diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml
index 261d7d06a1..5b7d2cd2fa 100644
--- a/.github/workflows/pypi-release.yml
+++ b/.github/workflows/pypi-release.yml
@@ -28,7 +28,7 @@ jobs:
         run: twine check dist/*
 
       - name: check PyPI versions
-        if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2.3'
+        if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')
         run: |
           pip install --upgrade requests
           python -c "\
diff --git a/docs/nodes/communityNodes.md b/docs/nodes/communityNodes.md
index 47ed407695..d5a5d5654f 100644
--- a/docs/nodes/communityNodes.md
+++ b/docs/nodes/communityNodes.md
@@ -8,28 +8,42 @@ To download a node, simply download the `.py` node file from the link and add it
 
 To use a community workflow, download the the `.json` node graph file and load it into Invoke AI via the **Load Workflow** button in the Workflow Editor. 
 
---------------------------------
+- Community Nodes
+    + [Depth Map from Wavefront OBJ](#depth-map-from-wavefront-obj)
+    + [Film Grain](#film-grain)
+    + [Generative Grammar-Based Prompt Nodes](#generative-grammar-based-prompt-nodes)
+    + [GPT2RandomPromptMaker](#gpt2randompromptmaker)
+    + [Grid to Gif](#grid-to-gif)
+    + [Halftone](#halftone)
+    + [Ideal Size](#ideal-size)
+    + [Image and Mask Composition Pack](#image-and-mask-composition-pack)
+    + [Image to Character Art Image Nodes](#image-to-character-art-image-nodes)
+    + [Image Picker](#image-picker)
+    + [Load Video Frame](#load-video-frame)
+    + [Make 3D](#make-3d)
+    + [Oobabooga](#oobabooga)
+    + [Prompt Tools](#prompt-tools)
+    + [Retroize](#retroize)
+    + [Size Stepper Nodes](#size-stepper-nodes)
+    + [Text font to Image](#text-font-to-image)
+    + [Thresholding](#thresholding)
+    + [XY Image to Grid and Images to Grids nodes](#xy-image-to-grid-and-images-to-grids-nodes)
+- [Example Node Template](#example-node-template)
+- [Disclaimer](#disclaimer)
+- [Help](#help)
+
 
 --------------------------------
-### Make 3D
+### Depth Map from Wavefront OBJ
 
-**Description:** Create compelling 3D stereo images from 2D originals.
+**Description:** Render depth maps from Wavefront .obj files (triangulated) using this simple 3D renderer utilizing numpy and matplotlib to compute and color the scene. There are simple parameters to change the FOV, camera position, and model orientation.
 
-**Node Link:** [https://gitlab.com/srcrr/shift3d/-/raw/main/make3d.py](https://gitlab.com/srcrr/shift3d)
+To be imported, an .obj must use triangulated meshes, so make sure to enable that option if exporting from a 3D modeling program. This renderer makes each triangle a solid color based on its average depth, so it will cause anomalies if your .obj has large triangles. In Blender, the Remesh modifier can be helpful to subdivide a mesh into small pieces that work well given these limitations.
 
-**Example Node Graph:**  https://gitlab.com/srcrr/shift3d/-/raw/main/example-workflow.json?ref_type=heads&inline=false
+**Node Link:** https://github.com/dwringer/depth-from-obj-node
 
-**Output Examples** 
-
-![Painting of a cozy delapidated house](https://gitlab.com/srcrr/shift3d/-/raw/main/example-1.png){: style="height:512px;width:512px"}
-![Photo of cute puppies](https://gitlab.com/srcrr/shift3d/-/raw/main/example-2.png){: style="height:512px;width:512px"}
-
---------------------------------
-### Ideal Size
-
-**Description:** This node calculates an ideal image size for a first pass of a multi-pass upscaling. The aim is to avoid duplication that results from choosing a size larger than the model is capable of.
-
-**Node Link:** https://github.com/JPPhoto/ideal-size-node
+**Example Usage:**
+</br><img src="https://raw.githubusercontent.com/dwringer/depth-from-obj-node/main/depth_from_obj_usage.jpg" width="500" />
 
 --------------------------------
 ### Film Grain
@@ -39,68 +53,19 @@ To use a community workflow, download the the `.json` node graph file and load i
 **Node Link:** https://github.com/JPPhoto/film-grain-node
 
 --------------------------------
-### Image Picker
+### Generative Grammar-Based Prompt Nodes
 
-**Description:** This InvokeAI node takes in a collection of images and randomly chooses one. This can be useful when you have a number of poses to choose from for a ControlNet node, or a number of input images for another purpose.
+**Description:** This set of 3 nodes generates prompts from simple user-defined grammar rules (loaded from custom files - examples provided below). The prompts are made by recursively expanding a special template string, replacing nonterminal "parts-of-speech" until no nonterminal terms remain in the string.
 
-**Node Link:** https://github.com/JPPhoto/image-picker-node
+This includes 3 Nodes:
+- *Lookup Table from File* - loads a YAML file "prompt" section (or of a whole folder of YAML's) into a JSON-ified dictionary (Lookups output)
+- *Lookups Entry from Prompt* - places a single entry in a new Lookups output under the specified heading
+- *Prompt from Lookup Table* - uses a Collection of Lookups as grammar rules from which to randomly generate prompts.
 
---------------------------------
-### Thresholding
+**Node Link:** https://github.com/dwringer/generative-grammar-prompt-nodes
 
-**Description:** This node generates masks for highlights, midtones, and shadows given an input image. You can optionally specify a blur for the lookup table used in making those masks from the source image.
-
-**Node Link:** https://github.com/JPPhoto/thresholding-node
-
-**Examples**
-
-Input:
-
-![image](https://github.com/invoke-ai/InvokeAI/assets/34005131/c88ada13-fb3d-484c-a4fe-947b44712632){: style="height:512px;width:512px"}
-
-Highlights/Midtones/Shadows:
-
-<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/727021c1-36ff-4ec8-90c8-105e00de986d" style="width: 30%" />
-<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/0b721bfc-f051-404e-b905-2f16b824ddfe" style="width: 30%" />
-<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/04c1297f-1c88-42b6-a7df-dd090b976286" style="width: 30%" />
-
-Highlights/Midtones/Shadows (with LUT blur enabled):
-
-<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/19aa718a-70c1-4668-8169-d68f4bd13771" style="width: 30%" />
-<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/0a440e43-697f-4d17-82ee-f287467df0a5" style="width: 30%" />
-<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/0701fd0f-2ca7-4fe2-8613-2b52547bafce" style="width: 30%" />
-
---------------------------------
-### Halftone
-
-**Description**: Halftone converts the source image to grayscale and then performs halftoning. CMYK Halftone converts the image to CMYK and applies a per-channel halftoning to make the source image look like a magazine or newspaper. For both nodes, you can specify angles and halftone dot spacing.
-
-**Node Link:** https://github.com/JPPhoto/halftone-node
-
-**Example**
-
-Input:
-
-![image](https://github.com/invoke-ai/InvokeAI/assets/34005131/fd5efb9f-4355-4409-a1c2-c1ca99e0cab4){: style="height:512px;width:512px"}
-
-Halftone Output:
-
-![image](https://github.com/invoke-ai/InvokeAI/assets/34005131/7e606f29-e68f-4d46-b3d5-97f799a4ec2f){: style="height:512px;width:512px"}
-
-CMYK Halftone Output:
-
-![image](https://github.com/invoke-ai/InvokeAI/assets/34005131/c59c578f-db8e-4d66-8c66-2851752d75ea){: style="height:512px;width:512px"}
-
---------------------------------
-### Retroize
-
-**Description:** Retroize is a collection of nodes for InvokeAI to "Retroize" images. Any image can be given a fresh coat of retro paint with these nodes, either from your gallery or from within the graph itself. It includes nodes to pixelize, quantize, palettize, and ditherize images; as well as to retrieve palettes from existing images.
-
-**Node Link:** https://github.com/Ar7ific1al/invokeai-retroizeinode/
-
-**Retroize Output Examples**
-
-![image](https://github.com/Ar7ific1al/InvokeAI_nodes_retroize/assets/2306586/de8b4fa6-324c-4c2d-b36c-297600c73974)
+**Example Usage:**
+</br><img src="https://raw.githubusercontent.com/dwringer/generative-grammar-prompt-nodes/main/lookuptables_usage.jpg" width="500" />
 
 --------------------------------
 ### GPT2RandomPromptMaker
@@ -113,76 +78,49 @@ CMYK Halftone Output:
 
 Generated Prompt: An enchanted weapon will be usable by any character regardless of their alignment.
 
-![9acf5aef-7254-40dd-95b3-8eac431dfab0 (1)](https://github.com/mickr777/InvokeAI/assets/115216705/8496ba09-bcdd-4ff7-8076-ff213b6a1e4c)
+<img src="https://github.com/mickr777/InvokeAI/assets/115216705/8496ba09-bcdd-4ff7-8076-ff213b6a1e4c" width="200" />
 
 --------------------------------
-### Load Video Frame
+### Grid to Gif
 
-**Description:** This is a video frame image provider + indexer/video creation nodes for hooking up to iterators and ranges and ControlNets and such for invokeAI node experimentation. Think animation + ControlNet outputs.
+**Description:** One node that turns a grid image into an image collection, one node that turns an image collection into a gif.
 
-**Node Link:** https://github.com/helix4u/load_video_frame
+**Node Link:** https://github.com/mildmisery/invokeai-GridToGifNode/blob/main/GridToGif.py
 
-**Example Node Graph:**  https://github.com/helix4u/load_video_frame/blob/main/Example_Workflow.json
+**Example Node Graph:**  https://github.com/mildmisery/invokeai-GridToGifNode/blob/main/Grid%20to%20Gif%20Example%20Workflow.json
 
-**Output Example:** 
+**Output Examples** 
 
-![Example animation](https://github.com/helix4u/load_video_frame/blob/main/testmp4_embed_converted.gif)
-[Full mp4 of Example Output test.mp4](https://github.com/helix4u/load_video_frame/blob/main/test.mp4)
+<img src="https://raw.githubusercontent.com/mildmisery/invokeai-GridToGifNode/main/input.png" width="300" />
+<img src="https://raw.githubusercontent.com/mildmisery/invokeai-GridToGifNode/main/output.gif" width="300" />
 
 --------------------------------
+### Halftone
 
-### Oobabooga
+**Description**: Halftone converts the source image to grayscale and then performs halftoning. CMYK Halftone converts the image to CMYK and applies a per-channel halftoning to make the source image look like a magazine or newspaper. For both nodes, you can specify angles and halftone dot spacing.
 
-**Description:** asks a local LLM running in Oobabooga's Text-Generation-Webui to write a prompt based on the user input.
+**Node Link:** https://github.com/JPPhoto/halftone-node
 
-**Link:** https://github.com/sammyf/oobabooga-node
+**Example**
 
+Input:
 
-**Example:**
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/fd5efb9f-4355-4409-a1c2-c1ca99e0cab4" width="300" />
 
-"describe a new mystical  creature in its natural environment"
+Halftone Output:
 
-*can return*
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/7e606f29-e68f-4d46-b3d5-97f799a4ec2f" width="300" />
 
-"The mystical creature I am describing to you is called the "Glimmerwing". It is a majestic, iridescent being that inhabits the depths of the most enchanted forests and glimmering lakes. Its body is covered in shimmering scales that reflect every color of the rainbow, and it has delicate, translucent wings that sparkle like diamonds in the sunlight. The Glimmerwing's home is a crystal-clear lake, surrounded by towering trees with leaves that shimmer like jewels. In this serene environment, the Glimmerwing spends its days swimming gracefully through the water, chasing schools of glittering fish and playing with the gentle ripples of the lake's surface.
-As the sun sets, the Glimmerwing perches on a branch of one of the trees, spreading its wings to catch the last rays of light. The creature's scales glow softly, casting a rainbow of colors across the forest floor. The Glimmerwing sings a haunting melody, its voice echoing through the stillness of the night air. Its song is said to have the power to heal the sick and bring peace to troubled souls. Those who are lucky enough to hear the Glimmerwing's song are forever changed by its beauty and grace."
+CMYK Halftone Output:
 
-![glimmerwing_small](https://github.com/sammyf/oobabooga-node/assets/42468608/cecdd820-93dd-4c35-abbf-607e001fb2ed)
-
-**Requirement**
-
-a Text-Generation-Webui instance (might work remotely too, but I never tried it) and obviously InvokeAI 3.x
-
-**Note**
-
-This node works best with SDXL models, especially as the style can be described independantly of the LLM's output.
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/c59c578f-db8e-4d66-8c66-2851752d75ea" width="300" />
 
 --------------------------------
-### Depth Map from Wavefront OBJ
+### Ideal Size
 
-**Description:** Render depth maps from Wavefront .obj files (triangulated) using this simple 3D renderer utilizing numpy and matplotlib to compute and color the scene. There are simple parameters to change the FOV, camera position, and model orientation.
+**Description:** This node calculates an ideal image size for a first pass of a multi-pass upscaling. The aim is to avoid duplication that results from choosing a size larger than the model is capable of.
 
-To be imported, an .obj must use triangulated meshes, so make sure to enable that option if exporting from a 3D modeling program. This renderer makes each triangle a solid color based on its average depth, so it will cause anomalies if your .obj has large triangles. In Blender, the Remesh modifier can be helpful to subdivide a mesh into small pieces that work well given these limitations.
-
-**Node Link:** https://github.com/dwringer/depth-from-obj-node
-
-**Example Usage:**
-![depth from obj usage graph](https://raw.githubusercontent.com/dwringer/depth-from-obj-node/main/depth_from_obj_usage.jpg)
-
---------------------------------
-### Generative Grammar-Based Prompt Nodes
-
-**Description:** This set of 3 nodes generates prompts from simple user-defined grammar rules (loaded from custom files - examples provided below). The prompts are made by recursively expanding a special template string, replacing nonterminal "parts-of-speech" until no more nonterminal terms remain in the string.
-
-This includes 3 Nodes:
-- *Lookup Table from File* - loads a YAML file "prompt" section (or of a whole folder of YAML's) into a JSON-ified dictionary (Lookups output)
-- *Lookups Entry from Prompt* - places a single entry in a new Lookups output under the specified heading
-- *Prompt from Lookup Table* - uses a Collection of Lookups as grammar rules from which to randomly generate prompts.
-
-**Node Link:** https://github.com/dwringer/generative-grammar-prompt-nodes
-
-**Example Usage:**
-![lookups usage example graph](https://raw.githubusercontent.com/dwringer/generative-grammar-prompt-nodes/main/lookuptables_usage.jpg)
+**Node Link:** https://github.com/JPPhoto/ideal-size-node
 
 --------------------------------
 ### Image and Mask Composition Pack
@@ -208,45 +146,88 @@ This includes 15 Nodes:
 - *Text Mask (simple 2D)* - create and position a white on black (or black on white) line of text using any font locally available to Invoke.
 
 **Node Link:** https://github.com/dwringer/composition-nodes
-
-**Nodes and Output Examples:**
-![composition nodes usage graph](https://raw.githubusercontent.com/dwringer/composition-nodes/main/composition_pack_overview.jpg)
+  
+</br><img src="https://raw.githubusercontent.com/dwringer/composition-nodes/main/composition_pack_overview.jpg" width="500" />
 
 --------------------------------
-### Size Stepper Nodes
+### Image to Character Art Image Nodes
 
-**Description:** This is a set of nodes for calculating the necessary size increments for doing upscaling workflows. Use the *Final Size & Orientation* node to enter your full size dimensions and orientation (portrait/landscape/random), then plug that and your initial generation dimensions into the *Ideal Size Stepper* and get 1, 2, or 3 intermediate pairs of dimensions for upscaling. Note this does not output the initial size or full size dimensions: the 1, 2, or 3 outputs of this node are only the intermediate sizes.
+**Description:** Group of nodes to convert an input image into ascii/unicode art Image
 
-A third node is included, *Random Switch (Integers)*, which is just a generic version of Final Size with no orientation selection.
-
-**Node Link:** https://github.com/dwringer/size-stepper-nodes
-
-**Example Usage:**
-![size stepper usage graph](https://raw.githubusercontent.com/dwringer/size-stepper-nodes/main/size_nodes_usage.jpg)
-
---------------------------------
-
-### Text font to Image
-
-**Description:** text font to text image node for InvokeAI, download a font to use (or if in font cache uses it from there), the text is always resized to the image size, but can control that with padding, optional 2nd line
-
-**Node Link:** https://github.com/mickr777/textfontimage
+**Node Link:** https://github.com/mickr777/imagetoasciiimage
 
 **Output Examples**
 
-![a3609d48-d9b7-41f0-b280-063d857986fb](https://github.com/mickr777/InvokeAI/assets/115216705/c21b0af3-d9c6-4c16-9152-846a23effd36)
-
-Results after using the depth controlnet
-
-![9133eabb-bcda-4326-831e-1b641228b178](https://github.com/mickr777/InvokeAI/assets/115216705/915f1a53-968e-43eb-aa61-07cd8f1a733a)
-![4f9a3fa8-9be9-4236-8a3e-fcec66decd2a](https://github.com/mickr777/InvokeAI/assets/115216705/821ef89e-8a60-44f5-b94e-471a9d8690cc)
-![babd69c4-9d60-4a55-a834-5e8397f62610](https://github.com/mickr777/InvokeAI/assets/115216705/2befcb6d-49f4-4bfd-b5fc-1fee19274f89)
+<img src="https://user-images.githubusercontent.com/115216705/271817646-8e061fcc-9a2c-4fa9-bcc7-c0f7b01e9056.png" width="300" /><img src="https://github.com/mickr777/imagetoasciiimage/assets/115216705/3c4990eb-2f42-46b9-90f9-0088b939dc6a" width="300" /></br>
+<img src="https://github.com/mickr777/imagetoasciiimage/assets/115216705/fee7f800-a4a8-41e2-a66b-c66e4343307e" width="300" />
+<img src="https://github.com/mickr777/imagetoasciiimage/assets/115216705/1d9c1003-a45f-45c2-aac7-46470bb89330" width="300" />
 
 --------------------------------
 
+### Image Picker
+
+**Description:** This InvokeAI node takes in a collection of images and randomly chooses one. This can be useful when you have a number of poses to choose from for a ControlNet node, or a number of input images for another purpose.
+
+**Node Link:** https://github.com/JPPhoto/image-picker-node
+
+--------------------------------
+### Load Video Frame
+
+**Description:** This is a video frame image provider + indexer/video creation nodes for hooking up to iterators and ranges and ControlNets and such for invokeAI node experimentation. Think animation + ControlNet outputs.
+
+**Node Link:** https://github.com/helix4u/load_video_frame
+
+**Example Node Graph:**  https://github.com/helix4u/load_video_frame/blob/main/Example_Workflow.json
+
+**Output Example:** 
+
+<img src="https://github.com/helix4u/load_video_frame/blob/main/testmp4_embed_converted.gif" width="500" />
+[Full mp4 of Example Output test.mp4](https://github.com/helix4u/load_video_frame/blob/main/test.mp4)
+
+--------------------------------
+### Make 3D
+
+**Description:** Create compelling 3D stereo images from 2D originals.
+
+**Node Link:** [https://gitlab.com/srcrr/shift3d/-/raw/main/make3d.py](https://gitlab.com/srcrr/shift3d)
+
+**Example Node Graph:**  https://gitlab.com/srcrr/shift3d/-/raw/main/example-workflow.json?ref_type=heads&inline=false
+
+**Output Examples** 
+
+<img src="https://gitlab.com/srcrr/shift3d/-/raw/main/example-1.png" width="300" />
+<img src="https://gitlab.com/srcrr/shift3d/-/raw/main/example-2.png" width="300" />
+
+--------------------------------
+### Oobabooga
+
+**Description:** asks a local LLM running in Oobabooga's Text-Generation-Webui to write a prompt based on the user input.
+
+**Link:** https://github.com/sammyf/oobabooga-node
+
+**Example:**
+
+"describe a new mystical  creature in its natural environment"
+
+*can return*
+
+"The mystical creature I am describing to you is called the "Glimmerwing". It is a majestic, iridescent being that inhabits the depths of the most enchanted forests and glimmering lakes. Its body is covered in shimmering scales that reflect every color of the rainbow, and it has delicate, translucent wings that sparkle like diamonds in the sunlight. The Glimmerwing's home is a crystal-clear lake, surrounded by towering trees with leaves that shimmer like jewels. In this serene environment, the Glimmerwing spends its days swimming gracefully through the water, chasing schools of glittering fish and playing with the gentle ripples of the lake's surface.
+As the sun sets, the Glimmerwing perches on a branch of one of the trees, spreading its wings to catch the last rays of light. The creature's scales glow softly, casting a rainbow of colors across the forest floor. The Glimmerwing sings a haunting melody, its voice echoing through the stillness of the night air. Its song is said to have the power to heal the sick and bring peace to troubled souls. Those who are lucky enough to hear the Glimmerwing's song are forever changed by its beauty and grace."
+
+<img src="https://github.com/sammyf/oobabooga-node/assets/42468608/cecdd820-93dd-4c35-abbf-607e001fb2ed" width="300" />
+
+**Requirement**
+
+a Text-Generation-Webui instance (might work remotely too, but I never tried it) and obviously InvokeAI 3.x
+
+**Note**
+
+This node works best with SDXL models, especially as the style can be described independently of the LLM's output.
+
+--------------------------------
 ### Prompt Tools 
 
-**Description:** A set of InvokeAI nodes that add general prompt manipulation tools.  These where written to accompany the PromptsFromFile node and other prompt generation nodes.
+**Description:** A set of InvokeAI nodes that add general prompt manipulation tools.  These were written to accompany the PromptsFromFile node and other prompt generation nodes.
 
 1. PromptJoin - Joins to prompts into one.
 2. PromptReplace - performs a search and replace on a prompt. With the option of using regex.
@@ -263,51 +244,83 @@ See full docs here: https://github.com/skunkworxdark/Prompt-tools-nodes/edit/mai
 **Node Link:** https://github.com/skunkworxdark/Prompt-tools-nodes
 
 --------------------------------
+### Retroize
 
+**Description:** Retroize is a collection of nodes for InvokeAI to "Retroize" images. Any image can be given a fresh coat of retro paint with these nodes, either from your gallery or from within the graph itself. It includes nodes to pixelize, quantize, palettize, and ditherize images; as well as to retrieve palettes from existing images.
+
+**Node Link:** https://github.com/Ar7ific1al/invokeai-retroizeinode/
+
+**Retroize Output Examples**
+
+<img src="https://github.com/Ar7ific1al/InvokeAI_nodes_retroize/assets/2306586/de8b4fa6-324c-4c2d-b36c-297600c73974" width="500" />
+
+--------------------------------
+### Size Stepper Nodes
+
+**Description:** This is a set of nodes for calculating the necessary size increments for doing upscaling workflows. Use the *Final Size & Orientation* node to enter your full size dimensions and orientation (portrait/landscape/random), then plug that and your initial generation dimensions into the *Ideal Size Stepper* and get 1, 2, or 3 intermediate pairs of dimensions for upscaling. Note this does not output the initial size or full size dimensions: the 1, 2, or 3 outputs of this node are only the intermediate sizes.
+
+A third node is included, *Random Switch (Integers)*, which is just a generic version of Final Size with no orientation selection.
+
+**Node Link:** https://github.com/dwringer/size-stepper-nodes
+
+**Example Usage:**
+</br><img src="https://raw.githubusercontent.com/dwringer/size-stepper-nodes/main/size_nodes_usage.jpg" width="500" />
+
+--------------------------------
+### Text font to Image
+
+**Description:** text font to text image node for InvokeAI, download a font to use (or if in font cache uses it from there), the text is always resized to the image size, but can control that with padding, optional 2nd line
+
+**Node Link:** https://github.com/mickr777/textfontimage
+
+**Output Examples**
+
+<img src="https://github.com/mickr777/InvokeAI/assets/115216705/c21b0af3-d9c6-4c16-9152-846a23effd36" width="300" />
+
+Results after using the depth controlnet
+
+<img src="https://github.com/mickr777/InvokeAI/assets/115216705/915f1a53-968e-43eb-aa61-07cd8f1a733a" width="300" />
+<img src="https://github.com/mickr777/InvokeAI/assets/115216705/821ef89e-8a60-44f5-b94e-471a9d8690cc" width="300" />
+<img src="https://github.com/mickr777/InvokeAI/assets/115216705/2befcb6d-49f4-4bfd-b5fc-1fee19274f89" width="300" />
+
+--------------------------------
+### Thresholding
+
+**Description:** This node generates masks for highlights, midtones, and shadows given an input image. You can optionally specify a blur for the lookup table used in making those masks from the source image.
+
+**Node Link:** https://github.com/JPPhoto/thresholding-node
+
+**Examples**
+
+Input:
+
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/c88ada13-fb3d-484c-a4fe-947b44712632" width="300" />
+
+Highlights/Midtones/Shadows:
+
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/727021c1-36ff-4ec8-90c8-105e00de986d" width="300" />
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/0b721bfc-f051-404e-b905-2f16b824ddfe" width="300" />
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/04c1297f-1c88-42b6-a7df-dd090b976286" width="300" />
+
+Highlights/Midtones/Shadows (with LUT blur enabled):
+
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/19aa718a-70c1-4668-8169-d68f4bd13771" width="300" />
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/0a440e43-697f-4d17-82ee-f287467df0a5" width="300" />
+<img src="https://github.com/invoke-ai/InvokeAI/assets/34005131/0701fd0f-2ca7-4fe2-8613-2b52547bafce" width="300" />
+
+--------------------------------
 ### XY Image to Grid and Images to Grids nodes
 
 **Description:** Image to grid nodes and supporting tools.
 
-1. "Images To Grids" node - Takes a collection of images and creates a grid(s) of images. If there are more images than the size of a single grid then mutilple grids will be created until it runs out of images.
-2. "XYImage To Grid" node - Converts a collection of XYImages into a labeled Grid of images.  The XYImages collection has to be built using the supporoting nodes. See example node setups for more details.
-   
+1. "Images To Grids" node - Takes a collection of images and creates a grid(s) of images. If there are more images than the size of a single grid then multiple grids will be created until it runs out of images.
+2. "XYImage To Grid" node - Converts a collection of XYImages into a labeled Grid of images. The XYImages collection has to be built using the supporting nodes. See example node setups for more details.
 
 See full docs here: https://github.com/skunkworxdark/XYGrid_nodes/edit/main/README.md
 
 **Node Link:** https://github.com/skunkworxdark/XYGrid_nodes
 
 --------------------------------
-
-### Image to Character Art Image Node's
-
-**Description:** Group of nodes to convert an input image into ascii/unicode art Image
-
-**Node Link:** https://github.com/mickr777/imagetoasciiimage
-
-**Output Examples**
-
-<img src="https://github.com/invoke-ai/InvokeAI/assets/115216705/8e061fcc-9a2c-4fa9-bcc7-c0f7b01e9056" width="300" />
-<img src="https://github.com/mickr777/imagetoasciiimage/assets/115216705/3c4990eb-2f42-46b9-90f9-0088b939dc6a" width="300" /></br>
-<img src="https://github.com/mickr777/imagetoasciiimage/assets/115216705/fee7f800-a4a8-41e2-a66b-c66e4343307e" width="300" />
-<img src="https://github.com/mickr777/imagetoasciiimage/assets/115216705/1d9c1003-a45f-45c2-aac7-46470bb89330" width="300" />
-
---------------------------------
-
-### Grid to Gif
-
-**Description:** One node that turns a grid image into an image colletion, one node that turns an image collection into a gif
-
-**Node Link:** https://github.com/mildmisery/invokeai-GridToGifNode/blob/main/GridToGif.py
-
-**Example Node Graph:**  https://github.com/mildmisery/invokeai-GridToGifNode/blob/main/Grid%20to%20Gif%20Example%20Workflow.json
-
-**Output Examples** 
-
-<img src="https://raw.githubusercontent.com/mildmisery/invokeai-GridToGifNode/main/input.png" width="300" />
-<img src="https://raw.githubusercontent.com/mildmisery/invokeai-GridToGifNode/main/output.gif" width="300" />
-
---------------------------------
-
 ### Example Node Template
 
 **Description:** This node allows you to do super cool things with InvokeAI.
@@ -318,7 +331,7 @@ See full docs here: https://github.com/skunkworxdark/XYGrid_nodes/edit/main/READ
 
 **Output Examples** 
 
-![Example Image](https://invoke-ai.github.io/InvokeAI/assets/invoke_ai_banner.png){: style="height:115px;width:240px"}
+</br><img src="https://invoke-ai.github.io/InvokeAI/assets/invoke_ai_banner.png" width="500" />
 
 
 ## Disclaimer
diff --git a/invokeai/app/api/dependencies.py b/invokeai/app/api/dependencies.py
index 9db35fb5c3..c9a2f0a843 100644
--- a/invokeai/app/api/dependencies.py
+++ b/invokeai/app/api/dependencies.py
@@ -1,35 +1,35 @@
 # Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
 
-import sqlite3
 from logging import Logger
 
-from invokeai.app.services.board_image_record_storage import SqliteBoardImageRecordStorage
-from invokeai.app.services.board_images import BoardImagesService, BoardImagesServiceDependencies
-from invokeai.app.services.board_record_storage import SqliteBoardRecordStorage
-from invokeai.app.services.boards import BoardService, BoardServiceDependencies
-from invokeai.app.services.config import InvokeAIAppConfig
-from invokeai.app.services.image_record_storage import SqliteImageRecordStorage
-from invokeai.app.services.images import ImageService, ImageServiceDependencies
-from invokeai.app.services.invocation_cache.invocation_cache_memory import MemoryInvocationCache
-from invokeai.app.services.resource_name import SimpleNameService
-from invokeai.app.services.session_processor.session_processor_default import DefaultSessionProcessor
-from invokeai.app.services.session_queue.session_queue_sqlite import SqliteSessionQueue
-from invokeai.app.services.urls import LocalUrlService
 from invokeai.backend.util.logging import InvokeAILogger
 from invokeai.version.invokeai_version import __version__
 
-from ..services.default_graphs import create_system_graphs
-from ..services.graph import GraphExecutionState, LibraryGraph
-from ..services.image_file_storage import DiskImageFileStorage
-from ..services.invocation_queue import MemoryInvocationQueue
+from ..services.board_image_records.board_image_records_sqlite import SqliteBoardImageRecordStorage
+from ..services.board_images.board_images_default import BoardImagesService
+from ..services.board_records.board_records_sqlite import SqliteBoardRecordStorage
+from ..services.boards.boards_default import BoardService
+from ..services.config import InvokeAIAppConfig
+from ..services.image_files.image_files_disk import DiskImageFileStorage
+from ..services.image_records.image_records_sqlite import SqliteImageRecordStorage
+from ..services.images.images_default import ImageService
+from ..services.invocation_cache.invocation_cache_memory import MemoryInvocationCache
+from ..services.invocation_processor.invocation_processor_default import DefaultInvocationProcessor
+from ..services.invocation_queue.invocation_queue_memory import MemoryInvocationQueue
 from ..services.invocation_services import InvocationServices
-from ..services.invocation_stats import InvocationStatsService
+from ..services.invocation_stats.invocation_stats_default import InvocationStatsService
 from ..services.invoker import Invoker
-from ..services.latent_storage import DiskLatentsStorage, ForwardCacheLatentsStorage
-from ..services.model_manager_service import ModelManagerService
-from ..services.processor import DefaultInvocationProcessor
-from ..services.sqlite import SqliteItemStorage
-from ..services.thread import lock
+from ..services.item_storage.item_storage_sqlite import SqliteItemStorage
+from ..services.latents_storage.latents_storage_disk import DiskLatentsStorage
+from ..services.latents_storage.latents_storage_forward_cache import ForwardCacheLatentsStorage
+from ..services.model_manager.model_manager_default import ModelManagerService
+from ..services.names.names_default import SimpleNameService
+from ..services.session_processor.session_processor_default import DefaultSessionProcessor
+from ..services.session_queue.session_queue_sqlite import SqliteSessionQueue
+from ..services.shared.default_graphs import create_system_graphs
+from ..services.shared.graph import GraphExecutionState, LibraryGraph
+from ..services.shared.sqlite import SqliteDatabase
+from ..services.urls.urls_default import LocalUrlService
 from .events import FastAPIEventService
 
 
@@ -63,100 +63,64 @@ class ApiDependencies:
         logger.info(f"Root directory = {str(config.root_path)}")
         logger.debug(f"Internet connectivity is {config.internet_available}")
 
-        events = FastAPIEventService(event_handler_id)
-
         output_folder = config.output_path
 
-        # TODO: build a file/path manager?
-        if config.use_memory_db:
-            db_location = ":memory:"
-        else:
-            db_path = config.db_path
-            db_path.parent.mkdir(parents=True, exist_ok=True)
-            db_location = str(db_path)
+        db = SqliteDatabase(config, logger)
 
-        logger.info(f"Using database at {db_location}")
-        db_conn = sqlite3.connect(db_location, check_same_thread=False)  # TODO: figure out a better threading solution
+        configuration = config
+        logger = logger
 
-        if config.log_sql:
-            db_conn.set_trace_callback(print)
-        db_conn.execute("PRAGMA foreign_keys = ON;")
-
-        graph_execution_manager = SqliteItemStorage[GraphExecutionState](
-            conn=db_conn, table_name="graph_executions", lock=lock
-        )
-
-        urls = LocalUrlService()
-        image_record_storage = SqliteImageRecordStorage(conn=db_conn, lock=lock)
-        image_file_storage = DiskImageFileStorage(f"{output_folder}/images")
-        names = SimpleNameService()
+        board_image_records = SqliteBoardImageRecordStorage(db=db)
+        board_images = BoardImagesService()
+        board_records = SqliteBoardRecordStorage(db=db)
+        boards = BoardService()
+        events = FastAPIEventService(event_handler_id)
+        graph_execution_manager = SqliteItemStorage[GraphExecutionState](db=db, table_name="graph_executions")
+        graph_library = SqliteItemStorage[LibraryGraph](db=db, table_name="graphs")
+        image_files = DiskImageFileStorage(f"{output_folder}/images")
+        image_records = SqliteImageRecordStorage(db=db)
+        images = ImageService()
+        invocation_cache = MemoryInvocationCache(max_cache_size=config.node_cache_size)
         latents = ForwardCacheLatentsStorage(DiskLatentsStorage(f"{output_folder}/latents"))
-
-        board_record_storage = SqliteBoardRecordStorage(conn=db_conn, lock=lock)
-        board_image_record_storage = SqliteBoardImageRecordStorage(conn=db_conn, lock=lock)
-
-        boards = BoardService(
-            services=BoardServiceDependencies(
-                board_image_record_storage=board_image_record_storage,
-                board_record_storage=board_record_storage,
-                image_record_storage=image_record_storage,
-                url=urls,
-                logger=logger,
-            )
-        )
-
-        board_images = BoardImagesService(
-            services=BoardImagesServiceDependencies(
-                board_image_record_storage=board_image_record_storage,
-                board_record_storage=board_record_storage,
-                image_record_storage=image_record_storage,
-                url=urls,
-                logger=logger,
-            )
-        )
-
-        images = ImageService(
-            services=ImageServiceDependencies(
-                board_image_record_storage=board_image_record_storage,
-                image_record_storage=image_record_storage,
-                image_file_storage=image_file_storage,
-                url=urls,
-                logger=logger,
-                names=names,
-                graph_execution_manager=graph_execution_manager,
-            )
-        )
+        model_manager = ModelManagerService(config, logger)
+        names = SimpleNameService()
+        performance_statistics = InvocationStatsService()
+        processor = DefaultInvocationProcessor()
+        queue = MemoryInvocationQueue()
+        session_processor = DefaultSessionProcessor()
+        session_queue = SqliteSessionQueue(db=db)
+        urls = LocalUrlService()
 
         services = InvocationServices(
-            model_manager=ModelManagerService(config, logger),
-            events=events,
-            latents=latents,
-            images=images,
-            boards=boards,
+            board_image_records=board_image_records,
             board_images=board_images,
-            queue=MemoryInvocationQueue(),
-            graph_library=SqliteItemStorage[LibraryGraph](conn=db_conn, lock=lock, table_name="graphs"),
+            board_records=board_records,
+            boards=boards,
+            configuration=configuration,
+            events=events,
             graph_execution_manager=graph_execution_manager,
-            processor=DefaultInvocationProcessor(),
-            configuration=config,
-            performance_statistics=InvocationStatsService(graph_execution_manager),
+            graph_library=graph_library,
+            image_files=image_files,
+            image_records=image_records,
+            images=images,
+            invocation_cache=invocation_cache,
+            latents=latents,
             logger=logger,
-            session_queue=SqliteSessionQueue(conn=db_conn, lock=lock),
-            session_processor=DefaultSessionProcessor(),
-            invocation_cache=MemoryInvocationCache(max_cache_size=config.node_cache_size),
+            model_manager=model_manager,
+            names=names,
+            performance_statistics=performance_statistics,
+            processor=processor,
+            queue=queue,
+            session_processor=session_processor,
+            session_queue=session_queue,
+            urls=urls,
         )
 
         create_system_graphs(services.graph_library)
 
         ApiDependencies.invoker = Invoker(services)
 
-        try:
-            lock.acquire()
-            db_conn.execute("VACUUM;")
-            db_conn.commit()
-            logger.info("Cleaned database")
-        finally:
-            lock.release()
+        db.clean()
 
     @staticmethod
     def shutdown():
diff --git a/invokeai/app/api/events.py b/invokeai/app/api/events.py
index 41414a9230..40dfdb2c71 100644
--- a/invokeai/app/api/events.py
+++ b/invokeai/app/api/events.py
@@ -7,7 +7,7 @@ from typing import Any
 
 from fastapi_events.dispatcher import dispatch
 
-from ..services.events import EventServiceBase
+from ..services.events.events_base import EventServiceBase
 
 
 class FastAPIEventService(EventServiceBase):
diff --git a/invokeai/app/api/routers/boards.py b/invokeai/app/api/routers/boards.py
index 630135f236..69f965da64 100644
--- a/invokeai/app/api/routers/boards.py
+++ b/invokeai/app/api/routers/boards.py
@@ -4,9 +4,9 @@ from fastapi import Body, HTTPException, Path, Query
 from fastapi.routing import APIRouter
 from pydantic import BaseModel, Field
 
-from invokeai.app.services.board_record_storage import BoardChanges
-from invokeai.app.services.image_record_storage import OffsetPaginatedResults
-from invokeai.app.services.models.board_record import BoardDTO
+from invokeai.app.services.board_records.board_records_common import BoardChanges
+from invokeai.app.services.boards.boards_common import BoardDTO
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
 
 from ..dependencies import ApiDependencies
 
diff --git a/invokeai/app/api/routers/images.py b/invokeai/app/api/routers/images.py
index 7e798a3658..43a72943ee 100644
--- a/invokeai/app/api/routers/images.py
+++ b/invokeai/app/api/routers/images.py
@@ -8,9 +8,9 @@ from PIL import Image
 from pydantic import BaseModel, Field
 
 from invokeai.app.invocations.metadata import ImageMetadata
-from invokeai.app.models.image import ImageCategory, ResourceOrigin
-from invokeai.app.services.image_record_storage import OffsetPaginatedResults
-from invokeai.app.services.models.image_record import ImageDTO, ImageRecordChanges, ImageUrlsDTO
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ImageRecordChanges, ResourceOrigin
+from invokeai.app.services.images.images_common import ImageDTO, ImageUrlsDTO
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
 
 from ..dependencies import ApiDependencies
 
@@ -42,7 +42,7 @@ async def upload_image(
     crop_visible: Optional[bool] = Query(default=False, description="Whether to crop the image"),
 ) -> ImageDTO:
     """Uploads an image"""
-    if not file.content_type.startswith("image"):
+    if not file.content_type or not file.content_type.startswith("image"):
         raise HTTPException(status_code=415, detail="Not an image")
 
     contents = await file.read()
@@ -322,3 +322,20 @@ async def unstar_images_in_list(
         return ImagesUpdatedFromListResult(updated_image_names=updated_image_names)
     except Exception:
         raise HTTPException(status_code=500, detail="Failed to unstar images")
+
+
+class ImagesDownloaded(BaseModel):
+    response: Optional[str] = Field(
+        description="If defined, the message to display to the user when images begin downloading"
+    )
+
+
+@images_router.post("/download", operation_id="download_images_from_list", response_model=ImagesDownloaded)
+async def download_images_from_list(
+    image_names: list[str] = Body(description="The list of names of images to download", embed=True),
+    board_id: Optional[str] = Body(
+        default=None, description="The board from which image should be downloaded from", embed=True
+    ),
+) -> ImagesDownloaded:
+    # return ImagesDownloaded(response="Your images are downloading")
+    raise HTTPException(status_code=501, detail="Endpoint is not yet implemented")
diff --git a/invokeai/app/api/routers/models.py b/invokeai/app/api/routers/models.py
index ebc40f5ce5..018f3af02b 100644
--- a/invokeai/app/api/routers/models.py
+++ b/invokeai/app/api/routers/models.py
@@ -2,11 +2,11 @@
 
 
 import pathlib
-from typing import List, Literal, Optional, Union
+from typing import Annotated, List, Literal, Optional, Union
 
 from fastapi import Body, Path, Query, Response
 from fastapi.routing import APIRouter
-from pydantic import BaseModel, parse_obj_as
+from pydantic import BaseModel, ConfigDict, Field, TypeAdapter
 from starlette.exceptions import HTTPException
 
 from invokeai.backend import BaseModelType, ModelType
@@ -23,8 +23,14 @@ from ..dependencies import ApiDependencies
 models_router = APIRouter(prefix="/v1/models", tags=["models"])
 
 UpdateModelResponse = Union[tuple(OPENAPI_MODEL_CONFIGS)]
+update_models_response_adapter = TypeAdapter(UpdateModelResponse)
+
 ImportModelResponse = Union[tuple(OPENAPI_MODEL_CONFIGS)]
+import_models_response_adapter = TypeAdapter(ImportModelResponse)
+
 ConvertModelResponse = Union[tuple(OPENAPI_MODEL_CONFIGS)]
+convert_models_response_adapter = TypeAdapter(ConvertModelResponse)
+
 MergeModelResponse = Union[tuple(OPENAPI_MODEL_CONFIGS)]
 ImportModelAttributes = Union[tuple(OPENAPI_MODEL_CONFIGS)]
 
@@ -32,6 +38,11 @@ ImportModelAttributes = Union[tuple(OPENAPI_MODEL_CONFIGS)]
 class ModelsList(BaseModel):
     models: list[Union[tuple(OPENAPI_MODEL_CONFIGS)]]
 
+    model_config = ConfigDict(use_enum_values=True)
+
+
+models_list_adapter = TypeAdapter(ModelsList)
+
 
 @models_router.get(
     "/",
@@ -49,7 +60,7 @@ async def list_models(
             models_raw.extend(ApiDependencies.invoker.services.model_manager.list_models(base_model, model_type))
     else:
         models_raw = ApiDependencies.invoker.services.model_manager.list_models(None, model_type)
-    models = parse_obj_as(ModelsList, {"models": models_raw})
+    models = models_list_adapter.validate_python({"models": models_raw})
     return models
 
 
@@ -105,11 +116,14 @@ async def update_model(
                 info.path = new_info.get("path")
 
         # replace empty string values with None/null to avoid phenomenon of vae: ''
-        info_dict = info.dict()
+        info_dict = info.model_dump()
         info_dict = {x: info_dict[x] if info_dict[x] else None for x in info_dict.keys()}
 
         ApiDependencies.invoker.services.model_manager.update_model(
-            model_name=model_name, base_model=base_model, model_type=model_type, model_attributes=info_dict
+            model_name=model_name,
+            base_model=base_model,
+            model_type=model_type,
+            model_attributes=info_dict,
         )
 
         model_raw = ApiDependencies.invoker.services.model_manager.list_model(
@@ -117,7 +131,7 @@ async def update_model(
             base_model=base_model,
             model_type=model_type,
         )
-        model_response = parse_obj_as(UpdateModelResponse, model_raw)
+        model_response = update_models_response_adapter.validate_python(model_raw)
     except ModelNotFoundException as e:
         raise HTTPException(status_code=404, detail=str(e))
     except ValueError as e:
@@ -152,13 +166,15 @@ async def import_model(
 ) -> ImportModelResponse:
     """Add a model using its local path, repo_id, or remote URL. Model characteristics will be probed and configured automatically"""
 
+    location = location.strip("\"' ")
     items_to_import = {location}
     prediction_types = {x.value: x for x in SchedulerPredictionType}
     logger = ApiDependencies.invoker.services.logger
 
     try:
         installed_models = ApiDependencies.invoker.services.model_manager.heuristic_import(
-            items_to_import=items_to_import, prediction_type_helper=lambda x: prediction_types.get(prediction_type)
+            items_to_import=items_to_import,
+            prediction_type_helper=lambda x: prediction_types.get(prediction_type),
         )
         info = installed_models.get(location)
 
@@ -170,7 +186,7 @@ async def import_model(
         model_raw = ApiDependencies.invoker.services.model_manager.list_model(
             model_name=info.name, base_model=info.base_model, model_type=info.model_type
         )
-        return parse_obj_as(ImportModelResponse, model_raw)
+        return import_models_response_adapter.validate_python(model_raw)
 
     except ModelNotFoundException as e:
         logger.error(str(e))
@@ -204,13 +220,18 @@ async def add_model(
 
     try:
         ApiDependencies.invoker.services.model_manager.add_model(
-            info.model_name, info.base_model, info.model_type, model_attributes=info.dict()
+            info.model_name,
+            info.base_model,
+            info.model_type,
+            model_attributes=info.model_dump(),
         )
         logger.info(f"Successfully added {info.model_name}")
         model_raw = ApiDependencies.invoker.services.model_manager.list_model(
-            model_name=info.model_name, base_model=info.base_model, model_type=info.model_type
+            model_name=info.model_name,
+            base_model=info.base_model,
+            model_type=info.model_type,
         )
-        return parse_obj_as(ImportModelResponse, model_raw)
+        return import_models_response_adapter.validate_python(model_raw)
     except ModelNotFoundException as e:
         logger.error(str(e))
         raise HTTPException(status_code=404, detail=str(e))
@@ -222,7 +243,10 @@ async def add_model(
 @models_router.delete(
     "/{base_model}/{model_type}/{model_name}",
     operation_id="del_model",
-    responses={204: {"description": "Model deleted successfully"}, 404: {"description": "Model not found"}},
+    responses={
+        204: {"description": "Model deleted successfully"},
+        404: {"description": "Model not found"},
+    },
     status_code=204,
     response_model=None,
 )
@@ -278,7 +302,7 @@ async def convert_model(
         model_raw = ApiDependencies.invoker.services.model_manager.list_model(
             model_name, base_model=base_model, model_type=model_type
         )
-        response = parse_obj_as(ConvertModelResponse, model_raw)
+        response = convert_models_response_adapter.validate_python(model_raw)
     except ModelNotFoundException as e:
         raise HTTPException(status_code=404, detail=f"Model '{model_name}' not found: {str(e)}")
     except ValueError as e:
@@ -301,7 +325,8 @@ async def search_for_models(
 ) -> List[pathlib.Path]:
     if not search_path.is_dir():
         raise HTTPException(
-            status_code=404, detail=f"The search path '{search_path}' does not exist or is not directory"
+            status_code=404,
+            detail=f"The search path '{search_path}' does not exist or is not directory",
         )
     return ApiDependencies.invoker.services.model_manager.search_for_models(search_path)
 
@@ -336,6 +361,26 @@ async def sync_to_config() -> bool:
     return True
 
 
+# There's some weird pydantic-fastapi behaviour that requires this to be a separate class
+# TODO: After a few updates, see if it works inside the route operation handler?
+class MergeModelsBody(BaseModel):
+    model_names: List[str] = Field(description="model name", min_length=2, max_length=3)
+    merged_model_name: Optional[str] = Field(description="Name of destination model")
+    alpha: Optional[float] = Field(description="Alpha weighting strength to apply to 2d and 3d models", default=0.5)
+    interp: Optional[MergeInterpolationMethod] = Field(description="Interpolation method")
+    force: Optional[bool] = Field(
+        description="Force merging of models created with different versions of diffusers",
+        default=False,
+    )
+
+    merge_dest_directory: Optional[str] = Field(
+        description="Save the merged model to the designated directory (with 'merged_model_name' appended)",
+        default=None,
+    )
+
+    model_config = ConfigDict(protected_namespaces=())
+
+
 @models_router.put(
     "/merge/{base_model}",
     operation_id="merge_models",
@@ -348,31 +393,23 @@ async def sync_to_config() -> bool:
     response_model=MergeModelResponse,
 )
 async def merge_models(
+    body: Annotated[MergeModelsBody, Body(description="Model configuration", embed=True)],
     base_model: BaseModelType = Path(description="Base model"),
-    model_names: List[str] = Body(description="model name", min_items=2, max_items=3),
-    merged_model_name: Optional[str] = Body(description="Name of destination model"),
-    alpha: Optional[float] = Body(description="Alpha weighting strength to apply to 2d and 3d models", default=0.5),
-    interp: Optional[MergeInterpolationMethod] = Body(description="Interpolation method"),
-    force: Optional[bool] = Body(
-        description="Force merging of models created with different versions of diffusers", default=False
-    ),
-    merge_dest_directory: Optional[str] = Body(
-        description="Save the merged model to the designated directory (with 'merged_model_name' appended)",
-        default=None,
-    ),
 ) -> MergeModelResponse:
     """Convert a checkpoint model into a diffusers model"""
     logger = ApiDependencies.invoker.services.logger
     try:
-        logger.info(f"Merging models: {model_names} into {merge_dest_directory or '<MODELS>'}/{merged_model_name}")
-        dest = pathlib.Path(merge_dest_directory) if merge_dest_directory else None
+        logger.info(
+            f"Merging models: {body.model_names} into {body.merge_dest_directory or '<MODELS>'}/{body.merged_model_name}"
+        )
+        dest = pathlib.Path(body.merge_dest_directory) if body.merge_dest_directory else None
         result = ApiDependencies.invoker.services.model_manager.merge_models(
-            model_names,
-            base_model,
-            merged_model_name=merged_model_name or "+".join(model_names),
-            alpha=alpha,
-            interp=interp,
-            force=force,
+            model_names=body.model_names,
+            base_model=base_model,
+            merged_model_name=body.merged_model_name or "+".join(body.model_names),
+            alpha=body.alpha,
+            interp=body.interp,
+            force=body.force,
             merge_dest_directory=dest,
         )
         model_raw = ApiDependencies.invoker.services.model_manager.list_model(
@@ -380,9 +417,12 @@ async def merge_models(
             base_model=base_model,
             model_type=ModelType.Main,
         )
-        response = parse_obj_as(ConvertModelResponse, model_raw)
+        response = convert_models_response_adapter.validate_python(model_raw)
     except ModelNotFoundException:
-        raise HTTPException(status_code=404, detail=f"One or more of the models '{model_names}' not found")
+        raise HTTPException(
+            status_code=404,
+            detail=f"One or more of the models '{body.model_names}' not found",
+        )
     except ValueError as e:
         raise HTTPException(status_code=400, detail=str(e))
     return response
diff --git a/invokeai/app/api/routers/session_queue.py b/invokeai/app/api/routers/session_queue.py
index fb2c98c9f1..7ecb0504a3 100644
--- a/invokeai/app/api/routers/session_queue.py
+++ b/invokeai/app/api/routers/session_queue.py
@@ -18,9 +18,9 @@ from invokeai.app.services.session_queue.session_queue_common import (
     SessionQueueItemDTO,
     SessionQueueStatus,
 )
-from invokeai.app.services.shared.models import CursorPaginatedResults
+from invokeai.app.services.shared.graph import Graph
+from invokeai.app.services.shared.pagination import CursorPaginatedResults
 
-from ...services.graph import Graph
 from ..dependencies import ApiDependencies
 
 session_queue_router = APIRouter(prefix="/v1/queue", tags=["queue"])
diff --git a/invokeai/app/api/routers/sessions.py b/invokeai/app/api/routers/sessions.py
index ac6313edce..fb850d0b2b 100644
--- a/invokeai/app/api/routers/sessions.py
+++ b/invokeai/app/api/routers/sessions.py
@@ -1,56 +1,50 @@
 # Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
 
-from typing import Annotated, Optional, Union
 
-from fastapi import Body, HTTPException, Path, Query, Response
+from fastapi import HTTPException, Path
 from fastapi.routing import APIRouter
-from pydantic.fields import Field
 
-# Importing * is bad karma but needed here for node detection
-from ...invocations import *  # noqa: F401 F403
-from ...invocations.baseinvocation import BaseInvocation
-from ...services.graph import Edge, EdgeConnection, Graph, GraphExecutionState, NodeAlreadyExecutedError
-from ...services.item_storage import PaginatedResults
+from ...services.shared.graph import GraphExecutionState
 from ..dependencies import ApiDependencies
 
 session_router = APIRouter(prefix="/v1/sessions", tags=["sessions"])
 
 
-@session_router.post(
-    "/",
-    operation_id="create_session",
-    responses={
-        200: {"model": GraphExecutionState},
-        400: {"description": "Invalid json"},
-    },
-    deprecated=True,
-)
-async def create_session(
-    queue_id: str = Query(default="", description="The id of the queue to associate the session with"),
-    graph: Optional[Graph] = Body(default=None, description="The graph to initialize the session with"),
-) -> GraphExecutionState:
-    """Creates a new session, optionally initializing it with an invocation graph"""
-    session = ApiDependencies.invoker.create_execution_state(queue_id=queue_id, graph=graph)
-    return session
+# @session_router.post(
+#     "/",
+#     operation_id="create_session",
+#     responses={
+#         200: {"model": GraphExecutionState},
+#         400: {"description": "Invalid json"},
+#     },
+#     deprecated=True,
+# )
+# async def create_session(
+#     queue_id: str = Query(default="", description="The id of the queue to associate the session with"),
+#     graph: Optional[Graph] = Body(default=None, description="The graph to initialize the session with"),
+# ) -> GraphExecutionState:
+#     """Creates a new session, optionally initializing it with an invocation graph"""
+#     session = ApiDependencies.invoker.create_execution_state(queue_id=queue_id, graph=graph)
+#     return session
 
 
-@session_router.get(
-    "/",
-    operation_id="list_sessions",
-    responses={200: {"model": PaginatedResults[GraphExecutionState]}},
-    deprecated=True,
-)
-async def list_sessions(
-    page: int = Query(default=0, description="The page of results to get"),
-    per_page: int = Query(default=10, description="The number of results per page"),
-    query: str = Query(default="", description="The query string to search for"),
-) -> PaginatedResults[GraphExecutionState]:
-    """Gets a list of sessions, optionally searching"""
-    if query == "":
-        result = ApiDependencies.invoker.services.graph_execution_manager.list(page, per_page)
-    else:
-        result = ApiDependencies.invoker.services.graph_execution_manager.search(query, page, per_page)
-    return result
+# @session_router.get(
+#     "/",
+#     operation_id="list_sessions",
+#     responses={200: {"model": PaginatedResults[GraphExecutionState]}},
+#     deprecated=True,
+# )
+# async def list_sessions(
+#     page: int = Query(default=0, description="The page of results to get"),
+#     per_page: int = Query(default=10, description="The number of results per page"),
+#     query: str = Query(default="", description="The query string to search for"),
+# ) -> PaginatedResults[GraphExecutionState]:
+#     """Gets a list of sessions, optionally searching"""
+#     if query == "":
+#         result = ApiDependencies.invoker.services.graph_execution_manager.list(page, per_page)
+#     else:
+#         result = ApiDependencies.invoker.services.graph_execution_manager.search(query, page, per_page)
+#     return result
 
 
 @session_router.get(
@@ -60,7 +54,6 @@ async def list_sessions(
         200: {"model": GraphExecutionState},
         404: {"description": "Session not found"},
     },
-    deprecated=True,
 )
 async def get_session(
     session_id: str = Path(description="The id of the session to get"),
@@ -73,211 +66,211 @@ async def get_session(
         return session
 
 
-@session_router.post(
-    "/{session_id}/nodes",
-    operation_id="add_node",
-    responses={
-        200: {"model": str},
-        400: {"description": "Invalid node or link"},
-        404: {"description": "Session not found"},
-    },
-    deprecated=True,
-)
-async def add_node(
-    session_id: str = Path(description="The id of the session"),
-    node: Annotated[Union[BaseInvocation.get_invocations()], Field(discriminator="type")] = Body(  # type: ignore
-        description="The node to add"
-    ),
-) -> str:
-    """Adds a node to the graph"""
-    session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
-    if session is None:
-        raise HTTPException(status_code=404)
+# @session_router.post(
+#     "/{session_id}/nodes",
+#     operation_id="add_node",
+#     responses={
+#         200: {"model": str},
+#         400: {"description": "Invalid node or link"},
+#         404: {"description": "Session not found"},
+#     },
+#     deprecated=True,
+# )
+# async def add_node(
+#     session_id: str = Path(description="The id of the session"),
+#     node: Annotated[Union[BaseInvocation.get_invocations()], Field(discriminator="type")] = Body(  # type: ignore
+#         description="The node to add"
+#     ),
+# ) -> str:
+#     """Adds a node to the graph"""
+#     session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
+#     if session is None:
+#         raise HTTPException(status_code=404)
 
-    try:
-        session.add_node(node)
-        ApiDependencies.invoker.services.graph_execution_manager.set(
-            session
-        )  # TODO: can this be done automatically, or add node through an API?
-        return session.id
-    except NodeAlreadyExecutedError:
-        raise HTTPException(status_code=400)
-    except IndexError:
-        raise HTTPException(status_code=400)
+#     try:
+#         session.add_node(node)
+#         ApiDependencies.invoker.services.graph_execution_manager.set(
+#             session
+#         )  # TODO: can this be done automatically, or add node through an API?
+#         return session.id
+#     except NodeAlreadyExecutedError:
+#         raise HTTPException(status_code=400)
+#     except IndexError:
+#         raise HTTPException(status_code=400)
 
 
-@session_router.put(
-    "/{session_id}/nodes/{node_path}",
-    operation_id="update_node",
-    responses={
-        200: {"model": GraphExecutionState},
-        400: {"description": "Invalid node or link"},
-        404: {"description": "Session not found"},
-    },
-    deprecated=True,
-)
-async def update_node(
-    session_id: str = Path(description="The id of the session"),
-    node_path: str = Path(description="The path to the node in the graph"),
-    node: Annotated[Union[BaseInvocation.get_invocations()], Field(discriminator="type")] = Body(  # type: ignore
-        description="The new node"
-    ),
-) -> GraphExecutionState:
-    """Updates a node in the graph and removes all linked edges"""
-    session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
-    if session is None:
-        raise HTTPException(status_code=404)
+# @session_router.put(
+#     "/{session_id}/nodes/{node_path}",
+#     operation_id="update_node",
+#     responses={
+#         200: {"model": GraphExecutionState},
+#         400: {"description": "Invalid node or link"},
+#         404: {"description": "Session not found"},
+#     },
+#     deprecated=True,
+# )
+# async def update_node(
+#     session_id: str = Path(description="The id of the session"),
+#     node_path: str = Path(description="The path to the node in the graph"),
+#     node: Annotated[Union[BaseInvocation.get_invocations()], Field(discriminator="type")] = Body(  # type: ignore
+#         description="The new node"
+#     ),
+# ) -> GraphExecutionState:
+#     """Updates a node in the graph and removes all linked edges"""
+#     session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
+#     if session is None:
+#         raise HTTPException(status_code=404)
 
-    try:
-        session.update_node(node_path, node)
-        ApiDependencies.invoker.services.graph_execution_manager.set(
-            session
-        )  # TODO: can this be done automatically, or add node through an API?
-        return session
-    except NodeAlreadyExecutedError:
-        raise HTTPException(status_code=400)
-    except IndexError:
-        raise HTTPException(status_code=400)
+#     try:
+#         session.update_node(node_path, node)
+#         ApiDependencies.invoker.services.graph_execution_manager.set(
+#             session
+#         )  # TODO: can this be done automatically, or add node through an API?
+#         return session
+#     except NodeAlreadyExecutedError:
+#         raise HTTPException(status_code=400)
+#     except IndexError:
+#         raise HTTPException(status_code=400)
 
 
-@session_router.delete(
-    "/{session_id}/nodes/{node_path}",
-    operation_id="delete_node",
-    responses={
-        200: {"model": GraphExecutionState},
-        400: {"description": "Invalid node or link"},
-        404: {"description": "Session not found"},
-    },
-    deprecated=True,
-)
-async def delete_node(
-    session_id: str = Path(description="The id of the session"),
-    node_path: str = Path(description="The path to the node to delete"),
-) -> GraphExecutionState:
-    """Deletes a node in the graph and removes all linked edges"""
-    session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
-    if session is None:
-        raise HTTPException(status_code=404)
+# @session_router.delete(
+#     "/{session_id}/nodes/{node_path}",
+#     operation_id="delete_node",
+#     responses={
+#         200: {"model": GraphExecutionState},
+#         400: {"description": "Invalid node or link"},
+#         404: {"description": "Session not found"},
+#     },
+#     deprecated=True,
+# )
+# async def delete_node(
+#     session_id: str = Path(description="The id of the session"),
+#     node_path: str = Path(description="The path to the node to delete"),
+# ) -> GraphExecutionState:
+#     """Deletes a node in the graph and removes all linked edges"""
+#     session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
+#     if session is None:
+#         raise HTTPException(status_code=404)
 
-    try:
-        session.delete_node(node_path)
-        ApiDependencies.invoker.services.graph_execution_manager.set(
-            session
-        )  # TODO: can this be done automatically, or add node through an API?
-        return session
-    except NodeAlreadyExecutedError:
-        raise HTTPException(status_code=400)
-    except IndexError:
-        raise HTTPException(status_code=400)
+#     try:
+#         session.delete_node(node_path)
+#         ApiDependencies.invoker.services.graph_execution_manager.set(
+#             session
+#         )  # TODO: can this be done automatically, or add node through an API?
+#         return session
+#     except NodeAlreadyExecutedError:
+#         raise HTTPException(status_code=400)
+#     except IndexError:
+#         raise HTTPException(status_code=400)
 
 
-@session_router.post(
-    "/{session_id}/edges",
-    operation_id="add_edge",
-    responses={
-        200: {"model": GraphExecutionState},
-        400: {"description": "Invalid node or link"},
-        404: {"description": "Session not found"},
-    },
-    deprecated=True,
-)
-async def add_edge(
-    session_id: str = Path(description="The id of the session"),
-    edge: Edge = Body(description="The edge to add"),
-) -> GraphExecutionState:
-    """Adds an edge to the graph"""
-    session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
-    if session is None:
-        raise HTTPException(status_code=404)
+# @session_router.post(
+#     "/{session_id}/edges",
+#     operation_id="add_edge",
+#     responses={
+#         200: {"model": GraphExecutionState},
+#         400: {"description": "Invalid node or link"},
+#         404: {"description": "Session not found"},
+#     },
+#     deprecated=True,
+# )
+# async def add_edge(
+#     session_id: str = Path(description="The id of the session"),
+#     edge: Edge = Body(description="The edge to add"),
+# ) -> GraphExecutionState:
+#     """Adds an edge to the graph"""
+#     session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
+#     if session is None:
+#         raise HTTPException(status_code=404)
 
-    try:
-        session.add_edge(edge)
-        ApiDependencies.invoker.services.graph_execution_manager.set(
-            session
-        )  # TODO: can this be done automatically, or add node through an API?
-        return session
-    except NodeAlreadyExecutedError:
-        raise HTTPException(status_code=400)
-    except IndexError:
-        raise HTTPException(status_code=400)
+#     try:
+#         session.add_edge(edge)
+#         ApiDependencies.invoker.services.graph_execution_manager.set(
+#             session
+#         )  # TODO: can this be done automatically, or add node through an API?
+#         return session
+#     except NodeAlreadyExecutedError:
+#         raise HTTPException(status_code=400)
+#     except IndexError:
+#         raise HTTPException(status_code=400)
 
 
-# TODO: the edge being in the path here is really ugly, find a better solution
-@session_router.delete(
-    "/{session_id}/edges/{from_node_id}/{from_field}/{to_node_id}/{to_field}",
-    operation_id="delete_edge",
-    responses={
-        200: {"model": GraphExecutionState},
-        400: {"description": "Invalid node or link"},
-        404: {"description": "Session not found"},
-    },
-    deprecated=True,
-)
-async def delete_edge(
-    session_id: str = Path(description="The id of the session"),
-    from_node_id: str = Path(description="The id of the node the edge is coming from"),
-    from_field: str = Path(description="The field of the node the edge is coming from"),
-    to_node_id: str = Path(description="The id of the node the edge is going to"),
-    to_field: str = Path(description="The field of the node the edge is going to"),
-) -> GraphExecutionState:
-    """Deletes an edge from the graph"""
-    session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
-    if session is None:
-        raise HTTPException(status_code=404)
+# # TODO: the edge being in the path here is really ugly, find a better solution
+# @session_router.delete(
+#     "/{session_id}/edges/{from_node_id}/{from_field}/{to_node_id}/{to_field}",
+#     operation_id="delete_edge",
+#     responses={
+#         200: {"model": GraphExecutionState},
+#         400: {"description": "Invalid node or link"},
+#         404: {"description": "Session not found"},
+#     },
+#     deprecated=True,
+# )
+# async def delete_edge(
+#     session_id: str = Path(description="The id of the session"),
+#     from_node_id: str = Path(description="The id of the node the edge is coming from"),
+#     from_field: str = Path(description="The field of the node the edge is coming from"),
+#     to_node_id: str = Path(description="The id of the node the edge is going to"),
+#     to_field: str = Path(description="The field of the node the edge is going to"),
+# ) -> GraphExecutionState:
+#     """Deletes an edge from the graph"""
+#     session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
+#     if session is None:
+#         raise HTTPException(status_code=404)
 
-    try:
-        edge = Edge(
-            source=EdgeConnection(node_id=from_node_id, field=from_field),
-            destination=EdgeConnection(node_id=to_node_id, field=to_field),
-        )
-        session.delete_edge(edge)
-        ApiDependencies.invoker.services.graph_execution_manager.set(
-            session
-        )  # TODO: can this be done automatically, or add node through an API?
-        return session
-    except NodeAlreadyExecutedError:
-        raise HTTPException(status_code=400)
-    except IndexError:
-        raise HTTPException(status_code=400)
+#     try:
+#         edge = Edge(
+#             source=EdgeConnection(node_id=from_node_id, field=from_field),
+#             destination=EdgeConnection(node_id=to_node_id, field=to_field),
+#         )
+#         session.delete_edge(edge)
+#         ApiDependencies.invoker.services.graph_execution_manager.set(
+#             session
+#         )  # TODO: can this be done automatically, or add node through an API?
+#         return session
+#     except NodeAlreadyExecutedError:
+#         raise HTTPException(status_code=400)
+#     except IndexError:
+#         raise HTTPException(status_code=400)
 
 
-@session_router.put(
-    "/{session_id}/invoke",
-    operation_id="invoke_session",
-    responses={
-        200: {"model": None},
-        202: {"description": "The invocation is queued"},
-        400: {"description": "The session has no invocations ready to invoke"},
-        404: {"description": "Session not found"},
-    },
-    deprecated=True,
-)
-async def invoke_session(
-    queue_id: str = Query(description="The id of the queue to associate the session with"),
-    session_id: str = Path(description="The id of the session to invoke"),
-    all: bool = Query(default=False, description="Whether or not to invoke all remaining invocations"),
-) -> Response:
-    """Invokes a session"""
-    session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
-    if session is None:
-        raise HTTPException(status_code=404)
+# @session_router.put(
+#     "/{session_id}/invoke",
+#     operation_id="invoke_session",
+#     responses={
+#         200: {"model": None},
+#         202: {"description": "The invocation is queued"},
+#         400: {"description": "The session has no invocations ready to invoke"},
+#         404: {"description": "Session not found"},
+#     },
+#     deprecated=True,
+# )
+# async def invoke_session(
+#     queue_id: str = Query(description="The id of the queue to associate the session with"),
+#     session_id: str = Path(description="The id of the session to invoke"),
+#     all: bool = Query(default=False, description="Whether or not to invoke all remaining invocations"),
+# ) -> Response:
+#     """Invokes a session"""
+#     session = ApiDependencies.invoker.services.graph_execution_manager.get(session_id)
+#     if session is None:
+#         raise HTTPException(status_code=404)
 
-    if session.is_complete():
-        raise HTTPException(status_code=400)
+#     if session.is_complete():
+#         raise HTTPException(status_code=400)
 
-    ApiDependencies.invoker.invoke(queue_id, session, invoke_all=all)
-    return Response(status_code=202)
+#     ApiDependencies.invoker.invoke(queue_id, session, invoke_all=all)
+#     return Response(status_code=202)
 
 
-@session_router.delete(
-    "/{session_id}/invoke",
-    operation_id="cancel_session_invoke",
-    responses={202: {"description": "The invocation is canceled"}},
-    deprecated=True,
-)
-async def cancel_session_invoke(
-    session_id: str = Path(description="The id of the session to cancel"),
-) -> Response:
-    """Invokes a session"""
-    ApiDependencies.invoker.cancel(session_id)
-    return Response(status_code=202)
+# @session_router.delete(
+#     "/{session_id}/invoke",
+#     operation_id="cancel_session_invoke",
+#     responses={202: {"description": "The invocation is canceled"}},
+#     deprecated=True,
+# )
+# async def cancel_session_invoke(
+#     session_id: str = Path(description="The id of the session to cancel"),
+# ) -> Response:
+#     """Invokes a session"""
+#     ApiDependencies.invoker.cancel(session_id)
+#     return Response(status_code=202)
diff --git a/invokeai/app/api/routers/utilities.py b/invokeai/app/api/routers/utilities.py
index e664cb9070..476d10e2c0 100644
--- a/invokeai/app/api/routers/utilities.py
+++ b/invokeai/app/api/routers/utilities.py
@@ -1,4 +1,4 @@
-from typing import Optional
+from typing import Optional, Union
 
 from dynamicprompts.generators import CombinatorialPromptGenerator, RandomPromptGenerator
 from fastapi import Body
@@ -27,6 +27,7 @@ async def parse_dynamicprompts(
     combinatorial: bool = Body(default=True, description="Whether to use the combinatorial generator"),
 ) -> DynamicPromptsResponse:
     """Creates a batch process"""
+    generator: Union[RandomPromptGenerator, CombinatorialPromptGenerator]
     try:
         error: Optional[str] = None
         if combinatorial:
diff --git a/invokeai/app/api/sockets.py b/invokeai/app/api/sockets.py
index ae699f35ef..5725901de0 100644
--- a/invokeai/app/api/sockets.py
+++ b/invokeai/app/api/sockets.py
@@ -5,7 +5,7 @@ from fastapi_events.handlers.local import local_handler
 from fastapi_events.typing import Event
 from socketio import ASGIApp, AsyncServer
 
-from ..services.events import EventServiceBase
+from ..services.events.events_base import EventServiceBase
 
 
 class SocketIO:
@@ -30,8 +30,8 @@ class SocketIO:
 
     async def _handle_sub_queue(self, sid, data, *args, **kwargs):
         if "queue_id" in data:
-            self.__sio.enter_room(sid, data["queue_id"])
+            await self.__sio.enter_room(sid, data["queue_id"])
 
     async def _handle_unsub_queue(self, sid, data, *args, **kwargs):
         if "queue_id" in data:
-            self.__sio.enter_room(sid, data["queue_id"])
+            await self.__sio.enter_room(sid, data["queue_id"])
diff --git a/invokeai/app/api_app.py b/invokeai/app/api_app.py
index fdbd64b30d..e07b037dd1 100644
--- a/invokeai/app/api_app.py
+++ b/invokeai/app/api_app.py
@@ -22,7 +22,7 @@ if True:  # hack to make flake8 happy with imports coming after setting up the c
     from fastapi.staticfiles import StaticFiles
     from fastapi_events.handlers.local import local_handler
     from fastapi_events.middleware import EventHandlerASGIMiddleware
-    from pydantic.schema import schema
+    from pydantic.json_schema import models_json_schema
 
     # noinspection PyUnresolvedReferences
     import invokeai.backend.util.hotfixes  # noqa: F401 (monkeypatching on import)
@@ -51,7 +51,7 @@ mimetypes.add_type("text/css", ".css")
 
 # Create the app
 # TODO: create this all in a method so configuration/etc. can be passed in?
-app = FastAPI(title="Invoke AI", docs_url=None, redoc_url=None)
+app = FastAPI(title="Invoke AI", docs_url=None, redoc_url=None, separate_input_output_schemas=False)
 
 # Add event handler
 event_handler_id: int = id(app)
@@ -63,18 +63,18 @@ app.add_middleware(
 
 socket_io = SocketIO(app)
 
+app.add_middleware(
+    CORSMiddleware,
+    allow_origins=app_config.allow_origins,
+    allow_credentials=app_config.allow_credentials,
+    allow_methods=app_config.allow_methods,
+    allow_headers=app_config.allow_headers,
+)
+
 
 # Add startup event to load dependencies
 @app.on_event("startup")
 async def startup_event():
-    app.add_middleware(
-        CORSMiddleware,
-        allow_origins=app_config.allow_origins,
-        allow_credentials=app_config.allow_credentials,
-        allow_methods=app_config.allow_methods,
-        allow_headers=app_config.allow_headers,
-    )
-
     ApiDependencies.initialize(config=app_config, event_handler_id=event_handler_id, logger=logger)
 
 
@@ -85,11 +85,6 @@ async def shutdown_event():
 
 
 # Include all routers
-# TODO: REMOVE
-# app.include_router(
-#     invocation.invocation_router,
-#     prefix = '/api')
-
 app.include_router(sessions.session_router, prefix="/api")
 
 app.include_router(utilities.utilities_router, prefix="/api")
@@ -117,6 +112,7 @@ def custom_openapi():
         description="An API for invoking AI image operations",
         version="1.0.0",
         routes=app.routes,
+        separate_input_output_schemas=False,  # https://fastapi.tiangolo.com/how-to/separate-openapi-schemas/
     )
 
     # Add all outputs
@@ -127,29 +123,32 @@ def custom_openapi():
         output_type = signature(invoker.invoke).return_annotation
         output_types.add(output_type)
 
-    output_schemas = schema(output_types, ref_prefix="#/components/schemas/")
-    for schema_key, output_schema in output_schemas["definitions"].items():
-        output_schema["class"] = "output"
-        openapi_schema["components"]["schemas"][schema_key] = output_schema
-
+    output_schemas = models_json_schema(
+        models=[(o, "serialization") for o in output_types], ref_template="#/components/schemas/{model}"
+    )
+    for schema_key, output_schema in output_schemas[1]["$defs"].items():
         # TODO: note that we assume the schema_key here is the TYPE.__name__
         # This could break in some cases, figure out a better way to do it
         output_type_titles[schema_key] = output_schema["title"]
 
     # Add Node Editor UI helper schemas
-    ui_config_schemas = schema([UIConfigBase, _InputField, _OutputField], ref_prefix="#/components/schemas/")
-    for schema_key, ui_config_schema in ui_config_schemas["definitions"].items():
+    ui_config_schemas = models_json_schema(
+        [(UIConfigBase, "serialization"), (_InputField, "serialization"), (_OutputField, "serialization")],
+        ref_template="#/components/schemas/{model}",
+    )
+    for schema_key, ui_config_schema in ui_config_schemas[1]["$defs"].items():
         openapi_schema["components"]["schemas"][schema_key] = ui_config_schema
 
     # Add a reference to the output type to additionalProperties of the invoker schema
     for invoker in all_invocations:
         invoker_name = invoker.__name__
-        output_type = signature(invoker.invoke).return_annotation
+        output_type = signature(obj=invoker.invoke).return_annotation
         output_type_title = output_type_titles[output_type.__name__]
-        invoker_schema = openapi_schema["components"]["schemas"][invoker_name]
+        invoker_schema = openapi_schema["components"]["schemas"][f"{invoker_name}"]
         outputs_ref = {"$ref": f"#/components/schemas/{output_type_title}"}
         invoker_schema["output"] = outputs_ref
         invoker_schema["class"] = "invocation"
+        openapi_schema["components"]["schemas"][f"{output_type_title}"]["class"] = "output"
 
     from invokeai.backend.model_management.models import get_model_config_enums
 
@@ -172,7 +171,7 @@ def custom_openapi():
     return app.openapi_schema
 
 
-app.openapi = custom_openapi
+app.openapi = custom_openapi  # type: ignore [method-assign] # this is a valid assignment
 
 # Override API doc favicons
 app.mount("/static", StaticFiles(directory=Path(web_dir.__path__[0], "static/dream_web")), name="static")
diff --git a/invokeai/app/cli/commands.py b/invokeai/app/cli/commands.py
index b000abcf6a..c21c6315ed 100644
--- a/invokeai/app/cli/commands.py
+++ b/invokeai/app/cli/commands.py
@@ -24,8 +24,8 @@ def add_field_argument(command_parser, name: str, field, default_override=None):
         if field.default_factory is None
         else field.default_factory()
     )
-    if get_origin(field.type_) == Literal:
-        allowed_values = get_args(field.type_)
+    if get_origin(field.annotation) == Literal:
+        allowed_values = get_args(field.annotation)
         allowed_types = set()
         for val in allowed_values:
             allowed_types.add(type(val))
@@ -38,15 +38,15 @@ def add_field_argument(command_parser, name: str, field, default_override=None):
             type=field_type,
             default=default,
             choices=allowed_values,
-            help=field.field_info.description,
+            help=field.description,
         )
     else:
         command_parser.add_argument(
             f"--{name}",
             dest=name,
-            type=field.type_,
+            type=field.annotation,
             default=default,
-            help=field.field_info.description,
+            help=field.description,
         )
 
 
@@ -142,7 +142,6 @@ class BaseCommand(ABC, BaseModel):
     """A CLI command"""
 
     # All commands must include a type name like this:
-    # type: Literal['your_command_name'] = 'your_command_name'
 
     @classmethod
     def get_all_subclasses(cls):
diff --git a/invokeai/app/invocations/baseinvocation.py b/invokeai/app/invocations/baseinvocation.py
index 71af414f5b..cdbcc05226 100644
--- a/invokeai/app/invocations/baseinvocation.py
+++ b/invokeai/app/invocations/baseinvocation.py
@@ -7,28 +7,16 @@ import re
 from abc import ABC, abstractmethod
 from enum import Enum
 from inspect import signature
-from typing import (
-    TYPE_CHECKING,
-    AbstractSet,
-    Any,
-    Callable,
-    ClassVar,
-    Literal,
-    Mapping,
-    Optional,
-    Type,
-    TypeVar,
-    Union,
-    get_args,
-    get_type_hints,
-)
+from types import UnionType
+from typing import TYPE_CHECKING, Any, Callable, ClassVar, Iterable, Literal, Optional, Type, TypeVar, Union
 
 import semver
-from pydantic import BaseModel, Field, validator
-from pydantic.fields import ModelField, Undefined
-from pydantic.typing import NoArgAnyCallable
+from pydantic import BaseModel, ConfigDict, Field, create_model, field_validator
+from pydantic.fields import _Unset
+from pydantic_core import PydanticUndefined
 
-from invokeai.app.services.config.invokeai_config import InvokeAIAppConfig
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.app.util.misc import uuid_string
 
 if TYPE_CHECKING:
     from ..services.invocation_services import InvocationServices
@@ -215,6 +203,11 @@ class _InputField(BaseModel):
     ui_choice_labels: Optional[dict[str, str]]
     item_default: Optional[Any]
 
+    model_config = ConfigDict(
+        validate_assignment=True,
+        json_schema_serialization_defaults_required=True,
+    )
+
 
 class _OutputField(BaseModel):
     """
@@ -228,34 +221,36 @@ class _OutputField(BaseModel):
     ui_type: Optional[UIType]
     ui_order: Optional[int]
 
+    model_config = ConfigDict(
+        validate_assignment=True,
+        json_schema_serialization_defaults_required=True,
+    )
+
+
+def get_type(klass: BaseModel) -> str:
+    """Helper function to get an invocation or invocation output's type. This is the default value of the `type` field."""
+    return klass.model_fields["type"].default
+
 
 def InputField(
-    *args: Any,
-    default: Any = Undefined,
-    default_factory: Optional[NoArgAnyCallable] = None,
-    alias: Optional[str] = None,
-    title: Optional[str] = None,
-    description: Optional[str] = None,
-    exclude: Optional[Union[AbstractSet[Union[int, str]], Mapping[Union[int, str], Any], Any]] = None,
-    include: Optional[Union[AbstractSet[Union[int, str]], Mapping[Union[int, str], Any], Any]] = None,
-    const: Optional[bool] = None,
-    gt: Optional[float] = None,
-    ge: Optional[float] = None,
-    lt: Optional[float] = None,
-    le: Optional[float] = None,
-    multiple_of: Optional[float] = None,
-    allow_inf_nan: Optional[bool] = None,
-    max_digits: Optional[int] = None,
-    decimal_places: Optional[int] = None,
-    min_items: Optional[int] = None,
-    max_items: Optional[int] = None,
-    unique_items: Optional[bool] = None,
-    min_length: Optional[int] = None,
-    max_length: Optional[int] = None,
-    allow_mutation: bool = True,
-    regex: Optional[str] = None,
-    discriminator: Optional[str] = None,
-    repr: bool = True,
+    # copied from pydantic's Field
+    default: Any = _Unset,
+    default_factory: Callable[[], Any] | None = _Unset,
+    title: str | None = _Unset,
+    description: str | None = _Unset,
+    pattern: str | None = _Unset,
+    strict: bool | None = _Unset,
+    gt: float | None = _Unset,
+    ge: float | None = _Unset,
+    lt: float | None = _Unset,
+    le: float | None = _Unset,
+    multiple_of: float | None = _Unset,
+    allow_inf_nan: bool | None = _Unset,
+    max_digits: int | None = _Unset,
+    decimal_places: int | None = _Unset,
+    min_length: int | None = _Unset,
+    max_length: int | None = _Unset,
+    # custom
     input: Input = Input.Any,
     ui_type: Optional[UIType] = None,
     ui_component: Optional[UIComponent] = None,
@@ -263,7 +258,6 @@ def InputField(
     ui_order: Optional[int] = None,
     ui_choice_labels: Optional[dict[str, str]] = None,
     item_default: Optional[Any] = None,
-    **kwargs: Any,
 ) -> Any:
     """
     Creates an input field for an invocation.
@@ -293,18 +287,26 @@ def InputField(
     : param int ui_order: [None] Specifies the order in which this field should be rendered in the UI. \
 
     : param bool item_default: [None] Specifies the default item value, if this is a collection input. \
-      Ignored for non-collection fields..
+      Ignored for non-collection fields.
     """
-    return Field(
-        *args,
+
+    json_schema_extra_: dict[str, Any] = dict(
+        input=input,
+        ui_type=ui_type,
+        ui_component=ui_component,
+        ui_hidden=ui_hidden,
+        ui_order=ui_order,
+        item_default=item_default,
+        ui_choice_labels=ui_choice_labels,
+    )
+
+    field_args = dict(
         default=default,
         default_factory=default_factory,
-        alias=alias,
         title=title,
         description=description,
-        exclude=exclude,
-        include=include,
-        const=const,
+        pattern=pattern,
+        strict=strict,
         gt=gt,
         ge=ge,
         lt=lt,
@@ -313,57 +315,92 @@ def InputField(
         allow_inf_nan=allow_inf_nan,
         max_digits=max_digits,
         decimal_places=decimal_places,
-        min_items=min_items,
-        max_items=max_items,
-        unique_items=unique_items,
         min_length=min_length,
         max_length=max_length,
-        allow_mutation=allow_mutation,
-        regex=regex,
-        discriminator=discriminator,
-        repr=repr,
-        input=input,
-        ui_type=ui_type,
-        ui_component=ui_component,
-        ui_hidden=ui_hidden,
-        ui_order=ui_order,
-        item_default=item_default,
-        ui_choice_labels=ui_choice_labels,
-        **kwargs,
+    )
+
+    """
+    Invocation definitions have their fields typed correctly for their `invoke()` functions.
+    This typing is often more specific than the actual invocation definition requires, because
+    fields may have values provided only by connections.
+
+    For example, consider an ResizeImageInvocation with an `image: ImageField` field.
+
+    `image` is required during the call to `invoke()`, but when the python class is instantiated,
+    the field may not be present. This is fine, because that image field will be provided by a
+    an ancestor node that outputs the image.
+
+    So we'd like to type that `image` field as `Optional[ImageField]`. If we do that, however, then
+    we need to handle a lot of extra logic in the `invoke()` function to check if the field has a
+    value or not. This is very tedious.
+
+    Ideally, the invocation definition would be able to specify that the field is required during
+    invocation, but optional during instantiation. So the field would be typed as `image: ImageField`,
+    but when calling the `invoke()` function, we raise an error if the field is not present.
+
+    To do this, we need to do a bit of fanagling to make the pydantic field optional, and then do
+    extra validation when calling `invoke()`.
+
+    There is some additional logic here to cleaning create the pydantic field via the wrapper.
+    """
+
+    # Filter out field args not provided
+    provided_args = {k: v for (k, v) in field_args.items() if v is not PydanticUndefined}
+
+    if (default is not PydanticUndefined) and (default_factory is not PydanticUndefined):
+        raise ValueError("Cannot specify both default and default_factory")
+
+    # because we are manually making fields optional, we need to store the original required bool for reference later
+    if default is PydanticUndefined and default_factory is PydanticUndefined:
+        json_schema_extra_.update(dict(orig_required=True))
+    else:
+        json_schema_extra_.update(dict(orig_required=False))
+
+    # make Input.Any and Input.Connection fields optional, providing None as a default if the field doesn't already have one
+    if (input is Input.Any or input is Input.Connection) and default_factory is PydanticUndefined:
+        default_ = None if default is PydanticUndefined else default
+        provided_args.update(dict(default=default_))
+        if default is not PydanticUndefined:
+            # before invoking, we'll grab the original default value and set it on the field if the field wasn't provided a value
+            json_schema_extra_.update(dict(default=default))
+            json_schema_extra_.update(dict(orig_default=default))
+    elif default is not PydanticUndefined and default_factory is PydanticUndefined:
+        default_ = default
+        provided_args.update(dict(default=default_))
+        json_schema_extra_.update(dict(orig_default=default_))
+    elif default_factory is not PydanticUndefined:
+        provided_args.update(dict(default_factory=default_factory))
+        # TODO: cannot serialize default_factory...
+        # json_schema_extra_.update(dict(orig_default_factory=default_factory))
+
+    return Field(
+        **provided_args,
+        json_schema_extra=json_schema_extra_,
     )
 
 
 def OutputField(
-    *args: Any,
-    default: Any = Undefined,
-    default_factory: Optional[NoArgAnyCallable] = None,
-    alias: Optional[str] = None,
-    title: Optional[str] = None,
-    description: Optional[str] = None,
-    exclude: Optional[Union[AbstractSet[Union[int, str]], Mapping[Union[int, str], Any], Any]] = None,
-    include: Optional[Union[AbstractSet[Union[int, str]], Mapping[Union[int, str], Any], Any]] = None,
-    const: Optional[bool] = None,
-    gt: Optional[float] = None,
-    ge: Optional[float] = None,
-    lt: Optional[float] = None,
-    le: Optional[float] = None,
-    multiple_of: Optional[float] = None,
-    allow_inf_nan: Optional[bool] = None,
-    max_digits: Optional[int] = None,
-    decimal_places: Optional[int] = None,
-    min_items: Optional[int] = None,
-    max_items: Optional[int] = None,
-    unique_items: Optional[bool] = None,
-    min_length: Optional[int] = None,
-    max_length: Optional[int] = None,
-    allow_mutation: bool = True,
-    regex: Optional[str] = None,
-    discriminator: Optional[str] = None,
-    repr: bool = True,
+    # copied from pydantic's Field
+    default: Any = _Unset,
+    default_factory: Callable[[], Any] | None = _Unset,
+    title: str | None = _Unset,
+    description: str | None = _Unset,
+    pattern: str | None = _Unset,
+    strict: bool | None = _Unset,
+    gt: float | None = _Unset,
+    ge: float | None = _Unset,
+    lt: float | None = _Unset,
+    le: float | None = _Unset,
+    multiple_of: float | None = _Unset,
+    allow_inf_nan: bool | None = _Unset,
+    max_digits: int | None = _Unset,
+    decimal_places: int | None = _Unset,
+    min_length: int | None = _Unset,
+    max_length: int | None = _Unset,
+    # custom
     ui_type: Optional[UIType] = None,
     ui_hidden: bool = False,
     ui_order: Optional[int] = None,
-    **kwargs: Any,
 ) -> Any:
     """
     Creates an output field for an invocation output.
@@ -383,15 +420,12 @@ def OutputField(
     : param int ui_order: [None] Specifies the order in which this field should be rendered in the UI. \
     """
     return Field(
-        *args,
         default=default,
         default_factory=default_factory,
-        alias=alias,
         title=title,
         description=description,
-        exclude=exclude,
-        include=include,
-        const=const,
+        pattern=pattern,
+        strict=strict,
         gt=gt,
         ge=ge,
         lt=lt,
@@ -400,19 +434,13 @@ def OutputField(
         allow_inf_nan=allow_inf_nan,
         max_digits=max_digits,
         decimal_places=decimal_places,
-        min_items=min_items,
-        max_items=max_items,
-        unique_items=unique_items,
         min_length=min_length,
         max_length=max_length,
-        allow_mutation=allow_mutation,
-        regex=regex,
-        discriminator=discriminator,
-        repr=repr,
-        ui_type=ui_type,
-        ui_hidden=ui_hidden,
-        ui_order=ui_order,
-        **kwargs,
+        json_schema_extra=dict(
+            ui_type=ui_type,
+            ui_hidden=ui_hidden,
+            ui_order=ui_order,
+        ),
     )
 
 
@@ -426,7 +454,13 @@ class UIConfigBase(BaseModel):
     title: Optional[str] = Field(default=None, description="The node's display name")
     category: Optional[str] = Field(default=None, description="The node's category")
     version: Optional[str] = Field(
-        default=None, description='The node\'s version. Should be a valid semver string e.g. "1.0.0" or "3.8.13".'
+        default=None,
+        description='The node\'s version. Should be a valid semver string e.g. "1.0.0" or "3.8.13".',
+    )
+
+    model_config = ConfigDict(
+        validate_assignment=True,
+        json_schema_serialization_defaults_required=True,
     )
 
 
@@ -461,23 +495,38 @@ class BaseInvocationOutput(BaseModel):
     All invocation outputs must use the `@invocation_output` decorator to provide their unique type.
     """
 
-    @classmethod
-    def get_all_subclasses_tuple(cls):
-        subclasses = []
-        toprocess = [cls]
-        while len(toprocess) > 0:
-            next = toprocess.pop(0)
-            next_subclasses = next.__subclasses__()
-            subclasses.extend(next_subclasses)
-            toprocess.extend(next_subclasses)
-        return tuple(subclasses)
+    _output_classes: ClassVar[set[BaseInvocationOutput]] = set()
 
-    class Config:
-        @staticmethod
-        def schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
-            if "required" not in schema or not isinstance(schema["required"], list):
-                schema["required"] = list()
-            schema["required"].extend(["type"])
+    @classmethod
+    def register_output(cls, output: BaseInvocationOutput) -> None:
+        cls._output_classes.add(output)
+
+    @classmethod
+    def get_outputs(cls) -> Iterable[BaseInvocationOutput]:
+        return cls._output_classes
+
+    @classmethod
+    def get_outputs_union(cls) -> UnionType:
+        outputs_union = Union[tuple(cls._output_classes)]  # type: ignore [valid-type]
+        return outputs_union  # type: ignore [return-value]
+
+    @classmethod
+    def get_output_types(cls) -> Iterable[str]:
+        return map(lambda i: get_type(i), BaseInvocationOutput.get_outputs())
+
+    @staticmethod
+    def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
+        # Because we use a pydantic Literal field with default value for the invocation type,
+        # it will be typed as optional in the OpenAPI schema. Make it required manually.
+        if "required" not in schema or not isinstance(schema["required"], list):
+            schema["required"] = list()
+        schema["required"].extend(["type"])
+
+    model_config = ConfigDict(
+        validate_assignment=True,
+        json_schema_serialization_defaults_required=True,
+        json_schema_extra=json_schema_extra,
+    )
 
 
 class RequiredConnectionException(Exception):
@@ -502,104 +551,91 @@ class BaseInvocation(ABC, BaseModel):
     All invocations must use the `@invocation` decorator to provide their unique type.
     """
 
+    _invocation_classes: ClassVar[set[BaseInvocation]] = set()
+
     @classmethod
-    def get_all_subclasses(cls):
+    def register_invocation(cls, invocation: BaseInvocation) -> None:
+        cls._invocation_classes.add(invocation)
+
+    @classmethod
+    def get_invocations_union(cls) -> UnionType:
+        invocations_union = Union[tuple(cls._invocation_classes)]  # type: ignore [valid-type]
+        return invocations_union  # type: ignore [return-value]
+
+    @classmethod
+    def get_invocations(cls) -> Iterable[BaseInvocation]:
         app_config = InvokeAIAppConfig.get_config()
-        subclasses = []
-        toprocess = [cls]
-        while len(toprocess) > 0:
-            next = toprocess.pop(0)
-            next_subclasses = next.__subclasses__()
-            subclasses.extend(next_subclasses)
-            toprocess.extend(next_subclasses)
-        allowed_invocations = []
-        for sc in subclasses:
+        allowed_invocations: set[BaseInvocation] = set()
+        for sc in cls._invocation_classes:
+            invocation_type = get_type(sc)
             is_in_allowlist = (
-                sc.__fields__.get("type").default in app_config.allow_nodes
-                if isinstance(app_config.allow_nodes, list)
-                else True
+                invocation_type in app_config.allow_nodes if isinstance(app_config.allow_nodes, list) else True
             )
-
             is_in_denylist = (
-                sc.__fields__.get("type").default in app_config.deny_nodes
-                if isinstance(app_config.deny_nodes, list)
-                else False
+                invocation_type in app_config.deny_nodes if isinstance(app_config.deny_nodes, list) else False
             )
-
             if is_in_allowlist and not is_in_denylist:
-                allowed_invocations.append(sc)
+                allowed_invocations.add(sc)
         return allowed_invocations
 
     @classmethod
-    def get_invocations(cls):
-        return tuple(BaseInvocation.get_all_subclasses())
-
-    @classmethod
-    def get_invocations_map(cls):
+    def get_invocations_map(cls) -> dict[str, BaseInvocation]:
         # Get the type strings out of the literals and into a dictionary
         return dict(
             map(
-                lambda t: (get_args(get_type_hints(t)["type"])[0], t),
-                BaseInvocation.get_all_subclasses(),
+                lambda i: (get_type(i), i),
+                BaseInvocation.get_invocations(),
             )
         )
 
     @classmethod
-    def get_output_type(cls):
+    def get_invocation_types(cls) -> Iterable[str]:
+        return map(lambda i: get_type(i), BaseInvocation.get_invocations())
+
+    @classmethod
+    def get_output_type(cls) -> BaseInvocationOutput:
         return signature(cls.invoke).return_annotation
 
-    class Config:
-        validate_assignment = True
-        validate_all = True
-
-        @staticmethod
-        def schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
-            uiconfig = getattr(model_class, "UIConfig", None)
-            if uiconfig and hasattr(uiconfig, "title"):
-                schema["title"] = uiconfig.title
-            if uiconfig and hasattr(uiconfig, "tags"):
-                schema["tags"] = uiconfig.tags
-            if uiconfig and hasattr(uiconfig, "category"):
-                schema["category"] = uiconfig.category
-            if uiconfig and hasattr(uiconfig, "version"):
-                schema["version"] = uiconfig.version
-            if "required" not in schema or not isinstance(schema["required"], list):
-                schema["required"] = list()
-            schema["required"].extend(["type", "id"])
+    @staticmethod
+    def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
+        # Add the various UI-facing attributes to the schema. These are used to build the invocation templates.
+        uiconfig = getattr(model_class, "UIConfig", None)
+        if uiconfig and hasattr(uiconfig, "title"):
+            schema["title"] = uiconfig.title
+        if uiconfig and hasattr(uiconfig, "tags"):
+            schema["tags"] = uiconfig.tags
+        if uiconfig and hasattr(uiconfig, "category"):
+            schema["category"] = uiconfig.category
+        if uiconfig and hasattr(uiconfig, "version"):
+            schema["version"] = uiconfig.version
+        if "required" not in schema or not isinstance(schema["required"], list):
+            schema["required"] = list()
+        schema["required"].extend(["type", "id"])
 
     @abstractmethod
     def invoke(self, context: InvocationContext) -> BaseInvocationOutput:
         """Invoke with provided context and return outputs."""
         pass
 
-    def __init__(self, **data):
-        # nodes may have required fields, that can accept input from connections
-        # on instantiation of the model, we need to exclude these from validation
-        restore = dict()
-        try:
-            field_names = list(self.__fields__.keys())
-            for field_name in field_names:
-                # if the field is required and may get its value from a connection, exclude it from validation
-                field = self.__fields__[field_name]
-                _input = field.field_info.extra.get("input", None)
-                if _input in [Input.Connection, Input.Any] and field.required:
-                    if field_name not in data:
-                        restore[field_name] = self.__fields__.pop(field_name)
-            # instantiate the node, which will validate the data
-            super().__init__(**data)
-        finally:
-            # restore the removed fields
-            for field_name, field in restore.items():
-                self.__fields__[field_name] = field
-
     def invoke_internal(self, context: InvocationContext) -> BaseInvocationOutput:
-        for field_name, field in self.__fields__.items():
-            _input = field.field_info.extra.get("input", None)
-            if field.required and not hasattr(self, field_name):
-                if _input == Input.Connection:
-                    raise RequiredConnectionException(self.__fields__["type"].default, field_name)
-                elif _input == Input.Any:
-                    raise MissingInputException(self.__fields__["type"].default, field_name)
+        for field_name, field in self.model_fields.items():
+            if not field.json_schema_extra or callable(field.json_schema_extra):
+                # something has gone terribly awry, we should always have this and it should be a dict
+                continue
+
+            # Here we handle the case where the field is optional in the pydantic class, but required
+            # in the `invoke()` method.
+
+            orig_default = field.json_schema_extra.get("orig_default", PydanticUndefined)
+            orig_required = field.json_schema_extra.get("orig_required", True)
+            input_ = field.json_schema_extra.get("input", None)
+            if orig_default is not PydanticUndefined and not hasattr(self, field_name):
+                setattr(self, field_name, orig_default)
+            if orig_required and orig_default is PydanticUndefined and getattr(self, field_name) is None:
+                if input_ == Input.Connection:
+                    raise RequiredConnectionException(self.model_fields["type"].default, field_name)
+                elif input_ == Input.Any:
+                    raise MissingInputException(self.model_fields["type"].default, field_name)
 
         # skip node cache codepath if it's disabled
         if context.services.configuration.node_cache_size == 0:
@@ -622,23 +658,31 @@ class BaseInvocation(ABC, BaseModel):
             return self.invoke(context)
 
     def get_type(self) -> str:
-        return self.__fields__["type"].default
+        return self.model_fields["type"].default
 
     id: str = Field(
-        description="The id of this instance of an invocation. Must be unique among all instances of invocations."
+        default_factory=uuid_string,
+        description="The id of this instance of an invocation. Must be unique among all instances of invocations.",
     )
-    is_intermediate: bool = InputField(
-        default=False, description="Whether or not this is an intermediate invocation.", ui_type=UIType.IsIntermediate
+    is_intermediate: Optional[bool] = Field(
+        default=False,
+        description="Whether or not this is an intermediate invocation.",
+        json_schema_extra=dict(ui_type=UIType.IsIntermediate),
     )
-    workflow: Optional[str] = InputField(
+    workflow: Optional[str] = Field(
         default=None,
         description="The workflow to save with the image",
-        ui_type=UIType.WorkflowField,
+        json_schema_extra=dict(ui_type=UIType.WorkflowField),
+    )
+    use_cache: Optional[bool] = Field(
+        default=True,
+        description="Whether or not to use the cache",
     )
-    use_cache: bool = InputField(default=True, description="Whether or not to use the cache")
 
-    @validator("workflow", pre=True)
+    @field_validator("workflow", mode="before")
+    @classmethod
     def validate_workflow_is_json(cls, v):
+        """We don't have a workflow schema in the backend, so we just check that it's valid JSON"""
         if v is None:
             return None
         try:
@@ -649,8 +693,14 @@ class BaseInvocation(ABC, BaseModel):
 
     UIConfig: ClassVar[Type[UIConfigBase]]
 
+    model_config = ConfigDict(
+        validate_assignment=True,
+        json_schema_extra=json_schema_extra,
+        json_schema_serialization_defaults_required=True,
+    )
 
-GenericBaseInvocation = TypeVar("GenericBaseInvocation", bound=BaseInvocation)
+
+TBaseInvocation = TypeVar("TBaseInvocation", bound=BaseInvocation)
 
 
 def invocation(
@@ -660,7 +710,7 @@ def invocation(
     category: Optional[str] = None,
     version: Optional[str] = None,
     use_cache: Optional[bool] = True,
-) -> Callable[[Type[GenericBaseInvocation]], Type[GenericBaseInvocation]]:
+) -> Callable[[Type[TBaseInvocation]], Type[TBaseInvocation]]:
     """
     Adds metadata to an invocation.
 
@@ -672,12 +722,15 @@ def invocation(
     :param Optional[bool] use_cache: Whether or not to use the invocation cache. Defaults to True. The user may override this in the workflow editor.
     """
 
-    def wrapper(cls: Type[GenericBaseInvocation]) -> Type[GenericBaseInvocation]:
+    def wrapper(cls: Type[TBaseInvocation]) -> Type[TBaseInvocation]:
         # Validate invocation types on creation of invocation classes
         # TODO: ensure unique?
         if re.compile(r"^\S+$").match(invocation_type) is None:
             raise ValueError(f'"invocation_type" must consist of non-whitespace characters, got "{invocation_type}"')
 
+        if invocation_type in BaseInvocation.get_invocation_types():
+            raise ValueError(f'Invocation type "{invocation_type}" already exists')
+
         # Add OpenAPI schema extras
         uiconf_name = cls.__qualname__ + ".UIConfig"
         if not hasattr(cls, "UIConfig") or cls.UIConfig.__qualname__ != uiconf_name:
@@ -695,59 +748,83 @@ def invocation(
                 raise InvalidVersionError(f'Invalid version string for node "{invocation_type}": "{version}"') from e
             cls.UIConfig.version = version
         if use_cache is not None:
-            cls.__fields__["use_cache"].default = use_cache
+            cls.model_fields["use_cache"].default = use_cache
+
+        # Add the invocation type to the model.
+
+        # You'd be tempted to just add the type field and rebuild the model, like this:
+        # cls.model_fields.update(type=FieldInfo.from_annotated_attribute(Literal[invocation_type], invocation_type))
+        # cls.model_rebuild() or cls.model_rebuild(force=True)
+
+        # Unfortunately, because the `GraphInvocation` uses a forward ref in its `graph` field's annotation, this does
+        # not work. Instead, we have to create a new class with the type field and patch the original class with it.
 
-        # Add the invocation type to the pydantic model of the invocation
         invocation_type_annotation = Literal[invocation_type]  # type: ignore
-        invocation_type_field = ModelField.infer(
-            name="type",
-            value=invocation_type,
-            annotation=invocation_type_annotation,
-            class_validators=None,
-            config=cls.__config__,
+        invocation_type_field = Field(
+            title="type",
+            default=invocation_type,
         )
-        cls.__fields__.update({"type": invocation_type_field})
-        # to support 3.9, 3.10 and 3.11, as described in https://docs.python.org/3/howto/annotations.html
-        if annotations := cls.__dict__.get("__annotations__", None):
-            annotations.update({"type": invocation_type_annotation})
+
+        docstring = cls.__doc__
+        cls = create_model(
+            cls.__qualname__,
+            __base__=cls,
+            __module__=cls.__module__,
+            type=(invocation_type_annotation, invocation_type_field),
+        )
+        cls.__doc__ = docstring
+
+        # TODO: how to type this correctly? it's typed as ModelMetaclass, a private class in pydantic
+        BaseInvocation.register_invocation(cls)  # type: ignore
+
         return cls
 
     return wrapper
 
 
-GenericBaseInvocationOutput = TypeVar("GenericBaseInvocationOutput", bound=BaseInvocationOutput)
+TBaseInvocationOutput = TypeVar("TBaseInvocationOutput", bound=BaseInvocationOutput)
 
 
 def invocation_output(
     output_type: str,
-) -> Callable[[Type[GenericBaseInvocationOutput]], Type[GenericBaseInvocationOutput]]:
+) -> Callable[[Type[TBaseInvocationOutput]], Type[TBaseInvocationOutput]]:
     """
     Adds metadata to an invocation output.
 
     :param str output_type: The type of the invocation output. Must be unique among all invocation outputs.
     """
 
-    def wrapper(cls: Type[GenericBaseInvocationOutput]) -> Type[GenericBaseInvocationOutput]:
+    def wrapper(cls: Type[TBaseInvocationOutput]) -> Type[TBaseInvocationOutput]:
         # Validate output types on creation of invocation output classes
         # TODO: ensure unique?
         if re.compile(r"^\S+$").match(output_type) is None:
             raise ValueError(f'"output_type" must consist of non-whitespace characters, got "{output_type}"')
 
-        # Add the output type to the pydantic model of the invocation output
-        output_type_annotation = Literal[output_type]  # type: ignore
-        output_type_field = ModelField.infer(
-            name="type",
-            value=output_type,
-            annotation=output_type_annotation,
-            class_validators=None,
-            config=cls.__config__,
-        )
-        cls.__fields__.update({"type": output_type_field})
+        if output_type in BaseInvocationOutput.get_output_types():
+            raise ValueError(f'Invocation type "{output_type}" already exists')
 
-        # to support 3.9, 3.10 and 3.11, as described in https://docs.python.org/3/howto/annotations.html
-        if annotations := cls.__dict__.get("__annotations__", None):
-            annotations.update({"type": output_type_annotation})
+        # Add the output type to the model.
+
+        output_type_annotation = Literal[output_type]  # type: ignore
+        output_type_field = Field(
+            title="type",
+            default=output_type,
+        )
+
+        docstring = cls.__doc__
+        cls = create_model(
+            cls.__qualname__,
+            __base__=cls,
+            __module__=cls.__module__,
+            type=(output_type_annotation, output_type_field),
+        )
+        cls.__doc__ = docstring
+
+        BaseInvocationOutput.register_output(cls)  # type: ignore # TODO: how to type this correctly?
 
         return cls
 
     return wrapper
+
+
+GenericBaseModel = TypeVar("GenericBaseModel", bound=BaseModel)
diff --git a/invokeai/app/invocations/collections.py b/invokeai/app/invocations/collections.py
index 83863422f8..f26eebe1ff 100644
--- a/invokeai/app/invocations/collections.py
+++ b/invokeai/app/invocations/collections.py
@@ -2,7 +2,7 @@
 
 
 import numpy as np
-from pydantic import validator
+from pydantic import ValidationInfo, field_validator
 
 from invokeai.app.invocations.primitives import IntegerCollectionOutput
 from invokeai.app.util.misc import SEED_MAX, get_random_seed
@@ -20,9 +20,9 @@ class RangeInvocation(BaseInvocation):
     stop: int = InputField(default=10, description="The stop of the range")
     step: int = InputField(default=1, description="The step of the range")
 
-    @validator("stop")
-    def stop_gt_start(cls, v, values):
-        if "start" in values and v <= values["start"]:
+    @field_validator("stop")
+    def stop_gt_start(cls, v: int, info: ValidationInfo):
+        if "start" in info.data and v <= info.data["start"]:
             raise ValueError("stop must be greater than start")
         return v
 
diff --git a/invokeai/app/invocations/compel.py b/invokeai/app/invocations/compel.py
index b2634c2c56..b3ebc92320 100644
--- a/invokeai/app/invocations/compel.py
+++ b/invokeai/app/invocations/compel.py
@@ -1,6 +1,6 @@
 import re
 from dataclasses import dataclass
-from typing import List, Union
+from typing import List, Optional, Union
 
 import torch
 from compel import Compel, ReturnedEmbeddingsType
@@ -43,7 +43,13 @@ class ConditioningFieldData:
 #    PerpNeg = "perp_neg"
 
 
-@invocation("compel", title="Prompt", tags=["prompt", "compel"], category="conditioning", version="1.0.0")
+@invocation(
+    "compel",
+    title="Prompt",
+    tags=["prompt", "compel"],
+    category="conditioning",
+    version="1.0.0",
+)
 class CompelInvocation(BaseInvocation):
     """Parse prompt using compel package to conditioning."""
 
@@ -61,17 +67,19 @@ class CompelInvocation(BaseInvocation):
     @torch.no_grad()
     def invoke(self, context: InvocationContext) -> ConditioningOutput:
         tokenizer_info = context.services.model_manager.get_model(
-            **self.clip.tokenizer.dict(),
+            **self.clip.tokenizer.model_dump(),
             context=context,
         )
         text_encoder_info = context.services.model_manager.get_model(
-            **self.clip.text_encoder.dict(),
+            **self.clip.text_encoder.model_dump(),
             context=context,
         )
 
         def _lora_loader():
             for lora in self.clip.loras:
-                lora_info = context.services.model_manager.get_model(**lora.dict(exclude={"weight"}), context=context)
+                lora_info = context.services.model_manager.get_model(
+                    **lora.model_dump(exclude={"weight"}), context=context
+                )
                 yield (lora_info.context.model, lora.weight)
                 del lora_info
             return
@@ -160,11 +168,11 @@ class SDXLPromptInvocationBase:
         zero_on_empty: bool,
     ):
         tokenizer_info = context.services.model_manager.get_model(
-            **clip_field.tokenizer.dict(),
+            **clip_field.tokenizer.model_dump(),
             context=context,
         )
         text_encoder_info = context.services.model_manager.get_model(
-            **clip_field.text_encoder.dict(),
+            **clip_field.text_encoder.model_dump(),
             context=context,
         )
 
@@ -172,7 +180,11 @@ class SDXLPromptInvocationBase:
         if prompt == "" and zero_on_empty:
             cpu_text_encoder = text_encoder_info.context.model
             c = torch.zeros(
-                (1, cpu_text_encoder.config.max_position_embeddings, cpu_text_encoder.config.hidden_size),
+                (
+                    1,
+                    cpu_text_encoder.config.max_position_embeddings,
+                    cpu_text_encoder.config.hidden_size,
+                ),
                 dtype=text_encoder_info.context.cache.precision,
             )
             if get_pooled:
@@ -186,7 +198,9 @@ class SDXLPromptInvocationBase:
 
         def _lora_loader():
             for lora in clip_field.loras:
-                lora_info = context.services.model_manager.get_model(**lora.dict(exclude={"weight"}), context=context)
+                lora_info = context.services.model_manager.get_model(
+                    **lora.model_dump(exclude={"weight"}), context=context
+                )
                 yield (lora_info.context.model, lora.weight)
                 del lora_info
             return
@@ -273,8 +287,16 @@ class SDXLPromptInvocationBase:
 class SDXLCompelPromptInvocation(BaseInvocation, SDXLPromptInvocationBase):
     """Parse prompt using compel package to conditioning."""
 
-    prompt: str = InputField(default="", description=FieldDescriptions.compel_prompt, ui_component=UIComponent.Textarea)
-    style: str = InputField(default="", description=FieldDescriptions.compel_prompt, ui_component=UIComponent.Textarea)
+    prompt: str = InputField(
+        default="",
+        description=FieldDescriptions.compel_prompt,
+        ui_component=UIComponent.Textarea,
+    )
+    style: str = InputField(
+        default="",
+        description=FieldDescriptions.compel_prompt,
+        ui_component=UIComponent.Textarea,
+    )
     original_width: int = InputField(default=1024, description="")
     original_height: int = InputField(default=1024, description="")
     crop_top: int = InputField(default=0, description="")
@@ -310,7 +332,9 @@ class SDXLCompelPromptInvocation(BaseInvocation, SDXLPromptInvocationBase):
                 [
                     c1,
                     torch.zeros(
-                        (c1.shape[0], c2.shape[1] - c1.shape[1], c1.shape[2]), device=c1.device, dtype=c1.dtype
+                        (c1.shape[0], c2.shape[1] - c1.shape[1], c1.shape[2]),
+                        device=c1.device,
+                        dtype=c1.dtype,
                     ),
                 ],
                 dim=1,
@@ -321,7 +345,9 @@ class SDXLCompelPromptInvocation(BaseInvocation, SDXLPromptInvocationBase):
                 [
                     c2,
                     torch.zeros(
-                        (c2.shape[0], c1.shape[1] - c2.shape[1], c2.shape[2]), device=c2.device, dtype=c2.dtype
+                        (c2.shape[0], c1.shape[1] - c2.shape[1], c2.shape[2]),
+                        device=c2.device,
+                        dtype=c2.dtype,
                     ),
                 ],
                 dim=1,
@@ -359,7 +385,9 @@ class SDXLRefinerCompelPromptInvocation(BaseInvocation, SDXLPromptInvocationBase
     """Parse prompt using compel package to conditioning."""
 
     style: str = InputField(
-        default="", description=FieldDescriptions.compel_prompt, ui_component=UIComponent.Textarea
+        default="",
+        description=FieldDescriptions.compel_prompt,
+        ui_component=UIComponent.Textarea,
     )  # TODO: ?
     original_width: int = InputField(default=1024, description="")
     original_height: int = InputField(default=1024, description="")
@@ -403,10 +431,16 @@ class SDXLRefinerCompelPromptInvocation(BaseInvocation, SDXLPromptInvocationBase
 class ClipSkipInvocationOutput(BaseInvocationOutput):
     """Clip skip node output"""
 
-    clip: ClipField = OutputField(default=None, description=FieldDescriptions.clip, title="CLIP")
+    clip: Optional[ClipField] = OutputField(default=None, description=FieldDescriptions.clip, title="CLIP")
 
 
-@invocation("clip_skip", title="CLIP Skip", tags=["clipskip", "clip", "skip"], category="conditioning", version="1.0.0")
+@invocation(
+    "clip_skip",
+    title="CLIP Skip",
+    tags=["clipskip", "clip", "skip"],
+    category="conditioning",
+    version="1.0.0",
+)
 class ClipSkipInvocation(BaseInvocation):
     """Skip layers in clip text_encoder model."""
 
@@ -421,7 +455,9 @@ class ClipSkipInvocation(BaseInvocation):
 
 
 def get_max_token_count(
-    tokenizer, prompt: Union[FlattenedPrompt, Blend, Conjunction], truncate_if_too_long=False
+    tokenizer,
+    prompt: Union[FlattenedPrompt, Blend, Conjunction],
+    truncate_if_too_long=False,
 ) -> int:
     if type(prompt) is Blend:
         blend: Blend = prompt
diff --git a/invokeai/app/invocations/controlnet_image_processors.py b/invokeai/app/invocations/controlnet_image_processors.py
index 933c32c908..200c37d851 100644
--- a/invokeai/app/invocations/controlnet_image_processors.py
+++ b/invokeai/app/invocations/controlnet_image_processors.py
@@ -2,7 +2,7 @@
 # initial implementation by Gregg Helt, 2023
 # heavily leverages controlnet_aux package: https://github.com/patrickvonplaten/controlnet_aux
 from builtins import bool, float
-from typing import Dict, List, Literal, Optional, Union
+from typing import Dict, List, Literal, Union
 
 import cv2
 import numpy as np
@@ -24,12 +24,12 @@ from controlnet_aux import (
 )
 from controlnet_aux.util import HWC3, ade_palette
 from PIL import Image
-from pydantic import BaseModel, Field, validator
+from pydantic import BaseModel, ConfigDict, Field, field_validator
 
 from invokeai.app.invocations.primitives import ImageField, ImageOutput
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 
 from ...backend.model_management import BaseModelType
-from ..models.image import ImageCategory, ResourceOrigin
 from .baseinvocation import (
     BaseInvocation,
     BaseInvocationOutput,
@@ -57,6 +57,8 @@ class ControlNetModelField(BaseModel):
     model_name: str = Field(description="Name of the ControlNet model")
     base_model: BaseModelType = Field(description="Base model")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 class ControlField(BaseModel):
     image: ImageField = Field(description="The control image")
@@ -71,7 +73,7 @@ class ControlField(BaseModel):
     control_mode: CONTROLNET_MODE_VALUES = Field(default="balanced", description="The control mode to use")
     resize_mode: CONTROLNET_RESIZE_VALUES = Field(default="just_resize", description="The resize mode to use")
 
-    @validator("control_weight")
+    @field_validator("control_weight")
     def validate_control_weight(cls, v):
         """Validate that all control weights in the valid range"""
         if isinstance(v, list):
@@ -124,9 +126,7 @@ class ControlNetInvocation(BaseInvocation):
         )
 
 
-@invocation(
-    "image_processor", title="Base Image Processor", tags=["controlnet"], category="controlnet", version="1.0.0"
-)
+# This invocation exists for other invocations to subclass it - do not register with @invocation!
 class ImageProcessorInvocation(BaseInvocation):
     """Base class for invocations that preprocess images for ControlNet"""
 
@@ -393,9 +393,9 @@ class ContentShuffleImageProcessorInvocation(ImageProcessorInvocation):
 
     detect_resolution: int = InputField(default=512, ge=0, description=FieldDescriptions.detect_res)
     image_resolution: int = InputField(default=512, ge=0, description=FieldDescriptions.image_res)
-    h: Optional[int] = InputField(default=512, ge=0, description="Content shuffle `h` parameter")
-    w: Optional[int] = InputField(default=512, ge=0, description="Content shuffle `w` parameter")
-    f: Optional[int] = InputField(default=256, ge=0, description="Content shuffle `f` parameter")
+    h: int = InputField(default=512, ge=0, description="Content shuffle `h` parameter")
+    w: int = InputField(default=512, ge=0, description="Content shuffle `w` parameter")
+    f: int = InputField(default=256, ge=0, description="Content shuffle `f` parameter")
 
     def run_processor(self, image):
         content_shuffle_processor = ContentShuffleDetector()
@@ -575,14 +575,14 @@ class ColorMapImageProcessorInvocation(ImageProcessorInvocation):
 
     def run_processor(self, image: Image.Image):
         image = image.convert("RGB")
-        image = np.array(image, dtype=np.uint8)
-        height, width = image.shape[:2]
+        np_image = np.array(image, dtype=np.uint8)
+        height, width = np_image.shape[:2]
 
         width_tile_size = min(self.color_map_tile_size, width)
         height_tile_size = min(self.color_map_tile_size, height)
 
         color_map = cv2.resize(
-            image,
+            np_image,
             (width // width_tile_size, height // height_tile_size),
             interpolation=cv2.INTER_CUBIC,
         )
diff --git a/invokeai/app/invocations/cv.py b/invokeai/app/invocations/cv.py
index cbe76091d6..3b85955d74 100644
--- a/invokeai/app/invocations/cv.py
+++ b/invokeai/app/invocations/cv.py
@@ -6,7 +6,7 @@ import numpy
 from PIL import Image, ImageOps
 
 from invokeai.app.invocations.primitives import ImageField, ImageOutput
-from invokeai.app.models.image import ImageCategory, ResourceOrigin
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 
 from .baseinvocation import BaseInvocation, InputField, InvocationContext, invocation
 
diff --git a/invokeai/app/invocations/facetools.py b/invokeai/app/invocations/facetools.py
index 7926f76ce2..40e15e9476 100644
--- a/invokeai/app/invocations/facetools.py
+++ b/invokeai/app/invocations/facetools.py
@@ -8,7 +8,7 @@ import numpy as np
 from mediapipe.python.solutions.face_mesh import FaceMesh  # type: ignore[import]
 from PIL import Image, ImageDraw, ImageFilter, ImageFont, ImageOps
 from PIL.Image import Image as ImageType
-from pydantic import validator
+from pydantic import field_validator
 
 import invokeai.assets.fonts as font_assets
 from invokeai.app.invocations.baseinvocation import (
@@ -20,7 +20,7 @@ from invokeai.app.invocations.baseinvocation import (
     invocation_output,
 )
 from invokeai.app.invocations.primitives import ImageField, ImageOutput
-from invokeai.app.models.image import ImageCategory, ResourceOrigin
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 
 
 @invocation_output("face_mask_output")
@@ -46,6 +46,8 @@ class FaceResultData(TypedDict):
     y_center: float
     mesh_width: int
     mesh_height: int
+    chunk_x_offset: int
+    chunk_y_offset: int
 
 
 class FaceResultDataWithId(FaceResultData):
@@ -78,6 +80,48 @@ FONT_SIZE = 32
 FONT_STROKE_WIDTH = 4
 
 
+def coalesce_faces(face1: FaceResultData, face2: FaceResultData) -> FaceResultData:
+    face1_x_offset = face1["chunk_x_offset"] - min(face1["chunk_x_offset"], face2["chunk_x_offset"])
+    face2_x_offset = face2["chunk_x_offset"] - min(face1["chunk_x_offset"], face2["chunk_x_offset"])
+    face1_y_offset = face1["chunk_y_offset"] - min(face1["chunk_y_offset"], face2["chunk_y_offset"])
+    face2_y_offset = face2["chunk_y_offset"] - min(face1["chunk_y_offset"], face2["chunk_y_offset"])
+
+    new_im_width = (
+        max(face1["image"].width, face2["image"].width)
+        + max(face1["chunk_x_offset"], face2["chunk_x_offset"])
+        - min(face1["chunk_x_offset"], face2["chunk_x_offset"])
+    )
+    new_im_height = (
+        max(face1["image"].height, face2["image"].height)
+        + max(face1["chunk_y_offset"], face2["chunk_y_offset"])
+        - min(face1["chunk_y_offset"], face2["chunk_y_offset"])
+    )
+    pil_image = Image.new(mode=face1["image"].mode, size=(new_im_width, new_im_height))
+    pil_image.paste(face1["image"], (face1_x_offset, face1_y_offset))
+    pil_image.paste(face2["image"], (face2_x_offset, face2_y_offset))
+
+    # Mask images are always from the origin
+    new_mask_im_width = max(face1["mask"].width, face2["mask"].width)
+    new_mask_im_height = max(face1["mask"].height, face2["mask"].height)
+    mask_pil = create_white_image(new_mask_im_width, new_mask_im_height)
+    black_image = create_black_image(face1["mask"].width, face1["mask"].height)
+    mask_pil.paste(black_image, (0, 0), ImageOps.invert(face1["mask"]))
+    black_image = create_black_image(face2["mask"].width, face2["mask"].height)
+    mask_pil.paste(black_image, (0, 0), ImageOps.invert(face2["mask"]))
+
+    new_face = FaceResultData(
+        image=pil_image,
+        mask=mask_pil,
+        x_center=max(face1["x_center"], face2["x_center"]),
+        y_center=max(face1["y_center"], face2["y_center"]),
+        mesh_width=max(face1["mesh_width"], face2["mesh_width"]),
+        mesh_height=max(face1["mesh_height"], face2["mesh_height"]),
+        chunk_x_offset=max(face1["chunk_x_offset"], face2["chunk_x_offset"]),
+        chunk_y_offset=max(face2["chunk_y_offset"], face2["chunk_y_offset"]),
+    )
+    return new_face
+
+
 def prepare_faces_list(
     face_result_list: list[FaceResultData],
 ) -> list[FaceResultDataWithId]:
@@ -91,7 +135,7 @@ def prepare_faces_list(
         should_add = True
         candidate_x_center = candidate["x_center"]
         candidate_y_center = candidate["y_center"]
-        for face in deduped_faces:
+        for idx, face in enumerate(deduped_faces):
             face_center_x = face["x_center"]
             face_center_y = face["y_center"]
             face_radius_w = face["mesh_width"] / 2
@@ -105,6 +149,7 @@ def prepare_faces_list(
             )
 
             if p < 1:  # Inside of the already-added face's radius
+                deduped_faces[idx] = coalesce_faces(face, candidate)
                 should_add = False
                 break
 
@@ -138,7 +183,6 @@ def generate_face_box_mask(
     chunk_x_offset: int = 0,
     chunk_y_offset: int = 0,
     draw_mesh: bool = True,
-    check_bounds: bool = True,
 ) -> list[FaceResultData]:
     result = []
     mask_pil = None
@@ -211,33 +255,20 @@ def generate_face_box_mask(
                 mask_pil = create_white_image(w + chunk_x_offset, h + chunk_y_offset)
                 mask_pil.paste(init_mask_pil, (chunk_x_offset, chunk_y_offset))
 
-            left_side = x_center - mesh_width
-            right_side = x_center + mesh_width
-            top_side = y_center - mesh_height
-            bottom_side = y_center + mesh_height
-            im_width, im_height = pil_image.size
-            over_w = im_width * 0.1
-            over_h = im_height * 0.1
-            if not check_bounds or (
-                (left_side >= -over_w)
-                and (right_side < im_width + over_w)
-                and (top_side >= -over_h)
-                and (bottom_side < im_height + over_h)
-            ):
-                x_center = float(x_center)
-                y_center = float(y_center)
-                face = FaceResultData(
-                    image=pil_image,
-                    mask=mask_pil or create_white_image(*pil_image.size),
-                    x_center=x_center + chunk_x_offset,
-                    y_center=y_center + chunk_y_offset,
-                    mesh_width=mesh_width,
-                    mesh_height=mesh_height,
-                )
+            x_center = float(x_center)
+            y_center = float(y_center)
+            face = FaceResultData(
+                image=pil_image,
+                mask=mask_pil or create_white_image(*pil_image.size),
+                x_center=x_center + chunk_x_offset,
+                y_center=y_center + chunk_y_offset,
+                mesh_width=mesh_width,
+                mesh_height=mesh_height,
+                chunk_x_offset=chunk_x_offset,
+                chunk_y_offset=chunk_y_offset,
+            )
 
-                result.append(face)
-            else:
-                context.services.logger.info("FaceTools --> Face out of bounds, ignoring.")
+            result.append(face)
 
     return result
 
@@ -346,7 +377,6 @@ def get_faces_list(
             chunk_x_offset=0,
             chunk_y_offset=0,
             draw_mesh=draw_mesh,
-            check_bounds=False,
         )
     if should_chunk or len(result) == 0:
         context.services.logger.info("FaceTools --> Chunking image (chunk toggled on, or no face found in full image).")
@@ -360,24 +390,26 @@ def get_faces_list(
         if width > height:
             # Landscape - slice the image horizontally
             fx = 0.0
-            steps = int(width * 2 / height)
+            steps = int(width * 2 / height) + 1
+            increment = (width - height) / (steps - 1)
             while fx <= (width - height):
                 x = int(fx)
-                image_chunks.append(image.crop((x, 0, x + height - 1, height - 1)))
+                image_chunks.append(image.crop((x, 0, x + height, height)))
                 x_offsets.append(x)
                 y_offsets.append(0)
-                fx += (width - height) / steps
+                fx += increment
                 context.services.logger.info(f"FaceTools --> Chunk starting at x = {x}")
         elif height > width:
             # Portrait - slice the image vertically
             fy = 0.0
-            steps = int(height * 2 / width)
+            steps = int(height * 2 / width) + 1
+            increment = (height - width) / (steps - 1)
             while fy <= (height - width):
                 y = int(fy)
-                image_chunks.append(image.crop((0, y, width - 1, y + width - 1)))
+                image_chunks.append(image.crop((0, y, width, y + width)))
                 x_offsets.append(0)
                 y_offsets.append(y)
-                fy += (height - width) / steps
+                fy += increment
                 context.services.logger.info(f"FaceTools --> Chunk starting at y = {y}")
 
         for idx in range(len(image_chunks)):
@@ -404,7 +436,7 @@ def get_faces_list(
     return all_faces
 
 
-@invocation("face_off", title="FaceOff", tags=["image", "faceoff", "face", "mask"], category="image", version="1.0.1")
+@invocation("face_off", title="FaceOff", tags=["image", "faceoff", "face", "mask"], category="image", version="1.0.2")
 class FaceOffInvocation(BaseInvocation):
     """Bound, extract, and mask a face from an image using MediaPipe detection"""
 
@@ -498,7 +530,7 @@ class FaceOffInvocation(BaseInvocation):
         return output
 
 
-@invocation("face_mask_detection", title="FaceMask", tags=["image", "face", "mask"], category="image", version="1.0.1")
+@invocation("face_mask_detection", title="FaceMask", tags=["image", "face", "mask"], category="image", version="1.0.2")
 class FaceMaskInvocation(BaseInvocation):
     """Face mask creation using mediapipe face detection"""
 
@@ -518,7 +550,7 @@ class FaceMaskInvocation(BaseInvocation):
     )
     invert_mask: bool = InputField(default=False, description="Toggle to invert the mask")
 
-    @validator("face_ids")
+    @field_validator("face_ids")
     def validate_comma_separated_ints(cls, v) -> str:
         comma_separated_ints_regex = re.compile(r"^\d*(,\d+)*$")
         if comma_separated_ints_regex.match(v) is None:
@@ -616,7 +648,7 @@ class FaceMaskInvocation(BaseInvocation):
 
 
 @invocation(
-    "face_identifier", title="FaceIdentifier", tags=["image", "face", "identifier"], category="image", version="1.0.1"
+    "face_identifier", title="FaceIdentifier", tags=["image", "face", "identifier"], category="image", version="1.0.2"
 )
 class FaceIdentifierInvocation(BaseInvocation):
     """Outputs an image with detected face IDs printed on each face. For use with other FaceTools."""
diff --git a/invokeai/app/invocations/image.py b/invokeai/app/invocations/image.py
index 0301768219..3a4f4eadac 100644
--- a/invokeai/app/invocations/image.py
+++ b/invokeai/app/invocations/image.py
@@ -9,10 +9,10 @@ from PIL import Image, ImageChops, ImageFilter, ImageOps
 
 from invokeai.app.invocations.metadata import CoreMetadata
 from invokeai.app.invocations.primitives import BoardField, ColorField, ImageField, ImageOutput
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 from invokeai.backend.image_util.invisible_watermark import InvisibleWatermark
 from invokeai.backend.image_util.safety_checker import SafetyChecker
 
-from ..models.image import ImageCategory, ResourceOrigin
 from .baseinvocation import BaseInvocation, FieldDescriptions, Input, InputField, InvocationContext, invocation
 
 
@@ -36,7 +36,13 @@ class ShowImageInvocation(BaseInvocation):
         )
 
 
-@invocation("blank_image", title="Blank Image", tags=["image"], category="image", version="1.0.0")
+@invocation(
+    "blank_image",
+    title="Blank Image",
+    tags=["image"],
+    category="image",
+    version="1.0.0",
+)
 class BlankImageInvocation(BaseInvocation):
     """Creates a blank image and forwards it to the pipeline"""
 
@@ -65,7 +71,13 @@ class BlankImageInvocation(BaseInvocation):
         )
 
 
-@invocation("img_crop", title="Crop Image", tags=["image", "crop"], category="image", version="1.0.0")
+@invocation(
+    "img_crop",
+    title="Crop Image",
+    tags=["image", "crop"],
+    category="image",
+    version="1.0.0",
+)
 class ImageCropInvocation(BaseInvocation):
     """Crops an image to a specified box. The box can be outside of the image."""
 
@@ -98,7 +110,13 @@ class ImageCropInvocation(BaseInvocation):
         )
 
 
-@invocation("img_paste", title="Paste Image", tags=["image", "paste"], category="image", version="1.0.1")
+@invocation(
+    "img_paste",
+    title="Paste Image",
+    tags=["image", "paste"],
+    category="image",
+    version="1.0.1",
+)
 class ImagePasteInvocation(BaseInvocation):
     """Pastes an image into another image."""
 
@@ -151,7 +169,13 @@ class ImagePasteInvocation(BaseInvocation):
         )
 
 
-@invocation("tomask", title="Mask from Alpha", tags=["image", "mask"], category="image", version="1.0.0")
+@invocation(
+    "tomask",
+    title="Mask from Alpha",
+    tags=["image", "mask"],
+    category="image",
+    version="1.0.0",
+)
 class MaskFromAlphaInvocation(BaseInvocation):
     """Extracts the alpha channel of an image as a mask."""
 
@@ -182,7 +206,13 @@ class MaskFromAlphaInvocation(BaseInvocation):
         )
 
 
-@invocation("img_mul", title="Multiply Images", tags=["image", "multiply"], category="image", version="1.0.0")
+@invocation(
+    "img_mul",
+    title="Multiply Images",
+    tags=["image", "multiply"],
+    category="image",
+    version="1.0.0",
+)
 class ImageMultiplyInvocation(BaseInvocation):
     """Multiplies two images together using `PIL.ImageChops.multiply()`."""
 
@@ -215,7 +245,13 @@ class ImageMultiplyInvocation(BaseInvocation):
 IMAGE_CHANNELS = Literal["A", "R", "G", "B"]
 
 
-@invocation("img_chan", title="Extract Image Channel", tags=["image", "channel"], category="image", version="1.0.0")
+@invocation(
+    "img_chan",
+    title="Extract Image Channel",
+    tags=["image", "channel"],
+    category="image",
+    version="1.0.0",
+)
 class ImageChannelInvocation(BaseInvocation):
     """Gets a channel from an image."""
 
@@ -247,7 +283,13 @@ class ImageChannelInvocation(BaseInvocation):
 IMAGE_MODES = Literal["L", "RGB", "RGBA", "CMYK", "YCbCr", "LAB", "HSV", "I", "F"]
 
 
-@invocation("img_conv", title="Convert Image Mode", tags=["image", "convert"], category="image", version="1.0.0")
+@invocation(
+    "img_conv",
+    title="Convert Image Mode",
+    tags=["image", "convert"],
+    category="image",
+    version="1.0.0",
+)
 class ImageConvertInvocation(BaseInvocation):
     """Converts an image to a different mode."""
 
@@ -276,7 +318,13 @@ class ImageConvertInvocation(BaseInvocation):
         )
 
 
-@invocation("img_blur", title="Blur Image", tags=["image", "blur"], category="image", version="1.0.0")
+@invocation(
+    "img_blur",
+    title="Blur Image",
+    tags=["image", "blur"],
+    category="image",
+    version="1.0.0",
+)
 class ImageBlurInvocation(BaseInvocation):
     """Blurs an image"""
 
@@ -330,7 +378,13 @@ PIL_RESAMPLING_MAP = {
 }
 
 
-@invocation("img_resize", title="Resize Image", tags=["image", "resize"], category="image", version="1.0.0")
+@invocation(
+    "img_resize",
+    title="Resize Image",
+    tags=["image", "resize"],
+    category="image",
+    version="1.0.0",
+)
 class ImageResizeInvocation(BaseInvocation):
     """Resizes an image to specific dimensions"""
 
@@ -359,7 +413,7 @@ class ImageResizeInvocation(BaseInvocation):
             node_id=self.id,
             session_id=context.graph_execution_state_id,
             is_intermediate=self.is_intermediate,
-            metadata=self.metadata.dict() if self.metadata else None,
+            metadata=self.metadata.model_dump() if self.metadata else None,
             workflow=self.workflow,
         )
 
@@ -370,7 +424,13 @@ class ImageResizeInvocation(BaseInvocation):
         )
 
 
-@invocation("img_scale", title="Scale Image", tags=["image", "scale"], category="image", version="1.0.0")
+@invocation(
+    "img_scale",
+    title="Scale Image",
+    tags=["image", "scale"],
+    category="image",
+    version="1.0.0",
+)
 class ImageScaleInvocation(BaseInvocation):
     """Scales an image by a factor"""
 
@@ -411,7 +471,13 @@ class ImageScaleInvocation(BaseInvocation):
         )
 
 
-@invocation("img_lerp", title="Lerp Image", tags=["image", "lerp"], category="image", version="1.0.0")
+@invocation(
+    "img_lerp",
+    title="Lerp Image",
+    tags=["image", "lerp"],
+    category="image",
+    version="1.0.0",
+)
 class ImageLerpInvocation(BaseInvocation):
     """Linear interpolation of all pixels of an image"""
 
@@ -444,7 +510,13 @@ class ImageLerpInvocation(BaseInvocation):
         )
 
 
-@invocation("img_ilerp", title="Inverse Lerp Image", tags=["image", "ilerp"], category="image", version="1.0.0")
+@invocation(
+    "img_ilerp",
+    title="Inverse Lerp Image",
+    tags=["image", "ilerp"],
+    category="image",
+    version="1.0.0",
+)
 class ImageInverseLerpInvocation(BaseInvocation):
     """Inverse linear interpolation of all pixels of an image"""
 
@@ -456,7 +528,7 @@ class ImageInverseLerpInvocation(BaseInvocation):
         image = context.services.images.get_pil_image(self.image.image_name)
 
         image_arr = numpy.asarray(image, dtype=numpy.float32)
-        image_arr = numpy.minimum(numpy.maximum(image_arr - self.min, 0) / float(self.max - self.min), 1) * 255
+        image_arr = numpy.minimum(numpy.maximum(image_arr - self.min, 0) / float(self.max - self.min), 1) * 255  # type: ignore [assignment]
 
         ilerp_image = Image.fromarray(numpy.uint8(image_arr))
 
@@ -477,7 +549,13 @@ class ImageInverseLerpInvocation(BaseInvocation):
         )
 
 
-@invocation("img_nsfw", title="Blur NSFW Image", tags=["image", "nsfw"], category="image", version="1.0.0")
+@invocation(
+    "img_nsfw",
+    title="Blur NSFW Image",
+    tags=["image", "nsfw"],
+    category="image",
+    version="1.0.0",
+)
 class ImageNSFWBlurInvocation(BaseInvocation):
     """Add blur to NSFW-flagged images"""
 
@@ -505,7 +583,7 @@ class ImageNSFWBlurInvocation(BaseInvocation):
             node_id=self.id,
             session_id=context.graph_execution_state_id,
             is_intermediate=self.is_intermediate,
-            metadata=self.metadata.dict() if self.metadata else None,
+            metadata=self.metadata.model_dump() if self.metadata else None,
             workflow=self.workflow,
         )
 
@@ -515,7 +593,7 @@ class ImageNSFWBlurInvocation(BaseInvocation):
             height=image_dto.height,
         )
 
-    def _get_caution_img(self) -> Image:
+    def _get_caution_img(self) -> Image.Image:
         import invokeai.app.assets.images as image_assets
 
         caution = Image.open(Path(image_assets.__path__[0]) / "caution.png")
@@ -523,7 +601,11 @@ class ImageNSFWBlurInvocation(BaseInvocation):
 
 
 @invocation(
-    "img_watermark", title="Add Invisible Watermark", tags=["image", "watermark"], category="image", version="1.0.0"
+    "img_watermark",
+    title="Add Invisible Watermark",
+    tags=["image", "watermark"],
+    category="image",
+    version="1.0.0",
 )
 class ImageWatermarkInvocation(BaseInvocation):
     """Add an invisible watermark to an image"""
@@ -544,7 +626,7 @@ class ImageWatermarkInvocation(BaseInvocation):
             node_id=self.id,
             session_id=context.graph_execution_state_id,
             is_intermediate=self.is_intermediate,
-            metadata=self.metadata.dict() if self.metadata else None,
+            metadata=self.metadata.model_dump() if self.metadata else None,
             workflow=self.workflow,
         )
 
@@ -555,7 +637,13 @@ class ImageWatermarkInvocation(BaseInvocation):
         )
 
 
-@invocation("mask_edge", title="Mask Edge", tags=["image", "mask", "inpaint"], category="image", version="1.0.0")
+@invocation(
+    "mask_edge",
+    title="Mask Edge",
+    tags=["image", "mask", "inpaint"],
+    category="image",
+    version="1.0.0",
+)
 class MaskEdgeInvocation(BaseInvocation):
     """Applies an edge mask to an image"""
 
@@ -601,7 +689,11 @@ class MaskEdgeInvocation(BaseInvocation):
 
 
 @invocation(
-    "mask_combine", title="Combine Masks", tags=["image", "mask", "multiply"], category="image", version="1.0.0"
+    "mask_combine",
+    title="Combine Masks",
+    tags=["image", "mask", "multiply"],
+    category="image",
+    version="1.0.0",
 )
 class MaskCombineInvocation(BaseInvocation):
     """Combine two masks together by multiplying them using `PIL.ImageChops.multiply()`."""
@@ -632,7 +724,13 @@ class MaskCombineInvocation(BaseInvocation):
         )
 
 
-@invocation("color_correct", title="Color Correct", tags=["image", "color"], category="image", version="1.0.0")
+@invocation(
+    "color_correct",
+    title="Color Correct",
+    tags=["image", "color"],
+    category="image",
+    version="1.0.0",
+)
 class ColorCorrectInvocation(BaseInvocation):
     """
     Shifts the colors of a target image to match the reference image, optionally
@@ -742,7 +840,13 @@ class ColorCorrectInvocation(BaseInvocation):
         )
 
 
-@invocation("img_hue_adjust", title="Adjust Image Hue", tags=["image", "hue"], category="image", version="1.0.0")
+@invocation(
+    "img_hue_adjust",
+    title="Adjust Image Hue",
+    tags=["image", "hue"],
+    category="image",
+    version="1.0.0",
+)
 class ImageHueAdjustmentInvocation(BaseInvocation):
     """Adjusts the Hue of an image."""
 
@@ -980,7 +1084,7 @@ class SaveImageInvocation(BaseInvocation):
 
     image: ImageField = InputField(description=FieldDescriptions.image)
     board: Optional[BoardField] = InputField(default=None, description=FieldDescriptions.board, input=Input.Direct)
-    metadata: CoreMetadata = InputField(
+    metadata: Optional[CoreMetadata] = InputField(
         default=None,
         description=FieldDescriptions.core_metadata,
         ui_hidden=True,
@@ -997,7 +1101,7 @@ class SaveImageInvocation(BaseInvocation):
             node_id=self.id,
             session_id=context.graph_execution_state_id,
             is_intermediate=self.is_intermediate,
-            metadata=self.metadata.dict() if self.metadata else None,
+            metadata=self.metadata.model_dump() if self.metadata else None,
             workflow=self.workflow,
         )
 
diff --git a/invokeai/app/invocations/infill.py b/invokeai/app/invocations/infill.py
index e703b4ab41..d8384290f3 100644
--- a/invokeai/app/invocations/infill.py
+++ b/invokeai/app/invocations/infill.py
@@ -7,12 +7,12 @@ import numpy as np
 from PIL import Image, ImageOps
 
 from invokeai.app.invocations.primitives import ColorField, ImageField, ImageOutput
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 from invokeai.app.util.misc import SEED_MAX, get_random_seed
 from invokeai.backend.image_util.cv2_inpaint import cv2_inpaint
 from invokeai.backend.image_util.lama import LaMA
 from invokeai.backend.image_util.patchmatch import PatchMatch
 
-from ..models.image import ImageCategory, ResourceOrigin
 from .baseinvocation import BaseInvocation, InputField, InvocationContext, invocation
 from .image import PIL_RESAMPLING_MAP, PIL_RESAMPLING_MODES
 
diff --git a/invokeai/app/invocations/ip_adapter.py b/invokeai/app/invocations/ip_adapter.py
index 3e3a3d9b1f..81fd1f9f5d 100644
--- a/invokeai/app/invocations/ip_adapter.py
+++ b/invokeai/app/invocations/ip_adapter.py
@@ -2,7 +2,7 @@ import os
 from builtins import float
 from typing import List, Union
 
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, ConfigDict, Field
 
 from invokeai.app.invocations.baseinvocation import (
     BaseInvocation,
@@ -25,11 +25,15 @@ class IPAdapterModelField(BaseModel):
     model_name: str = Field(description="Name of the IP-Adapter model")
     base_model: BaseModelType = Field(description="Base model")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 class CLIPVisionModelField(BaseModel):
     model_name: str = Field(description="Name of the CLIP Vision image encoder model")
     base_model: BaseModelType = Field(description="Base model (usually 'Any')")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 class IPAdapterField(BaseModel):
     image: ImageField = Field(description="The IP-Adapter image prompt.")
diff --git a/invokeai/app/invocations/latent.py b/invokeai/app/invocations/latent.py
index 077f6135da..917f0e13e8 100644
--- a/invokeai/app/invocations/latent.py
+++ b/invokeai/app/invocations/latent.py
@@ -19,7 +19,7 @@ from diffusers.models.attention_processor import (
 )
 from diffusers.schedulers import DPMSolverSDEScheduler
 from diffusers.schedulers import SchedulerMixin as Scheduler
-from pydantic import validator
+from pydantic import field_validator
 from torchvision.transforms.functional import resize as tv_resize
 
 from invokeai.app.invocations.ip_adapter import IPAdapterField
@@ -34,6 +34,7 @@ from invokeai.app.invocations.primitives import (
     build_latents_output,
 )
 from invokeai.app.invocations.t2i_adapter import T2IAdapterField
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 from invokeai.app.util.controlnet_utils import prepare_control_image
 from invokeai.app.util.step_callback import stable_diffusion_step_callback
 from invokeai.backend.ip_adapter.ip_adapter import IPAdapter, IPAdapterPlus
@@ -54,7 +55,6 @@ from ...backend.stable_diffusion.diffusers_pipeline import (
 from ...backend.stable_diffusion.diffusion.shared_invokeai_diffusion import PostprocessingSettings
 from ...backend.stable_diffusion.schedulers import SCHEDULER_MAP
 from ...backend.util.devices import choose_precision, choose_torch_device
-from ..models.image import ImageCategory, ResourceOrigin
 from .baseinvocation import (
     BaseInvocation,
     BaseInvocationOutput,
@@ -84,12 +84,20 @@ class SchedulerOutput(BaseInvocationOutput):
     scheduler: SAMPLER_NAME_VALUES = OutputField(description=FieldDescriptions.scheduler, ui_type=UIType.Scheduler)
 
 
-@invocation("scheduler", title="Scheduler", tags=["scheduler"], category="latents", version="1.0.0")
+@invocation(
+    "scheduler",
+    title="Scheduler",
+    tags=["scheduler"],
+    category="latents",
+    version="1.0.0",
+)
 class SchedulerInvocation(BaseInvocation):
     """Selects a scheduler."""
 
     scheduler: SAMPLER_NAME_VALUES = InputField(
-        default="euler", description=FieldDescriptions.scheduler, ui_type=UIType.Scheduler
+        default="euler",
+        description=FieldDescriptions.scheduler,
+        ui_type=UIType.Scheduler,
     )
 
     def invoke(self, context: InvocationContext) -> SchedulerOutput:
@@ -97,7 +105,11 @@ class SchedulerInvocation(BaseInvocation):
 
 
 @invocation(
-    "create_denoise_mask", title="Create Denoise Mask", tags=["mask", "denoise"], category="latents", version="1.0.0"
+    "create_denoise_mask",
+    title="Create Denoise Mask",
+    tags=["mask", "denoise"],
+    category="latents",
+    version="1.0.0",
 )
 class CreateDenoiseMaskInvocation(BaseInvocation):
     """Creates mask for denoising model run."""
@@ -106,7 +118,11 @@ class CreateDenoiseMaskInvocation(BaseInvocation):
     image: Optional[ImageField] = InputField(default=None, description="Image which will be masked", ui_order=1)
     mask: ImageField = InputField(description="The mask to use when pasting", ui_order=2)
     tiled: bool = InputField(default=False, description=FieldDescriptions.tiled, ui_order=3)
-    fp32: bool = InputField(default=DEFAULT_PRECISION == "float32", description=FieldDescriptions.fp32, ui_order=4)
+    fp32: bool = InputField(
+        default=DEFAULT_PRECISION == "float32",
+        description=FieldDescriptions.fp32,
+        ui_order=4,
+    )
 
     def prep_mask_tensor(self, mask_image):
         if mask_image.mode != "L":
@@ -134,7 +150,7 @@ class CreateDenoiseMaskInvocation(BaseInvocation):
 
         if image is not None:
             vae_info = context.services.model_manager.get_model(
-                **self.vae.vae.dict(),
+                **self.vae.vae.model_dump(),
                 context=context,
             )
 
@@ -167,7 +183,7 @@ def get_scheduler(
 ) -> Scheduler:
     scheduler_class, scheduler_extra_config = SCHEDULER_MAP.get(scheduler_name, SCHEDULER_MAP["ddim"])
     orig_scheduler_info = context.services.model_manager.get_model(
-        **scheduler_info.dict(),
+        **scheduler_info.model_dump(),
         context=context,
     )
     with orig_scheduler_info as orig_scheduler:
@@ -209,34 +225,64 @@ class DenoiseLatentsInvocation(BaseInvocation):
     negative_conditioning: ConditioningField = InputField(
         description=FieldDescriptions.negative_cond, input=Input.Connection, ui_order=1
     )
-    noise: Optional[LatentsField] = InputField(description=FieldDescriptions.noise, input=Input.Connection, ui_order=3)
+    noise: Optional[LatentsField] = InputField(
+        default=None,
+        description=FieldDescriptions.noise,
+        input=Input.Connection,
+        ui_order=3,
+    )
     steps: int = InputField(default=10, gt=0, description=FieldDescriptions.steps)
     cfg_scale: Union[float, List[float]] = InputField(
         default=7.5, ge=1, description=FieldDescriptions.cfg_scale, title="CFG Scale"
     )
-    denoising_start: float = InputField(default=0.0, ge=0, le=1, description=FieldDescriptions.denoising_start)
+    denoising_start: float = InputField(
+        default=0.0,
+        ge=0,
+        le=1,
+        description=FieldDescriptions.denoising_start,
+    )
     denoising_end: float = InputField(default=1.0, ge=0, le=1, description=FieldDescriptions.denoising_end)
     scheduler: SAMPLER_NAME_VALUES = InputField(
-        default="euler", description=FieldDescriptions.scheduler, ui_type=UIType.Scheduler
+        default="euler",
+        description=FieldDescriptions.scheduler,
+        ui_type=UIType.Scheduler,
     )
-    unet: UNetField = InputField(description=FieldDescriptions.unet, input=Input.Connection, title="UNet", ui_order=2)
-    control: Union[ControlField, list[ControlField]] = InputField(
+    unet: UNetField = InputField(
+        description=FieldDescriptions.unet,
+        input=Input.Connection,
+        title="UNet",
+        ui_order=2,
+    )
+    control: Optional[Union[ControlField, list[ControlField]]] = InputField(
         default=None,
         input=Input.Connection,
         ui_order=5,
     )
     ip_adapter: Optional[Union[IPAdapterField, list[IPAdapterField]]] = InputField(
-        description=FieldDescriptions.ip_adapter, title="IP-Adapter", default=None, input=Input.Connection, ui_order=6
+        description=FieldDescriptions.ip_adapter,
+        title="IP-Adapter",
+        default=None,
+        input=Input.Connection,
+        ui_order=6,
     )
-    t2i_adapter: Union[T2IAdapterField, list[T2IAdapterField]] = InputField(
-        description=FieldDescriptions.t2i_adapter, title="T2I-Adapter", default=None, input=Input.Connection, ui_order=7
+    t2i_adapter: Optional[Union[T2IAdapterField, list[T2IAdapterField]]] = InputField(
+        description=FieldDescriptions.t2i_adapter,
+        title="T2I-Adapter",
+        default=None,
+        input=Input.Connection,
+        ui_order=7,
+    )
+    latents: Optional[LatentsField] = InputField(
+        default=None, description=FieldDescriptions.latents, input=Input.Connection
     )
-    latents: Optional[LatentsField] = InputField(description=FieldDescriptions.latents, input=Input.Connection)
     denoise_mask: Optional[DenoiseMaskField] = InputField(
-        default=None, description=FieldDescriptions.mask, input=Input.Connection, ui_order=8
+        default=None,
+        description=FieldDescriptions.mask,
+        input=Input.Connection,
+        ui_order=8,
     )
 
-    @validator("cfg_scale")
+    @field_validator("cfg_scale")
     def ge_one(cls, v):
         """validate that all cfg_scale values are >= 1"""
         if isinstance(v, list):
@@ -259,7 +305,7 @@ class DenoiseLatentsInvocation(BaseInvocation):
         stable_diffusion_step_callback(
             context=context,
             intermediate_state=intermediate_state,
-            node=self.dict(),
+            node=self.model_dump(),
             source_node_id=source_node_id,
             base_model=base_model,
         )
@@ -451,9 +497,10 @@ class DenoiseLatentsInvocation(BaseInvocation):
             # models are needed in memory. This would help to reduce peak memory utilization in low-memory environments.
             with image_encoder_model_info as image_encoder_model:
                 # Get image embeddings from CLIP and ImageProjModel.
-                image_prompt_embeds, uncond_image_prompt_embeds = ip_adapter_model.get_image_embeds(
-                    input_image, image_encoder_model
-                )
+                (
+                    image_prompt_embeds,
+                    uncond_image_prompt_embeds,
+                ) = ip_adapter_model.get_image_embeds(input_image, image_encoder_model)
                 conditioning_data.ip_adapter_conditioning.append(
                     IPAdapterConditioningInfo(image_prompt_embeds, uncond_image_prompt_embeds)
                 )
@@ -628,7 +675,10 @@ class DenoiseLatentsInvocation(BaseInvocation):
             # TODO(ryand): I have hard-coded `do_classifier_free_guidance=True` to mirror the behaviour of ControlNets,
             # below. Investigate whether this is appropriate.
             t2i_adapter_data = self.run_t2i_adapters(
-                context, self.t2i_adapter, latents.shape, do_classifier_free_guidance=True
+                context,
+                self.t2i_adapter,
+                latents.shape,
+                do_classifier_free_guidance=True,
             )
 
             # Get the source node id (we are invoking the prepared node)
@@ -641,7 +691,7 @@ class DenoiseLatentsInvocation(BaseInvocation):
             def _lora_loader():
                 for lora in self.unet.loras:
                     lora_info = context.services.model_manager.get_model(
-                        **lora.dict(exclude={"weight"}),
+                        **lora.model_dump(exclude={"weight"}),
                         context=context,
                     )
                     yield (lora_info.context.model, lora.weight)
@@ -649,7 +699,7 @@ class DenoiseLatentsInvocation(BaseInvocation):
                 return
 
             unet_info = context.services.model_manager.get_model(
-                **self.unet.unet.dict(),
+                **self.unet.unet.model_dump(),
                 context=context,
             )
             with (
@@ -701,7 +751,10 @@ class DenoiseLatentsInvocation(BaseInvocation):
                     denoising_end=self.denoising_end,
                 )
 
-                result_latents, result_attention_map_saver = pipeline.latents_from_embeddings(
+                (
+                    result_latents,
+                    result_attention_map_saver,
+                ) = pipeline.latents_from_embeddings(
                     latents=latents,
                     timesteps=timesteps,
                     init_timestep=init_timestep,
@@ -729,7 +782,11 @@ class DenoiseLatentsInvocation(BaseInvocation):
 
 
 @invocation(
-    "l2i", title="Latents to Image", tags=["latents", "image", "vae", "l2i"], category="latents", version="1.0.0"
+    "l2i",
+    title="Latents to Image",
+    tags=["latents", "image", "vae", "l2i"],
+    category="latents",
+    version="1.0.0",
 )
 class LatentsToImageInvocation(BaseInvocation):
     """Generates an image from latents."""
@@ -744,7 +801,7 @@ class LatentsToImageInvocation(BaseInvocation):
     )
     tiled: bool = InputField(default=False, description=FieldDescriptions.tiled)
     fp32: bool = InputField(default=DEFAULT_PRECISION == "float32", description=FieldDescriptions.fp32)
-    metadata: CoreMetadata = InputField(
+    metadata: Optional[CoreMetadata] = InputField(
         default=None,
         description=FieldDescriptions.core_metadata,
         ui_hidden=True,
@@ -755,7 +812,7 @@ class LatentsToImageInvocation(BaseInvocation):
         latents = context.services.latents.get(self.latents.latents_name)
 
         vae_info = context.services.model_manager.get_model(
-            **self.vae.vae.dict(),
+            **self.vae.vae.model_dump(),
             context=context,
         )
 
@@ -817,7 +874,7 @@ class LatentsToImageInvocation(BaseInvocation):
             node_id=self.id,
             session_id=context.graph_execution_state_id,
             is_intermediate=self.is_intermediate,
-            metadata=self.metadata.dict() if self.metadata else None,
+            metadata=self.metadata.model_dump() if self.metadata else None,
             workflow=self.workflow,
         )
 
@@ -831,7 +888,13 @@ class LatentsToImageInvocation(BaseInvocation):
 LATENTS_INTERPOLATION_MODE = Literal["nearest", "linear", "bilinear", "bicubic", "trilinear", "area", "nearest-exact"]
 
 
-@invocation("lresize", title="Resize Latents", tags=["latents", "resize"], category="latents", version="1.0.0")
+@invocation(
+    "lresize",
+    title="Resize Latents",
+    tags=["latents", "resize"],
+    category="latents",
+    version="1.0.0",
+)
 class ResizeLatentsInvocation(BaseInvocation):
     """Resizes latents to explicit width/height (in pixels). Provided dimensions are floor-divided by 8."""
 
@@ -877,7 +940,13 @@ class ResizeLatentsInvocation(BaseInvocation):
         return build_latents_output(latents_name=name, latents=resized_latents, seed=self.latents.seed)
 
 
-@invocation("lscale", title="Scale Latents", tags=["latents", "resize"], category="latents", version="1.0.0")
+@invocation(
+    "lscale",
+    title="Scale Latents",
+    tags=["latents", "resize"],
+    category="latents",
+    version="1.0.0",
+)
 class ScaleLatentsInvocation(BaseInvocation):
     """Scales latents by a given factor."""
 
@@ -916,7 +985,11 @@ class ScaleLatentsInvocation(BaseInvocation):
 
 
 @invocation(
-    "i2l", title="Image to Latents", tags=["latents", "image", "vae", "i2l"], category="latents", version="1.0.0"
+    "i2l",
+    title="Image to Latents",
+    tags=["latents", "image", "vae", "i2l"],
+    category="latents",
+    version="1.0.0",
 )
 class ImageToLatentsInvocation(BaseInvocation):
     """Encodes an image into latents."""
@@ -980,7 +1053,7 @@ class ImageToLatentsInvocation(BaseInvocation):
         image = context.services.images.get_pil_image(self.image.image_name)
 
         vae_info = context.services.model_manager.get_model(
-            **self.vae.vae.dict(),
+            **self.vae.vae.model_dump(),
             context=context,
         )
 
@@ -1008,7 +1081,13 @@ class ImageToLatentsInvocation(BaseInvocation):
         return vae.encode(image_tensor).latents
 
 
-@invocation("lblend", title="Blend Latents", tags=["latents", "blend"], category="latents", version="1.0.0")
+@invocation(
+    "lblend",
+    title="Blend Latents",
+    tags=["latents", "blend"],
+    category="latents",
+    version="1.0.0",
+)
 class BlendLatentsInvocation(BaseInvocation):
     """Blend two latents using a given alpha. Latents must have same size."""
 
diff --git a/invokeai/app/invocations/math.py b/invokeai/app/invocations/math.py
index b52cbb28bf..2aefa1def4 100644
--- a/invokeai/app/invocations/math.py
+++ b/invokeai/app/invocations/math.py
@@ -3,7 +3,7 @@
 from typing import Literal
 
 import numpy as np
-from pydantic import validator
+from pydantic import field_validator
 
 from invokeai.app.invocations.primitives import FloatOutput, IntegerOutput
 
@@ -72,7 +72,14 @@ class RandomIntInvocation(BaseInvocation):
         return IntegerOutput(value=np.random.randint(self.low, self.high))
 
 
-@invocation("rand_float", title="Random Float", tags=["math", "float", "random"], category="math", version="1.0.0")
+@invocation(
+    "rand_float",
+    title="Random Float",
+    tags=["math", "float", "random"],
+    category="math",
+    version="1.0.1",
+    use_cache=False,
+)
 class RandomFloatInvocation(BaseInvocation):
     """Outputs a single random float"""
 
@@ -178,7 +185,7 @@ class IntegerMathInvocation(BaseInvocation):
     a: int = InputField(default=0, description=FieldDescriptions.num_1)
     b: int = InputField(default=0, description=FieldDescriptions.num_2)
 
-    @validator("b")
+    @field_validator("b")
     def no_unrepresentable_results(cls, v, values):
         if values["operation"] == "DIV" and v == 0:
             raise ValueError("Cannot divide by zero")
@@ -252,7 +259,7 @@ class FloatMathInvocation(BaseInvocation):
     a: float = InputField(default=0, description=FieldDescriptions.num_1)
     b: float = InputField(default=0, description=FieldDescriptions.num_2)
 
-    @validator("b")
+    @field_validator("b")
     def no_unrepresentable_results(cls, v, values):
         if values["operation"] == "DIV" and v == 0:
             raise ValueError("Cannot divide by zero")
diff --git a/invokeai/app/invocations/metadata.py b/invokeai/app/invocations/metadata.py
index 54e385feb3..4d76926aaa 100644
--- a/invokeai/app/invocations/metadata.py
+++ b/invokeai/app/invocations/metadata.py
@@ -44,28 +44,31 @@ class CoreMetadata(BaseModelExcludeNull):
     """Core generation metadata for an image generated in InvokeAI."""
 
     app_version: str = Field(default=__version__, description="The version of InvokeAI used to generate this image")
-    generation_mode: str = Field(
+    generation_mode: Optional[str] = Field(
+        default=None,
         description="The generation mode that output this image",
     )
-    created_by: Optional[str] = Field(description="The name of the creator of the image")
-    positive_prompt: str = Field(description="The positive prompt parameter")
-    negative_prompt: str = Field(description="The negative prompt parameter")
-    width: int = Field(description="The width parameter")
-    height: int = Field(description="The height parameter")
-    seed: int = Field(description="The seed used for noise generation")
-    rand_device: str = Field(description="The device used for random number generation")
-    cfg_scale: float = Field(description="The classifier-free guidance scale parameter")
-    steps: int = Field(description="The number of steps used for inference")
-    scheduler: str = Field(description="The scheduler used for inference")
+    created_by: Optional[str] = Field(default=None, description="The name of the creator of the image")
+    positive_prompt: Optional[str] = Field(default=None, description="The positive prompt parameter")
+    negative_prompt: Optional[str] = Field(default=None, description="The negative prompt parameter")
+    width: Optional[int] = Field(default=None, description="The width parameter")
+    height: Optional[int] = Field(default=None, description="The height parameter")
+    seed: Optional[int] = Field(default=None, description="The seed used for noise generation")
+    rand_device: Optional[str] = Field(default=None, description="The device used for random number generation")
+    cfg_scale: Optional[float] = Field(default=None, description="The classifier-free guidance scale parameter")
+    steps: Optional[int] = Field(default=None, description="The number of steps used for inference")
+    scheduler: Optional[str] = Field(default=None, description="The scheduler used for inference")
     clip_skip: Optional[int] = Field(
         default=None,
         description="The number of skipped CLIP layers",
     )
-    model: MainModelField = Field(description="The main model used for inference")
-    controlnets: list[ControlField] = Field(description="The ControlNets used for inference")
-    ipAdapters: list[IPAdapterMetadataField] = Field(description="The IP Adapters used for inference")
-    t2iAdapters: list[T2IAdapterField] = Field(description="The IP Adapters used for inference")
-    loras: list[LoRAMetadataField] = Field(description="The LoRAs used for inference")
+    model: Optional[MainModelField] = Field(default=None, description="The main model used for inference")
+    controlnets: Optional[list[ControlField]] = Field(default=None, description="The ControlNets used for inference")
+    ipAdapters: Optional[list[IPAdapterMetadataField]] = Field(
+        default=None, description="The IP Adapters used for inference"
+    )
+    t2iAdapters: Optional[list[T2IAdapterField]] = Field(default=None, description="The IP Adapters used for inference")
+    loras: Optional[list[LoRAMetadataField]] = Field(default=None, description="The LoRAs used for inference")
     vae: Optional[VAEModelField] = Field(
         default=None,
         description="The VAE used for decoding, if the main model's default was not used",
@@ -122,27 +125,34 @@ class MetadataAccumulatorOutput(BaseInvocationOutput):
 class MetadataAccumulatorInvocation(BaseInvocation):
     """Outputs a Core Metadata Object"""
 
-    generation_mode: str = InputField(
+    generation_mode: Optional[str] = InputField(
+        default=None,
         description="The generation mode that output this image",
     )
-    positive_prompt: str = InputField(description="The positive prompt parameter")
-    negative_prompt: str = InputField(description="The negative prompt parameter")
-    width: int = InputField(description="The width parameter")
-    height: int = InputField(description="The height parameter")
-    seed: int = InputField(description="The seed used for noise generation")
-    rand_device: str = InputField(description="The device used for random number generation")
-    cfg_scale: float = InputField(description="The classifier-free guidance scale parameter")
-    steps: int = InputField(description="The number of steps used for inference")
-    scheduler: str = InputField(description="The scheduler used for inference")
-    clip_skip: Optional[int] = Field(
+    positive_prompt: Optional[str] = InputField(default=None, description="The positive prompt parameter")
+    negative_prompt: Optional[str] = InputField(default=None, description="The negative prompt parameter")
+    width: Optional[int] = InputField(default=None, description="The width parameter")
+    height: Optional[int] = InputField(default=None, description="The height parameter")
+    seed: Optional[int] = InputField(default=None, description="The seed used for noise generation")
+    rand_device: Optional[str] = InputField(default=None, description="The device used for random number generation")
+    cfg_scale: Optional[float] = InputField(default=None, description="The classifier-free guidance scale parameter")
+    steps: Optional[int] = InputField(default=None, description="The number of steps used for inference")
+    scheduler: Optional[str] = InputField(default=None, description="The scheduler used for inference")
+    clip_skip: Optional[int] = InputField(
         default=None,
         description="The number of skipped CLIP layers",
     )
-    model: MainModelField = InputField(description="The main model used for inference")
-    controlnets: list[ControlField] = InputField(description="The ControlNets used for inference")
-    ipAdapters: list[IPAdapterMetadataField] = InputField(description="The IP Adapters used for inference")
-    t2iAdapters: list[T2IAdapterField] = Field(description="The IP Adapters used for inference")
-    loras: list[LoRAMetadataField] = InputField(description="The LoRAs used for inference")
+    model: Optional[MainModelField] = InputField(default=None, description="The main model used for inference")
+    controlnets: Optional[list[ControlField]] = InputField(
+        default=None, description="The ControlNets used for inference"
+    )
+    ipAdapters: Optional[list[IPAdapterMetadataField]] = InputField(
+        default=None, description="The IP Adapters used for inference"
+    )
+    t2iAdapters: Optional[list[T2IAdapterField]] = InputField(
+        default=None, description="The IP Adapters used for inference"
+    )
+    loras: Optional[list[LoRAMetadataField]] = InputField(default=None, description="The LoRAs used for inference")
     strength: Optional[float] = InputField(
         default=None,
         description="The strength used for latents-to-latents",
@@ -156,6 +166,20 @@ class MetadataAccumulatorInvocation(BaseInvocation):
         description="The VAE used for decoding, if the main model's default was not used",
     )
 
+    # High resolution fix metadata.
+    hrf_width: Optional[int] = InputField(
+        default=None,
+        description="The high resolution fix height and width multipler.",
+    )
+    hrf_height: Optional[int] = InputField(
+        default=None,
+        description="The high resolution fix height and width multipler.",
+    )
+    hrf_strength: Optional[float] = InputField(
+        default=None,
+        description="The high resolution fix img2img strength used in the upscale pass.",
+    )
+
     # SDXL
     positive_style_prompt: Optional[str] = InputField(
         default=None,
@@ -199,4 +223,4 @@ class MetadataAccumulatorInvocation(BaseInvocation):
     def invoke(self, context: InvocationContext) -> MetadataAccumulatorOutput:
         """Collects and outputs a CoreMetadata object"""
 
-        return MetadataAccumulatorOutput(metadata=CoreMetadata(**self.dict()))
+        return MetadataAccumulatorOutput(metadata=CoreMetadata(**self.model_dump()))
diff --git a/invokeai/app/invocations/model.py b/invokeai/app/invocations/model.py
index 625d848bce..32815191c2 100644
--- a/invokeai/app/invocations/model.py
+++ b/invokeai/app/invocations/model.py
@@ -1,7 +1,7 @@
 import copy
 from typing import List, Optional
 
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, ConfigDict, Field
 
 from invokeai.app.invocations.shared import FreeUConfig
 
@@ -26,6 +26,8 @@ class ModelInfo(BaseModel):
     model_type: ModelType = Field(description="Info to load submodel")
     submodel: Optional[SubModelType] = Field(default=None, description="Info to load submodel")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 class LoraInfo(ModelInfo):
     weight: float = Field(description="Lora's weight which to use when apply to model")
@@ -87,6 +89,8 @@ class MainModelField(BaseModel):
     base_model: BaseModelType = Field(description="Base model")
     model_type: ModelType = Field(description="Model Type")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 class LoRAModelField(BaseModel):
     """LoRA model field"""
@@ -94,8 +98,16 @@ class LoRAModelField(BaseModel):
     model_name: str = Field(description="Name of the LoRA model")
     base_model: BaseModelType = Field(description="Base model")
 
+    model_config = ConfigDict(protected_namespaces=())
 
-@invocation("main_model_loader", title="Main Model", tags=["model"], category="model", version="1.0.0")
+
+@invocation(
+    "main_model_loader",
+    title="Main Model",
+    tags=["model"],
+    category="model",
+    version="1.0.0",
+)
 class MainModelLoaderInvocation(BaseInvocation):
     """Loads a main model, outputting its submodels."""
 
@@ -202,10 +214,16 @@ class LoraLoaderInvocation(BaseInvocation):
     lora: LoRAModelField = InputField(description=FieldDescriptions.lora_model, input=Input.Direct, title="LoRA")
     weight: float = InputField(default=0.75, description=FieldDescriptions.lora_weight)
     unet: Optional[UNetField] = InputField(
-        default=None, description=FieldDescriptions.unet, input=Input.Connection, title="UNet"
+        default=None,
+        description=FieldDescriptions.unet,
+        input=Input.Connection,
+        title="UNet",
     )
     clip: Optional[ClipField] = InputField(
-        default=None, description=FieldDescriptions.clip, input=Input.Connection, title="CLIP"
+        default=None,
+        description=FieldDescriptions.clip,
+        input=Input.Connection,
+        title="CLIP",
     )
 
     def invoke(self, context: InvocationContext) -> LoraLoaderOutput:
@@ -266,20 +284,35 @@ class SDXLLoraLoaderOutput(BaseInvocationOutput):
     clip2: Optional[ClipField] = OutputField(default=None, description=FieldDescriptions.clip, title="CLIP 2")
 
 
-@invocation("sdxl_lora_loader", title="SDXL LoRA", tags=["lora", "model"], category="model", version="1.0.0")
+@invocation(
+    "sdxl_lora_loader",
+    title="SDXL LoRA",
+    tags=["lora", "model"],
+    category="model",
+    version="1.0.0",
+)
 class SDXLLoraLoaderInvocation(BaseInvocation):
     """Apply selected lora to unet and text_encoder."""
 
     lora: LoRAModelField = InputField(description=FieldDescriptions.lora_model, input=Input.Direct, title="LoRA")
     weight: float = InputField(default=0.75, description=FieldDescriptions.lora_weight)
     unet: Optional[UNetField] = InputField(
-        default=None, description=FieldDescriptions.unet, input=Input.Connection, title="UNet"
+        default=None,
+        description=FieldDescriptions.unet,
+        input=Input.Connection,
+        title="UNet",
     )
     clip: Optional[ClipField] = InputField(
-        default=None, description=FieldDescriptions.clip, input=Input.Connection, title="CLIP 1"
+        default=None,
+        description=FieldDescriptions.clip,
+        input=Input.Connection,
+        title="CLIP 1",
     )
     clip2: Optional[ClipField] = InputField(
-        default=None, description=FieldDescriptions.clip, input=Input.Connection, title="CLIP 2"
+        default=None,
+        description=FieldDescriptions.clip,
+        input=Input.Connection,
+        title="CLIP 2",
     )
 
     def invoke(self, context: InvocationContext) -> SDXLLoraLoaderOutput:
@@ -352,13 +385,18 @@ class VAEModelField(BaseModel):
     model_name: str = Field(description="Name of the model")
     base_model: BaseModelType = Field(description="Base model")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 @invocation("vae_loader", title="VAE", tags=["vae", "model"], category="model", version="1.0.0")
 class VaeLoaderInvocation(BaseInvocation):
     """Loads a VAE model, outputting a VaeLoaderOutput"""
 
     vae_model: VAEModelField = InputField(
-        description=FieldDescriptions.vae_model, input=Input.Direct, ui_type=UIType.VaeModel, title="VAE"
+        description=FieldDescriptions.vae_model,
+        input=Input.Direct,
+        ui_type=UIType.VaeModel,
+        title="VAE",
     )
 
     def invoke(self, context: InvocationContext) -> VAEOutput:
@@ -387,19 +425,31 @@ class VaeLoaderInvocation(BaseInvocation):
 class SeamlessModeOutput(BaseInvocationOutput):
     """Modified Seamless Model output"""
 
-    unet: Optional[UNetField] = OutputField(description=FieldDescriptions.unet, title="UNet")
-    vae: Optional[VaeField] = OutputField(description=FieldDescriptions.vae, title="VAE")
+    unet: Optional[UNetField] = OutputField(default=None, description=FieldDescriptions.unet, title="UNet")
+    vae: Optional[VaeField] = OutputField(default=None, description=FieldDescriptions.vae, title="VAE")
 
 
-@invocation("seamless", title="Seamless", tags=["seamless", "model"], category="model", version="1.0.0")
+@invocation(
+    "seamless",
+    title="Seamless",
+    tags=["seamless", "model"],
+    category="model",
+    version="1.0.0",
+)
 class SeamlessModeInvocation(BaseInvocation):
     """Applies the seamless transformation to the Model UNet and VAE."""
 
     unet: Optional[UNetField] = InputField(
-        default=None, description=FieldDescriptions.unet, input=Input.Connection, title="UNet"
+        default=None,
+        description=FieldDescriptions.unet,
+        input=Input.Connection,
+        title="UNet",
     )
     vae: Optional[VaeField] = InputField(
-        default=None, description=FieldDescriptions.vae_model, input=Input.Connection, title="VAE"
+        default=None,
+        description=FieldDescriptions.vae_model,
+        input=Input.Connection,
+        title="VAE",
     )
     seamless_y: bool = InputField(default=True, input=Input.Any, description="Specify whether Y axis is seamless")
     seamless_x: bool = InputField(default=True, input=Input.Any, description="Specify whether X axis is seamless")
diff --git a/invokeai/app/invocations/noise.py b/invokeai/app/invocations/noise.py
index c46747aa89..3c1651a2f0 100644
--- a/invokeai/app/invocations/noise.py
+++ b/invokeai/app/invocations/noise.py
@@ -2,7 +2,7 @@
 
 
 import torch
-from pydantic import validator
+from pydantic import field_validator
 
 from invokeai.app.invocations.latent import LatentsField
 from invokeai.app.util.misc import SEED_MAX, get_random_seed
@@ -65,7 +65,7 @@ Nodes
 class NoiseOutput(BaseInvocationOutput):
     """Invocation noise output"""
 
-    noise: LatentsField = OutputField(default=None, description=FieldDescriptions.noise)
+    noise: LatentsField = OutputField(description=FieldDescriptions.noise)
     width: int = OutputField(description=FieldDescriptions.width)
     height: int = OutputField(description=FieldDescriptions.height)
 
@@ -78,7 +78,13 @@ def build_noise_output(latents_name: str, latents: torch.Tensor, seed: int):
     )
 
 
-@invocation("noise", title="Noise", tags=["latents", "noise"], category="latents", version="1.0.0")
+@invocation(
+    "noise",
+    title="Noise",
+    tags=["latents", "noise"],
+    category="latents",
+    version="1.0.0",
+)
 class NoiseInvocation(BaseInvocation):
     """Generates latent noise."""
 
@@ -105,7 +111,7 @@ class NoiseInvocation(BaseInvocation):
         description="Use CPU for noise generation (for reproducible results across platforms)",
     )
 
-    @validator("seed", pre=True)
+    @field_validator("seed", mode="before")
     def modulo_seed(cls, v):
         """Returns the seed modulo (SEED_MAX + 1) to ensure it is within the valid range."""
         return v % (SEED_MAX + 1)
diff --git a/invokeai/app/invocations/onnx.py b/invokeai/app/invocations/onnx.py
index 1d531d45a2..3f4f688cf4 100644
--- a/invokeai/app/invocations/onnx.py
+++ b/invokeai/app/invocations/onnx.py
@@ -9,18 +9,18 @@ from typing import List, Literal, Optional, Union
 import numpy as np
 import torch
 from diffusers.image_processor import VaeImageProcessor
-from pydantic import BaseModel, Field, validator
+from pydantic import BaseModel, ConfigDict, Field, field_validator
 from tqdm import tqdm
 
 from invokeai.app.invocations.metadata import CoreMetadata
 from invokeai.app.invocations.primitives import ConditioningField, ConditioningOutput, ImageField, ImageOutput
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 from invokeai.app.util.step_callback import stable_diffusion_step_callback
 from invokeai.backend import BaseModelType, ModelType, SubModelType
 
 from ...backend.model_management import ONNXModelPatcher
 from ...backend.stable_diffusion import PipelineIntermediateState
 from ...backend.util import choose_torch_device
-from ..models.image import ImageCategory, ResourceOrigin
 from .baseinvocation import (
     BaseInvocation,
     BaseInvocationOutput,
@@ -63,14 +63,17 @@ class ONNXPromptInvocation(BaseInvocation):
 
     def invoke(self, context: InvocationContext) -> ConditioningOutput:
         tokenizer_info = context.services.model_manager.get_model(
-            **self.clip.tokenizer.dict(),
+            **self.clip.tokenizer.model_dump(),
         )
         text_encoder_info = context.services.model_manager.get_model(
-            **self.clip.text_encoder.dict(),
+            **self.clip.text_encoder.model_dump(),
         )
         with tokenizer_info as orig_tokenizer, text_encoder_info as text_encoder:  # , ExitStack() as stack:
             loras = [
-                (context.services.model_manager.get_model(**lora.dict(exclude={"weight"})).context.model, lora.weight)
+                (
+                    context.services.model_manager.get_model(**lora.model_dump(exclude={"weight"})).context.model,
+                    lora.weight,
+                )
                 for lora in self.clip.loras
             ]
 
@@ -175,14 +178,14 @@ class ONNXTextToLatentsInvocation(BaseInvocation):
         description=FieldDescriptions.unet,
         input=Input.Connection,
     )
-    control: Optional[Union[ControlField, list[ControlField]]] = InputField(
+    control: Union[ControlField, list[ControlField]] = InputField(
         default=None,
         description=FieldDescriptions.control,
     )
     # seamless:   bool = InputField(default=False, description="Whether or not to generate an image that can tile without seams", )
     # seamless_axes: str = InputField(default="", description="The axes to tile the image on, 'x' and/or 'y'")
 
-    @validator("cfg_scale")
+    @field_validator("cfg_scale")
     def ge_one(cls, v):
         """validate that all cfg_scale values are >= 1"""
         if isinstance(v, list):
@@ -241,7 +244,7 @@ class ONNXTextToLatentsInvocation(BaseInvocation):
             stable_diffusion_step_callback(
                 context=context,
                 intermediate_state=intermediate_state,
-                node=self.dict(),
+                node=self.model_dump(),
                 source_node_id=source_node_id,
             )
 
@@ -254,12 +257,15 @@ class ONNXTextToLatentsInvocation(BaseInvocation):
                 eta=0.0,
             )
 
-        unet_info = context.services.model_manager.get_model(**self.unet.unet.dict())
+        unet_info = context.services.model_manager.get_model(**self.unet.unet.model_dump())
 
         with unet_info as unet:  # , ExitStack() as stack:
             # loras = [(stack.enter_context(context.services.model_manager.get_model(**lora.dict(exclude={"weight"}))), lora.weight) for lora in self.unet.loras]
             loras = [
-                (context.services.model_manager.get_model(**lora.dict(exclude={"weight"})).context.model, lora.weight)
+                (
+                    context.services.model_manager.get_model(**lora.model_dump(exclude={"weight"})).context.model,
+                    lora.weight,
+                )
                 for lora in self.unet.loras
             ]
 
@@ -346,7 +352,7 @@ class ONNXLatentsToImageInvocation(BaseInvocation):
             raise Exception(f"Expected vae_decoder, found: {self.vae.vae.model_type}")
 
         vae_info = context.services.model_manager.get_model(
-            **self.vae.vae.dict(),
+            **self.vae.vae.model_dump(),
         )
 
         # clear memory as vae decode can request a lot
@@ -375,7 +381,7 @@ class ONNXLatentsToImageInvocation(BaseInvocation):
             node_id=self.id,
             session_id=context.graph_execution_state_id,
             is_intermediate=self.is_intermediate,
-            metadata=self.metadata.dict() if self.metadata else None,
+            metadata=self.metadata.model_dump() if self.metadata else None,
             workflow=self.workflow,
         )
 
@@ -403,6 +409,8 @@ class OnnxModelField(BaseModel):
     base_model: BaseModelType = Field(description="Base model")
     model_type: ModelType = Field(description="Model Type")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 @invocation("onnx_model_loader", title="ONNX Main Model", tags=["onnx", "model"], category="model", version="1.0.0")
 class OnnxModelLoaderInvocation(BaseInvocation):
diff --git a/invokeai/app/invocations/param_easing.py b/invokeai/app/invocations/param_easing.py
index 7c327a6657..0e86fb978b 100644
--- a/invokeai/app/invocations/param_easing.py
+++ b/invokeai/app/invocations/param_easing.py
@@ -44,13 +44,22 @@ from invokeai.app.invocations.primitives import FloatCollectionOutput
 from .baseinvocation import BaseInvocation, InputField, InvocationContext, invocation
 
 
-@invocation("float_range", title="Float Range", tags=["math", "range"], category="math", version="1.0.0")
+@invocation(
+    "float_range",
+    title="Float Range",
+    tags=["math", "range"],
+    category="math",
+    version="1.0.0",
+)
 class FloatLinearRangeInvocation(BaseInvocation):
     """Creates a range"""
 
     start: float = InputField(default=5, description="The first value of the range")
     stop: float = InputField(default=10, description="The last value of the range")
-    steps: int = InputField(default=30, description="number of values to interpolate over (including start and stop)")
+    steps: int = InputField(
+        default=30,
+        description="number of values to interpolate over (including start and stop)",
+    )
 
     def invoke(self, context: InvocationContext) -> FloatCollectionOutput:
         param_list = list(np.linspace(self.start, self.stop, self.steps))
@@ -95,7 +104,13 @@ EASING_FUNCTION_KEYS = Literal[tuple(list(EASING_FUNCTIONS_MAP.keys()))]
 
 
 # actually I think for now could just use CollectionOutput (which is list[Any]
-@invocation("step_param_easing", title="Step Param Easing", tags=["step", "easing"], category="step", version="1.0.0")
+@invocation(
+    "step_param_easing",
+    title="Step Param Easing",
+    tags=["step", "easing"],
+    category="step",
+    version="1.0.0",
+)
 class StepParamEasingInvocation(BaseInvocation):
     """Experimental per-step parameter easing for denoising steps"""
 
@@ -159,7 +174,9 @@ class StepParamEasingInvocation(BaseInvocation):
                 context.services.logger.debug("base easing duration: " + str(base_easing_duration))
             even_num_steps = num_easing_steps % 2 == 0  # even number of steps
             easing_function = easing_class(
-                start=self.start_value, end=self.end_value, duration=base_easing_duration - 1
+                start=self.start_value,
+                end=self.end_value,
+                duration=base_easing_duration - 1,
             )
             base_easing_vals = list()
             for step_index in range(base_easing_duration):
@@ -199,7 +216,11 @@ class StepParamEasingInvocation(BaseInvocation):
         #
 
         else:  # no mirroring (default)
-            easing_function = easing_class(start=self.start_value, end=self.end_value, duration=num_easing_steps - 1)
+            easing_function = easing_class(
+                start=self.start_value,
+                end=self.end_value,
+                duration=num_easing_steps - 1,
+            )
             for step_index in range(num_easing_steps):
                 step_val = easing_function.ease(step_index)
                 easing_list.append(step_val)
diff --git a/invokeai/app/invocations/prompt.py b/invokeai/app/invocations/prompt.py
index b3d482b779..cb43a52447 100644
--- a/invokeai/app/invocations/prompt.py
+++ b/invokeai/app/invocations/prompt.py
@@ -3,7 +3,7 @@ from typing import Optional, Union
 
 import numpy as np
 from dynamicprompts.generators import CombinatorialPromptGenerator, RandomPromptGenerator
-from pydantic import validator
+from pydantic import field_validator
 
 from invokeai.app.invocations.primitives import StringCollectionOutput
 
@@ -21,7 +21,10 @@ from .baseinvocation import BaseInvocation, InputField, InvocationContext, UICom
 class DynamicPromptInvocation(BaseInvocation):
     """Parses a prompt using adieyal/dynamicprompts' random or combinatorial generator"""
 
-    prompt: str = InputField(description="The prompt to parse with dynamicprompts", ui_component=UIComponent.Textarea)
+    prompt: str = InputField(
+        description="The prompt to parse with dynamicprompts",
+        ui_component=UIComponent.Textarea,
+    )
     max_prompts: int = InputField(default=1, description="The number of prompts to generate")
     combinatorial: bool = InputField(default=False, description="Whether to use the combinatorial generator")
 
@@ -36,21 +39,31 @@ class DynamicPromptInvocation(BaseInvocation):
         return StringCollectionOutput(collection=prompts)
 
 
-@invocation("prompt_from_file", title="Prompts from File", tags=["prompt", "file"], category="prompt", version="1.0.0")
+@invocation(
+    "prompt_from_file",
+    title="Prompts from File",
+    tags=["prompt", "file"],
+    category="prompt",
+    version="1.0.0",
+)
 class PromptsFromFileInvocation(BaseInvocation):
     """Loads prompts from a text file"""
 
     file_path: str = InputField(description="Path to prompt text file")
     pre_prompt: Optional[str] = InputField(
-        default=None, description="String to prepend to each prompt", ui_component=UIComponent.Textarea
+        default=None,
+        description="String to prepend to each prompt",
+        ui_component=UIComponent.Textarea,
     )
     post_prompt: Optional[str] = InputField(
-        default=None, description="String to append to each prompt", ui_component=UIComponent.Textarea
+        default=None,
+        description="String to append to each prompt",
+        ui_component=UIComponent.Textarea,
     )
     start_line: int = InputField(default=1, ge=1, description="Line in the file to start start from")
     max_prompts: int = InputField(default=1, ge=0, description="Max lines to read from file (0=all)")
 
-    @validator("file_path")
+    @field_validator("file_path")
     def file_path_exists(cls, v):
         if not exists(v):
             raise ValueError(FileNotFoundError)
@@ -79,6 +92,10 @@ class PromptsFromFileInvocation(BaseInvocation):
 
     def invoke(self, context: InvocationContext) -> StringCollectionOutput:
         prompts = self.promptsFromFile(
-            self.file_path, self.pre_prompt, self.post_prompt, self.start_line, self.max_prompts
+            self.file_path,
+            self.pre_prompt,
+            self.post_prompt,
+            self.start_line,
+            self.max_prompts,
         )
         return StringCollectionOutput(collection=prompts)
diff --git a/invokeai/app/invocations/t2i_adapter.py b/invokeai/app/invocations/t2i_adapter.py
index e1bd8d0d04..76c250a552 100644
--- a/invokeai/app/invocations/t2i_adapter.py
+++ b/invokeai/app/invocations/t2i_adapter.py
@@ -1,6 +1,6 @@
 from typing import Union
 
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, ConfigDict, Field
 
 from invokeai.app.invocations.baseinvocation import (
     BaseInvocation,
@@ -23,6 +23,8 @@ class T2IAdapterModelField(BaseModel):
     model_name: str = Field(description="Name of the T2I-Adapter model")
     base_model: BaseModelType = Field(description="Base model")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 class T2IAdapterField(BaseModel):
     image: ImageField = Field(description="The T2I-Adapter image prompt.")
diff --git a/invokeai/app/invocations/upscale.py b/invokeai/app/invocations/upscale.py
index a1f3d2691a..d30bb71d95 100644
--- a/invokeai/app/invocations/upscale.py
+++ b/invokeai/app/invocations/upscale.py
@@ -7,10 +7,11 @@ import numpy as np
 import torch
 from basicsr.archs.rrdbnet_arch import RRDBNet
 from PIL import Image
+from pydantic import ConfigDict
 from realesrgan import RealESRGANer
 
 from invokeai.app.invocations.primitives import ImageField, ImageOutput
-from invokeai.app.models.image import ImageCategory, ResourceOrigin
+from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
 from invokeai.backend.util.devices import choose_torch_device
 
 from .baseinvocation import BaseInvocation, InputField, InvocationContext, invocation
@@ -38,6 +39,8 @@ class ESRGANInvocation(BaseInvocation):
         default=400, ge=0, description="Tile size for tiled ESRGAN upscaling (0=tiling disabled)"
     )
 
+    model_config = ConfigDict(protected_namespaces=())
+
     def invoke(self, context: InvocationContext) -> ImageOutput:
         image = context.services.images.get_pil_image(self.image.image_name)
         models_path = context.services.configuration.models_path
diff --git a/invokeai/app/models/exceptions.py b/invokeai/app/models/exceptions.py
deleted file mode 100644
index 662e1948ce..0000000000
--- a/invokeai/app/models/exceptions.py
+++ /dev/null
@@ -1,4 +0,0 @@
-class CanceledException(Exception):
-    """Execution canceled by user."""
-
-    pass
diff --git a/invokeai/app/models/image.py b/invokeai/app/models/image.py
deleted file mode 100644
index 88cf8af5f9..0000000000
--- a/invokeai/app/models/image.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from enum import Enum
-
-from pydantic import BaseModel, Field
-
-from invokeai.app.util.metaenum import MetaEnum
-
-
-class ProgressImage(BaseModel):
-    """The progress image sent intermittently during processing"""
-
-    width: int = Field(description="The effective width of the image in pixels")
-    height: int = Field(description="The effective height of the image in pixels")
-    dataURL: str = Field(description="The image data as a b64 data URL")
-
-
-class ResourceOrigin(str, Enum, metaclass=MetaEnum):
-    """The origin of a resource (eg image).
-
-    - INTERNAL: The resource was created by the application.
-    - EXTERNAL: The resource was not created by the application.
-    This may be a user-initiated upload, or an internal application upload (eg Canvas init image).
-    """
-
-    INTERNAL = "internal"
-    """The resource was created by the application."""
-    EXTERNAL = "external"
-    """The resource was not created by the application.
-    This may be a user-initiated upload, or an internal application upload (eg Canvas init image).
-    """
-
-
-class InvalidOriginException(ValueError):
-    """Raised when a provided value is not a valid ResourceOrigin.
-
-    Subclasses `ValueError`.
-    """
-
-    def __init__(self, message="Invalid resource origin."):
-        super().__init__(message)
-
-
-class ImageCategory(str, Enum, metaclass=MetaEnum):
-    """The category of an image.
-
-    - GENERAL: The image is an output, init image, or otherwise an image without a specialized purpose.
-    - MASK: The image is a mask image.
-    - CONTROL: The image is a ControlNet control image.
-    - USER: The image is a user-provide image.
-    - OTHER: The image is some other type of image with a specialized purpose. To be used by external nodes.
-    """
-
-    GENERAL = "general"
-    """GENERAL: The image is an output, init image, or otherwise an image without a specialized purpose."""
-    MASK = "mask"
-    """MASK: The image is a mask image."""
-    CONTROL = "control"
-    """CONTROL: The image is a ControlNet control image."""
-    USER = "user"
-    """USER: The image is a user-provide image."""
-    OTHER = "other"
-    """OTHER: The image is some other type of image with a specialized purpose. To be used by external nodes."""
-
-
-class InvalidImageCategoryException(ValueError):
-    """Raised when a provided value is not a valid ImageCategory.
-
-    Subclasses `ValueError`.
-    """
-
-    def __init__(self, message="Invalid image category."):
-        super().__init__(message)
diff --git a/invokeai/app/models/__init__.py b/invokeai/app/services/board_image_records/__init__.py
similarity index 100%
rename from invokeai/app/models/__init__.py
rename to invokeai/app/services/board_image_records/__init__.py
diff --git a/invokeai/app/services/board_image_records/board_image_records_base.py b/invokeai/app/services/board_image_records/board_image_records_base.py
new file mode 100644
index 0000000000..c8f7b35908
--- /dev/null
+++ b/invokeai/app/services/board_image_records/board_image_records_base.py
@@ -0,0 +1,47 @@
+from abc import ABC, abstractmethod
+from typing import Optional
+
+
+class BoardImageRecordStorageBase(ABC):
+    """Abstract base class for the one-to-many board-image relationship record storage."""
+
+    @abstractmethod
+    def add_image_to_board(
+        self,
+        board_id: str,
+        image_name: str,
+    ) -> None:
+        """Adds an image to a board."""
+        pass
+
+    @abstractmethod
+    def remove_image_from_board(
+        self,
+        image_name: str,
+    ) -> None:
+        """Removes an image from a board."""
+        pass
+
+    @abstractmethod
+    def get_all_board_image_names_for_board(
+        self,
+        board_id: str,
+    ) -> list[str]:
+        """Gets all board images for a board, as a list of the image names."""
+        pass
+
+    @abstractmethod
+    def get_board_for_image(
+        self,
+        image_name: str,
+    ) -> Optional[str]:
+        """Gets an image's board id, if it has one."""
+        pass
+
+    @abstractmethod
+    def get_image_count_for_board(
+        self,
+        board_id: str,
+    ) -> int:
+        """Gets the number of images for a board."""
+        pass
diff --git a/invokeai/app/services/board_image_record_storage.py b/invokeai/app/services/board_image_records/board_image_records_sqlite.py
similarity index 80%
rename from invokeai/app/services/board_image_record_storage.py
rename to invokeai/app/services/board_image_records/board_image_records_sqlite.py
index c4d06ec131..9f4e4379bc 100644
--- a/invokeai/app/services/board_image_record_storage.py
+++ b/invokeai/app/services/board_image_records/board_image_records_sqlite.py
@@ -1,69 +1,24 @@
 import sqlite3
 import threading
-from abc import ABC, abstractmethod
 from typing import Optional, cast
 
-from invokeai.app.services.image_record_storage import OffsetPaginatedResults
-from invokeai.app.services.models.image_record import ImageRecord, deserialize_image_record
+from invokeai.app.services.image_records.image_records_common import ImageRecord, deserialize_image_record
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+from invokeai.app.services.shared.sqlite import SqliteDatabase
 
-
-class BoardImageRecordStorageBase(ABC):
-    """Abstract base class for the one-to-many board-image relationship record storage."""
-
-    @abstractmethod
-    def add_image_to_board(
-        self,
-        board_id: str,
-        image_name: str,
-    ) -> None:
-        """Adds an image to a board."""
-        pass
-
-    @abstractmethod
-    def remove_image_from_board(
-        self,
-        image_name: str,
-    ) -> None:
-        """Removes an image from a board."""
-        pass
-
-    @abstractmethod
-    def get_all_board_image_names_for_board(
-        self,
-        board_id: str,
-    ) -> list[str]:
-        """Gets all board images for a board, as a list of the image names."""
-        pass
-
-    @abstractmethod
-    def get_board_for_image(
-        self,
-        image_name: str,
-    ) -> Optional[str]:
-        """Gets an image's board id, if it has one."""
-        pass
-
-    @abstractmethod
-    def get_image_count_for_board(
-        self,
-        board_id: str,
-    ) -> int:
-        """Gets the number of images for a board."""
-        pass
+from .board_image_records_base import BoardImageRecordStorageBase
 
 
 class SqliteBoardImageRecordStorage(BoardImageRecordStorageBase):
     _conn: sqlite3.Connection
     _cursor: sqlite3.Cursor
-    _lock: threading.Lock
+    _lock: threading.RLock
 
-    def __init__(self, conn: sqlite3.Connection, lock: threading.Lock) -> None:
+    def __init__(self, db: SqliteDatabase) -> None:
         super().__init__()
-        self._conn = conn
-        # Enable row factory to get rows as dictionaries (must be done before making the cursor!)
-        self._conn.row_factory = sqlite3.Row
+        self._lock = db.lock
+        self._conn = db.conn
         self._cursor = self._conn.cursor()
-        self._lock = lock
 
         try:
             self._lock.acquire()
diff --git a/invokeai/app/services/board_images.py b/invokeai/app/services/board_images.py
deleted file mode 100644
index 788722ec37..0000000000
--- a/invokeai/app/services/board_images.py
+++ /dev/null
@@ -1,112 +0,0 @@
-from abc import ABC, abstractmethod
-from logging import Logger
-from typing import Optional
-
-from invokeai.app.services.board_image_record_storage import BoardImageRecordStorageBase
-from invokeai.app.services.board_record_storage import BoardRecord, BoardRecordStorageBase
-from invokeai.app.services.image_record_storage import ImageRecordStorageBase
-from invokeai.app.services.models.board_record import BoardDTO
-from invokeai.app.services.urls import UrlServiceBase
-
-
-class BoardImagesServiceABC(ABC):
-    """High-level service for board-image relationship management."""
-
-    @abstractmethod
-    def add_image_to_board(
-        self,
-        board_id: str,
-        image_name: str,
-    ) -> None:
-        """Adds an image to a board."""
-        pass
-
-    @abstractmethod
-    def remove_image_from_board(
-        self,
-        image_name: str,
-    ) -> None:
-        """Removes an image from a board."""
-        pass
-
-    @abstractmethod
-    def get_all_board_image_names_for_board(
-        self,
-        board_id: str,
-    ) -> list[str]:
-        """Gets all board images for a board, as a list of the image names."""
-        pass
-
-    @abstractmethod
-    def get_board_for_image(
-        self,
-        image_name: str,
-    ) -> Optional[str]:
-        """Gets an image's board id, if it has one."""
-        pass
-
-
-class BoardImagesServiceDependencies:
-    """Service dependencies for the BoardImagesService."""
-
-    board_image_records: BoardImageRecordStorageBase
-    board_records: BoardRecordStorageBase
-    image_records: ImageRecordStorageBase
-    urls: UrlServiceBase
-    logger: Logger
-
-    def __init__(
-        self,
-        board_image_record_storage: BoardImageRecordStorageBase,
-        image_record_storage: ImageRecordStorageBase,
-        board_record_storage: BoardRecordStorageBase,
-        url: UrlServiceBase,
-        logger: Logger,
-    ):
-        self.board_image_records = board_image_record_storage
-        self.image_records = image_record_storage
-        self.board_records = board_record_storage
-        self.urls = url
-        self.logger = logger
-
-
-class BoardImagesService(BoardImagesServiceABC):
-    _services: BoardImagesServiceDependencies
-
-    def __init__(self, services: BoardImagesServiceDependencies):
-        self._services = services
-
-    def add_image_to_board(
-        self,
-        board_id: str,
-        image_name: str,
-    ) -> None:
-        self._services.board_image_records.add_image_to_board(board_id, image_name)
-
-    def remove_image_from_board(
-        self,
-        image_name: str,
-    ) -> None:
-        self._services.board_image_records.remove_image_from_board(image_name)
-
-    def get_all_board_image_names_for_board(
-        self,
-        board_id: str,
-    ) -> list[str]:
-        return self._services.board_image_records.get_all_board_image_names_for_board(board_id)
-
-    def get_board_for_image(
-        self,
-        image_name: str,
-    ) -> Optional[str]:
-        board_id = self._services.board_image_records.get_board_for_image(image_name)
-        return board_id
-
-
-def board_record_to_dto(board_record: BoardRecord, cover_image_name: Optional[str], image_count: int) -> BoardDTO:
-    """Converts a board record to a board DTO."""
-    return BoardDTO(
-        **board_record.dict(exclude={"cover_image_name"}),
-        cover_image_name=cover_image_name,
-        image_count=image_count,
-    )
diff --git a/invokeai/app/services/board_images/__init__.py b/invokeai/app/services/board_images/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/board_images/board_images_base.py b/invokeai/app/services/board_images/board_images_base.py
new file mode 100644
index 0000000000..356ff7068b
--- /dev/null
+++ b/invokeai/app/services/board_images/board_images_base.py
@@ -0,0 +1,39 @@
+from abc import ABC, abstractmethod
+from typing import Optional
+
+
+class BoardImagesServiceABC(ABC):
+    """High-level service for board-image relationship management."""
+
+    @abstractmethod
+    def add_image_to_board(
+        self,
+        board_id: str,
+        image_name: str,
+    ) -> None:
+        """Adds an image to a board."""
+        pass
+
+    @abstractmethod
+    def remove_image_from_board(
+        self,
+        image_name: str,
+    ) -> None:
+        """Removes an image from a board."""
+        pass
+
+    @abstractmethod
+    def get_all_board_image_names_for_board(
+        self,
+        board_id: str,
+    ) -> list[str]:
+        """Gets all board images for a board, as a list of the image names."""
+        pass
+
+    @abstractmethod
+    def get_board_for_image(
+        self,
+        image_name: str,
+    ) -> Optional[str]:
+        """Gets an image's board id, if it has one."""
+        pass
diff --git a/invokeai/app/services/models/board_image.py b/invokeai/app/services/board_images/board_images_common.py
similarity index 100%
rename from invokeai/app/services/models/board_image.py
rename to invokeai/app/services/board_images/board_images_common.py
diff --git a/invokeai/app/services/board_images/board_images_default.py b/invokeai/app/services/board_images/board_images_default.py
new file mode 100644
index 0000000000..85e478619c
--- /dev/null
+++ b/invokeai/app/services/board_images/board_images_default.py
@@ -0,0 +1,38 @@
+from typing import Optional
+
+from invokeai.app.services.invoker import Invoker
+
+from .board_images_base import BoardImagesServiceABC
+
+
+class BoardImagesService(BoardImagesServiceABC):
+    __invoker: Invoker
+
+    def start(self, invoker: Invoker) -> None:
+        self.__invoker = invoker
+
+    def add_image_to_board(
+        self,
+        board_id: str,
+        image_name: str,
+    ) -> None:
+        self.__invoker.services.board_image_records.add_image_to_board(board_id, image_name)
+
+    def remove_image_from_board(
+        self,
+        image_name: str,
+    ) -> None:
+        self.__invoker.services.board_image_records.remove_image_from_board(image_name)
+
+    def get_all_board_image_names_for_board(
+        self,
+        board_id: str,
+    ) -> list[str]:
+        return self.__invoker.services.board_image_records.get_all_board_image_names_for_board(board_id)
+
+    def get_board_for_image(
+        self,
+        image_name: str,
+    ) -> Optional[str]:
+        board_id = self.__invoker.services.board_image_records.get_board_for_image(image_name)
+        return board_id
diff --git a/invokeai/app/services/board_records/board_records_base.py b/invokeai/app/services/board_records/board_records_base.py
new file mode 100644
index 0000000000..30f819618a
--- /dev/null
+++ b/invokeai/app/services/board_records/board_records_base.py
@@ -0,0 +1,55 @@
+from abc import ABC, abstractmethod
+
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+
+from .board_records_common import BoardChanges, BoardRecord
+
+
+class BoardRecordStorageBase(ABC):
+    """Low-level service responsible for interfacing with the board record store."""
+
+    @abstractmethod
+    def delete(self, board_id: str) -> None:
+        """Deletes a board record."""
+        pass
+
+    @abstractmethod
+    def save(
+        self,
+        board_name: str,
+    ) -> BoardRecord:
+        """Saves a board record."""
+        pass
+
+    @abstractmethod
+    def get(
+        self,
+        board_id: str,
+    ) -> BoardRecord:
+        """Gets a board record."""
+        pass
+
+    @abstractmethod
+    def update(
+        self,
+        board_id: str,
+        changes: BoardChanges,
+    ) -> BoardRecord:
+        """Updates a board record."""
+        pass
+
+    @abstractmethod
+    def get_many(
+        self,
+        offset: int = 0,
+        limit: int = 10,
+    ) -> OffsetPaginatedResults[BoardRecord]:
+        """Gets many board records."""
+        pass
+
+    @abstractmethod
+    def get_all(
+        self,
+    ) -> list[BoardRecord]:
+        """Gets all board records."""
+        pass
diff --git a/invokeai/app/services/models/board_record.py b/invokeai/app/services/board_records/board_records_common.py
similarity index 59%
rename from invokeai/app/services/models/board_record.py
rename to invokeai/app/services/board_records/board_records_common.py
index 4b93d0ea23..d08951b499 100644
--- a/invokeai/app/services/models/board_record.py
+++ b/invokeai/app/services/board_records/board_records_common.py
@@ -1,7 +1,7 @@
 from datetime import datetime
 from typing import Optional, Union
 
-from pydantic import Field
+from pydantic import BaseModel, Field
 
 from invokeai.app.util.misc import get_iso_timestamp
 from invokeai.app.util.model_exclude_null import BaseModelExcludeNull
@@ -18,21 +18,12 @@ class BoardRecord(BaseModelExcludeNull):
     """The created timestamp of the image."""
     updated_at: Union[datetime, str] = Field(description="The updated timestamp of the board.")
     """The updated timestamp of the image."""
-    deleted_at: Union[datetime, str, None] = Field(description="The deleted timestamp of the board.")
+    deleted_at: Optional[Union[datetime, str]] = Field(default=None, description="The deleted timestamp of the board.")
     """The updated timestamp of the image."""
-    cover_image_name: Optional[str] = Field(description="The name of the cover image of the board.")
+    cover_image_name: Optional[str] = Field(default=None, description="The name of the cover image of the board.")
     """The name of the cover image of the board."""
 
 
-class BoardDTO(BoardRecord):
-    """Deserialized board record with cover image URL and image count."""
-
-    cover_image_name: Optional[str] = Field(description="The name of the board's cover image.")
-    """The URL of the thumbnail of the most recent image in the board."""
-    image_count: int = Field(description="The number of images in the board.")
-    """The number of images in the board."""
-
-
 def deserialize_board_record(board_dict: dict) -> BoardRecord:
     """Deserializes a board record."""
 
@@ -53,3 +44,29 @@ def deserialize_board_record(board_dict: dict) -> BoardRecord:
         updated_at=updated_at,
         deleted_at=deleted_at,
     )
+
+
+class BoardChanges(BaseModel, extra="forbid"):
+    board_name: Optional[str] = Field(default=None, description="The board's new name.")
+    cover_image_name: Optional[str] = Field(default=None, description="The name of the board's new cover image.")
+
+
+class BoardRecordNotFoundException(Exception):
+    """Raised when an board record is not found."""
+
+    def __init__(self, message="Board record not found"):
+        super().__init__(message)
+
+
+class BoardRecordSaveException(Exception):
+    """Raised when an board record cannot be saved."""
+
+    def __init__(self, message="Board record not saved"):
+        super().__init__(message)
+
+
+class BoardRecordDeleteException(Exception):
+    """Raised when an board record cannot be deleted."""
+
+    def __init__(self, message="Board record not deleted"):
+        super().__init__(message)
diff --git a/invokeai/app/services/board_record_storage.py b/invokeai/app/services/board_records/board_records_sqlite.py
similarity index 73%
rename from invokeai/app/services/board_record_storage.py
rename to invokeai/app/services/board_records/board_records_sqlite.py
index c12a9c8eea..9e3423ab19 100644
--- a/invokeai/app/services/board_record_storage.py
+++ b/invokeai/app/services/board_records/board_records_sqlite.py
@@ -1,103 +1,32 @@
 import sqlite3
 import threading
-from abc import ABC, abstractmethod
-from typing import Optional, Union, cast
+from typing import Union, cast
 
-from pydantic import BaseModel, Extra, Field
-
-from invokeai.app.services.image_record_storage import OffsetPaginatedResults
-from invokeai.app.services.models.board_record import BoardRecord, deserialize_board_record
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+from invokeai.app.services.shared.sqlite import SqliteDatabase
 from invokeai.app.util.misc import uuid_string
 
-
-class BoardChanges(BaseModel, extra=Extra.forbid):
-    board_name: Optional[str] = Field(description="The board's new name.")
-    cover_image_name: Optional[str] = Field(description="The name of the board's new cover image.")
-
-
-class BoardRecordNotFoundException(Exception):
-    """Raised when an board record is not found."""
-
-    def __init__(self, message="Board record not found"):
-        super().__init__(message)
-
-
-class BoardRecordSaveException(Exception):
-    """Raised when an board record cannot be saved."""
-
-    def __init__(self, message="Board record not saved"):
-        super().__init__(message)
-
-
-class BoardRecordDeleteException(Exception):
-    """Raised when an board record cannot be deleted."""
-
-    def __init__(self, message="Board record not deleted"):
-        super().__init__(message)
-
-
-class BoardRecordStorageBase(ABC):
-    """Low-level service responsible for interfacing with the board record store."""
-
-    @abstractmethod
-    def delete(self, board_id: str) -> None:
-        """Deletes a board record."""
-        pass
-
-    @abstractmethod
-    def save(
-        self,
-        board_name: str,
-    ) -> BoardRecord:
-        """Saves a board record."""
-        pass
-
-    @abstractmethod
-    def get(
-        self,
-        board_id: str,
-    ) -> BoardRecord:
-        """Gets a board record."""
-        pass
-
-    @abstractmethod
-    def update(
-        self,
-        board_id: str,
-        changes: BoardChanges,
-    ) -> BoardRecord:
-        """Updates a board record."""
-        pass
-
-    @abstractmethod
-    def get_many(
-        self,
-        offset: int = 0,
-        limit: int = 10,
-    ) -> OffsetPaginatedResults[BoardRecord]:
-        """Gets many board records."""
-        pass
-
-    @abstractmethod
-    def get_all(
-        self,
-    ) -> list[BoardRecord]:
-        """Gets all board records."""
-        pass
+from .board_records_base import BoardRecordStorageBase
+from .board_records_common import (
+    BoardChanges,
+    BoardRecord,
+    BoardRecordDeleteException,
+    BoardRecordNotFoundException,
+    BoardRecordSaveException,
+    deserialize_board_record,
+)
 
 
 class SqliteBoardRecordStorage(BoardRecordStorageBase):
     _conn: sqlite3.Connection
     _cursor: sqlite3.Cursor
-    _lock: threading.Lock
+    _lock: threading.RLock
 
-    def __init__(self, conn: sqlite3.Connection, lock: threading.Lock) -> None:
+    def __init__(self, db: SqliteDatabase) -> None:
         super().__init__()
-        self._conn = conn
-        # Enable row factory to get rows as dictionaries (must be done before making the cursor!)
-        self._conn.row_factory = sqlite3.Row
+        self._lock = db.lock
+        self._conn = db.conn
         self._cursor = self._conn.cursor()
-        self._lock = lock
 
         try:
             self._lock.acquire()
diff --git a/invokeai/app/services/boards.py b/invokeai/app/services/boards.py
deleted file mode 100644
index e7a516da65..0000000000
--- a/invokeai/app/services/boards.py
+++ /dev/null
@@ -1,158 +0,0 @@
-from abc import ABC, abstractmethod
-from logging import Logger
-
-from invokeai.app.services.board_image_record_storage import BoardImageRecordStorageBase
-from invokeai.app.services.board_images import board_record_to_dto
-from invokeai.app.services.board_record_storage import BoardChanges, BoardRecordStorageBase
-from invokeai.app.services.image_record_storage import ImageRecordStorageBase, OffsetPaginatedResults
-from invokeai.app.services.models.board_record import BoardDTO
-from invokeai.app.services.urls import UrlServiceBase
-
-
-class BoardServiceABC(ABC):
-    """High-level service for board management."""
-
-    @abstractmethod
-    def create(
-        self,
-        board_name: str,
-    ) -> BoardDTO:
-        """Creates a board."""
-        pass
-
-    @abstractmethod
-    def get_dto(
-        self,
-        board_id: str,
-    ) -> BoardDTO:
-        """Gets a board."""
-        pass
-
-    @abstractmethod
-    def update(
-        self,
-        board_id: str,
-        changes: BoardChanges,
-    ) -> BoardDTO:
-        """Updates a board."""
-        pass
-
-    @abstractmethod
-    def delete(
-        self,
-        board_id: str,
-    ) -> None:
-        """Deletes a board."""
-        pass
-
-    @abstractmethod
-    def get_many(
-        self,
-        offset: int = 0,
-        limit: int = 10,
-    ) -> OffsetPaginatedResults[BoardDTO]:
-        """Gets many boards."""
-        pass
-
-    @abstractmethod
-    def get_all(
-        self,
-    ) -> list[BoardDTO]:
-        """Gets all boards."""
-        pass
-
-
-class BoardServiceDependencies:
-    """Service dependencies for the BoardService."""
-
-    board_image_records: BoardImageRecordStorageBase
-    board_records: BoardRecordStorageBase
-    image_records: ImageRecordStorageBase
-    urls: UrlServiceBase
-    logger: Logger
-
-    def __init__(
-        self,
-        board_image_record_storage: BoardImageRecordStorageBase,
-        image_record_storage: ImageRecordStorageBase,
-        board_record_storage: BoardRecordStorageBase,
-        url: UrlServiceBase,
-        logger: Logger,
-    ):
-        self.board_image_records = board_image_record_storage
-        self.image_records = image_record_storage
-        self.board_records = board_record_storage
-        self.urls = url
-        self.logger = logger
-
-
-class BoardService(BoardServiceABC):
-    _services: BoardServiceDependencies
-
-    def __init__(self, services: BoardServiceDependencies):
-        self._services = services
-
-    def create(
-        self,
-        board_name: str,
-    ) -> BoardDTO:
-        board_record = self._services.board_records.save(board_name)
-        return board_record_to_dto(board_record, None, 0)
-
-    def get_dto(self, board_id: str) -> BoardDTO:
-        board_record = self._services.board_records.get(board_id)
-        cover_image = self._services.image_records.get_most_recent_image_for_board(board_record.board_id)
-        if cover_image:
-            cover_image_name = cover_image.image_name
-        else:
-            cover_image_name = None
-        image_count = self._services.board_image_records.get_image_count_for_board(board_id)
-        return board_record_to_dto(board_record, cover_image_name, image_count)
-
-    def update(
-        self,
-        board_id: str,
-        changes: BoardChanges,
-    ) -> BoardDTO:
-        board_record = self._services.board_records.update(board_id, changes)
-        cover_image = self._services.image_records.get_most_recent_image_for_board(board_record.board_id)
-        if cover_image:
-            cover_image_name = cover_image.image_name
-        else:
-            cover_image_name = None
-
-        image_count = self._services.board_image_records.get_image_count_for_board(board_id)
-        return board_record_to_dto(board_record, cover_image_name, image_count)
-
-    def delete(self, board_id: str) -> None:
-        self._services.board_records.delete(board_id)
-
-    def get_many(self, offset: int = 0, limit: int = 10) -> OffsetPaginatedResults[BoardDTO]:
-        board_records = self._services.board_records.get_many(offset, limit)
-        board_dtos = []
-        for r in board_records.items:
-            cover_image = self._services.image_records.get_most_recent_image_for_board(r.board_id)
-            if cover_image:
-                cover_image_name = cover_image.image_name
-            else:
-                cover_image_name = None
-
-            image_count = self._services.board_image_records.get_image_count_for_board(r.board_id)
-            board_dtos.append(board_record_to_dto(r, cover_image_name, image_count))
-
-        return OffsetPaginatedResults[BoardDTO](items=board_dtos, offset=offset, limit=limit, total=len(board_dtos))
-
-    def get_all(self) -> list[BoardDTO]:
-        board_records = self._services.board_records.get_all()
-        board_dtos = []
-        for r in board_records:
-            cover_image = self._services.image_records.get_most_recent_image_for_board(r.board_id)
-            if cover_image:
-                cover_image_name = cover_image.image_name
-            else:
-                cover_image_name = None
-
-            image_count = self._services.board_image_records.get_image_count_for_board(r.board_id)
-            board_dtos.append(board_record_to_dto(r, cover_image_name, image_count))
-
-        return board_dtos
diff --git a/invokeai/app/services/boards/__init__.py b/invokeai/app/services/boards/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/boards/boards_base.py b/invokeai/app/services/boards/boards_base.py
new file mode 100644
index 0000000000..6f90334d53
--- /dev/null
+++ b/invokeai/app/services/boards/boards_base.py
@@ -0,0 +1,59 @@
+from abc import ABC, abstractmethod
+
+from invokeai.app.services.board_records.board_records_common import BoardChanges
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+
+from .boards_common import BoardDTO
+
+
+class BoardServiceABC(ABC):
+    """High-level service for board management."""
+
+    @abstractmethod
+    def create(
+        self,
+        board_name: str,
+    ) -> BoardDTO:
+        """Creates a board."""
+        pass
+
+    @abstractmethod
+    def get_dto(
+        self,
+        board_id: str,
+    ) -> BoardDTO:
+        """Gets a board."""
+        pass
+
+    @abstractmethod
+    def update(
+        self,
+        board_id: str,
+        changes: BoardChanges,
+    ) -> BoardDTO:
+        """Updates a board."""
+        pass
+
+    @abstractmethod
+    def delete(
+        self,
+        board_id: str,
+    ) -> None:
+        """Deletes a board."""
+        pass
+
+    @abstractmethod
+    def get_many(
+        self,
+        offset: int = 0,
+        limit: int = 10,
+    ) -> OffsetPaginatedResults[BoardDTO]:
+        """Gets many boards."""
+        pass
+
+    @abstractmethod
+    def get_all(
+        self,
+    ) -> list[BoardDTO]:
+        """Gets all boards."""
+        pass
diff --git a/invokeai/app/services/boards/boards_common.py b/invokeai/app/services/boards/boards_common.py
new file mode 100644
index 0000000000..0cb54102bb
--- /dev/null
+++ b/invokeai/app/services/boards/boards_common.py
@@ -0,0 +1,23 @@
+from typing import Optional
+
+from pydantic import Field
+
+from ..board_records.board_records_common import BoardRecord
+
+
+class BoardDTO(BoardRecord):
+    """Deserialized board record with cover image URL and image count."""
+
+    cover_image_name: Optional[str] = Field(description="The name of the board's cover image.")
+    """The URL of the thumbnail of the most recent image in the board."""
+    image_count: int = Field(description="The number of images in the board.")
+    """The number of images in the board."""
+
+
+def board_record_to_dto(board_record: BoardRecord, cover_image_name: Optional[str], image_count: int) -> BoardDTO:
+    """Converts a board record to a board DTO."""
+    return BoardDTO(
+        **board_record.model_dump(exclude={"cover_image_name"}),
+        cover_image_name=cover_image_name,
+        image_count=image_count,
+    )
diff --git a/invokeai/app/services/boards/boards_default.py b/invokeai/app/services/boards/boards_default.py
new file mode 100644
index 0000000000..5b37d6c7ad
--- /dev/null
+++ b/invokeai/app/services/boards/boards_default.py
@@ -0,0 +1,79 @@
+from invokeai.app.services.board_records.board_records_common import BoardChanges
+from invokeai.app.services.boards.boards_common import BoardDTO
+from invokeai.app.services.invoker import Invoker
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+
+from .boards_base import BoardServiceABC
+from .boards_common import board_record_to_dto
+
+
+class BoardService(BoardServiceABC):
+    __invoker: Invoker
+
+    def start(self, invoker: Invoker) -> None:
+        self.__invoker = invoker
+
+    def create(
+        self,
+        board_name: str,
+    ) -> BoardDTO:
+        board_record = self.__invoker.services.board_records.save(board_name)
+        return board_record_to_dto(board_record, None, 0)
+
+    def get_dto(self, board_id: str) -> BoardDTO:
+        board_record = self.__invoker.services.board_records.get(board_id)
+        cover_image = self.__invoker.services.image_records.get_most_recent_image_for_board(board_record.board_id)
+        if cover_image:
+            cover_image_name = cover_image.image_name
+        else:
+            cover_image_name = None
+        image_count = self.__invoker.services.board_image_records.get_image_count_for_board(board_id)
+        return board_record_to_dto(board_record, cover_image_name, image_count)
+
+    def update(
+        self,
+        board_id: str,
+        changes: BoardChanges,
+    ) -> BoardDTO:
+        board_record = self.__invoker.services.board_records.update(board_id, changes)
+        cover_image = self.__invoker.services.image_records.get_most_recent_image_for_board(board_record.board_id)
+        if cover_image:
+            cover_image_name = cover_image.image_name
+        else:
+            cover_image_name = None
+
+        image_count = self.__invoker.services.board_image_records.get_image_count_for_board(board_id)
+        return board_record_to_dto(board_record, cover_image_name, image_count)
+
+    def delete(self, board_id: str) -> None:
+        self.__invoker.services.board_records.delete(board_id)
+
+    def get_many(self, offset: int = 0, limit: int = 10) -> OffsetPaginatedResults[BoardDTO]:
+        board_records = self.__invoker.services.board_records.get_many(offset, limit)
+        board_dtos = []
+        for r in board_records.items:
+            cover_image = self.__invoker.services.image_records.get_most_recent_image_for_board(r.board_id)
+            if cover_image:
+                cover_image_name = cover_image.image_name
+            else:
+                cover_image_name = None
+
+            image_count = self.__invoker.services.board_image_records.get_image_count_for_board(r.board_id)
+            board_dtos.append(board_record_to_dto(r, cover_image_name, image_count))
+
+        return OffsetPaginatedResults[BoardDTO](items=board_dtos, offset=offset, limit=limit, total=len(board_dtos))
+
+    def get_all(self) -> list[BoardDTO]:
+        board_records = self.__invoker.services.board_records.get_all()
+        board_dtos = []
+        for r in board_records:
+            cover_image = self.__invoker.services.image_records.get_most_recent_image_for_board(r.board_id)
+            if cover_image:
+                cover_image_name = cover_image.image_name
+            else:
+                cover_image_name = None
+
+            image_count = self.__invoker.services.board_image_records.get_image_count_for_board(r.board_id)
+            board_dtos.append(board_record_to_dto(r, cover_image_name, image_count))
+
+        return board_dtos
diff --git a/invokeai/app/services/config/__init__.py b/invokeai/app/services/config/__init__.py
index a404f33638..b9a92b03d2 100644
--- a/invokeai/app/services/config/__init__.py
+++ b/invokeai/app/services/config/__init__.py
@@ -2,5 +2,5 @@
 Init file for InvokeAI configure package
 """
 
-from .base import PagingArgumentParser  # noqa F401
-from .invokeai_config import InvokeAIAppConfig, get_invokeai_config  # noqa F401
+from .config_base import PagingArgumentParser  # noqa F401
+from .config_default import InvokeAIAppConfig, get_invokeai_config  # noqa F401
diff --git a/invokeai/app/services/config/base.py b/invokeai/app/services/config/config_base.py
similarity index 79%
rename from invokeai/app/services/config/base.py
rename to invokeai/app/services/config/config_base.py
index f24879af05..9405c1dfae 100644
--- a/invokeai/app/services/config/base.py
+++ b/invokeai/app/services/config/config_base.py
@@ -12,25 +12,15 @@ from __future__ import annotations
 
 import argparse
 import os
-import pydoc
 import sys
 from argparse import ArgumentParser
 from pathlib import Path
 from typing import ClassVar, Dict, List, Literal, Optional, Union, get_args, get_origin, get_type_hints
 
 from omegaconf import DictConfig, ListConfig, OmegaConf
-from pydantic import BaseSettings
+from pydantic_settings import BaseSettings, SettingsConfigDict
 
-
-class PagingArgumentParser(argparse.ArgumentParser):
-    """
-    A custom ArgumentParser that uses pydoc to page its output.
-    It also supports reading defaults from an init file.
-    """
-
-    def print_help(self, file=None):
-        text = self.format_help()
-        pydoc.pager(text)
+from invokeai.app.services.config.config_common import PagingArgumentParser, int_or_float_or_str
 
 
 class InvokeAISettings(BaseSettings):
@@ -42,12 +32,14 @@ class InvokeAISettings(BaseSettings):
     initconf: ClassVar[Optional[DictConfig]] = None
     argparse_groups: ClassVar[Dict] = {}
 
+    model_config = SettingsConfigDict(env_file_encoding="utf-8", arbitrary_types_allowed=True, case_sensitive=True)
+
     def parse_args(self, argv: Optional[list] = sys.argv[1:]):
         parser = self.get_parser()
         opt, unknown_opts = parser.parse_known_args(argv)
         if len(unknown_opts) > 0:
             print("Unknown args:", unknown_opts)
-        for name in self.__fields__:
+        for name in self.model_fields:
             if name not in self._excluded():
                 value = getattr(opt, name)
                 if isinstance(value, ListConfig):
@@ -64,10 +56,12 @@ class InvokeAISettings(BaseSettings):
         cls = self.__class__
         type = get_args(get_type_hints(cls)["type"])[0]
         field_dict = dict({type: dict()})
-        for name, field in self.__fields__.items():
+        for name, field in self.model_fields.items():
             if name in cls._excluded_from_yaml():
                 continue
-            category = field.field_info.extra.get("category") or "Uncategorized"
+            category = (
+                field.json_schema_extra.get("category", "Uncategorized") if field.json_schema_extra else "Uncategorized"
+            )
             value = getattr(self, name)
             if category not in field_dict[type]:
                 field_dict[type][category] = dict()
@@ -83,7 +77,7 @@ class InvokeAISettings(BaseSettings):
         else:
             settings_stanza = "Uncategorized"
 
-        env_prefix = getattr(cls.Config, "env_prefix", None)
+        env_prefix = getattr(cls.model_config, "env_prefix", None)
         env_prefix = env_prefix if env_prefix is not None else settings_stanza.upper()
 
         initconf = (
@@ -99,14 +93,18 @@ class InvokeAISettings(BaseSettings):
         for key, value in os.environ.items():
             upcase_environ[key.upper()] = value
 
-        fields = cls.__fields__
+        fields = cls.model_fields
         cls.argparse_groups = {}
 
         for name, field in fields.items():
             if name not in cls._excluded():
                 current_default = field.default
 
-                category = field.field_info.extra.get("category", "Uncategorized")
+                category = (
+                    field.json_schema_extra.get("category", "Uncategorized")
+                    if field.json_schema_extra
+                    else "Uncategorized"
+                )
                 env_name = env_prefix + "_" + name
                 if category in initconf and name in initconf.get(category):
                     field.default = initconf.get(category).get(name)
@@ -156,11 +154,6 @@ class InvokeAISettings(BaseSettings):
             "tiled_decode",
         ]
 
-    class Config:
-        env_file_encoding = "utf-8"
-        arbitrary_types_allowed = True
-        case_sensitive = True
-
     @classmethod
     def add_field_argument(cls, command_parser, name: str, field, default_override=None):
         field_type = get_type_hints(cls).get(name)
@@ -171,7 +164,7 @@ class InvokeAISettings(BaseSettings):
             if field.default_factory is None
             else field.default_factory()
         )
-        if category := field.field_info.extra.get("category"):
+        if category := (field.json_schema_extra.get("category", None) if field.json_schema_extra else None):
             if category not in cls.argparse_groups:
                 cls.argparse_groups[category] = command_parser.add_argument_group(category)
             argparse_group = cls.argparse_groups[category]
@@ -179,7 +172,7 @@ class InvokeAISettings(BaseSettings):
             argparse_group = command_parser
 
         if get_origin(field_type) == Literal:
-            allowed_values = get_args(field.type_)
+            allowed_values = get_args(field.annotation)
             allowed_types = set()
             for val in allowed_values:
                 allowed_types.add(type(val))
@@ -192,7 +185,7 @@ class InvokeAISettings(BaseSettings):
                 type=field_type,
                 default=default,
                 choices=allowed_values,
-                help=field.field_info.description,
+                help=field.description,
             )
 
         elif get_origin(field_type) == Union:
@@ -201,7 +194,7 @@ class InvokeAISettings(BaseSettings):
                 dest=name,
                 type=int_or_float_or_str,
                 default=default,
-                help=field.field_info.description,
+                help=field.description,
             )
 
         elif get_origin(field_type) == list:
@@ -209,32 +202,17 @@ class InvokeAISettings(BaseSettings):
                 f"--{name}",
                 dest=name,
                 nargs="*",
-                type=field.type_,
+                type=field.annotation,
                 default=default,
-                action=argparse.BooleanOptionalAction if field.type_ == bool else "store",
-                help=field.field_info.description,
+                action=argparse.BooleanOptionalAction if field.annotation == bool else "store",
+                help=field.description,
             )
         else:
             argparse_group.add_argument(
                 f"--{name}",
                 dest=name,
-                type=field.type_,
+                type=field.annotation,
                 default=default,
-                action=argparse.BooleanOptionalAction if field.type_ == bool else "store",
-                help=field.field_info.description,
+                action=argparse.BooleanOptionalAction if field.annotation == bool else "store",
+                help=field.description,
             )
-
-
-def int_or_float_or_str(value: str) -> Union[int, float, str]:
-    """
-    Workaround for argparse type checking.
-    """
-    try:
-        return int(value)
-    except Exception as e:  # noqa F841
-        pass
-    try:
-        return float(value)
-    except Exception as e:  # noqa F841
-        pass
-    return str(value)
diff --git a/invokeai/app/services/config/config_common.py b/invokeai/app/services/config/config_common.py
new file mode 100644
index 0000000000..d11bcabcf9
--- /dev/null
+++ b/invokeai/app/services/config/config_common.py
@@ -0,0 +1,41 @@
+# Copyright (c) 2023 Lincoln Stein (https://github.com/lstein) and the InvokeAI Development Team
+
+"""
+Base class for the InvokeAI configuration system.
+It defines a type of pydantic BaseSettings object that
+is able to read and write from an omegaconf-based config file,
+with overriding of settings from environment variables and/or
+the command line.
+"""
+
+from __future__ import annotations
+
+import argparse
+import pydoc
+from typing import Union
+
+
+class PagingArgumentParser(argparse.ArgumentParser):
+    """
+    A custom ArgumentParser that uses pydoc to page its output.
+    It also supports reading defaults from an init file.
+    """
+
+    def print_help(self, file=None):
+        text = self.format_help()
+        pydoc.pager(text)
+
+
+def int_or_float_or_str(value: str) -> Union[int, float, str]:
+    """
+    Workaround for argparse type checking.
+    """
+    try:
+        return int(value)
+    except Exception as e:  # noqa F841
+        pass
+    try:
+        return float(value)
+    except Exception as e:  # noqa F841
+        pass
+    return str(value)
diff --git a/invokeai/app/services/config/invokeai_config.py b/invokeai/app/services/config/config_default.py
similarity index 70%
rename from invokeai/app/services/config/invokeai_config.py
rename to invokeai/app/services/config/config_default.py
index d8b598815d..df01b65882 100644
--- a/invokeai/app/services/config/invokeai_config.py
+++ b/invokeai/app/services/config/config_default.py
@@ -144,8 +144,8 @@ which is set to the desired top-level name.  For example, to create a
 
   class InvokeBatch(InvokeAISettings):
      type: Literal["InvokeBatch"] = "InvokeBatch"
-     node_count : int = Field(default=1, description="Number of nodes to run on", category='Resources')
-     cpu_count  : int = Field(default=8, description="Number of GPUs to run on per node", category='Resources')
+     node_count : int = Field(default=1, description="Number of nodes to run on", json_schema_extra=dict(category='Resources'))
+     cpu_count  : int = Field(default=8, description="Number of GPUs to run on per node", json_schema_extra=dict(category='Resources'))
 
 This will now read and write from the "InvokeBatch" section of the
 config file, look for environment variables named INVOKEBATCH_*, and
@@ -175,9 +175,10 @@ from pathlib import Path
 from typing import ClassVar, Dict, List, Literal, Optional, Union, get_type_hints
 
 from omegaconf import DictConfig, OmegaConf
-from pydantic import Field, parse_obj_as
+from pydantic import Field, TypeAdapter
+from pydantic_settings import SettingsConfigDict
 
-from .base import InvokeAISettings
+from .config_base import InvokeAISettings
 
 INIT_FILE = Path("invokeai.yaml")
 DB_FILE = Path("invokeai.db")
@@ -185,6 +186,21 @@ LEGACY_INIT_FILE = Path("invokeai.init")
 DEFAULT_MAX_VRAM = 0.5
 
 
+class Categories(object):
+    WebServer = dict(category="Web Server")
+    Features = dict(category="Features")
+    Paths = dict(category="Paths")
+    Logging = dict(category="Logging")
+    Development = dict(category="Development")
+    Other = dict(category="Other")
+    ModelCache = dict(category="Model Cache")
+    Device = dict(category="Device")
+    Generation = dict(category="Generation")
+    Queue = dict(category="Queue")
+    Nodes = dict(category="Nodes")
+    MemoryPerformance = dict(category="Memory/Performance")
+
+
 class InvokeAIAppConfig(InvokeAISettings):
     """
     Generate images using Stable Diffusion. Use "invokeai" to launch
@@ -201,86 +217,88 @@ class InvokeAIAppConfig(InvokeAISettings):
     type: Literal["InvokeAI"] = "InvokeAI"
 
     # WEB
-    host                : str = Field(default="127.0.0.1", description="IP address to bind to", category='Web Server')
-    port                : int = Field(default=9090, description="Port to bind to", category='Web Server')
-    allow_origins       : List[str] = Field(default=[], description="Allowed CORS origins", category='Web Server')
-    allow_credentials   : bool = Field(default=True, description="Allow CORS credentials", category='Web Server')
-    allow_methods       : List[str] = Field(default=["*"], description="Methods allowed for CORS", category='Web Server')
-    allow_headers       : List[str] = Field(default=["*"], description="Headers allowed for CORS", category='Web Server')
+    host                : str = Field(default="127.0.0.1", description="IP address to bind to", json_schema_extra=Categories.WebServer)
+    port                : int = Field(default=9090, description="Port to bind to", json_schema_extra=Categories.WebServer)
+    allow_origins       : List[str] = Field(default=[], description="Allowed CORS origins", json_schema_extra=Categories.WebServer)
+    allow_credentials   : bool = Field(default=True, description="Allow CORS credentials", json_schema_extra=Categories.WebServer)
+    allow_methods       : List[str] = Field(default=["*"], description="Methods allowed for CORS", json_schema_extra=Categories.WebServer)
+    allow_headers       : List[str] = Field(default=["*"], description="Headers allowed for CORS", json_schema_extra=Categories.WebServer)
 
     # FEATURES
-    esrgan              : bool = Field(default=True, description="Enable/disable upscaling code", category='Features')
-    internet_available  : bool = Field(default=True, description="If true, attempt to download models on the fly; otherwise only use local models", category='Features')
-    log_tokenization    : bool = Field(default=False, description="Enable logging of parsed prompt tokens.", category='Features')
-    patchmatch          : bool = Field(default=True, description="Enable/disable patchmatch inpaint code", category='Features')
-    ignore_missing_core_models : bool = Field(default=False, description='Ignore missing models in models/core/convert', category='Features')
+    esrgan              : bool = Field(default=True, description="Enable/disable upscaling code", json_schema_extra=Categories.Features)
+    internet_available  : bool = Field(default=True, description="If true, attempt to download models on the fly; otherwise only use local models", json_schema_extra=Categories.Features)
+    log_tokenization    : bool = Field(default=False, description="Enable logging of parsed prompt tokens.", json_schema_extra=Categories.Features)
+    patchmatch          : bool = Field(default=True, description="Enable/disable patchmatch inpaint code", json_schema_extra=Categories.Features)
+    ignore_missing_core_models : bool = Field(default=False, description='Ignore missing models in models/core/convert', json_schema_extra=Categories.Features)
 
     # PATHS
-    root                : Path = Field(default=None, description='InvokeAI runtime root directory', category='Paths')
-    autoimport_dir      : Path = Field(default='autoimport', description='Path to a directory of models files to be imported on startup.', category='Paths')
-    lora_dir            : Path = Field(default=None, description='Path to a directory of LoRA/LyCORIS models to be imported on startup.', category='Paths')
-    embedding_dir       : Path = Field(default=None, description='Path to a directory of Textual Inversion embeddings to be imported on startup.', category='Paths')
-    controlnet_dir      : Path = Field(default=None, description='Path to a directory of ControlNet embeddings to be imported on startup.', category='Paths')
-    conf_path           : Path = Field(default='configs/models.yaml', description='Path to models definition file', category='Paths')
-    models_dir          : Path = Field(default='models', description='Path to the models directory', category='Paths')
-    legacy_conf_dir     : Path = Field(default='configs/stable-diffusion', description='Path to directory of legacy checkpoint config files', category='Paths')
-    db_dir              : Path = Field(default='databases', description='Path to InvokeAI databases directory', category='Paths')
-    outdir              : Path = Field(default='outputs', description='Default folder for output images', category='Paths')
-    use_memory_db       : bool = Field(default=False, description='Use in-memory database for storing image metadata', category='Paths')
-    from_file           : Path = Field(default=None, description='Take command input from the indicated file (command-line client only)', category='Paths')
+    root                : Optional[Path] = Field(default=None, description='InvokeAI runtime root directory', json_schema_extra=Categories.Paths)
+    autoimport_dir      : Optional[Path] = Field(default=Path('autoimport'), description='Path to a directory of models files to be imported on startup.', json_schema_extra=Categories.Paths)
+    lora_dir            : Optional[Path] = Field(default=None, description='Path to a directory of LoRA/LyCORIS models to be imported on startup.', json_schema_extra=Categories.Paths)
+    embedding_dir       : Optional[Path] = Field(default=None, description='Path to a directory of Textual Inversion embeddings to be imported on startup.', json_schema_extra=Categories.Paths)
+    controlnet_dir      : Optional[Path] = Field(default=None, description='Path to a directory of ControlNet embeddings to be imported on startup.', json_schema_extra=Categories.Paths)
+    conf_path           : Optional[Path] = Field(default=Path('configs/models.yaml'), description='Path to models definition file', json_schema_extra=Categories.Paths)
+    models_dir          : Optional[Path] = Field(default=Path('models'), description='Path to the models directory', json_schema_extra=Categories.Paths)
+    legacy_conf_dir     : Optional[Path] = Field(default=Path('configs/stable-diffusion'), description='Path to directory of legacy checkpoint config files', json_schema_extra=Categories.Paths)
+    db_dir              : Optional[Path] = Field(default=Path('databases'), description='Path to InvokeAI databases directory', json_schema_extra=Categories.Paths)
+    outdir              : Optional[Path] = Field(default=Path('outputs'), description='Default folder for output images', json_schema_extra=Categories.Paths)
+    use_memory_db       : bool = Field(default=False, description='Use in-memory database for storing image metadata', json_schema_extra=Categories.Paths)
+    from_file           : Optional[Path] = Field(default=None, description='Take command input from the indicated file (command-line client only)', json_schema_extra=Categories.Paths)
 
     # LOGGING
-    log_handlers        : List[str] = Field(default=["console"], description='Log handler. Valid options are "console", "file=<path>", "syslog=path|address:host:port", "http=<url>"', category="Logging")
+    log_handlers        : List[str] = Field(default=["console"], description='Log handler. Valid options are "console", "file=<path>", "syslog=path|address:host:port", "http=<url>"', json_schema_extra=Categories.Logging)
     # note - would be better to read the log_format values from logging.py, but this creates circular dependencies issues
-    log_format          : Literal['plain', 'color', 'syslog', 'legacy'] = Field(default="color", description='Log format. Use "plain" for text-only, "color" for colorized output, "legacy" for 2.3-style logging and "syslog" for syslog-style', category="Logging")
-    log_level           : Literal["debug", "info", "warning", "error", "critical"] = Field(default="info", description="Emit logging messages at this level or  higher", category="Logging")
-    log_sql             : bool = Field(default=False, description="Log SQL queries", category="Logging")
+    log_format          : Literal['plain', 'color', 'syslog', 'legacy'] = Field(default="color", description='Log format. Use "plain" for text-only, "color" for colorized output, "legacy" for 2.3-style logging and "syslog" for syslog-style', json_schema_extra=Categories.Logging)
+    log_level           : Literal["debug", "info", "warning", "error", "critical"] = Field(default="info", description="Emit logging messages at this level or  higher", json_schema_extra=Categories.Logging)
+    log_sql             : bool = Field(default=False, description="Log SQL queries", json_schema_extra=Categories.Logging)
 
-    dev_reload          : bool = Field(default=False, description="Automatically reload when Python sources are changed.", category="Development")
+    dev_reload          : bool = Field(default=False, description="Automatically reload when Python sources are changed.", json_schema_extra=Categories.Development)
 
-    version             : bool = Field(default=False, description="Show InvokeAI version and exit", category="Other")
+    version             : bool = Field(default=False, description="Show InvokeAI version and exit", json_schema_extra=Categories.Other)
 
     # CACHE
-    ram                 : Union[float, Literal["auto"]] = Field(default=7.5, gt=0, description="Maximum memory amount used by model cache for rapid switching (floating point number or 'auto')", category="Model Cache", )
-    vram                : Union[float, Literal["auto"]] = Field(default=0.25, ge=0, description="Amount of VRAM reserved for model storage (floating point number or 'auto')", category="Model Cache", )
-    lazy_offload        : bool = Field(default=True, description="Keep models in VRAM until their space is needed", category="Model Cache", )
+    ram                 : float = Field(default=7.5, gt=0, description="Maximum memory amount used by model cache for rapid switching (floating point number, GB)", json_schema_extra=Categories.ModelCache, )
+    vram                : float = Field(default=0.25, ge=0, description="Amount of VRAM reserved for model storage (floating point number, GB)", json_schema_extra=Categories.ModelCache, )
+    lazy_offload        : bool = Field(default=True, description="Keep models in VRAM until their space is needed", json_schema_extra=Categories.ModelCache, )
 
     # DEVICE
-    device              : Literal["auto", "cpu", "cuda", "cuda:1", "mps"] = Field(default="auto", description="Generation device", category="Device", )
-    precision           : Literal["auto", "float16", "float32", "autocast"] = Field(default="auto", description="Floating point precision", category="Device", )
+    device              : Literal["auto", "cpu", "cuda", "cuda:1", "mps"] = Field(default="auto", description="Generation device", json_schema_extra=Categories.Device)
+    precision           : Literal["auto", "float16", "float32", "autocast"] = Field(default="auto", description="Floating point precision", json_schema_extra=Categories.Device)
 
     # GENERATION
-    sequential_guidance : bool = Field(default=False, description="Whether to calculate guidance in serial instead of in parallel, lowering memory requirements", category="Generation", )
-    attention_type      : Literal["auto", "normal", "xformers", "sliced", "torch-sdp"] = Field(default="auto", description="Attention type", category="Generation", )
-    attention_slice_size: Literal["auto", "balanced", "max", 1, 2, 3, 4, 5, 6, 7, 8] = Field(default="auto", description='Slice size, valid when attention_type=="sliced"', category="Generation", )
-    force_tiled_decode  : bool = Field(default=False, description="Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty)", category="Generation",)
-    force_tiled_decode: bool = Field(default=False, description="Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty)", category="Generation",)
-    png_compress_level  : int = Field(default=6, description="The compress_level setting of PIL.Image.save(), used for PNG encoding. All settings are lossless. 0 = fastest, largest filesize, 9 = slowest, smallest filesize", category="Generation", )
+    sequential_guidance : bool = Field(default=False, description="Whether to calculate guidance in serial instead of in parallel, lowering memory requirements", json_schema_extra=Categories.Generation)
+    attention_type      : Literal["auto", "normal", "xformers", "sliced", "torch-sdp"] = Field(default="auto", description="Attention type", json_schema_extra=Categories.Generation)
+    attention_slice_size: Literal["auto", "balanced", "max", 1, 2, 3, 4, 5, 6, 7, 8] = Field(default="auto", description='Slice size, valid when attention_type=="sliced"', json_schema_extra=Categories.Generation)
+    force_tiled_decode  : bool = Field(default=False, description="Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty)", json_schema_extra=Categories.Generation)
+    png_compress_level  : int = Field(default=6, description="The compress_level setting of PIL.Image.save(), used for PNG encoding. All settings are lossless. 0 = fastest, largest filesize, 9 = slowest, smallest filesize", json_schema_extra=Categories.Generation)
 
     # QUEUE
-    max_queue_size      : int = Field(default=10000, gt=0, description="Maximum number of items in the session queue", category="Queue", )
+    max_queue_size      : int = Field(default=10000, gt=0, description="Maximum number of items in the session queue", json_schema_extra=Categories.Queue)
 
     # NODES
-    allow_nodes         : Optional[List[str]] = Field(default=None, description="List of nodes to allow. Omit to allow all.", category="Nodes")
-    deny_nodes          : Optional[List[str]] = Field(default=None, description="List of nodes to deny. Omit to deny none.", category="Nodes")
-    node_cache_size     : int = Field(default=512, description="How many cached nodes to keep in memory", category="Nodes", )
+    allow_nodes         : Optional[List[str]] = Field(default=None, description="List of nodes to allow. Omit to allow all.", json_schema_extra=Categories.Nodes)
+    deny_nodes          : Optional[List[str]] = Field(default=None, description="List of nodes to deny. Omit to deny none.", json_schema_extra=Categories.Nodes)
+    node_cache_size     : int = Field(default=512, description="How many cached nodes to keep in memory", json_schema_extra=Categories.Nodes)
 
     # DEPRECATED FIELDS - STILL HERE IN ORDER TO OBTAN VALUES FROM PRE-3.1 CONFIG FILES
-    always_use_cpu      : bool = Field(default=False, description="If true, use the CPU for rendering even if a GPU is available.", category='Memory/Performance')
-    free_gpu_mem        : Optional[bool] = Field(default=None, description="If true, purge model from GPU after each generation.", category='Memory/Performance')
-    max_cache_size      : Optional[float] = Field(default=None, gt=0, description="Maximum memory amount used by model cache for rapid switching", category='Memory/Performance')
-    max_vram_cache_size : Optional[float] = Field(default=None, ge=0, description="Amount of VRAM reserved for model storage", category='Memory/Performance')
-    xformers_enabled    : bool = Field(default=True, description="Enable/disable memory-efficient attention", category='Memory/Performance')
-    tiled_decode        : bool = Field(default=False, description="Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty)", category='Memory/Performance')
+    always_use_cpu      : bool = Field(default=False, description="If true, use the CPU for rendering even if a GPU is available.", json_schema_extra=Categories.MemoryPerformance)
+    free_gpu_mem        : Optional[bool] = Field(default=None, description="If true, purge model from GPU after each generation.", json_schema_extra=Categories.MemoryPerformance)
+    max_cache_size      : Optional[float] = Field(default=None, gt=0, description="Maximum memory amount used by model cache for rapid switching", json_schema_extra=Categories.MemoryPerformance)
+    max_vram_cache_size : Optional[float] = Field(default=None, ge=0, description="Amount of VRAM reserved for model storage", json_schema_extra=Categories.MemoryPerformance)
+    xformers_enabled    : bool = Field(default=True, description="Enable/disable memory-efficient attention", json_schema_extra=Categories.MemoryPerformance)
+    tiled_decode        : bool = Field(default=False, description="Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty)", json_schema_extra=Categories.MemoryPerformance)
 
     # See InvokeAIAppConfig subclass below for CACHE and DEVICE categories
     # fmt: on
 
-    class Config:
-        validate_assignment = True
-        env_prefix = "INVOKEAI"
+    model_config = SettingsConfigDict(validate_assignment=True, env_prefix="INVOKEAI")
 
-    def parse_args(self, argv: Optional[list[str]] = None, conf: Optional[DictConfig] = None, clobber=False):
+    def parse_args(
+        self,
+        argv: Optional[list[str]] = None,
+        conf: Optional[DictConfig] = None,
+        clobber=False,
+    ):
         """
         Update settings with contents of init file, environment, and
         command-line settings.
@@ -308,7 +326,11 @@ class InvokeAIAppConfig(InvokeAISettings):
         if self.singleton_init and not clobber:
             hints = get_type_hints(self.__class__)
             for k in self.singleton_init:
-                setattr(self, k, parse_obj_as(hints[k], self.singleton_init[k]))
+                setattr(
+                    self,
+                    k,
+                    TypeAdapter(hints[k]).validate_python(self.singleton_init[k]),
+                )
 
     @classmethod
     def get_config(cls, **kwargs) -> InvokeAIAppConfig:
diff --git a/invokeai/app/services/events/__init__.py b/invokeai/app/services/events/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/events.py b/invokeai/app/services/events/events_base.py
similarity index 95%
rename from invokeai/app/services/events.py
rename to invokeai/app/services/events/events_base.py
index 0a02a03539..ad00815151 100644
--- a/invokeai/app/services/events.py
+++ b/invokeai/app/services/events/events_base.py
@@ -2,8 +2,7 @@
 
 from typing import Any, Optional
 
-from invokeai.app.models.image import ProgressImage
-from invokeai.app.services.model_manager_service import BaseModelType, ModelInfo, ModelType, SubModelType
+from invokeai.app.services.invocation_processor.invocation_processor_common import ProgressImage
 from invokeai.app.services.session_queue.session_queue_common import (
     BatchStatus,
     EnqueueBatchResult,
@@ -11,6 +10,8 @@ from invokeai.app.services.session_queue.session_queue_common import (
     SessionQueueStatus,
 )
 from invokeai.app.util.misc import get_timestamp
+from invokeai.backend.model_management.model_manager import ModelInfo
+from invokeai.backend.model_management.models.base import BaseModelType, ModelType, SubModelType
 
 
 class EventServiceBase:
@@ -54,7 +55,7 @@ class EventServiceBase:
                 graph_execution_state_id=graph_execution_state_id,
                 node_id=node.get("id"),
                 source_node_id=source_node_id,
-                progress_image=progress_image.dict() if progress_image is not None else None,
+                progress_image=progress_image.model_dump() if progress_image is not None else None,
                 step=step,
                 order=order,
                 total_steps=total_steps,
@@ -290,8 +291,8 @@ class EventServiceBase:
                     started_at=str(session_queue_item.started_at) if session_queue_item.started_at else None,
                     completed_at=str(session_queue_item.completed_at) if session_queue_item.completed_at else None,
                 ),
-                batch_status=batch_status.dict(),
-                queue_status=queue_status.dict(),
+                batch_status=batch_status.model_dump(),
+                queue_status=queue_status.model_dump(),
             ),
         )
 
diff --git a/invokeai/app/services/image_files/__init__.py b/invokeai/app/services/image_files/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/image_files/image_files_base.py b/invokeai/app/services/image_files/image_files_base.py
new file mode 100644
index 0000000000..5dde7b05d6
--- /dev/null
+++ b/invokeai/app/services/image_files/image_files_base.py
@@ -0,0 +1,43 @@
+from abc import ABC, abstractmethod
+from pathlib import Path
+from typing import Optional
+
+from PIL.Image import Image as PILImageType
+
+
+class ImageFileStorageBase(ABC):
+    """Low-level service responsible for storing and retrieving image files."""
+
+    @abstractmethod
+    def get(self, image_name: str) -> PILImageType:
+        """Retrieves an image as PIL Image."""
+        pass
+
+    @abstractmethod
+    def get_path(self, image_name: str, thumbnail: bool = False) -> Path:
+        """Gets the internal path to an image or thumbnail."""
+        pass
+
+    # TODO: We need to validate paths before starlette makes the FileResponse, else we get a
+    # 500 internal server error. I don't like having this method on the service.
+    @abstractmethod
+    def validate_path(self, path: str) -> bool:
+        """Validates the path given for an image or thumbnail."""
+        pass
+
+    @abstractmethod
+    def save(
+        self,
+        image: PILImageType,
+        image_name: str,
+        metadata: Optional[dict] = None,
+        workflow: Optional[str] = None,
+        thumbnail_size: int = 256,
+    ) -> None:
+        """Saves an image and a 256x256 WEBP thumbnail. Returns a tuple of the image name, thumbnail name, and created timestamp."""
+        pass
+
+    @abstractmethod
+    def delete(self, image_name: str) -> None:
+        """Deletes an image and its thumbnail (if one exists)."""
+        pass
diff --git a/invokeai/app/services/image_files/image_files_common.py b/invokeai/app/services/image_files/image_files_common.py
new file mode 100644
index 0000000000..e9cc2a3fa7
--- /dev/null
+++ b/invokeai/app/services/image_files/image_files_common.py
@@ -0,0 +1,20 @@
+# TODO: Should these excpetions subclass existing python exceptions?
+class ImageFileNotFoundException(Exception):
+    """Raised when an image file is not found in storage."""
+
+    def __init__(self, message="Image file not found"):
+        super().__init__(message)
+
+
+class ImageFileSaveException(Exception):
+    """Raised when an image cannot be saved."""
+
+    def __init__(self, message="Image file not saved"):
+        super().__init__(message)
+
+
+class ImageFileDeleteException(Exception):
+    """Raised when an image cannot be deleted."""
+
+    def __init__(self, message="Image file not deleted"):
+        super().__init__(message)
diff --git a/invokeai/app/services/image_file_storage.py b/invokeai/app/services/image_files/image_files_disk.py
similarity index 70%
rename from invokeai/app/services/image_file_storage.py
rename to invokeai/app/services/image_files/image_files_disk.py
index 7f32671a8c..9111a71605 100644
--- a/invokeai/app/services/image_file_storage.py
+++ b/invokeai/app/services/image_files/image_files_disk.py
@@ -1,6 +1,5 @@
 # Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) and the InvokeAI Team
 import json
-from abc import ABC, abstractmethod
 from pathlib import Path
 from queue import Queue
 from typing import Dict, Optional, Union
@@ -9,68 +8,11 @@ from PIL import Image, PngImagePlugin
 from PIL.Image import Image as PILImageType
 from send2trash import send2trash
 
-from invokeai.app.services.config.invokeai_config import InvokeAIAppConfig
+from invokeai.app.services.invoker import Invoker
 from invokeai.app.util.thumbnails import get_thumbnail_name, make_thumbnail
 
-
-# TODO: Should these excpetions subclass existing python exceptions?
-class ImageFileNotFoundException(Exception):
-    """Raised when an image file is not found in storage."""
-
-    def __init__(self, message="Image file not found"):
-        super().__init__(message)
-
-
-class ImageFileSaveException(Exception):
-    """Raised when an image cannot be saved."""
-
-    def __init__(self, message="Image file not saved"):
-        super().__init__(message)
-
-
-class ImageFileDeleteException(Exception):
-    """Raised when an image cannot be deleted."""
-
-    def __init__(self, message="Image file not deleted"):
-        super().__init__(message)
-
-
-class ImageFileStorageBase(ABC):
-    """Low-level service responsible for storing and retrieving image files."""
-
-    @abstractmethod
-    def get(self, image_name: str) -> PILImageType:
-        """Retrieves an image as PIL Image."""
-        pass
-
-    @abstractmethod
-    def get_path(self, image_name: str, thumbnail: bool = False) -> str:
-        """Gets the internal path to an image or thumbnail."""
-        pass
-
-    # TODO: We need to validate paths before starlette makes the FileResponse, else we get a
-    # 500 internal server error. I don't like having this method on the service.
-    @abstractmethod
-    def validate_path(self, path: str) -> bool:
-        """Validates the path given for an image or thumbnail."""
-        pass
-
-    @abstractmethod
-    def save(
-        self,
-        image: PILImageType,
-        image_name: str,
-        metadata: Optional[dict] = None,
-        workflow: Optional[str] = None,
-        thumbnail_size: int = 256,
-    ) -> None:
-        """Saves an image and a 256x256 WEBP thumbnail. Returns a tuple of the image name, thumbnail name, and created timestamp."""
-        pass
-
-    @abstractmethod
-    def delete(self, image_name: str) -> None:
-        """Deletes an image and its thumbnail (if one exists)."""
-        pass
+from .image_files_base import ImageFileStorageBase
+from .image_files_common import ImageFileDeleteException, ImageFileNotFoundException, ImageFileSaveException
 
 
 class DiskImageFileStorage(ImageFileStorageBase):
@@ -80,7 +22,7 @@ class DiskImageFileStorage(ImageFileStorageBase):
     __cache_ids: Queue  # TODO: this is an incredibly naive cache
     __cache: Dict[Path, PILImageType]
     __max_cache_size: int
-    __compress_level: int
+    __invoker: Invoker
 
     def __init__(self, output_folder: Union[str, Path]):
         self.__cache = dict()
@@ -89,10 +31,12 @@ class DiskImageFileStorage(ImageFileStorageBase):
 
         self.__output_folder: Path = output_folder if isinstance(output_folder, Path) else Path(output_folder)
         self.__thumbnails_folder = self.__output_folder / "thumbnails"
-        self.__compress_level = InvokeAIAppConfig.get_config().png_compress_level
         # Validate required output folders at launch
         self.__validate_storage_folders()
 
+    def start(self, invoker: Invoker) -> None:
+        self.__invoker = invoker
+
     def get(self, image_name: str) -> PILImageType:
         try:
             image_path = self.get_path(image_name)
@@ -136,7 +80,12 @@ class DiskImageFileStorage(ImageFileStorageBase):
                 if original_workflow is not None:
                     pnginfo.add_text("invokeai_workflow", original_workflow)
 
-            image.save(image_path, "PNG", pnginfo=pnginfo, compress_level=self.__compress_level)
+            image.save(
+                image_path,
+                "PNG",
+                pnginfo=pnginfo,
+                compress_level=self.__invoker.services.configuration.png_compress_level,
+            )
 
             thumbnail_name = get_thumbnail_name(image_name)
             thumbnail_path = self.get_path(thumbnail_name, thumbnail=True)
diff --git a/invokeai/app/services/image_records/__init__.py b/invokeai/app/services/image_records/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/image_records/image_records_base.py b/invokeai/app/services/image_records/image_records_base.py
new file mode 100644
index 0000000000..107ff85f9b
--- /dev/null
+++ b/invokeai/app/services/image_records/image_records_base.py
@@ -0,0 +1,84 @@
+from abc import ABC, abstractmethod
+from datetime import datetime
+from typing import Optional
+
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+
+from .image_records_common import ImageCategory, ImageRecord, ImageRecordChanges, ResourceOrigin
+
+
+class ImageRecordStorageBase(ABC):
+    """Low-level service responsible for interfacing with the image record store."""
+
+    # TODO: Implement an `update()` method
+
+    @abstractmethod
+    def get(self, image_name: str) -> ImageRecord:
+        """Gets an image record."""
+        pass
+
+    @abstractmethod
+    def get_metadata(self, image_name: str) -> Optional[dict]:
+        """Gets an image's metadata'."""
+        pass
+
+    @abstractmethod
+    def update(
+        self,
+        image_name: str,
+        changes: ImageRecordChanges,
+    ) -> None:
+        """Updates an image record."""
+        pass
+
+    @abstractmethod
+    def get_many(
+        self,
+        offset: int = 0,
+        limit: int = 10,
+        image_origin: Optional[ResourceOrigin] = None,
+        categories: Optional[list[ImageCategory]] = None,
+        is_intermediate: Optional[bool] = None,
+        board_id: Optional[str] = None,
+    ) -> OffsetPaginatedResults[ImageRecord]:
+        """Gets a page of image records."""
+        pass
+
+    # TODO: The database has a nullable `deleted_at` column, currently unused.
+    # Should we implement soft deletes? Would need coordination with ImageFileStorage.
+    @abstractmethod
+    def delete(self, image_name: str) -> None:
+        """Deletes an image record."""
+        pass
+
+    @abstractmethod
+    def delete_many(self, image_names: list[str]) -> None:
+        """Deletes many image records."""
+        pass
+
+    @abstractmethod
+    def delete_intermediates(self) -> list[str]:
+        """Deletes all intermediate image records, returning a list of deleted image names."""
+        pass
+
+    @abstractmethod
+    def save(
+        self,
+        image_name: str,
+        image_origin: ResourceOrigin,
+        image_category: ImageCategory,
+        width: int,
+        height: int,
+        is_intermediate: Optional[bool] = False,
+        starred: Optional[bool] = False,
+        session_id: Optional[str] = None,
+        node_id: Optional[str] = None,
+        metadata: Optional[dict] = None,
+    ) -> datetime:
+        """Saves an image record."""
+        pass
+
+    @abstractmethod
+    def get_most_recent_image_for_board(self, board_id: str) -> Optional[ImageRecord]:
+        """Gets the most recent image for a board."""
+        pass
diff --git a/invokeai/app/services/models/image_record.py b/invokeai/app/services/image_records/image_records_common.py
similarity index 56%
rename from invokeai/app/services/models/image_record.py
rename to invokeai/app/services/image_records/image_records_common.py
index 3b215f5b88..5a6e5652c9 100644
--- a/invokeai/app/services/models/image_record.py
+++ b/invokeai/app/services/image_records/image_records_common.py
@@ -1,13 +1,117 @@
+# TODO: Should these excpetions subclass existing python exceptions?
 import datetime
+from enum import Enum
 from typing import Optional, Union
 
-from pydantic import Extra, Field, StrictBool, StrictStr
+from pydantic import Field, StrictBool, StrictStr
 
-from invokeai.app.models.image import ImageCategory, ResourceOrigin
+from invokeai.app.util.metaenum import MetaEnum
 from invokeai.app.util.misc import get_iso_timestamp
 from invokeai.app.util.model_exclude_null import BaseModelExcludeNull
 
 
+class ResourceOrigin(str, Enum, metaclass=MetaEnum):
+    """The origin of a resource (eg image).
+
+    - INTERNAL: The resource was created by the application.
+    - EXTERNAL: The resource was not created by the application.
+    This may be a user-initiated upload, or an internal application upload (eg Canvas init image).
+    """
+
+    INTERNAL = "internal"
+    """The resource was created by the application."""
+    EXTERNAL = "external"
+    """The resource was not created by the application.
+    This may be a user-initiated upload, or an internal application upload (eg Canvas init image).
+    """
+
+
+class InvalidOriginException(ValueError):
+    """Raised when a provided value is not a valid ResourceOrigin.
+
+    Subclasses `ValueError`.
+    """
+
+    def __init__(self, message="Invalid resource origin."):
+        super().__init__(message)
+
+
+class ImageCategory(str, Enum, metaclass=MetaEnum):
+    """The category of an image.
+
+    - GENERAL: The image is an output, init image, or otherwise an image without a specialized purpose.
+    - MASK: The image is a mask image.
+    - CONTROL: The image is a ControlNet control image.
+    - USER: The image is a user-provide image.
+    - OTHER: The image is some other type of image with a specialized purpose. To be used by external nodes.
+    """
+
+    GENERAL = "general"
+    """GENERAL: The image is an output, init image, or otherwise an image without a specialized purpose."""
+    MASK = "mask"
+    """MASK: The image is a mask image."""
+    CONTROL = "control"
+    """CONTROL: The image is a ControlNet control image."""
+    USER = "user"
+    """USER: The image is a user-provide image."""
+    OTHER = "other"
+    """OTHER: The image is some other type of image with a specialized purpose. To be used by external nodes."""
+
+
+class InvalidImageCategoryException(ValueError):
+    """Raised when a provided value is not a valid ImageCategory.
+
+    Subclasses `ValueError`.
+    """
+
+    def __init__(self, message="Invalid image category."):
+        super().__init__(message)
+
+
+class ImageRecordNotFoundException(Exception):
+    """Raised when an image record is not found."""
+
+    def __init__(self, message="Image record not found"):
+        super().__init__(message)
+
+
+class ImageRecordSaveException(Exception):
+    """Raised when an image record cannot be saved."""
+
+    def __init__(self, message="Image record not saved"):
+        super().__init__(message)
+
+
+class ImageRecordDeleteException(Exception):
+    """Raised when an image record cannot be deleted."""
+
+    def __init__(self, message="Image record not deleted"):
+        super().__init__(message)
+
+
+IMAGE_DTO_COLS = ", ".join(
+    list(
+        map(
+            lambda c: "images." + c,
+            [
+                "image_name",
+                "image_origin",
+                "image_category",
+                "width",
+                "height",
+                "session_id",
+                "node_id",
+                "is_intermediate",
+                "created_at",
+                "updated_at",
+                "deleted_at",
+                "starred",
+            ],
+        )
+    )
+)
+
+
 class ImageRecord(BaseModelExcludeNull):
     """Deserialized image record without metadata."""
 
@@ -25,7 +129,9 @@ class ImageRecord(BaseModelExcludeNull):
     """The created timestamp of the image."""
     updated_at: Union[datetime.datetime, str] = Field(description="The updated timestamp of the image.")
     """The updated timestamp of the image."""
-    deleted_at: Union[datetime.datetime, str, None] = Field(description="The deleted timestamp of the image.")
+    deleted_at: Optional[Union[datetime.datetime, str]] = Field(
+        default=None, description="The deleted timestamp of the image."
+    )
     """The deleted timestamp of the image."""
     is_intermediate: bool = Field(description="Whether this is an intermediate image.")
     """Whether this is an intermediate image."""
@@ -43,7 +149,7 @@ class ImageRecord(BaseModelExcludeNull):
     """Whether this image is starred."""
 
 
-class ImageRecordChanges(BaseModelExcludeNull, extra=Extra.forbid):
+class ImageRecordChanges(BaseModelExcludeNull, extra="allow"):
     """A set of changes to apply to an image record.
 
     Only limited changes are valid:
@@ -66,41 +172,6 @@ class ImageRecordChanges(BaseModelExcludeNull, extra=Extra.forbid):
     """The image's new `starred` state."""
 
 
-class ImageUrlsDTO(BaseModelExcludeNull):
-    """The URLs for an image and its thumbnail."""
-
-    image_name: str = Field(description="The unique name of the image.")
-    """The unique name of the image."""
-    image_url: str = Field(description="The URL of the image.")
-    """The URL of the image."""
-    thumbnail_url: str = Field(description="The URL of the image's thumbnail.")
-    """The URL of the image's thumbnail."""
-
-
-class ImageDTO(ImageRecord, ImageUrlsDTO):
-    """Deserialized image record, enriched for the frontend."""
-
-    board_id: Optional[str] = Field(description="The id of the board the image belongs to, if one exists.")
-    """The id of the board the image belongs to, if one exists."""
-
-    pass
-
-
-def image_record_to_dto(
-    image_record: ImageRecord,
-    image_url: str,
-    thumbnail_url: str,
-    board_id: Optional[str],
-) -> ImageDTO:
-    """Converts an image record to an image DTO."""
-    return ImageDTO(
-        **image_record.dict(),
-        image_url=image_url,
-        thumbnail_url=thumbnail_url,
-        board_id=board_id,
-    )
-
-
 def deserialize_image_record(image_dict: dict) -> ImageRecord:
     """Deserializes an image record."""
 
diff --git a/invokeai/app/services/image_record_storage.py b/invokeai/app/services/image_records/image_records_sqlite.py
similarity index 75%
rename from invokeai/app/services/image_record_storage.py
rename to invokeai/app/services/image_records/image_records_sqlite.py
index 21afcaf0bf..9793236d9c 100644
--- a/invokeai/app/services/image_record_storage.py
+++ b/invokeai/app/services/image_records/image_records_sqlite.py
@@ -1,164 +1,36 @@
 import json
 import sqlite3
 import threading
-from abc import ABC, abstractmethod
 from datetime import datetime
-from typing import Generic, Optional, TypeVar, cast
+from typing import Optional, Union, cast
 
-from pydantic import BaseModel, Field
-from pydantic.generics import GenericModel
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+from invokeai.app.services.shared.sqlite import SqliteDatabase
 
-from invokeai.app.models.image import ImageCategory, ResourceOrigin
-from invokeai.app.services.models.image_record import ImageRecord, ImageRecordChanges, deserialize_image_record
-
-T = TypeVar("T", bound=BaseModel)
-
-
-class OffsetPaginatedResults(GenericModel, Generic[T]):
-    """Offset-paginated results"""
-
-    # fmt: off
-    items: list[T] = Field(description="Items")
-    offset: int = Field(description="Offset from which to retrieve items")
-    limit: int = Field(description="Limit of items to get")
-    total: int = Field(description="Total number of items in result")
-    # fmt: on
-
-
-# TODO: Should these excpetions subclass existing python exceptions?
-class ImageRecordNotFoundException(Exception):
-    """Raised when an image record is not found."""
-
-    def __init__(self, message="Image record not found"):
-        super().__init__(message)
-
-
-class ImageRecordSaveException(Exception):
-    """Raised when an image record cannot be saved."""
-
-    def __init__(self, message="Image record not saved"):
-        super().__init__(message)
-
-
-class ImageRecordDeleteException(Exception):
-    """Raised when an image record cannot be deleted."""
-
-    def __init__(self, message="Image record not deleted"):
-        super().__init__(message)
-
-
-IMAGE_DTO_COLS = ", ".join(
-    list(
-        map(
-            lambda c: "images." + c,
-            [
-                "image_name",
-                "image_origin",
-                "image_category",
-                "width",
-                "height",
-                "session_id",
-                "node_id",
-                "is_intermediate",
-                "created_at",
-                "updated_at",
-                "deleted_at",
-                "starred",
-            ],
-        )
-    )
+from .image_records_base import ImageRecordStorageBase
+from .image_records_common import (
+    IMAGE_DTO_COLS,
+    ImageCategory,
+    ImageRecord,
+    ImageRecordChanges,
+    ImageRecordDeleteException,
+    ImageRecordNotFoundException,
+    ImageRecordSaveException,
+    ResourceOrigin,
+    deserialize_image_record,
 )
 
 
-class ImageRecordStorageBase(ABC):
-    """Low-level service responsible for interfacing with the image record store."""
-
-    # TODO: Implement an `update()` method
-
-    @abstractmethod
-    def get(self, image_name: str) -> ImageRecord:
-        """Gets an image record."""
-        pass
-
-    @abstractmethod
-    def get_metadata(self, image_name: str) -> Optional[dict]:
-        """Gets an image's metadata'."""
-        pass
-
-    @abstractmethod
-    def update(
-        self,
-        image_name: str,
-        changes: ImageRecordChanges,
-    ) -> None:
-        """Updates an image record."""
-        pass
-
-    @abstractmethod
-    def get_many(
-        self,
-        offset: Optional[int] = None,
-        limit: Optional[int] = None,
-        image_origin: Optional[ResourceOrigin] = None,
-        categories: Optional[list[ImageCategory]] = None,
-        is_intermediate: Optional[bool] = None,
-        board_id: Optional[str] = None,
-    ) -> OffsetPaginatedResults[ImageRecord]:
-        """Gets a page of image records."""
-        pass
-
-    # TODO: The database has a nullable `deleted_at` column, currently unused.
-    # Should we implement soft deletes? Would need coordination with ImageFileStorage.
-    @abstractmethod
-    def delete(self, image_name: str) -> None:
-        """Deletes an image record."""
-        pass
-
-    @abstractmethod
-    def delete_many(self, image_names: list[str]) -> None:
-        """Deletes many image records."""
-        pass
-
-    @abstractmethod
-    def delete_intermediates(self) -> list[str]:
-        """Deletes all intermediate image records, returning a list of deleted image names."""
-        pass
-
-    @abstractmethod
-    def save(
-        self,
-        image_name: str,
-        image_origin: ResourceOrigin,
-        image_category: ImageCategory,
-        width: int,
-        height: int,
-        session_id: Optional[str],
-        node_id: Optional[str],
-        metadata: Optional[dict],
-        is_intermediate: bool = False,
-        starred: bool = False,
-    ) -> datetime:
-        """Saves an image record."""
-        pass
-
-    @abstractmethod
-    def get_most_recent_image_for_board(self, board_id: str) -> Optional[ImageRecord]:
-        """Gets the most recent image for a board."""
-        pass
-
-
 class SqliteImageRecordStorage(ImageRecordStorageBase):
     _conn: sqlite3.Connection
     _cursor: sqlite3.Cursor
-    _lock: threading.Lock
+    _lock: threading.RLock
 
-    def __init__(self, conn: sqlite3.Connection, lock: threading.Lock) -> None:
+    def __init__(self, db: SqliteDatabase) -> None:
         super().__init__()
-        self._conn = conn
-        # Enable row factory to get rows as dictionaries (must be done before making the cursor!)
-        self._conn.row_factory = sqlite3.Row
+        self._lock = db.lock
+        self._conn = db.conn
         self._cursor = self._conn.cursor()
-        self._lock = lock
 
         try:
             self._lock.acquire()
@@ -245,7 +117,7 @@ class SqliteImageRecordStorage(ImageRecordStorageBase):
             """
         )
 
-    def get(self, image_name: str) -> Optional[ImageRecord]:
+    def get(self, image_name: str) -> ImageRecord:
         try:
             self._lock.acquire()
 
@@ -351,8 +223,8 @@ class SqliteImageRecordStorage(ImageRecordStorageBase):
 
     def get_many(
         self,
-        offset: Optional[int] = None,
-        limit: Optional[int] = None,
+        offset: int = 0,
+        limit: int = 10,
         image_origin: Optional[ResourceOrigin] = None,
         categories: Optional[list[ImageCategory]] = None,
         is_intermediate: Optional[bool] = None,
@@ -377,7 +249,7 @@ class SqliteImageRecordStorage(ImageRecordStorageBase):
             """
 
             query_conditions = ""
-            query_params = []
+            query_params: list[Union[int, str, bool]] = []
 
             if image_origin is not None:
                 query_conditions += """--sql
@@ -515,13 +387,13 @@ class SqliteImageRecordStorage(ImageRecordStorageBase):
         image_name: str,
         image_origin: ResourceOrigin,
         image_category: ImageCategory,
-        session_id: Optional[str],
         width: int,
         height: int,
-        node_id: Optional[str],
-        metadata: Optional[dict],
-        is_intermediate: bool = False,
-        starred: bool = False,
+        is_intermediate: Optional[bool] = False,
+        starred: Optional[bool] = False,
+        session_id: Optional[str] = None,
+        node_id: Optional[str] = None,
+        metadata: Optional[dict] = None,
     ) -> datetime:
         try:
             metadata_json = None if metadata is None else json.dumps(metadata)
diff --git a/invokeai/app/services/images.py b/invokeai/app/services/images.py
deleted file mode 100644
index 08d5093a70..0000000000
--- a/invokeai/app/services/images.py
+++ /dev/null
@@ -1,449 +0,0 @@
-from abc import ABC, abstractmethod
-from logging import Logger
-from typing import TYPE_CHECKING, Callable, Optional
-
-from PIL.Image import Image as PILImageType
-
-from invokeai.app.invocations.metadata import ImageMetadata
-from invokeai.app.models.image import (
-    ImageCategory,
-    InvalidImageCategoryException,
-    InvalidOriginException,
-    ResourceOrigin,
-)
-from invokeai.app.services.board_image_record_storage import BoardImageRecordStorageBase
-from invokeai.app.services.image_file_storage import (
-    ImageFileDeleteException,
-    ImageFileNotFoundException,
-    ImageFileSaveException,
-    ImageFileStorageBase,
-)
-from invokeai.app.services.image_record_storage import (
-    ImageRecordDeleteException,
-    ImageRecordNotFoundException,
-    ImageRecordSaveException,
-    ImageRecordStorageBase,
-    OffsetPaginatedResults,
-)
-from invokeai.app.services.item_storage import ItemStorageABC
-from invokeai.app.services.models.image_record import ImageDTO, ImageRecord, ImageRecordChanges, image_record_to_dto
-from invokeai.app.services.resource_name import NameServiceBase
-from invokeai.app.services.urls import UrlServiceBase
-from invokeai.app.util.metadata import get_metadata_graph_from_raw_session
-
-if TYPE_CHECKING:
-    from invokeai.app.services.graph import GraphExecutionState
-
-
-class ImageServiceABC(ABC):
-    """High-level service for image management."""
-
-    _on_changed_callbacks: list[Callable[[ImageDTO], None]]
-    _on_deleted_callbacks: list[Callable[[str], None]]
-
-    def __init__(self) -> None:
-        self._on_changed_callbacks = list()
-        self._on_deleted_callbacks = list()
-
-    def on_changed(self, on_changed: Callable[[ImageDTO], None]) -> None:
-        """Register a callback for when an image is changed"""
-        self._on_changed_callbacks.append(on_changed)
-
-    def on_deleted(self, on_deleted: Callable[[str], None]) -> None:
-        """Register a callback for when an image is deleted"""
-        self._on_deleted_callbacks.append(on_deleted)
-
-    def _on_changed(self, item: ImageDTO) -> None:
-        for callback in self._on_changed_callbacks:
-            callback(item)
-
-    def _on_deleted(self, item_id: str) -> None:
-        for callback in self._on_deleted_callbacks:
-            callback(item_id)
-
-    @abstractmethod
-    def create(
-        self,
-        image: PILImageType,
-        image_origin: ResourceOrigin,
-        image_category: ImageCategory,
-        node_id: Optional[str] = None,
-        session_id: Optional[str] = None,
-        board_id: Optional[str] = None,
-        is_intermediate: bool = False,
-        metadata: Optional[dict] = None,
-        workflow: Optional[str] = None,
-    ) -> ImageDTO:
-        """Creates an image, storing the file and its metadata."""
-        pass
-
-    @abstractmethod
-    def update(
-        self,
-        image_name: str,
-        changes: ImageRecordChanges,
-    ) -> ImageDTO:
-        """Updates an image."""
-        pass
-
-    @abstractmethod
-    def get_pil_image(self, image_name: str) -> PILImageType:
-        """Gets an image as a PIL image."""
-        pass
-
-    @abstractmethod
-    def get_record(self, image_name: str) -> ImageRecord:
-        """Gets an image record."""
-        pass
-
-    @abstractmethod
-    def get_dto(self, image_name: str) -> ImageDTO:
-        """Gets an image DTO."""
-        pass
-
-    @abstractmethod
-    def get_metadata(self, image_name: str) -> ImageMetadata:
-        """Gets an image's metadata."""
-        pass
-
-    @abstractmethod
-    def get_path(self, image_name: str, thumbnail: bool = False) -> str:
-        """Gets an image's path."""
-        pass
-
-    @abstractmethod
-    def validate_path(self, path: str) -> bool:
-        """Validates an image's path."""
-        pass
-
-    @abstractmethod
-    def get_url(self, image_name: str, thumbnail: bool = False) -> str:
-        """Gets an image's or thumbnail's URL."""
-        pass
-
-    @abstractmethod
-    def get_many(
-        self,
-        offset: int = 0,
-        limit: int = 10,
-        image_origin: Optional[ResourceOrigin] = None,
-        categories: Optional[list[ImageCategory]] = None,
-        is_intermediate: Optional[bool] = None,
-        board_id: Optional[str] = None,
-    ) -> OffsetPaginatedResults[ImageDTO]:
-        """Gets a paginated list of image DTOs."""
-        pass
-
-    @abstractmethod
-    def delete(self, image_name: str):
-        """Deletes an image."""
-        pass
-
-    @abstractmethod
-    def delete_intermediates(self) -> int:
-        """Deletes all intermediate images."""
-        pass
-
-    @abstractmethod
-    def delete_images_on_board(self, board_id: str):
-        """Deletes all images on a board."""
-        pass
-
-
-class ImageServiceDependencies:
-    """Service dependencies for the ImageService."""
-
-    image_records: ImageRecordStorageBase
-    image_files: ImageFileStorageBase
-    board_image_records: BoardImageRecordStorageBase
-    urls: UrlServiceBase
-    logger: Logger
-    names: NameServiceBase
-    graph_execution_manager: ItemStorageABC["GraphExecutionState"]
-
-    def __init__(
-        self,
-        image_record_storage: ImageRecordStorageBase,
-        image_file_storage: ImageFileStorageBase,
-        board_image_record_storage: BoardImageRecordStorageBase,
-        url: UrlServiceBase,
-        logger: Logger,
-        names: NameServiceBase,
-        graph_execution_manager: ItemStorageABC["GraphExecutionState"],
-    ):
-        self.image_records = image_record_storage
-        self.image_files = image_file_storage
-        self.board_image_records = board_image_record_storage
-        self.urls = url
-        self.logger = logger
-        self.names = names
-        self.graph_execution_manager = graph_execution_manager
-
-
-class ImageService(ImageServiceABC):
-    _services: ImageServiceDependencies
-
-    def __init__(self, services: ImageServiceDependencies):
-        super().__init__()
-        self._services = services
-
-    def create(
-        self,
-        image: PILImageType,
-        image_origin: ResourceOrigin,
-        image_category: ImageCategory,
-        node_id: Optional[str] = None,
-        session_id: Optional[str] = None,
-        board_id: Optional[str] = None,
-        is_intermediate: bool = False,
-        metadata: Optional[dict] = None,
-        workflow: Optional[str] = None,
-    ) -> ImageDTO:
-        if image_origin not in ResourceOrigin:
-            raise InvalidOriginException
-
-        if image_category not in ImageCategory:
-            raise InvalidImageCategoryException
-
-        image_name = self._services.names.create_image_name()
-
-        # TODO: Do we want to store the graph in the image at all? I don't think so...
-        # graph = None
-        # if session_id is not None:
-        #     session_raw = self._services.graph_execution_manager.get_raw(session_id)
-        #     if session_raw is not None:
-        #         try:
-        #             graph = get_metadata_graph_from_raw_session(session_raw)
-        #         except Exception as e:
-        #             self._services.logger.warn(f"Failed to parse session graph: {e}")
-        #             graph = None
-
-        (width, height) = image.size
-
-        try:
-            # TODO: Consider using a transaction here to ensure consistency between storage and database
-            self._services.image_records.save(
-                # Non-nullable fields
-                image_name=image_name,
-                image_origin=image_origin,
-                image_category=image_category,
-                width=width,
-                height=height,
-                # Meta fields
-                is_intermediate=is_intermediate,
-                # Nullable fields
-                node_id=node_id,
-                metadata=metadata,
-                session_id=session_id,
-            )
-            if board_id is not None:
-                self._services.board_image_records.add_image_to_board(board_id=board_id, image_name=image_name)
-            self._services.image_files.save(image_name=image_name, image=image, metadata=metadata, workflow=workflow)
-            image_dto = self.get_dto(image_name)
-
-            self._on_changed(image_dto)
-            return image_dto
-        except ImageRecordSaveException:
-            self._services.logger.error("Failed to save image record")
-            raise
-        except ImageFileSaveException:
-            self._services.logger.error("Failed to save image file")
-            raise
-        except Exception as e:
-            self._services.logger.error(f"Problem saving image record and file: {str(e)}")
-            raise e
-
-    def update(
-        self,
-        image_name: str,
-        changes: ImageRecordChanges,
-    ) -> ImageDTO:
-        try:
-            self._services.image_records.update(image_name, changes)
-            image_dto = self.get_dto(image_name)
-            self._on_changed(image_dto)
-            return image_dto
-        except ImageRecordSaveException:
-            self._services.logger.error("Failed to update image record")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem updating image record")
-            raise e
-
-    def get_pil_image(self, image_name: str) -> PILImageType:
-        try:
-            return self._services.image_files.get(image_name)
-        except ImageFileNotFoundException:
-            self._services.logger.error("Failed to get image file")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem getting image file")
-            raise e
-
-    def get_record(self, image_name: str) -> ImageRecord:
-        try:
-            return self._services.image_records.get(image_name)
-        except ImageRecordNotFoundException:
-            self._services.logger.error("Image record not found")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem getting image record")
-            raise e
-
-    def get_dto(self, image_name: str) -> ImageDTO:
-        try:
-            image_record = self._services.image_records.get(image_name)
-
-            image_dto = image_record_to_dto(
-                image_record,
-                self._services.urls.get_image_url(image_name),
-                self._services.urls.get_image_url(image_name, True),
-                self._services.board_image_records.get_board_for_image(image_name),
-            )
-
-            return image_dto
-        except ImageRecordNotFoundException:
-            self._services.logger.error("Image record not found")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem getting image DTO")
-            raise e
-
-    def get_metadata(self, image_name: str) -> Optional[ImageMetadata]:
-        try:
-            image_record = self._services.image_records.get(image_name)
-            metadata = self._services.image_records.get_metadata(image_name)
-
-            if not image_record.session_id:
-                return ImageMetadata(metadata=metadata)
-
-            session_raw = self._services.graph_execution_manager.get_raw(image_record.session_id)
-            graph = None
-
-            if session_raw:
-                try:
-                    graph = get_metadata_graph_from_raw_session(session_raw)
-                except Exception as e:
-                    self._services.logger.warn(f"Failed to parse session graph: {e}")
-                    graph = None
-
-            return ImageMetadata(graph=graph, metadata=metadata)
-        except ImageRecordNotFoundException:
-            self._services.logger.error("Image record not found")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem getting image DTO")
-            raise e
-
-    def get_path(self, image_name: str, thumbnail: bool = False) -> str:
-        try:
-            return self._services.image_files.get_path(image_name, thumbnail)
-        except Exception as e:
-            self._services.logger.error("Problem getting image path")
-            raise e
-
-    def validate_path(self, path: str) -> bool:
-        try:
-            return self._services.image_files.validate_path(path)
-        except Exception as e:
-            self._services.logger.error("Problem validating image path")
-            raise e
-
-    def get_url(self, image_name: str, thumbnail: bool = False) -> str:
-        try:
-            return self._services.urls.get_image_url(image_name, thumbnail)
-        except Exception as e:
-            self._services.logger.error("Problem getting image path")
-            raise e
-
-    def get_many(
-        self,
-        offset: int = 0,
-        limit: int = 10,
-        image_origin: Optional[ResourceOrigin] = None,
-        categories: Optional[list[ImageCategory]] = None,
-        is_intermediate: Optional[bool] = None,
-        board_id: Optional[str] = None,
-    ) -> OffsetPaginatedResults[ImageDTO]:
-        try:
-            results = self._services.image_records.get_many(
-                offset,
-                limit,
-                image_origin,
-                categories,
-                is_intermediate,
-                board_id,
-            )
-
-            image_dtos = list(
-                map(
-                    lambda r: image_record_to_dto(
-                        r,
-                        self._services.urls.get_image_url(r.image_name),
-                        self._services.urls.get_image_url(r.image_name, True),
-                        self._services.board_image_records.get_board_for_image(r.image_name),
-                    ),
-                    results.items,
-                )
-            )
-
-            return OffsetPaginatedResults[ImageDTO](
-                items=image_dtos,
-                offset=results.offset,
-                limit=results.limit,
-                total=results.total,
-            )
-        except Exception as e:
-            self._services.logger.error("Problem getting paginated image DTOs")
-            raise e
-
-    def delete(self, image_name: str):
-        try:
-            self._services.image_files.delete(image_name)
-            self._services.image_records.delete(image_name)
-            self._on_deleted(image_name)
-        except ImageRecordDeleteException:
-            self._services.logger.error("Failed to delete image record")
-            raise
-        except ImageFileDeleteException:
-            self._services.logger.error("Failed to delete image file")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem deleting image record and file")
-            raise e
-
-    def delete_images_on_board(self, board_id: str):
-        try:
-            image_names = self._services.board_image_records.get_all_board_image_names_for_board(board_id)
-            for image_name in image_names:
-                self._services.image_files.delete(image_name)
-            self._services.image_records.delete_many(image_names)
-            for image_name in image_names:
-                self._on_deleted(image_name)
-        except ImageRecordDeleteException:
-            self._services.logger.error("Failed to delete image records")
-            raise
-        except ImageFileDeleteException:
-            self._services.logger.error("Failed to delete image files")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem deleting image records and files")
-            raise e
-
-    def delete_intermediates(self) -> int:
-        try:
-            image_names = self._services.image_records.delete_intermediates()
-            count = len(image_names)
-            for image_name in image_names:
-                self._services.image_files.delete(image_name)
-                self._on_deleted(image_name)
-            return count
-        except ImageRecordDeleteException:
-            self._services.logger.error("Failed to delete image records")
-            raise
-        except ImageFileDeleteException:
-            self._services.logger.error("Failed to delete image files")
-            raise
-        except Exception as e:
-            self._services.logger.error("Problem deleting image records and files")
-            raise e
diff --git a/invokeai/app/services/images/__init__.py b/invokeai/app/services/images/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/images/images_base.py b/invokeai/app/services/images/images_base.py
new file mode 100644
index 0000000000..a611e9485d
--- /dev/null
+++ b/invokeai/app/services/images/images_base.py
@@ -0,0 +1,129 @@
+from abc import ABC, abstractmethod
+from typing import Callable, Optional
+
+from PIL.Image import Image as PILImageType
+
+from invokeai.app.invocations.metadata import ImageMetadata
+from invokeai.app.services.image_records.image_records_common import (
+    ImageCategory,
+    ImageRecord,
+    ImageRecordChanges,
+    ResourceOrigin,
+)
+from invokeai.app.services.images.images_common import ImageDTO
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+
+
+class ImageServiceABC(ABC):
+    """High-level service for image management."""
+
+    _on_changed_callbacks: list[Callable[[ImageDTO], None]]
+    _on_deleted_callbacks: list[Callable[[str], None]]
+
+    def __init__(self) -> None:
+        self._on_changed_callbacks = list()
+        self._on_deleted_callbacks = list()
+
+    def on_changed(self, on_changed: Callable[[ImageDTO], None]) -> None:
+        """Register a callback for when an image is changed"""
+        self._on_changed_callbacks.append(on_changed)
+
+    def on_deleted(self, on_deleted: Callable[[str], None]) -> None:
+        """Register a callback for when an image is deleted"""
+        self._on_deleted_callbacks.append(on_deleted)
+
+    def _on_changed(self, item: ImageDTO) -> None:
+        for callback in self._on_changed_callbacks:
+            callback(item)
+
+    def _on_deleted(self, item_id: str) -> None:
+        for callback in self._on_deleted_callbacks:
+            callback(item_id)
+
+    @abstractmethod
+    def create(
+        self,
+        image: PILImageType,
+        image_origin: ResourceOrigin,
+        image_category: ImageCategory,
+        node_id: Optional[str] = None,
+        session_id: Optional[str] = None,
+        board_id: Optional[str] = None,
+        is_intermediate: Optional[bool] = False,
+        metadata: Optional[dict] = None,
+        workflow: Optional[str] = None,
+    ) -> ImageDTO:
+        """Creates an image, storing the file and its metadata."""
+        pass
+
+    @abstractmethod
+    def update(
+        self,
+        image_name: str,
+        changes: ImageRecordChanges,
+    ) -> ImageDTO:
+        """Updates an image."""
+        pass
+
+    @abstractmethod
+    def get_pil_image(self, image_name: str) -> PILImageType:
+        """Gets an image as a PIL image."""
+        pass
+
+    @abstractmethod
+    def get_record(self, image_name: str) -> ImageRecord:
+        """Gets an image record."""
+        pass
+
+    @abstractmethod
+    def get_dto(self, image_name: str) -> ImageDTO:
+        """Gets an image DTO."""
+        pass
+
+    @abstractmethod
+    def get_metadata(self, image_name: str) -> ImageMetadata:
+        """Gets an image's metadata."""
+        pass
+
+    @abstractmethod
+    def get_path(self, image_name: str, thumbnail: bool = False) -> str:
+        """Gets an image's path."""
+        pass
+
+    @abstractmethod
+    def validate_path(self, path: str) -> bool:
+        """Validates an image's path."""
+        pass
+
+    @abstractmethod
+    def get_url(self, image_name: str, thumbnail: bool = False) -> str:
+        """Gets an image's or thumbnail's URL."""
+        pass
+
+    @abstractmethod
+    def get_many(
+        self,
+        offset: int = 0,
+        limit: int = 10,
+        image_origin: Optional[ResourceOrigin] = None,
+        categories: Optional[list[ImageCategory]] = None,
+        is_intermediate: Optional[bool] = None,
+        board_id: Optional[str] = None,
+    ) -> OffsetPaginatedResults[ImageDTO]:
+        """Gets a paginated list of image DTOs."""
+        pass
+
+    @abstractmethod
+    def delete(self, image_name: str):
+        """Deletes an image."""
+        pass
+
+    @abstractmethod
+    def delete_intermediates(self) -> int:
+        """Deletes all intermediate images."""
+        pass
+
+    @abstractmethod
+    def delete_images_on_board(self, board_id: str):
+        """Deletes all images on a board."""
+        pass
diff --git a/invokeai/app/services/images/images_common.py b/invokeai/app/services/images/images_common.py
new file mode 100644
index 0000000000..325cecdd26
--- /dev/null
+++ b/invokeai/app/services/images/images_common.py
@@ -0,0 +1,43 @@
+from typing import Optional
+
+from pydantic import Field
+
+from invokeai.app.services.image_records.image_records_common import ImageRecord
+from invokeai.app.util.model_exclude_null import BaseModelExcludeNull
+
+
+class ImageUrlsDTO(BaseModelExcludeNull):
+    """The URLs for an image and its thumbnail."""
+
+    image_name: str = Field(description="The unique name of the image.")
+    """The unique name of the image."""
+    image_url: str = Field(description="The URL of the image.")
+    """The URL of the image."""
+    thumbnail_url: str = Field(description="The URL of the image's thumbnail.")
+    """The URL of the image's thumbnail."""
+
+
+class ImageDTO(ImageRecord, ImageUrlsDTO):
+    """Deserialized image record, enriched for the frontend."""
+
+    board_id: Optional[str] = Field(
+        default=None, description="The id of the board the image belongs to, if one exists."
+    )
+    """The id of the board the image belongs to, if one exists."""
+
+    pass
+
+
+def image_record_to_dto(
+    image_record: ImageRecord,
+    image_url: str,
+    thumbnail_url: str,
+    board_id: Optional[str],
+) -> ImageDTO:
+    """Converts an image record to an image DTO."""
+    return ImageDTO(
+        **image_record.model_dump(),
+        image_url=image_url,
+        thumbnail_url=thumbnail_url,
+        board_id=board_id,
+    )
diff --git a/invokeai/app/services/images/images_default.py b/invokeai/app/services/images/images_default.py
new file mode 100644
index 0000000000..d4e473b8e4
--- /dev/null
+++ b/invokeai/app/services/images/images_default.py
@@ -0,0 +1,286 @@
+from typing import Optional
+
+from PIL.Image import Image as PILImageType
+
+from invokeai.app.invocations.metadata import ImageMetadata
+from invokeai.app.services.invoker import Invoker
+from invokeai.app.services.shared.pagination import OffsetPaginatedResults
+from invokeai.app.util.metadata import get_metadata_graph_from_raw_session
+
+from ..image_files.image_files_common import (
+    ImageFileDeleteException,
+    ImageFileNotFoundException,
+    ImageFileSaveException,
+)
+from ..image_records.image_records_common import (
+    ImageCategory,
+    ImageRecord,
+    ImageRecordChanges,
+    ImageRecordDeleteException,
+    ImageRecordNotFoundException,
+    ImageRecordSaveException,
+    InvalidImageCategoryException,
+    InvalidOriginException,
+    ResourceOrigin,
+)
+from .images_base import ImageServiceABC
+from .images_common import ImageDTO, image_record_to_dto
+
+
+class ImageService(ImageServiceABC):
+    __invoker: Invoker
+
+    def start(self, invoker: Invoker) -> None:
+        self.__invoker = invoker
+
+    def create(
+        self,
+        image: PILImageType,
+        image_origin: ResourceOrigin,
+        image_category: ImageCategory,
+        node_id: Optional[str] = None,
+        session_id: Optional[str] = None,
+        board_id: Optional[str] = None,
+        is_intermediate: Optional[bool] = False,
+        metadata: Optional[dict] = None,
+        workflow: Optional[str] = None,
+    ) -> ImageDTO:
+        if image_origin not in ResourceOrigin:
+            raise InvalidOriginException
+
+        if image_category not in ImageCategory:
+            raise InvalidImageCategoryException
+
+        image_name = self.__invoker.services.names.create_image_name()
+
+        (width, height) = image.size
+
+        try:
+            # TODO: Consider using a transaction here to ensure consistency between storage and database
+            self.__invoker.services.image_records.save(
+                # Non-nullable fields
+                image_name=image_name,
+                image_origin=image_origin,
+                image_category=image_category,
+                width=width,
+                height=height,
+                # Meta fields
+                is_intermediate=is_intermediate,
+                # Nullable fields
+                node_id=node_id,
+                metadata=metadata,
+                session_id=session_id,
+            )
+            if board_id is not None:
+                self.__invoker.services.board_image_records.add_image_to_board(board_id=board_id, image_name=image_name)
+            self.__invoker.services.image_files.save(
+                image_name=image_name, image=image, metadata=metadata, workflow=workflow
+            )
+            image_dto = self.get_dto(image_name)
+
+            self._on_changed(image_dto)
+            return image_dto
+        except ImageRecordSaveException:
+            self.__invoker.services.logger.error("Failed to save image record")
+            raise
+        except ImageFileSaveException:
+            self.__invoker.services.logger.error("Failed to save image file")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error(f"Problem saving image record and file: {str(e)}")
+            raise e
+
+    def update(
+        self,
+        image_name: str,
+        changes: ImageRecordChanges,
+    ) -> ImageDTO:
+        try:
+            self.__invoker.services.image_records.update(image_name, changes)
+            image_dto = self.get_dto(image_name)
+            self._on_changed(image_dto)
+            return image_dto
+        except ImageRecordSaveException:
+            self.__invoker.services.logger.error("Failed to update image record")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem updating image record")
+            raise e
+
+    def get_pil_image(self, image_name: str) -> PILImageType:
+        try:
+            return self.__invoker.services.image_files.get(image_name)
+        except ImageFileNotFoundException:
+            self.__invoker.services.logger.error("Failed to get image file")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem getting image file")
+            raise e
+
+    def get_record(self, image_name: str) -> ImageRecord:
+        try:
+            return self.__invoker.services.image_records.get(image_name)
+        except ImageRecordNotFoundException:
+            self.__invoker.services.logger.error("Image record not found")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem getting image record")
+            raise e
+
+    def get_dto(self, image_name: str) -> ImageDTO:
+        try:
+            image_record = self.__invoker.services.image_records.get(image_name)
+
+            image_dto = image_record_to_dto(
+                image_record,
+                self.__invoker.services.urls.get_image_url(image_name),
+                self.__invoker.services.urls.get_image_url(image_name, True),
+                self.__invoker.services.board_image_records.get_board_for_image(image_name),
+            )
+
+            return image_dto
+        except ImageRecordNotFoundException:
+            self.__invoker.services.logger.error("Image record not found")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem getting image DTO")
+            raise e
+
+    def get_metadata(self, image_name: str) -> ImageMetadata:
+        try:
+            image_record = self.__invoker.services.image_records.get(image_name)
+            metadata = self.__invoker.services.image_records.get_metadata(image_name)
+
+            if not image_record.session_id:
+                return ImageMetadata(metadata=metadata)
+
+            session_raw = self.__invoker.services.graph_execution_manager.get_raw(image_record.session_id)
+            graph = None
+
+            if session_raw:
+                try:
+                    graph = get_metadata_graph_from_raw_session(session_raw)
+                except Exception as e:
+                    self.__invoker.services.logger.warn(f"Failed to parse session graph: {e}")
+                    graph = None
+
+            return ImageMetadata(graph=graph, metadata=metadata)
+        except ImageRecordNotFoundException:
+            self.__invoker.services.logger.error("Image record not found")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem getting image DTO")
+            raise e
+
+    def get_path(self, image_name: str, thumbnail: bool = False) -> str:
+        try:
+            return str(self.__invoker.services.image_files.get_path(image_name, thumbnail))
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem getting image path")
+            raise e
+
+    def validate_path(self, path: str) -> bool:
+        try:
+            return self.__invoker.services.image_files.validate_path(path)
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem validating image path")
+            raise e
+
+    def get_url(self, image_name: str, thumbnail: bool = False) -> str:
+        try:
+            return self.__invoker.services.urls.get_image_url(image_name, thumbnail)
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem getting image path")
+            raise e
+
+    def get_many(
+        self,
+        offset: int = 0,
+        limit: int = 10,
+        image_origin: Optional[ResourceOrigin] = None,
+        categories: Optional[list[ImageCategory]] = None,
+        is_intermediate: Optional[bool] = None,
+        board_id: Optional[str] = None,
+    ) -> OffsetPaginatedResults[ImageDTO]:
+        try:
+            results = self.__invoker.services.image_records.get_many(
+                offset,
+                limit,
+                image_origin,
+                categories,
+                is_intermediate,
+                board_id,
+            )
+
+            image_dtos = list(
+                map(
+                    lambda r: image_record_to_dto(
+                        r,
+                        self.__invoker.services.urls.get_image_url(r.image_name),
+                        self.__invoker.services.urls.get_image_url(r.image_name, True),
+                        self.__invoker.services.board_image_records.get_board_for_image(r.image_name),
+                    ),
+                    results.items,
+                )
+            )
+
+            return OffsetPaginatedResults[ImageDTO](
+                items=image_dtos,
+                offset=results.offset,
+                limit=results.limit,
+                total=results.total,
+            )
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem getting paginated image DTOs")
+            raise e
+
+    def delete(self, image_name: str):
+        try:
+            self.__invoker.services.image_files.delete(image_name)
+            self.__invoker.services.image_records.delete(image_name)
+            self._on_deleted(image_name)
+        except ImageRecordDeleteException:
+            self.__invoker.services.logger.error("Failed to delete image record")
+            raise
+        except ImageFileDeleteException:
+            self.__invoker.services.logger.error("Failed to delete image file")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem deleting image record and file")
+            raise e
+
+    def delete_images_on_board(self, board_id: str):
+        try:
+            image_names = self.__invoker.services.board_image_records.get_all_board_image_names_for_board(board_id)
+            for image_name in image_names:
+                self.__invoker.services.image_files.delete(image_name)
+            self.__invoker.services.image_records.delete_many(image_names)
+            for image_name in image_names:
+                self._on_deleted(image_name)
+        except ImageRecordDeleteException:
+            self.__invoker.services.logger.error("Failed to delete image records")
+            raise
+        except ImageFileDeleteException:
+            self.__invoker.services.logger.error("Failed to delete image files")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem deleting image records and files")
+            raise e
+
+    def delete_intermediates(self) -> int:
+        try:
+            image_names = self.__invoker.services.image_records.delete_intermediates()
+            count = len(image_names)
+            for image_name in image_names:
+                self.__invoker.services.image_files.delete(image_name)
+                self._on_deleted(image_name)
+            return count
+        except ImageRecordDeleteException:
+            self.__invoker.services.logger.error("Failed to delete image records")
+            raise
+        except ImageFileDeleteException:
+            self.__invoker.services.logger.error("Failed to delete image files")
+            raise
+        except Exception as e:
+            self.__invoker.services.logger.error("Problem deleting image records and files")
+            raise e
diff --git a/invokeai/app/services/invocation_cache/invocation_cache_memory.py b/invokeai/app/services/invocation_cache/invocation_cache_memory.py
index 817dbb958e..4a503b3c6b 100644
--- a/invokeai/app/services/invocation_cache/invocation_cache_memory.py
+++ b/invokeai/app/services/invocation_cache/invocation_cache_memory.py
@@ -58,7 +58,12 @@ class MemoryInvocationCache(InvocationCacheBase):
             # If the cache is full, we need to remove the least used
             number_to_delete = len(self._cache) + 1 - self._max_cache_size
             self._delete_oldest_access(number_to_delete)
-            self._cache[key] = CachedItem(invocation_output, invocation_output.json())
+            self._cache[key] = CachedItem(
+                invocation_output,
+                invocation_output.model_dump_json(
+                    warnings=False, exclude_defaults=True, exclude_unset=True, include={"type"}
+                ),
+            )
 
     def _delete_oldest_access(self, number_to_delete: int) -> None:
         number_to_delete = min(number_to_delete, len(self._cache))
@@ -85,7 +90,7 @@ class MemoryInvocationCache(InvocationCacheBase):
 
     @staticmethod
     def create_key(invocation: BaseInvocation) -> int:
-        return hash(invocation.json(exclude={"id"}))
+        return hash(invocation.model_dump_json(exclude={"id"}, warnings=False))
 
     def disable(self) -> None:
         with self._lock:
diff --git a/invokeai/app/services/invocation_processor/__init__.py b/invokeai/app/services/invocation_processor/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/invocation_processor/invocation_processor_base.py b/invokeai/app/services/invocation_processor/invocation_processor_base.py
new file mode 100644
index 0000000000..04774accc2
--- /dev/null
+++ b/invokeai/app/services/invocation_processor/invocation_processor_base.py
@@ -0,0 +1,5 @@
+from abc import ABC
+
+
+class InvocationProcessorABC(ABC):
+    pass
diff --git a/invokeai/app/services/invocation_processor/invocation_processor_common.py b/invokeai/app/services/invocation_processor/invocation_processor_common.py
new file mode 100644
index 0000000000..347f6c7323
--- /dev/null
+++ b/invokeai/app/services/invocation_processor/invocation_processor_common.py
@@ -0,0 +1,15 @@
+from pydantic import BaseModel, Field
+
+
+class ProgressImage(BaseModel):
+    """The progress image sent intermittently during processing"""
+
+    width: int = Field(description="The effective width of the image in pixels")
+    height: int = Field(description="The effective height of the image in pixels")
+    dataURL: str = Field(description="The image data as a b64 data URL")
+
+
+class CanceledException(Exception):
+    """Execution canceled by user."""
+
+    pass
diff --git a/invokeai/app/services/processor.py b/invokeai/app/services/invocation_processor/invocation_processor_default.py
similarity index 90%
rename from invokeai/app/services/processor.py
rename to invokeai/app/services/invocation_processor/invocation_processor_default.py
index b4c894c52d..c59fb678ef 100644
--- a/invokeai/app/services/processor.py
+++ b/invokeai/app/services/invocation_processor/invocation_processor_default.py
@@ -4,12 +4,12 @@ from threading import BoundedSemaphore, Event, Thread
 from typing import Optional
 
 import invokeai.backend.util.logging as logger
+from invokeai.app.invocations.baseinvocation import InvocationContext
+from invokeai.app.services.invocation_queue.invocation_queue_common import InvocationQueueItem
 
-from ..invocations.baseinvocation import InvocationContext
-from ..models.exceptions import CanceledException
-from .invocation_queue import InvocationQueueItem
-from .invocation_stats import InvocationStatsServiceBase
-from .invoker import InvocationProcessorABC, Invoker
+from ..invoker import Invoker
+from .invocation_processor_base import InvocationProcessorABC
+from .invocation_processor_common import CanceledException
 
 
 class DefaultInvocationProcessor(InvocationProcessorABC):
@@ -37,7 +37,6 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
     def __process(self, stop_event: Event):
         try:
             self.__threadLimit.acquire()
-            statistics: InvocationStatsServiceBase = self.__invoker.services.performance_statistics
             queue_item: Optional[InvocationQueueItem] = None
 
             while not stop_event.is_set():
@@ -90,15 +89,14 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
                     queue_item_id=queue_item.session_queue_item_id,
                     queue_id=queue_item.session_queue_id,
                     graph_execution_state_id=graph_execution_state.id,
-                    node=invocation.dict(),
+                    node=invocation.model_dump(),
                     source_node_id=source_node_id,
                 )
 
                 # Invoke
                 try:
                     graph_id = graph_execution_state.id
-                    model_manager = self.__invoker.services.model_manager
-                    with statistics.collect_stats(invocation, graph_id, model_manager):
+                    with self.__invoker.services.performance_statistics.collect_stats(invocation, graph_id):
                         # use the internal invoke_internal(), which wraps the node's invoke() method,
                         # which handles a few things:
                         # - nodes that require a value, but get it only from a connection
@@ -129,17 +127,17 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
                             queue_item_id=queue_item.session_queue_item_id,
                             queue_id=queue_item.session_queue_id,
                             graph_execution_state_id=graph_execution_state.id,
-                            node=invocation.dict(),
+                            node=invocation.model_dump(),
                             source_node_id=source_node_id,
-                            result=outputs.dict(),
+                            result=outputs.model_dump(),
                         )
-                    statistics.log_stats()
+                    self.__invoker.services.performance_statistics.log_stats()
 
                 except KeyboardInterrupt:
                     pass
 
                 except CanceledException:
-                    statistics.reset_stats(graph_execution_state.id)
+                    self.__invoker.services.performance_statistics.reset_stats(graph_execution_state.id)
                     pass
 
                 except Exception as e:
@@ -159,12 +157,12 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
                         queue_item_id=queue_item.session_queue_item_id,
                         queue_id=queue_item.session_queue_id,
                         graph_execution_state_id=graph_execution_state.id,
-                        node=invocation.dict(),
+                        node=invocation.model_dump(),
                         source_node_id=source_node_id,
                         error_type=e.__class__.__name__,
                         error=error,
                     )
-                    statistics.reset_stats(graph_execution_state.id)
+                    self.__invoker.services.performance_statistics.reset_stats(graph_execution_state.id)
                     pass
 
                 # Check queue to see if this is canceled, and skip if so
@@ -189,7 +187,7 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
                             queue_item_id=queue_item.session_queue_item_id,
                             queue_id=queue_item.session_queue_id,
                             graph_execution_state_id=graph_execution_state.id,
-                            node=invocation.dict(),
+                            node=invocation.model_dump(),
                             source_node_id=source_node_id,
                             error_type=e.__class__.__name__,
                             error=traceback.format_exc(),
diff --git a/invokeai/app/services/invocation_queue/__init__.py b/invokeai/app/services/invocation_queue/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/invocation_queue/invocation_queue_base.py b/invokeai/app/services/invocation_queue/invocation_queue_base.py
new file mode 100644
index 0000000000..09f4875c5f
--- /dev/null
+++ b/invokeai/app/services/invocation_queue/invocation_queue_base.py
@@ -0,0 +1,26 @@
+# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
+
+from abc import ABC, abstractmethod
+from typing import Optional
+
+from .invocation_queue_common import InvocationQueueItem
+
+
+class InvocationQueueABC(ABC):
+    """Abstract base class for all invocation queues"""
+
+    @abstractmethod
+    def get(self) -> InvocationQueueItem:
+        pass
+
+    @abstractmethod
+    def put(self, item: Optional[InvocationQueueItem]) -> None:
+        pass
+
+    @abstractmethod
+    def cancel(self, graph_execution_state_id: str) -> None:
+        pass
+
+    @abstractmethod
+    def is_canceled(self, graph_execution_state_id: str) -> bool:
+        pass
diff --git a/invokeai/app/services/invocation_queue/invocation_queue_common.py b/invokeai/app/services/invocation_queue/invocation_queue_common.py
new file mode 100644
index 0000000000..88e72886f7
--- /dev/null
+++ b/invokeai/app/services/invocation_queue/invocation_queue_common.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
+
+import time
+
+from pydantic import BaseModel, Field
+
+
+class InvocationQueueItem(BaseModel):
+    graph_execution_state_id: str = Field(description="The ID of the graph execution state")
+    invocation_id: str = Field(description="The ID of the node being invoked")
+    session_queue_id: str = Field(description="The ID of the session queue from which this invocation queue item came")
+    session_queue_item_id: int = Field(
+        description="The ID of session queue item from which this invocation queue item came"
+    )
+    session_queue_batch_id: str = Field(
+        description="The ID of the session batch from which this invocation queue item came"
+    )
+    invoke_all: bool = Field(default=False)
+    timestamp: float = Field(default_factory=time.time)
diff --git a/invokeai/app/services/invocation_queue.py b/invokeai/app/services/invocation_queue/invocation_queue_memory.py
similarity index 52%
rename from invokeai/app/services/invocation_queue.py
rename to invokeai/app/services/invocation_queue/invocation_queue_memory.py
index 378a9d12cf..33e82fae18 100644
--- a/invokeai/app/services/invocation_queue.py
+++ b/invokeai/app/services/invocation_queue/invocation_queue_memory.py
@@ -1,45 +1,11 @@
 # Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
 
 import time
-from abc import ABC, abstractmethod
 from queue import Queue
 from typing import Optional
 
-from pydantic import BaseModel, Field
-
-
-class InvocationQueueItem(BaseModel):
-    graph_execution_state_id: str = Field(description="The ID of the graph execution state")
-    invocation_id: str = Field(description="The ID of the node being invoked")
-    session_queue_id: str = Field(description="The ID of the session queue from which this invocation queue item came")
-    session_queue_item_id: int = Field(
-        description="The ID of session queue item from which this invocation queue item came"
-    )
-    session_queue_batch_id: str = Field(
-        description="The ID of the session batch from which this invocation queue item came"
-    )
-    invoke_all: bool = Field(default=False)
-    timestamp: float = Field(default_factory=time.time)
-
-
-class InvocationQueueABC(ABC):
-    """Abstract base class for all invocation queues"""
-
-    @abstractmethod
-    def get(self) -> InvocationQueueItem:
-        pass
-
-    @abstractmethod
-    def put(self, item: Optional[InvocationQueueItem]) -> None:
-        pass
-
-    @abstractmethod
-    def cancel(self, graph_execution_state_id: str) -> None:
-        pass
-
-    @abstractmethod
-    def is_canceled(self, graph_execution_state_id: str) -> bool:
-        pass
+from .invocation_queue_base import InvocationQueueABC
+from .invocation_queue_common import InvocationQueueItem
 
 
 class MemoryInvocationQueue(InvocationQueueABC):
diff --git a/invokeai/app/services/invocation_services.py b/invokeai/app/services/invocation_services.py
index e496ff80f2..ba53ea50cf 100644
--- a/invokeai/app/services/invocation_services.py
+++ b/invokeai/app/services/invocation_services.py
@@ -6,21 +6,27 @@ from typing import TYPE_CHECKING
 if TYPE_CHECKING:
     from logging import Logger
 
-    from invokeai.app.services.board_images import BoardImagesServiceABC
-    from invokeai.app.services.boards import BoardServiceABC
-    from invokeai.app.services.config import InvokeAIAppConfig
-    from invokeai.app.services.events import EventServiceBase
-    from invokeai.app.services.graph import GraphExecutionState, LibraryGraph
-    from invokeai.app.services.images import ImageServiceABC
-    from invokeai.app.services.invocation_cache.invocation_cache_base import InvocationCacheBase
-    from invokeai.app.services.invocation_queue import InvocationQueueABC
-    from invokeai.app.services.invocation_stats import InvocationStatsServiceBase
-    from invokeai.app.services.invoker import InvocationProcessorABC
-    from invokeai.app.services.item_storage import ItemStorageABC
-    from invokeai.app.services.latent_storage import LatentsStorageBase
-    from invokeai.app.services.model_manager_service import ModelManagerServiceBase
-    from invokeai.app.services.session_processor.session_processor_base import SessionProcessorBase
-    from invokeai.app.services.session_queue.session_queue_base import SessionQueueBase
+    from .board_image_records.board_image_records_base import BoardImageRecordStorageBase
+    from .board_images.board_images_base import BoardImagesServiceABC
+    from .board_records.board_records_base import BoardRecordStorageBase
+    from .boards.boards_base import BoardServiceABC
+    from .config import InvokeAIAppConfig
+    from .events.events_base import EventServiceBase
+    from .image_files.image_files_base import ImageFileStorageBase
+    from .image_records.image_records_base import ImageRecordStorageBase
+    from .images.images_base import ImageServiceABC
+    from .invocation_cache.invocation_cache_base import InvocationCacheBase
+    from .invocation_processor.invocation_processor_base import InvocationProcessorABC
+    from .invocation_queue.invocation_queue_base import InvocationQueueABC
+    from .invocation_stats.invocation_stats_base import InvocationStatsServiceBase
+    from .item_storage.item_storage_base import ItemStorageABC
+    from .latents_storage.latents_storage_base import LatentsStorageBase
+    from .model_manager.model_manager_base import ModelManagerServiceBase
+    from .names.names_base import NameServiceBase
+    from .session_processor.session_processor_base import SessionProcessorBase
+    from .session_queue.session_queue_base import SessionQueueBase
+    from .shared.graph import GraphExecutionState, LibraryGraph
+    from .urls.urls_base import UrlServiceBase
 
 
 class InvocationServices:
@@ -28,12 +34,16 @@ class InvocationServices:
 
     # TODO: Just forward-declared everything due to circular dependencies. Fix structure.
     board_images: "BoardImagesServiceABC"
+    board_image_record_storage: "BoardImageRecordStorageBase"
     boards: "BoardServiceABC"
+    board_records: "BoardRecordStorageBase"
     configuration: "InvokeAIAppConfig"
     events: "EventServiceBase"
     graph_execution_manager: "ItemStorageABC[GraphExecutionState]"
     graph_library: "ItemStorageABC[LibraryGraph]"
     images: "ImageServiceABC"
+    image_records: "ImageRecordStorageBase"
+    image_files: "ImageFileStorageBase"
     latents: "LatentsStorageBase"
     logger: "Logger"
     model_manager: "ModelManagerServiceBase"
@@ -43,16 +53,22 @@ class InvocationServices:
     session_queue: "SessionQueueBase"
     session_processor: "SessionProcessorBase"
     invocation_cache: "InvocationCacheBase"
+    names: "NameServiceBase"
+    urls: "UrlServiceBase"
 
     def __init__(
         self,
         board_images: "BoardImagesServiceABC",
+        board_image_records: "BoardImageRecordStorageBase",
         boards: "BoardServiceABC",
+        board_records: "BoardRecordStorageBase",
         configuration: "InvokeAIAppConfig",
         events: "EventServiceBase",
         graph_execution_manager: "ItemStorageABC[GraphExecutionState]",
         graph_library: "ItemStorageABC[LibraryGraph]",
         images: "ImageServiceABC",
+        image_files: "ImageFileStorageBase",
+        image_records: "ImageRecordStorageBase",
         latents: "LatentsStorageBase",
         logger: "Logger",
         model_manager: "ModelManagerServiceBase",
@@ -62,14 +78,20 @@ class InvocationServices:
         session_queue: "SessionQueueBase",
         session_processor: "SessionProcessorBase",
         invocation_cache: "InvocationCacheBase",
+        names: "NameServiceBase",
+        urls: "UrlServiceBase",
     ):
         self.board_images = board_images
+        self.board_image_records = board_image_records
         self.boards = boards
+        self.board_records = board_records
         self.configuration = configuration
         self.events = events
         self.graph_execution_manager = graph_execution_manager
         self.graph_library = graph_library
         self.images = images
+        self.image_files = image_files
+        self.image_records = image_records
         self.latents = latents
         self.logger = logger
         self.model_manager = model_manager
@@ -79,3 +101,5 @@ class InvocationServices:
         self.session_queue = session_queue
         self.session_processor = session_processor
         self.invocation_cache = invocation_cache
+        self.names = names
+        self.urls = urls
diff --git a/invokeai/app/services/invocation_stats/__init__.py b/invokeai/app/services/invocation_stats/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/invocation_stats/invocation_stats_base.py b/invokeai/app/services/invocation_stats/invocation_stats_base.py
new file mode 100644
index 0000000000..7db653c3fb
--- /dev/null
+++ b/invokeai/app/services/invocation_stats/invocation_stats_base.py
@@ -0,0 +1,121 @@
+# Copyright 2023 Lincoln D. Stein <lincoln.stein@gmail.com>
+"""Utility to collect execution time and GPU usage stats on invocations in flight
+
+Usage:
+
+statistics = InvocationStatsService(graph_execution_manager)
+with statistics.collect_stats(invocation, graph_execution_state.id):
+      ... execute graphs...
+statistics.log_stats()
+
+Typical output:
+[2023-08-02 18:03:04,507]::[InvokeAI]::INFO --> Graph stats: c7764585-9c68-4d9d-a199-55e8186790f3
+[2023-08-02 18:03:04,507]::[InvokeAI]::INFO --> Node                 Calls  Seconds  VRAM Used
+[2023-08-02 18:03:04,507]::[InvokeAI]::INFO --> main_model_loader        1   0.005s     0.01G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> clip_skip                1   0.004s     0.01G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> compel                   2   0.512s     0.26G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> rand_int                 1   0.001s     0.01G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> range_of_size            1   0.001s     0.01G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> iterate                  1   0.001s     0.01G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> metadata_accumulator     1   0.002s     0.01G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> noise                    1   0.002s     0.01G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> t2l                      1   3.541s     1.93G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> l2i                      1   0.679s     0.58G
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> TOTAL GRAPH EXECUTION TIME:  4.749s
+[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> Current VRAM utilization 0.01G
+
+The abstract base class for this class is InvocationStatsServiceBase. An implementing class which
+writes to the system log is stored in InvocationServices.performance_statistics.
+"""
+
+from abc import ABC, abstractmethod
+from contextlib import AbstractContextManager
+from typing import Dict
+
+from invokeai.app.invocations.baseinvocation import BaseInvocation
+from invokeai.backend.model_management.model_cache import CacheStats
+
+from .invocation_stats_common import NodeLog
+
+
+class InvocationStatsServiceBase(ABC):
+    "Abstract base class for recording node memory/time performance statistics"
+
+    # {graph_id => NodeLog}
+    _stats: Dict[str, NodeLog]
+    _cache_stats: Dict[str, CacheStats]
+    ram_used: float
+    ram_changed: float
+
+    @abstractmethod
+    def __init__(self):
+        """
+        Initialize the InvocationStatsService and reset counters to zero
+        """
+        pass
+
+    @abstractmethod
+    def collect_stats(
+        self,
+        invocation: BaseInvocation,
+        graph_execution_state_id: str,
+    ) -> AbstractContextManager:
+        """
+        Return a context object that will capture the statistics on the execution
+        of invocaation. Use with: to place around the part of the code that executes the invocation.
+        :param invocation: BaseInvocation object from the current graph.
+        :param graph_execution_state_id: The id of the current session.
+        """
+        pass
+
+    @abstractmethod
+    def reset_stats(self, graph_execution_state_id: str):
+        """
+        Reset all statistics for the indicated graph
+        :param graph_execution_state_id
+        """
+        pass
+
+    @abstractmethod
+    def reset_all_stats(self):
+        """Zero all statistics"""
+        pass
+
+    @abstractmethod
+    def update_invocation_stats(
+        self,
+        graph_id: str,
+        invocation_type: str,
+        time_used: float,
+        vram_used: float,
+    ):
+        """
+        Add timing information on execution of a node. Usually
+        used internally.
+        :param graph_id: ID of the graph that is currently executing
+        :param invocation_type: String literal type of the node
+        :param time_used: Time used by node's exection (sec)
+        :param vram_used: Maximum VRAM used during exection (GB)
+        """
+        pass
+
+    @abstractmethod
+    def log_stats(self):
+        """
+        Write out the accumulated statistics to the log or somewhere else.
+        """
+        pass
+
+    @abstractmethod
+    def update_mem_stats(
+        self,
+        ram_used: float,
+        ram_changed: float,
+    ):
+        """
+        Update the collector with RAM memory usage info.
+
+        :param ram_used: How much RAM is currently in use.
+        :param ram_changed: How much RAM changed since last generation.
+        """
+        pass
diff --git a/invokeai/app/services/invocation_stats/invocation_stats_common.py b/invokeai/app/services/invocation_stats/invocation_stats_common.py
new file mode 100644
index 0000000000..19b954f6da
--- /dev/null
+++ b/invokeai/app/services/invocation_stats/invocation_stats_common.py
@@ -0,0 +1,25 @@
+from dataclasses import dataclass, field
+from typing import Dict
+
+# size of GIG in bytes
+GIG = 1073741824
+
+
+@dataclass
+class NodeStats:
+    """Class for tracking execution stats of an invocation node"""
+
+    calls: int = 0
+    time_used: float = 0.0  # seconds
+    max_vram: float = 0.0  # GB
+    cache_hits: int = 0
+    cache_misses: int = 0
+    cache_high_watermark: int = 0
+
+
+@dataclass
+class NodeLog:
+    """Class for tracking node usage"""
+
+    # {node_type => NodeStats}
+    nodes: Dict[str, NodeStats] = field(default_factory=dict)
diff --git a/invokeai/app/services/invocation_stats.py b/invokeai/app/services/invocation_stats/invocation_stats_default.py
similarity index 50%
rename from invokeai/app/services/invocation_stats.py
rename to invokeai/app/services/invocation_stats/invocation_stats_default.py
index 33932f73aa..be019b6820 100644
--- a/invokeai/app/services/invocation_stats.py
+++ b/invokeai/app/services/invocation_stats/invocation_stats_default.py
@@ -1,171 +1,35 @@
-# Copyright 2023 Lincoln D. Stein <lincoln.stein@gmail.com>
-"""Utility to collect execution time and GPU usage stats on invocations in flight
-
-Usage:
-
-statistics = InvocationStatsService(graph_execution_manager)
-with statistics.collect_stats(invocation, graph_execution_state.id):
-      ... execute graphs...
-statistics.log_stats()
-
-Typical output:
-[2023-08-02 18:03:04,507]::[InvokeAI]::INFO --> Graph stats: c7764585-9c68-4d9d-a199-55e8186790f3
-[2023-08-02 18:03:04,507]::[InvokeAI]::INFO --> Node                 Calls  Seconds  VRAM Used
-[2023-08-02 18:03:04,507]::[InvokeAI]::INFO --> main_model_loader        1   0.005s     0.01G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> clip_skip                1   0.004s     0.01G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> compel                   2   0.512s     0.26G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> rand_int                 1   0.001s     0.01G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> range_of_size            1   0.001s     0.01G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> iterate                  1   0.001s     0.01G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> metadata_accumulator     1   0.002s     0.01G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> noise                    1   0.002s     0.01G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> t2l                      1   3.541s     1.93G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> l2i                      1   0.679s     0.58G
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> TOTAL GRAPH EXECUTION TIME:  4.749s
-[2023-08-02 18:03:04,508]::[InvokeAI]::INFO --> Current VRAM utilization 0.01G
-
-The abstract base class for this class is InvocationStatsServiceBase. An implementing class which
-writes to the system log is stored in InvocationServices.performance_statistics.
-"""
-
 import time
-from abc import ABC, abstractmethod
-from contextlib import AbstractContextManager
-from dataclasses import dataclass, field
 from typing import Dict
 
 import psutil
 import torch
 
 import invokeai.backend.util.logging as logger
+from invokeai.app.invocations.baseinvocation import BaseInvocation
+from invokeai.app.services.invoker import Invoker
+from invokeai.app.services.model_manager.model_manager_base import ModelManagerServiceBase
 from invokeai.backend.model_management.model_cache import CacheStats
 
-from ..invocations.baseinvocation import BaseInvocation
-from .graph import GraphExecutionState
-from .item_storage import ItemStorageABC
-from .model_manager_service import ModelManagerService
-
-# size of GIG in bytes
-GIG = 1073741824
-
-
-@dataclass
-class NodeStats:
-    """Class for tracking execution stats of an invocation node"""
-
-    calls: int = 0
-    time_used: float = 0.0  # seconds
-    max_vram: float = 0.0  # GB
-    cache_hits: int = 0
-    cache_misses: int = 0
-    cache_high_watermark: int = 0
-
-
-@dataclass
-class NodeLog:
-    """Class for tracking node usage"""
-
-    # {node_type => NodeStats}
-    nodes: Dict[str, NodeStats] = field(default_factory=dict)
-
-
-class InvocationStatsServiceBase(ABC):
-    "Abstract base class for recording node memory/time performance statistics"
-
-    graph_execution_manager: ItemStorageABC["GraphExecutionState"]
-    # {graph_id => NodeLog}
-    _stats: Dict[str, NodeLog]
-    _cache_stats: Dict[str, CacheStats]
-    ram_used: float
-    ram_changed: float
-
-    @abstractmethod
-    def __init__(self, graph_execution_manager: ItemStorageABC["GraphExecutionState"]):
-        """
-        Initialize the InvocationStatsService and reset counters to zero
-        :param graph_execution_manager: Graph execution manager for this session
-        """
-        pass
-
-    @abstractmethod
-    def collect_stats(
-        self,
-        invocation: BaseInvocation,
-        graph_execution_state_id: str,
-    ) -> AbstractContextManager:
-        """
-        Return a context object that will capture the statistics on the execution
-        of invocaation. Use with: to place around the part of the code that executes the invocation.
-        :param invocation: BaseInvocation object from the current graph.
-        :param graph_execution_state: GraphExecutionState object from the current session.
-        """
-        pass
-
-    @abstractmethod
-    def reset_stats(self, graph_execution_state_id: str):
-        """
-        Reset all statistics for the indicated graph
-        :param graph_execution_state_id
-        """
-        pass
-
-    @abstractmethod
-    def reset_all_stats(self):
-        """Zero all statistics"""
-        pass
-
-    @abstractmethod
-    def update_invocation_stats(
-        self,
-        graph_id: str,
-        invocation_type: str,
-        time_used: float,
-        vram_used: float,
-    ):
-        """
-        Add timing information on execution of a node. Usually
-        used internally.
-        :param graph_id: ID of the graph that is currently executing
-        :param invocation_type: String literal type of the node
-        :param time_used: Time used by node's exection (sec)
-        :param vram_used: Maximum VRAM used during exection (GB)
-        """
-        pass
-
-    @abstractmethod
-    def log_stats(self):
-        """
-        Write out the accumulated statistics to the log or somewhere else.
-        """
-        pass
-
-    @abstractmethod
-    def update_mem_stats(
-        self,
-        ram_used: float,
-        ram_changed: float,
-    ):
-        """
-        Update the collector with RAM memory usage info.
-
-        :param ram_used: How much RAM is currently in use.
-        :param ram_changed: How much RAM changed since last generation.
-        """
-        pass
+from .invocation_stats_base import InvocationStatsServiceBase
+from .invocation_stats_common import GIG, NodeLog, NodeStats
 
 
 class InvocationStatsService(InvocationStatsServiceBase):
     """Accumulate performance information about a running graph. Collects time spent in each node,
     as well as the maximum and current VRAM utilisation for CUDA systems"""
 
-    def __init__(self, graph_execution_manager: ItemStorageABC["GraphExecutionState"]):
-        self.graph_execution_manager = graph_execution_manager
+    _invoker: Invoker
+
+    def __init__(self):
         # {graph_id => NodeLog}
         self._stats: Dict[str, NodeLog] = {}
         self._cache_stats: Dict[str, CacheStats] = {}
         self.ram_used: float = 0.0
         self.ram_changed: float = 0.0
 
+    def start(self, invoker: Invoker) -> None:
+        self._invoker = invoker
+
     class StatsContext:
         """Context manager for collecting statistics."""
 
@@ -174,13 +38,13 @@ class InvocationStatsService(InvocationStatsServiceBase):
         graph_id: str
         start_time: float
         ram_used: int
-        model_manager: ModelManagerService
+        model_manager: ModelManagerServiceBase
 
         def __init__(
             self,
             invocation: BaseInvocation,
             graph_id: str,
-            model_manager: ModelManagerService,
+            model_manager: ModelManagerServiceBase,
             collector: "InvocationStatsServiceBase",
         ):
             """Initialize statistics for this run."""
@@ -208,7 +72,7 @@ class InvocationStatsService(InvocationStatsServiceBase):
             )
             self.collector.update_invocation_stats(
                 graph_id=self.graph_id,
-                invocation_type=self.invocation.type,  # type: ignore - `type` is not on the `BaseInvocation` model, but *is* on all invocations
+                invocation_type=self.invocation.type,  # type: ignore # `type` is not on the `BaseInvocation` model, but *is* on all invocations
                 time_used=time.time() - self.start_time,
                 vram_used=torch.cuda.max_memory_allocated() / GIG if torch.cuda.is_available() else 0.0,
             )
@@ -217,12 +81,11 @@ class InvocationStatsService(InvocationStatsServiceBase):
         self,
         invocation: BaseInvocation,
         graph_execution_state_id: str,
-        model_manager: ModelManagerService,
     ) -> StatsContext:
         if not self._stats.get(graph_execution_state_id):  # first time we're seeing this
             self._stats[graph_execution_state_id] = NodeLog()
             self._cache_stats[graph_execution_state_id] = CacheStats()
-        return self.StatsContext(invocation, graph_execution_state_id, model_manager, self)
+        return self.StatsContext(invocation, graph_execution_state_id, self._invoker.services.model_manager, self)
 
     def reset_all_stats(self):
         """Zero all statistics"""
@@ -261,7 +124,7 @@ class InvocationStatsService(InvocationStatsServiceBase):
         errored = set()
         for graph_id, node_log in self._stats.items():
             try:
-                current_graph_state = self.graph_execution_manager.get(graph_id)
+                current_graph_state = self._invoker.services.graph_execution_manager.get(graph_id)
             except Exception:
                 errored.add(graph_id)
                 continue
diff --git a/invokeai/app/services/invoker.py b/invokeai/app/services/invoker.py
index 0c98fc285c..134bec2693 100644
--- a/invokeai/app/services/invoker.py
+++ b/invokeai/app/services/invoker.py
@@ -1,11 +1,10 @@
 # Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
 
-from abc import ABC
 from typing import Optional
 
-from .graph import Graph, GraphExecutionState
-from .invocation_queue import InvocationQueueItem
+from .invocation_queue.invocation_queue_common import InvocationQueueItem
 from .invocation_services import InvocationServices
+from .shared.graph import Graph, GraphExecutionState
 
 
 class Invoker:
@@ -84,7 +83,3 @@ class Invoker:
             self.__stop_service(getattr(self.services, service))
 
         self.services.queue.put(None)
-
-
-class InvocationProcessorABC(ABC):
-    pass
diff --git a/invokeai/app/services/item_storage/__init__.py b/invokeai/app/services/item_storage/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/item_storage.py b/invokeai/app/services/item_storage/item_storage_base.py
similarity index 78%
rename from invokeai/app/services/item_storage.py
rename to invokeai/app/services/item_storage/item_storage_base.py
index 5fe4eb7456..1446c0cd08 100644
--- a/invokeai/app/services/item_storage.py
+++ b/invokeai/app/services/item_storage/item_storage_base.py
@@ -1,25 +1,16 @@
 from abc import ABC, abstractmethod
 from typing import Callable, Generic, Optional, TypeVar
 
-from pydantic import BaseModel, Field
-from pydantic.generics import GenericModel
+from pydantic import BaseModel
+
+from invokeai.app.services.shared.pagination import PaginatedResults
 
 T = TypeVar("T", bound=BaseModel)
 
 
-class PaginatedResults(GenericModel, Generic[T]):
-    """Paginated results"""
-
-    # fmt: off
-    items: list[T] = Field(description="Items")
-    page: int = Field(description="Current Page")
-    pages: int = Field(description="Total number of pages")
-    per_page: int = Field(description="Number of items per page")
-    total: int = Field(description="Total number of items in result")
-    # fmt: on
-
-
 class ItemStorageABC(ABC, Generic[T]):
+    """Provides storage for a single type of item. The type must be a Pydantic model."""
+
     _on_changed_callbacks: list[Callable[[T], None]]
     _on_deleted_callbacks: list[Callable[[str], None]]
 
diff --git a/invokeai/app/services/sqlite.py b/invokeai/app/services/item_storage/item_storage_sqlite.py
similarity index 79%
rename from invokeai/app/services/sqlite.py
rename to invokeai/app/services/item_storage/item_storage_sqlite.py
index 63f3356b3c..1bb9429130 100644
--- a/invokeai/app/services/sqlite.py
+++ b/invokeai/app/services/item_storage/item_storage_sqlite.py
@@ -2,30 +2,33 @@ import sqlite3
 import threading
 from typing import Generic, Optional, TypeVar, get_args
 
-from pydantic import BaseModel, parse_raw_as
+from pydantic import BaseModel, TypeAdapter
 
-from .item_storage import ItemStorageABC, PaginatedResults
+from invokeai.app.services.shared.pagination import PaginatedResults
+from invokeai.app.services.shared.sqlite import SqliteDatabase
+
+from .item_storage_base import ItemStorageABC
 
 T = TypeVar("T", bound=BaseModel)
 
-sqlite_memory = ":memory:"
-
 
 class SqliteItemStorage(ItemStorageABC, Generic[T]):
     _table_name: str
     _conn: sqlite3.Connection
     _cursor: sqlite3.Cursor
     _id_field: str
-    _lock: threading.Lock
+    _lock: threading.RLock
+    _adapter: Optional[TypeAdapter[T]]
 
-    def __init__(self, conn: sqlite3.Connection, table_name: str, lock: threading.Lock, id_field: str = "id"):
+    def __init__(self, db: SqliteDatabase, table_name: str, id_field: str = "id"):
         super().__init__()
 
+        self._lock = db.lock
+        self._conn = db.conn
         self._table_name = table_name
         self._id_field = id_field  # TODO: validate that T has this field
-        self._lock = lock
-        self._conn = conn
         self._cursor = self._conn.cursor()
+        self._adapter: Optional[TypeAdapter[T]] = None
 
         self._create_table()
 
@@ -44,15 +47,21 @@ class SqliteItemStorage(ItemStorageABC, Generic[T]):
             self._lock.release()
 
     def _parse_item(self, item: str) -> T:
-        item_type = get_args(self.__orig_class__)[0]
-        return parse_raw_as(item_type, item)
+        if self._adapter is None:
+            """
+            We don't get access to `__orig_class__` in `__init__()`, and we need this before start(), so
+            we can create it when it is first needed instead.
+            __orig_class__ is technically an implementation detail of the typing module, not a supported API
+            """
+            self._adapter = TypeAdapter(get_args(self.__orig_class__)[0])  # type: ignore [attr-defined]
+        return self._adapter.validate_json(item)
 
     def set(self, item: T):
         try:
             self._lock.acquire()
             self._cursor.execute(
                 f"""INSERT OR REPLACE INTO {self._table_name} (item) VALUES (?);""",
-                (item.json(),),
+                (item.model_dump_json(warnings=False, exclude_none=True),),
             )
             self._conn.commit()
         finally:
diff --git a/invokeai/app/services/latent_storage.py b/invokeai/app/services/latent_storage.py
deleted file mode 100644
index 8605ef5abd..0000000000
--- a/invokeai/app/services/latent_storage.py
+++ /dev/null
@@ -1,119 +0,0 @@
-# Copyright (c) 2023 Kyle Schouviller (https://github.com/kyle0654)
-
-from abc import ABC, abstractmethod
-from pathlib import Path
-from queue import Queue
-from typing import Callable, Dict, Optional, Union
-
-import torch
-
-
-class LatentsStorageBase(ABC):
-    """Responsible for storing and retrieving latents."""
-
-    _on_changed_callbacks: list[Callable[[torch.Tensor], None]]
-    _on_deleted_callbacks: list[Callable[[str], None]]
-
-    def __init__(self) -> None:
-        self._on_changed_callbacks = list()
-        self._on_deleted_callbacks = list()
-
-    @abstractmethod
-    def get(self, name: str) -> torch.Tensor:
-        pass
-
-    @abstractmethod
-    def save(self, name: str, data: torch.Tensor) -> None:
-        pass
-
-    @abstractmethod
-    def delete(self, name: str) -> None:
-        pass
-
-    def on_changed(self, on_changed: Callable[[torch.Tensor], None]) -> None:
-        """Register a callback for when an item is changed"""
-        self._on_changed_callbacks.append(on_changed)
-
-    def on_deleted(self, on_deleted: Callable[[str], None]) -> None:
-        """Register a callback for when an item is deleted"""
-        self._on_deleted_callbacks.append(on_deleted)
-
-    def _on_changed(self, item: torch.Tensor) -> None:
-        for callback in self._on_changed_callbacks:
-            callback(item)
-
-    def _on_deleted(self, item_id: str) -> None:
-        for callback in self._on_deleted_callbacks:
-            callback(item_id)
-
-
-class ForwardCacheLatentsStorage(LatentsStorageBase):
-    """Caches the latest N latents in memory, writing-thorugh to and reading from underlying storage"""
-
-    __cache: Dict[str, torch.Tensor]
-    __cache_ids: Queue
-    __max_cache_size: int
-    __underlying_storage: LatentsStorageBase
-
-    def __init__(self, underlying_storage: LatentsStorageBase, max_cache_size: int = 20):
-        super().__init__()
-        self.__underlying_storage = underlying_storage
-        self.__cache = dict()
-        self.__cache_ids = Queue()
-        self.__max_cache_size = max_cache_size
-
-    def get(self, name: str) -> torch.Tensor:
-        cache_item = self.__get_cache(name)
-        if cache_item is not None:
-            return cache_item
-
-        latent = self.__underlying_storage.get(name)
-        self.__set_cache(name, latent)
-        return latent
-
-    def save(self, name: str, data: torch.Tensor) -> None:
-        self.__underlying_storage.save(name, data)
-        self.__set_cache(name, data)
-        self._on_changed(data)
-
-    def delete(self, name: str) -> None:
-        self.__underlying_storage.delete(name)
-        if name in self.__cache:
-            del self.__cache[name]
-        self._on_deleted(name)
-
-    def __get_cache(self, name: str) -> Optional[torch.Tensor]:
-        return None if name not in self.__cache else self.__cache[name]
-
-    def __set_cache(self, name: str, data: torch.Tensor):
-        if name not in self.__cache:
-            self.__cache[name] = data
-            self.__cache_ids.put(name)
-            if self.__cache_ids.qsize() > self.__max_cache_size:
-                self.__cache.pop(self.__cache_ids.get())
-
-
-class DiskLatentsStorage(LatentsStorageBase):
-    """Stores latents in a folder on disk without caching"""
-
-    __output_folder: Union[str, Path]
-
-    def __init__(self, output_folder: Union[str, Path]):
-        self.__output_folder = output_folder if isinstance(output_folder, Path) else Path(output_folder)
-        self.__output_folder.mkdir(parents=True, exist_ok=True)
-
-    def get(self, name: str) -> torch.Tensor:
-        latent_path = self.get_path(name)
-        return torch.load(latent_path)
-
-    def save(self, name: str, data: torch.Tensor) -> None:
-        self.__output_folder.mkdir(parents=True, exist_ok=True)
-        latent_path = self.get_path(name)
-        torch.save(data, latent_path)
-
-    def delete(self, name: str) -> None:
-        latent_path = self.get_path(name)
-        latent_path.unlink()
-
-    def get_path(self, name: str) -> Path:
-        return self.__output_folder / name
diff --git a/invokeai/app/services/latents_storage/__init__.py b/invokeai/app/services/latents_storage/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/latents_storage/latents_storage_base.py b/invokeai/app/services/latents_storage/latents_storage_base.py
new file mode 100644
index 0000000000..4850a477d3
--- /dev/null
+++ b/invokeai/app/services/latents_storage/latents_storage_base.py
@@ -0,0 +1,45 @@
+# Copyright (c) 2023 Kyle Schouviller (https://github.com/kyle0654)
+
+from abc import ABC, abstractmethod
+from typing import Callable
+
+import torch
+
+
+class LatentsStorageBase(ABC):
+    """Responsible for storing and retrieving latents."""
+
+    _on_changed_callbacks: list[Callable[[torch.Tensor], None]]
+    _on_deleted_callbacks: list[Callable[[str], None]]
+
+    def __init__(self) -> None:
+        self._on_changed_callbacks = list()
+        self._on_deleted_callbacks = list()
+
+    @abstractmethod
+    def get(self, name: str) -> torch.Tensor:
+        pass
+
+    @abstractmethod
+    def save(self, name: str, data: torch.Tensor) -> None:
+        pass
+
+    @abstractmethod
+    def delete(self, name: str) -> None:
+        pass
+
+    def on_changed(self, on_changed: Callable[[torch.Tensor], None]) -> None:
+        """Register a callback for when an item is changed"""
+        self._on_changed_callbacks.append(on_changed)
+
+    def on_deleted(self, on_deleted: Callable[[str], None]) -> None:
+        """Register a callback for when an item is deleted"""
+        self._on_deleted_callbacks.append(on_deleted)
+
+    def _on_changed(self, item: torch.Tensor) -> None:
+        for callback in self._on_changed_callbacks:
+            callback(item)
+
+    def _on_deleted(self, item_id: str) -> None:
+        for callback in self._on_deleted_callbacks:
+            callback(item_id)
diff --git a/invokeai/app/services/latents_storage/latents_storage_disk.py b/invokeai/app/services/latents_storage/latents_storage_disk.py
new file mode 100644
index 0000000000..6e7010bae0
--- /dev/null
+++ b/invokeai/app/services/latents_storage/latents_storage_disk.py
@@ -0,0 +1,34 @@
+# Copyright (c) 2023 Kyle Schouviller (https://github.com/kyle0654)
+
+from pathlib import Path
+from typing import Union
+
+import torch
+
+from .latents_storage_base import LatentsStorageBase
+
+
+class DiskLatentsStorage(LatentsStorageBase):
+    """Stores latents in a folder on disk without caching"""
+
+    __output_folder: Path
+
+    def __init__(self, output_folder: Union[str, Path]):
+        self.__output_folder = output_folder if isinstance(output_folder, Path) else Path(output_folder)
+        self.__output_folder.mkdir(parents=True, exist_ok=True)
+
+    def get(self, name: str) -> torch.Tensor:
+        latent_path = self.get_path(name)
+        return torch.load(latent_path)
+
+    def save(self, name: str, data: torch.Tensor) -> None:
+        self.__output_folder.mkdir(parents=True, exist_ok=True)
+        latent_path = self.get_path(name)
+        torch.save(data, latent_path)
+
+    def delete(self, name: str) -> None:
+        latent_path = self.get_path(name)
+        latent_path.unlink()
+
+    def get_path(self, name: str) -> Path:
+        return self.__output_folder / name
diff --git a/invokeai/app/services/latents_storage/latents_storage_forward_cache.py b/invokeai/app/services/latents_storage/latents_storage_forward_cache.py
new file mode 100644
index 0000000000..5248362ff5
--- /dev/null
+++ b/invokeai/app/services/latents_storage/latents_storage_forward_cache.py
@@ -0,0 +1,54 @@
+# Copyright (c) 2023 Kyle Schouviller (https://github.com/kyle0654)
+
+from queue import Queue
+from typing import Dict, Optional
+
+import torch
+
+from .latents_storage_base import LatentsStorageBase
+
+
+class ForwardCacheLatentsStorage(LatentsStorageBase):
+    """Caches the latest N latents in memory, writing-thorugh to and reading from underlying storage"""
+
+    __cache: Dict[str, torch.Tensor]
+    __cache_ids: Queue
+    __max_cache_size: int
+    __underlying_storage: LatentsStorageBase
+
+    def __init__(self, underlying_storage: LatentsStorageBase, max_cache_size: int = 20):
+        super().__init__()
+        self.__underlying_storage = underlying_storage
+        self.__cache = dict()
+        self.__cache_ids = Queue()
+        self.__max_cache_size = max_cache_size
+
+    def get(self, name: str) -> torch.Tensor:
+        cache_item = self.__get_cache(name)
+        if cache_item is not None:
+            return cache_item
+
+        latent = self.__underlying_storage.get(name)
+        self.__set_cache(name, latent)
+        return latent
+
+    def save(self, name: str, data: torch.Tensor) -> None:
+        self.__underlying_storage.save(name, data)
+        self.__set_cache(name, data)
+        self._on_changed(data)
+
+    def delete(self, name: str) -> None:
+        self.__underlying_storage.delete(name)
+        if name in self.__cache:
+            del self.__cache[name]
+        self._on_deleted(name)
+
+    def __get_cache(self, name: str) -> Optional[torch.Tensor]:
+        return None if name not in self.__cache else self.__cache[name]
+
+    def __set_cache(self, name: str, data: torch.Tensor):
+        if name not in self.__cache:
+            self.__cache[name] = data
+            self.__cache_ids.put(name)
+            if self.__cache_ids.qsize() > self.__max_cache_size:
+                self.__cache.pop(self.__cache_ids.get())
diff --git a/invokeai/app/services/model_manager/__init__.py b/invokeai/app/services/model_manager/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/model_manager/model_manager_base.py b/invokeai/app/services/model_manager/model_manager_base.py
new file mode 100644
index 0000000000..4c2fc4c085
--- /dev/null
+++ b/invokeai/app/services/model_manager/model_manager_base.py
@@ -0,0 +1,286 @@
+# Copyright (c) 2023 Lincoln D. Stein and the InvokeAI Team
+
+from __future__ import annotations
+
+from abc import ABC, abstractmethod
+from logging import Logger
+from pathlib import Path
+from typing import TYPE_CHECKING, Callable, List, Literal, Optional, Tuple, Union
+
+from pydantic import Field
+
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.backend.model_management import (
+    AddModelResult,
+    BaseModelType,
+    MergeInterpolationMethod,
+    ModelInfo,
+    ModelType,
+    SchedulerPredictionType,
+    SubModelType,
+)
+from invokeai.backend.model_management.model_cache import CacheStats
+
+if TYPE_CHECKING:
+    from invokeai.app.invocations.baseinvocation import BaseInvocation, InvocationContext
+
+
+class ModelManagerServiceBase(ABC):
+    """Responsible for managing models on disk and in memory"""
+
+    @abstractmethod
+    def __init__(
+        self,
+        config: InvokeAIAppConfig,
+        logger: Logger,
+    ):
+        """
+        Initialize with the path to the models.yaml config file.
+        Optional parameters are the torch device type, precision, max_models,
+        and sequential_offload boolean. Note that the default device
+        type and precision are set up for a CUDA system running at half precision.
+        """
+        pass
+
+    @abstractmethod
+    def get_model(
+        self,
+        model_name: str,
+        base_model: BaseModelType,
+        model_type: ModelType,
+        submodel: Optional[SubModelType] = None,
+        node: Optional[BaseInvocation] = None,
+        context: Optional[InvocationContext] = None,
+    ) -> ModelInfo:
+        """Retrieve the indicated model with name and type.
+        submodel can be used to get a part (such as the vae)
+        of a diffusers pipeline."""
+        pass
+
+    @property
+    @abstractmethod
+    def logger(self):
+        pass
+
+    @abstractmethod
+    def model_exists(
+        self,
+        model_name: str,
+        base_model: BaseModelType,
+        model_type: ModelType,
+    ) -> bool:
+        pass
+
+    @abstractmethod
+    def model_info(self, model_name: str, base_model: BaseModelType, model_type: ModelType) -> dict:
+        """
+        Given a model name returns a dict-like (OmegaConf) object describing it.
+        Uses the exact format as the omegaconf stanza.
+        """
+        pass
+
+    @abstractmethod
+    def list_models(self, base_model: Optional[BaseModelType] = None, model_type: Optional[ModelType] = None) -> dict:
+        """
+        Return a dict of models in the format:
+        { model_type1:
+          { model_name1: {'status': 'active'|'cached'|'not loaded',
+                         'model_name' : name,
+                         'model_type' : SDModelType,
+                         'description': description,
+                         'format': 'folder'|'safetensors'|'ckpt'
+                         },
+            model_name2: { etc }
+          },
+          model_type2:
+            { model_name_n: etc
+        }
+        """
+        pass
+
+    @abstractmethod
+    def list_model(self, model_name: str, base_model: BaseModelType, model_type: ModelType) -> dict:
+        """
+        Return information about the model using the same format as list_models()
+        """
+        pass
+
+    @abstractmethod
+    def model_names(self) -> List[Tuple[str, BaseModelType, ModelType]]:
+        """
+        Returns a list of all the model names known.
+        """
+        pass
+
+    @abstractmethod
+    def add_model(
+        self,
+        model_name: str,
+        base_model: BaseModelType,
+        model_type: ModelType,
+        model_attributes: dict,
+        clobber: bool = False,
+    ) -> AddModelResult:
+        """
+        Update the named model with a dictionary of attributes. Will fail with an
+        assertion error if the name already exists. Pass clobber=True to overwrite.
+        On a successful update, the config will be changed in memory. Will fail
+        with an assertion error if provided attributes are incorrect or
+        the model name is missing. Call commit() to write changes to disk.
+        """
+        pass
+
+    @abstractmethod
+    def update_model(
+        self,
+        model_name: str,
+        base_model: BaseModelType,
+        model_type: ModelType,
+        model_attributes: dict,
+    ) -> AddModelResult:
+        """
+        Update the named model with a dictionary of attributes. Will fail with a
+        ModelNotFoundException if the name does not already exist.
+
+        On a successful update, the config will be changed in memory. Will fail
+        with an assertion error if provided attributes are incorrect or
+        the model name is missing. Call commit() to write changes to disk.
+        """
+        pass
+
+    @abstractmethod
+    def del_model(
+        self,
+        model_name: str,
+        base_model: BaseModelType,
+        model_type: ModelType,
+    ):
+        """
+        Delete the named model from configuration. If delete_files is true,
+        then the underlying weight file or diffusers directory will be deleted
+        as well. Call commit() to write to disk.
+        """
+        pass
+
+    @abstractmethod
+    def rename_model(
+        self,
+        model_name: str,
+        base_model: BaseModelType,
+        model_type: ModelType,
+        new_name: str,
+    ):
+        """
+        Rename the indicated model.
+        """
+        pass
+
+    @abstractmethod
+    def list_checkpoint_configs(self) -> List[Path]:
+        """
+        List the checkpoint config paths from ROOT/configs/stable-diffusion.
+        """
+        pass
+
+    @abstractmethod
+    def convert_model(
+        self,
+        model_name: str,
+        base_model: BaseModelType,
+        model_type: Literal[ModelType.Main, ModelType.Vae],
+    ) -> AddModelResult:
+        """
+        Convert a checkpoint file into a diffusers folder, deleting the cached
+        version and deleting the original checkpoint file if it is in the models
+        directory.
+        :param model_name: Name of the model to convert
+        :param base_model: Base model type
+        :param model_type: Type of model ['vae' or 'main']
+
+        This will raise a ValueError unless the model is not a checkpoint. It will
+        also raise a ValueError in the event that there is a similarly-named diffusers
+        directory already in place.
+        """
+        pass
+
+    @abstractmethod
+    def heuristic_import(
+        self,
+        items_to_import: set[str],
+        prediction_type_helper: Optional[Callable[[Path], SchedulerPredictionType]] = None,
+    ) -> dict[str, AddModelResult]:
+        """Import a list of paths, repo_ids or URLs. Returns the set of
+        successfully imported items.
+        :param items_to_import: Set of strings corresponding to models to be imported.
+        :param prediction_type_helper: A callback that receives the Path of a Stable Diffusion 2 checkpoint model and returns a SchedulerPredictionType.
+
+        The prediction type helper is necessary to distinguish between
+        models based on Stable Diffusion 2 Base (requiring
+        SchedulerPredictionType.Epsilson) and Stable Diffusion 768
+        (requiring SchedulerPredictionType.VPrediction). It is
+        generally impossible to do this programmatically, so the
+        prediction_type_helper usually asks the user to choose.
+
+        The result is a set of successfully installed models. Each element
+        of the set is a dict corresponding to the newly-created OmegaConf stanza for
+        that model.
+        """
+        pass
+
+    @abstractmethod
+    def merge_models(
+        self,
+        model_names: List[str] = Field(
+            default=None, min_length=2, max_length=3, description="List of model names to merge"
+        ),
+        base_model: Union[BaseModelType, str] = Field(
+            default=None, description="Base model shared by all models to be merged"
+        ),
+        merged_model_name: str = Field(default=None, description="Name of destination model after merging"),
+        alpha: Optional[float] = 0.5,
+        interp: Optional[MergeInterpolationMethod] = None,
+        force: Optional[bool] = False,
+        merge_dest_directory: Optional[Path] = None,
+    ) -> AddModelResult:
+        """
+        Merge two to three diffusrs pipeline models and save as a new model.
+        :param model_names: List of 2-3 models to merge
+        :param base_model: Base model to use for all models
+        :param merged_model_name: Name of destination merged model
+        :param alpha: Alpha strength to apply to 2d and 3d model
+        :param interp: Interpolation method. None (default)
+        :param merge_dest_directory: Save the merged model to the designated directory (with 'merged_model_name' appended)
+        """
+        pass
+
+    @abstractmethod
+    def search_for_models(self, directory: Path) -> List[Path]:
+        """
+        Return list of all models found in the designated directory.
+        """
+        pass
+
+    @abstractmethod
+    def sync_to_config(self):
+        """
+        Re-read models.yaml, rescan the models directory, and reimport models
+        in the autoimport directories. Call after making changes outside the
+        model manager API.
+        """
+        pass
+
+    @abstractmethod
+    def collect_cache_stats(self, cache_stats: CacheStats):
+        """
+        Reset model cache statistics for graph with graph_id.
+        """
+        pass
+
+    @abstractmethod
+    def commit(self, conf_file: Optional[Path] = None) -> None:
+        """
+        Write current configuration out to the indicated file.
+        If no conf_file is provided, then replaces the
+        original file/database used to initialize the object.
+        """
+        pass
diff --git a/invokeai/app/services/model_manager_service.py b/invokeai/app/services/model_manager/model_manager_default.py
similarity index 61%
rename from invokeai/app/services/model_manager_service.py
rename to invokeai/app/services/model_manager/model_manager_default.py
index 143fa8f357..cdb3e59a91 100644
--- a/invokeai/app/services/model_manager_service.py
+++ b/invokeai/app/services/model_manager/model_manager_default.py
@@ -2,16 +2,15 @@
 
 from __future__ import annotations
 
-from abc import ABC, abstractmethod
 from logging import Logger
 from pathlib import Path
-from types import ModuleType
 from typing import TYPE_CHECKING, Callable, List, Literal, Optional, Tuple, Union
 
 import torch
 from pydantic import Field
 
-from invokeai.app.models.exceptions import CanceledException
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.app.services.invocation_processor.invocation_processor_common import CanceledException
 from invokeai.backend.model_management import (
     AddModelResult,
     BaseModelType,
@@ -26,273 +25,12 @@ from invokeai.backend.model_management import (
 )
 from invokeai.backend.model_management.model_cache import CacheStats
 from invokeai.backend.model_management.model_search import FindModels
+from invokeai.backend.util import choose_precision, choose_torch_device
 
-from ...backend.util import choose_precision, choose_torch_device
-from .config import InvokeAIAppConfig
+from .model_manager_base import ModelManagerServiceBase
 
 if TYPE_CHECKING:
-    from ..invocations.baseinvocation import BaseInvocation, InvocationContext
-
-
-class ModelManagerServiceBase(ABC):
-    """Responsible for managing models on disk and in memory"""
-
-    @abstractmethod
-    def __init__(
-        self,
-        config: InvokeAIAppConfig,
-        logger: ModuleType,
-    ):
-        """
-        Initialize with the path to the models.yaml config file.
-        Optional parameters are the torch device type, precision, max_models,
-        and sequential_offload boolean. Note that the default device
-        type and precision are set up for a CUDA system running at half precision.
-        """
-        pass
-
-    @abstractmethod
-    def get_model(
-        self,
-        model_name: str,
-        base_model: BaseModelType,
-        model_type: ModelType,
-        submodel: Optional[SubModelType] = None,
-        node: Optional[BaseInvocation] = None,
-        context: Optional[InvocationContext] = None,
-    ) -> ModelInfo:
-        """Retrieve the indicated model with name and type.
-        submodel can be used to get a part (such as the vae)
-        of a diffusers pipeline."""
-        pass
-
-    @property
-    @abstractmethod
-    def logger(self):
-        pass
-
-    @abstractmethod
-    def model_exists(
-        self,
-        model_name: str,
-        base_model: BaseModelType,
-        model_type: ModelType,
-    ) -> bool:
-        pass
-
-    @abstractmethod
-    def model_info(self, model_name: str, base_model: BaseModelType, model_type: ModelType) -> dict:
-        """
-        Given a model name returns a dict-like (OmegaConf) object describing it.
-        Uses the exact format as the omegaconf stanza.
-        """
-        pass
-
-    @abstractmethod
-    def list_models(self, base_model: Optional[BaseModelType] = None, model_type: Optional[ModelType] = None) -> dict:
-        """
-        Return a dict of models in the format:
-        { model_type1:
-          { model_name1: {'status': 'active'|'cached'|'not loaded',
-                         'model_name' : name,
-                         'model_type' : SDModelType,
-                         'description': description,
-                         'format': 'folder'|'safetensors'|'ckpt'
-                         },
-            model_name2: { etc }
-          },
-          model_type2:
-            { model_name_n: etc
-        }
-        """
-        pass
-
-    @abstractmethod
-    def list_model(self, model_name: str, base_model: BaseModelType, model_type: ModelType) -> dict:
-        """
-        Return information about the model using the same format as list_models()
-        """
-        pass
-
-    @abstractmethod
-    def model_names(self) -> List[Tuple[str, BaseModelType, ModelType]]:
-        """
-        Returns a list of all the model names known.
-        """
-        pass
-
-    @abstractmethod
-    def add_model(
-        self,
-        model_name: str,
-        base_model: BaseModelType,
-        model_type: ModelType,
-        model_attributes: dict,
-        clobber: bool = False,
-    ) -> AddModelResult:
-        """
-        Update the named model with a dictionary of attributes. Will fail with an
-        assertion error if the name already exists. Pass clobber=True to overwrite.
-        On a successful update, the config will be changed in memory. Will fail
-        with an assertion error if provided attributes are incorrect or
-        the model name is missing. Call commit() to write changes to disk.
-        """
-        pass
-
-    @abstractmethod
-    def update_model(
-        self,
-        model_name: str,
-        base_model: BaseModelType,
-        model_type: ModelType,
-        model_attributes: dict,
-    ) -> AddModelResult:
-        """
-        Update the named model with a dictionary of attributes. Will fail with a
-        ModelNotFoundException if the name does not already exist.
-
-        On a successful update, the config will be changed in memory. Will fail
-        with an assertion error if provided attributes are incorrect or
-        the model name is missing. Call commit() to write changes to disk.
-        """
-        pass
-
-    @abstractmethod
-    def del_model(
-        self,
-        model_name: str,
-        base_model: BaseModelType,
-        model_type: ModelType,
-    ):
-        """
-        Delete the named model from configuration. If delete_files is true,
-        then the underlying weight file or diffusers directory will be deleted
-        as well. Call commit() to write to disk.
-        """
-        pass
-
-    @abstractmethod
-    def rename_model(
-        self,
-        model_name: str,
-        base_model: BaseModelType,
-        model_type: ModelType,
-        new_name: str,
-    ):
-        """
-        Rename the indicated model.
-        """
-        pass
-
-    @abstractmethod
-    def list_checkpoint_configs(self) -> List[Path]:
-        """
-        List the checkpoint config paths from ROOT/configs/stable-diffusion.
-        """
-        pass
-
-    @abstractmethod
-    def convert_model(
-        self,
-        model_name: str,
-        base_model: BaseModelType,
-        model_type: Literal[ModelType.Main, ModelType.Vae],
-    ) -> AddModelResult:
-        """
-        Convert a checkpoint file into a diffusers folder, deleting the cached
-        version and deleting the original checkpoint file if it is in the models
-        directory.
-        :param model_name: Name of the model to convert
-        :param base_model: Base model type
-        :param model_type: Type of model ['vae' or 'main']
-
-        This will raise a ValueError unless the model is not a checkpoint. It will
-        also raise a ValueError in the event that there is a similarly-named diffusers
-        directory already in place.
-        """
-        pass
-
-    @abstractmethod
-    def heuristic_import(
-        self,
-        items_to_import: set[str],
-        prediction_type_helper: Optional[Callable[[Path], SchedulerPredictionType]] = None,
-    ) -> dict[str, AddModelResult]:
-        """Import a list of paths, repo_ids or URLs. Returns the set of
-        successfully imported items.
-        :param items_to_import: Set of strings corresponding to models to be imported.
-        :param prediction_type_helper: A callback that receives the Path of a Stable Diffusion 2 checkpoint model and returns a SchedulerPredictionType.
-
-        The prediction type helper is necessary to distinguish between
-        models based on Stable Diffusion 2 Base (requiring
-        SchedulerPredictionType.Epsilson) and Stable Diffusion 768
-        (requiring SchedulerPredictionType.VPrediction). It is
-        generally impossible to do this programmatically, so the
-        prediction_type_helper usually asks the user to choose.
-
-        The result is a set of successfully installed models. Each element
-        of the set is a dict corresponding to the newly-created OmegaConf stanza for
-        that model.
-        """
-        pass
-
-    @abstractmethod
-    def merge_models(
-        self,
-        model_names: List[str] = Field(
-            default=None, min_items=2, max_items=3, description="List of model names to merge"
-        ),
-        base_model: Union[BaseModelType, str] = Field(
-            default=None, description="Base model shared by all models to be merged"
-        ),
-        merged_model_name: str = Field(default=None, description="Name of destination model after merging"),
-        alpha: Optional[float] = 0.5,
-        interp: Optional[MergeInterpolationMethod] = None,
-        force: Optional[bool] = False,
-        merge_dest_directory: Optional[Path] = None,
-    ) -> AddModelResult:
-        """
-        Merge two to three diffusrs pipeline models and save as a new model.
-        :param model_names: List of 2-3 models to merge
-        :param base_model: Base model to use for all models
-        :param merged_model_name: Name of destination merged model
-        :param alpha: Alpha strength to apply to 2d and 3d model
-        :param interp: Interpolation method. None (default)
-        :param merge_dest_directory: Save the merged model to the designated directory (with 'merged_model_name' appended)
-        """
-        pass
-
-    @abstractmethod
-    def search_for_models(self, directory: Path) -> List[Path]:
-        """
-        Return list of all models found in the designated directory.
-        """
-        pass
-
-    @abstractmethod
-    def sync_to_config(self):
-        """
-        Re-read models.yaml, rescan the models directory, and reimport models
-        in the autoimport directories. Call after making changes outside the
-        model manager API.
-        """
-        pass
-
-    @abstractmethod
-    def collect_cache_stats(self, cache_stats: CacheStats):
-        """
-        Reset model cache statistics for graph with graph_id.
-        """
-        pass
-
-    @abstractmethod
-    def commit(self, conf_file: Optional[Path] = None) -> None:
-        """
-        Write current configuration out to the indicated file.
-        If no conf_file is provided, then replaces the
-        original file/database used to initialize the object.
-        """
-        pass
+    from invokeai.app.invocations.baseinvocation import InvocationContext
 
 
 # simple implementation
@@ -589,7 +327,7 @@ class ModelManagerService(ModelManagerServiceBase):
     def merge_models(
         self,
         model_names: List[str] = Field(
-            default=None, min_items=2, max_items=3, description="List of model names to merge"
+            default=None, min_length=2, max_length=3, description="List of model names to merge"
         ),
         base_model: Union[BaseModelType, str] = Field(
             default=None, description="Base model shared by all models to be merged"
diff --git a/invokeai/app/services/names/__init__.py b/invokeai/app/services/names/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/names/names_base.py b/invokeai/app/services/names/names_base.py
new file mode 100644
index 0000000000..f892c43c55
--- /dev/null
+++ b/invokeai/app/services/names/names_base.py
@@ -0,0 +1,11 @@
+from abc import ABC, abstractmethod
+
+
+class NameServiceBase(ABC):
+    """Low-level service responsible for naming resources (images, latents, etc)."""
+
+    # TODO: Add customizable naming schemes
+    @abstractmethod
+    def create_image_name(self) -> str:
+        """Creates a name for an image."""
+        pass
diff --git a/invokeai/app/services/names/names_common.py b/invokeai/app/services/names/names_common.py
new file mode 100644
index 0000000000..7c69f8abe8
--- /dev/null
+++ b/invokeai/app/services/names/names_common.py
@@ -0,0 +1,8 @@
+from enum import Enum, EnumMeta
+
+
+class ResourceType(str, Enum, metaclass=EnumMeta):
+    """Enum for resource types."""
+
+    IMAGE = "image"
+    LATENT = "latent"
diff --git a/invokeai/app/services/names/names_default.py b/invokeai/app/services/names/names_default.py
new file mode 100644
index 0000000000..104268c8bd
--- /dev/null
+++ b/invokeai/app/services/names/names_default.py
@@ -0,0 +1,13 @@
+from invokeai.app.util.misc import uuid_string
+
+from .names_base import NameServiceBase
+
+
+class SimpleNameService(NameServiceBase):
+    """Creates image names from UUIDs."""
+
+    # TODO: Add customizable naming schemes
+    def create_image_name(self) -> str:
+        uuid_str = uuid_string()
+        filename = f"{uuid_str}.png"
+        return filename
diff --git a/invokeai/app/services/resource_name.py b/invokeai/app/services/resource_name.py
deleted file mode 100644
index a17b1a084e..0000000000
--- a/invokeai/app/services/resource_name.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from abc import ABC, abstractmethod
-from enum import Enum, EnumMeta
-
-from invokeai.app.util.misc import uuid_string
-
-
-class ResourceType(str, Enum, metaclass=EnumMeta):
-    """Enum for resource types."""
-
-    IMAGE = "image"
-    LATENT = "latent"
-
-
-class NameServiceBase(ABC):
-    """Low-level service responsible for naming resources (images, latents, etc)."""
-
-    # TODO: Add customizable naming schemes
-    @abstractmethod
-    def create_image_name(self) -> str:
-        """Creates a name for an image."""
-        pass
-
-
-class SimpleNameService(NameServiceBase):
-    """Creates image names from UUIDs."""
-
-    # TODO: Add customizable naming schemes
-    def create_image_name(self) -> str:
-        uuid_str = uuid_string()
-        filename = f"{uuid_str}.png"
-        return filename
diff --git a/invokeai/app/services/session_processor/session_processor_default.py b/invokeai/app/services/session_processor/session_processor_default.py
index 065b80e1a9..5b59dee254 100644
--- a/invokeai/app/services/session_processor/session_processor_default.py
+++ b/invokeai/app/services/session_processor/session_processor_default.py
@@ -7,7 +7,7 @@ from typing import Optional
 from fastapi_events.handlers.local import local_handler
 from fastapi_events.typing import Event as FastAPIEvent
 
-from invokeai.app.services.events import EventServiceBase
+from invokeai.app.services.events.events_base import EventServiceBase
 from invokeai.app.services.session_queue.session_queue_common import SessionQueueItem
 
 from ..invoker import Invoker
@@ -97,7 +97,6 @@ class DefaultSessionProcessor(SessionProcessorBase):
             resume_event.set()
             self.__threadLimit.acquire()
             queue_item: Optional[SessionQueueItem] = None
-            self.__invoker.services.logger
             while not stop_event.is_set():
                 poll_now_event.clear()
                 try:
diff --git a/invokeai/app/services/session_queue/session_queue_base.py b/invokeai/app/services/session_queue/session_queue_base.py
index cbc16f8283..b5272f1868 100644
--- a/invokeai/app/services/session_queue/session_queue_base.py
+++ b/invokeai/app/services/session_queue/session_queue_base.py
@@ -1,7 +1,6 @@
 from abc import ABC, abstractmethod
 from typing import Optional
 
-from invokeai.app.services.graph import Graph
 from invokeai.app.services.session_queue.session_queue_common import (
     QUEUE_ITEM_STATUS,
     Batch,
@@ -18,7 +17,8 @@ from invokeai.app.services.session_queue.session_queue_common import (
     SessionQueueItemDTO,
     SessionQueueStatus,
 )
-from invokeai.app.services.shared.models import CursorPaginatedResults
+from invokeai.app.services.shared.graph import Graph
+from invokeai.app.services.shared.pagination import CursorPaginatedResults
 
 
 class SessionQueueBase(ABC):
diff --git a/invokeai/app/services/session_queue/session_queue_common.py b/invokeai/app/services/session_queue/session_queue_common.py
index a1eada6523..48e1da83b5 100644
--- a/invokeai/app/services/session_queue/session_queue_common.py
+++ b/invokeai/app/services/session_queue/session_queue_common.py
@@ -3,11 +3,11 @@ import json
 from itertools import chain, product
 from typing import Generator, Iterable, Literal, NamedTuple, Optional, TypeAlias, Union, cast
 
-from pydantic import BaseModel, Field, StrictStr, parse_raw_as, root_validator, validator
-from pydantic.json import pydantic_encoder
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, TypeAdapter, field_validator, model_validator
+from pydantic_core import to_jsonable_python
 
 from invokeai.app.invocations.baseinvocation import BaseInvocation
-from invokeai.app.services.graph import Graph, GraphExecutionState, NodeNotFoundError
+from invokeai.app.services.shared.graph import Graph, GraphExecutionState, NodeNotFoundError
 from invokeai.app.util.misc import uuid_string
 
 # region Errors
@@ -17,7 +17,7 @@ class BatchZippedLengthError(ValueError):
     """Raise when a batch has items of different lengths."""
 
 
-class BatchItemsTypeError(TypeError):
+class BatchItemsTypeError(ValueError):  # this cannot be a TypeError in pydantic v2
     """Raise when a batch has items of different types."""
 
 
@@ -70,7 +70,7 @@ class Batch(BaseModel):
         default=1, ge=1, description="Int stating how many times to iterate through all possible batch indices"
     )
 
-    @validator("data")
+    @field_validator("data")
     def validate_lengths(cls, v: Optional[BatchDataCollection]):
         if v is None:
             return v
@@ -81,7 +81,7 @@ class Batch(BaseModel):
                     raise BatchZippedLengthError("Zipped batch items must all have the same length")
         return v
 
-    @validator("data")
+    @field_validator("data")
     def validate_types(cls, v: Optional[BatchDataCollection]):
         if v is None:
             return v
@@ -94,7 +94,7 @@ class Batch(BaseModel):
                         raise BatchItemsTypeError("All items in a batch must have the same type")
         return v
 
-    @validator("data")
+    @field_validator("data")
     def validate_unique_field_mappings(cls, v: Optional[BatchDataCollection]):
         if v is None:
             return v
@@ -107,34 +107,35 @@ class Batch(BaseModel):
                 paths.add(pair)
         return v
 
-    @root_validator(skip_on_failure=True)
+    @model_validator(mode="after")
     def validate_batch_nodes_and_edges(cls, values):
-        batch_data_collection = cast(Optional[BatchDataCollection], values["data"])
+        batch_data_collection = cast(Optional[BatchDataCollection], values.data)
         if batch_data_collection is None:
             return values
-        graph = cast(Graph, values["graph"])
+        graph = cast(Graph, values.graph)
         for batch_data_list in batch_data_collection:
             for batch_data in batch_data_list:
                 try:
                     node = cast(BaseInvocation, graph.get_node(batch_data.node_path))
                 except NodeNotFoundError:
                     raise NodeNotFoundError(f"Node {batch_data.node_path} not found in graph")
-                if batch_data.field_name not in node.__fields__:
+                if batch_data.field_name not in node.model_fields:
                     raise NodeNotFoundError(f"Field {batch_data.field_name} not found in node {batch_data.node_path}")
         return values
 
-    @validator("graph")
+    @field_validator("graph")
     def validate_graph(cls, v: Graph):
         v.validate_self()
         return v
 
-    class Config:
-        schema_extra = {
-            "required": [
+    model_config = ConfigDict(
+        json_schema_extra=dict(
+            required=[
                 "graph",
                 "runs",
             ]
-        }
+        )
+    )
 
 
 # endregion Batch
@@ -146,15 +147,21 @@ DEFAULT_QUEUE_ID = "default"
 
 QUEUE_ITEM_STATUS = Literal["pending", "in_progress", "completed", "failed", "canceled"]
 
+adapter_NodeFieldValue = TypeAdapter(list[NodeFieldValue])
+
 
 def get_field_values(queue_item_dict: dict) -> Optional[list[NodeFieldValue]]:
     field_values_raw = queue_item_dict.get("field_values", None)
-    return parse_raw_as(list[NodeFieldValue], field_values_raw) if field_values_raw is not None else None
+    return adapter_NodeFieldValue.validate_json(field_values_raw) if field_values_raw is not None else None
+
+
+adapter_GraphExecutionState = TypeAdapter(GraphExecutionState)
 
 
 def get_session(queue_item_dict: dict) -> GraphExecutionState:
     session_raw = queue_item_dict.get("session", "{}")
-    return parse_raw_as(GraphExecutionState, session_raw)
+    session = adapter_GraphExecutionState.validate_json(session_raw, strict=False)
+    return session
 
 
 class SessionQueueItemWithoutGraph(BaseModel):
@@ -178,14 +185,14 @@ class SessionQueueItemWithoutGraph(BaseModel):
     )
 
     @classmethod
-    def from_dict(cls, queue_item_dict: dict) -> "SessionQueueItemDTO":
+    def queue_item_dto_from_dict(cls, queue_item_dict: dict) -> "SessionQueueItemDTO":
         # must parse these manually
         queue_item_dict["field_values"] = get_field_values(queue_item_dict)
         return SessionQueueItemDTO(**queue_item_dict)
 
-    class Config:
-        schema_extra = {
-            "required": [
+    model_config = ConfigDict(
+        json_schema_extra=dict(
+            required=[
                 "item_id",
                 "status",
                 "batch_id",
@@ -196,7 +203,8 @@ class SessionQueueItemWithoutGraph(BaseModel):
                 "created_at",
                 "updated_at",
             ]
-        }
+        )
+    )
 
 
 class SessionQueueItemDTO(SessionQueueItemWithoutGraph):
@@ -207,15 +215,15 @@ class SessionQueueItem(SessionQueueItemWithoutGraph):
     session: GraphExecutionState = Field(description="The fully-populated session to be executed")
 
     @classmethod
-    def from_dict(cls, queue_item_dict: dict) -> "SessionQueueItem":
+    def queue_item_from_dict(cls, queue_item_dict: dict) -> "SessionQueueItem":
         # must parse these manually
         queue_item_dict["field_values"] = get_field_values(queue_item_dict)
         queue_item_dict["session"] = get_session(queue_item_dict)
         return SessionQueueItem(**queue_item_dict)
 
-    class Config:
-        schema_extra = {
-            "required": [
+    model_config = ConfigDict(
+        json_schema_extra=dict(
+            required=[
                 "item_id",
                 "status",
                 "batch_id",
@@ -227,7 +235,8 @@ class SessionQueueItem(SessionQueueItemWithoutGraph):
                 "created_at",
                 "updated_at",
             ]
-        }
+        )
+    )
 
 
 # endregion Queue Items
@@ -321,7 +330,7 @@ def populate_graph(graph: Graph, node_field_values: Iterable[NodeFieldValue]) ->
     """
     Populates the given graph with the given batch data items.
     """
-    graph_clone = graph.copy(deep=True)
+    graph_clone = graph.model_copy(deep=True)
     for item in node_field_values:
         node = graph_clone.get_node(item.node_path)
         if node is None:
@@ -354,7 +363,7 @@ def create_session_nfv_tuples(
                 for item in batch_datum.items
             ]
             node_field_values_to_zip.append(node_field_values)
-        data.append(list(zip(*node_field_values_to_zip)))
+        data.append(list(zip(*node_field_values_to_zip)))  # type: ignore [arg-type]
 
     # create generator to yield session,nfv tuples
     count = 0
@@ -409,11 +418,11 @@ def prepare_values_to_insert(queue_id: str, batch: Batch, priority: int, max_new
         values_to_insert.append(
             SessionQueueValueToInsert(
                 queue_id,  # queue_id
-                session.json(),  # session (json)
+                session.model_dump_json(warnings=False, exclude_none=True),  # session (json)
                 session.id,  # session_id
                 batch.batch_id,  # batch_id
                 # must use pydantic_encoder bc field_values is a list of models
-                json.dumps(field_values, default=pydantic_encoder) if field_values else None,  # field_values (json)
+                json.dumps(field_values, default=to_jsonable_python) if field_values else None,  # field_values (json)
                 priority,  # priority
             )
         )
@@ -421,3 +430,6 @@ def prepare_values_to_insert(queue_id: str, batch: Batch, priority: int, max_new
 
 
 # endregion Util
+
+Batch.model_rebuild(force=True)
+SessionQueueItem.model_rebuild(force=True)
diff --git a/invokeai/app/services/session_queue/session_queue_sqlite.py b/invokeai/app/services/session_queue/session_queue_sqlite.py
index f995576311..4daab9cdbc 100644
--- a/invokeai/app/services/session_queue/session_queue_sqlite.py
+++ b/invokeai/app/services/session_queue/session_queue_sqlite.py
@@ -5,8 +5,7 @@ from typing import Optional, Union, cast
 from fastapi_events.handlers.local import local_handler
 from fastapi_events.typing import Event as FastAPIEvent
 
-from invokeai.app.services.events import EventServiceBase
-from invokeai.app.services.graph import Graph
+from invokeai.app.services.events.events_base import EventServiceBase
 from invokeai.app.services.invoker import Invoker
 from invokeai.app.services.session_queue.session_queue_base import SessionQueueBase
 from invokeai.app.services.session_queue.session_queue_common import (
@@ -29,14 +28,16 @@ from invokeai.app.services.session_queue.session_queue_common import (
     calc_session_count,
     prepare_values_to_insert,
 )
-from invokeai.app.services.shared.models import CursorPaginatedResults
+from invokeai.app.services.shared.graph import Graph
+from invokeai.app.services.shared.pagination import CursorPaginatedResults
+from invokeai.app.services.shared.sqlite import SqliteDatabase
 
 
 class SqliteSessionQueue(SessionQueueBase):
     __invoker: Invoker
     __conn: sqlite3.Connection
     __cursor: sqlite3.Cursor
-    __lock: threading.Lock
+    __lock: threading.RLock
 
     def start(self, invoker: Invoker) -> None:
         self.__invoker = invoker
@@ -45,13 +46,11 @@ class SqliteSessionQueue(SessionQueueBase):
         local_handler.register(event_name=EventServiceBase.queue_event, _func=self._on_session_event)
         self.__invoker.services.logger.info(f"Pruned {prune_result.deleted} finished queue items")
 
-    def __init__(self, conn: sqlite3.Connection, lock: threading.Lock) -> None:
+    def __init__(self, db: SqliteDatabase) -> None:
         super().__init__()
-        self.__conn = conn
-        # Enable row factory to get rows as dictionaries (must be done before making the cursor!)
-        self.__conn.row_factory = sqlite3.Row
+        self.__lock = db.lock
+        self.__conn = db.conn
         self.__cursor = self.__conn.cursor()
-        self.__lock = lock
         self._create_tables()
 
     def _match_event_name(self, event: FastAPIEvent, match_in: list[str]) -> bool:
@@ -278,8 +277,8 @@ class SqliteSessionQueue(SessionQueueBase):
         if result is None:
             raise SessionQueueItemNotFoundError(f"No queue item with batch id {enqueue_result.batch.batch_id}")
         return EnqueueGraphResult(
-            **enqueue_result.dict(),
-            queue_item=SessionQueueItemDTO.from_dict(dict(result)),
+            **enqueue_result.model_dump(),
+            queue_item=SessionQueueItemDTO.queue_item_dto_from_dict(dict(result)),
         )
 
     def enqueue_batch(self, queue_id: str, batch: Batch, prepend: bool) -> EnqueueBatchResult:
@@ -352,7 +351,7 @@ class SqliteSessionQueue(SessionQueueBase):
             self.__lock.release()
         if result is None:
             return None
-        queue_item = SessionQueueItem.from_dict(dict(result))
+        queue_item = SessionQueueItem.queue_item_from_dict(dict(result))
         queue_item = self._set_queue_item_status(item_id=queue_item.item_id, status="in_progress")
         return queue_item
 
@@ -381,7 +380,7 @@ class SqliteSessionQueue(SessionQueueBase):
             self.__lock.release()
         if result is None:
             return None
-        return SessionQueueItem.from_dict(dict(result))
+        return SessionQueueItem.queue_item_from_dict(dict(result))
 
     def get_current(self, queue_id: str) -> Optional[SessionQueueItem]:
         try:
@@ -405,7 +404,7 @@ class SqliteSessionQueue(SessionQueueBase):
             self.__lock.release()
         if result is None:
             return None
-        return SessionQueueItem.from_dict(dict(result))
+        return SessionQueueItem.queue_item_from_dict(dict(result))
 
     def _set_queue_item_status(
         self, item_id: int, status: QUEUE_ITEM_STATUS, error: Optional[str] = None
@@ -565,7 +564,7 @@ class SqliteSessionQueue(SessionQueueBase):
         queue_item = self.get_queue_item(item_id)
         if queue_item.status not in ["canceled", "failed", "completed"]:
             status = "failed" if error is not None else "canceled"
-            queue_item = self._set_queue_item_status(item_id=item_id, status=status, error=error)
+            queue_item = self._set_queue_item_status(item_id=item_id, status=status, error=error)  # type: ignore [arg-type] # mypy seems to not narrow the Literals here
             self.__invoker.services.queue.cancel(queue_item.session_id)
             self.__invoker.services.events.emit_session_canceled(
                 queue_item_id=queue_item.item_id,
@@ -700,7 +699,7 @@ class SqliteSessionQueue(SessionQueueBase):
             self.__lock.release()
         if result is None:
             raise SessionQueueItemNotFoundError(f"No queue item with id {item_id}")
-        return SessionQueueItem.from_dict(dict(result))
+        return SessionQueueItem.queue_item_from_dict(dict(result))
 
     def list_queue_items(
         self,
@@ -752,7 +751,7 @@ class SqliteSessionQueue(SessionQueueBase):
             params.append(limit + 1)
             self.__cursor.execute(query, params)
             results = cast(list[sqlite3.Row], self.__cursor.fetchall())
-            items = [SessionQueueItemDTO.from_dict(dict(result)) for result in results]
+            items = [SessionQueueItemDTO.queue_item_dto_from_dict(dict(result)) for result in results]
             has_more = False
             if len(items) > limit:
                 # remove the extra item
diff --git a/invokeai/app/services/shared/__init__.py b/invokeai/app/services/shared/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/default_graphs.py b/invokeai/app/services/shared/default_graphs.py
similarity index 85%
rename from invokeai/app/services/default_graphs.py
rename to invokeai/app/services/shared/default_graphs.py
index ad8d220599..9a6e2456cb 100644
--- a/invokeai/app/services/default_graphs.py
+++ b/invokeai/app/services/shared/default_graphs.py
@@ -1,10 +1,11 @@
-from ..invocations.compel import CompelInvocation
-from ..invocations.image import ImageNSFWBlurInvocation
-from ..invocations.latent import DenoiseLatentsInvocation, LatentsToImageInvocation
-from ..invocations.noise import NoiseInvocation
-from ..invocations.primitives import IntegerInvocation
+from invokeai.app.services.item_storage.item_storage_base import ItemStorageABC
+
+from ...invocations.compel import CompelInvocation
+from ...invocations.image import ImageNSFWBlurInvocation
+from ...invocations.latent import DenoiseLatentsInvocation, LatentsToImageInvocation
+from ...invocations.noise import NoiseInvocation
+from ...invocations.primitives import IntegerInvocation
 from .graph import Edge, EdgeConnection, ExposedNodeInput, ExposedNodeOutput, Graph, LibraryGraph
-from .item_storage import ItemStorageABC
 
 default_text_to_image_graph_id = "539b2af5-2b4d-4d8c-8071-e54a3255fc74"
 
@@ -79,10 +80,10 @@ def create_system_graphs(graph_library: ItemStorageABC[LibraryGraph]) -> list[Li
     # TODO: Uncomment this when we are ready to fix this up to prevent breaking changes
     graphs: list[LibraryGraph] = list()
 
-    # text_to_image = graph_library.get(default_text_to_image_graph_id)
+    text_to_image = graph_library.get(default_text_to_image_graph_id)
 
-    # # TODO: Check if the graph is the same as the default one, and if not, update it
-    # #if text_to_image is None:
+    # TODO: Check if the graph is the same as the default one, and if not, update it
+    # if text_to_image is None:
     text_to_image = create_text_to_image()
     graph_library.set(text_to_image)
 
diff --git a/invokeai/app/services/graph.py b/invokeai/app/services/shared/graph.py
similarity index 96%
rename from invokeai/app/services/graph.py
rename to invokeai/app/services/shared/graph.py
index ab479300fc..8f974f7c6b 100644
--- a/invokeai/app/services/graph.py
+++ b/invokeai/app/services/shared/graph.py
@@ -5,14 +5,12 @@ import itertools
 from typing import Annotated, Any, Optional, Union, get_args, get_origin, get_type_hints
 
 import networkx as nx
-from pydantic import BaseModel, root_validator, validator
+from pydantic import BaseModel, ConfigDict, field_validator, model_validator
 from pydantic.fields import Field
 
-from invokeai.app.util.misc import uuid_string
-
 # Importing * is bad karma but needed here for node detection
-from ..invocations import *  # noqa: F401 F403
-from ..invocations.baseinvocation import (
+from invokeai.app.invocations import *  # noqa: F401 F403
+from invokeai.app.invocations.baseinvocation import (
     BaseInvocation,
     BaseInvocationOutput,
     Input,
@@ -23,6 +21,7 @@ from ..invocations.baseinvocation import (
     invocation,
     invocation_output,
 )
+from invokeai.app.util.misc import uuid_string
 
 # in 3.10 this would be "from types import NoneType"
 NoneType = type(None)
@@ -236,7 +235,8 @@ class CollectInvocationOutput(BaseInvocationOutput):
 class CollectInvocation(BaseInvocation):
     """Collects values into a collection"""
 
-    item: Any = InputField(
+    item: Optional[Any] = InputField(
+        default=None,
         description="The item to collect (all inputs must be of the same type)",
         ui_type=UIType.CollectionItem,
         title="Collection Item",
@@ -251,8 +251,8 @@ class CollectInvocation(BaseInvocation):
         return CollectInvocationOutput(collection=copy.copy(self.collection))
 
 
-InvocationsUnion = Union[BaseInvocation.get_invocations()]  # type: ignore
-InvocationOutputsUnion = Union[BaseInvocationOutput.get_all_subclasses_tuple()]  # type: ignore
+InvocationsUnion: Any = BaseInvocation.get_invocations_union()
+InvocationOutputsUnion: Any = BaseInvocationOutput.get_outputs_union()
 
 
 class Graph(BaseModel):
@@ -379,13 +379,13 @@ class Graph(BaseModel):
                 raise NodeNotFoundError(f"Edge destination node {edge.destination.node_id} does not exist in the graph")
 
             # output fields are not on the node object directly, they are on the output type
-            if edge.source.field not in source_node.get_output_type().__fields__:
+            if edge.source.field not in source_node.get_output_type().model_fields:
                 raise NodeFieldNotFoundError(
                     f"Edge source field {edge.source.field} does not exist in node {edge.source.node_id}"
                 )
 
             # input fields are on the node
-            if edge.destination.field not in destination_node.__fields__:
+            if edge.destination.field not in destination_node.model_fields:
                 raise NodeFieldNotFoundError(
                     f"Edge destination field {edge.destination.field} does not exist in node {edge.destination.node_id}"
                 )
@@ -396,24 +396,24 @@ class Graph(BaseModel):
             raise CyclicalGraphError("Graph contains cycles")
 
         # Validate all edge connections are valid
-        for e in self.edges:
+        for edge in self.edges:
             if not are_connections_compatible(
-                self.get_node(e.source.node_id),
-                e.source.field,
-                self.get_node(e.destination.node_id),
-                e.destination.field,
+                self.get_node(edge.source.node_id),
+                edge.source.field,
+                self.get_node(edge.destination.node_id),
+                edge.destination.field,
             ):
                 raise InvalidEdgeError(
-                    f"Invalid edge from {e.source.node_id}.{e.source.field} to {e.destination.node_id}.{e.destination.field}"
+                    f"Invalid edge from {edge.source.node_id}.{edge.source.field} to {edge.destination.node_id}.{edge.destination.field}"
                 )
 
         # Validate all iterators & collectors
         # TODO: may need to validate all iterators & collectors in subgraphs so edge connections in parent graphs will be available
-        for n in self.nodes.values():
-            if isinstance(n, IterateInvocation) and not self._is_iterator_connection_valid(n.id):
-                raise InvalidEdgeError(f"Invalid iterator node {n.id}")
-            if isinstance(n, CollectInvocation) and not self._is_collector_connection_valid(n.id):
-                raise InvalidEdgeError(f"Invalid collector node {n.id}")
+        for node in self.nodes.values():
+            if isinstance(node, IterateInvocation) and not self._is_iterator_connection_valid(node.id):
+                raise InvalidEdgeError(f"Invalid iterator node {node.id}")
+            if isinstance(node, CollectInvocation) and not self._is_collector_connection_valid(node.id):
+                raise InvalidEdgeError(f"Invalid collector node {node.id}")
 
         return None
 
@@ -595,7 +595,7 @@ class Graph(BaseModel):
 
     def _get_input_edges_and_graphs(
         self, node_path: str, prefix: Optional[str] = None
-    ) -> list[tuple["Graph", str, Edge]]:
+    ) -> list[tuple["Graph", Union[str, None], Edge]]:
         """Gets all input edges for a node along with the graph they are in and the graph's path"""
         edges = list()
 
@@ -637,7 +637,7 @@ class Graph(BaseModel):
 
     def _get_output_edges_and_graphs(
         self, node_path: str, prefix: Optional[str] = None
-    ) -> list[tuple["Graph", str, Edge]]:
+    ) -> list[tuple["Graph", Union[str, None], Edge]]:
         """Gets all output edges for a node along with the graph they are in and the graph's path"""
         edges = list()
 
@@ -818,15 +818,15 @@ class GraphExecutionState(BaseModel):
         default_factory=dict,
     )
 
-    @validator("graph")
+    @field_validator("graph")
     def graph_is_valid(cls, v: Graph):
         """Validates that the graph is valid"""
         v.validate_self()
         return v
 
-    class Config:
-        schema_extra = {
-            "required": [
+    model_config = ConfigDict(
+        json_schema_extra=dict(
+            required=[
                 "id",
                 "graph",
                 "execution_graph",
@@ -837,7 +837,8 @@ class GraphExecutionState(BaseModel):
                 "prepared_source_mapping",
                 "source_prepared_mapping",
             ]
-        }
+        )
+    )
 
     def next(self) -> Optional[BaseInvocation]:
         """Gets the next node ready to execute."""
@@ -911,7 +912,7 @@ class GraphExecutionState(BaseModel):
             input_collection = getattr(input_collection_prepared_node_output, input_collection_edge.source.field)
             self_iteration_count = len(input_collection)
 
-        new_nodes = list()
+        new_nodes: list[str] = list()
         if self_iteration_count == 0:
             # TODO: should this raise a warning? It might just happen if an empty collection is input, and should be valid.
             return new_nodes
@@ -921,7 +922,7 @@ class GraphExecutionState(BaseModel):
 
         # Create new edges for this iteration
         # For collect nodes, this may contain multiple inputs to the same field
-        new_edges = list()
+        new_edges: list[Edge] = list()
         for edge in input_edges:
             for input_node_id in (n[1] for n in iteration_node_map if n[0] == edge.source.node_id):
                 new_edge = Edge(
@@ -1180,18 +1181,18 @@ class LibraryGraph(BaseModel):
         description="The outputs exposed by this graph", default_factory=list
     )
 
-    @validator("exposed_inputs", "exposed_outputs")
-    def validate_exposed_aliases(cls, v):
+    @field_validator("exposed_inputs", "exposed_outputs")
+    def validate_exposed_aliases(cls, v: list[Union[ExposedNodeInput, ExposedNodeOutput]]):
         if len(v) != len(set(i.alias for i in v)):
             raise ValueError("Duplicate exposed alias")
         return v
 
-    @root_validator
+    @model_validator(mode="after")
     def validate_exposed_nodes(cls, values):
-        graph = values["graph"]
+        graph = values.graph
 
         # Validate exposed inputs
-        for exposed_input in values["exposed_inputs"]:
+        for exposed_input in values.exposed_inputs:
             if not graph.has_node(exposed_input.node_path):
                 raise ValueError(f"Exposed input node {exposed_input.node_path} does not exist")
             node = graph.get_node(exposed_input.node_path)
@@ -1201,7 +1202,7 @@ class LibraryGraph(BaseModel):
                 )
 
         # Validate exposed outputs
-        for exposed_output in values["exposed_outputs"]:
+        for exposed_output in values.exposed_outputs:
             if not graph.has_node(exposed_output.node_path):
                 raise ValueError(f"Exposed output node {exposed_output.node_path} does not exist")
             node = graph.get_node(exposed_output.node_path)
@@ -1213,4 +1214,6 @@ class LibraryGraph(BaseModel):
         return values
 
 
-GraphInvocation.update_forward_refs()
+GraphInvocation.model_rebuild(force=True)
+Graph.model_rebuild(force=True)
+GraphExecutionState.model_rebuild(force=True)
diff --git a/invokeai/app/services/shared/models.py b/invokeai/app/services/shared/models.py
deleted file mode 100644
index 7edde152c3..0000000000
--- a/invokeai/app/services/shared/models.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from typing import Generic, TypeVar
-
-from pydantic import BaseModel, Field
-from pydantic.generics import GenericModel
-
-GenericBaseModel = TypeVar("GenericBaseModel", bound=BaseModel)
-
-
-class CursorPaginatedResults(GenericModel, Generic[GenericBaseModel]):
-    """Cursor-paginated results"""
-
-    limit: int = Field(..., description="Limit of items to get")
-    has_more: bool = Field(..., description="Whether there are more items available")
-    items: list[GenericBaseModel] = Field(..., description="Items")
diff --git a/invokeai/app/services/shared/pagination.py b/invokeai/app/services/shared/pagination.py
new file mode 100644
index 0000000000..ea342b1101
--- /dev/null
+++ b/invokeai/app/services/shared/pagination.py
@@ -0,0 +1,41 @@
+from typing import Generic, TypeVar
+
+from pydantic import BaseModel, Field
+
+GenericBaseModel = TypeVar("GenericBaseModel", bound=BaseModel)
+
+
+class CursorPaginatedResults(BaseModel, Generic[GenericBaseModel]):
+    """
+    Cursor-paginated results
+    Generic must be a Pydantic model
+    """
+
+    limit: int = Field(..., description="Limit of items to get")
+    has_more: bool = Field(..., description="Whether there are more items available")
+    items: list[GenericBaseModel] = Field(..., description="Items")
+
+
+class OffsetPaginatedResults(BaseModel, Generic[GenericBaseModel]):
+    """
+    Offset-paginated results
+    Generic must be a Pydantic model
+    """
+
+    limit: int = Field(description="Limit of items to get")
+    offset: int = Field(description="Offset from which to retrieve items")
+    total: int = Field(description="Total number of items in result")
+    items: list[GenericBaseModel] = Field(description="Items")
+
+
+class PaginatedResults(BaseModel, Generic[GenericBaseModel]):
+    """
+    Paginated results
+    Generic must be a Pydantic model
+    """
+
+    page: int = Field(description="Current Page")
+    pages: int = Field(description="Total number of pages")
+    per_page: int = Field(description="Number of items per page")
+    total: int = Field(description="Total number of items in result")
+    items: list[GenericBaseModel] = Field(description="Items")
diff --git a/invokeai/app/services/shared/sqlite.py b/invokeai/app/services/shared/sqlite.py
new file mode 100644
index 0000000000..3c75c3d6a7
--- /dev/null
+++ b/invokeai/app/services/shared/sqlite.py
@@ -0,0 +1,48 @@
+import sqlite3
+import threading
+from logging import Logger
+
+from invokeai.app.services.config import InvokeAIAppConfig
+
+sqlite_memory = ":memory:"
+
+
+class SqliteDatabase:
+    conn: sqlite3.Connection
+    lock: threading.RLock
+    _logger: Logger
+    _config: InvokeAIAppConfig
+
+    def __init__(self, config: InvokeAIAppConfig, logger: Logger):
+        self._logger = logger
+        self._config = config
+
+        if self._config.use_memory_db:
+            location = sqlite_memory
+            logger.info("Using in-memory database")
+        else:
+            db_path = self._config.db_path
+            db_path.parent.mkdir(parents=True, exist_ok=True)
+            location = str(db_path)
+            self._logger.info(f"Using database at {location}")
+
+        self.conn = sqlite3.connect(location, check_same_thread=False)
+        self.lock = threading.RLock()
+        self.conn.row_factory = sqlite3.Row
+
+        if self._config.log_sql:
+            self.conn.set_trace_callback(self._logger.debug)
+
+        self.conn.execute("PRAGMA foreign_keys = ON;")
+
+    def clean(self) -> None:
+        try:
+            self.lock.acquire()
+            self.conn.execute("VACUUM;")
+            self.conn.commit()
+            self._logger.info("Cleaned database")
+        except Exception as e:
+            self._logger.error(f"Error cleaning database: {e}")
+            raise e
+        finally:
+            self.lock.release()
diff --git a/invokeai/app/services/thread.py b/invokeai/app/services/thread.py
deleted file mode 100644
index 3fd88295b1..0000000000
--- a/invokeai/app/services/thread.py
+++ /dev/null
@@ -1,3 +0,0 @@
-import threading
-
-lock = threading.Lock()
diff --git a/invokeai/app/services/urls/__init__.py b/invokeai/app/services/urls/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/app/services/urls/urls_base.py b/invokeai/app/services/urls/urls_base.py
new file mode 100644
index 0000000000..c39ba055f3
--- /dev/null
+++ b/invokeai/app/services/urls/urls_base.py
@@ -0,0 +1,10 @@
+from abc import ABC, abstractmethod
+
+
+class UrlServiceBase(ABC):
+    """Responsible for building URLs for resources."""
+
+    @abstractmethod
+    def get_image_url(self, image_name: str, thumbnail: bool = False) -> str:
+        """Gets the URL for an image or thumbnail."""
+        pass
diff --git a/invokeai/app/services/urls.py b/invokeai/app/services/urls/urls_default.py
similarity index 64%
rename from invokeai/app/services/urls.py
rename to invokeai/app/services/urls/urls_default.py
index 7688b3bdd3..801aeac560 100644
--- a/invokeai/app/services/urls.py
+++ b/invokeai/app/services/urls/urls_default.py
@@ -1,14 +1,6 @@
 import os
-from abc import ABC, abstractmethod
 
-
-class UrlServiceBase(ABC):
-    """Responsible for building URLs for resources."""
-
-    @abstractmethod
-    def get_image_url(self, image_name: str, thumbnail: bool = False) -> str:
-        """Gets the URL for an image or thumbnail."""
-        pass
+from .urls_base import UrlServiceBase
 
 
 class LocalUrlService(UrlServiceBase):
diff --git a/invokeai/app/util/controlnet_utils.py b/invokeai/app/util/controlnet_utils.py
index e6f34a4c44..51ceec2edd 100644
--- a/invokeai/app/util/controlnet_utils.py
+++ b/invokeai/app/util/controlnet_utils.py
@@ -265,7 +265,7 @@ def np_img_resize(np_img: np.ndarray, resize_mode: str, h: int, w: int, device:
 
 
 def prepare_control_image(
-    image: Image,
+    image: Image.Image,
     width: int,
     height: int,
     num_channels: int = 3,
diff --git a/invokeai/app/util/metadata.py b/invokeai/app/util/metadata.py
index 5ca5f14e12..15951cb009 100644
--- a/invokeai/app/util/metadata.py
+++ b/invokeai/app/util/metadata.py
@@ -3,7 +3,7 @@ from typing import Optional
 
 from pydantic import ValidationError
 
-from invokeai.app.services.graph import Edge
+from invokeai.app.services.shared.graph import Edge
 
 
 def get_metadata_graph_from_raw_session(session_raw: str) -> Optional[dict]:
diff --git a/invokeai/app/util/misc.py b/invokeai/app/util/misc.py
index 6d56652ed4..910b05d8dd 100644
--- a/invokeai/app/util/misc.py
+++ b/invokeai/app/util/misc.py
@@ -1,4 +1,5 @@
 import datetime
+import typing
 import uuid
 
 import numpy as np
@@ -27,3 +28,8 @@ def get_random_seed():
 def uuid_string():
     res = uuid.uuid4()
     return str(res)
+
+
+def is_optional(value: typing.Any):
+    """Checks if a value is typed as Optional. Note that Optional is sugar for Union[x, None]."""
+    return typing.get_origin(value) is typing.Union and type(None) in typing.get_args(value)
diff --git a/invokeai/app/util/model_exclude_null.py b/invokeai/app/util/model_exclude_null.py
index b75f127ec7..6da41039b4 100644
--- a/invokeai/app/util/model_exclude_null.py
+++ b/invokeai/app/util/model_exclude_null.py
@@ -13,11 +13,11 @@ From https://github.com/tiangolo/fastapi/discussions/8882#discussioncomment-5154
 
 
 class BaseModelExcludeNull(BaseModel):
-    def dict(self, *args, **kwargs) -> dict[str, Any]:
+    def model_dump(self, *args, **kwargs) -> dict[str, Any]:
         """
         Override the default dict method to exclude None values in the response
         """
         kwargs.pop("exclude_none", None)
-        return super().dict(*args, exclude_none=True, **kwargs)
+        return super().model_dump(*args, exclude_none=True, **kwargs)
 
     pass
diff --git a/invokeai/app/util/step_callback.py b/invokeai/app/util/step_callback.py
index 6d4a857491..f166206d52 100644
--- a/invokeai/app/util/step_callback.py
+++ b/invokeai/app/util/step_callback.py
@@ -1,8 +1,7 @@
 import torch
 from PIL import Image
 
-from invokeai.app.models.exceptions import CanceledException
-from invokeai.app.models.image import ProgressImage
+from invokeai.app.services.invocation_processor.invocation_processor_common import CanceledException, ProgressImage
 
 from ...backend.model_management.models import BaseModelType
 from ...backend.stable_diffusion import PipelineIntermediateState
diff --git a/invokeai/assets/__init__.py b/invokeai/assets/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/invokeai/backend/image_util/txt2mask.py b/invokeai/backend/image_util/txt2mask.py
index 12db54b0db..de0c6a1652 100644
--- a/invokeai/backend/image_util/txt2mask.py
+++ b/invokeai/backend/image_util/txt2mask.py
@@ -41,18 +41,18 @@ config = InvokeAIAppConfig.get_config()
 
 
 class SegmentedGrayscale(object):
-    def __init__(self, image: Image, heatmap: torch.Tensor):
+    def __init__(self, image: Image.Image, heatmap: torch.Tensor):
         self.heatmap = heatmap
         self.image = image
 
-    def to_grayscale(self, invert: bool = False) -> Image:
+    def to_grayscale(self, invert: bool = False) -> Image.Image:
         return self._rescale(Image.fromarray(np.uint8(255 - self.heatmap * 255 if invert else self.heatmap * 255)))
 
-    def to_mask(self, threshold: float = 0.5) -> Image:
+    def to_mask(self, threshold: float = 0.5) -> Image.Image:
         discrete_heatmap = self.heatmap.lt(threshold).int()
         return self._rescale(Image.fromarray(np.uint8(discrete_heatmap * 255), mode="L"))
 
-    def to_transparent(self, invert: bool = False) -> Image:
+    def to_transparent(self, invert: bool = False) -> Image.Image:
         transparent_image = self.image.copy()
         # For img2img, we want the selected regions to be transparent,
         # but to_grayscale() returns the opposite. Thus invert.
@@ -61,7 +61,7 @@ class SegmentedGrayscale(object):
         return transparent_image
 
     # unscales and uncrops the 352x352 heatmap so that it matches the image again
-    def _rescale(self, heatmap: Image) -> Image:
+    def _rescale(self, heatmap: Image.Image) -> Image.Image:
         size = self.image.width if (self.image.width > self.image.height) else self.image.height
         resized_image = heatmap.resize((size, size), resample=Image.Resampling.LANCZOS)
         return resized_image.crop((0, 0, self.image.width, self.image.height))
@@ -82,7 +82,7 @@ class Txt2Mask(object):
         self.model = CLIPSegForImageSegmentation.from_pretrained(CLIPSEG_MODEL, cache_dir=config.cache_dir)
 
     @torch.no_grad()
-    def segment(self, image, prompt: str) -> SegmentedGrayscale:
+    def segment(self, image: Image.Image, prompt: str) -> SegmentedGrayscale:
         """
         Given a prompt string such as "a bagel", tries to identify the object in the
         provided image and returns a SegmentedGrayscale object in which the brighter
@@ -99,7 +99,7 @@ class Txt2Mask(object):
         heatmap = torch.sigmoid(outputs.logits)
         return SegmentedGrayscale(image, heatmap)
 
-    def _scale_and_crop(self, image: Image) -> Image:
+    def _scale_and_crop(self, image: Image.Image) -> Image.Image:
         scaled_image = Image.new("RGB", (CLIPSEG_SIZE, CLIPSEG_SIZE))
         if image.width > image.height:  # width is constraint
             scale = CLIPSEG_SIZE / image.width
diff --git a/invokeai/backend/image_util/util.py b/invokeai/backend/image_util/util.py
index bc7fa01e3b..7eceb9be82 100644
--- a/invokeai/backend/image_util/util.py
+++ b/invokeai/backend/image_util/util.py
@@ -9,7 +9,7 @@ class InitImageResizer:
     def __init__(self, Image):
         self.image = Image
 
-    def resize(self, width=None, height=None) -> Image:
+    def resize(self, width=None, height=None) -> Image.Image:
         """
         Return a copy of the image resized to fit within
         a box width x height. The aspect ratio is
diff --git a/invokeai/backend/install/invokeai_configure.py b/invokeai/backend/install/invokeai_configure.py
index 5afbdfb5a3..59cf1260ba 100755
--- a/invokeai/backend/install/invokeai_configure.py
+++ b/invokeai/backend/install/invokeai_configure.py
@@ -662,7 +662,7 @@ def default_ramcache() -> float:
 
 def default_startup_options(init_file: Path) -> Namespace:
     opts = InvokeAIAppConfig.get_config()
-    opts.ram = default_ramcache()
+    opts.ram = opts.ram or default_ramcache()
     return opts
 
 
@@ -793,7 +793,11 @@ def migrate_init_file(legacy_format: Path):
     old = legacy_parser.parse_args([f"@{str(legacy_format)}"])
     new = InvokeAIAppConfig.get_config()
 
-    fields = [x for x, y in InvokeAIAppConfig.__fields__.items() if y.field_info.extra.get("category") != "DEPRECATED"]
+    fields = [
+        x
+        for x, y in InvokeAIAppConfig.model_fields.items()
+        if (y.json_schema_extra.get("category", None) if y.json_schema_extra else None) != "DEPRECATED"
+    ]
     for attr in fields:
         if hasattr(old, attr):
             try:
diff --git a/invokeai/backend/install/model_install_backend.py b/invokeai/backend/install/model_install_backend.py
index 1481300c77..9224f5c8b2 100644
--- a/invokeai/backend/install/model_install_backend.py
+++ b/invokeai/backend/install/model_install_backend.py
@@ -236,9 +236,16 @@ class ModelInstall(object):
         if not models_installed:
             models_installed = dict()
 
+        model_path_id_or_url = str(model_path_id_or_url).strip("\"' ")
+
         # A little hack to allow nested routines to retrieve info on the requested ID
         self.current_id = model_path_id_or_url
         path = Path(model_path_id_or_url)
+
+        # fix relative paths
+        if path.exists() and not path.is_absolute():
+            path = path.absolute()  # make relative to current WD
+
         # checkpoint file, or similar
         if path.is_file():
             models_installed.update({str(path): self._install_path(path)})
diff --git a/invokeai/backend/model_management/memory_snapshot.py b/invokeai/backend/model_management/memory_snapshot.py
index 4f43affcf7..01f1328114 100644
--- a/invokeai/backend/model_management/memory_snapshot.py
+++ b/invokeai/backend/model_management/memory_snapshot.py
@@ -55,8 +55,10 @@ class MemorySnapshot:
 
         try:
             malloc_info = LibcUtil().mallinfo2()
-        except OSError:
-            # This is expected in environments that do not have the 'libc.so.6' shared library.
+        except (OSError, AttributeError):
+            # OSError: This is expected in environments that do not have the 'libc.so.6' shared library.
+            # AttributeError: This is expected in environments that have `libc.so.6` but do not have the `mallinfo2` (e.g. glibc < 2.33)
+            # TODO: Does `mallinfo` work?
             malloc_info = None
 
         return cls(process_ram, vram, malloc_info)
diff --git a/invokeai/backend/model_management/model_cache.py b/invokeai/backend/model_management/model_cache.py
index 9cf3852449..2a6079b2c4 100644
--- a/invokeai/backend/model_management/model_cache.py
+++ b/invokeai/backend/model_management/model_cache.py
@@ -238,11 +238,8 @@ class ModelCache(object):
                 f"{get_pretty_snapshot_diff(snapshot_before, snapshot_after)}"
             )
 
-            # We only log a warning for over-reported (not under-reported) model sizes before load. There is a known
-            # issue where models report their fp32 size before load, and are then loaded as fp16. Once this issue is
-            # addressed, it would make sense to log a warning for both over-reported and under-reported model sizes.
-            if (self_reported_model_size_after_load - self_reported_model_size_before_load) > 10 * MB:
-                self.logger.warning(
+            if abs(self_reported_model_size_after_load - self_reported_model_size_before_load) > 10 * MB:
+                self.logger.debug(
                     f"Model '{key}' mis-reported its size before load. Self-reported size before/after load:"
                     f" {(self_reported_model_size_before_load/GIG):.2f}GB /"
                     f" {(self_reported_model_size_after_load/GIG):.2f}GB."
@@ -299,7 +296,7 @@ class ModelCache(object):
                 rel_tol=0.1,
                 abs_tol=10 * MB,
             ):
-                self.logger.warning(
+                self.logger.debug(
                     f"Moving model '{key}' from {source_device} to"
                     f" {target_device} caused an unexpected change in VRAM usage. The model's"
                     " estimated size may be incorrect. Estimated model size:"
diff --git a/invokeai/backend/model_management/model_manager.py b/invokeai/backend/model_management/model_manager.py
index 7bb188cb4e..38a7361c85 100644
--- a/invokeai/backend/model_management/model_manager.py
+++ b/invokeai/backend/model_management/model_manager.py
@@ -236,13 +236,13 @@ import types
 from dataclasses import dataclass
 from pathlib import Path
 from shutil import move, rmtree
-from typing import Callable, Dict, List, Literal, Optional, Set, Tuple, Union
+from typing import Callable, Dict, List, Literal, Optional, Set, Tuple, Union, cast
 
 import torch
 import yaml
 from omegaconf import OmegaConf
 from omegaconf.dictconfig import DictConfig
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, ConfigDict, Field
 
 import invokeai.backend.util.logging as logger
 from invokeai.app.services.config import InvokeAIAppConfig
@@ -294,6 +294,8 @@ class AddModelResult(BaseModel):
     base_model: BaseModelType = Field(description="The base model")
     config: ModelConfigBase = Field(description="The configuration of the model")
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 MAX_CACHE_SIZE = 6.0  # GB
 
@@ -576,7 +578,7 @@ class ModelManager(object):
         """
         model_key = self.create_key(model_name, base_model, model_type)
         if model_key in self.models:
-            return self.models[model_key].dict(exclude_defaults=True)
+            return self.models[model_key].model_dump(exclude_defaults=True)
         else:
             return None  # TODO: None or empty dict on not found
 
@@ -632,7 +634,7 @@ class ModelManager(object):
                 continue
 
             model_dict = dict(
-                **model_config.dict(exclude_defaults=True),
+                **model_config.model_dump(exclude_defaults=True),
                 # OpenAPIModelInfoBase
                 model_name=cur_model_name,
                 base_model=cur_base_model,
@@ -900,14 +902,16 @@ class ModelManager(object):
         Write current configuration out to the indicated file.
         """
         data_to_save = dict()
-        data_to_save["__metadata__"] = self.config_meta.dict()
+        data_to_save["__metadata__"] = self.config_meta.model_dump()
 
         for model_key, model_config in self.models.items():
             model_name, base_model, model_type = self.parse_key(model_key)
             model_class = self._get_implementation(base_model, model_type)
             if model_class.save_to_config:
                 # TODO: or exclude_unset better fits here?
-                data_to_save[model_key] = model_config.dict(exclude_defaults=True, exclude={"error"})
+                data_to_save[model_key] = cast(BaseModel, model_config).model_dump(
+                    exclude_defaults=True, exclude={"error"}, mode="json"
+                )
                 # alias for config file
                 data_to_save[model_key]["format"] = data_to_save[model_key].pop("model_format")
 
@@ -986,6 +990,8 @@ class ModelManager(object):
 
                     for model_path in models_dir.iterdir():
                         if model_path not in loaded_files:  # TODO: check
+                            if model_path.name.startswith("."):
+                                continue
                             model_name = model_path.name if model_path.is_dir() else model_path.stem
                             model_key = self.create_key(model_name, cur_base_model, cur_model_type)
 
diff --git a/invokeai/backend/model_management/models/__init__.py b/invokeai/backend/model_management/models/__init__.py
index bf4b208395..0afd731032 100644
--- a/invokeai/backend/model_management/models/__init__.py
+++ b/invokeai/backend/model_management/models/__init__.py
@@ -2,7 +2,7 @@ import inspect
 from enum import Enum
 from typing import Literal, get_origin
 
-from pydantic import BaseModel
+from pydantic import BaseModel, ConfigDict, create_model
 
 from .base import (  # noqa: F401
     BaseModelType,
@@ -106,6 +106,8 @@ class OpenAPIModelInfoBase(BaseModel):
     base_model: BaseModelType
     model_type: ModelType
 
+    model_config = ConfigDict(protected_namespaces=())
+
 
 for base_model, models in MODEL_CLASSES.items():
     for model_type, model_class in models.items():
@@ -121,17 +123,11 @@ for base_model, models in MODEL_CLASSES.items():
             if openapi_cfg_name in vars():
                 continue
 
-            api_wrapper = type(
+            api_wrapper = create_model(
                 openapi_cfg_name,
-                (cfg, OpenAPIModelInfoBase),
-                dict(
-                    __annotations__=dict(
-                        model_type=Literal[model_type.value],
-                    ),
-                ),
+                __base__=(cfg, OpenAPIModelInfoBase),
+                model_type=(Literal[model_type], model_type),  # type: ignore
             )
-
-            # globals()[openapi_cfg_name] = api_wrapper
             vars()[openapi_cfg_name] = api_wrapper
             OPENAPI_MODEL_CONFIGS.append(api_wrapper)
 
diff --git a/invokeai/backend/model_management/models/base.py b/invokeai/backend/model_management/models/base.py
index 6e507735d4..f735e37189 100644
--- a/invokeai/backend/model_management/models/base.py
+++ b/invokeai/backend/model_management/models/base.py
@@ -19,7 +19,7 @@ from diffusers import logging as diffusers_logging
 from onnx import numpy_helper
 from onnxruntime import InferenceSession, SessionOptions, get_available_providers
 from picklescan.scanner import scan_file_path
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, ConfigDict, Field
 from transformers import logging as transformers_logging
 
 
@@ -86,14 +86,21 @@ class ModelError(str, Enum):
     NotFound = "not_found"
 
 
+def model_config_json_schema_extra(schema: dict[str, Any]) -> None:
+    if "required" not in schema:
+        schema["required"] = []
+    schema["required"].append("model_type")
+
+
 class ModelConfigBase(BaseModel):
     path: str  # or Path
     description: Optional[str] = Field(None)
     model_format: Optional[str] = Field(None)
     error: Optional[ModelError] = Field(None)
 
-    class Config:
-        use_enum_values = True
+    model_config = ConfigDict(
+        use_enum_values=True, protected_namespaces=(), json_schema_extra=model_config_json_schema_extra
+    )
 
 
 class EmptyConfigLoader(ConfigMixin):
diff --git a/invokeai/backend/model_management/models/ip_adapter.py b/invokeai/backend/model_management/models/ip_adapter.py
index 63694af0c8..c60edd0abe 100644
--- a/invokeai/backend/model_management/models/ip_adapter.py
+++ b/invokeai/backend/model_management/models/ip_adapter.py
@@ -58,14 +58,16 @@ class IPAdapterModel(ModelBase):
 
     def get_model(
         self,
-        torch_dtype: Optional[torch.dtype],
+        torch_dtype: torch.dtype,
         child_type: Optional[SubModelType] = None,
     ) -> typing.Union[IPAdapter, IPAdapterPlus]:
         if child_type is not None:
             raise ValueError("There are no child models in an IP-Adapter model.")
 
         model = build_ip_adapter(
-            ip_adapter_ckpt_path=os.path.join(self.model_path, "ip_adapter.bin"), device="cpu", dtype=torch_dtype
+            ip_adapter_ckpt_path=os.path.join(self.model_path, "ip_adapter.bin"),
+            device=torch.device("cpu"),
+            dtype=torch_dtype,
         )
 
         self.model_size = model.calc_size()
diff --git a/invokeai/backend/model_management/seamless.py b/invokeai/backend/model_management/seamless.py
index 7138f2e123..bfdf9e0c53 100644
--- a/invokeai/backend/model_management/seamless.py
+++ b/invokeai/backend/model_management/seamless.py
@@ -96,7 +96,7 @@ def set_seamless(model: Union[UNet2DConditionModel, AutoencoderKL], seamless_axe
     finally:
         for module, orig_conv_forward in to_restore:
             module._conv_forward = orig_conv_forward
-            if hasattr(m, "asymmetric_padding_mode"):
-                del m.asymmetric_padding_mode
-            if hasattr(m, "asymmetric_padding"):
-                del m.asymmetric_padding
+            if hasattr(module, "asymmetric_padding_mode"):
+                del module.asymmetric_padding_mode
+            if hasattr(module, "asymmetric_padding"):
+                del module.asymmetric_padding
diff --git a/invokeai/backend/stable_diffusion/diffusion/cross_attention_map_saving.py b/invokeai/backend/stable_diffusion/diffusion/cross_attention_map_saving.py
index abef979b1c..b5ea40185a 100644
--- a/invokeai/backend/stable_diffusion/diffusion/cross_attention_map_saving.py
+++ b/invokeai/backend/stable_diffusion/diffusion/cross_attention_map_saving.py
@@ -1,7 +1,8 @@
 import math
+from typing import Optional
 
-import PIL
 import torch
+from PIL import Image
 from torchvision.transforms.functional import InterpolationMode
 from torchvision.transforms.functional import resize as tv_resize
 
@@ -11,7 +12,7 @@ class AttentionMapSaver:
         self.token_ids = token_ids
         self.latents_shape = latents_shape
         # self.collated_maps = #torch.zeros([len(token_ids), latents_shape[0], latents_shape[1]])
-        self.collated_maps = {}
+        self.collated_maps: dict[str, torch.Tensor] = {}
 
     def clear_maps(self):
         self.collated_maps = {}
@@ -38,9 +39,10 @@ class AttentionMapSaver:
 
     def write_maps_to_disk(self, path: str):
         pil_image = self.get_stacked_maps_image()
-        pil_image.save(path, "PNG")
+        if pil_image is not None:
+            pil_image.save(path, "PNG")
 
-    def get_stacked_maps_image(self) -> PIL.Image:
+    def get_stacked_maps_image(self) -> Optional[Image.Image]:
         """
         Scale all collected attention maps to the same size, blend them together and return as an image.
         :return: An image containing a vertical stack of blended attention maps, one for each requested token.
@@ -95,4 +97,4 @@ class AttentionMapSaver:
             return None
 
         merged_bytes = merged.mul(0xFF).byte()
-        return PIL.Image.fromarray(merged_bytes.numpy(), mode="L")
+        return Image.fromarray(merged_bytes.numpy(), mode="L")
diff --git a/invokeai/backend/util/test_utils.py b/invokeai/backend/util/test_utils.py
index 1c7b538882..09b9de9e98 100644
--- a/invokeai/backend/util/test_utils.py
+++ b/invokeai/backend/util/test_utils.py
@@ -5,7 +5,7 @@ from typing import Optional, Union
 import pytest
 import torch
 
-from invokeai.app.services.config.invokeai_config import InvokeAIAppConfig
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
 from invokeai.backend.install.model_install_backend import ModelInstall
 from invokeai.backend.model_management.model_manager import ModelInfo
 from invokeai.backend.model_management.models.base import BaseModelType, ModelNotFoundException, ModelType, SubModelType
diff --git a/invokeai/frontend/install/model_install.py b/invokeai/frontend/install/model_install.py
index 1fb3b61891..0ea2570b2b 100644
--- a/invokeai/frontend/install/model_install.py
+++ b/invokeai/frontend/install/model_install.py
@@ -20,6 +20,7 @@ from multiprocessing import Process
 from multiprocessing.connection import Connection, Pipe
 from pathlib import Path
 from shutil import get_terminal_size
+from typing import Optional
 
 import npyscreen
 import torch
@@ -630,21 +631,23 @@ def ask_user_for_prediction_type(model_path: Path, tui_conn: Connection = None)
         return _ask_user_for_pt_cmdline(model_path)
 
 
-def _ask_user_for_pt_cmdline(model_path: Path) -> SchedulerPredictionType:
+def _ask_user_for_pt_cmdline(model_path: Path) -> Optional[SchedulerPredictionType]:
     choices = [SchedulerPredictionType.Epsilon, SchedulerPredictionType.VPrediction, None]
     print(
         f"""
-Please select the type of the V2 checkpoint named {model_path.name}:
-[1] A model based on Stable Diffusion v2 trained on 512 pixel images (SD-2-base)
-[2] A model based on Stable Diffusion v2 trained on 768 pixel images (SD-2-768)
-[3] Skip this model and come back later.
+Please select the scheduler prediction type of the checkpoint named {model_path.name}:
+[1] "epsilon" - most v1.5 models and v2 models trained on 512 pixel images
+[2] "vprediction" - v2 models trained on 768 pixel images and a few v1.5 models
+[3] Accept the best guess;  you can fix it in the Web UI later
 """
     )
     choice = None
     ok = False
     while not ok:
         try:
-            choice = input("select> ").strip()
+            choice = input("select [3]> ").strip()
+            if not choice:
+                return None
             choice = choices[int(choice) - 1]
             ok = True
         except (ValueError, IndexError):
@@ -655,22 +658,18 @@ Please select the type of the V2 checkpoint named {model_path.name}:
 
 
 def _ask_user_for_pt_tui(model_path: Path, tui_conn: Connection) -> SchedulerPredictionType:
-    try:
-        tui_conn.send_bytes(f"*need v2 config for:{model_path}".encode("utf-8"))
-        # note that we don't do any status checking here
-        response = tui_conn.recv_bytes().decode("utf-8")
-        if response is None:
-            return None
-        elif response == "epsilon":
-            return SchedulerPredictionType.epsilon
-        elif response == "v":
-            return SchedulerPredictionType.VPrediction
-        elif response == "abort":
-            logger.info("Conversion aborted")
-            return None
-        else:
-            return response
-    except Exception:
+    tui_conn.send_bytes(f"*need v2 config for:{model_path}".encode("utf-8"))
+    # note that we don't do any status checking here
+    response = tui_conn.recv_bytes().decode("utf-8")
+    if response is None:
+        return None
+    elif response == "epsilon":
+        return SchedulerPredictionType.epsilon
+    elif response == "v":
+        return SchedulerPredictionType.VPrediction
+    elif response == "guess":
+        return None
+    else:
         return None
 
 
diff --git a/invokeai/frontend/install/widgets.py b/invokeai/frontend/install/widgets.py
index 06d5473fa3..4a37aba9b8 100644
--- a/invokeai/frontend/install/widgets.py
+++ b/invokeai/frontend/install/widgets.py
@@ -381,12 +381,12 @@ def select_stable_diffusion_config_file(
     wrap: bool = True,
     model_name: str = "Unknown",
 ):
-    message = f"Please select the correct base model for the V2 checkpoint named '{model_name}'. Press <CANCEL> to skip installation."
+    message = f"Please select the correct prediction type for the checkpoint named '{model_name}'. Press <CANCEL> to skip installation."
     title = "CONFIG FILE SELECTION"
     options = [
-        "An SD v2.x base model (512 pixels; no 'parameterization:' line in its yaml file)",
-        "An SD v2.x v-predictive model (768 pixels; 'parameterization: \"v\"' line in its yaml file)",
-        "Skip installation for now and come back later",
+        "'epsilon' - most v1.5 models and v2 models trained on 512 pixel images",
+        "'vprediction' - v2 models trained on 768 pixel images and a few v1.5 models)",
+        "Accept the best guess; you can fix it in the Web UI later",
     ]
 
     F = ConfirmCancelPopup(
@@ -410,7 +410,7 @@ def select_stable_diffusion_config_file(
     choice = F.add(
         npyscreen.SelectOne,
         values=options,
-        value=[0],
+        value=[2],
         max_height=len(options) + 1,
         scroll_exit=True,
     )
@@ -420,5 +420,5 @@ def select_stable_diffusion_config_file(
     if not F.value:
         return None
     assert choice.value[0] in range(0, 3), "invalid choice"
-    choices = ["epsilon", "v", "abort"]
+    choices = ["epsilon", "v", "guess"]
     return choices[choice.value[0]]
diff --git a/invokeai/frontend/web/.prettierignore b/invokeai/frontend/web/.prettierignore
index 0c18899000..bdf02d5c9e 100644
--- a/invokeai/frontend/web/.prettierignore
+++ b/invokeai/frontend/web/.prettierignore
@@ -1,4 +1,5 @@
 dist/
+public/locales/*.json
 .husky/
 node_modules/
 patches/
diff --git a/invokeai/frontend/web/dist/assets/App-6a1ad010.js b/invokeai/frontend/web/dist/assets/App-6a1ad010.js
deleted file mode 100644
index 6b8d14f198..0000000000
--- a/invokeai/frontend/web/dist/assets/App-6a1ad010.js
+++ /dev/null
@@ -1,169 +0,0 @@
-import{a as Dc,b as U_,S as G_,c as K_,d as q_,e as o1,f as X_,i as s1,g as gR,h as vR,j as xR,k as bR,l as Q_,m as yR,n as JC,o as Y_,t as CR,p as wR,q as SR,r as kR,s as jR,u as d,v as a,w as $x,x as qp,y as _R,z as IR,A as PR,B as ER,P as MR,C as Lx,D as OR,E as RR,F as DR,G as AR,H as Z_,I as je,J as Nn,K as TR,L as NR,M as $R,N as Wt,O as we,Q as Ye,R as dn,T as He,U as vd,V as dr,W as In,X as Un,Y as on,Z as fa,_ as oi,$ as dt,a0 as Co,a1 as rc,a2 as pa,a3 as ma,a4 as ph,a5 as zx,a6 as xd,a7 as mn,a8 as LR,a9 as H,aa as ew,ab as zR,ac as J_,ad as a1,ae as bd,af as Ac,ag as FR,ah as eI,ai as tI,aj as nI,ak as Ho,al as BR,am as le,an as xe,ao as Bt,ap as W,aq as HR,ar as tw,as as VR,at as WR,au as UR,av as si,aw as te,ax as GR,ay as ct,az as Qt,aA as Ie,aB as L,aC as cr,aD as Jn,aE as Se,aF as Z,aG as rI,aH as KR,aI as qR,aJ as XR,aK as QR,aL as qr,aM as Fx,aN as ha,aO as Nr,aP as yd,aQ as YR,aR as ZR,aS as nw,aT as Bx,aU as ve,aV as Xr,aW as JR,aX as oI,aY as sI,aZ as rw,a_ as eD,a$ as tD,b0 as nD,b1 as ga,b2 as Hx,b3 as yt,b4 as rD,b5 as oD,b6 as aI,b7 as iI,b8 as mh,b9 as sD,ba as ow,bb as lI,bc as aD,bd as iD,be as lD,bf as cD,bg as uD,bh as dD,bi as fD,bj as cI,bk as pD,bl as mD,bm as hD,bn as gD,bo as vD,bp as va,bq as vc,br as xD,bs as $r,bt as bD,bu as yD,bv as CD,bw as sw,bx as wD,by as SD,bz as Zs,bA as hh,bB as Vx,bC as Wx,bD as to,bE as uI,bF as kD,bG as Bi,bH as Mu,bI as aw,bJ as jD,bK as _D,bL as ID,bM as qf,bN as Xf,bO as bu,bP as Q0,bQ as Nu,bR as $u,bS as Lu,bT as zu,bU as iw,bV as Xp,bW as Y0,bX as Qp,bY as lw,bZ as i1,b_ as Z0,b$ as l1,c0 as J0,c1 as Yp,c2 as cw,c3 as Hi,c4 as uw,c5 as Vi,c6 as dw,c7 as Zp,c8 as Cd,c9 as PD,ca as dI,cb as fw,cc as gh,cd as ED,ce as c1,cf as pw,cg as Fr,ch as Ta,ci as mw,cj as Ux,ck as MD,cl as OD,cm as ev,cn as hw,co as u1,cp as vh,cq as RD,cr as fI,cs as d1,ct as f1,cu as pI,cv as DD,cw as p1,cx as AD,cy as m1,cz as TD,cA as h1,cB as ND,cC as $D,cD as LD,cE as Gx,cF as Kx,cG as qx,cH as Xx,cI as Qx,cJ as xh,cK as Yx,cL as Xs,cM as mI,cN as hI,cO as Zx,cP as gI,cQ as zD,cR as yu,cS as sa,cT as vI,cU as xI,cV as gw,cW as Jx,cX as bI,cY as eb,cZ as tb,c_ as yI,c$ as On,d0 as FD,d1 as Rn,d2 as bh,d3 as nb,d4 as CI,d5 as wI,d6 as BD,d7 as HD,d8 as VD,d9 as WD,da as UD,db as GD,dc as KD,dd as qD,de as XD,df as QD,dg as vw,dh as rb,di as YD,dj as ZD,dk as wd,dl as JD,dm as eA,dn as yh,dp as tA,dq as nA,dr as rA,ds as oA,dt as an,du as sA,dv as aA,dw as iA,dx as lA,dy as cA,dz as uA,dA as Ku,dB as xw,dC as Xo,dD as SI,dE as dA,dF as ob,dG as fA,dH as bw,dI as pA,dJ as mA,dK as hA,dL as kI,dM as gA,dN as vA,dO as xA,dP as bA,dQ as yA,dR as CA,dS as wA,dT as jI,dU as SA,dV as kA,dW as yw,dX as jA,dY as _A,dZ as IA,d_ as PA,d$ as EA,e0 as MA,e1 as OA,e2 as _I,e3 as RA,e4 as DA,e5 as AA,e6 as Cw,e7 as Qf,e8 as II,e9 as TA,ea as NA,eb as $A,ec as LA,ed as zA,ee as Vo,ef as FA,eg as BA,eh as HA,ei as VA,ej as WA,ek as UA,el as GA,em as KA,en as qA,eo as XA,ep as QA,eq as YA,er as ZA,es as JA,et as eT,eu as tT,ev as ww,ew as nT,ex as rT,ey as oT,ez as sT,eA as aT,eB as iT,eC as lT,eD as Sw,eE as kw,eF as PI,eG as cT,eH as zo,eI as qu,eJ as wr,eK as uT,eL as dT,eM as EI,eN as MI,eO as fT,eP as jw,eQ as pT,eR as _w,eS as Iw,eT as Pw,eU as mT,eV as hT,eW as Ew,eX as Mw,eY as gT,eZ as vT,e_ as Jp,e$ as xT,f0 as Ow,f1 as Rw,f2 as bT,f3 as yT,f4 as CT,f5 as OI,f6 as wT,f7 as ST,f8 as RI,f9 as kT,fa as jT,fb as Dw,fc as _T,fd as Aw,fe as IT,ff as DI,fg as AI,fh as Sd,fi as TI,fj as Ei,fk as NI,fl as Tw,fm as PT,fn as ET,fo as $I,fp as MT,fq as OT,fr as RT,fs as DT,ft as AT,fu as sb,fv as g1,fw as Nw,fx as tl,fy as TT,fz as NT,fA as $T,fB as LI,fC as ab,fD as zI,fE as ib,fF as FI,fG as LT,fH as Ys,fI as zT,fJ as BI,fK as FT,fL as lb,fM as HI,fN as BT,fO as HT,fP as VT,fQ as WT,fR as UT,fS as GT,fT as KT,fU as em,fV as Ou,fW as Ql,fX as qT,fY as XT,fZ as QT,f_ as YT,f$ as ZT,g0 as JT,g1 as eN,g2 as tN,g3 as $w,g4 as nN,g5 as rN,g6 as oN,g7 as sN,g8 as aN,g9 as iN,ga as Lw,gb as lN,gc as cN,gd as uN,ge as dN,gf as fN,gg as pN,gh as mN,gi as zw,gj as hN,gk as gN,gl as vN,gm as xN,gn as bN,go as yN,gp as CN,gq as wN,gr as SN,gs as kN,gt as jN,gu as _N,gv as IN,gw as PN,gx as kd,gy as EN,gz as MN,gA as ON,gB as RN,gC as DN,gD as AN,gE as TN,gF as NN,gG as Fw,gH as Tp,gI as $N,gJ as tm,gK as VI,gL as nm,gM as LN,gN as zN,gO as oc,gP as WI,gQ as UI,gR as cb,gS as FN,gT as BN,gU as HN,gV as v1,gW as GI,gX as VN,gY as WN,gZ as KI,g_ as UN,g$ as GN,h0 as KN,h1 as qN,h2 as XN,h3 as Bw,h4 as Ml,h5 as QN,h6 as YN,h7 as ZN,h8 as JN,h9 as e9,ha as t9,hb as Hw,hc as n9,hd as r9,he as o9,hf as s9,hg as a9,hh as i9,hi as l9,hj as c9,hk as tv,hl as nv,hm as rv,hn as Yf,ho as Vw,hp as x1,hq as Ww,hr as u9,hs as d9,ht as f9,hu as p9,hv as qI,hw as m9,hx as h9,hy as g9,hz as v9,hA as x9,hB as b9,hC as y9,hD as C9,hE as w9,hF as S9,hG as k9,hH as Zf,hI as ov,hJ as j9,hK as _9,hL as I9,hM as P9,hN as E9,hO as M9,hP as O9,hQ as R9,hR as D9,hS as A9,hT as Uw,hU as Gw,hV as T9,hW as N9,hX as $9,hY as L9,hZ as z9}from"./index-a24a7159.js";import{u as XI,a as xa,b as F9,r as Re,f as B9,g as Kw,c as mt,d as Dn}from"./MantineProvider-2b56c833.js";var H9=200;function V9(e,t,n,r){var o=-1,s=K_,i=!0,l=e.length,u=[],p=t.length;if(!l)return u;n&&(t=Dc(t,U_(n))),r?(s=q_,i=!1):t.length>=H9&&(s=o1,i=!1,t=new G_(t));e:for(;++o<l;){var m=e[o],h=n==null?m:n(m);if(m=r||m!==0?m:0,i&&h===h){for(var g=p;g--;)if(t[g]===h)continue e;u.push(m)}else s(t,h,r)||u.push(m)}return u}var W9=X_(function(e,t){return s1(e)?V9(e,gR(t,1,s1,!0)):[]});const U9=W9;function G9(e,t){var n=-1,r=vR(e)?Array(e.length):[];return xR(e,function(o,s,i){r[++n]=t(o,s,i)}),r}function nr(e,t){var n=bR(e)?Dc:G9;return n(e,Q_(t))}function K9(e,t){return Dc(t,function(n){return e[n]})}function q9(e){return e==null?[]:K9(e,yR(e))}var X9=Math.min;function Q9(e,t,n){for(var r=n?q_:K_,o=e[0].length,s=e.length,i=s,l=Array(s),u=1/0,p=[];i--;){var m=e[i];i&&t&&(m=Dc(m,U_(t))),u=X9(m.length,u),l[i]=!n&&(t||o>=120&&m.length>=120)?new G_(i&&m):void 0}m=e[0];var h=-1,g=l[0];e:for(;++h<o&&p.length<u;){var x=m[h],y=t?t(x):x;if(x=n||x!==0?x:0,!(g?o1(g,y):r(p,y,n))){for(i=s;--i;){var b=l[i];if(!(b?o1(b,y):r(e[i],y,n)))continue e}g&&g.push(y),p.push(x)}}return p}function Y9(e){return s1(e)?e:[]}var Z9=X_(function(e){var t=Dc(e,Y9);return t.length&&t[0]===e[0]?Q9(t):[]});const J9=Z9;function e$(e){return e==null}function t$(e,t,n,r){if(!JC(e))return e;t=Y_(t,e);for(var o=-1,s=t.length,i=s-1,l=e;l!=null&&++o<s;){var u=CR(t[o]),p=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(o!=i){var m=l[u];p=r?r(m,u,l):void 0,p===void 0&&(p=JC(m)?m:wR(t[o+1])?[]:{})}SR(l,u,p),l=l[u]}return e}function n$(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var i=t[r],l=kR(e,i);n(l,i)&&t$(s,Y_(i,e),l)}return s}function qw(e,t){if(e==null)return{};var n=Dc(jR(e),function(r){return[r]});return t=Q_(t),n$(e,n,function(r,o){return t(r,o[0])})}function r$(e,t,n){let r=new Set([...t,void 0]);return e.listen((o,s)=>{r.has(s)&&n(o,s)})}function o$(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const QI=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:l,strokeWidth:u,className:p,borderRadius:m,shapeRendering:h,onClick:g,selected:x})=>{const{background:y,backgroundColor:b}=s||{},w=i||y||b;return a.jsx("rect",{className:$x(["react-flow__minimap-node",{selected:x},p]),x:t,y:n,rx:m,ry:m,width:r,height:o,fill:w,stroke:l,strokeWidth:u,shapeRendering:h,onClick:g?S=>g(S,e):void 0})};QI.displayName="MiniMapNode";var s$=d.memo(QI);const a$=e=>e.nodeOrigin,i$=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),sv=e=>e instanceof Function?e:()=>e;function l$({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=s$,onClick:i}){const l=qp(i$,Lx),u=qp(a$),p=sv(t),m=sv(e),h=sv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(x=>{const{x:y,y:b}=_R(x,u).positionAbsolute;return a.jsx(s,{x:y,y:b,width:x.width,height:x.height,style:x.style,selected:x.selected,className:h(x),color:p(x),borderRadius:r,strokeColor:m(x),strokeWidth:o,shapeRendering:g,onClick:i,id:x.id},x.id)})})}var c$=d.memo(l$);const u$=200,d$=150,f$=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?DR(AR(t,e.nodeOrigin),n):n,rfId:e.rfId}},p$="react-flow__minimap-desc";function YI({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:l,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:m=1,position:h="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:b=!1,ariaLabel:w="React Flow mini map",inversePan:S=!1,zoomStep:j=10,offsetScale:_=5}){const E=IR(),I=d.useRef(null),{boundingRect:M,viewBB:R,rfId:D}=qp(f$,Lx),A=(e==null?void 0:e.width)??u$,O=(e==null?void 0:e.height)??d$,T=M.width/A,X=M.height/O,B=Math.max(T,X),V=B*A,U=B*O,N=_*B,$=M.x-(V-M.width)/2-N,q=M.y-(U-M.height)/2-N,F=V+N*2,Q=U+N*2,Y=`${p$}-${D}`,se=d.useRef(0);se.current=B,d.useEffect(()=>{if(I.current){const G=PR(I.current),K=J=>{const{transform:ie,d3Selection:de,d3Zoom:ge}=E.getState();if(J.sourceEvent.type!=="wheel"||!de||!ge)return;const Ce=-J.sourceEvent.deltaY*(J.sourceEvent.deltaMode===1?.05:J.sourceEvent.deltaMode?1:.002)*j,he=ie[2]*Math.pow(2,Ce);ge.scaleTo(de,he)},ee=J=>{const{transform:ie,d3Selection:de,d3Zoom:ge,translateExtent:Ce,width:he,height:fe}=E.getState();if(J.sourceEvent.type!=="mousemove"||!de||!ge)return;const Oe=se.current*Math.max(1,ie[2])*(S?-1:1),_e={x:ie[0]-J.sourceEvent.movementX*Oe,y:ie[1]-J.sourceEvent.movementY*Oe},Ne=[[0,0],[he,fe]],nt=OR.translate(_e.x,_e.y).scale(ie[2]),$e=ge.constrain()(nt,Ne,Ce);ge.transform(de,$e)},ce=ER().on("zoom",y?ee:null).on("zoom.wheel",b?K:null);return G.call(ce),()=>{G.on("zoom",null)}}},[y,b,S,j]);const ae=g?G=>{const K=RR(G);g(G,{x:K[0],y:K[1]})}:void 0,re=x?(G,K)=>{const ee=E.getState().nodeInternals.get(K);x(G,ee)}:void 0;return a.jsx(MR,{position:h,style:e,className:$x(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:O,viewBox:`${$} ${q} ${F} ${Q}`,role:"img","aria-labelledby":Y,ref:I,onClick:ae,children:[w&&a.jsx("title",{id:Y,children:w}),a.jsx(c$,{onClick:re,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${$-N},${q-N}h${F+N*2}v${Q+N*2}h${-F-N*2}z
-        M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fill:u,fillRule:"evenodd",stroke:p,strokeWidth:m,pointerEvents:"none"})]})})}YI.displayName="MiniMap";var m$=d.memo(YI),Wo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Wo||(Wo={}));function h$({color:e,dimensions:t,lineWidth:n}){return a.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function g$({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const v$={[Wo.Dots]:"#91919a",[Wo.Lines]:"#eee",[Wo.Cross]:"#e2e2e2"},x$={[Wo.Dots]:1,[Wo.Lines]:1,[Wo.Cross]:6},b$=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ZI({id:e,variant:t=Wo.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:l,className:u}){const p=d.useRef(null),{transform:m,patternId:h}=qp(b$,Lx),g=i||v$[t],x=r||x$[t],y=t===Wo.Dots,b=t===Wo.Cross,w=Array.isArray(n)?n:[n,n],S=[w[0]*m[2]||1,w[1]*m[2]||1],j=x*m[2],_=b?[j,j]:S,E=y?[j/s,j/s]:[_[0]/s,_[1]/s];return a.jsxs("svg",{className:$x(["react-flow__background",u]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background",children:[a.jsx("pattern",{id:h+e,x:m[0]%S[0],y:m[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:y?a.jsx(g$,{color:g,radius:j/s}):a.jsx(h$,{dimensions:_,color:g,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+e})`})]})}ZI.displayName="Background";var y$=d.memo(ZI);const Xw=(e,t,n)=>{C$(n);const r=Z_(e,t);return JI[n].includes(r)},JI={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Qw=Object.keys(JI),C$=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Qw.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Qw.join("|")}`)};function w$(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var S$=w$();const e5=1/60*1e3,k$=typeof performance<"u"?()=>performance.now():()=>Date.now(),t5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(k$()),e5);function j$(e){let t=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,l={schedule:(u,p=!1,m=!1)=>{const h=m&&o,g=h?t:n;return p&&i.add(u),g.indexOf(u)===-1&&(g.push(u),h&&o&&(r=t.length)),u},cancel:u=>{const p=n.indexOf(u);p!==-1&&n.splice(p,1),i.delete(u)},process:u=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let p=0;p<r;p++){const m=t[p];m(u),i.has(m)&&(l.schedule(m),e())}o=!1,s&&(s=!1,l.process(u))}};return l}const _$=40;let b1=!0,Xu=!1,y1=!1;const sc={delta:0,timestamp:0},jd=["read","update","preRender","render","postRender"],Ch=jd.reduce((e,t)=>(e[t]=j$(()=>Xu=!0),e),{}),I$=jd.reduce((e,t)=>{const n=Ch[t];return e[t]=(r,o=!1,s=!1)=>(Xu||M$(),n.schedule(r,o,s)),e},{}),P$=jd.reduce((e,t)=>(e[t]=Ch[t].cancel,e),{});jd.reduce((e,t)=>(e[t]=()=>Ch[t].process(sc),e),{});const E$=e=>Ch[e].process(sc),n5=e=>{Xu=!1,sc.delta=b1?e5:Math.max(Math.min(e-sc.timestamp,_$),1),sc.timestamp=e,y1=!0,jd.forEach(E$),y1=!1,Xu&&(b1=!1,t5(n5))},M$=()=>{Xu=!0,b1=!0,y1||t5(n5)},Yw=()=>sc;function wh(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=d.Children.toArray(e.path),i=je((l,u)=>a.jsx(Nn,{ref:u,viewBox:t,...o,...l,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}function r5(e){const{theme:t}=TR(),n=NR();return d.useMemo(()=>$R(t.direction,{...n,...e}),[e,t.direction,n])}var O$=Object.defineProperty,R$=(e,t,n)=>t in e?O$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jn=(e,t,n)=>(R$(e,typeof t!="symbol"?t+"":t,n),n);function Zw(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var D$=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Jw(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function eS(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var C1=typeof window<"u"?d.useLayoutEffect:d.useEffect,rm=e=>e,A$=class{constructor(){jn(this,"descendants",new Map),jn(this,"register",e=>{if(e!=null)return D$(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),jn(this,"unregister",e=>{this.descendants.delete(e);const t=Zw(Array.from(this.descendants.keys()));this.assignIndex(t)}),jn(this,"destroy",()=>{this.descendants.clear()}),jn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),jn(this,"count",()=>this.descendants.size),jn(this,"enabledCount",()=>this.enabledValues().length),jn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),jn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),jn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),jn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),jn(this,"first",()=>this.item(0)),jn(this,"firstEnabled",()=>this.enabledItem(0)),jn(this,"last",()=>this.item(this.descendants.size-1)),jn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),jn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),jn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),jn(this,"next",(e,t=!0)=>{const n=Jw(e,this.count(),t);return this.item(n)}),jn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Jw(r,this.enabledCount(),t);return this.enabledItem(o)}),jn(this,"prev",(e,t=!0)=>{const n=eS(e,this.count()-1,t);return this.item(n)}),jn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=eS(r,this.enabledCount()-1,t);return this.enabledItem(o)}),jn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Zw(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function T$(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function It(...e){return t=>{e.forEach(n=>{T$(n,t)})}}function N$(...e){return d.useMemo(()=>It(...e),e)}function $$(){const e=d.useRef(new A$);return C1(()=>()=>e.current.destroy()),e.current}var[L$,o5]=Wt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function z$(e){const t=o5(),[n,r]=d.useState(-1),o=d.useRef(null);C1(()=>()=>{o.current&&t.unregister(o.current)},[]),C1(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=rm(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:It(s,o)}}function ub(){return[rm(L$),()=>rm(o5()),()=>$$(),o=>z$(o)]}var[F$,Sh]=Wt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[B$,db]=Wt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[H$,R1e,V$,W$]=ub(),Bl=je(function(t,n){const{getButtonProps:r}=db(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...Sh().button};return a.jsx(we.button,{...o,className:Ye("chakra-accordion__button",t.className),__css:i})});Bl.displayName="AccordionButton";function _d(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(g,x)=>g!==x}=e,s=dn(r),i=dn(o),[l,u]=d.useState(n),p=t!==void 0,m=p?t:l,h=dn(g=>{const y=typeof g=="function"?g(m):g;i(m,y)&&(p||u(y),s(y))},[p,s,m,i]);return[m,h]}function U$(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;q$(e),X$(e);const l=V$(),[u,p]=d.useState(-1);d.useEffect(()=>()=>{p(-1)},[]);const[m,h]=_d({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:m,setIndex:h,htmlProps:i,getAccordionItemProps:x=>{let y=!1;return x!==null&&(y=Array.isArray(m)?m.includes(x):m===x),{isOpen:y,onChange:w=>{if(x!==null)if(o&&Array.isArray(m)){const S=w?m.concat(x):m.filter(j=>j!==x);h(S)}else w?h(x):s&&h(-1)}}},focusedIndex:u,setFocusedIndex:p,descendants:l}}var[G$,fb]=Wt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function K$(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=fb(),l=d.useRef(null),u=d.useId(),p=r??u,m=`accordion-button-${p}`,h=`accordion-panel-${p}`;Q$(e);const{register:g,index:x,descendants:y}=W$({disabled:t&&!n}),{isOpen:b,onChange:w}=s(x===-1?null:x);Y$({isOpen:b,isDisabled:t});const S=()=>{w==null||w(!0)},j=()=>{w==null||w(!1)},_=d.useCallback(()=>{w==null||w(!b),i(x)},[x,i,b,w]),E=d.useCallback(D=>{const O={ArrowDown:()=>{const T=y.nextEnabled(x);T==null||T.node.focus()},ArrowUp:()=>{const T=y.prevEnabled(x);T==null||T.node.focus()},Home:()=>{const T=y.firstEnabled();T==null||T.node.focus()},End:()=>{const T=y.lastEnabled();T==null||T.node.focus()}}[D.key];O&&(D.preventDefault(),O(D))},[y,x]),I=d.useCallback(()=>{i(x)},[i,x]),M=d.useCallback(function(A={},O=null){return{...A,type:"button",ref:It(g,l,O),id:m,disabled:!!t,"aria-expanded":!!b,"aria-controls":h,onClick:He(A.onClick,_),onFocus:He(A.onFocus,I),onKeyDown:He(A.onKeyDown,E)}},[m,t,b,_,I,E,h,g]),R=d.useCallback(function(A={},O=null){return{...A,ref:O,role:"region",id:h,"aria-labelledby":m,hidden:!b}},[m,b,h]);return{isOpen:b,isDisabled:t,isFocusable:n,onOpen:S,onClose:j,getButtonProps:M,getPanelProps:R,htmlProps:o}}function q$(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;vd({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function X$(e){vd({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Q$(e){vd({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.
-    `})}function Y$(e){vd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Hl(e){const{isOpen:t,isDisabled:n}=db(),{reduceMotion:r}=fb(),o=Ye("chakra-accordion__icon",e.className),s=Sh(),i={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(Nn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:i,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Hl.displayName="AccordionIcon";var Vl=je(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=K$(t),u={...Sh().container,overflowAnchor:"none"},p=d.useMemo(()=>i,[i]);return a.jsx(B$,{value:p,children:a.jsx(we.div,{ref:n,...s,className:Ye("chakra-accordion__item",o),__css:u,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Vl.displayName="AccordionItem";var Yl={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ri={enter:{duration:.2,ease:Yl.easeOut},exit:{duration:.1,ease:Yl.easeIn}},Js={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},Z$=e=>e!=null&&parseInt(e.toString(),10)>0,tS={exit:{height:{duration:.2,ease:Yl.ease},opacity:{duration:.3,ease:Yl.ease}},enter:{height:{duration:.3,ease:Yl.ease},opacity:{duration:.4,ease:Yl.ease}}},J$={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:Z$(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Js.exit(tS.exit,o)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(s=n==null?void 0:n.enter)!=null?s:Js.enter(tS.enter,o)}}},Id=d.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:l,className:u,transition:p,transitionEnd:m,...h}=e,[g,x]=d.useState(!1);d.useEffect(()=>{const j=setTimeout(()=>{x(!0)});return()=>clearTimeout(j)},[]),vd({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const y=parseFloat(s.toString())>0,b={startingHeight:s,endingHeight:i,animateOpacity:o,transition:g?p:{enter:{duration:0}},transitionEnd:{enter:m==null?void 0:m.enter,exit:r?m==null?void 0:m.exit:{...m==null?void 0:m.exit,display:y?"block":"none"}}},w=r?n:!0,S=n||r?"enter":"exit";return a.jsx(dr,{initial:!1,custom:b,children:w&&a.jsx(In.div,{ref:t,...h,className:Ye("chakra-collapse",u),style:{overflow:"hidden",display:"block",...l},custom:b,variants:J$,initial:r?"exit":!1,animate:S,exit:"exit"})})});Id.displayName="Collapse";var eL={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Js.enter(Ri.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Js.exit(Ri.exit,n),transitionEnd:t==null?void 0:t.exit}}},s5={initial:"exit",animate:"enter",exit:"exit",variants:eL},tL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:l,delay:u,...p}=t,m=o||r?"enter":"exit",h=r?o&&r:!0,g={transition:i,transitionEnd:l,delay:u};return a.jsx(dr,{custom:g,children:h&&a.jsx(In.div,{ref:n,className:Ye("chakra-fade",s),custom:g,...s5,animate:m,...p})})});tL.displayName="Fade";var nL={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(s=n==null?void 0:n.exit)!=null?s:Js.exit(Ri.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Js.enter(Ri.enter,n),transitionEnd:e==null?void 0:e.enter}}},a5={initial:"exit",animate:"enter",exit:"exit",variants:nL},rL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:l,transition:u,transitionEnd:p,delay:m,...h}=t,g=r?o&&r:!0,x=o||r?"enter":"exit",y={initialScale:i,reverse:s,transition:u,transitionEnd:p,delay:m};return a.jsx(dr,{custom:y,children:g&&a.jsx(In.div,{ref:n,className:Ye("chakra-offset-slide",l),...a5,animate:x,custom:y,...h})})});rL.displayName="ScaleFade";var oL={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,x:e,y:t,transition:(s=n==null?void 0:n.exit)!=null?s:Js.exit(Ri.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Js.enter(Ri.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var i;const l={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:Js.exit(Ri.exit,s),...o?{...l,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...l,...r==null?void 0:r.exit}}}}},w1={initial:"initial",animate:"enter",exit:"exit",variants:oL},sL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:l=0,offsetY:u=8,transition:p,transitionEnd:m,delay:h,...g}=t,x=r?o&&r:!0,y=o||r?"enter":"exit",b={offsetX:l,offsetY:u,reverse:s,transition:p,transitionEnd:m,delay:h};return a.jsx(dr,{custom:b,children:x&&a.jsx(In.div,{ref:n,className:Ye("chakra-offset-slide",i),custom:b,...w1,animate:y,...g})})});sL.displayName="SlideFade";var Wl=je(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=fb(),{getPanelProps:l,isOpen:u}=db(),p=l(s,n),m=Ye("chakra-accordion__panel",r),h=Sh();i||delete p.hidden;const g=a.jsx(we.div,{...p,__css:h.panel,className:m});return i?g:a.jsx(Id,{in:u,...o,children:g})});Wl.displayName="AccordionPanel";var i5=je(function({children:t,reduceMotion:n,...r},o){const s=Un("Accordion",r),i=on(r),{htmlProps:l,descendants:u,...p}=U$(i),m=d.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(H$,{value:u,children:a.jsx(G$,{value:m,children:a.jsx(F$,{value:s,children:a.jsx(we.div,{ref:o,...l,className:Ye("chakra-accordion",r.className),__css:s.root,children:t})})})})});i5.displayName="Accordion";function kh(e){return d.Children.toArray(e).filter(t=>d.isValidElement(t))}var[aL,iL]=Wt({strict:!1,name:"ButtonGroupContext"}),lL={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},cL={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Vt=je(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:l="0.5rem",isAttached:u,isDisabled:p,orientation:m="horizontal",...h}=t,g=Ye("chakra-button__group",i),x=d.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...u?lL[m]:cL[m](l)};const b=m==="vertical";return a.jsx(aL,{value:x,children:a.jsx(we.div,{ref:n,role:"group",__css:y,className:g,"data-attached":u?"":void 0,"data-orientation":m,flexDir:b?"column":void 0,...h})})});Vt.displayName="ButtonGroup";function uL(e){const[t,n]=d.useState(!e);return{ref:d.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function S1(e){const{children:t,className:n,...r}=e,o=d.isValidElement(t)?d.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=Ye("chakra-button__icon",n);return a.jsx(we.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}S1.displayName="ButtonIcon";function k1(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(fa,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:i,...l}=e,u=Ye("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",m=d.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...i}),[i,t,p,r]);return a.jsx(we.div,{className:u,...l,__css:m,children:o})}k1.displayName="ButtonSpinner";var Za=je((e,t)=>{const n=iL(),r=oi("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:i,children:l,leftIcon:u,rightIcon:p,loadingText:m,iconSpacing:h="0.5rem",type:g,spinner:x,spinnerPlacement:y="start",className:b,as:w,...S}=on(e),j=d.useMemo(()=>{const M={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:M}}},[r,n]),{ref:_,type:E}=uL(w),I={rightIcon:p,leftIcon:u,iconSpacing:h,children:l};return a.jsxs(we.button,{ref:N$(t,_),as:w,type:g??E,"data-active":dt(i),"data-loading":dt(s),__css:j,className:Ye("chakra-button",b),...S,disabled:o||s,children:[s&&y==="start"&&a.jsx(k1,{className:"chakra-button__spinner--start",label:m,placement:"start",spacing:h,children:x}),s?m||a.jsx(we.span,{opacity:0,children:a.jsx(nS,{...I})}):a.jsx(nS,{...I}),s&&y==="end"&&a.jsx(k1,{className:"chakra-button__spinner--end",label:m,placement:"end",spacing:h,children:x})]})});Za.displayName="Button";function nS(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(S1,{marginEnd:o,children:t}),r,n&&a.jsx(S1,{marginStart:o,children:n})]})}var ys=je((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...i}=e,l=n||r,u=d.isValidElement(l)?d.cloneElement(l,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(Za,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...i,children:u})});ys.displayName="IconButton";var[D1e,dL]=Wt({name:"CheckboxGroupContext",strict:!1});function fL(e){const[t,n]=d.useState(e),[r,o]=d.useState(!1);return e!==t&&(o(!0),n(e)),r}function pL(e){return a.jsx(we.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:a.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function mL(e){return a.jsx(we.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:a.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function hL(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?mL:pL;return n||t?a.jsx(we.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[gL,l5]=Wt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[vL,Pd]=Wt({strict:!1,name:"FormControlContext"});function xL(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...i}=e,l=d.useId(),u=t||`field-${l}`,p=`${u}-label`,m=`${u}-feedback`,h=`${u}-helptext`,[g,x]=d.useState(!1),[y,b]=d.useState(!1),[w,S]=d.useState(!1),j=d.useCallback((R={},D=null)=>({id:h,...R,ref:It(D,A=>{A&&b(!0)})}),[h]),_=d.useCallback((R={},D=null)=>({...R,ref:D,"data-focus":dt(w),"data-disabled":dt(o),"data-invalid":dt(r),"data-readonly":dt(s),id:R.id!==void 0?R.id:p,htmlFor:R.htmlFor!==void 0?R.htmlFor:u}),[u,o,w,r,s,p]),E=d.useCallback((R={},D=null)=>({id:m,...R,ref:It(D,A=>{A&&x(!0)}),"aria-live":"polite"}),[m]),I=d.useCallback((R={},D=null)=>({...R,...i,ref:D,role:"group"}),[i]),M=d.useCallback((R={},D=null)=>({...R,ref:D,role:"presentation","aria-hidden":!0,children:R.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>S(!0),onBlur:()=>S(!1),hasFeedbackText:g,setHasFeedbackText:x,hasHelpText:y,setHasHelpText:b,id:u,labelId:p,feedbackId:m,helpTextId:h,htmlProps:i,getHelpTextProps:j,getErrorMessageProps:E,getRootProps:I,getLabelProps:_,getRequiredIndicatorProps:M}}var Kt=je(function(t,n){const r=Un("Form",t),o=on(t),{getRootProps:s,htmlProps:i,...l}=xL(o),u=Ye("chakra-form-control",t.className);return a.jsx(vL,{value:l,children:a.jsx(gL,{value:r,children:a.jsx(we.div,{...s({},n),className:u,__css:r.container})})})});Kt.displayName="FormControl";var c5=je(function(t,n){const r=Pd(),o=l5(),s=Ye("chakra-form__helper-text",t.className);return a.jsx(we.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});c5.displayName="FormHelperText";var wn=je(function(t,n){var r;const o=oi("FormLabel",t),s=on(t),{className:i,children:l,requiredIndicator:u=a.jsx(u5,{}),optionalIndicator:p=null,...m}=s,h=Pd(),g=(r=h==null?void 0:h.getLabelProps(m,n))!=null?r:{ref:n,...m};return a.jsxs(we.label,{...g,className:Ye("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[l,h!=null&&h.isRequired?u:p]})});wn.displayName="FormLabel";var u5=je(function(t,n){const r=Pd(),o=l5();if(!(r!=null&&r.isRequired))return null;const s=Ye("chakra-form__required-indicator",t.className);return a.jsx(we.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});u5.displayName="RequiredIndicator";function pb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=mb(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":Co(n),"aria-required":Co(o),"aria-readonly":Co(r)}}function mb(e){var t,n,r;const o=Pd(),{id:s,disabled:i,readOnly:l,required:u,isRequired:p,isInvalid:m,isReadOnly:h,isDisabled:g,onFocus:x,onBlur:y,...b}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...b,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=i??g)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=l??h)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=u??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:m??(o==null?void 0:o.isInvalid),onFocus:He(o==null?void 0:o.onFocus,x),onBlur:He(o==null?void 0:o.onBlur,y)}}var hb={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},d5=we("span",{baseStyle:hb});d5.displayName="VisuallyHidden";var bL=we("input",{baseStyle:hb});bL.displayName="VisuallyHiddenInput";const yL=()=>typeof document<"u";let rS=!1,Ed=null,Wi=!1,j1=!1;const _1=new Set;function gb(e,t){_1.forEach(n=>n(e,t))}const CL=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function wL(e){return!(e.metaKey||!CL&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function oS(e){Wi=!0,wL(e)&&(Ed="keyboard",gb("keyboard",e))}function Ol(e){if(Ed="pointer",e.type==="mousedown"||e.type==="pointerdown"){Wi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;gb("pointer",e)}}function SL(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function kL(e){SL(e)&&(Wi=!0,Ed="virtual")}function jL(e){e.target===window||e.target===document||(!Wi&&!j1&&(Ed="virtual",gb("virtual",e)),Wi=!1,j1=!1)}function _L(){Wi=!1,j1=!0}function sS(){return Ed!=="pointer"}function IL(){if(!yL()||rS)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Wi=!0,e.apply(this,n)},document.addEventListener("keydown",oS,!0),document.addEventListener("keyup",oS,!0),document.addEventListener("click",kL,!0),window.addEventListener("focus",jL,!0),window.addEventListener("blur",_L,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Ol,!0),document.addEventListener("pointermove",Ol,!0),document.addEventListener("pointerup",Ol,!0)):(document.addEventListener("mousedown",Ol,!0),document.addEventListener("mousemove",Ol,!0),document.addEventListener("mouseup",Ol,!0)),rS=!0}function f5(e){IL(),e(sS());const t=()=>e(sS());return _1.add(t),()=>{_1.delete(t)}}function PL(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function p5(e={}){const t=mb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:l,onFocus:u,"aria-describedby":p}=t,{defaultChecked:m,isChecked:h,isFocusable:g,onChange:x,isIndeterminate:y,name:b,value:w,tabIndex:S=void 0,"aria-label":j,"aria-labelledby":_,"aria-invalid":E,...I}=e,M=PL(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),R=dn(x),D=dn(l),A=dn(u),[O,T]=d.useState(!1),[X,B]=d.useState(!1),[V,U]=d.useState(!1),[N,$]=d.useState(!1);d.useEffect(()=>f5(T),[]);const q=d.useRef(null),[F,Q]=d.useState(!0),[Y,se]=d.useState(!!m),ae=h!==void 0,re=ae?h:Y,G=d.useCallback(fe=>{if(r||n){fe.preventDefault();return}ae||se(re?fe.target.checked:y?!0:fe.target.checked),R==null||R(fe)},[r,n,re,ae,y,R]);rc(()=>{q.current&&(q.current.indeterminate=!!y)},[y]),pa(()=>{n&&B(!1)},[n,B]),rc(()=>{const fe=q.current;if(!(fe!=null&&fe.form))return;const Oe=()=>{se(!!m)};return fe.form.addEventListener("reset",Oe),()=>{var _e;return(_e=fe.form)==null?void 0:_e.removeEventListener("reset",Oe)}},[]);const K=n&&!g,ee=d.useCallback(fe=>{fe.key===" "&&$(!0)},[$]),ce=d.useCallback(fe=>{fe.key===" "&&$(!1)},[$]);rc(()=>{if(!q.current)return;q.current.checked!==re&&se(q.current.checked)},[q.current]);const J=d.useCallback((fe={},Oe=null)=>{const _e=Ne=>{X&&Ne.preventDefault(),$(!0)};return{...fe,ref:Oe,"data-active":dt(N),"data-hover":dt(V),"data-checked":dt(re),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r),"aria-hidden":!0,onMouseDown:He(fe.onMouseDown,_e),onMouseUp:He(fe.onMouseUp,()=>$(!1)),onMouseEnter:He(fe.onMouseEnter,()=>U(!0)),onMouseLeave:He(fe.onMouseLeave,()=>U(!1))}},[N,re,n,X,O,V,y,s,r]),ie=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,"data-active":dt(N),"data-hover":dt(V),"data-checked":dt(re),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r)}),[N,re,n,X,O,V,y,s,r]),de=d.useCallback((fe={},Oe=null)=>({...M,...fe,ref:It(Oe,_e=>{_e&&Q(_e.tagName==="LABEL")}),onClick:He(fe.onClick,()=>{var _e;F||((_e=q.current)==null||_e.click(),requestAnimationFrame(()=>{var Ne;(Ne=q.current)==null||Ne.focus({preventScroll:!0})}))}),"data-disabled":dt(n),"data-checked":dt(re),"data-invalid":dt(s)}),[M,n,re,s,F]),ge=d.useCallback((fe={},Oe=null)=>({...fe,ref:It(q,Oe),type:"checkbox",name:b,value:w,id:i,tabIndex:S,onChange:He(fe.onChange,G),onBlur:He(fe.onBlur,D,()=>B(!1)),onFocus:He(fe.onFocus,A,()=>B(!0)),onKeyDown:He(fe.onKeyDown,ee),onKeyUp:He(fe.onKeyUp,ce),required:o,checked:re,disabled:K,readOnly:r,"aria-label":j,"aria-labelledby":_,"aria-invalid":E?!!E:s,"aria-describedby":p,"aria-disabled":n,style:hb}),[b,w,i,G,D,A,ee,ce,o,re,K,r,j,_,E,s,p,n,S]),Ce=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,onMouseDown:He(fe.onMouseDown,EL),"data-disabled":dt(n),"data-checked":dt(re),"data-invalid":dt(s)}),[re,n,s]);return{state:{isInvalid:s,isFocused:X,isChecked:re,isActive:N,isHovered:V,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:de,getCheckboxProps:J,getIndicatorProps:ie,getInputProps:ge,getLabelProps:Ce,htmlProps:M}}function EL(e){e.preventDefault(),e.stopPropagation()}var ML={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},OL={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},RL=ma({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),DL=ma({from:{opacity:0},to:{opacity:1}}),AL=ma({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Md=je(function(t,n){const r=dL(),o={...r,...t},s=Un("Checkbox",o),i=on(t),{spacing:l="0.5rem",className:u,children:p,iconColor:m,iconSize:h,icon:g=a.jsx(hL,{}),isChecked:x,isDisabled:y=r==null?void 0:r.isDisabled,onChange:b,inputProps:w,...S}=i;let j=x;r!=null&&r.value&&i.value&&(j=r.value.includes(i.value));let _=b;r!=null&&r.onChange&&i.value&&(_=ph(r.onChange,b));const{state:E,getInputProps:I,getCheckboxProps:M,getLabelProps:R,getRootProps:D}=p5({...S,isDisabled:y,isChecked:j,onChange:_}),A=fL(E.isChecked),O=d.useMemo(()=>({animation:A?E.isIndeterminate?`${DL} 20ms linear, ${AL} 200ms linear`:`${RL} 200ms linear`:void 0,fontSize:h,color:m,...s.icon}),[m,h,A,E.isIndeterminate,s.icon]),T=d.cloneElement(g,{__css:O,isIndeterminate:E.isIndeterminate,isChecked:E.isChecked});return a.jsxs(we.label,{__css:{...OL,...s.container},className:Ye("chakra-checkbox",u),...D(),children:[a.jsx("input",{className:"chakra-checkbox__input",...I(w,n)}),a.jsx(we.span,{__css:{...ML,...s.control},className:"chakra-checkbox__control",...M(),children:T}),p&&a.jsx(we.span,{className:"chakra-checkbox__label",...R(),__css:{marginStart:l,...s.label},children:p})]})});Md.displayName="Checkbox";function TL(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function vb(e,t){let n=TL(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function I1(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function om(e,t,n){return(e-t)*100/(n-t)}function m5(e,t,n){return(n-t)*e+t}function P1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=I1(n);return vb(r,o)}function ac(e,t,n){return e==null?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function NL(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:i=Number.MIN_SAFE_INTEGER,max:l=Number.MAX_SAFE_INTEGER,keepWithinRange:u=!0}=e,p=dn(t),[m,h]=d.useState(()=>{var O;return r==null?"":(O=av(r,s,n))!=null?O:""}),g=typeof o<"u",x=g?o:m,y=h5(za(x),s),b=n??y,w=d.useCallback(O=>{O!==x&&(g||h(O.toString()),p==null||p(O.toString(),za(O)))},[p,g,x]),S=d.useCallback(O=>{let T=O;return u&&(T=ac(T,i,l)),vb(T,b)},[b,u,l,i]),j=d.useCallback((O=s)=>{let T;x===""?T=za(O):T=za(x)+O,T=S(T),w(T)},[S,s,w,x]),_=d.useCallback((O=s)=>{let T;x===""?T=za(-O):T=za(x)-O,T=S(T),w(T)},[S,s,w,x]),E=d.useCallback(()=>{var O;let T;r==null?T="":T=(O=av(r,s,n))!=null?O:i,w(T)},[r,n,s,w,i]),I=d.useCallback(O=>{var T;const X=(T=av(O,s,b))!=null?T:i;w(X)},[b,s,w,i]),M=za(x);return{isOutOfRange:M>l||M<i,isAtMax:M===l,isAtMin:M===i,precision:b,value:x,valueAsNumber:M,update:w,reset:E,increment:j,decrement:_,clamp:S,cast:I,setValue:h}}function za(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function h5(e,t){return Math.max(I1(t),I1(e))}function av(e,t,n){const r=za(e);if(Number.isNaN(r))return;const o=h5(r,t);return vb(r,n??o)}var[$L,g5]=Wt({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[LL,xb]=Wt({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),v5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},jh=je(function(t,n){const{getInputProps:r}=xb(),o=g5(),s=r(t,n),i=Ye("chakra-editable__input",t.className);return a.jsx(we.input,{...s,__css:{outline:0,...v5,...o.input},className:i})});jh.displayName="EditableInput";var _h=je(function(t,n){const{getPreviewProps:r}=xb(),o=g5(),s=r(t,n),i=Ye("chakra-editable__preview",t.className);return a.jsx(we.span,{...s,__css:{cursor:"text",display:"inline-block",...v5,...o.preview},className:i})});_h.displayName="EditablePreview";function Di(e,t,n,r){const o=dn(n);return d.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,o,r)}}function zL(e){return"current"in e}var x5=()=>typeof window<"u";function FL(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var BL=e=>x5()&&e.test(navigator.vendor),HL=e=>x5()&&e.test(FL()),VL=()=>HL(/mac|iphone|ipad|ipod/i),WL=()=>VL()&&BL(/apple/i);function b5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,i;return(i=(s=t.current)==null?void 0:s.ownerDocument)!=null?i:document};Di(o,"pointerdown",s=>{if(!WL()||!r)return;const i=s.target,u=(n??[t]).some(p=>{const m=zL(p)?p.current:p;return(m==null?void 0:m.contains(i))||m===i});o().activeElement!==i&&u&&(s.preventDefault(),i.focus())})}function aS(e,t){return e?e===t||e.contains(t):!1}function UL(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:l,startWithEditView:u,isPreviewFocusable:p=!0,submitOnBlur:m=!0,selectAllOnFocus:h=!0,placeholder:g,onEdit:x,finalFocusRef:y,...b}=e,w=dn(x),S=!!(u&&!i),[j,_]=d.useState(S),[E,I]=_d({defaultValue:l||"",value:s,onChange:t}),[M,R]=d.useState(E),D=d.useRef(null),A=d.useRef(null),O=d.useRef(null),T=d.useRef(null),X=d.useRef(null);b5({ref:D,enabled:j,elements:[T,X]});const B=!j&&!i;rc(()=>{var J,ie;j&&((J=D.current)==null||J.focus(),h&&((ie=D.current)==null||ie.select()))},[]),pa(()=>{var J,ie,de,ge;if(!j){y?(J=y.current)==null||J.focus():(ie=O.current)==null||ie.focus();return}(de=D.current)==null||de.focus(),h&&((ge=D.current)==null||ge.select()),w==null||w()},[j,w,h]);const V=d.useCallback(()=>{B&&_(!0)},[B]),U=d.useCallback(()=>{R(E)},[E]),N=d.useCallback(()=>{_(!1),I(M),n==null||n(M),o==null||o(M)},[n,o,I,M]),$=d.useCallback(()=>{_(!1),R(E),r==null||r(E),o==null||o(M)},[E,r,o,M]);d.useEffect(()=>{if(j)return;const J=D.current;(J==null?void 0:J.ownerDocument.activeElement)===J&&(J==null||J.blur())},[j]);const q=d.useCallback(J=>{I(J.currentTarget.value)},[I]),F=d.useCallback(J=>{const ie=J.key,ge={Escape:N,Enter:Ce=>{!Ce.shiftKey&&!Ce.metaKey&&$()}}[ie];ge&&(J.preventDefault(),ge(J))},[N,$]),Q=d.useCallback(J=>{const ie=J.key,ge={Escape:N}[ie];ge&&(J.preventDefault(),ge(J))},[N]),Y=E.length===0,se=d.useCallback(J=>{var ie;if(!j)return;const de=J.currentTarget.ownerDocument,ge=(ie=J.relatedTarget)!=null?ie:de.activeElement,Ce=aS(T.current,ge),he=aS(X.current,ge);!Ce&&!he&&(m?$():N())},[m,$,N,j]),ae=d.useCallback((J={},ie=null)=>{const de=B&&p?0:void 0;return{...J,ref:It(ie,A),children:Y?g:E,hidden:j,"aria-disabled":Co(i),tabIndex:de,onFocus:He(J.onFocus,V,U)}},[i,j,B,p,Y,V,U,g,E]),re=d.useCallback((J={},ie=null)=>({...J,hidden:!j,placeholder:g,ref:It(ie,D),disabled:i,"aria-disabled":Co(i),value:E,onBlur:He(J.onBlur,se),onChange:He(J.onChange,q),onKeyDown:He(J.onKeyDown,F),onFocus:He(J.onFocus,U)}),[i,j,se,q,F,U,g,E]),G=d.useCallback((J={},ie=null)=>({...J,hidden:!j,placeholder:g,ref:It(ie,D),disabled:i,"aria-disabled":Co(i),value:E,onBlur:He(J.onBlur,se),onChange:He(J.onChange,q),onKeyDown:He(J.onKeyDown,Q),onFocus:He(J.onFocus,U)}),[i,j,se,q,Q,U,g,E]),K=d.useCallback((J={},ie=null)=>({"aria-label":"Edit",...J,type:"button",onClick:He(J.onClick,V),ref:It(ie,O),disabled:i}),[V,i]),ee=d.useCallback((J={},ie=null)=>({...J,"aria-label":"Submit",ref:It(X,ie),type:"button",onClick:He(J.onClick,$),disabled:i}),[$,i]),ce=d.useCallback((J={},ie=null)=>({"aria-label":"Cancel",id:"cancel",...J,ref:It(T,ie),type:"button",onClick:He(J.onClick,N),disabled:i}),[N,i]);return{isEditing:j,isDisabled:i,isValueEmpty:Y,value:E,onEdit:V,onCancel:N,onSubmit:$,getPreviewProps:ae,getInputProps:re,getTextareaProps:G,getEditButtonProps:K,getSubmitButtonProps:ee,getCancelButtonProps:ce,htmlProps:b}}var Ih=je(function(t,n){const r=Un("Editable",t),o=on(t),{htmlProps:s,...i}=UL(o),{isEditing:l,onSubmit:u,onCancel:p,onEdit:m}=i,h=Ye("chakra-editable",t.className),g=zx(t.children,{isEditing:l,onSubmit:u,onCancel:p,onEdit:m});return a.jsx(LL,{value:i,children:a.jsx($L,{value:r,children:a.jsx(we.div,{ref:n,...s,className:h,children:g})})})});Ih.displayName="Editable";function y5(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=xb();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var C5={exports:{}},GL="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",KL=GL,qL=KL;function w5(){}function S5(){}S5.resetWarningCache=w5;var XL=function(){function e(r,o,s,i,l,u){if(u!==qL){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:S5,resetWarningCache:w5};return n.PropTypes=n,n};C5.exports=XL();var QL=C5.exports;const Jt=xd(QL);var E1="data-focus-lock",k5="data-focus-lock-disabled",YL="data-no-focus-lock",ZL="data-autofocus-inside",JL="data-no-autofocus";function ez(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tz(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function j5(e,t){return tz(t||null,function(n){return e.forEach(function(r){return ez(r,n)})})}var iv={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},gs=function(){return gs=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},gs.apply(this,arguments)};function _5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Tc(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function l(m){try{p(r.next(m))}catch(h){i(h)}}function u(m){try{p(r.throw(m))}catch(h){i(h)}}function p(m){m.done?s(m.value):o(m.value).then(l,u)}p((r=r.apply(e,t||[])).next())})}function Nc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(p){return function(m){return u([p,m])}}function u(p){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(m){p=[6,m],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function iS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(l){i={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function M1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function I5(e){return e}function P5(e,t){t===void 0&&(t=I5);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var u=function(){var m=i;i=[],m.forEach(s)},p=function(){return Promise.resolve().then(u)};p(),n={push:function(m){i.push(m),p()},filter:function(m){return i=i.filter(m),n}}}};return o}function bb(e,t){return t===void 0&&(t=I5),P5(e,t)}function E5(e){e===void 0&&(e={});var t=P5(null);return t.options=gs({async:!0,ssr:!1},e),t}var M5=function(e){var t=e.sideCar,n=_5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,gs({},n))};M5.isSideCarExport=!0;function nz(e,t){return e.useMedium(t),M5}var O5=bb({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),R5=bb(),rz=bb(),oz=E5({async:!0}),sz=[],yb=d.forwardRef(function(t,n){var r,o=d.useState(),s=o[0],i=o[1],l=d.useRef(),u=d.useRef(!1),p=d.useRef(null),m=t.children,h=t.disabled,g=t.noFocusGuards,x=t.persistentFocus,y=t.crossFrame,b=t.autoFocus;t.allowTextSelection;var w=t.group,S=t.className,j=t.whiteList,_=t.hasPositiveIndices,E=t.shards,I=E===void 0?sz:E,M=t.as,R=M===void 0?"div":M,D=t.lockProps,A=D===void 0?{}:D,O=t.sideCar,T=t.returnFocus,X=t.focusOptions,B=t.onActivation,V=t.onDeactivation,U=d.useState({}),N=U[0],$=d.useCallback(function(){p.current=p.current||document&&document.activeElement,l.current&&B&&B(l.current),u.current=!0},[B]),q=d.useCallback(function(){u.current=!1,V&&V(l.current)},[V]);d.useEffect(function(){h||(p.current=null)},[]);var F=d.useCallback(function(ee){var ce=p.current;if(ce&&ce.focus){var J=typeof T=="function"?T(ce):T;if(J){var ie=typeof J=="object"?J:void 0;p.current=null,ee?Promise.resolve().then(function(){return ce.focus(ie)}):ce.focus(ie)}}},[T]),Q=d.useCallback(function(ee){u.current&&O5.useMedium(ee)},[]),Y=R5.useMedium,se=d.useCallback(function(ee){l.current!==ee&&(l.current=ee,i(ee))},[]),ae=mn((r={},r[k5]=h&&"disabled",r[E1]=w,r),A),re=g!==!0,G=re&&g!=="tail",K=j5([n,se]);return d.createElement(d.Fragment,null,re&&[d.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:iv}),_?d.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:iv}):null],!h&&d.createElement(O,{id:N,sideCar:oz,observed:s,disabled:h,persistentFocus:x,crossFrame:y,autoFocus:b,whiteList:j,shards:I,onActivation:$,onDeactivation:q,returnFocus:F,focusOptions:X}),d.createElement(R,mn({ref:K},ae,{className:S,onBlur:Y,onFocus:Q}),m),G&&d.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:iv}))});yb.propTypes={};yb.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const D5=yb;function O1(e,t){return O1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},O1(e,t)}function az(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,O1(e,t)}function iz(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function l(){i=e(s.map(function(p){return p.props})),t(i)}var u=function(p){az(m,p);function m(){return p.apply(this,arguments)||this}m.peek=function(){return i};var h=m.prototype;return h.componentDidMount=function(){s.push(this),l()},h.componentDidUpdate=function(){l()},h.componentWillUnmount=function(){var x=s.indexOf(this);s.splice(x,1),l()},h.render=function(){return H.createElement(o,this.props)},m}(d.PureComponent);return LR(u,"displayName","SideEffect("+n(o)+")"),u}}var Rs=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},sm=function(e){return Array.isArray(e)?e:[e]},A5=function(e){return Array.isArray(e)?e[0]:e},lz=function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!t||!t.getPropertyValue?!1:t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"},T5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},N5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},cz=function(e,t){return!e||N5(e)||!lz(e)&&t(T5(e))},$5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=cz(t,$5.bind(void 0,e));return e.set(t,r),r},uz=function(e,t){return e&&!N5(e)?pz(e)?t(T5(e)):!1:!0},L5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=uz(t,L5.bind(void 0,e));return e.set(t,r),r},z5=function(e){return e.dataset},dz=function(e){return e.tagName==="BUTTON"},F5=function(e){return e.tagName==="INPUT"},B5=function(e){return F5(e)&&e.type==="radio"},fz=function(e){return!((F5(e)||dz(e))&&(e.type==="hidden"||e.disabled))},pz=function(e){var t=e.getAttribute(JL);return![!0,"true",""].includes(t)},Cb=function(e){var t;return!!(e&&(!((t=z5(e))===null||t===void 0)&&t.focusGuard))},am=function(e){return!Cb(e)},mz=function(e){return!!e},hz=function(e,t){var n=e.tabIndex-t.tabIndex,r=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||r},H5=function(e,t,n){return Rs(e).map(function(r,o){return{node:r,index:o,tabIndex:n&&r.tabIndex===-1?(r.dataset||{}).focusGuard?0:-1:r.tabIndex}}).filter(function(r){return!t||r.tabIndex>=0}).sort(hz)},gz=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],wb=gz.join(","),vz="".concat(wb,", [data-focus-guard]"),V5=function(e,t){return Rs((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?vz:wb)?[r]:[],V5(r))},[])},xz=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Ph([e.contentDocument.body],t):[e]},Ph=function(e,t){return e.reduce(function(n,r){var o,s=V5(r,t),i=(o=[]).concat.apply(o,s.map(function(l){return xz(l,t)}));return n.concat(i,r.parentNode?Rs(r.parentNode.querySelectorAll(wb)).filter(function(l){return l===r}):[])},[])},bz=function(e){var t=e.querySelectorAll("[".concat(ZL,"]"));return Rs(t).map(function(n){return Ph([n])}).reduce(function(n,r){return n.concat(r)},[])},Sb=function(e,t){return Rs(e).filter(function(n){return $5(t,n)}).filter(function(n){return fz(n)})},lS=function(e,t){return t===void 0&&(t=new Map),Rs(e).filter(function(n){return L5(t,n)})},R1=function(e,t,n){return H5(Sb(Ph(e,n),t),!0,n)},cS=function(e,t){return H5(Sb(Ph(e),t),!1)},yz=function(e,t){return Sb(bz(e),t)},ic=function(e,t){return e.shadowRoot?ic(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Rs(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?ic(o,t):!1}return ic(n,t)})},Cz=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(i,l){return!t.has(l)})},W5=function(e){return e.parentNode?W5(e.parentNode):e},kb=function(e){var t=sm(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(E1);return n.push.apply(n,o?Cz(Rs(W5(r).querySelectorAll("[".concat(E1,'="').concat(o,'"]:not([').concat(k5,'="disabled"])')))):[r]),n},[])},wz=function(e){try{return e()}catch{return}},Qu=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Qu(t.shadowRoot):t instanceof HTMLIFrameElement&&wz(function(){return t.contentWindow.document})?Qu(t.contentWindow.document):t}},Sz=function(e,t){return e===t},kz=function(e,t){return!!Rs(e.querySelectorAll("iframe")).some(function(n){return Sz(n,t)})},U5=function(e,t){return t===void 0&&(t=Qu(A5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:kb(e).some(function(n){return ic(n,t)||kz(n,t)})},jz=function(e){e===void 0&&(e=document);var t=Qu(e);return t?Rs(e.querySelectorAll("[".concat(YL,"]"))).some(function(n){return ic(n,t)}):!1},_z=function(e,t){return t.filter(B5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},jb=function(e,t){return B5(e)&&e.name?_z(e,t):e},Iz=function(e){var t=new Set;return e.forEach(function(n){return t.add(jb(n,e))}),e.filter(function(n){return t.has(n)})},uS=function(e){return e[0]&&e.length>1?jb(e[0],e):e[0]},dS=function(e,t){return e.length>1?e.indexOf(jb(e[t],e)):t},G5="NEW_FOCUS",Pz=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],l=Cb(n);if(!(n&&e.indexOf(n)>=0)){var u=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):u,m=r?e.indexOf(r):-1,h=u-p,g=t.indexOf(s),x=t.indexOf(i),y=Iz(t),b=n!==void 0?y.indexOf(n):-1,w=b-(r?y.indexOf(r):u),S=dS(e,0),j=dS(e,o-1);if(u===-1||m===-1)return G5;if(!h&&m>=0)return m;if(u<=g&&l&&Math.abs(h)>1)return j;if(u>=x&&l&&Math.abs(h)>1)return S;if(h&&Math.abs(w)>1)return m;if(u<=g)return j;if(u>x)return S;if(h)return Math.abs(h)>1?m:(o+m+h)%o}},Ez=function(e){return function(t){var n,r=(n=z5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},Mz=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=lS(r.filter(Ez(n)));return o&&o.length?uS(o):uS(lS(t))},D1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&D1(e.parentNode.host||e.parentNode,t),t},lv=function(e,t){for(var n=D1(e),r=D1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},K5=function(e,t,n){var r=sm(e),o=sm(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(l){i=lv(i||l,l)||i,n.filter(Boolean).forEach(function(u){var p=lv(s,u);p&&(!i||ic(p,i)?i=p:i=lv(p,i))})}),i},Oz=function(e,t){return e.reduce(function(n,r){return n.concat(yz(r,t))},[])},Rz=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(mz)},Dz=function(e,t){var n=Qu(sm(e).length>0?document:A5(e).ownerDocument),r=kb(e).filter(am),o=K5(n||e,e,r),s=new Map,i=cS(r,s),l=R1(r,s).filter(function(x){var y=x.node;return am(y)});if(!(!l[0]&&(l=i,!l[0]))){var u=cS([o],s).map(function(x){var y=x.node;return y}),p=Rz(u,l),m=p.map(function(x){var y=x.node;return y}),h=Pz(m,u,n,t);if(h===G5){var g=Mz(i,m,Oz(r,s));if(g)return{node:g};console.warn("focus-lock: cannot find any node to move focus into");return}return h===void 0?h:p[h]}},Az=function(e){var t=kb(e).filter(am),n=K5(e,e,t),r=new Map,o=R1([n],r,!0),s=R1(t,r).filter(function(i){var l=i.node;return am(l)}).map(function(i){var l=i.node;return l});return o.map(function(i){var l=i.node,u=i.index;return{node:l,index:u,lockItem:s.indexOf(l)>=0,guard:Cb(l)}})},Tz=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},cv=0,uv=!1,q5=function(e,t,n){n===void 0&&(n={});var r=Dz(e,t);if(!uv&&r){if(cv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),uv=!0,setTimeout(function(){uv=!1},1);return}cv++,Tz(r.node,n.focusOptions),cv--}};function _b(e){setTimeout(e,1)}var Nz=function(){return document&&document.activeElement===document.body},$z=function(){return Nz()||jz()},lc=null,Zl=null,cc=null,Yu=!1,Lz=function(){return!0},zz=function(t){return(lc.whiteList||Lz)(t)},Fz=function(t,n){cc={observerNode:t,portaledElement:n}},Bz=function(t){return cc&&cc.portaledElement===t};function fS(e,t,n,r){var o=null,s=e;do{var i=r[s];if(i.guard)i.node.dataset.focusAutoGuard&&(o=i);else if(i.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var Hz=function(t){return t&&"current"in t?t.current:t},Vz=function(t){return t?!!Yu:Yu==="meanwhile"},Wz=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},Uz=function(t,n){return n.some(function(r){return Wz(t,r,r)})},im=function(){var t=!1;if(lc){var n=lc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,l=n.crossFrame,u=n.focusOptions,p=r||cc&&cc.portaledElement,m=document&&document.activeElement;if(p){var h=[p].concat(i.map(Hz).filter(Boolean));if((!m||zz(m))&&(o||Vz(l)||!$z()||!Zl&&s)&&(p&&!(U5(h)||m&&Uz(m,h)||Bz(m))&&(document&&!Zl&&m&&!s?(m.blur&&m.blur(),document.body.focus()):(t=q5(h,Zl,{focusOptions:u}),cc={})),Yu=!1,Zl=document&&document.activeElement),document){var g=document&&document.activeElement,x=Az(h),y=x.map(function(b){var w=b.node;return w}).indexOf(g);y>-1&&(x.filter(function(b){var w=b.guard,S=b.node;return w&&S.dataset.focusAutoGuard}).forEach(function(b){var w=b.node;return w.removeAttribute("tabIndex")}),fS(y,x.length,1,x),fS(y,-1,-1,x))}}}return t},X5=function(t){im()&&t&&(t.stopPropagation(),t.preventDefault())},Ib=function(){return _b(im)},Gz=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Fz(r,n)},Kz=function(){return null},Q5=function(){Yu="just",_b(function(){Yu="meanwhile"})},qz=function(){document.addEventListener("focusin",X5),document.addEventListener("focusout",Ib),window.addEventListener("blur",Q5)},Xz=function(){document.removeEventListener("focusin",X5),document.removeEventListener("focusout",Ib),window.removeEventListener("blur",Q5)};function Qz(e){return e.filter(function(t){var n=t.disabled;return!n})}function Yz(e){var t=e.slice(-1)[0];t&&!lc&&qz();var n=lc,r=n&&t&&t.id===n.id;lc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Zl=null,(!r||n.observed!==t.observed)&&t.onActivation(),im(),_b(im)):(Xz(),Zl=null)}O5.assignSyncMedium(Gz);R5.assignMedium(Ib);rz.assignMedium(function(e){return e({moveFocusInside:q5,focusInside:U5})});const Zz=iz(Qz,Yz)(Kz);var Y5=d.forwardRef(function(t,n){return d.createElement(D5,mn({sideCar:Zz,ref:n},t))}),Z5=D5.propTypes||{};Z5.sideCar;o$(Z5,["sideCar"]);Y5.propTypes={};const pS=Y5;function J5(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Pb(e){var t;if(!J5(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function Jz(e){var t,n;return(n=(t=e3(e))==null?void 0:t.defaultView)!=null?n:window}function e3(e){return J5(e)?e.ownerDocument:document}function eF(e){return e3(e).activeElement}function tF(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function nF(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function t3(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Pb(e)&&tF(e)?e:t3(nF(e))}var n3=e=>e.hasAttribute("tabindex"),rF=e=>n3(e)&&e.tabIndex===-1;function oF(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function r3(e){return e.parentElement&&r3(e.parentElement)?!0:e.hidden}function sF(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function o3(e){if(!Pb(e)||r3(e)||oF(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():sF(e)?!0:n3(e)}function aF(e){return e?Pb(e)&&o3(e)&&!rF(e):!1}var iF=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],lF=iF.join(),cF=e=>e.offsetWidth>0&&e.offsetHeight>0;function s3(e){const t=Array.from(e.querySelectorAll(lF));return t.unshift(e),t.filter(n=>o3(n)&&cF(n))}var mS,uF=(mS=pS.default)!=null?mS:pS,a3=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:l,persistentFocus:u,lockFocusAcrossFrames:p}=e,m=d.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&s3(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),h=d.useCallback(()=>{var x;(x=n==null?void 0:n.current)==null||x.focus()},[n]),g=o&&!n;return a.jsx(uF,{crossFrame:p,persistentFocus:u,autoFocus:l,disabled:i,onActivation:m,onDeactivation:h,returnFocus:g,children:s})};a3.displayName="FocusLock";var dF=S$?d.useLayoutEffect:d.useEffect;function A1(e,t=[]){const n=d.useRef(e);return dF(()=>{n.current=e}),d.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function fF(e,t,n,r){const o=A1(t);return d.useEffect(()=>{var s;const i=(s=ew(n))!=null?s:document;if(t)return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=ew(n))!=null?s:document).removeEventListener(e,o,r)}}function pF(e,t){const n=d.useId();return d.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function mF(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Lr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=A1(n),i=A1(t),[l,u]=d.useState(e.defaultIsOpen||!1),[p,m]=mF(r,l),h=pF(o,"disclosure"),g=d.useCallback(()=>{p||u(!1),i==null||i()},[p,i]),x=d.useCallback(()=>{p||u(!0),s==null||s()},[p,s]),y=d.useCallback(()=>{(m?g:x)()},[m,x,g]);return{isOpen:!!m,onOpen:x,onClose:g,onToggle:y,isControlled:p,getButtonProps:(b={})=>({...b,"aria-expanded":m,"aria-controls":h,onClick:zR(b.onClick,y)}),getDisclosureProps:(b={})=>({...b,hidden:!m,id:h})}}var[hF,gF]=Wt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),i3=je(function(t,n){const r=Un("Input",t),{children:o,className:s,...i}=on(t),l=Ye("chakra-input__group",s),u={},p=kh(o),m=r.field;p.forEach(g=>{var x,y;r&&(m&&g.type.id==="InputLeftElement"&&(u.paddingStart=(x=m.height)!=null?x:m.h),m&&g.type.id==="InputRightElement"&&(u.paddingEnd=(y=m.height)!=null?y:m.h),g.type.id==="InputRightAddon"&&(u.borderEndRadius=0),g.type.id==="InputLeftAddon"&&(u.borderStartRadius=0))});const h=p.map(g=>{var x,y;const b=J_({size:((x=g.props)==null?void 0:x.size)||t.size,variant:((y=g.props)==null?void 0:y.variant)||t.variant});return g.type.id!=="Input"?d.cloneElement(g,b):d.cloneElement(g,Object.assign(b,u,g.props))});return a.jsx(we.div,{className:l,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...i,children:a.jsx(hF,{value:r,children:h})})});i3.displayName="InputGroup";var vF=we("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),Eh=je(function(t,n){var r,o;const{placement:s="left",...i}=t,l=gF(),u=l.field,m={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=u==null?void 0:u.height)!=null?r:u==null?void 0:u.h,height:(o=u==null?void 0:u.height)!=null?o:u==null?void 0:u.h,fontSize:u==null?void 0:u.fontSize,...l.element};return a.jsx(vF,{ref:n,__css:m,...i})});Eh.id="InputElement";Eh.displayName="InputElement";var l3=je(function(t,n){const{className:r,...o}=t,s=Ye("chakra-input__left-element",r);return a.jsx(Eh,{ref:n,placement:"left",className:s,...o})});l3.id="InputLeftElement";l3.displayName="InputLeftElement";var Eb=je(function(t,n){const{className:r,...o}=t,s=Ye("chakra-input__right-element",r);return a.jsx(Eh,{ref:n,placement:"right",className:s,...o})});Eb.id="InputRightElement";Eb.displayName="InputRightElement";var Mh=je(function(t,n){const{htmlSize:r,...o}=t,s=Un("Input",o),i=on(o),l=pb(i),u=Ye("chakra-input",t.className);return a.jsx(we.input,{size:r,...l,__css:s.field,ref:n,className:u})});Mh.displayName="Input";Mh.id="Input";var Oh=je(function(t,n){const r=oi("Link",t),{className:o,isExternal:s,...i}=on(t);return a.jsx(we.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ye("chakra-link",o),...i,__css:r})});Oh.displayName="Link";var[xF,c3]=Wt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Mb=je(function(t,n){const r=Un("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:l,...u}=on(t),p=kh(o),h=l?{["& > *:not(style) ~ *:not(style)"]:{mt:l}}:{};return a.jsx(xF,{value:r,children:a.jsx(we.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...h},...u,children:p})})});Mb.displayName="List";var u3=je((e,t)=>{const{as:n,...r}=e;return a.jsx(Mb,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});u3.displayName="OrderedList";var Od=je(function(t,n){const{as:r,...o}=t;return a.jsx(Mb,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Od.displayName="UnorderedList";var Qr=je(function(t,n){const r=c3();return a.jsx(we.li,{ref:n,...t,__css:r.item})});Qr.displayName="ListItem";var bF=je(function(t,n){const r=c3();return a.jsx(Nn,{ref:n,role:"presentation",...t,__css:r.icon})});bF.displayName="ListIcon";var Ja=je(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:l,row:u,autoFlow:p,autoRows:m,templateRows:h,autoColumns:g,templateColumns:x,...y}=t,b={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:g,gridColumn:l,gridRow:u,gridAutoFlow:p,gridAutoRows:m,gridTemplateRows:h,gridTemplateColumns:x};return a.jsx(we.div,{ref:n,__css:b,...y})});Ja.displayName="Grid";function d3(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):a1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var ba=we("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});ba.displayName="Spacer";var f3=e=>a.jsx(we.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});f3.displayName="StackItem";function yF(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":d3(n,o=>r[o])}}var Ob=je((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:i="0.5rem",wrap:l,children:u,divider:p,className:m,shouldWrapChildren:h,...g}=e,x=n?"row":r??"column",y=d.useMemo(()=>yF({spacing:i,direction:x}),[i,x]),b=!!p,w=!h&&!b,S=d.useMemo(()=>{const _=kh(u);return w?_:_.map((E,I)=>{const M=typeof E.key<"u"?E.key:I,R=I+1===_.length,A=h?a.jsx(f3,{children:E},M):E;if(!b)return A;const O=d.cloneElement(p,{__css:y}),T=R?null:O;return a.jsxs(d.Fragment,{children:[A,T]},M)})},[p,y,b,w,h,u]),j=Ye("chakra-stack",m);return a.jsx(we.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:x,flexWrap:l,gap:b?void 0:i,className:j,...g,children:S})});Ob.displayName="Stack";var p3=je((e,t)=>a.jsx(Ob,{align:"center",...e,direction:"column",ref:t}));p3.displayName="VStack";var Rh=je((e,t)=>a.jsx(Ob,{align:"center",...e,direction:"row",ref:t}));Rh.displayName="HStack";function hS(e){return d3(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Zu=je(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:l,rowSpan:u,rowStart:p,...m}=t,h=J_({gridArea:r,gridColumn:hS(o),gridRow:hS(u),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:l});return a.jsx(we.div,{ref:n,__css:h,...m})});Zu.displayName="GridItem";var Ds=je(function(t,n){const r=oi("Badge",t),{className:o,...s}=on(t);return a.jsx(we.span,{ref:n,className:Ye("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Ds.displayName="Badge";var Yn=je(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:l,borderStyle:u,borderColor:p,...m}=oi("Divider",t),{className:h,orientation:g="horizontal",__css:x,...y}=on(t),b={vertical:{borderLeftWidth:r||i||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||l||"1px",width:"100%"}};return a.jsx(we.hr,{ref:n,"aria-orientation":g,...y,__css:{...m,border:"0",borderColor:p,borderStyle:u,...b[g],...x},className:Ye("chakra-divider",h)})});Yn.displayName="Divider";function CF(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function wF(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=d.useState([]),s=d.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},l=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};d.useEffect(()=>i,[]);function u(p){return m=>{if(m.key==="Backspace"){const h=[...r];h.pop(),o(h);return}if(CF(m)){const h=r.concat(m.key);n(m)&&(m.preventDefault(),m.stopPropagation()),o(h),p(h.join("")),l()}}}return u}function SF(e,t,n,r){if(t==null)return r;if(!r)return e.find(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function kF(){const e=d.useRef(new Map),t=e.current,n=d.useCallback((o,s,i,l)=>{e.current.set(i,{type:s,el:o,options:l}),o.addEventListener(s,i,l)},[]),r=d.useCallback((o,s,i,l)=>{o.removeEventListener(s,i,l),e.current.delete(i)},[]);return d.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function dv(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function m3(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:l,onClick:u,onKeyDown:p,onKeyUp:m,tabIndex:h,onMouseOver:g,onMouseLeave:x,...y}=e,[b,w]=d.useState(!0),[S,j]=d.useState(!1),_=kF(),E=$=>{$&&$.tagName!=="BUTTON"&&w(!1)},I=b?h:h||0,M=n&&!r,R=d.useCallback($=>{if(n){$.stopPropagation(),$.preventDefault();return}$.currentTarget.focus(),u==null||u($)},[n,u]),D=d.useCallback($=>{S&&dv($)&&($.preventDefault(),$.stopPropagation(),j(!1),_.remove(document,"keyup",D,!1))},[S,_]),A=d.useCallback($=>{if(p==null||p($),n||$.defaultPrevented||$.metaKey||!dv($.nativeEvent)||b)return;const q=o&&$.key==="Enter";s&&$.key===" "&&($.preventDefault(),j(!0)),q&&($.preventDefault(),$.currentTarget.click()),_.add(document,"keyup",D,!1)},[n,b,p,o,s,_,D]),O=d.useCallback($=>{if(m==null||m($),n||$.defaultPrevented||$.metaKey||!dv($.nativeEvent)||b)return;s&&$.key===" "&&($.preventDefault(),j(!1),$.currentTarget.click())},[s,b,n,m]),T=d.useCallback($=>{$.button===0&&(j(!1),_.remove(document,"mouseup",T,!1))},[_]),X=d.useCallback($=>{if($.button!==0)return;if(n){$.stopPropagation(),$.preventDefault();return}b||j(!0),$.currentTarget.focus({preventScroll:!0}),_.add(document,"mouseup",T,!1),i==null||i($)},[n,b,i,_,T]),B=d.useCallback($=>{$.button===0&&(b||j(!1),l==null||l($))},[l,b]),V=d.useCallback($=>{if(n){$.preventDefault();return}g==null||g($)},[n,g]),U=d.useCallback($=>{S&&($.preventDefault(),j(!1)),x==null||x($)},[S,x]),N=It(t,E);return b?{...y,ref:N,type:"button","aria-disabled":M?void 0:n,disabled:M,onClick:R,onMouseDown:i,onMouseUp:l,onKeyUp:m,onKeyDown:p,onMouseOver:g,onMouseLeave:x}:{...y,ref:N,role:"button","data-active":dt(S),"aria-disabled":n?"true":void 0,tabIndex:M?void 0:I,onClick:R,onMouseDown:X,onMouseUp:B,onKeyUp:O,onKeyDown:A,onMouseOver:V,onMouseLeave:U}}function jF(e){const t=e.current;if(!t)return!1;const n=eF(t);return!n||t.contains(n)?!1:!!aF(n)}function h3(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;pa(()=>{if(!s||jF(e))return;const i=(o==null?void 0:o.current)||e.current;let l;if(i)return l=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(l)}},[s,e,o])}var _F={preventScroll:!0,shouldFocus:!1};function IF(e,t=_F){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=PF(e)?e.current:e,l=o&&s,u=d.useRef(l),p=d.useRef(s);rc(()=>{!p.current&&s&&(u.current=l),p.current=s},[s,l]);const m=d.useCallback(()=>{if(!(!s||!i||!u.current)&&(u.current=!1,!i.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=s3(i);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[s,r,i,n]);pa(()=>{m()},[m]),Di(i,"transitionend",m)}function PF(e){return"current"in e}var Rl=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),$n={arrowShadowColor:Rl("--popper-arrow-shadow-color"),arrowSize:Rl("--popper-arrow-size","8px"),arrowSizeHalf:Rl("--popper-arrow-size-half"),arrowBg:Rl("--popper-arrow-bg"),transformOrigin:Rl("--popper-transform-origin"),arrowOffset:Rl("--popper-arrow-offset")};function EF(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var MF={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},OF=e=>MF[e],gS={scroll:!0,resize:!0};function RF(e){let t;return typeof e=="object"?t={enabled:!0,options:{...gS,...e}}:t={enabled:e,options:gS},t}var DF={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},AF={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{vS(e)},effect:({state:e})=>()=>{vS(e)}},vS=e=>{e.elements.popper.style.setProperty($n.transformOrigin.var,OF(e.placement))},TF={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{NF(e)}},NF=e=>{var t;if(!e.placement)return;const n=$F(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:$n.arrowSize.varRef,height:$n.arrowSize.varRef,zIndex:-1});const r={[$n.arrowSizeHalf.var]:`calc(${$n.arrowSize.varRef} / 2 - 1px)`,[$n.arrowOffset.var]:`calc(${$n.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},$F=e=>{if(e.startsWith("top"))return{property:"bottom",value:$n.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:$n.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:$n.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:$n.arrowOffset.varRef}},LF={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{xS(e)},effect:({state:e})=>()=>{xS(e)}},xS=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=EF(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:$n.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},zF={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},FF={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function BF(e,t="ltr"){var n,r;const o=((n=zF[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=FF[e])!=null?r:o}var Dr="top",ko="bottom",jo="right",Ar="left",Rb="auto",Rd=[Dr,ko,jo,Ar],xc="start",Ju="end",HF="clippingParents",g3="viewport",Cu="popper",VF="reference",bS=Rd.reduce(function(e,t){return e.concat([t+"-"+xc,t+"-"+Ju])},[]),v3=[].concat(Rd,[Rb]).reduce(function(e,t){return e.concat([t,t+"-"+xc,t+"-"+Ju])},[]),WF="beforeRead",UF="read",GF="afterRead",KF="beforeMain",qF="main",XF="afterMain",QF="beforeWrite",YF="write",ZF="afterWrite",JF=[WF,UF,GF,KF,qF,XF,QF,YF,ZF];function ws(e){return e?(e.nodeName||"").toLowerCase():null}function no(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ui(e){var t=no(e).Element;return e instanceof t||e instanceof Element}function wo(e){var t=no(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Db(e){if(typeof ShadowRoot>"u")return!1;var t=no(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function eB(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!wo(s)||!ws(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function tB(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(u,p){return u[p]="",u},{});!wo(o)||!ws(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const nB={name:"applyStyles",enabled:!0,phase:"write",fn:eB,effect:tB,requires:["computeStyles"]};function Cs(e){return e.split("-")[0]}var Ai=Math.max,lm=Math.min,bc=Math.round;function T1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function x3(){return!/^((?!chrome|android).)*safari/i.test(T1())}function yc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&wo(e)&&(o=e.offsetWidth>0&&bc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&bc(r.height)/e.offsetHeight||1);var i=Ui(e)?no(e):window,l=i.visualViewport,u=!x3()&&n,p=(r.left+(u&&l?l.offsetLeft:0))/o,m=(r.top+(u&&l?l.offsetTop:0))/s,h=r.width/o,g=r.height/s;return{width:h,height:g,top:m,right:p+h,bottom:m+g,left:p,x:p,y:m}}function Ab(e){var t=yc(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Db(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function aa(e){return no(e).getComputedStyle(e)}function rB(e){return["table","td","th"].indexOf(ws(e))>=0}function ai(e){return((Ui(e)?e.ownerDocument:e.document)||window.document).documentElement}function Dh(e){return ws(e)==="html"?e:e.assignedSlot||e.parentNode||(Db(e)?e.host:null)||ai(e)}function yS(e){return!wo(e)||aa(e).position==="fixed"?null:e.offsetParent}function oB(e){var t=/firefox/i.test(T1()),n=/Trident/i.test(T1());if(n&&wo(e)){var r=aa(e);if(r.position==="fixed")return null}var o=Dh(e);for(Db(o)&&(o=o.host);wo(o)&&["html","body"].indexOf(ws(o))<0;){var s=aa(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Dd(e){for(var t=no(e),n=yS(e);n&&rB(n)&&aa(n).position==="static";)n=yS(n);return n&&(ws(n)==="html"||ws(n)==="body"&&aa(n).position==="static")?t:n||oB(e)||t}function Tb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Fu(e,t,n){return Ai(e,lm(t,n))}function sB(e,t,n){var r=Fu(e,t,n);return r>n?n:r}function y3(){return{top:0,right:0,bottom:0,left:0}}function C3(e){return Object.assign({},y3(),e)}function w3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var aB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,C3(typeof t!="number"?t:w3(t,Rd))};function iB(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Cs(n.placement),u=Tb(l),p=[Ar,jo].indexOf(l)>=0,m=p?"height":"width";if(!(!s||!i)){var h=aB(o.padding,n),g=Ab(s),x=u==="y"?Dr:Ar,y=u==="y"?ko:jo,b=n.rects.reference[m]+n.rects.reference[u]-i[u]-n.rects.popper[m],w=i[u]-n.rects.reference[u],S=Dd(s),j=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,_=b/2-w/2,E=h[x],I=j-g[m]-h[y],M=j/2-g[m]/2+_,R=Fu(E,M,I),D=u;n.modifiersData[r]=(t={},t[D]=R,t.centerOffset=R-M,t)}}function lB(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||b3(t.elements.popper,o)&&(t.elements.arrow=o))}const cB={name:"arrow",enabled:!0,phase:"main",fn:iB,effect:lB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cc(e){return e.split("-")[1]}var uB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dB(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bc(n*o)/o||0,y:bc(r*o)/o||0}}function CS(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,u=e.gpuAcceleration,p=e.adaptive,m=e.roundOffsets,h=e.isFixed,g=i.x,x=g===void 0?0:g,y=i.y,b=y===void 0?0:y,w=typeof m=="function"?m({x,y:b}):{x,y:b};x=w.x,b=w.y;var S=i.hasOwnProperty("x"),j=i.hasOwnProperty("y"),_=Ar,E=Dr,I=window;if(p){var M=Dd(n),R="clientHeight",D="clientWidth";if(M===no(n)&&(M=ai(n),aa(M).position!=="static"&&l==="absolute"&&(R="scrollHeight",D="scrollWidth")),M=M,o===Dr||(o===Ar||o===jo)&&s===Ju){E=ko;var A=h&&M===I&&I.visualViewport?I.visualViewport.height:M[R];b-=A-r.height,b*=u?1:-1}if(o===Ar||(o===Dr||o===ko)&&s===Ju){_=jo;var O=h&&M===I&&I.visualViewport?I.visualViewport.width:M[D];x-=O-r.width,x*=u?1:-1}}var T=Object.assign({position:l},p&&uB),X=m===!0?dB({x,y:b},no(n)):{x,y:b};if(x=X.x,b=X.y,u){var B;return Object.assign({},T,(B={},B[E]=j?"0":"",B[_]=S?"0":"",B.transform=(I.devicePixelRatio||1)<=1?"translate("+x+"px, "+b+"px)":"translate3d("+x+"px, "+b+"px, 0)",B))}return Object.assign({},T,(t={},t[E]=j?b+"px":"",t[_]=S?x+"px":"",t.transform="",t))}function fB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,p={placement:Cs(t.placement),variation:Cc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,CS(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,CS(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const pB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fB,data:{}};var Jf={passive:!0};function mB(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,u=no(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(m){m.addEventListener("scroll",n.update,Jf)}),l&&u.addEventListener("resize",n.update,Jf),function(){s&&p.forEach(function(m){m.removeEventListener("scroll",n.update,Jf)}),l&&u.removeEventListener("resize",n.update,Jf)}}const hB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:mB,data:{}};var gB={left:"right",right:"left",bottom:"top",top:"bottom"};function Np(e){return e.replace(/left|right|bottom|top/g,function(t){return gB[t]})}var vB={start:"end",end:"start"};function wS(e){return e.replace(/start|end/g,function(t){return vB[t]})}function Nb(e){var t=no(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function $b(e){return yc(ai(e)).left+Nb(e).scrollLeft}function xB(e,t){var n=no(e),r=ai(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;var p=x3();(p||!p&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:l+$b(e),y:u}}function bB(e){var t,n=ai(e),r=Nb(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Ai(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Ai(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+$b(e),u=-r.scrollTop;return aa(o||n).direction==="rtl"&&(l+=Ai(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:u}}function Lb(e){var t=aa(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function S3(e){return["html","body","#document"].indexOf(ws(e))>=0?e.ownerDocument.body:wo(e)&&Lb(e)?e:S3(Dh(e))}function Bu(e,t){var n;t===void 0&&(t=[]);var r=S3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=no(r),i=o?[s].concat(s.visualViewport||[],Lb(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(Bu(Dh(i)))}function N1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yB(e,t){var n=yc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function SS(e,t,n){return t===g3?N1(xB(e,n)):Ui(t)?yB(t,n):N1(bB(ai(e)))}function CB(e){var t=Bu(Dh(e)),n=["absolute","fixed"].indexOf(aa(e).position)>=0,r=n&&wo(e)?Dd(e):e;return Ui(r)?t.filter(function(o){return Ui(o)&&b3(o,r)&&ws(o)!=="body"}):[]}function wB(e,t,n,r){var o=t==="clippingParents"?CB(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(u,p){var m=SS(e,p,r);return u.top=Ai(m.top,u.top),u.right=lm(m.right,u.right),u.bottom=lm(m.bottom,u.bottom),u.left=Ai(m.left,u.left),u},SS(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function k3(e){var t=e.reference,n=e.element,r=e.placement,o=r?Cs(r):null,s=r?Cc(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case Dr:u={x:i,y:t.y-n.height};break;case ko:u={x:i,y:t.y+t.height};break;case jo:u={x:t.x+t.width,y:l};break;case Ar:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var p=o?Tb(o):null;if(p!=null){var m=p==="y"?"height":"width";switch(s){case xc:u[p]=u[p]-(t[m]/2-n[m]/2);break;case Ju:u[p]=u[p]+(t[m]/2-n[m]/2);break}}return u}function ed(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?HF:l,p=n.rootBoundary,m=p===void 0?g3:p,h=n.elementContext,g=h===void 0?Cu:h,x=n.altBoundary,y=x===void 0?!1:x,b=n.padding,w=b===void 0?0:b,S=C3(typeof w!="number"?w:w3(w,Rd)),j=g===Cu?VF:Cu,_=e.rects.popper,E=e.elements[y?j:g],I=wB(Ui(E)?E:E.contextElement||ai(e.elements.popper),u,m,i),M=yc(e.elements.reference),R=k3({reference:M,element:_,strategy:"absolute",placement:o}),D=N1(Object.assign({},_,R)),A=g===Cu?D:M,O={top:I.top-A.top+S.top,bottom:A.bottom-I.bottom+S.bottom,left:I.left-A.left+S.left,right:A.right-I.right+S.right},T=e.modifiersData.offset;if(g===Cu&&T){var X=T[o];Object.keys(O).forEach(function(B){var V=[jo,ko].indexOf(B)>=0?1:-1,U=[Dr,ko].indexOf(B)>=0?"y":"x";O[B]+=X[U]*V})}return O}function SB(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,p=u===void 0?v3:u,m=Cc(r),h=m?l?bS:bS.filter(function(y){return Cc(y)===m}):Rd,g=h.filter(function(y){return p.indexOf(y)>=0});g.length===0&&(g=h);var x=g.reduce(function(y,b){return y[b]=ed(e,{placement:b,boundary:o,rootBoundary:s,padding:i})[Cs(b)],y},{});return Object.keys(x).sort(function(y,b){return x[y]-x[b]})}function kB(e){if(Cs(e)===Rb)return[];var t=Np(e);return[wS(e),t,wS(t)]}function jB(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,u=n.fallbackPlacements,p=n.padding,m=n.boundary,h=n.rootBoundary,g=n.altBoundary,x=n.flipVariations,y=x===void 0?!0:x,b=n.allowedAutoPlacements,w=t.options.placement,S=Cs(w),j=S===w,_=u||(j||!y?[Np(w)]:kB(w)),E=[w].concat(_).reduce(function(re,G){return re.concat(Cs(G)===Rb?SB(t,{placement:G,boundary:m,rootBoundary:h,padding:p,flipVariations:y,allowedAutoPlacements:b}):G)},[]),I=t.rects.reference,M=t.rects.popper,R=new Map,D=!0,A=E[0],O=0;O<E.length;O++){var T=E[O],X=Cs(T),B=Cc(T)===xc,V=[Dr,ko].indexOf(X)>=0,U=V?"width":"height",N=ed(t,{placement:T,boundary:m,rootBoundary:h,altBoundary:g,padding:p}),$=V?B?jo:Ar:B?ko:Dr;I[U]>M[U]&&($=Np($));var q=Np($),F=[];if(s&&F.push(N[X]<=0),l&&F.push(N[$]<=0,N[q]<=0),F.every(function(re){return re})){A=T,D=!1;break}R.set(T,F)}if(D)for(var Q=y?3:1,Y=function(G){var K=E.find(function(ee){var ce=R.get(ee);if(ce)return ce.slice(0,G).every(function(J){return J})});if(K)return A=K,"break"},se=Q;se>0;se--){var ae=Y(se);if(ae==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const _B={name:"flip",enabled:!0,phase:"main",fn:jB,requiresIfExists:["offset"],data:{_skip:!1}};function kS(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function jS(e){return[Dr,jo,ko,Ar].some(function(t){return e[t]>=0})}function IB(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=ed(t,{elementContext:"reference"}),l=ed(t,{altBoundary:!0}),u=kS(i,r),p=kS(l,o,s),m=jS(u),h=jS(p);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:p,isReferenceHidden:m,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":h})}const PB={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:IB};function EB(e,t,n){var r=Cs(e),o=[Ar,Dr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[Ar,jo].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function MB(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=v3.reduce(function(m,h){return m[h]=EB(h,t.rects,s),m},{}),l=i[t.placement],u=l.x,p=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=i}const OB={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:MB};function RB(e){var t=e.state,n=e.name;t.modifiersData[n]=k3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const DB={name:"popperOffsets",enabled:!0,phase:"read",fn:RB,data:{}};function AB(e){return e==="x"?"y":"x"}function TB(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,u=n.boundary,p=n.rootBoundary,m=n.altBoundary,h=n.padding,g=n.tether,x=g===void 0?!0:g,y=n.tetherOffset,b=y===void 0?0:y,w=ed(t,{boundary:u,rootBoundary:p,padding:h,altBoundary:m}),S=Cs(t.placement),j=Cc(t.placement),_=!j,E=Tb(S),I=AB(E),M=t.modifiersData.popperOffsets,R=t.rects.reference,D=t.rects.popper,A=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(M){if(s){var B,V=E==="y"?Dr:Ar,U=E==="y"?ko:jo,N=E==="y"?"height":"width",$=M[E],q=$+w[V],F=$-w[U],Q=x?-D[N]/2:0,Y=j===xc?R[N]:D[N],se=j===xc?-D[N]:-R[N],ae=t.elements.arrow,re=x&&ae?Ab(ae):{width:0,height:0},G=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:y3(),K=G[V],ee=G[U],ce=Fu(0,R[N],re[N]),J=_?R[N]/2-Q-ce-K-O.mainAxis:Y-ce-K-O.mainAxis,ie=_?-R[N]/2+Q+ce+ee+O.mainAxis:se+ce+ee+O.mainAxis,de=t.elements.arrow&&Dd(t.elements.arrow),ge=de?E==="y"?de.clientTop||0:de.clientLeft||0:0,Ce=(B=T==null?void 0:T[E])!=null?B:0,he=$+J-Ce-ge,fe=$+ie-Ce,Oe=Fu(x?lm(q,he):q,$,x?Ai(F,fe):F);M[E]=Oe,X[E]=Oe-$}if(l){var _e,Ne=E==="x"?Dr:Ar,nt=E==="x"?ko:jo,$e=M[I],Pt=I==="y"?"height":"width",Ze=$e+w[Ne],ot=$e-w[nt],ye=[Dr,Ar].indexOf(S)!==-1,De=(_e=T==null?void 0:T[I])!=null?_e:0,ut=ye?Ze:$e-R[Pt]-D[Pt]-De+O.altAxis,bt=ye?$e+R[Pt]+D[Pt]-De-O.altAxis:ot,be=x&&ye?sB(ut,$e,bt):Fu(x?ut:Ze,$e,x?bt:ot);M[I]=be,X[I]=be-$e}t.modifiersData[r]=X}}const NB={name:"preventOverflow",enabled:!0,phase:"main",fn:TB,requiresIfExists:["offset"]};function $B(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function LB(e){return e===no(e)||!wo(e)?Nb(e):$B(e)}function zB(e){var t=e.getBoundingClientRect(),n=bc(t.width)/e.offsetWidth||1,r=bc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function FB(e,t,n){n===void 0&&(n=!1);var r=wo(t),o=wo(t)&&zB(t),s=ai(t),i=yc(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((ws(t)!=="body"||Lb(s))&&(l=LB(t)),wo(t)?(u=yc(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=$b(s))),{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function BB(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function HB(e){var t=BB(e);return JF.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function VB(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function WB(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var _S={placement:"bottom",modifiers:[],strategy:"absolute"};function IS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function UB(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?_S:o;return function(l,u,p){p===void 0&&(p=s);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},_S,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},h=[],g=!1,x={state:m,setOptions:function(S){var j=typeof S=="function"?S(m.options):S;b(),m.options=Object.assign({},s,m.options,j),m.scrollParents={reference:Ui(l)?Bu(l):l.contextElement?Bu(l.contextElement):[],popper:Bu(u)};var _=HB(WB([].concat(r,m.options.modifiers)));return m.orderedModifiers=_.filter(function(E){return E.enabled}),y(),x.update()},forceUpdate:function(){if(!g){var S=m.elements,j=S.reference,_=S.popper;if(IS(j,_)){m.rects={reference:FB(j,Dd(_),m.options.strategy==="fixed"),popper:Ab(_)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(O){return m.modifiersData[O.name]=Object.assign({},O.data)});for(var E=0;E<m.orderedModifiers.length;E++){if(m.reset===!0){m.reset=!1,E=-1;continue}var I=m.orderedModifiers[E],M=I.fn,R=I.options,D=R===void 0?{}:R,A=I.name;typeof M=="function"&&(m=M({state:m,options:D,name:A,instance:x})||m)}}}},update:VB(function(){return new Promise(function(w){x.forceUpdate(),w(m)})}),destroy:function(){b(),g=!0}};if(!IS(l,u))return x;x.setOptions(p).then(function(w){!g&&p.onFirstUpdate&&p.onFirstUpdate(w)});function y(){m.orderedModifiers.forEach(function(w){var S=w.name,j=w.options,_=j===void 0?{}:j,E=w.effect;if(typeof E=="function"){var I=E({state:m,name:S,instance:x,options:_}),M=function(){};h.push(I||M)}})}function b(){h.forEach(function(w){return w()}),h=[]}return x}}var GB=[hB,DB,pB,nB,OB,_B,NB,cB,PB],KB=UB({defaultModifiers:GB});function zb(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:i=!0,offset:l,gutter:u=8,flip:p=!0,boundary:m="clippingParents",preventOverflow:h=!0,matchWidth:g,direction:x="ltr"}=e,y=d.useRef(null),b=d.useRef(null),w=d.useRef(null),S=BF(r,x),j=d.useRef(()=>{}),_=d.useCallback(()=>{var O;!t||!y.current||!b.current||((O=j.current)==null||O.call(j),w.current=KB(y.current,b.current,{placement:S,modifiers:[LF,TF,AF,{...DF,enabled:!!g},{name:"eventListeners",...RF(i)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:l??[0,u]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:m}},...n??[]],strategy:o}),w.current.forceUpdate(),j.current=w.current.destroy)},[S,t,n,g,i,s,l,u,p,h,m,o]);d.useEffect(()=>()=>{var O;!y.current&&!b.current&&((O=w.current)==null||O.destroy(),w.current=null)},[]);const E=d.useCallback(O=>{y.current=O,_()},[_]),I=d.useCallback((O={},T=null)=>({...O,ref:It(E,T)}),[E]),M=d.useCallback(O=>{b.current=O,_()},[_]),R=d.useCallback((O={},T=null)=>({...O,ref:It(M,T),style:{...O.style,position:o,minWidth:g?void 0:"max-content",inset:"0 auto auto 0"}}),[o,M,g]),D=d.useCallback((O={},T=null)=>{const{size:X,shadowColor:B,bg:V,style:U,...N}=O;return{...N,ref:T,"data-popper-arrow":"",style:qB(O)}},[]),A=d.useCallback((O={},T=null)=>({...O,ref:T,"data-popper-arrow-inner":""}),[]);return{update(){var O;(O=w.current)==null||O.update()},forceUpdate(){var O;(O=w.current)==null||O.forceUpdate()},transformOrigin:$n.transformOrigin.varRef,referenceRef:E,popperRef:M,getPopperProps:R,getArrowProps:D,getArrowInnerProps:A,getReferenceProps:I}}function qB(e){const{size:t,shadowColor:n,bg:r,style:o}=e,s={...o,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function Fb(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=dn(n),i=dn(t),[l,u]=d.useState(e.defaultIsOpen||!1),p=r!==void 0?r:l,m=r!==void 0,h=d.useId(),g=o??`disclosure-${h}`,x=d.useCallback(()=>{m||u(!1),i==null||i()},[m,i]),y=d.useCallback(()=>{m||u(!0),s==null||s()},[m,s]),b=d.useCallback(()=>{p?x():y()},[p,y,x]);function w(j={}){return{...j,"aria-expanded":p,"aria-controls":g,onClick(_){var E;(E=j.onClick)==null||E.call(j,_),b()}}}function S(j={}){return{...j,hidden:!p,id:g}}return{isOpen:p,onOpen:y,onClose:x,onToggle:b,isControlled:m,getButtonProps:w,getDisclosureProps:S}}function XB(e){const{ref:t,handler:n,enabled:r=!0}=e,o=dn(n),i=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;d.useEffect(()=>{if(!r)return;const l=h=>{fv(h,t)&&(i.isPointerDown=!0)},u=h=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&fv(h,t)&&(i.isPointerDown=!1,o(h))},p=h=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&fv(h,t)&&(i.isPointerDown=!1,o(h))},m=j3(t.current);return m.addEventListener("mousedown",l,!0),m.addEventListener("mouseup",u,!0),m.addEventListener("touchstart",l,!0),m.addEventListener("touchend",p,!0),()=>{m.removeEventListener("mousedown",l,!0),m.removeEventListener("mouseup",u,!0),m.removeEventListener("touchstart",l,!0),m.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function fv(e,t){var n;const r=e.target;return r&&!j3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function j3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function _3(e){const{isOpen:t,ref:n}=e,[r,o]=d.useState(t),[s,i]=d.useState(!1);return d.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),Di(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var u;const p=Jz(n.current),m=new p.CustomEvent("animationend",{bubbles:!0});(u=n.current)==null||u.dispatchEvent(m)}}}function Bb(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[QB,YB,ZB,JB]=ub(),[eH,Ad]=Wt({strict:!1,name:"MenuContext"});function tH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function I3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function PS(e){return I3(e).activeElement===e}function nH(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:l,defaultIsOpen:u,onClose:p,onOpen:m,placement:h="bottom-start",lazyBehavior:g="unmount",direction:x,computePositionOnMount:y=!1,...b}=e,w=d.useRef(null),S=d.useRef(null),j=ZB(),_=d.useCallback(()=>{requestAnimationFrame(()=>{var ae;(ae=w.current)==null||ae.focus({preventScroll:!1})})},[]),E=d.useCallback(()=>{const ae=setTimeout(()=>{var re;if(o)(re=o.current)==null||re.focus();else{const G=j.firstEnabled();G&&B(G.index)}});q.current.add(ae)},[j,o]),I=d.useCallback(()=>{const ae=setTimeout(()=>{const re=j.lastEnabled();re&&B(re.index)});q.current.add(ae)},[j]),M=d.useCallback(()=>{m==null||m(),s?E():_()},[s,E,_,m]),{isOpen:R,onOpen:D,onClose:A,onToggle:O}=Fb({isOpen:l,defaultIsOpen:u,onClose:p,onOpen:M});XB({enabled:R&&r,ref:w,handler:ae=>{var re;(re=S.current)!=null&&re.contains(ae.target)||A()}});const T=zb({...b,enabled:R||y,placement:h,direction:x}),[X,B]=d.useState(-1);pa(()=>{R||B(-1)},[R]),h3(w,{focusRef:S,visible:R,shouldFocus:!0});const V=_3({isOpen:R,ref:w}),[U,N]=tH(t,"menu-button","menu-list"),$=d.useCallback(()=>{D(),_()},[D,_]),q=d.useRef(new Set([]));cH(()=>{q.current.forEach(ae=>clearTimeout(ae)),q.current.clear()});const F=d.useCallback(()=>{D(),E()},[E,D]),Q=d.useCallback(()=>{D(),I()},[D,I]),Y=d.useCallback(()=>{var ae,re;const G=I3(w.current),K=(ae=w.current)==null?void 0:ae.contains(G.activeElement);if(!(R&&!K))return;const ce=(re=j.item(X))==null?void 0:re.node;ce==null||ce.focus()},[R,X,j]),se=d.useRef(null);return{openAndFocusMenu:$,openAndFocusFirstItem:F,openAndFocusLastItem:Q,onTransitionEnd:Y,unstable__animationState:V,descendants:j,popper:T,buttonId:U,menuId:N,forceUpdate:T.forceUpdate,orientation:"vertical",isOpen:R,onToggle:O,onOpen:D,onClose:A,menuRef:w,buttonRef:S,focusedIndex:X,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:B,isLazy:i,lazyBehavior:g,initialFocusRef:o,rafId:se}}function rH(e={},t=null){const n=Ad(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,l=d.useCallback(u=>{const p=u.key,h={Enter:s,ArrowDown:s,ArrowUp:i}[p];h&&(u.preventDefault(),u.stopPropagation(),h(u))},[s,i]);return{...e,ref:It(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":dt(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:He(e.onClick,r),onKeyDown:He(e.onKeyDown,l)}}function $1(e){var t;return iH(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function oH(e={},t=null){const n=Ad();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:i,onClose:l,menuId:u,isLazy:p,lazyBehavior:m,unstable__animationState:h}=n,g=YB(),x=wF({preventDefault:S=>S.key!==" "&&$1(S.target)}),y=d.useCallback(S=>{if(!S.currentTarget.contains(S.target))return;const j=S.key,E={Tab:M=>M.preventDefault(),Escape:l,ArrowDown:()=>{const M=g.nextEnabled(r);M&&o(M.index)},ArrowUp:()=>{const M=g.prevEnabled(r);M&&o(M.index)}}[j];if(E){S.preventDefault(),E(S);return}const I=x(M=>{const R=SF(g.values(),M,D=>{var A,O;return(O=(A=D==null?void 0:D.node)==null?void 0:A.textContent)!=null?O:""},g.item(r));if(R){const D=g.indexOf(R.node);o(D)}});$1(S.target)&&I(S)},[g,r,x,l,o]),b=d.useRef(!1);i&&(b.current=!0);const w=Bb({wasSelected:b.current,enabled:p,mode:m,isSelected:h.present});return{...e,ref:It(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:u,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:He(e.onKeyDown,y)}}function sH(e={}){const{popper:t,isOpen:n}=Ad();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function aH(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:l,isFocusable:u,closeOnSelect:p,type:m,...h}=e,g=Ad(),{setFocusedIndex:x,focusedIndex:y,closeOnSelect:b,onClose:w,menuRef:S,isOpen:j,menuId:_,rafId:E}=g,I=d.useRef(null),M=`${_}-menuitem-${d.useId()}`,{index:R,register:D}=JB({disabled:l&&!u}),A=d.useCallback($=>{n==null||n($),!l&&x(R)},[x,R,l,n]),O=d.useCallback($=>{r==null||r($),I.current&&!PS(I.current)&&A($)},[A,r]),T=d.useCallback($=>{o==null||o($),!l&&x(-1)},[x,l,o]),X=d.useCallback($=>{s==null||s($),$1($.currentTarget)&&(p??b)&&w()},[w,s,b,p]),B=d.useCallback($=>{i==null||i($),x(R)},[x,i,R]),V=R===y,U=l&&!u;pa(()=>{j&&(V&&!U&&I.current?(E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(()=>{var $;($=I.current)==null||$.focus(),E.current=null})):S.current&&!PS(S.current)&&S.current.focus({preventScroll:!0}))},[V,U,S,j]);const N=m3({onClick:X,onFocus:B,onMouseEnter:A,onMouseMove:O,onMouseLeave:T,ref:It(D,I,t),isDisabled:l,isFocusable:u});return{...h,...N,type:m??N.type,id:M,role:"menuitem",tabIndex:V?0:-1}}function iH(e){var t;if(!lH(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function lH(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function cH(e,t=[]){return d.useEffect(()=>()=>e(),t)}var[uH,$c]=Wt({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Ah=e=>{const{children:t}=e,n=Un("Menu",e),r=on(e),{direction:o}=bd(),{descendants:s,...i}=nH({...r,direction:o}),l=d.useMemo(()=>i,[i]),{isOpen:u,onClose:p,forceUpdate:m}=l;return a.jsx(QB,{value:s,children:a.jsx(eH,{value:l,children:a.jsx(uH,{value:n,children:zx(t,{isOpen:u,onClose:p,forceUpdate:m})})})})};Ah.displayName="Menu";var P3=je((e,t)=>{const n=$c();return a.jsx(we.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});P3.displayName="MenuCommand";var dH=je((e,t)=>{const{type:n,...r}=e,o=$c(),s=r.as||n?n??void 0:"button",i=d.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return a.jsx(we.button,{ref:t,type:s,...r,__css:i})}),E3=e=>{const{className:t,children:n,...r}=e,o=$c(),s=d.Children.only(n),i=d.isValidElement(s)?d.cloneElement(s,{focusable:"false","aria-hidden":!0,className:Ye("chakra-menu__icon",s.props.className)}):null,l=Ye("chakra-menu__icon-wrapper",t);return a.jsx(we.span,{className:l,...r,__css:o.icon,children:i})};E3.displayName="MenuIcon";var en=je((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...l}=e,u=aH(l,t),m=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(dH,{...u,className:Ye("chakra-menu__menuitem",u.className),children:[n&&a.jsx(E3,{fontSize:"0.8em",marginEnd:r,children:n}),m,o&&a.jsx(P3,{marginStart:s,children:o})]})});en.displayName="MenuItem";var fH={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},pH=we(In.div),Gi=je(function(t,n){var r,o;const{rootProps:s,motionProps:i,...l}=t,{isOpen:u,onTransitionEnd:p,unstable__animationState:m}=Ad(),h=oH(l,n),g=sH(s),x=$c();return a.jsx(we.div,{...g,__css:{zIndex:(o=t.zIndex)!=null?o:(r=x.list)==null?void 0:r.zIndex},children:a.jsx(pH,{variants:fH,initial:!1,animate:u?"enter":"exit",__css:{outline:0,...x.list},...i,className:Ye("chakra-menu__menu-list",h.className),...h,onUpdate:p,onAnimationComplete:ph(m.onComplete,h.onAnimationComplete)})})});Gi.displayName="MenuList";var td=je((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=Ye("chakra-menu__group__title",o),l=$c();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(we.p,{className:i,...s,__css:l.groupTitle,children:n}),r]})});td.displayName="MenuGroup";var mH=je((e,t)=>{const n=$c();return a.jsx(we.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Th=je((e,t)=>{const{children:n,as:r,...o}=e,s=rH(o,t),i=r||mH;return a.jsx(i,{...s,className:Ye("chakra-menu__menu-button",e.className),children:a.jsx(we.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Th.displayName="MenuButton";var hH={slideInBottom:{...w1,custom:{offsetY:16,reverse:!0}},slideInRight:{...w1,custom:{offsetX:16,reverse:!0}},scale:{...a5,custom:{initialScale:.95,reverse:!0}},none:{}},gH=we(In.section),vH=e=>hH[e||"none"],M3=d.forwardRef((e,t)=>{const{preset:n,motionProps:r=vH(n),...o}=e;return a.jsx(gH,{ref:t,...r,...o})});M3.displayName="ModalTransition";var xH=Object.defineProperty,bH=(e,t,n)=>t in e?xH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yH=(e,t,n)=>(bH(e,typeof t!="symbol"?t+"":t,n),n),CH=class{constructor(){yH(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},L1=new CH;function O3(e,t){const[n,r]=d.useState(0);return d.useEffect(()=>{const o=e.current;if(o){if(t){const s=L1.add(o);r(s)}return()=>{L1.remove(o),r(0)}}},[t,e]),n}var wH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dl=new WeakMap,ep=new WeakMap,tp={},pv=0,R3=function(e){return e&&(e.host||R3(e.parentNode))},SH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=R3(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kH=function(e,t,n,r){var o=SH(t,Array.isArray(e)?e:[e]);tp[n]||(tp[n]=new WeakMap);var s=tp[n],i=[],l=new Set,u=new Set(o),p=function(h){!h||l.has(h)||(l.add(h),p(h.parentNode))};o.forEach(p);var m=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(g){if(l.has(g))m(g);else{var x=g.getAttribute(r),y=x!==null&&x!=="false",b=(Dl.get(g)||0)+1,w=(s.get(g)||0)+1;Dl.set(g,b),s.set(g,w),i.push(g),b===1&&y&&ep.set(g,!0),w===1&&g.setAttribute(n,"true"),y||g.setAttribute(r,"true")}})};return m(t),l.clear(),pv++,function(){i.forEach(function(h){var g=Dl.get(h)-1,x=s.get(h)-1;Dl.set(h,g),s.set(h,x),g||(ep.has(h)||h.removeAttribute(r),ep.delete(h)),x||h.removeAttribute(n)}),pv--,pv||(Dl=new WeakMap,Dl=new WeakMap,ep=new WeakMap,tp={})}},jH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||wH(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),kH(r,o,n,"aria-hidden")):function(){return null}};function _H(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:l,onEsc:u}=e,p=d.useRef(null),m=d.useRef(null),[h,g,x]=PH(r,"chakra-modal","chakra-modal--header","chakra-modal--body");IH(p,t&&i);const y=O3(p,t),b=d.useRef(null),w=d.useCallback(A=>{b.current=A.target},[]),S=d.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),u==null||u())},[s,n,u]),[j,_]=d.useState(!1),[E,I]=d.useState(!1),M=d.useCallback((A={},O=null)=>({role:"dialog",...A,ref:It(O,p),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":j?g:void 0,"aria-describedby":E?x:void 0,onClick:He(A.onClick,T=>T.stopPropagation())}),[x,E,h,g,j]),R=d.useCallback(A=>{A.stopPropagation(),b.current===A.target&&L1.isTopModal(p.current)&&(o&&(n==null||n()),l==null||l())},[n,o,l]),D=d.useCallback((A={},O=null)=>({...A,ref:It(O,m),onClick:He(A.onClick,R),onKeyDown:He(A.onKeyDown,S),onMouseDown:He(A.onMouseDown,w)}),[S,w,R]);return{isOpen:t,onClose:n,headerId:g,bodyId:x,setBodyMounted:I,setHeaderMounted:_,dialogRef:p,overlayRef:m,getDialogProps:M,getDialogContainerProps:D,index:y}}function IH(e,t){const n=e.current;d.useEffect(()=>{if(!(!e.current||!t))return jH(e.current)},[t,e,n])}function PH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[EH,Lc]=Wt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[MH,Ki]=Wt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),qi=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x,onCloseComplete:y}=t,b=Un("Modal",t),S={..._H(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x};return a.jsx(MH,{value:S,children:a.jsx(EH,{value:b,children:a.jsx(dr,{onExitComplete:y,children:S.isOpen&&a.jsx(Ac,{...n,children:r})})})})};qi.displayName="Modal";var $p="right-scroll-bar-position",Lp="width-before-scroll-bar",OH="with-scroll-bars-hidden",RH="--removed-body-scroll-bar-size",D3=E5(),mv=function(){},Nh=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:mv,onWheelCapture:mv,onTouchMoveCapture:mv}),o=r[0],s=r[1],i=e.forwardProps,l=e.children,u=e.className,p=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,x=e.noIsolation,y=e.inert,b=e.allowPinchZoom,w=e.as,S=w===void 0?"div":w,j=e.gapMode,_=_5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=j5([n,t]),M=gs(gs({},_),o);return d.createElement(d.Fragment,null,m&&d.createElement(E,{sideCar:D3,removeScrollBar:p,shards:h,noIsolation:x,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:j}),i?d.cloneElement(d.Children.only(l),gs(gs({},M),{ref:I})):d.createElement(S,gs({},M,{className:u,ref:I}),l))});Nh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nh.classNames={fullWidth:Lp,zeroRight:$p};var ES,DH=function(){if(ES)return ES;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DH();return t&&e.setAttribute("nonce",t),e}function TH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function NH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $H=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AH())&&(TH(t,n),NH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LH=function(){var e=$H();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},A3=function(){var e=LH(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},zH={left:0,top:0,right:0,gap:0},hv=function(e){return parseInt(e||"",10)||0},FH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[hv(n),hv(r),hv(o)]},BH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zH;var t=FH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},HH=A3(),VH=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
-  .`.concat(OH,` {
-   overflow: hidden `).concat(r,`;
-   padding-right: `).concat(l,"px ").concat(r,`;
-  }
-  body {
-    overflow: hidden `).concat(r,`;
-    overscroll-behavior: contain;
-    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
-    padding-left: `.concat(o,`px;
-    padding-top: `).concat(s,`px;
-    padding-right: `).concat(i,`px;
-    margin-left:0;
-    margin-top:0;
-    margin-right: `).concat(l,"px ").concat(r,`;
-    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
-  }
-  
-  .`).concat($p,` {
-    right: `).concat(l,"px ").concat(r,`;
-  }
-  
-  .`).concat(Lp,` {
-    margin-right: `).concat(l,"px ").concat(r,`;
-  }
-  
-  .`).concat($p," .").concat($p,` {
-    right: 0 `).concat(r,`;
-  }
-  
-  .`).concat(Lp," .").concat(Lp,` {
-    margin-right: 0 `).concat(r,`;
-  }
-  
-  body {
-    `).concat(RH,": ").concat(l,`px;
-  }
-`)},WH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=d.useMemo(function(){return BH(o)},[o]);return d.createElement(HH,{styles:VH(s,!t,o,n?"":"!important")})},z1=!1;if(typeof window<"u")try{var np=Object.defineProperty({},"passive",{get:function(){return z1=!0,!0}});window.addEventListener("test",np,np),window.removeEventListener("test",np,np)}catch{z1=!1}var Al=z1?{passive:!1}:!1,UH=function(e){return e.tagName==="TEXTAREA"},T3=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!UH(e)&&n[t]==="visible")},GH=function(e){return T3(e,"overflowY")},KH=function(e){return T3(e,"overflowX")},MS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=N3(e,r);if(o){var s=$3(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},XH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},N3=function(e,t){return e==="v"?GH(t):KH(t)},$3=function(e,t){return e==="v"?qH(t):XH(t)},QH=function(e,t){return e==="h"&&t==="rtl"?-1:1},YH=function(e,t,n,r,o){var s=QH(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,u=t.contains(l),p=!1,m=i>0,h=0,g=0;do{var x=$3(e,l),y=x[0],b=x[1],w=x[2],S=b-w-s*y;(y||S)&&N3(e,l)&&(h+=S,g+=y),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(m&&(o&&h===0||!o&&i>h)||!m&&(o&&g===0||!o&&-i>g))&&(p=!0),p},rp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},OS=function(e){return[e.deltaX,e.deltaY]},RS=function(e){return e&&"current"in e?e.current:e},ZH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},JH=function(e){return`
-  .block-interactivity-`.concat(e,` {pointer-events: none;}
-  .allow-interactivity-`).concat(e,` {pointer-events: all;}
-`)},eV=0,Tl=[];function tV(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(eV++)[0],s=d.useState(A3)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=M1([e.lockRef.current],(e.shards||[]).map(RS),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!i.current.allowPinchZoom;var S=rp(b),j=n.current,_="deltaX"in b?b.deltaX:j[0]-S[0],E="deltaY"in b?b.deltaY:j[1]-S[1],I,M=b.target,R=Math.abs(_)>Math.abs(E)?"h":"v";if("touches"in b&&R==="h"&&M.type==="range")return!1;var D=MS(R,M);if(!D)return!0;if(D?I=R:(I=R==="v"?"h":"v",D=MS(R,M)),!D)return!1;if(!r.current&&"changedTouches"in b&&(_||E)&&(r.current=I),!I)return!0;var A=r.current||I;return YH(A,w,b,A==="h"?_:E,!0)},[]),u=d.useCallback(function(b){var w=b;if(!(!Tl.length||Tl[Tl.length-1]!==s)){var S="deltaY"in w?OS(w):rp(w),j=t.current.filter(function(I){return I.name===w.type&&I.target===w.target&&ZH(I.delta,S)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var _=(i.current.shards||[]).map(RS).filter(Boolean).filter(function(I){return I.contains(w.target)}),E=_.length>0?l(w,_[0]):!i.current.noIsolation;E&&w.cancelable&&w.preventDefault()}}},[]),p=d.useCallback(function(b,w,S,j){var _={name:b,delta:w,target:S,should:j};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(E){return E!==_})},1)},[]),m=d.useCallback(function(b){n.current=rp(b),r.current=void 0},[]),h=d.useCallback(function(b){p(b.type,OS(b),b.target,l(b,e.lockRef.current))},[]),g=d.useCallback(function(b){p(b.type,rp(b),b.target,l(b,e.lockRef.current))},[]);d.useEffect(function(){return Tl.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Al),document.addEventListener("touchmove",u,Al),document.addEventListener("touchstart",m,Al),function(){Tl=Tl.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,Al),document.removeEventListener("touchmove",u,Al),document.removeEventListener("touchstart",m,Al)}},[]);var x=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(s,{styles:JH(o)}):null,x?d.createElement(WH,{gapMode:e.gapMode}):null)}const nV=nz(D3,tV);var L3=d.forwardRef(function(e,t){return d.createElement(Nh,gs({},e,{ref:t,sideCar:nV}))});L3.classNames=Nh.classNames;const rV=L3;function oV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:l,returnFocusOnClose:u,preserveScrollBarGap:p,lockFocusAcrossFrames:m,isOpen:h}=Ki(),[g,x]=FR();d.useEffect(()=>{!g&&x&&setTimeout(x)},[g,x]);const y=O3(r,h);return a.jsx(a3,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:u,contentRef:r,lockFocusAcrossFrames:m,children:a.jsx(rV,{removeScrollBar:!p,allowPinchZoom:i,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var Xi=je((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:l,getDialogContainerProps:u}=Ki(),p=l(i,t),m=u(o),h=Ye("chakra-modal__content",n),g=Lc(),x={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...g.dialog},y={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...g.dialogContainer},{motionPreset:b}=Ki();return a.jsx(oV,{children:a.jsx(we.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:y,children:a.jsx(M3,{preset:b,motionProps:s,className:h,...p,__css:x,children:r})})})});Xi.displayName="ModalContent";function Td(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(qi,{...n,initialFocusRef:t})}var Nd=je((e,t)=>a.jsx(Xi,{ref:t,role:"alertdialog",...e})),Ss=je((e,t)=>{const{className:n,...r}=e,o=Ye("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...Lc().footer};return a.jsx(we.footer,{ref:t,...r,__css:i,className:o})});Ss.displayName="ModalFooter";var Qo=je((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Ki();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ye("chakra-modal__header",n),u={flex:0,...Lc().header};return a.jsx(we.header,{ref:t,className:i,id:o,...r,__css:u})});Qo.displayName="ModalHeader";var sV=we(In.div),Yo=je((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=Ye("chakra-modal__overlay",n),u={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Lc().overlay},{motionPreset:p}=Ki(),h=o||(p==="none"?{}:s5);return a.jsx(sV,{...h,__css:u,ref:t,className:i,...s})});Yo.displayName="ModalOverlay";var Zo=je((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Ki();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ye("chakra-modal__body",n),l=Lc();return a.jsx(we.div,{ref:t,className:i,id:o,...r,__css:l.body})});Zo.displayName="ModalBody";var $d=je((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Ki(),i=Ye("chakra-modal__close-btn",r),l=Lc();return a.jsx(eI,{ref:t,__css:l.closeButton,className:i,onClick:He(n,u=>{u.stopPropagation(),s()}),...o})});$d.displayName="ModalCloseButton";var aV=e=>a.jsx(Nn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),iV=e=>a.jsx(Nn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function DS(e,t,n,r){d.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,i=Array.isArray(t)?t:[t],l=new s.MutationObserver(u=>{for(const p of u)p.type==="attributes"&&p.attributeName&&i.includes(p.attributeName)&&n(p)});return l.observe(e.current,{attributes:!0,attributeFilter:i}),()=>l.disconnect()})}function lV(e,t){const n=dn(e);d.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var cV=50,AS=300;function uV(e,t){const[n,r]=d.useState(!1),[o,s]=d.useState(null),[i,l]=d.useState(!0),u=d.useRef(null),p=()=>clearTimeout(u.current);lV(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?cV:null);const m=d.useCallback(()=>{i&&e(),u.current=setTimeout(()=>{l(!1),r(!0),s("increment")},AS)},[e,i]),h=d.useCallback(()=>{i&&t(),u.current=setTimeout(()=>{l(!1),r(!0),s("decrement")},AS)},[t,i]),g=d.useCallback(()=>{l(!0),r(!1),p()},[]);return d.useEffect(()=>()=>p(),[]),{up:m,down:h,stop:g,isSpinning:n}}var dV=/^[Ee0-9+\-.]$/;function fV(e){return dV.test(e)}function pV(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function mV(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:i=1,isReadOnly:l,isDisabled:u,isRequired:p,isInvalid:m,pattern:h="[0-9]*(.[0-9]+)?",inputMode:g="decimal",allowMouseWheel:x,id:y,onChange:b,precision:w,name:S,"aria-describedby":j,"aria-label":_,"aria-labelledby":E,onFocus:I,onBlur:M,onInvalid:R,getAriaValueText:D,isValidCharacter:A,format:O,parse:T,...X}=e,B=dn(I),V=dn(M),U=dn(R),N=dn(A??fV),$=dn(D),q=NL(e),{update:F,increment:Q,decrement:Y}=q,[se,ae]=d.useState(!1),re=!(l||u),G=d.useRef(null),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useCallback(be=>be.split("").filter(N).join(""),[N]),ie=d.useCallback(be=>{var Je;return(Je=T==null?void 0:T(be))!=null?Je:be},[T]),de=d.useCallback(be=>{var Je;return((Je=O==null?void 0:O(be))!=null?Je:be).toString()},[O]);pa(()=>{(q.valueAsNumber>s||q.valueAsNumber<o)&&(U==null||U("rangeOverflow",de(q.value),q.valueAsNumber))},[q.valueAsNumber,q.value,de,U]),rc(()=>{if(!G.current)return;if(G.current.value!=q.value){const Je=ie(G.current.value);q.setValue(J(Je))}},[ie,J]);const ge=d.useCallback((be=i)=>{re&&Q(be)},[Q,re,i]),Ce=d.useCallback((be=i)=>{re&&Y(be)},[Y,re,i]),he=uV(ge,Ce);DS(ee,"disabled",he.stop,he.isSpinning),DS(ce,"disabled",he.stop,he.isSpinning);const fe=d.useCallback(be=>{if(be.nativeEvent.isComposing)return;const lt=ie(be.currentTarget.value);F(J(lt)),K.current={start:be.currentTarget.selectionStart,end:be.currentTarget.selectionEnd}},[F,J,ie]),Oe=d.useCallback(be=>{var Je,lt,ft;B==null||B(be),K.current&&(be.target.selectionStart=(lt=K.current.start)!=null?lt:(Je=be.currentTarget.value)==null?void 0:Je.length,be.currentTarget.selectionEnd=(ft=K.current.end)!=null?ft:be.currentTarget.selectionStart)},[B]),_e=d.useCallback(be=>{if(be.nativeEvent.isComposing)return;pV(be,N)||be.preventDefault();const Je=Ne(be)*i,lt=be.key,Me={ArrowUp:()=>ge(Je),ArrowDown:()=>Ce(Je),Home:()=>F(o),End:()=>F(s)}[lt];Me&&(be.preventDefault(),Me(be))},[N,i,ge,Ce,F,o,s]),Ne=be=>{let Je=1;return(be.metaKey||be.ctrlKey)&&(Je=.1),be.shiftKey&&(Je=10),Je},nt=d.useMemo(()=>{const be=$==null?void 0:$(q.value);if(be!=null)return be;const Je=q.value.toString();return Je||void 0},[q.value,$]),$e=d.useCallback(()=>{let be=q.value;if(q.value==="")return;/^[eE]/.test(q.value.toString())?q.setValue(""):(q.valueAsNumber<o&&(be=o),q.valueAsNumber>s&&(be=s),q.cast(be))},[q,s,o]),Pt=d.useCallback(()=>{ae(!1),n&&$e()},[n,ae,$e]),Ze=d.useCallback(()=>{t&&requestAnimationFrame(()=>{var be;(be=G.current)==null||be.focus()})},[t]),ot=d.useCallback(be=>{be.preventDefault(),he.up(),Ze()},[Ze,he]),ye=d.useCallback(be=>{be.preventDefault(),he.down(),Ze()},[Ze,he]);Di(()=>G.current,"wheel",be=>{var Je,lt;const Me=((lt=(Je=G.current)==null?void 0:Je.ownerDocument)!=null?lt:document).activeElement===G.current;if(!x||!Me)return;be.preventDefault();const Le=Ne(be)*i,Ut=Math.sign(be.deltaY);Ut===-1?ge(Le):Ut===1&&Ce(Le)},{passive:!1});const De=d.useCallback((be={},Je=null)=>{const lt=u||r&&q.isAtMax;return{...be,ref:It(Je,ee),role:"button",tabIndex:-1,onPointerDown:He(be.onPointerDown,ft=>{ft.button!==0||lt||ot(ft)}),onPointerLeave:He(be.onPointerLeave,he.stop),onPointerUp:He(be.onPointerUp,he.stop),disabled:lt,"aria-disabled":Co(lt)}},[q.isAtMax,r,ot,he.stop,u]),ut=d.useCallback((be={},Je=null)=>{const lt=u||r&&q.isAtMin;return{...be,ref:It(Je,ce),role:"button",tabIndex:-1,onPointerDown:He(be.onPointerDown,ft=>{ft.button!==0||lt||ye(ft)}),onPointerLeave:He(be.onPointerLeave,he.stop),onPointerUp:He(be.onPointerUp,he.stop),disabled:lt,"aria-disabled":Co(lt)}},[q.isAtMin,r,ye,he.stop,u]),bt=d.useCallback((be={},Je=null)=>{var lt,ft,Me,Le;return{name:S,inputMode:g,type:"text",pattern:h,"aria-labelledby":E,"aria-label":_,"aria-describedby":j,id:y,disabled:u,...be,readOnly:(lt=be.readOnly)!=null?lt:l,"aria-readonly":(ft=be.readOnly)!=null?ft:l,"aria-required":(Me=be.required)!=null?Me:p,required:(Le=be.required)!=null?Le:p,ref:It(G,Je),value:de(q.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(q.valueAsNumber)?void 0:q.valueAsNumber,"aria-invalid":Co(m??q.isOutOfRange),"aria-valuetext":nt,autoComplete:"off",autoCorrect:"off",onChange:He(be.onChange,fe),onKeyDown:He(be.onKeyDown,_e),onFocus:He(be.onFocus,Oe,()=>ae(!0)),onBlur:He(be.onBlur,V,Pt)}},[S,g,h,E,_,de,j,y,u,p,l,m,q.value,q.valueAsNumber,q.isOutOfRange,o,s,nt,fe,_e,Oe,V,Pt]);return{value:de(q.value),valueAsNumber:q.valueAsNumber,isFocused:se,isDisabled:u,isReadOnly:l,getIncrementButtonProps:De,getDecrementButtonProps:ut,getInputProps:bt,htmlProps:X}}var[hV,$h]=Wt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[gV,Hb]=Wt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Lh=je(function(t,n){const r=Un("NumberInput",t),o=on(t),s=mb(o),{htmlProps:i,...l}=mV(s),u=d.useMemo(()=>l,[l]);return a.jsx(gV,{value:u,children:a.jsx(hV,{value:r,children:a.jsx(we.div,{...i,ref:n,className:Ye("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Lh.displayName="NumberInput";var zh=je(function(t,n){const r=$h();return a.jsx(we.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});zh.displayName="NumberInputStepper";var Fh=je(function(t,n){const{getInputProps:r}=Hb(),o=r(t,n),s=$h();return a.jsx(we.input,{...o,className:Ye("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Fh.displayName="NumberInputField";var z3=we("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Bh=je(function(t,n){var r;const o=$h(),{getDecrementButtonProps:s}=Hb(),i=s(t,n);return a.jsx(z3,{...i,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(aV,{})})});Bh.displayName="NumberDecrementStepper";var Hh=je(function(t,n){var r;const{getIncrementButtonProps:o}=Hb(),s=o(t,n),i=$h();return a.jsx(z3,{...s,__css:i.stepper,children:(r=t.children)!=null?r:a.jsx(iV,{})})});Hh.displayName="NumberIncrementStepper";var[vV,nl]=Wt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[xV,Vh]=Wt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Wh(e){const t=d.Children.only(e.children),{getTriggerProps:n}=nl();return d.cloneElement(t,n(t.props,t.ref))}Wh.displayName="PopoverTrigger";var Nl={click:"click",hover:"hover"};function bV(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:l,arrowShadowColor:u,trigger:p=Nl.click,openDelay:m=200,closeDelay:h=200,isLazy:g,lazyBehavior:x="unmount",computePositionOnMount:y,...b}=e,{isOpen:w,onClose:S,onOpen:j,onToggle:_}=Fb(e),E=d.useRef(null),I=d.useRef(null),M=d.useRef(null),R=d.useRef(!1),D=d.useRef(!1);w&&(D.current=!0);const[A,O]=d.useState(!1),[T,X]=d.useState(!1),B=d.useId(),V=o??B,[U,N,$,q]=["popover-trigger","popover-content","popover-header","popover-body"].map(fe=>`${fe}-${V}`),{referenceRef:F,getArrowProps:Q,getPopperProps:Y,getArrowInnerProps:se,forceUpdate:ae}=zb({...b,enabled:w||!!y}),re=_3({isOpen:w,ref:M});b5({enabled:w,ref:I}),h3(M,{focusRef:I,visible:w,shouldFocus:s&&p===Nl.click}),IF(M,{focusRef:r,visible:w,shouldFocus:i&&p===Nl.click});const G=Bb({wasSelected:D.current,enabled:g,mode:x,isSelected:re.present}),K=d.useCallback((fe={},Oe=null)=>{const _e={...fe,style:{...fe.style,transformOrigin:$n.transformOrigin.varRef,[$n.arrowSize.var]:l?`${l}px`:void 0,[$n.arrowShadowColor.var]:u},ref:It(M,Oe),children:G?fe.children:null,id:N,tabIndex:-1,role:"dialog",onKeyDown:He(fe.onKeyDown,Ne=>{n&&Ne.key==="Escape"&&S()}),onBlur:He(fe.onBlur,Ne=>{const nt=TS(Ne),$e=gv(M.current,nt),Pt=gv(I.current,nt);w&&t&&(!$e&&!Pt)&&S()}),"aria-labelledby":A?$:void 0,"aria-describedby":T?q:void 0};return p===Nl.hover&&(_e.role="tooltip",_e.onMouseEnter=He(fe.onMouseEnter,()=>{R.current=!0}),_e.onMouseLeave=He(fe.onMouseLeave,Ne=>{Ne.nativeEvent.relatedTarget!==null&&(R.current=!1,setTimeout(()=>S(),h))})),_e},[G,N,A,$,T,q,p,n,S,w,t,h,u,l]),ee=d.useCallback((fe={},Oe=null)=>Y({...fe,style:{visibility:w?"visible":"hidden",...fe.style}},Oe),[w,Y]),ce=d.useCallback((fe,Oe=null)=>({...fe,ref:It(Oe,E,F)}),[E,F]),J=d.useRef(),ie=d.useRef(),de=d.useCallback(fe=>{E.current==null&&F(fe)},[F]),ge=d.useCallback((fe={},Oe=null)=>{const _e={...fe,ref:It(I,Oe,de),id:U,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":N};return p===Nl.click&&(_e.onClick=He(fe.onClick,_)),p===Nl.hover&&(_e.onFocus=He(fe.onFocus,()=>{J.current===void 0&&j()}),_e.onBlur=He(fe.onBlur,Ne=>{const nt=TS(Ne),$e=!gv(M.current,nt);w&&t&&$e&&S()}),_e.onKeyDown=He(fe.onKeyDown,Ne=>{Ne.key==="Escape"&&S()}),_e.onMouseEnter=He(fe.onMouseEnter,()=>{R.current=!0,J.current=window.setTimeout(()=>j(),m)}),_e.onMouseLeave=He(fe.onMouseLeave,()=>{R.current=!1,J.current&&(clearTimeout(J.current),J.current=void 0),ie.current=window.setTimeout(()=>{R.current===!1&&S()},h)})),_e},[U,w,N,p,de,_,j,t,S,m,h]);d.useEffect(()=>()=>{J.current&&clearTimeout(J.current),ie.current&&clearTimeout(ie.current)},[]);const Ce=d.useCallback((fe={},Oe=null)=>({...fe,id:$,ref:It(Oe,_e=>{O(!!_e)})}),[$]),he=d.useCallback((fe={},Oe=null)=>({...fe,id:q,ref:It(Oe,_e=>{X(!!_e)})}),[q]);return{forceUpdate:ae,isOpen:w,onAnimationComplete:re.onComplete,onClose:S,getAnchorProps:ce,getArrowProps:Q,getArrowInnerProps:se,getPopoverPositionerProps:ee,getPopoverProps:K,getTriggerProps:ge,getHeaderProps:Ce,getBodyProps:he}}function gv(e,t){return e===t||(e==null?void 0:e.contains(t))}function TS(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function Ld(e){const t=Un("Popover",e),{children:n,...r}=on(e),o=bd(),s=bV({...r,direction:o.direction});return a.jsx(vV,{value:s,children:a.jsx(xV,{value:t,children:zx(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}Ld.displayName="Popover";function F3(e){const t=d.Children.only(e.children),{getAnchorProps:n}=nl();return d.cloneElement(t,n(t.props,t.ref))}F3.displayName="PopoverAnchor";var vv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function B3(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:l}=e,{getArrowProps:u,getArrowInnerProps:p}=nl(),m=Vh(),h=(t=n??r)!=null?t:o,g=s??i;return a.jsx(we.div,{...u(),className:"chakra-popover__arrow-positioner",children:a.jsx(we.div,{className:Ye("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":vv("colors",l),"--popper-arrow-bg":vv("colors",h),"--popper-arrow-shadow":vv("shadows",g),...m.arrow}})})}B3.displayName="PopoverArrow";var Uh=je(function(t,n){const{getBodyProps:r}=nl(),o=Vh();return a.jsx(we.div,{...r(t,n),className:Ye("chakra-popover__body",t.className),__css:o.body})});Uh.displayName="PopoverBody";var H3=je(function(t,n){const{onClose:r}=nl(),o=Vh();return a.jsx(eI,{size:"sm",onClick:r,className:Ye("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});H3.displayName="PopoverCloseButton";function yV(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var CV={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},wV=we(In.section),V3=je(function(t,n){const{variants:r=CV,...o}=t,{isOpen:s}=nl();return a.jsx(wV,{ref:n,variants:yV(r),initial:!1,animate:s?"enter":"exit",...o})});V3.displayName="PopoverTransition";var zd=je(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:l,onAnimationComplete:u}=nl(),p=Vh(),m={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(we.div,{...l(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(V3,{...o,...i(s,n),onAnimationComplete:ph(u,s.onAnimationComplete),className:Ye("chakra-popover__content",t.className),__css:m})})});zd.displayName="PopoverContent";var F1=e=>a.jsx(we.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});F1.displayName="Circle";function SV(e,t,n){return(e-t)*100/(n-t)}var kV=ma({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),jV=ma({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),_V=ma({"0%":{left:"-40%"},"100%":{left:"100%"}}),IV=ma({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function W3(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:l="progressbar"}=e,u=SV(t,n,r);return{bind:{"data-indeterminate":i?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":i?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,u):o})(),role:l},percent:u,value:t}}var U3=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(we.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${jV} 2s linear infinite`:void 0},...r})};U3.displayName="Shape";var B1=je((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:i,getValueText:l,value:u,capIsRound:p,children:m,thickness:h="10px",color:g="#0078d4",trackColor:x="#edebe9",isIndeterminate:y,...b}=e,w=W3({min:s,max:o,value:u,valueText:i,getValueText:l,isIndeterminate:y}),S=y?void 0:((n=w.percent)!=null?n:0)*2.64,j=S==null?void 0:`${S} ${264-S}`,_=y?{css:{animation:`${kV} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:j,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},E={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(we.div,{ref:t,className:"chakra-progress",...w.bind,...b,__css:E,children:[a.jsxs(U3,{size:r,isIndeterminate:y,children:[a.jsx(F1,{stroke:x,strokeWidth:h,className:"chakra-progress__track"}),a.jsx(F1,{stroke:g,strokeWidth:h,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:w.value===0&&!y?0:void 0,..._})]}),m]})});B1.displayName="CircularProgress";var[PV,EV]=Wt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),MV=je((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...l}=e,u=W3({value:o,min:n,max:r,isIndeterminate:s,role:i}),m={height:"100%",...EV().filledTrack};return a.jsx(we.div,{ref:t,style:{width:`${u.percent}%`,...l.style},...u.bind,...l,__css:m})}),G3=je((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:l,children:u,borderRadius:p,isIndeterminate:m,"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,title:y,role:b,...w}=on(e),S=Un("Progress",e),j=p??((n=S.track)==null?void 0:n.borderRadius),_={animation:`${IV} 1s linear infinite`},M={...!m&&i&&l&&_,...m&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_V} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...S.track};return a.jsx(we.div,{ref:t,borderRadius:j,__css:R,...w,children:a.jsxs(PV,{value:S,children:[a.jsx(MV,{"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,min:o,max:s,value:r,isIndeterminate:m,css:M,borderRadius:j,title:y,role:b}),u]})})});G3.displayName="Progress";function OV(e){return e&&a1(e)&&a1(e.target)}function RV(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:l,...u}=e,[p,m]=d.useState(r||""),h=typeof n<"u",g=h?n:p,x=d.useRef(null),y=d.useCallback(()=>{const I=x.current;if(!I)return;let M="input:not(:disabled):checked";const R=I.querySelector(M);if(R){R.focus();return}M="input:not(:disabled)";const D=I.querySelector(M);D==null||D.focus()},[]),w=`radio-${d.useId()}`,S=o||w,j=d.useCallback(I=>{const M=OV(I)?I.target.value:I;h||m(M),t==null||t(String(M))},[t,h]),_=d.useCallback((I={},M=null)=>({...I,ref:It(M,x),role:"radiogroup"}),[]),E=d.useCallback((I={},M=null)=>({...I,ref:M,name:S,[l?"checked":"isChecked"]:g!=null?I.value===g:void 0,onChange(D){j(D)},"data-radiogroup":!0}),[l,S,j,g]);return{getRootProps:_,getRadioProps:E,name:S,ref:x,focus:y,setValue:m,value:g,onChange:j,isDisabled:s,isFocusable:i,htmlProps:u}}var[DV,K3]=Wt({name:"RadioGroupContext",strict:!1}),cm=je((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:l,isFocusable:u,...p}=e,{value:m,onChange:h,getRootProps:g,name:x,htmlProps:y}=RV(p),b=d.useMemo(()=>({name:x,size:r,onChange:h,colorScheme:n,value:m,variant:o,isDisabled:l,isFocusable:u}),[x,r,h,n,m,o,l,u]);return a.jsx(DV,{value:b,children:a.jsx(we.div,{...g(y,t),className:Ye("chakra-radio-group",i),children:s})})});cm.displayName="RadioGroup";var AV={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function TV(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:l,isInvalid:u,name:p,value:m,id:h,"data-radiogroup":g,"aria-describedby":x,...y}=e,b=`radio-${d.useId()}`,w=Pd(),j=!!K3()||!!g;let E=!!w&&!j?w.id:b;E=h??E;const I=o??(w==null?void 0:w.isDisabled),M=s??(w==null?void 0:w.isReadOnly),R=i??(w==null?void 0:w.isRequired),D=u??(w==null?void 0:w.isInvalid),[A,O]=d.useState(!1),[T,X]=d.useState(!1),[B,V]=d.useState(!1),[U,N]=d.useState(!1),[$,q]=d.useState(!!t),F=typeof n<"u",Q=F?n:$;d.useEffect(()=>f5(O),[]);const Y=d.useCallback(de=>{if(M||I){de.preventDefault();return}F||q(de.target.checked),l==null||l(de)},[F,I,M,l]),se=d.useCallback(de=>{de.key===" "&&N(!0)},[N]),ae=d.useCallback(de=>{de.key===" "&&N(!1)},[N]),re=d.useCallback((de={},ge=null)=>({...de,ref:ge,"data-active":dt(U),"data-hover":dt(B),"data-disabled":dt(I),"data-invalid":dt(D),"data-checked":dt(Q),"data-focus":dt(T),"data-focus-visible":dt(T&&A),"data-readonly":dt(M),"aria-hidden":!0,onMouseDown:He(de.onMouseDown,()=>N(!0)),onMouseUp:He(de.onMouseUp,()=>N(!1)),onMouseEnter:He(de.onMouseEnter,()=>V(!0)),onMouseLeave:He(de.onMouseLeave,()=>V(!1))}),[U,B,I,D,Q,T,M,A]),{onFocus:G,onBlur:K}=w??{},ee=d.useCallback((de={},ge=null)=>{const Ce=I&&!r;return{...de,id:E,ref:ge,type:"radio",name:p,value:m,onChange:He(de.onChange,Y),onBlur:He(K,de.onBlur,()=>X(!1)),onFocus:He(G,de.onFocus,()=>X(!0)),onKeyDown:He(de.onKeyDown,se),onKeyUp:He(de.onKeyUp,ae),checked:Q,disabled:Ce,readOnly:M,required:R,"aria-invalid":Co(D),"aria-disabled":Co(Ce),"aria-required":Co(R),"data-readonly":dt(M),"aria-describedby":x,style:AV}},[I,r,E,p,m,Y,K,G,se,ae,Q,M,R,D,x]);return{state:{isInvalid:D,isFocused:T,isChecked:Q,isActive:U,isHovered:B,isDisabled:I,isReadOnly:M,isRequired:R},getCheckboxProps:re,getRadioProps:re,getInputProps:ee,getLabelProps:(de={},ge=null)=>({...de,ref:ge,onMouseDown:He(de.onMouseDown,NV),"data-disabled":dt(I),"data-checked":dt(Q),"data-invalid":dt(D)}),getRootProps:(de,ge=null)=>({...de,ref:ge,"data-disabled":dt(I),"data-checked":dt(Q),"data-invalid":dt(D)}),htmlProps:y}}function NV(e){e.preventDefault(),e.stopPropagation()}function $V(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var Ks=je((e,t)=>{var n;const r=K3(),{onChange:o,value:s}=e,i=Un("Radio",{...r,...e}),l=on(e),{spacing:u="0.5rem",children:p,isDisabled:m=r==null?void 0:r.isDisabled,isFocusable:h=r==null?void 0:r.isFocusable,inputProps:g,...x}=l;let y=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(y=r.value===s);let b=o;r!=null&&r.onChange&&s!=null&&(b=ph(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:S,getCheckboxProps:j,getLabelProps:_,getRootProps:E,htmlProps:I}=TV({...x,isChecked:y,isFocusable:h,isDisabled:m,onChange:b,name:w}),[M,R]=$V(I,tI),D=j(R),A=S(g,t),O=_(),T=Object.assign({},M,E()),X={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},B={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},V={userSelect:"none",marginStart:u,...i.label};return a.jsxs(we.label,{className:"chakra-radio",...T,__css:X,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(we.span,{className:"chakra-radio__control",...D,__css:B}),p&&a.jsx(we.span,{className:"chakra-radio__label",...O,__css:V,children:p})]})});Ks.displayName="Radio";var q3=je(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(we.select,{...i,ref:n,className:Ye("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});q3.displayName="SelectField";function LV(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var X3=je((e,t)=>{var n;const r=Un("Select",e),{rootProps:o,placeholder:s,icon:i,color:l,height:u,h:p,minH:m,minHeight:h,iconColor:g,iconSize:x,...y}=on(e),[b,w]=LV(y,tI),S=pb(w),j={width:"100%",height:"fit-content",position:"relative",color:l},_={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(we.div,{className:"chakra-select__wrapper",__css:j,...b,...o,children:[a.jsx(q3,{ref:t,height:p??u,minH:m??h,placeholder:s,...S,__css:_,children:e.children}),a.jsx(Q3,{"data-disabled":dt(S.disabled),...(g||l)&&{color:g||l},__css:r.icon,...x&&{fontSize:x},children:i})]})});X3.displayName="Select";var zV=e=>a.jsx("svg",{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),FV=we("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Q3=e=>{const{children:t=a.jsx(zV,{}),...n}=e,r=d.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(FV,{...n,className:"chakra-select__icon-wrapper",children:d.isValidElement(t)?r:null})};Q3.displayName="SelectIcon";function BV(){const e=d.useRef(!0);return d.useEffect(()=>{e.current=!1},[]),e.current}function HV(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var VV=we("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),H1=nI("skeleton-start-color"),V1=nI("skeleton-end-color"),WV=ma({from:{opacity:0},to:{opacity:1}}),UV=ma({from:{borderColor:H1.reference,background:H1.reference},to:{borderColor:V1.reference,background:V1.reference}}),Gh=je((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=oi("Skeleton",n),o=BV(),{startColor:s="",endColor:i="",isLoaded:l,fadeDuration:u,speed:p,className:m,fitContent:h,...g}=on(n),[x,y]=Ho("colors",[s,i]),b=HV(l),w=Ye("chakra-skeleton",m),S={...x&&{[H1.variable]:x},...y&&{[V1.variable]:y}};if(l){const j=o||b?"none":`${WV} ${u}s`;return a.jsx(we.div,{ref:t,className:w,__css:{animation:j},...g})}return a.jsx(VV,{ref:t,className:w,...g,__css:{width:h?"fit-content":void 0,...r,...S,_dark:{...r._dark,...S},animation:`${p}s linear infinite alternate ${UV}`}})});Gh.displayName="Skeleton";var ho=e=>e?"":void 0,uc=e=>e?!0:void 0,ii=(...e)=>e.filter(Boolean).join(" ");function dc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function GV(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Ru(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var zp={width:0,height:0},op=e=>e||zp;function Y3(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=b=>{var w;const S=(w=r[b])!=null?w:zp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Ru({orientation:t,vertical:{bottom:`calc(${n[b]}% - ${S.height/2}px)`},horizontal:{left:`calc(${n[b]}% - ${S.width/2}px)`}})}},i=t==="vertical"?r.reduce((b,w)=>op(b).height>op(w).height?b:w,zp):r.reduce((b,w)=>op(b).width>op(w).width?b:w,zp),l={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Ru({orientation:t,vertical:i?{paddingLeft:i.width/2,paddingRight:i.width/2}:{},horizontal:i?{paddingTop:i.height/2,paddingBottom:i.height/2}:{}})},u={position:"absolute",...Ru({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,m=[0,o?100-n[0]:n[0]],h=p?m:n;let g=h[0];!p&&o&&(g=100-g);const x=Math.abs(h[h.length-1]-h[0]),y={...u,...Ru({orientation:t,vertical:o?{height:`${x}%`,top:`${g}%`}:{height:`${x}%`,bottom:`${g}%`},horizontal:o?{width:`${x}%`,right:`${g}%`}:{width:`${x}%`,left:`${g}%`}})};return{trackStyle:u,innerTrackStyle:y,rootStyle:l,getThumbStyle:s}}function Z3(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function KV(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function qV(e){const t=QV(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function J3(e){return!!e.touches}function XV(e){return J3(e)&&e.touches.length>1}function QV(e){var t;return(t=e.view)!=null?t:window}function YV(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function ZV(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function eP(e,t="page"){return J3(e)?YV(e,t):ZV(e,t)}function JV(e){return t=>{const n=qV(t);(!n||n&&t.button===0)&&e(t)}}function eW(e,t=!1){function n(o){e(o,{point:eP(o)})}return t?JV(n):n}function Fp(e,t,n,r){return KV(e,t,eW(n,t==="pointerdown"),r)}var tW=Object.defineProperty,nW=(e,t,n)=>t in e?tW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$o=(e,t,n)=>(nW(e,typeof t!="symbol"?t+"":t,n),n),rW=class{constructor(e,t,n){$o(this,"history",[]),$o(this,"startEvent",null),$o(this,"lastEvent",null),$o(this,"lastEventInfo",null),$o(this,"handlers",{}),$o(this,"removeListeners",()=>{}),$o(this,"threshold",3),$o(this,"win"),$o(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const l=xv(this.lastEventInfo,this.history),u=this.startEvent!==null,p=iW(l.offset,{x:0,y:0})>=this.threshold;if(!u&&!p)return;const{timestamp:m}=Yw();this.history.push({...l.point,timestamp:m});const{onStart:h,onMove:g}=this.handlers;u||(h==null||h(this.lastEvent,l),this.startEvent=this.lastEvent),g==null||g(this.lastEvent,l)}),$o(this,"onPointerMove",(l,u)=>{this.lastEvent=l,this.lastEventInfo=u,I$.update(this.updatePoint,!0)}),$o(this,"onPointerUp",(l,u)=>{const p=xv(u,this.history),{onEnd:m,onSessionEnd:h}=this.handlers;h==null||h(l,p),this.end(),!(!m||!this.startEvent)&&(m==null||m(l,p))});var r;if(this.win=(r=e.view)!=null?r:window,XV(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:eP(e)},{timestamp:s}=Yw();this.history=[{...o.point,timestamp:s}];const{onSessionStart:i}=t;i==null||i(e,xv(o,this.history)),this.removeListeners=aW(Fp(this.win,"pointermove",this.onPointerMove),Fp(this.win,"pointerup",this.onPointerUp),Fp(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),P$.update(this.updatePoint)}};function NS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xv(e,t){return{point:e.point,delta:NS(e.point,t[t.length-1]),offset:NS(e.point,t[0]),velocity:sW(t,.1)}}var oW=e=>e*1e3;function sW(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>oW(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function aW(...e){return t=>e.reduce((n,r)=>r(n),t)}function bv(e,t){return Math.abs(e-t)}function $S(e){return"x"in e&&"y"in e}function iW(e,t){if(typeof e=="number"&&typeof t=="number")return bv(e,t);if($S(e)&&$S(t)){const n=bv(e.x,t.x),r=bv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function tP(e){const t=d.useRef(null);return t.current=e,t}function nP(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:i,threshold:l}=t,u=!!(n||r||o||s||i),p=d.useRef(null),m=tP({onSessionStart:s,onSessionEnd:i,onStart:r,onMove:n,onEnd(h,g){p.current=null,o==null||o(h,g)}});d.useEffect(()=>{var h;(h=p.current)==null||h.updateHandlers(m.current)}),d.useEffect(()=>{const h=e.current;if(!h||!u)return;function g(x){p.current=new rW(x,m.current,l)}return Fp(h,"pointerdown",g)},[e,u,m,l]),d.useEffect(()=>()=>{var h;(h=p.current)==null||h.end(),p.current=null},[])}function lW(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[s]=o;let i,l;if("borderBoxSize"in s){const u=s.borderBoxSize,p=Array.isArray(u)?u[0]:u;i=p.inlineSize,l=p.blockSize}else i=e.offsetWidth,l=e.offsetHeight;t({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var cW=globalThis!=null&&globalThis.document?d.useLayoutEffect:d.useEffect;function uW(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function rP({getNodes:e,observeMutation:t=!0}){const[n,r]=d.useState([]),[o,s]=d.useState(0);return cW(()=>{const i=e(),l=i.map((u,p)=>lW(u,m=>{r(h=>[...h.slice(0,p),m,...h.slice(p+1)])}));if(t){const u=i[0];l.push(uW(u,()=>{s(p=>p+1)}))}return()=>{l.forEach(u=>{u==null||u()})}},[o]),n}function dW(e){return typeof e=="object"&&e!==null&&"current"in e}function fW(e){const[t]=rP({observeMutation:!1,getNodes(){return[dW(e)?e.current:e]}});return t}function pW(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:l="ltr",orientation:u="horizontal",id:p,isDisabled:m,isReadOnly:h,onChangeStart:g,onChangeEnd:x,step:y=1,getAriaValueText:b,"aria-valuetext":w,"aria-label":S,"aria-labelledby":j,name:_,focusThumbOnChange:E=!0,minStepsBetweenThumbs:I=0,...M}=e,R=dn(g),D=dn(x),A=dn(b),O=Z3({isReversed:i,direction:l,orientation:u}),[T,X]=_d({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(T))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof T}\``);const[B,V]=d.useState(!1),[U,N]=d.useState(!1),[$,q]=d.useState(-1),F=!(m||h),Q=d.useRef(T),Y=T.map(ke=>ac(ke,t,n)),se=I*y,ae=mW(Y,t,n,se),re=d.useRef({eventSource:null,value:[],valueBounds:[]});re.current.value=Y,re.current.valueBounds=ae;const G=Y.map(ke=>n-ke+t),ee=(O?G:Y).map(ke=>om(ke,t,n)),ce=u==="vertical",J=d.useRef(null),ie=d.useRef(null),de=rP({getNodes(){const ke=ie.current,Be=ke==null?void 0:ke.querySelectorAll("[role=slider]");return Be?Array.from(Be):[]}}),ge=d.useId(),he=GV(p??ge),fe=d.useCallback(ke=>{var Be,ze;if(!J.current)return;re.current.eventSource="pointer";const Ge=J.current.getBoundingClientRect(),{clientX:pt,clientY:En}=(ze=(Be=ke.touches)==null?void 0:Be[0])!=null?ze:ke,Dt=ce?Ge.bottom-En:pt-Ge.left,At=ce?Ge.height:Ge.width;let pr=Dt/At;return O&&(pr=1-pr),m5(pr,t,n)},[ce,O,n,t]),Oe=(n-t)/10,_e=y||(n-t)/100,Ne=d.useMemo(()=>({setValueAtIndex(ke,Be){if(!F)return;const ze=re.current.valueBounds[ke];Be=parseFloat(P1(Be,ze.min,_e)),Be=ac(Be,ze.min,ze.max);const Ge=[...re.current.value];Ge[ke]=Be,X(Ge)},setActiveIndex:q,stepUp(ke,Be=_e){const ze=re.current.value[ke],Ge=O?ze-Be:ze+Be;Ne.setValueAtIndex(ke,Ge)},stepDown(ke,Be=_e){const ze=re.current.value[ke],Ge=O?ze+Be:ze-Be;Ne.setValueAtIndex(ke,Ge)},reset(){X(Q.current)}}),[_e,O,X,F]),nt=d.useCallback(ke=>{const Be=ke.key,Ge={ArrowRight:()=>Ne.stepUp($),ArrowUp:()=>Ne.stepUp($),ArrowLeft:()=>Ne.stepDown($),ArrowDown:()=>Ne.stepDown($),PageUp:()=>Ne.stepUp($,Oe),PageDown:()=>Ne.stepDown($,Oe),Home:()=>{const{min:pt}=ae[$];Ne.setValueAtIndex($,pt)},End:()=>{const{max:pt}=ae[$];Ne.setValueAtIndex($,pt)}}[Be];Ge&&(ke.preventDefault(),ke.stopPropagation(),Ge(ke),re.current.eventSource="keyboard")},[Ne,$,Oe,ae]),{getThumbStyle:$e,rootStyle:Pt,trackStyle:Ze,innerTrackStyle:ot}=d.useMemo(()=>Y3({isReversed:O,orientation:u,thumbRects:de,thumbPercents:ee}),[O,u,ee,de]),ye=d.useCallback(ke=>{var Be;const ze=ke??$;if(ze!==-1&&E){const Ge=he.getThumb(ze),pt=(Be=ie.current)==null?void 0:Be.ownerDocument.getElementById(Ge);pt&&setTimeout(()=>pt.focus())}},[E,$,he]);pa(()=>{re.current.eventSource==="keyboard"&&(D==null||D(re.current.value))},[Y,D]);const De=ke=>{const Be=fe(ke)||0,ze=re.current.value.map(At=>Math.abs(At-Be)),Ge=Math.min(...ze);let pt=ze.indexOf(Ge);const En=ze.filter(At=>At===Ge);En.length>1&&Be>re.current.value[pt]&&(pt=pt+En.length-1),q(pt),Ne.setValueAtIndex(pt,Be),ye(pt)},ut=ke=>{if($==-1)return;const Be=fe(ke)||0;q($),Ne.setValueAtIndex($,Be),ye($)};nP(ie,{onPanSessionStart(ke){F&&(V(!0),De(ke),R==null||R(re.current.value))},onPanSessionEnd(){F&&(V(!1),D==null||D(re.current.value))},onPan(ke){F&&ut(ke)}});const bt=d.useCallback((ke={},Be=null)=>({...ke,...M,id:he.root,ref:It(Be,ie),tabIndex:-1,"aria-disabled":uc(m),"data-focused":ho(U),style:{...ke.style,...Pt}}),[M,m,U,Pt,he]),be=d.useCallback((ke={},Be=null)=>({...ke,ref:It(Be,J),id:he.track,"data-disabled":ho(m),style:{...ke.style,...Ze}}),[m,Ze,he]),Je=d.useCallback((ke={},Be=null)=>({...ke,ref:Be,id:he.innerTrack,style:{...ke.style,...ot}}),[ot,he]),lt=d.useCallback((ke,Be=null)=>{var ze;const{index:Ge,...pt}=ke,En=Y[Ge];if(En==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${Ge}\`. The \`value\` or \`defaultValue\` length is : ${Y.length}`);const Dt=ae[Ge];return{...pt,ref:Be,role:"slider",tabIndex:F?0:void 0,id:he.getThumb(Ge),"data-active":ho(B&&$===Ge),"aria-valuetext":(ze=A==null?void 0:A(En))!=null?ze:w==null?void 0:w[Ge],"aria-valuemin":Dt.min,"aria-valuemax":Dt.max,"aria-valuenow":En,"aria-orientation":u,"aria-disabled":uc(m),"aria-readonly":uc(h),"aria-label":S==null?void 0:S[Ge],"aria-labelledby":S!=null&&S[Ge]||j==null?void 0:j[Ge],style:{...ke.style,...$e(Ge)},onKeyDown:dc(ke.onKeyDown,nt),onFocus:dc(ke.onFocus,()=>{N(!0),q(Ge)}),onBlur:dc(ke.onBlur,()=>{N(!1),q(-1)})}},[he,Y,ae,F,B,$,A,w,u,m,h,S,j,$e,nt,N]),ft=d.useCallback((ke={},Be=null)=>({...ke,ref:Be,id:he.output,htmlFor:Y.map((ze,Ge)=>he.getThumb(Ge)).join(" "),"aria-live":"off"}),[he,Y]),Me=d.useCallback((ke,Be=null)=>{const{value:ze,...Ge}=ke,pt=!(ze<t||ze>n),En=ze>=Y[0]&&ze<=Y[Y.length-1];let Dt=om(ze,t,n);Dt=O?100-Dt:Dt;const At={position:"absolute",pointerEvents:"none",...Ru({orientation:u,vertical:{bottom:`${Dt}%`},horizontal:{left:`${Dt}%`}})};return{...Ge,ref:Be,id:he.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":ho(m),"data-invalid":ho(!pt),"data-highlighted":ho(En),style:{...ke.style,...At}}},[m,O,n,t,u,Y,he]),Le=d.useCallback((ke,Be=null)=>{const{index:ze,...Ge}=ke;return{...Ge,ref:Be,id:he.getInput(ze),type:"hidden",value:Y[ze],name:Array.isArray(_)?_[ze]:`${_}-${ze}`}},[_,Y,he]);return{state:{value:Y,isFocused:U,isDragging:B,getThumbPercent:ke=>ee[ke],getThumbMinValue:ke=>ae[ke].min,getThumbMaxValue:ke=>ae[ke].max},actions:Ne,getRootProps:bt,getTrackProps:be,getInnerTrackProps:Je,getThumbProps:lt,getMarkerProps:Me,getInputProps:Le,getOutputProps:ft}}function mW(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,l=s===e.length-1?n:e[s+1]-r;return{min:i,max:l}})}var[hW,Kh]=Wt({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[gW,qh]=Wt({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),Vb=je(function(t,n){const r={orientation:"horizontal",...t},o=Un("Slider",r),s=on(r),{direction:i}=bd();s.direction=i;const{getRootProps:l,...u}=pW(s),p=d.useMemo(()=>({...u,name:r.name}),[u,r.name]);return a.jsx(hW,{value:p,children:a.jsx(gW,{value:o,children:a.jsx(we.div,{...l({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});Vb.displayName="RangeSlider";var nd=je(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Kh(),i=qh(),l=r(t,n);return a.jsxs(we.div,{...l,className:ii("chakra-slider__thumb",t.className),__css:i.thumb,children:[l.children,s&&a.jsx("input",{...o({index:t.index})})]})});nd.displayName="RangeSliderThumb";var Wb=je(function(t,n){const{getTrackProps:r}=Kh(),o=qh(),s=r(t,n);return a.jsx(we.div,{...s,className:ii("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});Wb.displayName="RangeSliderTrack";var Ub=je(function(t,n){const{getInnerTrackProps:r}=Kh(),o=qh(),s=r(t,n);return a.jsx(we.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});Ub.displayName="RangeSliderFilledTrack";var Ti=je(function(t,n){const{getMarkerProps:r}=Kh(),o=qh(),s=r(t,n);return a.jsx(we.div,{...s,className:ii("chakra-slider__marker",t.className),__css:o.mark})});Ti.displayName="RangeSliderMark";function vW(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:i,isReversed:l,direction:u="ltr",orientation:p="horizontal",id:m,isDisabled:h,isReadOnly:g,onChangeStart:x,onChangeEnd:y,step:b=1,getAriaValueText:w,"aria-valuetext":S,"aria-label":j,"aria-labelledby":_,name:E,focusThumbOnChange:I=!0,...M}=e,R=dn(x),D=dn(y),A=dn(w),O=Z3({isReversed:l,direction:u,orientation:p}),[T,X]=_d({value:s,defaultValue:i??bW(n,r),onChange:o}),[B,V]=d.useState(!1),[U,N]=d.useState(!1),$=!(h||g),q=(r-n)/10,F=b||(r-n)/100,Q=ac(T,n,r),Y=r-Q+n,ae=om(O?Y:Q,n,r),re=p==="vertical",G=tP({min:n,max:r,step:b,isDisabled:h,value:Q,isInteractive:$,isReversed:O,isVertical:re,eventSource:null,focusThumbOnChange:I,orientation:p}),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useId(),ie=m??J,[de,ge]=[`slider-thumb-${ie}`,`slider-track-${ie}`],Ce=d.useCallback(Me=>{var Le,Ut;if(!K.current)return;const ke=G.current;ke.eventSource="pointer";const Be=K.current.getBoundingClientRect(),{clientX:ze,clientY:Ge}=(Ut=(Le=Me.touches)==null?void 0:Le[0])!=null?Ut:Me,pt=re?Be.bottom-Ge:ze-Be.left,En=re?Be.height:Be.width;let Dt=pt/En;O&&(Dt=1-Dt);let At=m5(Dt,ke.min,ke.max);return ke.step&&(At=parseFloat(P1(At,ke.min,ke.step))),At=ac(At,ke.min,ke.max),At},[re,O,G]),he=d.useCallback(Me=>{const Le=G.current;Le.isInteractive&&(Me=parseFloat(P1(Me,Le.min,F)),Me=ac(Me,Le.min,Le.max),X(Me))},[F,X,G]),fe=d.useMemo(()=>({stepUp(Me=F){const Le=O?Q-Me:Q+Me;he(Le)},stepDown(Me=F){const Le=O?Q+Me:Q-Me;he(Le)},reset(){he(i||0)},stepTo(Me){he(Me)}}),[he,O,Q,F,i]),Oe=d.useCallback(Me=>{const Le=G.current,ke={ArrowRight:()=>fe.stepUp(),ArrowUp:()=>fe.stepUp(),ArrowLeft:()=>fe.stepDown(),ArrowDown:()=>fe.stepDown(),PageUp:()=>fe.stepUp(q),PageDown:()=>fe.stepDown(q),Home:()=>he(Le.min),End:()=>he(Le.max)}[Me.key];ke&&(Me.preventDefault(),Me.stopPropagation(),ke(Me),Le.eventSource="keyboard")},[fe,he,q,G]),_e=(t=A==null?void 0:A(Q))!=null?t:S,Ne=fW(ee),{getThumbStyle:nt,rootStyle:$e,trackStyle:Pt,innerTrackStyle:Ze}=d.useMemo(()=>{const Me=G.current,Le=Ne??{width:0,height:0};return Y3({isReversed:O,orientation:Me.orientation,thumbRects:[Le],thumbPercents:[ae]})},[O,Ne,ae,G]),ot=d.useCallback(()=>{G.current.focusThumbOnChange&&setTimeout(()=>{var Le;return(Le=ee.current)==null?void 0:Le.focus()})},[G]);pa(()=>{const Me=G.current;ot(),Me.eventSource==="keyboard"&&(D==null||D(Me.value))},[Q,D]);function ye(Me){const Le=Ce(Me);Le!=null&&Le!==G.current.value&&X(Le)}nP(ce,{onPanSessionStart(Me){const Le=G.current;Le.isInteractive&&(V(!0),ot(),ye(Me),R==null||R(Le.value))},onPanSessionEnd(){const Me=G.current;Me.isInteractive&&(V(!1),D==null||D(Me.value))},onPan(Me){G.current.isInteractive&&ye(Me)}});const De=d.useCallback((Me={},Le=null)=>({...Me,...M,ref:It(Le,ce),tabIndex:-1,"aria-disabled":uc(h),"data-focused":ho(U),style:{...Me.style,...$e}}),[M,h,U,$e]),ut=d.useCallback((Me={},Le=null)=>({...Me,ref:It(Le,K),id:ge,"data-disabled":ho(h),style:{...Me.style,...Pt}}),[h,ge,Pt]),bt=d.useCallback((Me={},Le=null)=>({...Me,ref:Le,style:{...Me.style,...Ze}}),[Ze]),be=d.useCallback((Me={},Le=null)=>({...Me,ref:It(Le,ee),role:"slider",tabIndex:$?0:void 0,id:de,"data-active":ho(B),"aria-valuetext":_e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":Q,"aria-orientation":p,"aria-disabled":uc(h),"aria-readonly":uc(g),"aria-label":j,"aria-labelledby":j?void 0:_,style:{...Me.style,...nt(0)},onKeyDown:dc(Me.onKeyDown,Oe),onFocus:dc(Me.onFocus,()=>N(!0)),onBlur:dc(Me.onBlur,()=>N(!1))}),[$,de,B,_e,n,r,Q,p,h,g,j,_,nt,Oe]),Je=d.useCallback((Me,Le=null)=>{const Ut=!(Me.value<n||Me.value>r),ke=Q>=Me.value,Be=om(Me.value,n,r),ze={position:"absolute",pointerEvents:"none",...xW({orientation:p,vertical:{bottom:O?`${100-Be}%`:`${Be}%`},horizontal:{left:O?`${100-Be}%`:`${Be}%`}})};return{...Me,ref:Le,role:"presentation","aria-hidden":!0,"data-disabled":ho(h),"data-invalid":ho(!Ut),"data-highlighted":ho(ke),style:{...Me.style,...ze}}},[h,O,r,n,p,Q]),lt=d.useCallback((Me={},Le=null)=>({...Me,ref:Le,type:"hidden",value:Q,name:E}),[E,Q]);return{state:{value:Q,isFocused:U,isDragging:B},actions:fe,getRootProps:De,getTrackProps:ut,getInnerTrackProps:bt,getThumbProps:be,getMarkerProps:Je,getInputProps:lt}}function xW(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function bW(e,t){return t<e?e:e+(t-e)/2}var[yW,Xh]=Wt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[CW,Qh]=Wt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Gb=je((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Un("Slider",r),s=on(r),{direction:i}=bd();s.direction=i;const{getInputProps:l,getRootProps:u,...p}=vW(s),m=u(),h=l({},t);return a.jsx(yW,{value:p,children:a.jsx(CW,{value:o,children:a.jsxs(we.div,{...m,className:ii("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...h})]})})})});Gb.displayName="Slider";var Kb=je((e,t)=>{const{getThumbProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__thumb",e.className),__css:r.thumb})});Kb.displayName="SliderThumb";var qb=je((e,t)=>{const{getTrackProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__track",e.className),__css:r.track})});qb.displayName="SliderTrack";var Xb=je((e,t)=>{const{getInnerTrackProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__filled-track",e.className),__css:r.filledTrack})});Xb.displayName="SliderFilledTrack";var Ul=je((e,t)=>{const{getMarkerProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__marker",e.className),__css:r.mark})});Ul.displayName="SliderMark";var[wW,oP]=Wt({name:"StatStylesContext",errorMessage:`useStatStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Stat />" `}),sP=je(function(t,n){const r=Un("Stat",t),o={position:"relative",flex:"1 1 0%",...r.container},{className:s,children:i,...l}=on(t);return a.jsx(wW,{value:r,children:a.jsx(we.div,{ref:n,...l,className:Ye("chakra-stat",s),__css:o,children:a.jsx("dl",{children:i})})})});sP.displayName="Stat";var aP=je(function(t,n){return a.jsx(we.div,{...t,ref:n,role:"group",className:Ye("chakra-stat__group",t.className),__css:{display:"flex",flexWrap:"wrap",justifyContent:"space-around",alignItems:"flex-start"}})});aP.displayName="StatGroup";var iP=je(function(t,n){const r=oP();return a.jsx(we.dt,{ref:n,...t,className:Ye("chakra-stat__label",t.className),__css:r.label})});iP.displayName="StatLabel";var lP=je(function(t,n){const r=oP();return a.jsx(we.dd,{ref:n,...t,className:Ye("chakra-stat__number",t.className),__css:{...r.number,fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums"}})});lP.displayName="StatNumber";var Qb=je(function(t,n){const r=Un("Switch",t),{spacing:o="0.5rem",children:s,...i}=on(t),{getIndicatorProps:l,getInputProps:u,getCheckboxProps:p,getRootProps:m,getLabelProps:h}=p5(i),g=d.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),x=d.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),y=d.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return a.jsxs(we.label,{...m(),className:Ye("chakra-switch",t.className),__css:g,children:[a.jsx("input",{className:"chakra-switch__input",...u({},n)}),a.jsx(we.span,{...p(),className:"chakra-switch__track",__css:x,children:a.jsx(we.span,{__css:r.thumb,className:"chakra-switch__thumb",...l()})}),s&&a.jsx(we.span,{className:"chakra-switch__label",...h(),__css:y,children:s})]})});Qb.displayName="Switch";var[SW,kW,jW,_W]=ub();function IW(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:l="unmount",orientation:u="horizontal",direction:p="ltr",...m}=e,[h,g]=d.useState(n??0),[x,y]=_d({defaultValue:n??0,value:o,onChange:r});d.useEffect(()=>{o!=null&&g(o)},[o]);const b=jW(),w=d.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:x,focusedIndex:h,setSelectedIndex:y,setFocusedIndex:g,isManual:s,isLazy:i,lazyBehavior:l,orientation:u,descendants:b,direction:p,htmlProps:m}}var[PW,Yh]=Wt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function EW(e){const{focusedIndex:t,orientation:n,direction:r}=Yh(),o=kW(),s=d.useCallback(i=>{const l=()=>{var j;const _=o.nextEnabled(t);_&&((j=_.node)==null||j.focus())},u=()=>{var j;const _=o.prevEnabled(t);_&&((j=_.node)==null||j.focus())},p=()=>{var j;const _=o.firstEnabled();_&&((j=_.node)==null||j.focus())},m=()=>{var j;const _=o.lastEnabled();_&&((j=_.node)==null||j.focus())},h=n==="horizontal",g=n==="vertical",x=i.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",b=r==="ltr"?"ArrowRight":"ArrowLeft",S={[y]:()=>h&&u(),[b]:()=>h&&l(),ArrowDown:()=>g&&l(),ArrowUp:()=>g&&u(),Home:p,End:m}[x];S&&(i.preventDefault(),S(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:He(e.onKeyDown,s)}}function MW(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:l,selectedIndex:u}=Yh(),{index:p,register:m}=_W({disabled:t&&!n}),h=p===u,g=()=>{o(p)},x=()=>{l(p),!s&&!(t&&n)&&o(p)},y=m3({...r,ref:It(m,e.ref),isDisabled:t,isFocusable:n,onClick:He(e.onClick,g)}),b="button";return{...y,id:cP(i,p),role:"tab",tabIndex:h?0:-1,type:b,"aria-selected":h,"aria-controls":uP(i,p),onFocus:t?void 0:He(e.onFocus,x)}}var[OW,RW]=Wt({});function DW(e){const t=Yh(),{id:n,selectedIndex:r}=t,s=kh(e.children).map((i,l)=>d.createElement(OW,{key:l,value:{isSelected:l===r,id:uP(n,l),tabId:cP(n,l),selectedIndex:r}},i));return{...e,children:s}}function AW(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Yh(),{isSelected:s,id:i,tabId:l}=RW(),u=d.useRef(!1);s&&(u.current=!0);const p=Bb({wasSelected:u.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":l,hidden:!s,id:i}}function cP(e,t){return`${e}--tab-${t}`}function uP(e,t){return`${e}--tabpanel-${t}`}var[TW,Zh]=Wt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),rl=je(function(t,n){const r=Un("Tabs",t),{children:o,className:s,...i}=on(t),{htmlProps:l,descendants:u,...p}=IW(i),m=d.useMemo(()=>p,[p]),{isFitted:h,...g}=l;return a.jsx(SW,{value:u,children:a.jsx(PW,{value:m,children:a.jsx(TW,{value:r,children:a.jsx(we.div,{className:Ye("chakra-tabs",s),ref:n,...g,__css:r.root,children:o})})})})});rl.displayName="Tabs";var ol=je(function(t,n){const r=EW({...t,ref:n}),s={display:"flex",...Zh().tablist};return a.jsx(we.div,{...r,className:Ye("chakra-tabs__tablist",t.className),__css:s})});ol.displayName="TabList";var So=je(function(t,n){const r=AW({...t,ref:n}),o=Zh();return a.jsx(we.div,{outline:"0",...r,className:Ye("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});So.displayName="TabPanel";var zc=je(function(t,n){const r=DW(t),o=Zh();return a.jsx(we.div,{...r,width:"100%",ref:n,className:Ye("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});zc.displayName="TabPanels";var Tr=je(function(t,n){const r=Zh(),o=MW({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(we.button,{...o,className:Ye("chakra-tabs__tab",t.className),__css:s})});Tr.displayName="Tab";function NW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var $W=["h","minH","height","minHeight"],dP=je((e,t)=>{const n=oi("Textarea",e),{className:r,rows:o,...s}=on(e),i=pb(s),l=o?NW(n,$W):n;return a.jsx(we.textarea,{ref:t,rows:o,...i,className:Ye("chakra-textarea",r),__css:l})});dP.displayName="Textarea";var LW={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},W1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Bp=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function zW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:i=o,closeOnEsc:l=!0,onOpen:u,onClose:p,placement:m,id:h,isOpen:g,defaultIsOpen:x,arrowSize:y=10,arrowShadowColor:b,arrowPadding:w,modifiers:S,isDisabled:j,gutter:_,offset:E,direction:I,...M}=e,{isOpen:R,onOpen:D,onClose:A}=Fb({isOpen:g,defaultIsOpen:x,onOpen:u,onClose:p}),{referenceRef:O,getPopperProps:T,getArrowInnerProps:X,getArrowProps:B}=zb({enabled:R,placement:m,arrowPadding:w,modifiers:S,gutter:_,offset:E,direction:I}),V=d.useId(),N=`tooltip-${h??V}`,$=d.useRef(null),q=d.useRef(),F=d.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),Q=d.useRef(),Y=d.useCallback(()=>{Q.current&&(clearTimeout(Q.current),Q.current=void 0)},[]),se=d.useCallback(()=>{Y(),A()},[A,Y]),ae=FW($,se),re=d.useCallback(()=>{if(!j&&!q.current){R&&ae();const ge=Bp($);q.current=ge.setTimeout(D,t)}},[ae,j,R,D,t]),G=d.useCallback(()=>{F();const ge=Bp($);Q.current=ge.setTimeout(se,n)},[n,se,F]),K=d.useCallback(()=>{R&&r&&G()},[r,G,R]),ee=d.useCallback(()=>{R&&i&&G()},[i,G,R]),ce=d.useCallback(ge=>{R&&ge.key==="Escape"&&G()},[R,G]);Di(()=>W1($),"keydown",l?ce:void 0),Di(()=>{const ge=$.current;if(!ge)return null;const Ce=t3(ge);return Ce.localName==="body"?Bp($):Ce},"scroll",()=>{R&&s&&se()},{passive:!0,capture:!0}),d.useEffect(()=>{j&&(F(),R&&A())},[j,R,A,F]),d.useEffect(()=>()=>{F(),Y()},[F,Y]),Di(()=>$.current,"pointerleave",G);const J=d.useCallback((ge={},Ce=null)=>({...ge,ref:It($,Ce,O),onPointerEnter:He(ge.onPointerEnter,fe=>{fe.pointerType!=="touch"&&re()}),onClick:He(ge.onClick,K),onPointerDown:He(ge.onPointerDown,ee),onFocus:He(ge.onFocus,re),onBlur:He(ge.onBlur,G),"aria-describedby":R?N:void 0}),[re,G,ee,R,N,K,O]),ie=d.useCallback((ge={},Ce=null)=>T({...ge,style:{...ge.style,[$n.arrowSize.var]:y?`${y}px`:void 0,[$n.arrowShadowColor.var]:b}},Ce),[T,y,b]),de=d.useCallback((ge={},Ce=null)=>{const he={...ge.style,position:"relative",transformOrigin:$n.transformOrigin.varRef};return{ref:Ce,...M,...ge,id:N,role:"tooltip",style:he}},[M,N]);return{isOpen:R,show:re,hide:G,getTriggerProps:J,getTooltipProps:de,getTooltipPositionerProps:ie,getArrowProps:B,getArrowInnerProps:X}}var yv="chakra-ui:close-tooltip";function FW(e,t){return d.useEffect(()=>{const n=W1(e);return n.addEventListener(yv,t),()=>n.removeEventListener(yv,t)},[t,e]),()=>{const n=W1(e),r=Bp(e);n.dispatchEvent(new r.CustomEvent(yv))}}function BW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function HW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var VW=we(In.div),Ft=je((e,t)=>{var n,r;const o=oi("Tooltip",e),s=on(e),i=bd(),{children:l,label:u,shouldWrapChildren:p,"aria-label":m,hasArrow:h,bg:g,portalProps:x,background:y,backgroundColor:b,bgColor:w,motionProps:S,...j}=s,_=(r=(n=y??b)!=null?n:g)!=null?r:w;if(_){o.bg=_;const T=BR(i,"colors",_);o[$n.arrowBg.var]=T}const E=zW({...j,direction:i.direction}),I=typeof l=="string"||p;let M;if(I)M=a.jsx(we.span,{display:"inline-block",tabIndex:0,...E.getTriggerProps(),children:l});else{const T=d.Children.only(l);M=d.cloneElement(T,E.getTriggerProps(T.props,T.ref))}const R=!!m,D=E.getTooltipProps({},t),A=R?BW(D,["role","id"]):D,O=HW(D,["role","id"]);return u?a.jsxs(a.Fragment,{children:[M,a.jsx(dr,{children:E.isOpen&&a.jsx(Ac,{...x,children:a.jsx(we.div,{...E.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(VW,{variants:LW,initial:"exit",animate:"enter",exit:"exit",...S,...A,__css:o,children:[u,R&&a.jsx(we.span,{srOnly:!0,...O,children:m}),h&&a.jsx(we.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(we.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:l})});Ft.displayName="Tooltip";function Jh(e,t={}){let n=d.useCallback(o=>t.keys?r$(e,t.keys,o):e.listen(o),[t.keys,e]),r=e.get.bind(e);return d.useSyncExternalStore(n,r,r)}const WW=le(xe,({system:e})=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),fP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=W(WW);return d.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${HR[t]}`)):localStorage.setItem("ROARR_LOG","false"),tw.ROARR.write=VR.createLogWriter()},[t,n]),d.useEffect(()=>{const o={...WR};UR.set(tw.Roarr.child(o))},[]),d.useMemo(()=>si(e),[e])},UW=()=>{const e=te(),t=W(r=>r.system.toastQueue),n=r5();return d.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(GR())},[e,n,t]),null},sl=()=>{const e=te();return d.useCallback(n=>e(ct(Qt(n))),[e])},GW=d.memo(UW);var KW=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Fd(e,t){var n=qW(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function qW(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=KW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var XW=[".DS_Store","Thumbs.db"];function QW(e){return Tc(this,void 0,void 0,function(){return Nc(this,function(t){return um(e)&&YW(e.dataTransfer)?[2,tU(e.dataTransfer,e.type)]:ZW(e)?[2,JW(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,eU(e)]:[2,[]]})})}function YW(e){return um(e)}function ZW(e){return um(e)&&um(e.target)}function um(e){return typeof e=="object"&&e!==null}function JW(e){return U1(e.target.files).map(function(t){return Fd(t)})}function eU(e){return Tc(this,void 0,void 0,function(){var t;return Nc(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Fd(r)})]}})})}function tU(e,t){return Tc(this,void 0,void 0,function(){var n,r;return Nc(this,function(o){switch(o.label){case 0:return e.items?(n=U1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(nU))]):[3,2];case 1:return r=o.sent(),[2,LS(pP(r))];case 2:return[2,LS(U1(e.files).map(function(s){return Fd(s)}))]}})})}function LS(e){return e.filter(function(t){return XW.indexOf(t.name)===-1})}function U1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function nU(e){if(typeof e.webkitGetAsEntry!="function")return zS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?mP(t):zS(e)}function pP(e){return e.reduce(function(t,n){return M1(M1([],iS(t),!1),iS(Array.isArray(n)?pP(n):[n]),!1)},[])}function zS(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Fd(t);return Promise.resolve(n)}function rU(e){return Tc(this,void 0,void 0,function(){return Nc(this,function(t){return[2,e.isDirectory?mP(e):oU(e)]})})}function mP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(l){return Tc(i,void 0,void 0,function(){var u,p,m;return Nc(this,function(h){switch(h.label){case 0:if(l.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return u=h.sent(),n(u),[3,4];case 3:return p=h.sent(),r(p),[3,4];case 4:return[3,6];case 5:m=Promise.all(l.map(rU)),o.push(m),s(),h.label=6;case 6:return[2]}})})},function(l){r(l)})}s()})}function oU(e){return Tc(this,void 0,void 0,function(){return Nc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=Fd(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var sU=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var l=i.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?s===l.replace(/\/.*$/,""):o===l})}return!0};function FS(e){return lU(e)||iU(e)||gP(e)||aU()}function aU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lU(e){if(Array.isArray(e))return G1(e)}function BS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function HS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BS(Object(n),!0).forEach(function(r){hP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rd(e,t){return dU(e)||uU(e,t)||gP(e,t)||cU()}function cU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gP(e,t){if(e){if(typeof e=="string")return G1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G1(e,t)}}function G1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function dU(e){if(Array.isArray(e))return e}var fU="file-invalid-type",pU="file-too-large",mU="file-too-small",hU="too-many-files",gU=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:fU,message:"File type must be ".concat(n)}},VS=function(t){return{code:pU,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},WS=function(t){return{code:mU,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},vU={code:hU,message:"Too many files"};function vP(e,t){var n=e.type==="application/x-moz-file"||sU(e,t);return[n,n?null:gU(t)]}function xP(e,t,n){if(Ii(e.size))if(Ii(t)&&Ii(n)){if(e.size>n)return[!1,VS(n)];if(e.size<t)return[!1,WS(t)]}else{if(Ii(t)&&e.size<t)return[!1,WS(t)];if(Ii(n)&&e.size>n)return[!1,VS(n)]}return[!0,null]}function Ii(e){return e!=null}function xU(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,l=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(u){var p=vP(u,n),m=rd(p,1),h=m[0],g=xP(u,r,o),x=rd(g,1),y=x[0],b=l?l(u):null;return h&&y&&!b})}function dm(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function sp(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function US(e){e.preventDefault()}function bU(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yU(e){return e.indexOf("Edge/")!==-1}function CU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return bU(e)||yU(e)}function ps(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(l){return!dm(r)&&l&&l.apply(void 0,[r].concat(s)),dm(r)})}}function wU(){return"showOpenFilePicker"in window}function SU(e){if(Ii(e)){var t=Object.entries(e).filter(function(n){var r=rd(n,2),o=r[0],s=r[1],i=!0;return bP(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(yP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=rd(r,2),s=o[0],i=o[1];return HS(HS({},n),{},hP({},s,i))},{});return[{description:"Files",accept:t}]}return e}function kU(e){if(Ii(e))return Object.entries(e).reduce(function(t,n){var r=rd(n,2),o=r[0],s=r[1];return[].concat(FS(t),[o],FS(s))},[]).filter(function(t){return bP(t)||yP(t)}).join(",")}function jU(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function _U(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function bP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function yP(e){return/^.*\.[\w]+$/.test(e)}var IU=["children"],PU=["open"],EU=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],MU=["refKey","onChange","onClick"];function OU(e){return AU(e)||DU(e)||CP(e)||RU()}function RU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AU(e){if(Array.isArray(e))return K1(e)}function Cv(e,t){return $U(e)||NU(e,t)||CP(e,t)||TU()}function TU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CP(e,t){if(e){if(typeof e=="string")return K1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K1(e,t)}}function K1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function $U(e){if(Array.isArray(e))return e}function GS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GS(Object(n),!0).forEach(function(r){q1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fm(e,t){if(e==null)return{};var n=LU(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Yb=d.forwardRef(function(e,t){var n=e.children,r=fm(e,IU),o=Zb(r),s=o.open,i=fm(o,PU);return d.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(d.Fragment,null,n(bn(bn({},i),{},{open:s})))});Yb.displayName="Dropzone";var wP={disabled:!1,getFilesFromEvent:QW,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Yb.defaultProps=wP;Yb.propTypes={children:Jt.func,accept:Jt.objectOf(Jt.arrayOf(Jt.string)),multiple:Jt.bool,preventDropOnDocument:Jt.bool,noClick:Jt.bool,noKeyboard:Jt.bool,noDrag:Jt.bool,noDragEventsBubbling:Jt.bool,minSize:Jt.number,maxSize:Jt.number,maxFiles:Jt.number,disabled:Jt.bool,getFilesFromEvent:Jt.func,onFileDialogCancel:Jt.func,onFileDialogOpen:Jt.func,useFsAccessApi:Jt.bool,autoFocus:Jt.bool,onDragEnter:Jt.func,onDragLeave:Jt.func,onDragOver:Jt.func,onDrop:Jt.func,onDropAccepted:Jt.func,onDropRejected:Jt.func,onError:Jt.func,validator:Jt.func};var X1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Zb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=bn(bn({},wP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,l=t.multiple,u=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,h=t.onDragOver,g=t.onDrop,x=t.onDropAccepted,y=t.onDropRejected,b=t.onFileDialogCancel,w=t.onFileDialogOpen,S=t.useFsAccessApi,j=t.autoFocus,_=t.preventDropOnDocument,E=t.noClick,I=t.noKeyboard,M=t.noDrag,R=t.noDragEventsBubbling,D=t.onError,A=t.validator,O=d.useMemo(function(){return kU(n)},[n]),T=d.useMemo(function(){return SU(n)},[n]),X=d.useMemo(function(){return typeof w=="function"?w:KS},[w]),B=d.useMemo(function(){return typeof b=="function"?b:KS},[b]),V=d.useRef(null),U=d.useRef(null),N=d.useReducer(zU,X1),$=Cv(N,2),q=$[0],F=$[1],Q=q.isFocused,Y=q.isFileDialogActive,se=d.useRef(typeof window<"u"&&window.isSecureContext&&S&&wU()),ae=function(){!se.current&&Y&&setTimeout(function(){if(U.current){var De=U.current.files;De.length||(F({type:"closeDialog"}),B())}},300)};d.useEffect(function(){return window.addEventListener("focus",ae,!1),function(){window.removeEventListener("focus",ae,!1)}},[U,Y,B,se]);var re=d.useRef([]),G=function(De){V.current&&V.current.contains(De.target)||(De.preventDefault(),re.current=[])};d.useEffect(function(){return _&&(document.addEventListener("dragover",US,!1),document.addEventListener("drop",G,!1)),function(){_&&(document.removeEventListener("dragover",US),document.removeEventListener("drop",G))}},[V,_]),d.useEffect(function(){return!r&&j&&V.current&&V.current.focus(),function(){}},[V,j,r]);var K=d.useCallback(function(ye){D?D(ye):console.error(ye)},[D]),ee=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye),re.current=[].concat(OU(re.current),[ye.target]),sp(ye)&&Promise.resolve(o(ye)).then(function(De){if(!(dm(ye)&&!R)){var ut=De.length,bt=ut>0&&xU({files:De,accept:O,minSize:i,maxSize:s,multiple:l,maxFiles:u,validator:A}),be=ut>0&&!bt;F({isDragAccept:bt,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),p&&p(ye)}}).catch(function(De){return K(De)})},[o,p,K,R,O,i,s,l,u,A]),ce=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye);var De=sp(ye);if(De&&ye.dataTransfer)try{ye.dataTransfer.dropEffect="copy"}catch{}return De&&h&&h(ye),!1},[h,R]),J=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye);var De=re.current.filter(function(bt){return V.current&&V.current.contains(bt)}),ut=De.indexOf(ye.target);ut!==-1&&De.splice(ut,1),re.current=De,!(De.length>0)&&(F({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),sp(ye)&&m&&m(ye))},[V,m,R]),ie=d.useCallback(function(ye,De){var ut=[],bt=[];ye.forEach(function(be){var Je=vP(be,O),lt=Cv(Je,2),ft=lt[0],Me=lt[1],Le=xP(be,i,s),Ut=Cv(Le,2),ke=Ut[0],Be=Ut[1],ze=A?A(be):null;if(ft&&ke&&!ze)ut.push(be);else{var Ge=[Me,Be];ze&&(Ge=Ge.concat(ze)),bt.push({file:be,errors:Ge.filter(function(pt){return pt})})}}),(!l&&ut.length>1||l&&u>=1&&ut.length>u)&&(ut.forEach(function(be){bt.push({file:be,errors:[vU]})}),ut.splice(0)),F({acceptedFiles:ut,fileRejections:bt,type:"setFiles"}),g&&g(ut,bt,De),bt.length>0&&y&&y(bt,De),ut.length>0&&x&&x(ut,De)},[F,l,O,i,s,u,g,x,y,A]),de=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye),re.current=[],sp(ye)&&Promise.resolve(o(ye)).then(function(De){dm(ye)&&!R||ie(De,ye)}).catch(function(De){return K(De)}),F({type:"reset"})},[o,ie,K,R]),ge=d.useCallback(function(){if(se.current){F({type:"openDialog"}),X();var ye={multiple:l,types:T};window.showOpenFilePicker(ye).then(function(De){return o(De)}).then(function(De){ie(De,null),F({type:"closeDialog"})}).catch(function(De){jU(De)?(B(De),F({type:"closeDialog"})):_U(De)?(se.current=!1,U.current?(U.current.value=null,U.current.click()):K(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):K(De)});return}U.current&&(F({type:"openDialog"}),X(),U.current.value=null,U.current.click())},[F,X,B,S,ie,K,T,l]),Ce=d.useCallback(function(ye){!V.current||!V.current.isEqualNode(ye.target)||(ye.key===" "||ye.key==="Enter"||ye.keyCode===32||ye.keyCode===13)&&(ye.preventDefault(),ge())},[V,ge]),he=d.useCallback(function(){F({type:"focus"})},[]),fe=d.useCallback(function(){F({type:"blur"})},[]),Oe=d.useCallback(function(){E||(CU()?setTimeout(ge,0):ge())},[E,ge]),_e=function(De){return r?null:De},Ne=function(De){return I?null:_e(De)},nt=function(De){return M?null:_e(De)},$e=function(De){R&&De.stopPropagation()},Pt=d.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De=ye.refKey,ut=De===void 0?"ref":De,bt=ye.role,be=ye.onKeyDown,Je=ye.onFocus,lt=ye.onBlur,ft=ye.onClick,Me=ye.onDragEnter,Le=ye.onDragOver,Ut=ye.onDragLeave,ke=ye.onDrop,Be=fm(ye,EU);return bn(bn(q1({onKeyDown:Ne(ps(be,Ce)),onFocus:Ne(ps(Je,he)),onBlur:Ne(ps(lt,fe)),onClick:_e(ps(ft,Oe)),onDragEnter:nt(ps(Me,ee)),onDragOver:nt(ps(Le,ce)),onDragLeave:nt(ps(Ut,J)),onDrop:nt(ps(ke,de)),role:typeof bt=="string"&&bt!==""?bt:"presentation"},ut,V),!r&&!I?{tabIndex:0}:{}),Be)}},[V,Ce,he,fe,Oe,ee,ce,J,de,I,M,r]),Ze=d.useCallback(function(ye){ye.stopPropagation()},[]),ot=d.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De=ye.refKey,ut=De===void 0?"ref":De,bt=ye.onChange,be=ye.onClick,Je=fm(ye,MU),lt=q1({accept:O,multiple:l,type:"file",style:{display:"none"},onChange:_e(ps(bt,de)),onClick:_e(ps(be,Ze)),tabIndex:-1},ut,U);return bn(bn({},lt),Je)}},[U,n,l,de,r]);return bn(bn({},q),{},{isFocused:Q&&!r,getRootProps:Pt,getInputProps:ot,rootRef:V,inputRef:U,open:_e(ge)})}function zU(e,t){switch(t.type){case"focus":return bn(bn({},e),{},{isFocused:!0});case"blur":return bn(bn({},e),{},{isFocused:!1});case"openDialog":return bn(bn({},X1),{},{isFileDialogActive:!0});case"closeDialog":return bn(bn({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return bn(bn({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return bn(bn({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return bn({},X1);default:return e}}function KS(){}function Q1(){return Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q1.apply(this,arguments)}var SP=["shift","alt","meta","mod","ctrl"],FU={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Va(e){return(FU[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function BU(e){return SP.includes(e)}function wv(e,t){return t===void 0&&(t=","),e.split(t)}function Sv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return Va(i)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(i){return!SP.includes(i)});return Q1({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&kP([Va(e.key),Va(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&jP([Va(e.key),Va(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Wa.clear()})})();var Wa=new Set;function Jb(e){return Array.isArray(e)}function Hp(e,t){t===void 0&&(t=",");var n=Jb(e)?e:e.split(t);return n.every(function(r){return Wa.has(r.trim().toLowerCase())})}function kP(e){var t=Array.isArray(e)?e:[e];Wa.has("meta")&&Wa.forEach(function(n){return!BU(n)&&Wa.delete(n.toLowerCase())}),t.forEach(function(n){return Wa.add(n.toLowerCase())})}function jP(e){var t=Array.isArray(e)?e:[e];e==="meta"?Wa.clear():t.forEach(function(n){return Wa.delete(n.toLowerCase())})}function HU(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function VU(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function WU(e){return _P(e,["input","textarea","select"])}function _P(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Jb(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function UU(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var GU=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,l=n.shift,u=n.ctrl,p=n.keys,m=t.key,h=t.code,g=t.ctrlKey,x=t.metaKey,y=t.shiftKey,b=t.altKey,w=Va(h),S=m.toLowerCase();if(!r){if(o===!b&&S!=="alt"||l===!y&&S!=="shift")return!1;if(i){if(!x&&!g)return!1}else if(s===!x&&S!=="meta"&&S!=="os"||u===!g&&S!=="ctrl"&&S!=="control")return!1}return p&&p.length===1&&(p.includes(S)||p.includes(w))?!0:p?Hp(p):!p},KU=d.createContext(void 0),qU=function(){return d.useContext(KU)};function IP(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&IP(e[r],t[r])},!0):e===t}var XU=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),QU=function(){return d.useContext(XU)};function YU(e){var t=d.useRef(void 0);return IP(t.current,e)||(t.current=e),t.current}var qS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},ZU=typeof window<"u"?d.useLayoutEffect:d.useEffect;function et(e,t,n,r){var o=d.useRef(null),s=d.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,l=Jb(e)?e.join(i==null?void 0:i.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,p=d.useCallback(t,u??[]),m=d.useRef(p);u?m.current=p:m.current=t;var h=YU(i),g=QU(),x=g.enabledScopes,y=qU();return ZU(function(){if(!((h==null?void 0:h.enabled)===!1||!UU(x,h==null?void 0:h.scopes))){var b=function(E,I){var M;if(I===void 0&&(I=!1),!(WU(E)&&!_P(E,h==null?void 0:h.enableOnFormTags))&&!(h!=null&&h.ignoreEventWhen!=null&&h.ignoreEventWhen(E))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){qS(E);return}(M=E.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||wv(l,h==null?void 0:h.splitKey).forEach(function(R){var D,A=Sv(R,h==null?void 0:h.combinationKey);if(GU(E,A,h==null?void 0:h.ignoreModifiers)||(D=A.keys)!=null&&D.includes("*")){if(I&&s.current)return;if(HU(E,A,h==null?void 0:h.preventDefault),!VU(E,A,h==null?void 0:h.enabled)){qS(E);return}m.current(E,A),I||(s.current=!0)}})}},w=function(E){E.key!==void 0&&(kP(Va(E.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&b(E))},S=function(E){E.key!==void 0&&(jP(Va(E.code)),s.current=!1,h!=null&&h.keyup&&b(E,!0))},j=o.current||(i==null?void 0:i.document)||document;return j.addEventListener("keyup",S),j.addEventListener("keydown",w),y&&wv(l,h==null?void 0:h.splitKey).forEach(function(_){return y.addHotkey(Sv(_,h==null?void 0:h.combinationKey,h==null?void 0:h.description))}),function(){j.removeEventListener("keyup",S),j.removeEventListener("keydown",w),y&&wv(l,h==null?void 0:h.splitKey).forEach(function(_){return y.removeHotkey(Sv(_,h==null?void 0:h.combinationKey,h==null?void 0:h.description))})}}},[l,h,x]),o}const JU=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return et("esc",()=>{r(!1)}),a.jsxs(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:[a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:"base.700",_dark:{bg:"base.900"},opacity:.7,alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx(L,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",flexDir:"column",gap:4,borderWidth:3,borderRadius:"xl",borderStyle:"dashed",color:"base.100",borderColor:"base.100",_dark:{borderColor:"base.200"}},children:t?a.jsx(cr,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(cr,{size:"lg",children:"Invalid Upload"}),a.jsx(cr,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},eG=d.memo(JU),tG=le([xe,Jn],({gallery:e},t)=>{let n={type:"TOAST"};t==="unifiedCanvas"&&(n={type:"SET_CANVAS_INITIAL_IMAGE"}),t==="img2img"&&(n={type:"SET_INITIAL_IMAGE"});const{autoAddBoardId:r}=e;return{autoAddBoardId:r,postUploadAction:n}},Se),nG=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=W(tG),o=sl(),{t:s}=Z(),[i,l]=d.useState(!1),[u]=rI(),p=d.useCallback(_=>{l(!0),o({title:s("toast.uploadFailed"),description:_.errors.map(E=>E.message).join(`
-`),status:"error"})},[s,o]),m=d.useCallback(async _=>{u({file:_,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,u]),h=d.useCallback((_,E)=>{if(E.length>1){o({title:s("toast.uploadFailed"),description:s("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}E.forEach(I=>{p(I)}),_.forEach(I=>{m(I)})},[s,o,m,p]),g=d.useCallback(()=>{l(!0)},[]),{getRootProps:x,getInputProps:y,isDragAccept:b,isDragReject:w,isDragActive:S,inputRef:j}=Zb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:g,multiple:!1});return d.useEffect(()=>{const _=async E=>{var I,M;j.current&&(I=E.clipboardData)!=null&&I.files&&(j.current.files=E.clipboardData.files,(M=j.current)==null||M.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",_),()=>{document.removeEventListener("paste",_)}},[j]),a.jsxs(Ie,{...x({style:{}}),onKeyDown:_=>{_.key},children:[a.jsx("input",{...y()}),t,a.jsx(dr,{children:S&&i&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(eG,{isDragAccept:b,isDragReject:w,setIsHandlingUpload:l})},"image-upload-overlay")})]})},rG=d.memo(nG),oG=je((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:l,...u}=e;return a.jsx(Ft,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(Za,{ref:t,colorScheme:l?"accent":"base",...u,children:n})})}),at=d.memo(oG);function sG(e){const t=d.createContext(null);return[({children:o,value:s})=>H.createElement(t.Provider,{value:s},o),()=>{const o=d.useContext(t);if(o===null)throw new Error(e);return o}]}function PP(e){return Array.isArray(e)?e:[e]}const aG=()=>{};function iG(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||aG:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function EP({data:e}){const t=[],n=[],r=e.reduce((o,s,i)=>(s.group?o[s.group]?o[s.group].push(i):o[s.group]=[i]:n.push(i),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function MP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function OP(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=OP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function RP(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=OP(t))&&(r&&(r+=" "),r+=n);return r}const lG={app:100,modal:200,popover:300,overlay:400,max:9999};function ey(e){return lG[e]}function cG(e,t){const n=d.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const uG=KR({key:"mantine",prepend:!0});function dG(){return XI()||uG}var fG=Object.defineProperty,XS=Object.getOwnPropertySymbols,pG=Object.prototype.hasOwnProperty,mG=Object.prototype.propertyIsEnumerable,QS=(e,t,n)=>t in e?fG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hG=(e,t)=>{for(var n in t||(t={}))pG.call(t,n)&&QS(e,n,t[n]);if(XS)for(var n of XS(t))mG.call(t,n)&&QS(e,n,t[n]);return e};const kv="ref";function gG(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(kv in n))return{args:e,ref:t};t=n[kv];const r=hG({},n);return delete r[kv],{args:[r],ref:t}}const{cssFactory:vG}=(()=>{function e(n,r,o){const s=[],i=QR(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:l,args:u}=gG(i),p=qR(u,r.registered);return XR(r,p,!1),`${r.key}-${p.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...i)=>e(r.registered,o,RP(i))}}return{cssFactory:t}})();function DP(){const e=dG();return cG(()=>vG({cache:e}),[e])}function xG({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((l,u)=>(Object.keys(u.classNames).forEach(p=>{typeof l[p]!="string"?l[p]=`${u.classNames[p]}`:l[p]=`${l[p]} ${u.classNames[p]}`}),l),{});return Object.keys(t).reduce((l,u)=>(l[u]=e(t[u],i[u],r!=null&&r[u],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${u}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${u}`:null),l),{})}var bG=Object.defineProperty,YS=Object.getOwnPropertySymbols,yG=Object.prototype.hasOwnProperty,CG=Object.prototype.propertyIsEnumerable,ZS=(e,t,n)=>t in e?bG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jv=(e,t)=>{for(var n in t||(t={}))yG.call(t,n)&&ZS(e,n,t[n]);if(YS)for(var n of YS(t))CG.call(t,n)&&ZS(e,n,t[n]);return e};function Y1(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=jv(jv({},e[n]),t[n]):e[n]=jv({},t[n])}),e}function JS(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,i)=>Y1(s,i),{}):o(e)}function wG({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&Y1(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&Y1(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function fr(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=xa(),i=F9(o==null?void 0:o.name),l=XI(),u={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:m}=DP(),h=t(s,r,u),g=JS(o==null?void 0:o.styles,s,r,u),x=JS(i,s,r,u),y=wG({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),b=Object.fromEntries(Object.keys(h).map(w=>{const S=m({[p(h[w])]:!(o!=null&&o.unstyled)},p(y[w]),p(x[w]),p(g[w]));return[w,S]}));return{classes:xG({cx:m,classes:b,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:m,theme:s}}return n}function e4(e){return`___ref-${e||""}`}var SG=Object.defineProperty,kG=Object.defineProperties,jG=Object.getOwnPropertyDescriptors,t4=Object.getOwnPropertySymbols,_G=Object.prototype.hasOwnProperty,IG=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?SG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wu=(e,t)=>{for(var n in t||(t={}))_G.call(t,n)&&n4(e,n,t[n]);if(t4)for(var n of t4(t))IG.call(t,n)&&n4(e,n,t[n]);return e},Su=(e,t)=>kG(e,jG(t));const ku={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Re(10)})`},transitionProperty:"transform, opacity"},ap={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${Re(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${Re(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Re(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Re(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Su(wu({},ku),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Su(wu({},ku),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Su(wu({},ku),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Su(wu({},ku),{common:{transformOrigin:"top left"}}),"pop-top-right":Su(wu({},ku),{common:{transformOrigin:"top right"}})},r4=["mousedown","touchstart"];function PG(e,t,n){const r=d.useRef();return d.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const l=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!l&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||r4).forEach(s=>document.addEventListener(s,o)),()=>{(t||r4).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function EG(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function MG(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function OG(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=d.useState(n?t:MG(e,t)),s=d.useRef();return d.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),EG(s.current,i=>o(i.matches))},[e]),r}const AP=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Uo(e,t){const n=d.useRef(!1);d.useEffect(()=>()=>{n.current=!1},[]),d.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function RG({opened:e,shouldReturnFocus:t=!0}){const n=d.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Uo(()=>{let o=-1;const s=i=>{i.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const DG=/input|select|textarea|button|object/,TP="a, input, select, textarea, button, object, [tabindex]";function AG(e){return e.style.display==="none"}function TG(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(AG(n))return!1;n=n.parentNode}return!0}function NP(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Z1(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(NP(e));return(DG.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&TG(e)}function $P(e){const t=NP(e);return(Number.isNaN(t)||t>=0)&&Z1(e)}function NG(e){return Array.from(e.querySelectorAll(TP)).filter($P)}function $G(e,t){const n=NG(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const i=n[t.shiftKey?n.length-1:0];i&&i.focus()}function ty(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function LG(e,t="body > :not(script)"){const n=ty(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),u=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!l&&!u&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:l||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function zG(e=!0){const t=d.useRef(),n=d.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const l=Array.from(s.querySelectorAll(TP));i=l.find($P)||l.find(Z1)||null,!i&&Z1(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=d.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=LG(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return d.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=i=>{i.key==="Tab"&&t.current&&$G(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const FG=H["useId".toString()]||(()=>{});function BG(){const e=FG();return e?`mantine-${e.replace(/:/g,"")}`:""}function ny(e){const t=BG(),[n,r]=d.useState(t);return AP(()=>{r(ty())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function o4(e,t,n){d.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function LP(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function HG(...e){return t=>{e.forEach(n=>LP(n,t))}}function Bd(...e){return d.useCallback(HG(...e),e)}function od({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=d.useState(t!==void 0?t:n),i=l=>{s(l),r==null||r(l)};return e!==void 0?[e,r,!0]:[o,i,!1]}function zP(e,t){return OG("(prefers-reduced-motion: reduce)",e,t)}const VG=e=>e<.5?2*e*e:-1+(4-2*e)*e,WG=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const i=!!n,u=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),m=h=>p[h]-u[h];if(e==="y"){const h=m("top");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.height*(s?0:1)||!s?x:0}const g=i?u.height:window.innerHeight;if(r==="end"){const x=h+o-g+p.height;return x>=-p.height*(s?0:1)||!s?x:0}return r==="center"?h-g/2+p.height/2:0}if(e==="x"){const h=m("left");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.width||!s?x:0}const g=i?u.width:window.innerWidth;if(r==="end"){const x=h+o-g+p.width;return x>=-p.width||!s?x:0}return r==="center"?h-g/2+p.width/2:0}return 0},UG=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},GG=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:s}=document;o[r]=n,s[r]=n}};function FP({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=VG,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const l=d.useRef(0),u=d.useRef(0),p=d.useRef(!1),m=d.useRef(null),h=d.useRef(null),g=zP(),x=()=>{l.current&&cancelAnimationFrame(l.current)},y=d.useCallback(({alignment:w="start"}={})=>{var S;p.current=!1,l.current&&x();const j=(S=UG({parent:m.current,axis:t}))!=null?S:0,_=WG({parent:m.current,target:h.current,axis:t,alignment:w,offset:o,isList:i})-(m.current?0:j);function E(){u.current===0&&(u.current=performance.now());const M=performance.now()-u.current,R=g||e===0?1:M/e,D=j+_*r(R);GG({parent:m.current,axis:t,distance:D}),!p.current&&R<1?l.current=requestAnimationFrame(E):(typeof n=="function"&&n(),u.current=0,l.current=0,x())}E()},[t,e,r,i,o,n,g]),b=()=>{s&&(p.current=!0)};return o4("wheel",b,{passive:!0}),o4("touchmove",b,{passive:!0}),d.useEffect(()=>x,[]),{scrollableRef:m,targetRef:h,scrollIntoView:y,cancel:x}}var s4=Object.getOwnPropertySymbols,KG=Object.prototype.hasOwnProperty,qG=Object.prototype.propertyIsEnumerable,XG=(e,t)=>{var n={};for(var r in e)KG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&s4)for(var r of s4(e))t.indexOf(r)<0&&qG.call(e,r)&&(n[r]=e[r]);return n};function eg(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:w,c:S,opacity:j,ff:_,fz:E,fw:I,lts:M,ta:R,lh:D,fs:A,tt:O,td:T,w:X,miw:B,maw:V,h:U,mih:N,mah:$,bgsz:q,bgp:F,bgr:Q,bga:Y,pos:se,top:ae,left:re,bottom:G,right:K,inset:ee,display:ce}=t,J=XG(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:B9({m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:w,c:S,opacity:j,ff:_,fz:E,fw:I,lts:M,ta:R,lh:D,fs:A,tt:O,td:T,w:X,miw:B,maw:V,h:U,mih:N,mah:$,bgsz:q,bgp:F,bgr:Q,bga:Y,pos:se,top:ae,left:re,bottom:G,right:K,inset:ee,display:ce}),rest:J}}function QG(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>Kw(mt({size:r,sizes:t.breakpoints}))-Kw(mt({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function YG({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return QG(e,t).reduce((i,l)=>{if(l==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(m=>{i[m]=p}),i):(i[r]=p,i)}const u=n(e[l],t);return Array.isArray(r)?(i[t.fn.largerThan(l)]={},r.forEach(p=>{i[t.fn.largerThan(l)][p]=u}),i):(i[t.fn.largerThan(l)]={[r]:u},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function ZG(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function JG(e){return Re(e)}function eK(e){return e}function tK(e,t){return mt({size:e,sizes:t.fontSizes})}const nK=["-xs","-sm","-md","-lg","-xl"];function rK(e,t){return nK.includes(e)?`calc(${mt({size:e.replace("-",""),sizes:t.spacing})} * -1)`:mt({size:e,sizes:t.spacing})}const oK={identity:eK,color:ZG,size:JG,fontSize:tK,spacing:rK},sK={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var aK=Object.defineProperty,a4=Object.getOwnPropertySymbols,iK=Object.prototype.hasOwnProperty,lK=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?aK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l4=(e,t)=>{for(var n in t||(t={}))iK.call(t,n)&&i4(e,n,t[n]);if(a4)for(var n of a4(t))lK.call(t,n)&&i4(e,n,t[n]);return e};function c4(e,t,n=sK){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(YG({value:e[s],getValue:oK[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(i=>{typeof s[i]=="object"&&s[i]!==null&&i in o?o[i]=l4(l4({},o[i]),s[i]):o[i]=s[i]}),o),{})}function u4(e,t){return typeof e=="function"?e(t):e}function cK(e,t,n){const r=xa(),{css:o,cx:s}=DP();return Array.isArray(e)?s(n,o(c4(t,r)),e.map(i=>o(u4(i,r)))):s(n,o(u4(e,r)),o(c4(t,r)))}var uK=Object.defineProperty,pm=Object.getOwnPropertySymbols,BP=Object.prototype.hasOwnProperty,HP=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?uK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dK=(e,t)=>{for(var n in t||(t={}))BP.call(t,n)&&d4(e,n,t[n]);if(pm)for(var n of pm(t))HP.call(t,n)&&d4(e,n,t[n]);return e},fK=(e,t)=>{var n={};for(var r in e)BP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pm)for(var r of pm(e))t.indexOf(r)<0&&HP.call(e,r)&&(n[r]=e[r]);return n};const VP=d.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,l=fK(n,["className","component","style","sx"]);const{systemStyles:u,rest:p}=eg(l),m=o||"div";return H.createElement(m,dK({ref:t,className:cK(i,u,r),style:s},p))});VP.displayName="@mantine/core/Box";const zr=VP;var pK=Object.defineProperty,mK=Object.defineProperties,hK=Object.getOwnPropertyDescriptors,f4=Object.getOwnPropertySymbols,gK=Object.prototype.hasOwnProperty,vK=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?pK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m4=(e,t)=>{for(var n in t||(t={}))gK.call(t,n)&&p4(e,n,t[n]);if(f4)for(var n of f4(t))vK.call(t,n)&&p4(e,n,t[n]);return e},xK=(e,t)=>mK(e,hK(t)),bK=fr(e=>({root:xK(m4(m4({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const yK=bK;var CK=Object.defineProperty,mm=Object.getOwnPropertySymbols,WP=Object.prototype.hasOwnProperty,UP=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?CK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wK=(e,t)=>{for(var n in t||(t={}))WP.call(t,n)&&h4(e,n,t[n]);if(mm)for(var n of mm(t))UP.call(t,n)&&h4(e,n,t[n]);return e},SK=(e,t)=>{var n={};for(var r in e)WP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mm)for(var r of mm(e))t.indexOf(r)<0&&UP.call(e,r)&&(n[r]=e[r]);return n};const GP=d.forwardRef((e,t)=>{const n=Dn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,l=SK(n,["className","component","unstyled","variant"]),{classes:u,cx:p}=yK(null,{name:"UnstyledButton",unstyled:s,variant:i});return H.createElement(zr,wK({component:o,ref:t,className:p(u.root,r),type:o==="button"?"button":void 0},l))});GP.displayName="@mantine/core/UnstyledButton";const kK=GP;var jK=Object.defineProperty,_K=Object.defineProperties,IK=Object.getOwnPropertyDescriptors,g4=Object.getOwnPropertySymbols,PK=Object.prototype.hasOwnProperty,EK=Object.prototype.propertyIsEnumerable,v4=(e,t,n)=>t in e?jK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J1=(e,t)=>{for(var n in t||(t={}))PK.call(t,n)&&v4(e,n,t[n]);if(g4)for(var n of g4(t))EK.call(t,n)&&v4(e,n,t[n]);return e},x4=(e,t)=>_K(e,IK(t));const MK=["subtle","filled","outline","light","default","transparent","gradient"],ip={xs:Re(18),sm:Re(22),md:Re(28),lg:Re(34),xl:Re(44)};function OK({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:MK.includes(e)?J1({border:`${Re(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var RK=fr((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:x4(J1({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:mt({size:s,sizes:ip}),minHeight:mt({size:s,sizes:ip}),width:mt({size:s,sizes:ip}),minWidth:mt({size:s,sizes:ip})},OK({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":x4(J1({content:'""'},e.fn.cover(Re(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const DK=RK;var AK=Object.defineProperty,hm=Object.getOwnPropertySymbols,KP=Object.prototype.hasOwnProperty,qP=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?AK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y4=(e,t)=>{for(var n in t||(t={}))KP.call(t,n)&&b4(e,n,t[n]);if(hm)for(var n of hm(t))qP.call(t,n)&&b4(e,n,t[n]);return e},C4=(e,t)=>{var n={};for(var r in e)KP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hm)for(var r of hm(e))t.indexOf(r)<0&&qP.call(e,r)&&(n[r]=e[r]);return n};function TK(e){var t=e,{size:n,color:r}=t,o=C4(t,["size","color"]);const s=o,{style:i}=s,l=C4(s,["style"]);return H.createElement("svg",y4({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:y4({width:n},i)},l),H.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var NK=Object.defineProperty,gm=Object.getOwnPropertySymbols,XP=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable,w4=(e,t,n)=>t in e?NK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S4=(e,t)=>{for(var n in t||(t={}))XP.call(t,n)&&w4(e,n,t[n]);if(gm)for(var n of gm(t))QP.call(t,n)&&w4(e,n,t[n]);return e},k4=(e,t)=>{var n={};for(var r in e)XP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gm)for(var r of gm(e))t.indexOf(r)<0&&QP.call(e,r)&&(n[r]=e[r]);return n};function $K(e){var t=e,{size:n,color:r}=t,o=k4(t,["size","color"]);const s=o,{style:i}=s,l=k4(s,["style"]);return H.createElement("svg",S4({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:S4({width:n,height:n},i)},l),H.createElement("g",{fill:"none",fillRule:"evenodd"},H.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},H.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),H.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},H.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var LK=Object.defineProperty,vm=Object.getOwnPropertySymbols,YP=Object.prototype.hasOwnProperty,ZP=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?LK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_4=(e,t)=>{for(var n in t||(t={}))YP.call(t,n)&&j4(e,n,t[n]);if(vm)for(var n of vm(t))ZP.call(t,n)&&j4(e,n,t[n]);return e},I4=(e,t)=>{var n={};for(var r in e)YP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vm)for(var r of vm(e))t.indexOf(r)<0&&ZP.call(e,r)&&(n[r]=e[r]);return n};function zK(e){var t=e,{size:n,color:r}=t,o=I4(t,["size","color"]);const s=o,{style:i}=s,l=I4(s,["style"]);return H.createElement("svg",_4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:_4({width:n},i)},l),H.createElement("circle",{cx:"15",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},H.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"105",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var FK=Object.defineProperty,xm=Object.getOwnPropertySymbols,JP=Object.prototype.hasOwnProperty,e6=Object.prototype.propertyIsEnumerable,P4=(e,t,n)=>t in e?FK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BK=(e,t)=>{for(var n in t||(t={}))JP.call(t,n)&&P4(e,n,t[n]);if(xm)for(var n of xm(t))e6.call(t,n)&&P4(e,n,t[n]);return e},HK=(e,t)=>{var n={};for(var r in e)JP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xm)for(var r of xm(e))t.indexOf(r)<0&&e6.call(e,r)&&(n[r]=e[r]);return n};const _v={bars:TK,oval:$K,dots:zK},VK={xs:Re(18),sm:Re(22),md:Re(36),lg:Re(44),xl:Re(58)},WK={size:"md"};function t6(e){const t=Dn("Loader",WK,e),{size:n,color:r,variant:o}=t,s=HK(t,["size","color","variant"]),i=xa(),l=o in _v?o:i.loader;return H.createElement(zr,BK({role:"presentation",component:_v[l]||_v.bars,size:mt({size:n,sizes:VK}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}t6.displayName="@mantine/core/Loader";var UK=Object.defineProperty,bm=Object.getOwnPropertySymbols,n6=Object.prototype.hasOwnProperty,r6=Object.prototype.propertyIsEnumerable,E4=(e,t,n)=>t in e?UK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M4=(e,t)=>{for(var n in t||(t={}))n6.call(t,n)&&E4(e,n,t[n]);if(bm)for(var n of bm(t))r6.call(t,n)&&E4(e,n,t[n]);return e},GK=(e,t)=>{var n={};for(var r in e)n6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bm)for(var r of bm(e))t.indexOf(r)<0&&r6.call(e,r)&&(n[r]=e[r]);return n};const KK={color:"gray",size:"md",variant:"subtle"},o6=d.forwardRef((e,t)=>{const n=Dn("ActionIcon",KK,e),{className:r,color:o,children:s,radius:i,size:l,variant:u,gradient:p,disabled:m,loaderProps:h,loading:g,unstyled:x,__staticSelector:y}=n,b=GK(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:S,theme:j}=DK({radius:i,color:o,gradient:p},{name:["ActionIcon",y],unstyled:x,size:l,variant:u}),_=H.createElement(t6,M4({color:j.fn.variant({color:o,variant:u}).color,size:"100%","data-action-icon-loader":!0},h));return H.createElement(kK,M4({className:S(w.root,r),ref:t,disabled:m,"data-disabled":m||void 0,"data-loading":g||void 0,unstyled:x},b),g?_:s)});o6.displayName="@mantine/core/ActionIcon";const qK=o6;var XK=Object.defineProperty,QK=Object.defineProperties,YK=Object.getOwnPropertyDescriptors,ym=Object.getOwnPropertySymbols,s6=Object.prototype.hasOwnProperty,a6=Object.prototype.propertyIsEnumerable,O4=(e,t,n)=>t in e?XK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZK=(e,t)=>{for(var n in t||(t={}))s6.call(t,n)&&O4(e,n,t[n]);if(ym)for(var n of ym(t))a6.call(t,n)&&O4(e,n,t[n]);return e},JK=(e,t)=>QK(e,YK(t)),eq=(e,t)=>{var n={};for(var r in e)s6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ym)for(var r of ym(e))t.indexOf(r)<0&&a6.call(e,r)&&(n[r]=e[r]);return n};function i6(e){const t=Dn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=eq(t,["children","target","className","innerRef"]),l=xa(),[u,p]=d.useState(!1),m=d.useRef();return AP(()=>(p(!0),m.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(m.current),()=>{!r&&document.body.removeChild(m.current)}),[r]),u?qr.createPortal(H.createElement("div",JK(ZK({className:o,dir:l.dir},i),{ref:s}),n),m.current):null}i6.displayName="@mantine/core/Portal";var tq=Object.defineProperty,Cm=Object.getOwnPropertySymbols,l6=Object.prototype.hasOwnProperty,c6=Object.prototype.propertyIsEnumerable,R4=(e,t,n)=>t in e?tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nq=(e,t)=>{for(var n in t||(t={}))l6.call(t,n)&&R4(e,n,t[n]);if(Cm)for(var n of Cm(t))c6.call(t,n)&&R4(e,n,t[n]);return e},rq=(e,t)=>{var n={};for(var r in e)l6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cm)for(var r of Cm(e))t.indexOf(r)<0&&c6.call(e,r)&&(n[r]=e[r]);return n};function u6(e){var t=e,{withinPortal:n=!0,children:r}=t,o=rq(t,["withinPortal","children"]);return n?H.createElement(i6,nq({},o),r):H.createElement(H.Fragment,null,r)}u6.displayName="@mantine/core/OptionalPortal";var oq=Object.defineProperty,wm=Object.getOwnPropertySymbols,d6=Object.prototype.hasOwnProperty,f6=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A4=(e,t)=>{for(var n in t||(t={}))d6.call(t,n)&&D4(e,n,t[n]);if(wm)for(var n of wm(t))f6.call(t,n)&&D4(e,n,t[n]);return e},sq=(e,t)=>{var n={};for(var r in e)d6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wm)for(var r of wm(e))t.indexOf(r)<0&&f6.call(e,r)&&(n[r]=e[r]);return n};function p6(e){const t=e,{width:n,height:r,style:o}=t,s=sq(t,["width","height","style"]);return H.createElement("svg",A4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:A4({width:n,height:r},o)},s),H.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}p6.displayName="@mantine/core/CloseIcon";var aq=Object.defineProperty,Sm=Object.getOwnPropertySymbols,m6=Object.prototype.hasOwnProperty,h6=Object.prototype.propertyIsEnumerable,T4=(e,t,n)=>t in e?aq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iq=(e,t)=>{for(var n in t||(t={}))m6.call(t,n)&&T4(e,n,t[n]);if(Sm)for(var n of Sm(t))h6.call(t,n)&&T4(e,n,t[n]);return e},lq=(e,t)=>{var n={};for(var r in e)m6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sm)for(var r of Sm(e))t.indexOf(r)<0&&h6.call(e,r)&&(n[r]=e[r]);return n};const cq={xs:Re(12),sm:Re(16),md:Re(20),lg:Re(28),xl:Re(34)},uq={size:"sm"},g6=d.forwardRef((e,t)=>{const n=Dn("CloseButton",uq,e),{iconSize:r,size:o,children:s}=n,i=lq(n,["iconSize","size","children"]),l=Re(r||cq[o]);return H.createElement(qK,iq({ref:t,__staticSelector:"CloseButton",size:o},i),s||H.createElement(p6,{width:l,height:l}))});g6.displayName="@mantine/core/CloseButton";const v6=g6;var dq=Object.defineProperty,fq=Object.defineProperties,pq=Object.getOwnPropertyDescriptors,N4=Object.getOwnPropertySymbols,mq=Object.prototype.hasOwnProperty,hq=Object.prototype.propertyIsEnumerable,$4=(e,t,n)=>t in e?dq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lp=(e,t)=>{for(var n in t||(t={}))mq.call(t,n)&&$4(e,n,t[n]);if(N4)for(var n of N4(t))hq.call(t,n)&&$4(e,n,t[n]);return e},gq=(e,t)=>fq(e,pq(t));function vq({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function xq({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function bq(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function yq({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var Cq=fr((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:l,weight:u,transform:p,align:m,strikethrough:h,italic:g},{size:x})=>{const y=e.fn.variant({variant:"gradient",gradient:l});return{root:gq(lp(lp(lp(lp({},e.fn.fontStyles()),e.fn.focusStyles()),bq(n)),yq({theme:e,truncate:r})),{color:xq({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||x===void 0?"inherit":mt({size:x,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:vq({underline:i,strikethrough:h}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":u,textTransform:p,textAlign:m,fontStyle:g?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const wq=Cq;var Sq=Object.defineProperty,km=Object.getOwnPropertySymbols,x6=Object.prototype.hasOwnProperty,b6=Object.prototype.propertyIsEnumerable,L4=(e,t,n)=>t in e?Sq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kq=(e,t)=>{for(var n in t||(t={}))x6.call(t,n)&&L4(e,n,t[n]);if(km)for(var n of km(t))b6.call(t,n)&&L4(e,n,t[n]);return e},jq=(e,t)=>{var n={};for(var r in e)x6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&km)for(var r of km(e))t.indexOf(r)<0&&b6.call(e,r)&&(n[r]=e[r]);return n};const _q={variant:"text"},y6=d.forwardRef((e,t)=>{const n=Dn("Text",_q,e),{className:r,size:o,weight:s,transform:i,color:l,align:u,variant:p,lineClamp:m,truncate:h,gradient:g,inline:x,inherit:y,underline:b,strikethrough:w,italic:S,classNames:j,styles:_,unstyled:E,span:I,__staticSelector:M}=n,R=jq(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:D,cx:A}=wq({color:l,lineClamp:m,truncate:h,inline:x,inherit:y,underline:b,strikethrough:w,italic:S,weight:s,transform:i,align:u,gradient:g},{unstyled:E,name:M||"Text",variant:p,size:o});return H.createElement(zr,kq({ref:t,className:A(D.root,{[D.gradient]:p==="gradient"},r),component:I?"span":"div"},R))});y6.displayName="@mantine/core/Text";const wc=y6,cp={xs:Re(1),sm:Re(2),md:Re(3),lg:Re(4),xl:Re(5)};function up(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var Iq=fr((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:Re(1),borderTop:`${mt({size:n,sizes:cp})} ${r} ${up(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${mt({size:n,sizes:cp})} ${r} ${up(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:Re(mt({size:n,sizes:cp})),borderTopColor:up(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Re(mt({size:n,sizes:cp})),borderLeftColor:up(e,t),borderLeftStyle:r}}));const Pq=Iq;var Eq=Object.defineProperty,Mq=Object.defineProperties,Oq=Object.getOwnPropertyDescriptors,jm=Object.getOwnPropertySymbols,C6=Object.prototype.hasOwnProperty,w6=Object.prototype.propertyIsEnumerable,z4=(e,t,n)=>t in e?Eq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F4=(e,t)=>{for(var n in t||(t={}))C6.call(t,n)&&z4(e,n,t[n]);if(jm)for(var n of jm(t))w6.call(t,n)&&z4(e,n,t[n]);return e},Rq=(e,t)=>Mq(e,Oq(t)),Dq=(e,t)=>{var n={};for(var r in e)C6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jm)for(var r of jm(e))t.indexOf(r)<0&&w6.call(e,r)&&(n[r]=e[r]);return n};const Aq={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},ex=d.forwardRef((e,t)=>{const n=Dn("Divider",Aq,e),{className:r,color:o,orientation:s,size:i,label:l,labelPosition:u,labelProps:p,variant:m,styles:h,classNames:g,unstyled:x}=n,y=Dq(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:b,cx:w}=Pq({color:o},{classNames:g,styles:h,unstyled:x,name:"Divider",variant:m,size:i}),S=s==="vertical",j=s==="horizontal",_=!!l&&j,E=!(p!=null&&p.color);return H.createElement(zr,F4({ref:t,className:w(b.root,{[b.vertical]:S,[b.horizontal]:j,[b.withLabel]:_},r),role:"separator"},y),_&&H.createElement(wc,Rq(F4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Re(2),className:w(b.label,b[u],{[b.labelDefaultStyles]:E})}),l))});ex.displayName="@mantine/core/Divider";var Tq=Object.defineProperty,Nq=Object.defineProperties,$q=Object.getOwnPropertyDescriptors,B4=Object.getOwnPropertySymbols,Lq=Object.prototype.hasOwnProperty,zq=Object.prototype.propertyIsEnumerable,H4=(e,t,n)=>t in e?Tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V4=(e,t)=>{for(var n in t||(t={}))Lq.call(t,n)&&H4(e,n,t[n]);if(B4)for(var n of B4(t))zq.call(t,n)&&H4(e,n,t[n]);return e},Fq=(e,t)=>Nq(e,$q(t)),Bq=fr((e,t,{size:n})=>({item:Fq(V4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:mt({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":V4({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${mt({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${mt({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const Hq=Bq;var Vq=Object.defineProperty,W4=Object.getOwnPropertySymbols,Wq=Object.prototype.hasOwnProperty,Uq=Object.prototype.propertyIsEnumerable,U4=(e,t,n)=>t in e?Vq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gq=(e,t)=>{for(var n in t||(t={}))Wq.call(t,n)&&U4(e,n,t[n]);if(W4)for(var n of W4(t))Uq.call(t,n)&&U4(e,n,t[n]);return e};function ry({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:l,onItemSelect:u,itemsRefs:p,itemComponent:m,size:h,nothingFound:g,creatable:x,createLabel:y,unstyled:b,variant:w}){const{classes:S}=Hq(null,{classNames:n,styles:r,unstyled:b,name:i,variant:w,size:h}),j=[],_=[];let E=null;const I=(R,D)=>{const A=typeof o=="function"?o(R.value):!1;return H.createElement(m,Gq({key:R.value,className:S.item,"data-disabled":R.disabled||void 0,"data-hovered":!R.disabled&&t===D||void 0,"data-selected":!R.disabled&&A||void 0,selected:A,onMouseEnter:()=>l(D),id:`${s}-${D}`,role:"option",tabIndex:-1,"aria-selected":t===D,ref:O=>{p&&p.current&&(p.current[R.value]=O)},onMouseDown:R.disabled?null:O=>{O.preventDefault(),u(R)},disabled:R.disabled,variant:w},R))};let M=null;if(e.forEach((R,D)=>{R.creatable?E=D:R.group?(M!==R.group&&(M=R.group,_.push(H.createElement("div",{className:S.separator,key:`__mantine-divider-${D}`},H.createElement(ex,{classNames:{label:S.separatorLabel},label:R.group})))),_.push(I(R,D))):j.push(I(R,D))}),x){const R=e[E];j.push(H.createElement("div",{key:ty(),className:S.item,"data-hovered":t===E||void 0,onMouseEnter:()=>l(E),onMouseDown:D=>{D.preventDefault(),u(R)},tabIndex:-1,ref:D=>{p&&p.current&&(p.current[R.value]=D)}},y))}return _.length>0&&j.length>0&&j.unshift(H.createElement("div",{className:S.separator,key:"empty-group-separator"},H.createElement(ex,null))),_.length>0||j.length>0?H.createElement(H.Fragment,null,_,j):H.createElement(wc,{size:h,unstyled:b,className:S.nothingFound},g)}ry.displayName="@mantine/core/SelectItems";var Kq=Object.defineProperty,_m=Object.getOwnPropertySymbols,S6=Object.prototype.hasOwnProperty,k6=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?Kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qq=(e,t)=>{for(var n in t||(t={}))S6.call(t,n)&&G4(e,n,t[n]);if(_m)for(var n of _m(t))k6.call(t,n)&&G4(e,n,t[n]);return e},Xq=(e,t)=>{var n={};for(var r in e)S6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_m)for(var r of _m(e))t.indexOf(r)<0&&k6.call(e,r)&&(n[r]=e[r]);return n};const oy=d.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=Xq(n,["label","value"]);return H.createElement("div",qq({ref:t},s),r||o)});oy.displayName="@mantine/core/DefaultItem";function Qq(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function j6(...e){return t=>e.forEach(n=>Qq(n,t))}function al(...e){return d.useCallback(j6(...e),e)}const _6=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Zq);if(s){const i=s.props.children,l=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return d.createElement(tx,mn({},r,{ref:t}),d.isValidElement(i)?d.cloneElement(i,void 0,l):null)}return d.createElement(tx,mn({},r,{ref:t}),n)});_6.displayName="Slot";const tx=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...Jq(r,n.props),ref:j6(t,n.ref)}):d.Children.count(n)>1?d.Children.only(null):null});tx.displayName="SlotClone";const Yq=({children:e})=>d.createElement(d.Fragment,null,e);function Zq(e){return d.isValidElement(e)&&e.type===Yq}function Jq(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const eX=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Hd=eX.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,l=s?_6:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(l,mn({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),nx=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function tX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Vd=e=>{const{present:t,children:n}=e,r=nX(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=al(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Vd.displayName="Presence";function nX(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[l,u]=tX(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const p=dp(r.current);s.current=l==="mounted"?p:"none"},[l]),nx(()=>{const p=r.current,m=o.current;if(m!==e){const g=s.current,x=dp(p);e?u("MOUNT"):x==="none"||(p==null?void 0:p.display)==="none"?u("UNMOUNT"):u(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),nx(()=>{if(t){const p=h=>{const x=dp(r.current).includes(h.animationName);h.target===t&&x&&qr.flushSync(()=>u("ANIMATION_END"))},m=h=>{h.target===t&&(s.current=dp(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function dp(e){return(e==null?void 0:e.animationName)||"none"}function rX(e,t=[]){let n=[];function r(s,i){const l=d.createContext(i),u=n.length;n=[...n,i];function p(h){const{scope:g,children:x,...y}=h,b=(g==null?void 0:g[e][u])||l,w=d.useMemo(()=>y,Object.values(y));return d.createElement(b.Provider,{value:w},x)}function m(h,g){const x=(g==null?void 0:g[e][u])||l,y=d.useContext(x);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,m]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(l){const u=(l==null?void 0:l[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return o.scopeName=e,[r,oX(o,...t)]}function oX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:u,scopeName:p})=>{const h=u(s)[`__scope${p}`];return{...l,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Pi(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const sX=d.createContext(void 0);function aX(e){const t=d.useContext(sX);return e||t||"ltr"}function iX(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ni(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function lX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const I6="ScrollArea",[P6,A1e]=rX(I6),[cX,_o]=P6(I6),uX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[l,u]=d.useState(null),[p,m]=d.useState(null),[h,g]=d.useState(null),[x,y]=d.useState(null),[b,w]=d.useState(null),[S,j]=d.useState(0),[_,E]=d.useState(0),[I,M]=d.useState(!1),[R,D]=d.useState(!1),A=al(t,T=>u(T)),O=aX(o);return d.createElement(cX,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:l,viewport:p,onViewportChange:m,content:h,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:I,onScrollbarXEnabledChange:M,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:j,onCornerHeightChange:E},d.createElement(Hd.div,mn({dir:O},i,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})))}),dX="ScrollAreaViewport",fX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=_o(dX,n),i=d.useRef(null),l=al(t,i,s.onViewportChange);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(Hd.div,mn({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),d.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ya="ScrollAreaScrollbar",pX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_o(ya,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,l=e.orientation==="horizontal";return d.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),o.type==="hover"?d.createElement(mX,mn({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(hX,mn({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(E6,mn({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(sy,mn({},r,{ref:t})):null}),mX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_o(ya,e.__scopeScrollArea),[s,i]=d.useState(!1);return d.useEffect(()=>{const l=o.scrollArea;let u=0;if(l){const p=()=>{window.clearTimeout(u),i(!0)},m=()=>{u=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",p),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",p),l.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Vd,{present:n||s},d.createElement(E6,mn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),hX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_o(ya,e.__scopeScrollArea),s=e.orientation==="horizontal",i=ng(()=>u("SCROLL_END"),100),[l,u]=lX("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(l==="idle"){const p=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[l,o.scrollHideDelay,u]),d.useEffect(()=>{const p=o.viewport,m=s?"scrollLeft":"scrollTop";if(p){let h=p[m];const g=()=>{const x=p[m];h!==x&&(u("SCROLL"),i()),h=x};return p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,s,u,i]),d.createElement(Vd,{present:n||l!=="hidden"},d.createElement(sy,mn({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Ni(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ni(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),E6=d.forwardRef((e,t)=>{const n=_o(ya,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=d.useState(!1),l=e.orientation==="horizontal",u=ng(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?p:m)}},10);return Sc(n.viewport,u),Sc(n.content,u),d.createElement(Vd,{present:r||s},d.createElement(sy,mn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),sy=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=_o(ya,e.__scopeScrollArea),s=d.useRef(null),i=d.useRef(0),[l,u]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=D6(l.viewport,l.content),m={...r,sizes:l,onSizesChange:u,hasThumb:p>0&&p<1,onThumbChange:g=>s.current=g,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:g=>i.current=g};function h(g,x){return SX(g,i.current,l,x)}return n==="horizontal"?d.createElement(gX,mn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollLeft,x=K4(g,l,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=h(g,o.dir))}})):n==="vertical"?d.createElement(vX,mn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollTop,x=K4(g,l);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=h(g))}})):null}),gX=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=_o(ya,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=al(t,u,s.onScrollbarXChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(O6,mn({"data-orientation":"horizontal"},o,{ref:p,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":tg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),T6(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Im(i.paddingLeft),paddingEnd:Im(i.paddingRight)}})}}))}),vX=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=_o(ya,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=al(t,u,s.onScrollbarYChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(O6,mn({"data-orientation":"vertical"},o,{ref:p,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":tg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),T6(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Im(i.paddingTop),paddingEnd:Im(i.paddingBottom)}})}}))}),[xX,M6]=P6(ya),O6=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:p,onWheelScroll:m,onResize:h,...g}=e,x=_o(ya,n),[y,b]=d.useState(null),w=al(t,A=>b(A)),S=d.useRef(null),j=d.useRef(""),_=x.viewport,E=r.content-r.viewport,I=Pi(m),M=Pi(u),R=ng(h,10);function D(A){if(S.current){const O=A.clientX-S.current.left,T=A.clientY-S.current.top;p({x:O,y:T})}}return d.useEffect(()=>{const A=O=>{const T=O.target;(y==null?void 0:y.contains(T))&&I(O,E)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[_,y,E,I]),d.useEffect(M,[r,M]),Sc(y,R),Sc(x.content,R),d.createElement(xX,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:Pi(s),onThumbPointerUp:Pi(i),onThumbPositionChange:M,onThumbPointerDown:Pi(l)},d.createElement(Hd.div,mn({},g,{ref:w,style:{position:"absolute",...g.style},onPointerDown:Ni(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),S.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(A))}),onPointerMove:Ni(e.onPointerMove,D),onPointerUp:Ni(e.onPointerUp,A=>{const O=A.target;O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=j.current,S.current=null})})))}),rx="ScrollAreaThumb",bX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=M6(rx,e.__scopeScrollArea);return d.createElement(Vd,{present:n||o.hasThumb},d.createElement(yX,mn({ref:t},r)))}),yX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=_o(rx,n),i=M6(rx,n),{onThumbPositionChange:l}=i,u=al(t,h=>i.onThumbChange(h)),p=d.useRef(),m=ng(()=>{p.current&&(p.current(),p.current=void 0)},100);return d.useEffect(()=>{const h=s.viewport;if(h){const g=()=>{if(m(),!p.current){const x=kX(h,l);p.current=x,l()}};return l(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[s.viewport,m,l]),d.createElement(Hd.div,mn({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ni(e.onPointerDownCapture,h=>{const x=h.target.getBoundingClientRect(),y=h.clientX-x.left,b=h.clientY-x.top;i.onThumbPointerDown({x:y,y:b})}),onPointerUp:Ni(e.onPointerUp,i.onThumbPointerUp)}))}),R6="ScrollAreaCorner",CX=d.forwardRef((e,t)=>{const n=_o(R6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(wX,mn({},e,{ref:t})):null}),wX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=_o(R6,n),[s,i]=d.useState(0),[l,u]=d.useState(0),p=!!(s&&l);return Sc(o.scrollbarX,()=>{var m;const h=((m=o.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;o.onCornerHeightChange(h),u(h)}),Sc(o.scrollbarY,()=>{var m;const h=((m=o.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;o.onCornerWidthChange(h),i(h)}),p?d.createElement(Hd.div,mn({},r,{ref:t,style:{width:s,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Im(e){return e?parseInt(e,10):0}function D6(e,t){const n=e/t;return isNaN(n)?0:n}function tg(e){const t=D6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function SX(e,t,n,r="ltr"){const o=tg(n),s=o/2,i=t||s,l=o-i,u=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return A6([u,p],h)(e)}function K4(e,t,n="ltr"){const r=tg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,l=s-r,u=n==="ltr"?[0,i]:[i*-1,0],p=iX(e,u);return A6([0,i],[0,l])(p)}function A6(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function T6(e,t){return e>0&&e<t}const kX=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function ng(e,t){const n=Pi(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Sc(e,t){const n=Pi(t);nx(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const jX=uX,_X=fX,q4=pX,X4=bX,IX=CX;var PX=fr((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Re(t):void 0,paddingBottom:n?Re(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Re(t)}  / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${e4("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Re(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Re(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:e4("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Re(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:Re(44),minHeight:Re(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const EX=PX;var MX=Object.defineProperty,OX=Object.defineProperties,RX=Object.getOwnPropertyDescriptors,Pm=Object.getOwnPropertySymbols,N6=Object.prototype.hasOwnProperty,$6=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?MX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ox=(e,t)=>{for(var n in t||(t={}))N6.call(t,n)&&Q4(e,n,t[n]);if(Pm)for(var n of Pm(t))$6.call(t,n)&&Q4(e,n,t[n]);return e},L6=(e,t)=>OX(e,RX(t)),z6=(e,t)=>{var n={};for(var r in e)N6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pm)for(var r of Pm(e))t.indexOf(r)<0&&$6.call(e,r)&&(n[r]=e[r]);return n};const F6={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},rg=d.forwardRef((e,t)=>{const n=Dn("ScrollArea",F6,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:l,scrollHideDelay:u,type:p,dir:m,offsetScrollbars:h,viewportRef:g,onScrollPositionChange:x,unstyled:y,variant:b,viewportProps:w}=n,S=z6(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[j,_]=d.useState(!1),E=xa(),{classes:I,cx:M}=EX({scrollbarSize:l,offsetScrollbars:h,scrollbarHovered:j,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:y,variant:b});return H.createElement(jX,{type:p==="never"?"always":p,scrollHideDelay:u,dir:m||E.dir,ref:t,asChild:!0},H.createElement(zr,ox({className:M(I.root,o)},S),H.createElement(_X,L6(ox({},w),{className:I.viewport,ref:g,onScroll:typeof x=="function"?({currentTarget:R})=>x({x:R.scrollLeft,y:R.scrollTop}):void 0}),r),H.createElement(q4,{orientation:"horizontal",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},H.createElement(X4,{className:I.thumb})),H.createElement(q4,{orientation:"vertical",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},H.createElement(X4,{className:I.thumb})),H.createElement(IX,{className:I.corner})))}),B6=d.forwardRef((e,t)=>{const n=Dn("ScrollAreaAutosize",F6,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:l,type:u,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,sx:y,variant:b,viewportProps:w}=n,S=z6(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(zr,L6(ox({},S),{ref:t,sx:[{display:"flex"},...PP(y)]}),H.createElement(zr,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(rg,{classNames:o,styles:s,scrollHideDelay:l,scrollbarSize:i,type:u,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w},r)))});B6.displayName="@mantine/core/ScrollAreaAutosize";rg.displayName="@mantine/core/ScrollArea";rg.Autosize=B6;const H6=rg;var DX=Object.defineProperty,AX=Object.defineProperties,TX=Object.getOwnPropertyDescriptors,Em=Object.getOwnPropertySymbols,V6=Object.prototype.hasOwnProperty,W6=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?DX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z4=(e,t)=>{for(var n in t||(t={}))V6.call(t,n)&&Y4(e,n,t[n]);if(Em)for(var n of Em(t))W6.call(t,n)&&Y4(e,n,t[n]);return e},NX=(e,t)=>AX(e,TX(t)),$X=(e,t)=>{var n={};for(var r in e)V6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Em)for(var r of Em(e))t.indexOf(r)<0&&W6.call(e,r)&&(n[r]=e[r]);return n};const og=d.forwardRef((e,t)=>{var n=e,{style:r}=n,o=$X(n,["style"]);return H.createElement(H6,NX(Z4({},o),{style:Z4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});og.displayName="@mantine/core/SelectScrollArea";var LX=fr(()=>({dropdown:{},itemsWrapper:{padding:Re(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const zX=LX;function Fc(e){return e.split("-")[1]}function ay(e){return e==="y"?"height":"width"}function Go(e){return e.split("-")[0]}function li(e){return["top","bottom"].includes(Go(e))?"x":"y"}function J4(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,i=r.y+r.height/2-o.height/2,l=li(t),u=ay(l),p=r[u]/2-o[u]/2,m=l==="x";let h;switch(Go(t)){case"top":h={x:s,y:r.y-o.height};break;case"bottom":h={x:s,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:i};break;case"left":h={x:r.x-o.width,y:i};break;default:h={x:r.x,y:r.y}}switch(Fc(t)){case"start":h[l]-=p*(n&&m?-1:1);break;case"end":h[l]+=p*(n&&m?-1:1)}return h}const FX=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let p=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=J4(p,r,u),g=r,x={},y=0;for(let b=0;b<l.length;b++){const{name:w,fn:S}=l[b],{x:j,y:_,data:E,reset:I}=await S({x:m,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:x,rects:p,platform:i,elements:{reference:e,floating:t}});m=j??m,h=_??h,x={...x,[w]:{...x[w],...E}},I&&y<=50&&(y++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(p=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:m,y:h}=J4(p,g,u)),b=-1)}return{x:m,y:h,placement:g,strategy:o,middlewareData:x}};function ia(e,t){return typeof e=="function"?e(t):e}function iy(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function kc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function ly(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:x=0}=ia(t,e),y=iy(x),b=l[g?h==="floating"?"reference":"floating":h],w=kc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:p,rootBoundary:m,strategy:u})),S=h==="floating"?{...i.floating,x:r,y:o}:i.reference,j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),_=await(s.isElement==null?void 0:s.isElement(j))&&await(s.getScale==null?void 0:s.getScale(j))||{x:1,y:1},E=kc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:j,strategy:u}):S);return{top:(w.top-E.top+y.top)/_.y,bottom:(E.bottom-w.bottom+y.bottom)/_.y,left:(w.left-E.left+y.left)/_.x,right:(E.right-w.right+y.right)/_.x}}const ei=Math.min,ms=Math.max;function sx(e,t,n){return ms(e,ei(t,n))}const ek=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l}=t,{element:u,padding:p=0}=ia(e,t)||{};if(u==null)return{};const m=iy(p),h={x:n,y:r},g=li(o),x=ay(g),y=await i.getDimensions(u),b=g==="y",w=b?"top":"left",S=b?"bottom":"right",j=b?"clientHeight":"clientWidth",_=s.reference[x]+s.reference[g]-h[g]-s.floating[x],E=h[g]-s.reference[g],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=I?I[j]:0;M&&await(i.isElement==null?void 0:i.isElement(I))||(M=l.floating[j]||s.floating[x]);const R=_/2-E/2,D=M/2-y[x]/2-1,A=ei(m[w],D),O=ei(m[S],D),T=A,X=M-y[x]-O,B=M/2-y[x]/2+R,V=sx(T,B,X),U=Fc(o)!=null&&B!=V&&s.reference[x]/2-(B<T?A:O)-y[x]/2<0?B<T?T-B:X-B:0;return{[g]:h[g]-U,data:{[g]:V,centerOffset:B-V+U}}}}),BX=["top","right","bottom","left"];BX.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const HX={left:"right",right:"left",bottom:"top",top:"bottom"};function Mm(e){return e.replace(/left|right|bottom|top/g,t=>HX[t])}function VX(e,t,n){n===void 0&&(n=!1);const r=Fc(e),o=li(e),s=ay(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Mm(i)),{main:i,cross:Mm(i)}}const WX={start:"end",end:"start"};function Iv(e){return e.replace(/start|end/g,t=>WX[t])}const UX=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...b}=ia(e,t),w=Go(r),S=Go(i)===i,j=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(S||!y?[Mm(i)]:function(T){const X=Mm(T);return[Iv(T),X,Iv(X)]}(i));h||x==="none"||_.push(...function(T,X,B,V){const U=Fc(T);let N=function($,q,F){const Q=["left","right"],Y=["right","left"],se=["top","bottom"],ae=["bottom","top"];switch($){case"top":case"bottom":return F?q?Y:Q:q?Q:Y;case"left":case"right":return q?se:ae;default:return[]}}(Go(T),B==="start",V);return U&&(N=N.map($=>$+"-"+U),X&&(N=N.concat(N.map(Iv)))),N}(i,y,x,j));const E=[i,..._],I=await ly(t,b),M=[];let R=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&M.push(I[w]),m){const{main:T,cross:X}=VX(r,s,j);M.push(I[T],I[X])}if(R=[...R,{placement:r,overflows:M}],!M.every(T=>T<=0)){var D,A;const T=(((D=o.flip)==null?void 0:D.index)||0)+1,X=E[T];if(X)return{data:{index:T,overflows:R},reset:{placement:X}};let B=(A=R.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(g){case"bestFit":{var O;const V=(O=R.map(U=>[U.placement,U.overflows.filter(N=>N>0).reduce((N,$)=>N+$,0)]).sort((U,N)=>U[1]-N[1])[0])==null?void 0:O[0];V&&(B=V);break}case"initialPlacement":B=i}if(r!==B)return{reset:{placement:B}}}return{}}}};function tk(e){const t=ei(...e.map(r=>r.left)),n=ei(...e.map(r=>r.top));return{x:t,y:n,width:ms(...e.map(r=>r.right))-t,height:ms(...e.map(r=>r.bottom))-n}}const GX=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:i}=t,{padding:l=2,x:u,y:p}=ia(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),h=function(b){const w=b.slice().sort((_,E)=>_.y-E.y),S=[];let j=null;for(let _=0;_<w.length;_++){const E=w[_];!j||E.y-j.y>j.height/2?S.push([E]):S[S.length-1].push(E),j=E}return S.map(_=>kc(tk(_)))}(m),g=kc(tk(m)),x=iy(l),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(h.length===2&&h[0].left>h[1].right&&u!=null&&p!=null)return h.find(b=>u>b.left-x.left&&u<b.right+x.right&&p>b.top-x.top&&p<b.bottom+x.bottom)||g;if(h.length>=2){if(li(n)==="x"){const I=h[0],M=h[h.length-1],R=Go(n)==="top",D=I.top,A=M.bottom,O=R?I.left:M.left,T=R?I.right:M.right;return{top:D,bottom:A,left:O,right:T,width:T-O,height:A-D,x:O,y:D}}const b=Go(n)==="left",w=ms(...h.map(I=>I.right)),S=ei(...h.map(I=>I.left)),j=h.filter(I=>b?I.left===S:I.right===w),_=j[0].top,E=j[j.length-1].bottom;return{top:_,bottom:E,left:S,right:w,width:w-S,height:E-_,x:S,y:_}}return g}},floating:r.floating,strategy:i});return o.reference.x!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},KX=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,i){const{placement:l,platform:u,elements:p}=s,m=await(u.isRTL==null?void 0:u.isRTL(p.floating)),h=Go(l),g=Fc(l),x=li(l)==="x",y=["left","top"].includes(h)?-1:1,b=m&&x?-1:1,w=ia(i,s);let{mainAxis:S,crossAxis:j,alignmentAxis:_}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return g&&typeof _=="number"&&(j=g==="end"?-1*_:_),x?{x:j*b,y:S*y}:{x:S*y,y:j*b}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function U6(e){return e==="x"?"y":"x"}const qX=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:w=>{let{x:S,y:j}=w;return{x:S,y:j}}},...u}=ia(e,t),p={x:n,y:r},m=await ly(t,u),h=li(Go(o)),g=U6(h);let x=p[h],y=p[g];if(s){const w=h==="y"?"bottom":"right";x=sx(x+m[h==="y"?"top":"left"],x,x-m[w])}if(i){const w=g==="y"?"bottom":"right";y=sx(y+m[g==="y"?"top":"left"],y,y-m[w])}const b=l.fn({...t,[h]:x,[g]:y});return{...b,data:{x:b.x-n,y:b.y-r}}}}},XX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:u=!0,crossAxis:p=!0}=ia(e,t),m={x:n,y:r},h=li(o),g=U6(h);let x=m[h],y=m[g];const b=ia(l,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const _=h==="y"?"height":"width",E=s.reference[h]-s.floating[_]+w.mainAxis,I=s.reference[h]+s.reference[_]-w.mainAxis;x<E?x=E:x>I&&(x=I)}if(p){var S,j;const _=h==="y"?"width":"height",E=["top","left"].includes(Go(o)),I=s.reference[g]-s.floating[_]+(E&&((S=i.offset)==null?void 0:S[g])||0)+(E?0:w.crossAxis),M=s.reference[g]+s.reference[_]+(E?0:((j=i.offset)==null?void 0:j[g])||0)-(E?w.crossAxis:0);y<I?y=I:y>M&&(y=M)}return{[h]:x,[g]:y}}}},QX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...l}=ia(e,t),u=await ly(t,l),p=Go(n),m=Fc(n),h=li(n)==="x",{width:g,height:x}=r.floating;let y,b;p==="top"||p==="bottom"?(y=p,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=p,y=m==="end"?"top":"bottom");const w=x-u[y],S=g-u[b],j=!t.middlewareData.shift;let _=w,E=S;if(h){const M=g-u.left-u.right;E=m||j?ei(S,M):M}else{const M=x-u.top-u.bottom;_=m||j?ei(w,M):M}if(j&&!m){const M=ms(u.left,0),R=ms(u.right,0),D=ms(u.top,0),A=ms(u.bottom,0);h?E=g-2*(M!==0||R!==0?M+R:ms(u.left,u.right)):_=x-2*(D!==0||A!==0?D+A:ms(u.top,u.bottom))}await i({...t,availableWidth:E,availableHeight:_});const I=await o.getDimensions(s.floating);return g!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function Zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){return Zr(e).getComputedStyle(e)}function G6(e){return e instanceof Zr(e).Node}function ti(e){return G6(e)?(e.nodeName||"").toLowerCase():"#document"}function Jo(e){return e instanceof HTMLElement||e instanceof Zr(e).HTMLElement}function nk(e){return typeof ShadowRoot<"u"&&(e instanceof Zr(e).ShadowRoot||e instanceof ShadowRoot)}function sd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ks(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function YX(e){return["table","td","th"].includes(ti(e))}function ax(e){const t=cy(),n=ks(e);return n.transform!=="none"||n.perspective!=="none"||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function cy(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function sg(e){return["html","body","#document"].includes(ti(e))}const ix=Math.min,fc=Math.max,Om=Math.round,fp=Math.floor,ni=e=>({x:e,y:e});function K6(e){const t=ks(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=Om(n)!==s||Om(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function ea(e){return e instanceof Element||e instanceof Zr(e).Element}function uy(e){return ea(e)?e:e.contextElement}function pc(e){const t=uy(e);if(!Jo(t))return ni(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=K6(t);let i=(s?Om(n.width):n.width)/r,l=(s?Om(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}const ZX=ni(0);function q6(e){const t=Zr(e);return cy()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ZX}function Qi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=uy(e);let i=ni(1);t&&(r?ea(r)&&(i=pc(r)):i=pc(e));const l=function(g,x,y){return x===void 0&&(x=!1),!(!y||x&&y!==Zr(g))&&x}(s,n,r)?q6(s):ni(0);let u=(o.left+l.x)/i.x,p=(o.top+l.y)/i.y,m=o.width/i.x,h=o.height/i.y;if(s){const g=Zr(s),x=r&&ea(r)?Zr(r):r;let y=g.frameElement;for(;y&&r&&x!==g;){const b=pc(y),w=y.getBoundingClientRect(),S=getComputedStyle(y),j=w.left+(y.clientLeft+parseFloat(S.paddingLeft))*b.x,_=w.top+(y.clientTop+parseFloat(S.paddingTop))*b.y;u*=b.x,p*=b.y,m*=b.x,h*=b.y,u+=j,p+=_,y=Zr(y).frameElement}}return kc({width:m,height:h,x:u,y:p})}function ag(e){return ea(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ta(e){var t;return(t=(G6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X6(e){return Qi(ta(e)).left+ag(e).scrollLeft}function jc(e){if(ti(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nk(e)&&e.host||ta(e);return nk(t)?t.host:t}function Q6(e){const t=jc(e);return sg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&sd(t)?t:Q6(t)}function Rm(e,t){var n;t===void 0&&(t=[]);const r=Q6(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Zr(r);return o?t.concat(s,s.visualViewport||[],sd(r)?r:[]):t.concat(r,Rm(r))}function rk(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=Zr(o),l=ta(o),u=i.visualViewport;let p=l.clientWidth,m=l.clientHeight,h=0,g=0;if(u){p=u.width,m=u.height;const x=cy();(!x||x&&s==="fixed")&&(h=u.offsetLeft,g=u.offsetTop)}return{width:p,height:m,x:h,y:g}}(e,n);else if(t==="document")r=function(o){const s=ta(o),i=ag(o),l=o.ownerDocument.body,u=fc(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),p=fc(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let m=-i.scrollLeft+X6(o);const h=-i.scrollTop;return ks(l).direction==="rtl"&&(m+=fc(s.clientWidth,l.clientWidth)-u),{width:u,height:p,x:m,y:h}}(ta(e));else if(ea(t))r=function(o,s){const i=Qi(o,!0,s==="fixed"),l=i.top+o.clientTop,u=i.left+o.clientLeft,p=Jo(o)?pc(o):ni(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:u*p.x,y:l*p.y}}(t,n);else{const o=q6(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return kc(r)}function Y6(e,t){const n=jc(e);return!(n===t||!ea(n)||sg(n))&&(ks(n).position==="fixed"||Y6(n,t))}function JX(e,t,n){const r=Jo(t),o=ta(t),s=n==="fixed",i=Qi(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=ni(0);if(r||!r&&!s)if((ti(t)!=="body"||sd(o))&&(l=ag(t)),Jo(t)){const p=Qi(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&(u.x=X6(o));return{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function ok(e,t){return Jo(e)&&ks(e).position!=="fixed"?t?t(e):e.offsetParent:null}function sk(e,t){const n=Zr(e);if(!Jo(e))return n;let r=ok(e,t);for(;r&&YX(r)&&ks(r).position==="static";)r=ok(r,t);return r&&(ti(r)==="html"||ti(r)==="body"&&ks(r).position==="static"&&!ax(r))?n:r||function(o){let s=jc(o);for(;Jo(s)&&!sg(s);){if(ax(s))return s;s=jc(s)}return null}(e)||n}const eQ={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Jo(n),s=ta(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},l=ni(1);const u=ni(0);if((o||!o&&r!=="fixed")&&((ti(n)!=="body"||sd(s))&&(i=ag(n)),Jo(n))){const p=Qi(n);l=pc(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-i.scrollLeft*l.x+u.x,y:t.y*l.y-i.scrollTop*l.y+u.y}},getDocumentElement:ta,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(u,p){const m=p.get(u);if(m)return m;let h=Rm(u).filter(b=>ea(b)&&ti(b)!=="body"),g=null;const x=ks(u).position==="fixed";let y=x?jc(u):u;for(;ea(y)&&!sg(y);){const b=ks(y),w=ax(y);w||b.position!=="fixed"||(g=null),(x?!w&&!g:!w&&b.position==="static"&&g&&["absolute","fixed"].includes(g.position)||sd(y)&&!w&&Y6(u,y))?h=h.filter(S=>S!==y):g=b,y=jc(y)}return p.set(u,h),h}(t,this._c):[].concat(n),r],i=s[0],l=s.reduce((u,p)=>{const m=rk(t,p,o);return u.top=fc(m.top,u.top),u.right=ix(m.right,u.right),u.bottom=ix(m.bottom,u.bottom),u.left=fc(m.left,u.left),u},rk(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:sk,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||sk,s=this.getDimensions;return{reference:JX(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return K6(e)},getScale:pc,isElement:ea,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function tQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,p=uy(e),m=o||s?[...p?Rm(p):[],...Rm(t)]:[];m.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const h=p&&l?function(w,S){let j,_=null;const E=ta(w);function I(){clearTimeout(j),_&&_.disconnect(),_=null}return function M(R,D){R===void 0&&(R=!1),D===void 0&&(D=1),I();const{left:A,top:O,width:T,height:X}=w.getBoundingClientRect();if(R||S(),!T||!X)return;const B={rootMargin:-fp(O)+"px "+-fp(E.clientWidth-(A+T))+"px "+-fp(E.clientHeight-(O+X))+"px "+-fp(A)+"px",threshold:fc(0,ix(1,D))||1};let V=!0;function U(N){const $=N[0].intersectionRatio;if($!==D){if(!V)return M();$?M(!1,$):j=setTimeout(()=>{M(!1,1e-7)},100)}V=!1}try{_=new IntersectionObserver(U,{...B,root:E.ownerDocument})}catch{_=new IntersectionObserver(U,B)}_.observe(w)}(!0),I}(p,n):null;let g,x=-1,y=null;i&&(y=new ResizeObserver(w=>{let[S]=w;S&&S.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!u&&y.observe(p),y.observe(t));let b=u?Qi(e):null;return u&&function w(){const S=Qi(e);!b||S.x===b.x&&S.y===b.y&&S.width===b.width&&S.height===b.height||n(),b=S,g=requestAnimationFrame(w)}(),n(),()=>{m.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),h&&h(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(g)}}const nQ=(e,t,n)=>{const r=new Map,o={platform:eQ,...n},s={...o.platform,_c:r};return FX(e,t,{...o,platform:s})},rQ=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?ek({element:t.current,padding:n}).fn(o):{}:t?ek({element:t,padding:n}).fn(o):{}}}};var Vp=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Dm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Dm(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Dm(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ak(e){const t=d.useRef(e);return Vp(()=>{t.current=e}),t}function oQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[l,u]=d.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);Dm(p,r)||m(r);const h=d.useRef(null),g=d.useRef(null),x=d.useRef(l),y=ak(s),b=ak(o),[w,S]=d.useState(null),[j,_]=d.useState(null),E=d.useCallback(O=>{h.current!==O&&(h.current=O,S(O))},[]),I=d.useCallback(O=>{g.current!==O&&(g.current=O,_(O))},[]),M=d.useCallback(()=>{if(!h.current||!g.current)return;const O={placement:t,strategy:n,middleware:p};b.current&&(O.platform=b.current),nQ(h.current,g.current,O).then(T=>{const X={...T,isPositioned:!0};R.current&&!Dm(x.current,X)&&(x.current=X,qr.flushSync(()=>{u(X)}))})},[p,t,n,b]);Vp(()=>{i===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,u(O=>({...O,isPositioned:!1})))},[i]);const R=d.useRef(!1);Vp(()=>(R.current=!0,()=>{R.current=!1}),[]),Vp(()=>{if(w&&j){if(y.current)return y.current(w,j,M);M()}},[w,j,M,y]);const D=d.useMemo(()=>({reference:h,floating:g,setReference:E,setFloating:I}),[E,I]),A=d.useMemo(()=>({reference:w,floating:j}),[w,j]);return d.useMemo(()=>({...l,update:M,refs:D,elements:A,reference:E,floating:I}),[l,M,D,A,E,I])}var sQ=typeof document<"u"?d.useLayoutEffect:d.useEffect;function aQ(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const iQ=d.createContext(null),lQ=()=>d.useContext(iQ);function cQ(e){return(e==null?void 0:e.ownerDocument)||document}function uQ(e){return cQ(e).defaultView||window}function pp(e){return e?e instanceof uQ(e).Element:!1}const dQ=Fx["useInsertionEffect".toString()],fQ=dQ||(e=>e());function pQ(e){const t=d.useRef(()=>{});return fQ(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function mQ(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=oQ(e),s=lQ(),i=d.useRef(null),l=d.useRef({}),u=d.useState(()=>aQ())[0],[p,m]=d.useState(null),h=d.useCallback(S=>{const j=pp(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;o.refs.setReference(j)},[o.refs]),g=d.useCallback(S=>{(pp(S)||S===null)&&(i.current=S,m(S)),(pp(o.refs.reference.current)||o.refs.reference.current===null||S!==null&&!pp(S))&&o.refs.setReference(S)},[o.refs]),x=d.useMemo(()=>({...o.refs,setReference:g,setPositionReference:h,domReference:i}),[o.refs,g,h]),y=d.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),b=pQ(n),w=d.useMemo(()=>({...o,refs:x,elements:y,dataRef:l,nodeId:r,events:u,open:t,onOpenChange:b}),[o,r,u,t,b,x,y]);return sQ(()=>{const S=s==null?void 0:s.nodesRef.current.find(j=>j.id===r);S&&(S.context=w)}),d.useMemo(()=>({...o,context:w,refs:x,reference:g,positionReference:h}),[o,x,w,g,h])}function hQ({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=d.useState(0);d.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return tQ(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Uo(()=>{t.update()},r),Uo(()=>{s(i=>i+1)},[e])}function gQ(e){const t=[KX(e.offset)];return e.middlewares.shift&&t.push(qX({limiter:XX()})),e.middlewares.flip&&t.push(UX()),e.middlewares.inline&&t.push(GX()),t.push(rQ({element:e.arrowRef,padding:e.arrowOffset})),t}function vQ(e){const[t,n]=od({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var i;(i=e.onClose)==null||i.call(e),n(!1)},o=()=>{var i,l;t?((i=e.onClose)==null||i.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},s=mQ({placement:e.position,middleware:[...gQ(e),...e.width==="target"?[QX({apply({rects:i}){var l,u;Object.assign((u=(l=s.refs.floating.current)==null?void 0:l.style)!=null?u:{},{width:`${i.reference.width}px`})}})]:[]]});return hQ({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),Uo(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),Uo(()=>{var i,l;e.opened?(l=e.onOpen)==null||l.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const Z6={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[xQ,J6]=sG(Z6.context);var bQ=Object.defineProperty,yQ=Object.defineProperties,CQ=Object.getOwnPropertyDescriptors,Am=Object.getOwnPropertySymbols,eE=Object.prototype.hasOwnProperty,tE=Object.prototype.propertyIsEnumerable,ik=(e,t,n)=>t in e?bQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mp=(e,t)=>{for(var n in t||(t={}))eE.call(t,n)&&ik(e,n,t[n]);if(Am)for(var n of Am(t))tE.call(t,n)&&ik(e,n,t[n]);return e},wQ=(e,t)=>yQ(e,CQ(t)),SQ=(e,t)=>{var n={};for(var r in e)eE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Am)for(var r of Am(e))t.indexOf(r)<0&&tE.call(e,r)&&(n[r]=e[r]);return n};const kQ={refProp:"ref",popupType:"dialog"},nE=d.forwardRef((e,t)=>{const n=Dn("PopoverTarget",kQ,e),{children:r,refProp:o,popupType:s}=n,i=SQ(n,["children","refProp","popupType"]);if(!MP(r))throw new Error(Z6.children);const l=i,u=J6(),p=Bd(u.reference,r.ref,t),m=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return d.cloneElement(r,mp(wQ(mp(mp(mp({},l),m),u.targetProps),{className:RP(u.targetProps.className,l.className,r.props.className),[o]:p}),u.controlled?null:{onClick:u.onToggle}))});nE.displayName="@mantine/core/PopoverTarget";var jQ=fr((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Re(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${Re(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const _Q=jQ;var IQ=Object.defineProperty,lk=Object.getOwnPropertySymbols,PQ=Object.prototype.hasOwnProperty,EQ=Object.prototype.propertyIsEnumerable,ck=(e,t,n)=>t in e?IQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$l=(e,t)=>{for(var n in t||(t={}))PQ.call(t,n)&&ck(e,n,t[n]);if(lk)for(var n of lk(t))EQ.call(t,n)&&ck(e,n,t[n]);return e};const uk={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function MQ({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ap?$l($l($l({transitionProperty:ap[e].transitionProperty},o),ap[e].common),ap[e][uk[t]]):null:$l($l($l({transitionProperty:e.transitionProperty},o),e.common),e[uk[t]])}function OQ({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:l}){const u=xa(),p=zP(),m=u.respectReducedMotion?p:!1,[h,g]=d.useState(m?0:e),[x,y]=d.useState(r?"entered":"exited"),b=d.useRef(-1),w=S=>{const j=S?o:s,_=S?i:l;y(S?"pre-entering":"pre-exiting"),window.clearTimeout(b.current);const E=m?0:S?e:t;if(g(E),E===0)typeof j=="function"&&j(),typeof _=="function"&&_(),y(S?"entered":"exited");else{const I=window.setTimeout(()=>{typeof j=="function"&&j(),y(S?"entering":"exiting")},10);b.current=window.setTimeout(()=>{window.clearTimeout(I),typeof _=="function"&&_(),y(S?"entered":"exited")},E)}};return Uo(()=>{w(r)},[r]),d.useEffect(()=>()=>window.clearTimeout(b.current),[]),{transitionDuration:h,transitionStatus:x,transitionTimingFunction:n||u.transitionTimingFunction}}function rE({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:m}){const{transitionDuration:h,transitionStatus:g,transitionTimingFunction:x}=OQ({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:m});return h===0?o?H.createElement(H.Fragment,null,s({})):e?s({display:"none"}):null:g==="exited"?e?s({display:"none"}):null:H.createElement(H.Fragment,null,s(MQ({transition:t,duration:h,state:g,timingFunction:x})))}rE.displayName="@mantine/core/Transition";function oE({children:e,active:t=!0,refProp:n="ref"}){const r=zG(t),o=Bd(r,e==null?void 0:e.ref);return MP(e)?d.cloneElement(e,{[n]:o}):e}oE.displayName="@mantine/core/FocusTrap";var RQ=Object.defineProperty,DQ=Object.defineProperties,AQ=Object.getOwnPropertyDescriptors,dk=Object.getOwnPropertySymbols,TQ=Object.prototype.hasOwnProperty,NQ=Object.prototype.propertyIsEnumerable,fk=(e,t,n)=>t in e?RQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Na=(e,t)=>{for(var n in t||(t={}))TQ.call(t,n)&&fk(e,n,t[n]);if(dk)for(var n of dk(t))NQ.call(t,n)&&fk(e,n,t[n]);return e},hp=(e,t)=>DQ(e,AQ(t));function pk(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function mk(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const $Q={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function LQ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:l}){const[u,p="center"]=e.split("-"),m={width:Re(t),height:Re(t),transform:"rotate(45deg)",position:"absolute",[$Q[u]]:Re(r)},h=Re(-t/2);return u==="left"?hp(Na(Na({},m),pk(p,i,n,o)),{right:h,borderLeftColor:"transparent",borderBottomColor:"transparent"}):u==="right"?hp(Na(Na({},m),pk(p,i,n,o)),{left:h,borderRightColor:"transparent",borderTopColor:"transparent"}):u==="top"?hp(Na(Na({},m),mk(p,s,n,o,l)),{bottom:h,borderTopColor:"transparent",borderLeftColor:"transparent"}):u==="bottom"?hp(Na(Na({},m),mk(p,s,n,o,l)),{top:h,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var zQ=Object.defineProperty,FQ=Object.defineProperties,BQ=Object.getOwnPropertyDescriptors,Tm=Object.getOwnPropertySymbols,sE=Object.prototype.hasOwnProperty,aE=Object.prototype.propertyIsEnumerable,hk=(e,t,n)=>t in e?zQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HQ=(e,t)=>{for(var n in t||(t={}))sE.call(t,n)&&hk(e,n,t[n]);if(Tm)for(var n of Tm(t))aE.call(t,n)&&hk(e,n,t[n]);return e},VQ=(e,t)=>FQ(e,BQ(t)),WQ=(e,t)=>{var n={};for(var r in e)sE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tm)for(var r of Tm(e))t.indexOf(r)<0&&aE.call(e,r)&&(n[r]=e[r]);return n};const iE=d.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,visible:u,arrowX:p,arrowY:m}=n,h=WQ(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const g=xa();return u?H.createElement("div",VQ(HQ({},h),{ref:t,style:LQ({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,dir:g.dir,arrowX:p,arrowY:m})})):null});iE.displayName="@mantine/core/FloatingArrow";var UQ=Object.defineProperty,GQ=Object.defineProperties,KQ=Object.getOwnPropertyDescriptors,Nm=Object.getOwnPropertySymbols,lE=Object.prototype.hasOwnProperty,cE=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?UQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ll=(e,t)=>{for(var n in t||(t={}))lE.call(t,n)&&gk(e,n,t[n]);if(Nm)for(var n of Nm(t))cE.call(t,n)&&gk(e,n,t[n]);return e},gp=(e,t)=>GQ(e,KQ(t)),qQ=(e,t)=>{var n={};for(var r in e)lE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nm)for(var r of Nm(e))t.indexOf(r)<0&&cE.call(e,r)&&(n[r]=e[r]);return n};const XQ={};function uE(e){var t;const n=Dn("PopoverDropdown",XQ,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,l=qQ(n,["style","className","children","onKeyDownCapture"]),u=J6(),{classes:p,cx:m}=_Q({radius:u.radius,shadow:u.shadow},{name:u.__staticSelector,classNames:u.classNames,styles:u.styles,unstyled:u.unstyled,variant:u.variant}),h=RG({opened:u.opened,shouldReturnFocus:u.returnFocus}),g=u.withRoles?{"aria-labelledby":u.getTargetId(),id:u.getDropdownId(),role:"dialog"}:{};return u.disabled?null:H.createElement(u6,gp(Ll({},u.portalProps),{withinPortal:u.withinPortal}),H.createElement(rE,gp(Ll({mounted:u.opened},u.transitionProps),{transition:u.transitionProps.transition||"fade",duration:(t=u.transitionProps.duration)!=null?t:150,keepMounted:u.keepMounted,exitDuration:typeof u.transitionProps.exitDuration=="number"?u.transitionProps.exitDuration:u.transitionProps.duration}),x=>{var y,b;return H.createElement(oE,{active:u.trapFocus},H.createElement(zr,Ll(gp(Ll({},g),{tabIndex:-1,ref:u.floating,style:gp(Ll(Ll({},r),x),{zIndex:u.zIndex,top:(y=u.y)!=null?y:0,left:(b=u.x)!=null?b:0,width:u.width==="target"?void 0:Re(u.width)}),className:m(p.dropdown,o),onKeyDownCapture:iG(u.onClose,{active:u.closeOnEscape,onTrigger:h,onKeyDown:i}),"data-position":u.placement}),l),s,H.createElement(iE,{ref:u.arrowRef,arrowX:u.arrowX,arrowY:u.arrowY,visible:u.withArrow,position:u.placement,arrowSize:u.arrowSize,arrowRadius:u.arrowRadius,arrowOffset:u.arrowOffset,arrowPosition:u.arrowPosition,className:p.arrow})))}))}uE.displayName="@mantine/core/PopoverDropdown";function QQ(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var vk=Object.getOwnPropertySymbols,YQ=Object.prototype.hasOwnProperty,ZQ=Object.prototype.propertyIsEnumerable,JQ=(e,t)=>{var n={};for(var r in e)YQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vk)for(var r of vk(e))t.indexOf(r)<0&&ZQ.call(e,r)&&(n[r]=e[r]);return n};const eY={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:ey("popover"),__staticSelector:"Popover",width:"max-content"};function Bc(e){var t,n,r,o,s,i;const l=d.useRef(null),u=Dn("Popover",eY,e),{children:p,position:m,offset:h,onPositionChange:g,positionDependencies:x,opened:y,transitionProps:b,width:w,middlewares:S,withArrow:j,arrowSize:_,arrowOffset:E,arrowRadius:I,arrowPosition:M,unstyled:R,classNames:D,styles:A,closeOnClickOutside:O,withinPortal:T,portalProps:X,closeOnEscape:B,clickOutsideEvents:V,trapFocus:U,onClose:N,onOpen:$,onChange:q,zIndex:F,radius:Q,shadow:Y,id:se,defaultOpened:ae,__staticSelector:re,withRoles:G,disabled:K,returnFocus:ee,variant:ce,keepMounted:J}=u,ie=JQ(u,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[de,ge]=d.useState(null),[Ce,he]=d.useState(null),fe=ny(se),Oe=xa(),_e=vQ({middlewares:S,width:w,position:QQ(Oe.dir,m),offset:typeof h=="number"?h+(j?_/2:0):h,arrowRef:l,arrowOffset:E,onPositionChange:g,positionDependencies:x,opened:y,defaultOpened:ae,onChange:q,onOpen:$,onClose:N});PG(()=>_e.opened&&O&&_e.onClose(),V,[de,Ce]);const Ne=d.useCallback($e=>{ge($e),_e.floating.reference($e)},[_e.floating.reference]),nt=d.useCallback($e=>{he($e),_e.floating.floating($e)},[_e.floating.floating]);return H.createElement(xQ,{value:{returnFocus:ee,disabled:K,controlled:_e.controlled,reference:Ne,floating:nt,x:_e.floating.x,y:_e.floating.y,arrowX:(r=(n=(t=_e.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(i=(s=(o=_e.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:_e.opened,arrowRef:l,transitionProps:b,width:w,withArrow:j,arrowSize:_,arrowOffset:E,arrowRadius:I,arrowPosition:M,placement:_e.floating.placement,trapFocus:U,withinPortal:T,portalProps:X,zIndex:F,radius:Q,shadow:Y,closeOnEscape:B,onClose:_e.onClose,onToggle:_e.onToggle,getTargetId:()=>`${fe}-target`,getDropdownId:()=>`${fe}-dropdown`,withRoles:G,targetProps:ie,__staticSelector:re,classNames:D,styles:A,unstyled:R,variant:ce,keepMounted:J}},p)}Bc.Target=nE;Bc.Dropdown=uE;Bc.displayName="@mantine/core/Popover";var tY=Object.defineProperty,$m=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,xk=(e,t,n)=>t in e?tY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nY=(e,t)=>{for(var n in t||(t={}))dE.call(t,n)&&xk(e,n,t[n]);if($m)for(var n of $m(t))fE.call(t,n)&&xk(e,n,t[n]);return e},rY=(e,t)=>{var n={};for(var r in e)dE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$m)for(var r of $m(e))t.indexOf(r)<0&&fE.call(e,r)&&(n[r]=e[r]);return n};function oY(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:l,__staticSelector:u,styles:p,classNames:m,unstyled:h}=t,g=rY(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:x}=zX(null,{name:u,styles:p,classNames:m,unstyled:h});return H.createElement(Bc.Dropdown,nY({p:0,onMouseDown:y=>y.preventDefault()},g),H.createElement("div",{style:{maxHeight:Re(o),display:"flex"}},H.createElement(zr,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==og?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},H.createElement("div",{className:x.itemsWrapper,style:{flexDirection:s}},n))))}function Ka({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:i,onDirectionChange:l,switchDirectionOnFlip:u,zIndex:p,dropdownPosition:m,positionDependencies:h=[],classNames:g,styles:x,unstyled:y,readOnly:b,variant:w}){return H.createElement(Bc,{unstyled:y,classNames:g,styles:x,width:"target",withRoles:!1,opened:e,middlewares:{flip:m==="flip",shift:!1},position:m==="flip"?"bottom":m,positionDependencies:h,zIndex:p,__staticSelector:i,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:b,onPositionChange:S=>u&&(l==null?void 0:l(S==="top"?"column-reverse":"column")),variant:w},s)}Ka.Target=Bc.Target;Ka.Dropdown=oY;var sY=Object.defineProperty,aY=Object.defineProperties,iY=Object.getOwnPropertyDescriptors,Lm=Object.getOwnPropertySymbols,pE=Object.prototype.hasOwnProperty,mE=Object.prototype.propertyIsEnumerable,bk=(e,t,n)=>t in e?sY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vp=(e,t)=>{for(var n in t||(t={}))pE.call(t,n)&&bk(e,n,t[n]);if(Lm)for(var n of Lm(t))mE.call(t,n)&&bk(e,n,t[n]);return e},lY=(e,t)=>aY(e,iY(t)),cY=(e,t)=>{var n={};for(var r in e)pE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lm)for(var r of Lm(e))t.indexOf(r)<0&&mE.call(e,r)&&(n[r]=e[r]);return n};function hE(e,t,n){const r=Dn(e,t,n),{label:o,description:s,error:i,required:l,classNames:u,styles:p,className:m,unstyled:h,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:w,wrapperProps:S,id:j,size:_,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:R,variant:D}=r,A=cY(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),O=ny(j),{systemStyles:T,rest:X}=eg(A),B=vp({label:o,description:s,error:i,required:l,classNames:u,className:m,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:w,unstyled:h,styles:p,id:O,size:_,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:R,variant:D},S);return lY(vp({},X),{classNames:u,styles:p,unstyled:h,wrapperProps:vp(vp({},B),T),inputProps:{required:l,classNames:u,styles:p,unstyled:h,id:O,size:_,__staticSelector:g,error:i,variant:D}})}var uY=fr((e,t,{size:n})=>({label:{display:"inline-block",fontSize:mt({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const dY=uY;var fY=Object.defineProperty,zm=Object.getOwnPropertySymbols,gE=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?fY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pY=(e,t)=>{for(var n in t||(t={}))gE.call(t,n)&&yk(e,n,t[n]);if(zm)for(var n of zm(t))vE.call(t,n)&&yk(e,n,t[n]);return e},mY=(e,t)=>{var n={};for(var r in e)gE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zm)for(var r of zm(e))t.indexOf(r)<0&&vE.call(e,r)&&(n[r]=e[r]);return n};const hY={labelElement:"label",size:"sm"},dy=d.forwardRef((e,t)=>{const n=Dn("InputLabel",hY,e),{labelElement:r,children:o,required:s,size:i,classNames:l,styles:u,unstyled:p,className:m,htmlFor:h,__staticSelector:g,variant:x,onMouseDown:y}=n,b=mY(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:S}=dY(null,{name:["InputWrapper",g],classNames:l,styles:u,unstyled:p,variant:x,size:i});return H.createElement(zr,pY({component:r,ref:t,className:S(w.label,m),htmlFor:r==="label"?h:void 0,onMouseDown:j=>{y==null||y(j),!j.defaultPrevented&&j.detail>1&&j.preventDefault()}},b),o,s&&H.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});dy.displayName="@mantine/core/InputLabel";var gY=fr((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${Re(2)})`,lineHeight:1.2,display:"block"}}));const vY=gY;var xY=Object.defineProperty,Fm=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Ck=(e,t,n)=>t in e?xY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bY=(e,t)=>{for(var n in t||(t={}))xE.call(t,n)&&Ck(e,n,t[n]);if(Fm)for(var n of Fm(t))bE.call(t,n)&&Ck(e,n,t[n]);return e},yY=(e,t)=>{var n={};for(var r in e)xE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fm)for(var r of Fm(e))t.indexOf(r)<0&&bE.call(e,r)&&(n[r]=e[r]);return n};const CY={size:"sm"},fy=d.forwardRef((e,t)=>{const n=Dn("InputError",CY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:m}=n,h=yY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=vY(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:m,size:u});return H.createElement(wc,bY({className:x(g.error,o),ref:t},h),r)});fy.displayName="@mantine/core/InputError";var wY=fr((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${Re(2)})`,lineHeight:1.2,display:"block"}}));const SY=wY;var kY=Object.defineProperty,Bm=Object.getOwnPropertySymbols,yE=Object.prototype.hasOwnProperty,CE=Object.prototype.propertyIsEnumerable,wk=(e,t,n)=>t in e?kY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jY=(e,t)=>{for(var n in t||(t={}))yE.call(t,n)&&wk(e,n,t[n]);if(Bm)for(var n of Bm(t))CE.call(t,n)&&wk(e,n,t[n]);return e},_Y=(e,t)=>{var n={};for(var r in e)yE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bm)for(var r of Bm(e))t.indexOf(r)<0&&CE.call(e,r)&&(n[r]=e[r]);return n};const IY={size:"sm"},py=d.forwardRef((e,t)=>{const n=Dn("InputDescription",IY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:m}=n,h=_Y(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=SY(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:m,size:u});return H.createElement(wc,jY({color:"dimmed",className:x(g.description,o),ref:t,unstyled:l},h),r)});py.displayName="@mantine/core/InputDescription";const wE=d.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),PY=wE.Provider,EY=()=>d.useContext(wE);function MY(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="input"),o=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var OY=Object.defineProperty,RY=Object.defineProperties,DY=Object.getOwnPropertyDescriptors,Sk=Object.getOwnPropertySymbols,AY=Object.prototype.hasOwnProperty,TY=Object.prototype.propertyIsEnumerable,kk=(e,t,n)=>t in e?OY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NY=(e,t)=>{for(var n in t||(t={}))AY.call(t,n)&&kk(e,n,t[n]);if(Sk)for(var n of Sk(t))TY.call(t,n)&&kk(e,n,t[n]);return e},$Y=(e,t)=>RY(e,DY(t)),LY=fr(e=>({root:$Y(NY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const zY=LY;var FY=Object.defineProperty,BY=Object.defineProperties,HY=Object.getOwnPropertyDescriptors,Hm=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,jk=(e,t,n)=>t in e?FY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$a=(e,t)=>{for(var n in t||(t={}))SE.call(t,n)&&jk(e,n,t[n]);if(Hm)for(var n of Hm(t))kE.call(t,n)&&jk(e,n,t[n]);return e},_k=(e,t)=>BY(e,HY(t)),VY=(e,t)=>{var n={};for(var r in e)SE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hm)for(var r of Hm(e))t.indexOf(r)<0&&kE.call(e,r)&&(n[r]=e[r]);return n};const WY={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},jE=d.forwardRef((e,t)=>{const n=Dn("InputWrapper",WY,e),{className:r,label:o,children:s,required:i,id:l,error:u,description:p,labelElement:m,labelProps:h,descriptionProps:g,errorProps:x,classNames:y,styles:b,size:w,inputContainer:S,__staticSelector:j,unstyled:_,inputWrapperOrder:E,withAsterisk:I,variant:M}=n,R=VY(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:D,cx:A}=zY(null,{classNames:y,styles:b,name:["InputWrapper",j],unstyled:_,variant:M,size:w}),O={classNames:y,styles:b,unstyled:_,size:w,variant:M,__staticSelector:j},T=typeof I=="boolean"?I:i,X=l?`${l}-error`:x==null?void 0:x.id,B=l?`${l}-description`:g==null?void 0:g.id,U=`${!!u&&typeof u!="boolean"?X:""} ${p?B:""}`,N=U.trim().length>0?U.trim():void 0,$=o&&H.createElement(dy,$a($a({key:"label",labelElement:m,id:l?`${l}-label`:void 0,htmlFor:l,required:T},O),h),o),q=p&&H.createElement(py,_k($a($a({key:"description"},g),O),{size:(g==null?void 0:g.size)||O.size,id:(g==null?void 0:g.id)||B}),p),F=H.createElement(d.Fragment,{key:"input"},S(s)),Q=typeof u!="boolean"&&u&&H.createElement(fy,_k($a($a({},x),O),{size:(x==null?void 0:x.size)||O.size,key:"error",id:(x==null?void 0:x.id)||X}),u),Y=E.map(se=>{switch(se){case"label":return $;case"input":return F;case"description":return q;case"error":return Q;default:return null}});return H.createElement(PY,{value:$a({describedBy:N},MY(E,{hasDescription:!!q,hasError:!!Q}))},H.createElement(zr,$a({className:A(D.root,r),ref:t},R),Y))});jE.displayName="@mantine/core/InputWrapper";var UY=Object.defineProperty,Vm=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,IE=Object.prototype.propertyIsEnumerable,Ik=(e,t,n)=>t in e?UY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GY=(e,t)=>{for(var n in t||(t={}))_E.call(t,n)&&Ik(e,n,t[n]);if(Vm)for(var n of Vm(t))IE.call(t,n)&&Ik(e,n,t[n]);return e},KY=(e,t)=>{var n={};for(var r in e)_E.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vm)for(var r of Vm(e))t.indexOf(r)<0&&IE.call(e,r)&&(n[r]=e[r]);return n};const qY={},PE=d.forwardRef((e,t)=>{const n=Dn("InputPlaceholder",qY,e),{sx:r}=n,o=KY(n,["sx"]);return H.createElement(zr,GY({component:"span",sx:[s=>s.fn.placeholderStyles(),...PP(r)],ref:t},o))});PE.displayName="@mantine/core/InputPlaceholder";var XY=Object.defineProperty,QY=Object.defineProperties,YY=Object.getOwnPropertyDescriptors,Pk=Object.getOwnPropertySymbols,ZY=Object.prototype.hasOwnProperty,JY=Object.prototype.propertyIsEnumerable,Ek=(e,t,n)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xp=(e,t)=>{for(var n in t||(t={}))ZY.call(t,n)&&Ek(e,n,t[n]);if(Pk)for(var n of Pk(t))JY.call(t,n)&&Ek(e,n,t[n]);return e},Pv=(e,t)=>QY(e,YY(t));const mo={xs:Re(30),sm:Re(36),md:Re(42),lg:Re(50),xl:Re(60)},eZ=["default","filled","unstyled"];function tZ({theme:e,variant:t}){return eZ.includes(t)?t==="default"?{border:`${Re(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${Re(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:Re(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var nZ=fr((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:l,offsetTop:u,pointer:p},{variant:m,size:h})=>{const g=e.fn.variant({variant:"filled",color:"red"}).background,x=m==="default"||m==="filled"?{minHeight:mt({size:h,sizes:mo}),paddingLeft:`calc(${mt({size:h,sizes:mo})}  / 3)`,paddingRight:s?o||mt({size:h,sizes:mo}):`calc(${mt({size:h,sizes:mo})}  / 3)`,borderRadius:e.fn.radius(n)}:m==="unstyled"&&s?{paddingRight:o||mt({size:h,sizes:mo})}:null;return{wrapper:{position:"relative",marginTop:u?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:Pv(xp(xp(Pv(xp({},e.fn.fontStyles()),{height:t?m==="unstyled"?void 0:"auto":mt({size:h,sizes:mo}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${mt({size:h,sizes:mo})} - ${Re(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:mt({size:h,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:p?"pointer":void 0}),tZ({theme:e,variant:m})),x),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:g,borderColor:g,"&::placeholder":{opacity:1,color:g}},"&[data-with-icon]":{paddingLeft:typeof i=="number"?Re(i):mt({size:h,sizes:mo})},"&::placeholder":Pv(xp({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:i?Re(i):mt({size:h,sizes:mo}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||mt({size:h,sizes:mo})}}});const rZ=nZ;var oZ=Object.defineProperty,sZ=Object.defineProperties,aZ=Object.getOwnPropertyDescriptors,Wm=Object.getOwnPropertySymbols,EE=Object.prototype.hasOwnProperty,ME=Object.prototype.propertyIsEnumerable,Mk=(e,t,n)=>t in e?oZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bp=(e,t)=>{for(var n in t||(t={}))EE.call(t,n)&&Mk(e,n,t[n]);if(Wm)for(var n of Wm(t))ME.call(t,n)&&Mk(e,n,t[n]);return e},Ok=(e,t)=>sZ(e,aZ(t)),iZ=(e,t)=>{var n={};for(var r in e)EE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wm)for(var r of Wm(e))t.indexOf(r)<0&&ME.call(e,r)&&(n[r]=e[r]);return n};const lZ={size:"sm",variant:"default"},il=d.forwardRef((e,t)=>{const n=Dn("Input",lZ,e),{className:r,error:o,required:s,disabled:i,variant:l,icon:u,style:p,rightSectionWidth:m,iconWidth:h,rightSection:g,rightSectionProps:x,radius:y,size:b,wrapperProps:w,classNames:S,styles:j,__staticSelector:_,multiline:E,sx:I,unstyled:M,pointer:R}=n,D=iZ(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:A,offsetTop:O,describedBy:T}=EY(),{classes:X,cx:B}=rZ({radius:y,multiline:E,invalid:!!o,rightSectionWidth:m?Re(m):void 0,iconWidth:h,withRightSection:!!g,offsetBottom:A,offsetTop:O,pointer:R},{classNames:S,styles:j,name:["Input",_],unstyled:M,variant:l,size:b}),{systemStyles:V,rest:U}=eg(D);return H.createElement(zr,bp(bp({className:B(X.wrapper,r),sx:I,style:p},V),w),u&&H.createElement("div",{className:X.icon},u),H.createElement(zr,Ok(bp({component:"input"},U),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":T,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!u||void 0,"data-invalid":!!o||void 0,className:X.input})),g&&H.createElement("div",Ok(bp({},x),{className:X.rightSection}),g))});il.displayName="@mantine/core/Input";il.Wrapper=jE;il.Label=dy;il.Description=py;il.Error=fy;il.Placeholder=PE;const _c=il;var cZ=Object.defineProperty,Um=Object.getOwnPropertySymbols,OE=Object.prototype.hasOwnProperty,RE=Object.prototype.propertyIsEnumerable,Rk=(e,t,n)=>t in e?cZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dk=(e,t)=>{for(var n in t||(t={}))OE.call(t,n)&&Rk(e,n,t[n]);if(Um)for(var n of Um(t))RE.call(t,n)&&Rk(e,n,t[n]);return e},uZ=(e,t)=>{var n={};for(var r in e)OE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Um)for(var r of Um(e))t.indexOf(r)<0&&RE.call(e,r)&&(n[r]=e[r]);return n};const dZ={multiple:!1},DE=d.forwardRef((e,t)=>{const n=Dn("FileButton",dZ,e),{onChange:r,children:o,multiple:s,accept:i,name:l,form:u,resetRef:p,disabled:m,capture:h,inputProps:g}=n,x=uZ(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=d.useRef(),b=()=>{!m&&y.current.click()},w=j=>{r(s?Array.from(j.currentTarget.files):j.currentTarget.files[0]||null)};return LP(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(Dk({onClick:b},x)),H.createElement("input",Dk({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:w,ref:Bd(t,y),name:l,form:u,capture:h},g)))});DE.displayName="@mantine/core/FileButton";const AE={xs:Re(16),sm:Re(22),md:Re(26),lg:Re(30),xl:Re(36)},fZ={xs:Re(10),sm:Re(12),md:Re(14),lg:Re(16),xl:Re(18)};var pZ=fr((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:mt({size:o,sizes:AE}),paddingLeft:`calc(${mt({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?mt({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:mt({size:o,sizes:fZ}),borderRadius:mt({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Re(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${mt({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const mZ=pZ;var hZ=Object.defineProperty,Gm=Object.getOwnPropertySymbols,TE=Object.prototype.hasOwnProperty,NE=Object.prototype.propertyIsEnumerable,Ak=(e,t,n)=>t in e?hZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gZ=(e,t)=>{for(var n in t||(t={}))TE.call(t,n)&&Ak(e,n,t[n]);if(Gm)for(var n of Gm(t))NE.call(t,n)&&Ak(e,n,t[n]);return e},vZ=(e,t)=>{var n={};for(var r in e)TE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gm)for(var r of Gm(e))t.indexOf(r)<0&&NE.call(e,r)&&(n[r]=e[r]);return n};const xZ={xs:16,sm:22,md:24,lg:26,xl:30};function $E(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:l,readOnly:u,size:p,radius:m="sm",variant:h,unstyled:g}=t,x=vZ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:b}=mZ({disabled:l,readOnly:u,radius:m},{name:"MultiSelect",classNames:r,styles:o,unstyled:g,size:p,variant:h});return H.createElement("div",gZ({className:b(y.defaultValue,s)},x),H.createElement("span",{className:y.defaultValueLabel},n),!l&&!u&&H.createElement(v6,{"aria-hidden":!0,onMouseDown:i,size:xZ[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:g}))}$E.displayName="@mantine/core/MultiSelect/DefaultValue";function bZ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:i}){if(!t&&s.length===0)return e;if(!t){const u=[];for(let p=0;p<e.length;p+=1)(i||!s.some(m=>m===e[p].value&&!e[p].disabled))&&u.push(e[p]);return u}const l=[];for(let u=0;u<e.length&&(o(r,!i&&s.some(p=>p===e[u].value&&!e[u].disabled),e[u])&&l.push(e[u]),!(l.length>=n));u+=1);return l}var yZ=Object.defineProperty,Km=Object.getOwnPropertySymbols,LE=Object.prototype.hasOwnProperty,zE=Object.prototype.propertyIsEnumerable,Tk=(e,t,n)=>t in e?yZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nk=(e,t)=>{for(var n in t||(t={}))LE.call(t,n)&&Tk(e,n,t[n]);if(Km)for(var n of Km(t))zE.call(t,n)&&Tk(e,n,t[n]);return e},CZ=(e,t)=>{var n={};for(var r in e)LE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Km)for(var r of Km(e))t.indexOf(r)<0&&zE.call(e,r)&&(n[r]=e[r]);return n};const wZ={xs:Re(14),sm:Re(18),md:Re(20),lg:Re(24),xl:Re(28)};function SZ(e){var t=e,{size:n,error:r,style:o}=t,s=CZ(t,["size","error","style"]);const i=xa(),l=mt({size:n,sizes:wZ});return H.createElement("svg",Nk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Nk({color:r?i.colors.red[6]:i.colors.gray[6],width:l,height:l},o),"data-chevron":!0},s),H.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var kZ=Object.defineProperty,jZ=Object.defineProperties,_Z=Object.getOwnPropertyDescriptors,$k=Object.getOwnPropertySymbols,IZ=Object.prototype.hasOwnProperty,PZ=Object.prototype.propertyIsEnumerable,Lk=(e,t,n)=>t in e?kZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EZ=(e,t)=>{for(var n in t||(t={}))IZ.call(t,n)&&Lk(e,n,t[n]);if($k)for(var n of $k(t))PZ.call(t,n)&&Lk(e,n,t[n]);return e},MZ=(e,t)=>jZ(e,_Z(t));function FE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(v6,MZ(EZ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(SZ,{error:o,size:r})}FE.displayName="@mantine/core/SelectRightSection";var OZ=Object.defineProperty,RZ=Object.defineProperties,DZ=Object.getOwnPropertyDescriptors,qm=Object.getOwnPropertySymbols,BE=Object.prototype.hasOwnProperty,HE=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?OZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ev=(e,t)=>{for(var n in t||(t={}))BE.call(t,n)&&zk(e,n,t[n]);if(qm)for(var n of qm(t))HE.call(t,n)&&zk(e,n,t[n]);return e},Fk=(e,t)=>RZ(e,DZ(t)),AZ=(e,t)=>{var n={};for(var r in e)BE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qm)for(var r of qm(e))t.indexOf(r)<0&&HE.call(e,r)&&(n[r]=e[r]);return n};function VE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=AZ(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const l=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&H.createElement(FE,Ev({},i)),styles:Fk(Ev({},l),{rightSection:Fk(Ev({},l==null?void 0:l.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var TZ=Object.defineProperty,NZ=Object.defineProperties,$Z=Object.getOwnPropertyDescriptors,Bk=Object.getOwnPropertySymbols,LZ=Object.prototype.hasOwnProperty,zZ=Object.prototype.propertyIsEnumerable,Hk=(e,t,n)=>t in e?TZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FZ=(e,t)=>{for(var n in t||(t={}))LZ.call(t,n)&&Hk(e,n,t[n]);if(Bk)for(var n of Bk(t))zZ.call(t,n)&&Hk(e,n,t[n]);return e},BZ=(e,t)=>NZ(e,$Z(t)),HZ=fr((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${mt({size:n,sizes:mo})} - ${Re(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:mt({size:n,sizes:mo})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Re(2)}) calc(${e.spacing.xs} / 2)`},searchInput:BZ(FZ({},e.fn.fontStyles()),{flex:1,minWidth:Re(60),backgroundColor:"transparent",border:0,outline:0,fontSize:mt({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:mt({size:n,sizes:AE}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const VZ=HZ;var WZ=Object.defineProperty,UZ=Object.defineProperties,GZ=Object.getOwnPropertyDescriptors,Xm=Object.getOwnPropertySymbols,WE=Object.prototype.hasOwnProperty,UE=Object.prototype.propertyIsEnumerable,Vk=(e,t,n)=>t in e?WZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zl=(e,t)=>{for(var n in t||(t={}))WE.call(t,n)&&Vk(e,n,t[n]);if(Xm)for(var n of Xm(t))UE.call(t,n)&&Vk(e,n,t[n]);return e},Wk=(e,t)=>UZ(e,GZ(t)),KZ=(e,t)=>{var n={};for(var r in e)WE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xm)for(var r of Xm(e))t.indexOf(r)<0&&UE.call(e,r)&&(n[r]=e[r]);return n};function qZ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function XZ(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function Uk(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const QZ={size:"sm",valueComponent:$E,itemComponent:oy,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:qZ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:XZ,switchDirectionOnFlip:!1,zIndex:ey("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},GE=d.forwardRef((e,t)=>{const n=Dn("MultiSelect",QZ,e),{className:r,style:o,required:s,label:i,description:l,size:u,error:p,classNames:m,styles:h,wrapperProps:g,value:x,defaultValue:y,data:b,onChange:w,valueComponent:S,itemComponent:j,id:_,transitionProps:E,maxDropdownHeight:I,shadow:M,nothingFound:R,onFocus:D,onBlur:A,searchable:O,placeholder:T,filter:X,limit:B,clearSearchOnChange:V,clearable:U,clearSearchOnBlur:N,variant:$,onSearchChange:q,searchValue:F,disabled:Q,initiallyOpened:Y,radius:se,icon:ae,rightSection:re,rightSectionWidth:G,creatable:K,getCreateLabel:ee,shouldCreate:ce,onCreate:J,sx:ie,dropdownComponent:de,onDropdownClose:ge,onDropdownOpen:Ce,maxSelectedValues:he,withinPortal:fe,portalProps:Oe,switchDirectionOnFlip:_e,zIndex:Ne,selectOnBlur:nt,name:$e,dropdownPosition:Pt,errorProps:Ze,labelProps:ot,descriptionProps:ye,form:De,positionDependencies:ut,onKeyDown:bt,unstyled:be,inputContainer:Je,inputWrapperOrder:lt,readOnly:ft,withAsterisk:Me,clearButtonProps:Le,hoverOnSearchChange:Ut,disableSelectedItemFiltering:ke}=n,Be=KZ(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:ze,cx:Ge,theme:pt}=VZ({invalid:!!p},{name:"MultiSelect",classNames:m,styles:h,unstyled:be,size:u,variant:$}),{systemStyles:En,rest:Dt}=eg(Be),At=d.useRef(),pr=d.useRef({}),Ln=ny(_),[kn,gn]=d.useState(Y),[ln,kr]=d.useState(-1),[Mo,mr]=d.useState("column"),[hr,Ns]=od({value:F,defaultValue:"",finalValue:void 0,onChange:q}),[$s,wa]=d.useState(!1),{scrollIntoView:Sa,targetRef:ml,scrollableRef:ka}=FP({duration:0,offset:5,cancelable:!1,isList:!0}),hl=K&&typeof ee=="function";let Qe=null;const Gt=b.map(rt=>typeof rt=="string"?{label:rt,value:rt}:rt),zn=EP({data:Gt}),[St,ja]=od({value:Uk(x,b),defaultValue:Uk(y,b),finalValue:[],onChange:w}),Wr=d.useRef(!!he&&he<St.length),ef=rt=>{if(!ft){const Mt=St.filter(kt=>kt!==rt);ja(Mt),he&&Mt.length<he&&(Wr.current=!1)}},zg=rt=>{Ns(rt.currentTarget.value),!Q&&!Wr.current&&O&&gn(!0)},Fg=rt=>{typeof D=="function"&&D(rt),!Q&&!Wr.current&&O&&gn(!0)},Fn=bZ({data:zn,searchable:O,searchValue:hr,limit:B,filter:X,value:St,disableSelectedItemFiltering:ke});hl&&ce(hr,zn)&&(Qe=ee(hr),Fn.push({label:hr,value:hr,creatable:!0}));const Ls=Math.min(ln,Fn.length-1),tf=(rt,Mt,kt)=>{let Ot=rt;for(;kt(Ot);)if(Ot=Mt(Ot),!Fn[Ot].disabled)return Ot;return rt};Uo(()=>{kr(Ut&&hr?0:-1)},[hr,Ut]),Uo(()=>{!Q&&St.length>b.length&&gn(!1),he&&St.length<he&&(Wr.current=!1),he&&St.length>=he&&(Wr.current=!0,gn(!1))},[St]);const gl=rt=>{if(!ft)if(V&&Ns(""),St.includes(rt.value))ef(rt.value);else{if(rt.creatable&&typeof J=="function"){const Mt=J(rt.value);typeof Mt<"u"&&Mt!==null&&ja(typeof Mt=="string"?[...St,Mt]:[...St,Mt.value])}else ja([...St,rt.value]);St.length===he-1&&(Wr.current=!0,gn(!1)),Fn.length===1&&gn(!1)}},Zc=rt=>{typeof A=="function"&&A(rt),nt&&Fn[Ls]&&kn&&gl(Fn[Ls]),N&&Ns(""),gn(!1)},hi=rt=>{if($s||(bt==null||bt(rt),ft)||rt.key!=="Backspace"&&he&&Wr.current)return;const Mt=Mo==="column",kt=()=>{kr(rr=>{var rn;const An=tf(rr,gr=>gr+1,gr=>gr<Fn.length-1);return kn&&(ml.current=pr.current[(rn=Fn[An])==null?void 0:rn.value],Sa({alignment:Mt?"end":"start"})),An})},Ot=()=>{kr(rr=>{var rn;const An=tf(rr,gr=>gr-1,gr=>gr>0);return kn&&(ml.current=pr.current[(rn=Fn[An])==null?void 0:rn.value],Sa({alignment:Mt?"start":"end"})),An})};switch(rt.key){case"ArrowUp":{rt.preventDefault(),gn(!0),Mt?Ot():kt();break}case"ArrowDown":{rt.preventDefault(),gn(!0),Mt?kt():Ot();break}case"Enter":{rt.preventDefault(),Fn[Ls]&&kn?gl(Fn[Ls]):gn(!0);break}case" ":{O||(rt.preventDefault(),Fn[Ls]&&kn?gl(Fn[Ls]):gn(!0));break}case"Backspace":{St.length>0&&hr.length===0&&(ja(St.slice(0,-1)),gn(!0),he&&(Wr.current=!1));break}case"Home":{if(!O){rt.preventDefault(),kn||gn(!0);const rr=Fn.findIndex(rn=>!rn.disabled);kr(rr),Sa({alignment:Mt?"end":"start"})}break}case"End":{if(!O){rt.preventDefault(),kn||gn(!0);const rr=Fn.map(rn=>!!rn.disabled).lastIndexOf(!1);kr(rr),Sa({alignment:Mt?"end":"start"})}break}case"Escape":gn(!1)}},Jc=St.map(rt=>{let Mt=zn.find(kt=>kt.value===rt&&!kt.disabled);return!Mt&&hl&&(Mt={value:rt,label:rt}),Mt}).filter(rt=>!!rt).map((rt,Mt)=>H.createElement(S,Wk(zl({},rt),{variant:$,disabled:Q,className:ze.value,readOnly:ft,onRemove:kt=>{kt.preventDefault(),kt.stopPropagation(),ef(rt.value)},key:rt.value,size:u,styles:h,classNames:m,radius:se,index:Mt}))),eu=rt=>St.includes(rt),Bg=()=>{var rt;Ns(""),ja([]),(rt=At.current)==null||rt.focus(),he&&(Wr.current=!1)},_a=!ft&&(Fn.length>0?kn:kn&&!!R);return Uo(()=>{const rt=_a?Ce:ge;typeof rt=="function"&&rt()},[_a]),H.createElement(_c.Wrapper,zl(zl({required:s,id:Ln,label:i,error:p,description:l,size:u,className:r,style:o,classNames:m,styles:h,__staticSelector:"MultiSelect",sx:ie,errorProps:Ze,descriptionProps:ye,labelProps:ot,inputContainer:Je,inputWrapperOrder:lt,unstyled:be,withAsterisk:Me,variant:$},En),g),H.createElement(Ka,{opened:_a,transitionProps:E,shadow:"sm",withinPortal:fe,portalProps:Oe,__staticSelector:"MultiSelect",onDirectionChange:mr,switchDirectionOnFlip:_e,zIndex:Ne,dropdownPosition:Pt,positionDependencies:[...ut,hr],classNames:m,styles:h,unstyled:be,variant:$},H.createElement(Ka.Target,null,H.createElement("div",{className:ze.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":kn&&_a?`${Ln}-items`:null,"aria-controls":Ln,"aria-expanded":kn,onMouseLeave:()=>kr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:$e,value:St.join(","),form:De,disabled:Q}),H.createElement(_c,zl({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:$,disabled:Q,error:p,required:s,radius:se,icon:ae,unstyled:be,onMouseDown:rt=>{var Mt;rt.preventDefault(),!Q&&!Wr.current&&gn(!kn),(Mt=At.current)==null||Mt.focus()},classNames:Wk(zl({},m),{input:Ge({[ze.input]:!O},m==null?void 0:m.input)})},VE({theme:pt,rightSection:re,rightSectionWidth:G,styles:h,size:u,shouldClear:U&&St.length>0,onClear:Bg,error:p,disabled:Q,clearButtonProps:Le,readOnly:ft})),H.createElement("div",{className:ze.values,"data-clearable":U||void 0},Jc,H.createElement("input",zl({ref:Bd(t,At),type:"search",id:Ln,className:Ge(ze.searchInput,{[ze.searchInputPointer]:!O,[ze.searchInputInputHidden]:!kn&&St.length>0||!O&&St.length>0,[ze.searchInputEmpty]:St.length===0}),onKeyDown:hi,value:hr,onChange:zg,onFocus:Fg,onBlur:Zc,readOnly:!O||Wr.current||ft,placeholder:St.length===0?T:void 0,disabled:Q,"data-mantine-stop-propagation":kn,autoComplete:"off",onCompositionStart:()=>wa(!0),onCompositionEnd:()=>wa(!1)},Dt)))))),H.createElement(Ka.Dropdown,{component:de||og,maxHeight:I,direction:Mo,id:Ln,innerRef:ka,__staticSelector:"MultiSelect",classNames:m,styles:h},H.createElement(ry,{data:Fn,hovered:Ls,classNames:m,styles:h,uuid:Ln,__staticSelector:"MultiSelect",onItemHover:kr,onItemSelect:gl,itemsRefs:pr,itemComponent:j,size:u,nothingFound:R,isItemSelected:eu,creatable:K&&!!Qe,createLabel:Qe,unstyled:be,variant:$}))))});GE.displayName="@mantine/core/MultiSelect";var YZ=Object.defineProperty,ZZ=Object.defineProperties,JZ=Object.getOwnPropertyDescriptors,Qm=Object.getOwnPropertySymbols,KE=Object.prototype.hasOwnProperty,qE=Object.prototype.propertyIsEnumerable,Gk=(e,t,n)=>t in e?YZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mv=(e,t)=>{for(var n in t||(t={}))KE.call(t,n)&&Gk(e,n,t[n]);if(Qm)for(var n of Qm(t))qE.call(t,n)&&Gk(e,n,t[n]);return e},eJ=(e,t)=>ZZ(e,JZ(t)),tJ=(e,t)=>{var n={};for(var r in e)KE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qm)for(var r of Qm(e))t.indexOf(r)<0&&qE.call(e,r)&&(n[r]=e[r]);return n};const nJ={type:"text",size:"sm",__staticSelector:"TextInput"},XE=d.forwardRef((e,t)=>{const n=hE("TextInput",nJ,e),{inputProps:r,wrapperProps:o}=n,s=tJ(n,["inputProps","wrapperProps"]);return H.createElement(_c.Wrapper,Mv({},o),H.createElement(_c,eJ(Mv(Mv({},r),s),{ref:t})))});XE.displayName="@mantine/core/TextInput";function rJ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const l=s!=null&&e.find(p=>p.value===s)||null;if(l&&!i&&(l==null?void 0:l.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(l),m=p+n,h=m-e.length;return h>0?e.slice(p-h):e.slice(p,m)}return e}const u=[];for(let p=0;p<e.length&&(o(r,e[p])&&u.push(e[p]),!(u.length>=n));p+=1);return u}var oJ=fr(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const sJ=oJ;var aJ=Object.defineProperty,iJ=Object.defineProperties,lJ=Object.getOwnPropertyDescriptors,Ym=Object.getOwnPropertySymbols,QE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,Kk=(e,t,n)=>t in e?aJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ju=(e,t)=>{for(var n in t||(t={}))QE.call(t,n)&&Kk(e,n,t[n]);if(Ym)for(var n of Ym(t))YE.call(t,n)&&Kk(e,n,t[n]);return e},Ov=(e,t)=>iJ(e,lJ(t)),cJ=(e,t)=>{var n={};for(var r in e)QE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ym)for(var r of Ym(e))t.indexOf(r)<0&&YE.call(e,r)&&(n[r]=e[r]);return n};function uJ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function dJ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const fJ={required:!1,size:"sm",shadow:"sm",itemComponent:oy,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:uJ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:dJ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:ey("popover"),positionDependencies:[],dropdownPosition:"flip"},my=d.forwardRef((e,t)=>{const n=hE("Select",fJ,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:l,defaultValue:u,onChange:p,itemComponent:m,onKeyDown:h,onBlur:g,onFocus:x,transitionProps:y,initiallyOpened:b,unstyled:w,classNames:S,styles:j,filter:_,maxDropdownHeight:E,searchable:I,clearable:M,nothingFound:R,limit:D,disabled:A,onSearchChange:O,searchValue:T,rightSection:X,rightSectionWidth:B,creatable:V,getCreateLabel:U,shouldCreate:N,selectOnBlur:$,onCreate:q,dropdownComponent:F,onDropdownClose:Q,onDropdownOpen:Y,withinPortal:se,portalProps:ae,switchDirectionOnFlip:re,zIndex:G,name:K,dropdownPosition:ee,allowDeselect:ce,placeholder:J,filterDataOnExactSearchMatch:ie,form:de,positionDependencies:ge,readOnly:Ce,clearButtonProps:he,hoverOnSearchChange:fe}=n,Oe=cJ(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:_e,cx:Ne,theme:nt}=sJ(),[$e,Pt]=d.useState(b),[Ze,ot]=d.useState(-1),ye=d.useRef(),De=d.useRef({}),[ut,bt]=d.useState("column"),be=ut==="column",{scrollIntoView:Je,targetRef:lt,scrollableRef:ft}=FP({duration:0,offset:5,cancelable:!1,isList:!0}),Me=ce===void 0?M:ce,Le=Qe=>{if($e!==Qe){Pt(Qe);const Gt=Qe?Y:Q;typeof Gt=="function"&&Gt()}},Ut=V&&typeof U=="function";let ke=null;const Be=i.map(Qe=>typeof Qe=="string"?{label:Qe,value:Qe}:Qe),ze=EP({data:Be}),[Ge,pt,En]=od({value:l,defaultValue:u,finalValue:null,onChange:p}),Dt=ze.find(Qe=>Qe.value===Ge),[At,pr]=od({value:T,defaultValue:(Dt==null?void 0:Dt.label)||"",finalValue:void 0,onChange:O}),Ln=Qe=>{pr(Qe),I&&typeof O=="function"&&O(Qe)},kn=()=>{var Qe;Ce||(pt(null),En||Ln(""),(Qe=ye.current)==null||Qe.focus())};d.useEffect(()=>{const Qe=ze.find(Gt=>Gt.value===Ge);Qe?Ln(Qe.label):(!Ut||!Ge)&&Ln("")},[Ge]),d.useEffect(()=>{Dt&&(!I||!$e)&&Ln(Dt.label)},[Dt==null?void 0:Dt.label]);const gn=Qe=>{if(!Ce)if(Me&&(Dt==null?void 0:Dt.value)===Qe.value)pt(null),Le(!1);else{if(Qe.creatable&&typeof q=="function"){const Gt=q(Qe.value);typeof Gt<"u"&&Gt!==null&&pt(typeof Gt=="string"?Gt:Gt.value)}else pt(Qe.value);En||Ln(Qe.label),ot(-1),Le(!1),ye.current.focus()}},ln=rJ({data:ze,searchable:I,limit:D,searchValue:At,filter:_,filterDataOnExactSearchMatch:ie,value:Ge});Ut&&N(At,ln)&&(ke=U(At),ln.push({label:At,value:At,creatable:!0}));const kr=(Qe,Gt,zn)=>{let St=Qe;for(;zn(St);)if(St=Gt(St),!ln[St].disabled)return St;return Qe};Uo(()=>{ot(fe&&At?0:-1)},[At,fe]);const Mo=Ge?ln.findIndex(Qe=>Qe.value===Ge):0,mr=!Ce&&(ln.length>0?$e:$e&&!!R),hr=()=>{ot(Qe=>{var Gt;const zn=kr(Qe,St=>St-1,St=>St>0);return lt.current=De.current[(Gt=ln[zn])==null?void 0:Gt.value],mr&&Je({alignment:be?"start":"end"}),zn})},Ns=()=>{ot(Qe=>{var Gt;const zn=kr(Qe,St=>St+1,St=>St<ln.length-1);return lt.current=De.current[(Gt=ln[zn])==null?void 0:Gt.value],mr&&Je({alignment:be?"end":"start"}),zn})},$s=()=>window.setTimeout(()=>{var Qe;lt.current=De.current[(Qe=ln[Mo])==null?void 0:Qe.value],Je({alignment:be?"end":"start"})},50);Uo(()=>{mr&&$s()},[mr]);const wa=Qe=>{switch(typeof h=="function"&&h(Qe),Qe.key){case"ArrowUp":{Qe.preventDefault(),$e?be?hr():Ns():(ot(Mo),Le(!0),$s());break}case"ArrowDown":{Qe.preventDefault(),$e?be?Ns():hr():(ot(Mo),Le(!0),$s());break}case"Home":{if(!I){Qe.preventDefault(),$e||Le(!0);const Gt=ln.findIndex(zn=>!zn.disabled);ot(Gt),mr&&Je({alignment:be?"end":"start"})}break}case"End":{if(!I){Qe.preventDefault(),$e||Le(!0);const Gt=ln.map(zn=>!!zn.disabled).lastIndexOf(!1);ot(Gt),mr&&Je({alignment:be?"end":"start"})}break}case"Escape":{Qe.preventDefault(),Le(!1),ot(-1);break}case" ":{I||(Qe.preventDefault(),ln[Ze]&&$e?gn(ln[Ze]):(Le(!0),ot(Mo),$s()));break}case"Enter":I||Qe.preventDefault(),ln[Ze]&&$e&&(Qe.preventDefault(),gn(ln[Ze]))}},Sa=Qe=>{typeof g=="function"&&g(Qe);const Gt=ze.find(zn=>zn.value===Ge);$&&ln[Ze]&&$e&&gn(ln[Ze]),Ln((Gt==null?void 0:Gt.label)||""),Le(!1)},ml=Qe=>{typeof x=="function"&&x(Qe),I&&Le(!0)},ka=Qe=>{Ce||(Ln(Qe.currentTarget.value),M&&Qe.currentTarget.value===""&&pt(null),ot(-1),Le(!0))},hl=()=>{Ce||(Le(!$e),Ge&&!$e&&ot(Mo))};return H.createElement(_c.Wrapper,Ov(ju({},o),{__staticSelector:"Select"}),H.createElement(Ka,{opened:mr,transitionProps:y,shadow:s,withinPortal:se,portalProps:ae,__staticSelector:"Select",onDirectionChange:bt,switchDirectionOnFlip:re,zIndex:G,dropdownPosition:ee,positionDependencies:[...ge,At],classNames:S,styles:j,unstyled:w,variant:r.variant},H.createElement(Ka.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":mr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":mr,onMouseLeave:()=>ot(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:K,value:Ge||"",form:de,disabled:A}),H.createElement(_c,ju(Ov(ju(ju({autoComplete:"off",type:"search"},r),Oe),{ref:Bd(t,ye),onKeyDown:wa,__staticSelector:"Select",value:At,placeholder:J,onChange:ka,"aria-autocomplete":"list","aria-controls":mr?`${r.id}-items`:null,"aria-activedescendant":Ze>=0?`${r.id}-${Ze}`:null,onMouseDown:hl,onBlur:Sa,onFocus:ml,readOnly:!I||Ce,disabled:A,"data-mantine-stop-propagation":mr,name:null,classNames:Ov(ju({},S),{input:Ne({[_e.input]:!I},S==null?void 0:S.input)})}),VE({theme:nt,rightSection:X,rightSectionWidth:B,styles:j,size:r.size,shouldClear:M&&!!Dt,onClear:kn,error:o.error,clearButtonProps:he,disabled:A,readOnly:Ce}))))),H.createElement(Ka.Dropdown,{component:F||og,maxHeight:E,direction:ut,id:r.id,innerRef:ft,__staticSelector:"Select",classNames:S,styles:j},H.createElement(ry,{data:ln,hovered:Ze,classNames:S,styles:j,isItemSelected:Qe=>Qe===Ge,uuid:r.id,__staticSelector:"Select",onItemHover:ot,onItemSelect:gn,itemsRefs:De,itemComponent:m,size:r.size,nothingFound:R,creatable:Ut&&!!ke,createLabel:ke,"aria-label":o.label,unstyled:w,variant:r.variant}))))});my.displayName="@mantine/core/Select";const Wd=()=>{const[e,t,n,r,o,s,i,l,u,p,m,h,g,x,y,b,w,S,j,_,E,I,M,R,D,A,O,T,X,B,V,U,N,$,q,F,Q,Y,se,ae,re,G,K,ee,ce,J,ie,de,ge,Ce,he,fe,Oe,_e,Ne,nt,$e,Pt,Ze,ot,ye,De,ut,bt,be,Je,lt,ft,Me,Le,Ut,ke,Be,ze,Ge,pt]=Ho("colors",["base.50","base.100","base.150","base.200","base.250","base.300","base.350","base.400","base.450","base.500","base.550","base.600","base.650","base.700","base.750","base.800","base.850","base.900","base.950","accent.50","accent.100","accent.150","accent.200","accent.250","accent.300","accent.350","accent.400","accent.450","accent.500","accent.550","accent.600","accent.650","accent.700","accent.750","accent.800","accent.850","accent.900","accent.950","baseAlpha.50","baseAlpha.100","baseAlpha.150","baseAlpha.200","baseAlpha.250","baseAlpha.300","baseAlpha.350","baseAlpha.400","baseAlpha.450","baseAlpha.500","baseAlpha.550","baseAlpha.600","baseAlpha.650","baseAlpha.700","baseAlpha.750","baseAlpha.800","baseAlpha.850","baseAlpha.900","baseAlpha.950","accentAlpha.50","accentAlpha.100","accentAlpha.150","accentAlpha.200","accentAlpha.250","accentAlpha.300","accentAlpha.350","accentAlpha.400","accentAlpha.450","accentAlpha.500","accentAlpha.550","accentAlpha.600","accentAlpha.650","accentAlpha.700","accentAlpha.750","accentAlpha.800","accentAlpha.850","accentAlpha.900","accentAlpha.950"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:i,base400:l,base450:u,base500:p,base550:m,base600:h,base650:g,base700:x,base750:y,base800:b,base850:w,base900:S,base950:j,accent50:_,accent100:E,accent150:I,accent200:M,accent250:R,accent300:D,accent350:A,accent400:O,accent450:T,accent500:X,accent550:B,accent600:V,accent650:U,accent700:N,accent750:$,accent800:q,accent850:F,accent900:Q,accent950:Y,baseAlpha50:se,baseAlpha100:ae,baseAlpha150:re,baseAlpha200:G,baseAlpha250:K,baseAlpha300:ee,baseAlpha350:ce,baseAlpha400:J,baseAlpha450:ie,baseAlpha500:de,baseAlpha550:ge,baseAlpha600:Ce,baseAlpha650:he,baseAlpha700:fe,baseAlpha750:Oe,baseAlpha800:_e,baseAlpha850:Ne,baseAlpha900:nt,baseAlpha950:$e,accentAlpha50:Pt,accentAlpha100:Ze,accentAlpha150:ot,accentAlpha200:ye,accentAlpha250:De,accentAlpha300:ut,accentAlpha350:bt,accentAlpha400:be,accentAlpha450:Je,accentAlpha500:lt,accentAlpha550:ft,accentAlpha600:Me,accentAlpha650:Le,accentAlpha700:Ut,accentAlpha750:ke,accentAlpha800:Be,accentAlpha850:ze,accentAlpha900:Ge,accentAlpha950:pt}},Ae=(e,t)=>n=>n==="light"?e:t,ZE=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=Wd(),{colorMode:b}=ha(),[w]=Ho("shadows",["dark-lg"]),[S,j,_]=Ho("space",[1,2,6]),[E]=Ho("radii",["base"]),[I]=Ho("lineHeights",["base"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},input:{border:"unset",backgroundColor:Ae(e,p)(b),borderRadius:E,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),minHeight:"unset",lineHeight:I,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:j,paddingInlineEnd:_,paddingTop:S,paddingBottom:S,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(t,p)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:w},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,i)(b),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,i,l,u,p,w,b,I,E,S,j,_])},JE=je((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,onChange:s,label:i,disabled:l,...u}=e,p=te(),[m,h]=d.useState(""),g=d.useCallback(w=>{w.shiftKey&&p(Nr(!0))},[p]),x=d.useCallback(w=>{w.shiftKey||p(Nr(!1))},[p]),y=d.useCallback(w=>{s&&s(w)},[s]),b=ZE();return a.jsx(Ft,{label:r,placement:"top",hasArrow:!0,children:a.jsxs(Kt,{ref:t,isDisabled:l,position:"static","data-testid":`select-${i||e.placeholder}`,children:[i&&a.jsx(wn,{children:i}),a.jsx(my,{ref:o,disabled:l,searchValue:m,onSearchChange:h,onChange:y,onKeyDown:g,onKeyUp:x,searchable:n,maxDropdownHeight:300,styles:b,...u})]})})});JE.displayName="IAIMantineSearchableSelect";const nn=d.memo(JE),pJ=le([xe],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},Se),mJ=()=>{const e=te(),[t,n]=d.useState(),{data:r,isFetching:o}=yd(),{imagesToChange:s,isModalOpen:i}=W(pJ),[l]=YR(),[u]=ZR(),{t:p}=Z(),m=d.useMemo(()=>{const y=[{label:p("boards.uncategorized"),value:"none"}];return(r??[]).forEach(b=>y.push({label:b.board_name,value:b.board_id})),y},[r,p]),h=d.useCallback(()=>{e(nw()),e(Bx(!1))},[e]),g=d.useCallback(()=>{!s.length||!t||(t==="none"?u({imageDTOs:s}):l({imageDTOs:s,board_id:t}),n(null),e(nw()))},[l,e,s,u,t]),x=d.useRef(null);return a.jsx(Td,{isOpen:i,onClose:h,leastDestructiveRef:x,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:p("boards.changeBoard")}),a.jsx(Zo,{children:a.jsxs(L,{sx:{flexDir:"column",gap:4},children:[a.jsxs(ve,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(nn,{placeholder:p(o?"boards.loading":"boards.selectBoard"),disabled:o,onChange:y=>n(y),value:t,data:m})]})}),a.jsxs(Ss,{children:[a.jsx(at,{ref:x,onClick:h,children:p("boards.cancel")}),a.jsx(at,{colorScheme:"accent",onClick:g,ml:3,children:p("boards.move")})]})]})})})},hJ=d.memo(mJ),eM=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,helperText:l,...u}=e;return a.jsx(Ft,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsx(Kt,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs(L,{sx:{flexDir:"column",w:"full"},children:[a.jsxs(L,{sx:{alignItems:"center",w:"full"},children:[t&&a.jsx(wn,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(Qb,{...u})]}),l&&a.jsx(c5,{children:a.jsx(ve,{variant:"subtext",children:l})})]})})})};eM.displayName="IAISwitch";const fn=d.memo(eM),gJ=e=>{const{t}=Z(),{imageUsage:n,topMessage:r=t("gallery.currentlyInUse"),bottomMessage:o=t("gallery.featuresWillReset")}=e;return!n||!Xr(n)?null:a.jsxs(a.Fragment,{children:[a.jsx(ve,{children:r}),a.jsxs(Od,{sx:{paddingInlineStart:6},children:[n.isInitialImage&&a.jsx(Qr,{children:t("common.img2img")}),n.isCanvasImage&&a.jsx(Qr,{children:t("common.unifiedCanvas")}),n.isControlNetImage&&a.jsx(Qr,{children:t("common.controlNet")}),n.isIPAdapterImage&&a.jsx(Qr,{children:t("common.ipAdapter")}),n.isNodesImage&&a.jsx(Qr,{children:t("common.nodeEditor")})]}),a.jsx(ve,{children:o})]})},tM=d.memo(gJ),vJ=le([xe,JR],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:i}=r,{imagesToDelete:l,isModalOpen:u}=o,p=(l??[]).map(({image_name:h})=>oI(e,h)),m={isInitialImage:Xr(p,h=>h.isInitialImage),isCanvasImage:Xr(p,h=>h.isCanvasImage),isNodesImage:Xr(p,h=>h.isNodesImage),isControlNetImage:Xr(p,h=>h.isControlNetImage),isIPAdapterImage:Xr(p,h=>h.isIPAdapterImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:i,imagesToDelete:l,imagesUsage:t,isModalOpen:u,imageUsageSummary:m}},Se),xJ=()=>{const e=te(),{t}=Z(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:i,imageUsageSummary:l}=W(vJ),u=d.useCallback(g=>e(sI(!g.target.checked)),[e]),p=d.useCallback(()=>{e(rw()),e(eD(!1))},[e]),m=d.useCallback(()=>{!o.length||!s.length||(e(rw()),e(tD({imageDTOs:o,imagesUsage:s})))},[e,o,s]),h=d.useRef(null);return a.jsx(Td,{isOpen:i,onClose:p,leastDestructiveRef:h,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Zo,{children:a.jsxs(L,{direction:"column",gap:3,children:[a.jsx(tM,{imageUsage:l}),a.jsx(Yn,{}),a.jsx(ve,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(ve,{children:t("common.areYouSure")}),a.jsx(fn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:u})]})}),a.jsxs(Ss,{children:[a.jsx(at,{ref:h,onClick:p,children:"Cancel"}),a.jsx(at,{colorScheme:"error",onClick:m,ml:3,children:"Delete"})]})]})})})},bJ=d.memo(xJ),nM=je((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...i}=e;return a.jsx(Ft,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(ys,{ref:t,role:n,colorScheme:s?"accent":"base","data-testid":r,...i})})});nM.displayName="IAIIconButton";const Fe=d.memo(nM);var rM={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},qk=H.createContext&&H.createContext(rM),qa=globalThis&&globalThis.__assign||function(){return qa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},qa.apply(this,arguments)},yJ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function oM(e){return e&&e.map(function(t,n){return H.createElement(t.tag,qa({key:n},t.attr),oM(t.child))})}function Te(e){return function(t){return H.createElement(CJ,qa({attr:qa({},e.attr)},t),oM(e.child))}}function CJ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,i=yJ(e,["attr","size","title"]),l=o||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),H.createElement("svg",qa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,i,{className:u,style:qa(qa({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return qk!==void 0?H.createElement(qk.Consumer,null,function(n){return t(n)}):t(rM)}function wJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function SJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function kJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"}}]})(e)}function jJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function _J(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function IJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function PJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function EJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function sM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function MJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}}]})(e)}function OJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function aM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function RJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"}}]})(e)}function iM(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function lM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"}}]})(e)}function Hc(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function DJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function AJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function ig(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function TJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"}}]})(e)}function NJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function $J(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}}]})(e)}function LJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z"}}]})(e)}function cM(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function hy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"}}]})(e)}function zJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function FJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function BJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function HJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function uM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"}}]})(e)}function VJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"}}]})(e)}function WJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M360 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24zm-75.078 384H99.08c17.059-46.797 52.096-80 92.92-80 40.821 0 75.862 33.196 92.922 80zm.019-256H99.078C91.988 108.548 88 86.748 88 64h208c0 22.805-3.987 44.587-11.059 64z"}}]})(e)}function Yi(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function UJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"}}]})(e)}function dM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function GJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function KJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function fM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"}}]})(e)}function pM(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"}}]})(e)}function qJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"}}]})(e)}function mM(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function XJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function QJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function YJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}}]})(e)}function ZJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function Vc(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function hM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function JJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504.971 359.029c9.373 9.373 9.373 24.569 0 33.941l-80 79.984c-15.01 15.01-40.971 4.49-40.971-16.971V416h-58.785a12.004 12.004 0 0 1-8.773-3.812l-70.556-75.596 53.333-57.143L352 336h32v-39.981c0-21.438 25.943-31.998 40.971-16.971l80 79.981zM12 176h84l52.781 56.551 53.333-57.143-70.556-75.596A11.999 11.999 0 0 0 122.785 96H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12zm372 0v39.984c0 21.46 25.961 31.98 40.971 16.971l80-79.984c9.373-9.373 9.373-24.569 0-33.941l-80-79.981C409.943 24.021 384 34.582 384 56.019V96h-58.785a12.004 12.004 0 0 0-8.773 3.812L96 336H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h110.785c3.326 0 6.503-1.381 8.773-3.812L352 176h32z"}}]})(e)}function eee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function tee(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z"}}]})(e)}function lg(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function nee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function gM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function ree(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"}}]})(e)}function Xk(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function vM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function oee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M16 128h416c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16H16C7.16 32 0 39.16 0 48v64c0 8.84 7.16 16 16 16zm480 80H80c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16zm-64 176H16c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16z"}}]})(e)}function see(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"}}]})(e)}function xM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"}}]})(e)}function Ic(e){return Te({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function Br(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function Ud(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function cg(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function aee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function bM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const Ht=e=>{const t=W(i=>i.config.disabledTabs),n=W(i=>i.config.disabledFeatures),r=W(i=>i.config.disabledSDFeatures),o=d.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=d.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};function iee(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(Ja,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(Ja,{children:[a.jsx(ve,{fontWeight:600,children:t}),r&&a.jsx(ve,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function lee({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Lr(),{t:o}=Z(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"),desc:o("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys.focusPrompt.title"),desc:o("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys.toggleOptions.title"),desc:o("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys.toggleGallery.title"),desc:o("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys.maximizeWorkSpace.title"),desc:o("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys.changeTabs.title"),desc:o("hotkeys.changeTabs.desc"),hotkey:"1-5"}],i=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.upscale.title"),desc:o("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys.showInfo.title"),desc:o("hotkeys.showInfo.desc"),hotkey:"I"},{title:o("hotkeys.sendToImageToImage.title"),desc:o("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys.deleteImage.title"),desc:o("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys.closePanels.title"),desc:o("hotkeys.closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys.previousImage.title"),desc:o("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextImage.title"),desc:o("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.increaseGalleryThumbSize.title"),desc:o("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys.decreaseGalleryThumbSize.title"),desc:o("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],u=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],p=[{title:o("hotkeys.addNodes.title"),desc:o("hotkeys.addNodes.desc"),hotkey:"Shift + A / Space"}],m=h=>a.jsx(L,{flexDir:"column",gap:4,children:h.map((g,x)=>a.jsxs(L,{flexDir:"column",px:2,gap:4,children:[a.jsx(iee,{title:g.title,description:g.desc,hotkey:g.hotkey}),x<h.length-1&&a.jsx(Yn,{})]},x))});return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:n}),a.jsxs(qi,{isOpen:t,onClose:r,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{children:o("hotkeys.keyboardShortcuts")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsx(i5,{allowMultiple:!0,children:a.jsxs(L,{flexDir:"column",gap:2,children:[a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(s)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(i)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(l)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(u)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(p)})]})]})})}),a.jsx(Ss,{})]})]})]})}function Qk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Yk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var cee=function(e,t){return typeof t=="boolean"?t:!e},uee=function(e){return d.useReducer(cee,e)};const dee=uee;function fee(e,t){t===void 0&&(t=0);var n=d.useRef(!1),r=d.useRef(),o=d.useRef(e),s=d.useCallback(function(){return n.current},[]),i=d.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),l=d.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){return i(),l},[t]),[s,l,i]}function pee(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=fee(e,t),o=r[0],s=r[1],i=r[2];return d.useEffect(i,n),[o,s]}var mee=function(e,t){t===void 0&&(t=!0);var n=d.useState(!1),r=n[0],o=n[1];return d.useEffect(function(){var s=function(){return o(!0)},i=function(){return o(!1)};t&&e&&e.current&&(Qk(e.current,"mouseover",s),Qk(e.current,"mouseout",i));var l=e.current;return function(){t&&l&&(Yk(l,"mouseover",s),Yk(l,"mouseout",i))}},[t,e]),r};const yM=mee,hee=({showVersion:e=!0})=>{const{data:t}=nD(),n=d.useRef(null),r=yM(n);return a.jsxs(L,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(ga,{src:Hx,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs(L,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(ve,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(dr,{children:e&&r&&t&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(ve,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},gee=d.memo(hee),CM=je((e,t)=>{const{tooltip:n,inputRef:r,label:o,disabled:s,required:i,...l}=e,u=ZE();return a.jsx(Ft,{label:n,placement:"top",hasArrow:!0,children:a.jsxs(Kt,{ref:t,isRequired:i,isDisabled:s,position:"static","data-testid":`select-${o||e.placeholder}`,children:[a.jsx(wn,{children:o}),a.jsx(my,{disabled:s,ref:r,styles:u,...l})]})})});CM.displayName="IAIMantineSelect";const Pn=d.memo(CM),vee={ar:yt.t("common.langArabic",{lng:"ar"}),nl:yt.t("common.langDutch",{lng:"nl"}),en:yt.t("common.langEnglish",{lng:"en"}),fr:yt.t("common.langFrench",{lng:"fr"}),de:yt.t("common.langGerman",{lng:"de"}),he:yt.t("common.langHebrew",{lng:"he"}),it:yt.t("common.langItalian",{lng:"it"}),ja:yt.t("common.langJapanese",{lng:"ja"}),ko:yt.t("common.langKorean",{lng:"ko"}),pl:yt.t("common.langPolish",{lng:"pl"}),pt_BR:yt.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:yt.t("common.langPortuguese",{lng:"pt"}),ru:yt.t("common.langRussian",{lng:"ru"}),zh_CN:yt.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:yt.t("common.langSpanish",{lng:"es"}),uk:yt.t("common.langUkranian",{lng:"ua"})},xee={CONNECTED:"common.statusConnected",DISCONNECTED:"common.statusDisconnected",PROCESSING:"common.statusProcessing",ERROR:"common.statusError",LOADING_MODEL:"common.statusLoadingModel"},wM=le(xe,({system:e})=>e.language,Se);function Lo(e){const{t}=Z(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:i,...l}=e;return a.jsxs(L,{justifyContent:"space-between",py:1,children:[a.jsxs(L,{gap:2,alignItems:"center",children:[a.jsx(ve,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(Ds,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...i,children:s})]}),a.jsx(fn,{...l})]})}const bee=e=>a.jsx(L,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),Gl=d.memo(bee);function yee(){const e=te(),{data:t,refetch:n}=rD(),[r,{isLoading:o}]=oD(),s=d.useCallback(()=>{r().unwrap().then(l=>{e(aI()),e(iI()),e(ct({title:`Cleared ${l} intermediates`,status:"info"}))})},[r,e]);d.useEffect(()=>{n()},[n]);const i=t?`Clear ${t} Intermediate${t>1?"s":""}`:"No Intermediates to Clear";return a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:"Clear Intermediates"}),a.jsx(at,{colorScheme:"warning",onClick:s,isLoading:o,isDisabled:!t,children:i}),a.jsx(ve,{fontWeight:"bold",children:"Clearing intermediates will reset your Canvas and ControlNet state."}),a.jsx(ve,{variant:"subtext",children:"Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space."}),a.jsx(ve,{variant:"subtext",children:"Your gallery images will not be deleted."})]})}const Cee=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=Wd(),{colorMode:b}=ha(),[w]=Ho("shadows",["dark-lg"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},searchInput:{":placeholder":{color:Ae(r,l)(b)}},input:{backgroundColor:Ae(e,p)(b),borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,u)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:w},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,i)(b),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,i,l,u,p,w,b])},SM=je((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,label:s,disabled:i,...l}=e,u=te(),p=d.useCallback(g=>{g.shiftKey&&u(Nr(!0))},[u]),m=d.useCallback(g=>{g.shiftKey||u(Nr(!1))},[u]),h=Cee();return a.jsx(Ft,{label:r,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsxs(Kt,{ref:t,isDisabled:i,position:"static",children:[s&&a.jsx(wn,{children:s}),a.jsx(GE,{ref:o,disabled:i,onKeyDown:p,onKeyUp:m,searchable:n,maxDropdownHeight:300,styles:h,...l})]})})});SM.displayName="IAIMantineMultiSelect";const wee=d.memo(SM),See=nr(mh,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function kee(){const e=te(),{t}=Z(),n=W(o=>o.ui.favoriteSchedulers),r=d.useCallback(o=>{e(sD(o))},[e]);return a.jsx(wee,{label:t("settings.favoriteSchedulers"),value:n,data:See,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const jee=le([xe],({system:e,ui:t})=>{const{shouldConfirmOnDelete:n,enableImageDebugging:r,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:i,shouldUseNSFWChecker:l,shouldUseWatermarker:u,shouldEnableInformationalPopovers:p}=e,{shouldUseSliders:m,shouldShowProgressInViewer:h,shouldAutoChangeDimensions:g}=t;return{shouldConfirmOnDelete:n,enableImageDebugging:r,shouldUseSliders:m,shouldShowProgressInViewer:h,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:i,shouldUseNSFWChecker:l,shouldUseWatermarker:u,shouldAutoChangeDimensions:g,shouldEnableInformationalPopovers:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),_ee=({children:e,config:t})=>{const n=te(),{t:r}=Z(),[o,s]=d.useState(3),i=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,l=(t==null?void 0:t.shouldShowResetWebUiText)??!0,u=(t==null?void 0:t.shouldShowClearIntermediates)??!0,p=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;d.useEffect(()=>{i||n(ow(!1))},[i,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:h}=lI(void 0,{selectFromResult:({data:Y})=>({isNSFWCheckerAvailable:(Y==null?void 0:Y.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Y==null?void 0:Y.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:g,onOpen:x,onClose:y}=Lr(),{isOpen:b,onOpen:w,onClose:S}=Lr(),{shouldConfirmOnDelete:j,enableImageDebugging:_,shouldUseSliders:E,shouldShowProgressInViewer:I,consoleLogLevel:M,shouldLogToConsole:R,shouldAntialiasProgressImage:D,shouldUseNSFWChecker:A,shouldUseWatermarker:O,shouldAutoChangeDimensions:T,shouldEnableInformationalPopovers:X}=W(jee),B=d.useCallback(()=>{Object.keys(window.localStorage).forEach(Y=>{(aD.includes(Y)||Y.startsWith(iD))&&localStorage.removeItem(Y)}),y(),w(),setInterval(()=>s(Y=>Y-1),1e3)},[y,w]);d.useEffect(()=>{o<=0&&window.location.reload()},[o]);const V=d.useCallback(Y=>{n(lD(Y))},[n]),U=d.useCallback(Y=>{n(cD(Y))},[n]),N=d.useCallback(Y=>{n(ow(Y.target.checked))},[n]),{colorMode:$,toggleColorMode:q}=ha(),F=Ht("localization").isFeatureEnabled,Q=W(wM);return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:x}),a.jsxs(qi,{isOpen:g,onClose:y,size:"2xl",isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{bg:"none",children:r("common.settingsLabel")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsxs(L,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.general")}),a.jsx(Lo,{label:r("settings.confirmOnDelete"),isChecked:j,onChange:Y=>n(sI(Y.target.checked))})]}),a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.generation")}),a.jsx(kee,{}),a.jsx(Lo,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:A,onChange:Y=>n(uD(Y.target.checked))}),a.jsx(Lo,{label:"Enable Invisible Watermark",isDisabled:!h,isChecked:O,onChange:Y=>n(dD(Y.target.checked))})]}),a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.ui")}),a.jsx(Lo,{label:r("common.darkMode"),isChecked:$==="dark",onChange:q}),a.jsx(Lo,{label:r("settings.useSlidersForAll"),isChecked:E,onChange:Y=>n(fD(Y.target.checked))}),a.jsx(Lo,{label:r("settings.showProgressInViewer"),isChecked:I,onChange:Y=>n(cI(Y.target.checked))}),a.jsx(Lo,{label:r("settings.antialiasProgressImages"),isChecked:D,onChange:Y=>n(pD(Y.target.checked))}),a.jsx(Lo,{label:r("settings.autoChangeDimensions"),isChecked:T,onChange:Y=>n(mD(Y.target.checked))}),p&&a.jsx(Pn,{disabled:!F,label:r("common.languagePickerLabel"),value:Q,data:Object.entries(vee).map(([Y,se])=>({value:Y,label:se})),onChange:U}),a.jsx(Lo,{label:"Enable informational popovers",isChecked:X,onChange:Y=>n(hD(Y.target.checked))})]}),i&&a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.developer")}),a.jsx(Lo,{label:r("settings.shouldLogToConsole"),isChecked:R,onChange:N}),a.jsx(Pn,{disabled:!R,label:r("settings.consoleLogLevel"),onChange:V,value:M,data:gD.concat()}),a.jsx(Lo,{label:r("settings.enableImageDebugging"),isChecked:_,onChange:Y=>n(vD(Y.target.checked))})]}),u&&a.jsx(yee,{}),a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(at,{colorScheme:"error",onClick:B,children:r("settings.resetWebUI")}),l&&a.jsxs(a.Fragment,{children:[a.jsx(ve,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(ve,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(Ss,{children:a.jsx(at,{onClick:y,children:r("common.close")})})]})]}),a.jsxs(qi,{closeOnOverlayClick:!1,isOpen:b,onClose:S,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Yo,{backdropFilter:"blur(40px)"}),a.jsxs(Xi,{children:[a.jsx(Qo,{}),a.jsx(Zo,{children:a.jsx(L,{justifyContent:"center",children:a.jsx(ve,{fontSize:"lg",children:a.jsxs(ve,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(Ss,{})]})]})]})},Iee=d.memo(_ee),Pee=le(xe,({system:e})=>{const{isConnected:t,status:n}=e;return{isConnected:t,statusTranslationKey:xee[n]}},Se),Zk={ok:"green.400",working:"yellow.400",error:"red.400"},Jk={ok:"green.600",working:"yellow.500",error:"red.500"},Eee=()=>{const{isConnected:e,statusTranslationKey:t}=W(Pee),{t:n}=Z(),r=d.useRef(null),{data:o}=va(),s=d.useMemo(()=>e?o!=null&&o.queue.in_progress?"working":"ok":"error",[o==null?void 0:o.queue.in_progress,e]),i=yM(r);return a.jsxs(L,{ref:r,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(dr,{children:i&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(ve,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Jk[s],_dark:{color:Zk[s]}},children:n(t)})},"statusText")}),a.jsx(Nn,{as:RJ,sx:{boxSize:"0.5rem",color:Jk[s],_dark:{color:Zk[s]}}})]})},Mee=d.memo(Eee),Oee=()=>{const{t:e}=Z(),t=Ht("bugLink").isFeatureEnabled,n=Ht("discordLink").isFeatureEnabled,r=Ht("githubLink").isFeatureEnabled,o="http://github.com/invoke-ai/InvokeAI",s="https://discord.gg/ZmtBAhwWhy";return a.jsxs(L,{sx:{gap:2,alignItems:"center"},children:[a.jsx(gee,{}),a.jsx(ba,{}),a.jsx(Mee,{}),a.jsxs(Ah,{children:[a.jsx(Th,{as:Fe,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(MJ,{}),sx:{boxSize:8}}),a.jsxs(Gi,{motionProps:vc,children:[a.jsxs(td,{title:e("common.communityLabel"),children:[r&&a.jsx(en,{as:"a",href:o,target:"_blank",icon:a.jsx(SJ,{}),children:e("common.githubLabel")}),t&&a.jsx(en,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(OJ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(en,{as:"a",href:s,target:"_blank",icon:a.jsx(wJ,{}),children:e("common.discordLabel")})]}),a.jsxs(td,{title:e("common.settingsLabel"),children:[a.jsx(lee,{children:a.jsx(en,{as:"button",icon:a.jsx(GJ,{}),children:e("common.hotkeysLabel")})}),a.jsx(Iee,{children:a.jsx(en,{as:"button",icon:a.jsx(lM,{}),children:e("common.settingsLabel")})})]})]})]})]})},Ree=d.memo(Oee);/*!
- * OverlayScrollbars
- * Version: 2.2.1
- *
- * Copyright (c) Rene Haas | KingSora.
- * https://github.com/KingSora
- *
- * Released under the MIT license.
- */function zt(e,t){if(dg(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&zt(Object.keys(e),n=>t(e[n],n,e));return e}function ur(e,t){const n=ci(t);if(ts(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?rj(e,s,t):t.reduce((i,l)=>(i[l]=rj(e,s,l),i),o)}return o}e&&zt(ro(t),o=>qee(e,o,t[o]))}const Fo=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const l=(m,h)=>{const g=s,x=m,y=h||(r?!r(g,x):g!==x);return(y||o)&&(s=x,i=g),[s,y,i]};return[t?m=>l(t(s,i),m):l,m=>[s,!!m,i]]},Gd=()=>typeof window<"u",kM=Gd()&&Node.ELEMENT_NODE,{toString:Dee,hasOwnProperty:Rv}=Object.prototype,Ca=e=>e===void 0,ug=e=>e===null,Aee=e=>Ca(e)||ug(e)?`${e}`:Dee.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Xa=e=>typeof e=="number",ci=e=>typeof e=="string",gy=e=>typeof e=="boolean",es=e=>typeof e=="function",ts=e=>Array.isArray(e),ad=e=>typeof e=="object"&&!ts(e)&&!ug(e),dg=e=>{const t=!!e&&e.length,n=Xa(t)&&t>-1&&t%1==0;return ts(e)||!es(e)&&n?t>0&&ad(e)?t-1 in e:!0:!1},lx=e=>{if(!e||!ad(e)||Aee(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=Rv.call(e,n),i=o&&Rv.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return Ca(t)||Rv.call(e,t)},Zm=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===kM:!1},fg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===kM:!1},vy=(e,t,n)=>e.indexOf(t,n),Xt=(e,t,n)=>(!n&&!ci(t)&&dg(t)?Array.prototype.push.apply(e,t):e.push(t),e),Zi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Xt(n,r)}):zt(e,r=>{Xt(n,r)}),n)},xy=e=>!!e&&e.length===0,As=(e,t,n)=>{zt(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},pg=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ro=e=>e?Object.keys(e):[],Cn=(e,t,n,r,o,s,i)=>{const l=[t,n,r,o,s,i];return(typeof e!="object"||ug(e))&&!es(e)&&(e={}),zt(l,u=>{zt(ro(u),p=>{const m=u[p];if(e===m)return!0;const h=ts(m);if(m&&(lx(m)||h)){const g=e[p];let x=g;h&&!ts(g)?x=[]:!h&&!lx(g)&&(x={}),e[p]=Cn(x,m)}else e[p]=m})}),e},by=e=>{for(const t in e)return!1;return!0},jM=(e,t,n,r)=>{if(Ca(r))return n?n[e]:t;n&&(ci(r)||Xa(r))&&(n[e]=r)},lr=(e,t,n)=>{if(Ca(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Mr=(e,t)=>{e&&e.removeAttribute(t)},$i=(e,t,n,r)=>{if(n){const o=lr(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Zi(s).join(" ").trim();lr(e,t,i)}},Tee=(e,t,n)=>{const r=lr(e,t)||"";return new Set(r.split(" ")).has(n)},Ko=(e,t)=>jM("scrollLeft",0,e,t),na=(e,t)=>jM("scrollTop",0,e,t),cx=Gd()&&Element.prototype,_M=(e,t)=>{const n=[],r=t?fg(t)?t:null:document;return r?Xt(n,r.querySelectorAll(e)):n},Nee=(e,t)=>{const n=t?fg(t)?t:null:document;return n?n.querySelector(e):null},Jm=(e,t)=>fg(e)?(cx.matches||cx.msMatchesSelector).call(e,t):!1,yy=e=>e?Zi(e.childNodes):[],la=e=>e?e.parentElement:null,Jl=(e,t)=>{if(fg(e)){const n=cx.closest;if(n)return n.call(e,t);do{if(Jm(e,t))return e;e=la(e)}while(e)}return null},$ee=(e,t,n)=>{const r=e&&Jl(e,t),o=e&&Nee(n,r),s=Jl(o,t)===r;return r&&o?r===e||o===e||s&&Jl(Jl(e,n),t)!==r:!1},Cy=(e,t,n)=>{if(n&&e){let r=t,o;dg(n)?(o=document.createDocumentFragment(),zt(n,s=>{s===r&&(r=s.previousSibling),o.appendChild(s)})):o=n,t&&(r?r!==t&&(r=r.nextSibling):r=e.firstChild),e.insertBefore(o,r||null)}},xo=(e,t)=>{Cy(e,null,t)},Lee=(e,t)=>{Cy(la(e),e,t)},ej=(e,t)=>{Cy(la(e),e&&e.nextSibling,t)},js=e=>{if(dg(e))zt(Zi(e),t=>js(t));else if(e){const t=la(e);t&&t.removeChild(e)}},Li=e=>{const t=document.createElement("div");return e&&lr(t,"class",e),t},IM=e=>{const t=Li();return t.innerHTML=e.trim(),zt(yy(t),n=>js(n))},ux=e=>e.charAt(0).toUpperCase()+e.slice(1),zee=()=>Li().style,Fee=["-webkit-","-moz-","-o-","-ms-"],Bee=["WebKit","Moz","O","MS","webkit","moz","o","ms"],Dv={},Av={},Hee=e=>{let t=Av[e];if(pg(Av,e))return t;const n=ux(e),r=zee();return zt(Fee,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,ux(s)+n].find(l=>r[l]!==void 0))}),Av[e]=t||""},Kd=e=>{if(Gd()){let t=Dv[e]||window[e];return pg(Dv,e)||(zt(Bee,n=>(t=t||window[n+ux(e)],!t)),Dv[e]=t),t}},Vee=Kd("MutationObserver"),tj=Kd("IntersectionObserver"),ec=Kd("ResizeObserver"),PM=Kd("cancelAnimationFrame"),EM=Kd("requestAnimationFrame"),eh=Gd()&&window.setTimeout,dx=Gd()&&window.clearTimeout,Wee=/[^\x20\t\r\n\f]+/g,MM=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&ci(t)){const l=t.match(Wee)||[];for(i=l.length>0;o=l[s++];)i=!!n(r,o)&&i}return i},wy=(e,t)=>{MM(e,t,(n,r)=>n.remove(r))},ra=(e,t)=>(MM(e,t,(n,r)=>n.add(r)),wy.bind(0,e,t)),mg=(e,t,n,r)=>{if(e&&t){let o=!0;return zt(n,s=>{const i=r?r(e[s]):e[s],l=r?r(t[s]):t[s];i!==l&&(o=!1)}),o}return!1},OM=(e,t)=>mg(e,t,["w","h"]),RM=(e,t)=>mg(e,t,["x","y"]),Uee=(e,t)=>mg(e,t,["t","r","b","l"]),nj=(e,t,n)=>mg(e,t,["width","height"],n&&(r=>Math.round(r))),go=()=>{},Kl=e=>{let t;const n=e?eh:EM,r=e?dx:PM;return[o=>{r(t),t=n(o,es(e)?e():e)},()=>r(t)]},Sy=(e,t)=>{let n,r,o,s=go;const{v:i,g:l,p:u}=t||{},p=function(y){s(),dx(n),n=r=void 0,s=go,e.apply(this,y)},m=x=>u&&r?u(r,x):x,h=()=>{s!==go&&p(m(o)||o)},g=function(){const y=Zi(arguments),b=es(i)?i():i;if(Xa(b)&&b>=0){const S=es(l)?l():l,j=Xa(S)&&S>=0,_=b>0?eh:EM,E=b>0?dx:PM,M=m(y)||y,R=p.bind(0,M);s();const D=_(R,b);s=()=>E(D),j&&!n&&(n=eh(h,S)),r=o=M}else p(y)};return g.m=h,g},Gee={opacity:1,zindex:1},yp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},Kee=(e,t)=>!Gee[e.toLowerCase()]&&Xa(t)?`${t}px`:t,rj=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],qee=(e,t,n)=>{try{const{style:r}=e;Ca(r[t])?r.setProperty(t,n):r[t]=Kee(t,n)}catch{}},id=e=>ur(e,"direction")==="rtl",oj=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,l=`${r}bottom${o}`,u=`${r}left${o}`,p=ur(e,[s,i,l,u]);return{t:yp(p[s],!0),r:yp(p[i],!0),b:yp(p[l],!0),l:yp(p[u],!0)}},{round:sj}=Math,ky={w:0,h:0},ld=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:ky,Wp=e=>e?{w:e.clientWidth,h:e.clientHeight}:ky,th=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:ky,nh=e=>{const t=parseFloat(ur(e,"height"))||0,n=parseFloat(ur(e,"width"))||0;return{w:n-sj(n),h:t-sj(t)}},xs=e=>e.getBoundingClientRect();let Cp;const Xee=()=>{if(Ca(Cp)){Cp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){Cp=!0}}))}catch{}}return Cp},DM=e=>e.split(" "),Qee=(e,t,n,r)=>{zt(DM(t),o=>{e.removeEventListener(o,n,r)})},Wn=(e,t,n,r)=>{var o;const s=Xee(),i=(o=s&&r&&r.S)!=null?o:s,l=r&&r.$||!1,u=r&&r.C||!1,p=[],m=s?{passive:i,capture:l}:l;return zt(DM(t),h=>{const g=u?x=>{e.removeEventListener(h,g,l),n&&n(x)}:n;Xt(p,Qee.bind(null,e,h,g,l)),e.addEventListener(h,g,m)}),As.bind(0,p)},AM=e=>e.stopPropagation(),TM=e=>e.preventDefault(),Yee={x:0,y:0},Tv=e=>{const t=e?xs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:Yee},aj=(e,t)=>{zt(ts(t)?t:[t],e)},jy=e=>{const t=new Map,n=(s,i)=>{if(s){const l=t.get(s);aj(u=>{l&&l[u?"delete":"clear"](u)},i)}else t.forEach(l=>{l.clear()}),t.clear()},r=(s,i)=>{if(ci(s)){const p=t.get(s)||new Set;return t.set(s,p),aj(m=>{es(m)&&p.add(m)},i),n.bind(0,s,i)}gy(i)&&i&&n();const l=ro(s),u=[];return zt(l,p=>{const m=s[p];m&&Xt(u,r(p,m))}),As.bind(0,u)},o=(s,i)=>{const l=t.get(s);zt(Zi(l),u=>{i&&!xy(i)?u.apply(0,i):u()})};return r(e||{}),[r,n,o]},ij=e=>JSON.stringify(e,(t,n)=>{if(es(n))throw new Error;return n}),Zee={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},NM=(e,t)=>{const n={},r=ro(t).concat(ro(e));return zt(r,o=>{const s=e[o],i=t[o];if(ad(s)&&ad(i))Cn(n[o]={},NM(s,i)),by(n[o])&&delete n[o];else if(pg(t,o)&&i!==s){let l=!0;if(ts(s)||ts(i))try{ij(s)===ij(i)&&(l=!1)}catch{}l&&(n[o]=i)}}),n},$M="os-environment",LM=`${$M}-flexbox-glue`,Jee=`${LM}-max`,zM="os-scrollbar-hidden",Nv="data-overlayscrollbars-initialize",Bo="data-overlayscrollbars",FM=`${Bo}-overflow-x`,BM=`${Bo}-overflow-y`,mc="overflowVisible",ete="scrollbarHidden",lj="scrollbarPressed",rh="updating",Fa="data-overlayscrollbars-viewport",$v="arrange",HM="scrollbarHidden",hc=mc,fx="data-overlayscrollbars-padding",tte=hc,cj="data-overlayscrollbars-content",_y="os-size-observer",nte=`${_y}-appear`,rte=`${_y}-listener`,ote="os-trinsic-observer",ste="os-no-css-vars",ate="os-theme-none",Hr="os-scrollbar",ite=`${Hr}-rtl`,lte=`${Hr}-horizontal`,cte=`${Hr}-vertical`,VM=`${Hr}-track`,Iy=`${Hr}-handle`,ute=`${Hr}-visible`,dte=`${Hr}-cornerless`,uj=`${Hr}-transitionless`,dj=`${Hr}-interaction`,fj=`${Hr}-unusable`,pj=`${Hr}-auto-hidden`,mj=`${Hr}-wheel`,fte=`${VM}-interactive`,pte=`${Iy}-interactive`,WM={},Ji=()=>WM,mte=e=>{const t=[];return zt(ts(e)?e:[e],n=>{const r=ro(n);zt(r,o=>{Xt(t,WM[o]=n[o])})}),t},hte="__osOptionsValidationPlugin",gte="__osSizeObserverPlugin",Py="__osScrollbarsHidingPlugin",vte="__osClickScrollPlugin";let Lv;const hj=(e,t,n,r)=>{xo(e,t);const o=Wp(t),s=ld(t),i=nh(n);return r&&js(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},xte=e=>{let t=!1;const n=ra(e,zM);try{t=ur(e,Hee("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},bte=(e,t)=>{const n="hidden";ur(e,{overflowX:n,overflowY:n,direction:"rtl"}),Ko(e,0);const r=Tv(e),o=Tv(t);Ko(e,-999);const s=Tv(t);return{i:r.x===o.x,n:o.x!==s.x}},yte=(e,t)=>{const n=ra(e,LM),r=xs(e),o=xs(t),s=nj(o,r,!0),i=ra(e,Jee),l=xs(e),u=xs(t),p=nj(u,l,!0);return n(),i(),s&&p},Cte=()=>{const{body:e}=document,n=IM(`<div class="${$M}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=jy(),[i,l]=Fo({o:hj(e,n,r),u:RM},hj.bind(0,e,n,r,!0)),[u]=l(),p=xte(n),m={x:u.x===0,y:u.y===0},h={elements:{host:null,padding:!p,viewport:j=>p&&j===j.ownerDocument.body&&j,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},g=Cn({},Zee),x=Cn.bind(0,{},g),y=Cn.bind(0,{},h),b={k:u,A:m,I:p,L:ur(n,"zIndex")==="-1",B:bte(n,r),V:yte(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:j=>Cn(h,j)&&y(),F:x,G:j=>Cn(g,j)&&x(),X:Cn({},h),U:Cn({},g)},w=window.addEventListener,S=Sy(j=>s(j?"z":"r"),{v:33,g:99});if(Mr(n,"style"),js(n),w("resize",S.bind(0,!1)),!p&&(!m.x||!m.y)){let j;w("resize",()=>{const _=Ji()[Py];j=j||_&&_.R(),j&&j(b,i,S.bind(0,!0))})}return b},Vr=()=>(Lv||(Lv=Cte()),Lv),Ey=(e,t)=>es(t)?t.apply(0,e):t,wte=(e,t,n,r)=>{const o=Ca(r)?n:r;return Ey(e,o)||t.apply(0,e)},UM=(e,t,n,r)=>{const o=Ca(r)?n:r,s=Ey(e,o);return!!s&&(Zm(s)?s:t.apply(0,e))},Ste=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=Vr(),{nativeScrollbarsOverlaid:l,body:u}=t,p=r??l,m=Ca(o)?u:o,h=(s.x||s.y)&&p,g=e&&(ug(m)?!i:m);return!!h||!!g},My=new WeakMap,kte=(e,t)=>{My.set(e,t)},jte=e=>{My.delete(e)},GM=e=>My.get(e),gj=(e,t)=>e?t.split(".").reduce((n,r)=>n&&pg(n,r)?n[r]:void 0,e):void 0,px=(e,t,n)=>r=>[gj(e,r),n||gj(t,r)!==void 0],KM=e=>{let t=e;return[()=>t,n=>{t=Cn({},t,n)}]},wp="tabindex",Sp=Li.bind(0,""),zv=e=>{xo(la(e),yy(e)),js(e)},_te=e=>{const t=Vr(),{N:n,I:r}=t,o=Ji()[Py],s=o&&o.T,{elements:i}=n(),{host:l,padding:u,viewport:p,content:m}=i,h=Zm(e),g=h?{}:e,{elements:x}=g,{host:y,padding:b,viewport:w,content:S}=x||{},j=h?e:g.target,_=Jm(j,"textarea"),E=j.ownerDocument,I=E.documentElement,M=j===E.body,R=E.defaultView,D=wte.bind(0,[j]),A=UM.bind(0,[j]),O=Ey.bind(0,[j]),T=D.bind(0,Sp,p),X=A.bind(0,Sp,m),B=T(w),V=B===j,U=V&&M,N=!V&&X(S),$=!V&&Zm(B)&&B===N,q=$&&!!O(m),F=q?T():B,Q=q?N:X(),se=U?I:$?F:B,ae=_?D(Sp,l,y):j,re=U?se:ae,G=$?Q:N,K=E.activeElement,ee=!V&&R.top===R&&K===j,ce={W:j,Z:re,J:se,K:!V&&A(Sp,u,b),tt:G,nt:!V&&!r&&s&&s(t),ot:U?I:se,st:U?E:se,et:R,ct:E,rt:_,it:M,lt:h,ut:V,dt:$,ft:(Ze,ot)=>Tee(se,V?Bo:Fa,V?ot:Ze),_t:(Ze,ot,ye)=>$i(se,V?Bo:Fa,V?ot:Ze,ye)},J=ro(ce).reduce((Ze,ot)=>{const ye=ce[ot];return Xt(Ze,ye&&!la(ye)?ye:!1)},[]),ie=Ze=>Ze?vy(J,Ze)>-1:null,{W:de,Z:ge,K:Ce,J:he,tt:fe,nt:Oe}=ce,_e=[()=>{Mr(ge,Bo),Mr(ge,Nv),Mr(de,Nv),M&&(Mr(I,Bo),Mr(I,Nv))}],Ne=_&&ie(ge);let nt=_?de:yy([fe,he,Ce,ge,de].find(Ze=>ie(Ze)===!1));const $e=U?de:fe||he;return[ce,()=>{lr(ge,Bo,V?"viewport":"host"),lr(Ce,fx,""),lr(fe,cj,""),V||lr(he,Fa,"");const Ze=M&&!V?ra(la(j),zM):go;if(Ne&&(ej(de,ge),Xt(_e,()=>{ej(ge,de),js(ge)})),xo($e,nt),xo(ge,Ce),xo(Ce||ge,!V&&he),xo(he,fe),Xt(_e,()=>{Ze(),Mr(Ce,fx),Mr(fe,cj),Mr(he,FM),Mr(he,BM),Mr(he,Fa),ie(fe)&&zv(fe),ie(he)&&zv(he),ie(Ce)&&zv(Ce)}),r&&!V&&($i(he,Fa,HM,!0),Xt(_e,Mr.bind(0,he,Fa))),Oe&&(Lee(he,Oe),Xt(_e,js.bind(0,Oe))),ee){const ot=lr(he,wp);lr(he,wp,"-1"),he.focus();const ye=()=>ot?lr(he,wp,ot):Mr(he,wp),De=Wn(E,"pointerdown keydown",()=>{ye(),De()});Xt(_e,[ye,De])}else K&&K.focus&&K.focus();nt=0},As.bind(0,_e)]},Ite=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Vr(),{ht:i}=r(),{vt:l}=o,u=(n||!s)&&l;return u&&ur(n,{height:i?"":"100%"}),{gt:u,wt:u}}},Pte=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:l}=e,[u,p]=Fo({u:Uee,o:oj()},oj.bind(0,o,"padding",""));return(m,h,g)=>{let[x,y]=p(g);const{I:b,V:w}=Vr(),{bt:S}=n(),{gt:j,wt:_,yt:E}=m,[I,M]=h("paddingAbsolute");(j||y||!w&&_)&&([x,y]=u(g));const D=!l&&(M||E||y);if(D){const A=!I||!s&&!b,O=x.r+x.l,T=x.t+x.b,X={marginRight:A&&!S?-O:0,marginBottom:A?-T:0,marginLeft:A&&S?-O:0,top:A?-x.t:0,right:A?S?-x.r:"auto":0,left:A?S?"auto":-x.l:0,width:A?`calc(100% + ${O}px)`:""},B={paddingTop:A?x.t:0,paddingRight:A?x.r:0,paddingBottom:A?x.b:0,paddingLeft:A?x.l:0};ur(s||i,X),ur(i,B),r({K:x,St:!A,P:s?B:Cn({},X,B)})}return{xt:D}}},{max:mx}=Math,Ba=mx.bind(0,0),qM="visible",vj="hidden",Ete=42,kp={u:OM,o:{w:0,h:0}},Mte={u:RM,o:{x:vj,y:vj}},Ote=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Ba(e.w-t.w),h:Ba(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},jp=e=>e.indexOf(qM)===0,Rte=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:l,ut:u,_t:p,it:m,et:h}=e,{k:g,V:x,I:y,A:b}=Vr(),w=Ji()[Py],S=!u&&!y&&(b.x||b.y),j=m&&u,[_,E]=Fo(kp,nh.bind(0,i)),[I,M]=Fo(kp,th.bind(0,i)),[R,D]=Fo(kp),[A,O]=Fo(kp),[T]=Fo(Mte),X=(q,F)=>{if(ur(i,{height:""}),F){const{St:Q,K:Y}=n(),{$t:se,D:ae}=q,re=nh(o),G=Wp(o),K=ur(i,"boxSizing")==="content-box",ee=Q||K?Y.b+Y.t:0,ce=!(b.x&&K);ur(i,{height:G.h+re.h+(se.x&&ce?ae.x:0)-ee})}},B=(q,F)=>{const Q=!y&&!q?Ete:0,Y=(ie,de,ge)=>{const Ce=ur(i,ie),fe=(F?F[ie]:Ce)==="scroll";return[Ce,fe,fe&&!y?de?Q:ge:0,de&&!!Q]},[se,ae,re,G]=Y("overflowX",b.x,g.x),[K,ee,ce,J]=Y("overflowY",b.y,g.y);return{Ct:{x:se,y:K},$t:{x:ae,y:ee},D:{x:re,y:ce},M:{x:G,y:J}}},V=(q,F,Q,Y)=>{const se=(ee,ce)=>{const J=jp(ee),ie=ce&&J&&ee.replace(`${qM}-`,"")||"";return[ce&&!J?ee:"",jp(ie)?"hidden":ie]},[ae,re]=se(Q.x,F.x),[G,K]=se(Q.y,F.y);return Y.overflowX=re&&G?re:ae,Y.overflowY=K&&ae?K:G,B(q,Y)},U=(q,F,Q,Y)=>{const{D:se,M:ae}=q,{x:re,y:G}=ae,{x:K,y:ee}=se,{P:ce}=n(),J=F?"marginLeft":"marginRight",ie=F?"paddingLeft":"paddingRight",de=ce[J],ge=ce.marginBottom,Ce=ce[ie],he=ce.paddingBottom;Y.width=`calc(100% + ${ee+-1*de}px)`,Y[J]=-ee+de,Y.marginBottom=-K+ge,Q&&(Y[ie]=Ce+(G?ee:0),Y.paddingBottom=he+(re?K:0))},[N,$]=w?w.H(S,x,i,l,n,B,U):[()=>S,()=>[go]];return(q,F,Q)=>{const{gt:Y,Ot:se,wt:ae,xt:re,vt:G,yt:K}=q,{ht:ee,bt:ce}=n(),[J,ie]=F("showNativeOverlaidScrollbars"),[de,ge]=F("overflow"),Ce=J&&b.x&&b.y,he=!u&&!x&&(Y||ae||se||ie||G),fe=jp(de.x),Oe=jp(de.y),_e=fe||Oe;let Ne=E(Q),nt=M(Q),$e=D(Q),Pt=O(Q),Ze;if(ie&&y&&p(HM,ete,!Ce),he&&(Ze=B(Ce),X(Ze,ee)),Y||re||ae||K||ie){_e&&p(hc,mc,!1);const[ke,Be]=$(Ce,ce,Ze),[ze,Ge]=Ne=_(Q),[pt,En]=nt=I(Q),Dt=Wp(i);let At=pt,pr=Dt;ke(),(En||Ge||ie)&&Be&&!Ce&&N(Be,pt,ze,ce)&&(pr=Wp(i),At=th(i));const Ln={w:Ba(mx(pt.w,At.w)+ze.w),h:Ba(mx(pt.h,At.h)+ze.h)},kn={w:Ba((j?h.innerWidth:pr.w+Ba(Dt.w-pt.w))+ze.w),h:Ba((j?h.innerHeight+ze.h:pr.h+Ba(Dt.h-pt.h))+ze.h)};Pt=A(kn),$e=R(Ote(Ln,kn),Q)}const[ot,ye]=Pt,[De,ut]=$e,[bt,be]=nt,[Je,lt]=Ne,ft={x:De.w>0,y:De.h>0},Me=fe&&Oe&&(ft.x||ft.y)||fe&&ft.x&&!ft.y||Oe&&ft.y&&!ft.x;if(re||K||lt||be||ye||ut||ge||ie||he){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},Be=V(Ce,ft,de,ke),ze=N(Be,bt,Je,ce);u||U(Be,ce,ze,ke),he&&X(Be,ee),u?(lr(o,FM,ke.overflowX),lr(o,BM,ke.overflowY)):ur(i,ke)}$i(o,Bo,mc,Me),$i(s,fx,tte,Me),u||$i(i,Fa,hc,_e);const[Le,Ut]=T(B(Ce).Ct);return r({Ct:Le,zt:{x:ot.w,y:ot.h},Tt:{x:De.w,y:De.h},Et:ft}),{It:Ut,At:ye,Lt:ut}}},xj=(e,t,n)=>{const r={},o=t||{},s=ro(e).concat(ro(o));return zt(s,i=>{const l=e[i],u=o[i];r[i]=!!(n||l||u)}),r},Dte=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:l,V:u}=Vr(),p=!i&&(l.x||l.y),m=[Ite(e,t),Pte(e,t),Rte(e,t)];return(h,g,x)=>{const y=xj(Cn({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},g),{},x),b=p||!u,w=b&&Ko(r),S=b&&na(r);o("",rh,!0);let j=y;return zt(m,_=>{j=xj(j,_(j,h,!!x)||{},x)}),Ko(r,w),na(r,S),o("",rh),s||(Ko(n,0),na(n,0)),j}},Ate=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=l=>{if(n){const u=n.reduce((p,m)=>{if(m){const[h,g]=m,x=g&&h&&(l?l(h):_M(h,e));x&&x.length&&g&&ci(g)&&Xt(p,[x,g.trim()],!0)}return p},[]);zt(u,p=>zt(p[0],m=>{const h=p[1],g=r.get(m)||[];if(e.contains(m)){const y=Wn(m,h,b=>{o?(y(),r.delete(m)):t(b)});r.set(m,Xt(g,y))}else As(g),r.delete(m)}))}};return n&&(r=new WeakMap,i()),[s,i]},bj=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:l,Mt:u,Rt:p,kt:m}=r||{},h=Sy(()=>{o&&n(!0)},{v:33,g:99}),[g,x]=Ate(e,h,l),y=s||[],b=i||[],w=y.concat(b),S=(_,E)=>{const I=p||go,M=m||go,R=new Set,D=new Set;let A=!1,O=!1;if(zt(_,T=>{const{attributeName:X,target:B,type:V,oldValue:U,addedNodes:N,removedNodes:$}=T,q=V==="attributes",F=V==="childList",Q=e===B,Y=q&&ci(X)?lr(B,X):0,se=Y!==0&&U!==Y,ae=vy(b,X)>-1&&se;if(t&&(F||!Q)){const re=!q,G=q&&se,K=G&&u&&Jm(B,u),ce=(K?!I(B,X,U,Y):re||G)&&!M(T,!!K,e,r);zt(N,J=>R.add(J)),zt($,J=>R.add(J)),O=O||ce}!t&&Q&&se&&!I(B,X,U,Y)&&(D.add(X),A=A||ae)}),R.size>0&&x(T=>Zi(R).reduce((X,B)=>(Xt(X,_M(T,B)),Jm(B,T)?Xt(X,B):X),[])),t)return!E&&O&&n(!1),[!1];if(D.size>0||A){const T=[Zi(D),A];return!E&&n.apply(0,T),T}},j=new Vee(_=>S(_));return j.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:w,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(g(),j.disconnect(),o=!1)},()=>{if(o){h.m();const _=j.takeRecords();return!xy(_)&&S(_,!0)}}]},_p=3333333,Ip=e=>e&&(e.height||e.width),XM=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Ji()[gte],{B:i}=Vr(),u=IM(`<div class="${_y}"><div class="${rte}"></div></div>`)[0],p=u.firstChild,m=id.bind(0,e),[h]=Fo({o:void 0,_:!0,u:(b,w)=>!(!b||!Ip(b)&&Ip(w))}),g=b=>{const w=ts(b)&&b.length>0&&ad(b[0]),S=!w&&gy(b[0]);let j=!1,_=!1,E=!0;if(w){const[I,,M]=h(b.pop().contentRect),R=Ip(I),D=Ip(M);j=!M||!R,_=!D&&R,E=!j}else S?[,E]=b:_=b===!0;if(r&&E){const I=S?b[0]:id(u);Ko(u,I?i.n?-_p:i.i?0:_p:_p),na(u,_p)}j||t({gt:!S,Yt:S?b:void 0,Vt:!!_})},x=[];let y=o?g:!1;return[()=>{As(x),js(u)},()=>{if(ec){const b=new ec(g);b.observe(p),Xt(x,()=>{b.disconnect()})}else if(s){const[b,w]=s.O(p,g,o);y=b,Xt(x,w)}if(r){const[b]=Fo({o:void 0},m);Xt(x,Wn(u,"scroll",w=>{const S=b(),[j,_,E]=S;_&&(wy(p,"ltr rtl"),j?ra(p,"rtl"):ra(p,"ltr"),g([!!j,_,E])),AM(w)}))}y&&(ra(u,nte),Xt(x,Wn(u,"animationstart",y,{C:!!ec}))),(ec||s)&&xo(e,u)}]},Tte=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,Nte=(e,t)=>{let n;const r=Li(ote),o=[],[s]=Fo({o:!1}),i=(u,p)=>{if(u){const m=s(Tte(u)),[,h]=m;if(h)return!p&&t(m),[m]}},l=(u,p)=>{if(u&&u.length>0)return i(u.pop(),p)};return[()=>{As(o),js(r)},()=>{if(tj)n=new tj(u=>l(u),{root:e}),n.observe(r),Xt(o,()=>{n.disconnect()});else{const u=()=>{const h=ld(r);i(h)},[p,m]=XM(r,u);Xt(o,p),m(),u()}xo(e,r)},()=>{if(n)return l(n.takeRecords(),!0)}]},yj=`[${Bo}]`,$te=`[${Fa}]`,Fv=["tabindex"],Cj=["wrap","cols","rows"],Bv=["id","class","style","open"],Lte=(e,t,n)=>{let r,o,s;const{Z:i,J:l,tt:u,rt:p,ut:m,ft:h,_t:g}=e,{V:x}=Vr(),[y]=Fo({u:OM,o:{w:0,h:0}},()=>{const V=h(hc,mc),U=h($v,""),N=U&&Ko(l),$=U&&na(l);g(hc,mc),g($v,""),g("",rh,!0);const q=th(u),F=th(l),Q=nh(l);return g(hc,mc,V),g($v,"",U),g("",rh),Ko(l,N),na(l,$),{w:F.w+q.w+Q.w,h:F.h+q.h+Q.h}}),b=p?Cj:Bv.concat(Cj),w=Sy(n,{v:()=>r,g:()=>o,p(V,U){const[N]=V,[$]=U;return[ro(N).concat(ro($)).reduce((q,F)=>(q[F]=N[F]||$[F],q),{})]}}),S=V=>{zt(V||Fv,U=>{if(vy(Fv,U)>-1){const N=lr(i,U);ci(N)?lr(l,U,N):Mr(l,U)}})},j=(V,U)=>{const[N,$]=V,q={vt:$};return t({ht:N}),!U&&n(q),q},_=({gt:V,Yt:U,Vt:N})=>{const $=!V||N?n:w;let q=!1;if(U){const[F,Q]=U;q=Q,t({bt:F})}$({gt:V,yt:q})},E=(V,U)=>{const[,N]=y(),$={wt:N};return N&&!U&&(V?n:w)($),$},I=(V,U,N)=>{const $={Ot:U};return U?!N&&w($):m||S(V),$},[M,R,D]=u||!x?Nte(i,j):[go,go,go],[A,O]=m?[go,go]:XM(i,_,{Vt:!0,Bt:!0}),[T,X]=bj(i,!1,I,{Pt:Bv,Ht:Bv.concat(Fv)}),B=m&&ec&&new ec(_.bind(0,{gt:!0}));return B&&B.observe(i),S(),[()=>{M(),A(),s&&s[0](),B&&B.disconnect(),T()},()=>{O(),R()},()=>{const V={},U=X(),N=D(),$=s&&s[1]();return U&&Cn(V,I.apply(0,Xt(U,!0))),N&&Cn(V,j.apply(0,Xt(N,!0))),$&&Cn(V,E.apply(0,Xt($,!0))),V},V=>{const[U]=V("update.ignoreMutation"),[N,$]=V("update.attributes"),[q,F]=V("update.elementEvents"),[Q,Y]=V("update.debounce"),se=F||$,ae=re=>es(U)&&U(re);if(se&&(s&&(s[1](),s[0]()),s=bj(u||l,!0,E,{Ht:b.concat(N||[]),Dt:q,Mt:yj,kt:(re,G)=>{const{target:K,attributeName:ee}=re;return(!G&&ee&&!m?$ee(K,yj,$te):!1)||!!Jl(K,`.${Hr}`)||!!ae(re)}})),Y)if(w.m(),ts(Q)){const re=Q[0],G=Q[1];r=Xa(re)&&re,o=Xa(G)&&G}else Xa(Q)?(r=Q,o=!1):(r=!1,o=!1)}]},wj={x:0,y:0},zte=e=>({K:{t:0,r:0,b:0,l:0},St:!1,P:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},zt:wj,Tt:wj,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:id(e.Z)}),Fte=(e,t)=>{const n=px(t,{}),[r,o,s]=jy(),[i,l,u]=_te(e),p=KM(zte(i)),[m,h]=p,g=Dte(i,p),x=(_,E,I)=>{const R=ro(_).some(D=>_[D])||!by(E)||I;return R&&s("u",[_,E,I]),R},[y,b,w,S]=Lte(i,h,_=>x(g(n,_),{},!1)),j=m.bind(0);return j.jt=_=>r("u",_),j.Nt=()=>{const{W:_,J:E}=i,I=Ko(_),M=na(_);b(),l(),Ko(E,I),na(E,M)},j.qt=i,[(_,E)=>{const I=px(t,_,E);return S(I),x(g(I,w(),E),_,!!E)},j,()=>{o(),y(),u()}]},{round:Sj}=Math,Bte=e=>{const{width:t,height:n}=xs(e),{w:r,h:o}=ld(e);return{x:Sj(t)/r||1,y:Sj(n)/o||1}},Hte=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:l}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(l||[]).includes(i)},Vte=(e,t)=>Wn(e,"mousedown",Wn.bind(0,t,"click",AM,{C:!0,$:!0}),{$:!0}),kj="pointerup pointerleave pointercancel lostpointercapture",Wte=(e,t,n,r,o,s,i)=>{const{B:l}=Vr(),{Ft:u,Gt:p,Xt:m}=r,h=`scroll${i?"Left":"Top"}`,g=`client${i?"X":"Y"}`,x=i?"width":"height",y=i?"left":"top",b=i?"w":"h",w=i?"x":"y",S=(j,_)=>E=>{const{Tt:I}=s(),M=ld(p)[b]-ld(u)[b],D=_*E/M*I[w],O=id(m)&&i?l.n||l.i?1:-1:1;o[h]=j+D*O};return Wn(p,"pointerdown",j=>{const _=Jl(j.target,`.${Iy}`)===u,E=_?u:p;if($i(t,Bo,lj,!0),Hte(j,e,_)){const I=!_&&j.shiftKey,M=()=>xs(u),R=()=>xs(p),D=(F,Q)=>(F||M())[y]-(Q||R())[y],A=S(o[h]||0,1/Bte(o)[w]),O=j[g],T=M(),X=R(),B=T[x],V=D(T,X)+B/2,U=O-X[y],N=_?0:U-V,$=F=>{As(q),E.releasePointerCapture(F.pointerId)},q=[$i.bind(0,t,Bo,lj),Wn(n,kj,$),Wn(n,"selectstart",F=>TM(F),{S:!1}),Wn(p,kj,$),Wn(p,"pointermove",F=>{const Q=F[g]-O;(_||I)&&A(N+Q)})];if(I)A(N);else if(!_){const F=Ji()[vte];F&&Xt(q,F.O(A,D,N,B,U))}E.setPointerCapture(j.pointerId)}})},Ute=(e,t)=>(n,r,o,s,i,l)=>{const{Xt:u}=n,[p,m]=Kl(333),h=!!i.scrollBy;let g=!0;return As.bind(0,[Wn(u,"pointerenter",()=>{r(dj,!0)}),Wn(u,"pointerleave pointercancel",()=>{r(dj)}),Wn(u,"wheel",x=>{const{deltaX:y,deltaY:b,deltaMode:w}=x;h&&g&&w===0&&la(u)===s&&i.scrollBy({left:y,top:b,behavior:"smooth"}),g=!1,r(mj,!0),p(()=>{g=!0,r(mj)}),TM(x)},{S:!1,$:!0}),Vte(u,o),Wte(e,s,o,n,i,t,l),m])},{min:hx,max:jj,abs:Gte,round:Kte}=Math,QM=(e,t,n,r)=>{if(r){const l=n?"x":"y",{Tt:u,zt:p}=r,m=p[l],h=u[l];return jj(0,hx(1,m/(m+h)))}const o=n?"width":"height",s=xs(e)[o],i=xs(t)[o];return jj(0,hx(1,s/i))},qte=(e,t,n,r,o,s)=>{const{B:i}=Vr(),l=s?"x":"y",u=s?"Left":"Top",{Tt:p}=r,m=Kte(p[l]),h=Gte(n[`scroll${u}`]),g=s&&o,x=i.i?h:m-h,b=hx(1,(g?x:h)/m),w=QM(e,t,s);return 1/w*(1-w)*b},Xte=(e,t,n)=>{const{N:r,L:o}=Vr(),{scrollbars:s}=r(),{slot:i}=s,{ct:l,W:u,Z:p,J:m,lt:h,ot:g,it:x,ut:y}=t,{scrollbars:b}=h?{}:e,{slot:w}=b||{},S=UM([u,p,m],()=>y&&x?u:p,i,w),j=(N,$,q)=>{const F=q?ra:wy;zt(N,Q=>{F(Q.Xt,$)})},_=(N,$)=>{zt(N,q=>{const[F,Q]=$(q);ur(F,Q)})},E=(N,$,q)=>{_(N,F=>{const{Ft:Q,Gt:Y}=F;return[Q,{[q?"width":"height"]:`${(100*QM(Q,Y,q,$)).toFixed(3)}%`}]})},I=(N,$,q)=>{const F=q?"X":"Y";_(N,Q=>{const{Ft:Y,Gt:se,Xt:ae}=Q,re=qte(Y,se,g,$,id(ae),q);return[Y,{transform:re===re?`translate${F}(${(100*re).toFixed(3)}%)`:""}]})},M=[],R=[],D=[],A=(N,$,q)=>{const F=gy(q),Q=F?q:!0,Y=F?!q:!0;Q&&j(R,N,$),Y&&j(D,N,$)},O=N=>{E(R,N,!0),E(D,N)},T=N=>{I(R,N,!0),I(D,N)},X=N=>{const $=N?lte:cte,q=N?R:D,F=xy(q)?uj:"",Q=Li(`${Hr} ${$} ${F}`),Y=Li(VM),se=Li(Iy),ae={Xt:Q,Gt:Y,Ft:se};return o||ra(Q,ste),xo(Q,Y),xo(Y,se),Xt(q,ae),Xt(M,[js.bind(0,Q),n(ae,A,l,p,g,N)]),ae},B=X.bind(0,!0),V=X.bind(0,!1),U=()=>{xo(S,R[0].Xt),xo(S,D[0].Xt),eh(()=>{A(uj)},300)};return B(),V(),[{Ut:O,Wt:T,Zt:A,Jt:{Kt:R,Qt:B,tn:_.bind(0,R)},nn:{Kt:D,Qt:V,tn:_.bind(0,D)}},U,As.bind(0,M)]},Qte=(e,t,n,r)=>{let o,s,i,l,u,p=0;const m=KM({}),[h]=m,[g,x]=Kl(),[y,b]=Kl(),[w,S]=Kl(100),[j,_]=Kl(100),[E,I]=Kl(()=>p),[M,R,D]=Xte(e,n.qt,Ute(t,n)),{Z:A,J:O,ot:T,st:X,ut:B,it:V}=n.qt,{Jt:U,nn:N,Zt:$,Ut:q,Wt:F}=M,{tn:Q}=U,{tn:Y}=N,se=ee=>{const{Xt:ce}=ee,J=B&&!V&&la(ce)===O&&ce;return[J,{transform:J?`translate(${Ko(T)}px, ${na(T)}px)`:""}]},ae=(ee,ce)=>{if(I(),ee)$(pj);else{const J=()=>$(pj,!0);p>0&&!ce?E(J):J()}},re=()=>{l=s,l&&ae(!0)},G=[S,I,_,b,x,D,Wn(A,"pointerover",re,{C:!0}),Wn(A,"pointerenter",re),Wn(A,"pointerleave",()=>{l=!1,s&&ae(!1)}),Wn(A,"pointermove",()=>{o&&g(()=>{S(),ae(!0),j(()=>{o&&ae(!1)})})}),Wn(X,"scroll",ee=>{y(()=>{F(n()),i&&ae(!0),w(()=>{i&&!l&&ae(!1)})}),r(ee),B&&Q(se),B&&Y(se)})],K=h.bind(0);return K.qt=M,K.Nt=R,[(ee,ce,J)=>{const{At:ie,Lt:de,It:ge,yt:Ce}=J,{A:he}=Vr(),fe=px(t,ee,ce),Oe=n(),{Tt:_e,Ct:Ne,bt:nt}=Oe,[$e,Pt]=fe("showNativeOverlaidScrollbars"),[Ze,ot]=fe("scrollbars.theme"),[ye,De]=fe("scrollbars.visibility"),[ut,bt]=fe("scrollbars.autoHide"),[be]=fe("scrollbars.autoHideDelay"),[Je,lt]=fe("scrollbars.dragScroll"),[ft,Me]=fe("scrollbars.clickScroll"),Le=ie||de||Ce,Ut=ge||De,ke=$e&&he.x&&he.y,Be=(ze,Ge)=>{const pt=ye==="visible"||ye==="auto"&&ze==="scroll";return $(ute,pt,Ge),pt};if(p=be,Pt&&$(ate,ke),ot&&($(u),$(Ze,!0),u=Ze),bt&&(o=ut==="move",s=ut==="leave",i=ut!=="never",ae(!i,!0)),lt&&$(pte,Je),Me&&$(fte,ft),Ut){const ze=Be(Ne.x,!0),Ge=Be(Ne.y,!1);$(dte,!(ze&&Ge))}Le&&(q(Oe),F(Oe),$(fj,!_e.x,!0),$(fj,!_e.y,!1),$(ite,nt&&!V))},K,As.bind(0,G)]},YM=(e,t,n)=>{es(e)&&e(t||void 0,n||void 0)},Ua=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=Vr(),l=Ji(),u=Zm(e),p=u?e:e.target,m=GM(p);if(t&&!m){let h=!1;const g=B=>{const V=Ji()[hte],U=V&&V.O;return U?U(B,!0):B},x=Cn({},r(),g(t)),[y,b,w]=jy(n),[S,j,_]=Fte(e,x),[E,I,M]=Qte(e,x,j,B=>w("scroll",[X,B])),R=(B,V)=>S(B,!!V),D=R.bind(0,{},!0),A=s(D),O=i(D),T=B=>{jte(p),A(),O(),M(),_(),h=!0,w("destroyed",[X,!!B]),b()},X={options(B,V){if(B){const U=V?r():{},N=NM(x,Cn(U,g(B)));by(N)||(Cn(x,N),R(N))}return Cn({},x)},on:y,off:(B,V)=>{B&&V&&b(B,V)},state(){const{zt:B,Tt:V,Ct:U,Et:N,K:$,St:q,bt:F}=j();return Cn({},{overflowEdge:B,overflowAmount:V,overflowStyle:U,hasOverflow:N,padding:$,paddingAbsolute:q,directionRTL:F,destroyed:h})},elements(){const{W:B,Z:V,K:U,J:N,tt:$,ot:q,st:F}=j.qt,{Jt:Q,nn:Y}=I.qt,se=re=>{const{Ft:G,Gt:K,Xt:ee}=re;return{scrollbar:ee,track:K,handle:G}},ae=re=>{const{Kt:G,Qt:K}=re,ee=se(G[0]);return Cn({},ee,{clone:()=>{const ce=se(K());return E({},!0,{}),ce}})};return Cn({},{target:B,host:V,padding:U||N,viewport:N,content:$||N,scrollOffsetElement:q,scrollEventElement:F,scrollbarHorizontal:ae(Q),scrollbarVertical:ae(Y)})},update:B=>R({},B),destroy:T.bind(0)};return j.jt((B,V,U)=>{E(V,U,B)}),kte(p,X),zt(ro(l),B=>YM(l[B],0,X)),Ste(j.qt.it,o().cancel,!u&&e.cancel)?(T(!0),X):(j.Nt(),I.Nt(),w("initialized",[X]),j.jt((B,V,U)=>{const{gt:N,yt:$,vt:q,At:F,Lt:Q,It:Y,wt:se,Ot:ae}=B;w("updated",[X,{updateHints:{sizeChanged:N,directionChanged:$,heightIntrinsicChanged:q,overflowEdgeChanged:F,overflowAmountChanged:Q,overflowStyleChanged:Y,contentMutation:se,hostMutation:ae},changedOptions:V,force:U}])}),X.update(!0),X)}return m};Ua.plugin=e=>{zt(mte(e),t=>YM(t,Ua))};Ua.valid=e=>{const t=e&&e.elements,n=es(t)&&t();return lx(n)&&!!GM(n.target)};Ua.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:l,N:u,q:p,F:m,G:h}=Vr();return Cn({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:l,getDefaultInitialization:u,setDefaultInitialization:p,getDefaultOptions:m,setDefaultOptions:h})};const Yte=()=>{if(typeof window>"u"){const p=()=>{};return[p,p]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,i=r?n.requestIdleCallback:o,l=r?n.cancelIdleCallback:s,u=()=>{l(e),s(t)};return[(p,m)=>{u(),e=i(r?()=>{u(),t=o(p)}:p,typeof m=="object"?m:{timeout:2233})},u]},Oy=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=d.useMemo(Yte,[]),i=d.useRef(null),l=d.useRef(r),u=d.useRef(t),p=d.useRef(n);return d.useEffect(()=>{l.current=r},[r]),d.useEffect(()=>{const{current:m}=i;u.current=t,Ua.valid(m)&&m.options(t||{},!0)},[t]),d.useEffect(()=>{const{current:m}=i;p.current=n,Ua.valid(m)&&m.on(n||{},!0)},[n]),d.useEffect(()=>()=>{var m;s(),(m=i.current)==null||m.destroy()},[]),d.useMemo(()=>[m=>{const h=i.current;if(Ua.valid(h))return;const g=l.current,x=u.current||{},y=p.current||{},b=()=>i.current=Ua(m,x,y);g?o(b,g):b()},()=>i.current],[])},Zte=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...l}=e,u=n,p=d.useRef(null),m=d.useRef(null),[h,g]=Oy({options:r,events:o,defer:s});return d.useEffect(()=>{const{current:x}=p,{current:y}=m;return x&&y&&h({target:x,elements:{viewport:y,content:y}}),()=>{var b;return(b=g())==null?void 0:b.destroy()}},[h,n]),d.useImperativeHandle(t,()=>({osInstance:g,getElement:()=>p.current}),[]),H.createElement(u,{"data-overlayscrollbars-initialize":"",ref:p,...l},H.createElement("div",{ref:m},i))},hg=d.forwardRef(Zte),Jte=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=Z(),o=W(j=>j.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:i}=xD((t==null?void 0:t.board_id)??$r.skipToken),l=d.useMemo(()=>le([xe],j=>{const _=(s??[]).map(I=>oI(j,I));return{imageUsageSummary:{isInitialImage:Xr(_,I=>I.isInitialImage),isCanvasImage:Xr(_,I=>I.isCanvasImage),isNodesImage:Xr(_,I=>I.isNodesImage),isControlNetImage:Xr(_,I=>I.isControlNetImage),isIPAdapterImage:Xr(_,I=>I.isIPAdapterImage)}}}),[s]),[u,{isLoading:p}]=bD(),[m,{isLoading:h}]=yD(),{imageUsageSummary:g}=W(l),x=d.useCallback(()=>{t&&(u(t.board_id),n(void 0))},[t,u,n]),y=d.useCallback(()=>{t&&(m(t.board_id),n(void 0))},[t,m,n]),b=d.useCallback(()=>{n(void 0)},[n]),w=d.useRef(null),S=d.useMemo(()=>h||p||i,[h,p,i]);return t?a.jsx(Td,{isOpen:!!t,onClose:b,leastDestructiveRef:w,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsxs(Qo,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Zo,{children:a.jsxs(L,{direction:"column",gap:3,children:[i?a.jsx(Gh,{children:a.jsx(L,{sx:{w:"full",h:32}})}):a.jsx(tM,{imageUsage:g,topMessage:r("boards.topMessage"),bottomMessage:r("boards.bottomMessage")}),a.jsx(ve,{children:"Deleted boards cannot be restored."}),a.jsx(ve,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(Ss,{children:a.jsxs(L,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(at,{ref:w,onClick:b,children:"Cancel"}),a.jsx(at,{colorScheme:"warning",isLoading:S,onClick:x,children:"Delete Board Only"}),a.jsx(at,{colorScheme:"error",isLoading:S,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},ene=d.memo(Jte),tne=()=>{const{t:e}=Z(),[t,{isLoading:n}]=CD(),r=e("boards.myBoard"),o=d.useCallback(()=>{t(r)},[t,r]);return a.jsx(Fe,{icon:a.jsx(Vc,{}),isLoading:n,tooltip:e("boards.addBoard"),"aria-label":e("boards.addBoard"),onClick:o,size:"sm","data-testid":"add-board-button"})},nne=d.memo(tne);var ZM=wh({displayName:"ExternalLinkIcon",path:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("path",{d:"M15 3h6v6"}),a.jsx("path",{d:"M10 14L21 3"})]})}),gg=wh({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),rne=wh({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),one=wh({displayName:"DeleteIcon",path:a.jsx("g",{fill:"currentColor",children:a.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});const sne=le([xe],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},Se),ane=()=>{const e=te(),{boardSearchText:t}=W(sne),n=d.useRef(null),{t:r}=Z(),o=d.useCallback(u=>{e(sw(u))},[e]),s=d.useCallback(()=>{e(sw(""))},[e]),i=d.useCallback(u=>{u.key==="Escape"&&s()},[s]),l=d.useCallback(u=>{o(u.target.value)},[o]);return d.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(i3,{children:[a.jsx(Mh,{ref:n,placeholder:r("boards.searchBoard"),value:t,onKeyDown:i,onChange:l,"data-testid":"board-search-input"}),t&&t.length&&a.jsx(Eb,{children:a.jsx(ys,{onClick:s,size:"xs",variant:"ghost","aria-label":r("boards.clearSearch"),opacity:.5,icon:a.jsx(rne,{boxSize:2})})})]})},ine=d.memo(ane);function JM(e){return wD(e)}function lne(e){return SD(e)}const e8=(e,t)=>{var o,s;if(!e||!(t!=null&&t.data.current))return!1;const{actionType:n}=e,{payloadType:r}=t.data.current;if(e.id===t.data.current.id)return!1;switch(n){case"ADD_FIELD_TO_LINEAR":return r==="NODE_FIELD";case"SET_CURRENT_IMAGE":return r==="IMAGE_DTO";case"SET_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_CONTROLNET_IMAGE":return r==="IMAGE_DTO";case"SET_IP_ADAPTER_IMAGE":return r==="IMAGE_DTO";case"SET_CANVAS_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_NODES_IMAGE":return r==="IMAGE_DTO";case"SET_MULTI_NODES_IMAGE":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BATCH":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:l}=t.data.current.payload,u=l.board_id??"none",p=e.context.boardId;return u!==p}if(r==="IMAGE_DTOS"){const{imageDTOs:l}=t.data.current.payload,u=((o=l[0])==null?void 0:o.board_id)??"none",p=e.context.boardId;return u!==p}return!1}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:l}=t.data.current.payload;return(l.board_id??"none")!=="none"}if(r==="IMAGE_DTOS"){const{imageDTOs:l}=t.data.current.payload;return(((s=l[0])==null?void 0:s.board_id)??"none")!=="none"}return!1}default:return!1}},cne=e=>{const{isOver:t,label:n="Drop"}=e,r=d.useRef(Zs()),{colorMode:o}=ha();return a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Ae("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(L,{sx:{position:"absolute",top:.5,insetInlineStart:.5,insetInlineEnd:.5,bottom:.5,opacity:1,borderWidth:2,borderColor:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),borderRadius:"lg",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(Ie,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.1)":"scale(1)",color:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},t8=d.memo(cne),une=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=d.useRef(Zs()),{isOver:s,setNodeRef:i,active:l}=JM({id:o.current,disabled:r,data:n});return a.jsx(Ie,{ref:i,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:l?"auto":"none",children:a.jsx(dr,{children:e8(n,l)&&a.jsx(t8,{isOver:s,label:t})})})},Ry=d.memo(une),dne=({isSelected:e,isHovered:t})=>a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e?1:.7,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:e?t?"hoverSelected.light":"selected.light":t?"hoverUnselected.light":void 0,_dark:{shadow:e?t?"hoverSelected.dark":"selected.dark":t?"hoverUnselected.dark":void 0}}}),Dy=d.memo(dne),fne=()=>a.jsx(L,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(Ds,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:"auto"})}),n8=d.memo(fne);function Ay(e){const[t,n]=d.useState(!1),[r,o]=d.useState(!1),[s,i]=d.useState(!1),[l,u]=d.useState([0,0]),p=d.useRef(null),m=W(g=>g.ui.globalContextMenuCloseTrigger);d.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{i(!0)})});else{i(!1);const g=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(g)}},[t]),d.useEffect(()=>{n(!1),i(!1),o(!1)},[m]),fF("contextmenu",g=>{var x;(x=p.current)!=null&&x.contains(g.target)||g.target===p.current?(g.preventDefault(),n(!0),u([g.pageX,g.pageY])):n(!1)});const h=d.useCallback(()=>{var g,x;(x=(g=e.menuProps)==null?void 0:g.onClose)==null||x.call(g),n(!1)},[e.menuProps]);return a.jsxs(a.Fragment,{children:[e.children(p),r&&a.jsx(Ac,{...e.portalProps,children:a.jsxs(Ah,{isOpen:s,gutter:0,...e.menuProps,onClose:h,children:[a.jsx(Th,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:l[0],top:l[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const vg=e=>{const{boardName:t}=yd(void 0,{selectFromResult:({data:n})=>{const r=n==null?void 0:n.find(s=>s.board_id===e);return{boardName:(r==null?void 0:r.board_name)||"Uncategorized"}}});return t},pne=({board:e,setBoardToDelete:t})=>{const n=d.useCallback(()=>{t&&t(e)},[e,t]);return a.jsxs(a.Fragment,{children:[e.image_count>0&&a.jsx(a.Fragment,{}),a.jsx(en,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Br,{}),onClick:n,children:"Delete Board"})]})},mne=d.memo(pne),hne=()=>a.jsx(a.Fragment,{}),gne=d.memo(hne),vne=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const o=te(),s=d.useMemo(()=>le(xe,({gallery:g})=>{const x=g.autoAddBoardId===t,y=g.autoAssignBoardOnClick;return{isAutoAdd:x,autoAssignBoardOnClick:y}},Se),[t]),{isAutoAdd:i,autoAssignBoardOnClick:l}=W(s),u=vg(t),p=d.useCallback(()=>{o(hh(t))},[t,o]),m=d.useCallback(g=>{g.preventDefault()},[]),{t:h}=Z();return a.jsx(Ay,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:m,children:a.jsxs(td,{title:u,children:[a.jsx(en,{icon:a.jsx(Vc,{}),isDisabled:i||l,onClick:p,children:h("boards.menuItemAutoAdd")}),!e&&a.jsx(gne,{}),e&&a.jsx(mne,{board:e,setBoardToDelete:n})]})}),children:r})},r8=d.memo(vne),xne=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=te(),o=d.useMemo(()=>le(xe,({gallery:A})=>{const O=e.board_id===A.autoAddBoardId,T=A.autoAssignBoardOnClick;return{isSelectedForAutoAdd:O,autoAssignBoardOnClick:T}},Se),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:i}=W(o),[l,u]=d.useState(!1),p=d.useCallback(()=>{u(!0)},[]),m=d.useCallback(()=>{u(!1)},[]),{data:h}=Vx(e.board_id),{data:g}=Wx(e.board_id),x=d.useMemo(()=>{if(!((h==null?void 0:h.total)===void 0||(g==null?void 0:g.total)===void 0))return`${h.total} image${h.total===1?"":"s"}, ${g.total} asset${g.total===1?"":"s"}`},[g,h]),{currentData:y}=to(e.cover_image_name??$r.skipToken),{board_name:b,board_id:w}=e,[S,j]=d.useState(b),_=d.useCallback(()=>{r(uI({boardId:w})),i&&r(hh(w))},[w,i,r]),[E,{isLoading:I}]=kD(),M=d.useMemo(()=>({id:w,actionType:"ADD_TO_BOARD",context:{boardId:w}}),[w]),R=d.useCallback(async A=>{if(!A.trim()){j(b);return}if(A!==b)try{const{board_name:O}=await E({board_id:w,changes:{board_name:A}}).unwrap();j(O)}catch{j(b)}},[w,b,E]),D=d.useCallback(A=>{j(A)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(L,{onMouseOver:p,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(r8,{board:e,board_id:w,setBoardToDelete:n,children:A=>a.jsx(Ft,{label:x,openDelay:1e3,hasArrow:!0,children:a.jsxs(L,{ref:A,onClick:_,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[y!=null&&y.thumbnail_url?a.jsx(ga,{src:y==null?void 0:y.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Nn,{boxSize:12,as:aee,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(n8,{}),a.jsx(Dy,{isSelected:t,isHovered:l}),a.jsx(L,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:t?"accent.400":"base.500",color:t?"base.50":"base.100",_dark:{bg:t?"accent.500":"base.600",color:t?"base.50":"base.100"},lineHeight:"short",fontSize:"xs"},children:a.jsxs(Ih,{value:S,isDisabled:I,submitOnBlur:!0,onChange:D,onSubmit:R,sx:{w:"full"},children:[a.jsx(_h,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(jh,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(Ry,{data:M,dropLabel:a.jsx(ve,{fontSize:"md",children:"Move"})})]})})})})})},bne=d.memo(xne),yne=le(xe,({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Se),o8=d.memo(({isSelected:e})=>{const t=te(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(yne),o=vg("none"),s=d.useCallback(()=>{t(uI({boardId:"none"})),r&&t(hh("none"))},[t,r]),[i,l]=d.useState(!1),{data:u}=Vx("none"),{data:p}=Wx("none"),m=d.useMemo(()=>{if(!((u==null?void 0:u.total)===void 0||(p==null?void 0:p.total)===void 0))return`${u.total} image${u.total===1?"":"s"}, ${p.total} asset${p.total===1?"":"s"}`},[p,u]),h=d.useCallback(()=>{l(!0)},[]),g=d.useCallback(()=>{l(!1)},[]),x=d.useMemo(()=>({id:"no_board",actionType:"REMOVE_FROM_BOARD"}),[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(L,{onMouseOver:h,onMouseOut:g,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(r8,{board_id:"none",children:y=>a.jsx(Ft,{label:m,openDelay:1e3,hasArrow:!0,children:a.jsxs(L,{ref:y,onClick:s,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(ga,{src:Hx,alt:"invoke-ai-logo",sx:{opacity:.4,filter:"grayscale(1)",mt:-6,w:16,h:16,minW:16,minH:16,userSelect:"none"}})}),n==="none"&&a.jsx(n8,{}),a.jsx(L,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:e?"accent.400":"base.500",color:e?"base.50":"base.100",_dark:{bg:e?"accent.500":"base.600",color:e?"base.50":"base.100"},lineHeight:"short",fontSize:"xs",fontWeight:e?700:500},children:o}),a.jsx(Dy,{isSelected:e,isHovered:i}),a.jsx(Ry,{data:x,dropLabel:a.jsx(ve,{fontSize:"md",children:"Move"})})]})})})})})});o8.displayName="HoverableBoard";const Cne=d.memo(o8),wne=le([xe],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},Se),Sne=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=W(wne),{data:o}=yd(),s=r?o==null?void 0:o.filter(u=>u.board_name.toLowerCase().includes(r.toLowerCase())):o,[i,l]=d.useState();return a.jsxs(a.Fragment,{children:[a.jsx(Id,{in:t,animateOpacity:!0,children:a.jsxs(L,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs(L,{sx:{gap:2,alignItems:"center"},children:[a.jsx(ine,{}),a.jsx(nne,{})]}),a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(Ja,{className:"list-container","data-testid":"boards-list",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(Zu,{sx:{p:1.5},"data-testid":"no-board",children:a.jsx(Cne,{isSelected:n==="none"})}),s&&s.map((u,p)=>a.jsx(Zu,{sx:{p:1.5},"data-testid":`board-${p}`,children:a.jsx(bne,{board:u,isSelected:n===u.board_id,setBoardToDelete:l})},u.board_id))]})})]})}),a.jsx(ene,{boardToDelete:i,setBoardToDelete:l})]})},kne=d.memo(Sne),jne=le([xe],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},Se),_ne=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=W(jne),o=vg(r),s=d.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs(L,{as:Za,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(ve,{noOfLines:1,sx:{fontWeight:600,w:"100%",textAlign:"center",color:"base.800",_dark:{color:"base.200"}},children:s}),a.jsx(gg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]})},Ine=d.memo(_ne),Pne=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(Ld,{isLazy:o,...s,children:[a.jsx(Wh,{children:t}),a.jsxs(zd,{shadow:"dark-lg",children:[r&&a.jsx(B3,{}),n]})]})},qd=d.memo(Pne);function Ene(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}},{tag:"path",attr:{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"}}]})(e)}const s8=je((e,t)=>{const[n,r]=d.useState(!1),{label:o,value:s,min:i=1,max:l=100,step:u=1,onChange:p,tooltipSuffix:m="",withSliderMarks:h=!1,withInput:g=!1,isInteger:x=!1,inputWidth:y=16,withReset:b=!1,hideTooltip:w=!1,isCompact:S=!1,isDisabled:j=!1,sliderMarks:_,handleReset:E,sliderFormControlProps:I,sliderFormLabelProps:M,sliderMarkProps:R,sliderTrackProps:D,sliderThumbProps:A,sliderNumberInputProps:O,sliderNumberInputFieldProps:T,sliderNumberInputStepperProps:X,sliderTooltipProps:B,sliderIAIIconButtonProps:V,...U}=e,N=te(),{t:$}=Z(),[q,F]=d.useState(String(s));d.useEffect(()=>{F(s)},[s]);const Q=d.useMemo(()=>O!=null&&O.min?O.min:i,[i,O==null?void 0:O.min]),Y=d.useMemo(()=>O!=null&&O.max?O.max:l,[l,O==null?void 0:O.max]),se=d.useCallback(J=>{p(J)},[p]),ae=d.useCallback(J=>{J.target.value===""&&(J.target.value=String(Q));const ie=Bi(x?Math.floor(Number(J.target.value)):Number(q),Q,Y),de=Mu(ie,u);p(de),F(de)},[x,q,Q,Y,p,u]),re=d.useCallback(J=>{F(J)},[]),G=d.useCallback(()=>{E&&E()},[E]),K=d.useCallback(J=>{J.target instanceof HTMLDivElement&&J.target.focus()},[]),ee=d.useCallback(J=>{J.shiftKey&&N(Nr(!0))},[N]),ce=d.useCallback(J=>{J.shiftKey||N(Nr(!1))},[N]);return a.jsxs(Kt,{ref:t,onClick:K,sx:S?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:j,...I,children:[o&&a.jsx(wn,{sx:g?{mb:-1.5}:{},...M,children:o}),a.jsxs(Rh,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Gb,{"aria-label":o,value:s,min:i,max:l,step:u,onChange:se,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),focusThumbOnChange:!1,isDisabled:j,...U,children:[h&&!_&&a.jsxs(a.Fragment,{children:[a.jsx(Ul,{value:i,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:i}),a.jsx(Ul,{value:l,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:l})]}),h&&_&&a.jsx(a.Fragment,{children:_.map((J,ie)=>ie===0?a.jsx(Ul,{value:J,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:J},J):ie===_.length-1?a.jsx(Ul,{value:J,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:J},J):a.jsx(Ul,{value:J,sx:{transform:"translateX(-50%)"},...R,children:J},J))}),a.jsx(qb,{...D,children:a.jsx(Xb,{})}),a.jsx(Ft,{hasArrow:!0,placement:"top",isOpen:n,label:`${s}${m}`,hidden:w,...B,children:a.jsx(Kb,{...A,zIndex:0})})]}),g&&a.jsxs(Lh,{min:Q,max:Y,step:u,value:q,onChange:re,onBlur:ae,focusInputOnChange:!1,...O,children:[a.jsx(Fh,{onKeyDown:ee,onKeyUp:ce,minWidth:y,...T}),a.jsxs(zh,{...X,children:[a.jsx(Hh,{onClick:()=>p(Number(q))}),a.jsx(Bh,{onClick:()=>p(Number(q))})]})]}),b&&a.jsx(Fe,{size:"sm","aria-label":$("accessibility.reset"),tooltip:$("accessibility.reset"),icon:a.jsx(Ene,{}),isDisabled:j,onClick:G,...V})]})]})});s8.displayName="IAISlider";const tt=d.memo(s8),a8=d.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Ft,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Ie,{ref:s,...o,children:a.jsxs(Ie,{children:[a.jsx(wc,{children:e}),n&&a.jsx(wc,{size:"xs",color:"base.600",children:n})]})})}));a8.displayName="IAIMantineSelectItemWithTooltip";const ui=d.memo(a8),Mne=le([xe],({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Se),One=()=>{const e=te(),{t}=Z(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(Mne),o=d.useRef(null),{boards:s,hasBoards:i}=yd(void 0,{selectFromResult:({data:u})=>{const p=[{label:"None",value:"none"}];return u==null||u.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{boards:p,hasBoards:p.length>1}}}),l=d.useCallback(u=>{u&&e(hh(u))},[e]);return a.jsx(nn,{label:t("boards.autoAddBoard"),inputRef:o,autoFocus:!0,placeholder:t("boards.selectBoard"),value:n,data:s,nothingFound:t("boards.noMatching"),itemComponent:ui,disabled:!i||r,filter:(u,p)=>{var m;return((m=p.label)==null?void 0:m.toLowerCase().includes(u.toLowerCase().trim()))||p.value.toLowerCase().includes(u.toLowerCase().trim())},onChange:l})},Rne=d.memo(One),Dne=e=>{const{label:t,...n}=e,{colorMode:r}=ha();return a.jsx(Md,{colorScheme:"accent",...n,children:a.jsx(ve,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},br=d.memo(Dne),Ane=le([xe],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},Se),Tne=()=>{const e=te(),{t}=Z(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=W(Ane),s=d.useCallback(u=>{e(aw(u))},[e]),i=d.useCallback(()=>{e(aw(64))},[e]),l=d.useCallback(u=>{e(jD(u.target.checked))},[e]);return a.jsx(qd,{triggerComponent:a.jsx(Fe,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(bM,{})}),children:a.jsxs(L,{direction:"column",gap:2,children:[a.jsx(tt,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:i}),a.jsx(fn,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:l}),a.jsx(br,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:u=>e(_D(u.target.checked))}),a.jsx(Rne,{})]})})},Nne=d.memo(Tne),$ne=e=>e.image?a.jsx(Gh,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx(L,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(fa,{size:"xl"})}),Zn=e=>{const{icon:t=Yi,boxSize:n=16,sx:r,...o}=e;return a.jsxs(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...r},...o,children:[t&&a.jsx(Nn,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(ve,{textAlign:"center",children:e.label})]})},Lne=e=>{const{sx:t,...n}=e;return a.jsxs(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...t},...n,children:[a.jsx(fa,{size:"xl"}),e.label&&a.jsx(ve,{textAlign:"center",children:e.label})]})},xg=0,di=1,Wc=2,i8=4;function l8(e,t){return n=>e(t(n))}function zne(e,t){return t(e)}function c8(e,t){return n=>e(t,n)}function _j(e,t){return()=>e(t)}function bg(e,t){return t(e),e}function hn(...e){return e}function Fne(e){e()}function Ij(e){return()=>e}function Bne(...e){return()=>{e.map(Fne)}}function Ty(e){return e!==void 0}function Uc(){}function Yt(e,t){return e(di,t)}function wt(e,t){e(xg,t)}function Ny(e){e(Wc)}function bo(e){return e(i8)}function st(e,t){return Yt(e,c8(t,xg))}function ca(e,t){const n=e(di,r=>{n(),t(r)});return n}function Tt(){const e=[];return(t,n)=>{switch(t){case Wc:e.splice(0,e.length);return;case di:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case xg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function Ve(e){let t=e;const n=Tt();return(r,o)=>{switch(r){case di:o(t);break;case xg:t=o;break;case i8:return t}return n(r,o)}}function Hne(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case di:return s?n===s?void 0:(r(),n=s,t=Yt(e,s),t):(r(),Uc);case Wc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Jr(e){return bg(Tt(),t=>st(e,t))}function yr(e,t){return bg(Ve(t),n=>st(e,n))}function Vne(...e){return t=>e.reduceRight(zne,t)}function Pe(e,...t){const n=Vne(...t);return(r,o)=>{switch(r){case di:return Yt(e,n(o));case Wc:Ny(e);return}}}function u8(e,t){return e===t}function pn(e=u8){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function gt(e){return t=>n=>{e(n)&&t(n)}}function Xe(e){return t=>l8(t,e)}function qs(e){return t=>()=>t(e)}function bs(e,t){return n=>r=>n(t=e(t,r))}function Pc(e){return t=>n=>{e>0?e--:t(n)}}function Ga(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Pj(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function _t(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);Yt(s,u=>{const p=n;n=n|l,t[i]=u,p!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const l=()=>s([i].concat(t));n===o?l():r=l}}function Ej(...e){return function(t,n){switch(t){case di:return Bne(...e.map(r=>Yt(r,n)));case Wc:return;default:throw new Error(`unrecognized action ${t}`)}}}function ht(e,t=u8){return Pe(e,pn(t))}function Qn(...e){const t=Tt(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);Yt(s,u=>{n[i]=u,r=r|l,r===o&&wt(t,n)})}),function(s,i){switch(s){case di:return r===o&&i(n),Yt(t,i);case Wc:return Ny(t);default:throw new Error(`unrecognized action ${s}`)}}}function qt(e,t=[],{singleton:n}={singleton:!0}){return{id:Wne(),constructor:e,dependencies:t,singleton:n}}const Wne=()=>Symbol();function Une(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const l=o(s.map(u=>n(u)));return i&&t.set(r,l),l};return n(e)}function Gne(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const Pp=typeof document<"u"?H.useLayoutEffect:H.useEffect;function d8(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),l=H.createContext({});function u(b,w){b.propsReady&&wt(b.propsReady,!1);for(const S of r){const j=b[t.required[S]];wt(j,w[S])}for(const S of o)if(S in w){const j=b[t.optional[S]];wt(j,w[S])}b.propsReady&&wt(b.propsReady,!0)}function p(b){return s.reduce((w,S)=>(w[S]=j=>{const _=b[t.methods[S]];wt(_,j)},w),{})}function m(b){return i.reduce((w,S)=>(w[S]=Hne(b[t.events[S]]),w),{})}return{Component:H.forwardRef((b,w)=>{const{children:S,...j}=b,[_]=H.useState(()=>bg(Une(e),I=>u(I,j))),[E]=H.useState(_j(m,_));return Pp(()=>{for(const I of i)I in j&&Yt(E[I],j[I]);return()=>{Object.values(E).map(Ny)}},[j,E,_]),Pp(()=>{u(_,j)}),H.useImperativeHandle(w,Ij(p(_))),H.createElement(l.Provider,{value:_},n?H.createElement(n,Gne([...r,...o,...i],j),S):S)}),usePublisher:b=>H.useCallback(c8(wt,H.useContext(l)[b]),[b]),useEmitterValue:b=>{const S=H.useContext(l)[b],[j,_]=H.useState(_j(bo,S));return Pp(()=>Yt(S,E=>{E!==j&&_(Ij(E))}),[S,j]),j},useEmitter:(b,w)=>{const j=H.useContext(l)[b];Pp(()=>Yt(j,w),[w,j])}}}const Kne=typeof document<"u"?H.useLayoutEffect:H.useEffect,qne=Kne;var eo=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(eo||{});const Xne={0:"debug",1:"log",2:"warn",3:"error"},Qne=()=>typeof globalThis>"u"?window:globalThis,fi=qt(()=>{const e=Ve(3);return{log:Ve((n,r,o=1)=>{var s;const i=(s=Qne().VIRTUOSO_LOG_LEVEL)!=null?s:bo(e);o>=i&&console[Xne[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function $y(e,t=!0){const n=H.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=H.useMemo(()=>new ResizeObserver(s=>{const i=s[0].target;i.offsetParent!==null&&e(i)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function ll(e,t=!0){return $y(e,t).callbackRef}function Yne(e,t,n,r,o,s,i){const l=H.useCallback(u=>{const p=Zne(u.children,t,"offsetHeight",o);let m=u.parentElement;for(;!m.dataset.virtuosoScroller;)m=m.parentElement;const h=m.lastElementChild.dataset.viewportType==="window",g=i?i.scrollTop:h?window.pageYOffset||document.documentElement.scrollTop:m.scrollTop,x=i?i.scrollHeight:h?document.documentElement.scrollHeight:m.scrollHeight,y=i?i.offsetHeight:h?window.innerHeight:m.offsetHeight;r({scrollTop:Math.max(g,0),scrollHeight:x,viewportHeight:y}),s==null||s(Jne("row-gap",getComputedStyle(u).rowGap,o)),p!==null&&e(p)},[e,t,o,s,i,r]);return $y(l,n)}function Zne(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const l=e.item(i);if(!l||l.dataset.index===void 0)continue;const u=parseInt(l.dataset.index),p=parseFloat(l.dataset.knownSize),m=t(l,n);if(m===0&&r("Zero-sized element, this should not happen",{child:l},eo.ERROR),m===p)continue;const h=s[s.length-1];s.length===0||h.size!==m||h.endIndex!==u-1?s.push({startIndex:u,endIndex:u,size:m}):s[s.length-1].endIndex++}return s}function Jne(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,eo.WARN),t==="normal"?0:parseInt(t??"0",10)}function ri(e,t){return Math.round(e.getBoundingClientRect()[t])}function f8(e,t){return Math.abs(e-t)<1.01}function p8(e,t,n,r=Uc,o){const s=H.useRef(null),i=H.useRef(null),l=H.useRef(null),u=H.useCallback(h=>{const g=h.target,x=g===window||g===document,y=x?window.pageYOffset||document.documentElement.scrollTop:g.scrollTop,b=x?document.documentElement.scrollHeight:g.scrollHeight,w=x?window.innerHeight:g.offsetHeight,S=()=>{e({scrollTop:Math.max(y,0),scrollHeight:b,viewportHeight:w})};h.suppressFlushSync?S():ID.flushSync(S),i.current!==null&&(y===i.current||y<=0||y===b-w)&&(i.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);H.useEffect(()=>{const h=o||s.current;return r(o||s.current),u({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",u,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",u)}},[s,u,n,r,o]);function p(h){const g=s.current;if(!g||"offsetHeight"in g&&g.offsetHeight===0)return;const x=h.behavior==="smooth";let y,b,w;g===window?(b=Math.max(ri(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,w=document.documentElement.scrollTop):(b=g.scrollHeight,y=ri(g,"height"),w=g.scrollTop);const S=b-y;if(h.top=Math.ceil(Math.max(Math.min(S,h.top),0)),f8(y,b)||h.top===w){e({scrollTop:w,scrollHeight:b,viewportHeight:y}),x&&t(!0);return}x?(i.current=h.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,i.current=null,t(!0)},1e3)):i.current=null,g.scrollTo(h)}function m(h){s.current.scrollBy(h)}return{scrollerRef:s,scrollByCallback:m,scrollToCallback:p}}const Sr=qt(()=>{const e=Tt(),t=Tt(),n=Ve(0),r=Tt(),o=Ve(0),s=Tt(),i=Tt(),l=Ve(0),u=Ve(0),p=Ve(0),m=Ve(0),h=Tt(),g=Tt(),x=Ve(!1);return st(Pe(e,Xe(({scrollTop:y})=>y)),t),st(Pe(e,Xe(({scrollHeight:y})=>y)),i),st(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:l,fixedHeaderHeight:u,fixedFooterHeight:p,footerHeight:m,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:h,scrollBy:g,statefulScrollTop:o,deviation:n,scrollingInProgress:x}},[],{singleton:!0}),cd={lvl:0};function m8(e,t,n,r=cd,o=cd){return{k:e,v:t,lvl:n,l:r,r:o}}function tn(e){return e===cd}function gc(){return cd}function gx(e,t){if(tn(e))return cd;const{k:n,l:r,r:o}=e;if(t===n){if(tn(r))return o;if(tn(o))return r;{const[s,i]=h8(r);return Up(Vn(e,{k:s,v:i,l:g8(r)}))}}else return t<n?Up(Vn(e,{l:gx(r,t)})):Up(Vn(e,{r:gx(o,t)}))}function ud(e,t){if(!tn(e))return t===e.k?e.v:t<e.k?ud(e.l,t):ud(e.r,t)}function ns(e,t,n="k"){if(tn(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=ns(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return ns(e.l,t,n)}function Yr(e,t,n){return tn(e)?m8(t,n,1):t===e.k?Vn(e,{k:t,v:n}):t<e.k?Mj(Vn(e,{l:Yr(e.l,t,n)})):Mj(Vn(e,{r:Yr(e.r,t,n)}))}function vx(e,t,n){if(tn(e))return[];const{k:r,v:o,l:s,r:i}=e;let l=[];return r>t&&(l=l.concat(vx(s,t,n))),r>=t&&r<=n&&l.push({k:r,v:o}),r<=n&&(l=l.concat(vx(i,t,n))),l}function Mi(e){return tn(e)?[]:[...Mi(e.l),{k:e.k,v:e.v},...Mi(e.r)]}function h8(e){return tn(e.r)?[e.k,e.v]:h8(e.r)}function g8(e){return tn(e.r)?e.l:Up(Vn(e,{r:g8(e.r)}))}function Vn(e,t){return m8(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Hv(e){return tn(e)||e.lvl>e.r.lvl}function Mj(e){return xx(x8(e))}function Up(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Hv(t))return x8(Vn(e,{lvl:r-1}));if(!tn(t)&&!tn(t.r))return Vn(t.r,{l:Vn(t,{r:t.r.l}),r:Vn(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(Hv(e))return xx(Vn(e,{lvl:r-1}));if(!tn(n)&&!tn(n.l)){const o=n.l,s=Hv(o)?n.lvl-1:n.lvl;return Vn(o,{l:Vn(e,{r:o.l,lvl:r-1}),r:xx(Vn(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function yg(e,t,n){if(tn(e))return[];const r=ns(e,t)[0];return ere(vx(e,r,n))}function v8(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:u}=t(e[i]);s.push({start:r,end:l-1,value:o}),r=l,o=u}return s.push({start:r,end:1/0,value:o}),s}function ere(e){return v8(e,({k:t,v:n})=>({index:t,value:n}))}function xx(e){const{r:t,lvl:n}=e;return!tn(t)&&!tn(t.r)&&t.lvl===n&&t.r.lvl===n?Vn(t,{l:Vn(e,{r:t.l}),lvl:n+1}):e}function x8(e){const{l:t}=e;return!tn(t)&&t.lvl===e.lvl?Vn(t,{r:Vn(e,{l:t.r})}):e}function oh(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],l=n(i,t);if(l===0)return s;if(l===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function b8(e,t,n){return e[oh(e,t,n)]}function tre(e,t,n,r){const o=oh(e,t,r),s=oh(e,n,r,o);return e.slice(o,s+1)}const Ly=qt(()=>({recalcInProgress:Ve(!1)}),[],{singleton:!0});function nre(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function Oj(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function rre(e,t){let n=tn(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:i}=r;if(n=Math.min(n,s),tn(e)){e=Yr(e,0,o);continue}const l=yg(e,s-1,i+1);if(l.some(nre(r)))continue;let u=!1,p=!1;for(const{start:m,end:h,value:g}of l)u?(i>=m||o===g)&&(e=gx(e,m)):(p=g!==o,u=!0),h>i&&i>=m&&g!==o&&(e=Yr(e,i+1,g));p&&(e=Yr(e,s,o))}return[e,n]}function ore(){return{offsetTree:[],sizeTree:gc(),groupOffsetTree:gc(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function zy({index:e},t){return t===e?0:t<e?-1:1}function sre({offset:e},t){return t===e?0:t<e?-1:1}function are(e){return{index:e.index,value:e}}function ire(e,t,n,r=0){return r>0&&(t=Math.max(t,b8(e,r,zy).offset)),v8(tre(e,t,n,sre),are)}function bx(e,t,n,r){let o=e,s=0,i=0,l=0,u=0;if(t!==0){u=oh(o,t-1,zy),l=o[u].offset;const m=ns(n,t-1);s=m[0],i=m[1],o.length&&o[u].size===ns(n,t)[1]&&(u-=1),o=o.slice(0,u+1)}else o=[];for(const{start:p,value:m}of yg(n,t,1/0)){const h=p-s,g=h*i+l+h*r;o.push({offset:g,size:m,index:p}),s=p,l=g,i=m}return{offsetTree:o,lastIndex:s,lastOffset:l,lastSize:i}}function lre(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,eo.DEBUG);const s=e.sizeTree;let i=s,l=0;if(n.length>0&&tn(s)&&t.length===2){const g=t[0].size,x=t[1].size;i=n.reduce((y,b)=>Yr(Yr(y,b,g),b+1,x),i)}else[i,l]=rre(i,t);if(i===s)return e;const{offsetTree:u,lastIndex:p,lastSize:m,lastOffset:h}=bx(e.offsetTree,l,i,o);return{sizeTree:i,offsetTree:u,lastIndex:p,lastOffset:h,lastSize:m,groupOffsetTree:n.reduce((g,x)=>Yr(g,x,dd(x,u,o)),gc()),groupIndices:n}}function dd(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=b8(t,e,zy),i=e-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function cre(e){return typeof e.groupIndex<"u"}function y8(e,t,n){if(cre(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=C8(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function C8(e,t){if(!Cg(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Cg(e){return!tn(e.groupOffsetTree)}function ure(e){return Mi(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],i=s?s.k-1:1/0;return{startIndex:t,endIndex:i,size:n}})}const dre={offsetHeight:"height",offsetWidth:"width"},Ts=qt(([{log:e},{recalcInProgress:t}])=>{const n=Tt(),r=Tt(),o=yr(r,0),s=Tt(),i=Tt(),l=Ve(0),u=Ve([]),p=Ve(void 0),m=Ve(void 0),h=Ve((I,M)=>ri(I,dre[M])),g=Ve(void 0),x=Ve(0),y=ore(),b=yr(Pe(n,_t(u,e,x),bs(lre,y),pn()),y),w=yr(Pe(u,pn(),bs((I,M)=>({prev:I.current,current:M}),{prev:[],current:[]}),Xe(({prev:I})=>I)),[]);st(Pe(u,gt(I=>I.length>0),_t(b,x),Xe(([I,M,R])=>{const D=I.reduce((A,O,T)=>Yr(A,O,dd(O,M.offsetTree,R)||T),gc());return{...M,groupIndices:I,groupOffsetTree:D}})),b),st(Pe(r,_t(b),gt(([I,{lastIndex:M}])=>I<M),Xe(([I,{lastIndex:M,lastSize:R}])=>[{startIndex:I,endIndex:M,size:R}])),n),st(p,m);const S=yr(Pe(p,Xe(I=>I===void 0)),!0);st(Pe(m,gt(I=>I!==void 0&&tn(bo(b).sizeTree)),Xe(I=>[{startIndex:0,endIndex:0,size:I}])),n);const j=Jr(Pe(n,_t(b),bs(({sizes:I},[M,R])=>({changed:R!==I,sizes:R}),{changed:!1,sizes:y}),Xe(I=>I.changed)));Yt(Pe(l,bs((I,M)=>({diff:I.prev-M,prev:M}),{diff:0,prev:0}),Xe(I=>I.diff)),I=>{const{groupIndices:M}=bo(b);if(I>0)wt(t,!0),wt(s,I+Oj(I,M));else if(I<0){const R=bo(w);R.length>0&&(I-=Oj(-I,R)),wt(i,I)}}),Yt(Pe(l,_t(e)),([I,M])=>{I<0&&M("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},eo.ERROR)});const _=Jr(s);st(Pe(s,_t(b),Xe(([I,M])=>{const R=M.groupIndices.length>0,D=[],A=M.lastSize;if(R){const O=ud(M.sizeTree,0);let T=0,X=0;for(;T<I;){const U=M.groupIndices[X],N=M.groupIndices.length===X+1?1/0:M.groupIndices[X+1]-U-1;D.push({startIndex:U,endIndex:U,size:O}),D.push({startIndex:U+1,endIndex:U+1+N-1,size:A}),X++,T+=N+1}const B=Mi(M.sizeTree);return T!==I&&B.shift(),B.reduce((U,{k:N,v:$})=>{let q=U.ranges;return U.prevSize!==0&&(q=[...U.ranges,{startIndex:U.prevIndex,endIndex:N+I-1,size:U.prevSize}]),{ranges:q,prevIndex:N+I,prevSize:$}},{ranges:D,prevIndex:I,prevSize:0}).ranges}return Mi(M.sizeTree).reduce((O,{k:T,v:X})=>({ranges:[...O.ranges,{startIndex:O.prevIndex,endIndex:T+I-1,size:O.prevSize}],prevIndex:T+I,prevSize:X}),{ranges:[],prevIndex:0,prevSize:A}).ranges})),n);const E=Jr(Pe(i,_t(b,x),Xe(([I,{offsetTree:M},R])=>{const D=-I;return dd(D,M,R)})));return st(Pe(i,_t(b,x),Xe(([I,M,R])=>{if(M.groupIndices.length>0){if(tn(M.sizeTree))return M;let A=gc();const O=bo(w);let T=0,X=0,B=0;for(;T<-I;){B=O[X];const U=O[X+1]-B-1;X++,T+=U+1}if(A=Mi(M.sizeTree).reduce((U,{k:N,v:$})=>Yr(U,Math.max(0,N+I),$),A),T!==-I){const U=ud(M.sizeTree,B);A=Yr(A,0,U);const N=ns(M.sizeTree,-I+1)[1];A=Yr(A,1,N)}return{...M,sizeTree:A,...bx(M.offsetTree,0,A,R)}}else{const A=Mi(M.sizeTree).reduce((O,{k:T,v:X})=>Yr(O,Math.max(0,T+I),X),gc());return{...M,sizeTree:A,...bx(M.offsetTree,0,A,R)}}})),b),{data:g,totalCount:r,sizeRanges:n,groupIndices:u,defaultItemSize:m,fixedItemSize:p,unshiftWith:s,shiftWith:i,shiftWithOffset:E,beforeUnshiftWith:_,firstItemIndex:l,gap:x,sizes:b,listRefresh:j,statefulTotalCount:o,trackItemSizes:S,itemSize:h}},hn(fi,Ly),{singleton:!0}),fre=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function w8(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!fre)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Xd=qt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:i,smoothScrollTargetReached:l,headerHeight:u,footerHeight:p,fixedHeaderHeight:m,fixedFooterHeight:h},{log:g}])=>{const x=Tt(),y=Ve(0);let b=null,w=null,S=null;function j(){b&&(b(),b=null),S&&(S(),S=null),w&&(clearTimeout(w),w=null),wt(o,!1)}return st(Pe(x,_t(e,s,t,y,u,p,g),_t(r,m,h),Xe(([[_,E,I,M,R,D,A,O],T,X,B])=>{const V=w8(_),{align:U,behavior:N,offset:$}=V,q=M-1,F=y8(V,E,q);let Q=dd(F,E.offsetTree,T)+D;U==="end"?(Q+=X+ns(E.sizeTree,F)[1]-I+B,F===q&&(Q+=A)):U==="center"?Q+=(X+ns(E.sizeTree,F)[1]-I+B)/2:Q-=R,$&&(Q+=$);const Y=se=>{j(),se?(O("retrying to scroll to",{location:_},eo.DEBUG),wt(x,_)):O("list did not change, scroll successful",{},eo.DEBUG)};if(j(),N==="smooth"){let se=!1;S=Yt(n,ae=>{se=se||ae}),b=ca(l,()=>{Y(se)})}else b=ca(Pe(n,pre(150)),Y);return w=setTimeout(()=>{j()},1200),wt(o,!0),O("scrolling from index to",{index:F,top:Q,behavior:N},eo.DEBUG),{top:Q,behavior:N}})),i),{scrollToIndex:x,topListHeight:y}},hn(Ts,Sr,fi),{singleton:!0});function pre(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const fd="up",Hu="down",mre="none",hre={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},gre=0,Qd=qt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=Ve(!1),l=Ve(!0),u=Tt(),p=Tt(),m=Ve(4),h=Ve(gre),g=yr(Pe(Ej(Pe(ht(t),Pc(1),qs(!0)),Pe(ht(t),Pc(1),qs(!1),Pj(100))),pn()),!1),x=yr(Pe(Ej(Pe(s,qs(!0)),Pe(s,qs(!1),Pj(200))),pn()),!1);st(Pe(Qn(ht(t),ht(h)),Xe(([j,_])=>j<=_),pn()),l),st(Pe(l,Ga(50)),p);const y=Jr(Pe(Qn(e,ht(n),ht(r),ht(o),ht(m)),bs((j,[{scrollTop:_,scrollHeight:E},I,M,R,D])=>{const A=_+I-E>-D,O={viewportHeight:I,scrollTop:_,scrollHeight:E};if(A){let X,B;return _>j.state.scrollTop?(X="SCROLLED_DOWN",B=j.state.scrollTop-_):(X="SIZE_DECREASED",B=j.state.scrollTop-_||j.scrollTopDelta),{atBottom:!0,state:O,atBottomBecause:X,scrollTopDelta:B}}let T;return O.scrollHeight>j.state.scrollHeight?T="SIZE_INCREASED":I<j.state.viewportHeight?T="VIEWPORT_HEIGHT_DECREASING":_<j.state.scrollTop?T="SCROLLING_UPWARDS":T="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:T,state:O}},hre),pn((j,_)=>j&&j.atBottom===_.atBottom))),b=yr(Pe(e,bs((j,{scrollTop:_,scrollHeight:E,viewportHeight:I})=>{if(f8(j.scrollHeight,E))return{scrollTop:_,scrollHeight:E,jump:0,changed:!1};{const M=E-(_+I)<1;return j.scrollTop!==_&&M?{scrollHeight:E,scrollTop:_,jump:j.scrollTop-_,changed:!0}:{scrollHeight:E,scrollTop:_,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),gt(j=>j.changed),Xe(j=>j.jump)),0);st(Pe(y,Xe(j=>j.atBottom)),i),st(Pe(i,Ga(50)),u);const w=Ve(Hu);st(Pe(e,Xe(({scrollTop:j})=>j),pn(),bs((j,_)=>bo(x)?{direction:j.direction,prevScrollTop:_}:{direction:_<j.prevScrollTop?fd:Hu,prevScrollTop:_},{direction:Hu,prevScrollTop:0}),Xe(j=>j.direction)),w),st(Pe(e,Ga(50),qs(mre)),w);const S=Ve(0);return st(Pe(g,gt(j=>!j),qs(0)),S),st(Pe(t,Ga(100),_t(g),gt(([j,_])=>!!_),bs(([j,_],[E])=>[_,E],[0,0]),Xe(([j,_])=>_-j)),S),{isScrolling:g,isAtTop:l,isAtBottom:i,atBottomState:y,atTopStateChange:p,atBottomStateChange:u,scrollDirection:w,atBottomThreshold:m,atTopThreshold:h,scrollVelocity:S,lastJumpDueToItemResize:b}},hn(Sr)),pi=qt(([{log:e}])=>{const t=Ve(!1),n=Jr(Pe(t,gt(r=>r),pn()));return Yt(t,r=>{r&&bo(e)("props updated",{},eo.DEBUG)}),{propsReady:t,didMount:n}},hn(fi),{singleton:!0});function Fy(e,t){e==0?t():requestAnimationFrame(()=>Fy(e-1,t))}function By(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Yd=qt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:s}])=>{const i=Ve(!0),l=Ve(0),u=Ve(!1);return st(Pe(s,_t(l),gt(([p,m])=>!!m),qs(!1)),i),Yt(Pe(Qn(t,s),_t(i,e,n,u),gt(([[,p],m,{sizeTree:h},g,x])=>p&&(!tn(h)||Ty(g))&&!m&&!x),_t(l)),([,p])=>{wt(u,!0),Fy(3,()=>{ca(r,()=>wt(i,!0)),wt(o,p)})}),{scrolledToInitialItem:i,initialTopMostItemIndex:l}},hn(Ts,Sr,Xd,pi),{singleton:!0});function Rj(e){return e?e==="smooth"?"smooth":"auto":!1}const vre=(e,t)=>typeof e=="function"?Rj(e(t)):t&&Rj(e),xre=qt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:i,didMount:l},{log:u},{scrollingInProgress:p}])=>{const m=Ve(!1),h=Tt();let g=null;function x(b){wt(o,{index:"LAST",align:"end",behavior:b})}Yt(Pe(Qn(Pe(ht(e),Pc(1)),l),_t(ht(m),n,s,p),Xe(([[b,w],S,j,_,E])=>{let I=w&&_,M="auto";return I&&(M=vre(S,j||E),I=I&&!!M),{totalCount:b,shouldFollow:I,followOutputBehavior:M}}),gt(({shouldFollow:b})=>b)),({totalCount:b,followOutputBehavior:w})=>{g&&(g(),g=null),g=ca(t,()=>{bo(u)("following output to ",{totalCount:b},eo.DEBUG),x(w),g=null})});function y(b){const w=ca(r,S=>{b&&!S.atBottom&&S.notAtBottomBecause==="SIZE_INCREASED"&&!g&&(bo(u)("scrolling to bottom due to increased size",{},eo.DEBUG),x("auto"))});setTimeout(w,100)}return Yt(Pe(Qn(ht(m),e,i),gt(([b,,w])=>b&&w),bs(({value:b},[,w])=>({refreshed:b===w,value:w}),{refreshed:!1,value:0}),gt(({refreshed:b})=>b),_t(m,e)),([,b])=>{y(b!==!1)}),Yt(h,()=>{y(bo(m)!==!1)}),Yt(Qn(ht(m),r),([b,w])=>{b&&!w.atBottom&&w.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&x("auto")}),{followOutput:m,autoscrollToBottom:h}},hn(Ts,Qd,Xd,Yd,pi,fi,Sr));function bre(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const S8=qt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Tt(),i=Tt(),l=Jr(Pe(s,Xe(bre)));return st(Pe(l,Xe(u=>u.totalCount)),e),st(Pe(l,Xe(u=>u.groupIndices)),t),st(Pe(Qn(r,n,o),gt(([u,p])=>Cg(p)),Xe(([u,p,m])=>ns(p.groupOffsetTree,Math.max(u-m,0),"v")[0]),pn(),Xe(u=>[u])),i),{groupCounts:s,topItemsIndexes:i}},hn(Ts,Sr));function pd(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function k8(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const sh="top",ah="bottom",Dj="none";function Aj(e,t,n){return typeof e=="number"?n===fd&&t===sh||n===Hu&&t===ah?e:0:n===fd?t===sh?e.main:e.reverse:t===ah?e.main:e.reverse}function Tj(e,t){return typeof e=="number"?e:e[t]||0}const Hy=qt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Tt(),i=Ve(0),l=Ve(0),u=Ve(0),p=yr(Pe(Qn(ht(e),ht(t),ht(r),ht(s,pd),ht(u),ht(i),ht(o),ht(n),ht(l)),Xe(([m,h,g,[x,y],b,w,S,j,_])=>{const E=m-j,I=w+S,M=Math.max(g-E,0);let R=Dj;const D=Tj(_,sh),A=Tj(_,ah);return x-=j,x+=g+S,y+=g+S,y-=j,x>m+I-D&&(R=fd),y<m-M+h+A&&(R=Hu),R!==Dj?[Math.max(E-g-Aj(b,sh,R)-D,0),E-M-S+h+Aj(b,ah,R)+A]:null}),gt(m=>m!=null),pn(pd)),[0,0]);return{listBoundary:s,overscan:u,topListHeight:i,increaseViewportBy:l,visibleRange:p}},hn(Sr),{singleton:!0});function yre(e,t,n){if(Cg(t)){const r=C8(e,t);return[{index:ns(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const Nj={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function $j(e,t,n){if(e.length===0)return[];if(!Cg(t))return e.map(p=>({...p,index:p.index+n,originalIndex:p.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=yg(t.groupOffsetTree,r,o);let l,u=0;for(const p of e){(!l||l.end<p.index)&&(l=i.shift(),u=t.groupIndices.indexOf(l.start));let m;p.index===l.start?m={type:"group",index:u}:m={index:p.index-(u+1)+n,groupIndex:u},s.push({...m,size:p.size,offset:p.offset,originalIndex:p.index,data:p.data})}return s}function Gp(e,t,n,r,o,s){const{lastSize:i,lastOffset:l,lastIndex:u}=o;let p=0,m=0;if(e.length>0){p=e[0].offset;const b=e[e.length-1];m=b.offset+b.size}const h=n-u,g=l+h*i+(h-1)*r,x=p,y=g-m;return{items:$j(e,o,s),topItems:$j(t,o,s),topListHeight:t.reduce((b,w)=>w.size+b,0),offsetTop:p,offsetBottom:y,top:x,bottom:m,totalCount:n,firstItemIndex:s}}const cl=qt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:i,listBoundary:l,topListHeight:u},{scrolledToInitialItem:p,initialTopMostItemIndex:m},{topListHeight:h},g,{didMount:x},{recalcInProgress:y}])=>{const b=Ve([]),w=Tt();st(s.topItemsIndexes,b);const S=yr(Pe(Qn(x,y,ht(i,pd),ht(t),ht(e),ht(m),p,ht(b),ht(r),ht(o),n),gt(([I,M,,R,,,,,,,D])=>{const A=D&&D.length!==R;return I&&!M&&!A}),Xe(([,,[I,M],R,D,A,O,T,X,B,V])=>{const U=D,{sizeTree:N,offsetTree:$}=U;if(R===0||I===0&&M===0)return{...Nj,totalCount:R};if(tn(N))return Gp(yre(By(A,R),U,V),[],R,B,U,X);const q=[];if(T.length>0){const ae=T[0],re=T[T.length-1];let G=0;for(const K of yg(N,ae,re)){const ee=K.value,ce=Math.max(K.start,ae),J=Math.min(K.end,re);for(let ie=ce;ie<=J;ie++)q.push({index:ie,size:ee,offset:G,data:V&&V[ie]}),G+=ee}}if(!O)return Gp([],q,R,B,U,X);const F=T.length>0?T[T.length-1]+1:0,Q=ire($,I,M,F);if(Q.length===0)return null;const Y=R-1,se=bg([],ae=>{for(const re of Q){const G=re.value;let K=G.offset,ee=re.start;const ce=G.size;if(G.offset<I){ee+=Math.floor((I-G.offset+B)/(ce+B));const ie=ee-re.start;K+=ie*ce+ie*B}ee<F&&(K+=(F-ee)*ce,ee=F);const J=Math.min(re.end,Y);for(let ie=ee;ie<=J&&!(K>=M);ie++)ae.push({index:ie,size:ce,offset:K,data:V&&V[ie]}),K+=ce+B}});return Gp(se,q,R,B,U,X)}),gt(I=>I!==null),pn()),Nj);st(Pe(n,gt(Ty),Xe(I=>I==null?void 0:I.length)),t),st(Pe(S,Xe(I=>I.topListHeight)),h),st(h,u),st(Pe(S,Xe(I=>[I.top,I.bottom])),l),st(Pe(S,Xe(I=>I.items)),w);const j=Jr(Pe(S,gt(({items:I})=>I.length>0),_t(t,n),gt(([{items:I},M])=>I[I.length-1].originalIndex===M-1),Xe(([,I,M])=>[I-1,M]),pn(pd),Xe(([I])=>I))),_=Jr(Pe(S,Ga(200),gt(({items:I,topItems:M})=>I.length>0&&I[0].originalIndex===M.length),Xe(({items:I})=>I[0].index),pn())),E=Jr(Pe(S,gt(({items:I})=>I.length>0),Xe(({items:I})=>{let M=0,R=I.length-1;for(;I[M].type==="group"&&M<R;)M++;for(;I[R].type==="group"&&R>M;)R--;return{startIndex:I[M].index,endIndex:I[R].index}}),pn(k8)));return{listState:S,topItemsIndexes:b,endReached:j,startReached:_,rangeChanged:E,itemsRendered:w,...g}},hn(Ts,S8,Hy,Yd,Xd,Qd,pi,Ly),{singleton:!0}),Cre=qt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{listState:s},{didMount:i}])=>{const l=Ve(0);return st(Pe(i,_t(l),gt(([,u])=>u!==0),_t(o,e,t,r,n),Xe(([[,u],p,m,h,g,x=[]])=>{let y=0;if(m.groupIndices.length>0)for(const j of m.groupIndices){if(j-y>=u)break;y++}const b=u+y,w=By(p,b),S=Array.from({length:b}).map((j,_)=>({index:_+w,size:0,offset:0,data:x[_+w]}));return Gp(S,[],b,g,m,h)})),s),{initialItemCount:l}},hn(Ts,Yd,cl,pi),{singleton:!0}),j8=qt(([{scrollVelocity:e}])=>{const t=Ve(!1),n=Tt(),r=Ve(!1);return st(Pe(e,_t(r,t,n),gt(([o,s])=>!!s),Xe(([o,s,i,l])=>{const{exit:u,enter:p}=s;if(i){if(u(o,l))return!1}else if(p(o,l))return!0;return i}),pn()),t),Yt(Pe(Qn(t,e,n),_t(r)),([[o,s,i],l])=>o&&l&&l.change&&l.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},hn(Qd),{singleton:!0}),wre=qt(([{topItemsIndexes:e}])=>{const t=Ve(0);return st(Pe(t,gt(n=>n>0),Xe(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},hn(cl)),_8=qt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Tt(),i=yr(Pe(Qn(e,r,t,n,o),Xe(([l,u,p,m,h])=>l+u+p+m+h.offsetBottom+h.bottom)),0);return st(ht(i),s),{totalListHeight:i,totalListHeightChanged:s}},hn(Sr,cl),{singleton:!0});function I8(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Sre=I8(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kre=qt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:i,lastJumpDueToItemResize:l},{listState:u},{beforeUnshiftWith:p,shiftWithOffset:m,sizes:h,gap:g},{log:x},{recalcInProgress:y}])=>{const b=Jr(Pe(u,_t(l),bs(([,S,j,_],[{items:E,totalCount:I,bottom:M,offsetBottom:R},D])=>{const A=M+R;let O=0;return j===I&&S.length>0&&E.length>0&&(E[0].originalIndex===0&&S[0].originalIndex===0||(O=A-_,O!==0&&(O+=D))),[O,E,I,A]},[0,[],0,0]),gt(([S])=>S!==0),_t(t,i,r,s,x,y),gt(([,S,j,_,,,E])=>!E&&!_&&S!==0&&j===fd),Xe(([[S],,,,,j])=>(j("Upward scrolling compensation",{amount:S},eo.DEBUG),S))));function w(S){S>0?(wt(e,{top:-S,behavior:"auto"}),wt(n,0)):(wt(n,0),wt(e,{top:-S,behavior:"auto"}))}return Yt(Pe(b,_t(n,o)),([S,j,_])=>{_&&Sre()?wt(n,j-S):w(-S)}),Yt(Pe(Qn(yr(o,!1),n,y),gt(([S,j,_])=>!S&&!_&&j!==0),Xe(([S,j])=>j),Ga(1)),w),st(Pe(m,Xe(S=>({top:-S}))),e),Yt(Pe(p,_t(h,g),Xe(([S,{lastSize:j,groupIndices:_,sizeTree:E},I])=>{function M(R){return R*(j+I)}if(_.length===0)return M(S);{let R=0;const D=ud(E,0);let A=0,O=0;for(;A<S;){A++,R+=D;let T=_.length===O+1?1/0:_[O+1]-_[O]-1;A+T>S&&(R-=D,T=S-A+1),A+=T,R+=M(T),O++}return R}})),S=>{wt(n,S),requestAnimationFrame(()=>{wt(e,{top:S}),requestAnimationFrame(()=>{wt(n,0),wt(y,!1)})})}),{deviation:n}},hn(Sr,Qd,cl,Ts,fi,Ly)),jre=qt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Ve(0);return Yt(Pe(e,_t(r),gt(([,o])=>o!==0),Xe(([,o])=>({top:o}))),o=>{ca(Pe(n,Pc(1),gt(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{wt(t,o)})})}),{initialScrollTop:r}},hn(pi,Sr,cl),{singleton:!0}),_re=qt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Ve(!1),r=yr(Pe(Qn(n,e,t),gt(([o])=>o),Xe(([,o,s])=>Math.max(0,o-s)),Ga(0),pn()),0);return{alignToBottom:n,paddingTopAddition:r}},hn(Sr,_8),{singleton:!0}),Vy=qt(([{scrollTo:e,scrollContainerState:t}])=>{const n=Tt(),r=Tt(),o=Tt(),s=Ve(!1),i=Ve(void 0);return st(Pe(Qn(n,r),Xe(([{viewportHeight:l,scrollTop:u,scrollHeight:p},{offsetTop:m}])=>({scrollTop:Math.max(0,u-m),scrollHeight:p,viewportHeight:l}))),t),st(Pe(e,_t(r),Xe(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},hn(Sr)),Ire=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...i}})=>e<n?{...i,behavior:o,align:s??"start"}:t>r?{...i,behavior:o,align:s??"end"}:null,Pre=qt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:i,fixedFooterHeight:l,scrollingInProgress:u},{scrollToIndex:p}])=>{const m=Tt();return st(Pe(m,_t(e,o,t,s,i,l,r),_t(n),Xe(([[h,g,x,y,b,w,S,j],_])=>{const{done:E,behavior:I,align:M,calculateViewLocation:R=Ire,...D}=h,A=y8(h,g,y-1),O=dd(A,g.offsetTree,_)+b+w,T=O+ns(g.sizeTree,A)[1],X=j+w,B=j+x-S,V=R({itemTop:O,itemBottom:T,viewportTop:X,viewportBottom:B,locationParams:{behavior:I,align:M,...D}});return V?E&&ca(Pe(u,gt(U=>U===!1),Pc(bo(u)?1:2)),E):E&&E(),V}),gt(h=>h!==null)),p),{scrollIntoView:m}},hn(Ts,Sr,Xd,cl,fi),{singleton:!0}),Ere=qt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:s,windowScrollContainerState:i,windowViewportRect:l}])=>{const u=Tt(),p=Ve(void 0),m=Ve(null),h=Ve(null);return st(i,m),st(l,h),Yt(Pe(u,_t(e,n,s,m,h)),([g,x,y,b,w,S])=>{const j=ure(x.sizeTree);b&&w!==null&&S!==null&&(y=w.scrollTop-S.offsetTop),g({ranges:j,scrollTop:y})}),st(Pe(p,gt(Ty),Xe(Mre)),r),st(Pe(o,_t(p),gt(([,g])=>g!==void 0),pn(),Xe(([,g])=>g.ranges)),t),{getState:u,restoreStateFrom:p}},hn(Ts,Sr,Yd,pi,Vy));function Mre(e){return{offset:e.scrollTop,index:0,align:"start"}}const Ore=qt(([e,t,n,r,o,s,i,l,u,p])=>({...e,...t,...n,...r,...o,...s,...i,...l,...u,...p}),hn(Hy,Cre,pi,j8,_8,jre,_re,Vy,Pre,fi)),Rre=qt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:i,firstItemIndex:l,groupIndices:u,statefulTotalCount:p,gap:m,sizes:h},{initialTopMostItemIndex:g,scrolledToInitialItem:x},y,b,w,{listState:S,topItemsIndexes:j,..._},{scrollToIndex:E},I,{topItemCount:M},{groupCounts:R},D])=>(st(_.rangeChanged,D.scrollSeekRangeChanged),st(Pe(D.windowViewportRect,Xe(A=>A.visibleHeight)),y.viewportHeight),{totalCount:e,data:i,firstItemIndex:l,sizeRanges:t,initialTopMostItemIndex:g,scrolledToInitialItem:x,topItemsIndexes:j,topItemCount:M,groupCounts:R,fixedItemHeight:n,defaultItemHeight:r,gap:m,...w,statefulTotalCount:p,listState:S,scrollToIndex:E,trackItemSizes:o,itemSize:s,groupIndices:u,..._,...D,...y,sizes:h,...b}),hn(Ts,Yd,Sr,Ere,xre,cl,Xd,kre,wre,S8,Ore)),Vv="-webkit-sticky",Lj="sticky",P8=I8(()=>{if(typeof document>"u")return Lj;const e=document.createElement("div");return e.style.position=Vv,e.style.position===Vv?Vv:Lj});function E8(e,t){const n=H.useRef(null),r=H.useCallback(l=>{if(l===null||!l.offsetParent)return;const u=l.getBoundingClientRect(),p=u.width;let m,h;if(t){const g=t.getBoundingClientRect(),x=u.top-g.top;m=g.height-Math.max(0,x),h=x+t.scrollTop}else m=window.innerHeight-Math.max(0,u.top),h=u.top+window.pageYOffset;n.current={offsetTop:h,visibleHeight:m,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=$y(r),i=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",i);const l=new ResizeObserver(i);return l.observe(t),()=>{t.removeEventListener("scroll",i),l.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}const M8=H.createContext(void 0),O8=H.createContext(void 0);function R8(e){return e}const Dre=qt(()=>{const e=Ve(u=>`Item ${u}`),t=Ve(null),n=Ve(u=>`Group ${u}`),r=Ve({}),o=Ve(R8),s=Ve("div"),i=Ve(Uc),l=(u,p=null)=>yr(Pe(r,Xe(m=>m[u]),pn()),p);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:i,FooterComponent:l("Footer"),HeaderComponent:l("Header"),TopItemListComponent:l("TopItemList"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),GroupComponent:l("Group","div"),ScrollerComponent:l("Scroller","div"),EmptyPlaceholder:l("EmptyPlaceholder"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder")}}),Are=qt(([e,t])=>({...e,...t}),hn(Rre,Dre)),Tre=({height:e})=>H.createElement("div",{style:{height:e}}),Nre={position:P8(),zIndex:1,overflowAnchor:"none"},$re={overflowAnchor:"none"},zj=H.memo(function({showTopList:t=!1}){const n=Rt("listState"),r=yo("sizeRanges"),o=Rt("useWindowScroll"),s=Rt("customScrollParent"),i=yo("windowScrollContainerState"),l=yo("scrollContainerState"),u=s||o?i:l,p=Rt("itemContent"),m=Rt("context"),h=Rt("groupContent"),g=Rt("trackItemSizes"),x=Rt("itemSize"),y=Rt("log"),b=yo("gap"),{callbackRef:w}=Yne(r,x,g,t?Uc:u,y,b,s),[S,j]=H.useState(0);Wy("deviation",V=>{S!==V&&j(V)});const _=Rt("EmptyPlaceholder"),E=Rt("ScrollSeekPlaceholder")||Tre,I=Rt("ListComponent"),M=Rt("ItemComponent"),R=Rt("GroupComponent"),D=Rt("computeItemKey"),A=Rt("isSeeking"),O=Rt("groupIndices").length>0,T=Rt("paddingTopAddition"),X=Rt("scrolledToInitialItem"),B=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+T,paddingBottom:n.offsetBottom,marginTop:S,...X?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&_?H.createElement(_,Rr(_,m)):H.createElement(I,{...Rr(I,m),ref:w,style:B,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(V=>{const U=V.originalIndex,N=D(U+n.firstItemIndex,V.data,m);return A?H.createElement(E,{...Rr(E,m),key:N,index:V.index,height:V.size,type:V.type||"item",...V.type==="group"?{}:{groupIndex:V.groupIndex}}):V.type==="group"?H.createElement(R,{...Rr(R,m),key:N,"data-index":U,"data-known-size":V.size,"data-item-index":V.index,style:Nre},h(V.index,m)):H.createElement(M,{...Rr(M,m),key:N,"data-index":U,"data-known-size":V.size,"data-item-index":V.index,"data-item-group-index":V.groupIndex,item:V.data,style:$re},O?p(V.index,V.groupIndex,V.data,m):p(V.index,V.data,m))}))}),Lre={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},wg={width:"100%",height:"100%",position:"absolute",top:0},zre={width:"100%",position:P8(),top:0,zIndex:1};function Rr(e,t){if(typeof e!="string")return{context:t}}const Fre=H.memo(function(){const t=Rt("HeaderComponent"),n=yo("headerHeight"),r=Rt("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=Rt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),Bre=H.memo(function(){const t=Rt("FooterComponent"),n=yo("footerHeight"),r=Rt("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=Rt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null});function D8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("scrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("scrollerRef"),g=n("context"),{scrollerRef:x,scrollByCallback:y,scrollToCallback:b}=p8(u,m,p,h);return t("scrollTo",b),t("scrollBy",y),H.createElement(p,{ref:x,style:{...Lre,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Rr(p,g)},i)})}function A8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("windowScrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("totalListHeight"),g=n("deviation"),x=n("customScrollParent"),y=n("context"),{scrollerRef:b,scrollByCallback:w,scrollToCallback:S}=p8(u,m,p,Uc,x);return qne(()=>(b.current=x||window,()=>{b.current=null}),[b,x]),t("windowScrollTo",S),t("scrollBy",w),H.createElement(p,{style:{position:"relative",...s,...h!==0?{height:h+g}:{}},"data-virtuoso-scroller":!0,...l,...Rr(p,y)},i)})}const Hre=({children:e})=>{const t=H.useContext(M8),n=yo("viewportHeight"),r=yo("fixedItemHeight"),o=ll(l8(n,s=>ri(s,"height")));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),H.createElement("div",{style:wg,ref:o,"data-viewport-type":"element"},e)},Vre=({children:e})=>{const t=H.useContext(M8),n=yo("windowViewportRect"),r=yo("fixedItemHeight"),o=Rt("customScrollParent"),s=E8(n,o);return H.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),H.createElement("div",{ref:s,style:wg,"data-viewport-type":"window"},e)},Wre=({children:e})=>{const t=Rt("TopItemListComponent"),n=Rt("headerHeight"),r={...zre,marginTop:`${n}px`},o=Rt("context");return H.createElement(t||"div",{style:r,context:o},e)},Ure=H.memo(function(t){const n=Rt("useWindowScroll"),r=Rt("topItemsIndexes").length>0,o=Rt("customScrollParent"),s=o||n?qre:Kre,i=o||n?Vre:Hre;return H.createElement(s,{...t},r&&H.createElement(Wre,null,H.createElement(zj,{showTopList:!0})),H.createElement(i,null,H.createElement(Fre,null),H.createElement(zj,null),H.createElement(Bre,null)))}),{Component:Gre,usePublisher:yo,useEmitterValue:Rt,useEmitter:Wy}=d8(Are,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Ure),Kre=D8({usePublisher:yo,useEmitterValue:Rt,useEmitter:Wy}),qre=A8({usePublisher:yo,useEmitterValue:Rt,useEmitter:Wy}),Xre=Gre,Fj={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Qre={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Bj,ceil:Hj,floor:ih,min:Wv,max:Vu}=Math;function Yre(e){return{...Qre,items:e}}function Vj(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function Zre(e,t){return e&&e.column===t.column&&e.row===t.row}function Ep(e,t){return e&&e.width===t.width&&e.height===t.height}const Jre=qt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:l,scrollContainerState:u,footerHeight:p,headerHeight:m},h,g,{propsReady:x,didMount:y},{windowViewportRect:b,useWindowScroll:w,customScrollParent:S,windowScrollContainerState:j,windowScrollTo:_},E])=>{const I=Ve(0),M=Ve(0),R=Ve(Fj),D=Ve({height:0,width:0}),A=Ve({height:0,width:0}),O=Tt(),T=Tt(),X=Ve(0),B=Ve(null),V=Ve({row:0,column:0}),U=Tt(),N=Tt(),$=Ve(!1),q=Ve(0),F=Ve(!0),Q=Ve(!1);Yt(Pe(y,_t(q),gt(([K,ee])=>!!ee)),()=>{wt(F,!1),wt(M,0)}),Yt(Pe(Qn(y,F,A,D,q,Q),gt(([K,ee,ce,J,,ie])=>K&&!ee&&ce.height!==0&&J.height!==0&&!ie)),([,,,,K])=>{wt(Q,!0),Fy(1,()=>{wt(O,K)}),ca(Pe(r),()=>{wt(n,[0,0]),wt(F,!0)})}),st(Pe(N,gt(K=>K!=null&&K.scrollTop>0),qs(0)),M),Yt(Pe(y,_t(N),gt(([,K])=>K!=null)),([,K])=>{K&&(wt(D,K.viewport),wt(A,K==null?void 0:K.item),wt(V,K.gap),K.scrollTop>0&&(wt($,!0),ca(Pe(r,Pc(1)),ee=>{wt($,!1)}),wt(i,{top:K.scrollTop})))}),st(Pe(D,Xe(({height:K})=>K)),o),st(Pe(Qn(ht(D,Ep),ht(A,Ep),ht(V,(K,ee)=>K&&K.column===ee.column&&K.row===ee.row),ht(r)),Xe(([K,ee,ce,J])=>({viewport:K,item:ee,gap:ce,scrollTop:J}))),U),st(Pe(Qn(ht(I),t,ht(V,Zre),ht(A,Ep),ht(D,Ep),ht(B),ht(M),ht($),ht(F),ht(q)),gt(([,,,,,,,K])=>!K),Xe(([K,[ee,ce],J,ie,de,ge,Ce,,he,fe])=>{const{row:Oe,column:_e}=J,{height:Ne,width:nt}=ie,{width:$e}=de;if(Ce===0&&(K===0||$e===0))return Fj;if(nt===0){const lt=By(fe,K),ft=lt===0?Math.max(Ce-1,0):lt;return Yre(Vj(lt,ft,ge))}const Pt=T8($e,nt,_e);let Ze,ot;he?ee===0&&ce===0&&Ce>0?(Ze=0,ot=Ce-1):(Ze=Pt*ih((ee+Oe)/(Ne+Oe)),ot=Pt*Hj((ce+Oe)/(Ne+Oe))-1,ot=Wv(K-1,Vu(ot,Pt-1)),Ze=Wv(ot,Vu(0,Ze))):(Ze=0,ot=-1);const ye=Vj(Ze,ot,ge),{top:De,bottom:ut}=Wj(de,J,ie,ye),bt=Hj(K/Pt),Je=bt*Ne+(bt-1)*Oe-ut;return{items:ye,offsetTop:De,offsetBottom:Je,top:De,bottom:ut,itemHeight:Ne,itemWidth:nt}})),R),st(Pe(B,gt(K=>K!==null),Xe(K=>K.length)),I),st(Pe(Qn(D,A,R,V),gt(([K,ee,{items:ce}])=>ce.length>0&&ee.height!==0&&K.height!==0),Xe(([K,ee,{items:ce},J])=>{const{top:ie,bottom:de}=Wj(K,J,ee,ce);return[ie,de]}),pn(pd)),n);const Y=Ve(!1);st(Pe(r,_t(Y),Xe(([K,ee])=>ee||K!==0)),Y);const se=Jr(Pe(ht(R),gt(({items:K})=>K.length>0),_t(I,Y),gt(([{items:K},ee,ce])=>ce&&K[K.length-1].index===ee-1),Xe(([,K])=>K-1),pn())),ae=Jr(Pe(ht(R),gt(({items:K})=>K.length>0&&K[0].index===0),qs(0),pn())),re=Jr(Pe(ht(R),_t($),gt(([{items:K},ee])=>K.length>0&&!ee),Xe(([{items:K}])=>({startIndex:K[0].index,endIndex:K[K.length-1].index})),pn(k8),Ga(0)));st(re,g.scrollSeekRangeChanged),st(Pe(O,_t(D,A,I,V),Xe(([K,ee,ce,J,ie])=>{const de=w8(K),{align:ge,behavior:Ce,offset:he}=de;let fe=de.index;fe==="LAST"&&(fe=J-1),fe=Vu(0,fe,Wv(J-1,fe));let Oe=yx(ee,ie,ce,fe);return ge==="end"?Oe=Bj(Oe-ee.height+ce.height):ge==="center"&&(Oe=Bj(Oe-ee.height/2+ce.height/2)),he&&(Oe+=he),{top:Oe,behavior:Ce}})),i);const G=yr(Pe(R,Xe(K=>K.offsetBottom+K.bottom)),0);return st(Pe(b,Xe(K=>({width:K.visibleWidth,height:K.visibleHeight}))),D),{data:B,totalCount:I,viewportDimensions:D,itemDimensions:A,scrollTop:r,scrollHeight:T,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:O,smoothScrollTargetReached:l,windowViewportRect:b,windowScrollTo:_,useWindowScroll:w,customScrollParent:S,windowScrollContainerState:j,deviation:X,scrollContainerState:u,footerHeight:p,headerHeight:m,initialItemCount:M,gap:V,restoreStateFrom:N,...g,initialTopMostItemIndex:q,gridState:R,totalListHeight:G,...h,startReached:ae,endReached:se,rangeChanged:re,stateChanged:U,propsReady:x,stateRestoreInProgress:$,...E}},hn(Hy,Sr,Qd,j8,pi,Vy,fi));function Wj(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=yx(e,t,n,r[0].index),i=yx(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function yx(e,t,n,r){const o=T8(e.width,n.width,t.column),s=ih(r/o),i=s*n.height+Vu(0,s-1)*t.row;return i>0?i+t.row:i}function T8(e,t,n){return Vu(1,ih((e+n)/(ih(t)+n)))}const eoe=qt(()=>{const e=Ve(p=>`Item ${p}`),t=Ve({}),n=Ve(null),r=Ve("virtuoso-grid-item"),o=Ve("virtuoso-grid-list"),s=Ve(R8),i=Ve("div"),l=Ve(Uc),u=(p,m=null)=>yr(Pe(t,Xe(h=>h[p]),pn()),m);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:l,FooterComponent:u("Footer"),HeaderComponent:u("Header"),ListComponent:u("List","div"),ItemComponent:u("Item","div"),ScrollerComponent:u("Scroller","div"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),toe=qt(([e,t])=>({...e,...t}),hn(Jre,eoe)),noe=H.memo(function(){const t=yn("gridState"),n=yn("listClassName"),r=yn("itemClassName"),o=yn("itemContent"),s=yn("computeItemKey"),i=yn("isSeeking"),l=qo("scrollHeight"),u=yn("ItemComponent"),p=yn("ListComponent"),m=yn("ScrollSeekPlaceholder"),h=yn("context"),g=qo("itemDimensions"),x=qo("gap"),y=yn("log"),b=yn("stateRestoreInProgress"),w=ll(S=>{const j=S.parentElement.parentElement.scrollHeight;l(j);const _=S.firstChild;if(_){const{width:E,height:I}=_.getBoundingClientRect();g({width:E,height:I})}x({row:Uj("row-gap",getComputedStyle(S).rowGap,y),column:Uj("column-gap",getComputedStyle(S).columnGap,y)})});return b?null:H.createElement(p,{ref:w,className:n,...Rr(p,h),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(S=>{const j=s(S.index,S.data,h);return i?H.createElement(m,{key:j,...Rr(m,h),index:S.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(u,{...Rr(u,h),className:r,"data-index":S.index,key:j},o(S.index,S.data,h))}))}),roe=H.memo(function(){const t=yn("HeaderComponent"),n=qo("headerHeight"),r=yn("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=yn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),ooe=H.memo(function(){const t=yn("FooterComponent"),n=qo("footerHeight"),r=yn("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=yn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),soe=({children:e})=>{const t=H.useContext(O8),n=qo("itemDimensions"),r=qo("viewportDimensions"),o=ll(s=>{r(s.getBoundingClientRect())});return H.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),H.createElement("div",{style:wg,ref:o},e)},aoe=({children:e})=>{const t=H.useContext(O8),n=qo("windowViewportRect"),r=qo("itemDimensions"),o=yn("customScrollParent"),s=E8(n,o);return H.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),H.createElement("div",{ref:s,style:wg},e)},ioe=H.memo(function({...t}){const n=yn("useWindowScroll"),r=yn("customScrollParent"),o=r||n?uoe:coe,s=r||n?aoe:soe;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(roe,null),H.createElement(noe,null),H.createElement(ooe,null)))}),{Component:loe,usePublisher:qo,useEmitterValue:yn,useEmitter:N8}=d8(toe,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},ioe),coe=D8({usePublisher:qo,useEmitterValue:yn,useEmitter:N8}),uoe=A8({usePublisher:qo,useEmitterValue:yn,useEmitter:N8});function Uj(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,eo.WARN),t==="normal"?0:parseInt(t??"0",10)}const doe=loe,foe=e=>{const t=W(s=>s.gallery.galleryView),{data:n}=Vx(e),{data:r}=Wx(e),o=d.useMemo(()=>t==="images"?n==null?void 0:n.total:r==null?void 0:r.total,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}},poe=({imageDTO:e})=>a.jsx(L,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:a.jsxs(Ds,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),moe=d.memo(poe),Uy=({postUploadAction:e,isDisabled:t})=>{const n=W(u=>u.gallery.autoAddBoardId),[r]=rI(),o=d.useCallback(u=>{const p=u[0];p&&r({file:p,image_category:"user",is_intermediate:!1,postUploadAction:e??{type:"TOAST"},board_id:n==="none"?void 0:n})},[n,e,r]),{getRootProps:s,getInputProps:i,open:l}=Zb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:i,openUploader:l}},hoe=le(xe,({generation:e})=>{const{model:t}=e;return{model:t}}),Sg=()=>{const e=te(),t=sl(),{t:n}=Z(),{model:r}=W(hoe),o=d.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),s=d.useCallback(N=>{t({title:n("toast.parameterNotSet"),description:N,status:"warning",duration:2500,isClosable:!0})},[n,t]),i=d.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),l=d.useCallback(N=>{t({title:n("toast.parametersNotSet"),status:"warning",description:N,duration:2500,isClosable:!0})},[n,t]),u=d.useCallback((N,$,q,F)=>{if(qf(N)||Xf($)||bu(q)||Q0(F)){qf(N)&&e(Nu(N)),Xf($)&&e($u($)),bu(q)&&e(Lu(q)),bu(F)&&e(zu(F)),o();return}s()},[e,o,s]),p=d.useCallback(N=>{if(!qf(N)){s();return}e(Nu(N)),o()},[e,o,s]),m=d.useCallback(N=>{if(!Xf(N)){s();return}e($u(N)),o()},[e,o,s]),h=d.useCallback(N=>{if(!bu(N)){s();return}e(Lu(N)),o()},[e,o,s]),g=d.useCallback(N=>{if(!Q0(N)){s();return}e(zu(N)),o()},[e,o,s]),x=d.useCallback(N=>{if(!iw(N)){s();return}e(Xp(N)),o()},[e,o,s]),y=d.useCallback(N=>{if(!Y0(N)){s();return}e(Qp(N)),o()},[e,o,s]),b=d.useCallback(N=>{if(!lw(N)){s();return}e(i1(N)),o()},[e,o,s]),w=d.useCallback(N=>{if(!Z0(N)){s();return}e(l1(N)),o()},[e,o,s]),S=d.useCallback(N=>{if(!J0(N)){s();return}e(Yp(N)),o()},[e,o,s]),j=d.useCallback(N=>{if(!cw(N)){s();return}e(Hi(N)),o()},[e,o,s]),_=d.useCallback(N=>{if(!uw(N)){s();return}e(Vi(N)),o()},[e,o,s]),E=d.useCallback(N=>{if(!dw(N)){s();return}e(Zp(N)),o()},[e,o,s]),{loras:I}=Cd(void 0,{selectFromResult:N=>({loras:N.data?PD.getSelectors().selectAll(N.data):[]})}),M=d.useCallback(N=>{if(!dI(N.lora))return{lora:null,error:"Invalid LoRA model"};const{base_model:$,model_name:q}=N.lora,F=I.find(Y=>Y.base_model===$&&Y.model_name===q);return F?(F==null?void 0:F.base_model)===(r==null?void 0:r.base_model)?{lora:F,error:null}:{lora:null,error:"LoRA incompatible with currently-selected model"}:{lora:null,error:"LoRA model is not installed"}},[I,r==null?void 0:r.base_model]),R=d.useCallback(N=>{const $=M(N);if(!$.lora){s($.error);return}e(fw({...$.lora,weight:N.weight})),o()},[M,e,o,s]),{controlnets:D}=gh(void 0,{selectFromResult:N=>({controlnets:N.data?ED.getSelectors().selectAll(N.data):[]})}),A=d.useCallback(N=>{if(!c1(N.control_model))return{controlnet:null,error:"Invalid ControlNet model"};const{image:$,control_model:q,control_weight:F,begin_step_percent:Q,end_step_percent:Y,control_mode:se,resize_mode:ae}=N,re=D.find(ie=>ie.base_model===q.base_model&&ie.model_name===q.model_name);if(!re)return{controlnet:null,error:"ControlNet model is not installed"};if(!((re==null?void 0:re.base_model)===(r==null?void 0:r.base_model)))return{controlnet:null,error:"ControlNet incompatible with currently-selected model"};const K=Zs();let ee=Ta.processorType;for(const ie in pw)if(re.model_name.includes(ie)){ee=pw[ie]||Ta.processorType;break}const ce=Fr[ee].default;return{controlnet:{isEnabled:!0,model:re,weight:typeof F=="number"?F:Ta.weight,beginStepPct:Q||Ta.beginStepPct,endStepPct:Y||Ta.endStepPct,controlMode:se||Ta.controlMode,resizeMode:ae||Ta.resizeMode,controlImage:($==null?void 0:$.image_name)||null,processedControlImage:($==null?void 0:$.image_name)||null,processorType:ee,processorNode:ce.type!=="none"?ce:Ta.processorNode,shouldAutoConfig:!0,controlNetId:K},error:null}},[D,r==null?void 0:r.base_model]),O=d.useCallback(N=>{const $=A(N);if(!$.controlnet){s($.error);return}e(mw({...$.controlnet})),o()},[A,e,o,s]),{ipAdapters:T}=Ux(void 0,{selectFromResult:N=>({ipAdapters:N.data?MD.getSelectors().selectAll(N.data):[]})}),X=d.useCallback(N=>{if(!OD(N==null?void 0:N.ip_adapter_model))return{ipAdapter:null,error:"Invalid IP Adapter model"};const{image:$,ip_adapter_model:q,weight:F,begin_step_percent:Q,end_step_percent:Y}=N,se=T.find(G=>G.base_model===(q==null?void 0:q.base_model)&&G.model_name===(q==null?void 0:q.model_name));return se?(se==null?void 0:se.base_model)===(r==null?void 0:r.base_model)?{ipAdapter:{adapterImage:($==null?void 0:$.image_name)??null,model:se,weight:F??ev.weight,beginStepPct:Q??ev.beginStepPct,endStepPct:Y??ev.endStepPct},error:null}:{ipAdapter:null,error:"IP Adapter incompatible with currently-selected model"}:{ipAdapter:null,error:"IP Adapter model is not installed"}},[T,r==null?void 0:r.base_model]),B=d.useCallback(N=>{const $=X(N);if(!$.ipAdapter){s($.error);return}e(hw({...$.ipAdapter})),e(u1(!0)),o()},[X,e,o,s]),V=d.useCallback(N=>{e(vh(N))},[e]),U=d.useCallback(N=>{if(!N){l();return}const{cfg_scale:$,height:q,model:F,positive_prompt:Q,negative_prompt:Y,scheduler:se,seed:ae,steps:re,width:G,strength:K,positive_style_prompt:ee,negative_style_prompt:ce,refiner_model:J,refiner_cfg_scale:ie,refiner_steps:de,refiner_scheduler:ge,refiner_positive_aesthetic_score:Ce,refiner_negative_aesthetic_score:he,refiner_start:fe,loras:Oe,controlnets:_e,ipAdapters:Ne}=N;Y0($)&&e(Qp($)),lw(F)&&e(i1(F)),qf(Q)&&e(Nu(Q)),Xf(Y)&&e($u(Y)),Z0(se)&&e(l1(se)),iw(ae)&&e(Xp(ae)),J0(re)&&e(Yp(re)),cw(G)&&e(Hi(G)),uw(q)&&e(Vi(q)),dw(K)&&e(Zp(K)),bu(ee)&&e(Lu(ee)),Q0(ce)&&e(zu(ce)),RD(J)&&e(fI(J)),J0(de)&&e(d1(de)),Y0(ie)&&e(f1(ie)),Z0(ge)&&e(pI(ge)),DD(Ce)&&e(p1(Ce)),AD(he)&&e(m1(he)),TD(fe)&&e(h1(fe)),e(ND()),Oe==null||Oe.forEach(nt=>{const $e=M(nt);$e.lora&&e(fw({...$e.lora,weight:nt.weight}))}),e(aI()),_e!=null&&_e.length&&e($D()),_e==null||_e.forEach(nt=>{const $e=A(nt);$e.controlnet&&e(mw($e.controlnet))}),Ne!=null&&Ne.length&&e(u1(!0)),Ne==null||Ne.forEach(nt=>{const $e=X(nt);$e.ipAdapter&&e(hw($e.ipAdapter))}),i()},[l,i,e,M,A,X]);return{recallBothPrompts:u,recallPositivePrompt:p,recallNegativePrompt:m,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:g,recallSeed:x,recallCfgScale:y,recallModel:b,recallScheduler:w,recallSteps:S,recallWidth:j,recallHeight:_,recallStrength:E,recallLoRA:R,recallControlNet:O,recallIPAdapter:B,recallAllParameters:U,sendToImageToImage:V}},$8=()=>{const e=sl(),{t}=Z(),n=d.useMemo(()=>!!navigator.clipboard&&!!window.ClipboardItem,[]),r=d.useCallback(async o=>{n||e({title:t("toast.problemCopyingImage"),description:"Your browser doesn't support the Clipboard API.",status:"error",duration:2500,isClosable:!0});try{LD((async()=>{const i=await fetch(o);if(!i.ok)throw new Error("Problem retrieving image data");return await i.blob()})()),e({title:t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})}catch(s){e({title:t("toast.problemCopyingImage"),description:String(s),status:"error",duration:2500,isClosable:!0})}},[n,t,e]);return{isClipboardAPIAvailable:n,copyImageToClipboard:r}};function goe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"}}]})(e)}function voe(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 256L28.5 28c2-16 15.6-28 31.8-28H228.9c15 0 27.1 12.1 27.1 27.1c0 3.2-.6 6.5-1.7 9.5L208 160H347.3c20.2 0 36.7 16.4 36.7 36.7c0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7h-2.9c-15.7 0-28.5-12.8-28.5-28.5c0-2.3 .3-4.6 .9-6.9L176 288H32c-17.7 0-32-14.3-32-32z"}}]})(e)}function xoe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"}}]})(e)}function Gy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"}}]})(e)}function boe(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"}}]})(e)}function yoe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24H280c13.3 0 24-10.7 24-24s-10.7-24-24-24H136z"}}]})(e)}function Coe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24V232h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H232V120c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"}}]})(e)}function woe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M17 16l-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5h-4z"}}]})(e)}function Soe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"}}]})(e)}function koe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function Ky(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}}]})(e)}function qy(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}]})(e)}function L8(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"}}]})(e)}const Xy=e=>e.config;Gx("gallery/requestedBoardImagesDeletion");const joe=Gx("gallery/sentImageToCanvas"),z8=Gx("gallery/sentImageToImg2Img"),_oe=e=>{const{imageDTO:t}=e,n=te(),{t:r}=Z(),o=sl(),s=Ht("unifiedCanvas").isFeatureEnabled,{shouldFetchMetadataFromApi:i}=W(Xy),l=Jh(Kx),{metadata:u,workflow:p,isLoading:m}=qx({image:t,shouldFetchMetadataFromApi:i},{selectFromResult:B=>{var V,U;return{isLoading:B.isFetching,metadata:(V=B==null?void 0:B.currentData)==null?void 0:V.metadata,workflow:(U=B==null?void 0:B.currentData)==null?void 0:U.workflow}}}),[h]=Xx(),[g]=Qx(),{isClipboardAPIAvailable:x,copyImageToClipboard:y}=$8(),b=d.useCallback(()=>{t&&n(xh([t]))},[n,t]),{recallBothPrompts:w,recallSeed:S,recallAllParameters:j}=Sg(),_=d.useCallback(()=>{w(u==null?void 0:u.positive_prompt,u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt)},[u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt,w]),E=d.useCallback(()=>{S(u==null?void 0:u.seed)},[u==null?void 0:u.seed,S]),I=d.useCallback(()=>{p&&n(Yx(p))},[n,p]),M=d.useCallback(()=>{n(z8()),n(vh(t))},[n,t]),R=d.useCallback(()=>{n(joe()),qr.flushSync(()=>{n(Xs("unifiedCanvas"))}),n(mI(t)),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),D=d.useCallback(()=>{j(u)},[u,j]),A=d.useCallback(()=>{n(hI([t])),n(Bx(!0))},[n,t]),O=d.useCallback(()=>{y(t.image_url)},[y,t.image_url]),T=d.useCallback(()=>{t&&h({imageDTOs:[t]})},[h,t]),X=d.useCallback(()=>{t&&g({imageDTOs:[t]})},[g,t]);return a.jsxs(a.Fragment,{children:[a.jsx(en,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(hy,{}),children:r("common.openInNewTab")}),x&&a.jsx(en,{icon:a.jsx(Hc,{}),onClickCapture:O,children:r("parameters.copyImage")}),a.jsx(en,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(ig,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(Gy,{}),onClickCapture:I,isDisabled:m||!p,children:r("nodes.loadWorkflow")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(hM,{}),onClickCapture:_,isDisabled:m||(u==null?void 0:u.positive_prompt)===void 0&&(u==null?void 0:u.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(gM,{}),onClickCapture:E,isDisabled:m||(u==null?void 0:u.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(sM,{}),onClickCapture:D,isDisabled:m||!u,children:r("parameters.useAll")}),a.jsx(en,{icon:a.jsx(Xk,{}),onClickCapture:M,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(en,{icon:a.jsx(Xk,{}),onClickCapture:R,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(en,{icon:a.jsx(uM,{}),onClickCapture:A,children:"Change Board"}),t.starred?a.jsx(en,{icon:l?l.off.icon:a.jsx(qy,{}),onClickCapture:X,children:l?l.off.text:"Unstar Image"}):a.jsx(en,{icon:l?l.on.icon:a.jsx(Ky,{}),onClickCapture:T,children:l?l.on.text:"Star Image"}),a.jsx(en,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Br,{}),onClickCapture:b,children:r("gallery.deleteImage")})]})},F8=d.memo(_oe),Mp=()=>a.jsx(L,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(fa,{size:"xs"})}),Ioe=()=>{const e=te(),t=W(h=>h.gallery.selection),n=Jh(Kx),[r]=Xx(),[o]=Qx(),s=d.useCallback(()=>{e(hI(t)),e(Bx(!0))},[e,t]),i=d.useCallback(()=>{e(xh(t))},[e,t]),l=d.useCallback(()=>{r({imageDTOs:t})},[r,t]),u=d.useCallback(()=>{o({imageDTOs:t})},[o,t]),p=d.useMemo(()=>t.every(h=>h.starred),[t]),m=d.useMemo(()=>t.every(h=>!h.starred),[t]);return a.jsxs(a.Fragment,{children:[p&&a.jsx(en,{icon:n?n.on.icon:a.jsx(Ky,{}),onClickCapture:u,children:n?n.off.text:"Unstar All"}),(m||!p&&!m)&&a.jsx(en,{icon:n?n.on.icon:a.jsx(qy,{}),onClickCapture:l,children:n?n.on.text:"Star All"}),a.jsx(en,{icon:a.jsx(uM,{}),onClickCapture:s,children:"Change Board"}),a.jsx(en,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Br,{}),onClickCapture:i,children:"Delete Selection"})]})},Poe=d.memo(Ioe),Eoe=le([xe],({gallery:e})=>({selectionCount:e.selection.length}),Se),Moe=({imageDTO:e,children:t})=>{const{selectionCount:n}=W(Eoe),r=d.useCallback(o=>{o.preventDefault()},[]);return a.jsx(Ay,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:r,children:a.jsx(Poe,{})}):a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:r,children:a.jsx(F8,{imageDTO:e})}):null,children:t})},Ooe=d.memo(Moe),Roe=e=>{const{data:t,disabled:n,...r}=e,o=d.useRef(Zs()),{attributes:s,listeners:i,setNodeRef:l}=lne({id:o.current,disabled:n,data:t});return a.jsx(Ie,{ref:l,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...i,...r})},Doe=d.memo(Roe),Aoe=a.jsx(Nn,{as:cg,sx:{boxSize:16}}),Toe=a.jsx(Zn,{icon:Yi}),Noe=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:i=!1,isUploadDisabled:l=!1,minSize:u=24,postUploadAction:p,imageSx:m,fitContainer:h=!1,droppableData:g,draggableData:x,dropLabel:y,isSelected:b=!1,thumbnail:w=!1,noContentFallback:S=Toe,uploadElement:j=Aoe,useThumbailFallback:_,withHoverOverlay:E=!1,children:I,onMouseOver:M,onMouseOut:R,dataTestId:D}=e,{colorMode:A}=ha(),[O,T]=d.useState(!1),X=d.useCallback($=>{M&&M($),T(!0)},[M]),B=d.useCallback($=>{R&&R($),T(!1)},[R]),{getUploadButtonProps:V,getUploadInputProps:U}=Uy({postUploadAction:p,isDisabled:l}),N=l?{}:{cursor:"pointer",bg:Ae("base.200","base.700")(A),_hover:{bg:Ae("base.300","base.650")(A),color:Ae("base.500","base.300")(A)}};return a.jsx(Ooe,{imageDTO:t,children:$=>a.jsxs(L,{ref:$,onMouseOver:X,onMouseOut:B,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:u||void 0,minH:u||void 0,userSelect:"none",cursor:i||!t?"default":"pointer"},children:[t&&a.jsxs(L,{sx:{w:"full",h:"full",position:h?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(ga,{src:w?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:_?t.thumbnail_url:void 0,fallback:_?void 0:a.jsx($ne,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...m},"data-testid":D}),o&&a.jsx(moe,{imageDTO:t}),a.jsx(Dy,{isSelected:b,isHovered:E?O:!1})]}),!t&&!l&&a.jsx(a.Fragment,{children:a.jsxs(L,{sx:{minH:u,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(A),...N},...V(),children:[a.jsx("input",{...U()}),j]})}),!t&&l&&S,t&&!i&&a.jsx(Doe,{data:x,disabled:i||!t,onClick:r}),I,!s&&a.jsx(Ry,{data:g,disabled:s,dropLabel:y})]})})},ua=d.memo(Noe),$oe=()=>a.jsx(Gh,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full"}})}),Loe=d.memo($oe),zoe=le([xe,Zx],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},Se),Foe=e=>{const t=te(),{queryArgs:n,selection:r}=W(zoe),{imageDTOs:o}=gI(n,{selectFromResult:p=>({imageDTOs:p.data?zD.selectAll(p.data):[]})}),s=Ht("multiselect").isFeatureEnabled,i=d.useCallback(p=>{var m;if(e){if(!s){t(yu([e]));return}if(p.shiftKey){const h=e.image_name,g=(m=r[r.length-1])==null?void 0:m.image_name,x=o.findIndex(b=>b.image_name===g),y=o.findIndex(b=>b.image_name===h);if(x>-1&&y>-1){const b=Math.min(x,y),w=Math.max(x,y),S=o.slice(b,w+1);t(yu(r.concat(S)))}}else p.ctrlKey||p.metaKey?r.some(h=>h.image_name===e.image_name)&&r.length>1?t(yu(r.filter(h=>h.image_name!==e.image_name))):t(yu(r.concat(e))):t(yu([e]))}},[t,e,o,r,s]),l=d.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),u=d.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:u,isSelected:l,handleClick:i}},Boe=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=sa("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))");return a.jsx(Fe,{onClick:t,"aria-label":n,tooltip:n,icon:r,size:"sm",variant:"link",sx:{position:"absolute",top:1,insetInlineEnd:1,p:0,minW:0,svg:{transitionProperty:"common",transitionDuration:"normal",fill:"base.100",_hover:{fill:"base.50"},filter:s},...o},"data-testid":n})},zi=d.memo(Boe),Hoe=e=>{const t=te(),{imageName:n}=e,{currentData:r}=to(n),o=W(M=>M.hotkeys.shift),{t:s}=Z(),{handleClick:i,isSelected:l,selection:u,selectionCount:p}=Foe(r),m=Jh(Kx),h=d.useCallback(M=>{M.stopPropagation(),r&&t(xh([r]))},[t,r]),g=d.useMemo(()=>{if(p>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:u}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,u,p]),[x]=Xx(),[y]=Qx(),b=d.useCallback(()=>{r&&(r.starred&&y({imageDTOs:[r]}),r.starred||x({imageDTOs:[r]}))},[x,y,r]),[w,S]=d.useState(!1),j=d.useCallback(()=>{S(!0)},[]),_=d.useCallback(()=>{S(!1)},[]),E=d.useMemo(()=>{if(r!=null&&r.starred)return m?m.on.icon:a.jsx(qy,{size:"20"});if(!(r!=null&&r.starred)&&w)return m?m.off.icon:a.jsx(Ky,{size:"20"})},[r==null?void 0:r.starred,w,m]),I=d.useMemo(()=>r!=null&&r.starred?m?m.off.text:"Unstar":r!=null&&r.starred?"":m?m.on.text:"Star",[r==null?void 0:r.starred,m]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},"data-testid":`image-${r.image_name}`,children:a.jsx(L,{userSelect:"none",sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(ua,{onClick:i,imageDTO:r,draggableData:g,isSelected:l,minSize:0,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0,withHoverOverlay:!0,onMouseOver:j,onMouseOut:_,children:a.jsxs(a.Fragment,{children:[a.jsx(zi,{onClick:b,icon:E,tooltip:I}),w&&o&&a.jsx(zi,{onClick:h,icon:a.jsx(Br,{}),tooltip:s("gallery.deleteImage"),styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Loe,{})},Voe=d.memo(Hoe),Woe=je((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,"data-testid":"image-item-container",children:e.children})),Uoe=d.memo(Woe),Goe=je((e,t)=>{const n=W(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(Ja,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},"data-testid":"image-list-container",children:e.children})}),Koe=d.memo(Goe),qoe={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},Xoe=()=>{const{t:e}=Z(),t=d.useRef(null),[n,r]=d.useState(null),[o,s]=Oy(qoe),i=W(w=>w.gallery.selectedBoardId),{currentViewTotal:l}=foe(i),u=W(Zx),{currentData:p,isFetching:m,isSuccess:h,isError:g}=gI(u),[x]=vI(),y=d.useMemo(()=>!p||!l?!1:p.ids.length<l,[p,l]),b=d.useCallback(()=>{y&&x({...u,offset:(p==null?void 0:p.ids.length)??0,limit:xI})},[y,x,u,p==null?void 0:p.ids.length]);return d.useEffect(()=>{const{current:w}=t;return n&&w&&o({target:w,elements:{viewport:n}}),()=>{var S;return(S=s())==null?void 0:S.destroy()}},[n,o,s]),p?h&&(p==null?void 0:p.ids.length)===0?a.jsx(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Zn,{label:e("gallery.noImagesInGallery"),icon:Yi})}):h&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(doe,{style:{height:"100%"},data:p.ids,endReached:b,components:{Item:Uoe,List:Koe},scrollerRef:r,itemContent:(w,S)=>a.jsx(Voe,{imageName:S},S)})}),a.jsx(at,{onClick:b,isDisabled:!y,isLoading:m,loadingText:e("gallery.loading"),flexShrink:0,children:`Load More (${p.ids.length} of ${l})`})]}):g?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(Zn,{label:e("gallery.unableToLoad"),icon:$J})}):null:a.jsx(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Zn,{label:e("gallery.loading"),icon:Yi})})},Qoe=d.memo(Xoe),Yoe=le([xe],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},Se),Zoe=()=>{const e=d.useRef(null),t=d.useRef(null),{galleryView:n}=W(Yoe),r=te(),{isOpen:o,onToggle:s}=Lr({defaultIsOpen:!0}),i=d.useCallback(()=>{r(gw("images"))},[r]),l=d.useCallback(()=>{r(gw("assets"))},[r]);return a.jsxs(p3,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs(L,{ref:e,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(Ine,{isOpen:o,onToggle:s}),a.jsx(Nne,{})]}),a.jsx(Ie,{children:a.jsx(kne,{isOpen:o})})]}),a.jsxs(L,{ref:t,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx(L,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(rl,{index:n==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(ol,{children:a.jsxs(Vt,{isAttached:!0,sx:{w:"full"},children:[a.jsx(Tr,{as:at,size:"sm",isChecked:n==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(UJ,{}),"data-testid":"images-tab",children:"Images"}),a.jsx(Tr,{as:at,size:"sm",isChecked:n==="assets",onClick:l,sx:{w:"full"},leftIcon:a.jsx(ree,{}),"data-testid":"assets-tab",children:"Assets"})]})})})}),a.jsx(Qoe,{})]})]})},Joe=d.memo(Zoe),ese=()=>{const e=W(p=>p.system.isConnected),{data:t}=va(),[n,{isLoading:r}]=Jx(),o=te(),{t:s}=Z(),i=d.useMemo(()=>t==null?void 0:t.queue.item_id,[t==null?void 0:t.queue.item_id]),l=d.useCallback(async()=>{if(i)try{await n(i).unwrap(),o(ct({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(ct({title:s("queue.cancelFailed"),status:"error"}))}},[i,o,s,n]),u=d.useMemo(()=>!e||e$(i),[e,i]);return{cancelQueueItem:l,isLoading:r,currentQueueItemId:i,isDisabled:u}},tse=({label:e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,asIconButton:i,isLoading:l,loadingText:u,sx:p})=>i?a.jsx(Fe,{"aria-label":e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:l,sx:p,"data-testid":e}):a.jsx(at,{"aria-label":e,tooltip:t,leftIcon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:l,loadingText:u??e,flexGrow:1,sx:p,"data-testid":e,children:e}),ul=d.memo(tse),nse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{cancelQueueItem:r,isLoading:o,isDisabled:s}=ese();return a.jsx(ul,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.cancel"),tooltip:n("queue.cancelTooltip"),icon:a.jsx(Ic,{}),onClick:r,colorScheme:"error",sx:t})},B8=d.memo(nse),rse=()=>{const{t:e}=Z(),t=te(),{data:n}=va(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=bI({fixedCacheKey:"clearQueue"}),i=d.useCallback(async()=>{if(n!=null&&n.queue.total)try{await o().unwrap(),t(ct({title:e("queue.clearSucceeded"),status:"success"})),t(eb(void 0)),t(tb(void 0))}catch{t(ct({title:e("queue.clearFailed"),status:"error"}))}},[n==null?void 0:n.queue.total,o,t,e]),l=d.useMemo(()=>!r||!(n!=null&&n.queue.total),[r,n==null?void 0:n.queue.total]);return{clearQueue:i,isLoading:s,queueStatus:n,isDisabled:l}},ose=je((e,t)=>{const{t:n}=Z(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:l,title:u,triggerComponent:p}=e,{isOpen:m,onOpen:h,onClose:g}=Lr(),x=d.useRef(null),y=()=>{o(),g()},b=()=>{i&&i(),g()};return a.jsxs(a.Fragment,{children:[d.cloneElement(p,{onClick:h,ref:t}),a.jsx(Td,{isOpen:m,leastDestructiveRef:x,onClose:g,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:u}),a.jsx(Zo,{children:l}),a.jsxs(Ss,{children:[a.jsx(at,{ref:x,onClick:b,children:s}),a.jsx(at,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),kg=d.memo(ose),sse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{clearQueue:r,isLoading:o,isDisabled:s}=rse();return a.jsxs(kg,{title:n("queue.clearTooltip"),acceptCallback:r,acceptButtonText:n("queue.clear"),triggerComponent:a.jsx(ul,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.clear"),tooltip:n("queue.clearTooltip"),icon:a.jsx(Br,{}),colorScheme:"error",sx:t}),children:[a.jsx(ve,{children:n("queue.clearQueueAlertDialog")}),a.jsx("br",{}),a.jsx(ve,{children:n("queue.clearQueueAlertDialog2")})]})},Qy=d.memo(sse),ase=()=>{const e=te(),{t}=Z(),n=W(p=>p.system.isConnected),{data:r}=va(),[o,{isLoading:s}]=yI({fixedCacheKey:"pauseProcessor"}),i=d.useMemo(()=>!!(r!=null&&r.processor.is_started),[r==null?void 0:r.processor.is_started]),l=d.useCallback(async()=>{if(i)try{await o().unwrap(),e(ct({title:t("queue.pauseSucceeded"),status:"success"}))}catch{e(ct({title:t("queue.pauseFailed"),status:"error"}))}},[i,o,e,t]),u=d.useMemo(()=>!n||!i,[n,i]);return{pauseProcessor:l,isLoading:s,isStarted:i,isDisabled:u}},ise=({asIconButton:e})=>{const{t}=Z(),{pauseProcessor:n,isLoading:r,isDisabled:o}=ase();return a.jsx(ul,{asIconButton:e,label:t("queue.pause"),tooltip:t("queue.pauseTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(YJ,{}),onClick:n,colorScheme:"gold"})},H8=d.memo(ise),lse=le([xe,Jn],({controlNet:e,generation:t,system:n,nodes:r,dynamicPrompts:o},s)=>{const{initialImage:i,model:l}=t,{isConnected:u}=n,p=[];return u||p.push(yt.t("parameters.invoke.systemDisconnected")),s==="img2img"&&!i&&p.push(yt.t("parameters.invoke.noInitialImageSelected")),s==="nodes"?r.shouldValidateGraph&&(r.nodes.length||p.push(yt.t("parameters.invoke.noNodesInGraph")),r.nodes.forEach(m=>{if(!On(m))return;const h=r.nodeTemplates[m.data.type];if(!h){p.push(yt.t("parameters.invoke.missingNodeTemplate"));return}const g=FD([m],r.edges);Rn(m.data.inputs,x=>{const y=h.inputs[x.name],b=g.some(w=>w.target===m.id&&w.targetHandle===x.name);if(!y){p.push(yt.t("parameters.invoke.missingFieldTemplate"));return}if(y.required&&x.value===void 0&&!b){p.push(yt.t("parameters.invoke.missingInputForField",{nodeLabel:m.data.label||h.title,fieldLabel:x.label||y.title}));return}})})):(o.prompts.length===0&&p.push(yt.t("parameters.invoke.noPrompts")),l||p.push(yt.t("parameters.invoke.noModelSelected")),e.isEnabled&&nr(e.controlNets).forEach((m,h)=>{m.isEnabled&&(m.model||p.push(yt.t("parameters.invoke.noModelForControlNet",{index:h+1})),(!m.controlImage||!m.processedControlImage&&m.processorType!=="none")&&p.push(yt.t("parameters.invoke.noControlImageForControlNet",{index:h+1})))})),{isReady:!p.length,reasons:p}},Se),Yy=()=>{const{isReady:e,reasons:t}=W(lse);return{isReady:e,reasons:t}},V8=()=>{const e=te(),t=W(Jn),{isReady:n}=Yy(),[r,{isLoading:o}]=bh({fixedCacheKey:"enqueueBatch"}),s=d.useMemo(()=>!n,[n]);return{queueBack:d.useCallback(()=>{s||(e(nb()),e(CI({tabName:t,prepend:!1})))},[e,s,t]),isLoading:o,isDisabled:s}},cse=le([xe],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},Se),use=({prepend:e=!1})=>{const{t}=Z(),{isReady:n,reasons:r}=Yy(),{autoAddBoardId:o}=W(cse),s=vg(o),[i,{isLoading:l}]=bh({fixedCacheKey:"enqueueBatch"}),u=d.useMemo(()=>t(l?"queue.enqueueing":n?e?"queue.queueFront":"queue.queueBack":"queue.notReady"),[l,n,e,t]);return a.jsxs(L,{flexDir:"column",gap:1,children:[a.jsx(ve,{fontWeight:600,children:u}),r.length>0&&a.jsx(Od,{children:r.map((p,m)=>a.jsx(Qr,{children:a.jsx(ve,{fontWeight:400,children:p})},`${p}.${m}`))}),a.jsx(U8,{}),a.jsxs(ve,{fontWeight:400,fontStyle:"oblique 10deg",children:["Adding images to"," ",a.jsx(ve,{as:"span",fontWeight:600,children:s||"Uncategorized"})]})]})},W8=d.memo(use),U8=d.memo(()=>a.jsx(Yn,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}));U8.displayName="StyledDivider";const dse=()=>a.jsx(Ie,{pos:"relative",w:4,h:4,children:a.jsx(ga,{src:Hx,alt:"invoke-ai-logo",pos:"absolute",top:-.5,insetInlineStart:-.5,w:5,h:5,minW:5,minH:5,filter:"saturate(0)"})}),fse=d.memo(dse),pse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueBack:r,isLoading:o,isDisabled:s}=V8();return a.jsx(ul,{asIconButton:e,colorScheme:"accent",label:n("parameters.invoke.invoke"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(W8,{}),sx:t,icon:e?a.jsx(fse,{}):void 0})},G8=d.memo(pse),K8=()=>{const e=te(),t=W(Jn),{isReady:n}=Yy(),[r,{isLoading:o}]=bh({fixedCacheKey:"enqueueBatch"}),s=Ht("prependQueue").isFeatureEnabled,i=d.useMemo(()=>!n||!s,[n,s]);return{queueFront:d.useCallback(()=>{i||(e(nb()),e(CI({tabName:t,prepend:!0})))},[e,i,t]),isLoading:o,isDisabled:i}},mse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueFront:r,isLoading:o,isDisabled:s}=K8();return a.jsx(ul,{asIconButton:e,colorScheme:"base",label:n("queue.queueFront"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(W8,{prepend:!0}),icon:a.jsx(voe,{}),sx:t})},hse=d.memo(mse),gse=()=>{const e=te(),t=W(p=>p.system.isConnected),{data:n}=va(),{t:r}=Z(),[o,{isLoading:s}]=wI({fixedCacheKey:"resumeProcessor"}),i=d.useMemo(()=>!!(n!=null&&n.processor.is_started),[n==null?void 0:n.processor.is_started]),l=d.useCallback(async()=>{if(!i)try{await o().unwrap(),e(ct({title:r("queue.resumeSucceeded"),status:"success"}))}catch{e(ct({title:r("queue.resumeFailed"),status:"error"}))}},[i,o,e,r]),u=d.useMemo(()=>!t||i,[t,i]);return{resumeProcessor:l,isLoading:s,isStarted:i,isDisabled:u}},vse=({asIconButton:e})=>{const{t}=Z(),{resumeProcessor:n,isLoading:r,isDisabled:o}=gse();return a.jsx(ul,{asIconButton:e,label:t("queue.resume"),tooltip:t("queue.resumeTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(ZJ,{}),onClick:n,colorScheme:"green"})},q8=d.memo(vse),xse=le(xe,({system:e})=>{var t;return{isConnected:e.isConnected,hasSteps:!!e.denoiseProgress,value:(((t=e.denoiseProgress)==null?void 0:t.percentage)??0)*100}},Se),bse=()=>{const{t:e}=Z(),{data:t}=va(),{hasSteps:n,value:r,isConnected:o}=W(xse);return a.jsx(G3,{value:r,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:o&&!!(t!=null&&t.queue.in_progress)&&!n,h:"full",w:"full",borderRadius:2,colorScheme:"accent"})},yse=d.memo(bse),Cse=()=>{const e=Ht("pauseQueue").isFeatureEnabled,t=Ht("resumeQueue").isFeatureEnabled,n=Ht("prependQueue").isFeatureEnabled;return a.jsxs(L,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,gap:2,flexDir:"column"},children:[a.jsxs(L,{gap:2,w:"full",children:[a.jsxs(Vt,{isAttached:!0,flexGrow:2,children:[a.jsx(G8,{}),n?a.jsx(hse,{asIconButton:!0}):a.jsx(a.Fragment,{}),a.jsx(B8,{asIconButton:!0})]}),a.jsxs(Vt,{isAttached:!0,children:[t?a.jsx(q8,{asIconButton:!0}):a.jsx(a.Fragment,{}),e?a.jsx(H8,{asIconButton:!0}):a.jsx(a.Fragment,{})]}),a.jsx(Qy,{asIconButton:!0})]}),a.jsx(L,{h:3,w:"full",children:a.jsx(yse,{})}),a.jsx(Q8,{})]})},X8=d.memo(Cse),Q8=d.memo(()=>{const{t:e}=Z(),t=te(),{hasItems:n,pending:r}=va(void 0,{selectFromResult:({data:s})=>{if(!s)return{hasItems:!1,pending:0};const{pending:i,in_progress:l}=s.queue;return{hasItems:i+l>0,pending:i}}}),o=d.useCallback(()=>{t(Xs("queue"))},[t]);return a.jsxs(L,{justifyContent:"space-between",alignItems:"center",pe:1,"data-testid":"queue-count",children:[a.jsx(ba,{}),a.jsx(Za,{onClick:o,size:"sm",variant:"link",fontWeight:400,opacity:.7,fontStyle:"oblique 10deg",children:n?e("queue.queuedCount",{pending:r}):e("queue.queueEmpty")})]})});Q8.displayName="QueueCounts";const{createElement:Ec,createContext:wse,forwardRef:Y8,useCallback:Gs,useContext:Z8,useEffect:oa,useImperativeHandle:J8,useLayoutEffect:Sse,useMemo:kse,useRef:Kr,useState:Wu}=Fx,Gj=Fx["useId".toString()],Uu=Sse,jse=typeof Gj=="function"?Gj:()=>null;let _se=0;function Zy(e=null){const t=jse(),n=Kr(e||t||null);return n.current===null&&(n.current=""+_se++),n.current}const jg=wse(null);jg.displayName="PanelGroupContext";function eO({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:l=null,minSize:u,onCollapse:p=null,onResize:m=null,order:h=null,style:g={},tagName:x="div"}){const y=Z8(jg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const b=Zy(i),{collapsePanel:w,expandPanel:S,getPanelSize:j,getPanelStyle:_,registerPanel:E,resizePanel:I,units:M,unregisterPanel:R}=y;u==null&&(M==="percentages"?u=10:u=0);const D=Kr({onCollapse:p,onResize:m});oa(()=>{D.current.onCollapse=p,D.current.onResize=m});const A=_(b,o),O=Kr({size:Kj(A)}),T=Kr({callbacksRef:D,collapsedSize:n,collapsible:r,defaultSize:o,id:b,idWasAutoGenerated:i==null,maxSize:l,minSize:u,order:h});return Uu(()=>{O.current.size=Kj(A),T.current.callbacksRef=D,T.current.collapsedSize=n,T.current.collapsible=r,T.current.defaultSize=o,T.current.id=b,T.current.idWasAutoGenerated=i==null,T.current.maxSize=l,T.current.minSize=u,T.current.order=h}),Uu(()=>(E(b,T),()=>{R(b)}),[h,b,E,R]),J8(s,()=>({collapse:()=>w(b),expand:()=>S(b),getCollapsed(){return O.current.size===0},getId(){return b},getSize(X){return j(b,X)},resize:(X,B)=>I(b,X,B)}),[w,S,j,b,I]),Ec(x,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":b,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1),id:`data-panel-id-${b}`,style:{...A,...g}})}const Qa=Y8((e,t)=>Ec(eO,{...e,forwardedRef:t}));eO.displayName="Panel";Qa.displayName="forwardRef(Panel)";function Kj(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const el=10;function Du(e,t,n,r,o,s,i,l){const{id:u,panels:p,units:m}=t,h=m==="pixels"?Ha(u):NaN,{sizes:g}=l||{},x=g||s,y=Or(p),b=x.concat();let w=0;{const _=o<0?r:n,E=y.findIndex(D=>D.current.id===_),I=y[E],M=x[E],R=Cx(m,h,I,M,M+Math.abs(o),e);if(M===R)return x;R===0&&M>0&&i.set(_,M),o=o<0?M-R:R-M}let S=o<0?n:r,j=y.findIndex(_=>_.current.id===S);for(;;){const _=y[j],E=x[j],I=Math.abs(o)-Math.abs(w),M=Cx(m,h,_,E,E-I,e);if(E!==M&&(M===0&&E>0&&i.set(_.current.id,E),w+=E-M,b[j]=M,w.toPrecision(el).localeCompare(Math.abs(o).toPrecision(el),void 0,{numeric:!0})>=0))break;if(o<0){if(--j<0)break}else if(++j>=y.length)break}return w===0?x:(S=o<0?r:n,j=y.findIndex(_=>_.current.id===S),b[j]=x[j]+w,b)}function Fl(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:i,collapsedSize:l,collapsible:u,id:p}=s.current,m=n[p];if(m!==r){n[p]=r;const{onCollapse:h,onResize:g}=i.current;g&&g(r,m),u&&h&&((m==null||m===l)&&r!==l?h(!1):m!==l&&r===l&&h(!0))}})}function Ise({groupId:e,panels:t,units:n}){const r=n==="pixels"?Ha(e):NaN,o=Or(t),s=Array(o.length);let i=0,l=100;for(let u=0;u<o.length;u++){const p=o[u],{defaultSize:m}=p.current;m!=null&&(i++,s[u]=n==="pixels"?m/r*100:m,l-=s[u])}for(let u=0;u<o.length;u++){const p=o[u];let{defaultSize:m,id:h,maxSize:g,minSize:x}=p.current;if(m!=null)continue;n==="pixels"&&(x=x/r*100,g!=null&&(g=g/r*100));const y=o.length-i,b=Math.min(g??100,Math.max(x,l/y));s[u]=b,i++,l-=b}if(l!==0)for(let u=0;u<o.length;u++){const p=o[u];let{maxSize:m,minSize:h}=p.current;n==="pixels"&&(h=h/r*100,m!=null&&(m=m/r*100));const g=Math.min(m??100,Math.max(h,s[u]+l));if(g!==s[u]&&(l-=g-s[u],s[u]=g,Math.abs(l).toFixed(3)==="0.000"))break}return Math.abs(l).toFixed(3),s}function Uv(e,t){if(t.length<2)return[null,null];const n=t.findIndex(i=>i.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function Ha(e){const t=md(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=Jy(e);return n==="horizontal"?t.offsetWidth-r.reduce((o,s)=>o+s.offsetWidth,0):t.offsetHeight-r.reduce((o,s)=>o+s.offsetHeight,0)}function tO(e,t,n){if(e.size===1)return"100";const o=Or(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(el)}function Pse(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function md(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function _g(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Ese(e){return nO().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function nO(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function Jy(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function e2(e,t,n){var u,p,m,h;const r=_g(t),o=Jy(e),s=r?o.indexOf(r):-1,i=((p=(u=n[s])==null?void 0:u.current)==null?void 0:p.id)??null,l=((h=(m=n[s+1])==null?void 0:m.current)==null?void 0:h.id)??null;return[i,l]}function Or(e){return Array.from(e.values()).sort((t,n)=>{const r=t.current.order,o=n.current.order;return r==null&&o==null?0:r==null?-1:o==null?1:r-o})}function Cx(e,t,n,r,o,s=null){var m;let{collapsedSize:i,collapsible:l,maxSize:u,minSize:p}=n.current;if(e==="pixels"&&(i=i/t*100,u!=null&&(u=u/t*100),p=p/t*100),l){if(r>i){if(o<=p/2+i)return i}else if(!((m=s==null?void 0:s.type)==null?void 0:m.startsWith("key"))&&o<p)return i}return Math.min(u??100,Math.max(p,o))}function Mse(e,t){const{collapsible:n,defaultSize:r,maxSize:o,minSize:s}=t.current;(s<0||e==="percentages"&&s>100)&&(t.current.minSize=0),o!=null&&(o<0||e==="percentages"&&o>100)&&(t.current.maxSize=null),r!==null&&(r<0||e==="percentages"&&r>100?t.current.defaultSize=null:r<s&&!n?t.current.defaultSize=s:o!=null&&r>o&&(t.current.defaultSize=o))}function Gv({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Or(t),i=o==="pixels"?Ha(e):NaN;let l=0;for(let u=0;u<s.length;u++){const p=s[u],m=r[u],h=n[u],g=Cx(o,i,p,m,h);h!=g&&(l+=h-g,n[u]=g)}if(l.toFixed(3)!=="0.000")for(let u=0;u<s.length;u++){const p=s[u];let{maxSize:m,minSize:h}=p.current;o==="pixels"&&(h=h/i*100,m!=null&&(m=m/i*100));const g=Math.min(m??100,Math.max(h,n[u]+l));if(g!==n[u]&&(l-=g-n[u],n[u]=g,Math.abs(l).toFixed(3)==="0.000"))break}return l.toFixed(3),n}function rO(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function Ose({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){oa(()=>{const{direction:i,panels:l}=e.current,u=md(t);rO(u!=null,`No group found for id "${t}"`);const{height:p,width:m}=u.getBoundingClientRect(),g=Jy(t).map(x=>{const y=x.getAttribute("data-panel-resize-handle-id"),b=Or(l),[w,S]=e2(t,y,b);if(w==null||S==null)return()=>{};let j=0,_=100,E=0,I=0;b.forEach(T=>{const{id:X,maxSize:B,minSize:V}=T.current;X===w?(j=V,_=B??100):(E+=V,I+=B??100)});const M=Math.min(_,100-E),R=Math.max(j,(b.length-1)*100-I),D=tO(l,w,o);x.setAttribute("aria-valuemax",""+Math.round(M)),x.setAttribute("aria-valuemin",""+Math.round(R)),x.setAttribute("aria-valuenow",""+Math.round(parseInt(D)));const A=T=>{if(!T.defaultPrevented)switch(T.key){case"Enter":{T.preventDefault();const X=b.findIndex(B=>B.current.id===w);if(X>=0){const B=b[X],V=o[X];if(V!=null){let U=0;V.toPrecision(el)<=B.current.minSize.toPrecision(el)?U=i==="horizontal"?m:p:U=-(i==="horizontal"?m:p);const N=Du(T,e.current,w,S,U,o,s.current,null);o!==N&&r(N)}}break}}};x.addEventListener("keydown",A);const O=Pse(w);return O!=null&&x.setAttribute("aria-controls",O.id),()=>{x.removeAttribute("aria-valuemax"),x.removeAttribute("aria-valuemin"),x.removeAttribute("aria-valuenow"),x.removeEventListener("keydown",A),O!=null&&x.removeAttribute("aria-controls")}});return()=>{g.forEach(x=>x())}},[e,t,n,s,r,o])}function Rse({disabled:e,handleId:t,resizeHandler:n}){oa(()=>{if(e||n==null)return;const r=_g(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=nO(),l=Ese(t);rO(l!==null);const u=s.shiftKey?l>0?l-1:i.length-1:l+1<i.length?l+1:0;i[u].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function Kv(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oO(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(wx(e))i=s?e.clientX:e.clientY;else if(Sx(e)){const m=e.touches[0];i=s?m.screenX:m.screenY}else return 0;const l=_g(t),u=o||l.getBoundingClientRect(),p=s?u.left:u.top;return i-p-r}function Dse(e,t,n,r,o,s,i){const{dragOffset:l=0,dragHandleRect:u,sizes:p}=i||{},m=p||s;if(Ase(e)){const h=o==="horizontal",x=md(t).getBoundingClientRect(),y=h?x.width:x.height,b=e.shiftKey?10:100,w=y/b;let S=0;switch(e.key){case"ArrowDown":S=h?0:w;break;case"ArrowLeft":S=h?-w:0;break;case"ArrowRight":S=h?w:0;break;case"ArrowUp":S=h?0:-w;break;case"End":S=y;break;case"Home":S=-y;break}const[j,_]=e2(t,n,r),E=S<0?j:_,I=r.findIndex(R=>R.current.id===E),M=r[I];if(M.current.collapsible){const R=m[I];(R===0||R.toPrecision(el)===M.current.minSize.toPrecision(el))&&(S=S<0?-M.current.minSize*y:M.current.minSize*y)}return S}else return oO(e,n,o,l,u)}function Ase(e){return e.type==="keydown"}function wx(e){return e.type.startsWith("mouse")}function Sx(e){return e.type.startsWith("touch")}let kx=null,Oi=null;function sO(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Tse(){Oi!==null&&(document.head.removeChild(Oi),kx=null,Oi=null)}function qv(e){if(kx===e)return;kx=e;const t=sO(e);Oi===null&&(Oi=document.createElement("style"),document.head.appendChild(Oi)),Oi.innerHTML=`*{cursor: ${t}!important;}`}function Nse(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function aO(e){return e.map(t=>{const{minSize:n,order:r}=t.current;return r?`${r}:${n}`:`${n}`}).sort((t,n)=>t.localeCompare(n)).join(",")}function iO(e,t){try{const n=t.getItem(`PanelGroup:sizes:${e}`);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function $se(e,t,n){const r=iO(e,n);if(r){const o=aO(t);return r[o]??null}return null}function Lse(e,t,n,r){const o=aO(t),s=iO(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const Xv={};function qj(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}const Au={getItem:e=>(qj(Au),Au.getItem(e)),setItem:(e,t)=>{qj(Au),Au.setItem(e,t)}};function lO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:l,storage:u=Au,style:p={},tagName:m="div",units:h="percentages"}){const g=Zy(i),[x,y]=Wu(null),[b,w]=Wu(new Map),S=Kr(null);Kr({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const j=Kr({onLayout:l});oa(()=>{j.current.onLayout=l});const _=Kr({}),[E,I]=Wu([]),M=Kr(new Map),R=Kr(0),D=Kr({direction:r,id:g,panels:b,sizes:E,units:h});J8(s,()=>({getId:()=>g,getLayout:F=>{const{sizes:Q,units:Y}=D.current;if((F??Y)==="pixels"){const ae=Ha(g);return Q.map(re=>re/100*ae)}else return Q},setLayout:(F,Q)=>{const{id:Y,panels:se,sizes:ae,units:re}=D.current;if((Q||re)==="pixels"){const ce=Ha(Y);F=F.map(J=>J/ce*100)}const G=_.current,K=Or(se),ee=Gv({groupId:Y,panels:se,nextSizes:F,prevSizes:ae,units:re});Kv(ae,ee)||(I(ee),Fl(K,ee,G))}}),[g]),Uu(()=>{D.current.direction=r,D.current.id=g,D.current.panels=b,D.current.sizes=E,D.current.units=h}),Ose({committedValuesRef:D,groupId:g,panels:b,setSizes:I,sizes:E,panelSizeBeforeCollapse:M}),oa(()=>{const{onLayout:F}=j.current,{panels:Q,sizes:Y}=D.current;if(Y.length>0){F&&F(Y);const se=_.current,ae=Or(Q);Fl(ae,Y,se)}},[E]),Uu(()=>{const{id:F,sizes:Q,units:Y}=D.current;if(Q.length===b.size)return;let se=null;if(e){const ae=Or(b);se=$se(e,ae,u)}if(se!=null){const ae=Gv({groupId:F,panels:b,nextSizes:se,prevSizes:se,units:Y});I(ae)}else{const ae=Ise({groupId:F,panels:b,units:Y});I(ae)}},[e,b,u]),oa(()=>{if(e){if(E.length===0||E.length!==b.size)return;const F=Or(b);Xv[e]||(Xv[e]=Nse(Lse,100)),Xv[e](e,F,E,u)}},[e,b,E,u]),Uu(()=>{if(h==="pixels"){const F=new ResizeObserver(()=>{const{panels:Q,sizes:Y}=D.current,se=Gv({groupId:g,panels:Q,nextSizes:Y,prevSizes:Y,units:h});Kv(Y,se)||I(se)});return F.observe(md(g)),()=>{F.disconnect()}}},[g,h]);const A=Gs((F,Q)=>{const{panels:Y,units:se}=D.current,re=Or(Y).findIndex(ee=>ee.current.id===F),G=E[re];if((Q??se)==="pixels"){const ee=Ha(g);return G/100*ee}else return G},[g,E]),O=Gs((F,Q)=>{const{panels:Y}=D.current;return Y.size===0?{flexBasis:0,flexGrow:Q??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:tO(Y,F,E),flexShrink:1,overflow:"hidden",pointerEvents:o&&x!==null?"none":void 0}},[x,o,E]),T=Gs((F,Q)=>{const{units:Y}=D.current;Mse(Y,Q),w(se=>{if(se.has(F))return se;const ae=new Map(se);return ae.set(F,Q),ae})},[]),X=Gs(F=>Y=>{Y.preventDefault();const{direction:se,panels:ae,sizes:re}=D.current,G=Or(ae),[K,ee]=e2(g,F,G);if(K==null||ee==null)return;let ce=Dse(Y,g,F,G,se,re,S.current);if(ce===0)return;const ie=md(g).getBoundingClientRect(),de=se==="horizontal";document.dir==="rtl"&&de&&(ce=-ce);const ge=de?ie.width:ie.height,Ce=ce/ge*100,he=Du(Y,D.current,K,ee,Ce,re,M.current,S.current),fe=!Kv(re,he);if((wx(Y)||Sx(Y))&&R.current!=Ce&&qv(fe?de?"horizontal":"vertical":de?ce<0?"horizontal-min":"horizontal-max":ce<0?"vertical-min":"vertical-max"),fe){const Oe=_.current;I(he),Fl(G,he,Oe)}R.current=Ce},[g]),B=Gs(F=>{w(Q=>{if(!Q.has(F))return Q;const Y=new Map(Q);return Y.delete(F),Y})},[]),V=Gs(F=>{const{panels:Q,sizes:Y}=D.current,se=Q.get(F);if(se==null)return;const{collapsedSize:ae,collapsible:re}=se.current;if(!re)return;const G=Or(Q),K=G.indexOf(se);if(K<0)return;const ee=Y[K];if(ee===ae)return;M.current.set(F,ee);const[ce,J]=Uv(F,G);if(ce==null||J==null)return;const de=K===G.length-1?ee:ae-ee,ge=Du(null,D.current,ce,J,de,Y,M.current,null);if(Y!==ge){const Ce=_.current;I(ge),Fl(G,ge,Ce)}},[]),U=Gs(F=>{const{panels:Q,sizes:Y}=D.current,se=Q.get(F);if(se==null)return;const{collapsedSize:ae,minSize:re}=se.current,G=M.current.get(F)||re;if(!G)return;const K=Or(Q),ee=K.indexOf(se);if(ee<0||Y[ee]!==ae)return;const[J,ie]=Uv(F,K);if(J==null||ie==null)return;const ge=ee===K.length-1?ae-G:G,Ce=Du(null,D.current,J,ie,ge,Y,M.current,null);if(Y!==Ce){const he=_.current;I(Ce),Fl(K,Ce,he)}},[]),N=Gs((F,Q,Y)=>{const{id:se,panels:ae,sizes:re,units:G}=D.current;if((Y||G)==="pixels"){const nt=Ha(se);Q=Q/nt*100}const K=ae.get(F);if(K==null)return;let{collapsedSize:ee,collapsible:ce,maxSize:J,minSize:ie}=K.current;if(G==="pixels"){const nt=Ha(se);ie=ie/nt*100,J!=null&&(J=J/nt*100)}const de=Or(ae),ge=de.indexOf(K);if(ge<0)return;const Ce=re[ge];if(Ce===Q)return;ce&&Q===ee||(Q=Math.min(J??100,Math.max(ie,Q)));const[he,fe]=Uv(F,de);if(he==null||fe==null)return;const _e=ge===de.length-1?Ce-Q:Q-Ce,Ne=Du(null,D.current,he,fe,_e,re,M.current,null);if(re!==Ne){const nt=_.current;I(Ne),Fl(de,Ne,nt)}},[]),$=kse(()=>({activeHandleId:x,collapsePanel:V,direction:r,expandPanel:U,getPanelSize:A,getPanelStyle:O,groupId:g,registerPanel:T,registerResizeHandle:X,resizePanel:N,startDragging:(F,Q)=>{if(y(F),wx(Q)||Sx(Q)){const Y=_g(F);S.current={dragHandleRect:Y.getBoundingClientRect(),dragOffset:oO(Q,F,r),sizes:D.current.sizes}}},stopDragging:()=>{Tse(),y(null),S.current=null},units:h,unregisterPanel:B}),[x,V,r,U,A,O,g,T,X,N,h,B]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ec(jg.Provider,{children:Ec(m,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g,"data-panel-group-units":h,style:{...q,...p}}),value:$})}const Ig=Y8((e,t)=>Ec(lO,{...e,forwardedRef:t}));lO.displayName="PanelGroup";Ig.displayName="forwardRef(PanelGroup)";function jx({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const l=Kr(null),u=Kr({onDragging:o});oa(()=>{u.current.onDragging=o});const p=Z8(jg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:m,direction:h,groupId:g,registerResizeHandle:x,startDragging:y,stopDragging:b}=p,w=Zy(r),S=m===w,[j,_]=Wu(!1),[E,I]=Wu(null),M=Gs(()=>{l.current.blur(),b();const{onDragging:A}=u.current;A&&A(!1)},[b]);oa(()=>{if(n)I(null);else{const D=x(w);I(()=>D)}},[n,w,x]),oa(()=>{if(n||E==null||!S)return;const D=X=>{E(X)},A=X=>{E(X)},T=l.current.ownerDocument;return T.body.addEventListener("contextmenu",M),T.body.addEventListener("mousemove",D),T.body.addEventListener("touchmove",D),T.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{T.body.removeEventListener("contextmenu",M),T.body.removeEventListener("mousemove",D),T.body.removeEventListener("touchmove",D),T.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[h,n,S,E,M]),Rse({disabled:n,handleId:w,resizeHandler:E});const R={cursor:sO(h),touchAction:"none",userSelect:"none"};return Ec(i,{children:e,className:t,"data-resize-handle-active":S?"pointer":j?"keyboard":void 0,"data-panel-group-direction":h,"data-panel-group-id":g,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w,onBlur:()=>_(!1),onFocus:()=>_(!0),onMouseDown:D=>{y(w,D.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:D=>{y(w,D.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},ref:l,role:"separator",style:{...R,...s},tabIndex:0})}jx.displayName="PanelResizeHandle";const zse=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=sa("base.100","base.850"),i=sa("base.300","base.700");return t==="horizontal"?a.jsx(jx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(L,{className:"resize-handle-horizontal",sx:{w:n?2.5:4,h:"full",justifyContent:n?n==="left"?"flex-start":"flex-end":"center",alignItems:"center",div:{bg:s},_hover:{div:{bg:i}}},...o,children:a.jsx(Ie,{sx:{w:1,h:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})}):a.jsx(jx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(L,{className:"resize-handle-vertical",sx:{w:"full",h:n?2.5:4,alignItems:n?n==="top"?"flex-start":"flex-end":"center",justifyContent:"center",div:{bg:s},_hover:{div:{bg:i}}},...o,children:a.jsx(Ie,{sx:{h:1,w:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})})},lh=d.memo(zse),t2=()=>{const e=te(),t=W(o=>o.ui.panels),n=d.useCallback(o=>t[o]??"",[t]),r=d.useCallback((o,s)=>{e(BD({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Fse=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,i=d.useMemo(()=>HD(n)?n:JSON.stringify(n,null,2),[n]),l=d.useCallback(()=>{navigator.clipboard.writeText(i)},[i]),u=d.useCallback(()=>{const m=new Blob([i]),h=document.createElement("a");h.href=URL.createObjectURL(m),h.download=`${r||t}.json`,document.body.appendChild(h),h.click(),h.remove()},[i,t,r]),{t:p}=Z();return a.jsxs(L,{layerStyle:"second",sx:{borderRadius:"base",flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4,fontSize:"sm"},children:a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:i})})}),a.jsxs(L,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:[o&&a.jsx(Ft,{label:`${p("gallery.download")} ${t} JSON`,children:a.jsx(ys,{"aria-label":`${p("gallery.download")} ${t} JSON`,icon:a.jsx(ig,{}),variant:"ghost",opacity:.7,onClick:u})}),s&&a.jsx(Ft,{label:`${p("gallery.copy")} ${t} JSON`,children:a.jsx(ys,{"aria-label":`${p("gallery.copy")} ${t} JSON`,icon:a.jsx(Hc,{}),variant:"ghost",opacity:.7,onClick:l})})]})]})},Ya=d.memo(Fse),Bse=le(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(r=>r.id===t);return{data:n==null?void 0:n.data}},Se),Hse=()=>{const{data:e}=W(Bse);return e?a.jsx(Ya,{data:e,label:"Node Data"}):a.jsx(Zn,{label:"No node selected",icon:null})},Vse=d.memo(Hse),Wse=({children:e,maxHeight:t})=>a.jsx(L,{sx:{w:"full",h:"full",maxHeight:t,position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e})})}),Zd=d.memo(Wse),Use=({output:e})=>{const{image:t}=e,{data:n}=to(t.image_name);return a.jsx(ua,{imageDTO:n})},Gse=d.memo(Use),Kse=le(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(s=>s.id===t),r=n?e.nodeTemplates[n.data.type]:void 0,o=e.nodeExecutionStates[t??"__UNKNOWN_NODE__"];return{node:n,template:r,nes:o}},Se),qse=()=>{const{node:e,template:t,nes:n}=W(Kse),{t:r}=Z();return!e||!n||!On(e)?a.jsx(Zn,{label:r("nodes.noNodeSelected"),icon:null}):n.outputs.length===0?a.jsx(Zn,{label:r("nodes.noOutputRecorded"),icon:null}):a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Zd,{children:a.jsx(L,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:(t==null?void 0:t.outputType)==="image_output"?n.outputs.map((o,s)=>a.jsx(Gse,{output:o},Qse(o,s))):a.jsx(Ya,{data:n.outputs,label:r("nodes.nodeOutputs")})})})})},Xse=d.memo(qse),Qse=(e,t)=>`${e.type}-${t}`,Yse=le(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(o=>o.id===t);return{template:n?e.nodeTemplates[n.data.type]:void 0}},Se),Zse=()=>{const{template:e}=W(Yse),{t}=Z();return e?a.jsx(Ya,{data:e,label:t("nodes.nodeTemplate")}):a.jsx(Zn,{label:t("nodes.noNodeSelected"),icon:null})},Jse=d.memo(Zse),eae=()=>a.jsx(L,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(rl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ol,{children:[a.jsx(Tr,{children:"Outputs"}),a.jsx(Tr,{children:"Data"}),a.jsx(Tr,{children:"Template"})]}),a.jsxs(zc,{children:[a.jsx(So,{children:a.jsx(Xse,{})}),a.jsx(So,{children:a.jsx(Vse,{})}),a.jsx(So,{children:a.jsx(Jse,{})})]})]})}),tae=d.memo(eae),n2=e=>{e.stopPropagation()},nae={display:"flex",flexDirection:"row",alignItems:"center",gap:10},rae=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...i}=e,l=te(),u=d.useCallback(m=>{m.shiftKey&&l(Nr(!0))},[l]),p=d.useCallback(m=>{m.shiftKey||l(Nr(!1))},[l]);return a.jsxs(Kt,{isInvalid:o,isDisabled:r,...s,style:n==="side"?nae:void 0,children:[t!==""&&a.jsx(wn,{children:t}),a.jsx(Mh,{...i,onPaste:n2,onKeyDown:u,onKeyUp:p})]})},vo=d.memo(rae),oae=je((e,t)=>{const n=te(),r=d.useCallback(s=>{s.shiftKey&&n(Nr(!0))},[n]),o=d.useCallback(s=>{s.shiftKey||n(Nr(!1))},[n]);return a.jsx(dP,{ref:t,onPaste:n2,onKeyDown:r,onKeyUp:o,...e})}),da=d.memo(oae),sae=le(xe,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:i,notes:l}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:i,notes:l}},Se),aae=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:i}=W(sae),l=te(),u=d.useCallback(w=>{l(VD(w.target.value))},[l]),p=d.useCallback(w=>{l(WD(w.target.value))},[l]),m=d.useCallback(w=>{l(UD(w.target.value))},[l]),h=d.useCallback(w=>{l(GD(w.target.value))},[l]),g=d.useCallback(w=>{l(KD(w.target.value))},[l]),x=d.useCallback(w=>{l(qD(w.target.value))},[l]),y=d.useCallback(w=>{l(XD(w.target.value))},[l]),{t:b}=Z();return a.jsx(Zd,{children:a.jsxs(L,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs(L,{sx:{gap:2,w:"full"},children:[a.jsx(vo,{label:b("nodes.workflowName"),value:t,onChange:u}),a.jsx(vo,{label:b("nodes.workflowVersion"),value:o,onChange:h})]}),a.jsxs(L,{sx:{gap:2,w:"full"},children:[a.jsx(vo,{label:b("nodes.workflowAuthor"),value:e,onChange:p}),a.jsx(vo,{label:b("nodes.workflowContact"),value:s,onChange:m})]}),a.jsx(vo,{label:b("nodes.workflowTags"),value:r,onChange:x}),a.jsxs(Kt,{as:L,sx:{flexDir:"column"},children:[a.jsx(wn,{children:b("nodes.workflowDescription")}),a.jsx(da,{onChange:g,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(Kt,{as:L,sx:{flexDir:"column",h:"full"},children:[a.jsx(wn,{children:b("nodes.workflowNotes")}),a.jsx(da,{onChange:y,value:i,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},iae=d.memo(aae);function lae(e,t,n){var r=this,o=d.useRef(null),s=d.useRef(0),i=d.useRef(null),l=d.useRef([]),u=d.useRef(),p=d.useRef(),m=d.useRef(e),h=d.useRef(!0);d.useEffect(function(){m.current=e},[e]);var g=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,b="maxWait"in n,w=b?Math.max(+n.maxWait||0,t):null;d.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var S=d.useMemo(function(){var j=function(D){var A=l.current,O=u.current;return l.current=u.current=null,s.current=D,p.current=m.current.apply(O,A)},_=function(D,A){g&&cancelAnimationFrame(i.current),i.current=g?requestAnimationFrame(D):setTimeout(D,A)},E=function(D){if(!h.current)return!1;var A=D-o.current;return!o.current||A>=t||A<0||b&&D-s.current>=w},I=function(D){return i.current=null,y&&l.current?j(D):(l.current=u.current=null,p.current)},M=function D(){var A=Date.now();if(E(A))return I(A);if(h.current){var O=t-(A-o.current),T=b?Math.min(O,w-(A-s.current)):O;_(D,T)}},R=function(){var D=Date.now(),A=E(D);if(l.current=[].slice.call(arguments),u.current=r,o.current=D,A){if(!i.current&&h.current)return s.current=o.current,_(M,t),x?j(o.current):p.current;if(b)return _(M,t),j(o.current)}return i.current||_(M,t),p.current};return R.cancel=function(){i.current&&(g?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,l.current=o.current=u.current=i.current=null},R.isPending=function(){return!!i.current},R.flush=function(){return i.current?I(Date.now()):p.current},R},[x,b,t,w,y,g]);return S}function cae(e,t){return e===t}function Xj(e){return typeof e=="function"?function(){return e}:e}function uae(e,t,n){var r,o,s=n&&n.equalityFn||cae,i=(r=d.useState(Xj(e)),o=r[1],[r[0],d.useCallback(function(h){return o(Xj(h))},[])]),l=i[0],u=i[1],p=lae(d.useCallback(function(h){return u(h)},[u]),t,n),m=d.useRef(e);return s(m.current,e)||(p(e),m.current=e),[l,p]}const cO=()=>{const e=W(r=>r.nodes),[t]=uae(e,300);return d.useMemo(()=>QD(t),[t])},dae=()=>{const e=cO(),{t}=Z();return a.jsx(L,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Ya,{data:e,label:t("nodes.workflow")})})},fae=d.memo(dae),pae=({isSelected:e,isHovered:t})=>{const n=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.light";if(e)return"nodeSelected.light";if(t)return"nodeHovered.light"},[t,e]),r=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.dark";if(e)return"nodeSelected.dark";if(t)return"nodeHovered.dark"},[t,e]);return a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e||t?1:.5,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:n,_dark:{shadow:r}}})},uO=d.memo(pae),dO=e=>{const t=te(),n=d.useMemo(()=>le(xe,({nodes:i})=>i.mouseOverNode===e,Se),[e]),r=W(n),o=d.useCallback(()=>{!r&&t(vw(e))},[t,e,r]),s=d.useCallback(()=>{r&&t(vw(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},fO=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(On(s))return(i=s==null?void 0:s.data.inputs[t])==null?void 0:i.label},Se),[t,e]);return W(n)},pO=(e,t,n)=>{const r=d.useMemo(()=>le(xe,({nodes:s})=>{var u;const i=s.nodes.find(p=>p.id===e);if(!On(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return(u=l==null?void 0:l[rb[n]][t])==null?void 0:u.title},Se),[t,n,e]);return W(r)},mO=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{const s=o.nodes.find(i=>i.id===e);if(On(s))return s==null?void 0:s.data.inputs[t]},Se),[t,e]);return W(n)},Pg=(e,t,n)=>{const r=d.useMemo(()=>le(xe,({nodes:s})=>{const i=s.nodes.find(u=>u.id===e);if(!On(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return l==null?void 0:l[rb[n]][t]},Se),[t,n,e]);return W(r)},mae=({nodeId:e,fieldName:t,kind:n})=>{const r=mO(e,t),o=Pg(e,t,n),s=YD(o),{t:i}=Z(),l=d.useMemo(()=>ZD(r)?r.label&&(o!=null&&o.title)?`${r.label} (${o.title})`:r.label&&!o?r.label:!r.label&&o?o.title:i("nodes.unknownField"):(o==null?void 0:o.title)||i("nodes.unknownField"),[r,o,i]);return a.jsxs(L,{sx:{flexDir:"column"},children:[a.jsx(ve,{sx:{fontWeight:600},children:l}),o&&a.jsx(ve,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(ve,{children:["Type: ",wd[o.type].title]}),s&&a.jsxs(ve,{children:["Input: ",JD(o.input)]})]})},r2=d.memo(mae),hae=je((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:i=!1}=e,l=fO(n,r),u=pO(n,r,o),{t:p}=Z(),m=te(),[h,g]=d.useState(l||u||p("nodes.unknownField")),x=d.useCallback(async b=>{b&&(b===l||b===u)||(g(b||u||p("nodes.unknownField")),m(eA({nodeId:n,fieldName:r,label:b})))},[l,u,m,n,r,p]),y=d.useCallback(b=>{g(b)},[]);return d.useEffect(()=>{g(l||u||p("nodes.unknownField"))},[l,u,p]),a.jsx(Ft,{label:i?a.jsx(r2,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:yh,placement:"top",hasArrow:!0,children:a.jsx(L,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(Ih,{value:h,onChange:y,onSubmit:x,as:L,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(_h,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(jh,{className:"nodrag",sx:{p:0,w:"full",fontWeight:600,color:"base.900",_dark:{color:"base.100"},_focusVisible:{p:0,textAlign:"left",boxShadow:"none"}}}),a.jsx(gO,{})]})})})}),hO=d.memo(hae),gO=d.memo(()=>{const{isEditing:e,getEditButtonProps:t}=y5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx(L,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});gO.displayName="EditableControls";const gae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(tA({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(Qb,{className:"nodrag",onChange:o,isChecked:n.value})},vae=d.memo(gae);function Eg(){return(Eg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vO(e,t){if(e==null)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function _x(e){var t=d.useRef(e),n=d.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Mc=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Gu=function(e){return"touches"in e},Ix=function(e){return e&&e.ownerDocument.defaultView||self},Qj=function(e,t,n){var r=e.getBoundingClientRect(),o=Gu(t)?function(s,i){for(var l=0;l<s.length;l++)if(s[l].identifier===i)return s[l];return s[0]}(t.touches,n):t;return{left:Mc((o.pageX-(r.left+Ix(e).pageXOffset))/r.width),top:Mc((o.pageY-(r.top+Ix(e).pageYOffset))/r.height)}},Yj=function(e){!Gu(e)&&e.preventDefault()},o2=H.memo(function(e){var t=e.onMove,n=e.onKey,r=vO(e,["onMove","onKey"]),o=d.useRef(null),s=_x(t),i=_x(n),l=d.useRef(null),u=d.useRef(!1),p=d.useMemo(function(){var x=function(w){Yj(w),(Gu(w)?w.touches.length>0:w.buttons>0)&&o.current?s(Qj(o.current,w,l.current)):b(!1)},y=function(){return b(!1)};function b(w){var S=u.current,j=Ix(o.current),_=w?j.addEventListener:j.removeEventListener;_(S?"touchmove":"mousemove",x),_(S?"touchend":"mouseup",y)}return[function(w){var S=w.nativeEvent,j=o.current;if(j&&(Yj(S),!function(E,I){return I&&!Gu(E)}(S,u.current)&&j)){if(Gu(S)){u.current=!0;var _=S.changedTouches||[];_.length&&(l.current=_[0].identifier)}j.focus(),s(Qj(j,S,l.current)),b(!0)}},function(w){var S=w.which||w.keyCode;S<37||S>40||(w.preventDefault(),i({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},b]},[i,s]),m=p[0],h=p[1],g=p[2];return d.useEffect(function(){return g},[g]),H.createElement("div",Eg({},r,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),Mg=function(e){return e.filter(Boolean).join(" ")},s2=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Mg(["react-colorful__pointer",e.className]);return H.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},H.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Cr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},xO=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:Cr(e.h),s:Cr(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:Cr(o/2),a:Cr(r,2)}},Px=function(e){var t=xO(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Qv=function(e){var t=xO(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},xae=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),i=r*(1-n),l=r*(1-(t-s)*n),u=r*(1-(1-t+s)*n),p=s%6;return{r:Cr(255*[r,l,i,i,u,r][p]),g:Cr(255*[u,r,r,l,i,i][p]),b:Cr(255*[i,i,u,r,r,l][p]),a:Cr(o,2)}},bae=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),i=s-Math.min(t,n,r),l=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:Cr(60*(l<0?l+6:l)),s:Cr(s?i/s*100:0),v:Cr(s/255*100),a:o}},yae=H.memo(function(e){var t=e.hue,n=e.onChange,r=Mg(["react-colorful__hue",e.className]);return H.createElement("div",{className:r},H.createElement(o2,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Mc(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":Cr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(s2,{className:"react-colorful__hue-pointer",left:t/360,color:Px({h:t,s:100,v:100,a:1})})))}),Cae=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Px({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(o2,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Mc(t.s+100*o.left,0,100),v:Mc(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Cr(t.s)+"%, Brightness "+Cr(t.v)+"%"},H.createElement(s2,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Px(t)})))}),bO=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function wae(e,t,n){var r=_x(n),o=d.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],l=d.useRef({color:t,hsva:s});d.useEffect(function(){if(!e.equal(t,l.current.color)){var p=e.toHsva(t);l.current={hsva:p,color:t},i(p)}},[t,e]),d.useEffect(function(){var p;bO(s,l.current.hsva)||e.equal(p=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:p},r(p))},[s,e,r]);var u=d.useCallback(function(p){i(function(m){return Object.assign({},m,p)})},[]);return[s,u]}var Sae=typeof window<"u"?d.useLayoutEffect:d.useEffect,kae=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Zj=new Map,jae=function(e){Sae(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Zj.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Zj.set(t,n);var r=kae();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},_ae=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Qv(Object.assign({},n,{a:0}))+", "+Qv(Object.assign({},n,{a:1}))+")"},s=Mg(["react-colorful__alpha",t]),i=Cr(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(o2,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:Mc(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement(s2,{className:"react-colorful__alpha-pointer",left:n.a,color:Qv(n)})))},Iae=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=vO(e,["className","colorModel","color","onChange"]),l=d.useRef(null);jae(l);var u=wae(n,o,s),p=u[0],m=u[1],h=Mg(["react-colorful",t]);return H.createElement("div",Eg({},i,{ref:l,className:h}),H.createElement(Cae,{hsva:p,onChange:m}),H.createElement(yae,{hue:p.h,onChange:m}),H.createElement(_ae,{hsva:p,onChange:m,className:"react-colorful__last-control"}))},Pae={defaultColor:{r:0,g:0,b:0,a:1},toHsva:bae,fromHsva:xae,equal:bO},yO=function(e){return H.createElement(Iae,Eg({},e,{colorModel:Pae}))};const Eae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(nA({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(yO,{className:"nodrag",color:n.value,onChange:o})},Mae=d.memo(Eae),CO=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=rA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({controlNetModelId:e,errors:s.error.format()},"Failed to parse ControlNet model id");return}return s.data},Oae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=gh(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/controlnet/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=CO(p);m&&o(oA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(Pn,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},Rae=d.memo(Oae),Dae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(i=>{o(sA({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return a.jsx(X3,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{value:i,children:r.ui_choice_labels?r.ui_choice_labels[i]:i},i))})},Aae=d.memo(Dae),Tae=e=>{var p;const{nodeId:t,field:n}=e,r=te(),{currentData:o}=to(((p=n.value)==null?void 0:p.image_name)??$r.skipToken),s=d.useCallback(()=>{r(aA({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),i=d.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),l=d.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),u=d.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx(L,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(ua,{imageDTO:o,droppableData:l,draggableData:i,postUploadAction:u,useThumbailFallback:!0,uploadElement:a.jsx(wO,{}),dropLabel:a.jsx(SO,{}),minSize:8,children:a.jsx(zi,{onClick:s,icon:o?a.jsx(Ud,{}):void 0,tooltip:"Reset Image"})})})},Nae=d.memo(Tae),wO=d.memo(()=>a.jsx(ve,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));wO.displayName="UploadElement";const SO=d.memo(()=>a.jsx(ve,{fontSize:16,fontWeight:600,children:"Drop"}));SO.displayName="DropLabel";const $ae=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=iA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({loraModelId:e,errors:s.error.format()},"Failed to parse LoRA model id");return}return s.data},Lae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Cd(),{t:i}=Z(),l=d.useMemo(()=>{if(!s)return[];const m=[];return Rn(s.entities,(h,g)=>{h&&m.push({value:g,label:h.model_name,group:an[h.base_model]})}),m.sort((h,g)=>h.disabled&&!g.disabled?1:-1)},[s]),u=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/lora/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r==null?void 0:r.base_model,r==null?void 0:r.model_name]),p=d.useCallback(m=>{if(!m)return;const h=$ae(m);h&&o(lA({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx(L,{sx:{justifyContent:"center",p:2},children:a.jsx(ve,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{className:"nowheel nodrag",value:(u==null?void 0:u.id)??null,placeholder:l.length>0?i("models.selectLoRA"):i("models.noLoRAsAvailable"),data:l,nothingFound:i("models.noMatchingLoRAs"),itemComponent:ui,disabled:l.length===0,filter:(m,h)=>{var g;return((g=h.label)==null?void 0:g.toLowerCase().includes(m.toLowerCase().trim()))||h.value.toLowerCase().includes(m.toLowerCase().trim())},error:!u,onChange:p,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},zae=d.memo(Lae),Og=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=cA.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data};function Gc(e){const{iconMode:t=!1,...n}=e,r=te(),{t:o}=Z(),[s,{isLoading:i}]=uA(),l=()=>{s().unwrap().then(u=>{r(ct(Qt({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(u=>{u&&r(ct(Qt({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(Fe,{icon:a.jsx(xM,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:i,onClick:l,size:"sm",...n}):a.jsx(at,{isLoading:i,onClick:l,minW:"max-content",...n,children:"Sync Models"})}const Fae=e=>{var y,b;const{nodeId:t,field:n}=e,r=te(),o=Ht("syncModels").isFeatureEnabled,{t:s}=Z(),{data:i,isLoading:l}=Ku(xw),{data:u,isLoading:p}=Xo(xw),m=d.useMemo(()=>l||p,[l,p]),h=d.useMemo(()=>{if(!u)return[];const w=[];return Rn(u.entities,(S,j)=>{S&&w.push({value:j,label:S.model_name,group:an[S.base_model]})}),i&&Rn(i.entities,(S,j)=>{S&&w.push({value:j,label:S.model_name,group:an[S.base_model]})}),w},[u,i]),g=d.useMemo(()=>{var w,S,j,_;return((u==null?void 0:u.entities[`${(w=n.value)==null?void 0:w.base_model}/main/${(S=n.value)==null?void 0:S.model_name}`])||(i==null?void 0:i.entities[`${(j=n.value)==null?void 0:j.base_model}/onnx/${(_=n.value)==null?void 0:_.model_name}`]))??null},[(y=n.value)==null?void 0:y.base_model,(b=n.value)==null?void 0:b.model_name,u==null?void 0:u.entities,i==null?void 0:i.entities]),x=d.useCallback(w=>{if(!w)return;const S=Og(w);S&&r(SI({nodeId:t,fieldName:n.name,value:S}))},[r,n.name,t]);return a.jsxs(L,{sx:{w:"full",alignItems:"center",gap:2},children:[m?a.jsx(ve,{variant:"subtext",children:"Loading..."}):a.jsx(nn,{className:"nowheel nodrag",tooltip:g==null?void 0:g.description,value:g==null?void 0:g.id,placeholder:h.length>0?s("models.selectModel"):s("models.noModelsAvailable"),data:h,error:!g,disabled:h.length===0,onChange:x,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Gc,{className:"nodrag",iconMode:!0})]})},Bae=d.memo(Fae),ch=/^-?(0\.)?\.?$/,kO=je((e,t)=>{const{label:n,isDisabled:r=!1,showStepper:o=!0,isInvalid:s,value:i,onChange:l,min:u,max:p,isInteger:m=!0,formControlProps:h,formLabelProps:g,numberInputFieldProps:x,numberInputStepperProps:y,tooltipProps:b,...w}=e,S=te(),[j,_]=d.useState(String(i));d.useEffect(()=>{!j.match(ch)&&i!==Number(j)&&_(String(i))},[i,j]);const E=D=>{_(D),D.match(ch)||l(m?Math.floor(Number(D)):Number(D))},I=D=>{const A=Bi(m?Math.floor(Number(D.target.value)):Number(D.target.value),u,p);_(String(A)),l(A)},M=d.useCallback(D=>{D.shiftKey&&S(Nr(!0))},[S]),R=d.useCallback(D=>{D.shiftKey||S(Nr(!1))},[S]);return a.jsx(Ft,{...b,children:a.jsxs(Kt,{ref:t,isDisabled:r,isInvalid:s,...h,children:[n&&a.jsx(wn,{...g,children:n}),a.jsxs(Lh,{value:j,min:u,max:p,keepWithinRange:!0,clampValueOnBlur:!1,onChange:E,onBlur:I,...w,onPaste:n2,children:[a.jsx(Fh,{...x,onKeyDown:M,onKeyUp:R}),o&&a.jsxs(zh,{children:[a.jsx(Hh,{...y}),a.jsx(Bh,{...y})]})]})]})})});kO.displayName="IAINumberInput";const Kc=d.memo(kO),Hae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),[s,i]=d.useState(String(n.value)),l=d.useMemo(()=>r.type==="integer",[r.type]),u=p=>{i(p),p.match(ch)||o(dA({nodeId:t,fieldName:n.name,value:l?Math.floor(Number(p)):Number(p)}))};return d.useEffect(()=>{!s.match(ch)&&n.value!==Number(s)&&i(String(n.value))},[n.value,s]),a.jsxs(Lh,{onChange:u,value:s,step:l?1:.1,precision:l?0:3,children:[a.jsx(Fh,{className:"nodrag"}),a.jsxs(zh,{children:[a.jsx(Hh,{}),a.jsx(Bh,{})]})]})},Vae=d.memo(Hae),Wae=e=>{var h,g;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=Ht("syncModels").isFeatureEnabled,{data:i,isLoading:l}=Xo(ob),u=d.useMemo(()=>{if(!i)return[];const x=[];return Rn(i.entities,(y,b)=>{y&&x.push({value:b,label:y.model_name,group:an[y.base_model]})}),x},[i]),p=d.useMemo(()=>{var x,y;return(i==null?void 0:i.entities[`${(x=n.value)==null?void 0:x.base_model}/main/${(y=n.value)==null?void 0:y.model_name}`])??null},[(h=n.value)==null?void 0:h.base_model,(g=n.value)==null?void 0:g.model_name,i==null?void 0:i.entities]),m=d.useCallback(x=>{if(!x)return;const y=Og(x);y&&r(fA({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return l?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:p==null?void 0:p.description,value:p==null?void 0:p.id,placeholder:u.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:u,error:!p,disabled:u.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Gc,{className:"nodrag",iconMode:!0})]})},Uae=d.memo(Wae),Gae=e=>{var g,x;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=Ht("syncModels").isFeatureEnabled,{data:i}=Ku(bw),{data:l,isLoading:u}=Xo(bw),p=d.useMemo(()=>{if(!l)return[];const y=[];return Rn(l.entities,(b,w)=>{!b||b.base_model!=="sdxl"||y.push({value:w,label:b.model_name,group:an[b.base_model]})}),i&&Rn(i.entities,(b,w)=>{!b||b.base_model!=="sdxl"||y.push({value:w,label:b.model_name,group:an[b.base_model]})}),y},[l,i]),m=d.useMemo(()=>{var y,b,w,S;return((l==null?void 0:l.entities[`${(y=n.value)==null?void 0:y.base_model}/main/${(b=n.value)==null?void 0:b.model_name}`])||(i==null?void 0:i.entities[`${(w=n.value)==null?void 0:w.base_model}/onnx/${(S=n.value)==null?void 0:S.model_name}`]))??null},[(g=n.value)==null?void 0:g.base_model,(x=n.value)==null?void 0:x.model_name,l==null?void 0:l.entities,i==null?void 0:i.entities]),h=d.useCallback(y=>{if(!y)return;const b=Og(y);b&&r(SI({nodeId:t,fieldName:n.name,value:b}))},[r,n.name,t]);return u?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:m==null?void 0:m.description,value:m==null?void 0:m.id,placeholder:p.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:p,error:!m,disabled:p.length===0,onChange:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Gc,{className:"nodrag",iconMode:!0})]})},Kae=d.memo(Gae),qae=le([xe],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:nr(mh,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},Se),Xae=e=>{const{nodeId:t,field:n}=e,r=te(),{data:o}=W(qae),s=d.useCallback(i=>{i&&r(pA({nodeId:t,fieldName:n.name,value:i}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:n.value,data:o,onChange:s})},Qae=d.memo(Xae),Yae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(i=>{o(mA({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(da,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(vo,{onChange:s,value:n.value})},Zae=d.memo(Yae),jO=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=hA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({vaeModelId:e,errors:s.error.format()},"Failed to parse VAE model id");return}return s.data},Jae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=kI(),i=d.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s]),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r]),u=d.useCallback(p=>{if(!p)return;const m=jO(p);m&&o(gA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",itemComponent:ui,tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??"default",placeholder:"Default",data:i,onChange:u,disabled:i.length===0,error:!l,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},eie=d.memo(Jae),_O=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=vA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({ipAdapterModelId:e,errors:s.error.format()},"Failed to parse IP-Adapter model id");return}return s.data},tie=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Ux(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/ip_adapter/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=_O(p);m&&o(xA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(Pn,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},nie=d.memo(tie),rie=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=bA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({t2iAdapterModelId:e,errors:s.error.format()},"Failed to parse T2I-Adapter model id");return}return s.data},oie=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=yA(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/t2i_adapter/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=rie(p);m&&o(CA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(Pn,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},sie=d.memo(oie),aie=e=>{var l;const{nodeId:t,field:n}=e,r=te(),{data:o,hasBoards:s}=yd(void 0,{selectFromResult:({data:u})=>{const p=[{label:"None",value:"none"}];return u==null||u.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{data:p,hasBoards:p.length>1}}}),i=d.useCallback(u=>{r(wA({nodeId:t,fieldName:n.name,value:u&&u!=="none"?{board_id:u}:void 0}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:((l=n.value)==null?void 0:l.board_id)??"none",data:o,onChange:i,disabled:!s})},iie=d.memo(aie),lie=({nodeId:e,fieldName:t})=>{const n=mO(e,t),r=Pg(e,t,"input");return(r==null?void 0:r.fieldKind)==="output"?a.jsxs(Ie,{p:2,children:["Output field in input: ",n==null?void 0:n.type]}):(n==null?void 0:n.type)==="string"&&(r==null?void 0:r.type)==="string"||(n==null?void 0:n.type)==="StringPolymorphic"&&(r==null?void 0:r.type)==="StringPolymorphic"?a.jsx(Zae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"||(n==null?void 0:n.type)==="BooleanPolymorphic"&&(r==null?void 0:r.type)==="BooleanPolymorphic"?a.jsx(vae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="integer"&&(r==null?void 0:r.type)==="integer"||(n==null?void 0:n.type)==="float"&&(r==null?void 0:r.type)==="float"||(n==null?void 0:n.type)==="FloatPolymorphic"&&(r==null?void 0:r.type)==="FloatPolymorphic"||(n==null?void 0:n.type)==="IntegerPolymorphic"&&(r==null?void 0:r.type)==="IntegerPolymorphic"?a.jsx(Vae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(Aae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"||(n==null?void 0:n.type)==="ImagePolymorphic"&&(r==null?void 0:r.type)==="ImagePolymorphic"?a.jsx(Nae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="BoardField"&&(r==null?void 0:r.type)==="BoardField"?a.jsx(iie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(Bae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(Uae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(eie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(zae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(Rae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="IPAdapterModelField"&&(r==null?void 0:r.type)==="IPAdapterModelField"?a.jsx(nie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="T2IAdapterModelField"&&(r==null?void 0:r.type)==="T2IAdapterModelField"?a.jsx(sie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(Mae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(Kae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(Qae,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(ve,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},IO=d.memo(lie),cie=({nodeId:e,fieldName:t})=>{const n=te(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=dO(e),{t:i}=Z(),l=d.useCallback(()=>{n(jI({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs(L,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(Kt,{as:L,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(wn,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(hO,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(ba,{}),a.jsx(Ft,{label:a.jsx(r2,{nodeId:e,fieldName:t,kind:"input"}),openDelay:yh,placement:"top",hasArrow:!0,children:a.jsx(L,{h:"full",alignItems:"center",children:a.jsx(Nn,{as:dM})})}),a.jsx(Fe,{"aria-label":i("nodes.removeLinearView"),tooltip:i("nodes.removeLinearView"),variant:"ghost",size:"sm",onClick:l,icon:a.jsx(Br,{})})]}),a.jsx(IO,{nodeId:e,fieldName:t})]}),a.jsx(uO,{isSelected:!1,isHovered:r})]})},uie=d.memo(cie),die=le(xe,({nodes:e})=>({fields:e.workflow.exposedFields}),Se),fie=()=>{const{fields:e}=W(die),{t}=Z();return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Zd,{children:a.jsx(L,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:e.length?e.map(({nodeId:n,fieldName:r})=>a.jsx(uie,{nodeId:n,fieldName:r},`${n}.${r}`)):a.jsx(Zn,{label:t("nodes.noFieldsLinearview"),icon:null})})})})},pie=d.memo(fie),mie=()=>a.jsx(L,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(rl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ol,{children:[a.jsx(Tr,{children:"Linear"}),a.jsx(Tr,{children:"Details"}),a.jsx(Tr,{children:"JSON"})]}),a.jsxs(zc,{children:[a.jsx(So,{children:a.jsx(pie,{})}),a.jsx(So,{children:a.jsx(iae,{})}),a.jsx(So,{children:a.jsx(fae,{})})]})]})}),hie=d.memo(mie),gie={paramNegativeConditioning:{placement:"right"},controlNet:{href:"https://support.invoke.ai/support/solutions/articles/151000105880"},lora:{href:"https://support.invoke.ai/support/solutions/articles/151000159072"},compositingCoherenceMode:{href:"https://support.invoke.ai/support/solutions/articles/151000158838"},infillMethod:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},scaleBeforeProcessing:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},paramIterations:{href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramPositiveConditioning:{href:"https://support.invoke.ai/support/solutions/articles/151000096606-tips-on-crafting-prompts",placement:"right"},paramScheduler:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramModel:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000096601-what-is-a-model-which-should-i-use-"},paramRatio:{gutter:16},controlNetControlMode:{placement:"right"},controlNetResizeMode:{placement:"right"},paramVAE:{placement:"right"},paramVAEPrecision:{placement:"right"}},vie=1e3,xie=[{name:"preventOverflow",options:{padding:10}}],PO=je(({feature:e,children:t,wrapperProps:n,...r},o)=>{const{t:s}=Z(),i=W(g=>g.system.shouldEnableInformationalPopovers),l=d.useMemo(()=>gie[e],[e]),u=d.useMemo(()=>SA(kA(l,["image","href","buttonLabel"]),r),[l,r]),p=d.useMemo(()=>s(`popovers.${e}.heading`),[e,s]),m=d.useMemo(()=>s(`popovers.${e}.paragraphs`,{returnObjects:!0})??[],[e,s]),h=d.useCallback(()=>{l!=null&&l.href&&window.open(l.href)},[l==null?void 0:l.href]);return i?a.jsxs(Ld,{isLazy:!0,closeOnBlur:!1,trigger:"hover",variant:"informational",openDelay:vie,modifiers:xie,placement:"top",...u,children:[a.jsx(Wh,{children:a.jsx(Ie,{ref:o,w:"full",...n,children:t})}),a.jsx(Ac,{children:a.jsxs(zd,{w:96,children:[a.jsx(H3,{}),a.jsx(Uh,{children:a.jsxs(L,{sx:{gap:2,flexDirection:"column",alignItems:"flex-start"},children:[p&&a.jsxs(a.Fragment,{children:[a.jsx(cr,{size:"sm",children:p}),a.jsx(Yn,{})]}),(l==null?void 0:l.image)&&a.jsxs(a.Fragment,{children:[a.jsx(ga,{sx:{objectFit:"contain",maxW:"60%",maxH:"60%",backgroundColor:"white"},src:l.image,alt:"Optional Image"}),a.jsx(Yn,{})]}),m.map(g=>a.jsx(ve,{children:g},g)),(l==null?void 0:l.href)&&a.jsxs(a.Fragment,{children:[a.jsx(Yn,{}),a.jsx(Za,{pt:1,onClick:h,leftIcon:a.jsx(hy,{}),alignSelf:"flex-end",variant:"link",children:s("common.learnMore")??p})]})]})})]})})]}):a.jsx(Ie,{ref:o,w:"full",...n,children:t})});PO.displayName="IAIInformationalPopover";const Et=d.memo(PO),bie=le([xe],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:l}=e.generation,{shouldUseSliders:u}=e.ui,p=e.hotkeys.shift?s:i;return{iterations:l,initial:t,min:n,sliderMax:r,inputMax:o,step:p,shouldUseSliders:u}},Se),yie=({asSlider:e})=>{const{iterations:t,initial:n,min:r,sliderMax:o,inputMax:s,step:i,shouldUseSliders:l}=W(bie),u=te(),{t:p}=Z(),m=d.useCallback(g=>{u(yw(g))},[u]),h=d.useCallback(()=>{u(yw(n))},[u,n]);return e||l?a.jsx(Et,{feature:"paramIterations",children:a.jsx(tt,{label:p("parameters.iterations"),step:i,min:r,max:o,onChange:m,handleReset:h,value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s}})}):a.jsx(Et,{feature:"paramIterations",children:a.jsx(Kc,{label:p("parameters.iterations"),step:i,min:r,max:s,onChange:m,value:t,numberInputFieldProps:{textAlign:"center"}})})},rs=d.memo(yie),Cie=()=>{const[e,t]=d.useState(!1),[n,r]=d.useState(!1),o=d.useRef(null),s=t2(),i=d.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs(L,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(X8,{}),a.jsx(L,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,pb:3,gap:2,flexDir:"column"},children:a.jsx(rs,{asSlider:!0})}),a.jsxs(Ig,{ref:o,id:"workflow-panel-group",autoSaveId:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Qa,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(hie,{})}),a.jsx(lh,{direction:"vertical",onDoubleClick:i,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Qa,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(tae,{})})]})]})},wie=d.memo(Cie),Jj=(e,t)=>{const n=d.useRef(null),[r,o]=d.useState(()=>{var p;return!!((p=n.current)!=null&&p.getCollapsed())}),s=d.useCallback(()=>{var p;(p=n.current)!=null&&p.getCollapsed()?qr.flushSync(()=>{var m;(m=n.current)==null||m.expand()}):qr.flushSync(()=>{var m;(m=n.current)==null||m.collapse()})},[]),i=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),l=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),u=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.resize(e,t)})},[e,t]);return{ref:n,minSize:e,isCollapsed:r,setIsCollapsed:o,reset:u,toggle:s,expand:i,collapse:l}},Sie=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(Ac,{children:a.jsx(L,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(Fe,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("accessibility.showGalleryPanel"),onClick:r,icon:a.jsx(koe,{}),sx:{p:0,px:3,h:48,borderEndRadius:0}})})}):null},kie=d.memo(Sie),Op={borderStartRadius:0,flexGrow:1},jie=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(Ac,{children:a.jsxs(L,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,h:48,children:[a.jsxs(Vt,{isAttached:!0,orientation:"vertical",flexGrow:3,children:[a.jsx(Fe,{tooltip:n("parameters.showOptionsPanel"),"aria-label":n("parameters.showOptionsPanel"),onClick:r,sx:Op,icon:a.jsx(vM,{})}),a.jsx(G8,{asIconButton:!0,sx:Op}),a.jsx(B8,{asIconButton:!0,sx:Op})]}),a.jsx(Qy,{asIconButton:!0,sx:Op})]})}):null},_ie=d.memo(jie),Iie=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=Lr({defaultIsOpen:o}),{colorMode:l}=ha();return a.jsxs(Ie,{children:[a.jsxs(L,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:Ae("base.250","base.750")(l),color:Ae("base.900","base.100")(l),_hover:{bg:Ae("base.300","base.700")(l)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},"data-testid":`${t} collapsible`,children:[t,a.jsx(dr,{children:n&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(ve,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(ba,{}),a.jsx(gg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(Id,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Ie,{sx:{p:4,pb:4,borderBottomRadius:"base",bg:"base.150",_dark:{bg:"base.800"}},children:r})})]})},oo=d.memo(Iie),Pie=le(xe,e=>{const{maxPrompts:t,combinatorial:n}=e.dynamicPrompts,{min:r,sliderMax:o,inputMax:s}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:r,sliderMax:o,inputMax:s,isDisabled:!n}},Se),Eie=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=W(Pie),s=te(),{t:i}=Z(),l=d.useCallback(p=>{s(jA(p))},[s]),u=d.useCallback(()=>{s(_A())},[s]);return a.jsx(Et,{feature:"dynamicPromptsMaxPrompts",children:a.jsx(tt,{label:i("dynamicPrompts.maxPrompts"),isDisabled:o,min:t,max:n,value:e,onChange:l,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})})},Mie=d.memo(Eie),Oie=le(xe,e=>{const{isLoading:t,isError:n,prompts:r,parsingError:o}=e.dynamicPrompts;return{prompts:r,parsingError:o,isError:n,isLoading:t}},Se),Rie={"&::marker":{color:"base.500",_dark:{color:"base.500"}}},Die=()=>{const{prompts:e,parsingError:t,isLoading:n,isError:r}=W(Oie);return r?a.jsx(Et,{feature:"dynamicPrompts",children:a.jsx(L,{w:"full",h:"full",layerStyle:"second",alignItems:"center",justifyContent:"center",p:8,children:a.jsx(Zn,{icon:xoe,label:"Problem generating prompts"})})}):a.jsx(Et,{feature:"dynamicPrompts",children:a.jsxs(Kt,{isInvalid:!!t,children:[a.jsxs(wn,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:["Prompts Preview (",e.length,")",t&&` - ${t}`]}),a.jsxs(L,{h:64,pos:"relative",layerStyle:"third",borderRadius:"base",p:2,children:[a.jsx(Zd,{children:a.jsx(u3,{stylePosition:"inside",ms:0,children:e.map((o,s)=>a.jsx(Qr,{fontSize:"sm",sx:Rie,children:a.jsx(ve,{as:"span",children:o})},`${o}.${s}`))})}),n&&a.jsx(L,{pos:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,layerStyle:"second",opacity:.7,alignItems:"center",justifyContent:"center",children:a.jsx(fa,{})})]})]})})},Aie=d.memo(Die),EO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx(Ie,{ref:r,...n,children:a.jsxs(Ie,{children:[a.jsx(ve,{fontWeight:600,children:e}),t&&a.jsx(ve,{size:"xs",variant:"subtext",children:t})]})}));EO.displayName="IAIMantineSelectItemWithDescription";const Tie=d.memo(EO),Nie=()=>{const e=te(),{t}=Z(),n=W(s=>s.dynamicPrompts.seedBehaviour),r=d.useMemo(()=>[{value:"PER_ITERATION",label:t("dynamicPrompts.seedBehaviour.perIterationLabel"),description:t("dynamicPrompts.seedBehaviour.perIterationDesc")},{value:"PER_PROMPT",label:t("dynamicPrompts.seedBehaviour.perPromptLabel"),description:t("dynamicPrompts.seedBehaviour.perPromptDesc")}],[t]),o=d.useCallback(s=>{s&&e(IA(s))},[e]);return a.jsx(Et,{feature:"dynamicPromptsSeedBehaviour",children:a.jsx(Pn,{label:t("dynamicPrompts.seedBehaviour.label"),value:n,data:r,itemComponent:Tie,onChange:o})})},$ie=d.memo(Nie),Lie=()=>{const{t:e}=Z(),t=d.useMemo(()=>le(xe,({dynamicPrompts:o})=>{const s=o.prompts.length;return s===1?e("dynamicPrompts.promptsWithCount_one",{count:s}):e("dynamicPrompts.promptsWithCount_other",{count:s})}),[e]),n=W(t);return Ht("dynamicPrompting").isFeatureEnabled?a.jsx(oo,{label:e("dynamicPrompts.dynamicPrompts"),activeLabel:n,children:a.jsxs(L,{sx:{gap:2,flexDir:"column"},children:[a.jsx(Aie,{}),a.jsx($ie,{}),a.jsx(Mie,{})]})}):null},qc=d.memo(Lie),zie=e=>{const t=te(),{lora:n}=e,r=d.useCallback(i=>{t(PA({id:n.id,weight:i}))},[t,n.id]),o=d.useCallback(()=>{t(EA(n.id))},[t,n.id]),s=d.useCallback(()=>{t(MA(n.id))},[t,n.id]);return a.jsx(Et,{feature:"lora",children:a.jsxs(L,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(tt,{label:n.model_name,value:n.weight,onChange:r,min:-1,max:2,step:.01,withInput:!0,withReset:!0,handleReset:o,withSliderMarks:!0,sliderMarks:[-1,0,1,2],sliderNumberInputProps:{min:-50,max:50}}),a.jsx(Fe,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Br,{}),colorScheme:"error"})]})})},Fie=d.memo(zie),Bie=le(xe,({lora:e})=>({lorasArray:nr(e.loras)}),Se),Hie=()=>{const{lorasArray:e}=W(Bie);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Yn,{pt:1}),a.jsx(Fie,{lora:t})]},t.model_name))})},Vie=d.memo(Hie),Wie=le(xe,({lora:e})=>({loras:e.loras}),Se),Uie=()=>{const e=te(),{loras:t}=W(Wie),{data:n}=Cd(),r=W(i=>i.generation.model),o=d.useMemo(()=>{if(!n)return[];const i=[];return Rn(n.entities,(l,u)=>{if(!l||u in t)return;const p=(r==null?void 0:r.base_model)!==l.base_model;i.push({value:u,label:l.model_name,disabled:p,group:an[l.base_model],tooltip:p?`Incompatible base model: ${l.base_model}`:void 0})}),i.sort((l,u)=>l.label&&!u.label?1:-1),i.sort((l,u)=>l.disabled&&!u.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=d.useCallback(i=>{if(!i)return;const l=n==null?void 0:n.entities[i];l&&e(OA(l))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx(L,{sx:{justifyContent:"center",p:2},children:a.jsx(ve,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:ui,disabled:o.length===0,filter:(i,l)=>{var u;return((u=l.label)==null?void 0:u.toLowerCase().includes(i.toLowerCase().trim()))||l.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s,"data-testid":"add-lora"})},Gie=d.memo(Uie),Kie=le(xe,e=>{const t=_I(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Se),qie=()=>{const{activeLabel:e}=W(Kie);return Ht("lora").isFeatureEnabled?a.jsx(oo,{label:"LoRA",activeLabel:e,children:a.jsxs(L,{sx:{flexDir:"column",gap:2},children:[a.jsx(Gie,{}),a.jsx(Vie,{})]})}):null},Xc=d.memo(qie),Xie=()=>{const e=te(),t=W(o=>o.generation.shouldUseCpuNoise),{t:n}=Z(),r=d.useCallback(o=>{e(RA(o.target.checked))},[e]);return a.jsx(Et,{feature:"noiseUseCPU",children:a.jsx(fn,{label:n("parameters.useCpuNoise"),isChecked:t,onChange:r})})},os=e=>e.generation,Qie=le(os,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Se),Yie=()=>{const{t:e}=Z(),{seamlessXAxis:t}=W(Qie),n=te(),r=d.useCallback(o=>{n(DA(o.target.checked))},[n]);return a.jsx(fn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},Zie=d.memo(Yie),Jie=le(os,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Se),ele=()=>{const{t:e}=Z(),{seamlessYAxis:t}=W(Jie),n=te(),r=d.useCallback(o=>{n(AA(o.target.checked))},[n]);return a.jsx(fn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},tle=d.memo(ele),nle=()=>{const{t:e}=Z();return Ht("seamless").isFeatureEnabled?a.jsxs(Kt,{children:[a.jsx(wn,{children:e("parameters.seamlessTiling")})," ",a.jsxs(L,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx(Zie,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(tle,{})})]})]}):null},rle=d.memo(nle);function ole(){const e=W(u=>u.generation.clipSkip),{model:t}=W(u=>u.generation),n=te(),{t:r}=Z(),o=d.useCallback(u=>{n(Cw(u))},[n]),s=d.useCallback(()=>{n(Cw(0))},[n]),i=d.useMemo(()=>t?Qf[t.base_model].maxClip:Qf["sd-1"].maxClip,[t]),l=d.useMemo(()=>t?Qf[t.base_model].markers:Qf["sd-1"].markers,[t]);return(t==null?void 0:t.base_model)==="sdxl"?null:a.jsx(Et,{feature:"clipSkip",placement:"top",children:a.jsx(tt,{label:r("parameters.clipSkip"),"aria-label":r("parameters.clipSkip"),min:0,max:i,step:1,value:e,onChange:o,withSliderMarks:!0,sliderMarks:l,withInput:!0,withReset:!0,handleReset:s})})}const sle=le(xe,e=>{const{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}=e.generation;return{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}},Se);function Qc(){const{clipSkip:e,model:t,seamlessXAxis:n,seamlessYAxis:r,shouldUseCpuNoise:o}=W(sle),{t:s}=Z(),i=d.useMemo(()=>{const l=[];return o?l.push(s("parameters.cpuNoise")):l.push(s("parameters.gpuNoise")),e>0&&t&&t.base_model!=="sdxl"&&l.push(s("parameters.clipSkipWithLayerCount",{layerCount:e})),n&&r?l.push(s("parameters.seamlessX&Y")):n?l.push(s("parameters.seamlessX")):r&&l.push(s("parameters.seamlessY")),l.join(", ")},[e,t,n,r,o,s]);return a.jsx(oo,{label:s("common.advanced"),activeLabel:i,children:a.jsxs(L,{sx:{flexDir:"column",gap:2},children:[a.jsx(rle,{}),a.jsx(Yn,{}),t&&(t==null?void 0:t.base_model)!=="sdxl"&&a.jsxs(a.Fragment,{children:[a.jsx(ole,{}),a.jsx(Yn,{pt:2})]}),a.jsx(Xie,{})]})})}const ale=le(xe,({generation:e})=>{const{model:t}=e;return{mainModel:t}},Se),ile=e=>{const{controlNetId:t,model:n,isEnabled:r}=e.controlNet,o=te(),{mainModel:s}=W(ale),{t:i}=Z(),{data:l}=gh(),u=d.useMemo(()=>{if(!l)return[];const h=[];return Rn(l.entities,(g,x)=>{if(!g)return;const y=(g==null?void 0:g.base_model)!==(s==null?void 0:s.base_model);h.push({value:x,label:g.model_name,group:an[g.base_model],disabled:y,tooltip:y?`${i("controlnet.incompatibleBaseModel")} ${g.base_model}`:void 0})}),h},[l,s==null?void 0:s.base_model,i]),p=d.useMemo(()=>(l==null?void 0:l.entities[`${n==null?void 0:n.base_model}/controlnet/${n==null?void 0:n.model_name}`])??null,[n==null?void 0:n.base_model,n==null?void 0:n.model_name,l==null?void 0:l.entities]),m=d.useCallback(h=>{if(!h)return;const g=CO(h);g&&o(II({controlNetId:t,model:g}))},[t,o]);return a.jsx(nn,{itemComponent:ui,data:u,error:!p||(s==null?void 0:s.base_model)!==p.base_model,placeholder:i("controlnet.selectModel"),value:(p==null?void 0:p.id)??null,onChange:m,disabled:!r,tooltip:p==null?void 0:p.description})},lle=d.memo(ile),cle=e=>{const{weight:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),{t:s}=Z(),i=d.useCallback(l=>{o(TA({controlNetId:r,weight:l}))},[r,o]);return a.jsx(Et,{feature:"controlNetWeight",children:a.jsx(tt,{isDisabled:!n,label:s("controlnet.weight"),value:t,onChange:i,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})})},ule=d.memo(cle),dle=le(xe,({controlNet:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},Se),fle=({isSmall:e,controlNet:t})=>{const{controlImage:n,processedControlImage:r,processorType:o,controlNetId:s}=t,i=te(),{t:l}=Z(),{pendingControlImages:u,autoAddBoardId:p}=W(dle),m=W(Jn),[h,g]=d.useState(!1),{currentData:x}=to(n??$r.skipToken),{currentData:y}=to(r??$r.skipToken),[b]=NA(),[w]=$A(),[S]=LA(),j=d.useCallback(()=>{i(zA({controlNetId:s,controlImage:null}))},[s,i]),_=d.useCallback(async()=>{y&&(await b({imageDTO:y,is_intermediate:!1}).unwrap(),p!=="none"?w({imageDTO:y,board_id:p}):S({imageDTO:y}))},[y,b,p,w,S]),E=d.useCallback(()=>{x&&(m==="unifiedCanvas"?i(Vo({width:x.width,height:x.height})):(i(Hi(x.width)),i(Vi(x.height))))},[x,m,i]),I=d.useCallback(()=>{g(!0)},[]),M=d.useCallback(()=>{g(!1)},[]),R=d.useMemo(()=>{if(x)return{id:s,payloadType:"IMAGE_DTO",payload:{imageDTO:x}}},[x,s]),D=d.useMemo(()=>({id:s,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:s}}),[s]),A=d.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:s}),[s]),O=x&&y&&!h&&!u.includes(s)&&o!=="none";return a.jsxs(L,{onMouseEnter:I,onMouseLeave:M,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center"},children:[a.jsx(ua,{draggableData:R,droppableData:D,imageDTO:x,isDropDisabled:O,postUploadAction:A}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:O?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(ua,{draggableData:R,droppableData:D,imageDTO:y,isUploadDisabled:!0})}),a.jsxs(a.Fragment,{children:[a.jsx(zi,{onClick:j,icon:x?a.jsx(Ud,{}):void 0,tooltip:l("controlnet.resetControlImage")}),a.jsx(zi,{onClick:_,icon:x?a.jsx(lg,{size:16}):void 0,tooltip:l("controlnet.saveControlImage"),styleOverrides:{marginTop:6}}),a.jsx(zi,{onClick:E,icon:x?a.jsx(tee,{size:16}):void 0,tooltip:l("controlnet.setControlImageDimensions"),styleOverrides:{marginTop:12}})]}),u.includes(s)&&a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",alignItems:"center",justifyContent:"center",opacity:.8,borderRadius:"base",bg:"base.400",_dark:{bg:"base.900"}},children:a.jsx(fa,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},e_=d.memo(fle),Io=()=>{const e=te();return d.useCallback((n,r)=>{e(FA({controlNetId:n,changes:r}))},[e])};function Po(e){return a.jsx(L,{sx:{flexDirection:"column",gap:2,pb:2},children:e.children})}const t_=Fr.canny_image_processor.default,ple=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{low_threshold:g})},[t,i]),p=d.useCallback(()=>{i(t,{low_threshold:t_.low_threshold})},[t,i]),m=d.useCallback(g=>{i(t,{high_threshold:g})},[t,i]),h=d.useCallback(()=>{i(t,{high_threshold:t_.high_threshold})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{isDisabled:!r,label:l("controlnet.lowThreshold"),value:o,onChange:u,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(tt,{isDisabled:!r,label:l("controlnet.highThreshold"),value:s,onChange:m,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},mle=d.memo(ple),hle=Fr.color_map_image_processor.default,gle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{color_map_tile_size:o}=n,s=Io(),{t:i}=Z(),l=d.useCallback(p=>{s(t,{color_map_tile_size:p})},[t,s]),u=d.useCallback(()=>{s(t,{color_map_tile_size:hle.color_map_tile_size})},[t,s]);return a.jsx(Po,{children:a.jsx(tt,{isDisabled:!r,label:i("controlnet.colorMapTileSize"),value:o,onChange:l,handleReset:u,withReset:!0,min:1,max:256,step:1,withInput:!0,withSliderMarks:!0,sliderNumberInputProps:{max:4096}})})},vle=d.memo(gle),_u=Fr.content_shuffle_image_processor.default,xle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:l,f:u}=n,p=Io(),{t:m}=Z(),h=d.useCallback(I=>{p(t,{detect_resolution:I})},[t,p]),g=d.useCallback(()=>{p(t,{detect_resolution:_u.detect_resolution})},[t,p]),x=d.useCallback(I=>{p(t,{image_resolution:I})},[t,p]),y=d.useCallback(()=>{p(t,{image_resolution:_u.image_resolution})},[t,p]),b=d.useCallback(I=>{p(t,{w:I})},[t,p]),w=d.useCallback(()=>{p(t,{w:_u.w})},[t,p]),S=d.useCallback(I=>{p(t,{h:I})},[t,p]),j=d.useCallback(()=>{p(t,{h:_u.h})},[t,p]),_=d.useCallback(I=>{p(t,{f:I})},[t,p]),E=d.useCallback(()=>{p(t,{f:_u.f})},[t,p]);return a.jsxs(Po,{children:[a.jsx(tt,{label:m("controlnet.detectResolution"),value:s,onChange:h,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.imageResolution"),value:o,onChange:x,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.w"),value:i,onChange:b,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.h"),value:l,onChange:S,handleReset:j,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.f"),value:u,onChange:_,handleReset:E,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},ble=d.memo(xle),n_=Fr.hed_image_processor.default,yle=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=Io(),{t:l}=Z(),u=d.useCallback(x=>{i(t,{detect_resolution:x})},[t,i]),p=d.useCallback(x=>{i(t,{image_resolution:x})},[t,i]),m=d.useCallback(x=>{i(t,{scribble:x.target.checked})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:n_.detect_resolution})},[t,i]),g=d.useCallback(()=>{i(t,{image_resolution:n_.image_resolution})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.detectResolution"),value:n,onChange:u,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(tt,{label:l("controlnet.imageResolution"),value:r,onChange:p,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(fn,{label:l("controlnet.scribble"),isChecked:o,onChange:m,isDisabled:!s})]})},Cle=d.memo(yle),r_=Fr.lineart_anime_image_processor.default,wle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{detect_resolution:g})},[t,i]),p=d.useCallback(g=>{i(t,{image_resolution:g})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:r_.detect_resolution})},[t,i]),h=d.useCallback(()=>{i(t,{image_resolution:r_.image_resolution})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.detectResolution"),value:s,onChange:u,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Sle=d.memo(wle),o_=Fr.lineart_image_processor.default,kle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,l=Io(),{t:u}=Z(),p=d.useCallback(y=>{l(t,{detect_resolution:y})},[t,l]),m=d.useCallback(y=>{l(t,{image_resolution:y})},[t,l]),h=d.useCallback(()=>{l(t,{detect_resolution:o_.detect_resolution})},[t,l]),g=d.useCallback(()=>{l(t,{image_resolution:o_.image_resolution})},[t,l]),x=d.useCallback(y=>{l(t,{coarse:y.target.checked})},[t,l]);return a.jsxs(Po,{children:[a.jsx(tt,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:u("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(fn,{label:u("controlnet.coarse"),isChecked:i,onChange:x,isDisabled:!r})]})},jle=d.memo(kle),s_=Fr.mediapipe_face_processor.default,_le=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{max_faces:g})},[t,i]),p=d.useCallback(g=>{i(t,{min_confidence:g})},[t,i]),m=d.useCallback(()=>{i(t,{max_faces:s_.max_faces})},[t,i]),h=d.useCallback(()=>{i(t,{min_confidence:s_.min_confidence})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.maxFaces"),value:o,onChange:u,handleReset:m,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.minConfidence"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Ile=d.memo(_le),a_=Fr.midas_depth_image_processor.default,Ple=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{a_mult:g})},[t,i]),p=d.useCallback(g=>{i(t,{bg_th:g})},[t,i]),m=d.useCallback(()=>{i(t,{a_mult:a_.a_mult})},[t,i]),h=d.useCallback(()=>{i(t,{bg_th:a_.bg_th})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.amult"),value:o,onChange:u,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.bgth"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Ele=d.memo(Ple),Rp=Fr.mlsd_image_processor.default,Mle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:l}=n,u=Io(),{t:p}=Z(),m=d.useCallback(j=>{u(t,{detect_resolution:j})},[t,u]),h=d.useCallback(j=>{u(t,{image_resolution:j})},[t,u]),g=d.useCallback(j=>{u(t,{thr_d:j})},[t,u]),x=d.useCallback(j=>{u(t,{thr_v:j})},[t,u]),y=d.useCallback(()=>{u(t,{detect_resolution:Rp.detect_resolution})},[t,u]),b=d.useCallback(()=>{u(t,{image_resolution:Rp.image_resolution})},[t,u]),w=d.useCallback(()=>{u(t,{thr_d:Rp.thr_d})},[t,u]),S=d.useCallback(()=>{u(t,{thr_v:Rp.thr_v})},[t,u]);return a.jsxs(Po,{children:[a.jsx(tt,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.w"),value:i,onChange:g,handleReset:w,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.h"),value:l,onChange:x,handleReset:S,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Ole=d.memo(Mle),i_=Fr.normalbae_image_processor.default,Rle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{detect_resolution:g})},[t,i]),p=d.useCallback(g=>{i(t,{image_resolution:g})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:i_.detect_resolution})},[t,i]),h=d.useCallback(()=>{i(t,{image_resolution:i_.image_resolution})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.detectResolution"),value:s,onChange:u,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Dle=d.memo(Rle),l_=Fr.openpose_image_processor.default,Ale=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,l=Io(),{t:u}=Z(),p=d.useCallback(y=>{l(t,{detect_resolution:y})},[t,l]),m=d.useCallback(y=>{l(t,{image_resolution:y})},[t,l]),h=d.useCallback(()=>{l(t,{detect_resolution:l_.detect_resolution})},[t,l]),g=d.useCallback(()=>{l(t,{image_resolution:l_.image_resolution})},[t,l]),x=d.useCallback(y=>{l(t,{hand_and_face:y.target.checked})},[t,l]);return a.jsxs(Po,{children:[a.jsx(tt,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:u("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(fn,{label:u("controlnet.handAndFace"),isChecked:i,onChange:x,isDisabled:!r})]})},Tle=d.memo(Ale),c_=Fr.pidi_image_processor.default,Nle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:l}=n,u=Io(),{t:p}=Z(),m=d.useCallback(w=>{u(t,{detect_resolution:w})},[t,u]),h=d.useCallback(w=>{u(t,{image_resolution:w})},[t,u]),g=d.useCallback(()=>{u(t,{detect_resolution:c_.detect_resolution})},[t,u]),x=d.useCallback(()=>{u(t,{image_resolution:c_.image_resolution})},[t,u]),y=d.useCallback(w=>{u(t,{scribble:w.target.checked})},[t,u]),b=d.useCallback(w=>{u(t,{safe:w.target.checked})},[t,u]);return a.jsxs(Po,{children:[a.jsx(tt,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(fn,{label:p("controlnet.scribble"),isChecked:i,onChange:y}),a.jsx(fn,{label:p("controlnet.safe"),isChecked:l,onChange:b,isDisabled:!r})]})},$le=d.memo(Nle),Lle=e=>null,zle=d.memo(Lle),Fle=e=>{const{controlNetId:t,isEnabled:n,processorNode:r}=e.controlNet;return r.type==="canny_image_processor"?a.jsx(mle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="color_map_image_processor"?a.jsx(vle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="hed_image_processor"?a.jsx(Cle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_image_processor"?a.jsx(jle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="content_shuffle_image_processor"?a.jsx(ble,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_anime_image_processor"?a.jsx(Sle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mediapipe_face_processor"?a.jsx(Ile,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="midas_depth_image_processor"?a.jsx(Ele,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mlsd_image_processor"?a.jsx(Ole,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="normalbae_image_processor"?a.jsx(Dle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="openpose_image_processor"?a.jsx(Tle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="pidi_image_processor"?a.jsx($le,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="zoe_depth_image_processor"?a.jsx(zle,{controlNetId:t,processorNode:r,isEnabled:n}):null},Ble=d.memo(Fle),Hle=e=>{const{controlNetId:t,isEnabled:n,shouldAutoConfig:r}=e.controlNet,o=te(),{t:s}=Z(),i=d.useCallback(()=>{o(BA({controlNetId:t}))},[t,o]);return a.jsx(fn,{label:s("controlnet.autoConfigure"),"aria-label":s("controlnet.autoConfigure"),isChecked:r,onChange:i,isDisabled:!n})},Vle=d.memo(Hle),Wle=e=>{const{controlNet:t}=e,n=te(),{t:r}=Z(),o=d.useCallback(()=>{n(HA({controlNet:t}))},[t,n]),s=d.useCallback(()=>{n(VA({controlNet:t}))},[t,n]);return a.jsxs(L,{sx:{gap:2},children:[a.jsx(Fe,{size:"sm",icon:a.jsx(Yi,{}),tooltip:r("controlnet.importImageFromCanvas"),"aria-label":r("controlnet.importImageFromCanvas"),onClick:o}),a.jsx(Fe,{size:"sm",icon:a.jsx(mM,{}),tooltip:r("controlnet.importMaskFromCanvas"),"aria-label":r("controlnet.importMaskFromCanvas"),onClick:s})]})},Ule=d.memo(Wle),u_=e=>`${Math.round(e*100)}%`,Gle=e=>{const{beginStepPct:t,endStepPct:n,isEnabled:r,controlNetId:o}=e.controlNet,s=te(),{t:i}=Z(),l=d.useCallback(u=>{s(WA({controlNetId:o,beginStepPct:u[0]})),s(UA({controlNetId:o,endStepPct:u[1]}))},[o,s]);return a.jsx(Et,{feature:"controlNetBeginEnd",children:a.jsxs(Kt,{isDisabled:!r,children:[a.jsx(wn,{children:i("controlnet.beginEndStepPercent")}),a.jsx(Rh,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(Vb,{"aria-label":["Begin Step %","End Step %!"],value:[t,n],onChange:l,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!r,children:[a.jsx(Wb,{children:a.jsx(Ub,{})}),a.jsx(Ft,{label:u_(t),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:0})}),a.jsx(Ft,{label:u_(n),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:1})}),a.jsx(Ti,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Ti,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Ti,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})})},Kle=d.memo(Gle);function qle(e){const{controlMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),{t:s}=Z(),i=[{label:s("controlnet.balanced"),value:"balanced"},{label:s("controlnet.prompt"),value:"more_prompt"},{label:s("controlnet.control"),value:"more_control"},{label:s("controlnet.megaControl"),value:"unbalanced"}],l=d.useCallback(u=>{o(GA({controlNetId:r,controlMode:u}))},[r,o]);return a.jsx(Et,{feature:"controlNetControlMode",children:a.jsx(Pn,{disabled:!n,label:s("controlnet.controlMode"),data:i,value:String(t),onChange:l})})}const Xle=le(Xy,e=>nr(Fr,n=>({value:n.type,label:n.label})).sort((n,r)=>n.value==="none"?-1:r.value==="none"?1:n.label.localeCompare(r.label)).filter(n=>!e.sd.disabledControlNetProcessors.includes(n.value)),Se),Qle=e=>{const t=te(),{controlNetId:n,isEnabled:r,processorNode:o}=e.controlNet,s=W(Xle),{t:i}=Z(),l=d.useCallback(u=>{t(KA({controlNetId:n,processorType:u}))},[n,t]);return a.jsx(nn,{label:i("controlnet.processor"),value:o.type??"canny_image_processor",data:s,onChange:l,disabled:!r})},Yle=d.memo(Qle);function Zle(e){const{resizeMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),{t:s}=Z(),i=[{label:s("controlnet.resize"),value:"just_resize"},{label:s("controlnet.crop"),value:"crop_resize"},{label:s("controlnet.fill"),value:"fill_resize"}],l=d.useCallback(u=>{o(qA({controlNetId:r,resizeMode:u}))},[r,o]);return a.jsx(Et,{feature:"controlNetResizeMode",children:a.jsx(Pn,{disabled:!n,label:s("controlnet.resizeMode"),data:i,value:String(t),onChange:l})})}const Jle=e=>{const{controlNet:t}=e,{controlNetId:n}=t,r=te(),{t:o}=Z(),s=W(Jn),i=le(xe,({controlNet:y})=>{const b=y.controlNets[n];if(!b)return{isEnabled:!1,shouldAutoConfig:!1};const{isEnabled:w,shouldAutoConfig:S}=b;return{isEnabled:w,shouldAutoConfig:S}},Se),{isEnabled:l,shouldAutoConfig:u}=W(i),[p,m]=dee(!1),h=d.useCallback(()=>{r(XA({controlNetId:n}))},[n,r]),g=d.useCallback(()=>{r(QA({sourceControlNetId:n,newControlNetId:Zs()}))},[n,r]),x=d.useCallback(y=>{r(YA({controlNetId:n,isEnabled:y.target.checked}))},[n,r]);return a.jsxs(L,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsxs(L,{sx:{gap:2,alignItems:"center"},children:[a.jsx(fn,{tooltip:o("controlnet.toggleControlNet"),"aria-label":o("controlnet.toggleControlNet"),isChecked:l,onChange:x}),a.jsx(Ie,{sx:{w:"full",minW:0,transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(lle,{controlNet:t})}),s==="unifiedCanvas"&&a.jsx(Ule,{controlNet:t}),a.jsx(Fe,{size:"sm",tooltip:o("controlnet.duplicate"),"aria-label":o("controlnet.duplicate"),onClick:g,icon:a.jsx(Hc,{})}),a.jsx(Fe,{size:"sm",tooltip:o("controlnet.delete"),"aria-label":o("controlnet.delete"),colorScheme:"error",onClick:h,icon:a.jsx(Br,{})}),a.jsx(Fe,{size:"sm",tooltip:o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),"aria-label":o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),onClick:m,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(gg,{sx:{boxSize:4,color:"base.700",transform:p?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})}),!u&&a.jsx(Ie,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",top:4,insetInlineEnd:4,bg:"accent.700",_dark:{bg:"accent.400"}}})]}),a.jsxs(L,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs(L,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs(L,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:p?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(ule,{controlNet:t}),a.jsx(Kle,{controlNet:t})]}),!p&&a.jsx(L,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(e_,{controlNet:t,isSmall:!0})})]}),a.jsxs(L,{sx:{gap:2},children:[a.jsx(qle,{controlNet:t}),a.jsx(Zle,{controlNet:t})]}),a.jsx(Yle,{controlNet:t})]}),p&&a.jsxs(a.Fragment,{children:[a.jsx(e_,{controlNet:t}),a.jsx(Vle,{controlNet:t}),a.jsx(Ble,{controlNet:t})]})]})},ece=d.memo(Jle),d_=e=>`${Math.round(e*100)}%`,tce=()=>{const e=W(i=>i.controlNet.isIPAdapterEnabled),t=W(i=>i.controlNet.ipAdapterInfo.beginStepPct),n=W(i=>i.controlNet.ipAdapterInfo.endStepPct),r=te(),{t:o}=Z(),s=d.useCallback(i=>{r(ZA(i[0])),r(JA(i[1]))},[r]);return a.jsxs(Kt,{isDisabled:!e,children:[a.jsx(wn,{children:o("controlnet.beginEndStepPercent")}),a.jsx(Rh,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(Vb,{"aria-label":["Begin Step %","End Step %!"],value:[t,n],onChange:s,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!e,children:[a.jsx(Wb,{children:a.jsx(Ub,{})}),a.jsx(Ft,{label:d_(t),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:0})}),a.jsx(Ft,{label:d_(n),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:1})}),a.jsx(Ti,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Ti,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Ti,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},nce=d.memo(tce),rce=le(xe,e=>{const{isIPAdapterEnabled:t}=e.controlNet;return{isIPAdapterEnabled:t}},Se),oce=()=>{const{isIPAdapterEnabled:e}=W(rce),t=te(),{t:n}=Z(),r=d.useCallback(o=>{t(u1(o.target.checked))},[t]);return a.jsx(fn,{label:n("controlnet.enableIPAdapter"),isChecked:e,onChange:r,formControlProps:{width:"100%"}})},sce=d.memo(oce),ace=le(xe,({controlNet:e})=>{const{ipAdapterInfo:t}=e;return{ipAdapterInfo:t}},Se),ice=()=>{const{ipAdapterInfo:e}=W(ace),t=te(),{t:n}=Z(),{currentData:r}=to(e.adapterImage??$r.skipToken),o=d.useMemo(()=>{if(r)return{id:"ip-adapter-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r]),s=d.useMemo(()=>({id:"ip-adapter-image",actionType:"SET_IP_ADAPTER_IMAGE"}),[]),i=d.useMemo(()=>({type:"SET_IP_ADAPTER_IMAGE"}),[]);return a.jsxs(L,{layerStyle:"second",sx:{position:"relative",h:28,w:28,alignItems:"center",justifyContent:"center",aspectRatio:"1/1",borderRadius:"base"},children:[a.jsx(ua,{imageDTO:r,droppableData:s,draggableData:o,postUploadAction:i,dropLabel:n("toast.setIPAdapterImage"),noContentFallback:a.jsx(Zn,{label:n("controlnet.ipAdapterImageFallback")})}),a.jsx(zi,{onClick:()=>t(eT(null)),icon:e.adapterImage?a.jsx(Ud,{}):void 0,tooltip:n("controlnet.resetIPAdapterImage")})]})},lce=d.memo(ice),cce=()=>{const e=W(p=>p.controlNet.isIPAdapterEnabled),t=W(p=>p.controlNet.ipAdapterInfo.model),n=W(p=>p.generation.model),r=te(),{t:o}=Z(),{data:s}=Ux(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${t==null?void 0:t.base_model}/ip_adapter/${t==null?void 0:t.model_name}`])??null,[t==null?void 0:t.base_model,t==null?void 0:t.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{if(!m)return;const g=(n==null?void 0:n.base_model)!==m.base_model;p.push({value:h,label:m.model_name,group:an[m.base_model],disabled:g,tooltip:g?`Incompatible base model: ${m.base_model}`:void 0})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s,n==null?void 0:n.base_model]),u=d.useCallback(p=>{if(!p)return;const m=_O(p);m&&r(tT(m))},[r]);return a.jsx(Pn,{label:o("controlnet.ipAdapterModel"),className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:l.length>0?o("models.selectModel"):o("models.noModelsAvailable"),error:!i&&l.length>0,data:l,onChange:u,sx:{width:"100%"},disabled:!e||l.length===0})},uce=d.memo(cce),dce=()=>{const e=W(i=>i.controlNet.isIPAdapterEnabled),t=W(i=>i.controlNet.ipAdapterInfo.weight),n=te(),{t:r}=Z(),o=d.useCallback(i=>{n(ww(i))},[n]),s=d.useCallback(()=>{n(ww(1))},[n]);return a.jsx(tt,{isDisabled:!e,label:r("controlnet.weight"),value:t,onChange:o,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2],withReset:!0,handleReset:s})},fce=d.memo(dce),pce=le(xe,e=>{const{isIPAdapterEnabled:t}=e.controlNet;return{isIPAdapterEnabled:t}},Se),mce=()=>{const{isIPAdapterEnabled:e}=W(pce);return a.jsxs(L,{sx:{flexDir:"column",gap:3,paddingInline:3,paddingBlock:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(sce,{}),e&&a.jsxs(a.Fragment,{children:[a.jsx(uce,{}),a.jsxs(L,{gap:"3",children:[a.jsxs(L,{flexDirection:"column",sx:{h:28,w:"full",gap:4,mb:4},children:[a.jsx(fce,{}),a.jsx(nce,{})]}),a.jsx(lce,{})]})]})]})},hce=d.memo(mce),gce=le(xe,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},Se),vce=()=>{const{isEnabled:e}=W(gce),t=te(),n=d.useCallback(()=>{t(nT())},[t]);return a.jsx(Ie,{width:"100%",children:a.jsx(Et,{feature:"controlNet",children:a.jsx(fn,{label:"Enable ControlNet",isChecked:e,onChange:n})})})},xce=d.memo(vce),bce=le([xe],({controlNet:e})=>{const{controlNets:t,isEnabled:n,isIPAdapterEnabled:r,ipAdapterInfo:o}=e,s=rT(t),i=o.model&&o.adapterImage;let l;return n&&s.length>0&&(l=`${s.length} ControlNet`),r&&i&&(l?l=`${l}, IP Adapter`:l="IP Adapter"),{controlNetsArray:nr(t),activeLabel:l}},Se),yce=()=>{const{controlNetsArray:e,activeLabel:t}=W(bce),n=Ht("controlNet").isFeatureDisabled,r=te(),{data:o}=gh(),s=d.useMemo(()=>{if(!o||!Object.keys(o.entities).length)return;const l=Object.keys(o.entities)[0];if(!l)return;const u=o.entities[l];return u||void 0},[o]),i=d.useCallback(()=>{if(!s)return;const l=Zs();r(oT({controlNetId:l})),r(II({controlNetId:l,model:s}))},[r,s]);return n?null:a.jsx(oo,{label:"Control Adapters",activeLabel:t,children:a.jsxs(L,{sx:{flexDir:"column",gap:2},children:[a.jsxs(L,{sx:{w:"100%",gap:2,p:2,ps:3,borderRadius:"base",alignItems:"center",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(xce,{}),a.jsx(Fe,{tooltip:"Add ControlNet","aria-label":"Add ControlNet",icon:a.jsx(Vc,{}),isDisabled:!s,flexGrow:1,size:"sm",onClick:i,"data-testid":"add controlnet"})]}),e.map((l,u)=>a.jsxs(d.Fragment,{children:[u>0&&a.jsx(Yn,{}),a.jsx(ece,{controlNet:l})]},l.controlNetId)),a.jsx(hce,{})]})})},Yc=d.memo(yce),Cce=e=>{const{onClick:t}=e,{t:n}=Z();return a.jsx(Fe,{size:"sm","aria-label":n("embedding.addEmbedding"),tooltip:n("embedding.addEmbedding"),icon:a.jsx(iM,{}),sx:{p:2,color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}}},variant:"link",onClick:t})},Rg=d.memo(Cce),wce="28rem",Sce=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=sT(),i=d.useRef(null),{t:l}=Z(),u=W(h=>h.generation.model),p=d.useMemo(()=>{if(!s)return[];const h=[];return Rn(s.entities,(g,x)=>{if(!g)return;const y=(u==null?void 0:u.base_model)!==g.base_model;h.push({value:g.model_name,label:g.model_name,group:an[g.base_model],disabled:y,tooltip:y?`${l("embedding.incompatibleModel")} ${g.base_model}`:void 0})}),h.sort((g,x)=>{var y;return g.label&&x.label?(y=g.label)!=null&&y.localeCompare(x.label)?-1:1:-1}),h.sort((g,x)=>g.disabled&&!x.disabled?1:-1)},[s,u==null?void 0:u.base_model,l]),m=d.useCallback(h=>{h&&t(h)},[t]);return a.jsxs(Ld,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Wh,{children:o}),a.jsx(zd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Uh,{sx:{p:0,w:`calc(${wce} - 2rem )`},children:p.length===0?a.jsx(L,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(ve,{children:"No Embeddings Loaded"})}):a.jsx(nn,{inputRef:i,autoFocus:!0,placeholder:l("embedding.addEmbedding"),value:null,data:p,nothingFound:l("embedding.noMatchingEmbedding"),itemComponent:ui,disabled:p.length===0,onDropdownClose:r,filter:(h,g)=>{var x;return((x=g.label)==null?void 0:x.toLowerCase().includes(h.toLowerCase().trim()))||g.value.toLowerCase().includes(h.toLowerCase().trim())},onChange:m})})})]})},Dg=d.memo(Sce),kce=()=>{const e=W(h=>h.generation.negativePrompt),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),s=te(),{t:i}=Z(),l=d.useCallback(h=>{s($u(h.target.value))},[s]),u=d.useCallback(h=>{h.key==="<"&&o()},[o]),p=d.useCallback(h=>{if(!t.current)return;const g=t.current.selectionStart;if(g===void 0)return;let x=e.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=e.slice(g),qr.flushSync(()=>{s($u(x))}),t.current.selectionEnd=y,r()},[s,r,e]),m=Ht("embedding").isFeatureEnabled;return a.jsxs(Kt,{children:[a.jsx(Dg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(Et,{feature:"paramNegativeConditioning",placement:"right",children:a.jsx(da,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:l,resize:"vertical",fontSize:"sm",minH:16,...m&&{onKeyDown:u}})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:o})})]})},MO=d.memo(kce),jce=le([xe],({generation:e})=>({prompt:e.positivePrompt}),{memoizeOptions:{resultEqualityCheck:Bt}}),_ce=()=>{const e=te(),{prompt:t}=W(jce),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Lr(),{t:i}=Z(),l=d.useCallback(h=>{e(Nu(h.target.value))},[e]);et("alt+a",()=>{var h;(h=n.current)==null||h.focus()},[]);const u=d.useCallback(h=>{if(!n.current)return;const g=n.current.selectionStart;if(g===void 0)return;let x=t.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=t.slice(g),qr.flushSync(()=>{e(Nu(x))}),n.current.selectionStart=y,n.current.selectionEnd=y,o()},[e,o,t]),p=Ht("embedding").isFeatureEnabled,m=d.useCallback(h=>{p&&h.key==="<"&&s()},[s,p]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(Kt,{children:a.jsx(Dg,{isOpen:r,onClose:o,onSelect:u,children:a.jsx(Et,{feature:"paramPositiveConditioning",placement:"right",children:a.jsx(da,{id:"prompt",name:"prompt",ref:n,value:t,placeholder:i("parameters.positivePromptPlaceholder"),onChange:l,onKeyDown:m,resize:"vertical",minH:32})})})}),!r&&p&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:s})})]})},OO=d.memo(_ce);function Ice(){const e=W(o=>o.sdxl.shouldConcatSDXLStylePrompt),t=te(),{t:n}=Z(),r=()=>{t(aT(!e))};return a.jsx(Fe,{"aria-label":n("sdxl.concatPromptStyle"),tooltip:n("sdxl.concatPromptStyle"),variant:"outline",isChecked:e,onClick:r,icon:a.jsx(fM,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const f_={position:"absolute",bg:"none",w:"full",minH:2,borderRadius:0,borderLeft:"none",borderRight:"none",zIndex:2,maskImage:"radial-gradient(circle at center, black, black 65%, black 30%, black 15%, transparent)"};function RO(){return a.jsxs(L,{children:[a.jsx(Ie,{as:In.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"1px",borderTop:"none",borderColor:"base.400",...f_,_dark:{borderColor:"accent.500"}}}),a.jsx(Ie,{as:In.div,initial:{opacity:0,scale:0},animate:{opacity:[0,1,1,1],scale:[0,.75,1.5,1],transition:{duration:.42,times:[0,.25,.5,1]}},exit:{opacity:0,scale:0},sx:{zIndex:3,position:"absolute",left:"48%",top:"3px",p:1,borderRadius:4,bg:"accent.400",color:"base.50",_dark:{bg:"accent.500"}},children:a.jsx(fM,{size:12})}),a.jsx(Ie,{as:In.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"17px",borderBottom:"none",borderColor:"base.400",...f_,_dark:{borderColor:"accent.500"}}})]})}const Pce=le([xe],({sdxl:e})=>{const{negativeStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Ece=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:i,shouldConcatSDXLStylePrompt:l}=W(Pce),u=d.useCallback(g=>{e(zu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=i.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=i.slice(x),qr.flushSync(()=>{e(zu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,i]),m=Ht("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(dr,{children:l&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(RO,{})})}),a.jsx(Kt,{children:a.jsx(Dg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:i,placeholder:s("sdxl.negStylePrompt"),onChange:u,onKeyDown:h,resize:"vertical",fontSize:"sm",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:o})})]})},Mce=d.memo(Ece),Oce=le([xe],({sdxl:e})=>{const{positiveStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Rce=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:i,shouldConcatSDXLStylePrompt:l}=W(Oce),u=d.useCallback(g=>{e(Lu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=i.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=i.slice(x),qr.flushSync(()=>{e(Lu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,i]),m=Ht("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(dr,{children:l&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(RO,{})})}),a.jsx(Kt,{children:a.jsx(Dg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:i,placeholder:s("sdxl.posStylePrompt"),onChange:u,onKeyDown:h,resize:"vertical",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:o})})]})},Dce=d.memo(Rce);function a2(){return a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsx(OO,{}),a.jsx(Ice,{}),a.jsx(Dce,{}),a.jsx(MO,{}),a.jsx(Mce,{})]})}const dl=()=>{const{isRefinerAvailable:e}=Xo(ob,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},Ace=le([xe],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},Se),Tce=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=W(Ace),r=dl(),o=te(),{t:s}=Z(),i=d.useCallback(u=>o(f1(u)),[o]),l=d.useCallback(()=>o(f1(7)),[o]);return t?a.jsx(tt,{label:s("sdxl.cfgScale"),step:n?.1:.5,min:1,max:20,onChange:i,handleReset:l,value:e,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!r}):a.jsx(Kc,{label:s("sdxl.cfgScale"),step:.5,min:1,max:200,onChange:i,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},Nce=d.memo(Tce),$ce=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=iT.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data},Lce=le(xe,e=>({model:e.sdxl.refinerModel}),Se),zce=()=>{const e=te(),t=Ht("syncModels").isFeatureEnabled,{model:n}=W(Lce),{t:r}=Z(),{data:o,isLoading:s}=Xo(ob),i=d.useMemo(()=>{if(!o)return[];const p=[];return Rn(o.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[o]),l=d.useMemo(()=>(o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])??null,[o==null?void 0:o.entities,n]),u=d.useCallback(p=>{if(!p)return;const m=$ce(p);m&&e(fI(m))},[e]);return s?a.jsx(nn,{label:r("sdxl.refinermodel"),placeholder:r("sdxl.loading"),disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{tooltip:l==null?void 0:l.description,label:r("sdxl.refinermodel"),value:l==null?void 0:l.id,placeholder:i.length>0?r("sdxl.selectAModel"):r("sdxl.noModelsAvailable"),data:i,error:i.length===0,disabled:i.length===0,onChange:u,w:"100%"}),t&&a.jsx(Ie,{mt:7,children:a.jsx(Gc,{iconMode:!0})})]})},Fce=d.memo(zce),Bce=le([xe],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},Se),Hce=()=>{const{refinerNegativeAestheticScore:e,shift:t}=W(Bce),n=dl(),r=te(),{t:o}=Z(),s=d.useCallback(l=>r(m1(l)),[r]),i=d.useCallback(()=>r(m1(2.5)),[r]);return a.jsx(tt,{label:o("sdxl.negAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:i,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Vce=d.memo(Hce),Wce=le([xe],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},Se),Uce=()=>{const{refinerPositiveAestheticScore:e,shift:t}=W(Wce),n=dl(),r=te(),{t:o}=Z(),s=d.useCallback(l=>r(p1(l)),[r]),i=d.useCallback(()=>r(p1(6)),[r]);return a.jsx(tt,{label:o("sdxl.posAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:i,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Gce=d.memo(Uce),Kce=le(xe,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=nr(mh,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{refinerScheduler:n,data:o}},Se),qce=()=>{const e=te(),{t}=Z(),{refinerScheduler:n,data:r}=W(Kce),o=dl(),s=d.useCallback(i=>{i&&e(pI(i))},[e]);return a.jsx(nn,{w:"100%",label:t("sdxl.scheduler"),value:n,data:r,onChange:s,disabled:!o})},Xce=d.memo(qce),Qce=le([xe],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},Se),Yce=()=>{const{refinerStart:e}=W(Qce),t=te(),n=dl(),r=d.useCallback(i=>t(h1(i)),[t]),{t:o}=Z(),s=d.useCallback(()=>t(h1(.8)),[t]);return a.jsx(tt,{label:o("sdxl.refinerStart"),step:.01,min:0,max:1,onChange:r,handleReset:s,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Zce=d.memo(Yce),Jce=le([xe],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},Se),eue=()=>{const{refinerSteps:e,shouldUseSliders:t}=W(Jce),n=dl(),r=te(),{t:o}=Z(),s=d.useCallback(l=>{r(d1(l))},[r]),i=d.useCallback(()=>{r(d1(20))},[r]);return t?a.jsx(tt,{label:o("sdxl.steps"),min:1,max:100,step:1,onChange:s,handleReset:i,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:500},isDisabled:!n}):a.jsx(Kc,{label:o("sdxl.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},tue=d.memo(eue);function nue(){const e=W(s=>s.sdxl.shouldUseSDXLRefiner),t=dl(),n=te(),{t:r}=Z(),o=s=>{n(lT(s.target.checked))};return a.jsx(fn,{label:r("sdxl.useRefiner"),isChecked:e,onChange:o,isDisabled:!t})}const rue=le(xe,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},Se),oue=()=>{const{activeLabel:e,shouldUseSliders:t}=W(rue),{t:n}=Z();return a.jsx(oo,{label:n("sdxl.refiner"),activeLabel:e,children:a.jsxs(L,{sx:{gap:2,flexDir:"column"},children:[a.jsx(nue,{}),a.jsx(Fce,{}),a.jsxs(L,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(tue,{}),a.jsx(Nce,{})]}),a.jsx(Xce,{}),a.jsx(Gce,{}),a.jsx(Vce,{}),a.jsx(Zce,{})]})})},i2=d.memo(oue),sue=le([xe],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l}=t.sd.guidance,{cfgScale:u}=e,{shouldUseSliders:p}=n,{shift:m}=r;return{cfgScale:u,initial:o,min:s,sliderMax:i,inputMax:l,shouldUseSliders:p,shift:m}},Se),aue=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=W(sue),l=te(),{t:u}=Z(),p=d.useCallback(h=>l(Qp(h)),[l]),m=d.useCallback(()=>l(Qp(t)),[l,t]);return s?a.jsx(Et,{feature:"paramCFGScale",children:a.jsx(tt,{label:u("parameters.cfgScale"),step:i?.1:.5,min:n,max:r,onChange:p,handleReset:m,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1})}):a.jsx(Et,{feature:"paramCFGScale",children:a.jsx(Kc,{label:u("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})})},_s=d.memo(aue),iue=le(xe,e=>({model:e.generation.model}),Se),lue=()=>{const e=te(),{t}=Z(),{model:n}=W(iue),r=Ht("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Xo(Sw),{data:i,isLoading:l}=Ku(Sw),u=W(Jn),p=d.useMemo(()=>{if(!o)return[];const g=[];return Rn(o.entities,(x,y)=>{x&&g.push({value:y,label:x.model_name,group:an[x.base_model]})}),Rn(i==null?void 0:i.entities,(x,y)=>{!x||u==="unifiedCanvas"||u==="img2img"||g.push({value:y,label:x.model_name,group:an[x.base_model]})}),g},[o,i,u]),m=d.useMemo(()=>((o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])||(i==null?void 0:i.entities[`${n==null?void 0:n.base_model}/onnx/${n==null?void 0:n.model_name}`]))??null,[o==null?void 0:o.entities,n,i==null?void 0:i.entities]),h=d.useCallback(g=>{if(!g)return;const x=Og(g);x&&e(i1(x))},[e]);return s||l?a.jsx(nn,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Et,{feature:"paramModel",children:a.jsx(nn,{tooltip:m==null?void 0:m.description,label:t("modelManager.model"),value:m==null?void 0:m.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:p.length===0,disabled:p.length===0,onChange:h,w:"100%"})}),r&&a.jsx(Ie,{mt:6,children:a.jsx(Gc,{iconMode:!0})})]})},cue=d.memo(lue),uue=le(xe,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},Se),due=()=>{const e=te(),{t}=Z(),{model:n,vae:r}=W(uue),{data:o}=kI(),s=d.useMemo(()=>{if(!o)return[];const u=[{value:"default",label:"Default",group:"Default"}];return Rn(o.entities,(p,m)=>{if(!p)return;const h=(n==null?void 0:n.base_model)!==p.base_model;u.push({value:m,label:p.model_name,group:an[p.base_model],disabled:h,tooltip:h?`Incompatible base model: ${p.base_model}`:void 0})}),u.sort((p,m)=>p.disabled&&!m.disabled?1:-1)},[o,n==null?void 0:n.base_model]),i=d.useMemo(()=>(o==null?void 0:o.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[o==null?void 0:o.entities,r]),l=d.useCallback(u=>{if(!u||u==="default"){e(kw(null));return}const p=jO(u);p&&e(kw(p))},[e]);return a.jsx(Et,{feature:"paramVAE",children:a.jsx(nn,{itemComponent:ui,tooltip:i==null?void 0:i.description,label:t("modelManager.vae"),value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:s,onChange:l,disabled:s.length===0,clearable:!0})})},fue=d.memo(due),pue=le([PI,os],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=nr(mh,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{scheduler:n,data:o}},Se),mue=()=>{const e=te(),{t}=Z(),{scheduler:n,data:r}=W(pue),o=d.useCallback(s=>{s&&e(l1(s))},[e]);return a.jsx(Et,{feature:"paramScheduler",children:a.jsx(nn,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})})},hue=d.memo(mue),gue=le(xe,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},Se),vue=["fp16","fp32"],xue=()=>{const e=te(),{vaePrecision:t}=W(gue),n=d.useCallback(r=>{r&&e(cT(r))},[e]);return a.jsx(Et,{feature:"paramVAEPrecision",children:a.jsx(Pn,{label:"VAE Precision",value:t,data:vue,onChange:n})})},bue=d.memo(xue),yue=()=>{const e=Ht("vae").isFeatureEnabled;return a.jsxs(L,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(cue,{})}),a.jsx(Ie,{w:"full",children:a.jsx(hue,{})}),e&&a.jsxs(L,{w:"full",gap:3,children:[a.jsx(fue,{}),a.jsx(bue,{})]})]})},Is=d.memo(yue),DO=[{name:"Free",value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],AO=DO.map(e=>e.value);function TO(){const e=W(o=>o.generation.aspectRatio),t=te(),n=W(o=>o.generation.shouldFitToWidthHeight),r=W(Jn);return a.jsx(Vt,{isAttached:!0,children:DO.map(o=>a.jsx(at,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(zo(o.value)),t(qu(!1))},children:o.name},o.name))})}const Cue=le([xe],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.height,{model:u,height:p}=e,{aspectRatio:m}=e,h=t.shift?i:l;return{model:u,height:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Se),wue=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=W(Cue),u=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(u(Vi(x)),l){const y=wr(x*l,8);u(Hi(y))}},[u,l]),g=d.useCallback(()=>{if(u(Vi(m)),l){const x=wr(m*l,8);u(Hi(x))}},[u,m,l]);return a.jsx(tt,{label:p("parameters.height"),value:n,min:r,step:i,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Sue=d.memo(wue),kue=le([xe],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.width,{model:u,width:p,aspectRatio:m}=e,h=t.shift?i:l;return{model:u,width:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Se),jue=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=W(kue),u=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(u(Hi(x)),l){const y=wr(x/l,8);u(Vi(y))}},[u,l]),g=d.useCallback(()=>{if(u(Hi(m)),l){const x=wr(m/l,8);u(Vi(x))}},[u,m,l]);return a.jsx(tt,{label:p("parameters.width"),value:n,min:r,step:i,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},_ue=d.memo(jue),Iue=le([os,Jn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}},Se);function Oc(){const{t:e}=Z(),t=te(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:i}=W(Iue),l=d.useCallback(()=>{o?(t(qu(!1)),AO.includes(s/i)?t(zo(s/i)):t(zo(null))):(t(qu(!0)),t(zo(s/i)))},[o,s,i,t]),u=d.useCallback(()=>{t(uT()),t(zo(null)),o&&t(zo(i/s))},[t,o,s,i]);return a.jsxs(L,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsx(Et,{feature:"paramRatio",children:a.jsxs(Kt,{as:L,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(wn,{children:e("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(TO,{}),a.jsx(Fe,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(L8,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:u}),a.jsx(Fe,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(pM,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:l})]})}),a.jsx(L,{gap:2,alignItems:"center",children:a.jsxs(L,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(_ue,{isDisabled:n==="img2img"?!r:!1}),a.jsx(Sue,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Pue=le([xe],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l,fineStep:u,coarseStep:p}=t.sd.steps,{steps:m}=e,{shouldUseSliders:h}=n,g=r.shift?u:p;return{steps:m,initial:o,min:s,sliderMax:i,inputMax:l,step:g,shouldUseSliders:h}},Se),Eue=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=W(Pue),l=te(),{t:u}=Z(),p=d.useCallback(g=>{l(Yp(g))},[l]),m=d.useCallback(()=>{l(Yp(t))},[l,t]),h=d.useCallback(()=>{l(nb())},[l]);return i?a.jsx(Et,{feature:"paramSteps",children:a.jsx(tt,{label:u("parameters.steps"),min:n,max:r,step:s,onChange:p,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}})}):a.jsx(Et,{feature:"paramSteps",children:a.jsx(Kc,{label:u("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:h})})},Ps=d.memo(Eue);function NO(){const e=te(),t=W(o=>o.generation.shouldFitToWidthHeight),n=o=>e(dT(o.target.checked)),{t:r}=Z();return a.jsx(fn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function Mue(){const e=W(i=>i.generation.seed),t=W(i=>i.generation.shouldRandomizeSeed),n=W(i=>i.generation.shouldGenerateVariations),{t:r}=Z(),o=te(),s=i=>o(Xp(i));return a.jsx(Kc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:EI,max:MI,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const Oue=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function Rue(){const e=te(),t=W(o=>o.generation.shouldRandomizeSeed),{t:n}=Z(),r=()=>e(Xp(Oue(EI,MI)));return a.jsx(Fe,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(JJ,{})})}const Due=()=>{const e=te(),{t}=Z(),n=W(o=>o.generation.shouldRandomizeSeed),r=o=>e(fT(o.target.checked));return a.jsx(fn,{label:t("common.random"),isChecked:n,onChange:r})},Aue=d.memo(Due),Tue=()=>a.jsx(Et,{feature:"paramSeed",children:a.jsxs(L,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(Mue,{}),a.jsx(Rue,{}),a.jsx(Aue,{})]})}),Es=d.memo(Tue),$O=je((e,t)=>a.jsxs(L,{ref:t,sx:{flexDir:"column",gap:2,bg:"base.100",px:4,pt:2,pb:4,borderRadius:"base",_dark:{bg:"base.750"}},children:[a.jsx(ve,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]}));$O.displayName="SubSettingsWrapper";const Rc=d.memo($O),Nue=le([xe],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},Se),$ue=()=>{const{sdxlImg2ImgDenoisingStrength:e}=W(Nue),t=te(),{t:n}=Z(),r=d.useCallback(s=>t(jw(s)),[t]),o=d.useCallback(()=>{t(jw(.7))},[t]);return a.jsx(Et,{feature:"paramDenoisingStrength",children:a.jsx(Rc,{children:a.jsx(tt,{label:n("sdxl.denoisingStrength"),step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})})},LO=d.memo($ue),Lue=le([PI,os],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Se),zue=()=>{const{shouldUseSliders:e,activeLabel:t}=W(Lue);return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}),a.jsx(LO,{}),a.jsx(NO,{})]})})},Fue=d.memo(zue),Bue=()=>a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(Fue,{}),a.jsx(i2,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Qc,{})]}),Hue=d.memo(Bue),l2=()=>{const{t:e}=Z(),t=W(i=>i.generation.shouldRandomizeSeed),n=W(i=>i.generation.iterations),r=d.useMemo(()=>n===1?e("parameters.iterationsWithCount_one",{count:1}):e("parameters.iterationsWithCount_other",{count:n}),[n,e]),o=d.useMemo(()=>e(t?"parameters.randomSeed":"parameters.manualSeed"),[t,e]);return{iterationsAndSeedLabel:d.useMemo(()=>[r,o].join(", "),[r,o]),iterationsLabel:r,seedLabel:o}},Vue=()=>{const e=W(n=>n.ui.shouldUseSliders),{iterationsAndSeedLabel:t}=l2();return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx(L,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]})})})},zO=d.memo(Vue),Wue=()=>a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(zO,{}),a.jsx(i2,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Qc,{})]}),Uue=d.memo(Wue),Gue=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],Kue=()=>{const e=te(),t=W(o=>o.generation.canvasCoherenceMode),{t:n}=Z(),r=o=>{o&&e(pT(o))};return a.jsx(Et,{feature:"compositingCoherenceMode",children:a.jsx(Pn,{label:n("parameters.coherenceMode"),data:Gue,value:t,onChange:r})})},que=d.memo(Kue),Xue=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceSteps),{t:n}=Z();return a.jsx(Et,{feature:"compositingCoherenceSteps",children:a.jsx(tt,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(_w(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(_w(20))}})})},Que=d.memo(Xue),Yue=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceStrength),{t:n}=Z();return a.jsx(Et,{feature:"compositingStrength",children:a.jsx(tt,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(Iw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Iw(.3))}})})},Zue=d.memo(Yue);function Jue(){const e=te(),t=W(r=>r.generation.maskBlur),{t:n}=Z();return a.jsx(Et,{feature:"compositingBlur",children:a.jsx(tt,{label:n("parameters.maskBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Pw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Pw(16))}})})}const ede=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function tde(){const e=W(o=>o.generation.maskBlurMethod),t=te(),{t:n}=Z(),r=o=>{o&&t(mT(o))};return a.jsx(Et,{feature:"compositingBlurMethod",children:a.jsx(Pn,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:ede})})}const nde=()=>{const{t:e}=Z();return a.jsx(oo,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Rc,{label:e("parameters.coherencePassHeader"),children:[a.jsx(que,{}),a.jsx(Que,{}),a.jsx(Zue,{})]}),a.jsx(Yn,{}),a.jsxs(Rc,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(Jue,{}),a.jsx(tde,{})]})]})})},FO=d.memo(nde),rde=le([xe],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Se),ode=()=>{const e=te(),{infillMethod:t}=W(rde),{data:n,isLoading:r}=lI(),o=n==null?void 0:n.infill_methods,{t:s}=Z(),i=d.useCallback(l=>{e(hT(l))},[e]);return a.jsx(Et,{feature:"infillMethod",children:a.jsx(Pn,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})})},sde=d.memo(ode),ade=le([os],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},Se),ide=()=>{const e=te(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=W(ade),{t:r}=Z(),o=d.useCallback(i=>{e(Ew(i))},[e]),s=d.useCallback(()=>{e(Ew(2))},[e]);return a.jsx(tt,{isDisabled:n!=="patchmatch",label:r("parameters.patchmatchDownScaleSize"),min:1,max:10,value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},lde=d.memo(ide),cde=le([os],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},Se),ude=()=>{const e=te(),{infillTileSize:t,infillMethod:n}=W(cde),{t:r}=Z(),o=d.useCallback(i=>{e(Mw(i))},[e]),s=d.useCallback(()=>{e(Mw(32))},[e]);return a.jsx(tt,{isDisabled:n!=="tile",label:r("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},dde=d.memo(ude),fde=le([os],e=>{const{infillMethod:t}=e;return{infillMethod:t}},Se);function pde(){const{infillMethod:e}=W(fde);return a.jsxs(L,{children:[e==="tile"&&a.jsx(dde,{}),e==="patchmatch"&&a.jsx(lde,{})]})}const Sn=e=>e.canvas,Eo=le([xe],({canvas:e})=>e.batchIds.length>0||e.layerState.stagingArea.images.length>0),mde=le([Sn],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Se),hde=()=>{const e=te(),{boundingBoxScale:t}=W(mde),{t:n}=Z(),r=o=>{e(vT(o))};return a.jsx(Et,{feature:"scaleBeforeProcessing",children:a.jsx(nn,{label:n("parameters.scaleBeforeProcessing"),data:gT,value:t,onChange:r})})},gde=d.memo(hde),vde=le([os,Sn],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o,aspectRatio:s}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual",aspectRatio:s}},Se),xde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(vde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{let m=r.width;const h=Math.floor(p);o&&(m=wr(h*o,64)),e(Jp({width:m,height:h}))},u=()=>{let p=r.width;const m=Math.floor(s);o&&(p=wr(m*o,64)),e(Jp({width:p,height:m}))};return a.jsx(tt,{isDisabled:!n,label:i("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},bde=d.memo(xde),yde=le([Sn,os],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,scaledBoundingBoxDimensions:r,aspectRatio:s,isManual:n==="manual"}},Se),Cde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(yde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{const m=Math.floor(p);let h=r.height;o&&(h=wr(m/o,64)),e(Jp({width:m,height:h}))},u=()=>{const p=Math.floor(s);let m=r.height;o&&(m=wr(p/o,64)),e(Jp({width:p,height:m}))};return a.jsx(tt,{isDisabled:!n,label:i("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},wde=d.memo(Cde),Sde=()=>{const{t:e}=Z();return a.jsx(oo,{label:e("parameters.infillScalingHeader"),children:a.jsxs(L,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Rc,{children:[a.jsx(sde,{}),a.jsx(pde,{})]}),a.jsx(Yn,{}),a.jsxs(Rc,{children:[a.jsx(gde,{}),a.jsx(wde,{}),a.jsx(bde,{})]})]})})},BO=d.memo(Sde),kde=le([xe,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Se),jde=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(kde),{t:s}=Z(),i=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,l=p=>{if(e(Vo({...n,height:Math.floor(p)})),o){const m=wr(p*o,64);e(Vo({width:m,height:Math.floor(p)}))}},u=()=>{if(e(Vo({...n,height:Math.floor(i)})),o){const p=wr(i*o,64);e(Vo({width:p,height:Math.floor(i)}))}};return a.jsx(tt,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},_de=d.memo(jde),Ide=le([xe,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Se),Pde=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(Ide),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{if(e(Vo({...n,width:Math.floor(p)})),o){const m=wr(p/o,64);e(Vo({width:Math.floor(p),height:m}))}},u=()=>{if(e(Vo({...n,width:Math.floor(s)})),o){const p=wr(s/o,64);e(Vo({width:Math.floor(s),height:p}))}};return a.jsx(tt,{label:i("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Ede=d.memo(Pde),Mde=le([os,Sn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function uh(){const e=te(),{t}=Z(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=W(Mde),o=d.useCallback(()=>{n?(e(qu(!1)),AO.includes(r.width/r.height)?e(zo(r.width/r.height)):e(zo(null))):(e(qu(!0)),e(zo(r.width/r.height)))},[n,r,e]),s=d.useCallback(()=>{e(xT()),e(zo(null)),n&&e(zo(r.height/r.width))},[e,n,r]);return a.jsxs(L,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsx(Et,{feature:"paramRatio",children:a.jsxs(Kt,{as:L,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(wn,{children:t("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(TO,{}),a.jsx(Fe,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(L8,{}),fontSize:20,onClick:s}),a.jsx(Fe,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(pM,{}),isChecked:n,onClick:o})]})}),a.jsx(Ede,{}),a.jsx(_de,{})]})}const Ode=le(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Se),Rde=()=>{const{shouldUseSliders:e,activeLabel:t}=W(Ode);return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}),a.jsx(LO,{})]})})},Dde=d.memo(Rde);function Ade(){return a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(Dde,{}),a.jsx(i2,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(BO,{}),a.jsx(FO,{}),a.jsx(Qc,{})]})}function c2(){return a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsx(OO,{}),a.jsx(MO,{})]})}function Tde(){const e=W(o=>o.generation.horizontalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(tt,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(Ow(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Ow(0))})}function Nde(){const e=W(o=>o.generation.verticalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(tt,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(Rw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Rw(0))})}function $de(){const e=W(n=>n.generation.shouldUseSymmetry),t=te();return a.jsx(fn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(bT(n.target.checked))})}const Lde=le(xe,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Se),zde=()=>{const{t:e}=Z(),{activeLabel:t}=W(Lde);return Ht("symmetry").isFeatureEnabled?a.jsx(oo,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs(L,{sx:{gap:2,flexDirection:"column"},children:[a.jsx($de,{}),a.jsx(Tde,{}),a.jsx(Nde,{})]})}):null},u2=d.memo(zde),Fde=le([xe],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:l,coarseStep:u}=n.sd.img2imgStrength,{img2imgStrength:p}=e,m=t.shift?l:u;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:m}},Se),Bde=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=W(Fde),i=te(),{t:l}=Z(),u=d.useCallback(m=>i(Zp(m)),[i]),p=d.useCallback(()=>{i(Zp(t))},[i,t]);return a.jsx(Et,{feature:"paramDenoisingStrength",children:a.jsx(Rc,{children:a.jsx(tt,{label:`${l("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:u,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})})})},HO=d.memo(Bde),Hde=()=>{const e=W(n=>n.ui.shouldUseSliders),{iterationsAndSeedLabel:t}=l2();return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}),a.jsx(HO,{}),a.jsx(NO,{})]})})},Vde=d.memo(Hde),Wde=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(Vde,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(u2,{}),a.jsx(Qc,{})]}),Ude=d.memo(Wde),Gde=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(zO,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(u2,{}),a.jsx(Qc,{})]}),Kde=d.memo(Gde),qde=()=>{const e=W(n=>n.ui.shouldUseSliders),{iterationsAndSeedLabel:t}=l2();return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}),a.jsx(HO,{})]})})},Xde=d.memo(qde),Qde=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(Xde,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(u2,{}),a.jsx(BO,{}),a.jsx(FO,{}),a.jsx(Qc,{})]}),Yde=d.memo(Qde),Zde=()=>{const e=W(Jn),t=W(n=>n.generation.model);return e==="txt2img"?a.jsx(Kp,{children:t&&t.base_model==="sdxl"?a.jsx(Uue,{}):a.jsx(Kde,{})}):e==="img2img"?a.jsx(Kp,{children:t&&t.base_model==="sdxl"?a.jsx(Hue,{}):a.jsx(Ude,{})}):e==="unifiedCanvas"?a.jsx(Kp,{children:t&&t.base_model==="sdxl"?a.jsx(Ade,{}):a.jsx(Yde,{})}):null},Jde=d.memo(Zde),Kp=d.memo(e=>a.jsxs(L,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(X8,{}),a.jsx(L,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx(L,{sx:{w:"full",h:"full",position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:800,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:a.jsx(L,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));Kp.displayName="ParametersPanelWrapper";const efe=le([xe],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},Se),tfe=()=>{const{initialImage:e}=W(efe),{currentData:t}=to((e==null?void 0:e.imageName)??$r.skipToken),n=d.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),r=d.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(ua,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(Zn,{label:"No initial image selected"}),dataTestId:"initial-image"})},nfe=d.memo(tfe),rfe=le([xe],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},Se),ofe={type:"SET_INITIAL_IMAGE"},sfe=()=>{const{isResetButtonDisabled:e}=W(rfe),t=te(),{getUploadButtonProps:n,getUploadInputProps:r}=Uy({postUploadAction:ofe}),o=d.useCallback(()=>{t(yT())},[t]);return a.jsxs(L,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs(L,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(ve,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(ba,{}),a.jsx(Fe,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(cg,{}),...n()}),a.jsx(Fe,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(Ud,{}),onClick:o,isDisabled:e})]}),a.jsx(nfe,{}),a.jsx("input",{...r()})]})},afe=d.memo(sfe),ife=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=Z(),o=W(s=>s.system.isConnected);return a.jsx(Fe,{onClick:t,icon:a.jsx(Br,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},VO=()=>{const[e,{isLoading:t}]=bh({fixedCacheKey:"enqueueBatch"}),[n,{isLoading:r}]=CT({fixedCacheKey:"enqueueGraph"}),[o,{isLoading:s}]=wI({fixedCacheKey:"resumeProcessor"}),[i,{isLoading:l}]=yI({fixedCacheKey:"pauseProcessor"}),[u,{isLoading:p}]=Jx({fixedCacheKey:"cancelQueueItem"}),[m,{isLoading:h}]=bI({fixedCacheKey:"clearQueue"}),[g,{isLoading:x}]=OI({fixedCacheKey:"pruneQueue"});return t||r||s||l||p||h||x},lfe=[{label:"RealESRGAN x2 Plus",value:"RealESRGAN_x2plus.pth",tooltip:"Attempts to retain sharpness, low smoothing",group:"x2 Upscalers"},{label:"RealESRGAN x4 Plus",value:"RealESRGAN_x4plus.pth",tooltip:"Best for photos and highly detailed images, medium smoothing",group:"x4 Upscalers"},{label:"RealESRGAN x4 Plus (anime 6B)",value:"RealESRGAN_x4plus_anime_6B.pth",tooltip:"Best for anime/manga, high smoothing",group:"x4 Upscalers"},{label:"ESRGAN SRx4",value:"ESRGAN_SRx4_DF2KOST_official-ff704c30.pth",tooltip:"Retains sharpness, low smoothing",group:"x4 Upscalers"}];function cfe(){const e=W(r=>r.postprocessing.esrganModelName),t=te(),n=r=>t(wT(r));return a.jsx(Pn,{label:"ESRGAN Model",value:e,itemComponent:ui,onChange:n,data:lfe})}const ufe=e=>{const{imageDTO:t}=e,n=te(),r=VO(),{t:o}=Z(),{isOpen:s,onOpen:i,onClose:l}=Lr(),{isAllowedToUpscale:u,detail:p}=ST(t),m=d.useCallback(()=>{l(),!(!t||!u)&&n(RI({imageDTO:t}))},[n,t,u,l]);return a.jsx(qd,{isOpen:s,onClose:l,triggerComponent:a.jsx(Fe,{tooltip:o("parameters.upscale"),onClick:i,icon:a.jsx(cM,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs(L,{sx:{flexDirection:"column",gap:4},children:[a.jsx(cfe,{}),a.jsx(at,{tooltip:p,size:"sm",isDisabled:!t||r||!u,onClick:m,children:o("parameters.upscaleImage")})]})})},dfe=d.memo(ufe),ffe=le([xe,Jn],({gallery:e,system:t,ui:n,config:r},o)=>{const{isConnected:s,shouldConfirmOnDelete:i,denoiseProgress:l}=t,{shouldShowImageDetails:u,shouldHidePreview:p,shouldShowProgressInViewer:m}=n,{shouldFetchMetadataFromApi:h}=r,g=e.selection[e.selection.length-1];return{shouldConfirmOnDelete:i,isConnected:s,shouldDisableToolbarButtons:!!(l!=null&&l.progress_image)||!g,shouldShowImageDetails:u,activeTabName:o,shouldHidePreview:p,shouldShowProgressInViewer:m,lastSelectedImage:g,shouldFetchMetadataFromApi:h}},{memoizeOptions:{resultEqualityCheck:Bt}}),pfe=e=>{const t=te(),{isConnected:n,shouldDisableToolbarButtons:r,shouldShowImageDetails:o,lastSelectedImage:s,shouldShowProgressInViewer:i,shouldFetchMetadataFromApi:l}=W(ffe),u=Ht("upscaling").isFeatureEnabled,p=VO(),m=sl(),{t:h}=Z(),{recallBothPrompts:g,recallSeed:x,recallAllParameters:y}=Sg(),{currentData:b}=to((s==null?void 0:s.image_name)??$r.skipToken),w=d.useMemo(()=>s?{image:s,shouldFetchMetadataFromApi:l}:$r.skipToken,[s,l]),{metadata:S,workflow:j,isLoading:_}=qx(w,{selectFromResult:B=>{var V,U;return{isLoading:B.isFetching,metadata:(V=B==null?void 0:B.currentData)==null?void 0:V.metadata,workflow:(U=B==null?void 0:B.currentData)==null?void 0:U.workflow}}}),E=d.useCallback(()=>{j&&t(Yx(j))},[t,j]),I=d.useCallback(()=>{y(S)},[S,y]);et("a",()=>{},[S,y]);const M=d.useCallback(()=>{x(S==null?void 0:S.seed)},[S==null?void 0:S.seed,x]);et("s",M,[b]);const R=d.useCallback(()=>{g(S==null?void 0:S.positive_prompt,S==null?void 0:S.negative_prompt,S==null?void 0:S.positive_style_prompt,S==null?void 0:S.negative_style_prompt)},[S==null?void 0:S.negative_prompt,S==null?void 0:S.positive_prompt,S==null?void 0:S.positive_style_prompt,S==null?void 0:S.negative_style_prompt,g]);et("p",R,[b]),et("w",E,[j]);const D=d.useCallback(()=>{t(z8()),t(vh(b))},[t,b]);et("shift+i",D,[b]);const A=d.useCallback(()=>{b&&t(RI({imageDTO:b}))},[t,b]),O=d.useCallback(()=>{b&&t(xh([b]))},[t,b]);et("Shift+U",()=>{A()},{enabled:()=>!!(u&&!r&&n)},[u,b,r,n]);const T=d.useCallback(()=>t(kT(!o)),[t,o]);et("i",()=>{b?T():m({title:h("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[b,o,m]),et("delete",()=>{O()},[t,b]);const X=d.useCallback(()=>{t(cI(!i))},[t,i]);return a.jsx(a.Fragment,{children:a.jsxs(L,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(Vt,{isAttached:!0,isDisabled:r,children:a.jsxs(Ah,{children:[a.jsx(Th,{as:Fe,"aria-label":h("parameters.imageActions"),tooltip:h("parameters.imageActions"),isDisabled:!b,icon:a.jsx(boe,{})}),a.jsx(Gi,{motionProps:vc,children:b&&a.jsx(F8,{imageDTO:b})})]})}),a.jsxs(Vt,{isAttached:!0,isDisabled:r,children:[a.jsx(Fe,{isLoading:_,icon:a.jsx(Gy,{}),tooltip:`${h("nodes.loadWorkflow")} (W)`,"aria-label":`${h("nodes.loadWorkflow")} (W)`,isDisabled:!j,onClick:E}),a.jsx(Fe,{isLoading:_,icon:a.jsx(hM,{}),tooltip:`${h("parameters.usePrompt")} (P)`,"aria-label":`${h("parameters.usePrompt")} (P)`,isDisabled:!(S!=null&&S.positive_prompt),onClick:R}),a.jsx(Fe,{isLoading:_,icon:a.jsx(gM,{}),tooltip:`${h("parameters.useSeed")} (S)`,"aria-label":`${h("parameters.useSeed")} (S)`,isDisabled:(S==null?void 0:S.seed)===null||(S==null?void 0:S.seed)===void 0,onClick:M}),a.jsx(Fe,{isLoading:_,icon:a.jsx(sM,{}),tooltip:`${h("parameters.useAll")} (A)`,"aria-label":`${h("parameters.useAll")} (A)`,isDisabled:!S,onClick:I})]}),u&&a.jsx(Vt,{isAttached:!0,isDisabled:p,children:u&&a.jsx(dfe,{imageDTO:b})}),a.jsx(Vt,{isAttached:!0,children:a.jsx(Fe,{icon:a.jsx(iM,{}),tooltip:`${h("parameters.info")} (I)`,"aria-label":`${h("parameters.info")} (I)`,isChecked:o,onClick:T})}),a.jsx(Vt,{isAttached:!0,children:a.jsx(Fe,{"aria-label":h("settings.displayInProgress"),tooltip:h("settings.displayInProgress"),icon:a.jsx(WJ,{}),isChecked:i,onClick:X})}),a.jsx(Vt,{isAttached:!0,children:a.jsx(ife,{onClick:O})})]})})},mfe=d.memo(pfe),hfe=le([xe,Zx],(e,t)=>{var j,_;const{data:n,status:r}=jT.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?Dw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):Dw.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(e),s=e.gallery.selection[e.gallery.selection.length-1],i=r==="pending";if(!n||!s||(o==null?void 0:o.total)===0)return{isFetching:i,queryArgs:t,isOnFirstImage:!0,isOnLastImage:!0};const l={...t,offset:n.ids.length,limit:xI},u=_T.getSelectors(),p=u.selectAll(n),m=p.findIndex(E=>E.image_name===s.image_name),h=Bi(m+1,0,p.length-1),g=Bi(m-1,0,p.length-1),x=(j=p[h])==null?void 0:j.image_name,y=(_=p[g])==null?void 0:_.image_name,b=x?u.selectById(n,x):void 0,w=y?u.selectById(n,y):void 0,S=p.length;return{loadedImagesCount:p.length,currentImageIndex:m,areMoreImagesAvailable:((o==null?void 0:o.total)??0)>S,isFetching:r==="pending",nextImage:b,prevImage:w,queryArgs:l}},{memoizeOptions:{resultEqualityCheck:Bt}}),WO=()=>{const e=te(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:i,currentImageIndex:l}=W(hfe),u=d.useCallback(()=>{n&&e(Aw(n))},[e,n]),p=d.useCallback(()=>{t&&e(Aw(t))},[e,t]),[m]=vI(),h=d.useCallback(()=>{m(s)},[m,s]);return{handlePrevImage:u,handleNextImage:p,isOnFirstImage:l===0,isOnLastImage:l!==void 0&&l===i-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:h,isFetching:o}};function gfe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const vfe=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=Z();return t?a.jsxs(L,{gap:2,children:[n&&a.jsx(Ft,{label:`Recall ${e}`,children:a.jsx(ys,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(gfe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Ft,{label:`Copy ${e}`,children:a.jsx(ys,{"aria-label":`Copy ${e}`,icon:a.jsx(Hc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs(L,{direction:o?"column":"row",children:[a.jsxs(ve,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Oh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(ZM,{mx:"2px"})]}):a.jsx(ve,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},xr=d.memo(vfe),xfe=e=>{const{metadata:t}=e,{t:n}=Z(),{recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallCfgScale:i,recallModel:l,recallScheduler:u,recallSteps:p,recallWidth:m,recallHeight:h,recallStrength:g,recallLoRA:x,recallControlNet:y,recallIPAdapter:b}=Sg(),w=d.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),S=d.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),j=d.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),_=d.useCallback(()=>{l(t==null?void 0:t.model)},[t==null?void 0:t.model,l]),E=d.useCallback(()=>{m(t==null?void 0:t.width)},[t==null?void 0:t.width,m]),I=d.useCallback(()=>{h(t==null?void 0:t.height)},[t==null?void 0:t.height,h]),M=d.useCallback(()=>{u(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,u]),R=d.useCallback(()=>{p(t==null?void 0:t.steps)},[t==null?void 0:t.steps,p]),D=d.useCallback(()=>{i(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,i]),A=d.useCallback(()=>{g(t==null?void 0:t.strength)},[t==null?void 0:t.strength,g]),O=d.useCallback(U=>{x(U)},[x]),T=d.useCallback(U=>{y(U)},[y]),X=d.useCallback(U=>{b(U)},[b]),B=d.useMemo(()=>t!=null&&t.controlnets?t.controlnets.filter(U=>c1(U.control_model)):[],[t==null?void 0:t.controlnets]),V=d.useMemo(()=>t!=null&&t.ipAdapters?t.ipAdapters.filter(U=>c1(U.ip_adapter_model)):[],[t==null?void 0:t.ipAdapters]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx(xr,{label:n("metadata.createdBy"),value:t.created_by}),t.generation_mode&&a.jsx(xr,{label:n("metadata.generationMode"),value:t.generation_mode}),t.positive_prompt&&a.jsx(xr,{label:n("metadata.positivePrompt"),labelPosition:"top",value:t.positive_prompt,onClick:w}),t.negative_prompt&&a.jsx(xr,{label:n("metadata.negativePrompt"),labelPosition:"top",value:t.negative_prompt,onClick:S}),t.seed!==void 0&&t.seed!==null&&a.jsx(xr,{label:n("metadata.seed"),value:t.seed,onClick:j}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx(xr,{label:n("metadata.model"),value:t.model.model_name,onClick:_}),t.width&&a.jsx(xr,{label:n("metadata.width"),value:t.width,onClick:E}),t.height&&a.jsx(xr,{label:n("metadata.height"),value:t.height,onClick:I}),t.scheduler&&a.jsx(xr,{label:n("metadata.scheduler"),value:t.scheduler,onClick:M}),t.steps&&a.jsx(xr,{label:n("metadata.steps"),value:t.steps,onClick:R}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(xr,{label:n("metadata.cfgScale"),value:t.cfg_scale,onClick:D}),t.strength&&a.jsx(xr,{label:n("metadata.strength"),value:t.strength,onClick:A}),t.loras&&t.loras.map((U,N)=>{if(dI(U.lora))return a.jsx(xr,{label:"LoRA",value:`${U.lora.model_name} - ${U.weight}`,onClick:()=>O(U)},N)}),B.map((U,N)=>{var $;return a.jsx(xr,{label:"ControlNet",value:`${($=U.control_model)==null?void 0:$.model_name} - ${U.control_weight}`,onClick:()=>T(U)},N)}),V.map((U,N)=>{var $;return a.jsx(xr,{label:"IP Adapter",value:`${($=U.ip_adapter_model)==null?void 0:$.model_name} - ${U.weight}`,onClick:()=>X(U)},N)})]})},bfe=d.memo(xfe),yfe=({image:e})=>{const{t}=Z(),{shouldFetchMetadataFromApi:n}=W(Xy),{metadata:r,workflow:o}=qx({image:e,shouldFetchMetadataFromApi:n},{selectFromResult:s=>{var i,l;return{metadata:(i=s==null?void 0:s.currentData)==null?void 0:i.metadata,workflow:(l=s==null?void 0:s.currentData)==null?void 0:l.workflow}}});return a.jsxs(L,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs(L,{gap:2,children:[a.jsx(ve,{fontWeight:"semibold",children:"File:"}),a.jsxs(Oh,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(ZM,{mx:"2px"})]})]}),a.jsx(bfe,{metadata:r}),a.jsxs(rl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ol,{children:[a.jsx(Tr,{children:t("metadata.metadata")}),a.jsx(Tr,{children:t("metadata.imageDetails")}),a.jsx(Tr,{children:t("metadata.workflow")})]}),a.jsxs(zc,{children:[a.jsx(So,{children:r?a.jsx(Ya,{data:r,label:t("metadata.metadata")}):a.jsx(Zn,{label:t("metadata.noMetaData")})}),a.jsx(So,{children:e?a.jsx(Ya,{data:e,label:t("metadata.imageDetails")}):a.jsx(Zn,{label:t("metadata.noImageDetails")})}),a.jsx(So,{children:o?a.jsx(Ya,{data:o,label:t("metadata.workflow")}):a.jsx(Zn,{label:t("nodes.noWorkflow")})})]})]})]})},Cfe=d.memo(yfe),Yv={color:"base.100",pointerEvents:"auto"},wfe=()=>{const{t:e}=Z(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:l}=WO();return a.jsxs(Ie,{sx:{position:"relative",height:"100%",width:"100%"},children:[a.jsx(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineStart:0},children:!r&&a.jsx(ys,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(jJ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:Yv})}),a.jsxs(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(ys,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(_J,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:Yv}),o&&i&&!l&&a.jsx(ys,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(kJ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:Yv}),o&&i&&l&&a.jsx(L,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(fa,{opacity:.5,size:"xl"})})]})]})},UO=d.memo(wfe),Sfe=le([xe,IT],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{denoiseProgress:i,shouldAntialiasProgressImage:l}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,denoiseProgress:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:l}},{memoizeOptions:{resultEqualityCheck:Bt}}),kfe=()=>{const{shouldShowImageDetails:e,imageName:t,denoiseProgress:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=W(Sfe),{handlePrevImage:s,handleNextImage:i,isOnLastImage:l,handleLoadMoreImages:u,areMoreImagesAvailable:p,isFetching:m}=WO();et("left",()=>{s()},[s]),et("right",()=>{if(l&&p&&!m){u();return}l||i()},[l,p,u,m,i]);const{currentData:h}=to(t??$r.skipToken),g=d.useMemo(()=>{if(h)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:h}}},[h]),x=d.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,b]=d.useState(!1),w=d.useRef(0),{t:S}=Z(),j=d.useCallback(()=>{b(!0),window.clearTimeout(w.current)},[]),_=d.useCallback(()=>{w.current=window.setTimeout(()=>{b(!1)},500)},[]);return a.jsxs(L,{onMouseOver:j,onMouseOut:_,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n!=null&&n.progress_image&&r?a.jsx(ga,{src:n.progress_image.dataURL,width:n.progress_image.width,height:n.progress_image.height,draggable:!1,"data-testid":"progress-image",sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(ua,{imageDTO:h,droppableData:x,draggableData:g,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:S("gallery.setCurrentImage"),noContentFallback:a.jsx(Zn,{icon:Yi,label:"No image selected"}),dataTestId:"image-preview"}),e&&h&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(Cfe,{image:h})}),a.jsx(dr,{children:!e&&h&&y&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:"0",width:"100%",height:"100%",pointerEvents:"none"},children:a.jsx(UO,{})},"nextPrevButtons")})]})},jfe=d.memo(kfe),_fe=()=>a.jsxs(L,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(mfe,{}),a.jsx(jfe,{})]}),Ife=d.memo(_fe),Pfe=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx(L,{sx:{width:"100%",height:"100%"},children:a.jsx(Ife,{})})}),GO=d.memo(Pfe),Efe=()=>{const e=d.useRef(null),t=d.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=t2();return a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsxs(Ig,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Qa,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(afe,{})}),a.jsx(lh,{onDoubleClick:t}),a.jsx(Qa,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(GO,{})})]})})},Mfe=d.memo(Efe);var Ofe=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n};const p_=xd(Ofe);function Ex(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var Rfe=Object.defineProperty,m_=Object.getOwnPropertySymbols,Dfe=Object.prototype.hasOwnProperty,Afe=Object.prototype.propertyIsEnumerable,h_=(e,t,n)=>t in e?Rfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tfe=(e,t)=>{for(var n in t||(t={}))Dfe.call(t,n)&&h_(e,n,t[n]);if(m_)for(var n of m_(t))Afe.call(t,n)&&h_(e,n,t[n]);return e};function KO(e,t){if(t===null||typeof t!="object")return{};const n=Tfe({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const Nfe="__MANTINE_FORM_INDEX__";function g_(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${Nfe}`)):!1:!1}function v_(e,t,n){typeof n.value=="object"&&(n.value=tc(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function tc(e){if(typeof e!="object")return e;var t=0,n,r,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(i){o.add(tc(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,l){o.set(tc(l),tc(i))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(tc(e.buffer)):s==="[object ArrayBuffer]"?o=e.slice(0):s.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)v_(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||v_(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function qO(e){return typeof e!="string"?[]:e.split(".")}function Ag(e,t,n){const r=qO(e);if(r.length===0)return n;const o=tc(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let i=1;i<r.length-1;i+=1){if(s===void 0)return o;s=s[r[i]]}return s[r[r.length-1]]=t,o}function Qs(e,t){const n=qO(e);if(n.length===0||typeof t!="object"||t===null)return;let r=t[n[0]];for(let o=1;o<n.length&&r!==void 0;o+=1)r=r[n[o]];return r}function x_(e){const t=Ex(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Mx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],l=`${n===""?"":`${n}.`}${s}`,u=Qs(l,t);let p=!1;return typeof i=="function"&&(o[l]=i(u,t,l)),typeof i=="object"&&Array.isArray(u)&&(p=!0,u.forEach((m,h)=>Mx(i,t,`${l}.${h}`,o))),typeof i=="object"&&typeof u=="object"&&u!==null&&(p||Mx(i,t,l,o)),o},r)}function Ox(e,t){return x_(typeof e=="function"?e(t):Mx(e,t))}function Dp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Ox(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,l)=>i===s.split(".")[l]));return{hasError:!!o,error:o?r.errors[o]:null}}function $fe(e,{from:t,to:n},r){const o=Qs(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),Ag(e,s,r)}var Lfe=Object.defineProperty,b_=Object.getOwnPropertySymbols,zfe=Object.prototype.hasOwnProperty,Ffe=Object.prototype.propertyIsEnumerable,y_=(e,t,n)=>t in e?Lfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bfe=(e,t)=>{for(var n in t||(t={}))zfe.call(t,n)&&y_(e,n,t[n]);if(b_)for(var n of b_(t))Ffe.call(t,n)&&y_(e,n,t[n]);return e};function Hfe(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=Bfe({},r);return Object.keys(r).every(l=>{let u,p;if(l.startsWith(o)&&(u=l,p=l.replace(o,s)),l.startsWith(s)&&(u=l.replace(s,o),p=l),u&&p){const m=i[u],h=i[p];return h===void 0?delete i[u]:i[u]=h,m===void 0?delete i[p]:i[p]=m,!1}return!0}),i}function Vfe(e,t,n){const r=Qs(e,n);return Array.isArray(r)?Ag(e,r.filter((o,s)=>s!==t),n):n}var Wfe=Object.defineProperty,C_=Object.getOwnPropertySymbols,Ufe=Object.prototype.hasOwnProperty,Gfe=Object.prototype.propertyIsEnumerable,w_=(e,t,n)=>t in e?Wfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kfe=(e,t)=>{for(var n in t||(t={}))Ufe.call(t,n)&&w_(e,n,t[n]);if(C_)for(var n of C_(t))Gfe.call(t,n)&&w_(e,n,t[n]);return e};function S_(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function k_(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=KO(`${o}.${t}`,s));const i=Kfe({},s),l=new Set;return Object.entries(s).filter(([u])=>{if(!u.startsWith(`${o}.`))return!1;const p=S_(u,o);return Number.isNaN(p)?!1:p>=t}).forEach(([u,p])=>{const m=S_(u,o),h=u.replace(`${o}.${m}`,`${o}.${m+r}`);i[h]=p,l.add(h),l.has(u)||delete i[u]}),i}function qfe(e,t,n,r){const o=Qs(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),Ag(e,s,r)}function j_(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(o=>o.startsWith(`${t}.`));return e[t]||r.some(o=>e[o])||!1}return n.some(r=>e[r])}function Xfe(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var Qfe=Object.defineProperty,Yfe=Object.defineProperties,Zfe=Object.getOwnPropertyDescriptors,__=Object.getOwnPropertySymbols,Jfe=Object.prototype.hasOwnProperty,epe=Object.prototype.propertyIsEnumerable,I_=(e,t,n)=>t in e?Qfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,La=(e,t)=>{for(var n in t||(t={}))Jfe.call(t,n)&&I_(e,n,t[n]);if(__)for(var n of __(t))epe.call(t,n)&&I_(e,n,t[n]);return e},Zv=(e,t)=>Yfe(e,Zfe(t));function fl({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:l=p=>p,validate:u}={}){const[p,m]=d.useState(r),[h,g]=d.useState(n),[x,y]=d.useState(e),[b,w]=d.useState(Ex(t)),S=d.useRef(e),j=G=>{S.current=G},_=d.useCallback(()=>m({}),[]),E=G=>{const K=G?La(La({},x),G):x;j(K),g({})},I=d.useCallback(G=>w(K=>Ex(typeof G=="function"?G(K):G)),[]),M=d.useCallback(()=>w({}),[]),R=d.useCallback(()=>{y(e),M(),j(e),g({}),_()},[]),D=d.useCallback((G,K)=>I(ee=>Zv(La({},ee),{[G]:K})),[]),A=d.useCallback(G=>I(K=>{if(typeof G!="string")return K;const ee=La({},K);return delete ee[G],ee}),[]),O=d.useCallback(G=>g(K=>{if(typeof G!="string")return K;const ee=KO(G,K);return delete ee[G],ee}),[]),T=d.useCallback((G,K)=>{const ee=g_(G,s);O(G),m(ce=>Zv(La({},ce),{[G]:!0})),y(ce=>{const J=Ag(G,K,ce);if(ee){const ie=Dp(G,u,J);ie.hasError?D(G,ie.error):A(G)}return J}),!ee&&o&&D(G,null)},[]),X=d.useCallback(G=>{y(K=>{const ee=typeof G=="function"?G(K):G;return La(La({},K),ee)}),o&&M()},[]),B=d.useCallback((G,K)=>{O(G),y(ee=>$fe(G,K,ee)),w(ee=>Hfe(G,K,ee))},[]),V=d.useCallback((G,K)=>{O(G),y(ee=>Vfe(G,K,ee)),w(ee=>k_(G,K,ee,-1))},[]),U=d.useCallback((G,K,ee)=>{O(G),y(ce=>qfe(G,K,ee,ce)),w(ce=>k_(G,ee,ce,1))},[]),N=d.useCallback(()=>{const G=Ox(u,x);return w(G.errors),G},[x,u]),$=d.useCallback(G=>{const K=Dp(G,u,x);return K.hasError?D(G,K.error):A(G),K},[x,u]),q=(G,{type:K="input",withError:ee=!0,withFocus:ce=!0}={})=>{const ie={onChange:Xfe(de=>T(G,de))};return ee&&(ie.error=b[G]),K==="checkbox"?ie.checked=Qs(G,x):ie.value=Qs(G,x),ce&&(ie.onFocus=()=>m(de=>Zv(La({},de),{[G]:!0})),ie.onBlur=()=>{if(g_(G,i)){const de=Dp(G,u,x);de.hasError?D(G,de.error):A(G)}}),ie},F=(G,K)=>ee=>{ee==null||ee.preventDefault();const ce=N();ce.hasErrors?K==null||K(ce.errors,x,ee):G==null||G(l(x),ee)},Q=G=>l(G||x),Y=d.useCallback(G=>{G.preventDefault(),R()},[]),se=G=>{if(G){const ee=Qs(G,h);if(typeof ee=="boolean")return ee;const ce=Qs(G,x),J=Qs(G,S.current);return!p_(ce,J)}return Object.keys(h).length>0?j_(h):!p_(x,S.current)},ae=d.useCallback(G=>j_(p,G),[p]),re=d.useCallback(G=>G?!Dp(G,u,x).hasError:!Ox(u,x).hasErrors,[x,u]);return{values:x,errors:b,setValues:X,setErrors:I,setFieldValue:T,setFieldError:D,clearFieldError:A,clearErrors:M,reset:R,validate:N,validateField:$,reorderListItem:B,removeListItem:V,insertListItem:U,getInputProps:q,onSubmit:F,onReset:Y,isDirty:se,isTouched:ae,setTouched:m,setDirty:g,resetTouched:_,resetDirty:E,isValid:re,getTransformedValues:Q}}function _n(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:l,base900:u,accent500:p,accent300:m}=Wd(),{colorMode:h}=ha();return a.jsx(XE,{styles:()=>({input:{color:Ae(u,r)(h),backgroundColor:Ae(n,u)(h),borderColor:Ae(o,i)(h),borderWidth:2,outline:"none",":focus":{borderColor:Ae(m,p)(h)}},label:{color:Ae(l,s)(h),fontWeight:"normal",marginBottom:4}}),...t})}const tpe=[{value:"sd-1",label:an["sd-1"]},{value:"sd-2",label:an["sd-2"]},{value:"sdxl",label:an.sdxl},{value:"sdxl-refiner",label:an["sdxl-refiner"]}];function Jd(e){const{...t}=e,{t:n}=Z();return a.jsx(Pn,{label:n("modelManager.baseModel"),data:tpe,...t})}function XO(e){const{data:t}=DI(),{...n}=e;return a.jsx(Pn,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const npe=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Tg(e){const{...t}=e,{t:n}=Z();return a.jsx(Pn,{label:n("modelManager.variant"),data:npe,...t})}function dh(e,t=!0){let n;t?n=new RegExp("[^\\\\/]+(?=\\.)"):n=new RegExp("[^\\\\/]+(?=[\\\\/]?$)");const r=e.match(n);return r?r[0]:""}function QO(e){const{t}=Z(),n=te(),{model_path:r}=e,o=fl({initialValues:{model_name:r?dh(r):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"checkpoint",error:void 0,vae:"",variant:"normal",config:"configs\\stable-diffusion\\v1-inference.yaml"}}),[s]=AI(),[i,l]=d.useState(!1),u=p=>{s({body:p}).unwrap().then(m=>{n(ct(Qt({title:t("modelManager.modelAdded",{modelName:p.model_name}),status:"success"}))),o.reset(),r&&n(Sd(null))}).catch(m=>{m&&n(ct(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(p=>u(p)),style:{width:"100%"},children:a.jsxs(L,{flexDirection:"column",gap:2,children:[a.jsx(_n,{label:t("modelManager.model"),required:!0,...o.getInputProps("model_name")}),a.jsx(Jd,{label:t("modelManager.baseModel"),...o.getInputProps("base_model")}),a.jsx(_n,{label:t("modelManager.modelLocation"),required:!0,...o.getInputProps("path"),onBlur:p=>{if(o.values.model_name===""){const m=dh(p.currentTarget.value);m&&o.setFieldValue("model_name",m)}}}),a.jsx(_n,{label:t("modelManager.description"),...o.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...o.getInputProps("vae")}),a.jsx(Tg,{label:t("modelManager.variant"),...o.getInputProps("variant")}),a.jsxs(L,{flexDirection:"column",width:"100%",gap:2,children:[i?a.jsx(_n,{required:!0,label:t("modelManager.customConfigFileLocation"),...o.getInputProps("config")}):a.jsx(XO,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(br,{isChecked:i,onChange:()=>l(!i),label:t("modelManager.useCustomConfig")}),a.jsx(at,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function YO(e){const{t}=Z(),n=te(),{model_path:r}=e,[o]=AI(),s=fl({initialValues:{model_name:r?dh(r,!1):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"diffusers",error:void 0,vae:"",variant:"normal"}}),i=l=>{o({body:l}).unwrap().then(u=>{n(ct(Qt({title:t("modelManager.modelAdded",{modelName:l.model_name}),status:"success"}))),s.reset(),r&&n(Sd(null))}).catch(u=>{u&&n(ct(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs(L,{flexDirection:"column",gap:2,children:[a.jsx(_n,{required:!0,label:t("modelManager.model"),...s.getInputProps("model_name")}),a.jsx(Jd,{label:t("modelManager.baseModel"),...s.getInputProps("base_model")}),a.jsx(_n,{required:!0,label:t("modelManager.modelLocation"),placeholder:t("modelManager.modelLocationValidationMsg"),...s.getInputProps("path"),onBlur:l=>{if(s.values.model_name===""){const u=dh(l.currentTarget.value,!1);u&&s.setFieldValue("model_name",u)}}}),a.jsx(_n,{label:t("modelManager.description"),...s.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(Tg,{label:t("modelManager.variant"),...s.getInputProps("variant")}),a.jsx(at,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const ZO=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function rpe(){const[e,t]=d.useState("diffusers"),{t:n}=Z();return a.jsxs(L,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx(Pn,{label:n("modelManager.modelType"),value:e,data:ZO,onChange:r=>{r&&t(r)}}),a.jsxs(L,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(YO,{}),e==="checkpoint"&&a.jsx(QO,{})]})]})}const ope=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function spe(){const e=te(),{t}=Z(),[n,{isLoading:r}]=TI(),o=fl({initialValues:{location:"",prediction_type:void 0}}),s=i=>{const l={location:i.location,prediction_type:i.prediction_type==="none"?void 0:i.prediction_type};n({body:l}).unwrap().then(u=>{e(ct(Qt({title:t("toast.modelAddedSimple"),status:"success"}))),o.reset()}).catch(u=>{u&&e(ct(Qt({title:`${u.data.detail} `,status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(i=>s(i)),style:{width:"100%"},children:a.jsxs(L,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(_n,{label:t("modelManager.modelLocation"),placeholder:t("modelManager.simpleModelDesc"),w:"100%",...o.getInputProps("location")}),a.jsx(Pn,{label:t("modelManager.predictionType"),data:ope,defaultValue:"none",...o.getInputProps("prediction_type")}),a.jsx(at,{type:"submit",isLoading:r,children:t("modelManager.addModel")})]})})}function ape(){const[e,t]=d.useState("simple");return a.jsxs(L,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(Vt,{isAttached:!0,children:[a.jsx(at,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(at,{size:"sm",isChecked:e=="advanced",onClick:()=>t("advanced"),children:"Advanced"})]}),a.jsxs(L,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(spe,{}),e==="advanced"&&a.jsx(rpe,{})]})]})}function ipe(e){const{...t}=e;return a.jsx(H6,{w:"100%",...t,children:e.children})}function lpe(){const e=W(b=>b.modelmanager.searchFolder),[t,n]=d.useState(""),{data:r}=Xo(Ei),{foundModels:o,alreadyInstalled:s,filteredModels:i}=NI({search_path:e||""},{selectFromResult:({data:b})=>{const w=q9(r==null?void 0:r.entities),S=nr(w,"path"),j=U9(b,S),_=J9(b,S);return{foundModels:b,alreadyInstalled:P_(_,t),filteredModels:P_(j,t)}}}),[l,{isLoading:u}]=TI(),p=te(),{t:m}=Z(),h=d.useCallback(b=>{const w=b.currentTarget.id.split("\\").splice(-1)[0];l({body:{location:b.currentTarget.id}}).unwrap().then(S=>{p(ct(Qt({title:`Added Model: ${w}`,status:"success"})))}).catch(S=>{S&&p(ct(Qt({title:m("toast.modelAddFailed"),status:"error"})))})},[p,l,m]),g=d.useCallback(b=>{n(b.target.value)},[]),x=({models:b,showActions:w=!0})=>b.map(S=>a.jsxs(L,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(L,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(ve,{sx:{fontWeight:600},children:S.split("\\").slice(-1)[0]}),a.jsx(ve,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:S})]}),w?a.jsxs(L,{gap:2,children:[a.jsx(at,{id:S,onClick:h,isLoading:u,children:m("modelManager.quickAdd")}),a.jsx(at,{onClick:()=>p(Sd(S)),isLoading:u,children:m("modelManager.advanced")})]}):a.jsx(ve,{sx:{fontWeight:600,p:2,borderRadius:4,color:"accent.50",bg:"accent.400",_dark:{color:"accent.100",bg:"accent.600"}},children:"Installed"})]},S));return(()=>e?!o||o.length===0?a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(ve,{variant:"subtext",children:m("modelManager.noModels")})}):a.jsxs(L,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(vo,{onChange:g,label:m("modelManager.search"),labelPos:"side"}),a.jsxs(L,{p:2,gap:2,children:[a.jsxs(ve,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(ve,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",i.length]})]}),a.jsx(ipe,{offsetScrollbars:!0,children:a.jsxs(L,{gap:2,flexDirection:"column",children:[x({models:i}),x({models:s,showActions:!1})]})})]}):null)()}const P_=(e,t)=>{const n=[];return Rn(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function cpe(){const e=W(l=>l.modelmanager.advancedAddScanModel),{t}=Z(),[n,r]=d.useState("diffusers"),[o,s]=d.useState(!0);d.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(l=>e.endsWith(l))?r("checkpoint"):r("diffusers")},[e,r,o]);const i=te();return e?a.jsxs(Ie,{as:In.div,initial:{x:-100,opacity:0},animate:{x:0,opacity:1,transition:{duration:.2}},sx:{display:"flex",flexDirection:"column",minWidth:"40%",maxHeight:window.innerHeight-300,overflow:"scroll",p:4,gap:4,borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(L,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(ve,{size:"xl",fontWeight:600,children:o||n==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Fe,{icon:a.jsx(Ic,{}),"aria-label":t("modelManager.closeAdvanced"),onClick:()=>i(Sd(null)),size:"sm"})]}),a.jsx(Pn,{label:t("modelManager.modelType"),value:n,data:ZO,onChange:l=>{l&&(r(l),s(l==="checkpoint"))}}),o?a.jsx(QO,{model_path:e},e):a.jsx(YO,{model_path:e},e)]}):null}function upe(){const e=te(),{t}=Z(),n=W(l=>l.modelmanager.searchFolder),{refetch:r}=NI({search_path:n||""}),o=fl({initialValues:{folder:""}}),s=d.useCallback(l=>{e(Tw(l.folder))},[e]),i=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(l=>s(l)),style:{width:"100%"},children:a.jsxs(L,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs(L,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(ve,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx(L,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(vo,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs(L,{gap:2,children:[n?a.jsx(Fe,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(xM,{}),onClick:i,fontSize:18,size:"sm"}):a.jsx(Fe,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(nee,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Fe,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Br,{}),size:"sm",onClick:()=>{e(Tw(null)),e(Sd(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const dpe=d.memo(upe);function fpe(){return a.jsxs(L,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(dpe,{}),a.jsxs(L,{gap:4,children:[a.jsx(L,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(lpe,{})}),a.jsx(cpe,{})]})]})}function ppe(){const[e,t]=d.useState("add"),{t:n}=Z();return a.jsxs(L,{flexDirection:"column",gap:4,children:[a.jsxs(Vt,{isAttached:!0,children:[a.jsx(at,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(at,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx(ape,{}),e=="scan"&&a.jsx(fpe,{})]})}const mpe=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function hpe(){var $,q;const{t:e}=Z(),t=te(),{data:n}=Xo(Ei),[r,{isLoading:o}]=PT(),[s,i]=d.useState("sd-1"),l=qw(n==null?void 0:n.entities,(F,Q)=>(F==null?void 0:F.model_format)==="diffusers"&&(F==null?void 0:F.base_model)==="sd-1"),u=qw(n==null?void 0:n.entities,(F,Q)=>(F==null?void 0:F.model_format)==="diffusers"&&(F==null?void 0:F.base_model)==="sd-2"),p=d.useMemo(()=>({"sd-1":l,"sd-2":u}),[l,u]),[m,h]=d.useState((($=Object.keys(p[s]))==null?void 0:$[0])??null),[g,x]=d.useState(((q=Object.keys(p[s]))==null?void 0:q[1])??null),[y,b]=d.useState(null),[w,S]=d.useState(""),[j,_]=d.useState(.5),[E,I]=d.useState("weighted_sum"),[M,R]=d.useState("root"),[D,A]=d.useState(""),[O,T]=d.useState(!1),X=Object.keys(p[s]).filter(F=>F!==g&&F!==y),B=Object.keys(p[s]).filter(F=>F!==m&&F!==y),V=Object.keys(p[s]).filter(F=>F!==m&&F!==g),U=F=>{i(F),h(null),x(null)},N=()=>{const F=[];let Q=[m,g,y];Q=Q.filter(se=>se!==null),Q.forEach(se=>{var re;const ae=(re=se==null?void 0:se.split("/"))==null?void 0:re[2];ae&&F.push(ae)});const Y={model_names:F,merged_model_name:w!==""?w:F.join("-"),alpha:j,interp:E,force:O,merge_dest_directory:M==="root"?void 0:D};r({base_model:s,body:Y}).unwrap().then(se=>{t(ct(Qt({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(se=>{se&&t(ct(Qt({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs(L,{flexDirection:"column",rowGap:4,children:[a.jsxs(L,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(ve,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(ve,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs(L,{columnGap:4,children:[a.jsx(Pn,{label:"Model Type",w:"100%",data:mpe,value:s,onChange:U}),a.jsx(nn,{label:e("modelManager.modelOne"),w:"100%",value:m,placeholder:e("modelManager.selectModel"),data:X,onChange:F=>h(F)}),a.jsx(nn,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:g,data:B,onChange:F=>x(F)}),a.jsx(nn,{label:e("modelManager.modelThree"),data:V,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:F=>{F?(b(F),I("weighted_sum")):(b(null),I("add_difference"))}})]}),a.jsx(vo,{label:e("modelManager.mergedModelName"),value:w,onChange:F=>S(F.target.value)}),a.jsxs(L,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(tt,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:j,onChange:F=>_(F),withInput:!0,withReset:!0,handleReset:()=>_(.5),withSliderMarks:!0}),a.jsx(ve,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs(L,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(ve,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(cm,{value:E,onChange:F=>I(F),children:a.jsx(L,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(Ks,{value:"weighted_sum",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(Ks,{value:"sigmoid",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(Ks,{value:"inv_sigmoid",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(Ks,{value:"add_difference",children:a.jsx(Ft,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs(L,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs(L,{columnGap:4,children:[a.jsx(ve,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(cm,{value:M,onChange:F=>R(F),children:a.jsxs(L,{columnGap:4,children:[a.jsx(Ks,{value:"root",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(Ks,{value:"custom",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),M==="custom"&&a.jsx(vo,{label:e("modelManager.mergedModelCustomSaveLocation"),value:D,onChange:F=>A(F.target.value)})]}),a.jsx(br,{label:e("modelManager.ignoreMismatch"),isChecked:O,onChange:F=>T(F.target.checked),fontWeight:"500"}),a.jsx(at,{onClick:N,isLoading:o,isDisabled:m===null||g===null,children:e("modelManager.merge")})]})}function gpe(e){const{model:t}=e,n=te(),{t:r}=Z(),[o,{isLoading:s}]=ET(),[i,l]=d.useState("InvokeAIRoot"),[u,p]=d.useState("");d.useEffect(()=>{l("InvokeAIRoot")},[t]);const m=()=>{l("InvokeAIRoot")},h=()=>{const g={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:i==="Custom"?u:void 0};if(i==="Custom"&&u===""){n(ct(Qt({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(ct(Qt({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(g).unwrap().then(()=>{n(ct(Qt({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(ct(Qt({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(kg,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:h,cancelCallback:m,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(at,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs(L,{flexDirection:"column",rowGap:4,children:[a.jsx(ve,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Od,{children:[a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(ve,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs(L,{flexDir:"column",gap:2,children:[a.jsxs(L,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(ve,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(cm,{value:i,onChange:g=>l(g),children:a.jsxs(L,{gap:4,children:[a.jsx(Ks,{value:"InvokeAIRoot",children:a.jsx(Ft,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(Ks,{value:"Custom",children:a.jsx(Ft,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),i==="Custom"&&a.jsxs(L,{flexDirection:"column",rowGap:2,children:[a.jsx(ve,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(vo,{value:u,onChange:g=>{p(g.target.value)},width:"full"})]})]})]})}function vpe(e){const{model:t}=e,[n,{isLoading:r}]=$I(),{data:o}=DI(),[s,i]=d.useState(!1);d.useEffect(()=>{o!=null&&o.includes(t.config)||i(!0)},[o,t.config]);const l=te(),{t:u}=Z(),p=fl({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"checkpoint",vae:t.vae?t.vae:"",config:t.config?t.config:"",variant:t.variant},validate:{path:h=>h.trim().length===0?"Must provide a path":null}}),m=d.useCallback(h=>{const g={base_model:t.base_model,model_name:t.model_name,body:h};n(g).unwrap().then(x=>{p.setValues(x),l(ct(Qt({title:u("modelManager.modelUpdated"),status:"success"})))}).catch(x=>{p.reset(),l(ct(Qt({title:u("modelManager.modelUpdateFailed"),status:"error"})))})},[p,l,t.base_model,t.model_name,u,n]);return a.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(L,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs(L,{flexDirection:"column",children:[a.jsx(ve,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(ve,{fontSize:"sm",color:"base.400",children:[an[t.base_model]," Model"]})]}),[""].includes(t.base_model)?a.jsx(Ds,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(gpe,{model:t})]}),a.jsx(Yn,{}),a.jsx(L,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:p.onSubmit(h=>m(h)),children:a.jsxs(L,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:u("modelManager.name"),...p.getInputProps("model_name")}),a.jsx(_n,{label:u("modelManager.description"),...p.getInputProps("description")}),a.jsx(Jd,{required:!0,...p.getInputProps("base_model")}),a.jsx(Tg,{required:!0,...p.getInputProps("variant")}),a.jsx(_n,{required:!0,label:u("modelManager.modelLocation"),...p.getInputProps("path")}),a.jsx(_n,{label:u("modelManager.vaeLocation"),...p.getInputProps("vae")}),a.jsxs(L,{flexDirection:"column",gap:2,children:[s?a.jsx(_n,{required:!0,label:u("modelManager.config"),...p.getInputProps("config")}):a.jsx(XO,{required:!0,...p.getInputProps("config")}),a.jsx(br,{isChecked:s,onChange:()=>i(!s),label:"Use Custom Config"})]}),a.jsx(at,{type:"submit",isLoading:r,children:u("modelManager.updateModel")})]})})})]})}function xpe(e){const{model:t}=e,[n,{isLoading:r}]=$I(),o=te(),{t:s}=Z(),i=fl({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"diffusers",vae:t.vae?t.vae:"",variant:t.variant},validate:{path:u=>u.trim().length===0?"Must provide a path":null}}),l=d.useCallback(u=>{const p={base_model:t.base_model,model_name:t.model_name,body:u};n(p).unwrap().then(m=>{i.setValues(m),o(ct(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{i.reset(),o(ct(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[i,o,t.base_model,t.model_name,s,n]);return a.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(L,{flexDirection:"column",children:[a.jsx(ve,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(ve,{fontSize:"sm",color:"base.400",children:[an[t.base_model]," Model"]})]}),a.jsx(Yn,{}),a.jsx("form",{onSubmit:i.onSubmit(u=>l(u)),children:a.jsxs(L,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...i.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...i.getInputProps("description")}),a.jsx(Jd,{required:!0,...i.getInputProps("base_model")}),a.jsx(Tg,{required:!0,...i.getInputProps("variant")}),a.jsx(_n,{required:!0,label:s("modelManager.modelLocation"),...i.getInputProps("path")}),a.jsx(_n,{label:s("modelManager.vaeLocation"),...i.getInputProps("vae")}),a.jsx(at,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function bpe(e){const{model:t}=e,[n,{isLoading:r}]=MT(),o=te(),{t:s}=Z(),i=fl({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"lora",path:t.path?t.path:"",description:t.description?t.description:"",model_format:t.model_format},validate:{path:u=>u.trim().length===0?"Must provide a path":null}}),l=d.useCallback(u=>{const p={base_model:t.base_model,model_name:t.model_name,body:u};n(p).unwrap().then(m=>{i.setValues(m),o(ct(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{i.reset(),o(ct(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[o,i,t.base_model,t.model_name,s,n]);return a.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(L,{flexDirection:"column",children:[a.jsx(ve,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(ve,{fontSize:"sm",color:"base.400",children:[an[t.base_model]," Model ⋅"," ",OT[t.model_format]," format"]})]}),a.jsx(Yn,{}),a.jsx("form",{onSubmit:i.onSubmit(u=>l(u)),children:a.jsxs(L,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...i.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...i.getInputProps("description")}),a.jsx(Jd,{...i.getInputProps("base_model")}),a.jsx(_n,{label:s("modelManager.modelLocation"),...i.getInputProps("path")}),a.jsx(at,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function ype(e){const{t}=Z(),n=te(),[r]=RT(),[o]=DT(),{model:s,isSelected:i,setSelectedModelId:l}=e,u=d.useCallback(()=>{l(s.id)},[s.id,l]),p=d.useCallback(()=>{const m={main:r,lora:o,onnx:r}[s.model_type];m(s).unwrap().then(h=>{n(ct(Qt({title:`${t("modelManager.modelDeleted")}: ${s.model_name}`,status:"success"})))}).catch(h=>{h&&n(ct(Qt({title:`${t("modelManager.modelDeleteFailed")}: ${s.model_name}`,status:"error"})))}),l(void 0)},[r,o,s,l,n,t]);return a.jsxs(L,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx(L,{as:at,isChecked:i,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:i?"accent.400":"base.100",color:i?"base.50":"base.800",_hover:{bg:i?"accent.500":"base.300",color:i?"base.50":"base.800"},_dark:{color:i?"base.50":"base.100",bg:i?"accent.600":"base.850",_hover:{color:i?"base.50":"base.100",bg:i?"accent.550":"base.700"}}},onClick:u,children:a.jsxs(L,{gap:4,alignItems:"center",children:[a.jsx(Ds,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:AT[s.base_model]}),a.jsx(Ft,{label:s.description,hasArrow:!0,placement:"bottom",children:a.jsx(ve,{sx:{fontWeight:500},children:s.model_name})})]})}),a.jsx(kg,{title:t("modelManager.deleteModel"),acceptCallback:p,acceptButtonText:t("modelManager.delete"),triggerComponent:a.jsx(Fe,{icon:a.jsx(one,{}),"aria-label":t("modelManager.deleteConfig"),colorScheme:"error"}),children:a.jsxs(L,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:t("modelManager.deleteMsg1")}),a.jsx("p",{children:t("modelManager.deleteMsg2")})]})})]})}const Cpe=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=Z(),[o,s]=d.useState(""),[i,l]=d.useState("all"),{filteredDiffusersModels:u,isLoadingDiffusersModels:p}=Xo(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredDiffusersModels:Iu(_,"main","diffusers",o),isLoadingDiffusersModels:E})}),{filteredCheckpointModels:m,isLoadingCheckpointModels:h}=Xo(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredCheckpointModels:Iu(_,"main","checkpoint",o),isLoadingCheckpointModels:E})}),{filteredLoraModels:g,isLoadingLoraModels:x}=Cd(void 0,{selectFromResult:({data:_,isLoading:E})=>({filteredLoraModels:Iu(_,"lora",void 0,o),isLoadingLoraModels:E})}),{filteredOnnxModels:y,isLoadingOnnxModels:b}=Ku(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredOnnxModels:Iu(_,"onnx","onnx",o),isLoadingOnnxModels:E})}),{filteredOliveModels:w,isLoadingOliveModels:S}=Ku(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredOliveModels:Iu(_,"onnx","olive",o),isLoadingOliveModels:E})}),j=d.useCallback(_=>{s(_.target.value)},[]);return a.jsx(L,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs(L,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(Vt,{isAttached:!0,children:[a.jsx(at,{onClick:()=>l("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(at,{size:"sm",onClick:()=>l("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(at,{size:"sm",onClick:()=>l("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(at,{size:"sm",onClick:()=>l("onnx"),isChecked:i==="onnx",children:r("modelManager.onnxModels")}),a.jsx(at,{size:"sm",onClick:()=>l("olive"),isChecked:i==="olive",children:r("modelManager.oliveModels")}),a.jsx(at,{size:"sm",onClick:()=>l("lora"),isChecked:i==="lora",children:r("modelManager.loraModels")})]}),a.jsx(vo,{onChange:j,label:r("modelManager.search"),labelPos:"side"}),a.jsxs(L,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Xl,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(i)&&!p&&u.length>0&&a.jsx(ql,{title:"Diffusers",modelList:u,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),h&&a.jsx(Xl,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(i)&&!h&&m.length>0&&a.jsx(ql,{title:"Checkpoints",modelList:m,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),x&&a.jsx(Xl,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(i)&&!x&&g.length>0&&a.jsx(ql,{title:"LoRAs",modelList:g,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),S&&a.jsx(Xl,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(i)&&!S&&w.length>0&&a.jsx(ql,{title:"Olives",modelList:w,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),b&&a.jsx(Xl,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(i)&&!b&&y.length>0&&a.jsx(ql,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},wpe=d.memo(Cpe),Iu=(e,t,n,r)=>{const o=[];return Rn(e==null?void 0:e.entities,s=>{if(!s)return;const i=s.model_name.toLowerCase().includes(r.toLowerCase()),l=n===void 0||s.model_format===n,u=s.model_type===t;i&&l&&u&&o.push(s)}),o},d2=d.memo(e=>a.jsx(L,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));d2.displayName="StyledModelContainer";const ql=d.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(d2,{children:a.jsxs(L,{sx:{gap:2,flexDir:"column"},children:[a.jsx(ve,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(ype,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});ql.displayName="ModelListWrapper";const Xl=d.memo(({loadingMessage:e})=>a.jsx(d2,{children:a.jsxs(L,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(fa,{}),a.jsx(ve,{variant:"subtext",children:e||"Fetching..."})]})}));Xl.displayName="FetchingModelsLoader";function Spe(){const[e,t]=d.useState(),{mainModel:n}=Xo(Ei,{selectFromResult:({data:s})=>({mainModel:e?s==null?void 0:s.entities[e]:void 0})}),{loraModel:r}=Cd(void 0,{selectFromResult:({data:s})=>({loraModel:e?s==null?void 0:s.entities[e]:void 0})}),o=n||r;return a.jsxs(L,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(wpe,{selectedModelId:e,setSelectedModelId:t}),a.jsx(kpe,{model:o})]})}const kpe=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(vpe,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(xpe,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(bpe,{model:t},t.id):a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(ve,{variant:"subtext",children:"No Model Selected"})})};function jpe(){const{t:e}=Z();return a.jsxs(L,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsx(ve,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(ve,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Gc,{})]})}function _pe(){return a.jsx(L,{children:a.jsx(jpe,{})})}const E_=[{id:"modelManager",label:yt.t("modelManager.modelManager"),content:a.jsx(Spe,{})},{id:"importModels",label:yt.t("modelManager.importModels"),content:a.jsx(ppe,{})},{id:"mergeModels",label:yt.t("modelManager.mergeModels"),content:a.jsx(hpe,{})},{id:"settings",label:yt.t("modelManager.settings"),content:a.jsx(_pe,{})}],Ipe=()=>a.jsxs(rl,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(ol,{children:E_.map(e=>a.jsx(Tr,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(zc,{sx:{w:"full",h:"full"},children:E_.map(e=>a.jsx(So,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),Ppe=d.memo(Ipe),Epe={enum:"",BoardField:void 0,boolean:!1,BooleanCollection:[],BooleanPolymorphic:!1,ClipField:void 0,Collection:[],CollectionItem:void 0,ColorCollection:[],ColorField:void 0,ColorPolymorphic:void 0,ConditioningCollection:[],ConditioningField:void 0,ConditioningPolymorphic:void 0,ControlCollection:[],ControlField:void 0,ControlNetModelField:void 0,ControlPolymorphic:void 0,DenoiseMaskField:void 0,float:0,FloatCollection:[],FloatPolymorphic:0,ImageCollection:[],ImageField:void 0,ImagePolymorphic:void 0,integer:0,IntegerCollection:[],IntegerPolymorphic:0,IPAdapterCollection:[],IPAdapterField:void 0,IPAdapterModelField:void 0,IPAdapterPolymorphic:void 0,LatentsCollection:[],LatentsField:void 0,LatentsPolymorphic:void 0,LoRAModelField:void 0,MainModelField:void 0,ONNXModelField:void 0,Scheduler:"euler",SDXLMainModelField:void 0,SDXLRefinerModelField:void 0,string:"",StringCollection:[],StringPolymorphic:"",T2IAdapterCollection:[],T2IAdapterField:void 0,T2IAdapterModelField:void 0,T2IAdapterPolymorphic:void 0,UNetField:void 0,VaeField:void 0,VaeModelField:void 0},Mpe=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return n.value=t.default??Epe[t.type],n},Ope=le([e=>e.nodes],e=>e.nodeTemplates),Jv={dragHandle:`.${tl}`},Rpe=()=>{const e=W(Ope),t=sb();return d.useCallback(n=>{var x;const r=Zs();let o=window.innerWidth/2,s=window.innerHeight/2;const i=(x=document.querySelector("#workflow-editor"))==null?void 0:x.getBoundingClientRect();i&&(o=i.width/2-g1/2,s=i.height/2-g1/2);const{x:l,y:u}=t.project({x:o,y:s});if(n==="current_image")return{...Jv,id:r,type:"current_image",position:{x:l,y:u},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...Jv,id:r,type:"notes",position:{x:l,y:u},data:{id:r,isOpen:!0,label:"Notes",notes:"",type:"notes"}};const p=e[n];if(p===void 0){console.error(`Unable to find template ${n}.`);return}const m=Nw(p.inputs,(y,b,w)=>{const S=Zs(),j=Mpe(S,b);return y[w]=j,y},{}),h=Nw(p.outputs,(y,b,w)=>{const j={id:Zs(),name:w,type:b.type,fieldKind:"output"};return y[w]=j,y},{});return{...Jv,id:r,type:"invocation",position:{x:l,y:u},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:n!=="save_image",inputs:m,outputs:h,useCache:p.useCache}}},[e,t])},JO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(ve,{fontWeight:600,children:e}),a.jsx(ve,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));JO.displayName="AddNodePopoverSelectItem";const Dpe=(e,t)=>{const n=new RegExp(e.trim().replace(/[-[\]{}()*+!<=:?./\\^$|#,]/g,"").split(" ").join(".*"),"gi");return n.test(t.label)||n.test(t.description)||t.tags.some(r=>n.test(r))},Ape=()=>{const e=te(),t=Rpe(),n=sl(),{t:r}=Z(),o=W(w=>w.nodes.currentConnectionFieldType),s=W(w=>{var S;return(S=w.nodes.connectionStartParams)==null?void 0:S.handleType}),i=le([xe],({nodes:w})=>{const S=o?TT(w.nodeTemplates,_=>{const E=s=="source"?_.inputs:_.outputs;return Xr(E,I=>{const M=s=="source"?o:I.type,R=s=="target"?o:I.type;return ab(M,R)})}):nr(w.nodeTemplates),j=nr(S,_=>({label:_.title,value:_.type,description:_.description,tags:_.tags}));return o===null&&(j.push({label:r("nodes.currentImage"),value:"current_image",description:r("nodes.currentImageDescription"),tags:["progress"]}),j.push({label:r("nodes.notes"),value:"notes",description:r("nodes.notesDescription"),tags:["notes"]})),j.sort((_,E)=>_.label.localeCompare(E.label)),{data:j,t:r}},Se),{data:l}=W(i),u=W(w=>w.nodes.isAddNodePopoverOpen),p=d.useRef(null),m=d.useCallback(w=>{const S=t(w);if(!S){const j=r("nodes.unknownNode",{nodeType:w});n({status:"error",title:j});return}e(NT(S))},[e,t,n,r]),h=d.useCallback(w=>{w&&m(w)},[m]),g=d.useCallback(()=>{e($T())},[e]),x=d.useCallback(()=>{e(LI())},[e]),y=d.useCallback(w=>{w.preventDefault(),x(),setTimeout(()=>{var S;(S=p.current)==null||S.focus()},0)},[x]),b=d.useCallback(()=>{g()},[g]);return et(["shift+a","space"],y),et(["escape"],b),a.jsxs(Ld,{initialFocusRef:p,isOpen:u,onClose:g,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(F3,{children:a.jsx(L,{sx:{position:"absolute",top:"15%",insetInlineStart:"50%",pointerEvents:"none"}})}),a.jsx(zd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Uh,{sx:{p:0},children:a.jsx(nn,{inputRef:p,selectOnBlur:!1,placeholder:r("nodes.nodeSearch"),value:null,data:l,maxDropdownHeight:400,nothingFound:r("nodes.noMatchingNodes"),itemComponent:JO,filter:Dpe,onChange:h,hoverOnSearchChange:!0,onDropdownClose:g,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},Tpe=d.memo(Ape),Npe=()=>{const e=sb(),t=W(r=>r.nodes.shouldValidateGraph);return d.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:i})=>{var x,y;const l=e.getEdges(),u=e.getNodes();if(!(r&&o&&s&&i))return!1;const p=e.getNode(r),m=e.getNode(s);if(!(p&&m&&p.data&&m.data))return!1;const h=(x=p.data.outputs[o])==null?void 0:x.type,g=(y=m.data.inputs[i])==null?void 0:y.type;return!h||!g||r===s?!1:t?l.find(b=>{b.target===s&&b.targetHandle===i&&b.source===r&&b.sourceHandle})||l.find(b=>b.target===s&&b.targetHandle===i)&&g!=="CollectionItem"||!ab(h,g)?!1:zI(r,s,u,l):!0},[e,t])},hd=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,$pe=le(xe,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=hd(n&&r?wd[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),Lpe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:i,className:l}=W($pe),u={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=ib(u);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:i,strokeWidth:2,className:l,d:p,style:{opacity:.8}})})},zpe=d.memo(Lpe),e7=(e,t,n,r,o)=>le(xe,({nodes:s})=>{var g,x;const i=s.nodes.find(y=>y.id===e),l=s.nodes.find(y=>y.id===n),u=On(i)&&On(l),p=(i==null?void 0:i.selected)||(l==null?void 0:l.selected)||o,m=u?(x=(g=i==null?void 0:i.data)==null?void 0:g.outputs[t||""])==null?void 0:x.type:void 0,h=m&&s.shouldColorEdges?hd(wd[m].color):hd("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:h}},Se),Fpe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,data:l,selected:u,source:p,target:m,sourceHandleId:h,targetHandleId:g})=>{const x=d.useMemo(()=>e7(p,h,m,g,u),[u,p,h,m,g]),{isSelected:y,shouldAnimate:b}=W(x),[w,S,j]=ib({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:_}=Wd();return a.jsxs(a.Fragment,{children:[a.jsx(FI,{path:w,markerEnd:i,style:{strokeWidth:y?3:2,stroke:_,opacity:y?.8:.5,animation:b?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:b?5:"none"}}),(l==null?void 0:l.count)&&l.count>1&&a.jsx(LT,{children:a.jsx(L,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${S}px,${j}px)`},className:"nodrag nopan",children:a.jsx(Ds,{variant:"solid",sx:{bg:"base.500",opacity:y?.8:.5,boxShadow:"base"},children:l.count})})})]})},Bpe=d.memo(Fpe),Hpe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,selected:l,source:u,target:p,sourceHandleId:m,targetHandleId:h})=>{const g=d.useMemo(()=>e7(u,m,p,h,l),[u,m,p,h,l]),{isSelected:x,shouldAnimate:y,stroke:b}=W(g),[w]=ib({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(FI,{path:w,markerEnd:i,style:{strokeWidth:x?3:2,stroke:b,opacity:x?.8:.5,animation:y?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:y?5:"none"}})},Vpe=d.memo(Hpe),Wpe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:i,handleMouseOver:l}=dO(t),u=d.useMemo(()=>le(xe,({nodes:j})=>{var _;return((_=j.nodeExecutionStates[t])==null?void 0:_.status)===Ys.IN_PROGRESS}),[t]),p=W(u),[m,h,g,x]=Ho("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=te(),b=sa(m,h),w=W(j=>j.nodes.nodeOpacity),S=d.useCallback(j=>{!j.ctrlKey&&!j.altKey&&!j.metaKey&&!j.shiftKey&&y(zT(t)),y(BI())},[y,t]);return a.jsxs(Ie,{onClick:S,onMouseEnter:l,onMouseLeave:i,className:tl,sx:{h:"full",position:"relative",borderRadius:"base",w:n??g1,transitionProperty:"common",transitionDuration:"0.1s",cursor:"grab",opacity:w},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",pointerEvents:"none",shadow:`${g}, ${x}, ${x}`,zIndex:-1}}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"md",pointerEvents:"none",transitionProperty:"common",transitionDuration:"0.1s",opacity:.7,shadow:p?b:void 0,zIndex:-1}}),r,a.jsx(uO,{isSelected:o,isHovered:s})]})},Ng=d.memo(Wpe),Upe=le(xe,({system:e,gallery:t})=>{var r;return{imageDTO:t.selection[t.selection.length-1],progressImage:(r=e.denoiseProgress)==null?void 0:r.progress_image}}),Gpe=e=>{const{progressImage:t,imageDTO:n}=FT(Upe);return t?a.jsx(e1,{nodeProps:e,children:a.jsx(ga,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(e1,{nodeProps:e,children:a.jsx(ua,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(e1,{nodeProps:e,children:a.jsx(Zn,{})})},Kpe=d.memo(Gpe),e1=e=>{const[t,n]=d.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(Ng,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs(L,{onMouseEnter:r,onMouseLeave:o,className:tl,sx:{position:"relative",flexDirection:"column"},children:[a.jsx(L,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(ve,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs(L,{layerStyle:"nodeBody",sx:{w:"full",h:"full",borderBottomRadius:"base",p:2},children:[e.children,t&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:40,left:-2,right:-2,bottom:0,pointerEvents:"none"},children:a.jsx(UO,{})},"nextPrevButtons")]})]})})},qpe=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return[];const s=r.nodeTemplates[o.data.type];return s?nr(s.inputs).filter(i=>(["any","direct"].includes(i.input)||lb.includes(i.type))&&HI.includes(i.type)).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Se),[e]);return W(t)},Xpe=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return[];const s=r.nodeTemplates[o.data.type];return s?nr(s.inputs).filter(i=>i.input==="connection"&&!lb.includes(i.type)||!HI.includes(i.type)).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Se),[e]);return W(t)},Qpe=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return[];const s=r.nodeTemplates[o.data.type];return s?nr(s.outputs).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Se),[e]);return W(t)},Ype=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.embedWorkflow:!1},Se),[e]);return W(t)},$g=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?Xr(o.data.outputs,s=>BT.includes(s.type)&&o.data.type!=="image"):!1},Se),[e]);return W(t)},Zpe=({nodeId:e})=>{const t=te(),n=$g(e),r=Ype(e),o=d.useCallback(s=>{t(HT({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(Kt,{as:L,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(wn,{sx:{fontSize:"xs",mb:"1px"},children:"Workflow"}),a.jsx(Md,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},Jpe=d.memo(Zpe),eme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.isIntermediate:!1},Se),[e]);return W(t)},tme=({nodeId:e})=>{const t=te(),n=$g(e),r=eme(e),o=d.useCallback(s=>{t(VT({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(Kt,{as:L,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(wn,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Md,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},nme=d.memo(tme),rme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.useCache:!1},Se),[e]);return W(t)},ome=({nodeId:e})=>{const t=te(),n=rme(e),r=d.useCallback(o=>{t(WT({nodeId:e,useCache:o.target.checked}))},[t,e]);return a.jsxs(Kt,{as:L,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(wn,{sx:{fontSize:"xs",mb:"1px"},children:"Use Cache"}),a.jsx(Md,{className:"nopan",size:"sm",onChange:r,isChecked:n})]})},sme=d.memo(ome),ame=({nodeId:e})=>{const t=$g(e),n=Ht("invocationCache").isFeatureEnabled;return a.jsxs(L,{className:tl,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[n&&a.jsx(sme,{nodeId:e}),t&&a.jsx(Jpe,{nodeId:e}),t&&a.jsx(nme,{nodeId:e})]})},ime=d.memo(ame),lme=({nodeId:e,isOpen:t})=>{const n=te(),r=UT(),o=d.useCallback(()=>{n(GT({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(Fe,{className:"nodrag",onClick:o,"aria-label":"Minimize",sx:{minW:8,w:8,h:8,color:"base.500",_dark:{color:"base.500"},_hover:{color:"base.700",_dark:{color:"base.300"}}},variant:"link",icon:a.jsx(gg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})})},f2=d.memo(lme),t7=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.label:!1},Se),[e]);return W(t)},n7=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},Se),[e]);return W(t)},cme=({nodeId:e,title:t})=>{const n=te(),r=t7(e),o=n7(e),{t:s}=Z(),[i,l]=d.useState(""),u=d.useCallback(async m=>{n(KT({nodeId:e,label:m})),l(r||t||o||s("nodes.problemSettingTitle"))},[n,e,t,o,r,s]),p=d.useCallback(m=>{l(m)},[]);return d.useEffect(()=>{l(r||t||o||s("nodes.problemSettingTitle"))},[r,o,t,s]),a.jsx(L,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(Ih,{as:L,value:i,onChange:p,onSubmit:u,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(_h,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(jh,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(ume,{})]})})},r7=d.memo(cme);function ume(){const{isEditing:e,getEditButtonProps:t}=y5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:tl,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const p2=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},Se),[e]);return W(t)},dme=({nodeId:e})=>{const t=p2(e),{base400:n,base600:r}=Wd(),o=sa(n,r),s=d.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return em(t)?a.jsxs(a.Fragment,{children:[a.jsx(Ou,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Ql.Left,style:{...s,left:"-0.5rem"}}),nr(t.inputs,i=>a.jsx(Ou,{type:"target",id:i.name,isConnectable:!1,position:Ql.Left,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-input-handle`)),a.jsx(Ou,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Ql.Right,style:{...s,right:"-0.5rem"}}),nr(t.outputs,i=>a.jsx(Ou,{type:"source",id:i.name,isConnectable:!1,position:Ql.Right,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-output-handle`))]}):null},fme=d.memo(dme),pme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},Se),[e]);return W(t)},mme=({nodeId:e})=>{const t=te(),n=p2(e),{t:r}=Z(),o=d.useCallback(s=>{t(qT({nodeId:e,notes:s.target.value}))},[t,e]);return em(n)?a.jsxs(Kt,{children:[a.jsx(wn,{children:r("nodes.notes")}),a.jsx(da,{value:n==null?void 0:n.notes,onChange:o,rows:10})]}):null},hme=d.memo(mme),gme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{var i;const o=r.nodes.find(l=>l.id===e);if(!On(o))return!1;const s=r.nodeTemplates[(o==null?void 0:o.data.type)??""];return!(s!=null&&s.version)||!((i=o.data)!=null&&i.version)?!1:Z_(s.version,o.data.version)===0},Se),[e]);return W(t)},vme=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Lr(),o=t7(e),s=n7(e),i=gme(e),{t:l}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Ft,{label:a.jsx(o7,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx(L,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(Nn,{as:dM,sx:{boxSize:4,w:8,color:i?"base.400":"error.400"}})})}),a.jsxs(qi,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{children:o||s||l("nodes.unknownNode")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsx(hme,{nodeId:e})}),a.jsx(Ss,{})]})]})]})},xme=d.memo(vme),o7=d.memo(({nodeId:e})=>{const t=p2(e),n=pme(e),{t:r}=Z(),o=d.useMemo(()=>t!=null&&t.label&&(n!=null&&n.title)?`${t.label} (${n.title})`:t!=null&&t.label&&!n?t.label:!(t!=null&&t.label)&&n?n.title:r("nodes.unknownNode"),[t,n,r]),s=d.useMemo(()=>!em(t)||!n?null:t.version?n.version?Xw(t.version,n.version,"<")?a.jsxs(ve,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateNode"),")"]}):Xw(t.version,n.version,">")?a.jsxs(ve,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateApp"),")"]}):a.jsxs(ve,{as:"span",children:[r("nodes.version")," ",t.version]}):a.jsxs(ve,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.unknownTemplate"),")"]}):a.jsx(ve,{as:"span",sx:{color:"error.500"},children:r("nodes.versionUnknown")}),[t,n,r]);return em(t)?a.jsxs(L,{sx:{flexDir:"column"},children:[a.jsx(ve,{as:"span",sx:{fontWeight:600},children:o}),a.jsx(ve,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),s,(t==null?void 0:t.notes)&&a.jsx(ve,{children:t.notes})]}):a.jsx(ve,{sx:{fontWeight:600},children:r("nodes.unknownNode")})});o7.displayName="TooltipContent";const t1=3,M_={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},bme=({nodeId:e})=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=W(t);return n?a.jsx(Ft,{label:a.jsx(s7,{nodeExecutionState:n}),placement:"top",children:a.jsx(L,{className:tl,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(a7,{nodeExecutionState:n})})}):null},yme=d.memo(bme),s7=d.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e,{t:o}=Z();return t===Ys.PENDING?a.jsx(ve,{children:"Pending"}):t===Ys.IN_PROGRESS?r?a.jsxs(L,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(ga,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(Ds,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(ve,{children:[o("nodes.executionStateInProgress")," (",Math.round(n*100),"%)"]}):a.jsx(ve,{children:o("nodes.executionStateInProgress")}):t===Ys.COMPLETED?a.jsx(ve,{children:o("nodes.executionStateCompleted")}):t===Ys.FAILED?a.jsx(ve,{children:o("nodes.executionStateError")}):null});s7.displayName="TooltipLabel";const a7=d.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Ys.PENDING?a.jsx(Nn,{as:TJ,sx:{boxSize:t1,color:"base.600",_dark:{color:"base.300"}}}):n===Ys.IN_PROGRESS?t===null?a.jsx(B1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:M_}):a.jsx(B1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:M_}):n===Ys.COMPLETED?a.jsx(Nn,{as:aM,sx:{boxSize:t1,color:"ok.600",_dark:{color:"ok.300"}}}):n===Ys.FAILED?a.jsx(Nn,{as:LJ,sx:{boxSize:t1,color:"error.600",_dark:{color:"error.300"}}}):null});a7.displayName="StatusIcon";const Cme=({nodeId:e,isOpen:t})=>a.jsxs(L,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",justifyContent:"space-between",h:8,textAlign:"center",fontWeight:500,color:"base.700",_dark:{color:"base.200"}},children:[a.jsx(f2,{nodeId:e,isOpen:t}),a.jsx(r7,{nodeId:e}),a.jsxs(L,{alignItems:"center",children:[a.jsx(yme,{nodeId:e}),a.jsx(xme,{nodeId:e})]}),!t&&a.jsx(fme,{nodeId:e})]}),wme=d.memo(Cme),Sme=(e,t,n,r)=>le(xe,o=>{if(!r)return yt.t("nodes.noFieldType");const{currentConnectionFieldType:s,connectionStartParams:i,nodes:l,edges:u}=o.nodes;if(!i||!s)return yt.t("nodes.noConnectionInProgress");const{handleType:p,nodeId:m,handleId:h}=i;if(!p||!m||!h)return yt.t("nodes.noConnectionData");const g=n==="target"?r:s,x=n==="source"?r:s;if(e===m)return yt.t("nodes.cannotConnectToSelf");if(n===p)return n==="source"?yt.t("nodes.cannotConnectOutputToOutput"):yt.t("nodes.cannotConnectInputToInput");const y=n==="target"?e:m,b=n==="target"?t:h,w=n==="source"?e:m,S=n==="source"?t:h;return u.find(_=>{_.target===y&&_.targetHandle===b&&_.source===w&&_.sourceHandle})?yt.t("nodes.cannotDuplicateConnection"):u.find(_=>_.target===y&&_.targetHandle===b)&&g!=="CollectionItem"?yt.t("nodes.inputMayOnlyHaveOneConnection"):ab(x,g)?zI(p==="source"?m:e,p==="source"?e:m,l,u)?null:yt.t("nodes.connectionWouldCreateCycle"):yt.t("nodes.fieldTypesMustMatch")}),kme=(e,t,n)=>{const r=d.useMemo(()=>le(xe,({nodes:s})=>{var l;const i=s.nodes.find(u=>u.id===e);if(On(i))return(l=i==null?void 0:i.data[rb[n]][t])==null?void 0:l.type},Se),[t,n,e]);return W(r)},jme=le(xe,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),i7=({nodeId:e,fieldName:t,kind:n})=>{const r=kme(e,t,n),o=d.useMemo(()=>le(xe,({nodes:g})=>!!g.edges.filter(x=>(n==="input"?x.target:x.source)===e&&(n==="input"?x.targetHandle:x.sourceHandle)===t).length),[t,n,e]),s=d.useMemo(()=>Sme(e,t,n==="input"?"target":"source",r),[e,t,n,r]),i=d.useMemo(()=>le(xe,({nodes:g})=>{var x,y,b;return((x=g.connectionStartParams)==null?void 0:x.nodeId)===e&&((y=g.connectionStartParams)==null?void 0:y.handleId)===t&&((b=g.connectionStartParams)==null?void 0:b.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),l=W(o),u=W(jme),p=W(i),m=W(s),h=d.useMemo(()=>!!(u&&m&&!p),[m,u,p]);return{isConnected:l,isConnectionInProgress:u,isConnectionStartField:p,connectionError:m,shouldDim:h}},_me=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(On(s))return((i=s==null?void 0:s.data.inputs[t])==null?void 0:i.value)!==void 0},Se),[t,e]);return W(n)},Ime=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{const s=o.nodes.find(u=>u.id===e);if(!On(s))return;const i=o.nodeTemplates[(s==null?void 0:s.data.type)??""],l=i==null?void 0:i.inputs[t];return l==null?void 0:l.input},Se),[t,e]);return W(n)},Pme=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=te(),s=fO(e,t),i=pO(e,t,n),l=Ime(e,t),{t:u}=Z(),p=d.useCallback(w=>{w.preventDefault()},[]),m=d.useMemo(()=>le(xe,({nodes:w})=>({isExposed:!!w.workflow.exposedFields.find(j=>j.nodeId===e&&j.fieldName===t)}),Se),[t,e]),h=d.useMemo(()=>["any","direct"].includes(l??"__UNKNOWN_INPUT__"),[l]),{isExposed:g}=W(m),x=d.useCallback(()=>{o(XT({nodeId:e,fieldName:t}))},[o,t,e]),y=d.useCallback(()=>{o(jI({nodeId:e,fieldName:t}))},[o,t,e]),b=d.useMemo(()=>{const w=[];return h&&!g&&w.push(a.jsx(en,{icon:a.jsx(Vc,{}),onClick:x,children:"Add to Linear View"},`${e}.${t}.expose-field`)),h&&g&&w.push(a.jsx(en,{icon:a.jsx(XJ,{}),onClick:y,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),w},[t,x,y,g,h,e]);return a.jsx(Ay,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>b.length?a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:p,children:a.jsx(td,{title:s||i||u("nodes.unknownField"),children:b})}):null,children:r})},Eme=d.memo(Pme),Mme=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:i,type:l}=t,{color:u,title:p}=wd[l],m=d.useMemo(()=>{const g=QT.includes(l),x=lb.includes(l),y=YT.includes(l),b=hd(u),w={backgroundColor:g||x?"var(--invokeai-colors-base-900)":b,position:"absolute",width:"1rem",height:"1rem",borderWidth:g||x?4:0,borderStyle:"solid",borderColor:b,borderRadius:y?4:"100%",zIndex:1};return n==="target"?w.insetInlineStart="-1rem":w.insetInlineEnd="-1rem",r&&!o&&s&&(w.filter="opacity(0.4) grayscale(0.7)"),r&&s?o?w.cursor="grab":w.cursor="not-allowed":w.cursor="crosshair",w},[s,n,r,o,l,u]),h=d.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Ft,{label:h,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:yh,children:a.jsx(Ou,{type:n,id:i,position:n==="target"?Ql.Left:Ql.Right,style:m})})},l7=d.memo(Mme),Ome=({nodeId:e,fieldName:t})=>{const n=Pg(e,t,"input"),r=_me(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:i,connectionError:l,shouldDim:u}=i7({nodeId:e,fieldName:t,kind:"input"}),p=d.useMemo(()=>{if((n==null?void 0:n.fieldKind)!=="input"||!n.required)return!1;if(!o&&n.input==="connection"||!r&&!o&&n.input==="any")return!0},[n,o,r]);return(n==null?void 0:n.fieldKind)!=="input"?a.jsx(Rx,{shouldDim:u,children:a.jsxs(Kt,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Rx,{shouldDim:u,children:[a.jsxs(Kt,{isInvalid:p,isDisabled:o,sx:{alignItems:"stretch",justifyContent:"space-between",ps:n.input==="direct"?0:2,gap:2,h:"full",w:"full"},children:[a.jsx(Eme,{nodeId:e,fieldName:t,kind:"input",children:m=>a.jsx(wn,{sx:{display:"flex",alignItems:"center",h:"full",mb:0,px:1,gap:2},children:a.jsx(hO,{ref:m,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(IO,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(l7,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:i,connectionError:l})]})},O_=d.memo(Ome),Rx=d.memo(({shouldDim:e,children:t})=>a.jsx(L,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Rx.displayName="InputFieldWrapper";const Rme=({nodeId:e,fieldName:t})=>{const n=Pg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:i,shouldDim:l}=i7({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(Dx,{shouldDim:l,children:a.jsxs(Kt,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(Dx,{shouldDim:l,children:[a.jsx(Ft,{label:a.jsx(r2,{nodeId:e,fieldName:t,kind:"output"}),openDelay:yh,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(Kt,{isDisabled:r,pe:2,children:a.jsx(wn,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(l7,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:i})]})},Dme=d.memo(Rme),Dx=d.memo(({shouldDim:e,children:t})=>a.jsx(L,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));Dx.displayName="OutputFieldWrapper";const Ame=e=>{const t=$g(e),n=Ht("invocationCache").isFeatureEnabled;return d.useMemo(()=>t||n,[t,n])},Tme=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=Xpe(e),i=qpe(e),l=Ame(e),u=Qpe(e);return a.jsxs(Ng,{nodeId:e,selected:o,children:[a.jsx(wme,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx(L,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:l?0:"base"},children:a.jsxs(L,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(Ja,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,m)=>a.jsx(Zu,{gridColumnStart:1,gridRowStart:m+1,children:a.jsx(O_,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),u.map((p,m)=>a.jsx(Zu,{gridColumnStart:2,gridRowStart:m+1,children:a.jsx(Dme,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),i.map(p=>a.jsx(O_,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),l&&a.jsx(ime,{nodeId:e})]})]})},Nme=d.memo(Tme),$me=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(Ng,{nodeId:e,selected:o,children:[a.jsxs(L,{className:tl,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(f2,{nodeId:e,isOpen:t}),a.jsx(ve,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx(L,{layerStyle:"nodeBody",sx:{userSelect:"auto",flexDirection:"column",w:"full",h:"full",p:4,gap:1,borderBottomRadius:"base",fontSize:"sm"},children:a.jsxs(Ie,{children:[a.jsx(ve,{as:"span",children:"Unknown node type: "}),a.jsx(ve,{as:"span",fontWeight:600,children:r})]})})]}),Lme=d.memo($me),zme=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:i}=t,l=d.useMemo(()=>le(xe,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return W(l)?a.jsx(Nme,{nodeId:r,isOpen:s,label:i,type:o,selected:n}):a.jsx(Lme,{nodeId:r,isOpen:s,label:i,type:o,selected:n})},Fme=d.memo(zme),Bme=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,i=te(),l=d.useCallback(u=>{i(ZT({nodeId:t,value:u.target.value}))},[i,t]);return a.jsxs(Ng,{nodeId:t,selected:r,children:[a.jsxs(L,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(f2,{nodeId:t,isOpen:s}),a.jsx(r7,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx(L,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx(L,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(da,{value:o,onChange:l,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},Hme=d.memo(Bme),Vme=["Delete","Backspace"],Wme={collapsed:Bpe,default:Vpe},Ume={invocation:Fme,current_image:Kpe,notes:Hme},Gme={hideAttribution:!0},Kme=le(xe,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},Se),qme=()=>{const e=te(),t=W(O=>O.nodes.nodes),n=W(O=>O.nodes.edges),r=W(O=>O.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=W(Kme),i=d.useRef(null),l=d.useRef(),u=Npe(),[p]=Ho("radii",["base"]),m=d.useCallback(O=>{e(JT(O))},[e]),h=d.useCallback(O=>{e(eN(O))},[e]),g=d.useCallback((O,T)=>{e(tN(T))},[e]),x=d.useCallback(O=>{e($w(O))},[e]),y=d.useCallback(()=>{e(nN({cursorPosition:l.current}))},[e]),b=d.useCallback(O=>{e(rN(O))},[e]),w=d.useCallback(O=>{e(oN(O))},[e]),S=d.useCallback(({nodes:O,edges:T})=>{e(sN(O?O.map(X=>X.id):[])),e(aN(T?T.map(X=>X.id):[]))},[e]),j=d.useCallback((O,T)=>{e(iN(T))},[e]),_=d.useCallback(()=>{e(BI())},[e]),E=d.useCallback(O=>{Lw.set(O),O.fitView()},[]),I=d.useCallback(O=>{var X,B;const T=(X=i.current)==null?void 0:X.getBoundingClientRect();if(T){const V=(B=Lw.get())==null?void 0:B.project({x:O.clientX-T.left,y:O.clientY-T.top});l.current=V}},[]),M=d.useRef(),R=d.useCallback((O,T,X)=>{M.current=O,e(lN(T.id)),e(cN())},[e]),D=d.useCallback((O,T)=>{e($w(T))},[e]),A=d.useCallback((O,T,X)=>{var B,V;!("touches"in O)&&((B=M.current)==null?void 0:B.clientX)===O.clientX&&((V=M.current)==null?void 0:V.clientY)===O.clientY&&e(uN(T)),M.current=void 0},[e]);return et(["Ctrl+c","Meta+c"],O=>{O.preventDefault(),e(dN())}),et(["Ctrl+a","Meta+a"],O=>{O.preventDefault(),e(fN())}),et(["Ctrl+v","Meta+v"],O=>{O.preventDefault(),e(pN({cursorPosition:l.current}))}),a.jsx(mN,{id:"workflow-editor",ref:i,defaultViewport:r,nodeTypes:Ume,edgeTypes:Wme,nodes:t,edges:n,onInit:E,onMouseMove:I,onNodesChange:m,onEdgesChange:h,onEdgesDelete:b,onEdgeUpdate:D,onEdgeUpdateStart:R,onEdgeUpdateEnd:A,onNodesDelete:w,onConnectStart:g,onConnect:x,onConnectEnd:y,onMoveEnd:j,connectionLineComponent:zpe,onSelectionChange:S,isValidConnection:u,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:Gme,style:{borderRadius:p},onPaneClick:_,deleteKeyCode:Vme,selectionMode:s,children:a.jsx(y$,{})})},Xme=()=>{const e=te(),{t}=Z(),n=d.useCallback(()=>{e(LI())},[e]);return a.jsx(L,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(Fe,{tooltip:t("nodes.addNodeToolTip"),"aria-label":t("nodes.addNode"),icon:a.jsx(Vc,{}),onClick:n})})},Qme=d.memo(Xme),Yme=()=>{const e=te(),t=fP("nodes"),{t:n}=Z();return d.useCallback(o=>{if(!o)return;const s=new FileReader;s.onload=async()=>{const i=s.result;try{const l=JSON.parse(String(i)),u=hN.safeParse(l);if(!u.success){const{message:p}=gN(u.error,{prefix:n("nodes.workflowValidation")});t.error({error:vN(u.error)},p),e(ct(Qt({title:n("nodes.unableToValidateWorkflow"),status:"error",duration:5e3}))),s.abort();return}e(Yx(u.data)),s.abort()}catch{e(ct(Qt({title:n("nodes.unableToLoadWorkflow"),status:"error"})))}},s.readAsText(o)},[e,t,n])},Zme=d.memo(e=>e.error.issues[0]?a.jsx(ve,{children:zw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Od,{children:e.error.issues.map((t,n)=>a.jsx(Qr,{children:a.jsx(ve,{children:zw(t,{prefix:null}).toString()})},n))}));Zme.displayName="WorkflowValidationErrorContent";const Jme=()=>{const{t:e}=Z(),t=d.useRef(null),n=Yme();return a.jsx(DE,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(Fe,{icon:a.jsx(cg,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},ehe=d.memo(Jme),the=()=>{const{t:e}=Z(),t=te(),{isOpen:n,onOpen:r,onClose:o}=Lr(),s=d.useRef(null),i=W(u=>u.nodes.nodes.length),l=d.useCallback(()=>{t(xN()),t(ct(Qt({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Fe,{icon:a.jsx(Br,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!i,colorScheme:"error"}),a.jsxs(Td,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Zo,{py:4,children:a.jsxs(L,{flexDir:"column",gap:2,children:[a.jsx(ve,{children:e("nodes.resetWorkflowDesc")}),a.jsx(ve,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(Ss,{children:[a.jsx(Za,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(Za,{colorScheme:"error",ml:3,onClick:l,children:e("common.accept")})]})]})]})]})},nhe=d.memo(the),rhe=()=>{const{t:e}=Z(),t=cO(),n=d.useCallback(()=>{const r=new Blob([JSON.stringify(t,null,2)]),o=document.createElement("a");o.href=URL.createObjectURL(r),o.download=`${t.name||"My Workflow"}.json`,document.body.appendChild(o),o.click(),o.remove()},[t]);return a.jsx(Fe,{icon:a.jsx(ig,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},ohe=d.memo(rhe),she=()=>a.jsxs(L,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(ohe,{}),a.jsx(ehe,{}),a.jsx(nhe,{})]}),ahe=d.memo(she),ihe=()=>a.jsx(L,{sx:{gap:2,flexDir:"column"},children:nr(wd,({title:e,description:t,color:n},r)=>a.jsx(Ft,{label:t,children:a.jsx(Ds,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),lhe=d.memo(ihe),che=()=>{const{t:e}=Z(),t=te(),n=d.useCallback(()=>{t(bN())},[t]);return a.jsx(at,{leftIcon:a.jsx(see,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},uhe=d.memo(che),Pu={fontWeight:600},dhe=le(xe,({nodes:e})=>{const{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionMode:s}=e;return{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionModeIsChecked:s===yN.Full}},Se),fhe=je((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Lr(),s=te(),{shouldAnimateEdges:i,shouldValidateGraph:l,shouldSnapToGrid:u,shouldColorEdges:p,selectionModeIsChecked:m}=W(dhe),h=d.useCallback(S=>{s(CN(S.target.checked))},[s]),g=d.useCallback(S=>{s(wN(S.target.checked))},[s]),x=d.useCallback(S=>{s(SN(S.target.checked))},[s]),y=d.useCallback(S=>{s(kN(S.target.checked))},[s]),b=d.useCallback(S=>{s(jN(S.target.checked))},[s]),{t:w}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Fe,{ref:t,"aria-label":w("nodes.workflowSettings"),tooltip:w("nodes.workflowSettings"),icon:a.jsx(lM,{}),onClick:r}),a.jsxs(qi,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{children:w("nodes.workflowSettings")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsxs(L,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(cr,{size:"sm",children:"General"}),a.jsx(fn,{formLabelProps:Pu,onChange:g,isChecked:i,label:w("nodes.animatedEdges"),helperText:w("nodes.animatedEdgesHelp")}),a.jsx(Yn,{}),a.jsx(fn,{formLabelProps:Pu,isChecked:u,onChange:x,label:w("nodes.snapToGrid"),helperText:w("nodes.snapToGridHelp")}),a.jsx(Yn,{}),a.jsx(fn,{formLabelProps:Pu,isChecked:p,onChange:y,label:w("nodes.colorCodeEdges"),helperText:w("nodes.colorCodeEdgesHelp")}),a.jsx(fn,{formLabelProps:Pu,isChecked:m,onChange:b,label:w("nodes.fullyContainNodes"),helperText:w("nodes.fullyContainNodesHelp")}),a.jsx(cr,{size:"sm",pt:4,children:"Advanced"}),a.jsx(fn,{formLabelProps:Pu,isChecked:l,onChange:h,label:w("nodes.validateConnections"),helperText:w("nodes.validateConnectionsHelp")}),a.jsx(uhe,{})]})})]})]})]})}),phe=d.memo(fhe),mhe=()=>{const e=W(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs(L,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(phe,{}),e&&a.jsx(lhe,{})]})},hhe=d.memo(mhe);function ghe(){const e=te(),t=W(o=>o.nodes.nodeOpacity),{t:n}=Z(),r=d.useCallback(o=>{e(_N(o))},[e]);return a.jsx(L,{alignItems:"center",children:a.jsxs(Gb,{"aria-label":n("nodes.nodeOpacity"),value:t,min:.5,max:1,step:.01,onChange:r,orientation:"vertical",defaultValue:30,h:"calc(100% - 0.5rem)",children:[a.jsx(qb,{children:a.jsx(Xb,{})}),a.jsx(Kb,{})]})})}const vhe=()=>{const{t:e}=Z(),{zoomIn:t,zoomOut:n,fitView:r}=sb(),o=te(),s=W(m=>m.nodes.shouldShowMinimapPanel),i=d.useCallback(()=>{t()},[t]),l=d.useCallback(()=>{n()},[n]),u=d.useCallback(()=>{r()},[r]),p=d.useCallback(()=>{o(IN(!s))},[s,o]);return a.jsxs(Vt,{isAttached:!0,orientation:"vertical",children:[a.jsx(Fe,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:i,icon:a.jsx(Coe,{})}),a.jsx(Fe,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:l,icon:a.jsx(yoe,{})}),a.jsx(Fe,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:u,icon:a.jsx(cM,{})}),a.jsx(Fe,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(qJ,{})})]})},xhe=d.memo(vhe),bhe=()=>a.jsxs(L,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(xhe,{}),a.jsx(ghe,{})]}),yhe=d.memo(bhe),Che=we(m$),whe=()=>{const e=W(r=>r.nodes.shouldShowMinimapPanel),t=sa("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=sa("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx(L,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(Che,{pannable:!0,zoomable:!0,nodeBorderRadius:15,sx:{m:"0 !important",backgroundColor:"base.200 !important",borderRadius:"base",_dark:{backgroundColor:"base.500 !important"},svg:{borderRadius:"inherit"}},nodeColor:t,maskColor:n})})},She=d.memo(whe),khe=()=>{const e=W(n=>n.nodes.isReady),{t}=Z();return a.jsxs(L,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(dr,{children:e&&a.jsxs(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"relative",width:"100%",height:"100%"},children:[a.jsx(qme,{}),a.jsx(Tpe,{}),a.jsx(Qme,{}),a.jsx(ahe,{}),a.jsx(hhe,{}),a.jsx(yhe,{}),a.jsx(She,{})]})}),a.jsx(dr,{children:!e&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"absolute",width:"100%",height:"100%"},children:a.jsx(L,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(Zn,{label:t("nodes.loadingNodes"),icon:woe})})})})]})},jhe=d.memo(khe),_he=()=>a.jsx(PN,{children:a.jsx(jhe,{})}),Ihe=d.memo(_he),Phe=()=>{const{t:e}=Z(),t=te(),{data:n}=kd(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=EN({fixedCacheKey:"clearInvocationCache"}),i=d.useMemo(()=>!(n!=null&&n.size)||!r,[n==null?void 0:n.size,r]);return{clearInvocationCache:d.useCallback(async()=>{if(!i)try{await o().unwrap(),t(ct({title:e("invocationCache.clearSucceeded"),status:"success"}))}catch{t(ct({title:e("invocationCache.clearFailed"),status:"error"}))}},[i,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:i}},Ehe=()=>{const{t:e}=Z(),{clearInvocationCache:t,isDisabled:n,isLoading:r}=Phe();return a.jsx(at,{isDisabled:n,isLoading:r,onClick:t,children:e("invocationCache.clear")})},Mhe=d.memo(Ehe),Ohe=()=>{const{t:e}=Z(),t=te(),{data:n}=kd(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=MN({fixedCacheKey:"disableInvocationCache"}),i=d.useMemo(()=>!(n!=null&&n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{disableInvocationCache:d.useCallback(async()=>{if(!i)try{await o().unwrap(),t(ct({title:e("invocationCache.disableSucceeded"),status:"success"}))}catch{t(ct({title:e("invocationCache.disableFailed"),status:"error"}))}},[i,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:i}},Rhe=()=>{const{t:e}=Z(),t=te(),{data:n}=kd(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=ON({fixedCacheKey:"enableInvocationCache"}),i=d.useMemo(()=>(n==null?void 0:n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{enableInvocationCache:d.useCallback(async()=>{if(!i)try{await o().unwrap(),t(ct({title:e("invocationCache.enableSucceeded"),status:"success"}))}catch{t(ct({title:e("invocationCache.enableFailed"),status:"error"}))}},[i,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:i}},Dhe=()=>{const{t:e}=Z(),{data:t}=kd(),{enableInvocationCache:n,isDisabled:r,isLoading:o}=Rhe(),{disableInvocationCache:s,isDisabled:i,isLoading:l}=Ohe();return t!=null&&t.enabled?a.jsx(at,{isDisabled:i,isLoading:l,onClick:s,children:e("invocationCache.disable")}):a.jsx(at,{isDisabled:r,isLoading:o,onClick:n,children:e("invocationCache.enable")})},Ahe=d.memo(Dhe),The=({children:e,...t})=>a.jsx(aP,{alignItems:"center",justifyContent:"center",w:"full",h:"full",layerStyle:"second",borderRadius:"base",py:2,px:3,gap:6,flexWrap:"nowrap",...t,children:e}),c7=d.memo(The),Nhe={'&[aria-disabled="true"]':{color:"base.400",_dark:{color:"base.500"}}},$he=({label:e,value:t,isDisabled:n=!1,...r})=>a.jsxs(sP,{flexGrow:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","aria-disabled":n,sx:Nhe,...r,children:[a.jsx(iP,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:e}),a.jsx(lP,{children:t})]}),hs=d.memo($he),Lhe=()=>{const{t:e}=Z(),{data:t}=kd(void 0);return a.jsxs(c7,{children:[a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.cacheSize"),value:(t==null?void 0:t.size)??0}),a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.hits"),value:(t==null?void 0:t.hits)??0}),a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.misses"),value:(t==null?void 0:t.misses)??0}),a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.maxCacheSize"),value:(t==null?void 0:t.max_size)??0}),a.jsxs(Vt,{w:24,orientation:"vertical",size:"xs",children:[a.jsx(Mhe,{}),a.jsx(Ahe,{})]})]})},zhe=d.memo(Lhe),u7=e=>{const t=W(l=>l.system.isConnected),[n,{isLoading:r}]=Jx(),o=te(),{t:s}=Z();return{cancelQueueItem:d.useCallback(async()=>{try{await n(e).unwrap(),o(ct({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(ct({title:s("queue.cancelFailed"),status:"error"}))}},[o,e,s,n]),isLoading:r,isDisabled:!t}},d7=(e,t)=>Number(((Date.parse(t)-Date.parse(e))/1e3).toFixed(2)),R_={pending:{colorScheme:"cyan",translationKey:"queue.pending"},in_progress:{colorScheme:"yellow",translationKey:"queue.in_progress"},completed:{colorScheme:"green",translationKey:"queue.completed"},failed:{colorScheme:"red",translationKey:"queue.failed"},canceled:{colorScheme:"orange",translationKey:"queue.canceled"}},Fhe=({status:e})=>{const{t}=Z();return a.jsx(Ds,{colorScheme:R_[e].colorScheme,children:t(R_[e].translationKey)})},Bhe=d.memo(Fhe),Hhe=e=>{const t=W(u=>u.system.isConnected),{isCanceled:n}=RN({batch_id:e},{selectFromResult:({data:u})=>u?{isCanceled:(u==null?void 0:u.in_progress)===0&&(u==null?void 0:u.pending)===0}:{isCanceled:!0}}),[r,{isLoading:o}]=DN({fixedCacheKey:"cancelByBatchIds"}),s=te(),{t:i}=Z();return{cancelBatch:d.useCallback(async()=>{if(!n)try{await r({batch_ids:[e]}).unwrap(),s(ct({title:i("queue.cancelBatchSucceeded"),status:"success"}))}catch{s(ct({title:i("queue.cancelBatchFailed"),status:"error"}))}},[e,s,n,i,r]),isLoading:o,isCanceled:n,isDisabled:!t}},Vhe=({queueItemDTO:e})=>{const{session_id:t,batch_id:n,item_id:r}=e,{t:o}=Z(),{cancelBatch:s,isLoading:i,isCanceled:l}=Hhe(n),{cancelQueueItem:u,isLoading:p}=u7(r),{data:m}=AN(r),h=d.useMemo(()=>{if(!m)return o("common.loading");if(!m.completed_at||!m.started_at)return o(`queue.${m.status}`);const g=d7(m.started_at,m.completed_at);return m.status==="completed"?`${o("queue.completedIn")} ${g}${g===1?"":"s"}`:`${g}s`},[m,o]);return a.jsxs(L,{layerStyle:"third",flexDir:"column",p:2,pt:0,borderRadius:"base",gap:2,children:[a.jsxs(L,{layerStyle:"second",p:2,gap:2,justifyContent:"space-between",alignItems:"center",borderRadius:"base",h:20,children:[a.jsx(Ap,{label:o("queue.status"),data:h}),a.jsx(Ap,{label:o("queue.item"),data:r}),a.jsx(Ap,{label:o("queue.batch"),data:n}),a.jsx(Ap,{label:o("queue.session"),data:t}),a.jsxs(Vt,{size:"xs",orientation:"vertical",children:[a.jsx(at,{onClick:u,isLoading:p,isDisabled:m?["canceled","completed","failed"].includes(m.status):!0,"aria-label":o("queue.cancelItem"),icon:a.jsx(Ic,{}),colorScheme:"error",children:o("queue.cancelItem")}),a.jsx(at,{onClick:s,isLoading:i,isDisabled:l,"aria-label":o("queue.cancelBatch"),icon:a.jsx(Ic,{}),colorScheme:"error",children:o("queue.cancelBatch")})]})]}),(m==null?void 0:m.error)&&a.jsxs(L,{layerStyle:"second",p:3,gap:1,justifyContent:"space-between",alignItems:"flex-start",borderRadius:"base",flexDir:"column",children:[a.jsx(cr,{size:"sm",color:"error.500",_dark:{color:"error.400"},children:"Error"}),a.jsx("pre",{children:m.error})]}),a.jsx(L,{layerStyle:"second",h:512,w:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",children:m?a.jsx(Zd,{children:a.jsx(Ya,{label:"Queue Item",data:m})}):a.jsx(fa,{opacity:.5})})]})},Whe=d.memo(Vhe),Ap=({label:e,data:t})=>a.jsxs(L,{flexDir:"column",justifyContent:"flex-start",p:1,gap:1,overflow:"hidden",h:"full",w:"full",children:[a.jsx(cr,{size:"md",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e}),a.jsx(ve,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t})]}),vs={number:"3rem",statusBadge:"5.7rem",statusDot:2,time:"4rem",batchId:"5rem",fieldValues:"auto",actions:"auto"},D_={bg:"base.300",_dark:{bg:"base.750"}},Uhe={_hover:D_,"&[aria-selected='true']":D_},Ghe=({index:e,item:t,context:n})=>{const{t:r}=Z(),o=d.useCallback(()=>{n.toggleQueueItem(t.item_id)},[n,t.item_id]),{cancelQueueItem:s,isLoading:i}=u7(t.item_id),l=d.useCallback(h=>{h.stopPropagation(),s()},[s]),u=d.useMemo(()=>n.openQueueItems.includes(t.item_id),[n.openQueueItems,t.item_id]),p=d.useMemo(()=>!t.completed_at||!t.started_at?void 0:`${d7(t.started_at,t.completed_at)}s`,[t]),m=d.useMemo(()=>["canceled","completed","failed"].includes(t.status),[t.status]);return a.jsxs(L,{flexDir:"column","aria-selected":u,fontSize:"sm",borderRadius:"base",justifyContent:"center",sx:Uhe,"data-testid":"queue-item",children:[a.jsxs(L,{minH:9,alignItems:"center",gap:4,p:1.5,cursor:"pointer",onClick:o,children:[a.jsx(L,{w:vs.number,justifyContent:"flex-end",alignItems:"center",flexShrink:0,children:a.jsx(ve,{variant:"subtext",children:e+1})}),a.jsx(L,{w:vs.statusBadge,alignItems:"center",flexShrink:0,children:a.jsx(Bhe,{status:t.status})}),a.jsx(L,{w:vs.time,alignItems:"center",flexShrink:0,children:p||"-"}),a.jsx(L,{w:vs.batchId,flexShrink:0,children:a.jsx(ve,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",alignItems:"center",children:t.batch_id})}),a.jsx(L,{alignItems:"center",overflow:"hidden",flexGrow:1,children:t.field_values&&a.jsx(L,{gap:2,w:"full",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:t.field_values.filter(h=>h.node_path!=="metadata_accumulator").map(({node_path:h,field_name:g,value:x})=>a.jsxs(ve,{as:"span",children:[a.jsxs(ve,{as:"span",fontWeight:600,children:[h,".",g]}),": ",x]},`${t.item_id}.${h}.${g}.${x}`))})}),a.jsx(L,{alignItems:"center",w:vs.actions,pe:3,children:a.jsx(Vt,{size:"xs",variant:"ghost",children:a.jsx(Fe,{onClick:l,isDisabled:m,isLoading:i,"aria-label":r("queue.cancelItem"),icon:a.jsx(Ic,{})})})})]}),a.jsx(Id,{in:u,transition:{enter:{duration:.1},exit:{duration:.1}},unmountOnExit:!0,children:a.jsx(Whe,{queueItemDTO:t})})]})},Khe=d.memo(Ghe),qhe=d.memo(je((e,t)=>a.jsx(L,{...e,ref:t,flexDirection:"column",gap:.5,children:e.children}))),Xhe=d.memo(qhe),Qhe=()=>a.jsxs(L,{alignItems:"center",gap:4,p:1,pb:2,textTransform:"uppercase",fontWeight:700,fontSize:"xs",letterSpacing:1,children:[a.jsx(L,{w:vs.number,justifyContent:"flex-end",alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"#"})}),a.jsx(L,{ps:.5,w:vs.statusBadge,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"status"})}),a.jsx(L,{ps:.5,w:vs.time,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"time"})}),a.jsx(L,{ps:.5,w:vs.batchId,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"batch"})}),a.jsx(L,{ps:.5,w:vs.fieldValues,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"batch field values"})})]}),Yhe=d.memo(Qhe),Zhe={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},Jhe=le(xe,({queue:e})=>{const{listCursor:t,listPriority:n}=e;return{listCursor:t,listPriority:n}},Se),ege=(e,t)=>t.item_id,tge={List:Xhe},nge=(e,t,n)=>a.jsx(Khe,{index:e,item:t,context:n}),rge=()=>{const{listCursor:e,listPriority:t}=W(Jhe),n=te(),r=d.useRef(null),[o,s]=d.useState(null),[i,l]=Oy(Zhe),{t:u}=Z();d.useEffect(()=>{const{current:S}=r;return o&&S&&i({target:S,elements:{viewport:o}}),()=>{var j;return(j=l())==null?void 0:j.destroy()}},[o,i,l]);const{data:p,isLoading:m}=TN({cursor:e,priority:t}),h=d.useMemo(()=>p?NN.getSelectors().selectAll(p):[],[p]),g=d.useCallback(()=>{if(!(p!=null&&p.has_more))return;const S=h[h.length-1];S&&(n(eb(S.item_id)),n(tb(S.priority)))},[n,p==null?void 0:p.has_more,h]),[x,y]=d.useState([]),b=d.useCallback(S=>{y(j=>j.includes(S)?j.filter(_=>_!==S):[...j,S])},[]),w=d.useMemo(()=>({openQueueItems:x,toggleQueueItem:b}),[x,b]);return m?a.jsx(Lne,{}):h.length?a.jsxs(L,{w:"full",h:"full",flexDir:"column",children:[a.jsx(Yhe,{}),a.jsx(L,{ref:r,w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(Xre,{data:h,endReached:g,scrollerRef:s,itemContent:nge,computeItemKey:ege,components:tge,context:w})})]}):a.jsx(L,{w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(cr,{color:"base.400",_dark:{color:"base.500"},children:u("queue.queueEmpty")})})},oge=d.memo(rge),sge=()=>{const{data:e}=va(),{t}=Z();return a.jsxs(c7,{"data-testid":"queue-status",children:[a.jsx(hs,{label:t("queue.in_progress"),value:(e==null?void 0:e.queue.in_progress)??0}),a.jsx(hs,{label:t("queue.pending"),value:(e==null?void 0:e.queue.pending)??0}),a.jsx(hs,{label:t("queue.completed"),value:(e==null?void 0:e.queue.completed)??0}),a.jsx(hs,{label:t("queue.failed"),value:(e==null?void 0:e.queue.failed)??0}),a.jsx(hs,{label:t("queue.canceled"),value:(e==null?void 0:e.queue.canceled)??0}),a.jsx(hs,{label:t("queue.total"),value:(e==null?void 0:e.queue.total)??0})]})},age=d.memo(sge);function ige(e){return Te({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828l.645-1.937zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.734 1.734 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.734 1.734 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.734 1.734 0 0 0 3.407 2.31l.387-1.162zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L10.863.1z"}}]})(e)}const lge=()=>{const e=te(),{t}=Z(),n=W(u=>u.system.isConnected),[r,{isLoading:o}]=OI({fixedCacheKey:"pruneQueue"}),{finishedCount:s}=va(void 0,{selectFromResult:({data:u})=>u?{finishedCount:u.queue.completed+u.queue.canceled+u.queue.failed}:{finishedCount:0}}),i=d.useCallback(async()=>{if(s)try{const u=await r().unwrap();e(ct({title:t("queue.pruneSucceeded",{item_count:u.deleted}),status:"success"})),e(eb(void 0)),e(tb(void 0))}catch{e(ct({title:t("queue.pruneFailed"),status:"error"}))}},[s,r,e,t]),l=d.useMemo(()=>!n||!s,[s,n]);return{pruneQueue:i,isLoading:o,finishedCount:s,isDisabled:l}},cge=({asIconButton:e})=>{const{t}=Z(),{pruneQueue:n,isLoading:r,finishedCount:o,isDisabled:s}=lge();return a.jsx(ul,{isDisabled:s,isLoading:r,asIconButton:e,label:t("queue.prune"),tooltip:t("queue.pruneTooltip",{item_count:o}),icon:a.jsx(ige,{}),onClick:n,colorScheme:"blue"})},uge=d.memo(cge),dge=()=>{const e=Ht("pauseQueue").isFeatureEnabled,t=Ht("resumeQueue").isFeatureEnabled;return a.jsxs(L,{layerStyle:"second",borderRadius:"base",p:2,gap:2,children:[e||t?a.jsxs(Vt,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[t?a.jsx(q8,{}):a.jsx(a.Fragment,{}),e?a.jsx(H8,{}):a.jsx(a.Fragment,{})]}):a.jsx(a.Fragment,{}),a.jsxs(Vt,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[a.jsx(uge,{}),a.jsx(Qy,{})]})]})},fge=d.memo(dge),pge=()=>{const e=Ht("invocationCache").isFeatureEnabled;return a.jsxs(L,{layerStyle:"first",borderRadius:"base",w:"full",h:"full",p:2,flexDir:"column",gap:2,children:[a.jsxs(L,{gap:2,w:"full",children:[a.jsx(fge,{}),a.jsx(age,{}),e&&a.jsx(zhe,{})]}),a.jsx(Ie,{layerStyle:"second",p:2,borderRadius:"base",w:"full",h:"full",children:a.jsx(oge,{})})]})},mge=d.memo(pge),hge=()=>a.jsx(mge,{}),gge=d.memo(hge),vge=()=>a.jsx(GO,{}),xge=d.memo(vge);var Ax={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=Fw;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=Fw;e.exports=r.Konva})(Ax,Ax.exports);var bge=Ax.exports;const gd=xd(bge);var f7={exports:{}};/**
- * @license React
- * react-reconciler.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var yge=function(t){var n={},r=d,o=Tp,s=Object.assign;function i(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,v=1;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),I=Symbol.iterator;function M(c){return c===null||typeof c!="object"?null:(c=I&&c[I]||c["@@iterator"],typeof c=="function"?c:null)}function R(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case m:return"Fragment";case p:return"Portal";case g:return"Profiler";case h:return"StrictMode";case w:return"Suspense";case S:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case y:return(c.displayName||"Context")+".Consumer";case x:return(c._context.displayName||"Context")+".Provider";case b:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case j:return f=c.displayName||null,f!==null?f:R(c.type)||"Memo";case _:f=c._payload,c=c._init;try{return R(c(f))}catch{}}return null}function D(c){var f=c.type;switch(c.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=f.render,c=c.displayName||c.name||"",f.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(f);case 8:return f===h?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function A(c){var f=c,v=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(v=f.return),c=f.return;while(c)}return f.tag===3?v:null}function O(c){if(A(c)!==c)throw Error(i(188))}function T(c){var f=c.alternate;if(!f){if(f=A(c),f===null)throw Error(i(188));return f!==c?null:c}for(var v=c,C=f;;){var k=v.return;if(k===null)break;var P=k.alternate;if(P===null){if(C=k.return,C!==null){v=C;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===v)return O(k),c;if(P===C)return O(k),f;P=P.sibling}throw Error(i(188))}if(v.return!==C.return)v=k,C=P;else{for(var z=!1,ne=k.child;ne;){if(ne===v){z=!0,v=k,C=P;break}if(ne===C){z=!0,C=k,v=P;break}ne=ne.sibling}if(!z){for(ne=P.child;ne;){if(ne===v){z=!0,v=P,C=k;break}if(ne===C){z=!0,C=P,v=k;break}ne=ne.sibling}if(!z)throw Error(i(189))}}if(v.alternate!==C)throw Error(i(190))}if(v.tag!==3)throw Error(i(188));return v.stateNode.current===v?c:f}function X(c){return c=T(c),c!==null?B(c):null}function B(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=B(c);if(f!==null)return f;c=c.sibling}return null}function V(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var f=V(c);if(f!==null)return f}c=c.sibling}return null}var U=Array.isArray,N=t.getPublicInstance,$=t.getRootHostContext,q=t.getChildHostContext,F=t.prepareForCommit,Q=t.resetAfterCommit,Y=t.createInstance,se=t.appendInitialChild,ae=t.finalizeInitialChildren,re=t.prepareUpdate,G=t.shouldSetTextContent,K=t.createTextInstance,ee=t.scheduleTimeout,ce=t.cancelTimeout,J=t.noTimeout,ie=t.isPrimaryRenderer,de=t.supportsMutation,ge=t.supportsPersistence,Ce=t.supportsHydration,he=t.getInstanceFromNode,fe=t.preparePortalMount,Oe=t.getCurrentEventPriority,_e=t.detachDeletedInstance,Ne=t.supportsMicrotasks,nt=t.scheduleMicrotask,$e=t.supportsTestSelectors,Pt=t.findFiberRoot,Ze=t.getBoundingRect,ot=t.getTextContent,ye=t.isHiddenSubtree,De=t.matchAccessibilityRole,ut=t.setFocusIfFocusable,bt=t.setupIntersectionObserver,be=t.appendChild,Je=t.appendChildToContainer,lt=t.commitTextUpdate,ft=t.commitMount,Me=t.commitUpdate,Le=t.insertBefore,Ut=t.insertInContainerBefore,ke=t.removeChild,Be=t.removeChildFromContainer,ze=t.resetTextContent,Ge=t.hideInstance,pt=t.hideTextInstance,En=t.unhideInstance,Dt=t.unhideTextInstance,At=t.clearContainer,pr=t.cloneInstance,Ln=t.createContainerChildSet,kn=t.appendChildToContainerChildSet,gn=t.finalizeContainerChildren,ln=t.replaceContainerChildren,kr=t.cloneHiddenInstance,Mo=t.cloneHiddenTextInstance,mr=t.canHydrateInstance,hr=t.canHydrateTextInstance,Ns=t.canHydrateSuspenseInstance,$s=t.isSuspenseInstancePending,wa=t.isSuspenseInstanceFallback,Sa=t.getSuspenseInstanceFallbackErrorDetails,ml=t.registerSuspenseInstanceRetry,ka=t.getNextHydratableSibling,hl=t.getFirstHydratableChild,Qe=t.getFirstHydratableChildWithinContainer,Gt=t.getFirstHydratableChildWithinSuspenseInstance,zn=t.hydrateInstance,St=t.hydrateTextInstance,ja=t.hydrateSuspenseInstance,Wr=t.getNextHydratableInstanceAfterSuspenseInstance,ef=t.commitHydratedContainer,zg=t.commitHydratedSuspenseInstance,Fg=t.clearSuspenseBoundary,Fn=t.clearSuspenseBoundaryFromContainer,Ls=t.shouldDeleteUnhydratedTailInstances,tf=t.didNotMatchHydratedContainerTextInstance,gl=t.didNotMatchHydratedTextInstance,Zc;function hi(c){if(Zc===void 0)try{throw Error()}catch(v){var f=v.stack.trim().match(/\n( *(at )?)/);Zc=f&&f[1]||""}return`
-`+Zc+c}var Jc=!1;function eu(c,f){if(!c||Jc)return"";Jc=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ee){var C=Ee}Reflect.construct(c,[],f)}else{try{f.call()}catch(Ee){C=Ee}c.call(f.prototype)}else{try{throw Error()}catch(Ee){C=Ee}c()}}catch(Ee){if(Ee&&C&&typeof Ee.stack=="string"){for(var k=Ee.stack.split(`
-`),P=C.stack.split(`
-`),z=k.length-1,ne=P.length-1;1<=z&&0<=ne&&k[z]!==P[ne];)ne--;for(;1<=z&&0<=ne;z--,ne--)if(k[z]!==P[ne]){if(z!==1||ne!==1)do if(z--,ne--,0>ne||k[z]!==P[ne]){var pe=`
-`+k[z].replace(" at new "," at ");return c.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",c.displayName)),pe}while(1<=z&&0<=ne);break}}}finally{Jc=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?hi(c):""}var Bg=Object.prototype.hasOwnProperty,_a=[],rt=-1;function Mt(c){return{current:c}}function kt(c){0>rt||(c.current=_a[rt],_a[rt]=null,rt--)}function Ot(c,f){rt++,_a[rt]=c.current,c.current=f}var rr={},rn=Mt(rr),An=Mt(!1),gr=rr;function vl(c,f){var v=c.type.contextTypes;if(!v)return rr;var C=c.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===f)return C.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in v)k[P]=f[P];return C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=k),k}function jr(c){return c=c.childContextTypes,c!=null}function nf(){kt(An),kt(rn)}function v2(c,f,v){if(rn.current!==rr)throw Error(i(168));Ot(rn,f),Ot(An,v)}function x2(c,f,v){var C=c.stateNode;if(f=f.childContextTypes,typeof C.getChildContext!="function")return v;C=C.getChildContext();for(var k in C)if(!(k in f))throw Error(i(108,D(c)||"Unknown",k));return s({},v,C)}function rf(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||rr,gr=rn.current,Ot(rn,c),Ot(An,An.current),!0}function b2(c,f,v){var C=c.stateNode;if(!C)throw Error(i(169));v?(c=x2(c,f,gr),C.__reactInternalMemoizedMergedChildContext=c,kt(An),kt(rn),Ot(rn,c)):kt(An),Ot(An,v)}var Oo=Math.clz32?Math.clz32:I7,j7=Math.log,_7=Math.LN2;function I7(c){return c>>>=0,c===0?32:31-(j7(c)/_7|0)|0}var of=64,sf=4194304;function tu(c){switch(c&-c){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function af(c,f){var v=c.pendingLanes;if(v===0)return 0;var C=0,k=c.suspendedLanes,P=c.pingedLanes,z=v&268435455;if(z!==0){var ne=z&~k;ne!==0?C=tu(ne):(P&=z,P!==0&&(C=tu(P)))}else z=v&~k,z!==0?C=tu(z):P!==0&&(C=tu(P));if(C===0)return 0;if(f!==0&&f!==C&&!(f&k)&&(k=C&-C,P=f&-f,k>=P||k===16&&(P&4194240)!==0))return f;if(C&4&&(C|=v&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=C;0<f;)v=31-Oo(f),k=1<<v,C|=c[v],f&=~k;return C}function P7(c,f){switch(c){case 1:case 2:case 4:return f+250;case 8: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 f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function E7(c,f){for(var v=c.suspendedLanes,C=c.pingedLanes,k=c.expirationTimes,P=c.pendingLanes;0<P;){var z=31-Oo(P),ne=1<<z,pe=k[z];pe===-1?(!(ne&v)||ne&C)&&(k[z]=P7(ne,f)):pe<=f&&(c.expiredLanes|=ne),P&=~ne}}function Hg(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function y2(){var c=of;return of<<=1,!(of&4194240)&&(of=64),c}function Vg(c){for(var f=[],v=0;31>v;v++)f.push(c);return f}function nu(c,f,v){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Oo(f),c[f]=v}function M7(c,f){var v=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var C=c.eventTimes;for(c=c.expirationTimes;0<v;){var k=31-Oo(v),P=1<<k;f[k]=0,C[k]=-1,c[k]=-1,v&=~P}}function Wg(c,f){var v=c.entangledLanes|=f;for(c=c.entanglements;v;){var C=31-Oo(v),k=1<<C;k&f|c[C]&f&&(c[C]|=f),v&=~k}}var Nt=0;function C2(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var Ug=o.unstable_scheduleCallback,w2=o.unstable_cancelCallback,O7=o.unstable_shouldYield,R7=o.unstable_requestPaint,Gn=o.unstable_now,Gg=o.unstable_ImmediatePriority,D7=o.unstable_UserBlockingPriority,Kg=o.unstable_NormalPriority,A7=o.unstable_IdlePriority,lf=null,ss=null;function T7(c){if(ss&&typeof ss.onCommitFiberRoot=="function")try{ss.onCommitFiberRoot(lf,c,void 0,(c.current.flags&128)===128)}catch{}}function N7(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var Ro=typeof Object.is=="function"?Object.is:N7,zs=null,cf=!1,qg=!1;function S2(c){zs===null?zs=[c]:zs.push(c)}function $7(c){cf=!0,S2(c)}function as(){if(!qg&&zs!==null){qg=!0;var c=0,f=Nt;try{var v=zs;for(Nt=1;c<v.length;c++){var C=v[c];do C=C(!0);while(C!==null)}zs=null,cf=!1}catch(k){throw zs!==null&&(zs=zs.slice(c+1)),Ug(Gg,as),k}finally{Nt=f,qg=!1}}return null}var xl=[],bl=0,uf=null,df=0,so=[],ao=0,gi=null,Fs=1,Bs="";function vi(c,f){xl[bl++]=df,xl[bl++]=uf,uf=c,df=f}function k2(c,f,v){so[ao++]=Fs,so[ao++]=Bs,so[ao++]=gi,gi=c;var C=Fs;c=Bs;var k=32-Oo(C)-1;C&=~(1<<k),v+=1;var P=32-Oo(f)+k;if(30<P){var z=k-k%5;P=(C&(1<<z)-1).toString(32),C>>=z,k-=z,Fs=1<<32-Oo(f)+k|v<<k|C,Bs=P+c}else Fs=1<<P|v<<k|C,Bs=c}function Xg(c){c.return!==null&&(vi(c,1),k2(c,1,0))}function Qg(c){for(;c===uf;)uf=xl[--bl],xl[bl]=null,df=xl[--bl],xl[bl]=null;for(;c===gi;)gi=so[--ao],so[ao]=null,Bs=so[--ao],so[ao]=null,Fs=so[--ao],so[ao]=null}var Ur=null,io=null,cn=!1,ru=!1,Do=null;function j2(c,f){var v=po(5,null,null,0);v.elementType="DELETED",v.stateNode=f,v.return=c,f=c.deletions,f===null?(c.deletions=[v],c.flags|=16):f.push(v)}function _2(c,f){switch(c.tag){case 5:return f=mr(f,c.type,c.pendingProps),f!==null?(c.stateNode=f,Ur=c,io=hl(f),!0):!1;case 6:return f=hr(f,c.pendingProps),f!==null?(c.stateNode=f,Ur=c,io=null,!0):!1;case 13:if(f=Ns(f),f!==null){var v=gi!==null?{id:Fs,overflow:Bs}:null;return c.memoizedState={dehydrated:f,treeContext:v,retryLane:1073741824},v=po(18,null,null,0),v.stateNode=f,v.return=c,c.child=v,Ur=c,io=null,!0}return!1;default:return!1}}function Yg(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Zg(c){if(cn){var f=io;if(f){var v=f;if(!_2(c,f)){if(Yg(c))throw Error(i(418));f=ka(v);var C=Ur;f&&_2(c,f)?j2(C,v):(c.flags=c.flags&-4097|2,cn=!1,Ur=c)}}else{if(Yg(c))throw Error(i(418));c.flags=c.flags&-4097|2,cn=!1,Ur=c}}}function I2(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Ur=c}function ff(c){if(!Ce||c!==Ur)return!1;if(!cn)return I2(c),cn=!0,!1;if(c.tag!==3&&(c.tag!==5||Ls(c.type)&&!G(c.type,c.memoizedProps))){var f=io;if(f){if(Yg(c))throw P2(),Error(i(418));for(;f;)j2(c,f),f=ka(f)}}if(I2(c),c.tag===13){if(!Ce)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));io=Wr(c)}else io=Ur?ka(c.stateNode):null;return!0}function P2(){for(var c=io;c;)c=ka(c)}function yl(){Ce&&(io=Ur=null,ru=cn=!1)}function Jg(c){Do===null?Do=[c]:Do.push(c)}var L7=l.ReactCurrentBatchConfig;function pf(c,f){if(Ro(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var v=Object.keys(c),C=Object.keys(f);if(v.length!==C.length)return!1;for(C=0;C<v.length;C++){var k=v[C];if(!Bg.call(f,k)||!Ro(c[k],f[k]))return!1}return!0}function z7(c){switch(c.tag){case 5:return hi(c.type);case 16:return hi("Lazy");case 13:return hi("Suspense");case 19:return hi("SuspenseList");case 0:case 2:case 15:return c=eu(c.type,!1),c;case 11:return c=eu(c.type.render,!1),c;case 1:return c=eu(c.type,!0),c;default:return""}}function Ao(c,f){if(c&&c.defaultProps){f=s({},f),c=c.defaultProps;for(var v in c)f[v]===void 0&&(f[v]=c[v]);return f}return f}var mf=Mt(null),hf=null,Cl=null,e0=null;function t0(){e0=Cl=hf=null}function E2(c,f,v){ie?(Ot(mf,f._currentValue),f._currentValue=v):(Ot(mf,f._currentValue2),f._currentValue2=v)}function n0(c){var f=mf.current;kt(mf),ie?c._currentValue=f:c._currentValue2=f}function r0(c,f,v){for(;c!==null;){var C=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,C!==null&&(C.childLanes|=f)):C!==null&&(C.childLanes&f)!==f&&(C.childLanes|=f),c===v)break;c=c.return}}function wl(c,f){hf=c,e0=Cl=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(_r=!0),c.firstContext=null)}function lo(c){var f=ie?c._currentValue:c._currentValue2;if(e0!==c)if(c={context:c,memoizedValue:f,next:null},Cl===null){if(hf===null)throw Error(i(308));Cl=c,hf.dependencies={lanes:0,firstContext:c}}else Cl=Cl.next=c;return f}var xi=null;function o0(c){xi===null?xi=[c]:xi.push(c)}function M2(c,f,v,C){var k=f.interleaved;return k===null?(v.next=v,o0(f)):(v.next=k.next,k.next=v),f.interleaved=v,is(c,C)}function is(c,f){c.lanes|=f;var v=c.alternate;for(v!==null&&(v.lanes|=f),v=c,c=c.return;c!==null;)c.childLanes|=f,v=c.alternate,v!==null&&(v.childLanes|=f),v=c,c=c.return;return v.tag===3?v.stateNode:null}var Ia=!1;function s0(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function O2(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Hs(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function Pa(c,f,v){var C=c.updateQueue;if(C===null)return null;if(C=C.shared,jt&2){var k=C.pending;return k===null?f.next=f:(f.next=k.next,k.next=f),C.pending=f,is(c,v)}return k=C.interleaved,k===null?(f.next=f,o0(C)):(f.next=k.next,k.next=f),C.interleaved=f,is(c,v)}function gf(c,f,v){if(f=f.updateQueue,f!==null&&(f=f.shared,(v&4194240)!==0)){var C=f.lanes;C&=c.pendingLanes,v|=C,f.lanes=v,Wg(c,v)}}function R2(c,f){var v=c.updateQueue,C=c.alternate;if(C!==null&&(C=C.updateQueue,v===C)){var k=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var z={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?k=P=z:P=P.next=z,v=v.next}while(v!==null);P===null?k=P=f:P=P.next=f}else k=P=f;v={baseState:C.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:C.shared,effects:C.effects},c.updateQueue=v;return}c=v.lastBaseUpdate,c===null?v.firstBaseUpdate=f:c.next=f,v.lastBaseUpdate=f}function vf(c,f,v,C){var k=c.updateQueue;Ia=!1;var P=k.firstBaseUpdate,z=k.lastBaseUpdate,ne=k.shared.pending;if(ne!==null){k.shared.pending=null;var pe=ne,Ee=pe.next;pe.next=null,z===null?P=Ee:z.next=Ee,z=pe;var qe=c.alternate;qe!==null&&(qe=qe.updateQueue,ne=qe.lastBaseUpdate,ne!==z&&(ne===null?qe.firstBaseUpdate=Ee:ne.next=Ee,qe.lastBaseUpdate=pe))}if(P!==null){var vt=k.baseState;z=0,qe=Ee=pe=null,ne=P;do{var We=ne.lane,sn=ne.eventTime;if((C&We)===We){qe!==null&&(qe=qe.next={eventTime:sn,lane:0,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null});e:{var Zt=c,Er=ne;switch(We=f,sn=v,Er.tag){case 1:if(Zt=Er.payload,typeof Zt=="function"){vt=Zt.call(sn,vt,We);break e}vt=Zt;break e;case 3:Zt.flags=Zt.flags&-65537|128;case 0:if(Zt=Er.payload,We=typeof Zt=="function"?Zt.call(sn,vt,We):Zt,We==null)break e;vt=s({},vt,We);break e;case 2:Ia=!0}}ne.callback!==null&&ne.lane!==0&&(c.flags|=64,We=k.effects,We===null?k.effects=[ne]:We.push(ne))}else sn={eventTime:sn,lane:We,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},qe===null?(Ee=qe=sn,pe=vt):qe=qe.next=sn,z|=We;if(ne=ne.next,ne===null){if(ne=k.shared.pending,ne===null)break;We=ne,ne=We.next,We.next=null,k.lastBaseUpdate=We,k.shared.pending=null}}while(1);if(qe===null&&(pe=vt),k.baseState=pe,k.firstBaseUpdate=Ee,k.lastBaseUpdate=qe,f=k.shared.interleaved,f!==null){k=f;do z|=k.lane,k=k.next;while(k!==f)}else P===null&&(k.shared.lanes=0);yi|=z,c.lanes=z,c.memoizedState=vt}}function D2(c,f,v){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var C=c[f],k=C.callback;if(k!==null){if(C.callback=null,C=v,typeof k!="function")throw Error(i(191,k));k.call(C)}}}var A2=new r.Component().refs;function a0(c,f,v,C){f=c.memoizedState,v=v(C,f),v=v==null?f:s({},f,v),c.memoizedState=v,c.lanes===0&&(c.updateQueue.baseState=v)}var xf={isMounted:function(c){return(c=c._reactInternals)?A(c)===c:!1},enqueueSetState:function(c,f,v){c=c._reactInternals;var C=ir(),k=Oa(c),P=Hs(C,k);P.payload=f,v!=null&&(P.callback=v),f=Pa(c,P,k),f!==null&&(fo(f,c,k,C),gf(f,c,k))},enqueueReplaceState:function(c,f,v){c=c._reactInternals;var C=ir(),k=Oa(c),P=Hs(C,k);P.tag=1,P.payload=f,v!=null&&(P.callback=v),f=Pa(c,P,k),f!==null&&(fo(f,c,k,C),gf(f,c,k))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var v=ir(),C=Oa(c),k=Hs(v,C);k.tag=2,f!=null&&(k.callback=f),f=Pa(c,k,C),f!==null&&(fo(f,c,C,v),gf(f,c,C))}};function T2(c,f,v,C,k,P,z){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(C,P,z):f.prototype&&f.prototype.isPureReactComponent?!pf(v,C)||!pf(k,P):!0}function N2(c,f,v){var C=!1,k=rr,P=f.contextType;return typeof P=="object"&&P!==null?P=lo(P):(k=jr(f)?gr:rn.current,C=f.contextTypes,P=(C=C!=null)?vl(c,k):rr),f=new f(v,P),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=xf,c.stateNode=f,f._reactInternals=c,C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=k,c.__reactInternalMemoizedMaskedChildContext=P),f}function $2(c,f,v,C){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(v,C),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(v,C),f.state!==c&&xf.enqueueReplaceState(f,f.state,null)}function i0(c,f,v,C){var k=c.stateNode;k.props=v,k.state=c.memoizedState,k.refs=A2,s0(c);var P=f.contextType;typeof P=="object"&&P!==null?k.context=lo(P):(P=jr(f)?gr:rn.current,k.context=vl(c,P)),k.state=c.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(a0(c,f,P,v),k.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(f=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),f!==k.state&&xf.enqueueReplaceState(k,k.state,null),vf(c,v,k,C),k.state=c.memoizedState),typeof k.componentDidMount=="function"&&(c.flags|=4194308)}function ou(c,f,v){if(c=v.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(i(309));var C=v.stateNode}if(!C)throw Error(i(147,c));var k=C,P=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===P?f.ref:(f=function(z){var ne=k.refs;ne===A2&&(ne=k.refs={}),z===null?delete ne[P]:ne[P]=z},f._stringRef=P,f)}if(typeof c!="string")throw Error(i(284));if(!v._owner)throw Error(i(290,c))}return c}function bf(c,f){throw c=Object.prototype.toString.call(f),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function L2(c){var f=c._init;return f(c._payload)}function z2(c){function f(ue,oe){if(c){var me=ue.deletions;me===null?(ue.deletions=[oe],ue.flags|=16):me.push(oe)}}function v(ue,oe){if(!c)return null;for(;oe!==null;)f(ue,oe),oe=oe.sibling;return null}function C(ue,oe){for(ue=new Map;oe!==null;)oe.key!==null?ue.set(oe.key,oe):ue.set(oe.index,oe),oe=oe.sibling;return ue}function k(ue,oe){return ue=Da(ue,oe),ue.index=0,ue.sibling=null,ue}function P(ue,oe,me){return ue.index=me,c?(me=ue.alternate,me!==null?(me=me.index,me<oe?(ue.flags|=2,oe):me):(ue.flags|=2,oe)):(ue.flags|=1048576,oe)}function z(ue){return c&&ue.alternate===null&&(ue.flags|=2),ue}function ne(ue,oe,me,Ue){return oe===null||oe.tag!==6?(oe=q0(me,ue.mode,Ue),oe.return=ue,oe):(oe=k(oe,me),oe.return=ue,oe)}function pe(ue,oe,me,Ue){var it=me.type;return it===m?qe(ue,oe,me.props.children,Ue,me.key):oe!==null&&(oe.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===_&&L2(it)===oe.type)?(Ue=k(oe,me.props),Ue.ref=ou(ue,oe,me),Ue.return=ue,Ue):(Ue=Uf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=ou(ue,oe,me),Ue.return=ue,Ue)}function Ee(ue,oe,me,Ue){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==me.containerInfo||oe.stateNode.implementation!==me.implementation?(oe=X0(me,ue.mode,Ue),oe.return=ue,oe):(oe=k(oe,me.children||[]),oe.return=ue,oe)}function qe(ue,oe,me,Ue,it){return oe===null||oe.tag!==7?(oe=ki(me,ue.mode,Ue,it),oe.return=ue,oe):(oe=k(oe,me),oe.return=ue,oe)}function vt(ue,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return oe=q0(""+oe,ue.mode,me),oe.return=ue,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case u:return me=Uf(oe.type,oe.key,oe.props,null,ue.mode,me),me.ref=ou(ue,null,oe),me.return=ue,me;case p:return oe=X0(oe,ue.mode,me),oe.return=ue,oe;case _:var Ue=oe._init;return vt(ue,Ue(oe._payload),me)}if(U(oe)||M(oe))return oe=ki(oe,ue.mode,me,null),oe.return=ue,oe;bf(ue,oe)}return null}function We(ue,oe,me,Ue){var it=oe!==null?oe.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return it!==null?null:ne(ue,oe,""+me,Ue);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case u:return me.key===it?pe(ue,oe,me,Ue):null;case p:return me.key===it?Ee(ue,oe,me,Ue):null;case _:return it=me._init,We(ue,oe,it(me._payload),Ue)}if(U(me)||M(me))return it!==null?null:qe(ue,oe,me,Ue,null);bf(ue,me)}return null}function sn(ue,oe,me,Ue,it){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return ue=ue.get(me)||null,ne(oe,ue,""+Ue,it);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case u:return ue=ue.get(Ue.key===null?me:Ue.key)||null,pe(oe,ue,Ue,it);case p:return ue=ue.get(Ue.key===null?me:Ue.key)||null,Ee(oe,ue,Ue,it);case _:var Ct=Ue._init;return sn(ue,oe,me,Ct(Ue._payload),it)}if(U(Ue)||M(Ue))return ue=ue.get(me)||null,qe(oe,ue,Ue,it,null);bf(oe,Ue)}return null}function Zt(ue,oe,me,Ue){for(var it=null,Ct=null,xt=oe,$t=oe=0,Xn=null;xt!==null&&$t<me.length;$t++){xt.index>$t?(Xn=xt,xt=null):Xn=xt.sibling;var Lt=We(ue,xt,me[$t],Ue);if(Lt===null){xt===null&&(xt=Xn);break}c&&xt&&Lt.alternate===null&&f(ue,xt),oe=P(Lt,oe,$t),Ct===null?it=Lt:Ct.sibling=Lt,Ct=Lt,xt=Xn}if($t===me.length)return v(ue,xt),cn&&vi(ue,$t),it;if(xt===null){for(;$t<me.length;$t++)xt=vt(ue,me[$t],Ue),xt!==null&&(oe=P(xt,oe,$t),Ct===null?it=xt:Ct.sibling=xt,Ct=xt);return cn&&vi(ue,$t),it}for(xt=C(ue,xt);$t<me.length;$t++)Xn=sn(xt,ue,$t,me[$t],Ue),Xn!==null&&(c&&Xn.alternate!==null&&xt.delete(Xn.key===null?$t:Xn.key),oe=P(Xn,oe,$t),Ct===null?it=Xn:Ct.sibling=Xn,Ct=Xn);return c&&xt.forEach(function(Aa){return f(ue,Aa)}),cn&&vi(ue,$t),it}function Er(ue,oe,me,Ue){var it=M(me);if(typeof it!="function")throw Error(i(150));if(me=it.call(me),me==null)throw Error(i(151));for(var Ct=it=null,xt=oe,$t=oe=0,Xn=null,Lt=me.next();xt!==null&&!Lt.done;$t++,Lt=me.next()){xt.index>$t?(Xn=xt,xt=null):Xn=xt.sibling;var Aa=We(ue,xt,Lt.value,Ue);if(Aa===null){xt===null&&(xt=Xn);break}c&&xt&&Aa.alternate===null&&f(ue,xt),oe=P(Aa,oe,$t),Ct===null?it=Aa:Ct.sibling=Aa,Ct=Aa,xt=Xn}if(Lt.done)return v(ue,xt),cn&&vi(ue,$t),it;if(xt===null){for(;!Lt.done;$t++,Lt=me.next())Lt=vt(ue,Lt.value,Ue),Lt!==null&&(oe=P(Lt,oe,$t),Ct===null?it=Lt:Ct.sibling=Lt,Ct=Lt);return cn&&vi(ue,$t),it}for(xt=C(ue,xt);!Lt.done;$t++,Lt=me.next())Lt=sn(xt,ue,$t,Lt.value,Ue),Lt!==null&&(c&&Lt.alternate!==null&&xt.delete(Lt.key===null?$t:Lt.key),oe=P(Lt,oe,$t),Ct===null?it=Lt:Ct.sibling=Lt,Ct=Lt);return c&&xt.forEach(function(hR){return f(ue,hR)}),cn&&vi(ue,$t),it}function Us(ue,oe,me,Ue){if(typeof me=="object"&&me!==null&&me.type===m&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case u:e:{for(var it=me.key,Ct=oe;Ct!==null;){if(Ct.key===it){if(it=me.type,it===m){if(Ct.tag===7){v(ue,Ct.sibling),oe=k(Ct,me.props.children),oe.return=ue,ue=oe;break e}}else if(Ct.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===_&&L2(it)===Ct.type){v(ue,Ct.sibling),oe=k(Ct,me.props),oe.ref=ou(ue,Ct,me),oe.return=ue,ue=oe;break e}v(ue,Ct);break}else f(ue,Ct);Ct=Ct.sibling}me.type===m?(oe=ki(me.props.children,ue.mode,Ue,me.key),oe.return=ue,ue=oe):(Ue=Uf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=ou(ue,oe,me),Ue.return=ue,ue=Ue)}return z(ue);case p:e:{for(Ct=me.key;oe!==null;){if(oe.key===Ct)if(oe.tag===4&&oe.stateNode.containerInfo===me.containerInfo&&oe.stateNode.implementation===me.implementation){v(ue,oe.sibling),oe=k(oe,me.children||[]),oe.return=ue,ue=oe;break e}else{v(ue,oe);break}else f(ue,oe);oe=oe.sibling}oe=X0(me,ue.mode,Ue),oe.return=ue,ue=oe}return z(ue);case _:return Ct=me._init,Us(ue,oe,Ct(me._payload),Ue)}if(U(me))return Zt(ue,oe,me,Ue);if(M(me))return Er(ue,oe,me,Ue);bf(ue,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,oe!==null&&oe.tag===6?(v(ue,oe.sibling),oe=k(oe,me),oe.return=ue,ue=oe):(v(ue,oe),oe=q0(me,ue.mode,Ue),oe.return=ue,ue=oe),z(ue)):v(ue,oe)}return Us}var Sl=z2(!0),F2=z2(!1),su={},co=Mt(su),au=Mt(su),kl=Mt(su);function ls(c){if(c===su)throw Error(i(174));return c}function l0(c,f){Ot(kl,f),Ot(au,c),Ot(co,su),c=$(f),kt(co),Ot(co,c)}function jl(){kt(co),kt(au),kt(kl)}function B2(c){var f=ls(kl.current),v=ls(co.current);f=q(v,c.type,f),v!==f&&(Ot(au,c),Ot(co,f))}function c0(c){au.current===c&&(kt(co),kt(au))}var vn=Mt(0);function yf(c){for(var f=c;f!==null;){if(f.tag===13){var v=f.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||$s(v)||wa(v)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var u0=[];function d0(){for(var c=0;c<u0.length;c++){var f=u0[c];ie?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}u0.length=0}var Cf=l.ReactCurrentDispatcher,f0=l.ReactCurrentBatchConfig,bi=0,xn=null,Bn=null,Kn=null,wf=!1,iu=!1,lu=0,F7=0;function or(){throw Error(i(321))}function p0(c,f){if(f===null)return!1;for(var v=0;v<f.length&&v<c.length;v++)if(!Ro(c[v],f[v]))return!1;return!0}function m0(c,f,v,C,k,P){if(bi=P,xn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Cf.current=c===null||c.memoizedState===null?W7:U7,c=v(C,k),iu){P=0;do{if(iu=!1,lu=0,25<=P)throw Error(i(301));P+=1,Kn=Bn=null,f.updateQueue=null,Cf.current=G7,c=v(C,k)}while(iu)}if(Cf.current=jf,f=Bn!==null&&Bn.next!==null,bi=0,Kn=Bn=xn=null,wf=!1,f)throw Error(i(300));return c}function h0(){var c=lu!==0;return lu=0,c}function cs(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?xn.memoizedState=Kn=c:Kn=Kn.next=c,Kn}function uo(){if(Bn===null){var c=xn.alternate;c=c!==null?c.memoizedState:null}else c=Bn.next;var f=Kn===null?xn.memoizedState:Kn.next;if(f!==null)Kn=f,Bn=c;else{if(c===null)throw Error(i(310));Bn=c,c={memoizedState:Bn.memoizedState,baseState:Bn.baseState,baseQueue:Bn.baseQueue,queue:Bn.queue,next:null},Kn===null?xn.memoizedState=Kn=c:Kn=Kn.next=c}return Kn}function cu(c,f){return typeof f=="function"?f(c):f}function g0(c){var f=uo(),v=f.queue;if(v===null)throw Error(i(311));v.lastRenderedReducer=c;var C=Bn,k=C.baseQueue,P=v.pending;if(P!==null){if(k!==null){var z=k.next;k.next=P.next,P.next=z}C.baseQueue=k=P,v.pending=null}if(k!==null){P=k.next,C=C.baseState;var ne=z=null,pe=null,Ee=P;do{var qe=Ee.lane;if((bi&qe)===qe)pe!==null&&(pe=pe.next={lane:0,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),C=Ee.hasEagerState?Ee.eagerState:c(C,Ee.action);else{var vt={lane:qe,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};pe===null?(ne=pe=vt,z=C):pe=pe.next=vt,xn.lanes|=qe,yi|=qe}Ee=Ee.next}while(Ee!==null&&Ee!==P);pe===null?z=C:pe.next=ne,Ro(C,f.memoizedState)||(_r=!0),f.memoizedState=C,f.baseState=z,f.baseQueue=pe,v.lastRenderedState=C}if(c=v.interleaved,c!==null){k=c;do P=k.lane,xn.lanes|=P,yi|=P,k=k.next;while(k!==c)}else k===null&&(v.lanes=0);return[f.memoizedState,v.dispatch]}function v0(c){var f=uo(),v=f.queue;if(v===null)throw Error(i(311));v.lastRenderedReducer=c;var C=v.dispatch,k=v.pending,P=f.memoizedState;if(k!==null){v.pending=null;var z=k=k.next;do P=c(P,z.action),z=z.next;while(z!==k);Ro(P,f.memoizedState)||(_r=!0),f.memoizedState=P,f.baseQueue===null&&(f.baseState=P),v.lastRenderedState=P}return[P,C]}function H2(){}function V2(c,f){var v=xn,C=uo(),k=f(),P=!Ro(C.memoizedState,k);if(P&&(C.memoizedState=k,_r=!0),C=C.queue,x0(G2.bind(null,v,C,c),[c]),C.getSnapshot!==f||P||Kn!==null&&Kn.memoizedState.tag&1){if(v.flags|=2048,uu(9,U2.bind(null,v,C,k,f),void 0,null),qn===null)throw Error(i(349));bi&30||W2(v,f,k)}return k}function W2(c,f,v){c.flags|=16384,c={getSnapshot:f,value:v},f=xn.updateQueue,f===null?(f={lastEffect:null,stores:null},xn.updateQueue=f,f.stores=[c]):(v=f.stores,v===null?f.stores=[c]:v.push(c))}function U2(c,f,v,C){f.value=v,f.getSnapshot=C,K2(f)&&q2(c)}function G2(c,f,v){return v(function(){K2(f)&&q2(c)})}function K2(c){var f=c.getSnapshot;c=c.value;try{var v=f();return!Ro(c,v)}catch{return!0}}function q2(c){var f=is(c,1);f!==null&&fo(f,c,1,-1)}function X2(c){var f=cs();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cu,lastRenderedState:c},f.queue=c,c=c.dispatch=V7.bind(null,xn,c),[f.memoizedState,c]}function uu(c,f,v,C){return c={tag:c,create:f,destroy:v,deps:C,next:null},f=xn.updateQueue,f===null?(f={lastEffect:null,stores:null},xn.updateQueue=f,f.lastEffect=c.next=c):(v=f.lastEffect,v===null?f.lastEffect=c.next=c:(C=v.next,v.next=c,c.next=C,f.lastEffect=c)),c}function Q2(){return uo().memoizedState}function Sf(c,f,v,C){var k=cs();xn.flags|=c,k.memoizedState=uu(1|f,v,void 0,C===void 0?null:C)}function kf(c,f,v,C){var k=uo();C=C===void 0?null:C;var P=void 0;if(Bn!==null){var z=Bn.memoizedState;if(P=z.destroy,C!==null&&p0(C,z.deps)){k.memoizedState=uu(f,v,P,C);return}}xn.flags|=c,k.memoizedState=uu(1|f,v,P,C)}function Y2(c,f){return Sf(8390656,8,c,f)}function x0(c,f){return kf(2048,8,c,f)}function Z2(c,f){return kf(4,2,c,f)}function J2(c,f){return kf(4,4,c,f)}function eC(c,f){if(typeof f=="function")return c=c(),f(c),function(){f(null)};if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function tC(c,f,v){return v=v!=null?v.concat([c]):null,kf(4,4,eC.bind(null,f,c),v)}function b0(){}function nC(c,f){var v=uo();f=f===void 0?null:f;var C=v.memoizedState;return C!==null&&f!==null&&p0(f,C[1])?C[0]:(v.memoizedState=[c,f],c)}function rC(c,f){var v=uo();f=f===void 0?null:f;var C=v.memoizedState;return C!==null&&f!==null&&p0(f,C[1])?C[0]:(c=c(),v.memoizedState=[c,f],c)}function oC(c,f,v){return bi&21?(Ro(v,f)||(v=y2(),xn.lanes|=v,yi|=v,c.baseState=!0),f):(c.baseState&&(c.baseState=!1,_r=!0),c.memoizedState=v)}function B7(c,f){var v=Nt;Nt=v!==0&&4>v?v:4,c(!0);var C=f0.transition;f0.transition={};try{c(!1),f()}finally{Nt=v,f0.transition=C}}function sC(){return uo().memoizedState}function H7(c,f,v){var C=Oa(c);if(v={lane:C,action:v,hasEagerState:!1,eagerState:null,next:null},aC(c))iC(f,v);else if(v=M2(c,f,v,C),v!==null){var k=ir();fo(v,c,C,k),lC(v,f,C)}}function V7(c,f,v){var C=Oa(c),k={lane:C,action:v,hasEagerState:!1,eagerState:null,next:null};if(aC(c))iC(f,k);else{var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var z=f.lastRenderedState,ne=P(z,v);if(k.hasEagerState=!0,k.eagerState=ne,Ro(ne,z)){var pe=f.interleaved;pe===null?(k.next=k,o0(f)):(k.next=pe.next,pe.next=k),f.interleaved=k;return}}catch{}finally{}v=M2(c,f,k,C),v!==null&&(k=ir(),fo(v,c,C,k),lC(v,f,C))}}function aC(c){var f=c.alternate;return c===xn||f!==null&&f===xn}function iC(c,f){iu=wf=!0;var v=c.pending;v===null?f.next=f:(f.next=v.next,v.next=f),c.pending=f}function lC(c,f,v){if(v&4194240){var C=f.lanes;C&=c.pendingLanes,v|=C,f.lanes=v,Wg(c,v)}}var jf={readContext:lo,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},W7={readContext:lo,useCallback:function(c,f){return cs().memoizedState=[c,f===void 0?null:f],c},useContext:lo,useEffect:Y2,useImperativeHandle:function(c,f,v){return v=v!=null?v.concat([c]):null,Sf(4194308,4,eC.bind(null,f,c),v)},useLayoutEffect:function(c,f){return Sf(4194308,4,c,f)},useInsertionEffect:function(c,f){return Sf(4,2,c,f)},useMemo:function(c,f){var v=cs();return f=f===void 0?null:f,c=c(),v.memoizedState=[c,f],c},useReducer:function(c,f,v){var C=cs();return f=v!==void 0?v(f):f,C.memoizedState=C.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},C.queue=c,c=c.dispatch=H7.bind(null,xn,c),[C.memoizedState,c]},useRef:function(c){var f=cs();return c={current:c},f.memoizedState=c},useState:X2,useDebugValue:b0,useDeferredValue:function(c){return cs().memoizedState=c},useTransition:function(){var c=X2(!1),f=c[0];return c=B7.bind(null,c[1]),cs().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,v){var C=xn,k=cs();if(cn){if(v===void 0)throw Error(i(407));v=v()}else{if(v=f(),qn===null)throw Error(i(349));bi&30||W2(C,f,v)}k.memoizedState=v;var P={value:v,getSnapshot:f};return k.queue=P,Y2(G2.bind(null,C,P,c),[c]),C.flags|=2048,uu(9,U2.bind(null,C,P,v,f),void 0,null),v},useId:function(){var c=cs(),f=qn.identifierPrefix;if(cn){var v=Bs,C=Fs;v=(C&~(1<<32-Oo(C)-1)).toString(32)+v,f=":"+f+"R"+v,v=lu++,0<v&&(f+="H"+v.toString(32)),f+=":"}else v=F7++,f=":"+f+"r"+v.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},U7={readContext:lo,useCallback:nC,useContext:lo,useEffect:x0,useImperativeHandle:tC,useInsertionEffect:Z2,useLayoutEffect:J2,useMemo:rC,useReducer:g0,useRef:Q2,useState:function(){return g0(cu)},useDebugValue:b0,useDeferredValue:function(c){var f=uo();return oC(f,Bn.memoizedState,c)},useTransition:function(){var c=g0(cu)[0],f=uo().memoizedState;return[c,f]},useMutableSource:H2,useSyncExternalStore:V2,useId:sC,unstable_isNewReconciler:!1},G7={readContext:lo,useCallback:nC,useContext:lo,useEffect:x0,useImperativeHandle:tC,useInsertionEffect:Z2,useLayoutEffect:J2,useMemo:rC,useReducer:v0,useRef:Q2,useState:function(){return v0(cu)},useDebugValue:b0,useDeferredValue:function(c){var f=uo();return Bn===null?f.memoizedState=c:oC(f,Bn.memoizedState,c)},useTransition:function(){var c=v0(cu)[0],f=uo().memoizedState;return[c,f]},useMutableSource:H2,useSyncExternalStore:V2,useId:sC,unstable_isNewReconciler:!1};function _l(c,f){try{var v="",C=f;do v+=z7(C),C=C.return;while(C);var k=v}catch(P){k=`
-Error generating stack: `+P.message+`
-`+P.stack}return{value:c,source:f,stack:k,digest:null}}function y0(c,f,v){return{value:c,source:null,stack:v??null,digest:f??null}}function C0(c,f){try{console.error(f.value)}catch(v){setTimeout(function(){throw v})}}var K7=typeof WeakMap=="function"?WeakMap:Map;function cC(c,f,v){v=Hs(-1,v),v.tag=3,v.payload={element:null};var C=f.value;return v.callback=function(){zf||(zf=!0,B0=C),C0(c,f)},v}function uC(c,f,v){v=Hs(-1,v),v.tag=3;var C=c.type.getDerivedStateFromError;if(typeof C=="function"){var k=f.value;v.payload=function(){return C(k)},v.callback=function(){C0(c,f)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){C0(c,f),typeof C!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var z=f.stack;this.componentDidCatch(f.value,{componentStack:z!==null?z:""})}),v}function dC(c,f,v){var C=c.pingCache;if(C===null){C=c.pingCache=new K7;var k=new Set;C.set(f,k)}else k=C.get(f),k===void 0&&(k=new Set,C.set(f,k));k.has(v)||(k.add(v),c=iR.bind(null,c,f,v),f.then(c,c))}function fC(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function pC(c,f,v,C,k){return c.mode&1?(c.flags|=65536,c.lanes=k,c):(c===f?c.flags|=65536:(c.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(f=Hs(-1,1),f.tag=2,Pa(v,f,1))),v.lanes|=1),c)}var q7=l.ReactCurrentOwner,_r=!1;function vr(c,f,v,C){f.child=c===null?F2(f,null,v,C):Sl(f,c.child,v,C)}function mC(c,f,v,C,k){v=v.render;var P=f.ref;return wl(f,k),C=m0(c,f,v,C,P,k),v=h0(),c!==null&&!_r?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~k,Vs(c,f,k)):(cn&&v&&Xg(f),f.flags|=1,vr(c,f,C,k),f.child)}function hC(c,f,v,C,k){if(c===null){var P=v.type;return typeof P=="function"&&!K0(P)&&P.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(f.tag=15,f.type=P,gC(c,f,P,C,k)):(c=Uf(v.type,null,C,f,f.mode,k),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,!(c.lanes&k)){var z=P.memoizedProps;if(v=v.compare,v=v!==null?v:pf,v(z,C)&&c.ref===f.ref)return Vs(c,f,k)}return f.flags|=1,c=Da(P,C),c.ref=f.ref,c.return=f,f.child=c}function gC(c,f,v,C,k){if(c!==null){var P=c.memoizedProps;if(pf(P,C)&&c.ref===f.ref)if(_r=!1,f.pendingProps=C=P,(c.lanes&k)!==0)c.flags&131072&&(_r=!0);else return f.lanes=c.lanes,Vs(c,f,k)}return w0(c,f,v,C,k)}function vC(c,f,v){var C=f.pendingProps,k=C.children,P=c!==null?c.memoizedState:null;if(C.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(Pl,Gr),Gr|=v;else{if(!(v&1073741824))return c=P!==null?P.baseLanes|v:v,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null,transitions:null},f.updateQueue=null,Ot(Pl,Gr),Gr|=c,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=P!==null?P.baseLanes:v,Ot(Pl,Gr),Gr|=C}else P!==null?(C=P.baseLanes|v,f.memoizedState=null):C=v,Ot(Pl,Gr),Gr|=C;return vr(c,f,k,v),f.child}function xC(c,f){var v=f.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(f.flags|=512,f.flags|=2097152)}function w0(c,f,v,C,k){var P=jr(v)?gr:rn.current;return P=vl(f,P),wl(f,k),v=m0(c,f,v,C,P,k),C=h0(),c!==null&&!_r?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~k,Vs(c,f,k)):(cn&&C&&Xg(f),f.flags|=1,vr(c,f,v,k),f.child)}function bC(c,f,v,C,k){if(jr(v)){var P=!0;rf(f)}else P=!1;if(wl(f,k),f.stateNode===null)If(c,f),N2(f,v,C),i0(f,v,C,k),C=!0;else if(c===null){var z=f.stateNode,ne=f.memoizedProps;z.props=ne;var pe=z.context,Ee=v.contextType;typeof Ee=="object"&&Ee!==null?Ee=lo(Ee):(Ee=jr(v)?gr:rn.current,Ee=vl(f,Ee));var qe=v.getDerivedStateFromProps,vt=typeof qe=="function"||typeof z.getSnapshotBeforeUpdate=="function";vt||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(ne!==C||pe!==Ee)&&$2(f,z,C,Ee),Ia=!1;var We=f.memoizedState;z.state=We,vf(f,C,z,k),pe=f.memoizedState,ne!==C||We!==pe||An.current||Ia?(typeof qe=="function"&&(a0(f,v,qe,C),pe=f.memoizedState),(ne=Ia||T2(f,v,ne,C,We,pe,Ee))?(vt||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(f.flags|=4194308)):(typeof z.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=C,f.memoizedState=pe),z.props=C,z.state=pe,z.context=Ee,C=ne):(typeof z.componentDidMount=="function"&&(f.flags|=4194308),C=!1)}else{z=f.stateNode,O2(c,f),ne=f.memoizedProps,Ee=f.type===f.elementType?ne:Ao(f.type,ne),z.props=Ee,vt=f.pendingProps,We=z.context,pe=v.contextType,typeof pe=="object"&&pe!==null?pe=lo(pe):(pe=jr(v)?gr:rn.current,pe=vl(f,pe));var sn=v.getDerivedStateFromProps;(qe=typeof sn=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(ne!==vt||We!==pe)&&$2(f,z,C,pe),Ia=!1,We=f.memoizedState,z.state=We,vf(f,C,z,k);var Zt=f.memoizedState;ne!==vt||We!==Zt||An.current||Ia?(typeof sn=="function"&&(a0(f,v,sn,C),Zt=f.memoizedState),(Ee=Ia||T2(f,v,Ee,C,We,Zt,pe)||!1)?(qe||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(C,Zt,pe),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(C,Zt,pe)),typeof z.componentDidUpdate=="function"&&(f.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof z.componentDidUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=1024),f.memoizedProps=C,f.memoizedState=Zt),z.props=C,z.state=Zt,z.context=pe,C=Ee):(typeof z.componentDidUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=1024),C=!1)}return S0(c,f,v,C,P,k)}function S0(c,f,v,C,k,P){xC(c,f);var z=(f.flags&128)!==0;if(!C&&!z)return k&&b2(f,v,!1),Vs(c,f,P);C=f.stateNode,q7.current=f;var ne=z&&typeof v.getDerivedStateFromError!="function"?null:C.render();return f.flags|=1,c!==null&&z?(f.child=Sl(f,c.child,null,P),f.child=Sl(f,null,ne,P)):vr(c,f,ne,P),f.memoizedState=C.state,k&&b2(f,v,!0),f.child}function yC(c){var f=c.stateNode;f.pendingContext?v2(c,f.pendingContext,f.pendingContext!==f.context):f.context&&v2(c,f.context,!1),l0(c,f.containerInfo)}function CC(c,f,v,C,k){return yl(),Jg(k),f.flags|=256,vr(c,f,v,C),f.child}var k0={dehydrated:null,treeContext:null,retryLane:0};function j0(c){return{baseLanes:c,cachePool:null,transitions:null}}function wC(c,f,v){var C=f.pendingProps,k=vn.current,P=!1,z=(f.flags&128)!==0,ne;if((ne=z)||(ne=c!==null&&c.memoizedState===null?!1:(k&2)!==0),ne?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(k|=1),Ot(vn,k&1),c===null)return Zg(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?wa(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(z=C.children,c=C.fallback,P?(C=f.mode,P=f.child,z={mode:"hidden",children:z},!(C&1)&&P!==null?(P.childLanes=0,P.pendingProps=z):P=Gf(z,C,0,null),c=ki(c,C,v,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=j0(v),f.memoizedState=k0,c):_0(f,z));if(k=c.memoizedState,k!==null&&(ne=k.dehydrated,ne!==null))return X7(c,f,z,C,ne,k,v);if(P){P=C.fallback,z=f.mode,k=c.child,ne=k.sibling;var pe={mode:"hidden",children:C.children};return!(z&1)&&f.child!==k?(C=f.child,C.childLanes=0,C.pendingProps=pe,f.deletions=null):(C=Da(k,pe),C.subtreeFlags=k.subtreeFlags&14680064),ne!==null?P=Da(ne,P):(P=ki(P,z,v,null),P.flags|=2),P.return=f,C.return=f,C.sibling=P,f.child=C,C=P,P=f.child,z=c.child.memoizedState,z=z===null?j0(v):{baseLanes:z.baseLanes|v,cachePool:null,transitions:z.transitions},P.memoizedState=z,P.childLanes=c.childLanes&~v,f.memoizedState=k0,C}return P=c.child,c=P.sibling,C=Da(P,{mode:"visible",children:C.children}),!(f.mode&1)&&(C.lanes=v),C.return=f,C.sibling=null,c!==null&&(v=f.deletions,v===null?(f.deletions=[c],f.flags|=16):v.push(c)),f.child=C,f.memoizedState=null,C}function _0(c,f){return f=Gf({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function _f(c,f,v,C){return C!==null&&Jg(C),Sl(f,c.child,null,v),c=_0(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function X7(c,f,v,C,k,P,z){if(v)return f.flags&256?(f.flags&=-257,C=y0(Error(i(422))),_f(c,f,z,C)):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=C.fallback,k=f.mode,C=Gf({mode:"visible",children:C.children},k,0,null),P=ki(P,k,z,null),P.flags|=2,C.return=f,P.return=f,C.sibling=P,f.child=C,f.mode&1&&Sl(f,c.child,null,z),f.child.memoizedState=j0(z),f.memoizedState=k0,P);if(!(f.mode&1))return _f(c,f,z,null);if(wa(k))return C=Sa(k).digest,P=Error(i(419)),C=y0(P,C,void 0),_f(c,f,z,C);if(v=(z&c.childLanes)!==0,_r||v){if(C=qn,C!==null){switch(z&-z){case 4:k=2;break;case 16:k=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:k=32;break;case 536870912:k=268435456;break;default:k=0}k=k&(C.suspendedLanes|z)?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,is(c,k),fo(C,c,k,-1))}return G0(),C=y0(Error(i(421))),_f(c,f,z,C)}return $s(k)?(f.flags|=128,f.child=c.child,f=lR.bind(null,c),ml(k,f),null):(c=P.treeContext,Ce&&(io=Gt(k),Ur=f,cn=!0,Do=null,ru=!1,c!==null&&(so[ao++]=Fs,so[ao++]=Bs,so[ao++]=gi,Fs=c.id,Bs=c.overflow,gi=f)),f=_0(f,C.children),f.flags|=4096,f)}function SC(c,f,v){c.lanes|=f;var C=c.alternate;C!==null&&(C.lanes|=f),r0(c.return,f,v)}function I0(c,f,v,C,k){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:C,tail:v,tailMode:k}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=C,P.tail=v,P.tailMode=k)}function kC(c,f,v){var C=f.pendingProps,k=C.revealOrder,P=C.tail;if(vr(c,f,C.children,v),C=vn.current,C&2)C=C&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&SC(c,v,f);else if(c.tag===19)SC(c,v,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}C&=1}if(Ot(vn,C),!(f.mode&1))f.memoizedState=null;else switch(k){case"forwards":for(v=f.child,k=null;v!==null;)c=v.alternate,c!==null&&yf(c)===null&&(k=v),v=v.sibling;v=k,v===null?(k=f.child,f.child=null):(k=v.sibling,v.sibling=null),I0(f,!1,k,v,P);break;case"backwards":for(v=null,k=f.child,f.child=null;k!==null;){if(c=k.alternate,c!==null&&yf(c)===null){f.child=k;break}c=k.sibling,k.sibling=v,v=k,k=c}I0(f,!0,v,null,P);break;case"together":I0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function If(c,f){!(f.mode&1)&&c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2)}function Vs(c,f,v){if(c!==null&&(f.dependencies=c.dependencies),yi|=f.lanes,!(v&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(i(153));if(f.child!==null){for(c=f.child,v=Da(c,c.pendingProps),f.child=v,v.return=f;c.sibling!==null;)c=c.sibling,v=v.sibling=Da(c,c.pendingProps),v.return=f;v.sibling=null}return f.child}function Q7(c,f,v){switch(f.tag){case 3:yC(f),yl();break;case 5:B2(f);break;case 1:jr(f.type)&&rf(f);break;case 4:l0(f,f.stateNode.containerInfo);break;case 10:E2(f,f.type._context,f.memoizedProps.value);break;case 13:var C=f.memoizedState;if(C!==null)return C.dehydrated!==null?(Ot(vn,vn.current&1),f.flags|=128,null):v&f.child.childLanes?wC(c,f,v):(Ot(vn,vn.current&1),c=Vs(c,f,v),c!==null?c.sibling:null);Ot(vn,vn.current&1);break;case 19:if(C=(v&f.childLanes)!==0,c.flags&128){if(C)return kC(c,f,v);f.flags|=128}var k=f.memoizedState;if(k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Ot(vn,vn.current),C)break;return null;case 22:case 23:return f.lanes=0,vC(c,f,v)}return Vs(c,f,v)}function us(c){c.flags|=4}function jC(c,f){if(c!==null&&c.child===f.child)return!0;if(f.flags&16)return!1;for(c=f.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var du,fu,Pf,Ef;if(de)du=function(c,f){for(var v=f.child;v!==null;){if(v.tag===5||v.tag===6)se(c,v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},fu=function(){},Pf=function(c,f,v,C,k){if(c=c.memoizedProps,c!==C){var P=f.stateNode,z=ls(co.current);v=re(P,v,c,C,k,z),(f.updateQueue=v)&&us(f)}},Ef=function(c,f,v,C){v!==C&&us(f)};else if(ge){du=function(c,f,v,C){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&C&&(P=kr(P,k.type,k.memoizedProps,k)),se(c,P)}else if(k.tag===6)P=k.stateNode,v&&C&&(P=Mo(P,k.memoizedProps,k)),se(c,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),du(c,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};var _C=function(c,f,v,C){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&C&&(P=kr(P,k.type,k.memoizedProps,k)),kn(c,P)}else if(k.tag===6)P=k.stateNode,v&&C&&(P=Mo(P,k.memoizedProps,k)),kn(c,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),_C(c,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};fu=function(c,f){var v=f.stateNode;if(!jC(c,f)){c=v.containerInfo;var C=Ln(c);_C(C,f,!1,!1),v.pendingChildren=C,us(f),gn(c,C)}},Pf=function(c,f,v,C,k){var P=c.stateNode,z=c.memoizedProps;if((c=jC(c,f))&&z===C)f.stateNode=P;else{var ne=f.stateNode,pe=ls(co.current),Ee=null;z!==C&&(Ee=re(ne,v,z,C,k,pe)),c&&Ee===null?f.stateNode=P:(P=pr(P,Ee,v,z,C,f,c,ne),ae(P,v,C,k,pe)&&us(f),f.stateNode=P,c?us(f):du(P,f,!1,!1))}},Ef=function(c,f,v,C){v!==C?(c=ls(kl.current),v=ls(co.current),f.stateNode=K(C,c,v,f),us(f)):f.stateNode=c.stateNode}}else fu=function(){},Pf=function(){},Ef=function(){};function pu(c,f){if(!cn)switch(c.tailMode){case"hidden":f=c.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?c.tail=null:v.sibling=null;break;case"collapsed":v=c.tail;for(var C=null;v!==null;)v.alternate!==null&&(C=v),v=v.sibling;C===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:C.sibling=null}}function sr(c){var f=c.alternate!==null&&c.alternate.child===c.child,v=0,C=0;if(f)for(var k=c.child;k!==null;)v|=k.lanes|k.childLanes,C|=k.subtreeFlags&14680064,C|=k.flags&14680064,k.return=c,k=k.sibling;else for(k=c.child;k!==null;)v|=k.lanes|k.childLanes,C|=k.subtreeFlags,C|=k.flags,k.return=c,k=k.sibling;return c.subtreeFlags|=C,c.childLanes=v,f}function Y7(c,f,v){var C=f.pendingProps;switch(Qg(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sr(f),null;case 1:return jr(f.type)&&nf(),sr(f),null;case 3:return v=f.stateNode,jl(),kt(An),kt(rn),d0(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(c===null||c.child===null)&&(ff(f)?us(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Do!==null&&(W0(Do),Do=null))),fu(c,f),sr(f),null;case 5:c0(f),v=ls(kl.current);var k=f.type;if(c!==null&&f.stateNode!=null)Pf(c,f,k,C,v),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!C){if(f.stateNode===null)throw Error(i(166));return sr(f),null}if(c=ls(co.current),ff(f)){if(!Ce)throw Error(i(175));c=zn(f.stateNode,f.type,f.memoizedProps,v,c,f,!ru),f.updateQueue=c,c!==null&&us(f)}else{var P=Y(k,C,v,c,f);du(P,f,!1,!1),f.stateNode=P,ae(P,k,C,v,c)&&us(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return sr(f),null;case 6:if(c&&f.stateNode!=null)Ef(c,f,c.memoizedProps,C);else{if(typeof C!="string"&&f.stateNode===null)throw Error(i(166));if(c=ls(kl.current),v=ls(co.current),ff(f)){if(!Ce)throw Error(i(176));if(c=f.stateNode,v=f.memoizedProps,(C=St(c,v,f,!ru))&&(k=Ur,k!==null))switch(k.tag){case 3:tf(k.stateNode.containerInfo,c,v,(k.mode&1)!==0);break;case 5:gl(k.type,k.memoizedProps,k.stateNode,c,v,(k.mode&1)!==0)}C&&us(f)}else f.stateNode=K(C,c,v,f)}return sr(f),null;case 13:if(kt(vn),C=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(cn&&io!==null&&f.mode&1&&!(f.flags&128))P2(),yl(),f.flags|=98560,k=!1;else if(k=ff(f),C!==null&&C.dehydrated!==null){if(c===null){if(!k)throw Error(i(318));if(!Ce)throw Error(i(344));if(k=f.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(i(317));ja(k,f)}else yl(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;sr(f),k=!1}else Do!==null&&(W0(Do),Do=null),k=!0;if(!k)return f.flags&65536?f:null}return f.flags&128?(f.lanes=v,f):(v=C!==null,v!==(c!==null&&c.memoizedState!==null)&&v&&(f.child.flags|=8192,f.mode&1&&(c===null||vn.current&1?Hn===0&&(Hn=3):G0())),f.updateQueue!==null&&(f.flags|=4),sr(f),null);case 4:return jl(),fu(c,f),c===null&&fe(f.stateNode.containerInfo),sr(f),null;case 10:return n0(f.type._context),sr(f),null;case 17:return jr(f.type)&&nf(),sr(f),null;case 19:if(kt(vn),k=f.memoizedState,k===null)return sr(f),null;if(C=(f.flags&128)!==0,P=k.rendering,P===null)if(C)pu(k,!1);else{if(Hn!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(P=yf(c),P!==null){for(f.flags|=128,pu(k,!1),c=P.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=v,v=f.child;v!==null;)C=v,k=c,C.flags&=14680066,P=C.alternate,P===null?(C.childLanes=0,C.lanes=k,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=P.childLanes,C.lanes=P.lanes,C.child=P.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=P.memoizedProps,C.memoizedState=P.memoizedState,C.updateQueue=P.updateQueue,C.type=P.type,k=P.dependencies,C.dependencies=k===null?null:{lanes:k.lanes,firstContext:k.firstContext}),v=v.sibling;return Ot(vn,vn.current&1|2),f.child}c=c.sibling}k.tail!==null&&Gn()>F0&&(f.flags|=128,C=!0,pu(k,!1),f.lanes=4194304)}else{if(!C)if(c=yf(P),c!==null){if(f.flags|=128,C=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),pu(k,!0),k.tail===null&&k.tailMode==="hidden"&&!P.alternate&&!cn)return sr(f),null}else 2*Gn()-k.renderingStartTime>F0&&v!==1073741824&&(f.flags|=128,C=!0,pu(k,!1),f.lanes=4194304);k.isBackwards?(P.sibling=f.child,f.child=P):(c=k.last,c!==null?c.sibling=P:f.child=P,k.last=P)}return k.tail!==null?(f=k.tail,k.rendering=f,k.tail=f.sibling,k.renderingStartTime=Gn(),f.sibling=null,c=vn.current,Ot(vn,C?c&1|2:c&1),f):(sr(f),null);case 22:case 23:return U0(),v=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==v&&(f.flags|=8192),v&&f.mode&1?Gr&1073741824&&(sr(f),de&&f.subtreeFlags&6&&(f.flags|=8192)):sr(f),null;case 24:return null;case 25:return null}throw Error(i(156,f.tag))}function Z7(c,f){switch(Qg(f),f.tag){case 1:return jr(f.type)&&nf(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return jl(),kt(An),kt(rn),d0(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return c0(f),null;case 13:if(kt(vn),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(i(340));yl()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return kt(vn),null;case 4:return jl(),null;case 10:return n0(f.type._context),null;case 22:case 23:return U0(),null;case 24:return null;default:return null}}var Mf=!1,ar=!1,J7=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function Il(c,f){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(C){un(c,f,C)}else v.current=null}function P0(c,f,v){try{v()}catch(C){un(c,f,C)}}var IC=!1;function eR(c,f){for(F(c.containerInfo),Ke=f;Ke!==null;)if(c=Ke,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,Ke=f;else for(;Ke!==null;){c=Ke;try{var v=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var C=v.memoizedProps,k=v.memoizedState,P=c.stateNode,z=P.getSnapshotBeforeUpdate(c.elementType===c.type?C:Ao(c.type,C),k);P.__reactInternalSnapshotBeforeUpdate=z}break;case 3:de&&At(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(ne){un(c,c.return,ne)}if(f=c.sibling,f!==null){f.return=c.return,Ke=f;break}Ke=c.return}return v=IC,IC=!1,v}function mu(c,f,v){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var k=C=C.next;do{if((k.tag&c)===c){var P=k.destroy;k.destroy=void 0,P!==void 0&&P0(f,v,P)}k=k.next}while(k!==C)}}function Of(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var v=f=f.next;do{if((v.tag&c)===c){var C=v.create;v.destroy=C()}v=v.next}while(v!==f)}}function E0(c){var f=c.ref;if(f!==null){var v=c.stateNode;switch(c.tag){case 5:c=N(v);break;default:c=v}typeof f=="function"?f(c):f.current=c}}function PC(c){var f=c.alternate;f!==null&&(c.alternate=null,PC(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&_e(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function EC(c){return c.tag===5||c.tag===3||c.tag===4}function MC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||EC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function M0(c,f,v){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?Ut(v,c,f):Je(v,c);else if(C!==4&&(c=c.child,c!==null))for(M0(c,f,v),c=c.sibling;c!==null;)M0(c,f,v),c=c.sibling}function O0(c,f,v){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?Le(v,c,f):be(v,c);else if(C!==4&&(c=c.child,c!==null))for(O0(c,f,v),c=c.sibling;c!==null;)O0(c,f,v),c=c.sibling}var er=null,To=!1;function ds(c,f,v){for(v=v.child;v!==null;)R0(c,f,v),v=v.sibling}function R0(c,f,v){if(ss&&typeof ss.onCommitFiberUnmount=="function")try{ss.onCommitFiberUnmount(lf,v)}catch{}switch(v.tag){case 5:ar||Il(v,f);case 6:if(de){var C=er,k=To;er=null,ds(c,f,v),er=C,To=k,er!==null&&(To?Be(er,v.stateNode):ke(er,v.stateNode))}else ds(c,f,v);break;case 18:de&&er!==null&&(To?Fn(er,v.stateNode):Fg(er,v.stateNode));break;case 4:de?(C=er,k=To,er=v.stateNode.containerInfo,To=!0,ds(c,f,v),er=C,To=k):(ge&&(C=v.stateNode.containerInfo,k=Ln(C),ln(C,k)),ds(c,f,v));break;case 0:case 11:case 14:case 15:if(!ar&&(C=v.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){k=C=C.next;do{var P=k,z=P.destroy;P=P.tag,z!==void 0&&(P&2||P&4)&&P0(v,f,z),k=k.next}while(k!==C)}ds(c,f,v);break;case 1:if(!ar&&(Il(v,f),C=v.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=v.memoizedProps,C.state=v.memoizedState,C.componentWillUnmount()}catch(ne){un(v,f,ne)}ds(c,f,v);break;case 21:ds(c,f,v);break;case 22:v.mode&1?(ar=(C=ar)||v.memoizedState!==null,ds(c,f,v),ar=C):ds(c,f,v);break;default:ds(c,f,v)}}function OC(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new J7),f.forEach(function(C){var k=cR.bind(null,c,C);v.has(C)||(v.add(C),C.then(k,k))})}}function No(c,f){var v=f.deletions;if(v!==null)for(var C=0;C<v.length;C++){var k=v[C];try{var P=c,z=f;if(de){var ne=z;e:for(;ne!==null;){switch(ne.tag){case 5:er=ne.stateNode,To=!1;break e;case 3:er=ne.stateNode.containerInfo,To=!0;break e;case 4:er=ne.stateNode.containerInfo,To=!0;break e}ne=ne.return}if(er===null)throw Error(i(160));R0(P,z,k),er=null,To=!1}else R0(P,z,k);var pe=k.alternate;pe!==null&&(pe.return=null),k.return=null}catch(Ee){un(k,f,Ee)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)RC(f,c),f=f.sibling}function RC(c,f){var v=c.alternate,C=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(No(f,c),fs(c),C&4){try{mu(3,c,c.return),Of(3,c)}catch(We){un(c,c.return,We)}try{mu(5,c,c.return)}catch(We){un(c,c.return,We)}}break;case 1:No(f,c),fs(c),C&512&&v!==null&&Il(v,v.return);break;case 5:if(No(f,c),fs(c),C&512&&v!==null&&Il(v,v.return),de){if(c.flags&32){var k=c.stateNode;try{ze(k)}catch(We){un(c,c.return,We)}}if(C&4&&(k=c.stateNode,k!=null)){var P=c.memoizedProps;if(v=v!==null?v.memoizedProps:P,C=c.type,f=c.updateQueue,c.updateQueue=null,f!==null)try{Me(k,f,C,v,P,c)}catch(We){un(c,c.return,We)}}}break;case 6:if(No(f,c),fs(c),C&4&&de){if(c.stateNode===null)throw Error(i(162));k=c.stateNode,P=c.memoizedProps,v=v!==null?v.memoizedProps:P;try{lt(k,v,P)}catch(We){un(c,c.return,We)}}break;case 3:if(No(f,c),fs(c),C&4){if(de&&Ce&&v!==null&&v.memoizedState.isDehydrated)try{ef(f.containerInfo)}catch(We){un(c,c.return,We)}if(ge){k=f.containerInfo,P=f.pendingChildren;try{ln(k,P)}catch(We){un(c,c.return,We)}}}break;case 4:if(No(f,c),fs(c),C&4&&ge){P=c.stateNode,k=P.containerInfo,P=P.pendingChildren;try{ln(k,P)}catch(We){un(c,c.return,We)}}break;case 13:No(f,c),fs(c),k=c.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(z0=Gn())),C&4&&OC(c);break;case 22:var z=v!==null&&v.memoizedState!==null;if(c.mode&1?(ar=(v=ar)||z,No(f,c),ar=v):No(f,c),fs(c),C&8192){if(v=c.memoizedState!==null,(c.stateNode.isHidden=v)&&!z&&c.mode&1)for(Ke=c,C=c.child;C!==null;){for(f=Ke=C;Ke!==null;){z=Ke;var ne=z.child;switch(z.tag){case 0:case 11:case 14:case 15:mu(4,z,z.return);break;case 1:Il(z,z.return);var pe=z.stateNode;if(typeof pe.componentWillUnmount=="function"){var Ee=z,qe=z.return;try{var vt=Ee;pe.props=vt.memoizedProps,pe.state=vt.memoizedState,pe.componentWillUnmount()}catch(We){un(Ee,qe,We)}}break;case 5:Il(z,z.return);break;case 22:if(z.memoizedState!==null){TC(f);continue}}ne!==null?(ne.return=z,Ke=ne):TC(f)}C=C.sibling}if(de){e:if(C=null,de)for(f=c;;){if(f.tag===5){if(C===null){C=f;try{k=f.stateNode,v?Ge(k):En(f.stateNode,f.memoizedProps)}catch(We){un(c,c.return,We)}}}else if(f.tag===6){if(C===null)try{P=f.stateNode,v?pt(P):Dt(P,f.memoizedProps)}catch(We){un(c,c.return,We)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===c)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break e;for(;f.sibling===null;){if(f.return===null||f.return===c)break e;C===f&&(C=null),f=f.return}C===f&&(C=null),f.sibling.return=f.return,f=f.sibling}}}break;case 19:No(f,c),fs(c),C&4&&OC(c);break;case 21:break;default:No(f,c),fs(c)}}function fs(c){var f=c.flags;if(f&2){try{if(de){e:{for(var v=c.return;v!==null;){if(EC(v)){var C=v;break e}v=v.return}throw Error(i(160))}switch(C.tag){case 5:var k=C.stateNode;C.flags&32&&(ze(k),C.flags&=-33);var P=MC(c);O0(c,P,k);break;case 3:case 4:var z=C.stateNode.containerInfo,ne=MC(c);M0(c,ne,z);break;default:throw Error(i(161))}}}catch(pe){un(c,c.return,pe)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function tR(c,f,v){Ke=c,DC(c)}function DC(c,f,v){for(var C=(c.mode&1)!==0;Ke!==null;){var k=Ke,P=k.child;if(k.tag===22&&C){var z=k.memoizedState!==null||Mf;if(!z){var ne=k.alternate,pe=ne!==null&&ne.memoizedState!==null||ar;ne=Mf;var Ee=ar;if(Mf=z,(ar=pe)&&!Ee)for(Ke=k;Ke!==null;)z=Ke,pe=z.child,z.tag===22&&z.memoizedState!==null?NC(k):pe!==null?(pe.return=z,Ke=pe):NC(k);for(;P!==null;)Ke=P,DC(P),P=P.sibling;Ke=k,Mf=ne,ar=Ee}AC(c)}else k.subtreeFlags&8772&&P!==null?(P.return=k,Ke=P):AC(c)}}function AC(c){for(;Ke!==null;){var f=Ke;if(f.flags&8772){var v=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:ar||Of(5,f);break;case 1:var C=f.stateNode;if(f.flags&4&&!ar)if(v===null)C.componentDidMount();else{var k=f.elementType===f.type?v.memoizedProps:Ao(f.type,v.memoizedProps);C.componentDidUpdate(k,v.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&D2(f,P,C);break;case 3:var z=f.updateQueue;if(z!==null){if(v=null,f.child!==null)switch(f.child.tag){case 5:v=N(f.child.stateNode);break;case 1:v=f.child.stateNode}D2(f,z,v)}break;case 5:var ne=f.stateNode;v===null&&f.flags&4&&ft(ne,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&f.memoizedState===null){var pe=f.alternate;if(pe!==null){var Ee=pe.memoizedState;if(Ee!==null){var qe=Ee.dehydrated;qe!==null&&zg(qe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}ar||f.flags&512&&E0(f)}catch(vt){un(f,f.return,vt)}}if(f===c){Ke=null;break}if(v=f.sibling,v!==null){v.return=f.return,Ke=v;break}Ke=f.return}}function TC(c){for(;Ke!==null;){var f=Ke;if(f===c){Ke=null;break}var v=f.sibling;if(v!==null){v.return=f.return,Ke=v;break}Ke=f.return}}function NC(c){for(;Ke!==null;){var f=Ke;try{switch(f.tag){case 0:case 11:case 15:var v=f.return;try{Of(4,f)}catch(pe){un(f,v,pe)}break;case 1:var C=f.stateNode;if(typeof C.componentDidMount=="function"){var k=f.return;try{C.componentDidMount()}catch(pe){un(f,k,pe)}}var P=f.return;try{E0(f)}catch(pe){un(f,P,pe)}break;case 5:var z=f.return;try{E0(f)}catch(pe){un(f,z,pe)}}}catch(pe){un(f,f.return,pe)}if(f===c){Ke=null;break}var ne=f.sibling;if(ne!==null){ne.return=f.return,Ke=ne;break}Ke=f.return}}var Rf=0,Df=1,Af=2,Tf=3,Nf=4;if(typeof Symbol=="function"&&Symbol.for){var hu=Symbol.for;Rf=hu("selector.component"),Df=hu("selector.has_pseudo_class"),Af=hu("selector.role"),Tf=hu("selector.test_id"),Nf=hu("selector.text")}function D0(c){var f=he(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(i(364));return f}if(c=Pt(c),c===null)throw Error(i(362));return c.stateNode.current}function A0(c,f){switch(f.$$typeof){case Rf:if(c.type===f.value)return!0;break;case Df:e:{f=f.value,c=[c,0];for(var v=0;v<c.length;){var C=c[v++],k=c[v++],P=f[k];if(C.tag!==5||!ye(C)){for(;P!=null&&A0(C,P);)k++,P=f[k];if(k===f.length){f=!0;break e}else for(C=C.child;C!==null;)c.push(C,k),C=C.sibling}}f=!1}return f;case Af:if(c.tag===5&&De(c.stateNode,f.value))return!0;break;case Nf:if((c.tag===5||c.tag===6)&&(c=ot(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case Tf:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function T0(c){switch(c.$$typeof){case Rf:return"<"+(R(c.value)||"Unknown")+">";case Df:return":has("+(T0(c)||"")+")";case Af:return'[role="'+c.value+'"]';case Nf:return'"'+c.value+'"';case Tf:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function $C(c,f){var v=[];c=[c,0];for(var C=0;C<c.length;){var k=c[C++],P=c[C++],z=f[P];if(k.tag!==5||!ye(k)){for(;z!=null&&A0(k,z);)P++,z=f[P];if(P===f.length)v.push(k);else for(k=k.child;k!==null;)c.push(k,P),k=k.sibling}}return v}function N0(c,f){if(!$e)throw Error(i(363));c=D0(c),c=$C(c,f),f=[],c=Array.from(c);for(var v=0;v<c.length;){var C=c[v++];if(C.tag===5)ye(C)||f.push(C.stateNode);else for(C=C.child;C!==null;)c.push(C),C=C.sibling}return f}var nR=Math.ceil,$f=l.ReactCurrentDispatcher,$0=l.ReactCurrentOwner,Mn=l.ReactCurrentBatchConfig,jt=0,qn=null,Tn=null,tr=0,Gr=0,Pl=Mt(0),Hn=0,gu=null,yi=0,Lf=0,L0=0,vu=null,Ir=null,z0=0,F0=1/0,Ws=null;function El(){F0=Gn()+500}var zf=!1,B0=null,Ea=null,Ff=!1,Ma=null,Bf=0,xu=0,H0=null,Hf=-1,Vf=0;function ir(){return jt&6?Gn():Hf!==-1?Hf:Hf=Gn()}function Oa(c){return c.mode&1?jt&2&&tr!==0?tr&-tr:L7.transition!==null?(Vf===0&&(Vf=y2()),Vf):(c=Nt,c!==0?c:Oe()):1}function fo(c,f,v,C){if(50<xu)throw xu=0,H0=null,Error(i(185));nu(c,v,C),(!(jt&2)||c!==qn)&&(c===qn&&(!(jt&2)&&(Lf|=v),Hn===4&&Ra(c,tr)),Pr(c,C),v===1&&jt===0&&!(f.mode&1)&&(El(),cf&&as()))}function Pr(c,f){var v=c.callbackNode;E7(c,f);var C=af(c,c===qn?tr:0);if(C===0)v!==null&&w2(v),c.callbackNode=null,c.callbackPriority=0;else if(f=C&-C,c.callbackPriority!==f){if(v!=null&&w2(v),f===1)c.tag===0?$7(zC.bind(null,c)):S2(zC.bind(null,c)),Ne?nt(function(){!(jt&6)&&as()}):Ug(Gg,as),v=null;else{switch(C2(C)){case 1:v=Gg;break;case 4:v=D7;break;case 16:v=Kg;break;case 536870912:v=A7;break;default:v=Kg}v=qC(v,LC.bind(null,c))}c.callbackPriority=f,c.callbackNode=v}}function LC(c,f){if(Hf=-1,Vf=0,jt&6)throw Error(i(327));var v=c.callbackNode;if(Si()&&c.callbackNode!==v)return null;var C=af(c,c===qn?tr:0);if(C===0)return null;if(C&30||C&c.expiredLanes||f)f=Wf(c,C);else{f=C;var k=jt;jt|=2;var P=HC();(qn!==c||tr!==f)&&(Ws=null,El(),Ci(c,f));do try{sR();break}catch(ne){BC(c,ne)}while(1);t0(),$f.current=P,jt=k,Tn!==null?f=0:(qn=null,tr=0,f=Hn)}if(f!==0){if(f===2&&(k=Hg(c),k!==0&&(C=k,f=V0(c,k))),f===1)throw v=gu,Ci(c,0),Ra(c,C),Pr(c,Gn()),v;if(f===6)Ra(c,C);else{if(k=c.current.alternate,!(C&30)&&!rR(k)&&(f=Wf(c,C),f===2&&(P=Hg(c),P!==0&&(C=P,f=V0(c,P))),f===1))throw v=gu,Ci(c,0),Ra(c,C),Pr(c,Gn()),v;switch(c.finishedWork=k,c.finishedLanes=C,f){case 0:case 1:throw Error(i(345));case 2:wi(c,Ir,Ws);break;case 3:if(Ra(c,C),(C&130023424)===C&&(f=z0+500-Gn(),10<f)){if(af(c,0)!==0)break;if(k=c.suspendedLanes,(k&C)!==C){ir(),c.pingedLanes|=c.suspendedLanes&k;break}c.timeoutHandle=ee(wi.bind(null,c,Ir,Ws),f);break}wi(c,Ir,Ws);break;case 4:if(Ra(c,C),(C&4194240)===C)break;for(f=c.eventTimes,k=-1;0<C;){var z=31-Oo(C);P=1<<z,z=f[z],z>k&&(k=z),C&=~P}if(C=k,C=Gn()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*nR(C/1960))-C,10<C){c.timeoutHandle=ee(wi.bind(null,c,Ir,Ws),C);break}wi(c,Ir,Ws);break;case 5:wi(c,Ir,Ws);break;default:throw Error(i(329))}}}return Pr(c,Gn()),c.callbackNode===v?LC.bind(null,c):null}function V0(c,f){var v=vu;return c.current.memoizedState.isDehydrated&&(Ci(c,f).flags|=256),c=Wf(c,f),c!==2&&(f=Ir,Ir=v,f!==null&&W0(f)),c}function W0(c){Ir===null?Ir=c:Ir.push.apply(Ir,c)}function rR(c){for(var f=c;;){if(f.flags&16384){var v=f.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var C=0;C<v.length;C++){var k=v[C],P=k.getSnapshot;k=k.value;try{if(!Ro(P(),k))return!1}catch{return!1}}}if(v=f.child,f.subtreeFlags&16384&&v!==null)v.return=f,f=v;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Ra(c,f){for(f&=~L0,f&=~Lf,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var v=31-Oo(f),C=1<<v;c[v]=-1,f&=~C}}function zC(c){if(jt&6)throw Error(i(327));Si();var f=af(c,0);if(!(f&1))return Pr(c,Gn()),null;var v=Wf(c,f);if(c.tag!==0&&v===2){var C=Hg(c);C!==0&&(f=C,v=V0(c,C))}if(v===1)throw v=gu,Ci(c,0),Ra(c,f),Pr(c,Gn()),v;if(v===6)throw Error(i(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,wi(c,Ir,Ws),Pr(c,Gn()),null}function FC(c){Ma!==null&&Ma.tag===0&&!(jt&6)&&Si();var f=jt;jt|=1;var v=Mn.transition,C=Nt;try{if(Mn.transition=null,Nt=1,c)return c()}finally{Nt=C,Mn.transition=v,jt=f,!(jt&6)&&as()}}function U0(){Gr=Pl.current,kt(Pl)}function Ci(c,f){c.finishedWork=null,c.finishedLanes=0;var v=c.timeoutHandle;if(v!==J&&(c.timeoutHandle=J,ce(v)),Tn!==null)for(v=Tn.return;v!==null;){var C=v;switch(Qg(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&nf();break;case 3:jl(),kt(An),kt(rn),d0();break;case 5:c0(C);break;case 4:jl();break;case 13:kt(vn);break;case 19:kt(vn);break;case 10:n0(C.type._context);break;case 22:case 23:U0()}v=v.return}if(qn=c,Tn=c=Da(c.current,null),tr=Gr=f,Hn=0,gu=null,L0=Lf=yi=0,Ir=vu=null,xi!==null){for(f=0;f<xi.length;f++)if(v=xi[f],C=v.interleaved,C!==null){v.interleaved=null;var k=C.next,P=v.pending;if(P!==null){var z=P.next;P.next=k,C.next=z}v.pending=C}xi=null}return c}function BC(c,f){do{var v=Tn;try{if(t0(),Cf.current=jf,wf){for(var C=xn.memoizedState;C!==null;){var k=C.queue;k!==null&&(k.pending=null),C=C.next}wf=!1}if(bi=0,Kn=Bn=xn=null,iu=!1,lu=0,$0.current=null,v===null||v.return===null){Hn=1,gu=f,Tn=null;break}e:{var P=c,z=v.return,ne=v,pe=f;if(f=tr,ne.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ee=pe,qe=ne,vt=qe.tag;if(!(qe.mode&1)&&(vt===0||vt===11||vt===15)){var We=qe.alternate;We?(qe.updateQueue=We.updateQueue,qe.memoizedState=We.memoizedState,qe.lanes=We.lanes):(qe.updateQueue=null,qe.memoizedState=null)}var sn=fC(z);if(sn!==null){sn.flags&=-257,pC(sn,z,ne,P,f),sn.mode&1&&dC(P,Ee,f),f=sn,pe=Ee;var Zt=f.updateQueue;if(Zt===null){var Er=new Set;Er.add(pe),f.updateQueue=Er}else Zt.add(pe);break e}else{if(!(f&1)){dC(P,Ee,f),G0();break e}pe=Error(i(426))}}else if(cn&&ne.mode&1){var Us=fC(z);if(Us!==null){!(Us.flags&65536)&&(Us.flags|=256),pC(Us,z,ne,P,f),Jg(_l(pe,ne));break e}}P=pe=_l(pe,ne),Hn!==4&&(Hn=2),vu===null?vu=[P]:vu.push(P),P=z;do{switch(P.tag){case 3:P.flags|=65536,f&=-f,P.lanes|=f;var ue=cC(P,pe,f);R2(P,ue);break e;case 1:ne=pe;var oe=P.type,me=P.stateNode;if(!(P.flags&128)&&(typeof oe.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Ea===null||!Ea.has(me)))){P.flags|=65536,f&=-f,P.lanes|=f;var Ue=uC(P,ne,f);R2(P,Ue);break e}}P=P.return}while(P!==null)}WC(v)}catch(it){f=it,Tn===v&&v!==null&&(Tn=v=v.return);continue}break}while(1)}function HC(){var c=$f.current;return $f.current=jf,c===null?jf:c}function G0(){(Hn===0||Hn===3||Hn===2)&&(Hn=4),qn===null||!(yi&268435455)&&!(Lf&268435455)||Ra(qn,tr)}function Wf(c,f){var v=jt;jt|=2;var C=HC();(qn!==c||tr!==f)&&(Ws=null,Ci(c,f));do try{oR();break}catch(k){BC(c,k)}while(1);if(t0(),jt=v,$f.current=C,Tn!==null)throw Error(i(261));return qn=null,tr=0,Hn}function oR(){for(;Tn!==null;)VC(Tn)}function sR(){for(;Tn!==null&&!O7();)VC(Tn)}function VC(c){var f=KC(c.alternate,c,Gr);c.memoizedProps=c.pendingProps,f===null?WC(c):Tn=f,$0.current=null}function WC(c){var f=c;do{var v=f.alternate;if(c=f.return,f.flags&32768){if(v=Z7(v,f),v!==null){v.flags&=32767,Tn=v;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Hn=6,Tn=null;return}}else if(v=Y7(v,f,Gr),v!==null){Tn=v;return}if(f=f.sibling,f!==null){Tn=f;return}Tn=f=c}while(f!==null);Hn===0&&(Hn=5)}function wi(c,f,v){var C=Nt,k=Mn.transition;try{Mn.transition=null,Nt=1,aR(c,f,v,C)}finally{Mn.transition=k,Nt=C}return null}function aR(c,f,v,C){do Si();while(Ma!==null);if(jt&6)throw Error(i(327));v=c.finishedWork;var k=c.finishedLanes;if(v===null)return null;if(c.finishedWork=null,c.finishedLanes=0,v===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0;var P=v.lanes|v.childLanes;if(M7(c,P),c===qn&&(Tn=qn=null,tr=0),!(v.subtreeFlags&2064)&&!(v.flags&2064)||Ff||(Ff=!0,qC(Kg,function(){return Si(),null})),P=(v.flags&15990)!==0,v.subtreeFlags&15990||P){P=Mn.transition,Mn.transition=null;var z=Nt;Nt=1;var ne=jt;jt|=4,$0.current=null,eR(c,v),RC(v,c),Q(c.containerInfo),c.current=v,tR(v),R7(),jt=ne,Nt=z,Mn.transition=P}else c.current=v;if(Ff&&(Ff=!1,Ma=c,Bf=k),P=c.pendingLanes,P===0&&(Ea=null),T7(v.stateNode),Pr(c,Gn()),f!==null)for(C=c.onRecoverableError,v=0;v<f.length;v++)k=f[v],C(k.value,{componentStack:k.stack,digest:k.digest});if(zf)throw zf=!1,c=B0,B0=null,c;return Bf&1&&c.tag!==0&&Si(),P=c.pendingLanes,P&1?c===H0?xu++:(xu=0,H0=c):xu=0,as(),null}function Si(){if(Ma!==null){var c=C2(Bf),f=Mn.transition,v=Nt;try{if(Mn.transition=null,Nt=16>c?16:c,Ma===null)var C=!1;else{if(c=Ma,Ma=null,Bf=0,jt&6)throw Error(i(331));var k=jt;for(jt|=4,Ke=c.current;Ke!==null;){var P=Ke,z=P.child;if(Ke.flags&16){var ne=P.deletions;if(ne!==null){for(var pe=0;pe<ne.length;pe++){var Ee=ne[pe];for(Ke=Ee;Ke!==null;){var qe=Ke;switch(qe.tag){case 0:case 11:case 15:mu(8,qe,P)}var vt=qe.child;if(vt!==null)vt.return=qe,Ke=vt;else for(;Ke!==null;){qe=Ke;var We=qe.sibling,sn=qe.return;if(PC(qe),qe===Ee){Ke=null;break}if(We!==null){We.return=sn,Ke=We;break}Ke=sn}}}var Zt=P.alternate;if(Zt!==null){var Er=Zt.child;if(Er!==null){Zt.child=null;do{var Us=Er.sibling;Er.sibling=null,Er=Us}while(Er!==null)}}Ke=P}}if(P.subtreeFlags&2064&&z!==null)z.return=P,Ke=z;else e:for(;Ke!==null;){if(P=Ke,P.flags&2048)switch(P.tag){case 0:case 11:case 15:mu(9,P,P.return)}var ue=P.sibling;if(ue!==null){ue.return=P.return,Ke=ue;break e}Ke=P.return}}var oe=c.current;for(Ke=oe;Ke!==null;){z=Ke;var me=z.child;if(z.subtreeFlags&2064&&me!==null)me.return=z,Ke=me;else e:for(z=oe;Ke!==null;){if(ne=Ke,ne.flags&2048)try{switch(ne.tag){case 0:case 11:case 15:Of(9,ne)}}catch(it){un(ne,ne.return,it)}if(ne===z){Ke=null;break e}var Ue=ne.sibling;if(Ue!==null){Ue.return=ne.return,Ke=Ue;break e}Ke=ne.return}}if(jt=k,as(),ss&&typeof ss.onPostCommitFiberRoot=="function")try{ss.onPostCommitFiberRoot(lf,c)}catch{}C=!0}return C}finally{Nt=v,Mn.transition=f}}return!1}function UC(c,f,v){f=_l(v,f),f=cC(c,f,1),c=Pa(c,f,1),f=ir(),c!==null&&(nu(c,1,f),Pr(c,f))}function un(c,f,v){if(c.tag===3)UC(c,c,v);else for(;f!==null;){if(f.tag===3){UC(f,c,v);break}else if(f.tag===1){var C=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(Ea===null||!Ea.has(C))){c=_l(v,c),c=uC(f,c,1),f=Pa(f,c,1),c=ir(),f!==null&&(nu(f,1,c),Pr(f,c));break}}f=f.return}}function iR(c,f,v){var C=c.pingCache;C!==null&&C.delete(f),f=ir(),c.pingedLanes|=c.suspendedLanes&v,qn===c&&(tr&v)===v&&(Hn===4||Hn===3&&(tr&130023424)===tr&&500>Gn()-z0?Ci(c,0):L0|=v),Pr(c,f)}function GC(c,f){f===0&&(c.mode&1?(f=sf,sf<<=1,!(sf&130023424)&&(sf=4194304)):f=1);var v=ir();c=is(c,f),c!==null&&(nu(c,f,v),Pr(c,v))}function lR(c){var f=c.memoizedState,v=0;f!==null&&(v=f.retryLane),GC(c,v)}function cR(c,f){var v=0;switch(c.tag){case 13:var C=c.stateNode,k=c.memoizedState;k!==null&&(v=k.retryLane);break;case 19:C=c.stateNode;break;default:throw Error(i(314))}C!==null&&C.delete(f),GC(c,v)}var KC;KC=function(c,f,v){if(c!==null)if(c.memoizedProps!==f.pendingProps||An.current)_r=!0;else{if(!(c.lanes&v)&&!(f.flags&128))return _r=!1,Q7(c,f,v);_r=!!(c.flags&131072)}else _r=!1,cn&&f.flags&1048576&&k2(f,df,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;If(c,f),c=f.pendingProps;var k=vl(f,rn.current);wl(f,v),k=m0(null,f,C,c,k,v);var P=h0();return f.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,jr(C)?(P=!0,rf(f)):P=!1,f.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,s0(f),k.updater=xf,f.stateNode=k,k._reactInternals=f,i0(f,C,c,v),f=S0(null,f,C,!0,P,v)):(f.tag=0,cn&&P&&Xg(f),vr(null,f,k,v),f=f.child),f;case 16:C=f.elementType;e:{switch(If(c,f),c=f.pendingProps,k=C._init,C=k(C._payload),f.type=C,k=f.tag=dR(C),c=Ao(C,c),k){case 0:f=w0(null,f,C,c,v);break e;case 1:f=bC(null,f,C,c,v);break e;case 11:f=mC(null,f,C,c,v);break e;case 14:f=hC(null,f,C,Ao(C.type,c),v);break e}throw Error(i(306,C,""))}return f;case 0:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),w0(c,f,C,k,v);case 1:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),bC(c,f,C,k,v);case 3:e:{if(yC(f),c===null)throw Error(i(387));C=f.pendingProps,P=f.memoizedState,k=P.element,O2(c,f),vf(f,C,null,v);var z=f.memoizedState;if(C=z.element,Ce&&P.isDehydrated)if(P={element:C,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){k=_l(Error(i(423)),f),f=CC(c,f,C,v,k);break e}else if(C!==k){k=_l(Error(i(424)),f),f=CC(c,f,C,v,k);break e}else for(Ce&&(io=Qe(f.stateNode.containerInfo),Ur=f,cn=!0,Do=null,ru=!1),v=F2(f,null,C,v),f.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(yl(),C===k){f=Vs(c,f,v);break e}vr(c,f,C,v)}f=f.child}return f;case 5:return B2(f),c===null&&Zg(f),C=f.type,k=f.pendingProps,P=c!==null?c.memoizedProps:null,z=k.children,G(C,k)?z=null:P!==null&&G(C,P)&&(f.flags|=32),xC(c,f),vr(c,f,z,v),f.child;case 6:return c===null&&Zg(f),null;case 13:return wC(c,f,v);case 4:return l0(f,f.stateNode.containerInfo),C=f.pendingProps,c===null?f.child=Sl(f,null,C,v):vr(c,f,C,v),f.child;case 11:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),mC(c,f,C,k,v);case 7:return vr(c,f,f.pendingProps,v),f.child;case 8:return vr(c,f,f.pendingProps.children,v),f.child;case 12:return vr(c,f,f.pendingProps.children,v),f.child;case 10:e:{if(C=f.type._context,k=f.pendingProps,P=f.memoizedProps,z=k.value,E2(f,C,z),P!==null)if(Ro(P.value,z)){if(P.children===k.children&&!An.current){f=Vs(c,f,v);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var ne=P.dependencies;if(ne!==null){z=P.child;for(var pe=ne.firstContext;pe!==null;){if(pe.context===C){if(P.tag===1){pe=Hs(-1,v&-v),pe.tag=2;var Ee=P.updateQueue;if(Ee!==null){Ee=Ee.shared;var qe=Ee.pending;qe===null?pe.next=pe:(pe.next=qe.next,qe.next=pe),Ee.pending=pe}}P.lanes|=v,pe=P.alternate,pe!==null&&(pe.lanes|=v),r0(P.return,v,f),ne.lanes|=v;break}pe=pe.next}}else if(P.tag===10)z=P.type===f.type?null:P.child;else if(P.tag===18){if(z=P.return,z===null)throw Error(i(341));z.lanes|=v,ne=z.alternate,ne!==null&&(ne.lanes|=v),r0(z,v,f),z=P.sibling}else z=P.child;if(z!==null)z.return=P;else for(z=P;z!==null;){if(z===f){z=null;break}if(P=z.sibling,P!==null){P.return=z.return,z=P;break}z=z.return}P=z}vr(c,f,k.children,v),f=f.child}return f;case 9:return k=f.type,C=f.pendingProps.children,wl(f,v),k=lo(k),C=C(k),f.flags|=1,vr(c,f,C,v),f.child;case 14:return C=f.type,k=Ao(C,f.pendingProps),k=Ao(C.type,k),hC(c,f,C,k,v);case 15:return gC(c,f,f.type,f.pendingProps,v);case 17:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),If(c,f),f.tag=1,jr(C)?(c=!0,rf(f)):c=!1,wl(f,v),N2(f,C,k),i0(f,C,k,v),S0(null,f,C,!0,c,v);case 19:return kC(c,f,v);case 22:return vC(c,f,v)}throw Error(i(156,f.tag))};function qC(c,f){return Ug(c,f)}function uR(c,f,v,C){this.tag=c,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(c,f,v,C){return new uR(c,f,v,C)}function K0(c){return c=c.prototype,!(!c||!c.isReactComponent)}function dR(c){if(typeof c=="function")return K0(c)?1:0;if(c!=null){if(c=c.$$typeof,c===b)return 11;if(c===j)return 14}return 2}function Da(c,f){var v=c.alternate;return v===null?(v=po(c.tag,f,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=f,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&14680064,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,f=c.dependencies,v.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v}function Uf(c,f,v,C,k,P){var z=2;if(C=c,typeof c=="function")K0(c)&&(z=1);else if(typeof c=="string")z=5;else e:switch(c){case m:return ki(v.children,k,P,f);case h:z=8,k|=8;break;case g:return c=po(12,v,f,k|2),c.elementType=g,c.lanes=P,c;case w:return c=po(13,v,f,k),c.elementType=w,c.lanes=P,c;case S:return c=po(19,v,f,k),c.elementType=S,c.lanes=P,c;case E:return Gf(v,k,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case x:z=10;break e;case y:z=9;break e;case b:z=11;break e;case j:z=14;break e;case _:z=16,C=null;break e}throw Error(i(130,c==null?c:typeof c,""))}return f=po(z,v,f,k),f.elementType=c,f.type=C,f.lanes=P,f}function ki(c,f,v,C){return c=po(7,c,C,f),c.lanes=v,c}function Gf(c,f,v,C){return c=po(22,c,C,f),c.elementType=E,c.lanes=v,c.stateNode={isHidden:!1},c}function q0(c,f,v){return c=po(6,c,null,f),c.lanes=v,c}function X0(c,f,v){return f=po(4,c.children!==null?c.children:[],c.key,f),f.lanes=v,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function fR(c,f,v,C,k){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=J,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vg(0),this.expirationTimes=Vg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vg(0),this.identifierPrefix=C,this.onRecoverableError=k,Ce&&(this.mutableSourceEagerHydrationData=null)}function XC(c,f,v,C,k,P,z,ne,pe){return c=new fR(c,f,v,ne,pe),f===1?(f=1,P===!0&&(f|=8)):f=0,P=po(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:C,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},s0(P),c}function QC(c){if(!c)return rr;c=c._reactInternals;e:{if(A(c)!==c||c.tag!==1)throw Error(i(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(jr(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(i(171))}if(c.tag===1){var v=c.type;if(jr(v))return x2(c,v,f)}return f}function YC(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=X(f),c===null?null:c.stateNode}function ZC(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<f?v:f}}function Kf(c,f){ZC(c,f),(c=c.alternate)&&ZC(c,f)}function pR(c){return c=X(c),c===null?null:c.stateNode}function mR(){return null}return n.attemptContinuousHydration=function(c){if(c.tag===13){var f=is(c,134217728);if(f!==null){var v=ir();fo(f,c,134217728,v)}Kf(c,134217728)}},n.attemptDiscreteHydration=function(c){if(c.tag===13){var f=is(c,1);if(f!==null){var v=ir();fo(f,c,1,v)}Kf(c,1)}},n.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var f=Oa(c),v=is(c,f);if(v!==null){var C=ir();fo(v,c,f,C)}Kf(c,f)}},n.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var v=tu(f.pendingLanes);v!==0&&(Wg(f,v|1),Pr(f,Gn()),!(jt&6)&&(El(),as()))}break;case 13:FC(function(){var C=is(c,1);if(C!==null){var k=ir();fo(C,c,1,k)}}),Kf(c,1)}},n.batchedUpdates=function(c,f){var v=jt;jt|=1;try{return c(f)}finally{jt=v,jt===0&&(El(),cf&&as())}},n.createComponentSelector=function(c){return{$$typeof:Rf,value:c}},n.createContainer=function(c,f,v,C,k,P,z){return XC(c,f,!1,null,v,C,k,P,z)},n.createHasPseudoClassSelector=function(c){return{$$typeof:Df,value:c}},n.createHydrationContainer=function(c,f,v,C,k,P,z,ne,pe){return c=XC(v,C,!0,c,k,P,z,ne,pe),c.context=QC(null),v=c.current,C=ir(),k=Oa(v),P=Hs(C,k),P.callback=f??null,Pa(v,P,k),c.current.lanes=k,nu(c,k,C),Pr(c,C),c},n.createPortal=function(c,f,v){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:C==null?null:""+C,children:c,containerInfo:f,implementation:v}},n.createRoleSelector=function(c){return{$$typeof:Af,value:c}},n.createTestNameSelector=function(c){return{$$typeof:Tf,value:c}},n.createTextSelector=function(c){return{$$typeof:Nf,value:c}},n.deferredUpdates=function(c){var f=Nt,v=Mn.transition;try{return Mn.transition=null,Nt=16,c()}finally{Nt=f,Mn.transition=v}},n.discreteUpdates=function(c,f,v,C,k){var P=Nt,z=Mn.transition;try{return Mn.transition=null,Nt=1,c(f,v,C,k)}finally{Nt=P,Mn.transition=z,jt===0&&El()}},n.findAllNodes=N0,n.findBoundingRects=function(c,f){if(!$e)throw Error(i(363));f=N0(c,f),c=[];for(var v=0;v<f.length;v++)c.push(Ze(f[v]));for(f=c.length-1;0<f;f--){v=c[f];for(var C=v.x,k=C+v.width,P=v.y,z=P+v.height,ne=f-1;0<=ne;ne--)if(f!==ne){var pe=c[ne],Ee=pe.x,qe=Ee+pe.width,vt=pe.y,We=vt+pe.height;if(C>=Ee&&P>=vt&&k<=qe&&z<=We){c.splice(f,1);break}else if(C!==Ee||v.width!==pe.width||We<P||vt>z){if(!(P!==vt||v.height!==pe.height||qe<C||Ee>k)){Ee>C&&(pe.width+=Ee-C,pe.x=C),qe<k&&(pe.width=k-Ee),c.splice(f,1);break}}else{vt>P&&(pe.height+=vt-P,pe.y=P),We<z&&(pe.height=z-vt),c.splice(f,1);break}}}return c},n.findHostInstance=YC,n.findHostInstanceWithNoPortals=function(c){return c=T(c),c=c!==null?V(c):null,c===null?null:c.stateNode},n.findHostInstanceWithWarning=function(c){return YC(c)},n.flushControlled=function(c){var f=jt;jt|=1;var v=Mn.transition,C=Nt;try{Mn.transition=null,Nt=1,c()}finally{Nt=C,Mn.transition=v,jt=f,jt===0&&(El(),as())}},n.flushPassiveEffects=Si,n.flushSync=FC,n.focusWithin=function(c,f){if(!$e)throw Error(i(363));for(c=D0(c),f=$C(c,f),f=Array.from(f),c=0;c<f.length;){var v=f[c++];if(!ye(v)){if(v.tag===5&&ut(v.stateNode))return!0;for(v=v.child;v!==null;)f.push(v),v=v.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Nt},n.getFindAllNodesFailureDescription=function(c,f){if(!$e)throw Error(i(363));var v=0,C=[];c=[D0(c),0];for(var k=0;k<c.length;){var P=c[k++],z=c[k++],ne=f[z];if((P.tag!==5||!ye(P))&&(A0(P,ne)&&(C.push(T0(ne)),z++,z>v&&(v=z)),z<f.length))for(P=P.child;P!==null;)c.push(P,z),P=P.sibling}if(v<f.length){for(c=[];v<f.length;v++)c.push(T0(f[v]));return`findAllNodes was able to match part of the selector:
-  `+(C.join(" > ")+`
-
-No matching component was found for:
-  `)+c.join(" > ")}return null},n.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return N(c.child.stateNode);default:return c.child.stateNode}},n.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:pR,findFiberByHostInstance:c.findFiberByHostInstance||mR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{lf=f.inject(c),ss=f}catch{}c=!!f.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,f,v,C){if(!$e)throw Error(i(363));c=N0(c,f);var k=bt(c,v,C).disconnect;return{disconnect:function(){k()}}},n.registerMutableSourceForHydration=function(c,f){var v=f._getVersion;v=v(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,v]:c.mutableSourceEagerHydrationData.push(f,v)},n.runWithPriority=function(c,f){var v=Nt;try{return Nt=c,f()}finally{Nt=v}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,f,v,C){var k=f.current,P=ir(),z=Oa(k);return v=QC(v),f.context===null?f.context=v:f.pendingContext=v,f=Hs(P,z),f.payload={element:c},C=C===void 0?null:C,C!==null&&(f.callback=C),c=Pa(k,f,z),c!==null&&(fo(c,k,z,P),gf(c,k,z)),z},n};f7.exports=yge;var Cge=f7.exports;const wge=xd(Cge);var p7={exports:{}},pl={};/**
- * @license React
- * react-reconciler-constants.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */pl.ConcurrentRoot=1;pl.ContinuousEventPriority=4;pl.DefaultEventPriority=16;pl.DiscreteEventPriority=1;pl.IdleEventPriority=536870912;pl.LegacyRoot=0;p7.exports=pl;var m7=p7.exports;const A_={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let T_=!1,N_=!1;const m2=".react-konva-event",Sge=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
-Position of a node will be changed during drag&drop, so you should update state of the react app as well.
-Consider to add onDragMove or onDragEnd events.
-For more info see: https://github.com/konvajs/react-konva/issues/256
-`,kge=`ReactKonva: You are using "zIndex" attribute for a Konva node.
-react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
-For more info see: https://github.com/konvajs/react-konva/issues/194
-`,jge={};function Lg(e,t,n=jge){if(!T_&&"zIndex"in t&&(console.warn(kge),T_=!0),!N_&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Sge),N_=!0)}for(var s in n)if(!A_[s]){var i=s.slice(0,2)==="on",l=n[s]!==t[s];if(i&&l){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var m=t._useStrictMode,h={},g=!1;const x={};for(var s in t)if(!A_[s]){var i=s.slice(0,2)==="on",y=n[s]!==t[s];if(i&&y){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[s]&&(x[u]=t[s])}!i&&(t[s]!==n[s]||m&&t[s]!==e.getAttr(s))&&(g=!0,h[s]=t[s])}g&&(e.setAttrs(h),mi(e));for(var u in x)e.on(u+m2,x[u])}function mi(e){if(!$N.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const h7={},_ge={};gd.Node.prototype._applyProps=Lg;function Ige(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),mi(e)}function Pge(e,t,n){let r=gd[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}"  If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=gd.Group);const o={},s={};for(var i in t){var l=i.slice(0,2)==="on";l?s[i]=t[i]:o[i]=t[i]}const u=new r(o);return Lg(u,s),u}function Ege(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Mge(e,t,n){return!1}function Oge(e){return e}function Rge(){return null}function Dge(){return null}function Age(e,t,n,r){return _ge}function Tge(){}function Nge(e){}function $ge(e,t){return!1}function Lge(){return h7}function zge(){return h7}const Fge=setTimeout,Bge=clearTimeout,Hge=-1;function Vge(e,t){return!1}const Wge=!1,Uge=!0,Gge=!0;function Kge(e,t){t.parent===e?t.moveToTop():e.add(t),mi(e)}function qge(e,t){t.parent===e?t.moveToTop():e.add(t),mi(e)}function g7(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),mi(e)}function Xge(e,t,n){g7(e,t,n)}function Qge(e,t){t.destroy(),t.off(m2),mi(e)}function Yge(e,t){t.destroy(),t.off(m2),mi(e)}function Zge(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Jge(e,t,n){}function e0e(e,t,n,r,o){Lg(e,o,r)}function t0e(e){e.hide(),mi(e)}function n0e(e){}function r0e(e,t){(t.visible==null||t.visible)&&e.show()}function o0e(e,t){}function s0e(e){}function a0e(){}const i0e=()=>m7.DefaultEventPriority,l0e=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Kge,appendChildToContainer:qge,appendInitialChild:Ige,cancelTimeout:Bge,clearContainer:s0e,commitMount:Jge,commitTextUpdate:Zge,commitUpdate:e0e,createInstance:Pge,createTextInstance:Ege,detachDeletedInstance:a0e,finalizeInitialChildren:Mge,getChildHostContext:zge,getCurrentEventPriority:i0e,getPublicInstance:Oge,getRootHostContext:Lge,hideInstance:t0e,hideTextInstance:n0e,idlePriority:Tp.unstable_IdlePriority,insertBefore:g7,insertInContainerBefore:Xge,isPrimaryRenderer:Wge,noTimeout:Hge,now:Tp.unstable_now,prepareForCommit:Rge,preparePortalMount:Dge,prepareUpdate:Age,removeChild:Qge,removeChildFromContainer:Yge,resetAfterCommit:Tge,resetTextContent:Nge,run:Tp.unstable_runWithPriority,scheduleTimeout:Fge,shouldDeprioritizeSubtree:$ge,shouldSetTextContent:Vge,supportsMutation:Gge,unhideInstance:r0e,unhideTextInstance:o0e,warnsIfNotActing:Uge},Symbol.toStringTag,{value:"Module"}));var c0e=Object.defineProperty,u0e=Object.defineProperties,d0e=Object.getOwnPropertyDescriptors,$_=Object.getOwnPropertySymbols,f0e=Object.prototype.hasOwnProperty,p0e=Object.prototype.propertyIsEnumerable,L_=(e,t,n)=>t in e?c0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z_=(e,t)=>{for(var n in t||(t={}))f0e.call(t,n)&&L_(e,n,t[n]);if($_)for(var n of $_(t))p0e.call(t,n)&&L_(e,n,t[n]);return e},m0e=(e,t)=>u0e(e,d0e(t));function v7(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=v7(r,t,n);if(o)return o;r=t?null:r.sibling}}function x7(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const h2=x7(d.createContext(null));class b7 extends d.Component{render(){return d.createElement(h2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:F_,ReactCurrentDispatcher:B_}=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h0e(){const e=d.useContext(h2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=d.useId();return d.useMemo(()=>{for(const r of[F_==null?void 0:F_.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=v7(r,!1,s=>{let i=s.memoizedState;for(;i;){if(i.memoizedState===t)return!0;i=i.next}});if(o)return o}},[e,t])}function g0e(){var e,t;const n=h0e(),[r]=d.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==h2&&!r.has(s)&&r.set(s,(t=B_==null?void 0:B_.current)==null?void 0:t.readContext(x7(s))),o=o.return}return r}function v0e(){const e=g0e();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,m0e(z_({},r),{value:e.get(n)}))),t=>d.createElement(b7,z_({},t))),[e])}function x0e(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const b0e=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=x0e(e),s=v0e(),i=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return H.useLayoutEffect(()=>(n.current=new gd.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=Tu.createContainer(n.current,m7.LegacyRoot,!1,null),Tu.updateContainer(H.createElement(s,{},e.children),r.current),()=>{gd.isBrowser&&(i(null),Tu.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{i(n.current),Lg(n.current,e,o),Tu.updateContainer(H.createElement(s,{},e.children),r.current,null)}),H.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Eu="Layer",Ms="Group",Os="Rect",ji="Circle",fh="Line",y7="Image",y0e="Text",C0e="Transformer",Tu=wge(l0e);Tu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const w0e=H.forwardRef((e,t)=>H.createElement(b7,{},H.createElement(b0e,{...e,forwardedRef:t}))),S0e=le([Sn,Eo],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),k0e=()=>{const e=te(),{tool:t,isStaging:n,isMovingBoundingBox:r}=W(S0e);return{handleDragStart:d.useCallback(()=>{(t==="move"||n)&&!r&&e(tm(!0))},[e,r,n,t]),handleDragMove:d.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(VI(s))},[e,r,n,t]),handleDragEnd:d.useCallback(()=>{(t==="move"||n)&&!r&&e(tm(!1))},[e,r,n,t])}},j0e=le([Sn,Jn,Eo],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:l,shouldSnapToGrid:u}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:l,shouldSnapToGrid:u}},{memoizeOptions:{resultEqualityCheck:Bt}}),_0e=()=>{const e=te(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=W(j0e),l=d.useRef(null),u=WI(),p=()=>e(UI());et(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const m=()=>e(cb(!s));et(["h"],()=>{m()},{enabled:()=>!o,preventDefault:!0},[s]),et(["n"],()=>{e(nm(!i))},{enabled:!0,preventDefault:!0},[i]),et("esc",()=>{e(LN())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(zN(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),et(["space"],h=>{h.repeat||(u==null||u.container().focus(),r!=="move"&&(l.current=r,e(oc("move"))),r==="move"&&l.current&&l.current!=="move"&&(e(oc(l.current)),l.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},g2=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},C7=()=>{const e=te(),t=v1(),n=WI();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=FN.pixelRatio,[s,i,l,u]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;u&&s&&i&&l&&e(BN({r:s,g:i,b:l,a:u}))},commitColorUnderCursor:()=>{e(HN())}}},I0e=le([Jn,Sn,Eo],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),P0e=e=>{const t=te(),{tool:n,isStaging:r}=W(I0e),{commitColorUnderCursor:o}=C7();return d.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(tm(!0));return}if(n==="colorPicker"){o();return}const i=g2(e.current);i&&(s.evt.preventDefault(),t(GI(!0)),t(VN([i.x,i.y])))},[e,n,r,t,o])},E0e=le([Jn,Sn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),M0e=(e,t,n)=>{const r=te(),{isDrawing:o,tool:s,isStaging:i}=W(E0e),{updateColorUnderCursor:l}=C7();return d.useCallback(()=>{if(!e.current)return;const u=g2(e.current);if(u){if(r(WN(u)),n.current=u,s==="colorPicker"){l();return}!o||s==="move"||i||(t.current=!0,r(KI([u.x,u.y])))}},[t,r,o,i,n,e,s,l])},O0e=()=>{const e=te();return d.useCallback(()=>{e(UN())},[e])},R0e=le([Jn,Sn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),D0e=(e,t)=>{const n=te(),{tool:r,isDrawing:o,isStaging:s}=W(R0e);return d.useCallback(()=>{if(r==="move"||s){n(tm(!1));return}if(!t.current&&o&&e.current){const i=g2(e.current);if(!i)return;n(KI([i.x,i.y]))}else t.current=!1;n(GI(!1))},[t,n,o,s,e,r])},A0e=le([Sn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),T0e=e=>{const t=te(),{isMoveStageKeyHeld:n,stageScale:r}=W(A0e);return d.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const i={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let l=o.evt.deltaY;o.evt.ctrlKey&&(l=-l);const u=Bi(r*qN**l,KN,GN),p={x:s.x-i.x*u,y:s.y-i.y*u};t(XN(u)),t(VI(p))},[e,n,r,t])},N0e=le(Sn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),$0e=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(N0e);return a.jsxs(Ms,{children:[a.jsx(Os,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),a.jsx(Os,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},L0e=d.memo($0e),z0e=le([Sn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),F0e=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=W(z0e),{colorMode:r}=ha(),[o,s]=d.useState([]),[i,l]=Ho("colors",["base.800","base.200"]),u=d.useCallback(p=>p/e,[e]);return d.useLayoutEffect(()=>{const{width:p,height:m}=n,{x:h,y:g}=t,x={x1:0,y1:0,x2:p,y2:m,offset:{x:u(h),y:u(g)}},y={x:Math.ceil(u(h)/64)*64,y:Math.ceil(u(g)/64)*64},b={x1:-y.x,y1:-y.y,x2:u(p)-y.x+64,y2:u(m)-y.y+64},S={x1:Math.min(x.x1,b.x1),y1:Math.min(x.y1,b.y1),x2:Math.max(x.x2,b.x2),y2:Math.max(x.y2,b.y2)},j=S.x2-S.x1,_=S.y2-S.y1,E=Math.round(j/64)+1,I=Math.round(_/64)+1,M=Bw(0,E).map(D=>a.jsx(fh,{x:S.x1+D*64,y:S.y1,points:[0,0,0,_],stroke:r==="dark"?i:l,strokeWidth:1},`x_${D}`)),R=Bw(0,I).map(D=>a.jsx(fh,{x:S.x1,y:S.y1+D*64,points:[0,0,j,0],stroke:r==="dark"?i:l,strokeWidth:1},`y_${D}`));s(M.concat(R))},[e,t,n,u,r,i,l]),a.jsx(Ms,{children:o})},B0e=d.memo(F0e),H0e=le([xe],({system:e,canvas:t})=>{const{denoiseProgress:n}=e,{boundingBox:r}=t.layerState.stagingArea,{batchIds:o}=t;return{boundingBox:r,progressImage:n&&o.includes(n.batch_id)?n.progress_image:void 0}},{memoizeOptions:{resultEqualityCheck:Bt}}),V0e=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=W(H0e),[o,s]=d.useState(null);return d.useEffect(()=>{if(!n)return;const i=new Image;i.onload=()=>{s(i)},i.src=n.dataURL},[n]),n&&r&&o?a.jsx(y7,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},W0e=d.memo(V0e),Fi=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},U0e=le(Sn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Fi(t)}}),H_=e=>`data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-  <svg width="60px" height="60px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
-  <g transform="matrix(0.5,0,0,0.5,0,0)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,2.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,7.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,10)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,12.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,15)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,17.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,20)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,22.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,25)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,27.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,30)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-2.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-7.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-10)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-12.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-15)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-17.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-20)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-22.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-25)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-27.5)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-  <g transform="matrix(0.5,0,0,0.5,0,-30)">
-      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
-  </g>
-</svg>`.replaceAll("black",e),G0e=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(U0e),[i,l]=d.useState(null),[u,p]=d.useState(0),m=d.useRef(null),h=d.useCallback(()=>{p(u+1),setTimeout(h,500)},[u]);return d.useEffect(()=>{if(i)return;const g=new Image;g.onload=()=>{l(g)},g.src=H_(n)},[i,n]),d.useEffect(()=>{i&&(i.src=H_(n))},[i,n]),d.useEffect(()=>{const g=setInterval(()=>p(x=>(x+1)%5),50);return()=>clearInterval(g)},[]),!i||!Ml(r.x)||!Ml(r.y)||!Ml(s)||!Ml(o.width)||!Ml(o.height)?null:a.jsx(Os,{ref:m,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:Ml(u)?u:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},K0e=d.memo(G0e),q0e=le([Sn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Bt}}),X0e=e=>{const{...t}=e,{objects:n}=W(q0e);return a.jsx(Ms,{listening:!1,...t,children:n.filter(QN).map((r,o)=>a.jsx(fh,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})},Q0e=d.memo(X0e);var _i=d,Y0e=function(t,n,r){const o=_i.useRef("loading"),s=_i.useRef(),[i,l]=_i.useState(0),u=_i.useRef(),p=_i.useRef(),m=_i.useRef();return(u.current!==t||p.current!==n||m.current!==r)&&(o.current="loading",s.current=void 0,u.current=t,p.current=n,m.current=r),_i.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function g(){o.current="loaded",s.current=h,l(Math.random())}function x(){o.current="failed",s.current=void 0,l(Math.random())}return h.addEventListener("load",g),h.addEventListener("error",x),n&&(h.crossOrigin=n),r&&(h.referrerPolicy=r),h.src=t,function(){h.removeEventListener("load",g),h.removeEventListener("error",x)}},[t,n,r]),[s.current,o.current]};const Z0e=xd(Y0e),J0e=({canvasImage:e})=>{const[t,n,r,o]=Ho("colors",["base.400","base.500","base.700","base.900"]),s=sa(t,n),i=sa(r,o),{t:l}=Z();return a.jsxs(Ms,{children:[a.jsx(Os,{x:e.x,y:e.y,width:e.width,height:e.height,fill:s}),a.jsx(y0e,{x:e.x,y:e.y,width:e.width,height:e.height,align:"center",verticalAlign:"middle",fontFamily:'"Inter Variable", sans-serif',fontSize:e.width/16,fontStyle:"600",text:l("common.imageFailedToLoad"),fill:i})]})},eve=d.memo(J0e),tve=e=>{const{x:t,y:n,imageName:r}=e.canvasImage,{currentData:o,isError:s}=to(r??$r.skipToken),[i,l]=Z0e((o==null?void 0:o.image_url)??"",YN.get()?"use-credentials":"anonymous");return s||l==="failed"?a.jsx(eve,{canvasImage:e.canvasImage}):a.jsx(y7,{x:t,y:n,image:i,listening:!1})},w7=d.memo(tve),nve=le([Sn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),rve=()=>{const{objects:e}=W(nve);return e?a.jsx(Ms,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(ZN(t))return a.jsx(w7,{canvasImage:t},n);if(JN(t)){const r=a.jsx(fh,{points:t.points,stroke:t.color?Fi(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?a.jsx(Ms,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(e9(t))return a.jsx(Os,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Fi(t.color)},n);if(t9(t))return a.jsx(Os,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},ove=d.memo(rve),sve=le([Sn],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:o,boundingBoxDimensions:s}=e,{selectedImageIndex:i,images:l,boundingBox:u}=t.stagingArea;return{currentStagingAreaImage:l.length>0&&i!==void 0?l[i]:void 0,isOnFirstImage:i===0,isOnLastImage:i===l.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:(u==null?void 0:u.x)??o.x,y:(u==null?void 0:u.y)??o.y,width:(u==null?void 0:u.width)??s.width,height:(u==null?void 0:u.height)??s.height}},{memoizeOptions:{resultEqualityCheck:Bt}}),ave=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:l,height:u}=W(sve);return a.jsxs(Ms,{...t,children:[r&&n&&a.jsx(w7,{canvasImage:n}),o&&a.jsxs(Ms,{children:[a.jsx(Os,{x:s,y:i,width:l,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Os,{x:s,y:i,width:l,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},ive=d.memo(ave),lve=le([Sn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentIndex:n,total:t.length,currentStagingAreaImage:t.length>0?t[n]:void 0,shouldShowStagingImage:o,shouldShowStagingOutline:r}},Se),cve=()=>{const e=te(),{currentStagingAreaImage:t,shouldShowStagingImage:n,currentIndex:r,total:o}=W(lve),{t:s}=Z(),i=d.useCallback(()=>{e(Hw(!0))},[e]),l=d.useCallback(()=>{e(Hw(!1))},[e]),u=d.useCallback(()=>e(n9()),[e]),p=d.useCallback(()=>e(r9()),[e]),m=d.useCallback(()=>e(o9()),[e]);et(["left"],u,{enabled:()=>!0,preventDefault:!0}),et(["right"],p,{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>m,{enabled:()=>!0,preventDefault:!0});const{data:h}=to((t==null?void 0:t.imageName)??$r.skipToken),g=d.useCallback(()=>{e(s9(!n))},[e,n]),x=d.useCallback(()=>{h&&e(a9({imageDTO:h}))},[e,h]),y=d.useCallback(()=>{e(i9())},[e]);return t?a.jsxs(L,{pos:"absolute",bottom:4,gap:2,w:"100%",align:"center",justify:"center",onMouseEnter:i,onMouseLeave:l,children:[a.jsxs(Vt,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Fe,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:a.jsx(IJ,{}),onClick:u,colorScheme:"accent",isDisabled:!n}),a.jsx(at,{colorScheme:"base",pointerEvents:"none",isDisabled:!n,minW:20,children:`${r+1}/${o}`}),a.jsx(Fe,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:a.jsx(PJ,{}),onClick:p,colorScheme:"accent",isDisabled:!n})]}),a.jsxs(Vt,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Fe,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(aM,{}),onClick:m,colorScheme:"accent"}),a.jsx(Fe,{tooltip:s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"aria-label":s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"data-alert":!n,icon:n?a.jsx(BJ,{}):a.jsx(FJ,{}),onClick:g,colorScheme:"accent"}),a.jsx(Fe,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),isDisabled:!h||!h.is_intermediate,icon:a.jsx(lg,{}),onClick:x,colorScheme:"accent"}),a.jsx(Fe,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:a.jsx(Ic,{}),onClick:y,colorScheme:"error",fontSize:20})]})]}):null},uve=d.memo(cve),dve=()=>{const e=W(l=>l.canvas.layerState),t=W(l=>l.canvas.boundingBoxCoordinates),n=W(l=>l.canvas.boundingBoxDimensions),r=W(l=>l.canvas.isMaskEnabled),o=W(l=>l.canvas.shouldPreserveMaskedArea),[s,i]=d.useState();return d.useEffect(()=>{i(void 0)},[e,t,n,r,o]),pee(async()=>{const l=await l9(e,t,n,r,o);if(!l)return;const{baseImageData:u,maskImageData:p}=l,m=c9(u,p);i(m)},1e3,[e,t,n,r,o]),s},fve={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},pve=()=>{const e=dve();return a.jsxs(Ie,{children:["Mode: ",e?fve[e]:"..."]})},mve=d.memo(pve),nc=e=>Math.round(e*100)/100,hve=le([Sn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${nc(n)}, ${nc(r)})`}},{memoizeOptions:{resultEqualityCheck:Bt}});function gve(){const{cursorCoordinatesString:e}=W(hve),{t}=Z();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Tx="var(--invokeai-colors-warning-500)",vve=le([Sn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:l,height:u},boundingBoxCoordinates:{x:p,y:m},stageScale:h,shouldShowCanvasDebugInfo:g,layer:x,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:b}=e;let w="inherit";return(y==="none"&&(s<512||i<512)||y==="manual"&&l*u<512*512)&&(w=Tx),{activeLayerColor:x==="mask"?Tx:"inherit",activeLayerString:x.charAt(0).toUpperCase()+x.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${nc(p)}, ${nc(m)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${l}×${u}`,canvasCoordinatesString:`${nc(r)}×${nc(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:g,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:b}},{memoizeOptions:{resultEqualityCheck:Bt}}),xve=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:l,canvasDimensionsString:u,canvasScaleString:p,shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:h,shouldPreserveMaskedArea:g}=W(vve),{t:x}=Z();return a.jsxs(L,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(mve,{}),a.jsx(Ie,{style:{color:e},children:`${x("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasScale")}: ${p}%`}),g&&a.jsx(Ie,{style:{color:Tx},children:"Preserve Masked Area: On"}),h&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.scaledBoundingBox")}: ${s}`}),m&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${x("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasDimensions")}: ${u}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasPosition")}: ${l}`}),a.jsx(gve,{})]})]})},bve=d.memo(xve),yve=le([xe],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:l,tool:u,shouldSnapToGrid:p}=e,{aspectRatio:m}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:l,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:u,hitStrokeWidth:20/o,aspectRatio:m}},{memoizeOptions:{resultEqualityCheck:Bt}}),Cve=e=>{const{...t}=e,n=te(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:l,stageScale:u,shouldSnapToGrid:p,tool:m,hitStrokeWidth:h,aspectRatio:g}=W(yve),x=d.useRef(null),y=d.useRef(null),[b,w]=d.useState(!1);d.useEffect(()=>{var B;!x.current||!y.current||(x.current.nodes([y.current]),(B=x.current.getLayer())==null||B.batchDraw())},[]);const S=64*u;et("N",()=>{n(nm(!p))});const j=d.useCallback(B=>{if(!p){n(tv({x:Math.floor(B.target.x()),y:Math.floor(B.target.y())}));return}const V=B.target.x(),U=B.target.y(),N=wr(V,64),$=wr(U,64);B.target.x(N),B.target.y($),n(tv({x:N,y:$}))},[n,p]),_=d.useCallback(()=>{if(!y.current)return;const B=y.current,V=B.scaleX(),U=B.scaleY(),N=Math.round(B.width()*V),$=Math.round(B.height()*U),q=Math.round(B.x()),F=Math.round(B.y());if(g){const Q=wr(N/g,64);n(Vo({width:N,height:Q}))}else n(Vo({width:N,height:$}));n(tv({x:p?Mu(q,64):q,y:p?Mu(F,64):F})),B.scaleX(1),B.scaleY(1)},[n,p,g]),E=d.useCallback((B,V,U)=>{const N=B.x%S,$=B.y%S;return{x:Mu(V.x,S)+N,y:Mu(V.y,S)+$}},[S]),I=d.useCallback(()=>{n(nv(!0))},[n]),M=d.useCallback(()=>{n(nv(!1)),n(rv(!1)),n(Yf(!1)),w(!1)},[n]),R=d.useCallback(()=>{n(rv(!0))},[n]),D=d.useCallback(()=>{n(nv(!1)),n(rv(!1)),n(Yf(!1)),w(!1)},[n]),A=d.useCallback(()=>{w(!0)},[]),O=d.useCallback(()=>{!l&&!i&&w(!1)},[i,l]),T=d.useCallback(()=>{n(Yf(!0))},[n]),X=d.useCallback(()=>{n(Yf(!1))},[n]);return a.jsxs(Ms,{...t,children:[a.jsx(Os,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:T,onMouseOver:T,onMouseLeave:X,onMouseOut:X}),a.jsx(Os,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:h,listening:!s&&m==="move",onDragStart:R,onDragEnd:D,onDragMove:j,onMouseDown:R,onMouseOut:O,onMouseOver:A,onMouseEnter:A,onMouseUp:D,onTransform:_,onTransformEnd:M,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/u,width:o.width,x:r.x,y:r.y}),a.jsx(C0e,{anchorCornerRadius:3,anchorDragBoundFunc:E,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:m==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&m==="move",onDragStart:R,onDragEnd:D,onMouseDown:I,onMouseUp:M,onTransformEnd:M,ref:x,rotateEnabled:!1})]})},wve=d.memo(Cve),Sve=le(Sn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:l,shouldShowBrush:u,isMovingBoundingBox:p,isTransformingBoundingBox:m,stageScale:h,stageDimensions:g,boundingBoxCoordinates:x,boundingBoxDimensions:y,shouldRestrictStrokesToBox:b}=e,w=b?{clipX:x.x,clipY:x.y,clipWidth:y.width,clipHeight:y.height}:{};return{cursorPosition:t,brushX:t?t.x:g.width/2,brushY:t?t.y:g.height/2,radius:n/2,colorPickerOuterRadius:Vw/h,colorPickerInnerRadius:(Vw-x1+1)/h,maskColorString:Fi({...o,a:.5}),brushColorString:Fi(s),colorPickerColorString:Fi(r),tool:i,layer:l,shouldShowBrush:u,shouldDrawBrushPreview:!(p||m||!t)&&u,strokeWidth:1.5/h,dotRadius:1.5/h,clip:w}},{memoizeOptions:{resultEqualityCheck:Bt}}),kve=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:l,shouldDrawBrushPreview:u,dotRadius:p,strokeWidth:m,brushColorString:h,colorPickerColorString:g,colorPickerInnerRadius:x,colorPickerOuterRadius:y,clip:b}=W(Sve);return u?a.jsxs(Ms,{listening:!1,...b,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(ji,{x:n,y:r,radius:y,stroke:h,strokeWidth:x1,strokeScaleEnabled:!1}),a.jsx(ji,{x:n,y:r,radius:x,stroke:g,strokeWidth:x1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(ji,{x:n,y:r,radius:o,fill:l==="mask"?s:h,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(ji,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:m*2,strokeEnabled:!0,listening:!1}),a.jsx(ji,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:m,strokeEnabled:!0,listening:!1})]}),a.jsx(ji,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(ji,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},jve=d.memo(kve),_ve=le([Sn,Eo],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:l,stageDimensions:u,stageCoordinates:p,tool:m,isMovingStage:h,shouldShowIntermediates:g,shouldShowGrid:x,shouldRestrictStrokesToBox:y,shouldAntialias:b}=e;let w="none";return m==="move"||t?h?w="grabbing":w="grab":s?w=void 0:y&&!i&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||l,shouldShowBoundingBox:o,shouldShowGrid:x,stageCoordinates:p,stageCursor:w,stageDimensions:u,stageScale:r,tool:m,isStaging:t,shouldShowIntermediates:g,shouldAntialias:b}},Se),Ive=we(w0e,{shouldForwardProp:e=>!["sx"].includes(e)}),Pve=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:l,tool:u,isStaging:p,shouldShowIntermediates:m,shouldAntialias:h}=W(_ve);_0e();const g=te(),x=d.useRef(null),y=d.useRef(null),b=d.useRef(null),w=d.useCallback(B=>{u9(B),y.current=B},[]),S=d.useCallback(B=>{d9(B),b.current=B},[]),j=d.useRef({x:0,y:0}),_=d.useRef(!1),E=T0e(y),I=P0e(y),M=D0e(y,_),R=M0e(y,_,j),D=O0e(),{handleDragStart:A,handleDragMove:O,handleDragEnd:T}=k0e(),X=d.useCallback(B=>B.evt.preventDefault(),[]);return d.useEffect(()=>{if(!x.current)return;const B=new ResizeObserver(N=>{for(const $ of N)if($.contentBoxSize){const{width:q,height:F}=$.contentRect;g(Ww({width:q,height:F}))}});B.observe(x.current);const{width:V,height:U}=x.current.getBoundingClientRect();return g(Ww({width:V,height:U})),()=>{B.disconnect()}},[g]),a.jsxs(L,{id:"canvas-container",ref:x,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(Ive,{tabIndex:-1,ref:w,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:i.width,height:i.height,scale:{x:l,y:l},onTouchStart:I,onTouchMove:R,onTouchEnd:M,onMouseDown:I,onMouseLeave:D,onMouseMove:R,onMouseUp:M,onDragStart:A,onDragMove:O,onDragEnd:T,onContextMenu:X,onWheel:E,draggable:(u==="move"||p)&&!t,children:[a.jsx(Eu,{id:"grid",visible:r,children:a.jsx(B0e,{})}),a.jsx(Eu,{id:"base",ref:S,listening:!1,imageSmoothingEnabled:h,children:a.jsx(ove,{})}),a.jsxs(Eu,{id:"mask",visible:e&&!p,listening:!1,children:[a.jsx(Q0e,{visible:!0,listening:!1}),a.jsx(K0e,{listening:!1})]}),a.jsx(Eu,{children:a.jsx(L0e,{})}),a.jsxs(Eu,{id:"preview",imageSmoothingEnabled:h,children:[!p&&a.jsx(jve,{visible:u!=="move",listening:!1}),a.jsx(ive,{visible:p}),m&&a.jsx(W0e,{}),a.jsx(wve,{visible:n&&!p})]})]})}),a.jsx(bve,{}),a.jsx(uve,{})]})},Eve=d.memo(Pve);function Mve(e,t,n=250){const[r,o]=d.useState(0);return d.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),o(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>o(s=>s+1)}const n1={width:6,height:6,borderColor:"base.100"},Ove={".react-colorful__hue-pointer":n1,".react-colorful__saturation-pointer":n1,".react-colorful__alpha-pointer":n1},Rve=e=>a.jsx(Ie,{sx:Ove,children:a.jsx(yO,{...e})}),S7=d.memo(Rve),Dve=le([Sn,Eo],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Fi(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),Ave=()=>{const e=te(),{t}=Z(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=W(Dve);et(["q"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[n]),et(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]),et(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const l=()=>{e(qI(n==="mask"?"base":"mask"))},u=()=>e(UI()),p=()=>e(cb(!o)),m=async()=>{e(m9())};return a.jsx(qd,{triggerComponent:a.jsx(Vt,{children:a.jsx(Fe,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(mM,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs(L,{direction:"column",gap:2,children:[a.jsx(br,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(br,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(f9(h.target.checked))}),a.jsx(Ie,{sx:{paddingTop:2,paddingBottom:2},children:a.jsx(S7,{color:r,onChange:h=>e(p9(h))})}),a.jsx(at,{size:"sm",leftIcon:a.jsx(lg,{}),onClick:m,children:"Save Mask"}),a.jsxs(at,{size:"sm",leftIcon:a.jsx(Br,{}),onClick:u,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},Tve=d.memo(Ave),Nve=le([xe,Jn],({canvas:e},t)=>{const{futureLayerStates:n}=e;return{canRedo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function $ve(){const e=te(),{canRedo:t,activeTabName:n}=W(Nve),{t:r}=Z(),o=()=>{e(h9())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Fe,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(eee,{}),onClick:o,isDisabled:!t})}const Lve=()=>{const e=W(Eo),t=te(),{t:n}=Z();return a.jsxs(kg,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(g9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(at,{size:"sm",leftIcon:a.jsx(Br,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},zve=d.memo(Lve),Fve=le([Sn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),Bve=()=>{const e=te(),{t}=Z(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:l,shouldSnapToGrid:u,shouldRestrictStrokesToBox:p,shouldAntialias:m}=W(Fve);et(["n"],()=>{e(nm(!u))},{enabled:!0,preventDefault:!0},[u]);const h=g=>e(nm(g.target.checked));return a.jsx(qd,{isLazy:!1,triggerComponent:a.jsx(Fe,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(bM,{})}),children:a.jsxs(L,{direction:"column",gap:2,children:[a.jsx(br,{label:t("unifiedCanvas.showIntermediates"),isChecked:l,onChange:g=>e(v9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:g=>e(x9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.snapToGrid"),isChecked:u,onChange:h}),a.jsx(br,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:g=>e(b9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:g=>e(y9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:g=>e(C9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:g=>e(w9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:g=>e(S9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.antialiasing"),isChecked:m,onChange:g=>e(k9(g.target.checked))}),a.jsx(zve,{})]})})},Hve=d.memo(Bve),Vve=le([xe,Eo],({canvas:e},t)=>{const{tool:n,brushColor:r,brushSize:o}=e;return{tool:n,isStaging:t,brushColor:r,brushSize:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),Wve=()=>{const e=te(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=W(Vve),{t:s}=Z();et(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),et(["e"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[t]),et(["c"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),et(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),et(["delete","backspace"],()=>{m()},{enabled:()=>!o,preventDefault:!0}),et(["BracketLeft"],()=>{r-5<=5?e(Zf(Math.max(r-1,1))):e(Zf(Math.max(r-5,1)))},{enabled:()=>!o,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(Zf(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),et(["Shift+BracketLeft"],()=>{e(ov({...n,a:Bi(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),et(["Shift+BracketRight"],()=>{e(ov({...n,a:Bi(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(oc("brush")),l=()=>e(oc("eraser")),u=()=>e(oc("colorPicker")),p=()=>e(j9()),m=()=>e(_9());return a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(QJ,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(NJ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:l}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(HJ,{}),isDisabled:o,onClick:p}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(Vc,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:m}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(zJ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:u}),a.jsx(qd,{triggerComponent:a.jsx(Fe,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(vM,{})}),children:a.jsxs(L,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx(L,{gap:4,justifyContent:"space-between",children:a.jsx(tt,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:h=>e(Zf(h)),sliderNumberInputProps:{max:500}})}),a.jsx(Ie,{sx:{width:"100%",paddingTop:2,paddingBottom:2},children:a.jsx(S7,{color:n,onChange:h=>e(ov(h))})})]})})]})},Uve=d.memo(Wve),Gve=le([xe,Jn],({canvas:e},t)=>{const{pastLayerStates:n}=e;return{canUndo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function Kve(){const e=te(),{t}=Z(),{canUndo:n,activeTabName:r}=W(Gve),o=()=>{e(I9())};return et(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Fe,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(Ud,{}),onClick:o,isDisabled:!n})}const qve=le([xe,Eo],({canvas:e},t)=>{const{tool:n,shouldCropToBoundingBoxOnSave:r,layer:o,isMaskEnabled:s}=e;return{isStaging:t,isMaskEnabled:s,tool:n,layer:o,shouldCropToBoundingBoxOnSave:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),Xve=()=>{const e=te(),{isStaging:t,isMaskEnabled:n,layer:r,tool:o}=W(qve),s=v1(),{t:i}=Z(),{isClipboardAPIAvailable:l}=$8(),{getUploadButtonProps:u,getUploadInputProps:p}=Uy({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});et(["v"],()=>{m()},{enabled:()=>!t,preventDefault:!0},[]),et(["r"],()=>{g()},{enabled:()=>!0,preventDefault:!0},[s]),et(["shift+m"],()=>{y()},{enabled:()=>!t,preventDefault:!0},[s]),et(["shift+s"],()=>{b()},{enabled:()=>!t,preventDefault:!0},[s]),et(["meta+c","ctrl+c"],()=>{w()},{enabled:()=>!t&&l,preventDefault:!0},[s,l]),et(["shift+d"],()=>{S()},{enabled:()=>!t,preventDefault:!0},[s]);const m=()=>e(oc("move")),h=Mve(()=>g(!1),()=>g(!0)),g=(_=!1)=>{const E=v1();if(!E)return;const I=E.getClientRect({skipTransform:!0});e(E9({contentRect:I,shouldScaleTo1:_}))},x=()=>{e(iI())},y=()=>{e(M9())},b=()=>{e(O9())},w=()=>{l&&e(R9())},S=()=>{e(D9())},j=_=>{const E=_;e(qI(E)),E==="mask"&&!n&&e(cb(!0))};return a.jsxs(L,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx(Pn,{tooltip:`${i("unifiedCanvas.layer")} (Q)`,value:r,data:P9,onChange:j,disabled:t})}),a.jsx(Tve,{}),a.jsx(Uve,{}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.move")} (V)`,tooltip:`${i("unifiedCanvas.move")} (V)`,icon:a.jsx(EJ,{}),isChecked:o==="move"||t,onClick:m}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.resetView")} (R)`,tooltip:`${i("unifiedCanvas.resetView")} (R)`,icon:a.jsx(DJ,{}),onClick:h})]}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${i("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(KJ,{}),onClick:y,isDisabled:t}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${i("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(lg,{}),onClick:b,isDisabled:t}),l&&a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${i("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Hc,{}),onClick:w,isDisabled:t}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${i("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(ig,{}),onClick:S,isDisabled:t})]}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Kve,{}),a.jsx($ve,{})]}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${i("common.upload")}`,tooltip:`${i("common.upload")}`,icon:a.jsx(cg,{}),isDisabled:t,...u()}),a.jsx("input",{...p()}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.clearCanvas")}`,tooltip:`${i("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Br,{}),onClick:x,colorScheme:"error",isDisabled:t})]}),a.jsx(Vt,{isAttached:!0,children:a.jsx(Hve,{})})]})},Qve=d.memo(Xve),V_={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Yve=()=>{const{isOver:e,setNodeRef:t,active:n}=JM({id:"unifiedCanvas",data:V_});return a.jsxs(L,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(Qve,{}),a.jsx(Eve,{}),e8(V_,n)&&a.jsx(t8,{isOver:e,label:"Set Canvas Initial Image"})]})},Zve=d.memo(Yve),Jve=()=>a.jsx(Zve,{}),e1e=d.memo(Jve),t1e=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(Nn,{as:VJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(xge,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(Nn,{as:Yi,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Mfe,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(Nn,{as:Soe,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(e1e,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(Nn,{as:Gy,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Ihe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(Nn,{as:AJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Ppe,{})},{id:"queue",translationKey:"queue.queue",icon:a.jsx(Nn,{as:oee,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(gge,{})}],n1e=le([xe],({config:e})=>{const{disabledTabs:t}=e;return t1e.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:Bt}}),r1e=448,o1e=448,s1e=360,a1e=["modelManager","queue"],i1e=["modelManager","queue"],l1e=()=>{const e=W(A9),t=W(Jn),n=W(n1e),{t:r}=Z(),o=te(),s=d.useCallback(O=>{O.target instanceof HTMLElement&&O.target.blur()},[]),i=d.useMemo(()=>n.map(O=>a.jsx(Ft,{hasArrow:!0,label:String(r(O.translationKey)),placement:"end",children:a.jsxs(Tr,{onClick:s,children:[a.jsx(d5,{children:String(r(O.translationKey))}),O.icon]})},O.id)),[n,r,s]),l=d.useMemo(()=>n.map(O=>a.jsx(So,{children:O.content},O.id)),[n]),u=d.useCallback(O=>{const T=n[O];T&&o(Xs(T.id))},[o,n]),{minSize:p,isCollapsed:m,setIsCollapsed:h,ref:g,reset:x,expand:y,collapse:b,toggle:w}=Jj(r1e,"pixels"),{ref:S,minSize:j,isCollapsed:_,setIsCollapsed:E,reset:I,expand:M,collapse:R,toggle:D}=Jj(s1e,"pixels");et("f",()=>{_||m?(M(),y()):(b(),R())},[o,_,m]),et(["t","o"],()=>{w()},[o]),et("g",()=>{D()},[o]);const A=t2();return a.jsxs(rl,{variant:"appTabs",defaultIndex:e,index:e,onChange:u,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(ol,{sx:{pt:2,gap:4,flexDir:"column"},children:[i,a.jsx(ba,{})]}),a.jsxs(Ig,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!i1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Qa,{order:0,id:"side",ref:g,defaultSize:p,minSize:p,onCollapse:h,collapsible:!0,children:t==="nodes"?a.jsx(wie,{}):a.jsx(Jde,{})}),a.jsx(lh,{onDoubleClick:x,collapsedDirection:m?"left":void 0}),a.jsx(_ie,{isSidePanelCollapsed:m,sidePanelRef:g})]}),a.jsx(Qa,{id:"main",order:1,minSize:o1e,children:a.jsx(zc,{style:{height:"100%",width:"100%"},children:l})}),!a1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(lh,{onDoubleClick:I,collapsedDirection:_?"right":void 0}),a.jsx(Qa,{id:"gallery",ref:S,order:2,defaultSize:j,minSize:j,onCollapse:E,collapsible:!0,children:a.jsx(Joe,{})}),a.jsx(kie,{isGalleryCollapsed:_,galleryPanelRef:S})]})]})]})},c1e=d.memo(l1e),u1e=d.createContext(null),r1={didCatch:!1,error:null};class d1e extends d.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=r1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(r1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&f1e(t.resetKeys,o)){var s,i;(s=(i=this.props).onReset)===null||s===void 0||s.call(i,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(r1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:s,error:i}=this.state;let l=t;if(s){const u={error:i,resetErrorBoundary:this.resetErrorBoundary};if(d.isValidElement(o))l=o;else if(typeof n=="function")l=n(u);else if(r)l=d.createElement(r,u);else throw i}return d.createElement(u1e.Provider,{value:{didCatch:s,error:i,resetErrorBoundary:this.resetErrorBoundary}},l)}}function f1e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function p1e(e={}){let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");const n=new URL(`${t}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(const o of r){let s=e[o];if(s!==void 0){if(o==="labels"||o==="projects"){if(!Array.isArray(s))throw new TypeError(`The \`${o}\` option should be an array`);s=s.join(",")}n.searchParams.set(o,s)}}return n.toString()}const m1e=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(e=>[e.name,e]),h1e=new Map(m1e),g1e=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],Nx=new WeakSet,v1e=e=>{Nx.add(e);const t=e.toJSON();return Nx.delete(e),t},x1e=e=>h1e.get(e)??Error,k7=({from:e,seen:t,to:n,forceEnumerable:r,maxDepth:o,depth:s,useToJSON:i,serialize:l})=>{if(!n)if(Array.isArray(e))n=[];else if(!l&&W_(e)){const p=x1e(e.name);n=new p}else n={};if(t.push(e),s>=o)return n;if(i&&typeof e.toJSON=="function"&&!Nx.has(e))return v1e(e);const u=p=>k7({from:p,seen:[...t],forceEnumerable:r,maxDepth:o,depth:s,useToJSON:i,serialize:l});for(const[p,m]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(m)){n[p]="[object Buffer]";continue}if(m!==null&&typeof m=="object"&&typeof m.pipe=="function"){n[p]="[object Stream]";continue}if(typeof m!="function"){if(!m||typeof m!="object"){n[p]=m;continue}if(!t.includes(e[p])){s++,n[p]=u(e[p]);continue}n[p]="[Circular]"}}for(const{property:p,enumerable:m}of g1e)typeof e[p]<"u"&&e[p]!==null&&Object.defineProperty(n,p,{value:W_(e[p])?u(e[p]):e[p],enumerable:r?!0:m,configurable:!0,writable:!0});return n};function b1e(e,t={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:r=!0}=t;return typeof e=="object"&&e!==null?k7({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:r,serialize:!0}):typeof e=="function"?`[Function: ${e.name??"anonymous"}]`:e}function W_(e){return!!e&&typeof e=="object"&&"name"in e&&"message"in e&&"stack"in e}const y1e=({error:e,resetErrorBoundary:t})=>{const n=r5(),r=d.useCallback(()=>{const s=JSON.stringify(b1e(e),null,2);navigator.clipboard.writeText(`\`\`\`
-${s}
-\`\`\``),n({title:"Error Copied"})},[e,n]),o=d.useMemo(()=>p1e({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx(L,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs(L,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(cr,{children:"Something went wrong"}),a.jsx(L,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(ve,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs(L,{sx:{gap:4},children:[a.jsx(at,{leftIcon:a.jsx(goe,{}),onClick:t,children:"Reset UI"}),a.jsx(at,{leftIcon:a.jsx(Hc,{}),onClick:r,children:"Copy Error"}),a.jsx(Oh,{href:o,isExternal:!0,children:a.jsx(at,{leftIcon:a.jsx(hy,{}),children:"Create Issue"})})]})]})})},C1e=d.memo(y1e),w1e=le([xe],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),S1e=()=>{const e=te(),{shift:t,ctrl:n,meta:r}=W(w1e),{queueBack:o,isDisabled:s,isLoading:i}=V8();et(["ctrl+enter","meta+enter"],o,{enabled:()=>!s&&!i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s,i]);const{queueFront:l,isDisabled:u,isLoading:p}=K8();return et(["ctrl+shift+enter","meta+shift+enter"],l,{enabled:()=>!u&&!p,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[l,u,p]),et("*",()=>{Hp("shift")?!t&&e(Nr(!0)):t&&e(Nr(!1)),Hp("ctrl")?!n&&e(Uw(!0)):n&&e(Uw(!1)),Hp("meta")?!r&&e(Gw(!0)):r&&e(Gw(!1))},{keyup:!0,keydown:!0},[t,n,r]),et("1",()=>{e(Xs("txt2img"))}),et("2",()=>{e(Xs("img2img"))}),et("3",()=>{e(Xs("unifiedCanvas"))}),et("4",()=>{e(Xs("nodes"))}),et("5",()=>{e(Xs("modelManager"))}),null},k1e=d.memo(S1e),j1e=e=>{const t=te(),{recallAllParameters:n}=Sg(),r=sl(),{currentData:o}=to((e==null?void 0:e.imageName)??$r.skipToken),{currentData:s}=T9((e==null?void 0:e.imageName)??$r.skipToken),i=d.useCallback(()=>{o&&(t(mI(o)),t(Xs("unifiedCanvas")),r({title:N9("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))},[t,r,o]),l=d.useCallback(()=>{o&&t(vh(o))},[t,o]),u=d.useCallback(()=>{s&&n(s.metadata)},[s]);return d.useEffect(()=>{e&&e.action==="sendToCanvas"&&i()},[e,i]),d.useEffect(()=>{e&&e.action==="sendToImg2Img"&&l()},[e,l]),d.useEffect(()=>{e&&e.action==="useAllParameters"&&u()},[e,u]),{handleSendToCanvas:i,handleSendToImg2Img:l,handleUseAllMetadata:u}},_1e=e=>(j1e(e.selectedImage),null),I1e=d.memo(_1e),P1e={},E1e=({config:e=P1e,selectedImage:t})=>{const n=W(wM),r=fP("system"),o=te(),s=d.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);d.useEffect(()=>{yt.changeLanguage(n)},[n]),d.useEffect(()=>{_I(e)&&(r.info({config:e},"Received config"),o($9(e)))},[o,e,r]),d.useEffect(()=>{o(L9())},[o]);const i=Jh(z9);return a.jsxs(d1e,{onReset:s,FallbackComponent:C1e,children:[a.jsx(Ja,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(rG,{children:a.jsxs(Ja,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[i||a.jsx(Ree,{}),a.jsx(L,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(c1e,{})})]})})}),a.jsx(bJ,{}),a.jsx(hJ,{}),a.jsx(GW,{}),a.jsx(k1e,{}),a.jsx(I1e,{selectedImage:t})]})},T1e=d.memo(E1e);export{T1e as default};
diff --git a/invokeai/frontend/web/dist/assets/App-8c45baef.js b/invokeai/frontend/web/dist/assets/App-8c45baef.js
new file mode 100644
index 0000000000..fa3aa74451
--- /dev/null
+++ b/invokeai/frontend/web/dist/assets/App-8c45baef.js
@@ -0,0 +1,169 @@
+import{a as Tc,b as Uj,S as Gj,c as Kj,d as qj,e as i1,f as Xj,i as c1,g as jD,h as Qj,j as Yj,k as ID,l as Fx,m as PD,n as ED,o as ow,p as Zj,t as MD,q as OD,r as DD,s as RD,u as AD,v as d,w as a,x as Bx,y as Zp,z as TD,A as $D,B as ND,C as LD,P as zD,D as Hx,E as FD,F as BD,G as HD,H as VD,I as Jj,J as _e,K as Tn,L as WD,M as UD,N as GD,O as Wt,Q as Se,R as Je,T as un,U as Fe,V as yd,W as dr,X as jn,Y as Un,Z as on,_ as fa,$ as al,a0 as dt,a1 as bo,a2 as oc,a3 as pa,a4 as ma,a5 as xh,a6 as Vx,a7 as Cd,a8 as fn,a9 as KD,aa as H,ab as sw,ac as qD,ad as eI,ae as u1,af as wd,ag as $c,ah as XD,ai as tI,aj as nI,ak as rI,al as Ho,am as QD,an as le,ao as ge,ap as Bt,aq as W,ar as YD,as as aw,at as ZD,au as JD,av as eR,aw as ll,ax as te,ay as tR,az as lt,aA as Qt,aB as Ie,aC as N,aD as cr,aE as Zn,aF as Ce,aG as Z,aH as oI,aI as nR,aJ as rR,aK as oR,aL as sR,aM as Kr,aN as Wx,aO as ha,aP as Nr,aQ as Sd,aR,aS as lR,aT as lw,aU as Ux,aV as be,aW as Vo,aX as iR,aY as sI,aZ as aI,a_ as iw,a$ as cR,b0 as uR,b1 as dR,b2 as ga,b3 as Gx,b4 as bt,b5 as fR,b6 as pR,b7 as lI,b8 as iI,b9 as bh,ba as mR,bb as cw,bc as cI,bd as hR,be as gR,bf as vR,bg as xR,bh as bR,bi as yR,bj as CR,bk as uI,bl as wR,bm as SR,bn as kR,bo as _R,bp as jR,bq as va,br as bc,bs as IR,bt as Zr,bu as PR,bv as ER,bw as MR,bx as uw,by as OR,bz as DR,bA as Js,bB as dI,bC as fI,bD as yh,bE as Kx,bF as qx,bG as wo,bH as pI,bI as RR,bJ as Bl,bK as Au,bL as dw,bM as AR,bN as TR,bO as $R,bP as Qf,bQ as Yf,bR as wu,bS as J0,bT as Fu,bU as Bu,bV as Hu,bW as Vu,bX as fw,bY as Jp,bZ as ev,b_ as em,b$ as pw,c0 as d1,c1 as tv,c2 as f1,c3 as nv,c4 as tm,c5 as mw,c6 as Hl,c7 as hw,c8 as Vl,c9 as gw,ca as nm,cb as kd,cc as mI,cd as NR,ce as vw,cf as Xx,cg as rm,ch as hI,ci as wr,cj as Su,ck as Mi,cl as Qx,cm as gI,cn as Zf,co as Yx,cp as LR,cq as vI,cr as rv,cs as Ch,ct as zR,cu as xI,cv as p1,cw as m1,cx as bI,cy as FR,cz as h1,cA as BR,cB as g1,cC as HR,cD as v1,cE as VR,cF as WR,cG as Zx,cH as Jx,cI as eb,cJ as tb,cK as nb,cL as wh,cM as rb,cN as Qs,cO as yI,cP as CI,cQ as ob,cR as wI,cS as UR,cT as ku,cU as aa,cV as SI,cW as kI,cX as xw,cY as sb,cZ as _I,c_ as ab,c$ as lb,d0 as jI,d1 as Mn,d2 as GR,d3 as Wn,d4 as KR,d5 as Nc,d6 as Sh,d7 as ib,d8 as II,d9 as PI,da as qR,db as XR,dc as QR,dd as YR,de as ZR,df as JR,dg as eA,dh as tA,di as nA,dj as rA,dk as bw,dl as cb,dm as oA,dn as sA,dp as _d,dq as aA,dr as lA,ds as kh,dt as iA,du as cA,dv as uA,dw as dA,dx as pn,dy as fA,dz as pA,dA as mA,dB as hA,dC as gA,dD as vA,dE as Yu,dF as yw,dG as Qo,dH as EI,dI as xA,dJ as ub,dK as bA,dL as Cw,dM as yA,dN as CA,dO as wA,dP as MI,dQ as SA,dR as kA,dS as _A,dT as jA,dU as IA,dV as PA,dW as OI,dX as EA,dY as MA,dZ as ww,d_ as OA,d$ as DA,e0 as RA,e1 as AA,e2 as TA,e3 as $A,e4 as NA,e5 as DI,e6 as LA,e7 as zA,e8 as FA,e9 as Sw,ea as Jf,eb as _o,ec as BA,ed as HA,ee as VA,ef as WA,eg as UA,eh as GA,ei as Wo,ej as KA,ek as qA,el as XA,em as QA,en as YA,eo as ZA,ep as JA,eq as eT,er as tT,es as nT,et as rT,eu as oT,ev as sT,ew as aT,ex as lT,ey as iT,ez as cT,eA as uT,eB as dT,eC as fT,eD as pT,eE as mT,eF as hT,eG as gT,eH as vT,eI as kw,eJ as _w,eK as RI,eL as xT,eM as zo,eN as Zu,eO as Cr,eP as bT,eQ as yT,eR as AI,eS as TI,eT as CT,eU as jw,eV as wT,eW as Iw,eX as Pw,eY as Ew,eZ as ST,e_ as kT,e$ as Mw,f0 as Ow,f1 as _T,f2 as jT,f3 as om,f4 as IT,f5 as Dw,f6 as Rw,f7 as PT,f8 as ET,f9 as MT,fa as $I,fb as OT,fc as DT,fd as NI,fe as RT,ff as AT,fg as Aw,fh as TT,fi as Tw,fj as $T,fk as NT,fl as LI,fm as zI,fn as jd,fo as FI,fp as Ol,fq as BI,fr as $w,fs as LT,ft as zT,fu as HI,fv as FT,fw as BT,fx as HT,fy as VT,fz as WT,fA as db,fB as x1,fC as Nw,fD as ti,fE as UT,fF as GT,fG as VI,fH as fb,fI as WI,fJ as pb,fK as UI,fL as KT,fM as Zs,fN as qT,fO as GI,fP as XT,fQ as mb,fR as KI,fS as QT,fT as YT,fU as ZT,fV as JT,fW as e9,fX as t9,fY as n9,fZ as sm,f_ as Tu,f$ as Yi,g0 as r9,g1 as o9,g2 as s9,g3 as a9,g4 as l9,g5 as i9,g6 as c9,g7 as u9,g8 as Lw,g9 as d9,ga as f9,gb as p9,gc as m9,gd as h9,ge as g9,gf as zw,gg as v9,gh as x9,gi as b9,gj as y9,gk as C9,gl as w9,gm as S9,gn as Fw,go as k9,gp as _9,gq as j9,gr as I9,gs as P9,gt as E9,gu as M9,gv as O9,gw as D9,gx as R9,gy as A9,gz as T9,gA as $9,gB as N9,gC as Id,gD as L9,gE as z9,gF as F9,gG as B9,gH as H9,gI as V9,gJ as W9,gK as U9,gL as Bw,gM as Lp,gN as G9,gO as am,gP as qI,gQ as lm,gR as K9,gS as q9,gT as sc,gU as XI,gV as QI,gW as hb,gX as X9,gY as Q9,gZ as Y9,g_ as b1,g$ as YI,h0 as Z9,h1 as J9,h2 as ZI,h3 as e$,h4 as t$,h5 as n$,h6 as r$,h7 as o$,h8 as Hw,h9 as Oi,ha as s$,hb as a$,hc as l$,hd as i$,he as c$,hf as u$,hg as Vw,hh as d$,hi as f$,hj as p$,hk as m$,hl as h$,hm as g$,hn as v$,ho as x$,hp as ov,hq as sv,hr as av,hs as ep,ht as Ww,hu as y1,hv as Uw,hw as b$,hx as y$,hy as C$,hz as w$,hA as JI,hB as S$,hC as k$,hD as _$,hE as j$,hF as I$,hG as P$,hH as E$,hI as M$,hJ as O$,hK as D$,hL as R$,hM as tp,hN as lv,hO as A$,hP as T$,hQ as $$,hR as N$,hS as L$,hT as z$,hU as F$,hV as B$,hW as H$,hX as V$,hY as Gw,hZ as Kw,h_ as W$,h$ as U$,i0 as G$,i1 as K$}from"./index-27e8922c.js";import{u as e5,a as xa,b as q$,r as De,f as X$,g as qw,c as mt,d as Dn}from"./MantineProvider-70b4f32d.js";var Q$=200;function Y$(e,t,n,r){var o=-1,s=Kj,l=!0,i=e.length,u=[],p=t.length;if(!i)return u;n&&(t=Tc(t,Uj(n))),r?(s=qj,l=!1):t.length>=Q$&&(s=i1,l=!1,t=new Gj(t));e:for(;++o<i;){var m=e[o],h=n==null?m:n(m);if(m=r||m!==0?m:0,l&&h===h){for(var g=p;g--;)if(t[g]===h)continue e;u.push(m)}else s(t,h,r)||u.push(m)}return u}var Z$=Xj(function(e,t){return c1(e)?Y$(e,jD(t,1,c1,!0)):[]});const J$=Z$;function eN(e,t){var n=[];return Qj(e,function(r,o,s){t(r,o,s)&&n.push(r)}),n}function tN(e,t){var n=Yj(e)?ID:eN;return n(e,Fx(t))}function nN(e,t){var n=-1,r=PD(e)?Array(e.length):[];return Qj(e,function(o,s,l){r[++n]=t(o,s,l)}),r}function Sr(e,t){var n=Yj(e)?Tc:nN;return n(e,Fx(t))}function rN(e,t){return Tc(t,function(n){return e[n]})}function oN(e){return e==null?[]:rN(e,ED(e))}var sN=Math.min;function aN(e,t,n){for(var r=n?qj:Kj,o=e[0].length,s=e.length,l=s,i=Array(s),u=1/0,p=[];l--;){var m=e[l];l&&t&&(m=Tc(m,Uj(t))),u=sN(m.length,u),i[l]=!n&&(t||o>=120&&m.length>=120)?new Gj(l&&m):void 0}m=e[0];var h=-1,g=i[0];e:for(;++h<o&&p.length<u;){var x=m[h],y=t?t(x):x;if(x=n||x!==0?x:0,!(g?i1(g,y):r(p,y,n))){for(l=s;--l;){var b=i[l];if(!(b?i1(b,y):r(e[l],y,n)))continue e}g&&g.push(y),p.push(x)}}return p}function lN(e){return c1(e)?e:[]}var iN=Xj(function(e){var t=Tc(e,lN);return t.length&&t[0]===e[0]?aN(t):[]});const cN=iN;function gb(e){return e==null}function uN(e,t,n,r){if(!ow(e))return e;t=Zj(t,e);for(var o=-1,s=t.length,l=s-1,i=e;i!=null&&++o<s;){var u=MD(t[o]),p=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(o!=l){var m=i[u];p=r?r(m,u,i):void 0,p===void 0&&(p=ow(m)?m:OD(t[o+1])?[]:{})}DD(i,u,p),i=i[u]}return e}function dN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var l=t[r],i=RD(e,l);n(i,l)&&uN(s,Zj(l,e),i)}return s}function Xw(e,t){if(e==null)return{};var n=Tc(AD(e),function(r){return[r]});return t=Fx(t),dN(e,n,function(r,o){return t(r,o[0])})}function fN(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function pN(e,t,n){let r=new Set([...t,void 0]);return e.listen((o,s)=>{r.has(s)&&n(o,s)})}const t5=({id:e,x:t,y:n,width:r,height:o,style:s,color:l,strokeColor:i,strokeWidth:u,className:p,borderRadius:m,shapeRendering:h,onClick:g,selected:x})=>{const{background:y,backgroundColor:b}=s||{},C=l||y||b;return a.jsx("rect",{className:Bx(["react-flow__minimap-node",{selected:x},p]),x:t,y:n,rx:m,ry:m,width:r,height:o,fill:C,stroke:i,strokeWidth:u,shapeRendering:h,onClick:g?S=>g(S,e):void 0})};t5.displayName="MiniMapNode";var mN=d.memo(t5);const hN=e=>e.nodeOrigin,gN=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),iv=e=>e instanceof Function?e:()=>e;function vN({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=mN,onClick:l}){const i=Zp(gN,Hx),u=Zp(hN),p=iv(t),m=iv(e),h=iv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:i.map(x=>{const{x:y,y:b}=TD(x,u).positionAbsolute;return a.jsx(s,{x:y,y:b,width:x.width,height:x.height,style:x.style,selected:x.selected,className:h(x),color:p(x),borderRadius:r,strokeColor:m(x),strokeWidth:o,shapeRendering:g,onClick:l,id:x.id},x.id)})})}var xN=d.memo(vN);const bN=200,yN=150,CN=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?HD(VD(t,e.nodeOrigin),n):n,rfId:e.rfId}},wN="react-flow__minimap-desc";function n5({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:l=2,nodeComponent:i,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:m=1,position:h="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:b=!1,ariaLabel:C="React Flow mini map",inversePan:S=!1,zoomStep:_=10,offsetScale:j=5}){const E=$D(),I=d.useRef(null),{boundingRect:M,viewBB:D,rfId:R}=Zp(CN,Hx),A=(e==null?void 0:e.width)??bN,O=(e==null?void 0:e.height)??yN,$=M.width/A,X=M.height/O,z=Math.max($,X),V=z*A,Q=z*O,G=j*z,F=M.x-(V-M.width)/2-G,U=M.y-(Q-M.height)/2-G,T=V+G*2,B=Q+G*2,Y=`${wN}-${R}`,re=d.useRef(0);re.current=z,d.useEffect(()=>{if(I.current){const q=ND(I.current),K=J=>{const{transform:ie,d3Selection:de,d3Zoom:xe}=E.getState();if(J.sourceEvent.type!=="wheel"||!de||!xe)return;const we=-J.sourceEvent.deltaY*(J.sourceEvent.deltaMode===1?.05:J.sourceEvent.deltaMode?1:.002)*_,ve=ie[2]*Math.pow(2,we);xe.scaleTo(de,ve)},ee=J=>{const{transform:ie,d3Selection:de,d3Zoom:xe,translateExtent:we,width:ve,height:fe}=E.getState();if(J.sourceEvent.type!=="mousemove"||!de||!xe)return;const Oe=re.current*Math.max(1,ie[2])*(S?-1:1),je={x:ie[0]-J.sourceEvent.movementX*Oe,y:ie[1]-J.sourceEvent.movementY*Oe},$e=[[0,0],[ve,fe]],st=FD.translate(je.x,je.y).scale(ie[2]),Ve=xe.constrain()(st,$e,we);xe.transform(de,Ve)},ce=LD().on("zoom",y?ee:null).on("zoom.wheel",b?K:null);return q.call(ce),()=>{q.on("zoom",null)}}},[y,b,S,_]);const ae=g?q=>{const K=BD(q);g(q,{x:K[0],y:K[1]})}:void 0,oe=x?(q,K)=>{const ee=E.getState().nodeInternals.get(K);x(q,ee)}:void 0;return a.jsx(zD,{position:h,style:e,className:Bx(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:O,viewBox:`${F} ${U} ${T} ${B}`,role:"img","aria-labelledby":Y,ref:I,onClick:ae,children:[C&&a.jsx("title",{id:Y,children:C}),a.jsx(xN,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:i}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-G},${U-G}h${T+G*2}v${B+G*2}h${-T-G*2}z
+        M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fill:u,fillRule:"evenodd",stroke:p,strokeWidth:m,pointerEvents:"none"})]})})}n5.displayName="MiniMap";var SN=d.memo(n5),Uo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Uo||(Uo={}));function kN({color:e,dimensions:t,lineWidth:n}){return a.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function _N({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const jN={[Uo.Dots]:"#91919a",[Uo.Lines]:"#eee",[Uo.Cross]:"#e2e2e2"},IN={[Uo.Dots]:1,[Uo.Lines]:1,[Uo.Cross]:6},PN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function r5({id:e,variant:t=Uo.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:l,style:i,className:u}){const p=d.useRef(null),{transform:m,patternId:h}=Zp(PN,Hx),g=l||jN[t],x=r||IN[t],y=t===Uo.Dots,b=t===Uo.Cross,C=Array.isArray(n)?n:[n,n],S=[C[0]*m[2]||1,C[1]*m[2]||1],_=x*m[2],j=b?[_,_]:S,E=y?[_/s,_/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Bx(["react-flow__background",u]),style:{...i,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background",children:[a.jsx("pattern",{id:h+e,x:m[0]%S[0],y:m[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:y?a.jsx(_N,{color:g,radius:_/s}):a.jsx(kN,{dimensions:j,color:g,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+e})`})]})}r5.displayName="Background";var EN=d.memo(r5);const Qw=(e,t,n)=>{MN(n);const r=Jj(e,t);return o5[n].includes(r)},o5={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Yw=Object.keys(o5),MN=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Yw.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Yw.join("|")}`)};function ON(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var DN=ON();const s5=1/60*1e3,RN=typeof performance<"u"?()=>performance.now():()=>Date.now(),a5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(RN()),s5);function AN(e){let t=[],n=[],r=0,o=!1,s=!1;const l=new WeakSet,i={schedule:(u,p=!1,m=!1)=>{const h=m&&o,g=h?t:n;return p&&l.add(u),g.indexOf(u)===-1&&(g.push(u),h&&o&&(r=t.length)),u},cancel:u=>{const p=n.indexOf(u);p!==-1&&n.splice(p,1),l.delete(u)},process:u=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let p=0;p<r;p++){const m=t[p];m(u),l.has(m)&&(i.schedule(m),e())}o=!1,s&&(s=!1,i.process(u))}};return i}const TN=40;let C1=!0,Ju=!1,w1=!1;const ac={delta:0,timestamp:0},Pd=["read","update","preRender","render","postRender"],_h=Pd.reduce((e,t)=>(e[t]=AN(()=>Ju=!0),e),{}),$N=Pd.reduce((e,t)=>{const n=_h[t];return e[t]=(r,o=!1,s=!1)=>(Ju||zN(),n.schedule(r,o,s)),e},{}),NN=Pd.reduce((e,t)=>(e[t]=_h[t].cancel,e),{});Pd.reduce((e,t)=>(e[t]=()=>_h[t].process(ac),e),{});const LN=e=>_h[e].process(ac),l5=e=>{Ju=!1,ac.delta=C1?s5:Math.max(Math.min(e-ac.timestamp,TN),1),ac.timestamp=e,w1=!0,Pd.forEach(LN),w1=!1,Ju&&(C1=!1,a5(l5))},zN=()=>{Ju=!0,C1=!0,w1||a5(l5)},Zw=()=>ac;function jh(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=d.Children.toArray(e.path),l=_e((i,u)=>a.jsx(Tn,{ref:u,viewBox:t,...o,...i,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return l.displayName=r,l}function i5(e){const{theme:t}=WD(),n=UD();return d.useMemo(()=>GD(t.direction,{...n,...e}),[e,t.direction,n])}var FN=Object.defineProperty,BN=(e,t,n)=>t in e?FN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sn=(e,t,n)=>(BN(e,typeof t!="symbol"?t+"":t,n),n);function Jw(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var HN=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function eS(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function tS(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var S1=typeof window<"u"?d.useLayoutEffect:d.useEffect,im=e=>e,VN=class{constructor(){Sn(this,"descendants",new Map),Sn(this,"register",e=>{if(e!=null)return HN(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Sn(this,"unregister",e=>{this.descendants.delete(e);const t=Jw(Array.from(this.descendants.keys()));this.assignIndex(t)}),Sn(this,"destroy",()=>{this.descendants.clear()}),Sn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Sn(this,"count",()=>this.descendants.size),Sn(this,"enabledCount",()=>this.enabledValues().length),Sn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Sn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Sn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Sn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Sn(this,"first",()=>this.item(0)),Sn(this,"firstEnabled",()=>this.enabledItem(0)),Sn(this,"last",()=>this.item(this.descendants.size-1)),Sn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Sn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Sn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Sn(this,"next",(e,t=!0)=>{const n=eS(e,this.count(),t);return this.item(n)}),Sn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=eS(r,this.enabledCount(),t);return this.enabledItem(o)}),Sn(this,"prev",(e,t=!0)=>{const n=tS(e,this.count()-1,t);return this.item(n)}),Sn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=tS(r,this.enabledCount()-1,t);return this.enabledItem(o)}),Sn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Jw(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function WN(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Pt(...e){return t=>{e.forEach(n=>{WN(n,t)})}}function UN(...e){return d.useMemo(()=>Pt(...e),e)}function GN(){const e=d.useRef(new VN);return S1(()=>()=>e.current.destroy()),e.current}var[KN,c5]=Wt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function qN(e){const t=c5(),[n,r]=d.useState(-1),o=d.useRef(null);S1(()=>()=>{o.current&&t.unregister(o.current)},[]),S1(()=>{if(!o.current)return;const l=Number(o.current.dataset.index);n!=l&&!Number.isNaN(l)&&r(l)});const s=im(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Pt(s,o)}}function vb(){return[im(KN),()=>im(c5()),()=>GN(),o=>qN(o)]}var[XN,Ih]=Wt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[QN,xb]=Wt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[YN,R1e,ZN,JN]=vb(),Hi=_e(function(t,n){const{getButtonProps:r}=xb(),o=r(t,n),l={display:"flex",alignItems:"center",width:"100%",outline:0,...Ih().button};return a.jsx(Se.button,{...o,className:Je("chakra-accordion__button",t.className),__css:l})});Hi.displayName="AccordionButton";function Ed(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(g,x)=>g!==x}=e,s=un(r),l=un(o),[i,u]=d.useState(n),p=t!==void 0,m=p?t:i,h=un(g=>{const y=typeof g=="function"?g(m):g;l(m,y)&&(p||u(y),s(y))},[p,s,m,l]);return[m,h]}function eL(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...l}=e;rL(e),oL(e);const i=ZN(),[u,p]=d.useState(-1);d.useEffect(()=>()=>{p(-1)},[]);const[m,h]=Ed({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:m,setIndex:h,htmlProps:l,getAccordionItemProps:x=>{let y=!1;return x!==null&&(y=Array.isArray(m)?m.includes(x):m===x),{isOpen:y,onChange:C=>{if(x!==null)if(o&&Array.isArray(m)){const S=C?m.concat(x):m.filter(_=>_!==x);h(S)}else C?h(x):s&&h(-1)}}},focusedIndex:u,setFocusedIndex:p,descendants:i}}var[tL,bb]=Wt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function nL(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:l}=bb(),i=d.useRef(null),u=d.useId(),p=r??u,m=`accordion-button-${p}`,h=`accordion-panel-${p}`;sL(e);const{register:g,index:x,descendants:y}=JN({disabled:t&&!n}),{isOpen:b,onChange:C}=s(x===-1?null:x);aL({isOpen:b,isDisabled:t});const S=()=>{C==null||C(!0)},_=()=>{C==null||C(!1)},j=d.useCallback(()=>{C==null||C(!b),l(x)},[x,l,b,C]),E=d.useCallback(R=>{const O={ArrowDown:()=>{const $=y.nextEnabled(x);$==null||$.node.focus()},ArrowUp:()=>{const $=y.prevEnabled(x);$==null||$.node.focus()},Home:()=>{const $=y.firstEnabled();$==null||$.node.focus()},End:()=>{const $=y.lastEnabled();$==null||$.node.focus()}}[R.key];O&&(R.preventDefault(),O(R))},[y,x]),I=d.useCallback(()=>{l(x)},[l,x]),M=d.useCallback(function(A={},O=null){return{...A,type:"button",ref:Pt(g,i,O),id:m,disabled:!!t,"aria-expanded":!!b,"aria-controls":h,onClick:Fe(A.onClick,j),onFocus:Fe(A.onFocus,I),onKeyDown:Fe(A.onKeyDown,E)}},[m,t,b,j,I,E,h,g]),D=d.useCallback(function(A={},O=null){return{...A,ref:O,role:"region",id:h,"aria-labelledby":m,hidden:!b}},[m,b,h]);return{isOpen:b,isDisabled:t,isFocusable:n,onOpen:S,onClose:_,getButtonProps:M,getPanelProps:D,htmlProps:o}}function rL(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;yd({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function oL(e){yd({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function sL(e){yd({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.
+    `})}function aL(e){yd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Vi(e){const{isOpen:t,isDisabled:n}=xb(),{reduceMotion:r}=bb(),o=Je("chakra-accordion__icon",e.className),s=Ih(),l={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(Tn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:l,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Vi.displayName="AccordionIcon";var Wi=_e(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...l}=nL(t),u={...Ih().container,overflowAnchor:"none"},p=d.useMemo(()=>l,[l]);return a.jsx(QN,{value:p,children:a.jsx(Se.div,{ref:n,...s,className:Je("chakra-accordion__item",o),__css:u,children:typeof r=="function"?r({isExpanded:!!l.isOpen,isDisabled:!!l.isDisabled}):r})})});Wi.displayName="AccordionItem";var Zi={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Al={enter:{duration:.2,ease:Zi.easeOut},exit:{duration:.1,ease:Zi.easeIn}},ea={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},lL=e=>e!=null&&parseInt(e.toString(),10)>0,nS={exit:{height:{duration:.2,ease:Zi.ease},opacity:{duration:.3,ease:Zi.ease}},enter:{height:{duration:.3,ease:Zi.ease},opacity:{duration:.4,ease:Zi.ease}}},iL={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:lL(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:ea.exit(nS.exit,o)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(s=n==null?void 0:n.enter)!=null?s:ea.enter(nS.enter,o)}}},Md=d.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:l="auto",style:i,className:u,transition:p,transitionEnd:m,...h}=e,[g,x]=d.useState(!1);d.useEffect(()=>{const _=setTimeout(()=>{x(!0)});return()=>clearTimeout(_)},[]),yd({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const y=parseFloat(s.toString())>0,b={startingHeight:s,endingHeight:l,animateOpacity:o,transition:g?p:{enter:{duration:0}},transitionEnd:{enter:m==null?void 0:m.enter,exit:r?m==null?void 0:m.exit:{...m==null?void 0:m.exit,display:y?"block":"none"}}},C=r?n:!0,S=n||r?"enter":"exit";return a.jsx(dr,{initial:!1,custom:b,children:C&&a.jsx(jn.div,{ref:t,...h,className:Je("chakra-collapse",u),style:{overflow:"hidden",display:"block",...i},custom:b,variants:iL,initial:r?"exit":!1,animate:S,exit:"exit"})})});Md.displayName="Collapse";var cL={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:ea.enter(Al.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:ea.exit(Al.exit,n),transitionEnd:t==null?void 0:t.exit}}},u5={initial:"exit",animate:"enter",exit:"exit",variants:cL},uL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:l,transitionEnd:i,delay:u,...p}=t,m=o||r?"enter":"exit",h=r?o&&r:!0,g={transition:l,transitionEnd:i,delay:u};return a.jsx(dr,{custom:g,children:h&&a.jsx(jn.div,{ref:n,className:Je("chakra-fade",s),custom:g,...u5,animate:m,...p})})});uL.displayName="Fade";var dL={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(s=n==null?void 0:n.exit)!=null?s:ea.exit(Al.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:ea.enter(Al.enter,n),transitionEnd:e==null?void 0:e.enter}}},d5={initial:"exit",animate:"enter",exit:"exit",variants:dL},fL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:l=.95,className:i,transition:u,transitionEnd:p,delay:m,...h}=t,g=r?o&&r:!0,x=o||r?"enter":"exit",y={initialScale:l,reverse:s,transition:u,transitionEnd:p,delay:m};return a.jsx(dr,{custom:y,children:g&&a.jsx(jn.div,{ref:n,className:Je("chakra-offset-slide",i),...d5,animate:x,custom:y,...h})})});fL.displayName="ScaleFade";var pL={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,x:e,y:t,transition:(s=n==null?void 0:n.exit)!=null?s:ea.exit(Al.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:ea.enter(Al.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var l;const i={x:t,y:e};return{opacity:0,transition:(l=n==null?void 0:n.exit)!=null?l:ea.exit(Al.exit,s),...o?{...i,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...i,...r==null?void 0:r.exit}}}}},k1={initial:"initial",animate:"enter",exit:"exit",variants:pL},mL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:l,offsetX:i=0,offsetY:u=8,transition:p,transitionEnd:m,delay:h,...g}=t,x=r?o&&r:!0,y=o||r?"enter":"exit",b={offsetX:i,offsetY:u,reverse:s,transition:p,transitionEnd:m,delay:h};return a.jsx(dr,{custom:b,children:x&&a.jsx(jn.div,{ref:n,className:Je("chakra-offset-slide",l),custom:b,...k1,animate:y,...g})})});mL.displayName="SlideFade";var Ui=_e(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:l}=bb(),{getPanelProps:i,isOpen:u}=xb(),p=i(s,n),m=Je("chakra-accordion__panel",r),h=Ih();l||delete p.hidden;const g=a.jsx(Se.div,{...p,__css:h.panel,className:m});return l?g:a.jsx(Md,{in:u,...o,children:g})});Ui.displayName="AccordionPanel";var f5=_e(function({children:t,reduceMotion:n,...r},o){const s=Un("Accordion",r),l=on(r),{htmlProps:i,descendants:u,...p}=eL(l),m=d.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(YN,{value:u,children:a.jsx(tL,{value:m,children:a.jsx(XN,{value:s,children:a.jsx(Se.div,{ref:o,...i,className:Je("chakra-accordion",r.className),__css:s.root,children:t})})})})});f5.displayName="Accordion";function Ph(e){return d.Children.toArray(e).filter(t=>d.isValidElement(t))}var[hL,gL]=Wt({strict:!1,name:"ButtonGroupContext"}),vL={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},xL={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Ht=_e(function(t,n){const{size:r,colorScheme:o,variant:s,className:l,spacing:i="0.5rem",isAttached:u,isDisabled:p,orientation:m="horizontal",...h}=t,g=Je("chakra-button__group",l),x=d.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...u?vL[m]:xL[m](i)};const b=m==="vertical";return a.jsx(hL,{value:x,children:a.jsx(Se.div,{ref:n,role:"group",__css:y,className:g,"data-attached":u?"":void 0,"data-orientation":m,flexDir:b?"column":void 0,...h})})});Ht.displayName="ButtonGroup";function bL(e){const[t,n]=d.useState(!e);return{ref:d.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function _1(e){const{children:t,className:n,...r}=e,o=d.isValidElement(t)?d.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=Je("chakra-button__icon",n);return a.jsx(Se.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}_1.displayName="ButtonIcon";function j1(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(fa,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:l,...i}=e,u=Je("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",m=d.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...l}),[l,t,p,r]);return a.jsx(Se.div,{className:u,...i,__css:m,children:o})}j1.displayName="ButtonSpinner";var Ja=_e((e,t)=>{const n=gL(),r=al("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:l,children:i,leftIcon:u,rightIcon:p,loadingText:m,iconSpacing:h="0.5rem",type:g,spinner:x,spinnerPlacement:y="start",className:b,as:C,...S}=on(e),_=d.useMemo(()=>{const M={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:M}}},[r,n]),{ref:j,type:E}=bL(C),I={rightIcon:p,leftIcon:u,iconSpacing:h,children:i};return a.jsxs(Se.button,{ref:UN(t,j),as:C,type:g??E,"data-active":dt(l),"data-loading":dt(s),__css:_,className:Je("chakra-button",b),...S,disabled:o||s,children:[s&&y==="start"&&a.jsx(j1,{className:"chakra-button__spinner--start",label:m,placement:"start",spacing:h,children:x}),s?m||a.jsx(Se.span,{opacity:0,children:a.jsx(rS,{...I})}):a.jsx(rS,{...I}),s&&y==="end"&&a.jsx(j1,{className:"chakra-button__spinner--end",label:m,placement:"end",spacing:h,children:x})]})});Ja.displayName="Button";function rS(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(_1,{marginEnd:o,children:t}),r,n&&a.jsx(_1,{marginStart:o,children:n})]})}var Cs=_e((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...l}=e,i=n||r,u=d.isValidElement(i)?d.cloneElement(i,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(Ja,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...l,children:u})});Cs.displayName="IconButton";var[A1e,yL]=Wt({name:"CheckboxGroupContext",strict:!1});function CL(e){const[t,n]=d.useState(e),[r,o]=d.useState(!1);return e!==t&&(o(!0),n(e)),r}function wL(e){return a.jsx(Se.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:a.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function SL(e){return a.jsx(Se.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:a.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function kL(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?SL:wL;return n||t?a.jsx(Se.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[_L,p5]=Wt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[jL,Od]=Wt({strict:!1,name:"FormControlContext"});function IL(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...l}=e,i=d.useId(),u=t||`field-${i}`,p=`${u}-label`,m=`${u}-feedback`,h=`${u}-helptext`,[g,x]=d.useState(!1),[y,b]=d.useState(!1),[C,S]=d.useState(!1),_=d.useCallback((D={},R=null)=>({id:h,...D,ref:Pt(R,A=>{A&&b(!0)})}),[h]),j=d.useCallback((D={},R=null)=>({...D,ref:R,"data-focus":dt(C),"data-disabled":dt(o),"data-invalid":dt(r),"data-readonly":dt(s),id:D.id!==void 0?D.id:p,htmlFor:D.htmlFor!==void 0?D.htmlFor:u}),[u,o,C,r,s,p]),E=d.useCallback((D={},R=null)=>({id:m,...D,ref:Pt(R,A=>{A&&x(!0)}),"aria-live":"polite"}),[m]),I=d.useCallback((D={},R=null)=>({...D,...l,ref:R,role:"group"}),[l]),M=d.useCallback((D={},R=null)=>({...D,ref:R,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!C,onFocus:()=>S(!0),onBlur:()=>S(!1),hasFeedbackText:g,setHasFeedbackText:x,hasHelpText:y,setHasHelpText:b,id:u,labelId:p,feedbackId:m,helpTextId:h,htmlProps:l,getHelpTextProps:_,getErrorMessageProps:E,getRootProps:I,getLabelProps:j,getRequiredIndicatorProps:M}}var Zt=_e(function(t,n){const r=Un("Form",t),o=on(t),{getRootProps:s,htmlProps:l,...i}=IL(o),u=Je("chakra-form-control",t.className);return a.jsx(jL,{value:i,children:a.jsx(_L,{value:r,children:a.jsx(Se.div,{...s({},n),className:u,__css:r.container})})})});Zt.displayName="FormControl";var m5=_e(function(t,n){const r=Od(),o=p5(),s=Je("chakra-form__helper-text",t.className);return a.jsx(Se.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});m5.displayName="FormHelperText";var In=_e(function(t,n){var r;const o=al("FormLabel",t),s=on(t),{className:l,children:i,requiredIndicator:u=a.jsx(h5,{}),optionalIndicator:p=null,...m}=s,h=Od(),g=(r=h==null?void 0:h.getLabelProps(m,n))!=null?r:{ref:n,...m};return a.jsxs(Se.label,{...g,className:Je("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[i,h!=null&&h.isRequired?u:p]})});In.displayName="FormLabel";var h5=_e(function(t,n){const r=Od(),o=p5();if(!(r!=null&&r.isRequired))return null;const s=Je("chakra-form__required-indicator",t.className);return a.jsx(Se.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});h5.displayName="RequiredIndicator";function yb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=Cb(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":bo(n),"aria-required":bo(o),"aria-readonly":bo(r)}}function Cb(e){var t,n,r;const o=Od(),{id:s,disabled:l,readOnly:i,required:u,isRequired:p,isInvalid:m,isReadOnly:h,isDisabled:g,onFocus:x,onBlur:y,...b}=e,C=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&C.push(o.feedbackId),o!=null&&o.hasHelpText&&C.push(o.helpTextId),{...b,"aria-describedby":C.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=l??g)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=i??h)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=u??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:m??(o==null?void 0:o.isInvalid),onFocus:Fe(o==null?void 0:o.onFocus,x),onBlur:Fe(o==null?void 0:o.onBlur,y)}}var wb={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},g5=Se("span",{baseStyle:wb});g5.displayName="VisuallyHidden";var PL=Se("input",{baseStyle:wb});PL.displayName="VisuallyHiddenInput";const EL=()=>typeof document<"u";let oS=!1,Dd=null,Wl=!1,I1=!1;const P1=new Set;function Sb(e,t){P1.forEach(n=>n(e,t))}const ML=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function OL(e){return!(e.metaKey||!ML&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function sS(e){Wl=!0,OL(e)&&(Dd="keyboard",Sb("keyboard",e))}function Di(e){if(Dd="pointer",e.type==="mousedown"||e.type==="pointerdown"){Wl=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;Sb("pointer",e)}}function DL(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function RL(e){DL(e)&&(Wl=!0,Dd="virtual")}function AL(e){e.target===window||e.target===document||(!Wl&&!I1&&(Dd="virtual",Sb("virtual",e)),Wl=!1,I1=!1)}function TL(){Wl=!1,I1=!0}function aS(){return Dd!=="pointer"}function $L(){if(!EL()||oS)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Wl=!0,e.apply(this,n)},document.addEventListener("keydown",sS,!0),document.addEventListener("keyup",sS,!0),document.addEventListener("click",RL,!0),window.addEventListener("focus",AL,!0),window.addEventListener("blur",TL,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Di,!0),document.addEventListener("pointermove",Di,!0),document.addEventListener("pointerup",Di,!0)):(document.addEventListener("mousedown",Di,!0),document.addEventListener("mousemove",Di,!0),document.addEventListener("mouseup",Di,!0)),oS=!0}function v5(e){$L(),e(aS());const t=()=>e(aS());return P1.add(t),()=>{P1.delete(t)}}function NL(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function x5(e={}){const t=Cb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:l,onBlur:i,onFocus:u,"aria-describedby":p}=t,{defaultChecked:m,isChecked:h,isFocusable:g,onChange:x,isIndeterminate:y,name:b,value:C,tabIndex:S=void 0,"aria-label":_,"aria-labelledby":j,"aria-invalid":E,...I}=e,M=NL(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=un(x),R=un(i),A=un(u),[O,$]=d.useState(!1),[X,z]=d.useState(!1),[V,Q]=d.useState(!1),[G,F]=d.useState(!1);d.useEffect(()=>v5($),[]);const U=d.useRef(null),[T,B]=d.useState(!0),[Y,re]=d.useState(!!m),ae=h!==void 0,oe=ae?h:Y,q=d.useCallback(fe=>{if(r||n){fe.preventDefault();return}ae||re(oe?fe.target.checked:y?!0:fe.target.checked),D==null||D(fe)},[r,n,oe,ae,y,D]);oc(()=>{U.current&&(U.current.indeterminate=!!y)},[y]),pa(()=>{n&&z(!1)},[n,z]),oc(()=>{const fe=U.current;if(!(fe!=null&&fe.form))return;const Oe=()=>{re(!!m)};return fe.form.addEventListener("reset",Oe),()=>{var je;return(je=fe.form)==null?void 0:je.removeEventListener("reset",Oe)}},[]);const K=n&&!g,ee=d.useCallback(fe=>{fe.key===" "&&F(!0)},[F]),ce=d.useCallback(fe=>{fe.key===" "&&F(!1)},[F]);oc(()=>{if(!U.current)return;U.current.checked!==oe&&re(U.current.checked)},[U.current]);const J=d.useCallback((fe={},Oe=null)=>{const je=$e=>{X&&$e.preventDefault(),F(!0)};return{...fe,ref:Oe,"data-active":dt(G),"data-hover":dt(V),"data-checked":dt(oe),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r),"aria-hidden":!0,onMouseDown:Fe(fe.onMouseDown,je),onMouseUp:Fe(fe.onMouseUp,()=>F(!1)),onMouseEnter:Fe(fe.onMouseEnter,()=>Q(!0)),onMouseLeave:Fe(fe.onMouseLeave,()=>Q(!1))}},[G,oe,n,X,O,V,y,s,r]),ie=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,"data-active":dt(G),"data-hover":dt(V),"data-checked":dt(oe),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r)}),[G,oe,n,X,O,V,y,s,r]),de=d.useCallback((fe={},Oe=null)=>({...M,...fe,ref:Pt(Oe,je=>{je&&B(je.tagName==="LABEL")}),onClick:Fe(fe.onClick,()=>{var je;T||((je=U.current)==null||je.click(),requestAnimationFrame(()=>{var $e;($e=U.current)==null||$e.focus({preventScroll:!0})}))}),"data-disabled":dt(n),"data-checked":dt(oe),"data-invalid":dt(s)}),[M,n,oe,s,T]),xe=d.useCallback((fe={},Oe=null)=>({...fe,ref:Pt(U,Oe),type:"checkbox",name:b,value:C,id:l,tabIndex:S,onChange:Fe(fe.onChange,q),onBlur:Fe(fe.onBlur,R,()=>z(!1)),onFocus:Fe(fe.onFocus,A,()=>z(!0)),onKeyDown:Fe(fe.onKeyDown,ee),onKeyUp:Fe(fe.onKeyUp,ce),required:o,checked:oe,disabled:K,readOnly:r,"aria-label":_,"aria-labelledby":j,"aria-invalid":E?!!E:s,"aria-describedby":p,"aria-disabled":n,style:wb}),[b,C,l,q,R,A,ee,ce,o,oe,K,r,_,j,E,s,p,n,S]),we=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,onMouseDown:Fe(fe.onMouseDown,LL),"data-disabled":dt(n),"data-checked":dt(oe),"data-invalid":dt(s)}),[oe,n,s]);return{state:{isInvalid:s,isFocused:X,isChecked:oe,isActive:G,isHovered:V,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:de,getCheckboxProps:J,getIndicatorProps:ie,getInputProps:xe,getLabelProps:we,htmlProps:M}}function LL(e){e.preventDefault(),e.stopPropagation()}var zL={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},FL={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},BL=ma({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),HL=ma({from:{opacity:0},to:{opacity:1}}),VL=ma({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Rd=_e(function(t,n){const r=yL(),o={...r,...t},s=Un("Checkbox",o),l=on(t),{spacing:i="0.5rem",className:u,children:p,iconColor:m,iconSize:h,icon:g=a.jsx(kL,{}),isChecked:x,isDisabled:y=r==null?void 0:r.isDisabled,onChange:b,inputProps:C,...S}=l;let _=x;r!=null&&r.value&&l.value&&(_=r.value.includes(l.value));let j=b;r!=null&&r.onChange&&l.value&&(j=xh(r.onChange,b));const{state:E,getInputProps:I,getCheckboxProps:M,getLabelProps:D,getRootProps:R}=x5({...S,isDisabled:y,isChecked:_,onChange:j}),A=CL(E.isChecked),O=d.useMemo(()=>({animation:A?E.isIndeterminate?`${HL} 20ms linear, ${VL} 200ms linear`:`${BL} 200ms linear`:void 0,fontSize:h,color:m,...s.icon}),[m,h,A,E.isIndeterminate,s.icon]),$=d.cloneElement(g,{__css:O,isIndeterminate:E.isIndeterminate,isChecked:E.isChecked});return a.jsxs(Se.label,{__css:{...FL,...s.container},className:Je("chakra-checkbox",u),...R(),children:[a.jsx("input",{className:"chakra-checkbox__input",...I(C,n)}),a.jsx(Se.span,{__css:{...zL,...s.control},className:"chakra-checkbox__control",...M(),children:$}),p&&a.jsx(Se.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:i,...s.label},children:p})]})});Rd.displayName="Checkbox";function WL(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function kb(e,t){let n=WL(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function E1(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function cm(e,t,n){return(e-t)*100/(n-t)}function b5(e,t,n){return(n-t)*e+t}function M1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=E1(n);return kb(r,o)}function lc(e,t,n){return e==null?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function UL(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:l=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER,keepWithinRange:u=!0}=e,p=un(t),[m,h]=d.useState(()=>{var O;return r==null?"":(O=cv(r,s,n))!=null?O:""}),g=typeof o<"u",x=g?o:m,y=y5(za(x),s),b=n??y,C=d.useCallback(O=>{O!==x&&(g||h(O.toString()),p==null||p(O.toString(),za(O)))},[p,g,x]),S=d.useCallback(O=>{let $=O;return u&&($=lc($,l,i)),kb($,b)},[b,u,i,l]),_=d.useCallback((O=s)=>{let $;x===""?$=za(O):$=za(x)+O,$=S($),C($)},[S,s,C,x]),j=d.useCallback((O=s)=>{let $;x===""?$=za(-O):$=za(x)-O,$=S($),C($)},[S,s,C,x]),E=d.useCallback(()=>{var O;let $;r==null?$="":$=(O=cv(r,s,n))!=null?O:l,C($)},[r,n,s,C,l]),I=d.useCallback(O=>{var $;const X=($=cv(O,s,b))!=null?$:l;C(X)},[b,s,C,l]),M=za(x);return{isOutOfRange:M>i||M<l,isAtMax:M===i,isAtMin:M===l,precision:b,value:x,valueAsNumber:M,update:C,reset:E,increment:_,decrement:j,clamp:S,cast:I,setValue:h}}function za(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function y5(e,t){return Math.max(E1(t),E1(e))}function cv(e,t,n){const r=za(e);if(Number.isNaN(r))return;const o=y5(r,t);return kb(r,n??o)}var[GL,C5]=Wt({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[KL,_b]=Wt({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),w5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},Eh=_e(function(t,n){const{getInputProps:r}=_b(),o=C5(),s=r(t,n),l=Je("chakra-editable__input",t.className);return a.jsx(Se.input,{...s,__css:{outline:0,...w5,...o.input},className:l})});Eh.displayName="EditableInput";var Mh=_e(function(t,n){const{getPreviewProps:r}=_b(),o=C5(),s=r(t,n),l=Je("chakra-editable__preview",t.className);return a.jsx(Se.span,{...s,__css:{cursor:"text",display:"inline-block",...w5,...o.preview},className:l})});Mh.displayName="EditablePreview";function Tl(e,t,n,r){const o=un(n);return d.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,o,r)}}function qL(e){return"current"in e}var S5=()=>typeof window<"u";function XL(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var QL=e=>S5()&&e.test(navigator.vendor),YL=e=>S5()&&e.test(XL()),ZL=()=>YL(/mac|iphone|ipad|ipod/i),JL=()=>ZL()&&QL(/apple/i);function k5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,l;return(l=(s=t.current)==null?void 0:s.ownerDocument)!=null?l:document};Tl(o,"pointerdown",s=>{if(!JL()||!r)return;const l=s.target,u=(n??[t]).some(p=>{const m=qL(p)?p.current:p;return(m==null?void 0:m.contains(l))||m===l});o().activeElement!==l&&u&&(s.preventDefault(),l.focus())})}function lS(e,t){return e?e===t||e.contains(t):!1}function ez(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:l,defaultValue:i,startWithEditView:u,isPreviewFocusable:p=!0,submitOnBlur:m=!0,selectAllOnFocus:h=!0,placeholder:g,onEdit:x,finalFocusRef:y,...b}=e,C=un(x),S=!!(u&&!l),[_,j]=d.useState(S),[E,I]=Ed({defaultValue:i||"",value:s,onChange:t}),[M,D]=d.useState(E),R=d.useRef(null),A=d.useRef(null),O=d.useRef(null),$=d.useRef(null),X=d.useRef(null);k5({ref:R,enabled:_,elements:[$,X]});const z=!_&&!l;oc(()=>{var J,ie;_&&((J=R.current)==null||J.focus(),h&&((ie=R.current)==null||ie.select()))},[]),pa(()=>{var J,ie,de,xe;if(!_){y?(J=y.current)==null||J.focus():(ie=O.current)==null||ie.focus();return}(de=R.current)==null||de.focus(),h&&((xe=R.current)==null||xe.select()),C==null||C()},[_,C,h]);const V=d.useCallback(()=>{z&&j(!0)},[z]),Q=d.useCallback(()=>{D(E)},[E]),G=d.useCallback(()=>{j(!1),I(M),n==null||n(M),o==null||o(M)},[n,o,I,M]),F=d.useCallback(()=>{j(!1),D(E),r==null||r(E),o==null||o(M)},[E,r,o,M]);d.useEffect(()=>{if(_)return;const J=R.current;(J==null?void 0:J.ownerDocument.activeElement)===J&&(J==null||J.blur())},[_]);const U=d.useCallback(J=>{I(J.currentTarget.value)},[I]),T=d.useCallback(J=>{const ie=J.key,xe={Escape:G,Enter:we=>{!we.shiftKey&&!we.metaKey&&F()}}[ie];xe&&(J.preventDefault(),xe(J))},[G,F]),B=d.useCallback(J=>{const ie=J.key,xe={Escape:G}[ie];xe&&(J.preventDefault(),xe(J))},[G]),Y=E.length===0,re=d.useCallback(J=>{var ie;if(!_)return;const de=J.currentTarget.ownerDocument,xe=(ie=J.relatedTarget)!=null?ie:de.activeElement,we=lS($.current,xe),ve=lS(X.current,xe);!we&&!ve&&(m?F():G())},[m,F,G,_]),ae=d.useCallback((J={},ie=null)=>{const de=z&&p?0:void 0;return{...J,ref:Pt(ie,A),children:Y?g:E,hidden:_,"aria-disabled":bo(l),tabIndex:de,onFocus:Fe(J.onFocus,V,Q)}},[l,_,z,p,Y,V,Q,g,E]),oe=d.useCallback((J={},ie=null)=>({...J,hidden:!_,placeholder:g,ref:Pt(ie,R),disabled:l,"aria-disabled":bo(l),value:E,onBlur:Fe(J.onBlur,re),onChange:Fe(J.onChange,U),onKeyDown:Fe(J.onKeyDown,T),onFocus:Fe(J.onFocus,Q)}),[l,_,re,U,T,Q,g,E]),q=d.useCallback((J={},ie=null)=>({...J,hidden:!_,placeholder:g,ref:Pt(ie,R),disabled:l,"aria-disabled":bo(l),value:E,onBlur:Fe(J.onBlur,re),onChange:Fe(J.onChange,U),onKeyDown:Fe(J.onKeyDown,B),onFocus:Fe(J.onFocus,Q)}),[l,_,re,U,B,Q,g,E]),K=d.useCallback((J={},ie=null)=>({"aria-label":"Edit",...J,type:"button",onClick:Fe(J.onClick,V),ref:Pt(ie,O),disabled:l}),[V,l]),ee=d.useCallback((J={},ie=null)=>({...J,"aria-label":"Submit",ref:Pt(X,ie),type:"button",onClick:Fe(J.onClick,F),disabled:l}),[F,l]),ce=d.useCallback((J={},ie=null)=>({"aria-label":"Cancel",id:"cancel",...J,ref:Pt($,ie),type:"button",onClick:Fe(J.onClick,G),disabled:l}),[G,l]);return{isEditing:_,isDisabled:l,isValueEmpty:Y,value:E,onEdit:V,onCancel:G,onSubmit:F,getPreviewProps:ae,getInputProps:oe,getTextareaProps:q,getEditButtonProps:K,getSubmitButtonProps:ee,getCancelButtonProps:ce,htmlProps:b}}var Oh=_e(function(t,n){const r=Un("Editable",t),o=on(t),{htmlProps:s,...l}=ez(o),{isEditing:i,onSubmit:u,onCancel:p,onEdit:m}=l,h=Je("chakra-editable",t.className),g=Vx(t.children,{isEditing:i,onSubmit:u,onCancel:p,onEdit:m});return a.jsx(KL,{value:l,children:a.jsx(GL,{value:r,children:a.jsx(Se.div,{ref:n,...s,className:h,children:g})})})});Oh.displayName="Editable";function _5(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=_b();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var j5={exports:{}},tz="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",nz=tz,rz=nz;function I5(){}function P5(){}P5.resetWarningCache=I5;var oz=function(){function e(r,o,s,l,i,u){if(u!==rz){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:P5,resetWarningCache:I5};return n.PropTypes=n,n};j5.exports=oz();var sz=j5.exports;const en=Cd(sz);var O1="data-focus-lock",E5="data-focus-lock-disabled",az="data-no-focus-lock",lz="data-autofocus-inside",iz="data-no-autofocus";function cz(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function uz(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function M5(e,t){return uz(t||null,function(n){return e.forEach(function(r){return cz(r,n)})})}var uv={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},vs=function(){return vs=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},vs.apply(this,arguments)};function O5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Lc(e,t,n,r){function o(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function i(m){try{p(r.next(m))}catch(h){l(h)}}function u(m){try{p(r.throw(m))}catch(h){l(h)}}function p(m){m.done?s(m.value):o(m.value).then(i,u)}p((r=r.apply(e,t||[])).next())})}function zc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(p){return function(m){return u([p,m])}}function u(p){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(m){p=[6,m],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function iS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],l;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(i){l={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return s}function D1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function D5(e){return e}function R5(e,t){t===void 0&&(t=D5);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(i){return i!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var i=n;n=[],i.forEach(s),l=n}var u=function(){var m=l;l=[],m.forEach(s)},p=function(){return Promise.resolve().then(u)};p(),n={push:function(m){l.push(m),p()},filter:function(m){return l=l.filter(m),n}}}};return o}function jb(e,t){return t===void 0&&(t=D5),R5(e,t)}function A5(e){e===void 0&&(e={});var t=R5(null);return t.options=vs({async:!0,ssr:!1},e),t}var T5=function(e){var t=e.sideCar,n=O5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,vs({},n))};T5.isSideCarExport=!0;function dz(e,t){return e.useMedium(t),T5}var $5=jb({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),N5=jb(),fz=jb(),pz=A5({async:!0}),mz=[],Ib=d.forwardRef(function(t,n){var r,o=d.useState(),s=o[0],l=o[1],i=d.useRef(),u=d.useRef(!1),p=d.useRef(null),m=t.children,h=t.disabled,g=t.noFocusGuards,x=t.persistentFocus,y=t.crossFrame,b=t.autoFocus;t.allowTextSelection;var C=t.group,S=t.className,_=t.whiteList,j=t.hasPositiveIndices,E=t.shards,I=E===void 0?mz:E,M=t.as,D=M===void 0?"div":M,R=t.lockProps,A=R===void 0?{}:R,O=t.sideCar,$=t.returnFocus,X=t.focusOptions,z=t.onActivation,V=t.onDeactivation,Q=d.useState({}),G=Q[0],F=d.useCallback(function(){p.current=p.current||document&&document.activeElement,i.current&&z&&z(i.current),u.current=!0},[z]),U=d.useCallback(function(){u.current=!1,V&&V(i.current)},[V]);d.useEffect(function(){h||(p.current=null)},[]);var T=d.useCallback(function(ee){var ce=p.current;if(ce&&ce.focus){var J=typeof $=="function"?$(ce):$;if(J){var ie=typeof J=="object"?J:void 0;p.current=null,ee?Promise.resolve().then(function(){return ce.focus(ie)}):ce.focus(ie)}}},[$]),B=d.useCallback(function(ee){u.current&&$5.useMedium(ee)},[]),Y=N5.useMedium,re=d.useCallback(function(ee){i.current!==ee&&(i.current=ee,l(ee))},[]),ae=fn((r={},r[E5]=h&&"disabled",r[O1]=C,r),A),oe=g!==!0,q=oe&&g!=="tail",K=M5([n,re]);return d.createElement(d.Fragment,null,oe&&[d.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:uv}),j?d.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:uv}):null],!h&&d.createElement(O,{id:G,sideCar:pz,observed:s,disabled:h,persistentFocus:x,crossFrame:y,autoFocus:b,whiteList:_,shards:I,onActivation:F,onDeactivation:U,returnFocus:T,focusOptions:X}),d.createElement(D,fn({ref:K},ae,{className:S,onBlur:Y,onFocus:B}),m),q&&d.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:uv}))});Ib.propTypes={};Ib.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const L5=Ib;function R1(e,t){return R1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},R1(e,t)}function hz(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,R1(e,t)}function gz(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],l;function i(){l=e(s.map(function(p){return p.props})),t(l)}var u=function(p){hz(m,p);function m(){return p.apply(this,arguments)||this}m.peek=function(){return l};var h=m.prototype;return h.componentDidMount=function(){s.push(this),i()},h.componentDidUpdate=function(){i()},h.componentWillUnmount=function(){var x=s.indexOf(this);s.splice(x,1),i()},h.render=function(){return H.createElement(o,this.props)},m}(d.PureComponent);return KD(u,"displayName","SideEffect("+n(o)+")"),u}}var Rs=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},um=function(e){return Array.isArray(e)?e:[e]},z5=function(e){return Array.isArray(e)?e[0]:e},vz=function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!t||!t.getPropertyValue?!1:t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"},F5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},B5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},xz=function(e,t){return!e||B5(e)||!vz(e)&&t(F5(e))},H5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=xz(t,H5.bind(void 0,e));return e.set(t,r),r},bz=function(e,t){return e&&!B5(e)?wz(e)?t(F5(e)):!1:!0},V5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=bz(t,V5.bind(void 0,e));return e.set(t,r),r},W5=function(e){return e.dataset},yz=function(e){return e.tagName==="BUTTON"},U5=function(e){return e.tagName==="INPUT"},G5=function(e){return U5(e)&&e.type==="radio"},Cz=function(e){return!((U5(e)||yz(e))&&(e.type==="hidden"||e.disabled))},wz=function(e){var t=e.getAttribute(iz);return![!0,"true",""].includes(t)},Pb=function(e){var t;return!!(e&&(!((t=W5(e))===null||t===void 0)&&t.focusGuard))},dm=function(e){return!Pb(e)},Sz=function(e){return!!e},kz=function(e,t){var n=e.tabIndex-t.tabIndex,r=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||r},K5=function(e,t,n){return Rs(e).map(function(r,o){return{node:r,index:o,tabIndex:n&&r.tabIndex===-1?(r.dataset||{}).focusGuard?0:-1:r.tabIndex}}).filter(function(r){return!t||r.tabIndex>=0}).sort(kz)},_z=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Eb=_z.join(","),jz="".concat(Eb,", [data-focus-guard]"),q5=function(e,t){return Rs((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?jz:Eb)?[r]:[],q5(r))},[])},Iz=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Dh([e.contentDocument.body],t):[e]},Dh=function(e,t){return e.reduce(function(n,r){var o,s=q5(r,t),l=(o=[]).concat.apply(o,s.map(function(i){return Iz(i,t)}));return n.concat(l,r.parentNode?Rs(r.parentNode.querySelectorAll(Eb)).filter(function(i){return i===r}):[])},[])},Pz=function(e){var t=e.querySelectorAll("[".concat(lz,"]"));return Rs(t).map(function(n){return Dh([n])}).reduce(function(n,r){return n.concat(r)},[])},Mb=function(e,t){return Rs(e).filter(function(n){return H5(t,n)}).filter(function(n){return Cz(n)})},cS=function(e,t){return t===void 0&&(t=new Map),Rs(e).filter(function(n){return V5(t,n)})},A1=function(e,t,n){return K5(Mb(Dh(e,n),t),!0,n)},uS=function(e,t){return K5(Mb(Dh(e),t),!1)},Ez=function(e,t){return Mb(Pz(e),t)},ic=function(e,t){return e.shadowRoot?ic(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Rs(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?ic(o,t):!1}return ic(n,t)})},Mz=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(l,i){return!t.has(i)})},X5=function(e){return e.parentNode?X5(e.parentNode):e},Ob=function(e){var t=um(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(O1);return n.push.apply(n,o?Mz(Rs(X5(r).querySelectorAll("[".concat(O1,'="').concat(o,'"]:not([').concat(E5,'="disabled"])')))):[r]),n},[])},Oz=function(e){try{return e()}catch{return}},ed=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?ed(t.shadowRoot):t instanceof HTMLIFrameElement&&Oz(function(){return t.contentWindow.document})?ed(t.contentWindow.document):t}},Dz=function(e,t){return e===t},Rz=function(e,t){return!!Rs(e.querySelectorAll("iframe")).some(function(n){return Dz(n,t)})},Q5=function(e,t){return t===void 0&&(t=ed(z5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Ob(e).some(function(n){return ic(n,t)||Rz(n,t)})},Az=function(e){e===void 0&&(e=document);var t=ed(e);return t?Rs(e.querySelectorAll("[".concat(az,"]"))).some(function(n){return ic(n,t)}):!1},Tz=function(e,t){return t.filter(G5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Db=function(e,t){return G5(e)&&e.name?Tz(e,t):e},$z=function(e){var t=new Set;return e.forEach(function(n){return t.add(Db(n,e))}),e.filter(function(n){return t.has(n)})},dS=function(e){return e[0]&&e.length>1?Db(e[0],e):e[0]},fS=function(e,t){return e.length>1?e.indexOf(Db(e[t],e)):t},Y5="NEW_FOCUS",Nz=function(e,t,n,r){var o=e.length,s=e[0],l=e[o-1],i=Pb(n);if(!(n&&e.indexOf(n)>=0)){var u=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):u,m=r?e.indexOf(r):-1,h=u-p,g=t.indexOf(s),x=t.indexOf(l),y=$z(t),b=n!==void 0?y.indexOf(n):-1,C=b-(r?y.indexOf(r):u),S=fS(e,0),_=fS(e,o-1);if(u===-1||m===-1)return Y5;if(!h&&m>=0)return m;if(u<=g&&i&&Math.abs(h)>1)return _;if(u>=x&&i&&Math.abs(h)>1)return S;if(h&&Math.abs(C)>1)return m;if(u<=g)return _;if(u>x)return S;if(h)return Math.abs(h)>1?m:(o+m+h)%o}},Lz=function(e){return function(t){var n,r=(n=W5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},zz=function(e,t,n){var r=e.map(function(s){var l=s.node;return l}),o=cS(r.filter(Lz(n)));return o&&o.length?dS(o):dS(cS(t))},T1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&T1(e.parentNode.host||e.parentNode,t),t},dv=function(e,t){for(var n=T1(e),r=T1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},Z5=function(e,t,n){var r=um(e),o=um(t),s=r[0],l=!1;return o.filter(Boolean).forEach(function(i){l=dv(l||i,i)||l,n.filter(Boolean).forEach(function(u){var p=dv(s,u);p&&(!l||ic(p,l)?l=p:l=dv(p,l))})}),l},Fz=function(e,t){return e.reduce(function(n,r){return n.concat(Ez(r,t))},[])},Bz=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Sz)},Hz=function(e,t){var n=ed(um(e).length>0?document:z5(e).ownerDocument),r=Ob(e).filter(dm),o=Z5(n||e,e,r),s=new Map,l=uS(r,s),i=A1(r,s).filter(function(x){var y=x.node;return dm(y)});if(!(!i[0]&&(i=l,!i[0]))){var u=uS([o],s).map(function(x){var y=x.node;return y}),p=Bz(u,i),m=p.map(function(x){var y=x.node;return y}),h=Nz(m,u,n,t);if(h===Y5){var g=zz(l,m,Fz(r,s));if(g)return{node:g};console.warn("focus-lock: cannot find any node to move focus into");return}return h===void 0?h:p[h]}},Vz=function(e){var t=Ob(e).filter(dm),n=Z5(e,e,t),r=new Map,o=A1([n],r,!0),s=A1(t,r).filter(function(l){var i=l.node;return dm(i)}).map(function(l){var i=l.node;return i});return o.map(function(l){var i=l.node,u=l.index;return{node:i,index:u,lockItem:s.indexOf(i)>=0,guard:Pb(i)}})},Wz=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},fv=0,pv=!1,J5=function(e,t,n){n===void 0&&(n={});var r=Hz(e,t);if(!pv&&r){if(fv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),pv=!0,setTimeout(function(){pv=!1},1);return}fv++,Wz(r.node,n.focusOptions),fv--}};function Rb(e){setTimeout(e,1)}var Uz=function(){return document&&document.activeElement===document.body},Gz=function(){return Uz()||Az()},cc=null,Ji=null,uc=null,td=!1,Kz=function(){return!0},qz=function(t){return(cc.whiteList||Kz)(t)},Xz=function(t,n){uc={observerNode:t,portaledElement:n}},Qz=function(t){return uc&&uc.portaledElement===t};function pS(e,t,n,r){var o=null,s=e;do{var l=r[s];if(l.guard)l.node.dataset.focusAutoGuard&&(o=l);else if(l.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var Yz=function(t){return t&&"current"in t?t.current:t},Zz=function(t){return t?!!td:td==="meanwhile"},Jz=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},eF=function(t,n){return n.some(function(r){return Jz(t,r,r)})},fm=function(){var t=!1;if(cc){var n=cc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,l=n.shards,i=n.crossFrame,u=n.focusOptions,p=r||uc&&uc.portaledElement,m=document&&document.activeElement;if(p){var h=[p].concat(l.map(Yz).filter(Boolean));if((!m||qz(m))&&(o||Zz(i)||!Gz()||!Ji&&s)&&(p&&!(Q5(h)||m&&eF(m,h)||Qz(m))&&(document&&!Ji&&m&&!s?(m.blur&&m.blur(),document.body.focus()):(t=J5(h,Ji,{focusOptions:u}),uc={})),td=!1,Ji=document&&document.activeElement),document){var g=document&&document.activeElement,x=Vz(h),y=x.map(function(b){var C=b.node;return C}).indexOf(g);y>-1&&(x.filter(function(b){var C=b.guard,S=b.node;return C&&S.dataset.focusAutoGuard}).forEach(function(b){var C=b.node;return C.removeAttribute("tabIndex")}),pS(y,x.length,1,x),pS(y,-1,-1,x))}}}return t},e3=function(t){fm()&&t&&(t.stopPropagation(),t.preventDefault())},Ab=function(){return Rb(fm)},tF=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Xz(r,n)},nF=function(){return null},t3=function(){td="just",Rb(function(){td="meanwhile"})},rF=function(){document.addEventListener("focusin",e3),document.addEventListener("focusout",Ab),window.addEventListener("blur",t3)},oF=function(){document.removeEventListener("focusin",e3),document.removeEventListener("focusout",Ab),window.removeEventListener("blur",t3)};function sF(e){return e.filter(function(t){var n=t.disabled;return!n})}function aF(e){var t=e.slice(-1)[0];t&&!cc&&rF();var n=cc,r=n&&t&&t.id===n.id;cc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Ji=null,(!r||n.observed!==t.observed)&&t.onActivation(),fm(),Rb(fm)):(oF(),Ji=null)}$5.assignSyncMedium(tF);N5.assignMedium(Ab);fz.assignMedium(function(e){return e({moveFocusInside:J5,focusInside:Q5})});const lF=gz(sF,aF)(nF);var n3=d.forwardRef(function(t,n){return d.createElement(L5,fn({sideCar:lF,ref:n},t))}),r3=L5.propTypes||{};r3.sideCar;fN(r3,["sideCar"]);n3.propTypes={};const mS=n3;function o3(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Tb(e){var t;if(!o3(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function iF(e){var t,n;return(n=(t=s3(e))==null?void 0:t.defaultView)!=null?n:window}function s3(e){return o3(e)?e.ownerDocument:document}function cF(e){return s3(e).activeElement}function uF(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function dF(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function a3(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Tb(e)&&uF(e)?e:a3(dF(e))}var l3=e=>e.hasAttribute("tabindex"),fF=e=>l3(e)&&e.tabIndex===-1;function pF(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function i3(e){return e.parentElement&&i3(e.parentElement)?!0:e.hidden}function mF(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function c3(e){if(!Tb(e)||i3(e)||pF(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():mF(e)?!0:l3(e)}function hF(e){return e?Tb(e)&&c3(e)&&!fF(e):!1}var gF=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],vF=gF.join(),xF=e=>e.offsetWidth>0&&e.offsetHeight>0;function u3(e){const t=Array.from(e.querySelectorAll(vF));return t.unshift(e),t.filter(n=>c3(n)&&xF(n))}var hS,bF=(hS=mS.default)!=null?hS:mS,d3=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:l,autoFocus:i,persistentFocus:u,lockFocusAcrossFrames:p}=e,m=d.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&u3(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),h=d.useCallback(()=>{var x;(x=n==null?void 0:n.current)==null||x.focus()},[n]),g=o&&!n;return a.jsx(bF,{crossFrame:p,persistentFocus:u,autoFocus:i,disabled:l,onActivation:m,onDeactivation:h,returnFocus:g,children:s})};d3.displayName="FocusLock";var yF=DN?d.useLayoutEffect:d.useEffect;function $1(e,t=[]){const n=d.useRef(e);return yF(()=>{n.current=e}),d.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function CF(e,t,n,r){const o=$1(t);return d.useEffect(()=>{var s;const l=(s=sw(n))!=null?s:document;if(t)return l.addEventListener(e,o,r),()=>{l.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=sw(n))!=null?s:document).removeEventListener(e,o,r)}}function wF(e,t){const n=d.useId();return d.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function SF(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Lr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=$1(n),l=$1(t),[i,u]=d.useState(e.defaultIsOpen||!1),[p,m]=SF(r,i),h=wF(o,"disclosure"),g=d.useCallback(()=>{p||u(!1),l==null||l()},[p,l]),x=d.useCallback(()=>{p||u(!0),s==null||s()},[p,s]),y=d.useCallback(()=>{(m?g:x)()},[m,x,g]);return{isOpen:!!m,onOpen:x,onClose:g,onToggle:y,isControlled:p,getButtonProps:(b={})=>({...b,"aria-expanded":m,"aria-controls":h,onClick:qD(b.onClick,y)}),getDisclosureProps:(b={})=>({...b,hidden:!m,id:h})}}var[kF,_F]=Wt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),f3=_e(function(t,n){const r=Un("Input",t),{children:o,className:s,...l}=on(t),i=Je("chakra-input__group",s),u={},p=Ph(o),m=r.field;p.forEach(g=>{var x,y;r&&(m&&g.type.id==="InputLeftElement"&&(u.paddingStart=(x=m.height)!=null?x:m.h),m&&g.type.id==="InputRightElement"&&(u.paddingEnd=(y=m.height)!=null?y:m.h),g.type.id==="InputRightAddon"&&(u.borderEndRadius=0),g.type.id==="InputLeftAddon"&&(u.borderStartRadius=0))});const h=p.map(g=>{var x,y;const b=eI({size:((x=g.props)==null?void 0:x.size)||t.size,variant:((y=g.props)==null?void 0:y.variant)||t.variant});return g.type.id!=="Input"?d.cloneElement(g,b):d.cloneElement(g,Object.assign(b,u,g.props))});return a.jsx(Se.div,{className:i,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...l,children:a.jsx(kF,{value:r,children:h})})});f3.displayName="InputGroup";var jF=Se("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),Rh=_e(function(t,n){var r,o;const{placement:s="left",...l}=t,i=_F(),u=i.field,m={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=u==null?void 0:u.height)!=null?r:u==null?void 0:u.h,height:(o=u==null?void 0:u.height)!=null?o:u==null?void 0:u.h,fontSize:u==null?void 0:u.fontSize,...i.element};return a.jsx(jF,{ref:n,__css:m,...l})});Rh.id="InputElement";Rh.displayName="InputElement";var p3=_e(function(t,n){const{className:r,...o}=t,s=Je("chakra-input__left-element",r);return a.jsx(Rh,{ref:n,placement:"left",className:s,...o})});p3.id="InputLeftElement";p3.displayName="InputLeftElement";var $b=_e(function(t,n){const{className:r,...o}=t,s=Je("chakra-input__right-element",r);return a.jsx(Rh,{ref:n,placement:"right",className:s,...o})});$b.id="InputRightElement";$b.displayName="InputRightElement";var Ah=_e(function(t,n){const{htmlSize:r,...o}=t,s=Un("Input",o),l=on(o),i=yb(l),u=Je("chakra-input",t.className);return a.jsx(Se.input,{size:r,...i,__css:s.field,ref:n,className:u})});Ah.displayName="Input";Ah.id="Input";var Th=_e(function(t,n){const r=al("Link",t),{className:o,isExternal:s,...l}=on(t);return a.jsx(Se.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Je("chakra-link",o),...l,__css:r})});Th.displayName="Link";var[IF,m3]=Wt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Nb=_e(function(t,n){const r=Un("List",t),{children:o,styleType:s="none",stylePosition:l,spacing:i,...u}=on(t),p=Ph(o),h=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return a.jsx(IF,{value:r,children:a.jsx(Se.ul,{ref:n,listStyleType:s,listStylePosition:l,role:"list",__css:{...r.container,...h},...u,children:p})})});Nb.displayName="List";var h3=_e((e,t)=>{const{as:n,...r}=e;return a.jsx(Nb,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});h3.displayName="OrderedList";var Ad=_e(function(t,n){const{as:r,...o}=t;return a.jsx(Nb,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Ad.displayName="UnorderedList";var ho=_e(function(t,n){const r=m3();return a.jsx(Se.li,{ref:n,...t,__css:r.item})});ho.displayName="ListItem";var PF=_e(function(t,n){const r=m3();return a.jsx(Tn,{ref:n,role:"presentation",...t,__css:r.icon})});PF.displayName="ListIcon";var el=_e(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:l,column:i,row:u,autoFlow:p,autoRows:m,templateRows:h,autoColumns:g,templateColumns:x,...y}=t,b={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:l,gridAutoColumns:g,gridColumn:i,gridRow:u,gridAutoFlow:p,gridAutoRows:m,gridTemplateRows:h,gridTemplateColumns:x};return a.jsx(Se.div,{ref:n,__css:b,...y})});el.displayName="Grid";function g3(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):u1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var ba=Se("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});ba.displayName="Spacer";var v3=e=>a.jsx(Se.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});v3.displayName="StackItem";function EF(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":g3(n,o=>r[o])}}var Lb=_e((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:l="0.5rem",wrap:i,children:u,divider:p,className:m,shouldWrapChildren:h,...g}=e,x=n?"row":r??"column",y=d.useMemo(()=>EF({spacing:l,direction:x}),[l,x]),b=!!p,C=!h&&!b,S=d.useMemo(()=>{const j=Ph(u);return C?j:j.map((E,I)=>{const M=typeof E.key<"u"?E.key:I,D=I+1===j.length,A=h?a.jsx(v3,{children:E},M):E;if(!b)return A;const O=d.cloneElement(p,{__css:y}),$=D?null:O;return a.jsxs(d.Fragment,{children:[A,$]},M)})},[p,y,b,C,h,u]),_=Je("chakra-stack",m);return a.jsx(Se.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:x,flexWrap:i,gap:b?void 0:l,className:_,...g,children:S})});Lb.displayName="Stack";var x3=_e((e,t)=>a.jsx(Lb,{align:"center",...e,direction:"column",ref:t}));x3.displayName="VStack";var zb=_e((e,t)=>a.jsx(Lb,{align:"center",...e,direction:"row",ref:t}));zb.displayName="HStack";function gS(e){return g3(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var nd=_e(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:l,rowEnd:i,rowSpan:u,rowStart:p,...m}=t,h=eI({gridArea:r,gridColumn:gS(o),gridRow:gS(u),gridColumnStart:s,gridColumnEnd:l,gridRowStart:p,gridRowEnd:i});return a.jsx(Se.div,{ref:n,__css:h,...m})});nd.displayName="GridItem";var As=_e(function(t,n){const r=al("Badge",t),{className:o,...s}=on(t);return a.jsx(Se.span,{ref:n,className:Je("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});As.displayName="Badge";var Yn=_e(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:l,borderWidth:i,borderStyle:u,borderColor:p,...m}=al("Divider",t),{className:h,orientation:g="horizontal",__css:x,...y}=on(t),b={vertical:{borderLeftWidth:r||l||i||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||i||"1px",width:"100%"}};return a.jsx(Se.hr,{ref:n,"aria-orientation":g,...y,__css:{...m,border:"0",borderColor:p,borderStyle:u,...b[g],...x},className:Je("chakra-divider",h)})});Yn.displayName="Divider";function MF(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function OF(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=d.useState([]),s=d.useRef(),l=()=>{s.current&&(clearTimeout(s.current),s.current=null)},i=()=>{l(),s.current=setTimeout(()=>{o([]),s.current=null},t)};d.useEffect(()=>l,[]);function u(p){return m=>{if(m.key==="Backspace"){const h=[...r];h.pop(),o(h);return}if(MF(m)){const h=r.concat(m.key);n(m)&&(m.preventDefault(),m.stopPropagation()),o(h),p(h.join("")),i()}}}return u}function DF(e,t,n,r){if(t==null)return r;if(!r)return e.find(l=>n(l).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function RF(){const e=d.useRef(new Map),t=e.current,n=d.useCallback((o,s,l,i)=>{e.current.set(l,{type:s,el:o,options:i}),o.addEventListener(s,l,i)},[]),r=d.useCallback((o,s,l,i)=>{o.removeEventListener(s,l,i),e.current.delete(l)},[]);return d.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function mv(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function b3(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:l,onMouseUp:i,onClick:u,onKeyDown:p,onKeyUp:m,tabIndex:h,onMouseOver:g,onMouseLeave:x,...y}=e,[b,C]=d.useState(!0),[S,_]=d.useState(!1),j=RF(),E=F=>{F&&F.tagName!=="BUTTON"&&C(!1)},I=b?h:h||0,M=n&&!r,D=d.useCallback(F=>{if(n){F.stopPropagation(),F.preventDefault();return}F.currentTarget.focus(),u==null||u(F)},[n,u]),R=d.useCallback(F=>{S&&mv(F)&&(F.preventDefault(),F.stopPropagation(),_(!1),j.remove(document,"keyup",R,!1))},[S,j]),A=d.useCallback(F=>{if(p==null||p(F),n||F.defaultPrevented||F.metaKey||!mv(F.nativeEvent)||b)return;const U=o&&F.key==="Enter";s&&F.key===" "&&(F.preventDefault(),_(!0)),U&&(F.preventDefault(),F.currentTarget.click()),j.add(document,"keyup",R,!1)},[n,b,p,o,s,j,R]),O=d.useCallback(F=>{if(m==null||m(F),n||F.defaultPrevented||F.metaKey||!mv(F.nativeEvent)||b)return;s&&F.key===" "&&(F.preventDefault(),_(!1),F.currentTarget.click())},[s,b,n,m]),$=d.useCallback(F=>{F.button===0&&(_(!1),j.remove(document,"mouseup",$,!1))},[j]),X=d.useCallback(F=>{if(F.button!==0)return;if(n){F.stopPropagation(),F.preventDefault();return}b||_(!0),F.currentTarget.focus({preventScroll:!0}),j.add(document,"mouseup",$,!1),l==null||l(F)},[n,b,l,j,$]),z=d.useCallback(F=>{F.button===0&&(b||_(!1),i==null||i(F))},[i,b]),V=d.useCallback(F=>{if(n){F.preventDefault();return}g==null||g(F)},[n,g]),Q=d.useCallback(F=>{S&&(F.preventDefault(),_(!1)),x==null||x(F)},[S,x]),G=Pt(t,E);return b?{...y,ref:G,type:"button","aria-disabled":M?void 0:n,disabled:M,onClick:D,onMouseDown:l,onMouseUp:i,onKeyUp:m,onKeyDown:p,onMouseOver:g,onMouseLeave:x}:{...y,ref:G,role:"button","data-active":dt(S),"aria-disabled":n?"true":void 0,tabIndex:M?void 0:I,onClick:D,onMouseDown:X,onMouseUp:z,onKeyUp:O,onKeyDown:A,onMouseOver:V,onMouseLeave:Q}}function AF(e){const t=e.current;if(!t)return!1;const n=cF(t);return!n||t.contains(n)?!1:!!hF(n)}function y3(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;pa(()=>{if(!s||AF(e))return;const l=(o==null?void 0:o.current)||e.current;let i;if(l)return i=requestAnimationFrame(()=>{l.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(i)}},[s,e,o])}var TF={preventScroll:!0,shouldFocus:!1};function $F(e,t=TF){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,l=NF(e)?e.current:e,i=o&&s,u=d.useRef(i),p=d.useRef(s);oc(()=>{!p.current&&s&&(u.current=i),p.current=s},[s,i]);const m=d.useCallback(()=>{if(!(!s||!l||!u.current)&&(u.current=!1,!l.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=u3(l);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[s,r,l,n]);pa(()=>{m()},[m]),Tl(l,"transitionend",m)}function NF(e){return"current"in e}var Ri=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),$n={arrowShadowColor:Ri("--popper-arrow-shadow-color"),arrowSize:Ri("--popper-arrow-size","8px"),arrowSizeHalf:Ri("--popper-arrow-size-half"),arrowBg:Ri("--popper-arrow-bg"),transformOrigin:Ri("--popper-transform-origin"),arrowOffset:Ri("--popper-arrow-offset")};function LF(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var zF={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},FF=e=>zF[e],vS={scroll:!0,resize:!0};function BF(e){let t;return typeof e=="object"?t={enabled:!0,options:{...vS,...e}}:t={enabled:e,options:vS},t}var HF={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},VF={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{xS(e)},effect:({state:e})=>()=>{xS(e)}},xS=e=>{e.elements.popper.style.setProperty($n.transformOrigin.var,FF(e.placement))},WF={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{UF(e)}},UF=e=>{var t;if(!e.placement)return;const n=GF(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:$n.arrowSize.varRef,height:$n.arrowSize.varRef,zIndex:-1});const r={[$n.arrowSizeHalf.var]:`calc(${$n.arrowSize.varRef} / 2 - 1px)`,[$n.arrowOffset.var]:`calc(${$n.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},GF=e=>{if(e.startsWith("top"))return{property:"bottom",value:$n.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:$n.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:$n.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:$n.arrowOffset.varRef}},KF={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{bS(e)},effect:({state:e})=>()=>{bS(e)}},bS=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=LF(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:$n.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},qF={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},XF={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function QF(e,t="ltr"){var n,r;const o=((n=qF[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=XF[e])!=null?r:o}var Ar="top",So="bottom",ko="right",Tr="left",Fb="auto",Td=[Ar,So,ko,Tr],yc="start",rd="end",YF="clippingParents",C3="viewport",_u="popper",ZF="reference",yS=Td.reduce(function(e,t){return e.concat([t+"-"+yc,t+"-"+rd])},[]),w3=[].concat(Td,[Fb]).reduce(function(e,t){return e.concat([t,t+"-"+yc,t+"-"+rd])},[]),JF="beforeRead",eB="read",tB="afterRead",nB="beforeMain",rB="main",oB="afterMain",sB="beforeWrite",aB="write",lB="afterWrite",iB=[JF,eB,tB,nB,rB,oB,sB,aB,lB];function Ss(e){return e?(e.nodeName||"").toLowerCase():null}function Jr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ul(e){var t=Jr(e).Element;return e instanceof t||e instanceof Element}function yo(e){var t=Jr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Bb(e){if(typeof ShadowRoot>"u")return!1;var t=Jr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function cB(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!yo(s)||!Ss(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(l){var i=o[l];i===!1?s.removeAttribute(l):s.setAttribute(l,i===!0?"":i)}))})}function uB(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),i=l.reduce(function(u,p){return u[p]="",u},{});!yo(o)||!Ss(o)||(Object.assign(o.style,i),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const dB={name:"applyStyles",enabled:!0,phase:"write",fn:cB,effect:uB,requires:["computeStyles"]};function ws(e){return e.split("-")[0]}var $l=Math.max,pm=Math.min,Cc=Math.round;function N1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function S3(){return!/^((?!chrome|android).)*safari/i.test(N1())}function wc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&yo(e)&&(o=e.offsetWidth>0&&Cc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Cc(r.height)/e.offsetHeight||1);var l=Ul(e)?Jr(e):window,i=l.visualViewport,u=!S3()&&n,p=(r.left+(u&&i?i.offsetLeft:0))/o,m=(r.top+(u&&i?i.offsetTop:0))/s,h=r.width/o,g=r.height/s;return{width:h,height:g,top:m,right:p+h,bottom:m+g,left:p,x:p,y:m}}function Hb(e){var t=wc(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function k3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Bb(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function la(e){return Jr(e).getComputedStyle(e)}function fB(e){return["table","td","th"].indexOf(Ss(e))>=0}function il(e){return((Ul(e)?e.ownerDocument:e.document)||window.document).documentElement}function $h(e){return Ss(e)==="html"?e:e.assignedSlot||e.parentNode||(Bb(e)?e.host:null)||il(e)}function CS(e){return!yo(e)||la(e).position==="fixed"?null:e.offsetParent}function pB(e){var t=/firefox/i.test(N1()),n=/Trident/i.test(N1());if(n&&yo(e)){var r=la(e);if(r.position==="fixed")return null}var o=$h(e);for(Bb(o)&&(o=o.host);yo(o)&&["html","body"].indexOf(Ss(o))<0;){var s=la(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function $d(e){for(var t=Jr(e),n=CS(e);n&&fB(n)&&la(n).position==="static";)n=CS(n);return n&&(Ss(n)==="html"||Ss(n)==="body"&&la(n).position==="static")?t:n||pB(e)||t}function Vb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Wu(e,t,n){return $l(e,pm(t,n))}function mB(e,t,n){var r=Wu(e,t,n);return r>n?n:r}function _3(){return{top:0,right:0,bottom:0,left:0}}function j3(e){return Object.assign({},_3(),e)}function I3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var hB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,j3(typeof t!="number"?t:I3(t,Td))};function gB(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,l=n.modifiersData.popperOffsets,i=ws(n.placement),u=Vb(i),p=[Tr,ko].indexOf(i)>=0,m=p?"height":"width";if(!(!s||!l)){var h=hB(o.padding,n),g=Hb(s),x=u==="y"?Ar:Tr,y=u==="y"?So:ko,b=n.rects.reference[m]+n.rects.reference[u]-l[u]-n.rects.popper[m],C=l[u]-n.rects.reference[u],S=$d(s),_=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,j=b/2-C/2,E=h[x],I=_-g[m]-h[y],M=_/2-g[m]/2+j,D=Wu(E,M,I),R=u;n.modifiersData[r]=(t={},t[R]=D,t.centerOffset=D-M,t)}}function vB(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||k3(t.elements.popper,o)&&(t.elements.arrow=o))}const xB={name:"arrow",enabled:!0,phase:"main",fn:gB,effect:vB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sc(e){return e.split("-")[1]}var bB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yB(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Cc(n*o)/o||0,y:Cc(r*o)/o||0}}function wS(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,l=e.offsets,i=e.position,u=e.gpuAcceleration,p=e.adaptive,m=e.roundOffsets,h=e.isFixed,g=l.x,x=g===void 0?0:g,y=l.y,b=y===void 0?0:y,C=typeof m=="function"?m({x,y:b}):{x,y:b};x=C.x,b=C.y;var S=l.hasOwnProperty("x"),_=l.hasOwnProperty("y"),j=Tr,E=Ar,I=window;if(p){var M=$d(n),D="clientHeight",R="clientWidth";if(M===Jr(n)&&(M=il(n),la(M).position!=="static"&&i==="absolute"&&(D="scrollHeight",R="scrollWidth")),M=M,o===Ar||(o===Tr||o===ko)&&s===rd){E=So;var A=h&&M===I&&I.visualViewport?I.visualViewport.height:M[D];b-=A-r.height,b*=u?1:-1}if(o===Tr||(o===Ar||o===So)&&s===rd){j=ko;var O=h&&M===I&&I.visualViewport?I.visualViewport.width:M[R];x-=O-r.width,x*=u?1:-1}}var $=Object.assign({position:i},p&&bB),X=m===!0?yB({x,y:b},Jr(n)):{x,y:b};if(x=X.x,b=X.y,u){var z;return Object.assign({},$,(z={},z[E]=_?"0":"",z[j]=S?"0":"",z.transform=(I.devicePixelRatio||1)<=1?"translate("+x+"px, "+b+"px)":"translate3d("+x+"px, "+b+"px, 0)",z))}return Object.assign({},$,(t={},t[E]=_?b+"px":"",t[j]=S?x+"px":"",t.transform="",t))}function CB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,l=s===void 0?!0:s,i=n.roundOffsets,u=i===void 0?!0:i,p={placement:ws(t.placement),variation:Sc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,wS(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,wS(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const wB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:CB,data:{}};var np={passive:!0};function SB(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,l=r.resize,i=l===void 0?!0:l,u=Jr(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(m){m.addEventListener("scroll",n.update,np)}),i&&u.addEventListener("resize",n.update,np),function(){s&&p.forEach(function(m){m.removeEventListener("scroll",n.update,np)}),i&&u.removeEventListener("resize",n.update,np)}}const kB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:SB,data:{}};var _B={left:"right",right:"left",bottom:"top",top:"bottom"};function zp(e){return e.replace(/left|right|bottom|top/g,function(t){return _B[t]})}var jB={start:"end",end:"start"};function SS(e){return e.replace(/start|end/g,function(t){return jB[t]})}function Wb(e){var t=Jr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ub(e){return wc(il(e)).left+Wb(e).scrollLeft}function IB(e,t){var n=Jr(e),r=il(e),o=n.visualViewport,s=r.clientWidth,l=r.clientHeight,i=0,u=0;if(o){s=o.width,l=o.height;var p=S3();(p||!p&&t==="fixed")&&(i=o.offsetLeft,u=o.offsetTop)}return{width:s,height:l,x:i+Ub(e),y:u}}function PB(e){var t,n=il(e),r=Wb(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=$l(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=$l(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),i=-r.scrollLeft+Ub(e),u=-r.scrollTop;return la(o||n).direction==="rtl"&&(i+=$l(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:l,x:i,y:u}}function Gb(e){var t=la(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function P3(e){return["html","body","#document"].indexOf(Ss(e))>=0?e.ownerDocument.body:yo(e)&&Gb(e)?e:P3($h(e))}function Uu(e,t){var n;t===void 0&&(t=[]);var r=P3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Jr(r),l=o?[s].concat(s.visualViewport||[],Gb(r)?r:[]):r,i=t.concat(l);return o?i:i.concat(Uu($h(l)))}function L1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function EB(e,t){var n=wc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function kS(e,t,n){return t===C3?L1(IB(e,n)):Ul(t)?EB(t,n):L1(PB(il(e)))}function MB(e){var t=Uu($h(e)),n=["absolute","fixed"].indexOf(la(e).position)>=0,r=n&&yo(e)?$d(e):e;return Ul(r)?t.filter(function(o){return Ul(o)&&k3(o,r)&&Ss(o)!=="body"}):[]}function OB(e,t,n,r){var o=t==="clippingParents"?MB(e):[].concat(t),s=[].concat(o,[n]),l=s[0],i=s.reduce(function(u,p){var m=kS(e,p,r);return u.top=$l(m.top,u.top),u.right=pm(m.right,u.right),u.bottom=pm(m.bottom,u.bottom),u.left=$l(m.left,u.left),u},kS(e,l,r));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}function E3(e){var t=e.reference,n=e.element,r=e.placement,o=r?ws(r):null,s=r?Sc(r):null,l=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2,u;switch(o){case Ar:u={x:l,y:t.y-n.height};break;case So:u={x:l,y:t.y+t.height};break;case ko:u={x:t.x+t.width,y:i};break;case Tr:u={x:t.x-n.width,y:i};break;default:u={x:t.x,y:t.y}}var p=o?Vb(o):null;if(p!=null){var m=p==="y"?"height":"width";switch(s){case yc:u[p]=u[p]-(t[m]/2-n[m]/2);break;case rd:u[p]=u[p]+(t[m]/2-n[m]/2);break}}return u}function od(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,l=s===void 0?e.strategy:s,i=n.boundary,u=i===void 0?YF:i,p=n.rootBoundary,m=p===void 0?C3:p,h=n.elementContext,g=h===void 0?_u:h,x=n.altBoundary,y=x===void 0?!1:x,b=n.padding,C=b===void 0?0:b,S=j3(typeof C!="number"?C:I3(C,Td)),_=g===_u?ZF:_u,j=e.rects.popper,E=e.elements[y?_:g],I=OB(Ul(E)?E:E.contextElement||il(e.elements.popper),u,m,l),M=wc(e.elements.reference),D=E3({reference:M,element:j,strategy:"absolute",placement:o}),R=L1(Object.assign({},j,D)),A=g===_u?R:M,O={top:I.top-A.top+S.top,bottom:A.bottom-I.bottom+S.bottom,left:I.left-A.left+S.left,right:A.right-I.right+S.right},$=e.modifiersData.offset;if(g===_u&&$){var X=$[o];Object.keys(O).forEach(function(z){var V=[ko,So].indexOf(z)>=0?1:-1,Q=[Ar,So].indexOf(z)>=0?"y":"x";O[z]+=X[Q]*V})}return O}function DB(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,l=n.padding,i=n.flipVariations,u=n.allowedAutoPlacements,p=u===void 0?w3:u,m=Sc(r),h=m?i?yS:yS.filter(function(y){return Sc(y)===m}):Td,g=h.filter(function(y){return p.indexOf(y)>=0});g.length===0&&(g=h);var x=g.reduce(function(y,b){return y[b]=od(e,{placement:b,boundary:o,rootBoundary:s,padding:l})[ws(b)],y},{});return Object.keys(x).sort(function(y,b){return x[y]-x[b]})}function RB(e){if(ws(e)===Fb)return[];var t=zp(e);return[SS(e),t,SS(t)]}function AB(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,i=l===void 0?!0:l,u=n.fallbackPlacements,p=n.padding,m=n.boundary,h=n.rootBoundary,g=n.altBoundary,x=n.flipVariations,y=x===void 0?!0:x,b=n.allowedAutoPlacements,C=t.options.placement,S=ws(C),_=S===C,j=u||(_||!y?[zp(C)]:RB(C)),E=[C].concat(j).reduce(function(oe,q){return oe.concat(ws(q)===Fb?DB(t,{placement:q,boundary:m,rootBoundary:h,padding:p,flipVariations:y,allowedAutoPlacements:b}):q)},[]),I=t.rects.reference,M=t.rects.popper,D=new Map,R=!0,A=E[0],O=0;O<E.length;O++){var $=E[O],X=ws($),z=Sc($)===yc,V=[Ar,So].indexOf(X)>=0,Q=V?"width":"height",G=od(t,{placement:$,boundary:m,rootBoundary:h,altBoundary:g,padding:p}),F=V?z?ko:Tr:z?So:Ar;I[Q]>M[Q]&&(F=zp(F));var U=zp(F),T=[];if(s&&T.push(G[X]<=0),i&&T.push(G[F]<=0,G[U]<=0),T.every(function(oe){return oe})){A=$,R=!1;break}D.set($,T)}if(R)for(var B=y?3:1,Y=function(q){var K=E.find(function(ee){var ce=D.get(ee);if(ce)return ce.slice(0,q).every(function(J){return J})});if(K)return A=K,"break"},re=B;re>0;re--){var ae=Y(re);if(ae==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const TB={name:"flip",enabled:!0,phase:"main",fn:AB,requiresIfExists:["offset"],data:{_skip:!1}};function _S(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function jS(e){return[Ar,ko,So,Tr].some(function(t){return e[t]>=0})}function $B(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,l=od(t,{elementContext:"reference"}),i=od(t,{altBoundary:!0}),u=_S(l,r),p=_S(i,o,s),m=jS(u),h=jS(p);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:p,isReferenceHidden:m,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":h})}const NB={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:$B};function LB(e,t,n){var r=ws(e),o=[Tr,Ar].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=s[0],i=s[1];return l=l||0,i=(i||0)*o,[Tr,ko].indexOf(r)>=0?{x:i,y:l}:{x:l,y:i}}function zB(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,l=w3.reduce(function(m,h){return m[h]=LB(h,t.rects,s),m},{}),i=l[t.placement],u=i.x,p=i.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=l}const FB={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:zB};function BB(e){var t=e.state,n=e.name;t.modifiersData[n]=E3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const HB={name:"popperOffsets",enabled:!0,phase:"read",fn:BB,data:{}};function VB(e){return e==="x"?"y":"x"}function WB(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,i=l===void 0?!1:l,u=n.boundary,p=n.rootBoundary,m=n.altBoundary,h=n.padding,g=n.tether,x=g===void 0?!0:g,y=n.tetherOffset,b=y===void 0?0:y,C=od(t,{boundary:u,rootBoundary:p,padding:h,altBoundary:m}),S=ws(t.placement),_=Sc(t.placement),j=!_,E=Vb(S),I=VB(E),M=t.modifiersData.popperOffsets,D=t.rects.reference,R=t.rects.popper,A=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(M){if(s){var z,V=E==="y"?Ar:Tr,Q=E==="y"?So:ko,G=E==="y"?"height":"width",F=M[E],U=F+C[V],T=F-C[Q],B=x?-R[G]/2:0,Y=_===yc?D[G]:R[G],re=_===yc?-R[G]:-D[G],ae=t.elements.arrow,oe=x&&ae?Hb(ae):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:_3(),K=q[V],ee=q[Q],ce=Wu(0,D[G],oe[G]),J=j?D[G]/2-B-ce-K-O.mainAxis:Y-ce-K-O.mainAxis,ie=j?-D[G]/2+B+ce+ee+O.mainAxis:re+ce+ee+O.mainAxis,de=t.elements.arrow&&$d(t.elements.arrow),xe=de?E==="y"?de.clientTop||0:de.clientLeft||0:0,we=(z=$==null?void 0:$[E])!=null?z:0,ve=F+J-we-xe,fe=F+ie-we,Oe=Wu(x?pm(U,ve):U,F,x?$l(T,fe):T);M[E]=Oe,X[E]=Oe-F}if(i){var je,$e=E==="x"?Ar:Tr,st=E==="x"?So:ko,Ve=M[I],Ct=I==="y"?"height":"width",Ye=Ve+C[$e],Ke=Ve-C[st],he=[Ar,Tr].indexOf(S)!==-1,Re=(je=$==null?void 0:$[I])!=null?je:0,ut=he?Ye:Ve-D[Ct]-R[Ct]-Re+O.altAxis,yt=he?Ve+D[Ct]+R[Ct]-Re-O.altAxis:Ke,ye=x&&he?mB(ut,Ve,yt):Wu(x?ut:Ye,Ve,x?yt:Ke);M[I]=ye,X[I]=ye-Ve}t.modifiersData[r]=X}}const UB={name:"preventOverflow",enabled:!0,phase:"main",fn:WB,requiresIfExists:["offset"]};function GB(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function KB(e){return e===Jr(e)||!yo(e)?Wb(e):GB(e)}function qB(e){var t=e.getBoundingClientRect(),n=Cc(t.width)/e.offsetWidth||1,r=Cc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function XB(e,t,n){n===void 0&&(n=!1);var r=yo(t),o=yo(t)&&qB(t),s=il(t),l=wc(e,o,n),i={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Ss(t)!=="body"||Gb(s))&&(i=KB(t)),yo(t)?(u=wc(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=Ub(s))),{x:l.left+i.scrollLeft-u.x,y:l.top+i.scrollTop-u.y,width:l.width,height:l.height}}function QB(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var l=[].concat(s.requires||[],s.requiresIfExists||[]);l.forEach(function(i){if(!n.has(i)){var u=t.get(i);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function YB(e){var t=QB(e);return iB.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function ZB(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function JB(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var IS={placement:"bottom",modifiers:[],strategy:"absolute"};function PS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function eH(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?IS:o;return function(i,u,p){p===void 0&&(p=s);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},IS,s),modifiersData:{},elements:{reference:i,popper:u},attributes:{},styles:{}},h=[],g=!1,x={state:m,setOptions:function(S){var _=typeof S=="function"?S(m.options):S;b(),m.options=Object.assign({},s,m.options,_),m.scrollParents={reference:Ul(i)?Uu(i):i.contextElement?Uu(i.contextElement):[],popper:Uu(u)};var j=YB(JB([].concat(r,m.options.modifiers)));return m.orderedModifiers=j.filter(function(E){return E.enabled}),y(),x.update()},forceUpdate:function(){if(!g){var S=m.elements,_=S.reference,j=S.popper;if(PS(_,j)){m.rects={reference:XB(_,$d(j),m.options.strategy==="fixed"),popper:Hb(j)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(O){return m.modifiersData[O.name]=Object.assign({},O.data)});for(var E=0;E<m.orderedModifiers.length;E++){if(m.reset===!0){m.reset=!1,E=-1;continue}var I=m.orderedModifiers[E],M=I.fn,D=I.options,R=D===void 0?{}:D,A=I.name;typeof M=="function"&&(m=M({state:m,options:R,name:A,instance:x})||m)}}}},update:ZB(function(){return new Promise(function(C){x.forceUpdate(),C(m)})}),destroy:function(){b(),g=!0}};if(!PS(i,u))return x;x.setOptions(p).then(function(C){!g&&p.onFirstUpdate&&p.onFirstUpdate(C)});function y(){m.orderedModifiers.forEach(function(C){var S=C.name,_=C.options,j=_===void 0?{}:_,E=C.effect;if(typeof E=="function"){var I=E({state:m,name:S,instance:x,options:j}),M=function(){};h.push(I||M)}})}function b(){h.forEach(function(C){return C()}),h=[]}return x}}var tH=[kB,HB,wB,dB,FB,TB,UB,xB,NB],nH=eH({defaultModifiers:tH});function Kb(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:l=!0,offset:i,gutter:u=8,flip:p=!0,boundary:m="clippingParents",preventOverflow:h=!0,matchWidth:g,direction:x="ltr"}=e,y=d.useRef(null),b=d.useRef(null),C=d.useRef(null),S=QF(r,x),_=d.useRef(()=>{}),j=d.useCallback(()=>{var O;!t||!y.current||!b.current||((O=_.current)==null||O.call(_),C.current=nH(y.current,b.current,{placement:S,modifiers:[KF,WF,VF,{...HF,enabled:!!g},{name:"eventListeners",...BF(l)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:i??[0,u]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:m}},...n??[]],strategy:o}),C.current.forceUpdate(),_.current=C.current.destroy)},[S,t,n,g,l,s,i,u,p,h,m,o]);d.useEffect(()=>()=>{var O;!y.current&&!b.current&&((O=C.current)==null||O.destroy(),C.current=null)},[]);const E=d.useCallback(O=>{y.current=O,j()},[j]),I=d.useCallback((O={},$=null)=>({...O,ref:Pt(E,$)}),[E]),M=d.useCallback(O=>{b.current=O,j()},[j]),D=d.useCallback((O={},$=null)=>({...O,ref:Pt(M,$),style:{...O.style,position:o,minWidth:g?void 0:"max-content",inset:"0 auto auto 0"}}),[o,M,g]),R=d.useCallback((O={},$=null)=>{const{size:X,shadowColor:z,bg:V,style:Q,...G}=O;return{...G,ref:$,"data-popper-arrow":"",style:rH(O)}},[]),A=d.useCallback((O={},$=null)=>({...O,ref:$,"data-popper-arrow-inner":""}),[]);return{update(){var O;(O=C.current)==null||O.update()},forceUpdate(){var O;(O=C.current)==null||O.forceUpdate()},transformOrigin:$n.transformOrigin.varRef,referenceRef:E,popperRef:M,getPopperProps:D,getArrowProps:R,getArrowInnerProps:A,getReferenceProps:I}}function rH(e){const{size:t,shadowColor:n,bg:r,style:o}=e,s={...o,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function qb(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=un(n),l=un(t),[i,u]=d.useState(e.defaultIsOpen||!1),p=r!==void 0?r:i,m=r!==void 0,h=d.useId(),g=o??`disclosure-${h}`,x=d.useCallback(()=>{m||u(!1),l==null||l()},[m,l]),y=d.useCallback(()=>{m||u(!0),s==null||s()},[m,s]),b=d.useCallback(()=>{p?x():y()},[p,y,x]);function C(_={}){return{..._,"aria-expanded":p,"aria-controls":g,onClick(j){var E;(E=_.onClick)==null||E.call(_,j),b()}}}function S(_={}){return{..._,hidden:!p,id:g}}return{isOpen:p,onOpen:y,onClose:x,onToggle:b,isControlled:m,getButtonProps:C,getDisclosureProps:S}}function oH(e){const{ref:t,handler:n,enabled:r=!0}=e,o=un(n),l=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;d.useEffect(()=>{if(!r)return;const i=h=>{hv(h,t)&&(l.isPointerDown=!0)},u=h=>{if(l.ignoreEmulatedMouseEvents){l.ignoreEmulatedMouseEvents=!1;return}l.isPointerDown&&n&&hv(h,t)&&(l.isPointerDown=!1,o(h))},p=h=>{l.ignoreEmulatedMouseEvents=!0,n&&l.isPointerDown&&hv(h,t)&&(l.isPointerDown=!1,o(h))},m=M3(t.current);return m.addEventListener("mousedown",i,!0),m.addEventListener("mouseup",u,!0),m.addEventListener("touchstart",i,!0),m.addEventListener("touchend",p,!0),()=>{m.removeEventListener("mousedown",i,!0),m.removeEventListener("mouseup",u,!0),m.removeEventListener("touchstart",i,!0),m.removeEventListener("touchend",p,!0)}},[n,t,o,l,r])}function hv(e,t){var n;const r=e.target;return r&&!M3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function M3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function O3(e){const{isOpen:t,ref:n}=e,[r,o]=d.useState(t),[s,l]=d.useState(!1);return d.useEffect(()=>{s||(o(t),l(!0))},[t,s,r]),Tl(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var u;const p=iF(n.current),m=new p.CustomEvent("animationend",{bubbles:!0});(u=n.current)==null||u.dispatchEvent(m)}}}function Xb(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[sH,aH,lH,iH]=vb(),[cH,Nd]=Wt({strict:!1,name:"MenuContext"});function uH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function D3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function ES(e){return D3(e).activeElement===e}function dH(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:l,isOpen:i,defaultIsOpen:u,onClose:p,onOpen:m,placement:h="bottom-start",lazyBehavior:g="unmount",direction:x,computePositionOnMount:y=!1,...b}=e,C=d.useRef(null),S=d.useRef(null),_=lH(),j=d.useCallback(()=>{requestAnimationFrame(()=>{var ae;(ae=C.current)==null||ae.focus({preventScroll:!1})})},[]),E=d.useCallback(()=>{const ae=setTimeout(()=>{var oe;if(o)(oe=o.current)==null||oe.focus();else{const q=_.firstEnabled();q&&z(q.index)}});U.current.add(ae)},[_,o]),I=d.useCallback(()=>{const ae=setTimeout(()=>{const oe=_.lastEnabled();oe&&z(oe.index)});U.current.add(ae)},[_]),M=d.useCallback(()=>{m==null||m(),s?E():j()},[s,E,j,m]),{isOpen:D,onOpen:R,onClose:A,onToggle:O}=qb({isOpen:i,defaultIsOpen:u,onClose:p,onOpen:M});oH({enabled:D&&r,ref:C,handler:ae=>{var oe;(oe=S.current)!=null&&oe.contains(ae.target)||A()}});const $=Kb({...b,enabled:D||y,placement:h,direction:x}),[X,z]=d.useState(-1);pa(()=>{D||z(-1)},[D]),y3(C,{focusRef:S,visible:D,shouldFocus:!0});const V=O3({isOpen:D,ref:C}),[Q,G]=uH(t,"menu-button","menu-list"),F=d.useCallback(()=>{R(),j()},[R,j]),U=d.useRef(new Set([]));xH(()=>{U.current.forEach(ae=>clearTimeout(ae)),U.current.clear()});const T=d.useCallback(()=>{R(),E()},[E,R]),B=d.useCallback(()=>{R(),I()},[R,I]),Y=d.useCallback(()=>{var ae,oe;const q=D3(C.current),K=(ae=C.current)==null?void 0:ae.contains(q.activeElement);if(!(D&&!K))return;const ce=(oe=_.item(X))==null?void 0:oe.node;ce==null||ce.focus()},[D,X,_]),re=d.useRef(null);return{openAndFocusMenu:F,openAndFocusFirstItem:T,openAndFocusLastItem:B,onTransitionEnd:Y,unstable__animationState:V,descendants:_,popper:$,buttonId:Q,menuId:G,forceUpdate:$.forceUpdate,orientation:"vertical",isOpen:D,onToggle:O,onOpen:R,onClose:A,menuRef:C,buttonRef:S,focusedIndex:X,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:z,isLazy:l,lazyBehavior:g,initialFocusRef:o,rafId:re}}function fH(e={},t=null){const n=Nd(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:l}=n,i=d.useCallback(u=>{const p=u.key,h={Enter:s,ArrowDown:s,ArrowUp:l}[p];h&&(u.preventDefault(),u.stopPropagation(),h(u))},[s,l]);return{...e,ref:Pt(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":dt(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Fe(e.onClick,r),onKeyDown:Fe(e.onKeyDown,i)}}function z1(e){var t;return gH(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function pH(e={},t=null){const n=Nd();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:l,onClose:i,menuId:u,isLazy:p,lazyBehavior:m,unstable__animationState:h}=n,g=aH(),x=OF({preventDefault:S=>S.key!==" "&&z1(S.target)}),y=d.useCallback(S=>{if(!S.currentTarget.contains(S.target))return;const _=S.key,E={Tab:M=>M.preventDefault(),Escape:i,ArrowDown:()=>{const M=g.nextEnabled(r);M&&o(M.index)},ArrowUp:()=>{const M=g.prevEnabled(r);M&&o(M.index)}}[_];if(E){S.preventDefault(),E(S);return}const I=x(M=>{const D=DF(g.values(),M,R=>{var A,O;return(O=(A=R==null?void 0:R.node)==null?void 0:A.textContent)!=null?O:""},g.item(r));if(D){const R=g.indexOf(D.node);o(R)}});z1(S.target)&&I(S)},[g,r,x,i,o]),b=d.useRef(!1);l&&(b.current=!0);const C=Xb({wasSelected:b.current,enabled:p,mode:m,isSelected:h.present});return{...e,ref:Pt(s,t),children:C?e.children:null,tabIndex:-1,role:"menu",id:u,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Fe(e.onKeyDown,y)}}function mH(e={}){const{popper:t,isOpen:n}=Nd();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function hH(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:l,isDisabled:i,isFocusable:u,closeOnSelect:p,type:m,...h}=e,g=Nd(),{setFocusedIndex:x,focusedIndex:y,closeOnSelect:b,onClose:C,menuRef:S,isOpen:_,menuId:j,rafId:E}=g,I=d.useRef(null),M=`${j}-menuitem-${d.useId()}`,{index:D,register:R}=iH({disabled:i&&!u}),A=d.useCallback(F=>{n==null||n(F),!i&&x(D)},[x,D,i,n]),O=d.useCallback(F=>{r==null||r(F),I.current&&!ES(I.current)&&A(F)},[A,r]),$=d.useCallback(F=>{o==null||o(F),!i&&x(-1)},[x,i,o]),X=d.useCallback(F=>{s==null||s(F),z1(F.currentTarget)&&(p??b)&&C()},[C,s,b,p]),z=d.useCallback(F=>{l==null||l(F),x(D)},[x,l,D]),V=D===y,Q=i&&!u;pa(()=>{_&&(V&&!Q&&I.current?(E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(()=>{var F;(F=I.current)==null||F.focus(),E.current=null})):S.current&&!ES(S.current)&&S.current.focus({preventScroll:!0}))},[V,Q,S,_]);const G=b3({onClick:X,onFocus:z,onMouseEnter:A,onMouseMove:O,onMouseLeave:$,ref:Pt(R,I,t),isDisabled:i,isFocusable:u});return{...h,...G,type:m??G.type,id:M,role:"menuitem",tabIndex:V?0:-1}}function gH(e){var t;if(!vH(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function vH(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function xH(e,t=[]){return d.useEffect(()=>()=>e(),t)}var[bH,Fc]=Wt({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Nh=e=>{const{children:t}=e,n=Un("Menu",e),r=on(e),{direction:o}=wd(),{descendants:s,...l}=dH({...r,direction:o}),i=d.useMemo(()=>l,[l]),{isOpen:u,onClose:p,forceUpdate:m}=i;return a.jsx(sH,{value:s,children:a.jsx(cH,{value:i,children:a.jsx(bH,{value:n,children:Vx(t,{isOpen:u,onClose:p,forceUpdate:m})})})})};Nh.displayName="Menu";var R3=_e((e,t)=>{const n=Fc();return a.jsx(Se.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});R3.displayName="MenuCommand";var yH=_e((e,t)=>{const{type:n,...r}=e,o=Fc(),s=r.as||n?n??void 0:"button",l=d.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return a.jsx(Se.button,{ref:t,type:s,...r,__css:l})}),A3=e=>{const{className:t,children:n,...r}=e,o=Fc(),s=d.Children.only(n),l=d.isValidElement(s)?d.cloneElement(s,{focusable:"false","aria-hidden":!0,className:Je("chakra-menu__icon",s.props.className)}):null,i=Je("chakra-menu__icon-wrapper",t);return a.jsx(Se.span,{className:i,...r,__css:o.icon,children:l})};A3.displayName="MenuIcon";var Kt=_e((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:l,...i}=e,u=hH(i,t),m=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:l}):l;return a.jsxs(yH,{...u,className:Je("chakra-menu__menuitem",u.className),children:[n&&a.jsx(A3,{fontSize:"0.8em",marginEnd:r,children:n}),m,o&&a.jsx(R3,{marginStart:s,children:o})]})});Kt.displayName="MenuItem";var CH={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},wH=Se(jn.div),Gl=_e(function(t,n){var r,o;const{rootProps:s,motionProps:l,...i}=t,{isOpen:u,onTransitionEnd:p,unstable__animationState:m}=Nd(),h=pH(i,n),g=mH(s),x=Fc();return a.jsx(Se.div,{...g,__css:{zIndex:(o=t.zIndex)!=null?o:(r=x.list)==null?void 0:r.zIndex},children:a.jsx(wH,{variants:CH,initial:!1,animate:u?"enter":"exit",__css:{outline:0,...x.list},...l,className:Je("chakra-menu__menu-list",h.className),...h,onUpdate:p,onAnimationComplete:xh(m.onComplete,h.onAnimationComplete)})})});Gl.displayName="MenuList";var sd=_e((e,t)=>{const{title:n,children:r,className:o,...s}=e,l=Je("chakra-menu__group__title",o),i=Fc();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(Se.p,{className:l,...s,__css:i.groupTitle,children:n}),r]})});sd.displayName="MenuGroup";var SH=_e((e,t)=>{const n=Fc();return a.jsx(Se.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Lh=_e((e,t)=>{const{children:n,as:r,...o}=e,s=fH(o,t),l=r||SH;return a.jsx(l,{...s,className:Je("chakra-menu__menu-button",e.className),children:a.jsx(Se.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Lh.displayName="MenuButton";var kH={slideInBottom:{...k1,custom:{offsetY:16,reverse:!0}},slideInRight:{...k1,custom:{offsetX:16,reverse:!0}},scale:{...d5,custom:{initialScale:.95,reverse:!0}},none:{}},_H=Se(jn.section),jH=e=>kH[e||"none"],T3=d.forwardRef((e,t)=>{const{preset:n,motionProps:r=jH(n),...o}=e;return a.jsx(_H,{ref:t,...r,...o})});T3.displayName="ModalTransition";var IH=Object.defineProperty,PH=(e,t,n)=>t in e?IH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EH=(e,t,n)=>(PH(e,typeof t!="symbol"?t+"":t,n),n),MH=class{constructor(){EH(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},F1=new MH;function $3(e,t){const[n,r]=d.useState(0);return d.useEffect(()=>{const o=e.current;if(o){if(t){const s=F1.add(o);r(s)}return()=>{F1.remove(o),r(0)}}},[t,e]),n}var OH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ai=new WeakMap,rp=new WeakMap,op={},gv=0,N3=function(e){return e&&(e.host||N3(e.parentNode))},DH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=N3(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},RH=function(e,t,n,r){var o=DH(t,Array.isArray(e)?e:[e]);op[n]||(op[n]=new WeakMap);var s=op[n],l=[],i=new Set,u=new Set(o),p=function(h){!h||i.has(h)||(i.add(h),p(h.parentNode))};o.forEach(p);var m=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(g){if(i.has(g))m(g);else{var x=g.getAttribute(r),y=x!==null&&x!=="false",b=(Ai.get(g)||0)+1,C=(s.get(g)||0)+1;Ai.set(g,b),s.set(g,C),l.push(g),b===1&&y&&rp.set(g,!0),C===1&&g.setAttribute(n,"true"),y||g.setAttribute(r,"true")}})};return m(t),i.clear(),gv++,function(){l.forEach(function(h){var g=Ai.get(h)-1,x=s.get(h)-1;Ai.set(h,g),s.set(h,x),g||(rp.has(h)||h.removeAttribute(r),rp.delete(h)),x||h.removeAttribute(n)}),gv--,gv||(Ai=new WeakMap,Ai=new WeakMap,rp=new WeakMap,op={})}},AH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||OH(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),RH(r,o,n,"aria-hidden")):function(){return null}};function TH(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:l=!0,onOverlayClick:i,onEsc:u}=e,p=d.useRef(null),m=d.useRef(null),[h,g,x]=NH(r,"chakra-modal","chakra-modal--header","chakra-modal--body");$H(p,t&&l);const y=$3(p,t),b=d.useRef(null),C=d.useCallback(A=>{b.current=A.target},[]),S=d.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),u==null||u())},[s,n,u]),[_,j]=d.useState(!1),[E,I]=d.useState(!1),M=d.useCallback((A={},O=null)=>({role:"dialog",...A,ref:Pt(O,p),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":_?g:void 0,"aria-describedby":E?x:void 0,onClick:Fe(A.onClick,$=>$.stopPropagation())}),[x,E,h,g,_]),D=d.useCallback(A=>{A.stopPropagation(),b.current===A.target&&F1.isTopModal(p.current)&&(o&&(n==null||n()),i==null||i())},[n,o,i]),R=d.useCallback((A={},O=null)=>({...A,ref:Pt(O,m),onClick:Fe(A.onClick,D),onKeyDown:Fe(A.onKeyDown,S),onMouseDown:Fe(A.onMouseDown,C)}),[S,C,D]);return{isOpen:t,onClose:n,headerId:g,bodyId:x,setBodyMounted:I,setHeaderMounted:j,dialogRef:p,overlayRef:m,getDialogProps:M,getDialogContainerProps:R,index:y}}function $H(e,t){const n=e.current;d.useEffect(()=>{if(!(!e.current||!t))return AH(e.current)},[t,e,n])}function NH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[LH,Bc]=Wt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[zH,Kl]=Wt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),ql=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:l,finalFocusRef:i,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x,onCloseComplete:y}=t,b=Un("Modal",t),S={...TH(t),autoFocus:o,trapFocus:s,initialFocusRef:l,finalFocusRef:i,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x};return a.jsx(zH,{value:S,children:a.jsx(LH,{value:b,children:a.jsx(dr,{onExitComplete:y,children:S.isOpen&&a.jsx($c,{...n,children:r})})})})};ql.displayName="Modal";var Fp="right-scroll-bar-position",Bp="width-before-scroll-bar",FH="with-scroll-bars-hidden",BH="--removed-body-scroll-bar-size",L3=A5(),vv=function(){},zh=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:vv,onWheelCapture:vv,onTouchMoveCapture:vv}),o=r[0],s=r[1],l=e.forwardProps,i=e.children,u=e.className,p=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,x=e.noIsolation,y=e.inert,b=e.allowPinchZoom,C=e.as,S=C===void 0?"div":C,_=e.gapMode,j=O5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=M5([n,t]),M=vs(vs({},j),o);return d.createElement(d.Fragment,null,m&&d.createElement(E,{sideCar:L3,removeScrollBar:p,shards:h,noIsolation:x,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:_}),l?d.cloneElement(d.Children.only(i),vs(vs({},M),{ref:I})):d.createElement(S,vs({},M,{className:u,ref:I}),i))});zh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zh.classNames={fullWidth:Bp,zeroRight:Fp};var MS,HH=function(){if(MS)return MS;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=HH();return t&&e.setAttribute("nonce",t),e}function WH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var GH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=VH())&&(WH(t,n),UH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},KH=function(){var e=GH();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},z3=function(){var e=KH(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},qH={left:0,top:0,right:0,gap:0},xv=function(e){return parseInt(e||"",10)||0},XH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xv(n),xv(r),xv(o)]},QH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qH;var t=XH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},YH=z3(),ZH=function(e,t,n,r){var o=e.left,s=e.top,l=e.right,i=e.gap;return n===void 0&&(n="margin"),`
+  .`.concat(FH,` {
+   overflow: hidden `).concat(r,`;
+   padding-right: `).concat(i,"px ").concat(r,`;
+  }
+  body {
+    overflow: hidden `).concat(r,`;
+    overscroll-behavior: contain;
+    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
+    padding-left: `.concat(o,`px;
+    padding-top: `).concat(s,`px;
+    padding-right: `).concat(l,`px;
+    margin-left:0;
+    margin-top:0;
+    margin-right: `).concat(i,"px ").concat(r,`;
+    `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),`
+  }
+  
+  .`).concat(Fp,` {
+    right: `).concat(i,"px ").concat(r,`;
+  }
+  
+  .`).concat(Bp,` {
+    margin-right: `).concat(i,"px ").concat(r,`;
+  }
+  
+  .`).concat(Fp," .").concat(Fp,` {
+    right: 0 `).concat(r,`;
+  }
+  
+  .`).concat(Bp," .").concat(Bp,` {
+    margin-right: 0 `).concat(r,`;
+  }
+  
+  body {
+    `).concat(BH,": ").concat(i,`px;
+  }
+`)},JH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=d.useMemo(function(){return QH(o)},[o]);return d.createElement(YH,{styles:ZH(s,!t,o,n?"":"!important")})},B1=!1;if(typeof window<"u")try{var sp=Object.defineProperty({},"passive",{get:function(){return B1=!0,!0}});window.addEventListener("test",sp,sp),window.removeEventListener("test",sp,sp)}catch{B1=!1}var Ti=B1?{passive:!1}:!1,eV=function(e){return e.tagName==="TEXTAREA"},F3=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!eV(e)&&n[t]==="visible")},tV=function(e){return F3(e,"overflowY")},nV=function(e){return F3(e,"overflowX")},OS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=B3(e,r);if(o){var s=H3(e,r),l=s[1],i=s[2];if(l>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},oV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},B3=function(e,t){return e==="v"?tV(t):nV(t)},H3=function(e,t){return e==="v"?rV(t):oV(t)},sV=function(e,t){return e==="h"&&t==="rtl"?-1:1},aV=function(e,t,n,r,o){var s=sV(e,window.getComputedStyle(t).direction),l=s*r,i=n.target,u=t.contains(i),p=!1,m=l>0,h=0,g=0;do{var x=H3(e,i),y=x[0],b=x[1],C=x[2],S=b-C-s*y;(y||S)&&B3(e,i)&&(h+=S,g+=y),i=i.parentNode}while(!u&&i!==document.body||u&&(t.contains(i)||t===i));return(m&&(o&&h===0||!o&&l>h)||!m&&(o&&g===0||!o&&-l>g))&&(p=!0),p},ap=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},DS=function(e){return[e.deltaX,e.deltaY]},RS=function(e){return e&&"current"in e?e.current:e},lV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iV=function(e){return`
+  .block-interactivity-`.concat(e,` {pointer-events: none;}
+  .allow-interactivity-`).concat(e,` {pointer-events: all;}
+`)},cV=0,$i=[];function uV(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(cV++)[0],s=d.useState(z3)[0],l=d.useRef(e);d.useEffect(function(){l.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=D1([e.lockRef.current],(e.shards||[]).map(RS),!0).filter(Boolean);return b.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=d.useCallback(function(b,C){if("touches"in b&&b.touches.length===2)return!l.current.allowPinchZoom;var S=ap(b),_=n.current,j="deltaX"in b?b.deltaX:_[0]-S[0],E="deltaY"in b?b.deltaY:_[1]-S[1],I,M=b.target,D=Math.abs(j)>Math.abs(E)?"h":"v";if("touches"in b&&D==="h"&&M.type==="range")return!1;var R=OS(D,M);if(!R)return!0;if(R?I=D:(I=D==="v"?"h":"v",R=OS(D,M)),!R)return!1;if(!r.current&&"changedTouches"in b&&(j||E)&&(r.current=I),!I)return!0;var A=r.current||I;return aV(A,C,b,A==="h"?j:E,!0)},[]),u=d.useCallback(function(b){var C=b;if(!(!$i.length||$i[$i.length-1]!==s)){var S="deltaY"in C?DS(C):ap(C),_=t.current.filter(function(I){return I.name===C.type&&I.target===C.target&&lV(I.delta,S)})[0];if(_&&_.should){C.cancelable&&C.preventDefault();return}if(!_){var j=(l.current.shards||[]).map(RS).filter(Boolean).filter(function(I){return I.contains(C.target)}),E=j.length>0?i(C,j[0]):!l.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),p=d.useCallback(function(b,C,S,_){var j={name:b,delta:C,target:S,should:_};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(E){return E!==j})},1)},[]),m=d.useCallback(function(b){n.current=ap(b),r.current=void 0},[]),h=d.useCallback(function(b){p(b.type,DS(b),b.target,i(b,e.lockRef.current))},[]),g=d.useCallback(function(b){p(b.type,ap(b),b.target,i(b,e.lockRef.current))},[]);d.useEffect(function(){return $i.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ti),document.addEventListener("touchmove",u,Ti),document.addEventListener("touchstart",m,Ti),function(){$i=$i.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,Ti),document.removeEventListener("touchmove",u,Ti),document.removeEventListener("touchstart",m,Ti)}},[]);var x=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(s,{styles:iV(o)}):null,x?d.createElement(JH,{gapMode:e.gapMode}):null)}const dV=dz(L3,uV);var V3=d.forwardRef(function(e,t){return d.createElement(zh,vs({},e,{ref:t,sideCar:dV}))});V3.classNames=zh.classNames;const fV=V3;function pV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:l,finalFocusRef:i,returnFocusOnClose:u,preserveScrollBarGap:p,lockFocusAcrossFrames:m,isOpen:h}=Kl(),[g,x]=XD();d.useEffect(()=>{!g&&x&&setTimeout(x)},[g,x]);const y=$3(r,h);return a.jsx(d3,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:i,restoreFocus:u,contentRef:r,lockFocusAcrossFrames:m,children:a.jsx(fV,{removeScrollBar:!p,allowPinchZoom:l,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var Xl=_e((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...l}=e,{getDialogProps:i,getDialogContainerProps:u}=Kl(),p=i(l,t),m=u(o),h=Je("chakra-modal__content",n),g=Bc(),x={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...g.dialog},y={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...g.dialogContainer},{motionPreset:b}=Kl();return a.jsx(pV,{children:a.jsx(Se.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:y,children:a.jsx(T3,{preset:b,motionProps:s,className:h,...p,__css:x,children:r})})})});Xl.displayName="ModalContent";function Ld(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(ql,{...n,initialFocusRef:t})}var zd=_e((e,t)=>a.jsx(Xl,{ref:t,role:"alertdialog",...e})),ks=_e((e,t)=>{const{className:n,...r}=e,o=Je("chakra-modal__footer",n),l={display:"flex",alignItems:"center",justifyContent:"flex-end",...Bc().footer};return a.jsx(Se.footer,{ref:t,...r,__css:l,className:o})});ks.displayName="ModalFooter";var Yo=_e((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Kl();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const l=Je("chakra-modal__header",n),u={flex:0,...Bc().header};return a.jsx(Se.header,{ref:t,className:l,id:o,...r,__css:u})});Yo.displayName="ModalHeader";var mV=Se(jn.div),Zo=_e((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,l=Je("chakra-modal__overlay",n),u={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Bc().overlay},{motionPreset:p}=Kl(),h=o||(p==="none"?{}:u5);return a.jsx(mV,{...h,__css:u,ref:t,className:l,...s})});Zo.displayName="ModalOverlay";var Jo=_e((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Kl();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const l=Je("chakra-modal__body",n),i=Bc();return a.jsx(Se.div,{ref:t,className:l,id:o,...r,__css:i.body})});Jo.displayName="ModalBody";var Fd=_e((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Kl(),l=Je("chakra-modal__close-btn",r),i=Bc();return a.jsx(tI,{ref:t,__css:i.closeButton,className:l,onClick:Fe(n,u=>{u.stopPropagation(),s()}),...o})});Fd.displayName="ModalCloseButton";var hV=e=>a.jsx(Tn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),gV=e=>a.jsx(Tn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function AS(e,t,n,r){d.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,l=Array.isArray(t)?t:[t],i=new s.MutationObserver(u=>{for(const p of u)p.type==="attributes"&&p.attributeName&&l.includes(p.attributeName)&&n(p)});return i.observe(e.current,{attributes:!0,attributeFilter:l}),()=>i.disconnect()})}function vV(e,t){const n=un(e);d.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var xV=50,TS=300;function bV(e,t){const[n,r]=d.useState(!1),[o,s]=d.useState(null),[l,i]=d.useState(!0),u=d.useRef(null),p=()=>clearTimeout(u.current);vV(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?xV:null);const m=d.useCallback(()=>{l&&e(),u.current=setTimeout(()=>{i(!1),r(!0),s("increment")},TS)},[e,l]),h=d.useCallback(()=>{l&&t(),u.current=setTimeout(()=>{i(!1),r(!0),s("decrement")},TS)},[t,l]),g=d.useCallback(()=>{i(!0),r(!1),p()},[]);return d.useEffect(()=>()=>p(),[]),{up:m,down:h,stop:g,isSpinning:n}}var yV=/^[Ee0-9+\-.]$/;function CV(e){return yV.test(e)}function wV(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function SV(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:l=1,isReadOnly:i,isDisabled:u,isRequired:p,isInvalid:m,pattern:h="[0-9]*(.[0-9]+)?",inputMode:g="decimal",allowMouseWheel:x,id:y,onChange:b,precision:C,name:S,"aria-describedby":_,"aria-label":j,"aria-labelledby":E,onFocus:I,onBlur:M,onInvalid:D,getAriaValueText:R,isValidCharacter:A,format:O,parse:$,...X}=e,z=un(I),V=un(M),Q=un(D),G=un(A??CV),F=un(R),U=UL(e),{update:T,increment:B,decrement:Y}=U,[re,ae]=d.useState(!1),oe=!(i||u),q=d.useRef(null),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useCallback(ye=>ye.split("").filter(G).join(""),[G]),ie=d.useCallback(ye=>{var et;return(et=$==null?void 0:$(ye))!=null?et:ye},[$]),de=d.useCallback(ye=>{var et;return((et=O==null?void 0:O(ye))!=null?et:ye).toString()},[O]);pa(()=>{(U.valueAsNumber>s||U.valueAsNumber<o)&&(Q==null||Q("rangeOverflow",de(U.value),U.valueAsNumber))},[U.valueAsNumber,U.value,de,Q]),oc(()=>{if(!q.current)return;if(q.current.value!=U.value){const et=ie(q.current.value);U.setValue(J(et))}},[ie,J]);const xe=d.useCallback((ye=l)=>{oe&&B(ye)},[B,oe,l]),we=d.useCallback((ye=l)=>{oe&&Y(ye)},[Y,oe,l]),ve=bV(xe,we);AS(ee,"disabled",ve.stop,ve.isSpinning),AS(ce,"disabled",ve.stop,ve.isSpinning);const fe=d.useCallback(ye=>{if(ye.nativeEvent.isComposing)return;const ct=ie(ye.currentTarget.value);T(J(ct)),K.current={start:ye.currentTarget.selectionStart,end:ye.currentTarget.selectionEnd}},[T,J,ie]),Oe=d.useCallback(ye=>{var et,ct,ft;z==null||z(ye),K.current&&(ye.target.selectionStart=(ct=K.current.start)!=null?ct:(et=ye.currentTarget.value)==null?void 0:et.length,ye.currentTarget.selectionEnd=(ft=K.current.end)!=null?ft:ye.currentTarget.selectionStart)},[z]),je=d.useCallback(ye=>{if(ye.nativeEvent.isComposing)return;wV(ye,G)||ye.preventDefault();const et=$e(ye)*l,ct=ye.key,Me={ArrowUp:()=>xe(et),ArrowDown:()=>we(et),Home:()=>T(o),End:()=>T(s)}[ct];Me&&(ye.preventDefault(),Me(ye))},[G,l,xe,we,T,o,s]),$e=ye=>{let et=1;return(ye.metaKey||ye.ctrlKey)&&(et=.1),ye.shiftKey&&(et=10),et},st=d.useMemo(()=>{const ye=F==null?void 0:F(U.value);if(ye!=null)return ye;const et=U.value.toString();return et||void 0},[U.value,F]),Ve=d.useCallback(()=>{let ye=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumber<o&&(ye=o),U.valueAsNumber>s&&(ye=s),U.cast(ye))},[U,s,o]),Ct=d.useCallback(()=>{ae(!1),n&&Ve()},[n,ae,Ve]),Ye=d.useCallback(()=>{t&&requestAnimationFrame(()=>{var ye;(ye=q.current)==null||ye.focus()})},[t]),Ke=d.useCallback(ye=>{ye.preventDefault(),ve.up(),Ye()},[Ye,ve]),he=d.useCallback(ye=>{ye.preventDefault(),ve.down(),Ye()},[Ye,ve]);Tl(()=>q.current,"wheel",ye=>{var et,ct;const Me=((ct=(et=q.current)==null?void 0:et.ownerDocument)!=null?ct:document).activeElement===q.current;if(!x||!Me)return;ye.preventDefault();const Ne=$e(ye)*l,Ut=Math.sign(ye.deltaY);Ut===-1?xe(Ne):Ut===1&&we(Ne)},{passive:!1});const Re=d.useCallback((ye={},et=null)=>{const ct=u||r&&U.isAtMax;return{...ye,ref:Pt(et,ee),role:"button",tabIndex:-1,onPointerDown:Fe(ye.onPointerDown,ft=>{ft.button!==0||ct||Ke(ft)}),onPointerLeave:Fe(ye.onPointerLeave,ve.stop),onPointerUp:Fe(ye.onPointerUp,ve.stop),disabled:ct,"aria-disabled":bo(ct)}},[U.isAtMax,r,Ke,ve.stop,u]),ut=d.useCallback((ye={},et=null)=>{const ct=u||r&&U.isAtMin;return{...ye,ref:Pt(et,ce),role:"button",tabIndex:-1,onPointerDown:Fe(ye.onPointerDown,ft=>{ft.button!==0||ct||he(ft)}),onPointerLeave:Fe(ye.onPointerLeave,ve.stop),onPointerUp:Fe(ye.onPointerUp,ve.stop),disabled:ct,"aria-disabled":bo(ct)}},[U.isAtMin,r,he,ve.stop,u]),yt=d.useCallback((ye={},et=null)=>{var ct,ft,Me,Ne;return{name:S,inputMode:g,type:"text",pattern:h,"aria-labelledby":E,"aria-label":j,"aria-describedby":_,id:y,disabled:u,...ye,readOnly:(ct=ye.readOnly)!=null?ct:i,"aria-readonly":(ft=ye.readOnly)!=null?ft:i,"aria-required":(Me=ye.required)!=null?Me:p,required:(Ne=ye.required)!=null?Ne:p,ref:Pt(q,et),value:de(U.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":bo(m??U.isOutOfRange),"aria-valuetext":st,autoComplete:"off",autoCorrect:"off",onChange:Fe(ye.onChange,fe),onKeyDown:Fe(ye.onKeyDown,je),onFocus:Fe(ye.onFocus,Oe,()=>ae(!0)),onBlur:Fe(ye.onBlur,V,Ct)}},[S,g,h,E,j,de,_,y,u,p,i,m,U.value,U.valueAsNumber,U.isOutOfRange,o,s,st,fe,je,Oe,V,Ct]);return{value:de(U.value),valueAsNumber:U.valueAsNumber,isFocused:re,isDisabled:u,isReadOnly:i,getIncrementButtonProps:Re,getDecrementButtonProps:ut,getInputProps:yt,htmlProps:X}}var[kV,Fh]=Wt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[_V,Qb]=Wt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Bh=_e(function(t,n){const r=Un("NumberInput",t),o=on(t),s=Cb(o),{htmlProps:l,...i}=SV(s),u=d.useMemo(()=>i,[i]);return a.jsx(_V,{value:u,children:a.jsx(kV,{value:r,children:a.jsx(Se.div,{...l,ref:n,className:Je("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Bh.displayName="NumberInput";var Hh=_e(function(t,n){const r=Fh();return a.jsx(Se.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});Hh.displayName="NumberInputStepper";var Vh=_e(function(t,n){const{getInputProps:r}=Qb(),o=r(t,n),s=Fh();return a.jsx(Se.input,{...o,className:Je("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Vh.displayName="NumberInputField";var W3=Se("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Wh=_e(function(t,n){var r;const o=Fh(),{getDecrementButtonProps:s}=Qb(),l=s(t,n);return a.jsx(W3,{...l,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(hV,{})})});Wh.displayName="NumberDecrementStepper";var Uh=_e(function(t,n){var r;const{getIncrementButtonProps:o}=Qb(),s=o(t,n),l=Fh();return a.jsx(W3,{...s,__css:l.stepper,children:(r=t.children)!=null?r:a.jsx(gV,{})})});Uh.displayName="NumberIncrementStepper";var[jV,ni]=Wt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[IV,Gh]=Wt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Kh(e){const t=d.Children.only(e.children),{getTriggerProps:n}=ni();return d.cloneElement(t,n(t.props,t.ref))}Kh.displayName="PopoverTrigger";var Ni={click:"click",hover:"hover"};function PV(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:l=!0,arrowSize:i,arrowShadowColor:u,trigger:p=Ni.click,openDelay:m=200,closeDelay:h=200,isLazy:g,lazyBehavior:x="unmount",computePositionOnMount:y,...b}=e,{isOpen:C,onClose:S,onOpen:_,onToggle:j}=qb(e),E=d.useRef(null),I=d.useRef(null),M=d.useRef(null),D=d.useRef(!1),R=d.useRef(!1);C&&(R.current=!0);const[A,O]=d.useState(!1),[$,X]=d.useState(!1),z=d.useId(),V=o??z,[Q,G,F,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(fe=>`${fe}-${V}`),{referenceRef:T,getArrowProps:B,getPopperProps:Y,getArrowInnerProps:re,forceUpdate:ae}=Kb({...b,enabled:C||!!y}),oe=O3({isOpen:C,ref:M});k5({enabled:C,ref:I}),y3(M,{focusRef:I,visible:C,shouldFocus:s&&p===Ni.click}),$F(M,{focusRef:r,visible:C,shouldFocus:l&&p===Ni.click});const q=Xb({wasSelected:R.current,enabled:g,mode:x,isSelected:oe.present}),K=d.useCallback((fe={},Oe=null)=>{const je={...fe,style:{...fe.style,transformOrigin:$n.transformOrigin.varRef,[$n.arrowSize.var]:i?`${i}px`:void 0,[$n.arrowShadowColor.var]:u},ref:Pt(M,Oe),children:q?fe.children:null,id:G,tabIndex:-1,role:"dialog",onKeyDown:Fe(fe.onKeyDown,$e=>{n&&$e.key==="Escape"&&S()}),onBlur:Fe(fe.onBlur,$e=>{const st=$S($e),Ve=bv(M.current,st),Ct=bv(I.current,st);C&&t&&(!Ve&&!Ct)&&S()}),"aria-labelledby":A?F:void 0,"aria-describedby":$?U:void 0};return p===Ni.hover&&(je.role="tooltip",je.onMouseEnter=Fe(fe.onMouseEnter,()=>{D.current=!0}),je.onMouseLeave=Fe(fe.onMouseLeave,$e=>{$e.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>S(),h))})),je},[q,G,A,F,$,U,p,n,S,C,t,h,u,i]),ee=d.useCallback((fe={},Oe=null)=>Y({...fe,style:{visibility:C?"visible":"hidden",...fe.style}},Oe),[C,Y]),ce=d.useCallback((fe,Oe=null)=>({...fe,ref:Pt(Oe,E,T)}),[E,T]),J=d.useRef(),ie=d.useRef(),de=d.useCallback(fe=>{E.current==null&&T(fe)},[T]),xe=d.useCallback((fe={},Oe=null)=>{const je={...fe,ref:Pt(I,Oe,de),id:Q,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":G};return p===Ni.click&&(je.onClick=Fe(fe.onClick,j)),p===Ni.hover&&(je.onFocus=Fe(fe.onFocus,()=>{J.current===void 0&&_()}),je.onBlur=Fe(fe.onBlur,$e=>{const st=$S($e),Ve=!bv(M.current,st);C&&t&&Ve&&S()}),je.onKeyDown=Fe(fe.onKeyDown,$e=>{$e.key==="Escape"&&S()}),je.onMouseEnter=Fe(fe.onMouseEnter,()=>{D.current=!0,J.current=window.setTimeout(()=>_(),m)}),je.onMouseLeave=Fe(fe.onMouseLeave,()=>{D.current=!1,J.current&&(clearTimeout(J.current),J.current=void 0),ie.current=window.setTimeout(()=>{D.current===!1&&S()},h)})),je},[Q,C,G,p,de,j,_,t,S,m,h]);d.useEffect(()=>()=>{J.current&&clearTimeout(J.current),ie.current&&clearTimeout(ie.current)},[]);const we=d.useCallback((fe={},Oe=null)=>({...fe,id:F,ref:Pt(Oe,je=>{O(!!je)})}),[F]),ve=d.useCallback((fe={},Oe=null)=>({...fe,id:U,ref:Pt(Oe,je=>{X(!!je)})}),[U]);return{forceUpdate:ae,isOpen:C,onAnimationComplete:oe.onComplete,onClose:S,getAnchorProps:ce,getArrowProps:B,getArrowInnerProps:re,getPopoverPositionerProps:ee,getPopoverProps:K,getTriggerProps:xe,getHeaderProps:we,getBodyProps:ve}}function bv(e,t){return e===t||(e==null?void 0:e.contains(t))}function $S(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function Bd(e){const t=Un("Popover",e),{children:n,...r}=on(e),o=wd(),s=PV({...r,direction:o.direction});return a.jsx(jV,{value:s,children:a.jsx(IV,{value:t,children:Vx(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}Bd.displayName="Popover";function U3(e){const t=d.Children.only(e.children),{getAnchorProps:n}=ni();return d.cloneElement(t,n(t.props,t.ref))}U3.displayName="PopoverAnchor";var yv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function G3(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:l,shadowColor:i}=e,{getArrowProps:u,getArrowInnerProps:p}=ni(),m=Gh(),h=(t=n??r)!=null?t:o,g=s??l;return a.jsx(Se.div,{...u(),className:"chakra-popover__arrow-positioner",children:a.jsx(Se.div,{className:Je("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":yv("colors",i),"--popper-arrow-bg":yv("colors",h),"--popper-arrow-shadow":yv("shadows",g),...m.arrow}})})}G3.displayName="PopoverArrow";var qh=_e(function(t,n){const{getBodyProps:r}=ni(),o=Gh();return a.jsx(Se.div,{...r(t,n),className:Je("chakra-popover__body",t.className),__css:o.body})});qh.displayName="PopoverBody";var K3=_e(function(t,n){const{onClose:r}=ni(),o=Gh();return a.jsx(tI,{size:"sm",onClick:r,className:Je("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});K3.displayName="PopoverCloseButton";function EV(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var MV={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},OV=Se(jn.section),q3=_e(function(t,n){const{variants:r=MV,...o}=t,{isOpen:s}=ni();return a.jsx(OV,{ref:n,variants:EV(r),initial:!1,animate:s?"enter":"exit",...o})});q3.displayName="PopoverTransition";var Hd=_e(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:l,getPopoverPositionerProps:i,onAnimationComplete:u}=ni(),p=Gh(),m={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(Se.div,{...i(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(q3,{...o,...l(s,n),onAnimationComplete:xh(u,s.onAnimationComplete),className:Je("chakra-popover__content",t.className),__css:m})})});Hd.displayName="PopoverContent";var H1=e=>a.jsx(Se.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});H1.displayName="Circle";function DV(e,t,n){return(e-t)*100/(n-t)}var RV=ma({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),AV=ma({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),TV=ma({"0%":{left:"-40%"},"100%":{left:"100%"}}),$V=ma({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function X3(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:l,role:i="progressbar"}=e,u=DV(t,n,r);return{bind:{"data-indeterminate":l?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":l?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,u):o})(),role:i},percent:u,value:t}}var Q3=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(Se.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${AV} 2s linear infinite`:void 0},...r})};Q3.displayName="Shape";var V1=_e((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:l,getValueText:i,value:u,capIsRound:p,children:m,thickness:h="10px",color:g="#0078d4",trackColor:x="#edebe9",isIndeterminate:y,...b}=e,C=X3({min:s,max:o,value:u,valueText:l,getValueText:i,isIndeterminate:y}),S=y?void 0:((n=C.percent)!=null?n:0)*2.64,_=S==null?void 0:`${S} ${264-S}`,j=y?{css:{animation:`${RV} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:_,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},E={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(Se.div,{ref:t,className:"chakra-progress",...C.bind,...b,__css:E,children:[a.jsxs(Q3,{size:r,isIndeterminate:y,children:[a.jsx(H1,{stroke:x,strokeWidth:h,className:"chakra-progress__track"}),a.jsx(H1,{stroke:g,strokeWidth:h,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:C.value===0&&!y?0:void 0,...j})]}),m]})});V1.displayName="CircularProgress";var[NV,LV]=Wt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),zV=_e((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:l,...i}=e,u=X3({value:o,min:n,max:r,isIndeterminate:s,role:l}),m={height:"100%",...LV().filledTrack};return a.jsx(Se.div,{ref:t,style:{width:`${u.percent}%`,...i.style},...u.bind,...i,__css:m})}),Y3=_e((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:l,isAnimated:i,children:u,borderRadius:p,isIndeterminate:m,"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,title:y,role:b,...C}=on(e),S=Un("Progress",e),_=p??((n=S.track)==null?void 0:n.borderRadius),j={animation:`${$V} 1s linear infinite`},M={...!m&&l&&i&&j,...m&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${TV} 1s ease infinite normal none running`}},D={overflow:"hidden",position:"relative",...S.track};return a.jsx(Se.div,{ref:t,borderRadius:_,__css:D,...C,children:a.jsxs(NV,{value:S,children:[a.jsx(zV,{"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,min:o,max:s,value:r,isIndeterminate:m,css:M,borderRadius:_,title:y,role:b}),u]})})});Y3.displayName="Progress";function FV(e){return e&&u1(e)&&u1(e.target)}function BV(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:l,isNative:i,...u}=e,[p,m]=d.useState(r||""),h=typeof n<"u",g=h?n:p,x=d.useRef(null),y=d.useCallback(()=>{const I=x.current;if(!I)return;let M="input:not(:disabled):checked";const D=I.querySelector(M);if(D){D.focus();return}M="input:not(:disabled)";const R=I.querySelector(M);R==null||R.focus()},[]),C=`radio-${d.useId()}`,S=o||C,_=d.useCallback(I=>{const M=FV(I)?I.target.value:I;h||m(M),t==null||t(String(M))},[t,h]),j=d.useCallback((I={},M=null)=>({...I,ref:Pt(M,x),role:"radiogroup"}),[]),E=d.useCallback((I={},M=null)=>({...I,ref:M,name:S,[i?"checked":"isChecked"]:g!=null?I.value===g:void 0,onChange(R){_(R)},"data-radiogroup":!0}),[i,S,_,g]);return{getRootProps:j,getRadioProps:E,name:S,ref:x,focus:y,setValue:m,value:g,onChange:_,isDisabled:s,isFocusable:l,htmlProps:u}}var[HV,Z3]=Wt({name:"RadioGroupContext",strict:!1}),mm=_e((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:l,isDisabled:i,isFocusable:u,...p}=e,{value:m,onChange:h,getRootProps:g,name:x,htmlProps:y}=BV(p),b=d.useMemo(()=>({name:x,size:r,onChange:h,colorScheme:n,value:m,variant:o,isDisabled:i,isFocusable:u}),[x,r,h,n,m,o,i,u]);return a.jsx(HV,{value:b,children:a.jsx(Se.div,{...g(y,t),className:Je("chakra-radio-group",l),children:s})})});mm.displayName="RadioGroup";var VV={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function WV(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:l,onChange:i,isInvalid:u,name:p,value:m,id:h,"data-radiogroup":g,"aria-describedby":x,...y}=e,b=`radio-${d.useId()}`,C=Od(),_=!!Z3()||!!g;let E=!!C&&!_?C.id:b;E=h??E;const I=o??(C==null?void 0:C.isDisabled),M=s??(C==null?void 0:C.isReadOnly),D=l??(C==null?void 0:C.isRequired),R=u??(C==null?void 0:C.isInvalid),[A,O]=d.useState(!1),[$,X]=d.useState(!1),[z,V]=d.useState(!1),[Q,G]=d.useState(!1),[F,U]=d.useState(!!t),T=typeof n<"u",B=T?n:F;d.useEffect(()=>v5(O),[]);const Y=d.useCallback(de=>{if(M||I){de.preventDefault();return}T||U(de.target.checked),i==null||i(de)},[T,I,M,i]),re=d.useCallback(de=>{de.key===" "&&G(!0)},[G]),ae=d.useCallback(de=>{de.key===" "&&G(!1)},[G]),oe=d.useCallback((de={},xe=null)=>({...de,ref:xe,"data-active":dt(Q),"data-hover":dt(z),"data-disabled":dt(I),"data-invalid":dt(R),"data-checked":dt(B),"data-focus":dt($),"data-focus-visible":dt($&&A),"data-readonly":dt(M),"aria-hidden":!0,onMouseDown:Fe(de.onMouseDown,()=>G(!0)),onMouseUp:Fe(de.onMouseUp,()=>G(!1)),onMouseEnter:Fe(de.onMouseEnter,()=>V(!0)),onMouseLeave:Fe(de.onMouseLeave,()=>V(!1))}),[Q,z,I,R,B,$,M,A]),{onFocus:q,onBlur:K}=C??{},ee=d.useCallback((de={},xe=null)=>{const we=I&&!r;return{...de,id:E,ref:xe,type:"radio",name:p,value:m,onChange:Fe(de.onChange,Y),onBlur:Fe(K,de.onBlur,()=>X(!1)),onFocus:Fe(q,de.onFocus,()=>X(!0)),onKeyDown:Fe(de.onKeyDown,re),onKeyUp:Fe(de.onKeyUp,ae),checked:B,disabled:we,readOnly:M,required:D,"aria-invalid":bo(R),"aria-disabled":bo(we),"aria-required":bo(D),"data-readonly":dt(M),"aria-describedby":x,style:VV}},[I,r,E,p,m,Y,K,q,re,ae,B,M,D,R,x]);return{state:{isInvalid:R,isFocused:$,isChecked:B,isActive:Q,isHovered:z,isDisabled:I,isReadOnly:M,isRequired:D},getCheckboxProps:oe,getRadioProps:oe,getInputProps:ee,getLabelProps:(de={},xe=null)=>({...de,ref:xe,onMouseDown:Fe(de.onMouseDown,UV),"data-disabled":dt(I),"data-checked":dt(B),"data-invalid":dt(R)}),getRootProps:(de,xe=null)=>({...de,ref:xe,"data-disabled":dt(I),"data-checked":dt(B),"data-invalid":dt(R)}),htmlProps:y}}function UV(e){e.preventDefault(),e.stopPropagation()}function GV(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var qs=_e((e,t)=>{var n;const r=Z3(),{onChange:o,value:s}=e,l=Un("Radio",{...r,...e}),i=on(e),{spacing:u="0.5rem",children:p,isDisabled:m=r==null?void 0:r.isDisabled,isFocusable:h=r==null?void 0:r.isFocusable,inputProps:g,...x}=i;let y=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(y=r.value===s);let b=o;r!=null&&r.onChange&&s!=null&&(b=xh(r.onChange,o));const C=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:S,getCheckboxProps:_,getLabelProps:j,getRootProps:E,htmlProps:I}=WV({...x,isChecked:y,isFocusable:h,isDisabled:m,onChange:b,name:C}),[M,D]=GV(I,nI),R=_(D),A=S(g,t),O=j(),$=Object.assign({},M,E()),X={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...l.container},z={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...l.control},V={userSelect:"none",marginStart:u,...l.label};return a.jsxs(Se.label,{className:"chakra-radio",...$,__css:X,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(Se.span,{className:"chakra-radio__control",...R,__css:z}),p&&a.jsx(Se.span,{className:"chakra-radio__label",...O,__css:V,children:p})]})});qs.displayName="Radio";var J3=_e(function(t,n){const{children:r,placeholder:o,className:s,...l}=t;return a.jsxs(Se.select,{...l,ref:n,className:Je("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});J3.displayName="SelectField";function KV(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var eP=_e((e,t)=>{var n;const r=Un("Select",e),{rootProps:o,placeholder:s,icon:l,color:i,height:u,h:p,minH:m,minHeight:h,iconColor:g,iconSize:x,...y}=on(e),[b,C]=KV(y,nI),S=yb(C),_={width:"100%",height:"fit-content",position:"relative",color:i},j={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(Se.div,{className:"chakra-select__wrapper",__css:_,...b,...o,children:[a.jsx(J3,{ref:t,height:p??u,minH:m??h,placeholder:s,...S,__css:j,children:e.children}),a.jsx(tP,{"data-disabled":dt(S.disabled),...(g||i)&&{color:g||i},__css:r.icon,...x&&{fontSize:x},children:l})]})});eP.displayName="Select";var qV=e=>a.jsx("svg",{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),XV=Se("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),tP=e=>{const{children:t=a.jsx(qV,{}),...n}=e,r=d.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(XV,{...n,className:"chakra-select__icon-wrapper",children:d.isValidElement(t)?r:null})};tP.displayName="SelectIcon";function QV(){const e=d.useRef(!0);return d.useEffect(()=>{e.current=!1},[]),e.current}function YV(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var ZV=Se("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),W1=rI("skeleton-start-color"),U1=rI("skeleton-end-color"),JV=ma({from:{opacity:0},to:{opacity:1}}),eW=ma({from:{borderColor:W1.reference,background:W1.reference},to:{borderColor:U1.reference,background:U1.reference}}),Xh=_e((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=al("Skeleton",n),o=QV(),{startColor:s="",endColor:l="",isLoaded:i,fadeDuration:u,speed:p,className:m,fitContent:h,...g}=on(n),[x,y]=Ho("colors",[s,l]),b=YV(i),C=Je("chakra-skeleton",m),S={...x&&{[W1.variable]:x},...y&&{[U1.variable]:y}};if(i){const _=o||b?"none":`${JV} ${u}s`;return a.jsx(Se.div,{ref:t,className:C,__css:{animation:_},...g})}return a.jsx(ZV,{ref:t,className:C,...g,__css:{width:h?"fit-content":void 0,...r,...S,_dark:{...r._dark,...S},animation:`${p}s linear infinite alternate ${eW}`}})});Xh.displayName="Skeleton";var fo=e=>e?"":void 0,dc=e=>e?!0:void 0,cl=(...e)=>e.filter(Boolean).join(" ");function fc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function tW(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function $u(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Hp={width:0,height:0},lp=e=>e||Hp;function nP(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=b=>{var C;const S=(C=r[b])!=null?C:Hp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...$u({orientation:t,vertical:{bottom:`calc(${n[b]}% - ${S.height/2}px)`},horizontal:{left:`calc(${n[b]}% - ${S.width/2}px)`}})}},l=t==="vertical"?r.reduce((b,C)=>lp(b).height>lp(C).height?b:C,Hp):r.reduce((b,C)=>lp(b).width>lp(C).width?b:C,Hp),i={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...$u({orientation:t,vertical:l?{paddingLeft:l.width/2,paddingRight:l.width/2}:{},horizontal:l?{paddingTop:l.height/2,paddingBottom:l.height/2}:{}})},u={position:"absolute",...$u({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,m=[0,o?100-n[0]:n[0]],h=p?m:n;let g=h[0];!p&&o&&(g=100-g);const x=Math.abs(h[h.length-1]-h[0]),y={...u,...$u({orientation:t,vertical:o?{height:`${x}%`,top:`${g}%`}:{height:`${x}%`,bottom:`${g}%`},horizontal:o?{width:`${x}%`,right:`${g}%`}:{width:`${x}%`,left:`${g}%`}})};return{trackStyle:u,innerTrackStyle:y,rootStyle:i,getThumbStyle:s}}function rP(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function nW(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function rW(e){const t=sW(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function oP(e){return!!e.touches}function oW(e){return oP(e)&&e.touches.length>1}function sW(e){var t;return(t=e.view)!=null?t:window}function aW(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function lW(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function sP(e,t="page"){return oP(e)?aW(e,t):lW(e,t)}function iW(e){return t=>{const n=rW(t);(!n||n&&t.button===0)&&e(t)}}function cW(e,t=!1){function n(o){e(o,{point:sP(o)})}return t?iW(n):n}function Vp(e,t,n,r){return nW(e,t,cW(n,t==="pointerdown"),r)}var uW=Object.defineProperty,dW=(e,t,n)=>t in e?uW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,No=(e,t,n)=>(dW(e,typeof t!="symbol"?t+"":t,n),n),fW=class{constructor(e,t,n){No(this,"history",[]),No(this,"startEvent",null),No(this,"lastEvent",null),No(this,"lastEventInfo",null),No(this,"handlers",{}),No(this,"removeListeners",()=>{}),No(this,"threshold",3),No(this,"win"),No(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const i=Cv(this.lastEventInfo,this.history),u=this.startEvent!==null,p=gW(i.offset,{x:0,y:0})>=this.threshold;if(!u&&!p)return;const{timestamp:m}=Zw();this.history.push({...i.point,timestamp:m});const{onStart:h,onMove:g}=this.handlers;u||(h==null||h(this.lastEvent,i),this.startEvent=this.lastEvent),g==null||g(this.lastEvent,i)}),No(this,"onPointerMove",(i,u)=>{this.lastEvent=i,this.lastEventInfo=u,$N.update(this.updatePoint,!0)}),No(this,"onPointerUp",(i,u)=>{const p=Cv(u,this.history),{onEnd:m,onSessionEnd:h}=this.handlers;h==null||h(i,p),this.end(),!(!m||!this.startEvent)&&(m==null||m(i,p))});var r;if(this.win=(r=e.view)!=null?r:window,oW(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:sP(e)},{timestamp:s}=Zw();this.history=[{...o.point,timestamp:s}];const{onSessionStart:l}=t;l==null||l(e,Cv(o,this.history)),this.removeListeners=hW(Vp(this.win,"pointermove",this.onPointerMove),Vp(this.win,"pointerup",this.onPointerUp),Vp(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),NN.update(this.updatePoint)}};function NS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Cv(e,t){return{point:e.point,delta:NS(e.point,t[t.length-1]),offset:NS(e.point,t[0]),velocity:mW(t,.1)}}var pW=e=>e*1e3;function mW(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>pW(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const l={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function hW(...e){return t=>e.reduce((n,r)=>r(n),t)}function wv(e,t){return Math.abs(e-t)}function LS(e){return"x"in e&&"y"in e}function gW(e,t){if(typeof e=="number"&&typeof t=="number")return wv(e,t);if(LS(e)&&LS(t)){const n=wv(e.x,t.x),r=wv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function aP(e){const t=d.useRef(null);return t.current=e,t}function lP(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:l,threshold:i}=t,u=!!(n||r||o||s||l),p=d.useRef(null),m=aP({onSessionStart:s,onSessionEnd:l,onStart:r,onMove:n,onEnd(h,g){p.current=null,o==null||o(h,g)}});d.useEffect(()=>{var h;(h=p.current)==null||h.updateHandlers(m.current)}),d.useEffect(()=>{const h=e.current;if(!h||!u)return;function g(x){p.current=new fW(x,m.current,i)}return Vp(h,"pointerdown",g)},[e,u,m,i]),d.useEffect(()=>()=>{var h;(h=p.current)==null||h.end(),p.current=null},[])}function vW(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[s]=o;let l,i;if("borderBoxSize"in s){const u=s.borderBoxSize,p=Array.isArray(u)?u[0]:u;l=p.inlineSize,i=p.blockSize}else l=e.offsetWidth,i=e.offsetHeight;t({width:l,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var xW=globalThis!=null&&globalThis.document?d.useLayoutEffect:d.useEffect;function bW(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function iP({getNodes:e,observeMutation:t=!0}){const[n,r]=d.useState([]),[o,s]=d.useState(0);return xW(()=>{const l=e(),i=l.map((u,p)=>vW(u,m=>{r(h=>[...h.slice(0,p),m,...h.slice(p+1)])}));if(t){const u=l[0];i.push(bW(u,()=>{s(p=>p+1)}))}return()=>{i.forEach(u=>{u==null||u()})}},[o]),n}function yW(e){return typeof e=="object"&&e!==null&&"current"in e}function CW(e){const[t]=iP({observeMutation:!1,getNodes(){return[yW(e)?e.current:e]}});return t}function wW(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:l,direction:i="ltr",orientation:u="horizontal",id:p,isDisabled:m,isReadOnly:h,onChangeStart:g,onChangeEnd:x,step:y=1,getAriaValueText:b,"aria-valuetext":C,"aria-label":S,"aria-labelledby":_,name:j,focusThumbOnChange:E=!0,minStepsBetweenThumbs:I=0,...M}=e,D=un(g),R=un(x),A=un(b),O=rP({isReversed:l,direction:i,orientation:u}),[$,X]=Ed({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray($))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof $}\``);const[z,V]=d.useState(!1),[Q,G]=d.useState(!1),[F,U]=d.useState(-1),T=!(m||h),B=d.useRef($),Y=$.map(ke=>lc(ke,t,n)),re=I*y,ae=SW(Y,t,n,re),oe=d.useRef({eventSource:null,value:[],valueBounds:[]});oe.current.value=Y,oe.current.valueBounds=ae;const q=Y.map(ke=>n-ke+t),ee=(O?q:Y).map(ke=>cm(ke,t,n)),ce=u==="vertical",J=d.useRef(null),ie=d.useRef(null),de=iP({getNodes(){const ke=ie.current,ze=ke==null?void 0:ke.querySelectorAll("[role=slider]");return ze?Array.from(ze):[]}}),xe=d.useId(),ve=tW(p??xe),fe=d.useCallback(ke=>{var ze,Le;if(!J.current)return;oe.current.eventSource="pointer";const Ge=J.current.getBoundingClientRect(),{clientX:pt,clientY:Pn}=(Le=(ze=ke.touches)==null?void 0:ze[0])!=null?Le:ke,Rt=ce?Ge.bottom-Pn:pt-Ge.left,At=ce?Ge.height:Ge.width;let pr=Rt/At;return O&&(pr=1-pr),b5(pr,t,n)},[ce,O,n,t]),Oe=(n-t)/10,je=y||(n-t)/100,$e=d.useMemo(()=>({setValueAtIndex(ke,ze){if(!T)return;const Le=oe.current.valueBounds[ke];ze=parseFloat(M1(ze,Le.min,je)),ze=lc(ze,Le.min,Le.max);const Ge=[...oe.current.value];Ge[ke]=ze,X(Ge)},setActiveIndex:U,stepUp(ke,ze=je){const Le=oe.current.value[ke],Ge=O?Le-ze:Le+ze;$e.setValueAtIndex(ke,Ge)},stepDown(ke,ze=je){const Le=oe.current.value[ke],Ge=O?Le+ze:Le-ze;$e.setValueAtIndex(ke,Ge)},reset(){X(B.current)}}),[je,O,X,T]),st=d.useCallback(ke=>{const ze=ke.key,Ge={ArrowRight:()=>$e.stepUp(F),ArrowUp:()=>$e.stepUp(F),ArrowLeft:()=>$e.stepDown(F),ArrowDown:()=>$e.stepDown(F),PageUp:()=>$e.stepUp(F,Oe),PageDown:()=>$e.stepDown(F,Oe),Home:()=>{const{min:pt}=ae[F];$e.setValueAtIndex(F,pt)},End:()=>{const{max:pt}=ae[F];$e.setValueAtIndex(F,pt)}}[ze];Ge&&(ke.preventDefault(),ke.stopPropagation(),Ge(ke),oe.current.eventSource="keyboard")},[$e,F,Oe,ae]),{getThumbStyle:Ve,rootStyle:Ct,trackStyle:Ye,innerTrackStyle:Ke}=d.useMemo(()=>nP({isReversed:O,orientation:u,thumbRects:de,thumbPercents:ee}),[O,u,ee,de]),he=d.useCallback(ke=>{var ze;const Le=ke??F;if(Le!==-1&&E){const Ge=ve.getThumb(Le),pt=(ze=ie.current)==null?void 0:ze.ownerDocument.getElementById(Ge);pt&&setTimeout(()=>pt.focus())}},[E,F,ve]);pa(()=>{oe.current.eventSource==="keyboard"&&(R==null||R(oe.current.value))},[Y,R]);const Re=ke=>{const ze=fe(ke)||0,Le=oe.current.value.map(At=>Math.abs(At-ze)),Ge=Math.min(...Le);let pt=Le.indexOf(Ge);const Pn=Le.filter(At=>At===Ge);Pn.length>1&&ze>oe.current.value[pt]&&(pt=pt+Pn.length-1),U(pt),$e.setValueAtIndex(pt,ze),he(pt)},ut=ke=>{if(F==-1)return;const ze=fe(ke)||0;U(F),$e.setValueAtIndex(F,ze),he(F)};lP(ie,{onPanSessionStart(ke){T&&(V(!0),Re(ke),D==null||D(oe.current.value))},onPanSessionEnd(){T&&(V(!1),R==null||R(oe.current.value))},onPan(ke){T&&ut(ke)}});const yt=d.useCallback((ke={},ze=null)=>({...ke,...M,id:ve.root,ref:Pt(ze,ie),tabIndex:-1,"aria-disabled":dc(m),"data-focused":fo(Q),style:{...ke.style,...Ct}}),[M,m,Q,Ct,ve]),ye=d.useCallback((ke={},ze=null)=>({...ke,ref:Pt(ze,J),id:ve.track,"data-disabled":fo(m),style:{...ke.style,...Ye}}),[m,Ye,ve]),et=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:ve.innerTrack,style:{...ke.style,...Ke}}),[Ke,ve]),ct=d.useCallback((ke,ze=null)=>{var Le;const{index:Ge,...pt}=ke,Pn=Y[Ge];if(Pn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${Ge}\`. The \`value\` or \`defaultValue\` length is : ${Y.length}`);const Rt=ae[Ge];return{...pt,ref:ze,role:"slider",tabIndex:T?0:void 0,id:ve.getThumb(Ge),"data-active":fo(z&&F===Ge),"aria-valuetext":(Le=A==null?void 0:A(Pn))!=null?Le:C==null?void 0:C[Ge],"aria-valuemin":Rt.min,"aria-valuemax":Rt.max,"aria-valuenow":Pn,"aria-orientation":u,"aria-disabled":dc(m),"aria-readonly":dc(h),"aria-label":S==null?void 0:S[Ge],"aria-labelledby":S!=null&&S[Ge]||_==null?void 0:_[Ge],style:{...ke.style,...Ve(Ge)},onKeyDown:fc(ke.onKeyDown,st),onFocus:fc(ke.onFocus,()=>{G(!0),U(Ge)}),onBlur:fc(ke.onBlur,()=>{G(!1),U(-1)})}},[ve,Y,ae,T,z,F,A,C,u,m,h,S,_,Ve,st,G]),ft=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:ve.output,htmlFor:Y.map((Le,Ge)=>ve.getThumb(Ge)).join(" "),"aria-live":"off"}),[ve,Y]),Me=d.useCallback((ke,ze=null)=>{const{value:Le,...Ge}=ke,pt=!(Le<t||Le>n),Pn=Le>=Y[0]&&Le<=Y[Y.length-1];let Rt=cm(Le,t,n);Rt=O?100-Rt:Rt;const At={position:"absolute",pointerEvents:"none",...$u({orientation:u,vertical:{bottom:`${Rt}%`},horizontal:{left:`${Rt}%`}})};return{...Ge,ref:ze,id:ve.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":fo(m),"data-invalid":fo(!pt),"data-highlighted":fo(Pn),style:{...ke.style,...At}}},[m,O,n,t,u,Y,ve]),Ne=d.useCallback((ke,ze=null)=>{const{index:Le,...Ge}=ke;return{...Ge,ref:ze,id:ve.getInput(Le),type:"hidden",value:Y[Le],name:Array.isArray(j)?j[Le]:`${j}-${Le}`}},[j,Y,ve]);return{state:{value:Y,isFocused:Q,isDragging:z,getThumbPercent:ke=>ee[ke],getThumbMinValue:ke=>ae[ke].min,getThumbMaxValue:ke=>ae[ke].max},actions:$e,getRootProps:yt,getTrackProps:ye,getInnerTrackProps:et,getThumbProps:ct,getMarkerProps:Me,getInputProps:Ne,getOutputProps:ft}}function SW(e,t,n,r){return e.map((o,s)=>{const l=s===0?t:e[s-1]+r,i=s===e.length-1?n:e[s+1]-r;return{min:l,max:i}})}var[kW,Qh]=Wt({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[_W,Yh]=Wt({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),cP=_e(function(t,n){const r={orientation:"horizontal",...t},o=Un("Slider",r),s=on(r),{direction:l}=wd();s.direction=l;const{getRootProps:i,...u}=wW(s),p=d.useMemo(()=>({...u,name:r.name}),[u,r.name]);return a.jsx(kW,{value:p,children:a.jsx(_W,{value:o,children:a.jsx(Se.div,{...i({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});cP.displayName="RangeSlider";var G1=_e(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Qh(),l=Yh(),i=r(t,n);return a.jsxs(Se.div,{...i,className:cl("chakra-slider__thumb",t.className),__css:l.thumb,children:[i.children,s&&a.jsx("input",{...o({index:t.index})})]})});G1.displayName="RangeSliderThumb";var uP=_e(function(t,n){const{getTrackProps:r}=Qh(),o=Yh(),s=r(t,n);return a.jsx(Se.div,{...s,className:cl("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});uP.displayName="RangeSliderTrack";var dP=_e(function(t,n){const{getInnerTrackProps:r}=Qh(),o=Yh(),s=r(t,n);return a.jsx(Se.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});dP.displayName="RangeSliderFilledTrack";var Wp=_e(function(t,n){const{getMarkerProps:r}=Qh(),o=Yh(),s=r(t,n);return a.jsx(Se.div,{...s,className:cl("chakra-slider__marker",t.className),__css:o.mark})});Wp.displayName="RangeSliderMark";function jW(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:l,isReversed:i,direction:u="ltr",orientation:p="horizontal",id:m,isDisabled:h,isReadOnly:g,onChangeStart:x,onChangeEnd:y,step:b=1,getAriaValueText:C,"aria-valuetext":S,"aria-label":_,"aria-labelledby":j,name:E,focusThumbOnChange:I=!0,...M}=e,D=un(x),R=un(y),A=un(C),O=rP({isReversed:i,direction:u,orientation:p}),[$,X]=Ed({value:s,defaultValue:l??PW(n,r),onChange:o}),[z,V]=d.useState(!1),[Q,G]=d.useState(!1),F=!(h||g),U=(r-n)/10,T=b||(r-n)/100,B=lc($,n,r),Y=r-B+n,ae=cm(O?Y:B,n,r),oe=p==="vertical",q=aP({min:n,max:r,step:b,isDisabled:h,value:B,isInteractive:F,isReversed:O,isVertical:oe,eventSource:null,focusThumbOnChange:I,orientation:p}),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useId(),ie=m??J,[de,xe]=[`slider-thumb-${ie}`,`slider-track-${ie}`],we=d.useCallback(Me=>{var Ne,Ut;if(!K.current)return;const ke=q.current;ke.eventSource="pointer";const ze=K.current.getBoundingClientRect(),{clientX:Le,clientY:Ge}=(Ut=(Ne=Me.touches)==null?void 0:Ne[0])!=null?Ut:Me,pt=oe?ze.bottom-Ge:Le-ze.left,Pn=oe?ze.height:ze.width;let Rt=pt/Pn;O&&(Rt=1-Rt);let At=b5(Rt,ke.min,ke.max);return ke.step&&(At=parseFloat(M1(At,ke.min,ke.step))),At=lc(At,ke.min,ke.max),At},[oe,O,q]),ve=d.useCallback(Me=>{const Ne=q.current;Ne.isInteractive&&(Me=parseFloat(M1(Me,Ne.min,T)),Me=lc(Me,Ne.min,Ne.max),X(Me))},[T,X,q]),fe=d.useMemo(()=>({stepUp(Me=T){const Ne=O?B-Me:B+Me;ve(Ne)},stepDown(Me=T){const Ne=O?B+Me:B-Me;ve(Ne)},reset(){ve(l||0)},stepTo(Me){ve(Me)}}),[ve,O,B,T,l]),Oe=d.useCallback(Me=>{const Ne=q.current,ke={ArrowRight:()=>fe.stepUp(),ArrowUp:()=>fe.stepUp(),ArrowLeft:()=>fe.stepDown(),ArrowDown:()=>fe.stepDown(),PageUp:()=>fe.stepUp(U),PageDown:()=>fe.stepDown(U),Home:()=>ve(Ne.min),End:()=>ve(Ne.max)}[Me.key];ke&&(Me.preventDefault(),Me.stopPropagation(),ke(Me),Ne.eventSource="keyboard")},[fe,ve,U,q]),je=(t=A==null?void 0:A(B))!=null?t:S,$e=CW(ee),{getThumbStyle:st,rootStyle:Ve,trackStyle:Ct,innerTrackStyle:Ye}=d.useMemo(()=>{const Me=q.current,Ne=$e??{width:0,height:0};return nP({isReversed:O,orientation:Me.orientation,thumbRects:[Ne],thumbPercents:[ae]})},[O,$e,ae,q]),Ke=d.useCallback(()=>{q.current.focusThumbOnChange&&setTimeout(()=>{var Ne;return(Ne=ee.current)==null?void 0:Ne.focus()})},[q]);pa(()=>{const Me=q.current;Ke(),Me.eventSource==="keyboard"&&(R==null||R(Me.value))},[B,R]);function he(Me){const Ne=we(Me);Ne!=null&&Ne!==q.current.value&&X(Ne)}lP(ce,{onPanSessionStart(Me){const Ne=q.current;Ne.isInteractive&&(V(!0),Ke(),he(Me),D==null||D(Ne.value))},onPanSessionEnd(){const Me=q.current;Me.isInteractive&&(V(!1),R==null||R(Me.value))},onPan(Me){q.current.isInteractive&&he(Me)}});const Re=d.useCallback((Me={},Ne=null)=>({...Me,...M,ref:Pt(Ne,ce),tabIndex:-1,"aria-disabled":dc(h),"data-focused":fo(Q),style:{...Me.style,...Ve}}),[M,h,Q,Ve]),ut=d.useCallback((Me={},Ne=null)=>({...Me,ref:Pt(Ne,K),id:xe,"data-disabled":fo(h),style:{...Me.style,...Ct}}),[h,xe,Ct]),yt=d.useCallback((Me={},Ne=null)=>({...Me,ref:Ne,style:{...Me.style,...Ye}}),[Ye]),ye=d.useCallback((Me={},Ne=null)=>({...Me,ref:Pt(Ne,ee),role:"slider",tabIndex:F?0:void 0,id:de,"data-active":fo(z),"aria-valuetext":je,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":B,"aria-orientation":p,"aria-disabled":dc(h),"aria-readonly":dc(g),"aria-label":_,"aria-labelledby":_?void 0:j,style:{...Me.style,...st(0)},onKeyDown:fc(Me.onKeyDown,Oe),onFocus:fc(Me.onFocus,()=>G(!0)),onBlur:fc(Me.onBlur,()=>G(!1))}),[F,de,z,je,n,r,B,p,h,g,_,j,st,Oe]),et=d.useCallback((Me,Ne=null)=>{const Ut=!(Me.value<n||Me.value>r),ke=B>=Me.value,ze=cm(Me.value,n,r),Le={position:"absolute",pointerEvents:"none",...IW({orientation:p,vertical:{bottom:O?`${100-ze}%`:`${ze}%`},horizontal:{left:O?`${100-ze}%`:`${ze}%`}})};return{...Me,ref:Ne,role:"presentation","aria-hidden":!0,"data-disabled":fo(h),"data-invalid":fo(!Ut),"data-highlighted":fo(ke),style:{...Me.style,...Le}}},[h,O,r,n,p,B]),ct=d.useCallback((Me={},Ne=null)=>({...Me,ref:Ne,type:"hidden",value:B,name:E}),[E,B]);return{state:{value:B,isFocused:Q,isDragging:z},actions:fe,getRootProps:Re,getTrackProps:ut,getInnerTrackProps:yt,getThumbProps:ye,getMarkerProps:et,getInputProps:ct}}function IW(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function PW(e,t){return t<e?e:e+(t-e)/2}var[EW,Zh]=Wt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[MW,Jh]=Wt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Yb=_e((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Un("Slider",r),s=on(r),{direction:l}=wd();s.direction=l;const{getInputProps:i,getRootProps:u,...p}=jW(s),m=u(),h=i({},t);return a.jsx(EW,{value:p,children:a.jsx(MW,{value:o,children:a.jsxs(Se.div,{...m,className:cl("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...h})]})})})});Yb.displayName="Slider";var Zb=_e((e,t)=>{const{getThumbProps:n}=Zh(),r=Jh(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__thumb",e.className),__css:r.thumb})});Zb.displayName="SliderThumb";var Jb=_e((e,t)=>{const{getTrackProps:n}=Zh(),r=Jh(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__track",e.className),__css:r.track})});Jb.displayName="SliderTrack";var ey=_e((e,t)=>{const{getInnerTrackProps:n}=Zh(),r=Jh(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__filled-track",e.className),__css:r.filledTrack})});ey.displayName="SliderFilledTrack";var Gi=_e((e,t)=>{const{getMarkerProps:n}=Zh(),r=Jh(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__marker",e.className),__css:r.mark})});Gi.displayName="SliderMark";var[OW,fP]=Wt({name:"StatStylesContext",errorMessage:`useStatStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Stat />" `}),pP=_e(function(t,n){const r=Un("Stat",t),o={position:"relative",flex:"1 1 0%",...r.container},{className:s,children:l,...i}=on(t);return a.jsx(OW,{value:r,children:a.jsx(Se.div,{ref:n,...i,className:Je("chakra-stat",s),__css:o,children:a.jsx("dl",{children:l})})})});pP.displayName="Stat";var mP=_e(function(t,n){return a.jsx(Se.div,{...t,ref:n,role:"group",className:Je("chakra-stat__group",t.className),__css:{display:"flex",flexWrap:"wrap",justifyContent:"space-around",alignItems:"flex-start"}})});mP.displayName="StatGroup";var hP=_e(function(t,n){const r=fP();return a.jsx(Se.dt,{ref:n,...t,className:Je("chakra-stat__label",t.className),__css:r.label})});hP.displayName="StatLabel";var gP=_e(function(t,n){const r=fP();return a.jsx(Se.dd,{ref:n,...t,className:Je("chakra-stat__number",t.className),__css:{...r.number,fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums"}})});gP.displayName="StatNumber";var ty=_e(function(t,n){const r=Un("Switch",t),{spacing:o="0.5rem",children:s,...l}=on(t),{getIndicatorProps:i,getInputProps:u,getCheckboxProps:p,getRootProps:m,getLabelProps:h}=x5(l),g=d.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),x=d.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),y=d.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return a.jsxs(Se.label,{...m(),className:Je("chakra-switch",t.className),__css:g,children:[a.jsx("input",{className:"chakra-switch__input",...u({},n)}),a.jsx(Se.span,{...p(),className:"chakra-switch__track",__css:x,children:a.jsx(Se.span,{__css:r.thumb,className:"chakra-switch__thumb",...i()})}),s&&a.jsx(Se.span,{className:"chakra-switch__label",...h(),__css:y,children:s})]})});ty.displayName="Switch";var[DW,RW,AW,TW]=vb();function $W(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:l,lazyBehavior:i="unmount",orientation:u="horizontal",direction:p="ltr",...m}=e,[h,g]=d.useState(n??0),[x,y]=Ed({defaultValue:n??0,value:o,onChange:r});d.useEffect(()=>{o!=null&&g(o)},[o]);const b=AW(),C=d.useId();return{id:`tabs-${(t=e.id)!=null?t:C}`,selectedIndex:x,focusedIndex:h,setSelectedIndex:y,setFocusedIndex:g,isManual:s,isLazy:l,lazyBehavior:i,orientation:u,descendants:b,direction:p,htmlProps:m}}var[NW,eg]=Wt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function LW(e){const{focusedIndex:t,orientation:n,direction:r}=eg(),o=RW(),s=d.useCallback(l=>{const i=()=>{var _;const j=o.nextEnabled(t);j&&((_=j.node)==null||_.focus())},u=()=>{var _;const j=o.prevEnabled(t);j&&((_=j.node)==null||_.focus())},p=()=>{var _;const j=o.firstEnabled();j&&((_=j.node)==null||_.focus())},m=()=>{var _;const j=o.lastEnabled();j&&((_=j.node)==null||_.focus())},h=n==="horizontal",g=n==="vertical",x=l.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",b=r==="ltr"?"ArrowRight":"ArrowLeft",S={[y]:()=>h&&u(),[b]:()=>h&&i(),ArrowDown:()=>g&&i(),ArrowUp:()=>g&&u(),Home:p,End:m}[x];S&&(l.preventDefault(),S(l))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Fe(e.onKeyDown,s)}}function zW(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:l,setFocusedIndex:i,selectedIndex:u}=eg(),{index:p,register:m}=TW({disabled:t&&!n}),h=p===u,g=()=>{o(p)},x=()=>{i(p),!s&&!(t&&n)&&o(p)},y=b3({...r,ref:Pt(m,e.ref),isDisabled:t,isFocusable:n,onClick:Fe(e.onClick,g)}),b="button";return{...y,id:vP(l,p),role:"tab",tabIndex:h?0:-1,type:b,"aria-selected":h,"aria-controls":xP(l,p),onFocus:t?void 0:Fe(e.onFocus,x)}}var[FW,BW]=Wt({});function HW(e){const t=eg(),{id:n,selectedIndex:r}=t,s=Ph(e.children).map((l,i)=>d.createElement(FW,{key:i,value:{isSelected:i===r,id:xP(n,i),tabId:vP(n,i),selectedIndex:r}},l));return{...e,children:s}}function VW(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=eg(),{isSelected:s,id:l,tabId:i}=BW(),u=d.useRef(!1);s&&(u.current=!0);const p=Xb({wasSelected:u.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":i,hidden:!s,id:l}}function vP(e,t){return`${e}--tab-${t}`}function xP(e,t){return`${e}--tabpanel-${t}`}var[WW,tg]=Wt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),ri=_e(function(t,n){const r=Un("Tabs",t),{children:o,className:s,...l}=on(t),{htmlProps:i,descendants:u,...p}=$W(l),m=d.useMemo(()=>p,[p]),{isFitted:h,...g}=i;return a.jsx(DW,{value:u,children:a.jsx(NW,{value:m,children:a.jsx(WW,{value:r,children:a.jsx(Se.div,{className:Je("chakra-tabs",s),ref:n,...g,__css:r.root,children:o})})})})});ri.displayName="Tabs";var oi=_e(function(t,n){const r=LW({...t,ref:n}),s={display:"flex",...tg().tablist};return a.jsx(Se.div,{...r,className:Je("chakra-tabs__tablist",t.className),__css:s})});oi.displayName="TabList";var Co=_e(function(t,n){const r=VW({...t,ref:n}),o=tg();return a.jsx(Se.div,{outline:"0",...r,className:Je("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});Co.displayName="TabPanel";var Hc=_e(function(t,n){const r=HW(t),o=tg();return a.jsx(Se.div,{...r,width:"100%",ref:n,className:Je("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});Hc.displayName="TabPanels";var $r=_e(function(t,n){const r=tg(),o=zW({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(Se.button,{...o,className:Je("chakra-tabs__tab",t.className),__css:s})});$r.displayName="Tab";function UW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var GW=["h","minH","height","minHeight"],bP=_e((e,t)=>{const n=al("Textarea",e),{className:r,rows:o,...s}=on(e),l=yb(s),i=o?UW(n,GW):n;return a.jsx(Se.textarea,{ref:t,rows:o,...l,className:Je("chakra-textarea",r),__css:i})});bP.displayName="Textarea";var KW={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},K1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Up=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function qW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:l=o,closeOnEsc:i=!0,onOpen:u,onClose:p,placement:m,id:h,isOpen:g,defaultIsOpen:x,arrowSize:y=10,arrowShadowColor:b,arrowPadding:C,modifiers:S,isDisabled:_,gutter:j,offset:E,direction:I,...M}=e,{isOpen:D,onOpen:R,onClose:A}=qb({isOpen:g,defaultIsOpen:x,onOpen:u,onClose:p}),{referenceRef:O,getPopperProps:$,getArrowInnerProps:X,getArrowProps:z}=Kb({enabled:D,placement:m,arrowPadding:C,modifiers:S,gutter:j,offset:E,direction:I}),V=d.useId(),G=`tooltip-${h??V}`,F=d.useRef(null),U=d.useRef(),T=d.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),B=d.useRef(),Y=d.useCallback(()=>{B.current&&(clearTimeout(B.current),B.current=void 0)},[]),re=d.useCallback(()=>{Y(),A()},[A,Y]),ae=XW(F,re),oe=d.useCallback(()=>{if(!_&&!U.current){D&&ae();const xe=Up(F);U.current=xe.setTimeout(R,t)}},[ae,_,D,R,t]),q=d.useCallback(()=>{T();const xe=Up(F);B.current=xe.setTimeout(re,n)},[n,re,T]),K=d.useCallback(()=>{D&&r&&q()},[r,q,D]),ee=d.useCallback(()=>{D&&l&&q()},[l,q,D]),ce=d.useCallback(xe=>{D&&xe.key==="Escape"&&q()},[D,q]);Tl(()=>K1(F),"keydown",i?ce:void 0),Tl(()=>{const xe=F.current;if(!xe)return null;const we=a3(xe);return we.localName==="body"?Up(F):we},"scroll",()=>{D&&s&&re()},{passive:!0,capture:!0}),d.useEffect(()=>{_&&(T(),D&&A())},[_,D,A,T]),d.useEffect(()=>()=>{T(),Y()},[T,Y]),Tl(()=>F.current,"pointerleave",q);const J=d.useCallback((xe={},we=null)=>({...xe,ref:Pt(F,we,O),onPointerEnter:Fe(xe.onPointerEnter,fe=>{fe.pointerType!=="touch"&&oe()}),onClick:Fe(xe.onClick,K),onPointerDown:Fe(xe.onPointerDown,ee),onFocus:Fe(xe.onFocus,oe),onBlur:Fe(xe.onBlur,q),"aria-describedby":D?G:void 0}),[oe,q,ee,D,G,K,O]),ie=d.useCallback((xe={},we=null)=>$({...xe,style:{...xe.style,[$n.arrowSize.var]:y?`${y}px`:void 0,[$n.arrowShadowColor.var]:b}},we),[$,y,b]),de=d.useCallback((xe={},we=null)=>{const ve={...xe.style,position:"relative",transformOrigin:$n.transformOrigin.varRef};return{ref:we,...M,...xe,id:G,role:"tooltip",style:ve}},[M,G]);return{isOpen:D,show:oe,hide:q,getTriggerProps:J,getTooltipProps:de,getTooltipPositionerProps:ie,getArrowProps:z,getArrowInnerProps:X}}var Sv="chakra-ui:close-tooltip";function XW(e,t){return d.useEffect(()=>{const n=K1(e);return n.addEventListener(Sv,t),()=>n.removeEventListener(Sv,t)},[t,e]),()=>{const n=K1(e),r=Up(e);n.dispatchEvent(new r.CustomEvent(Sv))}}function QW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function YW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var ZW=Se(jn.div),Vt=_e((e,t)=>{var n,r;const o=al("Tooltip",e),s=on(e),l=wd(),{children:i,label:u,shouldWrapChildren:p,"aria-label":m,hasArrow:h,bg:g,portalProps:x,background:y,backgroundColor:b,bgColor:C,motionProps:S,..._}=s,j=(r=(n=y??b)!=null?n:g)!=null?r:C;if(j){o.bg=j;const $=QD(l,"colors",j);o[$n.arrowBg.var]=$}const E=qW({..._,direction:l.direction}),I=typeof i=="string"||p;let M;if(I)M=a.jsx(Se.span,{display:"inline-block",tabIndex:0,...E.getTriggerProps(),children:i});else{const $=d.Children.only(i);M=d.cloneElement($,E.getTriggerProps($.props,$.ref))}const D=!!m,R=E.getTooltipProps({},t),A=D?QW(R,["role","id"]):R,O=YW(R,["role","id"]);return u?a.jsxs(a.Fragment,{children:[M,a.jsx(dr,{children:E.isOpen&&a.jsx($c,{...x,children:a.jsx(Se.div,{...E.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(ZW,{variants:KW,initial:"exit",animate:"enter",exit:"exit",...S,...A,__css:o,children:[u,D&&a.jsx(Se.span,{srOnly:!0,...O,children:m}),h&&a.jsx(Se.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(Se.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:i})});Vt.displayName="Tooltip";function ng(e,t={}){let n=d.useCallback(o=>t.keys?pN(e,t.keys,o):e.listen(o),[t.keys,e]),r=e.get.bind(e);return d.useSyncExternalStore(n,r,r)}const JW=le(ge,({system:e})=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),yP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=W(JW);return d.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${YD[t]}`)):localStorage.setItem("ROARR_LOG","false"),aw.ROARR.write=ZD.createLogWriter()},[t,n]),d.useEffect(()=>{const o={...JD};eR.set(aw.Roarr.child(o))},[]),d.useMemo(()=>ll(e),[e])},eU=()=>{const e=te(),t=W(r=>r.system.toastQueue),n=i5();return d.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(tR())},[e,n,t]),null},si=()=>{const e=te();return d.useCallback(n=>e(lt(Qt(n))),[e])},tU=d.memo(eU);var nU=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Vd(e,t){var n=rU(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function rU(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=nU.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var oU=[".DS_Store","Thumbs.db"];function sU(e){return Lc(this,void 0,void 0,function(){return zc(this,function(t){return hm(e)&&aU(e.dataTransfer)?[2,uU(e.dataTransfer,e.type)]:lU(e)?[2,iU(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,cU(e)]:[2,[]]})})}function aU(e){return hm(e)}function lU(e){return hm(e)&&hm(e.target)}function hm(e){return typeof e=="object"&&e!==null}function iU(e){return q1(e.target.files).map(function(t){return Vd(t)})}function cU(e){return Lc(this,void 0,void 0,function(){var t;return zc(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Vd(r)})]}})})}function uU(e,t){return Lc(this,void 0,void 0,function(){var n,r;return zc(this,function(o){switch(o.label){case 0:return e.items?(n=q1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(dU))]):[3,2];case 1:return r=o.sent(),[2,zS(CP(r))];case 2:return[2,zS(q1(e.files).map(function(s){return Vd(s)}))]}})})}function zS(e){return e.filter(function(t){return oU.indexOf(t.name)===-1})}function q1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function dU(e){if(typeof e.webkitGetAsEntry!="function")return FS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?wP(t):FS(e)}function CP(e){return e.reduce(function(t,n){return D1(D1([],iS(t),!1),iS(Array.isArray(n)?CP(n):[n]),!1)},[])}function FS(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Vd(t);return Promise.resolve(n)}function fU(e){return Lc(this,void 0,void 0,function(){return zc(this,function(t){return[2,e.isDirectory?wP(e):pU(e)]})})}function wP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var l=this;t.readEntries(function(i){return Lc(l,void 0,void 0,function(){var u,p,m;return zc(this,function(h){switch(h.label){case 0:if(i.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return u=h.sent(),n(u),[3,4];case 3:return p=h.sent(),r(p),[3,4];case 4:return[3,6];case 5:m=Promise.all(i.map(fU)),o.push(m),s(),h.label=6;case 6:return[2]}})})},function(i){r(i)})}s()})}function pU(e){return Lc(this,void 0,void 0,function(){return zc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=Vd(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var mU=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(l){var i=l.trim().toLowerCase();return i.charAt(0)==="."?r.toLowerCase().endsWith(i):i.endsWith("/*")?s===i.replace(/\/.*$/,""):o===i})}return!0};function BS(e){return vU(e)||gU(e)||kP(e)||hU()}function hU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vU(e){if(Array.isArray(e))return X1(e)}function HS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function VS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HS(Object(n),!0).forEach(function(r){SP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ad(e,t){return yU(e)||bU(e,t)||kP(e,t)||xU()}function xU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kP(e,t){if(e){if(typeof e=="string")return X1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X1(e,t)}}function X1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,l,i;try{for(n=n.call(e);!(o=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,i=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw i}}return r}}function yU(e){if(Array.isArray(e))return e}var CU="file-invalid-type",wU="file-too-large",SU="file-too-small",kU="too-many-files",_U=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:CU,message:"File type must be ".concat(n)}},WS=function(t){return{code:wU,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},US=function(t){return{code:SU,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},jU={code:kU,message:"Too many files"};function _P(e,t){var n=e.type==="application/x-moz-file"||mU(e,t);return[n,n?null:_U(t)]}function jP(e,t,n){if(El(e.size))if(El(t)&&El(n)){if(e.size>n)return[!1,WS(n)];if(e.size<t)return[!1,US(t)]}else{if(El(t)&&e.size<t)return[!1,US(t)];if(El(n)&&e.size>n)return[!1,WS(n)]}return[!0,null]}function El(e){return e!=null}function IU(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,l=e.maxFiles,i=e.validator;return!s&&t.length>1||s&&l>=1&&t.length>l?!1:t.every(function(u){var p=_P(u,n),m=ad(p,1),h=m[0],g=jP(u,r,o),x=ad(g,1),y=x[0],b=i?i(u):null;return h&&y&&!b})}function gm(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function ip(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function GS(e){e.preventDefault()}function PU(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function EU(e){return e.indexOf("Edge/")!==-1}function MU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return PU(e)||EU(e)}function ms(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return t.some(function(i){return!gm(r)&&i&&i.apply(void 0,[r].concat(s)),gm(r)})}}function OU(){return"showOpenFilePicker"in window}function DU(e){if(El(e)){var t=Object.entries(e).filter(function(n){var r=ad(n,2),o=r[0],s=r[1],l=!0;return IP(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),l=!1),(!Array.isArray(s)||!s.every(PP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(n,r){var o=ad(r,2),s=o[0],l=o[1];return VS(VS({},n),{},SP({},s,l))},{});return[{description:"Files",accept:t}]}return e}function RU(e){if(El(e))return Object.entries(e).reduce(function(t,n){var r=ad(n,2),o=r[0],s=r[1];return[].concat(BS(t),[o],BS(s))},[]).filter(function(t){return IP(t)||PP(t)}).join(",")}function AU(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function TU(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function IP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function PP(e){return/^.*\.[\w]+$/.test(e)}var $U=["children"],NU=["open"],LU=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],zU=["refKey","onChange","onClick"];function FU(e){return VU(e)||HU(e)||EP(e)||BU()}function BU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VU(e){if(Array.isArray(e))return Q1(e)}function kv(e,t){return GU(e)||UU(e,t)||EP(e,t)||WU()}function WU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EP(e,t){if(e){if(typeof e=="string")return Q1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q1(e,t)}}function Q1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,l,i;try{for(n=n.call(e);!(o=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,i=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw i}}return r}}function GU(e){if(Array.isArray(e))return e}function KS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KS(Object(n),!0).forEach(function(r){Y1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Y1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vm(e,t){if(e==null)return{};var n=KU(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var ny=d.forwardRef(function(e,t){var n=e.children,r=vm(e,$U),o=ry(r),s=o.open,l=vm(o,NU);return d.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(d.Fragment,null,n(xn(xn({},l),{},{open:s})))});ny.displayName="Dropzone";var MP={disabled:!1,getFilesFromEvent:sU,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};ny.defaultProps=MP;ny.propTypes={children:en.func,accept:en.objectOf(en.arrayOf(en.string)),multiple:en.bool,preventDropOnDocument:en.bool,noClick:en.bool,noKeyboard:en.bool,noDrag:en.bool,noDragEventsBubbling:en.bool,minSize:en.number,maxSize:en.number,maxFiles:en.number,disabled:en.bool,getFilesFromEvent:en.func,onFileDialogCancel:en.func,onFileDialogOpen:en.func,useFsAccessApi:en.bool,autoFocus:en.bool,onDragEnter:en.func,onDragLeave:en.func,onDragOver:en.func,onDrop:en.func,onDropAccepted:en.func,onDropRejected:en.func,onError:en.func,validator:en.func};var Z1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function ry(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=xn(xn({},MP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,l=t.minSize,i=t.multiple,u=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,h=t.onDragOver,g=t.onDrop,x=t.onDropAccepted,y=t.onDropRejected,b=t.onFileDialogCancel,C=t.onFileDialogOpen,S=t.useFsAccessApi,_=t.autoFocus,j=t.preventDropOnDocument,E=t.noClick,I=t.noKeyboard,M=t.noDrag,D=t.noDragEventsBubbling,R=t.onError,A=t.validator,O=d.useMemo(function(){return RU(n)},[n]),$=d.useMemo(function(){return DU(n)},[n]),X=d.useMemo(function(){return typeof C=="function"?C:qS},[C]),z=d.useMemo(function(){return typeof b=="function"?b:qS},[b]),V=d.useRef(null),Q=d.useRef(null),G=d.useReducer(qU,Z1),F=kv(G,2),U=F[0],T=F[1],B=U.isFocused,Y=U.isFileDialogActive,re=d.useRef(typeof window<"u"&&window.isSecureContext&&S&&OU()),ae=function(){!re.current&&Y&&setTimeout(function(){if(Q.current){var Re=Q.current.files;Re.length||(T({type:"closeDialog"}),z())}},300)};d.useEffect(function(){return window.addEventListener("focus",ae,!1),function(){window.removeEventListener("focus",ae,!1)}},[Q,Y,z,re]);var oe=d.useRef([]),q=function(Re){V.current&&V.current.contains(Re.target)||(Re.preventDefault(),oe.current=[])};d.useEffect(function(){return j&&(document.addEventListener("dragover",GS,!1),document.addEventListener("drop",q,!1)),function(){j&&(document.removeEventListener("dragover",GS),document.removeEventListener("drop",q))}},[V,j]),d.useEffect(function(){return!r&&_&&V.current&&V.current.focus(),function(){}},[V,_,r]);var K=d.useCallback(function(he){R?R(he):console.error(he)},[R]),ee=d.useCallback(function(he){he.preventDefault(),he.persist(),Ve(he),oe.current=[].concat(FU(oe.current),[he.target]),ip(he)&&Promise.resolve(o(he)).then(function(Re){if(!(gm(he)&&!D)){var ut=Re.length,yt=ut>0&&IU({files:Re,accept:O,minSize:l,maxSize:s,multiple:i,maxFiles:u,validator:A}),ye=ut>0&&!yt;T({isDragAccept:yt,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),p&&p(he)}}).catch(function(Re){return K(Re)})},[o,p,K,D,O,l,s,i,u,A]),ce=d.useCallback(function(he){he.preventDefault(),he.persist(),Ve(he);var Re=ip(he);if(Re&&he.dataTransfer)try{he.dataTransfer.dropEffect="copy"}catch{}return Re&&h&&h(he),!1},[h,D]),J=d.useCallback(function(he){he.preventDefault(),he.persist(),Ve(he);var Re=oe.current.filter(function(yt){return V.current&&V.current.contains(yt)}),ut=Re.indexOf(he.target);ut!==-1&&Re.splice(ut,1),oe.current=Re,!(Re.length>0)&&(T({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ip(he)&&m&&m(he))},[V,m,D]),ie=d.useCallback(function(he,Re){var ut=[],yt=[];he.forEach(function(ye){var et=_P(ye,O),ct=kv(et,2),ft=ct[0],Me=ct[1],Ne=jP(ye,l,s),Ut=kv(Ne,2),ke=Ut[0],ze=Ut[1],Le=A?A(ye):null;if(ft&&ke&&!Le)ut.push(ye);else{var Ge=[Me,ze];Le&&(Ge=Ge.concat(Le)),yt.push({file:ye,errors:Ge.filter(function(pt){return pt})})}}),(!i&&ut.length>1||i&&u>=1&&ut.length>u)&&(ut.forEach(function(ye){yt.push({file:ye,errors:[jU]})}),ut.splice(0)),T({acceptedFiles:ut,fileRejections:yt,type:"setFiles"}),g&&g(ut,yt,Re),yt.length>0&&y&&y(yt,Re),ut.length>0&&x&&x(ut,Re)},[T,i,O,l,s,u,g,x,y,A]),de=d.useCallback(function(he){he.preventDefault(),he.persist(),Ve(he),oe.current=[],ip(he)&&Promise.resolve(o(he)).then(function(Re){gm(he)&&!D||ie(Re,he)}).catch(function(Re){return K(Re)}),T({type:"reset"})},[o,ie,K,D]),xe=d.useCallback(function(){if(re.current){T({type:"openDialog"}),X();var he={multiple:i,types:$};window.showOpenFilePicker(he).then(function(Re){return o(Re)}).then(function(Re){ie(Re,null),T({type:"closeDialog"})}).catch(function(Re){AU(Re)?(z(Re),T({type:"closeDialog"})):TU(Re)?(re.current=!1,Q.current?(Q.current.value=null,Q.current.click()):K(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):K(Re)});return}Q.current&&(T({type:"openDialog"}),X(),Q.current.value=null,Q.current.click())},[T,X,z,S,ie,K,$,i]),we=d.useCallback(function(he){!V.current||!V.current.isEqualNode(he.target)||(he.key===" "||he.key==="Enter"||he.keyCode===32||he.keyCode===13)&&(he.preventDefault(),xe())},[V,xe]),ve=d.useCallback(function(){T({type:"focus"})},[]),fe=d.useCallback(function(){T({type:"blur"})},[]),Oe=d.useCallback(function(){E||(MU()?setTimeout(xe,0):xe())},[E,xe]),je=function(Re){return r?null:Re},$e=function(Re){return I?null:je(Re)},st=function(Re){return M?null:je(Re)},Ve=function(Re){D&&Re.stopPropagation()},Ct=d.useMemo(function(){return function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=he.refKey,ut=Re===void 0?"ref":Re,yt=he.role,ye=he.onKeyDown,et=he.onFocus,ct=he.onBlur,ft=he.onClick,Me=he.onDragEnter,Ne=he.onDragOver,Ut=he.onDragLeave,ke=he.onDrop,ze=vm(he,LU);return xn(xn(Y1({onKeyDown:$e(ms(ye,we)),onFocus:$e(ms(et,ve)),onBlur:$e(ms(ct,fe)),onClick:je(ms(ft,Oe)),onDragEnter:st(ms(Me,ee)),onDragOver:st(ms(Ne,ce)),onDragLeave:st(ms(Ut,J)),onDrop:st(ms(ke,de)),role:typeof yt=="string"&&yt!==""?yt:"presentation"},ut,V),!r&&!I?{tabIndex:0}:{}),ze)}},[V,we,ve,fe,Oe,ee,ce,J,de,I,M,r]),Ye=d.useCallback(function(he){he.stopPropagation()},[]),Ke=d.useMemo(function(){return function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=he.refKey,ut=Re===void 0?"ref":Re,yt=he.onChange,ye=he.onClick,et=vm(he,zU),ct=Y1({accept:O,multiple:i,type:"file",style:{display:"none"},onChange:je(ms(yt,de)),onClick:je(ms(ye,Ye)),tabIndex:-1},ut,Q);return xn(xn({},ct),et)}},[Q,n,i,de,r]);return xn(xn({},U),{},{isFocused:B&&!r,getRootProps:Ct,getInputProps:Ke,rootRef:V,inputRef:Q,open:je(xe)})}function qU(e,t){switch(t.type){case"focus":return xn(xn({},e),{},{isFocused:!0});case"blur":return xn(xn({},e),{},{isFocused:!1});case"openDialog":return xn(xn({},Z1),{},{isFileDialogActive:!0});case"closeDialog":return xn(xn({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return xn(xn({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return xn(xn({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return xn({},Z1);default:return e}}function qS(){}function J1(){return J1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J1.apply(this,arguments)}var OP=["shift","alt","meta","mod","ctrl"],XU={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Va(e){return(XU[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function QU(e){return OP.includes(e)}function _v(e,t){return t===void 0&&(t=","),e.split(t)}function jv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(l){return Va(l)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(l){return!OP.includes(l)});return J1({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&DP([Va(e.key),Va(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&RP([Va(e.key),Va(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Wa.clear()})})();var Wa=new Set;function oy(e){return Array.isArray(e)}function Gp(e,t){t===void 0&&(t=",");var n=oy(e)?e:e.split(t);return n.every(function(r){return Wa.has(r.trim().toLowerCase())})}function DP(e){var t=Array.isArray(e)?e:[e];Wa.has("meta")&&Wa.forEach(function(n){return!QU(n)&&Wa.delete(n.toLowerCase())}),t.forEach(function(n){return Wa.add(n.toLowerCase())})}function RP(e){var t=Array.isArray(e)?e:[e];e==="meta"?Wa.clear():t.forEach(function(n){return Wa.delete(n.toLowerCase())})}function YU(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function ZU(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function JU(e){return AP(e,["input","textarea","select"])}function AP(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return oy(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function eG(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var tG=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,l=n.mod,i=n.shift,u=n.ctrl,p=n.keys,m=t.key,h=t.code,g=t.ctrlKey,x=t.metaKey,y=t.shiftKey,b=t.altKey,C=Va(h),S=m.toLowerCase();if(!r){if(o===!b&&S!=="alt"||i===!y&&S!=="shift")return!1;if(l){if(!x&&!g)return!1}else if(s===!x&&S!=="meta"&&S!=="os"||u===!g&&S!=="ctrl"&&S!=="control")return!1}return p&&p.length===1&&(p.includes(S)||p.includes(C))?!0:p?Gp(p):!p},nG=d.createContext(void 0),rG=function(){return d.useContext(nG)};function TP(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&TP(e[r],t[r])},!0):e===t}var oG=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),sG=function(){return d.useContext(oG)};function aG(e){var t=d.useRef(void 0);return TP(t.current,e)||(t.current=e),t.current}var XS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},lG=typeof window<"u"?d.useLayoutEffect:d.useEffect;function tt(e,t,n,r){var o=d.useRef(null),s=d.useRef(!1),l=n instanceof Array?r instanceof Array?void 0:r:n,i=oy(e)?e.join(l==null?void 0:l.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,p=d.useCallback(t,u??[]),m=d.useRef(p);u?m.current=p:m.current=t;var h=aG(l),g=sG(),x=g.enabledScopes,y=rG();return lG(function(){if(!((h==null?void 0:h.enabled)===!1||!eG(x,h==null?void 0:h.scopes))){var b=function(E,I){var M;if(I===void 0&&(I=!1),!(JU(E)&&!AP(E,h==null?void 0:h.enableOnFormTags))&&!(h!=null&&h.ignoreEventWhen!=null&&h.ignoreEventWhen(E))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){XS(E);return}(M=E.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||_v(i,h==null?void 0:h.splitKey).forEach(function(D){var R,A=jv(D,h==null?void 0:h.combinationKey);if(tG(E,A,h==null?void 0:h.ignoreModifiers)||(R=A.keys)!=null&&R.includes("*")){if(I&&s.current)return;if(YU(E,A,h==null?void 0:h.preventDefault),!ZU(E,A,h==null?void 0:h.enabled)){XS(E);return}m.current(E,A),I||(s.current=!0)}})}},C=function(E){E.key!==void 0&&(DP(Va(E.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&b(E))},S=function(E){E.key!==void 0&&(RP(Va(E.code)),s.current=!1,h!=null&&h.keyup&&b(E,!0))},_=o.current||(l==null?void 0:l.document)||document;return _.addEventListener("keyup",S),_.addEventListener("keydown",C),y&&_v(i,h==null?void 0:h.splitKey).forEach(function(j){return y.addHotkey(jv(j,h==null?void 0:h.combinationKey,h==null?void 0:h.description))}),function(){_.removeEventListener("keyup",S),_.removeEventListener("keydown",C),y&&_v(i,h==null?void 0:h.splitKey).forEach(function(j){return y.removeHotkey(jv(j,h==null?void 0:h.combinationKey,h==null?void 0:h.description))})}}},[i,h,x]),o}const iG=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return tt("esc",()=>{r(!1)}),a.jsxs(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:[a.jsx(N,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:"base.700",_dark:{bg:"base.900"},opacity:.7,alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(N,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx(N,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",flexDir:"column",gap:4,borderWidth:3,borderRadius:"xl",borderStyle:"dashed",color:"base.100",borderColor:"base.100",_dark:{borderColor:"base.200"}},children:t?a.jsx(cr,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(cr,{size:"lg",children:"Invalid Upload"}),a.jsx(cr,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},cG=d.memo(iG),uG=le([ge,Zn],({gallery:e},t)=>{let n={type:"TOAST"};t==="unifiedCanvas"&&(n={type:"SET_CANVAS_INITIAL_IMAGE"}),t==="img2img"&&(n={type:"SET_INITIAL_IMAGE"});const{autoAddBoardId:r}=e;return{autoAddBoardId:r,postUploadAction:n}},Ce),dG=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=W(uG),o=si(),{t:s}=Z(),[l,i]=d.useState(!1),[u]=oI(),p=d.useCallback(j=>{i(!0),o({title:s("toast.uploadFailed"),description:j.errors.map(E=>E.message).join(`
+`),status:"error"})},[s,o]),m=d.useCallback(async j=>{u({file:j,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,u]),h=d.useCallback((j,E)=>{if(E.length>1){o({title:s("toast.uploadFailed"),description:s("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}E.forEach(I=>{p(I)}),j.forEach(I=>{m(I)})},[s,o,m,p]),g=d.useCallback(()=>{i(!0)},[]),{getRootProps:x,getInputProps:y,isDragAccept:b,isDragReject:C,isDragActive:S,inputRef:_}=ry({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:g,multiple:!1});return d.useEffect(()=>{const j=async E=>{var I,M;_.current&&(I=E.clipboardData)!=null&&I.files&&(_.current.files=E.clipboardData.files,(M=_.current)==null||M.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",j),()=>{document.removeEventListener("paste",j)}},[_]),a.jsxs(Ie,{...x({style:{}}),onKeyDown:j=>{j.key},children:[a.jsx("input",{...y()}),t,a.jsx(dr,{children:S&&l&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(cG,{isDragAccept:b,isDragReject:C,setIsHandlingUpload:i})},"image-upload-overlay")})]})},fG=d.memo(dG),pG=_e((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...l}={},isChecked:i,...u}=e;return a.jsx(Vt,{label:r,placement:o,hasArrow:s,...l,children:a.jsx(Ja,{ref:t,colorScheme:i?"accent":"base",...u,children:n})})}),ot=d.memo(pG);function mG(e){const t=d.createContext(null);return[({children:o,value:s})=>H.createElement(t.Provider,{value:s},o),()=>{const o=d.useContext(t);if(o===null)throw new Error(e);return o}]}function $P(e){return Array.isArray(e)?e:[e]}const hG=()=>{};function gG(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||hG:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function NP({data:e}){const t=[],n=[],r=e.reduce((o,s,l)=>(s.group?o[s.group]?o[s.group].push(l):o[s.group]=[l]:n.push(l),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function LP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function zP(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=zP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function FP(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=zP(t))&&(r&&(r+=" "),r+=n);return r}const vG={app:100,modal:200,popover:300,overlay:400,max:9999};function sy(e){return vG[e]}function xG(e,t){const n=d.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const bG=nR({key:"mantine",prepend:!0});function yG(){return e5()||bG}var CG=Object.defineProperty,QS=Object.getOwnPropertySymbols,wG=Object.prototype.hasOwnProperty,SG=Object.prototype.propertyIsEnumerable,YS=(e,t,n)=>t in e?CG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kG=(e,t)=>{for(var n in t||(t={}))wG.call(t,n)&&YS(e,n,t[n]);if(QS)for(var n of QS(t))SG.call(t,n)&&YS(e,n,t[n]);return e};const Iv="ref";function _G(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(Iv in n))return{args:e,ref:t};t=n[Iv];const r=kG({},n);return delete r[Iv],{args:[r],ref:t}}const{cssFactory:jG}=(()=>{function e(n,r,o){const s=[],l=sR(n,s,o);return s.length<2?o:l+r(s)}function t(n){const{cache:r}=n,o=(...l)=>{const{ref:i,args:u}=_G(l),p=rR(u,r.registered);return oR(r,p,!1),`${r.key}-${p.name}${i===void 0?"":` ${i}`}`};return{css:o,cx:(...l)=>e(r.registered,o,FP(l))}}return{cssFactory:t}})();function BP(){const e=yG();return xG(()=>jG({cache:e}),[e])}function IG({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const l=n.reduce((i,u)=>(Object.keys(u.classNames).forEach(p=>{typeof i[p]!="string"?i[p]=`${u.classNames[p]}`:i[p]=`${i[p]} ${u.classNames[p]}`}),i),{});return Object.keys(t).reduce((i,u)=>(i[u]=e(t[u],l[u],r!=null&&r[u],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${u}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${u}`:null),i),{})}var PG=Object.defineProperty,ZS=Object.getOwnPropertySymbols,EG=Object.prototype.hasOwnProperty,MG=Object.prototype.propertyIsEnumerable,JS=(e,t,n)=>t in e?PG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pv=(e,t)=>{for(var n in t||(t={}))EG.call(t,n)&&JS(e,n,t[n]);if(ZS)for(var n of ZS(t))MG.call(t,n)&&JS(e,n,t[n]);return e};function ex(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=Pv(Pv({},e[n]),t[n]):e[n]=Pv({},t[n])}),e}function e4(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,l)=>ex(s,l),{}):o(e)}function OG({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,l)=>(l.variants&&r in l.variants&&ex(s,l.variants[r](t,n,{variant:r,size:o})),l.sizes&&o in l.sizes&&ex(s,l.sizes[o](t,n,{variant:r,size:o})),s),{})}function fr(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=xa(),l=q$(o==null?void 0:o.name),i=e5(),u={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:m}=BP(),h=t(s,r,u),g=e4(o==null?void 0:o.styles,s,r,u),x=e4(l,s,r,u),y=OG({ctx:l,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),b=Object.fromEntries(Object.keys(h).map(C=>{const S=m({[p(h[C])]:!(o!=null&&o.unstyled)},p(y[C]),p(x[C]),p(g[C]));return[C,S]}));return{classes:IG({cx:m,classes:b,context:l,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:i}),cx:m,theme:s}}return n}function t4(e){return`___ref-${e||""}`}var DG=Object.defineProperty,RG=Object.defineProperties,AG=Object.getOwnPropertyDescriptors,n4=Object.getOwnPropertySymbols,TG=Object.prototype.hasOwnProperty,$G=Object.prototype.propertyIsEnumerable,r4=(e,t,n)=>t in e?DG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ju=(e,t)=>{for(var n in t||(t={}))TG.call(t,n)&&r4(e,n,t[n]);if(n4)for(var n of n4(t))$G.call(t,n)&&r4(e,n,t[n]);return e},Iu=(e,t)=>RG(e,AG(t));const Pu={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${De(10)})`},transitionProperty:"transform, opacity"},cp={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${De(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${De(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${De(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${De(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Iu(ju({},Pu),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Iu(ju({},Pu),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Iu(ju({},Pu),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Iu(ju({},Pu),{common:{transformOrigin:"top left"}}),"pop-top-right":Iu(ju({},Pu),{common:{transformOrigin:"top right"}})},o4=["mousedown","touchstart"];function NG(e,t,n){const r=d.useRef();return d.useEffect(()=>{const o=s=>{const{target:l}=s??{};if(Array.isArray(n)){const i=(l==null?void 0:l.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(l)&&l.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!i&&e()}else r.current&&!r.current.contains(l)&&e()};return(t||o4).forEach(s=>document.addEventListener(s,o)),()=>{(t||o4).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function LG(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function zG(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function FG(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=d.useState(n?t:zG(e,t)),s=d.useRef();return d.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),LG(s.current,l=>o(l.matches))},[e]),r}const HP=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Go(e,t){const n=d.useRef(!1);d.useEffect(()=>()=>{n.current=!1},[]),d.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function BG({opened:e,shouldReturnFocus:t=!0}){const n=d.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Go(()=>{let o=-1;const s=l=>{l.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const HG=/input|select|textarea|button|object/,VP="a, input, select, textarea, button, object, [tabindex]";function VG(e){return e.style.display==="none"}function WG(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(VG(n))return!1;n=n.parentNode}return!0}function WP(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function tx(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(WP(e));return(HG.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&WG(e)}function UP(e){const t=WP(e);return(Number.isNaN(t)||t>=0)&&tx(e)}function UG(e){return Array.from(e.querySelectorAll(VP)).filter(UP)}function GG(e,t){const n=UG(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const l=n[t.shiftKey?n.length-1:0];l&&l.focus()}function ay(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function KG(e,t="body > :not(script)"){const n=ay(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const l=o.getAttribute("aria-hidden"),i=o.getAttribute("data-hidden"),u=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),l===null||l==="false"?o.setAttribute("aria-hidden","true"):!i&&!u&&o.setAttribute("data-hidden",l),{node:o,ariaHidden:i||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function qG(e=!0){const t=d.useRef(),n=d.useRef(null),r=s=>{let l=s.querySelector("[data-autofocus]");if(!l){const i=Array.from(s.querySelectorAll(VP));l=i.find(UP)||i.find(tx)||null,!l&&tx(s)&&(l=s)}l&&l.focus({preventScroll:!0})},o=d.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=KG(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return d.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=l=>{l.key==="Tab"&&t.current&&GG(t.current,l)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const XG=H["useId".toString()]||(()=>{});function QG(){const e=XG();return e?`mantine-${e.replace(/:/g,"")}`:""}function ly(e){const t=QG(),[n,r]=d.useState(t);return HP(()=>{r(ay())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function s4(e,t,n){d.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function GP(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function YG(...e){return t=>{e.forEach(n=>GP(n,t))}}function Wd(...e){return d.useCallback(YG(...e),e)}function ld({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=d.useState(t!==void 0?t:n),l=i=>{s(i),r==null||r(i)};return e!==void 0?[e,r,!0]:[o,l,!1]}function KP(e,t){return FG("(prefers-reduced-motion: reduce)",e,t)}const ZG=e=>e<.5?2*e*e:-1+(4-2*e)*e,JG=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const l=!!n,u=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),m=h=>p[h]-u[h];if(e==="y"){const h=m("top");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.height*(s?0:1)||!s?x:0}const g=l?u.height:window.innerHeight;if(r==="end"){const x=h+o-g+p.height;return x>=-p.height*(s?0:1)||!s?x:0}return r==="center"?h-g/2+p.height/2:0}if(e==="x"){const h=m("left");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.width||!s?x:0}const g=l?u.width:window.innerWidth;if(r==="end"){const x=h+o-g+p.width;return x>=-p.width||!s?x:0}return r==="center"?h-g/2+p.width/2:0}return 0},eK=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},tK=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:s}=document;o[r]=n,s[r]=n}};function qP({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=ZG,offset:o=0,cancelable:s=!0,isList:l=!1}={}){const i=d.useRef(0),u=d.useRef(0),p=d.useRef(!1),m=d.useRef(null),h=d.useRef(null),g=KP(),x=()=>{i.current&&cancelAnimationFrame(i.current)},y=d.useCallback(({alignment:C="start"}={})=>{var S;p.current=!1,i.current&&x();const _=(S=eK({parent:m.current,axis:t}))!=null?S:0,j=JG({parent:m.current,target:h.current,axis:t,alignment:C,offset:o,isList:l})-(m.current?0:_);function E(){u.current===0&&(u.current=performance.now());const M=performance.now()-u.current,D=g||e===0?1:M/e,R=_+j*r(D);tK({parent:m.current,axis:t,distance:R}),!p.current&&D<1?i.current=requestAnimationFrame(E):(typeof n=="function"&&n(),u.current=0,i.current=0,x())}E()},[t,e,r,l,o,n,g]),b=()=>{s&&(p.current=!0)};return s4("wheel",b,{passive:!0}),s4("touchmove",b,{passive:!0}),d.useEffect(()=>x,[]),{scrollableRef:m,targetRef:h,scrollIntoView:y,cancel:x}}var a4=Object.getOwnPropertySymbols,nK=Object.prototype.hasOwnProperty,rK=Object.prototype.propertyIsEnumerable,oK=(e,t)=>{var n={};for(var r in e)nK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&a4)for(var r of a4(e))t.indexOf(r)<0&&rK.call(e,r)&&(n[r]=e[r]);return n};function rg(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:l,ml:i,mr:u,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:C,c:S,opacity:_,ff:j,fz:E,fw:I,lts:M,ta:D,lh:R,fs:A,tt:O,td:$,w:X,miw:z,maw:V,h:Q,mih:G,mah:F,bgsz:U,bgp:T,bgr:B,bga:Y,pos:re,top:ae,left:oe,bottom:q,right:K,inset:ee,display:ce}=t,J=oK(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:X$({m:n,mx:r,my:o,mt:s,mb:l,ml:i,mr:u,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:C,c:S,opacity:_,ff:j,fz:E,fw:I,lts:M,ta:D,lh:R,fs:A,tt:O,td:$,w:X,miw:z,maw:V,h:Q,mih:G,mah:F,bgsz:U,bgp:T,bgr:B,bga:Y,pos:re,top:ae,left:oe,bottom:q,right:K,inset:ee,display:ce}),rest:J}}function sK(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>qw(mt({size:r,sizes:t.breakpoints}))-qw(mt({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function aK({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return sK(e,t).reduce((l,i)=>{if(i==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(m=>{l[m]=p}),l):(l[r]=p,l)}const u=n(e[i],t);return Array.isArray(r)?(l[t.fn.largerThan(i)]={},r.forEach(p=>{l[t.fn.largerThan(i)][p]=u}),l):(l[t.fn.largerThan(i)]={[r]:u},l)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,l)=>(s[l]=o,s),{}):{[r]:o}}function lK(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function iK(e){return De(e)}function cK(e){return e}function uK(e,t){return mt({size:e,sizes:t.fontSizes})}const dK=["-xs","-sm","-md","-lg","-xl"];function fK(e,t){return dK.includes(e)?`calc(${mt({size:e.replace("-",""),sizes:t.spacing})} * -1)`:mt({size:e,sizes:t.spacing})}const pK={identity:cK,color:lK,size:iK,fontSize:uK,spacing:fK},mK={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var hK=Object.defineProperty,l4=Object.getOwnPropertySymbols,gK=Object.prototype.hasOwnProperty,vK=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?hK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c4=(e,t)=>{for(var n in t||(t={}))gK.call(t,n)&&i4(e,n,t[n]);if(l4)for(var n of l4(t))vK.call(t,n)&&i4(e,n,t[n]);return e};function u4(e,t,n=mK){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(aK({value:e[s],getValue:pK[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(l=>{typeof s[l]=="object"&&s[l]!==null&&l in o?o[l]=c4(c4({},o[l]),s[l]):o[l]=s[l]}),o),{})}function d4(e,t){return typeof e=="function"?e(t):e}function xK(e,t,n){const r=xa(),{css:o,cx:s}=BP();return Array.isArray(e)?s(n,o(u4(t,r)),e.map(l=>o(d4(l,r)))):s(n,o(d4(e,r)),o(u4(t,r)))}var bK=Object.defineProperty,xm=Object.getOwnPropertySymbols,XP=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable,f4=(e,t,n)=>t in e?bK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yK=(e,t)=>{for(var n in t||(t={}))XP.call(t,n)&&f4(e,n,t[n]);if(xm)for(var n of xm(t))QP.call(t,n)&&f4(e,n,t[n]);return e},CK=(e,t)=>{var n={};for(var r in e)XP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xm)for(var r of xm(e))t.indexOf(r)<0&&QP.call(e,r)&&(n[r]=e[r]);return n};const YP=d.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:l}=n,i=CK(n,["className","component","style","sx"]);const{systemStyles:u,rest:p}=rg(i),m=o||"div";return H.createElement(m,yK({ref:t,className:xK(l,u,r),style:s},p))});YP.displayName="@mantine/core/Box";const zr=YP;var wK=Object.defineProperty,SK=Object.defineProperties,kK=Object.getOwnPropertyDescriptors,p4=Object.getOwnPropertySymbols,_K=Object.prototype.hasOwnProperty,jK=Object.prototype.propertyIsEnumerable,m4=(e,t,n)=>t in e?wK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h4=(e,t)=>{for(var n in t||(t={}))_K.call(t,n)&&m4(e,n,t[n]);if(p4)for(var n of p4(t))jK.call(t,n)&&m4(e,n,t[n]);return e},IK=(e,t)=>SK(e,kK(t)),PK=fr(e=>({root:IK(h4(h4({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const EK=PK;var MK=Object.defineProperty,bm=Object.getOwnPropertySymbols,ZP=Object.prototype.hasOwnProperty,JP=Object.prototype.propertyIsEnumerable,g4=(e,t,n)=>t in e?MK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OK=(e,t)=>{for(var n in t||(t={}))ZP.call(t,n)&&g4(e,n,t[n]);if(bm)for(var n of bm(t))JP.call(t,n)&&g4(e,n,t[n]);return e},DK=(e,t)=>{var n={};for(var r in e)ZP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bm)for(var r of bm(e))t.indexOf(r)<0&&JP.call(e,r)&&(n[r]=e[r]);return n};const e6=d.forwardRef((e,t)=>{const n=Dn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:l}=n,i=DK(n,["className","component","unstyled","variant"]),{classes:u,cx:p}=EK(null,{name:"UnstyledButton",unstyled:s,variant:l});return H.createElement(zr,OK({component:o,ref:t,className:p(u.root,r),type:o==="button"?"button":void 0},i))});e6.displayName="@mantine/core/UnstyledButton";const RK=e6;var AK=Object.defineProperty,TK=Object.defineProperties,$K=Object.getOwnPropertyDescriptors,v4=Object.getOwnPropertySymbols,NK=Object.prototype.hasOwnProperty,LK=Object.prototype.propertyIsEnumerable,x4=(e,t,n)=>t in e?AK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nx=(e,t)=>{for(var n in t||(t={}))NK.call(t,n)&&x4(e,n,t[n]);if(v4)for(var n of v4(t))LK.call(t,n)&&x4(e,n,t[n]);return e},b4=(e,t)=>TK(e,$K(t));const zK=["subtle","filled","outline","light","default","transparent","gradient"],up={xs:De(18),sm:De(22),md:De(28),lg:De(34),xl:De(44)};function FK({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:zK.includes(e)?nx({border:`${De(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var BK=fr((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:b4(nx({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:mt({size:s,sizes:up}),minHeight:mt({size:s,sizes:up}),width:mt({size:s,sizes:up}),minWidth:mt({size:s,sizes:up})},FK({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":b4(nx({content:'""'},e.fn.cover(De(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const HK=BK;var VK=Object.defineProperty,ym=Object.getOwnPropertySymbols,t6=Object.prototype.hasOwnProperty,n6=Object.prototype.propertyIsEnumerable,y4=(e,t,n)=>t in e?VK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C4=(e,t)=>{for(var n in t||(t={}))t6.call(t,n)&&y4(e,n,t[n]);if(ym)for(var n of ym(t))n6.call(t,n)&&y4(e,n,t[n]);return e},w4=(e,t)=>{var n={};for(var r in e)t6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ym)for(var r of ym(e))t.indexOf(r)<0&&n6.call(e,r)&&(n[r]=e[r]);return n};function WK(e){var t=e,{size:n,color:r}=t,o=w4(t,["size","color"]);const s=o,{style:l}=s,i=w4(s,["style"]);return H.createElement("svg",C4({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:C4({width:n},l)},i),H.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var UK=Object.defineProperty,Cm=Object.getOwnPropertySymbols,r6=Object.prototype.hasOwnProperty,o6=Object.prototype.propertyIsEnumerable,S4=(e,t,n)=>t in e?UK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k4=(e,t)=>{for(var n in t||(t={}))r6.call(t,n)&&S4(e,n,t[n]);if(Cm)for(var n of Cm(t))o6.call(t,n)&&S4(e,n,t[n]);return e},_4=(e,t)=>{var n={};for(var r in e)r6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cm)for(var r of Cm(e))t.indexOf(r)<0&&o6.call(e,r)&&(n[r]=e[r]);return n};function GK(e){var t=e,{size:n,color:r}=t,o=_4(t,["size","color"]);const s=o,{style:l}=s,i=_4(s,["style"]);return H.createElement("svg",k4({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:k4({width:n,height:n},l)},i),H.createElement("g",{fill:"none",fillRule:"evenodd"},H.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},H.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),H.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},H.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var KK=Object.defineProperty,wm=Object.getOwnPropertySymbols,s6=Object.prototype.hasOwnProperty,a6=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?KK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I4=(e,t)=>{for(var n in t||(t={}))s6.call(t,n)&&j4(e,n,t[n]);if(wm)for(var n of wm(t))a6.call(t,n)&&j4(e,n,t[n]);return e},P4=(e,t)=>{var n={};for(var r in e)s6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wm)for(var r of wm(e))t.indexOf(r)<0&&a6.call(e,r)&&(n[r]=e[r]);return n};function qK(e){var t=e,{size:n,color:r}=t,o=P4(t,["size","color"]);const s=o,{style:l}=s,i=P4(s,["style"]);return H.createElement("svg",I4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:I4({width:n},l)},i),H.createElement("circle",{cx:"15",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},H.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"105",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var XK=Object.defineProperty,Sm=Object.getOwnPropertySymbols,l6=Object.prototype.hasOwnProperty,i6=Object.prototype.propertyIsEnumerable,E4=(e,t,n)=>t in e?XK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QK=(e,t)=>{for(var n in t||(t={}))l6.call(t,n)&&E4(e,n,t[n]);if(Sm)for(var n of Sm(t))i6.call(t,n)&&E4(e,n,t[n]);return e},YK=(e,t)=>{var n={};for(var r in e)l6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sm)for(var r of Sm(e))t.indexOf(r)<0&&i6.call(e,r)&&(n[r]=e[r]);return n};const Ev={bars:WK,oval:GK,dots:qK},ZK={xs:De(18),sm:De(22),md:De(36),lg:De(44),xl:De(58)},JK={size:"md"};function c6(e){const t=Dn("Loader",JK,e),{size:n,color:r,variant:o}=t,s=YK(t,["size","color","variant"]),l=xa(),i=o in Ev?o:l.loader;return H.createElement(zr,QK({role:"presentation",component:Ev[i]||Ev.bars,size:mt({size:n,sizes:ZK}),color:l.fn.variant({variant:"filled",primaryFallback:!1,color:r||l.primaryColor}).background},s))}c6.displayName="@mantine/core/Loader";var eq=Object.defineProperty,km=Object.getOwnPropertySymbols,u6=Object.prototype.hasOwnProperty,d6=Object.prototype.propertyIsEnumerable,M4=(e,t,n)=>t in e?eq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O4=(e,t)=>{for(var n in t||(t={}))u6.call(t,n)&&M4(e,n,t[n]);if(km)for(var n of km(t))d6.call(t,n)&&M4(e,n,t[n]);return e},tq=(e,t)=>{var n={};for(var r in e)u6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&km)for(var r of km(e))t.indexOf(r)<0&&d6.call(e,r)&&(n[r]=e[r]);return n};const nq={color:"gray",size:"md",variant:"subtle"},f6=d.forwardRef((e,t)=>{const n=Dn("ActionIcon",nq,e),{className:r,color:o,children:s,radius:l,size:i,variant:u,gradient:p,disabled:m,loaderProps:h,loading:g,unstyled:x,__staticSelector:y}=n,b=tq(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:C,cx:S,theme:_}=HK({radius:l,color:o,gradient:p},{name:["ActionIcon",y],unstyled:x,size:i,variant:u}),j=H.createElement(c6,O4({color:_.fn.variant({color:o,variant:u}).color,size:"100%","data-action-icon-loader":!0},h));return H.createElement(RK,O4({className:S(C.root,r),ref:t,disabled:m,"data-disabled":m||void 0,"data-loading":g||void 0,unstyled:x},b),g?j:s)});f6.displayName="@mantine/core/ActionIcon";const rq=f6;var oq=Object.defineProperty,sq=Object.defineProperties,aq=Object.getOwnPropertyDescriptors,_m=Object.getOwnPropertySymbols,p6=Object.prototype.hasOwnProperty,m6=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lq=(e,t)=>{for(var n in t||(t={}))p6.call(t,n)&&D4(e,n,t[n]);if(_m)for(var n of _m(t))m6.call(t,n)&&D4(e,n,t[n]);return e},iq=(e,t)=>sq(e,aq(t)),cq=(e,t)=>{var n={};for(var r in e)p6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_m)for(var r of _m(e))t.indexOf(r)<0&&m6.call(e,r)&&(n[r]=e[r]);return n};function h6(e){const t=Dn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,l=cq(t,["children","target","className","innerRef"]),i=xa(),[u,p]=d.useState(!1),m=d.useRef();return HP(()=>(p(!0),m.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(m.current),()=>{!r&&document.body.removeChild(m.current)}),[r]),u?Kr.createPortal(H.createElement("div",iq(lq({className:o,dir:i.dir},l),{ref:s}),n),m.current):null}h6.displayName="@mantine/core/Portal";var uq=Object.defineProperty,jm=Object.getOwnPropertySymbols,g6=Object.prototype.hasOwnProperty,v6=Object.prototype.propertyIsEnumerable,R4=(e,t,n)=>t in e?uq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dq=(e,t)=>{for(var n in t||(t={}))g6.call(t,n)&&R4(e,n,t[n]);if(jm)for(var n of jm(t))v6.call(t,n)&&R4(e,n,t[n]);return e},fq=(e,t)=>{var n={};for(var r in e)g6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jm)for(var r of jm(e))t.indexOf(r)<0&&v6.call(e,r)&&(n[r]=e[r]);return n};function x6(e){var t=e,{withinPortal:n=!0,children:r}=t,o=fq(t,["withinPortal","children"]);return n?H.createElement(h6,dq({},o),r):H.createElement(H.Fragment,null,r)}x6.displayName="@mantine/core/OptionalPortal";var pq=Object.defineProperty,Im=Object.getOwnPropertySymbols,b6=Object.prototype.hasOwnProperty,y6=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T4=(e,t)=>{for(var n in t||(t={}))b6.call(t,n)&&A4(e,n,t[n]);if(Im)for(var n of Im(t))y6.call(t,n)&&A4(e,n,t[n]);return e},mq=(e,t)=>{var n={};for(var r in e)b6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Im)for(var r of Im(e))t.indexOf(r)<0&&y6.call(e,r)&&(n[r]=e[r]);return n};function C6(e){const t=e,{width:n,height:r,style:o}=t,s=mq(t,["width","height","style"]);return H.createElement("svg",T4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:T4({width:n,height:r},o)},s),H.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}C6.displayName="@mantine/core/CloseIcon";var hq=Object.defineProperty,Pm=Object.getOwnPropertySymbols,w6=Object.prototype.hasOwnProperty,S6=Object.prototype.propertyIsEnumerable,$4=(e,t,n)=>t in e?hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gq=(e,t)=>{for(var n in t||(t={}))w6.call(t,n)&&$4(e,n,t[n]);if(Pm)for(var n of Pm(t))S6.call(t,n)&&$4(e,n,t[n]);return e},vq=(e,t)=>{var n={};for(var r in e)w6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pm)for(var r of Pm(e))t.indexOf(r)<0&&S6.call(e,r)&&(n[r]=e[r]);return n};const xq={xs:De(12),sm:De(16),md:De(20),lg:De(28),xl:De(34)},bq={size:"sm"},k6=d.forwardRef((e,t)=>{const n=Dn("CloseButton",bq,e),{iconSize:r,size:o,children:s}=n,l=vq(n,["iconSize","size","children"]),i=De(r||xq[o]);return H.createElement(rq,gq({ref:t,__staticSelector:"CloseButton",size:o},l),s||H.createElement(C6,{width:i,height:i}))});k6.displayName="@mantine/core/CloseButton";const _6=k6;var yq=Object.defineProperty,Cq=Object.defineProperties,wq=Object.getOwnPropertyDescriptors,N4=Object.getOwnPropertySymbols,Sq=Object.prototype.hasOwnProperty,kq=Object.prototype.propertyIsEnumerable,L4=(e,t,n)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dp=(e,t)=>{for(var n in t||(t={}))Sq.call(t,n)&&L4(e,n,t[n]);if(N4)for(var n of N4(t))kq.call(t,n)&&L4(e,n,t[n]);return e},_q=(e,t)=>Cq(e,wq(t));function jq({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function Iq({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function Pq(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function Eq({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var Mq=fr((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:l,gradient:i,weight:u,transform:p,align:m,strikethrough:h,italic:g},{size:x})=>{const y=e.fn.variant({variant:"gradient",gradient:i});return{root:_q(dp(dp(dp(dp({},e.fn.fontStyles()),e.fn.focusStyles()),Pq(n)),Eq({theme:e,truncate:r})),{color:Iq({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||x===void 0?"inherit":mt({size:x,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:jq({underline:l,strikethrough:h}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":u,textTransform:p,textAlign:m,fontStyle:g?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const Oq=Mq;var Dq=Object.defineProperty,Em=Object.getOwnPropertySymbols,j6=Object.prototype.hasOwnProperty,I6=Object.prototype.propertyIsEnumerable,z4=(e,t,n)=>t in e?Dq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rq=(e,t)=>{for(var n in t||(t={}))j6.call(t,n)&&z4(e,n,t[n]);if(Em)for(var n of Em(t))I6.call(t,n)&&z4(e,n,t[n]);return e},Aq=(e,t)=>{var n={};for(var r in e)j6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Em)for(var r of Em(e))t.indexOf(r)<0&&I6.call(e,r)&&(n[r]=e[r]);return n};const Tq={variant:"text"},P6=d.forwardRef((e,t)=>{const n=Dn("Text",Tq,e),{className:r,size:o,weight:s,transform:l,color:i,align:u,variant:p,lineClamp:m,truncate:h,gradient:g,inline:x,inherit:y,underline:b,strikethrough:C,italic:S,classNames:_,styles:j,unstyled:E,span:I,__staticSelector:M}=n,D=Aq(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:R,cx:A}=Oq({color:i,lineClamp:m,truncate:h,inline:x,inherit:y,underline:b,strikethrough:C,italic:S,weight:s,transform:l,align:u,gradient:g},{unstyled:E,name:M||"Text",variant:p,size:o});return H.createElement(zr,Rq({ref:t,className:A(R.root,{[R.gradient]:p==="gradient"},r),component:I?"span":"div"},D))});P6.displayName="@mantine/core/Text";const kc=P6,fp={xs:De(1),sm:De(2),md:De(3),lg:De(4),xl:De(5)};function pp(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $q=fr((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:De(1),borderTop:`${mt({size:n,sizes:fp})} ${r} ${pp(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${mt({size:n,sizes:fp})} ${r} ${pp(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:De(mt({size:n,sizes:fp})),borderTopColor:pp(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:De(mt({size:n,sizes:fp})),borderLeftColor:pp(e,t),borderLeftStyle:r}}));const Nq=$q;var Lq=Object.defineProperty,zq=Object.defineProperties,Fq=Object.getOwnPropertyDescriptors,Mm=Object.getOwnPropertySymbols,E6=Object.prototype.hasOwnProperty,M6=Object.prototype.propertyIsEnumerable,F4=(e,t,n)=>t in e?Lq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B4=(e,t)=>{for(var n in t||(t={}))E6.call(t,n)&&F4(e,n,t[n]);if(Mm)for(var n of Mm(t))M6.call(t,n)&&F4(e,n,t[n]);return e},Bq=(e,t)=>zq(e,Fq(t)),Hq=(e,t)=>{var n={};for(var r in e)E6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mm)for(var r of Mm(e))t.indexOf(r)<0&&M6.call(e,r)&&(n[r]=e[r]);return n};const Vq={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},rx=d.forwardRef((e,t)=>{const n=Dn("Divider",Vq,e),{className:r,color:o,orientation:s,size:l,label:i,labelPosition:u,labelProps:p,variant:m,styles:h,classNames:g,unstyled:x}=n,y=Hq(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:b,cx:C}=Nq({color:o},{classNames:g,styles:h,unstyled:x,name:"Divider",variant:m,size:l}),S=s==="vertical",_=s==="horizontal",j=!!i&&_,E=!(p!=null&&p.color);return H.createElement(zr,B4({ref:t,className:C(b.root,{[b.vertical]:S,[b.horizontal]:_,[b.withLabel]:j},r),role:"separator"},y),j&&H.createElement(kc,Bq(B4({},p),{size:(p==null?void 0:p.size)||"xs",mt:De(2),className:C(b.label,b[u],{[b.labelDefaultStyles]:E})}),i))});rx.displayName="@mantine/core/Divider";var Wq=Object.defineProperty,Uq=Object.defineProperties,Gq=Object.getOwnPropertyDescriptors,H4=Object.getOwnPropertySymbols,Kq=Object.prototype.hasOwnProperty,qq=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?Wq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W4=(e,t)=>{for(var n in t||(t={}))Kq.call(t,n)&&V4(e,n,t[n]);if(H4)for(var n of H4(t))qq.call(t,n)&&V4(e,n,t[n]);return e},Xq=(e,t)=>Uq(e,Gq(t)),Qq=fr((e,t,{size:n})=>({item:Xq(W4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:mt({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":W4({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${mt({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${mt({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const Yq=Qq;var Zq=Object.defineProperty,U4=Object.getOwnPropertySymbols,Jq=Object.prototype.hasOwnProperty,eX=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?Zq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tX=(e,t)=>{for(var n in t||(t={}))Jq.call(t,n)&&G4(e,n,t[n]);if(U4)for(var n of U4(t))eX.call(t,n)&&G4(e,n,t[n]);return e};function iy({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:l,onItemHover:i,onItemSelect:u,itemsRefs:p,itemComponent:m,size:h,nothingFound:g,creatable:x,createLabel:y,unstyled:b,variant:C}){const{classes:S}=Yq(null,{classNames:n,styles:r,unstyled:b,name:l,variant:C,size:h}),_=[],j=[];let E=null;const I=(D,R)=>{const A=typeof o=="function"?o(D.value):!1;return H.createElement(m,tX({key:D.value,className:S.item,"data-disabled":D.disabled||void 0,"data-hovered":!D.disabled&&t===R||void 0,"data-selected":!D.disabled&&A||void 0,selected:A,onMouseEnter:()=>i(R),id:`${s}-${R}`,role:"option",tabIndex:-1,"aria-selected":t===R,ref:O=>{p&&p.current&&(p.current[D.value]=O)},onMouseDown:D.disabled?null:O=>{O.preventDefault(),u(D)},disabled:D.disabled,variant:C},D))};let M=null;if(e.forEach((D,R)=>{D.creatable?E=R:D.group?(M!==D.group&&(M=D.group,j.push(H.createElement("div",{className:S.separator,key:`__mantine-divider-${R}`},H.createElement(rx,{classNames:{label:S.separatorLabel},label:D.group})))),j.push(I(D,R))):_.push(I(D,R))}),x){const D=e[E];_.push(H.createElement("div",{key:ay(),className:S.item,"data-hovered":t===E||void 0,onMouseEnter:()=>i(E),onMouseDown:R=>{R.preventDefault(),u(D)},tabIndex:-1,ref:R=>{p&&p.current&&(p.current[D.value]=R)}},y))}return j.length>0&&_.length>0&&_.unshift(H.createElement("div",{className:S.separator,key:"empty-group-separator"},H.createElement(rx,null))),j.length>0||_.length>0?H.createElement(H.Fragment,null,j,_):H.createElement(kc,{size:h,unstyled:b,className:S.nothingFound},g)}iy.displayName="@mantine/core/SelectItems";var nX=Object.defineProperty,Om=Object.getOwnPropertySymbols,O6=Object.prototype.hasOwnProperty,D6=Object.prototype.propertyIsEnumerable,K4=(e,t,n)=>t in e?nX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rX=(e,t)=>{for(var n in t||(t={}))O6.call(t,n)&&K4(e,n,t[n]);if(Om)for(var n of Om(t))D6.call(t,n)&&K4(e,n,t[n]);return e},oX=(e,t)=>{var n={};for(var r in e)O6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Om)for(var r of Om(e))t.indexOf(r)<0&&D6.call(e,r)&&(n[r]=e[r]);return n};const cy=d.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=oX(n,["label","value"]);return H.createElement("div",rX({ref:t},s),r||o)});cy.displayName="@mantine/core/DefaultItem";function sX(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function R6(...e){return t=>e.forEach(n=>sX(n,t))}function ai(...e){return d.useCallback(R6(...e),e)}const A6=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(lX);if(s){const l=s.props.children,i=o.map(u=>u===s?d.Children.count(l)>1?d.Children.only(null):d.isValidElement(l)?l.props.children:null:u);return d.createElement(ox,fn({},r,{ref:t}),d.isValidElement(l)?d.cloneElement(l,void 0,i):null)}return d.createElement(ox,fn({},r,{ref:t}),n)});A6.displayName="Slot";const ox=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...iX(r,n.props),ref:R6(t,n.ref)}):d.Children.count(n)>1?d.Children.only(null):null});ox.displayName="SlotClone";const aX=({children:e})=>d.createElement(d.Fragment,null,e);function lX(e){return d.isValidElement(e)&&e.type===aX}function iX(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{s(...i),o(...i)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const cX=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Ud=cX.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...l}=r,i=s?A6:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(i,fn({},l,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),sx=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function uX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Gd=e=>{const{present:t,children:n}=e,r=dX(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ai(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Gd.displayName="Presence";function dX(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),l=e?"mounted":"unmounted",[i,u]=uX(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const p=mp(r.current);s.current=i==="mounted"?p:"none"},[i]),sx(()=>{const p=r.current,m=o.current;if(m!==e){const g=s.current,x=mp(p);e?u("MOUNT"):x==="none"||(p==null?void 0:p.display)==="none"?u("UNMOUNT"):u(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),sx(()=>{if(t){const p=h=>{const x=mp(r.current).includes(h.animationName);h.target===t&&x&&Kr.flushSync(()=>u("ANIMATION_END"))},m=h=>{h.target===t&&(s.current=mp(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:d.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function mp(e){return(e==null?void 0:e.animationName)||"none"}function fX(e,t=[]){let n=[];function r(s,l){const i=d.createContext(l),u=n.length;n=[...n,l];function p(h){const{scope:g,children:x,...y}=h,b=(g==null?void 0:g[e][u])||i,C=d.useMemo(()=>y,Object.values(y));return d.createElement(b.Provider,{value:C},x)}function m(h,g){const x=(g==null?void 0:g[e][u])||i,y=d.useContext(x);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,m]}const o=()=>{const s=n.map(l=>d.createContext(l));return function(i){const u=(i==null?void 0:i[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[r,pX(o,...t)]}function pX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const l=r.reduce((i,{useScope:u,scopeName:p})=>{const h=u(s)[`__scope${p}`];return{...i,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Ml(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const mX=d.createContext(void 0);function hX(e){const t=d.useContext(mX);return e||t||"ltr"}function gX(e,[t,n]){return Math.min(n,Math.max(t,e))}function Nl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function vX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const T6="ScrollArea",[$6,T1e]=fX(T6),[xX,jo]=$6(T6),bX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...l}=e,[i,u]=d.useState(null),[p,m]=d.useState(null),[h,g]=d.useState(null),[x,y]=d.useState(null),[b,C]=d.useState(null),[S,_]=d.useState(0),[j,E]=d.useState(0),[I,M]=d.useState(!1),[D,R]=d.useState(!1),A=ai(t,$=>u($)),O=hX(o);return d.createElement(xX,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:i,viewport:p,onViewportChange:m,content:h,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:I,onScrollbarXEnabledChange:M,scrollbarY:b,onScrollbarYChange:C,scrollbarYEnabled:D,onScrollbarYEnabledChange:R,onCornerWidthChange:_,onCornerHeightChange:E},d.createElement(Ud.div,fn({dir:O},l,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})))}),yX="ScrollAreaViewport",CX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=jo(yX,n),l=d.useRef(null),i=ai(t,l,s.onViewportChange);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(Ud.div,fn({"data-radix-scroll-area-viewport":""},o,{ref:i,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),d.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ya="ScrollAreaScrollbar",wX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jo(ya,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=o,i=e.orientation==="horizontal";return d.useEffect(()=>(i?s(!0):l(!0),()=>{i?s(!1):l(!1)}),[i,s,l]),o.type==="hover"?d.createElement(SX,fn({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(kX,fn({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(N6,fn({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(uy,fn({},r,{ref:t})):null}),SX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jo(ya,e.__scopeScrollArea),[s,l]=d.useState(!1);return d.useEffect(()=>{const i=o.scrollArea;let u=0;if(i){const p=()=>{window.clearTimeout(u),l(!0)},m=()=>{u=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",p),i.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),i.removeEventListener("pointerenter",p),i.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Gd,{present:n||s},d.createElement(N6,fn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),kX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jo(ya,e.__scopeScrollArea),s=e.orientation==="horizontal",l=sg(()=>u("SCROLL_END"),100),[i,u]=vX("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(i==="idle"){const p=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[i,o.scrollHideDelay,u]),d.useEffect(()=>{const p=o.viewport,m=s?"scrollLeft":"scrollTop";if(p){let h=p[m];const g=()=>{const x=p[m];h!==x&&(u("SCROLL"),l()),h=x};return p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,s,u,l]),d.createElement(Gd,{present:n||i!=="hidden"},d.createElement(uy,fn({"data-state":i==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Nl(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Nl(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),N6=d.forwardRef((e,t)=>{const n=jo(ya,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,l]=d.useState(!1),i=e.orientation==="horizontal",u=sg(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;l(i?p:m)}},10);return _c(n.viewport,u),_c(n.content,u),d.createElement(Gd,{present:r||s},d.createElement(uy,fn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),uy=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=jo(ya,e.__scopeScrollArea),s=d.useRef(null),l=d.useRef(0),[i,u]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=B6(i.viewport,i.content),m={...r,sizes:i,onSizesChange:u,hasThumb:p>0&&p<1,onThumbChange:g=>s.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function h(g,x){return DX(g,l.current,i,x)}return n==="horizontal"?d.createElement(_X,fn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollLeft,x=q4(g,i,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=h(g,o.dir))}})):n==="vertical"?d.createElement(jX,fn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollTop,x=q4(g,i);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=h(g))}})):null}),_X=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=jo(ya,e.__scopeScrollArea),[l,i]=d.useState(),u=d.useRef(null),p=ai(t,u,s.onScrollbarXChange);return d.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),d.createElement(z6,fn({"data-orientation":"horizontal"},o,{ref:p,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":og(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),V6(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Dm(l.paddingLeft),paddingEnd:Dm(l.paddingRight)}})}}))}),jX=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=jo(ya,e.__scopeScrollArea),[l,i]=d.useState(),u=d.useRef(null),p=ai(t,u,s.onScrollbarYChange);return d.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),d.createElement(z6,fn({"data-orientation":"vertical"},o,{ref:p,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":og(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),V6(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Dm(l.paddingTop),paddingEnd:Dm(l.paddingBottom)}})}}))}),[IX,L6]=$6(ya),z6=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:i,onThumbPositionChange:u,onDragScroll:p,onWheelScroll:m,onResize:h,...g}=e,x=jo(ya,n),[y,b]=d.useState(null),C=ai(t,A=>b(A)),S=d.useRef(null),_=d.useRef(""),j=x.viewport,E=r.content-r.viewport,I=Ml(m),M=Ml(u),D=sg(h,10);function R(A){if(S.current){const O=A.clientX-S.current.left,$=A.clientY-S.current.top;p({x:O,y:$})}}return d.useEffect(()=>{const A=O=>{const $=O.target;(y==null?void 0:y.contains($))&&I(O,E)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[j,y,E,I]),d.useEffect(M,[r,M]),_c(y,D),_c(x.content,D),d.createElement(IX,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:Ml(s),onThumbPointerUp:Ml(l),onThumbPositionChange:M,onThumbPointerDown:Ml(i)},d.createElement(Ud.div,fn({},g,{ref:C,style:{position:"absolute",...g.style},onPointerDown:Nl(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),S.current=y.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",R(A))}),onPointerMove:Nl(e.onPointerMove,R),onPointerUp:Nl(e.onPointerUp,A=>{const O=A.target;O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=_.current,S.current=null})})))}),ax="ScrollAreaThumb",PX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=L6(ax,e.__scopeScrollArea);return d.createElement(Gd,{present:n||o.hasThumb},d.createElement(EX,fn({ref:t},r)))}),EX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=jo(ax,n),l=L6(ax,n),{onThumbPositionChange:i}=l,u=ai(t,h=>l.onThumbChange(h)),p=d.useRef(),m=sg(()=>{p.current&&(p.current(),p.current=void 0)},100);return d.useEffect(()=>{const h=s.viewport;if(h){const g=()=>{if(m(),!p.current){const x=RX(h,i);p.current=x,i()}};return i(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[s.viewport,m,i]),d.createElement(Ud.div,fn({"data-state":l.hasThumb?"visible":"hidden"},o,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Nl(e.onPointerDownCapture,h=>{const x=h.target.getBoundingClientRect(),y=h.clientX-x.left,b=h.clientY-x.top;l.onThumbPointerDown({x:y,y:b})}),onPointerUp:Nl(e.onPointerUp,l.onThumbPointerUp)}))}),F6="ScrollAreaCorner",MX=d.forwardRef((e,t)=>{const n=jo(F6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(OX,fn({},e,{ref:t})):null}),OX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=jo(F6,n),[s,l]=d.useState(0),[i,u]=d.useState(0),p=!!(s&&i);return _c(o.scrollbarX,()=>{var m;const h=((m=o.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;o.onCornerHeightChange(h),u(h)}),_c(o.scrollbarY,()=>{var m;const h=((m=o.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;o.onCornerWidthChange(h),l(h)}),p?d.createElement(Ud.div,fn({},r,{ref:t,style:{width:s,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Dm(e){return e?parseInt(e,10):0}function B6(e,t){const n=e/t;return isNaN(n)?0:n}function og(e){const t=B6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function DX(e,t,n,r="ltr"){const o=og(n),s=o/2,l=t||s,i=o-l,u=n.scrollbar.paddingStart+l,p=n.scrollbar.size-n.scrollbar.paddingEnd-i,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return H6([u,p],h)(e)}function q4(e,t,n="ltr"){const r=og(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,l=t.content-t.viewport,i=s-r,u=n==="ltr"?[0,l]:[l*-1,0],p=gX(e,u);return H6([0,l],[0,i])(p)}function H6(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function V6(e,t){return e>0&&e<t}const RX=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},l=n.left!==s.left,i=n.top!==s.top;(l||i)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function sg(e,t){const n=Ml(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function _c(e,t){const n=Ml(t);sx(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const AX=bX,TX=CX,X4=wX,Q4=PX,$X=MX;var NX=fr((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?De(t):void 0,paddingBottom:n?De(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${De(t)}  / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${t4("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:De(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:De(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:t4("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:De(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:De(44),minHeight:De(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const LX=NX;var zX=Object.defineProperty,FX=Object.defineProperties,BX=Object.getOwnPropertyDescriptors,Rm=Object.getOwnPropertySymbols,W6=Object.prototype.hasOwnProperty,U6=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?zX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lx=(e,t)=>{for(var n in t||(t={}))W6.call(t,n)&&Y4(e,n,t[n]);if(Rm)for(var n of Rm(t))U6.call(t,n)&&Y4(e,n,t[n]);return e},G6=(e,t)=>FX(e,BX(t)),K6=(e,t)=>{var n={};for(var r in e)W6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rm)for(var r of Rm(e))t.indexOf(r)<0&&U6.call(e,r)&&(n[r]=e[r]);return n};const q6={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},ag=d.forwardRef((e,t)=>{const n=Dn("ScrollArea",q6,e),{children:r,className:o,classNames:s,styles:l,scrollbarSize:i,scrollHideDelay:u,type:p,dir:m,offsetScrollbars:h,viewportRef:g,onScrollPositionChange:x,unstyled:y,variant:b,viewportProps:C}=n,S=K6(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[_,j]=d.useState(!1),E=xa(),{classes:I,cx:M}=LX({scrollbarSize:i,offsetScrollbars:h,scrollbarHovered:_,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:l,unstyled:y,variant:b});return H.createElement(AX,{type:p==="never"?"always":p,scrollHideDelay:u,dir:m||E.dir,ref:t,asChild:!0},H.createElement(zr,lx({className:M(I.root,o)},S),H.createElement(TX,G6(lx({},C),{className:I.viewport,ref:g,onScroll:typeof x=="function"?({currentTarget:D})=>x({x:D.scrollLeft,y:D.scrollTop}):void 0}),r),H.createElement(X4,{orientation:"horizontal",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(Q4,{className:I.thumb})),H.createElement(X4,{orientation:"vertical",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(Q4,{className:I.thumb})),H.createElement($X,{className:I.corner})))}),X6=d.forwardRef((e,t)=>{const n=Dn("ScrollAreaAutosize",q6,e),{children:r,classNames:o,styles:s,scrollbarSize:l,scrollHideDelay:i,type:u,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,sx:y,variant:b,viewportProps:C}=n,S=K6(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(zr,G6(lx({},S),{ref:t,sx:[{display:"flex"},...$P(y)]}),H.createElement(zr,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(ag,{classNames:o,styles:s,scrollHideDelay:i,scrollbarSize:l,type:u,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:C},r)))});X6.displayName="@mantine/core/ScrollAreaAutosize";ag.displayName="@mantine/core/ScrollArea";ag.Autosize=X6;const Q6=ag;var HX=Object.defineProperty,VX=Object.defineProperties,WX=Object.getOwnPropertyDescriptors,Am=Object.getOwnPropertySymbols,Y6=Object.prototype.hasOwnProperty,Z6=Object.prototype.propertyIsEnumerable,Z4=(e,t,n)=>t in e?HX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J4=(e,t)=>{for(var n in t||(t={}))Y6.call(t,n)&&Z4(e,n,t[n]);if(Am)for(var n of Am(t))Z6.call(t,n)&&Z4(e,n,t[n]);return e},UX=(e,t)=>VX(e,WX(t)),GX=(e,t)=>{var n={};for(var r in e)Y6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Am)for(var r of Am(e))t.indexOf(r)<0&&Z6.call(e,r)&&(n[r]=e[r]);return n};const lg=d.forwardRef((e,t)=>{var n=e,{style:r}=n,o=GX(n,["style"]);return H.createElement(Q6,UX(J4({},o),{style:J4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});lg.displayName="@mantine/core/SelectScrollArea";var KX=fr(()=>({dropdown:{},itemsWrapper:{padding:De(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const qX=KX;function Vc(e){return e.split("-")[1]}function dy(e){return e==="y"?"height":"width"}function Ko(e){return e.split("-")[0]}function ul(e){return["top","bottom"].includes(Ko(e))?"x":"y"}function ek(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,i=ul(t),u=dy(i),p=r[u]/2-o[u]/2,m=i==="x";let h;switch(Ko(t)){case"top":h={x:s,y:r.y-o.height};break;case"bottom":h={x:s,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:l};break;case"left":h={x:r.x-o.width,y:l};break;default:h={x:r.x,y:r.y}}switch(Vc(t)){case"start":h[i]-=p*(n&&m?-1:1);break;case"end":h[i]+=p*(n&&m?-1:1)}return h}const XX=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:l}=n,i=s.filter(Boolean),u=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=ek(p,r,u),g=r,x={},y=0;for(let b=0;b<i.length;b++){const{name:C,fn:S}=i[b],{x:_,y:j,data:E,reset:I}=await S({x:m,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:x,rects:p,platform:l,elements:{reference:e,floating:t}});m=_??m,h=j??h,x={...x,[C]:{...x[C],...E}},I&&y<=50&&(y++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(p=I.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:m,y:h}=ek(p,g,u)),b=-1)}return{x:m,y:h,placement:g,strategy:o,middlewareData:x}};function ia(e,t){return typeof e=="function"?e(t):e}function fy(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function jc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function py(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:l,elements:i,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:x=0}=ia(t,e),y=fy(x),b=i[g?h==="floating"?"reference":"floating":h],C=jc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:p,rootBoundary:m,strategy:u})),S=h==="floating"?{...l.floating,x:r,y:o}:l.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),j=await(s.isElement==null?void 0:s.isElement(_))&&await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1},E=jc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:_,strategy:u}):S);return{top:(C.top-E.top+y.top)/j.y,bottom:(E.bottom-C.bottom+y.bottom)/j.y,left:(C.left-E.left+y.left)/j.x,right:(E.right-C.right+y.right)/j.x}}const tl=Math.min,hs=Math.max;function ix(e,t,n){return hs(e,tl(t,n))}const tk=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:l,elements:i}=t,{element:u,padding:p=0}=ia(e,t)||{};if(u==null)return{};const m=fy(p),h={x:n,y:r},g=ul(o),x=dy(g),y=await l.getDimensions(u),b=g==="y",C=b?"top":"left",S=b?"bottom":"right",_=b?"clientHeight":"clientWidth",j=s.reference[x]+s.reference[g]-h[g]-s.floating[x],E=h[g]-s.reference[g],I=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let M=I?I[_]:0;M&&await(l.isElement==null?void 0:l.isElement(I))||(M=i.floating[_]||s.floating[x]);const D=j/2-E/2,R=M/2-y[x]/2-1,A=tl(m[C],R),O=tl(m[S],R),$=A,X=M-y[x]-O,z=M/2-y[x]/2+D,V=ix($,z,X),Q=Vc(o)!=null&&z!=V&&s.reference[x]/2-(z<$?A:O)-y[x]/2<0?z<$?$-z:X-z:0;return{[g]:h[g]-Q,data:{[g]:V,centerOffset:z-V+Q}}}}),QX=["top","right","bottom","left"];QX.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const YX={left:"right",right:"left",bottom:"top",top:"bottom"};function Tm(e){return e.replace(/left|right|bottom|top/g,t=>YX[t])}function ZX(e,t,n){n===void 0&&(n=!1);const r=Vc(e),o=ul(e),s=dy(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=Tm(l)),{main:l,cross:Tm(l)}}const JX={start:"end",end:"start"};function Mv(e){return e.replace(/start|end/g,t=>JX[t])}const eQ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:l,platform:i,elements:u}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...b}=ia(e,t),C=Ko(r),S=Ko(l)===l,_=await(i.isRTL==null?void 0:i.isRTL(u.floating)),j=h||(S||!y?[Tm(l)]:function($){const X=Tm($);return[Mv($),X,Mv(X)]}(l));h||x==="none"||j.push(...function($,X,z,V){const Q=Vc($);let G=function(F,U,T){const B=["left","right"],Y=["right","left"],re=["top","bottom"],ae=["bottom","top"];switch(F){case"top":case"bottom":return T?U?Y:B:U?B:Y;case"left":case"right":return U?re:ae;default:return[]}}(Ko($),z==="start",V);return Q&&(G=G.map(F=>F+"-"+Q),X&&(G=G.concat(G.map(Mv)))),G}(l,y,x,_));const E=[l,...j],I=await py(t,b),M=[];let D=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&M.push(I[C]),m){const{main:$,cross:X}=ZX(r,s,_);M.push(I[$],I[X])}if(D=[...D,{placement:r,overflows:M}],!M.every($=>$<=0)){var R,A;const $=(((R=o.flip)==null?void 0:R.index)||0)+1,X=E[$];if(X)return{data:{index:$,overflows:D},reset:{placement:X}};let z=(A=D.filter(V=>V.overflows[0]<=0).sort((V,Q)=>V.overflows[1]-Q.overflows[1])[0])==null?void 0:A.placement;if(!z)switch(g){case"bestFit":{var O;const V=(O=D.map(Q=>[Q.placement,Q.overflows.filter(G=>G>0).reduce((G,F)=>G+F,0)]).sort((Q,G)=>Q[1]-G[1])[0])==null?void 0:O[0];V&&(z=V);break}case"initialPlacement":z=l}if(r!==z)return{reset:{placement:z}}}return{}}}};function nk(e){const t=tl(...e.map(r=>r.left)),n=tl(...e.map(r=>r.top));return{x:t,y:n,width:hs(...e.map(r=>r.right))-t,height:hs(...e.map(r=>r.bottom))-n}}const tQ=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:l}=t,{padding:i=2,x:u,y:p}=ia(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),h=function(b){const C=b.slice().sort((j,E)=>j.y-E.y),S=[];let _=null;for(let j=0;j<C.length;j++){const E=C[j];!_||E.y-_.y>_.height/2?S.push([E]):S[S.length-1].push(E),_=E}return S.map(j=>jc(nk(j)))}(m),g=jc(nk(m)),x=fy(i),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(h.length===2&&h[0].left>h[1].right&&u!=null&&p!=null)return h.find(b=>u>b.left-x.left&&u<b.right+x.right&&p>b.top-x.top&&p<b.bottom+x.bottom)||g;if(h.length>=2){if(ul(n)==="x"){const I=h[0],M=h[h.length-1],D=Ko(n)==="top",R=I.top,A=M.bottom,O=D?I.left:M.left,$=D?I.right:M.right;return{top:R,bottom:A,left:O,right:$,width:$-O,height:A-R,x:O,y:R}}const b=Ko(n)==="left",C=hs(...h.map(I=>I.right)),S=tl(...h.map(I=>I.left)),_=h.filter(I=>b?I.left===S:I.right===C),j=_[0].top,E=_[_.length-1].bottom;return{top:j,bottom:E,left:S,right:C,width:C-S,height:E-j,x:S,y:j}}return g}},floating:r.floating,strategy:l});return o.reference.x!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},nQ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,l){const{placement:i,platform:u,elements:p}=s,m=await(u.isRTL==null?void 0:u.isRTL(p.floating)),h=Ko(i),g=Vc(i),x=ul(i)==="x",y=["left","top"].includes(h)?-1:1,b=m&&x?-1:1,C=ia(l,s);let{mainAxis:S,crossAxis:_,alignmentAxis:j}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return g&&typeof j=="number"&&(_=g==="end"?-1*j:j),x?{x:_*b,y:S*y}:{x:S*y,y:_*b}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function J6(e){return e==="x"?"y":"x"}const rQ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:i={fn:C=>{let{x:S,y:_}=C;return{x:S,y:_}}},...u}=ia(e,t),p={x:n,y:r},m=await py(t,u),h=ul(Ko(o)),g=J6(h);let x=p[h],y=p[g];if(s){const C=h==="y"?"bottom":"right";x=ix(x+m[h==="y"?"top":"left"],x,x-m[C])}if(l){const C=g==="y"?"bottom":"right";y=ix(y+m[g==="y"?"top":"left"],y,y-m[C])}const b=i.fn({...t,[h]:x,[g]:y});return{...b,data:{x:b.x-n,y:b.y-r}}}}},oQ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:l}=t,{offset:i=0,mainAxis:u=!0,crossAxis:p=!0}=ia(e,t),m={x:n,y:r},h=ul(o),g=J6(h);let x=m[h],y=m[g];const b=ia(i,t),C=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const j=h==="y"?"height":"width",E=s.reference[h]-s.floating[j]+C.mainAxis,I=s.reference[h]+s.reference[j]-C.mainAxis;x<E?x=E:x>I&&(x=I)}if(p){var S,_;const j=h==="y"?"width":"height",E=["top","left"].includes(Ko(o)),I=s.reference[g]-s.floating[j]+(E&&((S=l.offset)==null?void 0:S[g])||0)+(E?0:C.crossAxis),M=s.reference[g]+s.reference[j]+(E?0:((_=l.offset)==null?void 0:_[g])||0)-(E?C.crossAxis:0);y<I?y=I:y>M&&(y=M)}return{[h]:x,[g]:y}}}},sQ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:l=()=>{},...i}=ia(e,t),u=await py(t,i),p=Ko(n),m=Vc(n),h=ul(n)==="x",{width:g,height:x}=r.floating;let y,b;p==="top"||p==="bottom"?(y=p,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=p,y=m==="end"?"top":"bottom");const C=x-u[y],S=g-u[b],_=!t.middlewareData.shift;let j=C,E=S;if(h){const M=g-u.left-u.right;E=m||_?tl(S,M):M}else{const M=x-u.top-u.bottom;j=m||_?tl(C,M):M}if(_&&!m){const M=hs(u.left,0),D=hs(u.right,0),R=hs(u.top,0),A=hs(u.bottom,0);h?E=g-2*(M!==0||D!==0?M+D:hs(u.left,u.right)):j=x-2*(R!==0||A!==0?R+A:hs(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:j});const I=await o.getDimensions(s.floating);return g!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function Xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){return Xr(e).getComputedStyle(e)}function eE(e){return e instanceof Xr(e).Node}function nl(e){return eE(e)?(e.nodeName||"").toLowerCase():"#document"}function es(e){return e instanceof HTMLElement||e instanceof Xr(e).HTMLElement}function rk(e){return typeof ShadowRoot<"u"&&(e instanceof Xr(e).ShadowRoot||e instanceof ShadowRoot)}function id(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_s(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function aQ(e){return["table","td","th"].includes(nl(e))}function cx(e){const t=my(),n=_s(e);return n.transform!=="none"||n.perspective!=="none"||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function my(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ig(e){return["html","body","#document"].includes(nl(e))}const ux=Math.min,pc=Math.max,$m=Math.round,hp=Math.floor,rl=e=>({x:e,y:e});function tE(e){const t=_s(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=es(e),s=o?e.offsetWidth:n,l=o?e.offsetHeight:r,i=$m(n)!==s||$m(r)!==l;return i&&(n=s,r=l),{width:n,height:r,$:i}}function ta(e){return e instanceof Element||e instanceof Xr(e).Element}function hy(e){return ta(e)?e:e.contextElement}function mc(e){const t=hy(e);if(!es(t))return rl(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=tE(t);let l=(s?$m(n.width):n.width)/r,i=(s?$m(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),i&&Number.isFinite(i)||(i=1),{x:l,y:i}}const lQ=rl(0);function nE(e){const t=Xr(e);return my()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:lQ}function Ql(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=hy(e);let l=rl(1);t&&(r?ta(r)&&(l=mc(r)):l=mc(e));const i=function(g,x,y){return x===void 0&&(x=!1),!(!y||x&&y!==Xr(g))&&x}(s,n,r)?nE(s):rl(0);let u=(o.left+i.x)/l.x,p=(o.top+i.y)/l.y,m=o.width/l.x,h=o.height/l.y;if(s){const g=Xr(s),x=r&&ta(r)?Xr(r):r;let y=g.frameElement;for(;y&&r&&x!==g;){const b=mc(y),C=y.getBoundingClientRect(),S=getComputedStyle(y),_=C.left+(y.clientLeft+parseFloat(S.paddingLeft))*b.x,j=C.top+(y.clientTop+parseFloat(S.paddingTop))*b.y;u*=b.x,p*=b.y,m*=b.x,h*=b.y,u+=_,p+=j,y=Xr(y).frameElement}}return jc({width:m,height:h,x:u,y:p})}function cg(e){return ta(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function na(e){var t;return(t=(eE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rE(e){return Ql(na(e)).left+cg(e).scrollLeft}function Ic(e){if(nl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rk(e)&&e.host||na(e);return rk(t)?t.host:t}function oE(e){const t=Ic(e);return ig(t)?e.ownerDocument?e.ownerDocument.body:e.body:es(t)&&id(t)?t:oE(t)}function Nm(e,t){var n;t===void 0&&(t=[]);const r=oE(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Xr(r);return o?t.concat(s,s.visualViewport||[],id(r)?r:[]):t.concat(r,Nm(r))}function ok(e,t,n){let r;if(t==="viewport")r=function(o,s){const l=Xr(o),i=na(o),u=l.visualViewport;let p=i.clientWidth,m=i.clientHeight,h=0,g=0;if(u){p=u.width,m=u.height;const x=my();(!x||x&&s==="fixed")&&(h=u.offsetLeft,g=u.offsetTop)}return{width:p,height:m,x:h,y:g}}(e,n);else if(t==="document")r=function(o){const s=na(o),l=cg(o),i=o.ownerDocument.body,u=pc(s.scrollWidth,s.clientWidth,i.scrollWidth,i.clientWidth),p=pc(s.scrollHeight,s.clientHeight,i.scrollHeight,i.clientHeight);let m=-l.scrollLeft+rE(o);const h=-l.scrollTop;return _s(i).direction==="rtl"&&(m+=pc(s.clientWidth,i.clientWidth)-u),{width:u,height:p,x:m,y:h}}(na(e));else if(ta(t))r=function(o,s){const l=Ql(o,!0,s==="fixed"),i=l.top+o.clientTop,u=l.left+o.clientLeft,p=es(o)?mc(o):rl(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:u*p.x,y:i*p.y}}(t,n);else{const o=nE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return jc(r)}function sE(e,t){const n=Ic(e);return!(n===t||!ta(n)||ig(n))&&(_s(n).position==="fixed"||sE(n,t))}function iQ(e,t,n){const r=es(t),o=na(t),s=n==="fixed",l=Ql(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const u=rl(0);if(r||!r&&!s)if((nl(t)!=="body"||id(o))&&(i=cg(t)),es(t)){const p=Ql(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&(u.x=rE(o));return{x:l.left+i.scrollLeft-u.x,y:l.top+i.scrollTop-u.y,width:l.width,height:l.height}}function sk(e,t){return es(e)&&_s(e).position!=="fixed"?t?t(e):e.offsetParent:null}function ak(e,t){const n=Xr(e);if(!es(e))return n;let r=sk(e,t);for(;r&&aQ(r)&&_s(r).position==="static";)r=sk(r,t);return r&&(nl(r)==="html"||nl(r)==="body"&&_s(r).position==="static"&&!cx(r))?n:r||function(o){let s=Ic(o);for(;es(s)&&!ig(s);){if(cx(s))return s;s=Ic(s)}return null}(e)||n}const cQ={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=es(n),s=na(n);if(n===s)return t;let l={scrollLeft:0,scrollTop:0},i=rl(1);const u=rl(0);if((o||!o&&r!=="fixed")&&((nl(n)!=="body"||id(s))&&(l=cg(n)),es(n))){const p=Ql(n);i=mc(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}return{width:t.width*i.x,height:t.height*i.y,x:t.x*i.x-l.scrollLeft*i.x+u.x,y:t.y*i.y-l.scrollTop*i.y+u.y}},getDocumentElement:na,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(u,p){const m=p.get(u);if(m)return m;let h=Nm(u).filter(b=>ta(b)&&nl(b)!=="body"),g=null;const x=_s(u).position==="fixed";let y=x?Ic(u):u;for(;ta(y)&&!ig(y);){const b=_s(y),C=cx(y);C||b.position!=="fixed"||(g=null),(x?!C&&!g:!C&&b.position==="static"&&g&&["absolute","fixed"].includes(g.position)||id(y)&&!C&&sE(u,y))?h=h.filter(S=>S!==y):g=b,y=Ic(y)}return p.set(u,h),h}(t,this._c):[].concat(n),r],l=s[0],i=s.reduce((u,p)=>{const m=ok(t,p,o);return u.top=pc(m.top,u.top),u.right=ux(m.right,u.right),u.bottom=ux(m.bottom,u.bottom),u.left=pc(m.left,u.left),u},ok(t,l,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}},getOffsetParent:ak,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ak,s=this.getDimensions;return{reference:iQ(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return tE(e)},getScale:mc,isElement:ta,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function uQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,p=hy(e),m=o||s?[...p?Nm(p):[],...Nm(t)]:[];m.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const h=p&&i?function(C,S){let _,j=null;const E=na(C);function I(){clearTimeout(_),j&&j.disconnect(),j=null}return function M(D,R){D===void 0&&(D=!1),R===void 0&&(R=1),I();const{left:A,top:O,width:$,height:X}=C.getBoundingClientRect();if(D||S(),!$||!X)return;const z={rootMargin:-hp(O)+"px "+-hp(E.clientWidth-(A+$))+"px "+-hp(E.clientHeight-(O+X))+"px "+-hp(A)+"px",threshold:pc(0,ux(1,R))||1};let V=!0;function Q(G){const F=G[0].intersectionRatio;if(F!==R){if(!V)return M();F?M(!1,F):_=setTimeout(()=>{M(!1,1e-7)},100)}V=!1}try{j=new IntersectionObserver(Q,{...z,root:E.ownerDocument})}catch{j=new IntersectionObserver(Q,z)}j.observe(C)}(!0),I}(p,n):null;let g,x=-1,y=null;l&&(y=new ResizeObserver(C=>{let[S]=C;S&&S.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!u&&y.observe(p),y.observe(t));let b=u?Ql(e):null;return u&&function C(){const S=Ql(e);!b||S.x===b.x&&S.y===b.y&&S.width===b.width&&S.height===b.height||n(),b=S,g=requestAnimationFrame(C)}(),n(),()=>{m.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),h&&h(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(g)}}const dQ=(e,t,n)=>{const r=new Map,o={platform:cQ,...n},s={...o.platform,_c:r};return XX(e,t,{...o,platform:s})},fQ=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?tk({element:t.current,padding:n}).fn(o):{}:t?tk({element:t,padding:n}).fn(o):{}}}};var Kp=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Lm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Lm(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Lm(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function lk(e){const t=d.useRef(e);return Kp(()=>{t.current=e}),t}function pQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:l}=e,[i,u]=d.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);Lm(p,r)||m(r);const h=d.useRef(null),g=d.useRef(null),x=d.useRef(i),y=lk(s),b=lk(o),[C,S]=d.useState(null),[_,j]=d.useState(null),E=d.useCallback(O=>{h.current!==O&&(h.current=O,S(O))},[]),I=d.useCallback(O=>{g.current!==O&&(g.current=O,j(O))},[]),M=d.useCallback(()=>{if(!h.current||!g.current)return;const O={placement:t,strategy:n,middleware:p};b.current&&(O.platform=b.current),dQ(h.current,g.current,O).then($=>{const X={...$,isPositioned:!0};D.current&&!Lm(x.current,X)&&(x.current=X,Kr.flushSync(()=>{u(X)}))})},[p,t,n,b]);Kp(()=>{l===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,u(O=>({...O,isPositioned:!1})))},[l]);const D=d.useRef(!1);Kp(()=>(D.current=!0,()=>{D.current=!1}),[]),Kp(()=>{if(C&&_){if(y.current)return y.current(C,_,M);M()}},[C,_,M,y]);const R=d.useMemo(()=>({reference:h,floating:g,setReference:E,setFloating:I}),[E,I]),A=d.useMemo(()=>({reference:C,floating:_}),[C,_]);return d.useMemo(()=>({...i,update:M,refs:R,elements:A,reference:E,floating:I}),[i,M,R,A,E,I])}var mQ=typeof document<"u"?d.useLayoutEffect:d.useEffect;function hQ(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const gQ=d.createContext(null),vQ=()=>d.useContext(gQ);function xQ(e){return(e==null?void 0:e.ownerDocument)||document}function bQ(e){return xQ(e).defaultView||window}function gp(e){return e?e instanceof bQ(e).Element:!1}const yQ=Wx["useInsertionEffect".toString()],CQ=yQ||(e=>e());function wQ(e){const t=d.useRef(()=>{});return CQ(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function SQ(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=pQ(e),s=vQ(),l=d.useRef(null),i=d.useRef({}),u=d.useState(()=>hQ())[0],[p,m]=d.useState(null),h=d.useCallback(S=>{const _=gp(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;o.refs.setReference(_)},[o.refs]),g=d.useCallback(S=>{(gp(S)||S===null)&&(l.current=S,m(S)),(gp(o.refs.reference.current)||o.refs.reference.current===null||S!==null&&!gp(S))&&o.refs.setReference(S)},[o.refs]),x=d.useMemo(()=>({...o.refs,setReference:g,setPositionReference:h,domReference:l}),[o.refs,g,h]),y=d.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),b=wQ(n),C=d.useMemo(()=>({...o,refs:x,elements:y,dataRef:i,nodeId:r,events:u,open:t,onOpenChange:b}),[o,r,u,t,b,x,y]);return mQ(()=>{const S=s==null?void 0:s.nodesRef.current.find(_=>_.id===r);S&&(S.context=C)}),d.useMemo(()=>({...o,context:C,refs:x,reference:g,positionReference:h}),[o,x,C,g,h])}function kQ({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=d.useState(0);d.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return uQ(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Go(()=>{t.update()},r),Go(()=>{s(l=>l+1)},[e])}function _Q(e){const t=[nQ(e.offset)];return e.middlewares.shift&&t.push(rQ({limiter:oQ()})),e.middlewares.flip&&t.push(eQ()),e.middlewares.inline&&t.push(tQ()),t.push(fQ({element:e.arrowRef,padding:e.arrowOffset})),t}function jQ(e){const[t,n]=ld({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var l;(l=e.onClose)==null||l.call(e),n(!1)},o=()=>{var l,i;t?((l=e.onClose)==null||l.call(e),n(!1)):((i=e.onOpen)==null||i.call(e),n(!0))},s=SQ({placement:e.position,middleware:[..._Q(e),...e.width==="target"?[sQ({apply({rects:l}){var i,u;Object.assign((u=(i=s.refs.floating.current)==null?void 0:i.style)!=null?u:{},{width:`${l.reference.width}px`})}})]:[]]});return kQ({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),Go(()=>{var l;(l=e.onPositionChange)==null||l.call(e,s.placement)},[s.placement]),Go(()=>{var l,i;e.opened?(i=e.onOpen)==null||i.call(e):(l=e.onClose)==null||l.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const aE={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[IQ,lE]=mG(aE.context);var PQ=Object.defineProperty,EQ=Object.defineProperties,MQ=Object.getOwnPropertyDescriptors,zm=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,cE=Object.prototype.propertyIsEnumerable,ik=(e,t,n)=>t in e?PQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vp=(e,t)=>{for(var n in t||(t={}))iE.call(t,n)&&ik(e,n,t[n]);if(zm)for(var n of zm(t))cE.call(t,n)&&ik(e,n,t[n]);return e},OQ=(e,t)=>EQ(e,MQ(t)),DQ=(e,t)=>{var n={};for(var r in e)iE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zm)for(var r of zm(e))t.indexOf(r)<0&&cE.call(e,r)&&(n[r]=e[r]);return n};const RQ={refProp:"ref",popupType:"dialog"},uE=d.forwardRef((e,t)=>{const n=Dn("PopoverTarget",RQ,e),{children:r,refProp:o,popupType:s}=n,l=DQ(n,["children","refProp","popupType"]);if(!LP(r))throw new Error(aE.children);const i=l,u=lE(),p=Wd(u.reference,r.ref,t),m=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return d.cloneElement(r,vp(OQ(vp(vp(vp({},i),m),u.targetProps),{className:FP(u.targetProps.className,i.className,r.props.className),[o]:p}),u.controlled?null:{onClick:u.onToggle}))});uE.displayName="@mantine/core/PopoverTarget";var AQ=fr((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${De(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${De(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const TQ=AQ;var $Q=Object.defineProperty,ck=Object.getOwnPropertySymbols,NQ=Object.prototype.hasOwnProperty,LQ=Object.prototype.propertyIsEnumerable,uk=(e,t,n)=>t in e?$Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Li=(e,t)=>{for(var n in t||(t={}))NQ.call(t,n)&&uk(e,n,t[n]);if(ck)for(var n of ck(t))LQ.call(t,n)&&uk(e,n,t[n]);return e};const dk={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function zQ({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in cp?Li(Li(Li({transitionProperty:cp[e].transitionProperty},o),cp[e].common),cp[e][dk[t]]):null:Li(Li(Li({transitionProperty:e.transitionProperty},o),e.common),e[dk[t]])}function FQ({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:l,onExited:i}){const u=xa(),p=KP(),m=u.respectReducedMotion?p:!1,[h,g]=d.useState(m?0:e),[x,y]=d.useState(r?"entered":"exited"),b=d.useRef(-1),C=S=>{const _=S?o:s,j=S?l:i;y(S?"pre-entering":"pre-exiting"),window.clearTimeout(b.current);const E=m?0:S?e:t;if(g(E),E===0)typeof _=="function"&&_(),typeof j=="function"&&j(),y(S?"entered":"exited");else{const I=window.setTimeout(()=>{typeof _=="function"&&_(),y(S?"entering":"exiting")},10);b.current=window.setTimeout(()=>{window.clearTimeout(I),typeof j=="function"&&j(),y(S?"entered":"exited")},E)}};return Go(()=>{C(r)},[r]),d.useEffect(()=>()=>window.clearTimeout(b.current),[]),{transitionDuration:h,transitionStatus:x,transitionTimingFunction:n||u.transitionTimingFunction}}function dE({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:l,onExit:i,onEntered:u,onEnter:p,onExited:m}){const{transitionDuration:h,transitionStatus:g,transitionTimingFunction:x}=FQ({mounted:o,exitDuration:r,duration:n,timingFunction:l,onExit:i,onEntered:u,onEnter:p,onExited:m});return h===0?o?H.createElement(H.Fragment,null,s({})):e?s({display:"none"}):null:g==="exited"?e?s({display:"none"}):null:H.createElement(H.Fragment,null,s(zQ({transition:t,duration:h,state:g,timingFunction:x})))}dE.displayName="@mantine/core/Transition";function fE({children:e,active:t=!0,refProp:n="ref"}){const r=qG(t),o=Wd(r,e==null?void 0:e.ref);return LP(e)?d.cloneElement(e,{[n]:o}):e}fE.displayName="@mantine/core/FocusTrap";var BQ=Object.defineProperty,HQ=Object.defineProperties,VQ=Object.getOwnPropertyDescriptors,fk=Object.getOwnPropertySymbols,WQ=Object.prototype.hasOwnProperty,UQ=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?BQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$a=(e,t)=>{for(var n in t||(t={}))WQ.call(t,n)&&pk(e,n,t[n]);if(fk)for(var n of fk(t))UQ.call(t,n)&&pk(e,n,t[n]);return e},xp=(e,t)=>HQ(e,VQ(t));function mk(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function hk(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const GQ={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function KQ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:l,dir:i}){const[u,p="center"]=e.split("-"),m={width:De(t),height:De(t),transform:"rotate(45deg)",position:"absolute",[GQ[u]]:De(r)},h=De(-t/2);return u==="left"?xp($a($a({},m),mk(p,l,n,o)),{right:h,borderLeftColor:"transparent",borderBottomColor:"transparent"}):u==="right"?xp($a($a({},m),mk(p,l,n,o)),{left:h,borderRightColor:"transparent",borderTopColor:"transparent"}):u==="top"?xp($a($a({},m),hk(p,s,n,o,i)),{bottom:h,borderTopColor:"transparent",borderLeftColor:"transparent"}):u==="bottom"?xp($a($a({},m),hk(p,s,n,o,i)),{top:h,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var qQ=Object.defineProperty,XQ=Object.defineProperties,QQ=Object.getOwnPropertyDescriptors,Fm=Object.getOwnPropertySymbols,pE=Object.prototype.hasOwnProperty,mE=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?qQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YQ=(e,t)=>{for(var n in t||(t={}))pE.call(t,n)&&gk(e,n,t[n]);if(Fm)for(var n of Fm(t))mE.call(t,n)&&gk(e,n,t[n]);return e},ZQ=(e,t)=>XQ(e,QQ(t)),JQ=(e,t)=>{var n={};for(var r in e)pE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fm)for(var r of Fm(e))t.indexOf(r)<0&&mE.call(e,r)&&(n[r]=e[r]);return n};const hE=d.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:l,arrowPosition:i,visible:u,arrowX:p,arrowY:m}=n,h=JQ(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const g=xa();return u?H.createElement("div",ZQ(YQ({},h),{ref:t,style:KQ({position:r,arrowSize:o,arrowOffset:s,arrowRadius:l,arrowPosition:i,dir:g.dir,arrowX:p,arrowY:m})})):null});hE.displayName="@mantine/core/FloatingArrow";var eY=Object.defineProperty,tY=Object.defineProperties,nY=Object.getOwnPropertyDescriptors,Bm=Object.getOwnPropertySymbols,gE=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable,vk=(e,t,n)=>t in e?eY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zi=(e,t)=>{for(var n in t||(t={}))gE.call(t,n)&&vk(e,n,t[n]);if(Bm)for(var n of Bm(t))vE.call(t,n)&&vk(e,n,t[n]);return e},bp=(e,t)=>tY(e,nY(t)),rY=(e,t)=>{var n={};for(var r in e)gE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bm)for(var r of Bm(e))t.indexOf(r)<0&&vE.call(e,r)&&(n[r]=e[r]);return n};const oY={};function xE(e){var t;const n=Dn("PopoverDropdown",oY,e),{style:r,className:o,children:s,onKeyDownCapture:l}=n,i=rY(n,["style","className","children","onKeyDownCapture"]),u=lE(),{classes:p,cx:m}=TQ({radius:u.radius,shadow:u.shadow},{name:u.__staticSelector,classNames:u.classNames,styles:u.styles,unstyled:u.unstyled,variant:u.variant}),h=BG({opened:u.opened,shouldReturnFocus:u.returnFocus}),g=u.withRoles?{"aria-labelledby":u.getTargetId(),id:u.getDropdownId(),role:"dialog"}:{};return u.disabled?null:H.createElement(x6,bp(zi({},u.portalProps),{withinPortal:u.withinPortal}),H.createElement(dE,bp(zi({mounted:u.opened},u.transitionProps),{transition:u.transitionProps.transition||"fade",duration:(t=u.transitionProps.duration)!=null?t:150,keepMounted:u.keepMounted,exitDuration:typeof u.transitionProps.exitDuration=="number"?u.transitionProps.exitDuration:u.transitionProps.duration}),x=>{var y,b;return H.createElement(fE,{active:u.trapFocus},H.createElement(zr,zi(bp(zi({},g),{tabIndex:-1,ref:u.floating,style:bp(zi(zi({},r),x),{zIndex:u.zIndex,top:(y=u.y)!=null?y:0,left:(b=u.x)!=null?b:0,width:u.width==="target"?void 0:De(u.width)}),className:m(p.dropdown,o),onKeyDownCapture:gG(u.onClose,{active:u.closeOnEscape,onTrigger:h,onKeyDown:l}),"data-position":u.placement}),i),s,H.createElement(hE,{ref:u.arrowRef,arrowX:u.arrowX,arrowY:u.arrowY,visible:u.withArrow,position:u.placement,arrowSize:u.arrowSize,arrowRadius:u.arrowRadius,arrowOffset:u.arrowOffset,arrowPosition:u.arrowPosition,className:p.arrow})))}))}xE.displayName="@mantine/core/PopoverDropdown";function sY(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var xk=Object.getOwnPropertySymbols,aY=Object.prototype.hasOwnProperty,lY=Object.prototype.propertyIsEnumerable,iY=(e,t)=>{var n={};for(var r in e)aY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xk)for(var r of xk(e))t.indexOf(r)<0&&lY.call(e,r)&&(n[r]=e[r]);return n};const cY={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:sy("popover"),__staticSelector:"Popover",width:"max-content"};function Wc(e){var t,n,r,o,s,l;const i=d.useRef(null),u=Dn("Popover",cY,e),{children:p,position:m,offset:h,onPositionChange:g,positionDependencies:x,opened:y,transitionProps:b,width:C,middlewares:S,withArrow:_,arrowSize:j,arrowOffset:E,arrowRadius:I,arrowPosition:M,unstyled:D,classNames:R,styles:A,closeOnClickOutside:O,withinPortal:$,portalProps:X,closeOnEscape:z,clickOutsideEvents:V,trapFocus:Q,onClose:G,onOpen:F,onChange:U,zIndex:T,radius:B,shadow:Y,id:re,defaultOpened:ae,__staticSelector:oe,withRoles:q,disabled:K,returnFocus:ee,variant:ce,keepMounted:J}=u,ie=iY(u,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[de,xe]=d.useState(null),[we,ve]=d.useState(null),fe=ly(re),Oe=xa(),je=jQ({middlewares:S,width:C,position:sY(Oe.dir,m),offset:typeof h=="number"?h+(_?j/2:0):h,arrowRef:i,arrowOffset:E,onPositionChange:g,positionDependencies:x,opened:y,defaultOpened:ae,onChange:U,onOpen:F,onClose:G});NG(()=>je.opened&&O&&je.onClose(),V,[de,we]);const $e=d.useCallback(Ve=>{xe(Ve),je.floating.reference(Ve)},[je.floating.reference]),st=d.useCallback(Ve=>{ve(Ve),je.floating.floating(Ve)},[je.floating.floating]);return H.createElement(IQ,{value:{returnFocus:ee,disabled:K,controlled:je.controlled,reference:$e,floating:st,x:je.floating.x,y:je.floating.y,arrowX:(r=(n=(t=je.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(l=(s=(o=je.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:l.y,opened:je.opened,arrowRef:i,transitionProps:b,width:C,withArrow:_,arrowSize:j,arrowOffset:E,arrowRadius:I,arrowPosition:M,placement:je.floating.placement,trapFocus:Q,withinPortal:$,portalProps:X,zIndex:T,radius:B,shadow:Y,closeOnEscape:z,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${fe}-target`,getDropdownId:()=>`${fe}-dropdown`,withRoles:q,targetProps:ie,__staticSelector:oe,classNames:R,styles:A,unstyled:D,variant:ce,keepMounted:J}},p)}Wc.Target=uE;Wc.Dropdown=xE;Wc.displayName="@mantine/core/Popover";var uY=Object.defineProperty,Hm=Object.getOwnPropertySymbols,bE=Object.prototype.hasOwnProperty,yE=Object.prototype.propertyIsEnumerable,bk=(e,t,n)=>t in e?uY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dY=(e,t)=>{for(var n in t||(t={}))bE.call(t,n)&&bk(e,n,t[n]);if(Hm)for(var n of Hm(t))yE.call(t,n)&&bk(e,n,t[n]);return e},fY=(e,t)=>{var n={};for(var r in e)bE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hm)for(var r of Hm(e))t.indexOf(r)<0&&yE.call(e,r)&&(n[r]=e[r]);return n};function pY(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:l,innerRef:i,__staticSelector:u,styles:p,classNames:m,unstyled:h}=t,g=fY(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:x}=qX(null,{name:u,styles:p,classNames:m,unstyled:h});return H.createElement(Wc.Dropdown,dY({p:0,onMouseDown:y=>y.preventDefault()},g),H.createElement("div",{style:{maxHeight:De(o),display:"flex"}},H.createElement(zr,{component:r||"div",id:`${l}-items`,"aria-labelledby":`${l}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==lg?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:i},H.createElement("div",{className:x.itemsWrapper,style:{flexDirection:s}},n))))}function Ka({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:l,onDirectionChange:i,switchDirectionOnFlip:u,zIndex:p,dropdownPosition:m,positionDependencies:h=[],classNames:g,styles:x,unstyled:y,readOnly:b,variant:C}){return H.createElement(Wc,{unstyled:y,classNames:g,styles:x,width:"target",withRoles:!1,opened:e,middlewares:{flip:m==="flip",shift:!1},position:m==="flip"?"bottom":m,positionDependencies:h,zIndex:p,__staticSelector:l,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:b,onPositionChange:S=>u&&(i==null?void 0:i(S==="top"?"column-reverse":"column")),variant:C},s)}Ka.Target=Wc.Target;Ka.Dropdown=pY;var mY=Object.defineProperty,hY=Object.defineProperties,gY=Object.getOwnPropertyDescriptors,Vm=Object.getOwnPropertySymbols,CE=Object.prototype.hasOwnProperty,wE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yp=(e,t)=>{for(var n in t||(t={}))CE.call(t,n)&&yk(e,n,t[n]);if(Vm)for(var n of Vm(t))wE.call(t,n)&&yk(e,n,t[n]);return e},vY=(e,t)=>hY(e,gY(t)),xY=(e,t)=>{var n={};for(var r in e)CE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vm)for(var r of Vm(e))t.indexOf(r)<0&&wE.call(e,r)&&(n[r]=e[r]);return n};function SE(e,t,n){const r=Dn(e,t,n),{label:o,description:s,error:l,required:i,classNames:u,styles:p,className:m,unstyled:h,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:C,wrapperProps:S,id:_,size:j,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:D,variant:R}=r,A=xY(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),O=ly(_),{systemStyles:$,rest:X}=rg(A),z=yp({label:o,description:s,error:l,required:i,classNames:u,className:m,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:C,unstyled:h,styles:p,id:O,size:j,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:D,variant:R},S);return vY(yp({},X),{classNames:u,styles:p,unstyled:h,wrapperProps:yp(yp({},z),$),inputProps:{required:i,classNames:u,styles:p,unstyled:h,id:O,size:j,__staticSelector:g,error:l,variant:R}})}var bY=fr((e,t,{size:n})=>({label:{display:"inline-block",fontSize:mt({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const yY=bY;var CY=Object.defineProperty,Wm=Object.getOwnPropertySymbols,kE=Object.prototype.hasOwnProperty,_E=Object.prototype.propertyIsEnumerable,Ck=(e,t,n)=>t in e?CY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wY=(e,t)=>{for(var n in t||(t={}))kE.call(t,n)&&Ck(e,n,t[n]);if(Wm)for(var n of Wm(t))_E.call(t,n)&&Ck(e,n,t[n]);return e},SY=(e,t)=>{var n={};for(var r in e)kE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wm)for(var r of Wm(e))t.indexOf(r)<0&&_E.call(e,r)&&(n[r]=e[r]);return n};const kY={labelElement:"label",size:"sm"},gy=d.forwardRef((e,t)=>{const n=Dn("InputLabel",kY,e),{labelElement:r,children:o,required:s,size:l,classNames:i,styles:u,unstyled:p,className:m,htmlFor:h,__staticSelector:g,variant:x,onMouseDown:y}=n,b=SY(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:C,cx:S}=yY(null,{name:["InputWrapper",g],classNames:i,styles:u,unstyled:p,variant:x,size:l});return H.createElement(zr,wY({component:r,ref:t,className:S(C.label,m),htmlFor:r==="label"?h:void 0,onMouseDown:_=>{y==null||y(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()}},b),o,s&&H.createElement("span",{className:C.required,"aria-hidden":!0}," *"))});gy.displayName="@mantine/core/InputLabel";var _Y=fr((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${De(2)})`,lineHeight:1.2,display:"block"}}));const jY=_Y;var IY=Object.defineProperty,Um=Object.getOwnPropertySymbols,jE=Object.prototype.hasOwnProperty,IE=Object.prototype.propertyIsEnumerable,wk=(e,t,n)=>t in e?IY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PY=(e,t)=>{for(var n in t||(t={}))jE.call(t,n)&&wk(e,n,t[n]);if(Um)for(var n of Um(t))IE.call(t,n)&&wk(e,n,t[n]);return e},EY=(e,t)=>{var n={};for(var r in e)jE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Um)for(var r of Um(e))t.indexOf(r)<0&&IE.call(e,r)&&(n[r]=e[r]);return n};const MY={size:"sm"},vy=d.forwardRef((e,t)=>{const n=Dn("InputError",MY,e),{children:r,className:o,classNames:s,styles:l,unstyled:i,size:u,__staticSelector:p,variant:m}=n,h=EY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=jY(null,{name:["InputWrapper",p],classNames:s,styles:l,unstyled:i,variant:m,size:u});return H.createElement(kc,PY({className:x(g.error,o),ref:t},h),r)});vy.displayName="@mantine/core/InputError";var OY=fr((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${De(2)})`,lineHeight:1.2,display:"block"}}));const DY=OY;var RY=Object.defineProperty,Gm=Object.getOwnPropertySymbols,PE=Object.prototype.hasOwnProperty,EE=Object.prototype.propertyIsEnumerable,Sk=(e,t,n)=>t in e?RY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,AY=(e,t)=>{for(var n in t||(t={}))PE.call(t,n)&&Sk(e,n,t[n]);if(Gm)for(var n of Gm(t))EE.call(t,n)&&Sk(e,n,t[n]);return e},TY=(e,t)=>{var n={};for(var r in e)PE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gm)for(var r of Gm(e))t.indexOf(r)<0&&EE.call(e,r)&&(n[r]=e[r]);return n};const $Y={size:"sm"},xy=d.forwardRef((e,t)=>{const n=Dn("InputDescription",$Y,e),{children:r,className:o,classNames:s,styles:l,unstyled:i,size:u,__staticSelector:p,variant:m}=n,h=TY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=DY(null,{name:["InputWrapper",p],classNames:s,styles:l,unstyled:i,variant:m,size:u});return H.createElement(kc,AY({color:"dimmed",className:x(g.description,o),ref:t,unstyled:i},h),r)});xy.displayName="@mantine/core/InputDescription";const ME=d.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),NY=ME.Provider,LY=()=>d.useContext(ME);function zY(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="input"),o=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var FY=Object.defineProperty,BY=Object.defineProperties,HY=Object.getOwnPropertyDescriptors,kk=Object.getOwnPropertySymbols,VY=Object.prototype.hasOwnProperty,WY=Object.prototype.propertyIsEnumerable,_k=(e,t,n)=>t in e?FY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UY=(e,t)=>{for(var n in t||(t={}))VY.call(t,n)&&_k(e,n,t[n]);if(kk)for(var n of kk(t))WY.call(t,n)&&_k(e,n,t[n]);return e},GY=(e,t)=>BY(e,HY(t)),KY=fr(e=>({root:GY(UY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const qY=KY;var XY=Object.defineProperty,QY=Object.defineProperties,YY=Object.getOwnPropertyDescriptors,Km=Object.getOwnPropertySymbols,OE=Object.prototype.hasOwnProperty,DE=Object.prototype.propertyIsEnumerable,jk=(e,t,n)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Na=(e,t)=>{for(var n in t||(t={}))OE.call(t,n)&&jk(e,n,t[n]);if(Km)for(var n of Km(t))DE.call(t,n)&&jk(e,n,t[n]);return e},Ik=(e,t)=>QY(e,YY(t)),ZY=(e,t)=>{var n={};for(var r in e)OE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Km)for(var r of Km(e))t.indexOf(r)<0&&DE.call(e,r)&&(n[r]=e[r]);return n};const JY={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},RE=d.forwardRef((e,t)=>{const n=Dn("InputWrapper",JY,e),{className:r,label:o,children:s,required:l,id:i,error:u,description:p,labelElement:m,labelProps:h,descriptionProps:g,errorProps:x,classNames:y,styles:b,size:C,inputContainer:S,__staticSelector:_,unstyled:j,inputWrapperOrder:E,withAsterisk:I,variant:M}=n,D=ZY(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:R,cx:A}=qY(null,{classNames:y,styles:b,name:["InputWrapper",_],unstyled:j,variant:M,size:C}),O={classNames:y,styles:b,unstyled:j,size:C,variant:M,__staticSelector:_},$=typeof I=="boolean"?I:l,X=i?`${i}-error`:x==null?void 0:x.id,z=i?`${i}-description`:g==null?void 0:g.id,Q=`${!!u&&typeof u!="boolean"?X:""} ${p?z:""}`,G=Q.trim().length>0?Q.trim():void 0,F=o&&H.createElement(gy,Na(Na({key:"label",labelElement:m,id:i?`${i}-label`:void 0,htmlFor:i,required:$},O),h),o),U=p&&H.createElement(xy,Ik(Na(Na({key:"description"},g),O),{size:(g==null?void 0:g.size)||O.size,id:(g==null?void 0:g.id)||z}),p),T=H.createElement(d.Fragment,{key:"input"},S(s)),B=typeof u!="boolean"&&u&&H.createElement(vy,Ik(Na(Na({},x),O),{size:(x==null?void 0:x.size)||O.size,key:"error",id:(x==null?void 0:x.id)||X}),u),Y=E.map(re=>{switch(re){case"label":return F;case"input":return T;case"description":return U;case"error":return B;default:return null}});return H.createElement(NY,{value:Na({describedBy:G},zY(E,{hasDescription:!!U,hasError:!!B}))},H.createElement(zr,Na({className:A(R.root,r),ref:t},D),Y))});RE.displayName="@mantine/core/InputWrapper";var eZ=Object.defineProperty,qm=Object.getOwnPropertySymbols,AE=Object.prototype.hasOwnProperty,TE=Object.prototype.propertyIsEnumerable,Pk=(e,t,n)=>t in e?eZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tZ=(e,t)=>{for(var n in t||(t={}))AE.call(t,n)&&Pk(e,n,t[n]);if(qm)for(var n of qm(t))TE.call(t,n)&&Pk(e,n,t[n]);return e},nZ=(e,t)=>{var n={};for(var r in e)AE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qm)for(var r of qm(e))t.indexOf(r)<0&&TE.call(e,r)&&(n[r]=e[r]);return n};const rZ={},$E=d.forwardRef((e,t)=>{const n=Dn("InputPlaceholder",rZ,e),{sx:r}=n,o=nZ(n,["sx"]);return H.createElement(zr,tZ({component:"span",sx:[s=>s.fn.placeholderStyles(),...$P(r)],ref:t},o))});$E.displayName="@mantine/core/InputPlaceholder";var oZ=Object.defineProperty,sZ=Object.defineProperties,aZ=Object.getOwnPropertyDescriptors,Ek=Object.getOwnPropertySymbols,lZ=Object.prototype.hasOwnProperty,iZ=Object.prototype.propertyIsEnumerable,Mk=(e,t,n)=>t in e?oZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cp=(e,t)=>{for(var n in t||(t={}))lZ.call(t,n)&&Mk(e,n,t[n]);if(Ek)for(var n of Ek(t))iZ.call(t,n)&&Mk(e,n,t[n]);return e},Ov=(e,t)=>sZ(e,aZ(t));const uo={xs:De(30),sm:De(36),md:De(42),lg:De(50),xl:De(60)},cZ=["default","filled","unstyled"];function uZ({theme:e,variant:t}){return cZ.includes(t)?t==="default"?{border:`${De(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${De(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:De(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var dZ=fr((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:l,offsetBottom:i,offsetTop:u,pointer:p},{variant:m,size:h})=>{const g=e.fn.variant({variant:"filled",color:"red"}).background,x=m==="default"||m==="filled"?{minHeight:mt({size:h,sizes:uo}),paddingLeft:`calc(${mt({size:h,sizes:uo})}  / 3)`,paddingRight:s?o||mt({size:h,sizes:uo}):`calc(${mt({size:h,sizes:uo})}  / 3)`,borderRadius:e.fn.radius(n)}:m==="unstyled"&&s?{paddingRight:o||mt({size:h,sizes:uo})}:null;return{wrapper:{position:"relative",marginTop:u?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:i?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:Ov(Cp(Cp(Ov(Cp({},e.fn.fontStyles()),{height:t?m==="unstyled"?void 0:"auto":mt({size:h,sizes:uo}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${mt({size:h,sizes:uo})} - ${De(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:mt({size:h,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:p?"pointer":void 0}),uZ({theme:e,variant:m})),x),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:g,borderColor:g,"&::placeholder":{opacity:1,color:g}},"&[data-with-icon]":{paddingLeft:typeof l=="number"?De(l):mt({size:h,sizes:uo})},"&::placeholder":Ov(Cp({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:l?De(l):mt({size:h,sizes:uo}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||mt({size:h,sizes:uo})}}});const fZ=dZ;var pZ=Object.defineProperty,mZ=Object.defineProperties,hZ=Object.getOwnPropertyDescriptors,Xm=Object.getOwnPropertySymbols,NE=Object.prototype.hasOwnProperty,LE=Object.prototype.propertyIsEnumerable,Ok=(e,t,n)=>t in e?pZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wp=(e,t)=>{for(var n in t||(t={}))NE.call(t,n)&&Ok(e,n,t[n]);if(Xm)for(var n of Xm(t))LE.call(t,n)&&Ok(e,n,t[n]);return e},Dk=(e,t)=>mZ(e,hZ(t)),gZ=(e,t)=>{var n={};for(var r in e)NE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xm)for(var r of Xm(e))t.indexOf(r)<0&&LE.call(e,r)&&(n[r]=e[r]);return n};const vZ={size:"sm",variant:"default"},li=d.forwardRef((e,t)=>{const n=Dn("Input",vZ,e),{className:r,error:o,required:s,disabled:l,variant:i,icon:u,style:p,rightSectionWidth:m,iconWidth:h,rightSection:g,rightSectionProps:x,radius:y,size:b,wrapperProps:C,classNames:S,styles:_,__staticSelector:j,multiline:E,sx:I,unstyled:M,pointer:D}=n,R=gZ(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:A,offsetTop:O,describedBy:$}=LY(),{classes:X,cx:z}=fZ({radius:y,multiline:E,invalid:!!o,rightSectionWidth:m?De(m):void 0,iconWidth:h,withRightSection:!!g,offsetBottom:A,offsetTop:O,pointer:D},{classNames:S,styles:_,name:["Input",j],unstyled:M,variant:i,size:b}),{systemStyles:V,rest:Q}=rg(R);return H.createElement(zr,wp(wp({className:z(X.wrapper,r),sx:I,style:p},V),C),u&&H.createElement("div",{className:X.icon},u),H.createElement(zr,Dk(wp({component:"input"},Q),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":$,disabled:l,"data-disabled":l||void 0,"data-with-icon":!!u||void 0,"data-invalid":!!o||void 0,className:X.input})),g&&H.createElement("div",Dk(wp({},x),{className:X.rightSection}),g))});li.displayName="@mantine/core/Input";li.Wrapper=RE;li.Label=gy;li.Description=xy;li.Error=vy;li.Placeholder=$E;const Pc=li;var xZ=Object.defineProperty,Qm=Object.getOwnPropertySymbols,zE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,Rk=(e,t,n)=>t in e?xZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ak=(e,t)=>{for(var n in t||(t={}))zE.call(t,n)&&Rk(e,n,t[n]);if(Qm)for(var n of Qm(t))FE.call(t,n)&&Rk(e,n,t[n]);return e},bZ=(e,t)=>{var n={};for(var r in e)zE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qm)for(var r of Qm(e))t.indexOf(r)<0&&FE.call(e,r)&&(n[r]=e[r]);return n};const yZ={multiple:!1},BE=d.forwardRef((e,t)=>{const n=Dn("FileButton",yZ,e),{onChange:r,children:o,multiple:s,accept:l,name:i,form:u,resetRef:p,disabled:m,capture:h,inputProps:g}=n,x=bZ(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=d.useRef(),b=()=>{!m&&y.current.click()},C=_=>{r(s?Array.from(_.currentTarget.files):_.currentTarget.files[0]||null)};return GP(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(Ak({onClick:b},x)),H.createElement("input",Ak({style:{display:"none"},type:"file",accept:l,multiple:s,onChange:C,ref:Wd(t,y),name:i,form:u,capture:h},g)))});BE.displayName="@mantine/core/FileButton";const HE={xs:De(16),sm:De(22),md:De(26),lg:De(30),xl:De(36)},CZ={xs:De(10),sm:De(12),md:De(14),lg:De(16),xl:De(18)};var wZ=fr((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:mt({size:o,sizes:HE}),paddingLeft:`calc(${mt({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?mt({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:mt({size:o,sizes:CZ}),borderRadius:mt({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${De(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${mt({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const SZ=wZ;var kZ=Object.defineProperty,Ym=Object.getOwnPropertySymbols,VE=Object.prototype.hasOwnProperty,WE=Object.prototype.propertyIsEnumerable,Tk=(e,t,n)=>t in e?kZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_Z=(e,t)=>{for(var n in t||(t={}))VE.call(t,n)&&Tk(e,n,t[n]);if(Ym)for(var n of Ym(t))WE.call(t,n)&&Tk(e,n,t[n]);return e},jZ=(e,t)=>{var n={};for(var r in e)VE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ym)for(var r of Ym(e))t.indexOf(r)<0&&WE.call(e,r)&&(n[r]=e[r]);return n};const IZ={xs:16,sm:22,md:24,lg:26,xl:30};function UE(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:l,disabled:i,readOnly:u,size:p,radius:m="sm",variant:h,unstyled:g}=t,x=jZ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:b}=SZ({disabled:i,readOnly:u,radius:m},{name:"MultiSelect",classNames:r,styles:o,unstyled:g,size:p,variant:h});return H.createElement("div",_Z({className:b(y.defaultValue,s)},x),H.createElement("span",{className:y.defaultValueLabel},n),!i&&!u&&H.createElement(_6,{"aria-hidden":!0,onMouseDown:l,size:IZ[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:g}))}UE.displayName="@mantine/core/MultiSelect/DefaultValue";function PZ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:l}){if(!t&&s.length===0)return e;if(!t){const u=[];for(let p=0;p<e.length;p+=1)(l||!s.some(m=>m===e[p].value&&!e[p].disabled))&&u.push(e[p]);return u}const i=[];for(let u=0;u<e.length&&(o(r,!l&&s.some(p=>p===e[u].value&&!e[u].disabled),e[u])&&i.push(e[u]),!(i.length>=n));u+=1);return i}var EZ=Object.defineProperty,Zm=Object.getOwnPropertySymbols,GE=Object.prototype.hasOwnProperty,KE=Object.prototype.propertyIsEnumerable,$k=(e,t,n)=>t in e?EZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nk=(e,t)=>{for(var n in t||(t={}))GE.call(t,n)&&$k(e,n,t[n]);if(Zm)for(var n of Zm(t))KE.call(t,n)&&$k(e,n,t[n]);return e},MZ=(e,t)=>{var n={};for(var r in e)GE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zm)for(var r of Zm(e))t.indexOf(r)<0&&KE.call(e,r)&&(n[r]=e[r]);return n};const OZ={xs:De(14),sm:De(18),md:De(20),lg:De(24),xl:De(28)};function DZ(e){var t=e,{size:n,error:r,style:o}=t,s=MZ(t,["size","error","style"]);const l=xa(),i=mt({size:n,sizes:OZ});return H.createElement("svg",Nk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Nk({color:r?l.colors.red[6]:l.colors.gray[6],width:i,height:i},o),"data-chevron":!0},s),H.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var RZ=Object.defineProperty,AZ=Object.defineProperties,TZ=Object.getOwnPropertyDescriptors,Lk=Object.getOwnPropertySymbols,$Z=Object.prototype.hasOwnProperty,NZ=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?RZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LZ=(e,t)=>{for(var n in t||(t={}))$Z.call(t,n)&&zk(e,n,t[n]);if(Lk)for(var n of Lk(t))NZ.call(t,n)&&zk(e,n,t[n]);return e},zZ=(e,t)=>AZ(e,TZ(t));function qE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(_6,zZ(LZ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(DZ,{error:o,size:r})}qE.displayName="@mantine/core/SelectRightSection";var FZ=Object.defineProperty,BZ=Object.defineProperties,HZ=Object.getOwnPropertyDescriptors,Jm=Object.getOwnPropertySymbols,XE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,Fk=(e,t,n)=>t in e?FZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dv=(e,t)=>{for(var n in t||(t={}))XE.call(t,n)&&Fk(e,n,t[n]);if(Jm)for(var n of Jm(t))QE.call(t,n)&&Fk(e,n,t[n]);return e},Bk=(e,t)=>BZ(e,HZ(t)),VZ=(e,t)=>{var n={};for(var r in e)XE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jm)for(var r of Jm(e))t.indexOf(r)<0&&QE.call(e,r)&&(n[r]=e[r]);return n};function YE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,l=VZ(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const i=typeof n=="function"?n(s):n;return{rightSection:!l.readOnly&&!(l.disabled&&l.shouldClear)&&H.createElement(qE,Dv({},l)),styles:Bk(Dv({},i),{rightSection:Bk(Dv({},i==null?void 0:i.rightSection),{pointerEvents:l.shouldClear?void 0:"none"})})}}var WZ=Object.defineProperty,UZ=Object.defineProperties,GZ=Object.getOwnPropertyDescriptors,Hk=Object.getOwnPropertySymbols,KZ=Object.prototype.hasOwnProperty,qZ=Object.prototype.propertyIsEnumerable,Vk=(e,t,n)=>t in e?WZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XZ=(e,t)=>{for(var n in t||(t={}))KZ.call(t,n)&&Vk(e,n,t[n]);if(Hk)for(var n of Hk(t))qZ.call(t,n)&&Vk(e,n,t[n]);return e},QZ=(e,t)=>UZ(e,GZ(t)),YZ=fr((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${mt({size:n,sizes:uo})} - ${De(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:mt({size:n,sizes:uo})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${De(2)}) calc(${e.spacing.xs} / 2)`},searchInput:QZ(XZ({},e.fn.fontStyles()),{flex:1,minWidth:De(60),backgroundColor:"transparent",border:0,outline:0,fontSize:mt({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:mt({size:n,sizes:HE}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const ZZ=YZ;var JZ=Object.defineProperty,eJ=Object.defineProperties,tJ=Object.getOwnPropertyDescriptors,eh=Object.getOwnPropertySymbols,ZE=Object.prototype.hasOwnProperty,JE=Object.prototype.propertyIsEnumerable,Wk=(e,t,n)=>t in e?JZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fi=(e,t)=>{for(var n in t||(t={}))ZE.call(t,n)&&Wk(e,n,t[n]);if(eh)for(var n of eh(t))JE.call(t,n)&&Wk(e,n,t[n]);return e},Uk=(e,t)=>eJ(e,tJ(t)),nJ=(e,t)=>{var n={};for(var r in e)ZE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&eh)for(var r of eh(e))t.indexOf(r)<0&&JE.call(e,r)&&(n[r]=e[r]);return n};function rJ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function oJ(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function Gk(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const sJ={size:"sm",valueComponent:UE,itemComponent:cy,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:rJ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:oJ,switchDirectionOnFlip:!1,zIndex:sy("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},eM=d.forwardRef((e,t)=>{const n=Dn("MultiSelect",sJ,e),{className:r,style:o,required:s,label:l,description:i,size:u,error:p,classNames:m,styles:h,wrapperProps:g,value:x,defaultValue:y,data:b,onChange:C,valueComponent:S,itemComponent:_,id:j,transitionProps:E,maxDropdownHeight:I,shadow:M,nothingFound:D,onFocus:R,onBlur:A,searchable:O,placeholder:$,filter:X,limit:z,clearSearchOnChange:V,clearable:Q,clearSearchOnBlur:G,variant:F,onSearchChange:U,searchValue:T,disabled:B,initiallyOpened:Y,radius:re,icon:ae,rightSection:oe,rightSectionWidth:q,creatable:K,getCreateLabel:ee,shouldCreate:ce,onCreate:J,sx:ie,dropdownComponent:de,onDropdownClose:xe,onDropdownOpen:we,maxSelectedValues:ve,withinPortal:fe,portalProps:Oe,switchDirectionOnFlip:je,zIndex:$e,selectOnBlur:st,name:Ve,dropdownPosition:Ct,errorProps:Ye,labelProps:Ke,descriptionProps:he,form:Re,positionDependencies:ut,onKeyDown:yt,unstyled:ye,inputContainer:et,inputWrapperOrder:ct,readOnly:ft,withAsterisk:Me,clearButtonProps:Ne,hoverOnSearchChange:Ut,disableSelectedItemFiltering:ke}=n,ze=nJ(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Le,cx:Ge,theme:pt}=ZZ({invalid:!!p},{name:"MultiSelect",classNames:m,styles:h,unstyled:ye,size:u,variant:F}),{systemStyles:Pn,rest:Rt}=rg(ze),At=d.useRef(),pr=d.useRef({}),Nn=ly(j),[wn,hn]=d.useState(Y),[an,_r]=d.useState(-1),[Mo,mr]=d.useState("column"),[hr,Ns]=ld({value:T,defaultValue:"",finalValue:void 0,onChange:U}),[Ls,Sa]=d.useState(!1),{scrollIntoView:ka,targetRef:mi,scrollableRef:_a}=qP({duration:0,offset:5,cancelable:!1,isList:!0}),hi=K&&typeof ee=="function";let Ze=null;const Gt=b.map(nt=>typeof nt=="string"?{label:nt,value:nt}:nt),Ln=NP({data:Gt}),[kt,ja]=ld({value:Gk(x,b),defaultValue:Gk(y,b),finalValue:[],onChange:C}),Vr=d.useRef(!!ve&&ve<kt.length),nf=nt=>{if(!ft){const Et=kt.filter(_t=>_t!==nt);ja(Et),ve&&Et.length<ve&&(Vr.current=!1)}},Hg=nt=>{Ns(nt.currentTarget.value),!B&&!Vr.current&&O&&hn(!0)},Vg=nt=>{typeof R=="function"&&R(nt),!B&&!Vr.current&&O&&hn(!0)},zn=PZ({data:Ln,searchable:O,searchValue:hr,limit:z,filter:X,value:kt,disableSelectedItemFiltering:ke});hi&&ce(hr,Ln)&&(Ze=ee(hr),zn.push({label:hr,value:hr,creatable:!0}));const zs=Math.min(an,zn.length-1),rf=(nt,Et,_t)=>{let Mt=nt;for(;_t(Mt);)if(Mt=Et(Mt),!zn[Mt].disabled)return Mt;return nt};Go(()=>{_r(Ut&&hr?0:-1)},[hr,Ut]),Go(()=>{!B&&kt.length>b.length&&hn(!1),ve&&kt.length<ve&&(Vr.current=!1),ve&&kt.length>=ve&&(Vr.current=!0,hn(!1))},[kt]);const gi=nt=>{if(!ft)if(V&&Ns(""),kt.includes(nt.value))nf(nt.value);else{if(nt.creatable&&typeof J=="function"){const Et=J(nt.value);typeof Et<"u"&&Et!==null&&ja(typeof Et=="string"?[...kt,Et]:[...kt,Et.value])}else ja([...kt,nt.value]);kt.length===ve-1&&(Vr.current=!0,hn(!1)),zn.length===1&&hn(!1)}},tu=nt=>{typeof A=="function"&&A(nt),st&&zn[zs]&&wn&&gi(zn[zs]),G&&Ns(""),hn(!1)},vl=nt=>{if(Ls||(yt==null||yt(nt),ft)||nt.key!=="Backspace"&&ve&&Vr.current)return;const Et=Mo==="column",_t=()=>{_r(nr=>{var rn;const Rn=rf(nr,gr=>gr+1,gr=>gr<zn.length-1);return wn&&(mi.current=pr.current[(rn=zn[Rn])==null?void 0:rn.value],ka({alignment:Et?"end":"start"})),Rn})},Mt=()=>{_r(nr=>{var rn;const Rn=rf(nr,gr=>gr-1,gr=>gr>0);return wn&&(mi.current=pr.current[(rn=zn[Rn])==null?void 0:rn.value],ka({alignment:Et?"start":"end"})),Rn})};switch(nt.key){case"ArrowUp":{nt.preventDefault(),hn(!0),Et?Mt():_t();break}case"ArrowDown":{nt.preventDefault(),hn(!0),Et?_t():Mt();break}case"Enter":{nt.preventDefault(),zn[zs]&&wn?gi(zn[zs]):hn(!0);break}case" ":{O||(nt.preventDefault(),zn[zs]&&wn?gi(zn[zs]):hn(!0));break}case"Backspace":{kt.length>0&&hr.length===0&&(ja(kt.slice(0,-1)),hn(!0),ve&&(Vr.current=!1));break}case"Home":{if(!O){nt.preventDefault(),wn||hn(!0);const nr=zn.findIndex(rn=>!rn.disabled);_r(nr),ka({alignment:Et?"end":"start"})}break}case"End":{if(!O){nt.preventDefault(),wn||hn(!0);const nr=zn.map(rn=>!!rn.disabled).lastIndexOf(!1);_r(nr),ka({alignment:Et?"end":"start"})}break}case"Escape":hn(!1)}},nu=kt.map(nt=>{let Et=Ln.find(_t=>_t.value===nt&&!_t.disabled);return!Et&&hi&&(Et={value:nt,label:nt}),Et}).filter(nt=>!!nt).map((nt,Et)=>H.createElement(S,Uk(Fi({},nt),{variant:F,disabled:B,className:Le.value,readOnly:ft,onRemove:_t=>{_t.preventDefault(),_t.stopPropagation(),nf(nt.value)},key:nt.value,size:u,styles:h,classNames:m,radius:re,index:Et}))),ru=nt=>kt.includes(nt),Wg=()=>{var nt;Ns(""),ja([]),(nt=At.current)==null||nt.focus(),ve&&(Vr.current=!1)},Ia=!ft&&(zn.length>0?wn:wn&&!!D);return Go(()=>{const nt=Ia?we:xe;typeof nt=="function"&&nt()},[Ia]),H.createElement(Pc.Wrapper,Fi(Fi({required:s,id:Nn,label:l,error:p,description:i,size:u,className:r,style:o,classNames:m,styles:h,__staticSelector:"MultiSelect",sx:ie,errorProps:Ye,descriptionProps:he,labelProps:Ke,inputContainer:et,inputWrapperOrder:ct,unstyled:ye,withAsterisk:Me,variant:F},Pn),g),H.createElement(Ka,{opened:Ia,transitionProps:E,shadow:"sm",withinPortal:fe,portalProps:Oe,__staticSelector:"MultiSelect",onDirectionChange:mr,switchDirectionOnFlip:je,zIndex:$e,dropdownPosition:Ct,positionDependencies:[...ut,hr],classNames:m,styles:h,unstyled:ye,variant:F},H.createElement(Ka.Target,null,H.createElement("div",{className:Le.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":wn&&Ia?`${Nn}-items`:null,"aria-controls":Nn,"aria-expanded":wn,onMouseLeave:()=>_r(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:Ve,value:kt.join(","),form:Re,disabled:B}),H.createElement(Pc,Fi({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:F,disabled:B,error:p,required:s,radius:re,icon:ae,unstyled:ye,onMouseDown:nt=>{var Et;nt.preventDefault(),!B&&!Vr.current&&hn(!wn),(Et=At.current)==null||Et.focus()},classNames:Uk(Fi({},m),{input:Ge({[Le.input]:!O},m==null?void 0:m.input)})},YE({theme:pt,rightSection:oe,rightSectionWidth:q,styles:h,size:u,shouldClear:Q&&kt.length>0,onClear:Wg,error:p,disabled:B,clearButtonProps:Ne,readOnly:ft})),H.createElement("div",{className:Le.values,"data-clearable":Q||void 0},nu,H.createElement("input",Fi({ref:Wd(t,At),type:"search",id:Nn,className:Ge(Le.searchInput,{[Le.searchInputPointer]:!O,[Le.searchInputInputHidden]:!wn&&kt.length>0||!O&&kt.length>0,[Le.searchInputEmpty]:kt.length===0}),onKeyDown:vl,value:hr,onChange:Hg,onFocus:Vg,onBlur:tu,readOnly:!O||Vr.current||ft,placeholder:kt.length===0?$:void 0,disabled:B,"data-mantine-stop-propagation":wn,autoComplete:"off",onCompositionStart:()=>Sa(!0),onCompositionEnd:()=>Sa(!1)},Rt)))))),H.createElement(Ka.Dropdown,{component:de||lg,maxHeight:I,direction:Mo,id:Nn,innerRef:_a,__staticSelector:"MultiSelect",classNames:m,styles:h},H.createElement(iy,{data:zn,hovered:zs,classNames:m,styles:h,uuid:Nn,__staticSelector:"MultiSelect",onItemHover:_r,onItemSelect:gi,itemsRefs:pr,itemComponent:_,size:u,nothingFound:D,isItemSelected:ru,creatable:K&&!!Ze,createLabel:Ze,unstyled:ye,variant:F}))))});eM.displayName="@mantine/core/MultiSelect";var aJ=Object.defineProperty,lJ=Object.defineProperties,iJ=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,tM=Object.prototype.hasOwnProperty,nM=Object.prototype.propertyIsEnumerable,Kk=(e,t,n)=>t in e?aJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rv=(e,t)=>{for(var n in t||(t={}))tM.call(t,n)&&Kk(e,n,t[n]);if(th)for(var n of th(t))nM.call(t,n)&&Kk(e,n,t[n]);return e},cJ=(e,t)=>lJ(e,iJ(t)),uJ=(e,t)=>{var n={};for(var r in e)tM.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&th)for(var r of th(e))t.indexOf(r)<0&&nM.call(e,r)&&(n[r]=e[r]);return n};const dJ={type:"text",size:"sm",__staticSelector:"TextInput"},rM=d.forwardRef((e,t)=>{const n=SE("TextInput",dJ,e),{inputProps:r,wrapperProps:o}=n,s=uJ(n,["inputProps","wrapperProps"]);return H.createElement(Pc.Wrapper,Rv({},o),H.createElement(Pc,cJ(Rv(Rv({},r),s),{ref:t})))});rM.displayName="@mantine/core/TextInput";function fJ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:l}){if(!t)return e;const i=s!=null&&e.find(p=>p.value===s)||null;if(i&&!l&&(i==null?void 0:i.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(i),m=p+n,h=m-e.length;return h>0?e.slice(p-h):e.slice(p,m)}return e}const u=[];for(let p=0;p<e.length&&(o(r,e[p])&&u.push(e[p]),!(u.length>=n));p+=1);return u}var pJ=fr(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const mJ=pJ;var hJ=Object.defineProperty,gJ=Object.defineProperties,vJ=Object.getOwnPropertyDescriptors,nh=Object.getOwnPropertySymbols,oM=Object.prototype.hasOwnProperty,sM=Object.prototype.propertyIsEnumerable,qk=(e,t,n)=>t in e?hJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eu=(e,t)=>{for(var n in t||(t={}))oM.call(t,n)&&qk(e,n,t[n]);if(nh)for(var n of nh(t))sM.call(t,n)&&qk(e,n,t[n]);return e},Av=(e,t)=>gJ(e,vJ(t)),xJ=(e,t)=>{var n={};for(var r in e)oM.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nh)for(var r of nh(e))t.indexOf(r)<0&&sM.call(e,r)&&(n[r]=e[r]);return n};function bJ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function yJ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const CJ={required:!1,size:"sm",shadow:"sm",itemComponent:cy,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:bJ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:yJ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:sy("popover"),positionDependencies:[],dropdownPosition:"flip"},by=d.forwardRef((e,t)=>{const n=SE("Select",CJ,e),{inputProps:r,wrapperProps:o,shadow:s,data:l,value:i,defaultValue:u,onChange:p,itemComponent:m,onKeyDown:h,onBlur:g,onFocus:x,transitionProps:y,initiallyOpened:b,unstyled:C,classNames:S,styles:_,filter:j,maxDropdownHeight:E,searchable:I,clearable:M,nothingFound:D,limit:R,disabled:A,onSearchChange:O,searchValue:$,rightSection:X,rightSectionWidth:z,creatable:V,getCreateLabel:Q,shouldCreate:G,selectOnBlur:F,onCreate:U,dropdownComponent:T,onDropdownClose:B,onDropdownOpen:Y,withinPortal:re,portalProps:ae,switchDirectionOnFlip:oe,zIndex:q,name:K,dropdownPosition:ee,allowDeselect:ce,placeholder:J,filterDataOnExactSearchMatch:ie,form:de,positionDependencies:xe,readOnly:we,clearButtonProps:ve,hoverOnSearchChange:fe}=n,Oe=xJ(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:je,cx:$e,theme:st}=mJ(),[Ve,Ct]=d.useState(b),[Ye,Ke]=d.useState(-1),he=d.useRef(),Re=d.useRef({}),[ut,yt]=d.useState("column"),ye=ut==="column",{scrollIntoView:et,targetRef:ct,scrollableRef:ft}=qP({duration:0,offset:5,cancelable:!1,isList:!0}),Me=ce===void 0?M:ce,Ne=Ze=>{if(Ve!==Ze){Ct(Ze);const Gt=Ze?Y:B;typeof Gt=="function"&&Gt()}},Ut=V&&typeof Q=="function";let ke=null;const ze=l.map(Ze=>typeof Ze=="string"?{label:Ze,value:Ze}:Ze),Le=NP({data:ze}),[Ge,pt,Pn]=ld({value:i,defaultValue:u,finalValue:null,onChange:p}),Rt=Le.find(Ze=>Ze.value===Ge),[At,pr]=ld({value:$,defaultValue:(Rt==null?void 0:Rt.label)||"",finalValue:void 0,onChange:O}),Nn=Ze=>{pr(Ze),I&&typeof O=="function"&&O(Ze)},wn=()=>{var Ze;we||(pt(null),Pn||Nn(""),(Ze=he.current)==null||Ze.focus())};d.useEffect(()=>{const Ze=Le.find(Gt=>Gt.value===Ge);Ze?Nn(Ze.label):(!Ut||!Ge)&&Nn("")},[Ge]),d.useEffect(()=>{Rt&&(!I||!Ve)&&Nn(Rt.label)},[Rt==null?void 0:Rt.label]);const hn=Ze=>{if(!we)if(Me&&(Rt==null?void 0:Rt.value)===Ze.value)pt(null),Ne(!1);else{if(Ze.creatable&&typeof U=="function"){const Gt=U(Ze.value);typeof Gt<"u"&&Gt!==null&&pt(typeof Gt=="string"?Gt:Gt.value)}else pt(Ze.value);Pn||Nn(Ze.label),Ke(-1),Ne(!1),he.current.focus()}},an=fJ({data:Le,searchable:I,limit:R,searchValue:At,filter:j,filterDataOnExactSearchMatch:ie,value:Ge});Ut&&G(At,an)&&(ke=Q(At),an.push({label:At,value:At,creatable:!0}));const _r=(Ze,Gt,Ln)=>{let kt=Ze;for(;Ln(kt);)if(kt=Gt(kt),!an[kt].disabled)return kt;return Ze};Go(()=>{Ke(fe&&At?0:-1)},[At,fe]);const Mo=Ge?an.findIndex(Ze=>Ze.value===Ge):0,mr=!we&&(an.length>0?Ve:Ve&&!!D),hr=()=>{Ke(Ze=>{var Gt;const Ln=_r(Ze,kt=>kt-1,kt=>kt>0);return ct.current=Re.current[(Gt=an[Ln])==null?void 0:Gt.value],mr&&et({alignment:ye?"start":"end"}),Ln})},Ns=()=>{Ke(Ze=>{var Gt;const Ln=_r(Ze,kt=>kt+1,kt=>kt<an.length-1);return ct.current=Re.current[(Gt=an[Ln])==null?void 0:Gt.value],mr&&et({alignment:ye?"end":"start"}),Ln})},Ls=()=>window.setTimeout(()=>{var Ze;ct.current=Re.current[(Ze=an[Mo])==null?void 0:Ze.value],et({alignment:ye?"end":"start"})},50);Go(()=>{mr&&Ls()},[mr]);const Sa=Ze=>{switch(typeof h=="function"&&h(Ze),Ze.key){case"ArrowUp":{Ze.preventDefault(),Ve?ye?hr():Ns():(Ke(Mo),Ne(!0),Ls());break}case"ArrowDown":{Ze.preventDefault(),Ve?ye?Ns():hr():(Ke(Mo),Ne(!0),Ls());break}case"Home":{if(!I){Ze.preventDefault(),Ve||Ne(!0);const Gt=an.findIndex(Ln=>!Ln.disabled);Ke(Gt),mr&&et({alignment:ye?"end":"start"})}break}case"End":{if(!I){Ze.preventDefault(),Ve||Ne(!0);const Gt=an.map(Ln=>!!Ln.disabled).lastIndexOf(!1);Ke(Gt),mr&&et({alignment:ye?"end":"start"})}break}case"Escape":{Ze.preventDefault(),Ne(!1),Ke(-1);break}case" ":{I||(Ze.preventDefault(),an[Ye]&&Ve?hn(an[Ye]):(Ne(!0),Ke(Mo),Ls()));break}case"Enter":I||Ze.preventDefault(),an[Ye]&&Ve&&(Ze.preventDefault(),hn(an[Ye]))}},ka=Ze=>{typeof g=="function"&&g(Ze);const Gt=Le.find(Ln=>Ln.value===Ge);F&&an[Ye]&&Ve&&hn(an[Ye]),Nn((Gt==null?void 0:Gt.label)||""),Ne(!1)},mi=Ze=>{typeof x=="function"&&x(Ze),I&&Ne(!0)},_a=Ze=>{we||(Nn(Ze.currentTarget.value),M&&Ze.currentTarget.value===""&&pt(null),Ke(-1),Ne(!0))},hi=()=>{we||(Ne(!Ve),Ge&&!Ve&&Ke(Mo))};return H.createElement(Pc.Wrapper,Av(Eu({},o),{__staticSelector:"Select"}),H.createElement(Ka,{opened:mr,transitionProps:y,shadow:s,withinPortal:re,portalProps:ae,__staticSelector:"Select",onDirectionChange:yt,switchDirectionOnFlip:oe,zIndex:q,dropdownPosition:ee,positionDependencies:[...xe,At],classNames:S,styles:_,unstyled:C,variant:r.variant},H.createElement(Ka.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":mr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":mr,onMouseLeave:()=>Ke(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:K,value:Ge||"",form:de,disabled:A}),H.createElement(Pc,Eu(Av(Eu(Eu({autoComplete:"off",type:"search"},r),Oe),{ref:Wd(t,he),onKeyDown:Sa,__staticSelector:"Select",value:At,placeholder:J,onChange:_a,"aria-autocomplete":"list","aria-controls":mr?`${r.id}-items`:null,"aria-activedescendant":Ye>=0?`${r.id}-${Ye}`:null,onMouseDown:hi,onBlur:ka,onFocus:mi,readOnly:!I||we,disabled:A,"data-mantine-stop-propagation":mr,name:null,classNames:Av(Eu({},S),{input:$e({[je.input]:!I},S==null?void 0:S.input)})}),YE({theme:st,rightSection:X,rightSectionWidth:z,styles:_,size:r.size,shouldClear:M&&!!Rt,onClear:wn,error:o.error,clearButtonProps:ve,disabled:A,readOnly:we}))))),H.createElement(Ka.Dropdown,{component:T||lg,maxHeight:E,direction:ut,id:r.id,innerRef:ft,__staticSelector:"Select",classNames:S,styles:_},H.createElement(iy,{data:an,hovered:Ye,classNames:S,styles:_,isItemSelected:Ze=>Ze===Ge,uuid:r.id,__staticSelector:"Select",onItemHover:Ke,onItemSelect:hn,itemsRefs:Re,itemComponent:m,size:r.size,nothingFound:D,creatable:Ut&&!!ke,createLabel:ke,"aria-label":o.label,unstyled:C,variant:r.variant}))))});by.displayName="@mantine/core/Select";const Kd=()=>{const[e,t,n,r,o,s,l,i,u,p,m,h,g,x,y,b,C,S,_,j,E,I,M,D,R,A,O,$,X,z,V,Q,G,F,U,T,B,Y,re,ae,oe,q,K,ee,ce,J,ie,de,xe,we,ve,fe,Oe,je,$e,st,Ve,Ct,Ye,Ke,he,Re,ut,yt,ye,et,ct,ft,Me,Ne,Ut,ke,ze,Le,Ge,pt]=Ho("colors",["base.50","base.100","base.150","base.200","base.250","base.300","base.350","base.400","base.450","base.500","base.550","base.600","base.650","base.700","base.750","base.800","base.850","base.900","base.950","accent.50","accent.100","accent.150","accent.200","accent.250","accent.300","accent.350","accent.400","accent.450","accent.500","accent.550","accent.600","accent.650","accent.700","accent.750","accent.800","accent.850","accent.900","accent.950","baseAlpha.50","baseAlpha.100","baseAlpha.150","baseAlpha.200","baseAlpha.250","baseAlpha.300","baseAlpha.350","baseAlpha.400","baseAlpha.450","baseAlpha.500","baseAlpha.550","baseAlpha.600","baseAlpha.650","baseAlpha.700","baseAlpha.750","baseAlpha.800","baseAlpha.850","baseAlpha.900","baseAlpha.950","accentAlpha.50","accentAlpha.100","accentAlpha.150","accentAlpha.200","accentAlpha.250","accentAlpha.300","accentAlpha.350","accentAlpha.400","accentAlpha.450","accentAlpha.500","accentAlpha.550","accentAlpha.600","accentAlpha.650","accentAlpha.700","accentAlpha.750","accentAlpha.800","accentAlpha.850","accentAlpha.900","accentAlpha.950"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:l,base400:i,base450:u,base500:p,base550:m,base600:h,base650:g,base700:x,base750:y,base800:b,base850:C,base900:S,base950:_,accent50:j,accent100:E,accent150:I,accent200:M,accent250:D,accent300:R,accent350:A,accent400:O,accent450:$,accent500:X,accent550:z,accent600:V,accent650:Q,accent700:G,accent750:F,accent800:U,accent850:T,accent900:B,accent950:Y,baseAlpha50:re,baseAlpha100:ae,baseAlpha150:oe,baseAlpha200:q,baseAlpha250:K,baseAlpha300:ee,baseAlpha350:ce,baseAlpha400:J,baseAlpha450:ie,baseAlpha500:de,baseAlpha550:xe,baseAlpha600:we,baseAlpha650:ve,baseAlpha700:fe,baseAlpha750:Oe,baseAlpha800:je,baseAlpha850:$e,baseAlpha900:st,baseAlpha950:Ve,accentAlpha50:Ct,accentAlpha100:Ye,accentAlpha150:Ke,accentAlpha200:he,accentAlpha250:Re,accentAlpha300:ut,accentAlpha350:yt,accentAlpha400:ye,accentAlpha450:et,accentAlpha500:ct,accentAlpha550:ft,accentAlpha600:Me,accentAlpha650:Ne,accentAlpha700:Ut,accentAlpha750:ke,accentAlpha800:ze,accentAlpha850:Le,accentAlpha900:Ge,accentAlpha950:pt}},Ae=(e,t)=>n=>n==="light"?e:t,aM=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:l,base700:i,base800:u,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=Kd(),{colorMode:b}=ha(),[C]=Ho("shadows",["dark-lg"]),[S,_,j]=Ho("space",[1,2,6]),[E]=Ho("radii",["base"]),[I]=Ho("lineHeights",["base"]);return d.useCallback(()=>({label:{color:Ae(i,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,i)(b)}},input:{border:"unset",backgroundColor:Ae(e,p)(b),borderRadius:E,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),minHeight:"unset",lineHeight:I,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:_,paddingInlineEnd:j,paddingTop:S,paddingBottom:S,fontWeight:600,"&:hover":{borderColor:Ae(r,l)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,i)(b),color:Ae(l,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(t,p)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,i)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:C},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)},"&[data-active]":{backgroundColor:Ae(r,i)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,l)(b),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,l,i,u,p,C,b,I,E,S,_,j])},lM=_e((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,onChange:s,label:l,disabled:i,...u}=e,p=te(),[m,h]=d.useState(""),g=d.useCallback(C=>{C.shiftKey&&p(Nr(!0))},[p]),x=d.useCallback(C=>{C.shiftKey||p(Nr(!1))},[p]),y=d.useCallback(C=>{s&&s(C)},[s]),b=aM();return a.jsx(Vt,{label:r,placement:"top",hasArrow:!0,children:a.jsxs(Zt,{ref:t,isDisabled:i,position:"static","data-testid":`select-${l||e.placeholder}`,children:[l&&a.jsx(In,{children:l}),a.jsx(by,{ref:o,disabled:i,searchValue:m,onSearchChange:h,onChange:y,onKeyDown:g,onKeyUp:x,searchable:n,maxDropdownHeight:300,styles:b,...u})]})})});lM.displayName="IAIMantineSearchableSelect";const nn=d.memo(lM),wJ=le([ge],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},Ce),SJ=()=>{const e=te(),[t,n]=d.useState(),{data:r,isFetching:o}=Sd(),{imagesToChange:s,isModalOpen:l}=W(wJ),[i]=aR(),[u]=lR(),{t:p}=Z(),m=d.useMemo(()=>{const y=[{label:p("boards.uncategorized"),value:"none"}];return(r??[]).forEach(b=>y.push({label:b.board_name,value:b.board_id})),y},[r,p]),h=d.useCallback(()=>{e(lw()),e(Ux(!1))},[e]),g=d.useCallback(()=>{!s.length||!t||(t==="none"?u({imageDTOs:s}):i({imageDTOs:s,board_id:t}),n(null),e(lw()))},[i,e,s,u,t]),x=d.useRef(null);return a.jsx(Ld,{isOpen:l,onClose:h,leastDestructiveRef:x,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(zd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:p("boards.changeBoard")}),a.jsx(Jo,{children:a.jsxs(N,{sx:{flexDir:"column",gap:4},children:[a.jsxs(be,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(nn,{placeholder:p(o?"boards.loading":"boards.selectBoard"),disabled:o,onChange:y=>n(y),value:t,data:m})]})}),a.jsxs(ks,{children:[a.jsx(ot,{ref:x,onClick:h,children:p("boards.cancel")}),a.jsx(ot,{colorScheme:"accent",onClick:g,ml:3,children:p("boards.move")})]})]})})})},kJ=d.memo(SJ),iM=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:l,helperText:i,...u}=e;return a.jsx(Vt,{label:l,hasArrow:!0,placement:"top",isDisabled:!l,children:a.jsx(Zt,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs(N,{sx:{flexDir:"column",w:"full"},children:[a.jsxs(N,{sx:{alignItems:"center",w:"full"},children:[t&&a.jsx(In,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(ty,{...u})]}),i&&a.jsx(m5,{children:a.jsx(be,{variant:"subtext",children:i})})]})})})};iM.displayName="IAISwitch";const kn=d.memo(iM),_J=e=>{const{t}=Z(),{imageUsage:n,topMessage:r=t("gallery.currentlyInUse"),bottomMessage:o=t("gallery.featuresWillReset")}=e;return!n||!Vo(n)?null:a.jsxs(a.Fragment,{children:[a.jsx(be,{children:r}),a.jsxs(Ad,{sx:{paddingInlineStart:6},children:[n.isInitialImage&&a.jsx(ho,{children:t("common.img2img")}),n.isCanvasImage&&a.jsx(ho,{children:t("common.unifiedCanvas")}),n.isControlImage&&a.jsx(ho,{children:t("common.controlNet")}),n.isNodesImage&&a.jsx(ho,{children:t("common.nodeEditor")})]}),a.jsx(be,{children:o})]})},cM=d.memo(_J),jJ=le([ge,iR],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:l}=r,{imagesToDelete:i,isModalOpen:u}=o,p=(i??[]).map(({image_name:h})=>sI(e,h)),m={isInitialImage:Vo(p,h=>h.isInitialImage),isCanvasImage:Vo(p,h=>h.isCanvasImage),isNodesImage:Vo(p,h=>h.isNodesImage),isControlImage:Vo(p,h=>h.isControlImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:l,imagesToDelete:i,imagesUsage:t,isModalOpen:u,imageUsageSummary:m}},Ce),IJ=()=>{const e=te(),{t}=Z(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:l,imageUsageSummary:i}=W(jJ),u=d.useCallback(g=>e(aI(!g.target.checked)),[e]),p=d.useCallback(()=>{e(iw()),e(cR(!1))},[e]),m=d.useCallback(()=>{!o.length||!s.length||(e(iw()),e(uR({imageDTOs:o,imagesUsage:s})))},[e,o,s]),h=d.useRef(null);return a.jsx(Ld,{isOpen:l,onClose:p,leastDestructiveRef:h,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(zd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Jo,{children:a.jsxs(N,{direction:"column",gap:3,children:[a.jsx(cM,{imageUsage:i}),a.jsx(Yn,{}),a.jsx(be,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(be,{children:t("common.areYouSure")}),a.jsx(kn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:u})]})}),a.jsxs(ks,{children:[a.jsx(ot,{ref:h,onClick:p,children:"Cancel"}),a.jsx(ot,{colorScheme:"error",onClick:m,ml:3,children:"Delete"})]})]})})})},PJ=d.memo(IJ),uM=_e((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...l}=e;return a.jsx(Vt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(Cs,{ref:t,role:n,colorScheme:s?"accent":"base","data-testid":r,...l})})});uM.displayName="IAIIconButton";const Be=d.memo(uM);var dM={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Xk=H.createContext&&H.createContext(dM),qa=globalThis&&globalThis.__assign||function(){return qa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},qa.apply(this,arguments)},EJ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function fM(e){return e&&e.map(function(t,n){return H.createElement(t.tag,qa({key:n},t.attr),fM(t.child))})}function Te(e){return function(t){return H.createElement(MJ,qa({attr:qa({},e.attr)},t),fM(e.child))}}function MJ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,l=EJ(e,["attr","size","title"]),i=o||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),H.createElement("svg",qa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,l,{className:u,style:qa(qa({color:e.color||n.color},n.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return Xk!==void 0?H.createElement(Xk.Consumer,null,function(n){return t(n)}):t(dM)}function OJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function DJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function RJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"}}]})(e)}function AJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function TJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function $J(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function NJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function LJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function pM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function zJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}}]})(e)}function FJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function mM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function BJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"}}]})(e)}function hM(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function gM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"}}]})(e)}function Uc(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function HJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function VJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function Gc(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function WJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"}}]})(e)}function UJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function GJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}}]})(e)}function KJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z"}}]})(e)}function vM(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function yy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"}}]})(e)}function qJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function XJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function QJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function YJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function xM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"}}]})(e)}function ZJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"}}]})(e)}function JJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M360 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24zm-75.078 384H99.08c17.059-46.797 52.096-80 92.92-80 40.821 0 75.862 33.196 92.922 80zm.019-256H99.078C91.988 108.548 88 86.748 88 64h208c0 22.805-3.987 44.587-11.059 64z"}}]})(e)}function Yl(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function eee(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"}}]})(e)}function bM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function tee(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function nee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function yM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"}}]})(e)}function CM(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"}}]})(e)}function ree(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"}}]})(e)}function wM(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function oee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function see(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function aee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}}]})(e)}function lee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function Xa(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function SM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function iee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504.971 359.029c9.373 9.373 9.373 24.569 0 33.941l-80 79.984c-15.01 15.01-40.971 4.49-40.971-16.971V416h-58.785a12.004 12.004 0 0 1-8.773-3.812l-70.556-75.596 53.333-57.143L352 336h32v-39.981c0-21.438 25.943-31.998 40.971-16.971l80 79.981zM12 176h84l52.781 56.551 53.333-57.143-70.556-75.596A11.999 11.999 0 0 0 122.785 96H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12zm372 0v39.984c0 21.46 25.961 31.98 40.971 16.971l80-79.984c9.373-9.373 9.373-24.569 0-33.941l-80-79.981C409.943 24.021 384 34.582 384 56.019V96h-58.785a12.004 12.004 0 0 0-8.773 3.812L96 336H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h110.785c3.326 0 6.503-1.381 8.773-3.812L352 176h32z"}}]})(e)}function cee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function uee(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z"}}]})(e)}function ug(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function dee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function kM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function fee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"}}]})(e)}function Qk(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function _M(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function pee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M16 128h416c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16H16C7.16 32 0 39.16 0 48v64c0 8.84 7.16 16 16 16zm480 80H80c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16zm-64 176H16c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16z"}}]})(e)}function mee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"}}]})(e)}function jM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"}}]})(e)}function Ec(e){return Te({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function Fr(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function dg(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function fg(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function hee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function IM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const $t=e=>{const t=W(l=>l.config.disabledTabs),n=W(l=>l.config.disabledFeatures),r=W(l=>l.config.disabledSDFeatures),o=d.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=d.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};function gee(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(el,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(el,{children:[a.jsx(be,{fontWeight:600,children:t}),r&&a.jsx(be,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function vee({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Lr(),{t:o}=Z(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"),desc:o("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys.focusPrompt.title"),desc:o("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys.toggleOptions.title"),desc:o("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys.toggleGallery.title"),desc:o("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys.maximizeWorkSpace.title"),desc:o("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys.changeTabs.title"),desc:o("hotkeys.changeTabs.desc"),hotkey:"1-5"}],l=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.upscale.title"),desc:o("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys.showInfo.title"),desc:o("hotkeys.showInfo.desc"),hotkey:"I"},{title:o("hotkeys.sendToImageToImage.title"),desc:o("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys.deleteImage.title"),desc:o("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys.closePanels.title"),desc:o("hotkeys.closePanels.desc"),hotkey:"Esc"}],i=[{title:o("hotkeys.previousImage.title"),desc:o("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextImage.title"),desc:o("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.increaseGalleryThumbSize.title"),desc:o("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys.decreaseGalleryThumbSize.title"),desc:o("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],u=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],p=[{title:o("hotkeys.addNodes.title"),desc:o("hotkeys.addNodes.desc"),hotkey:"Shift + A / Space"}],m=h=>a.jsx(N,{flexDir:"column",gap:4,children:h.map((g,x)=>a.jsxs(N,{flexDir:"column",px:2,gap:4,children:[a.jsx(gee,{title:g.title,description:g.desc,hotkey:g.hotkey}),x<h.length-1&&a.jsx(Yn,{})]},x))});return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:n}),a.jsxs(ql,{isOpen:t,onClose:r,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(Fd,{}),a.jsx(Jo,{children:a.jsx(f5,{allowMultiple:!0,children:a.jsxs(N,{flexDir:"column",gap:2,children:[a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(s)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(l)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(i)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(u)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(p)})]})]})})}),a.jsx(ks,{})]})]})]})}function Yk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Zk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var xee=function(e,t){return typeof t=="boolean"?t:!e},bee=function(e){return d.useReducer(xee,e)};const yee=bee;function Cee(e,t){t===void 0&&(t=0);var n=d.useRef(!1),r=d.useRef(),o=d.useRef(e),s=d.useCallback(function(){return n.current},[]),l=d.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),i=d.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){return l(),i},[t]),[s,i,l]}function wee(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=Cee(e,t),o=r[0],s=r[1],l=r[2];return d.useEffect(l,n),[o,s]}var See=function(e,t){t===void 0&&(t=!0);var n=d.useState(!1),r=n[0],o=n[1];return d.useEffect(function(){var s=function(){return o(!0)},l=function(){return o(!1)};t&&e&&e.current&&(Yk(e.current,"mouseover",s),Yk(e.current,"mouseout",l));var i=e.current;return function(){t&&i&&(Zk(i,"mouseover",s),Zk(i,"mouseout",l))}},[t,e]),r};const PM=See,kee=({showVersion:e=!0})=>{const{data:t}=dR(),n=d.useRef(null),r=PM(n);return a.jsxs(N,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(ga,{src:Gx,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs(N,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(be,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(dr,{children:e&&r&&t&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(be,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},_ee=d.memo(kee),EM=_e((e,t)=>{const{tooltip:n,inputRef:r,label:o,disabled:s,required:l,...i}=e,u=aM();return a.jsx(Vt,{label:n,placement:"top",hasArrow:!0,children:a.jsxs(Zt,{ref:t,isRequired:l,isDisabled:s,position:"static","data-testid":`select-${o||e.placeholder}`,children:[a.jsx(In,{children:o}),a.jsx(by,{disabled:s,ref:r,styles:u,...i})]})})});EM.displayName="IAIMantineSelect";const On=d.memo(EM),jee={ar:bt.t("common.langArabic",{lng:"ar"}),nl:bt.t("common.langDutch",{lng:"nl"}),en:bt.t("common.langEnglish",{lng:"en"}),fr:bt.t("common.langFrench",{lng:"fr"}),de:bt.t("common.langGerman",{lng:"de"}),he:bt.t("common.langHebrew",{lng:"he"}),it:bt.t("common.langItalian",{lng:"it"}),ja:bt.t("common.langJapanese",{lng:"ja"}),ko:bt.t("common.langKorean",{lng:"ko"}),pl:bt.t("common.langPolish",{lng:"pl"}),pt_BR:bt.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:bt.t("common.langPortuguese",{lng:"pt"}),ru:bt.t("common.langRussian",{lng:"ru"}),zh_CN:bt.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:bt.t("common.langSpanish",{lng:"es"}),uk:bt.t("common.langUkranian",{lng:"ua"})},Iee={CONNECTED:"common.statusConnected",DISCONNECTED:"common.statusDisconnected",PROCESSING:"common.statusProcessing",ERROR:"common.statusError",LOADING_MODEL:"common.statusLoadingModel"},MM=le(ge,({system:e})=>e.language,Ce);function Lo(e){const{t}=Z(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:l,...i}=e;return a.jsxs(N,{justifyContent:"space-between",py:1,children:[a.jsxs(N,{gap:2,alignItems:"center",children:[a.jsx(be,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(As,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...l,children:s})]}),a.jsx(kn,{...i})]})}const Pee=e=>a.jsx(N,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),Ki=d.memo(Pee);function Eee(){const{t:e}=Z(),t=te(),{data:n,refetch:r}=fR(),[o,{isLoading:s}]=pR(),l=d.useCallback(()=>{o().unwrap().then(i=>{t(lI()),t(iI()),t(lt({title:e("settings.intermediatesCleared",{count:i}),status:"info"}))}).catch(()=>{t(lt({title:e("settings.intermediatesClearedFailed"),status:"error"}))})},[e,o,t]);return d.useEffect(()=>{r()},[r]),a.jsxs(Ki,{children:[a.jsx(cr,{size:"sm",children:e("settings.clearIntermediates")}),a.jsx(ot,{colorScheme:"warning",onClick:l,isLoading:s,isDisabled:!n,children:e("settings.clearIntermediatesWithCount",{count:n??0})}),a.jsx(be,{fontWeight:"bold",children:e("settings.clearIntermediatesDesc1")}),a.jsx(be,{variant:"subtext",children:e("settings.clearIntermediatesDesc2")}),a.jsx(be,{variant:"subtext",children:e("settings.clearIntermediatesDesc3")})]})}const Mee=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:l,base700:i,base800:u,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=Kd(),{colorMode:b}=ha(),[C]=Ho("shadows",["dark-lg"]);return d.useCallback(()=>({label:{color:Ae(i,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,i)(b)}},searchInput:{":placeholder":{color:Ae(r,i)(b)}},input:{backgroundColor:Ae(e,p)(b),borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,l)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,i)(b),color:Ae(l,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,u)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,i)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:C},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)},"&[data-active]":{backgroundColor:Ae(r,i)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,l)(b),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,l,i,u,p,C,b])},OM=_e((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,label:s,disabled:l,...i}=e,u=te(),p=d.useCallback(g=>{g.shiftKey&&u(Nr(!0))},[u]),m=d.useCallback(g=>{g.shiftKey||u(Nr(!1))},[u]),h=Mee();return a.jsx(Vt,{label:r,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsxs(Zt,{ref:t,isDisabled:l,position:"static",children:[s&&a.jsx(In,{children:s}),a.jsx(eM,{ref:o,disabled:l,onKeyDown:p,onKeyUp:m,searchable:n,maxDropdownHeight:300,styles:h,...i})]})})});OM.displayName="IAIMantineMultiSelect";const Oee=d.memo(OM),Dee=Sr(bh,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function Ree(){const e=te(),{t}=Z(),n=W(o=>o.ui.favoriteSchedulers),r=d.useCallback(o=>{e(mR(o))},[e]);return a.jsx(Oee,{label:t("settings.favoriteSchedulers"),value:n,data:Dee,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const Aee=le([ge],({system:e,ui:t})=>{const{shouldConfirmOnDelete:n,enableImageDebugging:r,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:l,shouldUseNSFWChecker:i,shouldUseWatermarker:u,shouldEnableInformationalPopovers:p}=e,{shouldUseSliders:m,shouldShowProgressInViewer:h,shouldAutoChangeDimensions:g}=t;return{shouldConfirmOnDelete:n,enableImageDebugging:r,shouldUseSliders:m,shouldShowProgressInViewer:h,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:l,shouldUseNSFWChecker:i,shouldUseWatermarker:u,shouldAutoChangeDimensions:g,shouldEnableInformationalPopovers:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),Tee=({children:e,config:t})=>{const n=te(),{t:r}=Z(),[o,s]=d.useState(3),l=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,i=(t==null?void 0:t.shouldShowResetWebUiText)??!0,u=(t==null?void 0:t.shouldShowClearIntermediates)??!0,p=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;d.useEffect(()=>{l||n(cw(!1))},[l,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:h}=cI(void 0,{selectFromResult:({data:Y})=>({isNSFWCheckerAvailable:(Y==null?void 0:Y.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Y==null?void 0:Y.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:g,onOpen:x,onClose:y}=Lr(),{isOpen:b,onOpen:C,onClose:S}=Lr(),{shouldConfirmOnDelete:_,enableImageDebugging:j,shouldUseSliders:E,shouldShowProgressInViewer:I,consoleLogLevel:M,shouldLogToConsole:D,shouldAntialiasProgressImage:R,shouldUseNSFWChecker:A,shouldUseWatermarker:O,shouldAutoChangeDimensions:$,shouldEnableInformationalPopovers:X}=W(Aee),z=d.useCallback(()=>{Object.keys(window.localStorage).forEach(Y=>{(hR.includes(Y)||Y.startsWith(gR))&&localStorage.removeItem(Y)}),y(),C(),setInterval(()=>s(Y=>Y-1),1e3)},[y,C]);d.useEffect(()=>{o<=0&&window.location.reload()},[o]);const V=d.useCallback(Y=>{n(vR(Y))},[n]),Q=d.useCallback(Y=>{n(xR(Y))},[n]),G=d.useCallback(Y=>{n(cw(Y.target.checked))},[n]),{colorMode:F,toggleColorMode:U}=ha(),T=$t("localization").isFeatureEnabled,B=W(MM);return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:x}),a.jsxs(ql,{isOpen:g,onClose:y,size:"2xl",isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{bg:"none",children:r("common.settingsLabel")}),a.jsx(Fd,{}),a.jsx(Jo,{children:a.jsxs(N,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Ki,{children:[a.jsx(cr,{size:"sm",children:r("settings.general")}),a.jsx(Lo,{label:r("settings.confirmOnDelete"),isChecked:_,onChange:Y=>n(aI(Y.target.checked))})]}),a.jsxs(Ki,{children:[a.jsx(cr,{size:"sm",children:r("settings.generation")}),a.jsx(Ree,{}),a.jsx(Lo,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:A,onChange:Y=>n(bR(Y.target.checked))}),a.jsx(Lo,{label:"Enable Invisible Watermark",isDisabled:!h,isChecked:O,onChange:Y=>n(yR(Y.target.checked))})]}),a.jsxs(Ki,{children:[a.jsx(cr,{size:"sm",children:r("settings.ui")}),a.jsx(Lo,{label:r("common.darkMode"),isChecked:F==="dark",onChange:U}),a.jsx(Lo,{label:r("settings.useSlidersForAll"),isChecked:E,onChange:Y=>n(CR(Y.target.checked))}),a.jsx(Lo,{label:r("settings.showProgressInViewer"),isChecked:I,onChange:Y=>n(uI(Y.target.checked))}),a.jsx(Lo,{label:r("settings.antialiasProgressImages"),isChecked:R,onChange:Y=>n(wR(Y.target.checked))}),a.jsx(Lo,{label:r("settings.autoChangeDimensions"),isChecked:$,onChange:Y=>n(SR(Y.target.checked))}),p&&a.jsx(On,{disabled:!T,label:r("common.languagePickerLabel"),value:B,data:Object.entries(jee).map(([Y,re])=>({value:Y,label:re})),onChange:Q}),a.jsx(Lo,{label:"Enable informational popovers",isChecked:X,onChange:Y=>n(kR(Y.target.checked))})]}),l&&a.jsxs(Ki,{children:[a.jsx(cr,{size:"sm",children:r("settings.developer")}),a.jsx(Lo,{label:r("settings.shouldLogToConsole"),isChecked:D,onChange:G}),a.jsx(On,{disabled:!D,label:r("settings.consoleLogLevel"),onChange:V,value:M,data:_R.concat()}),a.jsx(Lo,{label:r("settings.enableImageDebugging"),isChecked:j,onChange:Y=>n(jR(Y.target.checked))})]}),u&&a.jsx(Eee,{}),a.jsxs(Ki,{children:[a.jsx(cr,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(ot,{colorScheme:"error",onClick:z,children:r("settings.resetWebUI")}),i&&a.jsxs(a.Fragment,{children:[a.jsx(be,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(be,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(ks,{children:a.jsx(ot,{onClick:y,children:r("common.close")})})]})]}),a.jsxs(ql,{closeOnOverlayClick:!1,isOpen:b,onClose:S,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Zo,{backdropFilter:"blur(40px)"}),a.jsxs(Xl,{children:[a.jsx(Yo,{}),a.jsx(Jo,{children:a.jsx(N,{justifyContent:"center",children:a.jsx(be,{fontSize:"lg",children:a.jsxs(be,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(ks,{})]})]})]})},$ee=d.memo(Tee),Nee=le(ge,({system:e})=>{const{isConnected:t,status:n}=e;return{isConnected:t,statusTranslationKey:Iee[n]}},Ce),Jk={ok:"green.400",working:"yellow.400",error:"red.400"},e_={ok:"green.600",working:"yellow.500",error:"red.500"},Lee=()=>{const{isConnected:e,statusTranslationKey:t}=W(Nee),{t:n}=Z(),r=d.useRef(null),{data:o}=va(),s=d.useMemo(()=>e?o!=null&&o.queue.in_progress?"working":"ok":"error",[o==null?void 0:o.queue.in_progress,e]),l=PM(r);return a.jsxs(N,{ref:r,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(dr,{children:l&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(be,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:e_[s],_dark:{color:Jk[s]}},children:n(t)})},"statusText")}),a.jsx(Tn,{as:BJ,sx:{boxSize:"0.5rem",color:e_[s],_dark:{color:Jk[s]}}})]})},zee=d.memo(Lee),Fee=()=>{const{t:e}=Z(),t=$t("bugLink").isFeatureEnabled,n=$t("discordLink").isFeatureEnabled,r=$t("githubLink").isFeatureEnabled,o="http://github.com/invoke-ai/InvokeAI",s="https://discord.gg/ZmtBAhwWhy";return a.jsxs(N,{sx:{gap:2,alignItems:"center"},children:[a.jsx(_ee,{}),a.jsx(ba,{}),a.jsx(zee,{}),a.jsxs(Nh,{children:[a.jsx(Lh,{as:Be,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(zJ,{}),sx:{boxSize:8}}),a.jsxs(Gl,{motionProps:bc,children:[a.jsxs(sd,{title:e("common.communityLabel"),children:[r&&a.jsx(Kt,{as:"a",href:o,target:"_blank",icon:a.jsx(DJ,{}),children:e("common.githubLabel")}),t&&a.jsx(Kt,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(FJ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(Kt,{as:"a",href:s,target:"_blank",icon:a.jsx(OJ,{}),children:e("common.discordLabel")})]}),a.jsxs(sd,{title:e("common.settingsLabel"),children:[a.jsx(vee,{children:a.jsx(Kt,{as:"button",icon:a.jsx(tee,{}),children:e("common.hotkeysLabel")})}),a.jsx($ee,{children:a.jsx(Kt,{as:"button",icon:a.jsx(gM,{}),children:e("common.settingsLabel")})})]})]})]})]})},Bee=d.memo(Fee);/*!
+ * OverlayScrollbars
+ * Version: 2.2.1
+ *
+ * Copyright (c) Rene Haas | KingSora.
+ * https://github.com/KingSora
+ *
+ * Released under the MIT license.
+ */function Ft(e,t){if(mg(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Ft(Object.keys(e),n=>t(e[n],n,e));return e}function ur(e,t){const n=dl(t);if(ns(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?o_(e,s,t):t.reduce((l,i)=>(l[i]=o_(e,s,i),l),o)}return o}e&&Ft(eo(t),o=>rte(e,o,t[o]))}const Fo=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,l;const i=(m,h)=>{const g=s,x=m,y=h||(r?!r(g,x):g!==x);return(y||o)&&(s=x,l=g),[s,y,l]};return[t?m=>i(t(s,l),m):i,m=>[s,!!m,l]]},qd=()=>typeof window<"u",DM=qd()&&Node.ELEMENT_NODE,{toString:Hee,hasOwnProperty:Tv}=Object.prototype,Ca=e=>e===void 0,pg=e=>e===null,Vee=e=>Ca(e)||pg(e)?`${e}`:Hee.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Qa=e=>typeof e=="number",dl=e=>typeof e=="string",Cy=e=>typeof e=="boolean",ts=e=>typeof e=="function",ns=e=>Array.isArray(e),cd=e=>typeof e=="object"&&!ns(e)&&!pg(e),mg=e=>{const t=!!e&&e.length,n=Qa(t)&&t>-1&&t%1==0;return ns(e)||!ts(e)&&n?t>0&&cd(e)?t-1 in e:!0:!1},dx=e=>{if(!e||!cd(e)||Vee(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=Tv.call(e,n),l=o&&Tv.call(o,"isPrototypeOf");if(r&&!s&&!l)return!1;for(t in e);return Ca(t)||Tv.call(e,t)},rh=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===DM:!1},hg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===DM:!1},wy=(e,t,n)=>e.indexOf(t,n),Xt=(e,t,n)=>(!n&&!dl(t)&&mg(t)?Array.prototype.push.apply(e,t):e.push(t),e),Zl=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Xt(n,r)}):Ft(e,r=>{Xt(n,r)}),n)},Sy=e=>!!e&&e.length===0,Ts=(e,t,n)=>{Ft(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},gg=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),eo=e=>e?Object.keys(e):[],yn=(e,t,n,r,o,s,l)=>{const i=[t,n,r,o,s,l];return(typeof e!="object"||pg(e))&&!ts(e)&&(e={}),Ft(i,u=>{Ft(eo(u),p=>{const m=u[p];if(e===m)return!0;const h=ns(m);if(m&&(dx(m)||h)){const g=e[p];let x=g;h&&!ns(g)?x=[]:!h&&!dx(g)&&(x={}),e[p]=yn(x,m)}else e[p]=m})}),e},ky=e=>{for(const t in e)return!1;return!0},RM=(e,t,n,r)=>{if(Ca(r))return n?n[e]:t;n&&(dl(r)||Qa(r))&&(n[e]=r)},ir=(e,t,n)=>{if(Ca(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Or=(e,t)=>{e&&e.removeAttribute(t)},Ll=(e,t,n,r)=>{if(n){const o=ir(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const l=Zl(s).join(" ").trim();ir(e,t,l)}},Wee=(e,t,n)=>{const r=ir(e,t)||"";return new Set(r.split(" ")).has(n)},qo=(e,t)=>RM("scrollLeft",0,e,t),ra=(e,t)=>RM("scrollTop",0,e,t),fx=qd()&&Element.prototype,AM=(e,t)=>{const n=[],r=t?hg(t)?t:null:document;return r?Xt(n,r.querySelectorAll(e)):n},Uee=(e,t)=>{const n=t?hg(t)?t:null:document;return n?n.querySelector(e):null},oh=(e,t)=>hg(e)?(fx.matches||fx.msMatchesSelector).call(e,t):!1,_y=e=>e?Zl(e.childNodes):[],ca=e=>e?e.parentElement:null,ec=(e,t)=>{if(hg(e)){const n=fx.closest;if(n)return n.call(e,t);do{if(oh(e,t))return e;e=ca(e)}while(e)}return null},Gee=(e,t,n)=>{const r=e&&ec(e,t),o=e&&Uee(n,r),s=ec(o,t)===r;return r&&o?r===e||o===e||s&&ec(ec(e,n),t)!==r:!1},jy=(e,t,n)=>{if(n&&e){let r=t,o;mg(n)?(o=document.createDocumentFragment(),Ft(n,s=>{s===r&&(r=s.previousSibling),o.appendChild(s)})):o=n,t&&(r?r!==t&&(r=r.nextSibling):r=e.firstChild),e.insertBefore(o,r||null)}},go=(e,t)=>{jy(e,null,t)},Kee=(e,t)=>{jy(ca(e),e,t)},t_=(e,t)=>{jy(ca(e),e&&e.nextSibling,t)},js=e=>{if(mg(e))Ft(Zl(e),t=>js(t));else if(e){const t=ca(e);t&&t.removeChild(e)}},zl=e=>{const t=document.createElement("div");return e&&ir(t,"class",e),t},TM=e=>{const t=zl();return t.innerHTML=e.trim(),Ft(_y(t),n=>js(n))},px=e=>e.charAt(0).toUpperCase()+e.slice(1),qee=()=>zl().style,Xee=["-webkit-","-moz-","-o-","-ms-"],Qee=["WebKit","Moz","O","MS","webkit","moz","o","ms"],$v={},Nv={},Yee=e=>{let t=Nv[e];if(gg(Nv,e))return t;const n=px(e),r=qee();return Ft(Xee,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,px(s)+n].find(i=>r[i]!==void 0))}),Nv[e]=t||""},Xd=e=>{if(qd()){let t=$v[e]||window[e];return gg($v,e)||(Ft(Qee,n=>(t=t||window[n+px(e)],!t)),$v[e]=t),t}},Zee=Xd("MutationObserver"),n_=Xd("IntersectionObserver"),tc=Xd("ResizeObserver"),$M=Xd("cancelAnimationFrame"),NM=Xd("requestAnimationFrame"),sh=qd()&&window.setTimeout,mx=qd()&&window.clearTimeout,Jee=/[^\x20\t\r\n\f]+/g,LM=(e,t,n)=>{const r=e&&e.classList;let o,s=0,l=!1;if(r&&t&&dl(t)){const i=t.match(Jee)||[];for(l=i.length>0;o=i[s++];)l=!!n(r,o)&&l}return l},Iy=(e,t)=>{LM(e,t,(n,r)=>n.remove(r))},oa=(e,t)=>(LM(e,t,(n,r)=>n.add(r)),Iy.bind(0,e,t)),vg=(e,t,n,r)=>{if(e&&t){let o=!0;return Ft(n,s=>{const l=r?r(e[s]):e[s],i=r?r(t[s]):t[s];l!==i&&(o=!1)}),o}return!1},zM=(e,t)=>vg(e,t,["w","h"]),FM=(e,t)=>vg(e,t,["x","y"]),ete=(e,t)=>vg(e,t,["t","r","b","l"]),r_=(e,t,n)=>vg(e,t,["width","height"],n&&(r=>Math.round(r))),po=()=>{},qi=e=>{let t;const n=e?sh:NM,r=e?mx:$M;return[o=>{r(t),t=n(o,ts(e)?e():e)},()=>r(t)]},Py=(e,t)=>{let n,r,o,s=po;const{v:l,g:i,p:u}=t||{},p=function(y){s(),mx(n),n=r=void 0,s=po,e.apply(this,y)},m=x=>u&&r?u(r,x):x,h=()=>{s!==po&&p(m(o)||o)},g=function(){const y=Zl(arguments),b=ts(l)?l():l;if(Qa(b)&&b>=0){const S=ts(i)?i():i,_=Qa(S)&&S>=0,j=b>0?sh:NM,E=b>0?mx:$M,M=m(y)||y,D=p.bind(0,M);s();const R=j(D,b);s=()=>E(R),_&&!n&&(n=sh(h,S)),r=o=M}else p(y)};return g.m=h,g},tte={opacity:1,zindex:1},Sp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},nte=(e,t)=>!tte[e.toLowerCase()]&&Qa(t)?`${t}px`:t,o_=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],rte=(e,t,n)=>{try{const{style:r}=e;Ca(r[t])?r.setProperty(t,n):r[t]=nte(t,n)}catch{}},ud=e=>ur(e,"direction")==="rtl",s_=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,l=`${r}right${o}`,i=`${r}bottom${o}`,u=`${r}left${o}`,p=ur(e,[s,l,i,u]);return{t:Sp(p[s],!0),r:Sp(p[l],!0),b:Sp(p[i],!0),l:Sp(p[u],!0)}},{round:a_}=Math,Ey={w:0,h:0},dd=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:Ey,qp=e=>e?{w:e.clientWidth,h:e.clientHeight}:Ey,ah=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:Ey,lh=e=>{const t=parseFloat(ur(e,"height"))||0,n=parseFloat(ur(e,"width"))||0;return{w:n-a_(n),h:t-a_(t)}},bs=e=>e.getBoundingClientRect();let kp;const ote=()=>{if(Ca(kp)){kp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){kp=!0}}))}catch{}}return kp},BM=e=>e.split(" "),ste=(e,t,n,r)=>{Ft(BM(t),o=>{e.removeEventListener(o,n,r)})},Vn=(e,t,n,r)=>{var o;const s=ote(),l=(o=s&&r&&r.S)!=null?o:s,i=r&&r.$||!1,u=r&&r.C||!1,p=[],m=s?{passive:l,capture:i}:i;return Ft(BM(t),h=>{const g=u?x=>{e.removeEventListener(h,g,i),n&&n(x)}:n;Xt(p,ste.bind(null,e,h,g,i)),e.addEventListener(h,g,m)}),Ts.bind(0,p)},HM=e=>e.stopPropagation(),VM=e=>e.preventDefault(),ate={x:0,y:0},Lv=e=>{const t=e?bs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:ate},l_=(e,t)=>{Ft(ns(t)?t:[t],e)},My=e=>{const t=new Map,n=(s,l)=>{if(s){const i=t.get(s);l_(u=>{i&&i[u?"delete":"clear"](u)},l)}else t.forEach(i=>{i.clear()}),t.clear()},r=(s,l)=>{if(dl(s)){const p=t.get(s)||new Set;return t.set(s,p),l_(m=>{ts(m)&&p.add(m)},l),n.bind(0,s,l)}Cy(l)&&l&&n();const i=eo(s),u=[];return Ft(i,p=>{const m=s[p];m&&Xt(u,r(p,m))}),Ts.bind(0,u)},o=(s,l)=>{const i=t.get(s);Ft(Zl(i),u=>{l&&!Sy(l)?u.apply(0,l):u()})};return r(e||{}),[r,n,o]},i_=e=>JSON.stringify(e,(t,n)=>{if(ts(n))throw new Error;return n}),lte={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},WM=(e,t)=>{const n={},r=eo(t).concat(eo(e));return Ft(r,o=>{const s=e[o],l=t[o];if(cd(s)&&cd(l))yn(n[o]={},WM(s,l)),ky(n[o])&&delete n[o];else if(gg(t,o)&&l!==s){let i=!0;if(ns(s)||ns(l))try{i_(s)===i_(l)&&(i=!1)}catch{}i&&(n[o]=l)}}),n},UM="os-environment",GM=`${UM}-flexbox-glue`,ite=`${GM}-max`,KM="os-scrollbar-hidden",zv="data-overlayscrollbars-initialize",Bo="data-overlayscrollbars",qM=`${Bo}-overflow-x`,XM=`${Bo}-overflow-y`,hc="overflowVisible",cte="scrollbarHidden",c_="scrollbarPressed",ih="updating",Fa="data-overlayscrollbars-viewport",Fv="arrange",QM="scrollbarHidden",gc=hc,hx="data-overlayscrollbars-padding",ute=gc,u_="data-overlayscrollbars-content",Oy="os-size-observer",dte=`${Oy}-appear`,fte=`${Oy}-listener`,pte="os-trinsic-observer",mte="os-no-css-vars",hte="os-theme-none",Br="os-scrollbar",gte=`${Br}-rtl`,vte=`${Br}-horizontal`,xte=`${Br}-vertical`,YM=`${Br}-track`,Dy=`${Br}-handle`,bte=`${Br}-visible`,yte=`${Br}-cornerless`,d_=`${Br}-transitionless`,f_=`${Br}-interaction`,p_=`${Br}-unusable`,m_=`${Br}-auto-hidden`,h_=`${Br}-wheel`,Cte=`${YM}-interactive`,wte=`${Dy}-interactive`,ZM={},Jl=()=>ZM,Ste=e=>{const t=[];return Ft(ns(e)?e:[e],n=>{const r=eo(n);Ft(r,o=>{Xt(t,ZM[o]=n[o])})}),t},kte="__osOptionsValidationPlugin",_te="__osSizeObserverPlugin",Ry="__osScrollbarsHidingPlugin",jte="__osClickScrollPlugin";let Bv;const g_=(e,t,n,r)=>{go(e,t);const o=qp(t),s=dd(t),l=lh(n);return r&&js(t),{x:s.h-o.h+l.h,y:s.w-o.w+l.w}},Ite=e=>{let t=!1;const n=oa(e,KM);try{t=ur(e,Yee("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},Pte=(e,t)=>{const n="hidden";ur(e,{overflowX:n,overflowY:n,direction:"rtl"}),qo(e,0);const r=Lv(e),o=Lv(t);qo(e,-999);const s=Lv(t);return{i:r.x===o.x,n:o.x!==s.x}},Ete=(e,t)=>{const n=oa(e,GM),r=bs(e),o=bs(t),s=r_(o,r,!0),l=oa(e,ite),i=bs(e),u=bs(t),p=r_(u,i,!0);return n(),l(),s&&p},Mte=()=>{const{body:e}=document,n=TM(`<div class="${UM}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=My(),[l,i]=Fo({o:g_(e,n,r),u:FM},g_.bind(0,e,n,r,!0)),[u]=i(),p=Ite(n),m={x:u.x===0,y:u.y===0},h={elements:{host:null,padding:!p,viewport:_=>p&&_===_.ownerDocument.body&&_,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},g=yn({},lte),x=yn.bind(0,{},g),y=yn.bind(0,{},h),b={k:u,A:m,I:p,L:ur(n,"zIndex")==="-1",B:Pte(n,r),V:Ete(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:_=>yn(h,_)&&y(),F:x,G:_=>yn(g,_)&&x(),X:yn({},h),U:yn({},g)},C=window.addEventListener,S=Py(_=>s(_?"z":"r"),{v:33,g:99});if(Or(n,"style"),js(n),C("resize",S.bind(0,!1)),!p&&(!m.x||!m.y)){let _;C("resize",()=>{const j=Jl()[Ry];_=_||j&&j.R(),_&&_(b,l,S.bind(0,!0))})}return b},Hr=()=>(Bv||(Bv=Mte()),Bv),Ay=(e,t)=>ts(t)?t.apply(0,e):t,Ote=(e,t,n,r)=>{const o=Ca(r)?n:r;return Ay(e,o)||t.apply(0,e)},JM=(e,t,n,r)=>{const o=Ca(r)?n:r,s=Ay(e,o);return!!s&&(rh(s)?s:t.apply(0,e))},Dte=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:l}=Hr(),{nativeScrollbarsOverlaid:i,body:u}=t,p=r??i,m=Ca(o)?u:o,h=(s.x||s.y)&&p,g=e&&(pg(m)?!l:m);return!!h||!!g},Ty=new WeakMap,Rte=(e,t)=>{Ty.set(e,t)},Ate=e=>{Ty.delete(e)},e8=e=>Ty.get(e),v_=(e,t)=>e?t.split(".").reduce((n,r)=>n&&gg(n,r)?n[r]:void 0,e):void 0,gx=(e,t,n)=>r=>[v_(e,r),n||v_(t,r)!==void 0],t8=e=>{let t=e;return[()=>t,n=>{t=yn({},t,n)}]},_p="tabindex",jp=zl.bind(0,""),Hv=e=>{go(ca(e),_y(e)),js(e)},Tte=e=>{const t=Hr(),{N:n,I:r}=t,o=Jl()[Ry],s=o&&o.T,{elements:l}=n(),{host:i,padding:u,viewport:p,content:m}=l,h=rh(e),g=h?{}:e,{elements:x}=g,{host:y,padding:b,viewport:C,content:S}=x||{},_=h?e:g.target,j=oh(_,"textarea"),E=_.ownerDocument,I=E.documentElement,M=_===E.body,D=E.defaultView,R=Ote.bind(0,[_]),A=JM.bind(0,[_]),O=Ay.bind(0,[_]),$=R.bind(0,jp,p),X=A.bind(0,jp,m),z=$(C),V=z===_,Q=V&&M,G=!V&&X(S),F=!V&&rh(z)&&z===G,U=F&&!!O(m),T=U?$():z,B=U?G:X(),re=Q?I:F?T:z,ae=j?R(jp,i,y):_,oe=Q?re:ae,q=F?B:G,K=E.activeElement,ee=!V&&D.top===D&&K===_,ce={W:_,Z:oe,J:re,K:!V&&A(jp,u,b),tt:q,nt:!V&&!r&&s&&s(t),ot:Q?I:re,st:Q?E:re,et:D,ct:E,rt:j,it:M,lt:h,ut:V,dt:F,ft:(Ye,Ke)=>Wee(re,V?Bo:Fa,V?Ke:Ye),_t:(Ye,Ke,he)=>Ll(re,V?Bo:Fa,V?Ke:Ye,he)},J=eo(ce).reduce((Ye,Ke)=>{const he=ce[Ke];return Xt(Ye,he&&!ca(he)?he:!1)},[]),ie=Ye=>Ye?wy(J,Ye)>-1:null,{W:de,Z:xe,K:we,J:ve,tt:fe,nt:Oe}=ce,je=[()=>{Or(xe,Bo),Or(xe,zv),Or(de,zv),M&&(Or(I,Bo),Or(I,zv))}],$e=j&&ie(xe);let st=j?de:_y([fe,ve,we,xe,de].find(Ye=>ie(Ye)===!1));const Ve=Q?de:fe||ve;return[ce,()=>{ir(xe,Bo,V?"viewport":"host"),ir(we,hx,""),ir(fe,u_,""),V||ir(ve,Fa,"");const Ye=M&&!V?oa(ca(_),KM):po;if($e&&(t_(de,xe),Xt(je,()=>{t_(xe,de),js(xe)})),go(Ve,st),go(xe,we),go(we||xe,!V&&ve),go(ve,fe),Xt(je,()=>{Ye(),Or(we,hx),Or(fe,u_),Or(ve,qM),Or(ve,XM),Or(ve,Fa),ie(fe)&&Hv(fe),ie(ve)&&Hv(ve),ie(we)&&Hv(we)}),r&&!V&&(Ll(ve,Fa,QM,!0),Xt(je,Or.bind(0,ve,Fa))),Oe&&(Kee(ve,Oe),Xt(je,js.bind(0,Oe))),ee){const Ke=ir(ve,_p);ir(ve,_p,"-1"),ve.focus();const he=()=>Ke?ir(ve,_p,Ke):Or(ve,_p),Re=Vn(E,"pointerdown keydown",()=>{he(),Re()});Xt(je,[he,Re])}else K&&K.focus&&K.focus();st=0},Ts.bind(0,je)]},$te=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Hr(),{ht:l}=r(),{vt:i}=o,u=(n||!s)&&i;return u&&ur(n,{height:l?"":"100%"}),{gt:u,wt:u}}},Nte=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:l,ut:i}=e,[u,p]=Fo({u:ete,o:s_()},s_.bind(0,o,"padding",""));return(m,h,g)=>{let[x,y]=p(g);const{I:b,V:C}=Hr(),{bt:S}=n(),{gt:_,wt:j,yt:E}=m,[I,M]=h("paddingAbsolute");(_||y||!C&&j)&&([x,y]=u(g));const R=!i&&(M||E||y);if(R){const A=!I||!s&&!b,O=x.r+x.l,$=x.t+x.b,X={marginRight:A&&!S?-O:0,marginBottom:A?-$:0,marginLeft:A&&S?-O:0,top:A?-x.t:0,right:A?S?-x.r:"auto":0,left:A?S?"auto":-x.l:0,width:A?`calc(100% + ${O}px)`:""},z={paddingTop:A?x.t:0,paddingRight:A?x.r:0,paddingBottom:A?x.b:0,paddingLeft:A?x.l:0};ur(s||l,X),ur(l,z),r({K:x,St:!A,P:s?z:yn({},X,z)})}return{xt:R}}},{max:vx}=Math,Ba=vx.bind(0,0),n8="visible",x_="hidden",Lte=42,Ip={u:zM,o:{w:0,h:0}},zte={u:FM,o:{x:x_,y:x_}},Fte=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Ba(e.w-t.w),h:Ba(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Pp=e=>e.indexOf(n8)===0,Bte=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:l,nt:i,ut:u,_t:p,it:m,et:h}=e,{k:g,V:x,I:y,A:b}=Hr(),C=Jl()[Ry],S=!u&&!y&&(b.x||b.y),_=m&&u,[j,E]=Fo(Ip,lh.bind(0,l)),[I,M]=Fo(Ip,ah.bind(0,l)),[D,R]=Fo(Ip),[A,O]=Fo(Ip),[$]=Fo(zte),X=(U,T)=>{if(ur(l,{height:""}),T){const{St:B,K:Y}=n(),{$t:re,D:ae}=U,oe=lh(o),q=qp(o),K=ur(l,"boxSizing")==="content-box",ee=B||K?Y.b+Y.t:0,ce=!(b.x&&K);ur(l,{height:q.h+oe.h+(re.x&&ce?ae.x:0)-ee})}},z=(U,T)=>{const B=!y&&!U?Lte:0,Y=(ie,de,xe)=>{const we=ur(l,ie),fe=(T?T[ie]:we)==="scroll";return[we,fe,fe&&!y?de?B:xe:0,de&&!!B]},[re,ae,oe,q]=Y("overflowX",b.x,g.x),[K,ee,ce,J]=Y("overflowY",b.y,g.y);return{Ct:{x:re,y:K},$t:{x:ae,y:ee},D:{x:oe,y:ce},M:{x:q,y:J}}},V=(U,T,B,Y)=>{const re=(ee,ce)=>{const J=Pp(ee),ie=ce&&J&&ee.replace(`${n8}-`,"")||"";return[ce&&!J?ee:"",Pp(ie)?"hidden":ie]},[ae,oe]=re(B.x,T.x),[q,K]=re(B.y,T.y);return Y.overflowX=oe&&q?oe:ae,Y.overflowY=K&&ae?K:q,z(U,Y)},Q=(U,T,B,Y)=>{const{D:re,M:ae}=U,{x:oe,y:q}=ae,{x:K,y:ee}=re,{P:ce}=n(),J=T?"marginLeft":"marginRight",ie=T?"paddingLeft":"paddingRight",de=ce[J],xe=ce.marginBottom,we=ce[ie],ve=ce.paddingBottom;Y.width=`calc(100% + ${ee+-1*de}px)`,Y[J]=-ee+de,Y.marginBottom=-K+xe,B&&(Y[ie]=we+(q?ee:0),Y.paddingBottom=ve+(oe?K:0))},[G,F]=C?C.H(S,x,l,i,n,z,Q):[()=>S,()=>[po]];return(U,T,B)=>{const{gt:Y,Ot:re,wt:ae,xt:oe,vt:q,yt:K}=U,{ht:ee,bt:ce}=n(),[J,ie]=T("showNativeOverlaidScrollbars"),[de,xe]=T("overflow"),we=J&&b.x&&b.y,ve=!u&&!x&&(Y||ae||re||ie||q),fe=Pp(de.x),Oe=Pp(de.y),je=fe||Oe;let $e=E(B),st=M(B),Ve=R(B),Ct=O(B),Ye;if(ie&&y&&p(QM,cte,!we),ve&&(Ye=z(we),X(Ye,ee)),Y||oe||ae||K||ie){je&&p(gc,hc,!1);const[ke,ze]=F(we,ce,Ye),[Le,Ge]=$e=j(B),[pt,Pn]=st=I(B),Rt=qp(l);let At=pt,pr=Rt;ke(),(Pn||Ge||ie)&&ze&&!we&&G(ze,pt,Le,ce)&&(pr=qp(l),At=ah(l));const Nn={w:Ba(vx(pt.w,At.w)+Le.w),h:Ba(vx(pt.h,At.h)+Le.h)},wn={w:Ba((_?h.innerWidth:pr.w+Ba(Rt.w-pt.w))+Le.w),h:Ba((_?h.innerHeight+Le.h:pr.h+Ba(Rt.h-pt.h))+Le.h)};Ct=A(wn),Ve=D(Fte(Nn,wn),B)}const[Ke,he]=Ct,[Re,ut]=Ve,[yt,ye]=st,[et,ct]=$e,ft={x:Re.w>0,y:Re.h>0},Me=fe&&Oe&&(ft.x||ft.y)||fe&&ft.x&&!ft.y||Oe&&ft.y&&!ft.x;if(oe||K||ct||ye||he||ut||xe||ie||ve){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},ze=V(we,ft,de,ke),Le=G(ze,yt,et,ce);u||Q(ze,ce,Le,ke),ve&&X(ze,ee),u?(ir(o,qM,ke.overflowX),ir(o,XM,ke.overflowY)):ur(l,ke)}Ll(o,Bo,hc,Me),Ll(s,hx,ute,Me),u||Ll(l,Fa,gc,je);const[Ne,Ut]=$(z(we).Ct);return r({Ct:Ne,zt:{x:Ke.w,y:Ke.h},Tt:{x:Re.w,y:Re.h},Et:ft}),{It:Ut,At:he,Lt:ut}}},b_=(e,t,n)=>{const r={},o=t||{},s=eo(e).concat(eo(o));return Ft(s,l=>{const i=e[l],u=o[l];r[l]=!!(n||i||u)}),r},Hte=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:l,A:i,V:u}=Hr(),p=!l&&(i.x||i.y),m=[$te(e,t),Nte(e,t),Bte(e,t)];return(h,g,x)=>{const y=b_(yn({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},g),{},x),b=p||!u,C=b&&qo(r),S=b&&ra(r);o("",ih,!0);let _=y;return Ft(m,j=>{_=b_(_,j(_,h,!!x)||{},x)}),qo(r,C),ra(r,S),o("",ih),s||(qo(n,0),ra(n,0)),_}},Vte=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},l=i=>{if(n){const u=n.reduce((p,m)=>{if(m){const[h,g]=m,x=g&&h&&(i?i(h):AM(h,e));x&&x.length&&g&&dl(g)&&Xt(p,[x,g.trim()],!0)}return p},[]);Ft(u,p=>Ft(p[0],m=>{const h=p[1],g=r.get(m)||[];if(e.contains(m)){const y=Vn(m,h,b=>{o?(y(),r.delete(m)):t(b)});r.set(m,Xt(g,y))}else Ts(g),r.delete(m)}))}};return n&&(r=new WeakMap,l()),[s,l]},y_=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:l,Dt:i,Mt:u,Rt:p,kt:m}=r||{},h=Py(()=>{o&&n(!0)},{v:33,g:99}),[g,x]=Vte(e,h,i),y=s||[],b=l||[],C=y.concat(b),S=(j,E)=>{const I=p||po,M=m||po,D=new Set,R=new Set;let A=!1,O=!1;if(Ft(j,$=>{const{attributeName:X,target:z,type:V,oldValue:Q,addedNodes:G,removedNodes:F}=$,U=V==="attributes",T=V==="childList",B=e===z,Y=U&&dl(X)?ir(z,X):0,re=Y!==0&&Q!==Y,ae=wy(b,X)>-1&&re;if(t&&(T||!B)){const oe=!U,q=U&&re,K=q&&u&&oh(z,u),ce=(K?!I(z,X,Q,Y):oe||q)&&!M($,!!K,e,r);Ft(G,J=>D.add(J)),Ft(F,J=>D.add(J)),O=O||ce}!t&&B&&re&&!I(z,X,Q,Y)&&(R.add(X),A=A||ae)}),D.size>0&&x($=>Zl(D).reduce((X,z)=>(Xt(X,AM($,z)),oh(z,$)?Xt(X,z):X),[])),t)return!E&&O&&n(!1),[!1];if(R.size>0||A){const $=[Zl(R),A];return!E&&n.apply(0,$),$}},_=new Zee(j=>S(j));return _.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:C,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(g(),_.disconnect(),o=!1)},()=>{if(o){h.m();const j=_.takeRecords();return!Sy(j)&&S(j,!0)}}]},Ep=3333333,Mp=e=>e&&(e.height||e.width),r8=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Jl()[_te],{B:l}=Hr(),u=TM(`<div class="${Oy}"><div class="${fte}"></div></div>`)[0],p=u.firstChild,m=ud.bind(0,e),[h]=Fo({o:void 0,_:!0,u:(b,C)=>!(!b||!Mp(b)&&Mp(C))}),g=b=>{const C=ns(b)&&b.length>0&&cd(b[0]),S=!C&&Cy(b[0]);let _=!1,j=!1,E=!0;if(C){const[I,,M]=h(b.pop().contentRect),D=Mp(I),R=Mp(M);_=!M||!D,j=!R&&D,E=!_}else S?[,E]=b:j=b===!0;if(r&&E){const I=S?b[0]:ud(u);qo(u,I?l.n?-Ep:l.i?0:Ep:Ep),ra(u,Ep)}_||t({gt:!S,Yt:S?b:void 0,Vt:!!j})},x=[];let y=o?g:!1;return[()=>{Ts(x),js(u)},()=>{if(tc){const b=new tc(g);b.observe(p),Xt(x,()=>{b.disconnect()})}else if(s){const[b,C]=s.O(p,g,o);y=b,Xt(x,C)}if(r){const[b]=Fo({o:void 0},m);Xt(x,Vn(u,"scroll",C=>{const S=b(),[_,j,E]=S;j&&(Iy(p,"ltr rtl"),_?oa(p,"rtl"):oa(p,"ltr"),g([!!_,j,E])),HM(C)}))}y&&(oa(u,dte),Xt(x,Vn(u,"animationstart",y,{C:!!tc}))),(tc||s)&&go(e,u)}]},Wte=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,Ute=(e,t)=>{let n;const r=zl(pte),o=[],[s]=Fo({o:!1}),l=(u,p)=>{if(u){const m=s(Wte(u)),[,h]=m;if(h)return!p&&t(m),[m]}},i=(u,p)=>{if(u&&u.length>0)return l(u.pop(),p)};return[()=>{Ts(o),js(r)},()=>{if(n_)n=new n_(u=>i(u),{root:e}),n.observe(r),Xt(o,()=>{n.disconnect()});else{const u=()=>{const h=dd(r);l(h)},[p,m]=r8(r,u);Xt(o,p),m(),u()}go(e,r)},()=>{if(n)return i(n.takeRecords(),!0)}]},C_=`[${Bo}]`,Gte=`[${Fa}]`,Vv=["tabindex"],w_=["wrap","cols","rows"],Wv=["id","class","style","open"],Kte=(e,t,n)=>{let r,o,s;const{Z:l,J:i,tt:u,rt:p,ut:m,ft:h,_t:g}=e,{V:x}=Hr(),[y]=Fo({u:zM,o:{w:0,h:0}},()=>{const V=h(gc,hc),Q=h(Fv,""),G=Q&&qo(i),F=Q&&ra(i);g(gc,hc),g(Fv,""),g("",ih,!0);const U=ah(u),T=ah(i),B=lh(i);return g(gc,hc,V),g(Fv,"",Q),g("",ih),qo(i,G),ra(i,F),{w:T.w+U.w+B.w,h:T.h+U.h+B.h}}),b=p?w_:Wv.concat(w_),C=Py(n,{v:()=>r,g:()=>o,p(V,Q){const[G]=V,[F]=Q;return[eo(G).concat(eo(F)).reduce((U,T)=>(U[T]=G[T]||F[T],U),{})]}}),S=V=>{Ft(V||Vv,Q=>{if(wy(Vv,Q)>-1){const G=ir(l,Q);dl(G)?ir(i,Q,G):Or(i,Q)}})},_=(V,Q)=>{const[G,F]=V,U={vt:F};return t({ht:G}),!Q&&n(U),U},j=({gt:V,Yt:Q,Vt:G})=>{const F=!V||G?n:C;let U=!1;if(Q){const[T,B]=Q;U=B,t({bt:T})}F({gt:V,yt:U})},E=(V,Q)=>{const[,G]=y(),F={wt:G};return G&&!Q&&(V?n:C)(F),F},I=(V,Q,G)=>{const F={Ot:Q};return Q?!G&&C(F):m||S(V),F},[M,D,R]=u||!x?Ute(l,_):[po,po,po],[A,O]=m?[po,po]:r8(l,j,{Vt:!0,Bt:!0}),[$,X]=y_(l,!1,I,{Pt:Wv,Ht:Wv.concat(Vv)}),z=m&&tc&&new tc(j.bind(0,{gt:!0}));return z&&z.observe(l),S(),[()=>{M(),A(),s&&s[0](),z&&z.disconnect(),$()},()=>{O(),D()},()=>{const V={},Q=X(),G=R(),F=s&&s[1]();return Q&&yn(V,I.apply(0,Xt(Q,!0))),G&&yn(V,_.apply(0,Xt(G,!0))),F&&yn(V,E.apply(0,Xt(F,!0))),V},V=>{const[Q]=V("update.ignoreMutation"),[G,F]=V("update.attributes"),[U,T]=V("update.elementEvents"),[B,Y]=V("update.debounce"),re=T||F,ae=oe=>ts(Q)&&Q(oe);if(re&&(s&&(s[1](),s[0]()),s=y_(u||i,!0,E,{Ht:b.concat(G||[]),Dt:U,Mt:C_,kt:(oe,q)=>{const{target:K,attributeName:ee}=oe;return(!q&&ee&&!m?Gee(K,C_,Gte):!1)||!!ec(K,`.${Br}`)||!!ae(oe)}})),Y)if(C.m(),ns(B)){const oe=B[0],q=B[1];r=Qa(oe)&&oe,o=Qa(q)&&q}else Qa(B)?(r=B,o=!1):(r=!1,o=!1)}]},S_={x:0,y:0},qte=e=>({K:{t:0,r:0,b:0,l:0},St:!1,P:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},zt:S_,Tt:S_,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:ud(e.Z)}),Xte=(e,t)=>{const n=gx(t,{}),[r,o,s]=My(),[l,i,u]=Tte(e),p=t8(qte(l)),[m,h]=p,g=Hte(l,p),x=(j,E,I)=>{const D=eo(j).some(R=>j[R])||!ky(E)||I;return D&&s("u",[j,E,I]),D},[y,b,C,S]=Kte(l,h,j=>x(g(n,j),{},!1)),_=m.bind(0);return _.jt=j=>r("u",j),_.Nt=()=>{const{W:j,J:E}=l,I=qo(j),M=ra(j);b(),i(),qo(E,I),ra(E,M)},_.qt=l,[(j,E)=>{const I=gx(t,j,E);return S(I),x(g(I,C(),E),j,!!E)},_,()=>{o(),y(),u()}]},{round:k_}=Math,Qte=e=>{const{width:t,height:n}=bs(e),{w:r,h:o}=dd(e);return{x:k_(t)/r||1,y:k_(n)/o||1}},Yte=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:l}=e,{pointers:i}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(i||[]).includes(l)},Zte=(e,t)=>Vn(e,"mousedown",Vn.bind(0,t,"click",HM,{C:!0,$:!0}),{$:!0}),__="pointerup pointerleave pointercancel lostpointercapture",Jte=(e,t,n,r,o,s,l)=>{const{B:i}=Hr(),{Ft:u,Gt:p,Xt:m}=r,h=`scroll${l?"Left":"Top"}`,g=`client${l?"X":"Y"}`,x=l?"width":"height",y=l?"left":"top",b=l?"w":"h",C=l?"x":"y",S=(_,j)=>E=>{const{Tt:I}=s(),M=dd(p)[b]-dd(u)[b],R=j*E/M*I[C],O=ud(m)&&l?i.n||i.i?1:-1:1;o[h]=_+R*O};return Vn(p,"pointerdown",_=>{const j=ec(_.target,`.${Dy}`)===u,E=j?u:p;if(Ll(t,Bo,c_,!0),Yte(_,e,j)){const I=!j&&_.shiftKey,M=()=>bs(u),D=()=>bs(p),R=(T,B)=>(T||M())[y]-(B||D())[y],A=S(o[h]||0,1/Qte(o)[C]),O=_[g],$=M(),X=D(),z=$[x],V=R($,X)+z/2,Q=O-X[y],G=j?0:Q-V,F=T=>{Ts(U),E.releasePointerCapture(T.pointerId)},U=[Ll.bind(0,t,Bo,c_),Vn(n,__,F),Vn(n,"selectstart",T=>VM(T),{S:!1}),Vn(p,__,F),Vn(p,"pointermove",T=>{const B=T[g]-O;(j||I)&&A(G+B)})];if(I)A(G);else if(!j){const T=Jl()[jte];T&&Xt(U,T.O(A,R,G,z,Q))}E.setPointerCapture(_.pointerId)}})},ene=(e,t)=>(n,r,o,s,l,i)=>{const{Xt:u}=n,[p,m]=qi(333),h=!!l.scrollBy;let g=!0;return Ts.bind(0,[Vn(u,"pointerenter",()=>{r(f_,!0)}),Vn(u,"pointerleave pointercancel",()=>{r(f_)}),Vn(u,"wheel",x=>{const{deltaX:y,deltaY:b,deltaMode:C}=x;h&&g&&C===0&&ca(u)===s&&l.scrollBy({left:y,top:b,behavior:"smooth"}),g=!1,r(h_,!0),p(()=>{g=!0,r(h_)}),VM(x)},{S:!1,$:!0}),Zte(u,o),Jte(e,s,o,n,l,t,i),m])},{min:xx,max:j_,abs:tne,round:nne}=Math,o8=(e,t,n,r)=>{if(r){const i=n?"x":"y",{Tt:u,zt:p}=r,m=p[i],h=u[i];return j_(0,xx(1,m/(m+h)))}const o=n?"width":"height",s=bs(e)[o],l=bs(t)[o];return j_(0,xx(1,s/l))},rne=(e,t,n,r,o,s)=>{const{B:l}=Hr(),i=s?"x":"y",u=s?"Left":"Top",{Tt:p}=r,m=nne(p[i]),h=tne(n[`scroll${u}`]),g=s&&o,x=l.i?h:m-h,b=xx(1,(g?x:h)/m),C=o8(e,t,s);return 1/C*(1-C)*b},one=(e,t,n)=>{const{N:r,L:o}=Hr(),{scrollbars:s}=r(),{slot:l}=s,{ct:i,W:u,Z:p,J:m,lt:h,ot:g,it:x,ut:y}=t,{scrollbars:b}=h?{}:e,{slot:C}=b||{},S=JM([u,p,m],()=>y&&x?u:p,l,C),_=(G,F,U)=>{const T=U?oa:Iy;Ft(G,B=>{T(B.Xt,F)})},j=(G,F)=>{Ft(G,U=>{const[T,B]=F(U);ur(T,B)})},E=(G,F,U)=>{j(G,T=>{const{Ft:B,Gt:Y}=T;return[B,{[U?"width":"height"]:`${(100*o8(B,Y,U,F)).toFixed(3)}%`}]})},I=(G,F,U)=>{const T=U?"X":"Y";j(G,B=>{const{Ft:Y,Gt:re,Xt:ae}=B,oe=rne(Y,re,g,F,ud(ae),U);return[Y,{transform:oe===oe?`translate${T}(${(100*oe).toFixed(3)}%)`:""}]})},M=[],D=[],R=[],A=(G,F,U)=>{const T=Cy(U),B=T?U:!0,Y=T?!U:!0;B&&_(D,G,F),Y&&_(R,G,F)},O=G=>{E(D,G,!0),E(R,G)},$=G=>{I(D,G,!0),I(R,G)},X=G=>{const F=G?vte:xte,U=G?D:R,T=Sy(U)?d_:"",B=zl(`${Br} ${F} ${T}`),Y=zl(YM),re=zl(Dy),ae={Xt:B,Gt:Y,Ft:re};return o||oa(B,mte),go(B,Y),go(Y,re),Xt(U,ae),Xt(M,[js.bind(0,B),n(ae,A,i,p,g,G)]),ae},z=X.bind(0,!0),V=X.bind(0,!1),Q=()=>{go(S,D[0].Xt),go(S,R[0].Xt),sh(()=>{A(d_)},300)};return z(),V(),[{Ut:O,Wt:$,Zt:A,Jt:{Kt:D,Qt:z,tn:j.bind(0,D)},nn:{Kt:R,Qt:V,tn:j.bind(0,R)}},Q,Ts.bind(0,M)]},sne=(e,t,n,r)=>{let o,s,l,i,u,p=0;const m=t8({}),[h]=m,[g,x]=qi(),[y,b]=qi(),[C,S]=qi(100),[_,j]=qi(100),[E,I]=qi(()=>p),[M,D,R]=one(e,n.qt,ene(t,n)),{Z:A,J:O,ot:$,st:X,ut:z,it:V}=n.qt,{Jt:Q,nn:G,Zt:F,Ut:U,Wt:T}=M,{tn:B}=Q,{tn:Y}=G,re=ee=>{const{Xt:ce}=ee,J=z&&!V&&ca(ce)===O&&ce;return[J,{transform:J?`translate(${qo($)}px, ${ra($)}px)`:""}]},ae=(ee,ce)=>{if(I(),ee)F(m_);else{const J=()=>F(m_,!0);p>0&&!ce?E(J):J()}},oe=()=>{i=s,i&&ae(!0)},q=[S,I,j,b,x,R,Vn(A,"pointerover",oe,{C:!0}),Vn(A,"pointerenter",oe),Vn(A,"pointerleave",()=>{i=!1,s&&ae(!1)}),Vn(A,"pointermove",()=>{o&&g(()=>{S(),ae(!0),_(()=>{o&&ae(!1)})})}),Vn(X,"scroll",ee=>{y(()=>{T(n()),l&&ae(!0),C(()=>{l&&!i&&ae(!1)})}),r(ee),z&&B(re),z&&Y(re)})],K=h.bind(0);return K.qt=M,K.Nt=D,[(ee,ce,J)=>{const{At:ie,Lt:de,It:xe,yt:we}=J,{A:ve}=Hr(),fe=gx(t,ee,ce),Oe=n(),{Tt:je,Ct:$e,bt:st}=Oe,[Ve,Ct]=fe("showNativeOverlaidScrollbars"),[Ye,Ke]=fe("scrollbars.theme"),[he,Re]=fe("scrollbars.visibility"),[ut,yt]=fe("scrollbars.autoHide"),[ye]=fe("scrollbars.autoHideDelay"),[et,ct]=fe("scrollbars.dragScroll"),[ft,Me]=fe("scrollbars.clickScroll"),Ne=ie||de||we,Ut=xe||Re,ke=Ve&&ve.x&&ve.y,ze=(Le,Ge)=>{const pt=he==="visible"||he==="auto"&&Le==="scroll";return F(bte,pt,Ge),pt};if(p=ye,Ct&&F(hte,ke),Ke&&(F(u),F(Ye,!0),u=Ye),yt&&(o=ut==="move",s=ut==="leave",l=ut!=="never",ae(!l,!0)),ct&&F(wte,et),Me&&F(Cte,ft),Ut){const Le=ze($e.x,!0),Ge=ze($e.y,!1);F(yte,!(Le&&Ge))}Ne&&(U(Oe),T(Oe),F(p_,!je.x,!0),F(p_,!je.y,!1),F(gte,st&&!V))},K,Ts.bind(0,q)]},s8=(e,t,n)=>{ts(e)&&e(t||void 0,n||void 0)},Ua=(e,t,n)=>{const{F:r,N:o,Y:s,j:l}=Hr(),i=Jl(),u=rh(e),p=u?e:e.target,m=e8(p);if(t&&!m){let h=!1;const g=z=>{const V=Jl()[kte],Q=V&&V.O;return Q?Q(z,!0):z},x=yn({},r(),g(t)),[y,b,C]=My(n),[S,_,j]=Xte(e,x),[E,I,M]=sne(e,x,_,z=>C("scroll",[X,z])),D=(z,V)=>S(z,!!V),R=D.bind(0,{},!0),A=s(R),O=l(R),$=z=>{Ate(p),A(),O(),M(),j(),h=!0,C("destroyed",[X,!!z]),b()},X={options(z,V){if(z){const Q=V?r():{},G=WM(x,yn(Q,g(z)));ky(G)||(yn(x,G),D(G))}return yn({},x)},on:y,off:(z,V)=>{z&&V&&b(z,V)},state(){const{zt:z,Tt:V,Ct:Q,Et:G,K:F,St:U,bt:T}=_();return yn({},{overflowEdge:z,overflowAmount:V,overflowStyle:Q,hasOverflow:G,padding:F,paddingAbsolute:U,directionRTL:T,destroyed:h})},elements(){const{W:z,Z:V,K:Q,J:G,tt:F,ot:U,st:T}=_.qt,{Jt:B,nn:Y}=I.qt,re=oe=>{const{Ft:q,Gt:K,Xt:ee}=oe;return{scrollbar:ee,track:K,handle:q}},ae=oe=>{const{Kt:q,Qt:K}=oe,ee=re(q[0]);return yn({},ee,{clone:()=>{const ce=re(K());return E({},!0,{}),ce}})};return yn({},{target:z,host:V,padding:Q||G,viewport:G,content:F||G,scrollOffsetElement:U,scrollEventElement:T,scrollbarHorizontal:ae(B),scrollbarVertical:ae(Y)})},update:z=>D({},z),destroy:$.bind(0)};return _.jt((z,V,Q)=>{E(V,Q,z)}),Rte(p,X),Ft(eo(i),z=>s8(i[z],0,X)),Dte(_.qt.it,o().cancel,!u&&e.cancel)?($(!0),X):(_.Nt(),I.Nt(),C("initialized",[X]),_.jt((z,V,Q)=>{const{gt:G,yt:F,vt:U,At:T,Lt:B,It:Y,wt:re,Ot:ae}=z;C("updated",[X,{updateHints:{sizeChanged:G,directionChanged:F,heightIntrinsicChanged:U,overflowEdgeChanged:T,overflowAmountChanged:B,overflowStyleChanged:Y,contentMutation:re,hostMutation:ae},changedOptions:V,force:Q}])}),X.update(!0),X)}return m};Ua.plugin=e=>{Ft(Ste(e),t=>s8(t,Ua))};Ua.valid=e=>{const t=e&&e.elements,n=ts(t)&&t();return dx(n)&&!!e8(n.target)};Ua.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:l,U:i,N:u,q:p,F:m,G:h}=Hr();return yn({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:l,staticDefaultOptions:i,getDefaultInitialization:u,setDefaultInitialization:p,getDefaultOptions:m,setDefaultOptions:h})};const ane=()=>{if(typeof window>"u"){const p=()=>{};return[p,p]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,l=r?n.requestIdleCallback:o,i=r?n.cancelIdleCallback:s,u=()=>{i(e),s(t)};return[(p,m)=>{u(),e=l(r?()=>{u(),t=o(p)}:p,typeof m=="object"?m:{timeout:2233})},u]},$y=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=d.useMemo(ane,[]),l=d.useRef(null),i=d.useRef(r),u=d.useRef(t),p=d.useRef(n);return d.useEffect(()=>{i.current=r},[r]),d.useEffect(()=>{const{current:m}=l;u.current=t,Ua.valid(m)&&m.options(t||{},!0)},[t]),d.useEffect(()=>{const{current:m}=l;p.current=n,Ua.valid(m)&&m.on(n||{},!0)},[n]),d.useEffect(()=>()=>{var m;s(),(m=l.current)==null||m.destroy()},[]),d.useMemo(()=>[m=>{const h=l.current;if(Ua.valid(h))return;const g=i.current,x=u.current||{},y=p.current||{},b=()=>l.current=Ua(m,x,y);g?o(b,g):b()},()=>l.current],[])},lne=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:l,...i}=e,u=n,p=d.useRef(null),m=d.useRef(null),[h,g]=$y({options:r,events:o,defer:s});return d.useEffect(()=>{const{current:x}=p,{current:y}=m;return x&&y&&h({target:x,elements:{viewport:y,content:y}}),()=>{var b;return(b=g())==null?void 0:b.destroy()}},[h,n]),d.useImperativeHandle(t,()=>({osInstance:g,getElement:()=>p.current}),[]),H.createElement(u,{"data-overlayscrollbars-initialize":"",ref:p,...i},H.createElement("div",{ref:m},l))},xg=d.forwardRef(lne),ine=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=Z(),o=W(_=>_.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:l}=IR((t==null?void 0:t.board_id)??Zr.skipToken),i=d.useMemo(()=>le([ge],_=>{const j=(s??[]).map(I=>sI(_,I));return{imageUsageSummary:{isInitialImage:Vo(j,I=>I.isInitialImage),isCanvasImage:Vo(j,I=>I.isCanvasImage),isNodesImage:Vo(j,I=>I.isNodesImage),isControlImage:Vo(j,I=>I.isControlImage)}}}),[s]),[u,{isLoading:p}]=PR(),[m,{isLoading:h}]=ER(),{imageUsageSummary:g}=W(i),x=d.useCallback(()=>{t&&(u(t.board_id),n(void 0))},[t,u,n]),y=d.useCallback(()=>{t&&(m(t.board_id),n(void 0))},[t,m,n]),b=d.useCallback(()=>{n(void 0)},[n]),C=d.useRef(null),S=d.useMemo(()=>h||p||l,[h,p,l]);return t?a.jsx(Ld,{isOpen:!!t,onClose:b,leastDestructiveRef:C,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(zd,{children:[a.jsxs(Yo,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Jo,{children:a.jsxs(N,{direction:"column",gap:3,children:[l?a.jsx(Xh,{children:a.jsx(N,{sx:{w:"full",h:32}})}):a.jsx(cM,{imageUsage:g,topMessage:r("boards.topMessage"),bottomMessage:r("boards.bottomMessage")}),a.jsx(be,{children:"Deleted boards cannot be restored."}),a.jsx(be,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(ks,{children:a.jsxs(N,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(ot,{ref:C,onClick:b,children:"Cancel"}),a.jsx(ot,{colorScheme:"warning",isLoading:S,onClick:x,children:"Delete Board Only"}),a.jsx(ot,{colorScheme:"error",isLoading:S,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},cne=d.memo(ine),une=()=>{const{t:e}=Z(),[t,{isLoading:n}]=MR(),r=e("boards.myBoard"),o=d.useCallback(()=>{t(r)},[t,r]);return a.jsx(Be,{icon:a.jsx(Xa,{}),isLoading:n,tooltip:e("boards.addBoard"),"aria-label":e("boards.addBoard"),onClick:o,size:"sm","data-testid":"add-board-button"})},dne=d.memo(une);var a8=jh({displayName:"ExternalLinkIcon",path:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("path",{d:"M15 3h6v6"}),a.jsx("path",{d:"M10 14L21 3"})]})}),bg=jh({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),fne=jh({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),pne=jh({displayName:"DeleteIcon",path:a.jsx("g",{fill:"currentColor",children:a.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});const mne=le([ge],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},Ce),hne=()=>{const e=te(),{boardSearchText:t}=W(mne),n=d.useRef(null),{t:r}=Z(),o=d.useCallback(u=>{e(uw(u))},[e]),s=d.useCallback(()=>{e(uw(""))},[e]),l=d.useCallback(u=>{u.key==="Escape"&&s()},[s]),i=d.useCallback(u=>{o(u.target.value)},[o]);return d.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(f3,{children:[a.jsx(Ah,{ref:n,placeholder:r("boards.searchBoard"),value:t,onKeyDown:l,onChange:i,"data-testid":"board-search-input"}),t&&t.length&&a.jsx($b,{children:a.jsx(Cs,{onClick:s,size:"xs",variant:"ghost","aria-label":r("boards.clearSearch"),opacity:.5,icon:a.jsx(fne,{boxSize:2})})})]})},gne=d.memo(hne);function l8(e){return OR(e)}function vne(e){return DR(e)}const i8=(e,t)=>{var o,s;if(!e||!(t!=null&&t.data.current))return!1;const{actionType:n}=e,{payloadType:r}=t.data.current;if(e.id===t.data.current.id)return!1;switch(n){case"ADD_FIELD_TO_LINEAR":return r==="NODE_FIELD";case"SET_CURRENT_IMAGE":return r==="IMAGE_DTO";case"SET_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_CONTROL_ADAPTER_IMAGE":return r==="IMAGE_DTO";case"SET_CANVAS_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_NODES_IMAGE":return r==="IMAGE_DTO";case"SET_MULTI_NODES_IMAGE":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BATCH":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:i}=t.data.current.payload,u=i.board_id??"none",p=e.context.boardId;return u!==p}if(r==="IMAGE_DTOS"){const{imageDTOs:i}=t.data.current.payload,u=((o=i[0])==null?void 0:o.board_id)??"none",p=e.context.boardId;return u!==p}return!1}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:i}=t.data.current.payload;return(i.board_id??"none")!=="none"}if(r==="IMAGE_DTOS"){const{imageDTOs:i}=t.data.current.payload;return(((s=i[0])==null?void 0:s.board_id)??"none")!=="none"}return!1}default:return!1}},xne=e=>{const{isOver:t,label:n="Drop"}=e,r=d.useRef(Js()),{colorMode:o}=ha();return a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs(N,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx(N,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Ae("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(N,{sx:{position:"absolute",top:.5,insetInlineStart:.5,insetInlineEnd:.5,bottom:.5,opacity:1,borderWidth:2,borderColor:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),borderRadius:"lg",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(Ie,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.1)":"scale(1)",color:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},c8=d.memo(xne),bne=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=d.useRef(Js()),{isOver:s,setNodeRef:l,active:i}=l8({id:o.current,disabled:r,data:n});return a.jsx(Ie,{ref:l,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:i?"auto":"none",children:a.jsx(dr,{children:i8(n,i)&&a.jsx(c8,{isOver:s,label:t})})})},Ny=d.memo(bne),yne=({isSelected:e,isHovered:t})=>a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e?1:.7,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:e?t?"hoverSelected.light":"selected.light":t?"hoverUnselected.light":void 0,_dark:{shadow:e?t?"hoverSelected.dark":"selected.dark":t?"hoverUnselected.dark":void 0}}}),Ly=d.memo(yne),Cne=()=>{const{t:e}=Z();return a.jsx(N,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(As,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:e("common.auto")})})},u8=d.memo(Cne);function zy(e){const[t,n]=d.useState(!1),[r,o]=d.useState(!1),[s,l]=d.useState(!1),[i,u]=d.useState([0,0]),p=d.useRef(null),m=W(g=>g.ui.globalContextMenuCloseTrigger);d.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{l(!0)})});else{l(!1);const g=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(g)}},[t]),d.useEffect(()=>{n(!1),l(!1),o(!1)},[m]),CF("contextmenu",g=>{var x;(x=p.current)!=null&&x.contains(g.target)||g.target===p.current?(g.preventDefault(),n(!0),u([g.pageX,g.pageY])):n(!1)});const h=d.useCallback(()=>{var g,x;(x=(g=e.menuProps)==null?void 0:g.onClose)==null||x.call(g),n(!1)},[e.menuProps]);return a.jsxs(a.Fragment,{children:[e.children(p),r&&a.jsx($c,{...e.portalProps,children:a.jsxs(Nh,{isOpen:s,gutter:0,...e.menuProps,onClose:h,children:[a.jsx(Lh,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:i[0],top:i[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const yg=e=>{const{boardName:t}=Sd(void 0,{selectFromResult:({data:n})=>{const r=n==null?void 0:n.find(s=>s.board_id===e);return{boardName:(r==null?void 0:r.board_name)||dI("boards.uncategorized")}}});return t},wne=({board:e,setBoardToDelete:t})=>{const n=d.useCallback(()=>{t&&t(e)},[e,t]);return a.jsxs(a.Fragment,{children:[e.image_count>0&&a.jsx(a.Fragment,{}),a.jsx(Kt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Fr,{}),onClick:n,children:"Delete Board"})]})},Sne=d.memo(wne),kne=()=>a.jsx(a.Fragment,{}),_ne=d.memo(kne),jne=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const{t:o}=Z(),s=te(),l=d.useMemo(()=>le(ge,({gallery:b})=>{const C=b.autoAddBoardId===t,S=b.autoAssignBoardOnClick;return{isAutoAdd:C,autoAssignBoardOnClick:S}},Ce),[t]),{isAutoAdd:i,autoAssignBoardOnClick:u}=W(l),p=yg(t),m=$t("bulkDownload").isFeatureEnabled,[h]=fI(),g=d.useCallback(()=>{s(yh(t))},[t,s]),x=d.useCallback(async()=>{try{const b=await h({image_names:[],board_id:t}).unwrap();s(lt({title:o("gallery.preparingDownload"),status:"success",...b.response?{description:b.response}:{}}))}catch{s(lt({title:o("gallery.preparingDownloadFailed"),status:"error"}))}},[o,t,h,s]),y=d.useCallback(b=>{b.preventDefault()},[]);return a.jsx(zy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:y,children:a.jsxs(sd,{title:p,children:[a.jsx(Kt,{icon:a.jsx(Xa,{}),isDisabled:i||u,onClick:g,children:o("boards.menuItemAutoAdd")}),m&&a.jsx(Kt,{icon:a.jsx(Gc,{}),onClickCapture:x,children:o("boards.downloadBoard")}),!e&&a.jsx(_ne,{}),e&&a.jsx(Sne,{board:e,setBoardToDelete:n})]})}),children:r})},d8=d.memo(jne),Ine=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=te(),o=d.useMemo(()=>le(ge,({gallery:A})=>{const O=e.board_id===A.autoAddBoardId,$=A.autoAssignBoardOnClick;return{isSelectedForAutoAdd:O,autoAssignBoardOnClick:$}},Ce),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:l}=W(o),[i,u]=d.useState(!1),p=d.useCallback(()=>{u(!0)},[]),m=d.useCallback(()=>{u(!1)},[]),{data:h}=Kx(e.board_id),{data:g}=qx(e.board_id),x=d.useMemo(()=>{if(!((h==null?void 0:h.total)===void 0||(g==null?void 0:g.total)===void 0))return`${h.total} image${h.total===1?"":"s"}, ${g.total} asset${g.total===1?"":"s"}`},[g,h]),{currentData:y}=wo(e.cover_image_name??Zr.skipToken),{board_name:b,board_id:C}=e,[S,_]=d.useState(b),j=d.useCallback(()=>{r(pI({boardId:C})),l&&r(yh(C))},[C,l,r]),[E,{isLoading:I}]=RR(),M=d.useMemo(()=>({id:C,actionType:"ADD_TO_BOARD",context:{boardId:C}}),[C]),D=d.useCallback(async A=>{if(!A.trim()){_(b);return}if(A!==b)try{const{board_name:O}=await E({board_id:C,changes:{board_name:A}}).unwrap();_(O)}catch{_(b)}},[C,b,E]),R=d.useCallback(A=>{_(A)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(N,{onMouseOver:p,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(d8,{board:e,board_id:C,setBoardToDelete:n,children:A=>a.jsx(Vt,{label:x,openDelay:1e3,hasArrow:!0,children:a.jsxs(N,{ref:A,onClick:j,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[y!=null&&y.thumbnail_url?a.jsx(ga,{src:y==null?void 0:y.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Tn,{boxSize:12,as:hee,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(u8,{}),a.jsx(Ly,{isSelected:t,isHovered:i}),a.jsx(N,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:t?"accent.400":"base.500",color:t?"base.50":"base.100",_dark:{bg:t?"accent.500":"base.600",color:t?"base.50":"base.100"},lineHeight:"short",fontSize:"xs"},children:a.jsxs(Oh,{value:S,isDisabled:I,submitOnBlur:!0,onChange:R,onSubmit:D,sx:{w:"full"},children:[a.jsx(Mh,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(Eh,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(Ny,{data:M,dropLabel:a.jsx(be,{fontSize:"md",children:"Move"})})]})})})})})},Pne=d.memo(Ine),Ene=le(ge,({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Ce),f8=d.memo(({isSelected:e})=>{const t=te(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(Ene),o=yg("none"),s=d.useCallback(()=>{t(pI({boardId:"none"})),r&&t(yh("none"))},[t,r]),[l,i]=d.useState(!1),{data:u}=Kx("none"),{data:p}=qx("none"),m=d.useMemo(()=>{if(!((u==null?void 0:u.total)===void 0||(p==null?void 0:p.total)===void 0))return`${u.total} image${u.total===1?"":"s"}, ${p.total} asset${p.total===1?"":"s"}`},[p,u]),h=d.useCallback(()=>{i(!0)},[]),g=d.useCallback(()=>{i(!1)},[]),x=d.useMemo(()=>({id:"no_board",actionType:"REMOVE_FROM_BOARD"}),[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(N,{onMouseOver:h,onMouseOut:g,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(d8,{board_id:"none",children:y=>a.jsx(Vt,{label:m,openDelay:1e3,hasArrow:!0,children:a.jsxs(N,{ref:y,onClick:s,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(ga,{src:Gx,alt:"invoke-ai-logo",sx:{opacity:.4,filter:"grayscale(1)",mt:-6,w:16,h:16,minW:16,minH:16,userSelect:"none"}})}),n==="none"&&a.jsx(u8,{}),a.jsx(N,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:e?"accent.400":"base.500",color:e?"base.50":"base.100",_dark:{bg:e?"accent.500":"base.600",color:e?"base.50":"base.100"},lineHeight:"short",fontSize:"xs",fontWeight:e?700:500},children:o}),a.jsx(Ly,{isSelected:e,isHovered:l}),a.jsx(Ny,{data:x,dropLabel:a.jsx(be,{fontSize:"md",children:"Move"})})]})})})})})});f8.displayName="HoverableBoard";const Mne=d.memo(f8),One=le([ge],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},Ce),Dne=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=W(One),{data:o}=Sd(),s=r?o==null?void 0:o.filter(u=>u.board_name.toLowerCase().includes(r.toLowerCase())):o,[l,i]=d.useState();return a.jsxs(a.Fragment,{children:[a.jsx(Md,{in:t,animateOpacity:!0,children:a.jsxs(N,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs(N,{sx:{gap:2,alignItems:"center"},children:[a.jsx(gne,{}),a.jsx(dne,{})]}),a.jsx(xg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(el,{className:"list-container","data-testid":"boards-list",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(nd,{sx:{p:1.5},"data-testid":"no-board",children:a.jsx(Mne,{isSelected:n==="none"})}),s&&s.map((u,p)=>a.jsx(nd,{sx:{p:1.5},"data-testid":`board-${p}`,children:a.jsx(Pne,{board:u,isSelected:n===u.board_id,setBoardToDelete:i})},u.board_id))]})})]})}),a.jsx(cne,{boardToDelete:l,setBoardToDelete:i})]})},Rne=d.memo(Dne),Ane=le([ge],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},Ce),Tne=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=W(Ane),o=yg(r),s=d.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs(N,{as:Ja,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(be,{noOfLines:1,sx:{fontWeight:600,w:"100%",textAlign:"center",color:"base.800",_dark:{color:"base.200"}},children:s}),a.jsx(bg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]})},$ne=d.memo(Tne),Nne=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(Bd,{isLazy:o,...s,children:[a.jsx(Kh,{children:t}),a.jsxs(Hd,{shadow:"dark-lg",children:[r&&a.jsx(G3,{}),n]})]})},Qd=d.memo(Nne);function Lne(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}},{tag:"path",attr:{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"}}]})(e)}const p8=_e((e,t)=>{const[n,r]=d.useState(!1),{label:o,value:s,min:l=1,max:i=100,step:u=1,onChange:p,tooltipSuffix:m="",withSliderMarks:h=!1,withInput:g=!1,isInteger:x=!1,inputWidth:y=16,withReset:b=!1,hideTooltip:C=!1,isCompact:S=!1,isDisabled:_=!1,sliderMarks:j,handleReset:E,sliderFormControlProps:I,sliderFormLabelProps:M,sliderMarkProps:D,sliderTrackProps:R,sliderThumbProps:A,sliderNumberInputProps:O,sliderNumberInputFieldProps:$,sliderNumberInputStepperProps:X,sliderTooltipProps:z,sliderIAIIconButtonProps:V,...Q}=e,G=te(),{t:F}=Z(),[U,T]=d.useState(String(s));d.useEffect(()=>{T(s)},[s]);const B=d.useMemo(()=>O!=null&&O.min?O.min:l,[l,O==null?void 0:O.min]),Y=d.useMemo(()=>O!=null&&O.max?O.max:i,[i,O==null?void 0:O.max]),re=d.useCallback(J=>{p(J)},[p]),ae=d.useCallback(J=>{J.target.value===""&&(J.target.value=String(B));const ie=Bl(x?Math.floor(Number(J.target.value)):Number(U),B,Y),de=Au(ie,u);p(de),T(de)},[x,U,B,Y,p,u]),oe=d.useCallback(J=>{T(J)},[]),q=d.useCallback(()=>{E&&E()},[E]),K=d.useCallback(J=>{J.target instanceof HTMLDivElement&&J.target.focus()},[]),ee=d.useCallback(J=>{J.shiftKey&&G(Nr(!0))},[G]),ce=d.useCallback(J=>{J.shiftKey||G(Nr(!1))},[G]);return a.jsxs(Zt,{ref:t,onClick:K,sx:S?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:_,...I,children:[o&&a.jsx(In,{sx:g?{mb:-1.5}:{},...M,children:o}),a.jsxs(zb,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Yb,{"aria-label":o,value:s,min:l,max:i,step:u,onChange:re,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),focusThumbOnChange:!1,isDisabled:_,...Q,children:[h&&!j&&a.jsxs(a.Fragment,{children:[a.jsx(Gi,{value:l,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...D,children:l}),a.jsx(Gi,{value:i,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...D,children:i})]}),h&&j&&a.jsx(a.Fragment,{children:j.map((J,ie)=>ie===0?a.jsx(Gi,{value:J,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...D,children:J},J):ie===j.length-1?a.jsx(Gi,{value:J,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...D,children:J},J):a.jsx(Gi,{value:J,sx:{transform:"translateX(-50%)"},...D,children:J},J))}),a.jsx(Jb,{...R,children:a.jsx(ey,{})}),a.jsx(Vt,{hasArrow:!0,placement:"top",isOpen:n,label:`${s}${m}`,hidden:C,...z,children:a.jsx(Zb,{...A,zIndex:0})})]}),g&&a.jsxs(Bh,{min:B,max:Y,step:u,value:U,onChange:oe,onBlur:ae,focusInputOnChange:!1,...O,children:[a.jsx(Vh,{onKeyDown:ee,onKeyUp:ce,minWidth:y,...$}),a.jsxs(Hh,{...X,children:[a.jsx(Uh,{onClick:()=>p(Number(U))}),a.jsx(Wh,{onClick:()=>p(Number(U))})]})]}),b&&a.jsx(Be,{size:"sm","aria-label":F("accessibility.reset"),tooltip:F("accessibility.reset"),icon:a.jsx(Lne,{}),isDisabled:_,onClick:q,...V})]})]})});p8.displayName="IAISlider";const rt=d.memo(p8),m8=d.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Vt,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Ie,{ref:s,...o,children:a.jsxs(Ie,{children:[a.jsx(kc,{children:e}),n&&a.jsx(kc,{size:"xs",color:"base.600",children:n})]})})}));m8.displayName="IAIMantineSelectItemWithTooltip";const fl=d.memo(m8),zne=le([ge],({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Ce),Fne=()=>{const e=te(),{t}=Z(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(zne),o=d.useRef(null),{boards:s,hasBoards:l}=Sd(void 0,{selectFromResult:({data:u})=>{const p=[{label:"None",value:"none"}];return u==null||u.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{boards:p,hasBoards:p.length>1}}}),i=d.useCallback(u=>{u&&e(yh(u))},[e]);return a.jsx(nn,{label:t("boards.autoAddBoard"),inputRef:o,autoFocus:!0,placeholder:t("boards.selectBoard"),value:n,data:s,nothingFound:t("boards.noMatching"),itemComponent:fl,disabled:!l||r,filter:(u,p)=>{var m;return((m=p.label)==null?void 0:m.toLowerCase().includes(u.toLowerCase().trim()))||p.value.toLowerCase().includes(u.toLowerCase().trim())},onChange:i})},Bne=d.memo(Fne),Hne=e=>{const{label:t,...n}=e,{colorMode:r}=ha();return a.jsx(Rd,{colorScheme:"accent",...n,children:a.jsx(be,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},xr=d.memo(Hne),Vne=le([ge],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},Ce),Wne=()=>{const e=te(),{t}=Z(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=W(Vne),s=d.useCallback(u=>{e(dw(u))},[e]),l=d.useCallback(()=>{e(dw(64))},[e]),i=d.useCallback(u=>{e(AR(u.target.checked))},[e]);return a.jsx(Qd,{triggerComponent:a.jsx(Be,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(IM,{})}),children:a.jsxs(N,{direction:"column",gap:2,children:[a.jsx(rt,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:l}),a.jsx(kn,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:i}),a.jsx(xr,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:u=>e(TR(u.target.checked))}),a.jsx(Bne,{})]})})},Une=d.memo(Wne),Gne=e=>e.image?a.jsx(Xh,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx(N,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(fa,{size:"xl"})}),tr=e=>{const{icon:t=Yl,boxSize:n=16,sx:r,...o}=e;return a.jsxs(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...r},...o,children:[t&&a.jsx(Tn,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(be,{textAlign:"center",children:e.label})]})},Kne=e=>{const{sx:t,...n}=e;return a.jsxs(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...t},...n,children:[a.jsx(fa,{size:"xl"}),e.label&&a.jsx(be,{textAlign:"center",children:e.label})]})},Cg=0,pl=1,Kc=2,h8=4;function g8(e,t){return n=>e(t(n))}function qne(e,t){return t(e)}function v8(e,t){return n=>e(t,n)}function I_(e,t){return()=>e(t)}function wg(e,t){return t(e),e}function mn(...e){return e}function Xne(e){e()}function P_(e){return()=>e}function Qne(...e){return()=>{e.map(Xne)}}function Fy(e){return e!==void 0}function qc(){}function Yt(e,t){return e(pl,t)}function St(e,t){e(Cg,t)}function By(e){e(Kc)}function vo(e){return e(h8)}function at(e,t){return Yt(e,v8(t,Cg))}function ua(e,t){const n=e(pl,r=>{n(),t(r)});return n}function Tt(){const e=[];return(t,n)=>{switch(t){case Kc:e.splice(0,e.length);return;case pl:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Cg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function He(e){let t=e;const n=Tt();return(r,o)=>{switch(r){case pl:o(t);break;case Cg:t=o;break;case h8:return t}return n(r,o)}}function Yne(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case pl:return s?n===s?void 0:(r(),n=s,t=Yt(e,s),t):(r(),qc);case Kc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Qr(e){return wg(Tt(),t=>at(e,t))}function br(e,t){return wg(He(t),n=>at(e,n))}function Zne(...e){return t=>e.reduceRight(qne,t)}function Pe(e,...t){const n=Zne(...t);return(r,o)=>{switch(r){case pl:return Yt(e,n(o));case Kc:By(e);return}}}function x8(e,t){return e===t}function dn(e=x8){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function gt(e){return t=>n=>{e(n)&&t(n)}}function Qe(e){return t=>g8(t,e)}function Xs(e){return t=>()=>t(e)}function ys(e,t){return n=>r=>n(t=e(t,r))}function Mc(e){return t=>n=>{e>0?e--:t(n)}}function Ga(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function E_(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function It(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,l)=>{const i=Math.pow(2,l);Yt(s,u=>{const p=n;n=n|i,t[l]=u,p!==o&&n===o&&r&&(r(),r=null)})}),s=>l=>{const i=()=>s([l].concat(t));n===o?i():r=i}}function M_(...e){return function(t,n){switch(t){case pl:return Qne(...e.map(r=>Yt(r,n)));case Kc:return;default:throw new Error(`unrecognized action ${t}`)}}}function ht(e,t=x8){return Pe(e,dn(t))}function Qn(...e){const t=Tt(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,l)=>{const i=Math.pow(2,l);Yt(s,u=>{n[l]=u,r=r|i,r===o&&St(t,n)})}),function(s,l){switch(s){case pl:return r===o&&l(n),Yt(t,l);case Kc:return By(t);default:throw new Error(`unrecognized action ${s}`)}}}function qt(e,t=[],{singleton:n}={singleton:!0}){return{id:Jne(),constructor:e,dependencies:t,singleton:n}}const Jne=()=>Symbol();function ere(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:l})=>{if(l&&t.has(r))return t.get(r);const i=o(s.map(u=>n(u)));return l&&t.set(r,i),i};return n(e)}function tre(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const l in t)r.hasOwnProperty(l)||(n[l]=t[l]);return n}const Op=typeof document<"u"?H.useLayoutEffect:H.useEffect;function b8(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),l=Object.keys(t.events||{}),i=H.createContext({});function u(b,C){b.propsReady&&St(b.propsReady,!1);for(const S of r){const _=b[t.required[S]];St(_,C[S])}for(const S of o)if(S in C){const _=b[t.optional[S]];St(_,C[S])}b.propsReady&&St(b.propsReady,!0)}function p(b){return s.reduce((C,S)=>(C[S]=_=>{const j=b[t.methods[S]];St(j,_)},C),{})}function m(b){return l.reduce((C,S)=>(C[S]=Yne(b[t.events[S]]),C),{})}return{Component:H.forwardRef((b,C)=>{const{children:S,..._}=b,[j]=H.useState(()=>wg(ere(e),I=>u(I,_))),[E]=H.useState(I_(m,j));return Op(()=>{for(const I of l)I in _&&Yt(E[I],_[I]);return()=>{Object.values(E).map(By)}},[_,E,j]),Op(()=>{u(j,_)}),H.useImperativeHandle(C,P_(p(j))),H.createElement(i.Provider,{value:j},n?H.createElement(n,tre([...r,...o,...l],_),S):S)}),usePublisher:b=>H.useCallback(v8(St,H.useContext(i)[b]),[b]),useEmitterValue:b=>{const S=H.useContext(i)[b],[_,j]=H.useState(I_(vo,S));return Op(()=>Yt(S,E=>{E!==_&&j(P_(E))}),[S,_]),_},useEmitter:(b,C)=>{const _=H.useContext(i)[b];Op(()=>Yt(_,C),[C,_])}}}const nre=typeof document<"u"?H.useLayoutEffect:H.useEffect,rre=nre;var Yr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Yr||{});const ore={0:"debug",1:"log",2:"warn",3:"error"},sre=()=>typeof globalThis>"u"?window:globalThis,ml=qt(()=>{const e=He(3);return{log:He((n,r,o=1)=>{var s;const l=(s=sre().VIRTUOSO_LOG_LEVEL)!=null?s:vo(e);o>=l&&console[ore[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function Hy(e,t=!0){const n=H.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=H.useMemo(()=>new ResizeObserver(s=>{const l=s[0].target;l.offsetParent!==null&&e(l)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function ii(e,t=!0){return Hy(e,t).callbackRef}function are(e,t,n,r,o,s,l){const i=H.useCallback(u=>{const p=lre(u.children,t,"offsetHeight",o);let m=u.parentElement;for(;!m.dataset.virtuosoScroller;)m=m.parentElement;const h=m.lastElementChild.dataset.viewportType==="window",g=l?l.scrollTop:h?window.pageYOffset||document.documentElement.scrollTop:m.scrollTop,x=l?l.scrollHeight:h?document.documentElement.scrollHeight:m.scrollHeight,y=l?l.offsetHeight:h?window.innerHeight:m.offsetHeight;r({scrollTop:Math.max(g,0),scrollHeight:x,viewportHeight:y}),s==null||s(ire("row-gap",getComputedStyle(u).rowGap,o)),p!==null&&e(p)},[e,t,o,s,l,r]);return Hy(i,n)}function lre(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let l=0;l<o;l++){const i=e.item(l);if(!i||i.dataset.index===void 0)continue;const u=parseInt(i.dataset.index),p=parseFloat(i.dataset.knownSize),m=t(i,n);if(m===0&&r("Zero-sized element, this should not happen",{child:i},Yr.ERROR),m===p)continue;const h=s[s.length-1];s.length===0||h.size!==m||h.endIndex!==u-1?s.push({startIndex:u,endIndex:u,size:m}):s[s.length-1].endIndex++}return s}function ire(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Yr.WARN),t==="normal"?0:parseInt(t??"0",10)}function ol(e,t){return Math.round(e.getBoundingClientRect()[t])}function y8(e,t){return Math.abs(e-t)<1.01}function C8(e,t,n,r=qc,o){const s=H.useRef(null),l=H.useRef(null),i=H.useRef(null),u=H.useCallback(h=>{const g=h.target,x=g===window||g===document,y=x?window.pageYOffset||document.documentElement.scrollTop:g.scrollTop,b=x?document.documentElement.scrollHeight:g.scrollHeight,C=x?window.innerHeight:g.offsetHeight,S=()=>{e({scrollTop:Math.max(y,0),scrollHeight:b,viewportHeight:C})};h.suppressFlushSync?S():$R.flushSync(S),l.current!==null&&(y===l.current||y<=0||y===b-C)&&(l.current=null,t(!0),i.current&&(clearTimeout(i.current),i.current=null))},[e,t]);H.useEffect(()=>{const h=o||s.current;return r(o||s.current),u({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",u,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",u)}},[s,u,n,r,o]);function p(h){const g=s.current;if(!g||"offsetHeight"in g&&g.offsetHeight===0)return;const x=h.behavior==="smooth";let y,b,C;g===window?(b=Math.max(ol(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,C=document.documentElement.scrollTop):(b=g.scrollHeight,y=ol(g,"height"),C=g.scrollTop);const S=b-y;if(h.top=Math.ceil(Math.max(Math.min(S,h.top),0)),y8(y,b)||h.top===C){e({scrollTop:C,scrollHeight:b,viewportHeight:y}),x&&t(!0);return}x?(l.current=h.top,i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,l.current=null,t(!0)},1e3)):l.current=null,g.scrollTo(h)}function m(h){s.current.scrollBy(h)}return{scrollerRef:s,scrollByCallback:m,scrollToCallback:p}}const kr=qt(()=>{const e=Tt(),t=Tt(),n=He(0),r=Tt(),o=He(0),s=Tt(),l=Tt(),i=He(0),u=He(0),p=He(0),m=He(0),h=Tt(),g=Tt(),x=He(!1);return at(Pe(e,Qe(({scrollTop:y})=>y)),t),at(Pe(e,Qe(({scrollHeight:y})=>y)),l),at(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:i,fixedHeaderHeight:u,fixedFooterHeight:p,footerHeight:m,scrollHeight:l,smoothScrollTargetReached:r,scrollTo:h,scrollBy:g,statefulScrollTop:o,deviation:n,scrollingInProgress:x}},[],{singleton:!0}),fd={lvl:0};function w8(e,t,n,r=fd,o=fd){return{k:e,v:t,lvl:n,l:r,r:o}}function tn(e){return e===fd}function vc(){return fd}function bx(e,t){if(tn(e))return fd;const{k:n,l:r,r:o}=e;if(t===n){if(tn(r))return o;if(tn(o))return r;{const[s,l]=S8(r);return Xp(Hn(e,{k:s,v:l,l:k8(r)}))}}else return t<n?Xp(Hn(e,{l:bx(r,t)})):Xp(Hn(e,{r:bx(o,t)}))}function pd(e,t){if(!tn(e))return t===e.k?e.v:t<e.k?pd(e.l,t):pd(e.r,t)}function rs(e,t,n="k"){if(tn(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=rs(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return rs(e.l,t,n)}function qr(e,t,n){return tn(e)?w8(t,n,1):t===e.k?Hn(e,{k:t,v:n}):t<e.k?O_(Hn(e,{l:qr(e.l,t,n)})):O_(Hn(e,{r:qr(e.r,t,n)}))}function yx(e,t,n){if(tn(e))return[];const{k:r,v:o,l:s,r:l}=e;let i=[];return r>t&&(i=i.concat(yx(s,t,n))),r>=t&&r<=n&&i.push({k:r,v:o}),r<=n&&(i=i.concat(yx(l,t,n))),i}function Dl(e){return tn(e)?[]:[...Dl(e.l),{k:e.k,v:e.v},...Dl(e.r)]}function S8(e){return tn(e.r)?[e.k,e.v]:S8(e.r)}function k8(e){return tn(e.r)?e.l:Xp(Hn(e,{r:k8(e.r)}))}function Hn(e,t){return w8(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Uv(e){return tn(e)||e.lvl>e.r.lvl}function O_(e){return Cx(j8(e))}function Xp(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Uv(t))return j8(Hn(e,{lvl:r-1}));if(!tn(t)&&!tn(t.r))return Hn(t.r,{l:Hn(t,{r:t.r.l}),r:Hn(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(Uv(e))return Cx(Hn(e,{lvl:r-1}));if(!tn(n)&&!tn(n.l)){const o=n.l,s=Uv(o)?n.lvl-1:n.lvl;return Hn(o,{l:Hn(e,{r:o.l,lvl:r-1}),r:Cx(Hn(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Sg(e,t,n){if(tn(e))return[];const r=rs(e,t)[0];return cre(yx(e,r,n))}function _8(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let l=1;l<n;l++){const{index:i,value:u}=t(e[l]);s.push({start:r,end:i-1,value:o}),r=i,o=u}return s.push({start:r,end:1/0,value:o}),s}function cre(e){return _8(e,({k:t,v:n})=>({index:t,value:n}))}function Cx(e){const{r:t,lvl:n}=e;return!tn(t)&&!tn(t.r)&&t.lvl===n&&t.r.lvl===n?Hn(t,{l:Hn(e,{r:t.l}),lvl:n+1}):e}function j8(e){const{l:t}=e;return!tn(t)&&t.lvl===e.lvl?Hn(t,{r:Hn(e,{l:t.r})}):e}function ch(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),l=e[s],i=n(l,t);if(i===0)return s;if(i===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function I8(e,t,n){return e[ch(e,t,n)]}function ure(e,t,n,r){const o=ch(e,t,r),s=ch(e,n,r,o);return e.slice(o,s+1)}const Vy=qt(()=>({recalcInProgress:He(!1)}),[],{singleton:!0});function dre(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function D_(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function fre(e,t){let n=tn(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:l}=r;if(n=Math.min(n,s),tn(e)){e=qr(e,0,o);continue}const i=Sg(e,s-1,l+1);if(i.some(dre(r)))continue;let u=!1,p=!1;for(const{start:m,end:h,value:g}of i)u?(l>=m||o===g)&&(e=bx(e,m)):(p=g!==o,u=!0),h>l&&l>=m&&g!==o&&(e=qr(e,l+1,g));p&&(e=qr(e,s,o))}return[e,n]}function pre(){return{offsetTree:[],sizeTree:vc(),groupOffsetTree:vc(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Wy({index:e},t){return t===e?0:t<e?-1:1}function mre({offset:e},t){return t===e?0:t<e?-1:1}function hre(e){return{index:e.index,value:e}}function gre(e,t,n,r=0){return r>0&&(t=Math.max(t,I8(e,r,Wy).offset)),_8(ure(e,t,n,mre),hre)}function wx(e,t,n,r){let o=e,s=0,l=0,i=0,u=0;if(t!==0){u=ch(o,t-1,Wy),i=o[u].offset;const m=rs(n,t-1);s=m[0],l=m[1],o.length&&o[u].size===rs(n,t)[1]&&(u-=1),o=o.slice(0,u+1)}else o=[];for(const{start:p,value:m}of Sg(n,t,1/0)){const h=p-s,g=h*l+i+h*r;o.push({offset:g,size:m,index:p}),s=p,i=g,l=m}return{offsetTree:o,lastIndex:s,lastOffset:i,lastSize:l}}function vre(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Yr.DEBUG);const s=e.sizeTree;let l=s,i=0;if(n.length>0&&tn(s)&&t.length===2){const g=t[0].size,x=t[1].size;l=n.reduce((y,b)=>qr(qr(y,b,g),b+1,x),l)}else[l,i]=fre(l,t);if(l===s)return e;const{offsetTree:u,lastIndex:p,lastSize:m,lastOffset:h}=wx(e.offsetTree,i,l,o);return{sizeTree:l,offsetTree:u,lastIndex:p,lastOffset:h,lastSize:m,groupOffsetTree:n.reduce((g,x)=>qr(g,x,md(x,u,o)),vc()),groupIndices:n}}function md(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=I8(t,e,Wy),l=e-o,i=s*l+(l-1)*n+r;return i>0?i+n:i}function xre(e){return typeof e.groupIndex<"u"}function P8(e,t,n){if(xre(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=E8(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function E8(e,t){if(!kg(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function kg(e){return!tn(e.groupOffsetTree)}function bre(e){return Dl(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],l=s?s.k-1:1/0;return{startIndex:t,endIndex:l,size:n}})}const yre={offsetHeight:"height",offsetWidth:"width"},$s=qt(([{log:e},{recalcInProgress:t}])=>{const n=Tt(),r=Tt(),o=br(r,0),s=Tt(),l=Tt(),i=He(0),u=He([]),p=He(void 0),m=He(void 0),h=He((I,M)=>ol(I,yre[M])),g=He(void 0),x=He(0),y=pre(),b=br(Pe(n,It(u,e,x),ys(vre,y),dn()),y),C=br(Pe(u,dn(),ys((I,M)=>({prev:I.current,current:M}),{prev:[],current:[]}),Qe(({prev:I})=>I)),[]);at(Pe(u,gt(I=>I.length>0),It(b,x),Qe(([I,M,D])=>{const R=I.reduce((A,O,$)=>qr(A,O,md(O,M.offsetTree,D)||$),vc());return{...M,groupIndices:I,groupOffsetTree:R}})),b),at(Pe(r,It(b),gt(([I,{lastIndex:M}])=>I<M),Qe(([I,{lastIndex:M,lastSize:D}])=>[{startIndex:I,endIndex:M,size:D}])),n),at(p,m);const S=br(Pe(p,Qe(I=>I===void 0)),!0);at(Pe(m,gt(I=>I!==void 0&&tn(vo(b).sizeTree)),Qe(I=>[{startIndex:0,endIndex:0,size:I}])),n);const _=Qr(Pe(n,It(b),ys(({sizes:I},[M,D])=>({changed:D!==I,sizes:D}),{changed:!1,sizes:y}),Qe(I=>I.changed)));Yt(Pe(i,ys((I,M)=>({diff:I.prev-M,prev:M}),{diff:0,prev:0}),Qe(I=>I.diff)),I=>{const{groupIndices:M}=vo(b);if(I>0)St(t,!0),St(s,I+D_(I,M));else if(I<0){const D=vo(C);D.length>0&&(I-=D_(-I,D)),St(l,I)}}),Yt(Pe(i,It(e)),([I,M])=>{I<0&&M("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:i},Yr.ERROR)});const j=Qr(s);at(Pe(s,It(b),Qe(([I,M])=>{const D=M.groupIndices.length>0,R=[],A=M.lastSize;if(D){const O=pd(M.sizeTree,0);let $=0,X=0;for(;$<I;){const Q=M.groupIndices[X],G=M.groupIndices.length===X+1?1/0:M.groupIndices[X+1]-Q-1;R.push({startIndex:Q,endIndex:Q,size:O}),R.push({startIndex:Q+1,endIndex:Q+1+G-1,size:A}),X++,$+=G+1}const z=Dl(M.sizeTree);return $!==I&&z.shift(),z.reduce((Q,{k:G,v:F})=>{let U=Q.ranges;return Q.prevSize!==0&&(U=[...Q.ranges,{startIndex:Q.prevIndex,endIndex:G+I-1,size:Q.prevSize}]),{ranges:U,prevIndex:G+I,prevSize:F}},{ranges:R,prevIndex:I,prevSize:0}).ranges}return Dl(M.sizeTree).reduce((O,{k:$,v:X})=>({ranges:[...O.ranges,{startIndex:O.prevIndex,endIndex:$+I-1,size:O.prevSize}],prevIndex:$+I,prevSize:X}),{ranges:[],prevIndex:0,prevSize:A}).ranges})),n);const E=Qr(Pe(l,It(b,x),Qe(([I,{offsetTree:M},D])=>{const R=-I;return md(R,M,D)})));return at(Pe(l,It(b,x),Qe(([I,M,D])=>{if(M.groupIndices.length>0){if(tn(M.sizeTree))return M;let A=vc();const O=vo(C);let $=0,X=0,z=0;for(;$<-I;){z=O[X];const Q=O[X+1]-z-1;X++,$+=Q+1}if(A=Dl(M.sizeTree).reduce((Q,{k:G,v:F})=>qr(Q,Math.max(0,G+I),F),A),$!==-I){const Q=pd(M.sizeTree,z);A=qr(A,0,Q);const G=rs(M.sizeTree,-I+1)[1];A=qr(A,1,G)}return{...M,sizeTree:A,...wx(M.offsetTree,0,A,D)}}else{const A=Dl(M.sizeTree).reduce((O,{k:$,v:X})=>qr(O,Math.max(0,$+I),X),vc());return{...M,sizeTree:A,...wx(M.offsetTree,0,A,D)}}})),b),{data:g,totalCount:r,sizeRanges:n,groupIndices:u,defaultItemSize:m,fixedItemSize:p,unshiftWith:s,shiftWith:l,shiftWithOffset:E,beforeUnshiftWith:j,firstItemIndex:i,gap:x,sizes:b,listRefresh:_,statefulTotalCount:o,trackItemSizes:S,itemSize:h}},mn(ml,Vy),{singleton:!0}),Cre=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function M8(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Cre)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Yd=qt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:l,smoothScrollTargetReached:i,headerHeight:u,footerHeight:p,fixedHeaderHeight:m,fixedFooterHeight:h},{log:g}])=>{const x=Tt(),y=He(0);let b=null,C=null,S=null;function _(){b&&(b(),b=null),S&&(S(),S=null),C&&(clearTimeout(C),C=null),St(o,!1)}return at(Pe(x,It(e,s,t,y,u,p,g),It(r,m,h),Qe(([[j,E,I,M,D,R,A,O],$,X,z])=>{const V=M8(j),{align:Q,behavior:G,offset:F}=V,U=M-1,T=P8(V,E,U);let B=md(T,E.offsetTree,$)+R;Q==="end"?(B+=X+rs(E.sizeTree,T)[1]-I+z,T===U&&(B+=A)):Q==="center"?B+=(X+rs(E.sizeTree,T)[1]-I+z)/2:B-=D,F&&(B+=F);const Y=re=>{_(),re?(O("retrying to scroll to",{location:j},Yr.DEBUG),St(x,j)):O("list did not change, scroll successful",{},Yr.DEBUG)};if(_(),G==="smooth"){let re=!1;S=Yt(n,ae=>{re=re||ae}),b=ua(i,()=>{Y(re)})}else b=ua(Pe(n,wre(150)),Y);return C=setTimeout(()=>{_()},1200),St(o,!0),O("scrolling from index to",{index:T,top:B,behavior:G},Yr.DEBUG),{top:B,behavior:G}})),l),{scrollToIndex:x,topListHeight:y}},mn($s,kr,ml),{singleton:!0});function wre(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const hd="up",Gu="down",Sre="none",kre={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},_re=0,Zd=qt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const l=He(!1),i=He(!0),u=Tt(),p=Tt(),m=He(4),h=He(_re),g=br(Pe(M_(Pe(ht(t),Mc(1),Xs(!0)),Pe(ht(t),Mc(1),Xs(!1),E_(100))),dn()),!1),x=br(Pe(M_(Pe(s,Xs(!0)),Pe(s,Xs(!1),E_(200))),dn()),!1);at(Pe(Qn(ht(t),ht(h)),Qe(([_,j])=>_<=j),dn()),i),at(Pe(i,Ga(50)),p);const y=Qr(Pe(Qn(e,ht(n),ht(r),ht(o),ht(m)),ys((_,[{scrollTop:j,scrollHeight:E},I,M,D,R])=>{const A=j+I-E>-R,O={viewportHeight:I,scrollTop:j,scrollHeight:E};if(A){let X,z;return j>_.state.scrollTop?(X="SCROLLED_DOWN",z=_.state.scrollTop-j):(X="SIZE_DECREASED",z=_.state.scrollTop-j||_.scrollTopDelta),{atBottom:!0,state:O,atBottomBecause:X,scrollTopDelta:z}}let $;return O.scrollHeight>_.state.scrollHeight?$="SIZE_INCREASED":I<_.state.viewportHeight?$="VIEWPORT_HEIGHT_DECREASING":j<_.state.scrollTop?$="SCROLLING_UPWARDS":$="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:$,state:O}},kre),dn((_,j)=>_&&_.atBottom===j.atBottom))),b=br(Pe(e,ys((_,{scrollTop:j,scrollHeight:E,viewportHeight:I})=>{if(y8(_.scrollHeight,E))return{scrollTop:j,scrollHeight:E,jump:0,changed:!1};{const M=E-(j+I)<1;return _.scrollTop!==j&&M?{scrollHeight:E,scrollTop:j,jump:_.scrollTop-j,changed:!0}:{scrollHeight:E,scrollTop:j,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),gt(_=>_.changed),Qe(_=>_.jump)),0);at(Pe(y,Qe(_=>_.atBottom)),l),at(Pe(l,Ga(50)),u);const C=He(Gu);at(Pe(e,Qe(({scrollTop:_})=>_),dn(),ys((_,j)=>vo(x)?{direction:_.direction,prevScrollTop:j}:{direction:j<_.prevScrollTop?hd:Gu,prevScrollTop:j},{direction:Gu,prevScrollTop:0}),Qe(_=>_.direction)),C),at(Pe(e,Ga(50),Xs(Sre)),C);const S=He(0);return at(Pe(g,gt(_=>!_),Xs(0)),S),at(Pe(t,Ga(100),It(g),gt(([_,j])=>!!j),ys(([_,j],[E])=>[j,E],[0,0]),Qe(([_,j])=>j-_)),S),{isScrolling:g,isAtTop:i,isAtBottom:l,atBottomState:y,atTopStateChange:p,atBottomStateChange:u,scrollDirection:C,atBottomThreshold:m,atTopThreshold:h,scrollVelocity:S,lastJumpDueToItemResize:b}},mn(kr)),hl=qt(([{log:e}])=>{const t=He(!1),n=Qr(Pe(t,gt(r=>r),dn()));return Yt(t,r=>{r&&vo(e)("props updated",{},Yr.DEBUG)}),{propsReady:t,didMount:n}},mn(ml),{singleton:!0});function Uy(e,t){e==0?t():requestAnimationFrame(()=>Uy(e-1,t))}function Gy(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Jd=qt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:s}])=>{const l=He(!0),i=He(0),u=He(!1);return at(Pe(s,It(i),gt(([p,m])=>!!m),Xs(!1)),l),Yt(Pe(Qn(t,s),It(l,e,n,u),gt(([[,p],m,{sizeTree:h},g,x])=>p&&(!tn(h)||Fy(g))&&!m&&!x),It(i)),([,p])=>{St(u,!0),Uy(3,()=>{ua(r,()=>St(l,!0)),St(o,p)})}),{scrolledToInitialItem:l,initialTopMostItemIndex:i}},mn($s,kr,Yd,hl),{singleton:!0});function R_(e){return e?e==="smooth"?"smooth":"auto":!1}const jre=(e,t)=>typeof e=="function"?R_(e(t)):t&&R_(e),Ire=qt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:l,didMount:i},{log:u},{scrollingInProgress:p}])=>{const m=He(!1),h=Tt();let g=null;function x(b){St(o,{index:"LAST",align:"end",behavior:b})}Yt(Pe(Qn(Pe(ht(e),Mc(1)),i),It(ht(m),n,s,p),Qe(([[b,C],S,_,j,E])=>{let I=C&&j,M="auto";return I&&(M=jre(S,_||E),I=I&&!!M),{totalCount:b,shouldFollow:I,followOutputBehavior:M}}),gt(({shouldFollow:b})=>b)),({totalCount:b,followOutputBehavior:C})=>{g&&(g(),g=null),g=ua(t,()=>{vo(u)("following output to ",{totalCount:b},Yr.DEBUG),x(C),g=null})});function y(b){const C=ua(r,S=>{b&&!S.atBottom&&S.notAtBottomBecause==="SIZE_INCREASED"&&!g&&(vo(u)("scrolling to bottom due to increased size",{},Yr.DEBUG),x("auto"))});setTimeout(C,100)}return Yt(Pe(Qn(ht(m),e,l),gt(([b,,C])=>b&&C),ys(({value:b},[,C])=>({refreshed:b===C,value:C}),{refreshed:!1,value:0}),gt(({refreshed:b})=>b),It(m,e)),([,b])=>{y(b!==!1)}),Yt(h,()=>{y(vo(m)!==!1)}),Yt(Qn(ht(m),r),([b,C])=>{b&&!C.atBottom&&C.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&x("auto")}),{followOutput:m,autoscrollToBottom:h}},mn($s,Zd,Yd,Jd,hl,ml,kr));function Pre(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const O8=qt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Tt(),l=Tt(),i=Qr(Pe(s,Qe(Pre)));return at(Pe(i,Qe(u=>u.totalCount)),e),at(Pe(i,Qe(u=>u.groupIndices)),t),at(Pe(Qn(r,n,o),gt(([u,p])=>kg(p)),Qe(([u,p,m])=>rs(p.groupOffsetTree,Math.max(u-m,0),"v")[0]),dn(),Qe(u=>[u])),l),{groupCounts:s,topItemsIndexes:l}},mn($s,kr));function gd(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function D8(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const uh="top",dh="bottom",A_="none";function T_(e,t,n){return typeof e=="number"?n===hd&&t===uh||n===Gu&&t===dh?e:0:n===hd?t===uh?e.main:e.reverse:t===dh?e.main:e.reverse}function $_(e,t){return typeof e=="number"?e:e[t]||0}const Ky=qt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Tt(),l=He(0),i=He(0),u=He(0),p=br(Pe(Qn(ht(e),ht(t),ht(r),ht(s,gd),ht(u),ht(l),ht(o),ht(n),ht(i)),Qe(([m,h,g,[x,y],b,C,S,_,j])=>{const E=m-_,I=C+S,M=Math.max(g-E,0);let D=A_;const R=$_(j,uh),A=$_(j,dh);return x-=_,x+=g+S,y+=g+S,y-=_,x>m+I-R&&(D=hd),y<m-M+h+A&&(D=Gu),D!==A_?[Math.max(E-g-T_(b,uh,D)-R,0),E-M-S+h+T_(b,dh,D)+A]:null}),gt(m=>m!=null),dn(gd)),[0,0]);return{listBoundary:s,overscan:u,topListHeight:l,increaseViewportBy:i,visibleRange:p}},mn(kr),{singleton:!0});function Ere(e,t,n){if(kg(t)){const r=E8(e,t);return[{index:rs(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const N_={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function L_(e,t,n){if(e.length===0)return[];if(!kg(t))return e.map(p=>({...p,index:p.index+n,originalIndex:p.index}));const r=e[0].index,o=e[e.length-1].index,s=[],l=Sg(t.groupOffsetTree,r,o);let i,u=0;for(const p of e){(!i||i.end<p.index)&&(i=l.shift(),u=t.groupIndices.indexOf(i.start));let m;p.index===i.start?m={type:"group",index:u}:m={index:p.index-(u+1)+n,groupIndex:u},s.push({...m,size:p.size,offset:p.offset,originalIndex:p.index,data:p.data})}return s}function Qp(e,t,n,r,o,s){const{lastSize:l,lastOffset:i,lastIndex:u}=o;let p=0,m=0;if(e.length>0){p=e[0].offset;const b=e[e.length-1];m=b.offset+b.size}const h=n-u,g=i+h*l+(h-1)*r,x=p,y=g-m;return{items:L_(e,o,s),topItems:L_(t,o,s),topListHeight:t.reduce((b,C)=>C.size+b,0),offsetTop:p,offsetBottom:y,top:x,bottom:m,totalCount:n,firstItemIndex:s}}const ci=qt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:l,listBoundary:i,topListHeight:u},{scrolledToInitialItem:p,initialTopMostItemIndex:m},{topListHeight:h},g,{didMount:x},{recalcInProgress:y}])=>{const b=He([]),C=Tt();at(s.topItemsIndexes,b);const S=br(Pe(Qn(x,y,ht(l,gd),ht(t),ht(e),ht(m),p,ht(b),ht(r),ht(o),n),gt(([I,M,,D,,,,,,,R])=>{const A=R&&R.length!==D;return I&&!M&&!A}),Qe(([,,[I,M],D,R,A,O,$,X,z,V])=>{const Q=R,{sizeTree:G,offsetTree:F}=Q;if(D===0||I===0&&M===0)return{...N_,totalCount:D};if(tn(G))return Qp(Ere(Gy(A,D),Q,V),[],D,z,Q,X);const U=[];if($.length>0){const ae=$[0],oe=$[$.length-1];let q=0;for(const K of Sg(G,ae,oe)){const ee=K.value,ce=Math.max(K.start,ae),J=Math.min(K.end,oe);for(let ie=ce;ie<=J;ie++)U.push({index:ie,size:ee,offset:q,data:V&&V[ie]}),q+=ee}}if(!O)return Qp([],U,D,z,Q,X);const T=$.length>0?$[$.length-1]+1:0,B=gre(F,I,M,T);if(B.length===0)return null;const Y=D-1,re=wg([],ae=>{for(const oe of B){const q=oe.value;let K=q.offset,ee=oe.start;const ce=q.size;if(q.offset<I){ee+=Math.floor((I-q.offset+z)/(ce+z));const ie=ee-oe.start;K+=ie*ce+ie*z}ee<T&&(K+=(T-ee)*ce,ee=T);const J=Math.min(oe.end,Y);for(let ie=ee;ie<=J&&!(K>=M);ie++)ae.push({index:ie,size:ce,offset:K,data:V&&V[ie]}),K+=ce+z}});return Qp(re,U,D,z,Q,X)}),gt(I=>I!==null),dn()),N_);at(Pe(n,gt(Fy),Qe(I=>I==null?void 0:I.length)),t),at(Pe(S,Qe(I=>I.topListHeight)),h),at(h,u),at(Pe(S,Qe(I=>[I.top,I.bottom])),i),at(Pe(S,Qe(I=>I.items)),C);const _=Qr(Pe(S,gt(({items:I})=>I.length>0),It(t,n),gt(([{items:I},M])=>I[I.length-1].originalIndex===M-1),Qe(([,I,M])=>[I-1,M]),dn(gd),Qe(([I])=>I))),j=Qr(Pe(S,Ga(200),gt(({items:I,topItems:M})=>I.length>0&&I[0].originalIndex===M.length),Qe(({items:I})=>I[0].index),dn())),E=Qr(Pe(S,gt(({items:I})=>I.length>0),Qe(({items:I})=>{let M=0,D=I.length-1;for(;I[M].type==="group"&&M<D;)M++;for(;I[D].type==="group"&&D>M;)D--;return{startIndex:I[M].index,endIndex:I[D].index}}),dn(D8)));return{listState:S,topItemsIndexes:b,endReached:_,startReached:j,rangeChanged:E,itemsRendered:C,...g}},mn($s,O8,Ky,Jd,Yd,Zd,hl,Vy),{singleton:!0}),Mre=qt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{listState:s},{didMount:l}])=>{const i=He(0);return at(Pe(l,It(i),gt(([,u])=>u!==0),It(o,e,t,r,n),Qe(([[,u],p,m,h,g,x=[]])=>{let y=0;if(m.groupIndices.length>0)for(const _ of m.groupIndices){if(_-y>=u)break;y++}const b=u+y,C=Gy(p,b),S=Array.from({length:b}).map((_,j)=>({index:j+C,size:0,offset:0,data:x[j+C]}));return Qp(S,[],b,g,m,h)})),s),{initialItemCount:i}},mn($s,Jd,ci,hl),{singleton:!0}),R8=qt(([{scrollVelocity:e}])=>{const t=He(!1),n=Tt(),r=He(!1);return at(Pe(e,It(r,t,n),gt(([o,s])=>!!s),Qe(([o,s,l,i])=>{const{exit:u,enter:p}=s;if(l){if(u(o,i))return!1}else if(p(o,i))return!0;return l}),dn()),t),Yt(Pe(Qn(t,e,n),It(r)),([[o,s,l],i])=>o&&i&&i.change&&i.change(s,l)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},mn(Zd),{singleton:!0}),Ore=qt(([{topItemsIndexes:e}])=>{const t=He(0);return at(Pe(t,gt(n=>n>0),Qe(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},mn(ci)),A8=qt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Tt(),l=br(Pe(Qn(e,r,t,n,o),Qe(([i,u,p,m,h])=>i+u+p+m+h.offsetBottom+h.bottom)),0);return at(ht(l),s),{totalListHeight:l,totalListHeightChanged:s}},mn(kr,ci),{singleton:!0});function T8(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Dre=T8(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Rre=qt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:l,lastJumpDueToItemResize:i},{listState:u},{beforeUnshiftWith:p,shiftWithOffset:m,sizes:h,gap:g},{log:x},{recalcInProgress:y}])=>{const b=Qr(Pe(u,It(i),ys(([,S,_,j],[{items:E,totalCount:I,bottom:M,offsetBottom:D},R])=>{const A=M+D;let O=0;return _===I&&S.length>0&&E.length>0&&(E[0].originalIndex===0&&S[0].originalIndex===0||(O=A-j,O!==0&&(O+=R))),[O,E,I,A]},[0,[],0,0]),gt(([S])=>S!==0),It(t,l,r,s,x,y),gt(([,S,_,j,,,E])=>!E&&!j&&S!==0&&_===hd),Qe(([[S],,,,,_])=>(_("Upward scrolling compensation",{amount:S},Yr.DEBUG),S))));function C(S){S>0?(St(e,{top:-S,behavior:"auto"}),St(n,0)):(St(n,0),St(e,{top:-S,behavior:"auto"}))}return Yt(Pe(b,It(n,o)),([S,_,j])=>{j&&Dre()?St(n,_-S):C(-S)}),Yt(Pe(Qn(br(o,!1),n,y),gt(([S,_,j])=>!S&&!j&&_!==0),Qe(([S,_])=>_),Ga(1)),C),at(Pe(m,Qe(S=>({top:-S}))),e),Yt(Pe(p,It(h,g),Qe(([S,{lastSize:_,groupIndices:j,sizeTree:E},I])=>{function M(D){return D*(_+I)}if(j.length===0)return M(S);{let D=0;const R=pd(E,0);let A=0,O=0;for(;A<S;){A++,D+=R;let $=j.length===O+1?1/0:j[O+1]-j[O]-1;A+$>S&&(D-=R,$=S-A+1),A+=$,D+=M($),O++}return D}})),S=>{St(n,S),requestAnimationFrame(()=>{St(e,{top:S}),requestAnimationFrame(()=>{St(n,0),St(y,!1)})})}),{deviation:n}},mn(kr,Zd,ci,$s,ml,Vy)),Are=qt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=He(0);return Yt(Pe(e,It(r),gt(([,o])=>o!==0),Qe(([,o])=>({top:o}))),o=>{ua(Pe(n,Mc(1),gt(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{St(t,o)})})}),{initialScrollTop:r}},mn(hl,kr,ci),{singleton:!0}),Tre=qt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=He(!1),r=br(Pe(Qn(n,e,t),gt(([o])=>o),Qe(([,o,s])=>Math.max(0,o-s)),Ga(0),dn()),0);return{alignToBottom:n,paddingTopAddition:r}},mn(kr,A8),{singleton:!0}),qy=qt(([{scrollTo:e,scrollContainerState:t}])=>{const n=Tt(),r=Tt(),o=Tt(),s=He(!1),l=He(void 0);return at(Pe(Qn(n,r),Qe(([{viewportHeight:i,scrollTop:u,scrollHeight:p},{offsetTop:m}])=>({scrollTop:Math.max(0,u-m),scrollHeight:p,viewportHeight:i}))),t),at(Pe(e,It(r),Qe(([i,{offsetTop:u}])=>({...i,top:i.top+u}))),o),{useWindowScroll:s,customScrollParent:l,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},mn(kr)),$re=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...l}})=>e<n?{...l,behavior:o,align:s??"start"}:t>r?{...l,behavior:o,align:s??"end"}:null,Nre=qt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:i,scrollingInProgress:u},{scrollToIndex:p}])=>{const m=Tt();return at(Pe(m,It(e,o,t,s,l,i,r),It(n),Qe(([[h,g,x,y,b,C,S,_],j])=>{const{done:E,behavior:I,align:M,calculateViewLocation:D=$re,...R}=h,A=P8(h,g,y-1),O=md(A,g.offsetTree,j)+b+C,$=O+rs(g.sizeTree,A)[1],X=_+C,z=_+x-S,V=D({itemTop:O,itemBottom:$,viewportTop:X,viewportBottom:z,locationParams:{behavior:I,align:M,...R}});return V?E&&ua(Pe(u,gt(Q=>Q===!1),Mc(vo(u)?1:2)),E):E&&E(),V}),gt(h=>h!==null)),p),{scrollIntoView:m}},mn($s,kr,Yd,ci,ml),{singleton:!0}),Lre=qt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:s,windowScrollContainerState:l,windowViewportRect:i}])=>{const u=Tt(),p=He(void 0),m=He(null),h=He(null);return at(l,m),at(i,h),Yt(Pe(u,It(e,n,s,m,h)),([g,x,y,b,C,S])=>{const _=bre(x.sizeTree);b&&C!==null&&S!==null&&(y=C.scrollTop-S.offsetTop),g({ranges:_,scrollTop:y})}),at(Pe(p,gt(Fy),Qe(zre)),r),at(Pe(o,It(p),gt(([,g])=>g!==void 0),dn(),Qe(([,g])=>g.ranges)),t),{getState:u,restoreStateFrom:p}},mn($s,kr,Jd,hl,qy));function zre(e){return{offset:e.scrollTop,index:0,align:"start"}}const Fre=qt(([e,t,n,r,o,s,l,i,u,p])=>({...e,...t,...n,...r,...o,...s,...l,...i,...u,...p}),mn(Ky,Mre,hl,R8,A8,Are,Tre,qy,Nre,ml)),Bre=qt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:l,firstItemIndex:i,groupIndices:u,statefulTotalCount:p,gap:m,sizes:h},{initialTopMostItemIndex:g,scrolledToInitialItem:x},y,b,C,{listState:S,topItemsIndexes:_,...j},{scrollToIndex:E},I,{topItemCount:M},{groupCounts:D},R])=>(at(j.rangeChanged,R.scrollSeekRangeChanged),at(Pe(R.windowViewportRect,Qe(A=>A.visibleHeight)),y.viewportHeight),{totalCount:e,data:l,firstItemIndex:i,sizeRanges:t,initialTopMostItemIndex:g,scrolledToInitialItem:x,topItemsIndexes:_,topItemCount:M,groupCounts:D,fixedItemHeight:n,defaultItemHeight:r,gap:m,...C,statefulTotalCount:p,listState:S,scrollToIndex:E,trackItemSizes:o,itemSize:s,groupIndices:u,...j,...R,...y,sizes:h,...b}),mn($s,Jd,kr,Lre,Ire,ci,Yd,Rre,Ore,O8,Fre)),Gv="-webkit-sticky",z_="sticky",$8=T8(()=>{if(typeof document>"u")return z_;const e=document.createElement("div");return e.style.position=Gv,e.style.position===Gv?Gv:z_});function N8(e,t){const n=H.useRef(null),r=H.useCallback(i=>{if(i===null||!i.offsetParent)return;const u=i.getBoundingClientRect(),p=u.width;let m,h;if(t){const g=t.getBoundingClientRect(),x=u.top-g.top;m=g.height-Math.max(0,x),h=x+t.scrollTop}else m=window.innerHeight-Math.max(0,u.top),h=u.top+window.pageYOffset;n.current={offsetTop:h,visibleHeight:m,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=Hy(r),l=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",l);const i=new ResizeObserver(l);return i.observe(t),()=>{t.removeEventListener("scroll",l),i.unobserve(t)}}else return window.addEventListener("scroll",l),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,t]),o}const L8=H.createContext(void 0),z8=H.createContext(void 0);function F8(e){return e}const Hre=qt(()=>{const e=He(u=>`Item ${u}`),t=He(null),n=He(u=>`Group ${u}`),r=He({}),o=He(F8),s=He("div"),l=He(qc),i=(u,p=null)=>br(Pe(r,Qe(m=>m[u]),dn()),p);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:l,FooterComponent:i("Footer"),HeaderComponent:i("Header"),TopItemListComponent:i("TopItemList"),ListComponent:i("List","div"),ItemComponent:i("Item","div"),GroupComponent:i("Group","div"),ScrollerComponent:i("Scroller","div"),EmptyPlaceholder:i("EmptyPlaceholder"),ScrollSeekPlaceholder:i("ScrollSeekPlaceholder")}}),Vre=qt(([e,t])=>({...e,...t}),mn(Bre,Hre)),Wre=({height:e})=>H.createElement("div",{style:{height:e}}),Ure={position:$8(),zIndex:1,overflowAnchor:"none"},Gre={overflowAnchor:"none"},F_=H.memo(function({showTopList:t=!1}){const n=Dt("listState"),r=xo("sizeRanges"),o=Dt("useWindowScroll"),s=Dt("customScrollParent"),l=xo("windowScrollContainerState"),i=xo("scrollContainerState"),u=s||o?l:i,p=Dt("itemContent"),m=Dt("context"),h=Dt("groupContent"),g=Dt("trackItemSizes"),x=Dt("itemSize"),y=Dt("log"),b=xo("gap"),{callbackRef:C}=are(r,x,g,t?qc:u,y,b,s),[S,_]=H.useState(0);Xy("deviation",V=>{S!==V&&_(V)});const j=Dt("EmptyPlaceholder"),E=Dt("ScrollSeekPlaceholder")||Wre,I=Dt("ListComponent"),M=Dt("ItemComponent"),D=Dt("GroupComponent"),R=Dt("computeItemKey"),A=Dt("isSeeking"),O=Dt("groupIndices").length>0,$=Dt("paddingTopAddition"),X=Dt("scrolledToInitialItem"),z=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+$,paddingBottom:n.offsetBottom,marginTop:S,...X?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&j?H.createElement(j,Rr(j,m)):H.createElement(I,{...Rr(I,m),ref:C,style:z,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(V=>{const Q=V.originalIndex,G=R(Q+n.firstItemIndex,V.data,m);return A?H.createElement(E,{...Rr(E,m),key:G,index:V.index,height:V.size,type:V.type||"item",...V.type==="group"?{}:{groupIndex:V.groupIndex}}):V.type==="group"?H.createElement(D,{...Rr(D,m),key:G,"data-index":Q,"data-known-size":V.size,"data-item-index":V.index,style:Ure},h(V.index,m)):H.createElement(M,{...Rr(M,m),key:G,"data-index":Q,"data-known-size":V.size,"data-item-index":V.index,"data-item-group-index":V.groupIndex,item:V.data,style:Gre},O?p(V.index,V.groupIndex,V.data,m):p(V.index,V.data,m))}))}),Kre={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},_g={width:"100%",height:"100%",position:"absolute",top:0},qre={width:"100%",position:$8(),top:0,zIndex:1};function Rr(e,t){if(typeof e!="string")return{context:t}}const Xre=H.memo(function(){const t=Dt("HeaderComponent"),n=xo("headerHeight"),r=Dt("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=Dt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),Qre=H.memo(function(){const t=Dt("FooterComponent"),n=xo("footerHeight"),r=Dt("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=Dt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null});function B8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:l,...i}){const u=e("scrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("scrollerRef"),g=n("context"),{scrollerRef:x,scrollByCallback:y,scrollToCallback:b}=C8(u,m,p,h);return t("scrollTo",b),t("scrollBy",y),H.createElement(p,{ref:x,style:{...Kre,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...i,...Rr(p,g)},l)})}function H8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:l,...i}){const u=e("windowScrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("totalListHeight"),g=n("deviation"),x=n("customScrollParent"),y=n("context"),{scrollerRef:b,scrollByCallback:C,scrollToCallback:S}=C8(u,m,p,qc,x);return rre(()=>(b.current=x||window,()=>{b.current=null}),[b,x]),t("windowScrollTo",S),t("scrollBy",C),H.createElement(p,{style:{position:"relative",...s,...h!==0?{height:h+g}:{}},"data-virtuoso-scroller":!0,...i,...Rr(p,y)},l)})}const Yre=({children:e})=>{const t=H.useContext(L8),n=xo("viewportHeight"),r=xo("fixedItemHeight"),o=ii(g8(n,s=>ol(s,"height")));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),H.createElement("div",{style:_g,ref:o,"data-viewport-type":"element"},e)},Zre=({children:e})=>{const t=H.useContext(L8),n=xo("windowViewportRect"),r=xo("fixedItemHeight"),o=Dt("customScrollParent"),s=N8(n,o);return H.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),H.createElement("div",{ref:s,style:_g,"data-viewport-type":"window"},e)},Jre=({children:e})=>{const t=Dt("TopItemListComponent"),n=Dt("headerHeight"),r={...qre,marginTop:`${n}px`},o=Dt("context");return H.createElement(t||"div",{style:r,context:o},e)},eoe=H.memo(function(t){const n=Dt("useWindowScroll"),r=Dt("topItemsIndexes").length>0,o=Dt("customScrollParent"),s=o||n?roe:noe,l=o||n?Zre:Yre;return H.createElement(s,{...t},r&&H.createElement(Jre,null,H.createElement(F_,{showTopList:!0})),H.createElement(l,null,H.createElement(Xre,null),H.createElement(F_,null),H.createElement(Qre,null)))}),{Component:toe,usePublisher:xo,useEmitterValue:Dt,useEmitter:Xy}=b8(Vre,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},eoe),noe=B8({usePublisher:xo,useEmitterValue:Dt,useEmitter:Xy}),roe=H8({usePublisher:xo,useEmitterValue:Dt,useEmitter:Xy}),ooe=toe,B_={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},soe={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:H_,ceil:V_,floor:fh,min:Kv,max:Ku}=Math;function aoe(e){return{...soe,items:e}}function W_(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function loe(e,t){return e&&e.column===t.column&&e.row===t.row}function Dp(e,t){return e&&e.width===t.width&&e.height===t.height}const ioe=qt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:l,smoothScrollTargetReached:i,scrollContainerState:u,footerHeight:p,headerHeight:m},h,g,{propsReady:x,didMount:y},{windowViewportRect:b,useWindowScroll:C,customScrollParent:S,windowScrollContainerState:_,windowScrollTo:j},E])=>{const I=He(0),M=He(0),D=He(B_),R=He({height:0,width:0}),A=He({height:0,width:0}),O=Tt(),$=Tt(),X=He(0),z=He(null),V=He({row:0,column:0}),Q=Tt(),G=Tt(),F=He(!1),U=He(0),T=He(!0),B=He(!1);Yt(Pe(y,It(U),gt(([K,ee])=>!!ee)),()=>{St(T,!1),St(M,0)}),Yt(Pe(Qn(y,T,A,R,U,B),gt(([K,ee,ce,J,,ie])=>K&&!ee&&ce.height!==0&&J.height!==0&&!ie)),([,,,,K])=>{St(B,!0),Uy(1,()=>{St(O,K)}),ua(Pe(r),()=>{St(n,[0,0]),St(T,!0)})}),at(Pe(G,gt(K=>K!=null&&K.scrollTop>0),Xs(0)),M),Yt(Pe(y,It(G),gt(([,K])=>K!=null)),([,K])=>{K&&(St(R,K.viewport),St(A,K==null?void 0:K.item),St(V,K.gap),K.scrollTop>0&&(St(F,!0),ua(Pe(r,Mc(1)),ee=>{St(F,!1)}),St(l,{top:K.scrollTop})))}),at(Pe(R,Qe(({height:K})=>K)),o),at(Pe(Qn(ht(R,Dp),ht(A,Dp),ht(V,(K,ee)=>K&&K.column===ee.column&&K.row===ee.row),ht(r)),Qe(([K,ee,ce,J])=>({viewport:K,item:ee,gap:ce,scrollTop:J}))),Q),at(Pe(Qn(ht(I),t,ht(V,loe),ht(A,Dp),ht(R,Dp),ht(z),ht(M),ht(F),ht(T),ht(U)),gt(([,,,,,,,K])=>!K),Qe(([K,[ee,ce],J,ie,de,xe,we,,ve,fe])=>{const{row:Oe,column:je}=J,{height:$e,width:st}=ie,{width:Ve}=de;if(we===0&&(K===0||Ve===0))return B_;if(st===0){const ct=Gy(fe,K),ft=ct===0?Math.max(we-1,0):ct;return aoe(W_(ct,ft,xe))}const Ct=V8(Ve,st,je);let Ye,Ke;ve?ee===0&&ce===0&&we>0?(Ye=0,Ke=we-1):(Ye=Ct*fh((ee+Oe)/($e+Oe)),Ke=Ct*V_((ce+Oe)/($e+Oe))-1,Ke=Kv(K-1,Ku(Ke,Ct-1)),Ye=Kv(Ke,Ku(0,Ye))):(Ye=0,Ke=-1);const he=W_(Ye,Ke,xe),{top:Re,bottom:ut}=U_(de,J,ie,he),yt=V_(K/Ct),et=yt*$e+(yt-1)*Oe-ut;return{items:he,offsetTop:Re,offsetBottom:et,top:Re,bottom:ut,itemHeight:$e,itemWidth:st}})),D),at(Pe(z,gt(K=>K!==null),Qe(K=>K.length)),I),at(Pe(Qn(R,A,D,V),gt(([K,ee,{items:ce}])=>ce.length>0&&ee.height!==0&&K.height!==0),Qe(([K,ee,{items:ce},J])=>{const{top:ie,bottom:de}=U_(K,J,ee,ce);return[ie,de]}),dn(gd)),n);const Y=He(!1);at(Pe(r,It(Y),Qe(([K,ee])=>ee||K!==0)),Y);const re=Qr(Pe(ht(D),gt(({items:K})=>K.length>0),It(I,Y),gt(([{items:K},ee,ce])=>ce&&K[K.length-1].index===ee-1),Qe(([,K])=>K-1),dn())),ae=Qr(Pe(ht(D),gt(({items:K})=>K.length>0&&K[0].index===0),Xs(0),dn())),oe=Qr(Pe(ht(D),It(F),gt(([{items:K},ee])=>K.length>0&&!ee),Qe(([{items:K}])=>({startIndex:K[0].index,endIndex:K[K.length-1].index})),dn(D8),Ga(0)));at(oe,g.scrollSeekRangeChanged),at(Pe(O,It(R,A,I,V),Qe(([K,ee,ce,J,ie])=>{const de=M8(K),{align:xe,behavior:we,offset:ve}=de;let fe=de.index;fe==="LAST"&&(fe=J-1),fe=Ku(0,fe,Kv(J-1,fe));let Oe=Sx(ee,ie,ce,fe);return xe==="end"?Oe=H_(Oe-ee.height+ce.height):xe==="center"&&(Oe=H_(Oe-ee.height/2+ce.height/2)),ve&&(Oe+=ve),{top:Oe,behavior:we}})),l);const q=br(Pe(D,Qe(K=>K.offsetBottom+K.bottom)),0);return at(Pe(b,Qe(K=>({width:K.visibleWidth,height:K.visibleHeight}))),R),{data:z,totalCount:I,viewportDimensions:R,itemDimensions:A,scrollTop:r,scrollHeight:$,overscan:e,scrollBy:s,scrollTo:l,scrollToIndex:O,smoothScrollTargetReached:i,windowViewportRect:b,windowScrollTo:j,useWindowScroll:C,customScrollParent:S,windowScrollContainerState:_,deviation:X,scrollContainerState:u,footerHeight:p,headerHeight:m,initialItemCount:M,gap:V,restoreStateFrom:G,...g,initialTopMostItemIndex:U,gridState:D,totalListHeight:q,...h,startReached:ae,endReached:re,rangeChanged:oe,stateChanged:Q,propsReady:x,stateRestoreInProgress:F,...E}},mn(Ky,kr,Zd,R8,hl,qy,ml));function U_(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=Sx(e,t,n,r[0].index),l=Sx(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:l}}function Sx(e,t,n,r){const o=V8(e.width,n.width,t.column),s=fh(r/o),l=s*n.height+Ku(0,s-1)*t.row;return l>0?l+t.row:l}function V8(e,t,n){return Ku(1,fh((e+n)/(fh(t)+n)))}const coe=qt(()=>{const e=He(p=>`Item ${p}`),t=He({}),n=He(null),r=He("virtuoso-grid-item"),o=He("virtuoso-grid-list"),s=He(F8),l=He("div"),i=He(qc),u=(p,m=null)=>br(Pe(t,Qe(h=>h[p]),dn()),m);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:l,scrollerRef:i,FooterComponent:u("Footer"),HeaderComponent:u("Header"),ListComponent:u("List","div"),ItemComponent:u("Item","div"),ScrollerComponent:u("Scroller","div"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),uoe=qt(([e,t])=>({...e,...t}),mn(ioe,coe)),doe=H.memo(function(){const t=bn("gridState"),n=bn("listClassName"),r=bn("itemClassName"),o=bn("itemContent"),s=bn("computeItemKey"),l=bn("isSeeking"),i=Xo("scrollHeight"),u=bn("ItemComponent"),p=bn("ListComponent"),m=bn("ScrollSeekPlaceholder"),h=bn("context"),g=Xo("itemDimensions"),x=Xo("gap"),y=bn("log"),b=bn("stateRestoreInProgress"),C=ii(S=>{const _=S.parentElement.parentElement.scrollHeight;i(_);const j=S.firstChild;if(j){const{width:E,height:I}=j.getBoundingClientRect();g({width:E,height:I})}x({row:G_("row-gap",getComputedStyle(S).rowGap,y),column:G_("column-gap",getComputedStyle(S).columnGap,y)})});return b?null:H.createElement(p,{ref:C,className:n,...Rr(p,h),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(S=>{const _=s(S.index,S.data,h);return l?H.createElement(m,{key:_,...Rr(m,h),index:S.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(u,{...Rr(u,h),className:r,"data-index":S.index,key:_},o(S.index,S.data,h))}))}),foe=H.memo(function(){const t=bn("HeaderComponent"),n=Xo("headerHeight"),r=bn("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=bn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),poe=H.memo(function(){const t=bn("FooterComponent"),n=Xo("footerHeight"),r=bn("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=bn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),moe=({children:e})=>{const t=H.useContext(z8),n=Xo("itemDimensions"),r=Xo("viewportDimensions"),o=ii(s=>{r(s.getBoundingClientRect())});return H.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),H.createElement("div",{style:_g,ref:o},e)},hoe=({children:e})=>{const t=H.useContext(z8),n=Xo("windowViewportRect"),r=Xo("itemDimensions"),o=bn("customScrollParent"),s=N8(n,o);return H.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),H.createElement("div",{ref:s,style:_g},e)},goe=H.memo(function({...t}){const n=bn("useWindowScroll"),r=bn("customScrollParent"),o=r||n?boe:xoe,s=r||n?hoe:moe;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(foe,null),H.createElement(doe,null),H.createElement(poe,null)))}),{Component:voe,usePublisher:Xo,useEmitterValue:bn,useEmitter:W8}=b8(uoe,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},goe),xoe=B8({usePublisher:Xo,useEmitterValue:bn,useEmitter:W8}),boe=H8({usePublisher:Xo,useEmitterValue:bn,useEmitter:W8});function G_(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Yr.WARN),t==="normal"?0:parseInt(t??"0",10)}const yoe=voe,Coe=e=>{const t=W(s=>s.gallery.galleryView),{data:n}=Kx(e),{data:r}=qx(e),o=d.useMemo(()=>t==="images"?n==null?void 0:n.total:r==null?void 0:r.total,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}},woe=({imageDTO:e})=>a.jsx(N,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:a.jsxs(As,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),Soe=d.memo(woe),Qy=({postUploadAction:e,isDisabled:t})=>{const n=W(u=>u.gallery.autoAddBoardId),[r]=oI(),o=d.useCallback(u=>{const p=u[0];p&&r({file:p,image_category:"user",is_intermediate:!1,postUploadAction:e??{type:"TOAST"},board_id:n==="none"?void 0:n})},[n,e,r]),{getRootProps:s,getInputProps:l,open:i}=ry({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:l,openUploader:i}},koe=le(ge,({generation:e})=>e.model,Ce),jg=()=>{const e=te(),t=si(),{t:n}=Z(),r=W(koe),o=d.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),s=d.useCallback(T=>{t({title:n("toast.parameterNotSet"),description:T,status:"warning",duration:2500,isClosable:!0})},[n,t]),l=d.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),i=d.useCallback(T=>{t({title:n("toast.parametersNotSet"),status:"warning",description:T,duration:2500,isClosable:!0})},[n,t]),u=d.useCallback((T,B,Y,re)=>{if(Qf(T)||Yf(B)||wu(Y)||J0(re)){Qf(T)&&e(Fu(T)),Yf(B)&&e(Bu(B)),wu(Y)&&e(Hu(Y)),wu(re)&&e(Vu(re)),o();return}s()},[e,o,s]),p=d.useCallback(T=>{if(!Qf(T)){s();return}e(Fu(T)),o()},[e,o,s]),m=d.useCallback(T=>{if(!Yf(T)){s();return}e(Bu(T)),o()},[e,o,s]),h=d.useCallback(T=>{if(!wu(T)){s();return}e(Hu(T)),o()},[e,o,s]),g=d.useCallback(T=>{if(!J0(T)){s();return}e(Vu(T)),o()},[e,o,s]),x=d.useCallback(T=>{if(!fw(T)){s();return}e(Jp(T)),o()},[e,o,s]),y=d.useCallback(T=>{if(!ev(T)){s();return}e(em(T)),o()},[e,o,s]),b=d.useCallback(T=>{if(!pw(T)){s();return}e(d1(T)),o()},[e,o,s]),C=d.useCallback(T=>{if(!tv(T)){s();return}e(f1(T)),o()},[e,o,s]),S=d.useCallback(T=>{if(!nv(T)){s();return}e(tm(T)),o()},[e,o,s]),_=d.useCallback(T=>{if(!mw(T)){s();return}e(Hl(T)),o()},[e,o,s]),j=d.useCallback(T=>{if(!hw(T)){s();return}e(Vl(T)),o()},[e,o,s]),E=d.useCallback(T=>{if(!gw(T)){s();return}e(nm(T)),o()},[e,o,s]),{data:I}=kd(void 0),M=d.useCallback(T=>{if(!mI(T.lora))return{lora:null,error:"Invalid LoRA model"};const{base_model:B,model_name:Y}=T.lora,re=I?NR.getSelectors().selectById(I,`${B}/lora/${Y}`):void 0;return re?(re==null?void 0:re.base_model)===(r==null?void 0:r.base_model)?{lora:re,error:null}:{lora:null,error:"LoRA incompatible with currently-selected model"}:{lora:null,error:"LoRA model is not installed"}},[I,r==null?void 0:r.base_model]),D=d.useCallback(T=>{const B=M(T);if(!B.lora){s(B.error);return}e(vw({...B.lora,weight:T.weight})),o()},[M,e,o,s]),{data:R}=Xx(void 0),A=d.useCallback(T=>{if(!rm(T.control_model))return{controlnet:null,error:"Invalid ControlNet model"};const{image:B,control_model:Y,control_weight:re,begin_step_percent:ae,end_step_percent:oe,control_mode:q,resize_mode:K}=T,ee=R?hI.getSelectors().selectById(R,`${Y.base_model}/controlnet/${Y.model_name}`):void 0;if(!ee)return{controlnet:null,error:"ControlNet model is not installed"};if(!((ee==null?void 0:ee.base_model)===(r==null?void 0:r.base_model)))return{controlnet:null,error:"ControlNet incompatible with currently-selected model"};const J="none",ie=wr.none.default;return{controlnet:{type:"controlnet",isEnabled:!0,model:ee,weight:typeof re=="number"?re:Su.weight,beginStepPct:ae||Su.beginStepPct,endStepPct:oe||Su.endStepPct,controlMode:q||Su.controlMode,resizeMode:K||Su.resizeMode,controlImage:(B==null?void 0:B.image_name)||null,processedControlImage:(B==null?void 0:B.image_name)||null,processorType:J,processorNode:ie,shouldAutoConfig:!0,id:Js()},error:null}},[R,r==null?void 0:r.base_model]),O=d.useCallback(T=>{const B=A(T);if(!B.controlnet){s(B.error);return}e(Mi(B.controlnet)),o()},[A,e,o,s]),{data:$}=Qx(void 0),X=d.useCallback(T=>{if(!rm(T.t2i_adapter_model))return{controlnet:null,error:"Invalid ControlNet model"};const{image:B,t2i_adapter_model:Y,weight:re,begin_step_percent:ae,end_step_percent:oe,resize_mode:q}=T,K=$?gI.getSelectors().selectById($,`${Y.base_model}/t2i_adapter/${Y.model_name}`):void 0;if(!K)return{controlnet:null,error:"ControlNet model is not installed"};if(!((K==null?void 0:K.base_model)===(r==null?void 0:r.base_model)))return{t2iAdapter:null,error:"ControlNet incompatible with currently-selected model"};const ce="none",J=wr.none.default;return{t2iAdapter:{type:"t2i_adapter",isEnabled:!0,model:K,weight:typeof re=="number"?re:Zf.weight,beginStepPct:ae||Zf.beginStepPct,endStepPct:oe||Zf.endStepPct,resizeMode:q||Zf.resizeMode,controlImage:(B==null?void 0:B.image_name)||null,processedControlImage:(B==null?void 0:B.image_name)||null,processorType:ce,processorNode:J,shouldAutoConfig:!0,id:Js()},error:null}},[r==null?void 0:r.base_model,$]),z=d.useCallback(T=>{const B=X(T);if(!B.t2iAdapter){s(B.error);return}e(Mi(B.t2iAdapter)),o()},[X,e,o,s]),{data:V}=Yx(void 0),Q=d.useCallback(T=>{if(!LR(T==null?void 0:T.ip_adapter_model))return{ipAdapter:null,error:"Invalid IP Adapter model"};const{image:B,ip_adapter_model:Y,weight:re,begin_step_percent:ae,end_step_percent:oe}=T,q=V?vI.getSelectors().selectById(V,`${Y.base_model}/ip_adapter/${Y.model_name}`):void 0;return q?(q==null?void 0:q.base_model)===(r==null?void 0:r.base_model)?{ipAdapter:{id:Js(),type:"ip_adapter",isEnabled:!0,controlImage:(B==null?void 0:B.image_name)??null,model:q,weight:re??rv.weight,beginStepPct:ae??rv.beginStepPct,endStepPct:oe??rv.endStepPct},error:null}:{ipAdapter:null,error:"IP Adapter incompatible with currently-selected model"}:{ipAdapter:null,error:"IP Adapter model is not installed"}},[V,r==null?void 0:r.base_model]),G=d.useCallback(T=>{const B=Q(T);if(!B.ipAdapter){s(B.error);return}e(Mi(B.ipAdapter)),o()},[Q,e,o,s]),F=d.useCallback(T=>{e(Ch(T))},[e]),U=d.useCallback(T=>{if(!T){i();return}const{cfg_scale:B,height:Y,model:re,positive_prompt:ae,negative_prompt:oe,scheduler:q,seed:K,steps:ee,width:ce,strength:J,positive_style_prompt:ie,negative_style_prompt:de,refiner_model:xe,refiner_cfg_scale:we,refiner_steps:ve,refiner_scheduler:fe,refiner_positive_aesthetic_score:Oe,refiner_negative_aesthetic_score:je,refiner_start:$e,loras:st,controlnets:Ve,ipAdapters:Ct,t2iAdapters:Ye}=T;ev(B)&&e(em(B)),pw(re)&&e(d1(re)),Qf(ae)&&e(Fu(ae)),Yf(oe)&&e(Bu(oe)),tv(q)&&e(f1(q)),fw(K)&&e(Jp(K)),nv(ee)&&e(tm(ee)),mw(ce)&&e(Hl(ce)),hw(Y)&&e(Vl(Y)),gw(J)&&e(nm(J)),wu(ie)&&e(Hu(ie)),J0(de)&&e(Vu(de)),zR(xe)&&e(xI(xe)),nv(ve)&&e(p1(ve)),ev(we)&&e(m1(we)),tv(fe)&&e(bI(fe)),FR(Oe)&&e(h1(Oe)),BR(je)&&e(g1(je)),HR($e)&&e(v1($e)),e(VR()),st==null||st.forEach(Ke=>{const he=M(Ke);he.lora&&e(vw({...he.lora,weight:Ke.weight}))}),e(lI()),Ve==null||Ve.forEach(Ke=>{const he=A(Ke);he.controlnet&&e(Mi(he.controlnet))}),Ct==null||Ct.forEach(Ke=>{const he=Q(Ke);he.ipAdapter&&e(Mi(he.ipAdapter))}),Ye==null||Ye.forEach(Ke=>{const he=X(Ke);he.t2iAdapter&&e(Mi(he.t2iAdapter))}),l()},[e,l,i,M,A,Q,X]);return{recallBothPrompts:u,recallPositivePrompt:p,recallNegativePrompt:m,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:g,recallSeed:x,recallCfgScale:y,recallModel:b,recallScheduler:C,recallSteps:S,recallWidth:_,recallHeight:j,recallStrength:E,recallLoRA:D,recallControlNet:O,recallIPAdapter:G,recallT2IAdapter:z,recallAllParameters:U,sendToImageToImage:F}},U8=()=>{const e=si(),{t}=Z(),n=d.useMemo(()=>!!navigator.clipboard&&!!window.ClipboardItem,[]),r=d.useCallback(async o=>{n||e({title:t("toast.problemCopyingImage"),description:"Your browser doesn't support the Clipboard API.",status:"error",duration:2500,isClosable:!0});try{WR((async()=>{const l=await fetch(o);if(!l.ok)throw new Error("Problem retrieving image data");return await l.blob()})()),e({title:t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})}catch(s){e({title:t("toast.problemCopyingImage"),description:String(s),status:"error",duration:2500,isClosable:!0})}},[n,t,e]);return{isClipboardAPIAvailable:n,copyImageToClipboard:r}};function _oe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"}}]})(e)}function joe(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 256L28.5 28c2-16 15.6-28 31.8-28H228.9c15 0 27.1 12.1 27.1 27.1c0 3.2-.6 6.5-1.7 9.5L208 160H347.3c20.2 0 36.7 16.4 36.7 36.7c0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7h-2.9c-15.7 0-28.5-12.8-28.5-28.5c0-2.3 .3-4.6 .9-6.9L176 288H32c-17.7 0-32-14.3-32-32z"}}]})(e)}function Ioe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"}}]})(e)}function Yy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"}}]})(e)}function Poe(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"}}]})(e)}function Eoe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24H280c13.3 0 24-10.7 24-24s-10.7-24-24-24H136z"}}]})(e)}function Moe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24V232h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H232V120c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"}}]})(e)}function Ooe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M17 16l-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5h-4z"}}]})(e)}function Doe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"}}]})(e)}function Roe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function Zy(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}}]})(e)}function Jy(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}]})(e)}function G8(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"}}]})(e)}const e2=e=>e.config;Zx("gallery/requestedBoardImagesDeletion");const Aoe=Zx("gallery/sentImageToCanvas"),K8=Zx("gallery/sentImageToImg2Img"),Toe=e=>{const{imageDTO:t}=e,n=te(),{t:r}=Z(),o=si(),s=$t("unifiedCanvas").isFeatureEnabled,{shouldFetchMetadataFromApi:l}=W(e2),i=ng(Jx),{metadata:u,workflow:p,isLoading:m}=eb({image:t,shouldFetchMetadataFromApi:l},{selectFromResult:z=>{var V,Q;return{isLoading:z.isFetching,metadata:(V=z==null?void 0:z.currentData)==null?void 0:V.metadata,workflow:(Q=z==null?void 0:z.currentData)==null?void 0:Q.workflow}}}),[h]=tb(),[g]=nb(),{isClipboardAPIAvailable:x,copyImageToClipboard:y}=U8(),b=d.useCallback(()=>{t&&n(wh([t]))},[n,t]),{recallBothPrompts:C,recallSeed:S,recallAllParameters:_}=jg(),j=d.useCallback(()=>{C(u==null?void 0:u.positive_prompt,u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt)},[u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt,C]),E=d.useCallback(()=>{S(u==null?void 0:u.seed)},[u==null?void 0:u.seed,S]),I=d.useCallback(()=>{p&&n(rb(p))},[n,p]),M=d.useCallback(()=>{n(K8()),n(Ch(t))},[n,t]),D=d.useCallback(()=>{n(Aoe()),Kr.flushSync(()=>{n(Qs("unifiedCanvas"))}),n(yI(t)),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),R=d.useCallback(()=>{_(u)},[u,_]),A=d.useCallback(()=>{n(CI([t])),n(Ux(!0))},[n,t]),O=d.useCallback(()=>{y(t.image_url)},[y,t.image_url]),$=d.useCallback(()=>{t&&h({imageDTOs:[t]})},[h,t]),X=d.useCallback(()=>{t&&g({imageDTOs:[t]})},[g,t]);return a.jsxs(a.Fragment,{children:[a.jsx(Kt,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(yy,{}),children:r("common.openInNewTab")}),x&&a.jsx(Kt,{icon:a.jsx(Uc,{}),onClickCapture:O,children:r("parameters.copyImage")}),a.jsx(Kt,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(Gc,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(Kt,{icon:m?a.jsx(Rp,{}):a.jsx(Yy,{}),onClickCapture:I,isDisabled:m||!p,children:r("nodes.loadWorkflow")}),a.jsx(Kt,{icon:m?a.jsx(Rp,{}):a.jsx(SM,{}),onClickCapture:j,isDisabled:m||(u==null?void 0:u.positive_prompt)===void 0&&(u==null?void 0:u.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(Kt,{icon:m?a.jsx(Rp,{}):a.jsx(kM,{}),onClickCapture:E,isDisabled:m||(u==null?void 0:u.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(Kt,{icon:m?a.jsx(Rp,{}):a.jsx(pM,{}),onClickCapture:R,isDisabled:m||!u,children:r("parameters.useAll")}),a.jsx(Kt,{icon:a.jsx(Qk,{}),onClickCapture:M,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(Kt,{icon:a.jsx(Qk,{}),onClickCapture:D,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(Kt,{icon:a.jsx(xM,{}),onClickCapture:A,children:"Change Board"}),t.starred?a.jsx(Kt,{icon:i?i.off.icon:a.jsx(Jy,{}),onClickCapture:X,children:i?i.off.text:"Unstar Image"}):a.jsx(Kt,{icon:i?i.on.icon:a.jsx(Zy,{}),onClickCapture:$,children:i?i.on.text:"Star Image"}),a.jsx(Kt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Fr,{}),onClickCapture:b,children:r("gallery.deleteImage")})]})},q8=d.memo(Toe),Rp=()=>a.jsx(N,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(fa,{size:"xs"})}),$oe=()=>{const{t:e}=Z(),t=te(),n=W(b=>b.gallery.selection),r=ng(Jx),o=$t("bulkDownload").isFeatureEnabled,[s]=tb(),[l]=nb(),[i]=fI(),u=d.useCallback(()=>{t(CI(n)),t(Ux(!0))},[t,n]),p=d.useCallback(()=>{t(wh(n))},[t,n]),m=d.useCallback(()=>{s({imageDTOs:n})},[s,n]),h=d.useCallback(()=>{l({imageDTOs:n})},[l,n]),g=d.useCallback(async()=>{try{const b=await i({image_names:n.map(C=>C.image_name)}).unwrap();t(lt({title:e("gallery.preparingDownload"),status:"success",...b.response?{description:b.response}:{}}))}catch{t(lt({title:e("gallery.preparingDownloadFailed"),status:"error"}))}},[e,n,i,t]),x=d.useMemo(()=>n.every(b=>b.starred),[n]),y=d.useMemo(()=>n.every(b=>!b.starred),[n]);return a.jsxs(a.Fragment,{children:[x&&a.jsx(Kt,{icon:r?r.on.icon:a.jsx(Zy,{}),onClickCapture:h,children:r?r.off.text:"Unstar All"}),(y||!x&&!y)&&a.jsx(Kt,{icon:r?r.on.icon:a.jsx(Jy,{}),onClickCapture:m,children:r?r.on.text:"Star All"}),o&&a.jsx(Kt,{icon:a.jsx(Gc,{}),onClickCapture:g,children:e("gallery.downloadSelection")}),a.jsx(Kt,{icon:a.jsx(xM,{}),onClickCapture:u,children:"Change Board"}),a.jsx(Kt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Fr,{}),onClickCapture:p,children:"Delete Selection"})]})},Noe=d.memo($oe),Loe=le([ge],({gallery:e})=>({selectionCount:e.selection.length}),Ce),zoe=({imageDTO:e,children:t})=>{const{selectionCount:n}=W(Loe),r=d.useCallback(o=>{o.preventDefault()},[]);return a.jsx(zy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:r,children:a.jsx(Noe,{})}):a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:r,children:a.jsx(q8,{imageDTO:e})}):null,children:t})},Foe=d.memo(zoe),Boe=e=>{const{data:t,disabled:n,...r}=e,o=d.useRef(Js()),{attributes:s,listeners:l,setNodeRef:i}=vne({id:o.current,disabled:n,data:t});return a.jsx(Ie,{ref:i,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...l,...r})},Hoe=d.memo(Boe),Voe=a.jsx(Tn,{as:fg,sx:{boxSize:16}}),Woe=a.jsx(tr,{icon:Yl}),Uoe=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:l=!1,isUploadDisabled:i=!1,minSize:u=24,postUploadAction:p,imageSx:m,fitContainer:h=!1,droppableData:g,draggableData:x,dropLabel:y,isSelected:b=!1,thumbnail:C=!1,noContentFallback:S=Woe,uploadElement:_=Voe,useThumbailFallback:j,withHoverOverlay:E=!1,children:I,onMouseOver:M,onMouseOut:D,dataTestId:R}=e,{colorMode:A}=ha(),[O,$]=d.useState(!1),X=d.useCallback(F=>{M&&M(F),$(!0)},[M]),z=d.useCallback(F=>{D&&D(F),$(!1)},[D]),{getUploadButtonProps:V,getUploadInputProps:Q}=Qy({postUploadAction:p,isDisabled:i}),G=i?{}:{cursor:"pointer",bg:Ae("base.200","base.700")(A),_hover:{bg:Ae("base.300","base.650")(A),color:Ae("base.500","base.300")(A)}};return a.jsx(Foe,{imageDTO:t,children:F=>a.jsxs(N,{ref:F,onMouseOver:X,onMouseOut:z,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:u||void 0,minH:u||void 0,userSelect:"none",cursor:l||!t?"default":"pointer"},children:[t&&a.jsxs(N,{sx:{w:"full",h:"full",position:h?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(ga,{src:C?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:j?t.thumbnail_url:void 0,fallback:j?void 0:a.jsx(Gne,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...m},"data-testid":R}),o&&a.jsx(Soe,{imageDTO:t}),a.jsx(Ly,{isSelected:b,isHovered:E?O:!1})]}),!t&&!i&&a.jsx(a.Fragment,{children:a.jsxs(N,{sx:{minH:u,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(A),...G},...V(),children:[a.jsx("input",{...Q()}),_]})}),!t&&i&&S,t&&!l&&a.jsx(Hoe,{data:x,disabled:l||!t,onClick:r}),I,!s&&a.jsx(Ny,{data:g,disabled:s,dropLabel:y})]})})},sl=d.memo(Uoe),Goe=()=>a.jsx(Xh,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full"}})}),Koe=d.memo(Goe),qoe=le([ge,ob],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},Ce),Xoe=e=>{const t=te(),{queryArgs:n,selection:r}=W(qoe),{imageDTOs:o}=wI(n,{selectFromResult:p=>({imageDTOs:p.data?UR.selectAll(p.data):[]})}),s=$t("multiselect").isFeatureEnabled,l=d.useCallback(p=>{var m;if(e){if(!s){t(ku([e]));return}if(p.shiftKey){const h=e.image_name,g=(m=r[r.length-1])==null?void 0:m.image_name,x=o.findIndex(b=>b.image_name===g),y=o.findIndex(b=>b.image_name===h);if(x>-1&&y>-1){const b=Math.min(x,y),C=Math.max(x,y),S=o.slice(b,C+1);t(ku(r.concat(S)))}}else p.ctrlKey||p.metaKey?r.some(h=>h.image_name===e.image_name)&&r.length>1?t(ku(r.filter(h=>h.image_name!==e.image_name))):t(ku(r.concat(e))):t(ku([e]))}},[t,e,o,r,s]),i=d.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),u=d.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:u,isSelected:i,handleClick:l}},Qoe=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=aa("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))");return a.jsx(Be,{onClick:t,"aria-label":n,tooltip:n,icon:r,size:"sm",variant:"link",sx:{position:"absolute",top:1,insetInlineEnd:1,p:0,minW:0,svg:{transitionProperty:"common",transitionDuration:"normal",fill:"base.100",_hover:{fill:"base.50"},filter:s},...o},"data-testid":n})},xc=d.memo(Qoe),Yoe=e=>{const t=te(),{imageName:n}=e,{currentData:r}=wo(n),o=W(M=>M.hotkeys.shift),{t:s}=Z(),{handleClick:l,isSelected:i,selection:u,selectionCount:p}=Xoe(r),m=ng(Jx),h=d.useCallback(M=>{M.stopPropagation(),r&&t(wh([r]))},[t,r]),g=d.useMemo(()=>{if(p>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:u}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,u,p]),[x]=tb(),[y]=nb(),b=d.useCallback(()=>{r&&(r.starred&&y({imageDTOs:[r]}),r.starred||x({imageDTOs:[r]}))},[x,y,r]),[C,S]=d.useState(!1),_=d.useCallback(()=>{S(!0)},[]),j=d.useCallback(()=>{S(!1)},[]),E=d.useMemo(()=>{if(r!=null&&r.starred)return m?m.on.icon:a.jsx(Jy,{size:"20"});if(!(r!=null&&r.starred)&&C)return m?m.off.icon:a.jsx(Zy,{size:"20"})},[r==null?void 0:r.starred,C,m]),I=d.useMemo(()=>r!=null&&r.starred?m?m.off.text:"Unstar":r!=null&&r.starred?"":m?m.on.text:"Star",[r==null?void 0:r.starred,m]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},"data-testid":`image-${r.image_name}`,children:a.jsx(N,{userSelect:"none",sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(sl,{onClick:l,imageDTO:r,draggableData:g,isSelected:i,minSize:0,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0,withHoverOverlay:!0,onMouseOver:_,onMouseOut:j,children:a.jsxs(a.Fragment,{children:[a.jsx(xc,{onClick:b,icon:E,tooltip:I}),C&&o&&a.jsx(xc,{onClick:h,icon:a.jsx(Fr,{}),tooltip:s("gallery.deleteImage"),styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Koe,{})},Zoe=d.memo(Yoe),Joe=_e((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,"data-testid":"image-item-container",children:e.children})),ese=d.memo(Joe),tse=_e((e,t)=>{const n=W(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(el,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},"data-testid":"image-list-container",children:e.children})}),nse=d.memo(tse),rse={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},ose=()=>{const{t:e}=Z(),t=d.useRef(null),[n,r]=d.useState(null),[o,s]=$y(rse),l=W(C=>C.gallery.selectedBoardId),{currentViewTotal:i}=Coe(l),u=W(ob),{currentData:p,isFetching:m,isSuccess:h,isError:g}=wI(u),[x]=SI(),y=d.useMemo(()=>!p||!i?!1:p.ids.length<i,[p,i]),b=d.useCallback(()=>{y&&x({...u,offset:(p==null?void 0:p.ids.length)??0,limit:kI})},[y,x,u,p==null?void 0:p.ids.length]);return d.useEffect(()=>{const{current:C}=t;return n&&C&&o({target:C,elements:{viewport:n}}),()=>{var S;return(S=s())==null?void 0:S.destroy()}},[n,o,s]),p?h&&(p==null?void 0:p.ids.length)===0?a.jsx(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:e("gallery.noImagesInGallery"),icon:Yl})}):h&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(yoe,{style:{height:"100%"},data:p.ids,endReached:b,components:{Item:ese,List:nse},scrollerRef:r,itemContent:(C,S)=>a.jsx(Zoe,{imageName:S},S)})}),a.jsx(ot,{onClick:b,isDisabled:!y,isLoading:m,loadingText:e("gallery.loading"),flexShrink:0,children:`Load More (${p.ids.length} of ${i})`})]}):g?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(tr,{label:e("gallery.unableToLoad"),icon:GJ})}):null:a.jsx(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:e("gallery.loading"),icon:Yl})})},sse=d.memo(ose),ase=le([ge],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},Ce),lse=()=>{const{t:e}=Z(),t=d.useRef(null),n=d.useRef(null),{galleryView:r}=W(ase),o=te(),{isOpen:s,onToggle:l}=Lr({defaultIsOpen:!0}),i=d.useCallback(()=>{o(xw("images"))},[o]),u=d.useCallback(()=>{o(xw("assets"))},[o]);return a.jsxs(x3,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs(N,{ref:t,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx($ne,{isOpen:s,onToggle:l}),a.jsx(Une,{})]}),a.jsx(Ie,{children:a.jsx(Rne,{isOpen:s})})]}),a.jsxs(N,{ref:n,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx(N,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(ri,{index:r==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(oi,{children:a.jsxs(Ht,{isAttached:!0,sx:{w:"full"},children:[a.jsx($r,{as:ot,size:"sm",isChecked:r==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(eee,{}),"data-testid":"images-tab",children:e("gallery.images")}),a.jsx($r,{as:ot,size:"sm",isChecked:r==="assets",onClick:u,sx:{w:"full"},leftIcon:a.jsx(fee,{}),"data-testid":"assets-tab",children:e("gallery.assets")})]})})})}),a.jsx(sse,{})]})]})},ise=d.memo(lse),cse=()=>{const e=W(p=>p.system.isConnected),{data:t}=va(),[n,{isLoading:r}]=sb(),o=te(),{t:s}=Z(),l=d.useMemo(()=>t==null?void 0:t.queue.item_id,[t==null?void 0:t.queue.item_id]),i=d.useCallback(async()=>{if(l)try{await n(l).unwrap(),o(lt({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(lt({title:s("queue.cancelFailed"),status:"error"}))}},[l,o,s,n]),u=d.useMemo(()=>!e||gb(l),[e,l]);return{cancelQueueItem:i,isLoading:r,currentQueueItemId:l,isDisabled:u}},use=({label:e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,asIconButton:l,isLoading:i,loadingText:u,sx:p})=>l?a.jsx(Be,{"aria-label":e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:i,sx:p,"data-testid":e}):a.jsx(ot,{"aria-label":e,tooltip:t,leftIcon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:i,loadingText:u??e,flexGrow:1,sx:p,"data-testid":e,children:e}),ui=d.memo(use),dse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{cancelQueueItem:r,isLoading:o,isDisabled:s}=cse();return a.jsx(ui,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.cancel"),tooltip:n("queue.cancelTooltip"),icon:a.jsx(Ec,{}),onClick:r,colorScheme:"error",sx:t})},X8=d.memo(dse),fse=()=>{const{t:e}=Z(),t=te(),{data:n}=va(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=_I({fixedCacheKey:"clearQueue"}),l=d.useCallback(async()=>{if(n!=null&&n.queue.total)try{await o().unwrap(),t(lt({title:e("queue.clearSucceeded"),status:"success"})),t(ab(void 0)),t(lb(void 0))}catch{t(lt({title:e("queue.clearFailed"),status:"error"}))}},[n==null?void 0:n.queue.total,o,t,e]),i=d.useMemo(()=>!r||!(n!=null&&n.queue.total),[r,n==null?void 0:n.queue.total]);return{clearQueue:l,isLoading:s,queueStatus:n,isDisabled:i}},pse=_e((e,t)=>{const{t:n}=Z(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:l,children:i,title:u,triggerComponent:p}=e,{isOpen:m,onOpen:h,onClose:g}=Lr(),x=d.useRef(null),y=()=>{o(),g()},b=()=>{l&&l(),g()};return a.jsxs(a.Fragment,{children:[d.cloneElement(p,{onClick:h,ref:t}),a.jsx(Ld,{isOpen:m,leastDestructiveRef:x,onClose:g,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(zd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:u}),a.jsx(Jo,{children:i}),a.jsxs(ks,{children:[a.jsx(ot,{ref:x,onClick:b,children:s}),a.jsx(ot,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),Ig=d.memo(pse),mse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{clearQueue:r,isLoading:o,isDisabled:s}=fse();return a.jsxs(Ig,{title:n("queue.clearTooltip"),acceptCallback:r,acceptButtonText:n("queue.clear"),triggerComponent:a.jsx(ui,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.clear"),tooltip:n("queue.clearTooltip"),icon:a.jsx(Fr,{}),colorScheme:"error",sx:t}),children:[a.jsx(be,{children:n("queue.clearQueueAlertDialog")}),a.jsx("br",{}),a.jsx(be,{children:n("queue.clearQueueAlertDialog2")})]})},t2=d.memo(mse),hse=()=>{const e=te(),{t}=Z(),n=W(p=>p.system.isConnected),{data:r}=va(),[o,{isLoading:s}]=jI({fixedCacheKey:"pauseProcessor"}),l=d.useMemo(()=>!!(r!=null&&r.processor.is_started),[r==null?void 0:r.processor.is_started]),i=d.useCallback(async()=>{if(l)try{await o().unwrap(),e(lt({title:t("queue.pauseSucceeded"),status:"success"}))}catch{e(lt({title:t("queue.pauseFailed"),status:"error"}))}},[l,o,e,t]),u=d.useMemo(()=>!n||!l,[n,l]);return{pauseProcessor:i,isLoading:s,isStarted:l,isDisabled:u}},gse=({asIconButton:e})=>{const{t}=Z(),{pauseProcessor:n,isLoading:r,isDisabled:o}=hse();return a.jsx(ui,{asIconButton:e,label:t("queue.pause"),tooltip:t("queue.pauseTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(aee,{}),onClick:n,colorScheme:"gold"})},Q8=d.memo(gse),vse=le([ge,Zn],({controlAdapters:e,generation:t,system:n,nodes:r,dynamicPrompts:o},s)=>{const{initialImage:l,model:i}=t,{isConnected:u}=n,p=[];return u||p.push(bt.t("parameters.invoke.systemDisconnected")),s==="img2img"&&!l&&p.push(bt.t("parameters.invoke.noInitialImageSelected")),s==="nodes"?r.shouldValidateGraph&&(r.nodes.length||p.push(bt.t("parameters.invoke.noNodesInGraph")),r.nodes.forEach(m=>{if(!Mn(m))return;const h=r.nodeTemplates[m.data.type];if(!h){p.push(bt.t("parameters.invoke.missingNodeTemplate"));return}const g=GR([m],r.edges);Wn(m.data.inputs,x=>{const y=h.inputs[x.name],b=g.some(C=>C.target===m.id&&C.targetHandle===x.name);if(!y){p.push(bt.t("parameters.invoke.missingFieldTemplate"));return}if(y.required&&x.value===void 0&&!b){p.push(bt.t("parameters.invoke.missingInputForField",{nodeLabel:m.data.label||h.title,fieldLabel:x.label||y.title}));return}})})):(o.prompts.length===0&&p.push(bt.t("parameters.invoke.noPrompts")),i||p.push(bt.t("parameters.invoke.noModelSelected")),KR(e).forEach((m,h)=>{m.isEnabled&&(m.model?m.model.base_model!==(i==null?void 0:i.base_model)&&p.push(bt.t("parameters.invoke.incompatibleBaseModelForControlAdapter",{number:h+1})):p.push(bt.t("parameters.invoke.noModelForControlAdapter",{number:h+1})),(!m.controlImage||Nc(m)&&!m.processedControlImage&&m.processorType!=="none")&&p.push(bt.t("parameters.invoke.noControlImageForControlAdapter",{number:h+1})))})),{isReady:!p.length,reasons:p}},Ce),n2=()=>{const{isReady:e,reasons:t}=W(vse);return{isReady:e,reasons:t}},Y8=()=>{const e=te(),t=W(Zn),{isReady:n}=n2(),[r,{isLoading:o}]=Sh({fixedCacheKey:"enqueueBatch"}),s=d.useMemo(()=>!n,[n]);return{queueBack:d.useCallback(()=>{s||(e(ib()),e(II({tabName:t,prepend:!1})))},[e,s,t]),isLoading:o,isDisabled:s}},xse=le([ge],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},Ce),bse=({prepend:e=!1})=>{const{t}=Z(),{isReady:n,reasons:r}=n2(),{autoAddBoardId:o}=W(xse),s=yg(o),[l,{isLoading:i}]=Sh({fixedCacheKey:"enqueueBatch"}),u=d.useMemo(()=>t(i?"queue.enqueueing":n?e?"queue.queueFront":"queue.queueBack":"queue.notReady"),[i,n,e,t]);return a.jsxs(N,{flexDir:"column",gap:1,children:[a.jsx(be,{fontWeight:600,children:u}),r.length>0&&a.jsx(Ad,{children:r.map((p,m)=>a.jsx(ho,{children:a.jsx(be,{fontWeight:400,children:p})},`${p}.${m}`))}),a.jsx(J8,{}),a.jsxs(be,{fontWeight:400,fontStyle:"oblique 10deg",children:[t("parameters.invoke.addingImagesTo")," ",a.jsx(be,{as:"span",fontWeight:600,children:s||t("boards.uncategorized")})]})]})},Z8=d.memo(bse),J8=d.memo(()=>a.jsx(Yn,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}));J8.displayName="StyledDivider";const yse=()=>a.jsx(Ie,{pos:"relative",w:4,h:4,children:a.jsx(ga,{src:Gx,alt:"invoke-ai-logo",pos:"absolute",top:-.5,insetInlineStart:-.5,w:5,h:5,minW:5,minH:5,filter:"saturate(0)"})}),Cse=d.memo(yse),wse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueBack:r,isLoading:o,isDisabled:s}=Y8();return a.jsx(ui,{asIconButton:e,colorScheme:"accent",label:n("parameters.invoke.invoke"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(Z8,{}),sx:t,icon:e?a.jsx(Cse,{}):void 0})},eO=d.memo(wse),tO=()=>{const e=te(),t=W(Zn),{isReady:n}=n2(),[r,{isLoading:o}]=Sh({fixedCacheKey:"enqueueBatch"}),s=$t("prependQueue").isFeatureEnabled,l=d.useMemo(()=>!n||!s,[n,s]);return{queueFront:d.useCallback(()=>{l||(e(ib()),e(II({tabName:t,prepend:!0})))},[e,l,t]),isLoading:o,isDisabled:l}},Sse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueFront:r,isLoading:o,isDisabled:s}=tO();return a.jsx(ui,{asIconButton:e,colorScheme:"base",label:n("queue.queueFront"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(Z8,{prepend:!0}),icon:a.jsx(joe,{}),sx:t})},kse=d.memo(Sse),_se=()=>{const e=te(),t=W(p=>p.system.isConnected),{data:n}=va(),{t:r}=Z(),[o,{isLoading:s}]=PI({fixedCacheKey:"resumeProcessor"}),l=d.useMemo(()=>!!(n!=null&&n.processor.is_started),[n==null?void 0:n.processor.is_started]),i=d.useCallback(async()=>{if(!l)try{await o().unwrap(),e(lt({title:r("queue.resumeSucceeded"),status:"success"}))}catch{e(lt({title:r("queue.resumeFailed"),status:"error"}))}},[l,o,e,r]),u=d.useMemo(()=>!t||l,[t,l]);return{resumeProcessor:i,isLoading:s,isStarted:l,isDisabled:u}},jse=({asIconButton:e})=>{const{t}=Z(),{resumeProcessor:n,isLoading:r,isDisabled:o}=_se();return a.jsx(ui,{asIconButton:e,label:t("queue.resume"),tooltip:t("queue.resumeTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(lee,{}),onClick:n,colorScheme:"green"})},nO=d.memo(jse),Ise=le(ge,({system:e})=>{var t;return{isConnected:e.isConnected,hasSteps:!!e.denoiseProgress,value:(((t=e.denoiseProgress)==null?void 0:t.percentage)??0)*100}},Ce),Pse=()=>{const{t:e}=Z(),{data:t}=va(),{hasSteps:n,value:r,isConnected:o}=W(Ise);return a.jsx(Y3,{value:r,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:o&&!!(t!=null&&t.queue.in_progress)&&!n,h:"full",w:"full",borderRadius:2,colorScheme:"accent"})},Ese=d.memo(Pse),Mse=()=>{const e=$t("pauseQueue").isFeatureEnabled,t=$t("resumeQueue").isFeatureEnabled,n=$t("prependQueue").isFeatureEnabled;return a.jsxs(N,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,gap:2,flexDir:"column"},children:[a.jsxs(N,{gap:2,w:"full",children:[a.jsxs(Ht,{isAttached:!0,flexGrow:2,children:[a.jsx(eO,{}),n?a.jsx(kse,{asIconButton:!0}):a.jsx(a.Fragment,{}),a.jsx(X8,{asIconButton:!0})]}),a.jsxs(Ht,{isAttached:!0,children:[t?a.jsx(nO,{asIconButton:!0}):a.jsx(a.Fragment,{}),e?a.jsx(Q8,{asIconButton:!0}):a.jsx(a.Fragment,{})]}),a.jsx(t2,{asIconButton:!0})]}),a.jsx(N,{h:3,w:"full",children:a.jsx(Ese,{})}),a.jsx(oO,{})]})},rO=d.memo(Mse),oO=d.memo(()=>{const{t:e}=Z(),t=te(),{hasItems:n,pending:r}=va(void 0,{selectFromResult:({data:s})=>{if(!s)return{hasItems:!1,pending:0};const{pending:l,in_progress:i}=s.queue;return{hasItems:l+i>0,pending:l}}}),o=d.useCallback(()=>{t(Qs("queue"))},[t]);return a.jsxs(N,{justifyContent:"space-between",alignItems:"center",pe:1,"data-testid":"queue-count",children:[a.jsx(ba,{}),a.jsx(Ja,{onClick:o,size:"sm",variant:"link",fontWeight:400,opacity:.7,fontStyle:"oblique 10deg",children:n?e("queue.queuedCount",{pending:r}):e("queue.queueEmpty")})]})});oO.displayName="QueueCounts";const{createElement:Oc,createContext:Ose,forwardRef:sO,useCallback:Ks,useContext:aO,useEffect:sa,useImperativeHandle:lO,useLayoutEffect:Dse,useMemo:Rse,useRef:Gr,useState:qu}=Wx,K_=Wx["useId".toString()],Xu=Dse,Ase=typeof K_=="function"?K_:()=>null;let Tse=0;function r2(e=null){const t=Ase(),n=Gr(e||t||null);return n.current===null&&(n.current=""+Tse++),n.current}const Pg=Ose(null);Pg.displayName="PanelGroupContext";function iO({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:l=null,maxSize:i=null,minSize:u,onCollapse:p=null,onResize:m=null,order:h=null,style:g={},tagName:x="div"}){const y=aO(Pg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const b=r2(l),{collapsePanel:C,expandPanel:S,getPanelSize:_,getPanelStyle:j,registerPanel:E,resizePanel:I,units:M,unregisterPanel:D}=y;u==null&&(M==="percentages"?u=10:u=0);const R=Gr({onCollapse:p,onResize:m});sa(()=>{R.current.onCollapse=p,R.current.onResize=m});const A=j(b,o),O=Gr({size:q_(A)}),$=Gr({callbacksRef:R,collapsedSize:n,collapsible:r,defaultSize:o,id:b,idWasAutoGenerated:l==null,maxSize:i,minSize:u,order:h});return Xu(()=>{O.current.size=q_(A),$.current.callbacksRef=R,$.current.collapsedSize=n,$.current.collapsible=r,$.current.defaultSize=o,$.current.id=b,$.current.idWasAutoGenerated=l==null,$.current.maxSize=i,$.current.minSize=u,$.current.order=h}),Xu(()=>(E(b,$),()=>{D(b)}),[h,b,E,D]),lO(s,()=>({collapse:()=>C(b),expand:()=>S(b),getCollapsed(){return O.current.size===0},getId(){return b},getSize(X){return _(b,X)},resize:(X,z)=>I(b,X,z)}),[C,S,_,b,I]),Oc(x,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":b,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1),id:`data-panel-id-${b}`,style:{...A,...g}})}const Ya=sO((e,t)=>Oc(iO,{...e,forwardedRef:t}));iO.displayName="Panel";Ya.displayName="forwardRef(Panel)";function q_(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const ei=10;function Nu(e,t,n,r,o,s,l,i){const{id:u,panels:p,units:m}=t,h=m==="pixels"?Ha(u):NaN,{sizes:g}=i||{},x=g||s,y=Dr(p),b=x.concat();let C=0;{const j=o<0?r:n,E=y.findIndex(R=>R.current.id===j),I=y[E],M=x[E],D=kx(m,h,I,M,M+Math.abs(o),e);if(M===D)return x;D===0&&M>0&&l.set(j,M),o=o<0?M-D:D-M}let S=o<0?n:r,_=y.findIndex(j=>j.current.id===S);for(;;){const j=y[_],E=x[_],I=Math.abs(o)-Math.abs(C),M=kx(m,h,j,E,E-I,e);if(E!==M&&(M===0&&E>0&&l.set(j.current.id,E),C+=E-M,b[_]=M,C.toPrecision(ei).localeCompare(Math.abs(o).toPrecision(ei),void 0,{numeric:!0})>=0))break;if(o<0){if(--_<0)break}else if(++_>=y.length)break}return C===0?x:(S=o<0?r:n,_=y.findIndex(j=>j.current.id===S),b[_]=x[_]+C,b)}function Bi(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:l,collapsedSize:i,collapsible:u,id:p}=s.current,m=n[p];if(m!==r){n[p]=r;const{onCollapse:h,onResize:g}=l.current;g&&g(r,m),u&&h&&((m==null||m===i)&&r!==i?h(!1):m!==i&&r===i&&h(!0))}})}function $se({groupId:e,panels:t,units:n}){const r=n==="pixels"?Ha(e):NaN,o=Dr(t),s=Array(o.length);let l=0,i=100;for(let u=0;u<o.length;u++){const p=o[u],{defaultSize:m}=p.current;m!=null&&(l++,s[u]=n==="pixels"?m/r*100:m,i-=s[u])}for(let u=0;u<o.length;u++){const p=o[u];let{defaultSize:m,id:h,maxSize:g,minSize:x}=p.current;if(m!=null)continue;n==="pixels"&&(x=x/r*100,g!=null&&(g=g/r*100));const y=o.length-l,b=Math.min(g??100,Math.max(x,i/y));s[u]=b,l++,i-=b}if(i!==0)for(let u=0;u<o.length;u++){const p=o[u];let{maxSize:m,minSize:h}=p.current;n==="pixels"&&(h=h/r*100,m!=null&&(m=m/r*100));const g=Math.min(m??100,Math.max(h,s[u]+i));if(g!==s[u]&&(i-=g-s[u],s[u]=g,Math.abs(i).toFixed(3)==="0.000"))break}return Math.abs(i).toFixed(3),s}function qv(e,t){if(t.length<2)return[null,null];const n=t.findIndex(l=>l.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function Ha(e){const t=vd(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=o2(e);return n==="horizontal"?t.offsetWidth-r.reduce((o,s)=>o+s.offsetWidth,0):t.offsetHeight-r.reduce((o,s)=>o+s.offsetHeight,0)}function cO(e,t,n){if(e.size===1)return"100";const o=Dr(e).findIndex(l=>l.current.id===t),s=n[o];return s==null?"0":s.toPrecision(ei)}function Nse(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function vd(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function Eg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Lse(e){return uO().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function uO(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function o2(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function s2(e,t,n){var u,p,m,h;const r=Eg(t),o=o2(e),s=r?o.indexOf(r):-1,l=((p=(u=n[s])==null?void 0:u.current)==null?void 0:p.id)??null,i=((h=(m=n[s+1])==null?void 0:m.current)==null?void 0:h.id)??null;return[l,i]}function Dr(e){return Array.from(e.values()).sort((t,n)=>{const r=t.current.order,o=n.current.order;return r==null&&o==null?0:r==null?-1:o==null?1:r-o})}function kx(e,t,n,r,o,s=null){var m;let{collapsedSize:l,collapsible:i,maxSize:u,minSize:p}=n.current;if(e==="pixels"&&(l=l/t*100,u!=null&&(u=u/t*100),p=p/t*100),i){if(r>l){if(o<=p/2+l)return l}else if(!((m=s==null?void 0:s.type)==null?void 0:m.startsWith("key"))&&o<p)return l}return Math.min(u??100,Math.max(p,o))}function zse(e,t){const{collapsible:n,defaultSize:r,maxSize:o,minSize:s}=t.current;(s<0||e==="percentages"&&s>100)&&(t.current.minSize=0),o!=null&&(o<0||e==="percentages"&&o>100)&&(t.current.maxSize=null),r!==null&&(r<0||e==="percentages"&&r>100?t.current.defaultSize=null:r<s&&!n?t.current.defaultSize=s:o!=null&&r>o&&(t.current.defaultSize=o))}function Xv({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Dr(t),l=o==="pixels"?Ha(e):NaN;let i=0;for(let u=0;u<s.length;u++){const p=s[u],m=r[u],h=n[u],g=kx(o,l,p,m,h);h!=g&&(i+=h-g,n[u]=g)}if(i.toFixed(3)!=="0.000")for(let u=0;u<s.length;u++){const p=s[u];let{maxSize:m,minSize:h}=p.current;o==="pixels"&&(h=h/l*100,m!=null&&(m=m/l*100));const g=Math.min(m??100,Math.max(h,n[u]+i));if(g!==n[u]&&(i-=g-n[u],n[u]=g,Math.abs(i).toFixed(3)==="0.000"))break}return i.toFixed(3),n}function dO(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function Fse({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){sa(()=>{const{direction:l,panels:i}=e.current,u=vd(t);dO(u!=null,`No group found for id "${t}"`);const{height:p,width:m}=u.getBoundingClientRect(),g=o2(t).map(x=>{const y=x.getAttribute("data-panel-resize-handle-id"),b=Dr(i),[C,S]=s2(t,y,b);if(C==null||S==null)return()=>{};let _=0,j=100,E=0,I=0;b.forEach($=>{const{id:X,maxSize:z,minSize:V}=$.current;X===C?(_=V,j=z??100):(E+=V,I+=z??100)});const M=Math.min(j,100-E),D=Math.max(_,(b.length-1)*100-I),R=cO(i,C,o);x.setAttribute("aria-valuemax",""+Math.round(M)),x.setAttribute("aria-valuemin",""+Math.round(D)),x.setAttribute("aria-valuenow",""+Math.round(parseInt(R)));const A=$=>{if(!$.defaultPrevented)switch($.key){case"Enter":{$.preventDefault();const X=b.findIndex(z=>z.current.id===C);if(X>=0){const z=b[X],V=o[X];if(V!=null){let Q=0;V.toPrecision(ei)<=z.current.minSize.toPrecision(ei)?Q=l==="horizontal"?m:p:Q=-(l==="horizontal"?m:p);const G=Nu($,e.current,C,S,Q,o,s.current,null);o!==G&&r(G)}}break}}};x.addEventListener("keydown",A);const O=Nse(C);return O!=null&&x.setAttribute("aria-controls",O.id),()=>{x.removeAttribute("aria-valuemax"),x.removeAttribute("aria-valuemin"),x.removeAttribute("aria-valuenow"),x.removeEventListener("keydown",A),O!=null&&x.removeAttribute("aria-controls")}});return()=>{g.forEach(x=>x())}},[e,t,n,s,r,o])}function Bse({disabled:e,handleId:t,resizeHandler:n}){sa(()=>{if(e||n==null)return;const r=Eg(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const l=uO(),i=Lse(t);dO(i!==null);const u=s.shiftKey?i>0?i-1:l.length-1:i+1<l.length?i+1:0;l[u].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function Qv(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function fO(e,t,n,r=0,o=null){const s=n==="horizontal";let l=0;if(_x(e))l=s?e.clientX:e.clientY;else if(jx(e)){const m=e.touches[0];l=s?m.screenX:m.screenY}else return 0;const i=Eg(t),u=o||i.getBoundingClientRect(),p=s?u.left:u.top;return l-p-r}function Hse(e,t,n,r,o,s,l){const{dragOffset:i=0,dragHandleRect:u,sizes:p}=l||{},m=p||s;if(Vse(e)){const h=o==="horizontal",x=vd(t).getBoundingClientRect(),y=h?x.width:x.height,b=e.shiftKey?10:100,C=y/b;let S=0;switch(e.key){case"ArrowDown":S=h?0:C;break;case"ArrowLeft":S=h?-C:0;break;case"ArrowRight":S=h?C:0;break;case"ArrowUp":S=h?0:-C;break;case"End":S=y;break;case"Home":S=-y;break}const[_,j]=s2(t,n,r),E=S<0?_:j,I=r.findIndex(D=>D.current.id===E),M=r[I];if(M.current.collapsible){const D=m[I];(D===0||D.toPrecision(ei)===M.current.minSize.toPrecision(ei))&&(S=S<0?-M.current.minSize*y:M.current.minSize*y)}return S}else return fO(e,n,o,i,u)}function Vse(e){return e.type==="keydown"}function _x(e){return e.type.startsWith("mouse")}function jx(e){return e.type.startsWith("touch")}let Ix=null,Rl=null;function pO(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Wse(){Rl!==null&&(document.head.removeChild(Rl),Ix=null,Rl=null)}function Yv(e){if(Ix===e)return;Ix=e;const t=pO(e);Rl===null&&(Rl=document.createElement("style"),document.head.appendChild(Rl)),Rl.innerHTML=`*{cursor: ${t}!important;}`}function Use(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function mO(e){return e.map(t=>{const{minSize:n,order:r}=t.current;return r?`${r}:${n}`:`${n}`}).sort((t,n)=>t.localeCompare(n)).join(",")}function hO(e,t){try{const n=t.getItem(`PanelGroup:sizes:${e}`);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Gse(e,t,n){const r=hO(e,n);if(r){const o=mO(t);return r[o]??null}return null}function Kse(e,t,n,r){const o=mO(t),s=hO(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(l){console.error(l)}}const Zv={};function X_(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}const Lu={getItem:e=>(X_(Lu),Lu.getItem(e)),setItem:(e,t)=>{X_(Lu),Lu.setItem(e,t)}};function gO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:l=null,onLayout:i,storage:u=Lu,style:p={},tagName:m="div",units:h="percentages"}){const g=r2(l),[x,y]=qu(null),[b,C]=qu(new Map),S=Gr(null);Gr({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const _=Gr({onLayout:i});sa(()=>{_.current.onLayout=i});const j=Gr({}),[E,I]=qu([]),M=Gr(new Map),D=Gr(0),R=Gr({direction:r,id:g,panels:b,sizes:E,units:h});lO(s,()=>({getId:()=>g,getLayout:T=>{const{sizes:B,units:Y}=R.current;if((T??Y)==="pixels"){const ae=Ha(g);return B.map(oe=>oe/100*ae)}else return B},setLayout:(T,B)=>{const{id:Y,panels:re,sizes:ae,units:oe}=R.current;if((B||oe)==="pixels"){const ce=Ha(Y);T=T.map(J=>J/ce*100)}const q=j.current,K=Dr(re),ee=Xv({groupId:Y,panels:re,nextSizes:T,prevSizes:ae,units:oe});Qv(ae,ee)||(I(ee),Bi(K,ee,q))}}),[g]),Xu(()=>{R.current.direction=r,R.current.id=g,R.current.panels=b,R.current.sizes=E,R.current.units=h}),Fse({committedValuesRef:R,groupId:g,panels:b,setSizes:I,sizes:E,panelSizeBeforeCollapse:M}),sa(()=>{const{onLayout:T}=_.current,{panels:B,sizes:Y}=R.current;if(Y.length>0){T&&T(Y);const re=j.current,ae=Dr(B);Bi(ae,Y,re)}},[E]),Xu(()=>{const{id:T,sizes:B,units:Y}=R.current;if(B.length===b.size)return;let re=null;if(e){const ae=Dr(b);re=Gse(e,ae,u)}if(re!=null){const ae=Xv({groupId:T,panels:b,nextSizes:re,prevSizes:re,units:Y});I(ae)}else{const ae=$se({groupId:T,panels:b,units:Y});I(ae)}},[e,b,u]),sa(()=>{if(e){if(E.length===0||E.length!==b.size)return;const T=Dr(b);Zv[e]||(Zv[e]=Use(Kse,100)),Zv[e](e,T,E,u)}},[e,b,E,u]),Xu(()=>{if(h==="pixels"){const T=new ResizeObserver(()=>{const{panels:B,sizes:Y}=R.current,re=Xv({groupId:g,panels:B,nextSizes:Y,prevSizes:Y,units:h});Qv(Y,re)||I(re)});return T.observe(vd(g)),()=>{T.disconnect()}}},[g,h]);const A=Ks((T,B)=>{const{panels:Y,units:re}=R.current,oe=Dr(Y).findIndex(ee=>ee.current.id===T),q=E[oe];if((B??re)==="pixels"){const ee=Ha(g);return q/100*ee}else return q},[g,E]),O=Ks((T,B)=>{const{panels:Y}=R.current;return Y.size===0?{flexBasis:0,flexGrow:B??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:cO(Y,T,E),flexShrink:1,overflow:"hidden",pointerEvents:o&&x!==null?"none":void 0}},[x,o,E]),$=Ks((T,B)=>{const{units:Y}=R.current;zse(Y,B),C(re=>{if(re.has(T))return re;const ae=new Map(re);return ae.set(T,B),ae})},[]),X=Ks(T=>Y=>{Y.preventDefault();const{direction:re,panels:ae,sizes:oe}=R.current,q=Dr(ae),[K,ee]=s2(g,T,q);if(K==null||ee==null)return;let ce=Hse(Y,g,T,q,re,oe,S.current);if(ce===0)return;const ie=vd(g).getBoundingClientRect(),de=re==="horizontal";document.dir==="rtl"&&de&&(ce=-ce);const xe=de?ie.width:ie.height,we=ce/xe*100,ve=Nu(Y,R.current,K,ee,we,oe,M.current,S.current),fe=!Qv(oe,ve);if((_x(Y)||jx(Y))&&D.current!=we&&Yv(fe?de?"horizontal":"vertical":de?ce<0?"horizontal-min":"horizontal-max":ce<0?"vertical-min":"vertical-max"),fe){const Oe=j.current;I(ve),Bi(q,ve,Oe)}D.current=we},[g]),z=Ks(T=>{C(B=>{if(!B.has(T))return B;const Y=new Map(B);return Y.delete(T),Y})},[]),V=Ks(T=>{const{panels:B,sizes:Y}=R.current,re=B.get(T);if(re==null)return;const{collapsedSize:ae,collapsible:oe}=re.current;if(!oe)return;const q=Dr(B),K=q.indexOf(re);if(K<0)return;const ee=Y[K];if(ee===ae)return;M.current.set(T,ee);const[ce,J]=qv(T,q);if(ce==null||J==null)return;const de=K===q.length-1?ee:ae-ee,xe=Nu(null,R.current,ce,J,de,Y,M.current,null);if(Y!==xe){const we=j.current;I(xe),Bi(q,xe,we)}},[]),Q=Ks(T=>{const{panels:B,sizes:Y}=R.current,re=B.get(T);if(re==null)return;const{collapsedSize:ae,minSize:oe}=re.current,q=M.current.get(T)||oe;if(!q)return;const K=Dr(B),ee=K.indexOf(re);if(ee<0||Y[ee]!==ae)return;const[J,ie]=qv(T,K);if(J==null||ie==null)return;const xe=ee===K.length-1?ae-q:q,we=Nu(null,R.current,J,ie,xe,Y,M.current,null);if(Y!==we){const ve=j.current;I(we),Bi(K,we,ve)}},[]),G=Ks((T,B,Y)=>{const{id:re,panels:ae,sizes:oe,units:q}=R.current;if((Y||q)==="pixels"){const st=Ha(re);B=B/st*100}const K=ae.get(T);if(K==null)return;let{collapsedSize:ee,collapsible:ce,maxSize:J,minSize:ie}=K.current;if(q==="pixels"){const st=Ha(re);ie=ie/st*100,J!=null&&(J=J/st*100)}const de=Dr(ae),xe=de.indexOf(K);if(xe<0)return;const we=oe[xe];if(we===B)return;ce&&B===ee||(B=Math.min(J??100,Math.max(ie,B)));const[ve,fe]=qv(T,de);if(ve==null||fe==null)return;const je=xe===de.length-1?we-B:B-we,$e=Nu(null,R.current,ve,fe,je,oe,M.current,null);if(oe!==$e){const st=j.current;I($e),Bi(de,$e,st)}},[]),F=Rse(()=>({activeHandleId:x,collapsePanel:V,direction:r,expandPanel:Q,getPanelSize:A,getPanelStyle:O,groupId:g,registerPanel:$,registerResizeHandle:X,resizePanel:G,startDragging:(T,B)=>{if(y(T),_x(B)||jx(B)){const Y=Eg(T);S.current={dragHandleRect:Y.getBoundingClientRect(),dragOffset:fO(B,T,r),sizes:R.current.sizes}}},stopDragging:()=>{Wse(),y(null),S.current=null},units:h,unregisterPanel:z}),[x,V,r,Q,A,O,g,$,X,G,h,z]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Oc(Pg.Provider,{children:Oc(m,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g,"data-panel-group-units":h,style:{...U,...p}}),value:F})}const Mg=sO((e,t)=>Oc(gO,{...e,forwardedRef:t}));gO.displayName="PanelGroup";Mg.displayName="forwardRef(PanelGroup)";function Px({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:l="div"}){const i=Gr(null),u=Gr({onDragging:o});sa(()=>{u.current.onDragging=o});const p=aO(Pg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:m,direction:h,groupId:g,registerResizeHandle:x,startDragging:y,stopDragging:b}=p,C=r2(r),S=m===C,[_,j]=qu(!1),[E,I]=qu(null),M=Ks(()=>{i.current.blur(),b();const{onDragging:A}=u.current;A&&A(!1)},[b]);sa(()=>{if(n)I(null);else{const R=x(C);I(()=>R)}},[n,C,x]),sa(()=>{if(n||E==null||!S)return;const R=X=>{E(X)},A=X=>{E(X)},$=i.current.ownerDocument;return $.body.addEventListener("contextmenu",M),$.body.addEventListener("mousemove",R),$.body.addEventListener("touchmove",R),$.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{$.body.removeEventListener("contextmenu",M),$.body.removeEventListener("mousemove",R),$.body.removeEventListener("touchmove",R),$.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[h,n,S,E,M]),Bse({disabled:n,handleId:C,resizeHandler:E});const D={cursor:pO(h),touchAction:"none",userSelect:"none"};return Oc(l,{children:e,className:t,"data-resize-handle-active":S?"pointer":_?"keyboard":void 0,"data-panel-group-direction":h,"data-panel-group-id":g,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":C,onBlur:()=>j(!1),onFocus:()=>j(!0),onMouseDown:R=>{y(C,R.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:R=>{y(C,R.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},ref:i,role:"separator",style:{...D,...s},tabIndex:0})}Px.displayName="PanelResizeHandle";const qse=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=aa("base.100","base.850"),l=aa("base.300","base.700");return t==="horizontal"?a.jsx(Px,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(N,{className:"resize-handle-horizontal",sx:{w:n?2.5:4,h:"full",justifyContent:n?n==="left"?"flex-start":"flex-end":"center",alignItems:"center",div:{bg:s},_hover:{div:{bg:l}}},...o,children:a.jsx(Ie,{sx:{w:1,h:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})}):a.jsx(Px,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(N,{className:"resize-handle-vertical",sx:{w:"full",h:n?2.5:4,alignItems:n?n==="top"?"flex-start":"flex-end":"center",justifyContent:"center",div:{bg:s},_hover:{div:{bg:l}}},...o,children:a.jsx(Ie,{sx:{h:1,w:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})})},ph=d.memo(qse),a2=()=>{const e=te(),t=W(o=>o.ui.panels),n=d.useCallback(o=>t[o]??"",[t]),r=d.useCallback((o,s)=>{e(qR({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Xse=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,l=d.useMemo(()=>XR(n)?n:JSON.stringify(n,null,2),[n]),i=d.useCallback(()=>{navigator.clipboard.writeText(l)},[l]),u=d.useCallback(()=>{const m=new Blob([l]),h=document.createElement("a");h.href=URL.createObjectURL(m),h.download=`${r||t}.json`,document.body.appendChild(h),h.click(),h.remove()},[l,t,r]),{t:p}=Z();return a.jsxs(N,{layerStyle:"second",sx:{borderRadius:"base",flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4,fontSize:"sm"},children:a.jsx(xg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:l})})}),a.jsxs(N,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:[o&&a.jsx(Vt,{label:`${p("gallery.download")} ${t} JSON`,children:a.jsx(Cs,{"aria-label":`${p("gallery.download")} ${t} JSON`,icon:a.jsx(Gc,{}),variant:"ghost",opacity:.7,onClick:u})}),s&&a.jsx(Vt,{label:`${p("gallery.copy")} ${t} JSON`,children:a.jsx(Cs,{"aria-label":`${p("gallery.copy")} ${t} JSON`,icon:a.jsx(Uc,{}),variant:"ghost",opacity:.7,onClick:i})})]})]})},Za=d.memo(Xse),Qse=le(ge,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(r=>r.id===t);return{data:n==null?void 0:n.data}},Ce),Yse=()=>{const{data:e}=W(Qse);return e?a.jsx(Za,{data:e,label:"Node Data"}):a.jsx(tr,{label:"No node selected",icon:null})},Zse=d.memo(Yse),Jse=({children:e,maxHeight:t})=>a.jsx(N,{sx:{w:"full",h:"full",maxHeight:t,position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(xg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e})})}),ef=d.memo(Jse),eae=({output:e})=>{const{image:t}=e,{data:n}=wo(t.image_name);return a.jsx(sl,{imageDTO:n})},tae=d.memo(eae),nae=le(ge,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(s=>s.id===t),r=n?e.nodeTemplates[n.data.type]:void 0,o=e.nodeExecutionStates[t??"__UNKNOWN_NODE__"];return{node:n,template:r,nes:o}},Ce),rae=()=>{const{node:e,template:t,nes:n}=W(nae),{t:r}=Z();return!e||!n||!Mn(e)?a.jsx(tr,{label:r("nodes.noNodeSelected"),icon:null}):n.outputs.length===0?a.jsx(tr,{label:r("nodes.noOutputRecorded"),icon:null}):a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(ef,{children:a.jsx(N,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:(t==null?void 0:t.outputType)==="image_output"?n.outputs.map((o,s)=>a.jsx(tae,{output:o},sae(o,s))):a.jsx(Za,{data:n.outputs,label:r("nodes.nodeOutputs")})})})})},oae=d.memo(rae),sae=(e,t)=>`${e.type}-${t}`,aae=le(ge,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(o=>o.id===t);return{template:n?e.nodeTemplates[n.data.type]:void 0}},Ce),lae=()=>{const{template:e}=W(aae),{t}=Z();return e?a.jsx(Za,{data:e,label:t("nodes.nodeTemplate")}):a.jsx(tr,{label:t("nodes.noNodeSelected"),icon:null})},iae=d.memo(lae),cae=()=>a.jsx(N,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(ri,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(oi,{children:[a.jsx($r,{children:"Outputs"}),a.jsx($r,{children:"Data"}),a.jsx($r,{children:"Template"})]}),a.jsxs(Hc,{children:[a.jsx(Co,{children:a.jsx(oae,{})}),a.jsx(Co,{children:a.jsx(Zse,{})}),a.jsx(Co,{children:a.jsx(iae,{})})]})]})}),uae=d.memo(cae),l2=e=>{e.stopPropagation()},dae={display:"flex",flexDirection:"row",alignItems:"center",gap:10},fae=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...l}=e,i=te(),u=d.useCallback(m=>{m.shiftKey&&i(Nr(!0))},[i]),p=d.useCallback(m=>{m.shiftKey||i(Nr(!1))},[i]);return a.jsxs(Zt,{isInvalid:o,isDisabled:r,...s,style:n==="side"?dae:void 0,children:[t!==""&&a.jsx(In,{children:t}),a.jsx(Ah,{...l,onPaste:l2,onKeyDown:u,onKeyUp:p})]})},mo=d.memo(fae),pae=_e((e,t)=>{const n=te(),r=d.useCallback(s=>{s.shiftKey&&n(Nr(!0))},[n]),o=d.useCallback(s=>{s.shiftKey||n(Nr(!1))},[n]);return a.jsx(bP,{ref:t,onPaste:l2,onKeyDown:r,onKeyUp:o,...e})}),da=d.memo(pae),mae=le(ge,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:l,notes:i}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:l,notes:i}},Ce),hae=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:l}=W(mae),i=te(),u=d.useCallback(C=>{i(QR(C.target.value))},[i]),p=d.useCallback(C=>{i(YR(C.target.value))},[i]),m=d.useCallback(C=>{i(ZR(C.target.value))},[i]),h=d.useCallback(C=>{i(JR(C.target.value))},[i]),g=d.useCallback(C=>{i(eA(C.target.value))},[i]),x=d.useCallback(C=>{i(tA(C.target.value))},[i]),y=d.useCallback(C=>{i(nA(C.target.value))},[i]),{t:b}=Z();return a.jsx(ef,{children:a.jsxs(N,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs(N,{sx:{gap:2,w:"full"},children:[a.jsx(mo,{label:b("nodes.workflowName"),value:t,onChange:u}),a.jsx(mo,{label:b("nodes.workflowVersion"),value:o,onChange:h})]}),a.jsxs(N,{sx:{gap:2,w:"full"},children:[a.jsx(mo,{label:b("nodes.workflowAuthor"),value:e,onChange:p}),a.jsx(mo,{label:b("nodes.workflowContact"),value:s,onChange:m})]}),a.jsx(mo,{label:b("nodes.workflowTags"),value:r,onChange:x}),a.jsxs(Zt,{as:N,sx:{flexDir:"column"},children:[a.jsx(In,{children:b("nodes.workflowDescription")}),a.jsx(da,{onChange:g,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(Zt,{as:N,sx:{flexDir:"column",h:"full"},children:[a.jsx(In,{children:b("nodes.workflowNotes")}),a.jsx(da,{onChange:y,value:l,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},gae=d.memo(hae);function vae(e,t,n){var r=this,o=d.useRef(null),s=d.useRef(0),l=d.useRef(null),i=d.useRef([]),u=d.useRef(),p=d.useRef(),m=d.useRef(e),h=d.useRef(!0);d.useEffect(function(){m.current=e},[e]);var g=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,b="maxWait"in n,C=b?Math.max(+n.maxWait||0,t):null;d.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var S=d.useMemo(function(){var _=function(R){var A=i.current,O=u.current;return i.current=u.current=null,s.current=R,p.current=m.current.apply(O,A)},j=function(R,A){g&&cancelAnimationFrame(l.current),l.current=g?requestAnimationFrame(R):setTimeout(R,A)},E=function(R){if(!h.current)return!1;var A=R-o.current;return!o.current||A>=t||A<0||b&&R-s.current>=C},I=function(R){return l.current=null,y&&i.current?_(R):(i.current=u.current=null,p.current)},M=function R(){var A=Date.now();if(E(A))return I(A);if(h.current){var O=t-(A-o.current),$=b?Math.min(O,C-(A-s.current)):O;j(R,$)}},D=function(){var R=Date.now(),A=E(R);if(i.current=[].slice.call(arguments),u.current=r,o.current=R,A){if(!l.current&&h.current)return s.current=o.current,j(M,t),x?_(o.current):p.current;if(b)return j(M,t),_(o.current)}return l.current||j(M,t),p.current};return D.cancel=function(){l.current&&(g?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,i.current=o.current=u.current=l.current=null},D.isPending=function(){return!!l.current},D.flush=function(){return l.current?I(Date.now()):p.current},D},[x,b,t,C,y,g]);return S}function xae(e,t){return e===t}function Q_(e){return typeof e=="function"?function(){return e}:e}function bae(e,t,n){var r,o,s=n&&n.equalityFn||xae,l=(r=d.useState(Q_(e)),o=r[1],[r[0],d.useCallback(function(h){return o(Q_(h))},[])]),i=l[0],u=l[1],p=vae(d.useCallback(function(h){return u(h)},[u]),t,n),m=d.useRef(e);return s(m.current,e)||(p(e),m.current=e),[i,p]}const vO=()=>{const e=W(r=>r.nodes),[t]=bae(e,300);return d.useMemo(()=>rA(t),[t])},yae=()=>{const e=vO(),{t}=Z();return a.jsx(N,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Za,{data:e,label:t("nodes.workflow")})})},Cae=d.memo(yae),wae=({isSelected:e,isHovered:t})=>{const n=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.light";if(e)return"nodeSelected.light";if(t)return"nodeHovered.light"},[t,e]),r=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.dark";if(e)return"nodeSelected.dark";if(t)return"nodeHovered.dark"},[t,e]);return a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e||t?1:.5,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:n,_dark:{shadow:r}}})},xO=d.memo(wae),bO=e=>{const t=te(),n=d.useMemo(()=>le(ge,({nodes:l})=>l.mouseOverNode===e,Ce),[e]),r=W(n),o=d.useCallback(()=>{!r&&t(bw(e))},[t,e,r]),s=d.useCallback(()=>{r&&t(bw(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},yO=(e,t)=>{const n=d.useMemo(()=>le(ge,({nodes:o})=>{var l;const s=o.nodes.find(i=>i.id===e);if(Mn(s))return(l=s==null?void 0:s.data.inputs[t])==null?void 0:l.label},Ce),[t,e]);return W(n)},CO=(e,t,n)=>{const r=d.useMemo(()=>le(ge,({nodes:s})=>{var u;const l=s.nodes.find(p=>p.id===e);if(!Mn(l))return;const i=s.nodeTemplates[(l==null?void 0:l.data.type)??""];return(u=i==null?void 0:i[cb[n]][t])==null?void 0:u.title},Ce),[t,n,e]);return W(r)},wO=(e,t)=>{const n=d.useMemo(()=>le(ge,({nodes:o})=>{const s=o.nodes.find(l=>l.id===e);if(Mn(s))return s==null?void 0:s.data.inputs[t]},Ce),[t,e]);return W(n)},Og=(e,t,n)=>{const r=d.useMemo(()=>le(ge,({nodes:s})=>{const l=s.nodes.find(u=>u.id===e);if(!Mn(l))return;const i=s.nodeTemplates[(l==null?void 0:l.data.type)??""];return i==null?void 0:i[cb[n]][t]},Ce),[t,n,e]);return W(r)},Sae=({nodeId:e,fieldName:t,kind:n})=>{const r=wO(e,t),o=Og(e,t,n),s=oA(o),{t:l}=Z(),i=d.useMemo(()=>sA(r)?r.label&&(o!=null&&o.title)?`${r.label} (${o.title})`:r.label&&!o?r.label:!r.label&&o?o.title:l("nodes.unknownField"):(o==null?void 0:o.title)||l("nodes.unknownField"),[r,o,l]);return a.jsxs(N,{sx:{flexDir:"column"},children:[a.jsx(be,{sx:{fontWeight:600},children:i}),o&&a.jsx(be,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(be,{children:["Type: ",_d[o.type].title]}),s&&a.jsxs(be,{children:["Input: ",aA(o.input)]})]})},i2=d.memo(Sae),kae=_e((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:l=!1}=e,i=yO(n,r),u=CO(n,r,o),{t:p}=Z(),m=te(),[h,g]=d.useState(i||u||p("nodes.unknownField")),x=d.useCallback(async b=>{b&&(b===i||b===u)||(g(b||u||p("nodes.unknownField")),m(lA({nodeId:n,fieldName:r,label:b})))},[i,u,m,n,r,p]),y=d.useCallback(b=>{g(b)},[]);return d.useEffect(()=>{g(i||u||p("nodes.unknownField"))},[i,u,p]),a.jsx(Vt,{label:l?a.jsx(i2,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:kh,placement:"top",hasArrow:!0,children:a.jsx(N,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(Oh,{value:h,onChange:y,onSubmit:x,as:N,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(Mh,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(Eh,{className:"nodrag",sx:{p:0,w:"full",fontWeight:600,color:"base.900",_dark:{color:"base.100"},_focusVisible:{p:0,textAlign:"left",boxShadow:"none"}}}),a.jsx(kO,{})]})})})}),SO=d.memo(kae),kO=d.memo(()=>{const{isEditing:e,getEditButtonProps:t}=_5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx(N,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});kO.displayName="EditableControls";const _ae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(iA({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(ty,{className:"nodrag",onChange:o,isChecked:n.value})},jae=d.memo(_ae);function Dg(){return(Dg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _O(e,t){if(e==null)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function Ex(e){var t=d.useRef(e),n=d.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Dc=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Qu=function(e){return"touches"in e},Mx=function(e){return e&&e.ownerDocument.defaultView||self},Y_=function(e,t,n){var r=e.getBoundingClientRect(),o=Qu(t)?function(s,l){for(var i=0;i<s.length;i++)if(s[i].identifier===l)return s[i];return s[0]}(t.touches,n):t;return{left:Dc((o.pageX-(r.left+Mx(e).pageXOffset))/r.width),top:Dc((o.pageY-(r.top+Mx(e).pageYOffset))/r.height)}},Z_=function(e){!Qu(e)&&e.preventDefault()},c2=H.memo(function(e){var t=e.onMove,n=e.onKey,r=_O(e,["onMove","onKey"]),o=d.useRef(null),s=Ex(t),l=Ex(n),i=d.useRef(null),u=d.useRef(!1),p=d.useMemo(function(){var x=function(C){Z_(C),(Qu(C)?C.touches.length>0:C.buttons>0)&&o.current?s(Y_(o.current,C,i.current)):b(!1)},y=function(){return b(!1)};function b(C){var S=u.current,_=Mx(o.current),j=C?_.addEventListener:_.removeEventListener;j(S?"touchmove":"mousemove",x),j(S?"touchend":"mouseup",y)}return[function(C){var S=C.nativeEvent,_=o.current;if(_&&(Z_(S),!function(E,I){return I&&!Qu(E)}(S,u.current)&&_)){if(Qu(S)){u.current=!0;var j=S.changedTouches||[];j.length&&(i.current=j[0].identifier)}_.focus(),s(Y_(_,S,i.current)),b(!0)}},function(C){var S=C.which||C.keyCode;S<37||S>40||(C.preventDefault(),l({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},b]},[l,s]),m=p[0],h=p[1],g=p[2];return d.useEffect(function(){return g},[g]),H.createElement("div",Dg({},r,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),Rg=function(e){return e.filter(Boolean).join(" ")},u2=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Rg(["react-colorful__pointer",e.className]);return H.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},H.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},yr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},jO=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:yr(e.h),s:yr(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:yr(o/2),a:yr(r,2)}},Ox=function(e){var t=jO(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Jv=function(e){var t=jO(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Iae=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),l=r*(1-n),i=r*(1-(t-s)*n),u=r*(1-(1-t+s)*n),p=s%6;return{r:yr(255*[r,i,l,l,u,r][p]),g:yr(255*[u,r,r,i,l,l][p]),b:yr(255*[l,l,u,r,r,i][p]),a:yr(o,2)}},Pae=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),l=s-Math.min(t,n,r),i=l?s===t?(n-r)/l:s===n?2+(r-t)/l:4+(t-n)/l:0;return{h:yr(60*(i<0?i+6:i)),s:yr(s?l/s*100:0),v:yr(s/255*100),a:o}},Eae=H.memo(function(e){var t=e.hue,n=e.onChange,r=Rg(["react-colorful__hue",e.className]);return H.createElement("div",{className:r},H.createElement(c2,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Dc(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":yr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(u2,{className:"react-colorful__hue-pointer",left:t/360,color:Ox({h:t,s:100,v:100,a:1})})))}),Mae=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Ox({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(c2,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Dc(t.s+100*o.left,0,100),v:Dc(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+yr(t.s)+"%, Brightness "+yr(t.v)+"%"},H.createElement(u2,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ox(t)})))}),IO=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Oae(e,t,n){var r=Ex(n),o=d.useState(function(){return e.toHsva(t)}),s=o[0],l=o[1],i=d.useRef({color:t,hsva:s});d.useEffect(function(){if(!e.equal(t,i.current.color)){var p=e.toHsva(t);i.current={hsva:p,color:t},l(p)}},[t,e]),d.useEffect(function(){var p;IO(s,i.current.hsva)||e.equal(p=e.fromHsva(s),i.current.color)||(i.current={hsva:s,color:p},r(p))},[s,e,r]);var u=d.useCallback(function(p){l(function(m){return Object.assign({},m,p)})},[]);return[s,u]}var Dae=typeof window<"u"?d.useLayoutEffect:d.useEffect,Rae=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J_=new Map,Aae=function(e){Dae(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!J_.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J_.set(t,n);var r=Rae();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Tae=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Jv(Object.assign({},n,{a:0}))+", "+Jv(Object.assign({},n,{a:1}))+")"},s=Rg(["react-colorful__alpha",t]),l=yr(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(c2,{onMove:function(i){r({a:i.left})},onKey:function(i){r({a:Dc(n.a+i.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement(u2,{className:"react-colorful__alpha-pointer",left:n.a,color:Jv(n)})))},$ae=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,l=_O(e,["className","colorModel","color","onChange"]),i=d.useRef(null);Aae(i);var u=Oae(n,o,s),p=u[0],m=u[1],h=Rg(["react-colorful",t]);return H.createElement("div",Dg({},l,{ref:i,className:h}),H.createElement(Mae,{hsva:p,onChange:m}),H.createElement(Eae,{hue:p.h,onChange:m}),H.createElement(Tae,{hsva:p,onChange:m,className:"react-colorful__last-control"}))},Nae={defaultColor:{r:0,g:0,b:0,a:1},toHsva:Pae,fromHsva:Iae,equal:IO},PO=function(e){return H.createElement($ae,Dg({},e,{colorModel:Nae}))};const Lae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(cA({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(PO,{className:"nodrag",color:n.value,onChange:o})},zae=d.memo(Lae),EO=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=uA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({controlNetModelId:e,errors:s.error.format()},"Failed to parse ControlNet model id");return}return s.data},Fae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Xx(),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/controlnet/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),i=d.useMemo(()=>{if(!s)return[];const p=[];return Wn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=EO(p);m&&o(dA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(On,{className:"nowheel nodrag",tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??null,placeholder:"Pick one",error:!l,data:i,onChange:u,sx:{width:"100%"}})},Bae=d.memo(Fae),Hae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(l=>{o(fA({nodeId:t,fieldName:n.name,value:l.target.value}))},[o,n.name,t]);return a.jsx(eP,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(l=>a.jsx("option",{value:l,children:r.ui_choice_labels?r.ui_choice_labels[l]:l},l))})},Vae=d.memo(Hae),Wae=e=>{var p;const{nodeId:t,field:n}=e,r=te(),{currentData:o}=wo(((p=n.value)==null?void 0:p.image_name)??Zr.skipToken),s=d.useCallback(()=>{r(pA({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),l=d.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),i=d.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),u=d.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx(N,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(sl,{imageDTO:o,droppableData:i,draggableData:l,postUploadAction:u,useThumbailFallback:!0,uploadElement:a.jsx(MO,{}),dropLabel:a.jsx(OO,{}),minSize:8,children:a.jsx(xc,{onClick:s,icon:o?a.jsx(dg,{}):void 0,tooltip:"Reset Image"})})})},Uae=d.memo(Wae),MO=d.memo(()=>a.jsx(be,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));MO.displayName="UploadElement";const OO=d.memo(()=>a.jsx(be,{fontSize:16,fontWeight:600,children:"Drop"}));OO.displayName="DropLabel";const Gae=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=mA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({loraModelId:e,errors:s.error.format()},"Failed to parse LoRA model id");return}return s.data},Kae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=kd(),{t:l}=Z(),i=d.useMemo(()=>{if(!s)return[];const m=[];return Wn(s.entities,(h,g)=>{h&&m.push({value:g,label:h.model_name,group:pn[h.base_model]})}),m.sort((h,g)=>h.disabled&&!g.disabled?1:-1)},[s]),u=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/lora/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r==null?void 0:r.base_model,r==null?void 0:r.model_name]),p=d.useCallback(m=>{if(!m)return;const h=Gae(m);h&&o(hA({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx(N,{sx:{justifyContent:"center",p:2},children:a.jsx(be,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{className:"nowheel nodrag",value:(u==null?void 0:u.id)??null,placeholder:i.length>0?l("models.selectLoRA"):l("models.noLoRAsAvailable"),data:i,nothingFound:l("models.noMatchingLoRAs"),itemComponent:fl,disabled:i.length===0,filter:(m,h)=>{var g;return((g=h.label)==null?void 0:g.toLowerCase().includes(m.toLowerCase().trim()))||h.value.toLowerCase().includes(m.toLowerCase().trim())},error:!u,onChange:p,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},qae=d.memo(Kae),Ag=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=gA.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data};function Xc(e){const{iconMode:t=!1,...n}=e,r=te(),{t:o}=Z(),[s,{isLoading:l}]=vA(),i=()=>{s().unwrap().then(u=>{r(lt(Qt({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(u=>{u&&r(lt(Qt({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(Be,{icon:a.jsx(jM,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:l,onClick:i,size:"sm",...n}):a.jsx(ot,{isLoading:l,onClick:i,minW:"max-content",...n,children:"Sync Models"})}const Xae=e=>{var y,b;const{nodeId:t,field:n}=e,r=te(),o=$t("syncModels").isFeatureEnabled,{t:s}=Z(),{data:l,isLoading:i}=Yu(yw),{data:u,isLoading:p}=Qo(yw),m=d.useMemo(()=>i||p,[i,p]),h=d.useMemo(()=>{if(!u)return[];const C=[];return Wn(u.entities,(S,_)=>{S&&C.push({value:_,label:S.model_name,group:pn[S.base_model]})}),l&&Wn(l.entities,(S,_)=>{S&&C.push({value:_,label:S.model_name,group:pn[S.base_model]})}),C},[u,l]),g=d.useMemo(()=>{var C,S,_,j;return((u==null?void 0:u.entities[`${(C=n.value)==null?void 0:C.base_model}/main/${(S=n.value)==null?void 0:S.model_name}`])||(l==null?void 0:l.entities[`${(_=n.value)==null?void 0:_.base_model}/onnx/${(j=n.value)==null?void 0:j.model_name}`]))??null},[(y=n.value)==null?void 0:y.base_model,(b=n.value)==null?void 0:b.model_name,u==null?void 0:u.entities,l==null?void 0:l.entities]),x=d.useCallback(C=>{if(!C)return;const S=Ag(C);S&&r(EI({nodeId:t,fieldName:n.name,value:S}))},[r,n.name,t]);return a.jsxs(N,{sx:{w:"full",alignItems:"center",gap:2},children:[m?a.jsx(be,{variant:"subtext",children:"Loading..."}):a.jsx(nn,{className:"nowheel nodrag",tooltip:g==null?void 0:g.description,value:g==null?void 0:g.id,placeholder:h.length>0?s("models.selectModel"):s("models.noModelsAvailable"),data:h,error:!g,disabled:h.length===0,onChange:x,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Xc,{className:"nodrag",iconMode:!0})]})},Qae=d.memo(Xae),mh=/^-?(0\.)?\.?$/,DO=_e((e,t)=>{const{label:n,isDisabled:r=!1,showStepper:o=!0,isInvalid:s,value:l,onChange:i,min:u,max:p,isInteger:m=!0,formControlProps:h,formLabelProps:g,numberInputFieldProps:x,numberInputStepperProps:y,tooltipProps:b,...C}=e,S=te(),[_,j]=d.useState(String(l));d.useEffect(()=>{!_.match(mh)&&l!==Number(_)&&j(String(l))},[l,_]);const E=R=>{j(R),R.match(mh)||i(m?Math.floor(Number(R)):Number(R))},I=R=>{const A=Bl(m?Math.floor(Number(R.target.value)):Number(R.target.value),u,p);j(String(A)),i(A)},M=d.useCallback(R=>{R.shiftKey&&S(Nr(!0))},[S]),D=d.useCallback(R=>{R.shiftKey||S(Nr(!1))},[S]);return a.jsx(Vt,{...b,children:a.jsxs(Zt,{ref:t,isDisabled:r,isInvalid:s,...h,children:[n&&a.jsx(In,{...g,children:n}),a.jsxs(Bh,{value:_,min:u,max:p,keepWithinRange:!0,clampValueOnBlur:!1,onChange:E,onBlur:I,...C,onPaste:l2,children:[a.jsx(Vh,{...x,onKeyDown:M,onKeyUp:D}),o&&a.jsxs(Hh,{children:[a.jsx(Uh,{...y}),a.jsx(Wh,{...y})]})]})]})})});DO.displayName="IAINumberInput";const Qc=d.memo(DO),Yae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),[s,l]=d.useState(String(n.value)),i=d.useMemo(()=>r.type==="integer",[r.type]),u=p=>{l(p),p.match(mh)||o(xA({nodeId:t,fieldName:n.name,value:i?Math.floor(Number(p)):Number(p)}))};return d.useEffect(()=>{!s.match(mh)&&n.value!==Number(s)&&l(String(n.value))},[n.value,s]),a.jsxs(Bh,{onChange:u,value:s,step:i?1:.1,precision:i?0:3,children:[a.jsx(Vh,{className:"nodrag"}),a.jsxs(Hh,{children:[a.jsx(Uh,{}),a.jsx(Wh,{})]})]})},Zae=d.memo(Yae),Jae=e=>{var h,g;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=$t("syncModels").isFeatureEnabled,{data:l,isLoading:i}=Qo(ub),u=d.useMemo(()=>{if(!l)return[];const x=[];return Wn(l.entities,(y,b)=>{y&&x.push({value:b,label:y.model_name,group:pn[y.base_model]})}),x},[l]),p=d.useMemo(()=>{var x,y;return(l==null?void 0:l.entities[`${(x=n.value)==null?void 0:x.base_model}/main/${(y=n.value)==null?void 0:y.model_name}`])??null},[(h=n.value)==null?void 0:h.base_model,(g=n.value)==null?void 0:g.model_name,l==null?void 0:l.entities]),m=d.useCallback(x=>{if(!x)return;const y=Ag(x);y&&r(bA({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return i?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:p==null?void 0:p.description,value:p==null?void 0:p.id,placeholder:u.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:u,error:!p,disabled:u.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Xc,{className:"nodrag",iconMode:!0})]})},ele=d.memo(Jae),tle=e=>{var g,x;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=$t("syncModels").isFeatureEnabled,{data:l}=Yu(Cw),{data:i,isLoading:u}=Qo(Cw),p=d.useMemo(()=>{if(!i)return[];const y=[];return Wn(i.entities,(b,C)=>{!b||b.base_model!=="sdxl"||y.push({value:C,label:b.model_name,group:pn[b.base_model]})}),l&&Wn(l.entities,(b,C)=>{!b||b.base_model!=="sdxl"||y.push({value:C,label:b.model_name,group:pn[b.base_model]})}),y},[i,l]),m=d.useMemo(()=>{var y,b,C,S;return((i==null?void 0:i.entities[`${(y=n.value)==null?void 0:y.base_model}/main/${(b=n.value)==null?void 0:b.model_name}`])||(l==null?void 0:l.entities[`${(C=n.value)==null?void 0:C.base_model}/onnx/${(S=n.value)==null?void 0:S.model_name}`]))??null},[(g=n.value)==null?void 0:g.base_model,(x=n.value)==null?void 0:x.model_name,i==null?void 0:i.entities,l==null?void 0:l.entities]),h=d.useCallback(y=>{if(!y)return;const b=Ag(y);b&&r(EI({nodeId:t,fieldName:n.name,value:b}))},[r,n.name,t]);return u?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:m==null?void 0:m.description,value:m==null?void 0:m.id,placeholder:p.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:p,error:!m,disabled:p.length===0,onChange:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Xc,{className:"nodrag",iconMode:!0})]})},nle=d.memo(tle),rle=le([ge],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:Sr(bh,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},Ce),ole=e=>{const{nodeId:t,field:n}=e,r=te(),{data:o}=W(rle),s=d.useCallback(l=>{l&&r(yA({nodeId:t,fieldName:n.name,value:l}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:n.value,data:o,onChange:s})},sle=d.memo(ole),ale=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(l=>{o(CA({nodeId:t,fieldName:n.name,value:l.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(da,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(mo,{onChange:s,value:n.value})},lle=d.memo(ale),RO=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=wA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({vaeModelId:e,errors:s.error.format()},"Failed to parse VAE model id");return}return s.data},ile=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=MI(),l=d.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Wn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s]),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r]),u=d.useCallback(p=>{if(!p)return;const m=RO(p);m&&o(SA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",itemComponent:fl,tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:l,onChange:u,disabled:l.length===0,error:!i,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},cle=d.memo(ile),ule=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=kA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({ipAdapterModelId:e,errors:s.error.format()},"Failed to parse IP-Adapter model id");return}return s.data},dle=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Yx(),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/ip_adapter/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),i=d.useMemo(()=>{if(!s)return[];const p=[];return Wn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=ule(p);m&&o(_A({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(On,{className:"nowheel nodrag",tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??null,placeholder:"Pick one",error:!l,data:i,onChange:u,sx:{width:"100%"}})},fle=d.memo(dle),ple=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=jA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({t2iAdapterModelId:e,errors:s.error.format()},"Failed to parse T2I-Adapter model id");return}return s.data},mle=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Qx(),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/t2i_adapter/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),i=d.useMemo(()=>{if(!s)return[];const p=[];return Wn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=ple(p);m&&o(IA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(On,{className:"nowheel nodrag",tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??null,placeholder:"Pick one",error:!l,data:i,onChange:u,sx:{width:"100%"}})},hle=d.memo(mle),gle=e=>{var i;const{nodeId:t,field:n}=e,r=te(),{data:o,hasBoards:s}=Sd(void 0,{selectFromResult:({data:u})=>{const p=[{label:"None",value:"none"}];return u==null||u.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{data:p,hasBoards:p.length>1}}}),l=d.useCallback(u=>{r(PA({nodeId:t,fieldName:n.name,value:u&&u!=="none"?{board_id:u}:void 0}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:((i=n.value)==null?void 0:i.board_id)??"none",data:o,onChange:l,disabled:!s})},vle=d.memo(gle),xle=({nodeId:e,fieldName:t})=>{const n=wO(e,t),r=Og(e,t,"input");return(r==null?void 0:r.fieldKind)==="output"?a.jsxs(Ie,{p:2,children:["Output field in input: ",n==null?void 0:n.type]}):(n==null?void 0:n.type)==="string"&&(r==null?void 0:r.type)==="string"||(n==null?void 0:n.type)==="StringPolymorphic"&&(r==null?void 0:r.type)==="StringPolymorphic"?a.jsx(lle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"||(n==null?void 0:n.type)==="BooleanPolymorphic"&&(r==null?void 0:r.type)==="BooleanPolymorphic"?a.jsx(jae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="integer"&&(r==null?void 0:r.type)==="integer"||(n==null?void 0:n.type)==="float"&&(r==null?void 0:r.type)==="float"||(n==null?void 0:n.type)==="FloatPolymorphic"&&(r==null?void 0:r.type)==="FloatPolymorphic"||(n==null?void 0:n.type)==="IntegerPolymorphic"&&(r==null?void 0:r.type)==="IntegerPolymorphic"?a.jsx(Zae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(Vae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"||(n==null?void 0:n.type)==="ImagePolymorphic"&&(r==null?void 0:r.type)==="ImagePolymorphic"?a.jsx(Uae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="BoardField"&&(r==null?void 0:r.type)==="BoardField"?a.jsx(vle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(Qae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(ele,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(cle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(qae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(Bae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="IPAdapterModelField"&&(r==null?void 0:r.type)==="IPAdapterModelField"?a.jsx(fle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="T2IAdapterModelField"&&(r==null?void 0:r.type)==="T2IAdapterModelField"?a.jsx(hle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(zae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(nle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(sle,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(be,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},AO=d.memo(xle),ble=({nodeId:e,fieldName:t})=>{const n=te(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=bO(e),{t:l}=Z(),i=d.useCallback(()=>{n(OI({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs(N,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(Zt,{as:N,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(In,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(SO,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(ba,{}),a.jsx(Vt,{label:a.jsx(i2,{nodeId:e,fieldName:t,kind:"input"}),openDelay:kh,placement:"top",hasArrow:!0,children:a.jsx(N,{h:"full",alignItems:"center",children:a.jsx(Tn,{as:bM})})}),a.jsx(Be,{"aria-label":l("nodes.removeLinearView"),tooltip:l("nodes.removeLinearView"),variant:"ghost",size:"sm",onClick:i,icon:a.jsx(Fr,{})})]}),a.jsx(AO,{nodeId:e,fieldName:t})]}),a.jsx(xO,{isSelected:!1,isHovered:r})]})},yle=d.memo(ble),Cle=le(ge,({nodes:e})=>({fields:e.workflow.exposedFields}),Ce),wle=()=>{const{fields:e}=W(Cle),{t}=Z();return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(ef,{children:a.jsx(N,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:e.length?e.map(({nodeId:n,fieldName:r})=>a.jsx(yle,{nodeId:n,fieldName:r},`${n}.${r}`)):a.jsx(tr,{label:t("nodes.noFieldsLinearview"),icon:null})})})})},Sle=d.memo(wle),kle=()=>a.jsx(N,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(ri,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(oi,{children:[a.jsx($r,{children:"Linear"}),a.jsx($r,{children:"Details"}),a.jsx($r,{children:"JSON"})]}),a.jsxs(Hc,{children:[a.jsx(Co,{children:a.jsx(Sle,{})}),a.jsx(Co,{children:a.jsx(gae,{})}),a.jsx(Co,{children:a.jsx(Cae,{})})]})]})}),_le=d.memo(kle),jle={paramNegativeConditioning:{placement:"right"},controlNet:{href:"https://support.invoke.ai/support/solutions/articles/151000105880"},lora:{href:"https://support.invoke.ai/support/solutions/articles/151000159072"},compositingCoherenceMode:{href:"https://support.invoke.ai/support/solutions/articles/151000158838"},infillMethod:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},scaleBeforeProcessing:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},paramIterations:{href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramPositiveConditioning:{href:"https://support.invoke.ai/support/solutions/articles/151000096606-tips-on-crafting-prompts",placement:"right"},paramScheduler:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramModel:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000096601-what-is-a-model-which-should-i-use-"},paramRatio:{gutter:16},controlNetControlMode:{placement:"right"},controlNetResizeMode:{placement:"right"},paramVAE:{placement:"right"},paramVAEPrecision:{placement:"right"}},Ile=1e3,Ple=[{name:"preventOverflow",options:{padding:10}}],TO=_e(({feature:e,children:t,wrapperProps:n,...r},o)=>{const{t:s}=Z(),l=W(g=>g.system.shouldEnableInformationalPopovers),i=d.useMemo(()=>jle[e],[e]),u=d.useMemo(()=>EA(MA(i,["image","href","buttonLabel"]),r),[i,r]),p=d.useMemo(()=>s(`popovers.${e}.heading`),[e,s]),m=d.useMemo(()=>s(`popovers.${e}.paragraphs`,{returnObjects:!0})??[],[e,s]),h=d.useCallback(()=>{i!=null&&i.href&&window.open(i.href)},[i==null?void 0:i.href]);return l?a.jsxs(Bd,{isLazy:!0,closeOnBlur:!1,trigger:"hover",variant:"informational",openDelay:Ile,modifiers:Ple,placement:"top",...u,children:[a.jsx(Kh,{children:a.jsx(Ie,{ref:o,w:"full",...n,children:t})}),a.jsx($c,{children:a.jsxs(Hd,{w:96,children:[a.jsx(K3,{}),a.jsx(qh,{children:a.jsxs(N,{sx:{gap:2,flexDirection:"column",alignItems:"flex-start"},children:[p&&a.jsxs(a.Fragment,{children:[a.jsx(cr,{size:"sm",children:p}),a.jsx(Yn,{})]}),(i==null?void 0:i.image)&&a.jsxs(a.Fragment,{children:[a.jsx(ga,{sx:{objectFit:"contain",maxW:"60%",maxH:"60%",backgroundColor:"white"},src:i.image,alt:"Optional Image"}),a.jsx(Yn,{})]}),m.map(g=>a.jsx(be,{children:g},g)),(i==null?void 0:i.href)&&a.jsxs(a.Fragment,{children:[a.jsx(Yn,{}),a.jsx(Ja,{pt:1,onClick:h,leftIcon:a.jsx(yy,{}),alignSelf:"flex-end",variant:"link",children:s("common.learnMore")??p})]})]})})]})})]}):a.jsx(Ie,{ref:o,w:"full",...n,children:t})});TO.displayName="IAIInformationalPopover";const Ot=d.memo(TO),Ele=le([ge],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:l}=e.config.sd.iterations,{iterations:i}=e.generation,{shouldUseSliders:u}=e.ui,p=e.hotkeys.shift?s:l;return{iterations:i,initial:t,min:n,sliderMax:r,inputMax:o,step:p,shouldUseSliders:u}},Ce),Mle=({asSlider:e})=>{const{iterations:t,initial:n,min:r,sliderMax:o,inputMax:s,step:l,shouldUseSliders:i}=W(Ele),u=te(),{t:p}=Z(),m=d.useCallback(g=>{u(ww(g))},[u]),h=d.useCallback(()=>{u(ww(n))},[u,n]);return e||i?a.jsx(Ot,{feature:"paramIterations",children:a.jsx(rt,{label:p("parameters.iterations"),step:l,min:r,max:o,onChange:m,handleReset:h,value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s}})}):a.jsx(Ot,{feature:"paramIterations",children:a.jsx(Qc,{label:p("parameters.iterations"),step:l,min:r,max:s,onChange:m,value:t,numberInputFieldProps:{textAlign:"center"}})})},os=d.memo(Mle),Ole=()=>{const[e,t]=d.useState(!1),[n,r]=d.useState(!1),o=d.useRef(null),s=a2(),l=d.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs(N,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(rO,{}),a.jsx(N,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,pb:3,gap:2,flexDir:"column"},children:a.jsx(os,{asSlider:!0})}),a.jsxs(Mg,{ref:o,id:"workflow-panel-group",autoSaveId:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Ya,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(_le,{})}),a.jsx(ph,{direction:"vertical",onDoubleClick:l,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Ya,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(uae,{})})]})]})},Dle=d.memo(Ole),ej=(e,t)=>{const n=d.useRef(null),[r,o]=d.useState(()=>{var p;return!!((p=n.current)!=null&&p.getCollapsed())}),s=d.useCallback(()=>{var p;(p=n.current)!=null&&p.getCollapsed()?Kr.flushSync(()=>{var m;(m=n.current)==null||m.expand()}):Kr.flushSync(()=>{var m;(m=n.current)==null||m.collapse()})},[]),l=d.useCallback(()=>{Kr.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),i=d.useCallback(()=>{Kr.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),u=d.useCallback(()=>{Kr.flushSync(()=>{var p;(p=n.current)==null||p.resize(e,t)})},[e,t]);return{ref:n,minSize:e,isCollapsed:r,setIsCollapsed:o,reset:u,toggle:s,expand:l,collapse:i}},Rle=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx($c,{children:a.jsx(N,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(Be,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("accessibility.showGalleryPanel"),onClick:r,icon:a.jsx(Roe,{}),sx:{p:0,px:3,h:48,borderEndRadius:0}})})}):null},Ale=d.memo(Rle),Ap={borderStartRadius:0,flexGrow:1},Tle=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx($c,{children:a.jsxs(N,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,h:48,children:[a.jsxs(Ht,{isAttached:!0,orientation:"vertical",flexGrow:3,children:[a.jsx(Be,{tooltip:n("parameters.showOptionsPanel"),"aria-label":n("parameters.showOptionsPanel"),onClick:r,sx:Ap,icon:a.jsx(_M,{})}),a.jsx(eO,{asIconButton:!0,sx:Ap}),a.jsx(X8,{asIconButton:!0,sx:Ap})]}),a.jsx(t2,{asIconButton:!0,sx:Ap})]})}):null},$le=d.memo(Tle),Nle=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:l}=Lr({defaultIsOpen:o}),{colorMode:i}=ha();return a.jsxs(Ie,{children:[a.jsxs(N,{onClick:l,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:Ae("base.250","base.750")(i),color:Ae("base.900","base.100")(i),_hover:{bg:Ae("base.300","base.700")(i)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},"data-testid":`${t} collapsible`,children:[t,a.jsx(dr,{children:n&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(be,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(ba,{}),a.jsx(bg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(Md,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Ie,{sx:{p:4,pb:4,borderBottomRadius:"base",bg:"base.150",_dark:{bg:"base.800"}},children:r})})]})},to=d.memo(Nle),Lle=le(ge,e=>{const{maxPrompts:t,combinatorial:n}=e.dynamicPrompts,{min:r,sliderMax:o,inputMax:s}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:r,sliderMax:o,inputMax:s,isDisabled:!n}},Ce),zle=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=W(Lle),s=te(),{t:l}=Z(),i=d.useCallback(p=>{s(OA(p))},[s]),u=d.useCallback(()=>{s(DA())},[s]);return a.jsx(Ot,{feature:"dynamicPromptsMaxPrompts",children:a.jsx(rt,{label:l("dynamicPrompts.maxPrompts"),isDisabled:o,min:t,max:n,value:e,onChange:i,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})})},Fle=d.memo(zle),Ble=le(ge,e=>{const{isLoading:t,isError:n,prompts:r,parsingError:o}=e.dynamicPrompts;return{prompts:r,parsingError:o,isError:n,isLoading:t}},Ce),Hle={"&::marker":{color:"base.500",_dark:{color:"base.500"}}},Vle=()=>{const{prompts:e,parsingError:t,isLoading:n,isError:r}=W(Ble);return r?a.jsx(Ot,{feature:"dynamicPrompts",children:a.jsx(N,{w:"full",h:"full",layerStyle:"second",alignItems:"center",justifyContent:"center",p:8,children:a.jsx(tr,{icon:Ioe,label:"Problem generating prompts"})})}):a.jsx(Ot,{feature:"dynamicPrompts",children:a.jsxs(Zt,{isInvalid:!!t,children:[a.jsxs(In,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:["Prompts Preview (",e.length,")",t&&` - ${t}`]}),a.jsxs(N,{h:64,pos:"relative",layerStyle:"third",borderRadius:"base",p:2,children:[a.jsx(ef,{children:a.jsx(h3,{stylePosition:"inside",ms:0,children:e.map((o,s)=>a.jsx(ho,{fontSize:"sm",sx:Hle,children:a.jsx(be,{as:"span",children:o})},`${o}.${s}`))})}),n&&a.jsx(N,{pos:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,layerStyle:"second",opacity:.7,alignItems:"center",justifyContent:"center",children:a.jsx(fa,{})})]})]})})},Wle=d.memo(Vle),$O=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx(Ie,{ref:r,...n,children:a.jsxs(Ie,{children:[a.jsx(be,{fontWeight:600,children:e}),t&&a.jsx(be,{size:"xs",variant:"subtext",children:t})]})}));$O.displayName="IAIMantineSelectItemWithDescription";const Ule=d.memo($O),Gle=()=>{const e=te(),{t}=Z(),n=W(s=>s.dynamicPrompts.seedBehaviour),r=d.useMemo(()=>[{value:"PER_ITERATION",label:t("dynamicPrompts.seedBehaviour.perIterationLabel"),description:t("dynamicPrompts.seedBehaviour.perIterationDesc")},{value:"PER_PROMPT",label:t("dynamicPrompts.seedBehaviour.perPromptLabel"),description:t("dynamicPrompts.seedBehaviour.perPromptDesc")}],[t]),o=d.useCallback(s=>{s&&e(RA(s))},[e]);return a.jsx(Ot,{feature:"dynamicPromptsSeedBehaviour",children:a.jsx(On,{label:t("dynamicPrompts.seedBehaviour.label"),value:n,data:r,itemComponent:Ule,onChange:o})})},Kle=d.memo(Gle),qle=()=>{const{t:e}=Z(),t=d.useMemo(()=>le(ge,({dynamicPrompts:o})=>{const s=o.prompts.length;return s===1?e("dynamicPrompts.promptsWithCount_one",{count:s}):e("dynamicPrompts.promptsWithCount_other",{count:s})}),[e]),n=W(t);return $t("dynamicPrompting").isFeatureEnabled?a.jsx(to,{label:e("dynamicPrompts.dynamicPrompts"),activeLabel:n,children:a.jsxs(N,{sx:{gap:2,flexDir:"column"},children:[a.jsx(Wle,{}),a.jsx(Kle,{}),a.jsx(Fle,{})]})}):null},Yc=d.memo(qle),Xle=e=>{const t=te(),{lora:n}=e,r=d.useCallback(l=>{t(AA({id:n.id,weight:l}))},[t,n.id]),o=d.useCallback(()=>{t(TA(n.id))},[t,n.id]),s=d.useCallback(()=>{t($A(n.id))},[t,n.id]);return a.jsx(Ot,{feature:"lora",children:a.jsxs(N,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(rt,{label:n.model_name,value:n.weight,onChange:r,min:-1,max:2,step:.01,withInput:!0,withReset:!0,handleReset:o,withSliderMarks:!0,sliderMarks:[-1,0,1,2],sliderNumberInputProps:{min:-50,max:50}}),a.jsx(Be,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Fr,{}),colorScheme:"error"})]})})},Qle=d.memo(Xle),Yle=le(ge,({lora:e})=>({lorasArray:Sr(e.loras)}),Ce),Zle=()=>{const{lorasArray:e}=W(Yle);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Yn,{pt:1}),a.jsx(Qle,{lora:t})]},t.model_name))})},Jle=d.memo(Zle),eie=le(ge,({lora:e})=>({loras:e.loras}),Ce),tie=()=>{const e=te(),{loras:t}=W(eie),{data:n}=kd(),r=W(l=>l.generation.model),o=d.useMemo(()=>{if(!n)return[];const l=[];return Wn(n.entities,(i,u)=>{if(!i||u in t)return;const p=(r==null?void 0:r.base_model)!==i.base_model;l.push({value:u,label:i.model_name,disabled:p,group:pn[i.base_model],tooltip:p?`Incompatible base model: ${i.base_model}`:void 0})}),l.sort((i,u)=>i.label&&!u.label?1:-1),l.sort((i,u)=>i.disabled&&!u.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=d.useCallback(l=>{if(!l)return;const i=n==null?void 0:n.entities[l];i&&e(NA(i))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx(N,{sx:{justifyContent:"center",p:2},children:a.jsx(be,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:fl,disabled:o.length===0,filter:(l,i)=>{var u;return((u=i.label)==null?void 0:u.toLowerCase().includes(l.toLowerCase().trim()))||i.value.toLowerCase().includes(l.toLowerCase().trim())},onChange:s,"data-testid":"add-lora"})},nie=d.memo(tie),rie=le(ge,e=>{const t=DI(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Ce),oie=()=>{const{t:e}=Z(),{activeLabel:t}=W(rie);return $t("lora").isFeatureEnabled?a.jsx(to,{label:e("modelManager.loraModels"),activeLabel:t,children:a.jsxs(N,{sx:{flexDir:"column",gap:2},children:[a.jsx(nie,{}),a.jsx(Jle,{})]})}):null},Zc=d.memo(oie),sie=()=>{const e=te(),t=W(o=>o.generation.shouldUseCpuNoise),{t:n}=Z(),r=d.useCallback(o=>{e(LA(o.target.checked))},[e]);return a.jsx(Ot,{feature:"noiseUseCPU",children:a.jsx(kn,{label:n("parameters.useCpuNoise"),isChecked:t,onChange:r})})},ss=e=>e.generation,aie=le(ss,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Ce),lie=()=>{const{t:e}=Z(),{seamlessXAxis:t}=W(aie),n=te(),r=d.useCallback(o=>{n(zA(o.target.checked))},[n]);return a.jsx(kn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},iie=d.memo(lie),cie=le(ss,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Ce),uie=()=>{const{t:e}=Z(),{seamlessYAxis:t}=W(cie),n=te(),r=d.useCallback(o=>{n(FA(o.target.checked))},[n]);return a.jsx(kn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},die=d.memo(uie),fie=()=>{const{t:e}=Z();return $t("seamless").isFeatureEnabled?a.jsxs(Zt,{children:[a.jsx(In,{children:e("parameters.seamlessTiling")})," ",a.jsxs(N,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx(iie,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(die,{})})]})]}):null},pie=d.memo(fie);function mie(){const e=W(u=>u.generation.clipSkip),{model:t}=W(u=>u.generation),n=te(),{t:r}=Z(),o=d.useCallback(u=>{n(Sw(u))},[n]),s=d.useCallback(()=>{n(Sw(0))},[n]),l=d.useMemo(()=>t?Jf[t.base_model].maxClip:Jf["sd-1"].maxClip,[t]),i=d.useMemo(()=>t?Jf[t.base_model].markers:Jf["sd-1"].markers,[t]);return(t==null?void 0:t.base_model)==="sdxl"?null:a.jsx(Ot,{feature:"clipSkip",placement:"top",children:a.jsx(rt,{label:r("parameters.clipSkip"),"aria-label":r("parameters.clipSkip"),min:0,max:l,step:1,value:e,onChange:o,withSliderMarks:!0,sliderMarks:i,withInput:!0,withReset:!0,handleReset:s})})}const hie=le(ge,e=>{const{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}=e.generation;return{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}},Ce);function Jc(){const{clipSkip:e,model:t,seamlessXAxis:n,seamlessYAxis:r,shouldUseCpuNoise:o}=W(hie),{t:s}=Z(),l=d.useMemo(()=>{const i=[];return o?i.push(s("parameters.cpuNoise")):i.push(s("parameters.gpuNoise")),e>0&&t&&t.base_model!=="sdxl"&&i.push(s("parameters.clipSkipWithLayerCount",{layerCount:e})),n&&r?i.push(s("parameters.seamlessX&Y")):n?i.push(s("parameters.seamlessX")):r&&i.push(s("parameters.seamlessY")),i.join(", ")},[e,t,n,r,o,s]);return a.jsx(to,{label:s("common.advanced"),activeLabel:l,children:a.jsxs(N,{sx:{flexDir:"column",gap:2},children:[a.jsx(pie,{}),a.jsx(Yn,{}),t&&(t==null?void 0:t.base_model)!=="sdxl"&&a.jsxs(a.Fragment,{children:[a.jsx(mie,{}),a.jsx(Yn,{pt:2})]}),a.jsx(sie,{})]})})}const wa=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{var o;return((o=_o(r,e))==null?void 0:o.isEnabled)??!1},Ce),[e]);return W(t)},gie=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.model},Ce),[e]);return W(t)},NO=e=>{const{data:t}=Xx(),n=d.useMemo(()=>t?hI.getSelectors().selectAll(t):[],[t]),{data:r}=Qx(),o=d.useMemo(()=>r?gI.getSelectors().selectAll(r):[],[r]),{data:s}=Yx(),l=d.useMemo(()=>s?vI.getSelectors().selectAll(s):[],[s]);return e==="controlnet"?n:e==="t2i_adapter"?o:e==="ip_adapter"?l:[]},LO=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.type},Ce),[e]);return W(t)},vie=le(ge,({generation:e})=>{const{model:t}=e;return{mainModel:t}},Ce),xie=({id:e})=>{const t=wa(e),n=LO(e),r=gie(e),o=te(),{mainModel:s}=W(vie),{t:l}=Z(),i=NO(n),u=d.useMemo(()=>{if(!i)return[];const h=[];return i.forEach(g=>{if(!g)return;const x=(g==null?void 0:g.base_model)!==(s==null?void 0:s.base_model);h.push({value:g.id,label:g.model_name,group:pn[g.base_model],disabled:x,tooltip:x?`${l("controlnet.incompatibleBaseModel")} ${g.base_model}`:void 0})}),h.sort((g,x)=>g.disabled?1:x.disabled?-1:g.label.localeCompare(x.label)),h},[s==null?void 0:s.base_model,i,l]),p=d.useMemo(()=>i.find(h=>(h==null?void 0:h.id)===`${r==null?void 0:r.base_model}/${n}/${r==null?void 0:r.model_name}`),[n,r==null?void 0:r.base_model,r==null?void 0:r.model_name,i]),m=d.useCallback(h=>{if(!h)return;const g=EO(h);g&&o(BA({id:e,model:g}))},[o,e]);return a.jsx(nn,{itemComponent:fl,data:u,error:!p||(s==null?void 0:s.base_model)!==p.base_model,placeholder:l("controlnet.selectModel"),value:(p==null?void 0:p.id)??null,onChange:m,disabled:!t,tooltip:p==null?void 0:p.description})},bie=d.memo(xie),yie=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.weight},Ce),[e]);return W(t)},Cie=({id:e})=>{const t=wa(e),n=yie(e),r=te(),{t:o}=Z(),s=d.useCallback(l=>{r(HA({id:e,weight:l}))},[r,e]);return gb(n)?null:a.jsx(Ot,{feature:"controlNetWeight",children:a.jsx(rt,{isDisabled:!t,label:o("controlnet.weight"),value:n,onChange:s,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})})},wie=d.memo(Cie),Sie=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.controlImage},Ce),[e]);return W(t)},kie=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{const o=_o(r,e);return o&&Nc(o)?o.processedControlImage:void 0},Ce),[e]);return W(t)},_ie=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{const o=_o(r,e);return o&&Nc(o)?o.processorType:void 0},Ce),[e]);return W(t)},jie=le(ge,({controlAdapters:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},Ce),Iie=({isSmall:e,id:t})=>{const n=Sie(t),r=kie(t),o=_ie(t),s=te(),{t:l}=Z(),{pendingControlImages:i,autoAddBoardId:u}=W(jie),p=W(Zn),[m,h]=d.useState(!1),{currentData:g}=wo(n??Zr.skipToken),{currentData:x}=wo(r??Zr.skipToken),[y]=VA(),[b]=WA(),[C]=UA(),S=d.useCallback(()=>{s(GA({id:t,controlImage:null}))},[t,s]),_=d.useCallback(async()=>{x&&(await y({imageDTO:x,is_intermediate:!1}).unwrap(),u!=="none"?b({imageDTO:x,board_id:u}):C({imageDTO:x}))},[x,y,u,b,C]),j=d.useCallback(()=>{g&&(p==="unifiedCanvas"?s(Wo({width:g.width,height:g.height})):(s(Hl(g.width)),s(Vl(g.height))))},[g,p,s]),E=d.useCallback(()=>{h(!0)},[]),I=d.useCallback(()=>{h(!1)},[]),M=d.useMemo(()=>{if(g)return{id:t,payloadType:"IMAGE_DTO",payload:{imageDTO:g}}},[g,t]),D=d.useMemo(()=>({id:t,actionType:"SET_CONTROL_ADAPTER_IMAGE",context:{id:t}}),[t]),R=d.useMemo(()=>({type:"SET_CONTROL_ADAPTER_IMAGE",id:t}),[t]),A=g&&x&&!m&&!i.includes(t)&&o!=="none";return a.jsxs(N,{onMouseEnter:E,onMouseLeave:I,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center"},children:[a.jsx(sl,{draggableData:M,droppableData:D,imageDTO:g,isDropDisabled:A,postUploadAction:R}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:A?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(sl,{draggableData:M,droppableData:D,imageDTO:x,isUploadDisabled:!0})}),a.jsxs(a.Fragment,{children:[a.jsx(xc,{onClick:S,icon:g?a.jsx(dg,{}):void 0,tooltip:l("controlnet.resetControlImage")}),a.jsx(xc,{onClick:_,icon:g?a.jsx(ug,{size:16}):void 0,tooltip:l("controlnet.saveControlImage"),styleOverrides:{marginTop:6}}),a.jsx(xc,{onClick:j,icon:g?a.jsx(uee,{size:16}):void 0,tooltip:l("controlnet.setControlImageDimensions"),styleOverrides:{marginTop:12}})]}),i.includes(t)&&a.jsx(N,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",alignItems:"center",justifyContent:"center",opacity:.8,borderRadius:"base",bg:"base.400",_dark:{bg:"base.900"}},children:a.jsx(fa,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},tj=d.memo(Iie),Io=()=>{const e=te();return d.useCallback((n,r)=>{e(KA({id:n,params:r}))},[e])};function Po(e){return a.jsx(N,{sx:{flexDirection:"column",gap:2,pb:2},children:e.children})}const nj=wr.canny_image_processor.default,Pie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,l=Io(),{t:i}=Z(),u=d.useCallback(g=>{l(t,{low_threshold:g})},[t,l]),p=d.useCallback(()=>{l(t,{low_threshold:nj.low_threshold})},[t,l]),m=d.useCallback(g=>{l(t,{high_threshold:g})},[t,l]),h=d.useCallback(()=>{l(t,{high_threshold:nj.high_threshold})},[t,l]);return a.jsxs(Po,{children:[a.jsx(rt,{isDisabled:!r,label:i("controlnet.lowThreshold"),value:o,onChange:u,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(rt,{isDisabled:!r,label:i("controlnet.highThreshold"),value:s,onChange:m,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},Eie=d.memo(Pie),Mie=wr.color_map_image_processor.default,Oie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{color_map_tile_size:o}=n,s=Io(),{t:l}=Z(),i=d.useCallback(p=>{s(t,{color_map_tile_size:p})},[t,s]),u=d.useCallback(()=>{s(t,{color_map_tile_size:Mie.color_map_tile_size})},[t,s]);return a.jsx(Po,{children:a.jsx(rt,{isDisabled:!r,label:l("controlnet.colorMapTileSize"),value:o,onChange:i,handleReset:u,withReset:!0,min:1,max:256,step:1,withInput:!0,withSliderMarks:!0,sliderNumberInputProps:{max:4096}})})},Die=d.memo(Oie),Mu=wr.content_shuffle_image_processor.default,Rie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:l,h:i,f:u}=n,p=Io(),{t:m}=Z(),h=d.useCallback(I=>{p(t,{detect_resolution:I})},[t,p]),g=d.useCallback(()=>{p(t,{detect_resolution:Mu.detect_resolution})},[t,p]),x=d.useCallback(I=>{p(t,{image_resolution:I})},[t,p]),y=d.useCallback(()=>{p(t,{image_resolution:Mu.image_resolution})},[t,p]),b=d.useCallback(I=>{p(t,{w:I})},[t,p]),C=d.useCallback(()=>{p(t,{w:Mu.w})},[t,p]),S=d.useCallback(I=>{p(t,{h:I})},[t,p]),_=d.useCallback(()=>{p(t,{h:Mu.h})},[t,p]),j=d.useCallback(I=>{p(t,{f:I})},[t,p]),E=d.useCallback(()=>{p(t,{f:Mu.f})},[t,p]);return a.jsxs(Po,{children:[a.jsx(rt,{label:m("controlnet.detectResolution"),value:s,onChange:h,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:m("controlnet.imageResolution"),value:o,onChange:x,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:m("controlnet.w"),value:l,onChange:b,handleReset:C,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:m("controlnet.h"),value:i,onChange:S,handleReset:_,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:m("controlnet.f"),value:u,onChange:j,handleReset:E,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Aie=d.memo(Rie),rj=wr.hed_image_processor.default,Tie=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,l=Io(),{t:i}=Z(),u=d.useCallback(x=>{l(t,{detect_resolution:x})},[t,l]),p=d.useCallback(x=>{l(t,{image_resolution:x})},[t,l]),m=d.useCallback(x=>{l(t,{scribble:x.target.checked})},[t,l]),h=d.useCallback(()=>{l(t,{detect_resolution:rj.detect_resolution})},[t,l]),g=d.useCallback(()=>{l(t,{image_resolution:rj.image_resolution})},[t,l]);return a.jsxs(Po,{children:[a.jsx(rt,{label:i("controlnet.detectResolution"),value:n,onChange:u,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(rt,{label:i("controlnet.imageResolution"),value:r,onChange:p,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(kn,{label:i("controlnet.scribble"),isChecked:o,onChange:m,isDisabled:!s})]})},$ie=d.memo(Tie),oj=wr.lineart_anime_image_processor.default,Nie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,l=Io(),{t:i}=Z(),u=d.useCallback(g=>{l(t,{detect_resolution:g})},[t,l]),p=d.useCallback(g=>{l(t,{image_resolution:g})},[t,l]),m=d.useCallback(()=>{l(t,{detect_resolution:oj.detect_resolution})},[t,l]),h=d.useCallback(()=>{l(t,{image_resolution:oj.image_resolution})},[t,l]);return a.jsxs(Po,{children:[a.jsx(rt,{label:i("controlnet.detectResolution"),value:s,onChange:u,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:i("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Lie=d.memo(Nie),sj=wr.lineart_image_processor.default,zie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:l}=n,i=Io(),{t:u}=Z(),p=d.useCallback(y=>{i(t,{detect_resolution:y})},[t,i]),m=d.useCallback(y=>{i(t,{image_resolution:y})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:sj.detect_resolution})},[t,i]),g=d.useCallback(()=>{i(t,{image_resolution:sj.image_resolution})},[t,i]),x=d.useCallback(y=>{i(t,{coarse:y.target.checked})},[t,i]);return a.jsxs(Po,{children:[a.jsx(rt,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:u("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(kn,{label:u("controlnet.coarse"),isChecked:l,onChange:x,isDisabled:!r})]})},Fie=d.memo(zie),aj=wr.mediapipe_face_processor.default,Bie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,l=Io(),{t:i}=Z(),u=d.useCallback(g=>{l(t,{max_faces:g})},[t,l]),p=d.useCallback(g=>{l(t,{min_confidence:g})},[t,l]),m=d.useCallback(()=>{l(t,{max_faces:aj.max_faces})},[t,l]),h=d.useCallback(()=>{l(t,{min_confidence:aj.min_confidence})},[t,l]);return a.jsxs(Po,{children:[a.jsx(rt,{label:i("controlnet.maxFaces"),value:o,onChange:u,handleReset:m,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:i("controlnet.minConfidence"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Hie=d.memo(Bie),lj=wr.midas_depth_image_processor.default,Vie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,l=Io(),{t:i}=Z(),u=d.useCallback(g=>{l(t,{a_mult:g})},[t,l]),p=d.useCallback(g=>{l(t,{bg_th:g})},[t,l]),m=d.useCallback(()=>{l(t,{a_mult:lj.a_mult})},[t,l]),h=d.useCallback(()=>{l(t,{bg_th:lj.bg_th})},[t,l]);return a.jsxs(Po,{children:[a.jsx(rt,{label:i("controlnet.amult"),value:o,onChange:u,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:i("controlnet.bgth"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Wie=d.memo(Vie),Tp=wr.mlsd_image_processor.default,Uie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:l,thr_v:i}=n,u=Io(),{t:p}=Z(),m=d.useCallback(_=>{u(t,{detect_resolution:_})},[t,u]),h=d.useCallback(_=>{u(t,{image_resolution:_})},[t,u]),g=d.useCallback(_=>{u(t,{thr_d:_})},[t,u]),x=d.useCallback(_=>{u(t,{thr_v:_})},[t,u]),y=d.useCallback(()=>{u(t,{detect_resolution:Tp.detect_resolution})},[t,u]),b=d.useCallback(()=>{u(t,{image_resolution:Tp.image_resolution})},[t,u]),C=d.useCallback(()=>{u(t,{thr_d:Tp.thr_d})},[t,u]),S=d.useCallback(()=>{u(t,{thr_v:Tp.thr_v})},[t,u]);return a.jsxs(Po,{children:[a.jsx(rt,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:p("controlnet.w"),value:l,onChange:g,handleReset:C,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:p("controlnet.h"),value:i,onChange:x,handleReset:S,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Gie=d.memo(Uie),ij=wr.normalbae_image_processor.default,Kie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,l=Io(),{t:i}=Z(),u=d.useCallback(g=>{l(t,{detect_resolution:g})},[t,l]),p=d.useCallback(g=>{l(t,{image_resolution:g})},[t,l]),m=d.useCallback(()=>{l(t,{detect_resolution:ij.detect_resolution})},[t,l]),h=d.useCallback(()=>{l(t,{image_resolution:ij.image_resolution})},[t,l]);return a.jsxs(Po,{children:[a.jsx(rt,{label:i("controlnet.detectResolution"),value:s,onChange:u,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:i("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},qie=d.memo(Kie),cj=wr.openpose_image_processor.default,Xie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:l}=n,i=Io(),{t:u}=Z(),p=d.useCallback(y=>{i(t,{detect_resolution:y})},[t,i]),m=d.useCallback(y=>{i(t,{image_resolution:y})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:cj.detect_resolution})},[t,i]),g=d.useCallback(()=>{i(t,{image_resolution:cj.image_resolution})},[t,i]),x=d.useCallback(y=>{i(t,{hand_and_face:y.target.checked})},[t,i]);return a.jsxs(Po,{children:[a.jsx(rt,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:u("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(kn,{label:u("controlnet.handAndFace"),isChecked:l,onChange:x,isDisabled:!r})]})},Qie=d.memo(Xie),uj=wr.pidi_image_processor.default,Yie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:l,safe:i}=n,u=Io(),{t:p}=Z(),m=d.useCallback(C=>{u(t,{detect_resolution:C})},[t,u]),h=d.useCallback(C=>{u(t,{image_resolution:C})},[t,u]),g=d.useCallback(()=>{u(t,{detect_resolution:uj.detect_resolution})},[t,u]),x=d.useCallback(()=>{u(t,{image_resolution:uj.image_resolution})},[t,u]),y=d.useCallback(C=>{u(t,{scribble:C.target.checked})},[t,u]),b=d.useCallback(C=>{u(t,{safe:C.target.checked})},[t,u]);return a.jsxs(Po,{children:[a.jsx(rt,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(rt,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(kn,{label:p("controlnet.scribble"),isChecked:l,onChange:y}),a.jsx(kn,{label:p("controlnet.safe"),isChecked:i,onChange:b,isDisabled:!r})]})},Zie=d.memo(Yie),Jie=e=>null,ece=d.memo(Jie),zO=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{const o=_o(r,e);return o&&Nc(o)?o.processorNode:void 0},Ce),[e]);return W(t)},tce=({id:e})=>{const t=wa(e),n=zO(e);return n?n.type==="canny_image_processor"?a.jsx(Eie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="color_map_image_processor"?a.jsx(Die,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="hed_image_processor"?a.jsx($ie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="lineart_image_processor"?a.jsx(Fie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="content_shuffle_image_processor"?a.jsx(Aie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="lineart_anime_image_processor"?a.jsx(Lie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="mediapipe_face_processor"?a.jsx(Hie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="midas_depth_image_processor"?a.jsx(Wie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="mlsd_image_processor"?a.jsx(Gie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="normalbae_image_processor"?a.jsx(qie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="openpose_image_processor"?a.jsx(Qie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="pidi_image_processor"?a.jsx(Zie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="zoe_depth_image_processor"?a.jsx(ece,{controlNetId:e,processorNode:n,isEnabled:t}):null:null},nce=d.memo(tce),rce=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{const o=_o(r,e);if(o&&Nc(o))return o.shouldAutoConfig},Ce),[e]);return W(t)},oce=({id:e})=>{const t=wa(e),n=rce(e),r=te(),{t:o}=Z(),s=d.useCallback(()=>{r(qA({id:e}))},[e,r]);return gb(n)?null:a.jsx(kn,{label:o("controlnet.autoConfigure"),"aria-label":o("controlnet.autoConfigure"),isChecked:n,onChange:s,isDisabled:!t})},sce=d.memo(oce),ace=e=>{const{id:t}=e,n=te(),{t:r}=Z(),o=d.useCallback(()=>{n(XA({id:t}))},[t,n]),s=d.useCallback(()=>{n(QA({id:t}))},[t,n]);return a.jsxs(N,{sx:{gap:2},children:[a.jsx(Be,{size:"sm",icon:a.jsx(Yl,{}),tooltip:r("controlnet.importImageFromCanvas"),"aria-label":r("controlnet.importImageFromCanvas"),onClick:o}),a.jsx(Be,{size:"sm",icon:a.jsx(wM,{}),tooltip:r("controlnet.importMaskFromCanvas"),"aria-label":r("controlnet.importMaskFromCanvas"),onClick:s})]})},lce=d.memo(ace),ice=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{const o=_o(r,e);return o?{beginStepPct:o.beginStepPct,endStepPct:o.endStepPct}:void 0},Ce),[e]);return W(t)},dj=e=>`${Math.round(e*100)}%`,cce=({id:e})=>{const t=wa(e),n=ice(e),r=te(),{t:o}=Z(),s=d.useCallback(l=>{r(YA({id:e,beginStepPct:l[0]})),r(ZA({id:e,endStepPct:l[1]}))},[r,e]);return n?a.jsx(Ot,{feature:"controlNetBeginEnd",children:a.jsxs(Zt,{isDisabled:!t,children:[a.jsx(In,{children:o("controlnet.beginEndStepPercent")}),a.jsx(zb,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(cP,{"aria-label":["Begin Step %","End Step %!"],value:[n.beginStepPct,n.endStepPct],onChange:s,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!t,children:[a.jsx(uP,{children:a.jsx(dP,{})}),a.jsx(Vt,{label:dj(n.beginStepPct),placement:"top",hasArrow:!0,children:a.jsx(G1,{index:0})}),a.jsx(Vt,{label:dj(n.endStepPct),placement:"top",hasArrow:!0,children:a.jsx(G1,{index:1})}),a.jsx(Wp,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Wp,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Wp,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})}):null},uce=d.memo(cce),dce=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{const o=_o(r,e);if(o&&JA(o))return o.controlMode},Ce),[e]);return W(t)};function fce({id:e}){const t=wa(e),n=dce(e),r=te(),{t:o}=Z(),s=[{label:o("controlnet.balanced"),value:"balanced"},{label:o("controlnet.prompt"),value:"more_prompt"},{label:o("controlnet.control"),value:"more_control"},{label:o("controlnet.megaControl"),value:"unbalanced"}],l=d.useCallback(i=>{r(eT({id:e,controlMode:i}))},[e,r]);return n?a.jsx(Ot,{feature:"controlNetControlMode",children:a.jsx(On,{disabled:!t,label:o("controlnet.controlMode"),data:s,value:n,onChange:l})}):null}const pce=le(e2,e=>Sr(wr,n=>({value:n.type,label:n.label})).sort((n,r)=>n.value==="none"?-1:r.value==="none"?1:n.label.localeCompare(r.label)).filter(n=>!e.sd.disabledControlNetProcessors.includes(n.value)),Ce),mce=({id:e})=>{const t=wa(e),n=zO(e),r=te(),o=W(pce),{t:s}=Z(),l=d.useCallback(i=>{r(tT({id:e,processorType:i}))},[e,r]);return n?a.jsx(nn,{label:s("controlnet.processor"),value:n.type??"canny_image_processor",data:o,onChange:l,disabled:!t}):null},hce=d.memo(mce),gce=e=>{const t=d.useMemo(()=>le(ge,({controlAdapters:r})=>{const o=_o(r,e);if(o&&Nc(o))return o.resizeMode},Ce),[e]);return W(t)};function vce({id:e}){const t=wa(e),n=gce(e),r=te(),{t:o}=Z(),s=[{label:o("controlnet.resize"),value:"just_resize"},{label:o("controlnet.crop"),value:"crop_resize"},{label:o("controlnet.fill"),value:"fill_resize"}],l=d.useCallback(i=>{r(nT({id:e,resizeMode:i}))},[e,r]);return n?a.jsx(Ot,{feature:"controlNetResizeMode",children:a.jsx(On,{disabled:!t,label:o("controlnet.resizeMode"),data:s,value:n,onChange:l})}):null}const xce=e=>{const{id:t,number:n}=e,r=LO(t),o=te(),{t:s}=Z(),l=W(Zn),i=wa(t),[u,p]=yee(!1),m=d.useCallback(()=>{o(rT({id:t}))},[t,o]),h=d.useCallback(()=>{o(oT(t))},[t,o]),g=d.useCallback(x=>{o(sT({id:t,isEnabled:x.target.checked}))},[t,o]);return r?a.jsxs(N,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(N,{sx:{gap:2,alignItems:"center",justifyContent:"space-between"},children:a.jsx(kn,{label:s(`controlnet.${r}`,{number:n}),"aria-label":s("controlnet.toggleControlNet"),isChecked:i,onChange:g,formControlProps:{w:"full"},formLabelProps:{fontWeight:600}})}),a.jsxs(N,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Ie,{sx:{w:"full",minW:0,transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(bie,{id:t})}),l==="unifiedCanvas"&&a.jsx(lce,{id:t}),a.jsx(Be,{size:"sm",tooltip:s("controlnet.duplicate"),"aria-label":s("controlnet.duplicate"),onClick:h,icon:a.jsx(Uc,{})}),a.jsx(Be,{size:"sm",tooltip:s("controlnet.delete"),"aria-label":s("controlnet.delete"),colorScheme:"error",onClick:m,icon:a.jsx(Fr,{})}),a.jsx(Be,{size:"sm",tooltip:s(u?"controlnet.hideAdvanced":"controlnet.showAdvanced"),"aria-label":s(u?"controlnet.hideAdvanced":"controlnet.showAdvanced"),onClick:p,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(bg,{sx:{boxSize:4,color:"base.700",transform:u?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})})]}),a.jsxs(N,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs(N,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs(N,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:u?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(wie,{id:t}),a.jsx(uce,{id:t})]}),!u&&a.jsx(N,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(tj,{id:t,isSmall:!0})})]}),a.jsxs(N,{sx:{gap:2},children:[a.jsx(fce,{id:t}),a.jsx(vce,{id:t})]}),a.jsx(hce,{id:t})]}),u&&a.jsxs(a.Fragment,{children:[a.jsx(tj,{id:t}),a.jsx(sce,{id:t}),a.jsx(nce,{id:t})]})]}):null},bce=d.memo(xce),e1=e=>{const t=W(i=>{var u;return(u=i.generation.model)==null?void 0:u.base_model}),n=te(),r=NO(e),o=d.useMemo(()=>{const i=r.filter(u=>t?u.base_model===t:!0)[0];return i||r[0]},[t,r]),s=d.useMemo(()=>!o,[o]);return[d.useCallback(()=>{s||n(aT({type:e,overrides:{model:o}}))},[n,o,s,e]),s]},yce=le([ge],({controlAdapters:e})=>{const t=[];let n=!1;const r=lT(e).filter(m=>m.isEnabled).length,o=iT(e).length;r>0&&t.push(`${r} IP`),r>o&&(n=!0);const s=cT(e).filter(m=>m.isEnabled).length,l=uT(e).length;s>0&&t.push(`${s} ControlNet`),s>l&&(n=!0);const i=dT(e).filter(m=>m.isEnabled).length,u=fT(e).length;return i>0&&t.push(`${i} T2I`),i>u&&(n=!0),{controlAdapterIds:pT(e).map(String),activeLabel:t.join(", "),isError:n}},Ce),Cce=()=>{const{t:e}=Z(),{controlAdapterIds:t,activeLabel:n}=W(yce),r=$t("controlNet").isFeatureDisabled,[o,s]=e1("controlnet"),[l,i]=e1("ip_adapter"),[u,p]=e1("t2i_adapter");return r?null:a.jsx(to,{label:e("controlnet.controlAdapter",{count:t.length}),activeLabel:n,children:a.jsxs(N,{sx:{flexDir:"column",gap:2},children:[a.jsxs(Ht,{size:"sm",w:"full",justifyContent:"space-between",children:[a.jsx(ot,{tooltip:e("controlnet.addControlNet"),leftIcon:a.jsx(Xa,{}),onClick:o,"data-testid":"add controlnet",flexGrow:1,isDisabled:s,children:e("common.controlNet")}),a.jsx(ot,{tooltip:e("controlnet.addIPAdapter"),leftIcon:a.jsx(Xa,{}),onClick:l,"data-testid":"add ip adapter",flexGrow:1,isDisabled:i,children:e("common.ipAdapter")}),a.jsx(ot,{tooltip:e("controlnet.addT2IAdapter"),leftIcon:a.jsx(Xa,{}),onClick:u,"data-testid":"add t2i adapter",flexGrow:1,isDisabled:p,children:e("common.t2iAdapter")})]}),t.map((m,h)=>a.jsxs(d.Fragment,{children:[a.jsx(Yn,{}),a.jsx(bce,{id:m,number:h+1})]},m))]})})},eu=d.memo(Cce),wce=e=>{const{onClick:t}=e,{t:n}=Z();return a.jsx(Be,{size:"sm","aria-label":n("embedding.addEmbedding"),tooltip:n("embedding.addEmbedding"),icon:a.jsx(hM,{}),sx:{p:2,color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}}},variant:"link",onClick:t})},Tg=d.memo(wce),Sce="28rem",kce=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=mT(),l=d.useRef(null),{t:i}=Z(),u=W(h=>h.generation.model),p=d.useMemo(()=>{if(!s)return[];const h=[];return Wn(s.entities,(g,x)=>{if(!g)return;const y=(u==null?void 0:u.base_model)!==g.base_model;h.push({value:g.model_name,label:g.model_name,group:pn[g.base_model],disabled:y,tooltip:y?`${i("embedding.incompatibleModel")} ${g.base_model}`:void 0})}),h.sort((g,x)=>{var y;return g.label&&x.label?(y=g.label)!=null&&y.localeCompare(x.label)?-1:1:-1}),h.sort((g,x)=>g.disabled&&!x.disabled?1:-1)},[s,u==null?void 0:u.base_model,i]),m=d.useCallback(h=>{h&&t(h)},[t]);return a.jsxs(Bd,{initialFocusRef:l,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Kh,{children:o}),a.jsx(Hd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(qh,{sx:{p:0,w:`calc(${Sce} - 2rem )`},children:p.length===0?a.jsx(N,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(be,{children:"No Embeddings Loaded"})}):a.jsx(nn,{inputRef:l,autoFocus:!0,placeholder:i("embedding.addEmbedding"),value:null,data:p,nothingFound:i("embedding.noMatchingEmbedding"),itemComponent:fl,disabled:p.length===0,onDropdownClose:r,filter:(h,g)=>{var x;return((x=g.label)==null?void 0:x.toLowerCase().includes(h.toLowerCase().trim()))||g.value.toLowerCase().includes(h.toLowerCase().trim())},onChange:m})})})]})},$g=d.memo(kce),_ce=()=>{const e=W(h=>h.generation.negativePrompt),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),s=te(),{t:l}=Z(),i=d.useCallback(h=>{s(Bu(h.target.value))},[s]),u=d.useCallback(h=>{h.key==="<"&&o()},[o]),p=d.useCallback(h=>{if(!t.current)return;const g=t.current.selectionStart;if(g===void 0)return;let x=e.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=e.slice(g),Kr.flushSync(()=>{s(Bu(x))}),t.current.selectionEnd=y,r()},[s,r,e]),m=$t("embedding").isFeatureEnabled;return a.jsxs(Zt,{children:[a.jsx($g,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(Ot,{feature:"paramNegativeConditioning",placement:"right",children:a.jsx(da,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:l("parameters.negativePromptPlaceholder"),onChange:i,resize:"vertical",fontSize:"sm",minH:16,...m&&{onKeyDown:u}})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Tg,{onClick:o})})]})},FO=d.memo(_ce),jce=le([ge],({generation:e})=>({prompt:e.positivePrompt}),{memoizeOptions:{resultEqualityCheck:Bt}}),Ice=()=>{const e=te(),{prompt:t}=W(jce),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Lr(),{t:l}=Z(),i=d.useCallback(h=>{e(Fu(h.target.value))},[e]);tt("alt+a",()=>{var h;(h=n.current)==null||h.focus()},[]);const u=d.useCallback(h=>{if(!n.current)return;const g=n.current.selectionStart;if(g===void 0)return;let x=t.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=t.slice(g),Kr.flushSync(()=>{e(Fu(x))}),n.current.selectionStart=y,n.current.selectionEnd=y,o()},[e,o,t]),p=$t("embedding").isFeatureEnabled,m=d.useCallback(h=>{p&&h.key==="<"&&s()},[s,p]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(Zt,{children:a.jsx($g,{isOpen:r,onClose:o,onSelect:u,children:a.jsx(Ot,{feature:"paramPositiveConditioning",placement:"right",children:a.jsx(da,{id:"prompt",name:"prompt",ref:n,value:t,placeholder:l("parameters.positivePromptPlaceholder"),onChange:i,onKeyDown:m,resize:"vertical",minH:32})})})}),!r&&p&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Tg,{onClick:s})})]})},BO=d.memo(Ice);function Pce(){const e=W(o=>o.sdxl.shouldConcatSDXLStylePrompt),t=te(),{t:n}=Z(),r=()=>{t(hT(!e))};return a.jsx(Be,{"aria-label":n("sdxl.concatPromptStyle"),tooltip:n("sdxl.concatPromptStyle"),variant:"outline",isChecked:e,onClick:r,icon:a.jsx(yM,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const fj={position:"absolute",bg:"none",w:"full",minH:2,borderRadius:0,borderLeft:"none",borderRight:"none",zIndex:2,maskImage:"radial-gradient(circle at center, black, black 65%, black 30%, black 15%, transparent)"};function HO(){return a.jsxs(N,{children:[a.jsx(Ie,{as:jn.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"1px",borderTop:"none",borderColor:"base.400",...fj,_dark:{borderColor:"accent.500"}}}),a.jsx(Ie,{as:jn.div,initial:{opacity:0,scale:0},animate:{opacity:[0,1,1,1],scale:[0,.75,1.5,1],transition:{duration:.42,times:[0,.25,.5,1]}},exit:{opacity:0,scale:0},sx:{zIndex:3,position:"absolute",left:"48%",top:"3px",p:1,borderRadius:4,bg:"accent.400",color:"base.50",_dark:{bg:"accent.500"}},children:a.jsx(yM,{size:12})}),a.jsx(Ie,{as:jn.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"17px",borderBottom:"none",borderColor:"base.400",...fj,_dark:{borderColor:"accent.500"}}})]})}const Ece=le([ge],({sdxl:e})=>{const{negativeStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Mce=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:l,shouldConcatSDXLStylePrompt:i}=W(Ece),u=d.useCallback(g=>{e(Vu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=l.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=l.slice(x),Kr.flushSync(()=>{e(Vu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,l]),m=$t("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(dr,{children:i&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(HO,{})})}),a.jsx(Zt,{children:a.jsx($g,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:l,placeholder:s("sdxl.negStylePrompt"),onChange:u,onKeyDown:h,resize:"vertical",fontSize:"sm",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Tg,{onClick:o})})]})},Oce=d.memo(Mce),Dce=le([ge],({sdxl:e})=>{const{positiveStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Rce=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:l,shouldConcatSDXLStylePrompt:i}=W(Dce),u=d.useCallback(g=>{e(Hu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=l.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=l.slice(x),Kr.flushSync(()=>{e(Hu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,l]),m=$t("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(dr,{children:i&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(HO,{})})}),a.jsx(Zt,{children:a.jsx($g,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:l,placeholder:s("sdxl.posStylePrompt"),onChange:u,onKeyDown:h,resize:"vertical",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Tg,{onClick:o})})]})},Ace=d.memo(Rce);function d2(){return a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsx(BO,{}),a.jsx(Pce,{}),a.jsx(Ace,{}),a.jsx(FO,{}),a.jsx(Oce,{})]})}const di=()=>{const{isRefinerAvailable:e}=Qo(ub,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},Tce=le([ge],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},Ce),$ce=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=W(Tce),r=di(),o=te(),{t:s}=Z(),l=d.useCallback(u=>o(m1(u)),[o]),i=d.useCallback(()=>o(m1(7)),[o]);return t?a.jsx(rt,{label:s("sdxl.cfgScale"),step:n?.1:.5,min:1,max:20,onChange:l,handleReset:i,value:e,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!r}):a.jsx(Qc,{label:s("sdxl.cfgScale"),step:.5,min:1,max:200,onChange:l,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},Nce=d.memo($ce),Lce=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=gT.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data},zce=le(ge,e=>({model:e.sdxl.refinerModel}),Ce),Fce=()=>{const e=te(),t=$t("syncModels").isFeatureEnabled,{model:n}=W(zce),{t:r}=Z(),{data:o,isLoading:s}=Qo(ub),l=d.useMemo(()=>{if(!o)return[];const p=[];return Wn(o.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[o]),i=d.useMemo(()=>(o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])??null,[o==null?void 0:o.entities,n]),u=d.useCallback(p=>{if(!p)return;const m=Lce(p);m&&e(xI(m))},[e]);return s?a.jsx(nn,{label:r("sdxl.refinermodel"),placeholder:r("sdxl.loading"),disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{tooltip:i==null?void 0:i.description,label:r("sdxl.refinermodel"),value:i==null?void 0:i.id,placeholder:l.length>0?r("sdxl.selectAModel"):r("sdxl.noModelsAvailable"),data:l,error:l.length===0,disabled:l.length===0,onChange:u,w:"100%"}),t&&a.jsx(Ie,{mt:7,children:a.jsx(Xc,{iconMode:!0})})]})},Bce=d.memo(Fce),Hce=le([ge],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},Ce),Vce=()=>{const{refinerNegativeAestheticScore:e,shift:t}=W(Hce),n=di(),r=te(),{t:o}=Z(),s=d.useCallback(i=>r(g1(i)),[r]),l=d.useCallback(()=>r(g1(2.5)),[r]);return a.jsx(rt,{label:o("sdxl.negAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:l,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Wce=d.memo(Vce),Uce=le([ge],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},Ce),Gce=()=>{const{refinerPositiveAestheticScore:e,shift:t}=W(Uce),n=di(),r=te(),{t:o}=Z(),s=d.useCallback(i=>r(h1(i)),[r]),l=d.useCallback(()=>r(h1(6)),[r]);return a.jsx(rt,{label:o("sdxl.posAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:l,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Kce=d.memo(Gce),qce=le(ge,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=Sr(bh,(s,l)=>({value:l,label:s,group:r.includes(l)?"Favorites":void 0})).sort((s,l)=>s.label.localeCompare(l.label));return{refinerScheduler:n,data:o}},Ce),Xce=()=>{const e=te(),{t}=Z(),{refinerScheduler:n,data:r}=W(qce),o=di(),s=d.useCallback(l=>{l&&e(bI(l))},[e]);return a.jsx(nn,{w:"100%",label:t("sdxl.scheduler"),value:n,data:r,onChange:s,disabled:!o})},Qce=d.memo(Xce),Yce=le([ge],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},Ce),Zce=()=>{const{refinerStart:e}=W(Yce),t=te(),n=di(),r=d.useCallback(l=>t(v1(l)),[t]),{t:o}=Z(),s=d.useCallback(()=>t(v1(.8)),[t]);return a.jsx(rt,{label:o("sdxl.refinerStart"),step:.01,min:0,max:1,onChange:r,handleReset:s,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Jce=d.memo(Zce),eue=le([ge],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},Ce),tue=()=>{const{refinerSteps:e,shouldUseSliders:t}=W(eue),n=di(),r=te(),{t:o}=Z(),s=d.useCallback(i=>{r(p1(i))},[r]),l=d.useCallback(()=>{r(p1(20))},[r]);return t?a.jsx(rt,{label:o("sdxl.steps"),min:1,max:100,step:1,onChange:s,handleReset:l,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:500},isDisabled:!n}):a.jsx(Qc,{label:o("sdxl.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},nue=d.memo(tue);function rue(){const e=W(s=>s.sdxl.shouldUseSDXLRefiner),t=di(),n=te(),{t:r}=Z(),o=s=>{n(vT(s.target.checked))};return a.jsx(kn,{label:r("sdxl.useRefiner"),isChecked:e,onChange:o,isDisabled:!t})}const oue=le(ge,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},Ce),sue=()=>{const{activeLabel:e,shouldUseSliders:t}=W(oue),{t:n}=Z();return a.jsx(to,{label:n("sdxl.refiner"),activeLabel:e,children:a.jsxs(N,{sx:{gap:2,flexDir:"column"},children:[a.jsx(rue,{}),a.jsx(Bce,{}),a.jsxs(N,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(nue,{}),a.jsx(Nce,{})]}),a.jsx(Qce,{}),a.jsx(Kce,{}),a.jsx(Wce,{}),a.jsx(Jce,{})]})})},f2=d.memo(sue),aue=le([ge],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:l,inputMax:i}=t.sd.guidance,{cfgScale:u}=e,{shouldUseSliders:p}=n,{shift:m}=r;return{cfgScale:u,initial:o,min:s,sliderMax:l,inputMax:i,shouldUseSliders:p,shift:m}},Ce),lue=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:l}=W(aue),i=te(),{t:u}=Z(),p=d.useCallback(h=>i(em(h)),[i]),m=d.useCallback(()=>i(em(t)),[i,t]);return s?a.jsx(Ot,{feature:"paramCFGScale",children:a.jsx(rt,{label:u("parameters.cfgScale"),step:l?.1:.5,min:n,max:r,onChange:p,handleReset:m,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1})}):a.jsx(Ot,{feature:"paramCFGScale",children:a.jsx(Qc,{label:u("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})})},Is=d.memo(lue),iue=le(ge,e=>({model:e.generation.model}),Ce),cue=()=>{const e=te(),{t}=Z(),{model:n}=W(iue),r=$t("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Qo(kw),{data:l,isLoading:i}=Yu(kw),u=W(Zn),p=d.useMemo(()=>{if(!o)return[];const g=[];return Wn(o.entities,(x,y)=>{x&&g.push({value:y,label:x.model_name,group:pn[x.base_model]})}),Wn(l==null?void 0:l.entities,(x,y)=>{!x||u==="unifiedCanvas"||u==="img2img"||g.push({value:y,label:x.model_name,group:pn[x.base_model]})}),g},[o,l,u]),m=d.useMemo(()=>((o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])||(l==null?void 0:l.entities[`${n==null?void 0:n.base_model}/onnx/${n==null?void 0:n.model_name}`]))??null,[o==null?void 0:o.entities,n,l==null?void 0:l.entities]),h=d.useCallback(g=>{if(!g)return;const x=Ag(g);x&&e(d1(x))},[e]);return s||i?a.jsx(nn,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Ot,{feature:"paramModel",children:a.jsx(nn,{tooltip:m==null?void 0:m.description,label:t("modelManager.model"),value:m==null?void 0:m.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:p.length===0,disabled:p.length===0,onChange:h,w:"100%"})}),r&&a.jsx(Ie,{mt:6,children:a.jsx(Xc,{iconMode:!0})})]})},uue=d.memo(cue),due=le(ge,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},Ce),fue=()=>{const e=te(),{t}=Z(),{model:n,vae:r}=W(due),{data:o}=MI(),s=d.useMemo(()=>{if(!o)return[];const u=[{value:"default",label:"Default",group:"Default"}];return Wn(o.entities,(p,m)=>{if(!p)return;const h=(n==null?void 0:n.base_model)!==p.base_model;u.push({value:m,label:p.model_name,group:pn[p.base_model],disabled:h,tooltip:h?`Incompatible base model: ${p.base_model}`:void 0})}),u.sort((p,m)=>p.disabled&&!m.disabled?1:-1)},[o,n==null?void 0:n.base_model]),l=d.useMemo(()=>(o==null?void 0:o.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[o==null?void 0:o.entities,r]),i=d.useCallback(u=>{if(!u||u==="default"){e(_w(null));return}const p=RO(u);p&&e(_w(p))},[e]);return a.jsx(Ot,{feature:"paramVAE",children:a.jsx(nn,{itemComponent:fl,tooltip:l==null?void 0:l.description,label:t("modelManager.vae"),value:(l==null?void 0:l.id)??"default",placeholder:"Default",data:s,onChange:i,disabled:s.length===0,clearable:!0})})},pue=d.memo(fue),mue=le([RI,ss],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=Sr(bh,(s,l)=>({value:l,label:s,group:r.includes(l)?"Favorites":void 0})).sort((s,l)=>s.label.localeCompare(l.label));return{scheduler:n,data:o}},Ce),hue=()=>{const e=te(),{t}=Z(),{scheduler:n,data:r}=W(mue),o=d.useCallback(s=>{s&&e(f1(s))},[e]);return a.jsx(Ot,{feature:"paramScheduler",children:a.jsx(nn,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})})},gue=d.memo(hue),vue=le(ge,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},Ce),xue=["fp16","fp32"],bue=()=>{const{t:e}=Z(),t=te(),{vaePrecision:n}=W(vue),r=d.useCallback(o=>{o&&t(xT(o))},[t]);return a.jsx(Ot,{feature:"paramVAEPrecision",children:a.jsx(On,{label:e("modelManager.vaePrecision"),value:n,data:xue,onChange:r})})},yue=d.memo(bue),Cue=()=>{const e=$t("vae").isFeatureEnabled;return a.jsxs(N,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(uue,{})}),a.jsx(Ie,{w:"full",children:a.jsx(gue,{})}),e&&a.jsxs(N,{w:"full",gap:3,children:[a.jsx(pue,{}),a.jsx(yue,{})]})]})},Ps=d.memo(Cue),VO=[{name:bt.t("parameters.aspectRatioFree"),value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],WO=VO.map(e=>e.value);function UO(){const e=W(o=>o.generation.aspectRatio),t=te(),n=W(o=>o.generation.shouldFitToWidthHeight),r=W(Zn);return a.jsx(Ht,{isAttached:!0,children:VO.map(o=>a.jsx(ot,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(zo(o.value)),t(Zu(!1))},children:o.name},o.name))})}const wue=le([ge],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:l,coarseStep:i}=n.sd.height,{model:u,height:p}=e,{aspectRatio:m}=e,h=t.shift?l:i;return{model:u,height:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Ce),Sue=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:l,aspectRatio:i}=W(wue),u=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(u(Vl(x)),i){const y=Cr(x*i,8);u(Hl(y))}},[u,i]),g=d.useCallback(()=>{if(u(Vl(m)),i){const x=Cr(m*i,8);u(Hl(x))}},[u,m,i]);return a.jsx(rt,{label:p("parameters.height"),value:n,min:r,step:l,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},kue=d.memo(Sue),_ue=le([ge],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:l,coarseStep:i}=n.sd.width,{model:u,width:p,aspectRatio:m}=e,h=t.shift?l:i;return{model:u,width:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Ce),jue=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:l,aspectRatio:i}=W(_ue),u=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(u(Hl(x)),i){const y=Cr(x/i,8);u(Vl(y))}},[u,i]),g=d.useCallback(()=>{if(u(Hl(m)),i){const x=Cr(m/i,8);u(Vl(x))}},[u,m,i]);return a.jsx(rt,{label:p("parameters.width"),value:n,min:r,step:l,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Iue=d.memo(jue),Pue=le([ss,Zn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}},Ce);function Rc(){const{t:e}=Z(),t=te(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:l}=W(Pue),i=d.useCallback(()=>{o?(t(Zu(!1)),WO.includes(s/l)?t(zo(s/l)):t(zo(null))):(t(Zu(!0)),t(zo(s/l)))},[o,s,l,t]),u=d.useCallback(()=>{t(bT()),t(zo(null)),o&&t(zo(l/s))},[t,o,s,l]);return a.jsxs(N,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsx(Ot,{feature:"paramRatio",children:a.jsxs(Zt,{as:N,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(In,{children:e("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(UO,{}),a.jsx(Be,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(G8,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:u}),a.jsx(Be,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(CM,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:i})]})}),a.jsx(N,{gap:2,alignItems:"center",children:a.jsxs(N,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(Iue,{isDisabled:n==="img2img"?!r:!1}),a.jsx(kue,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Eue=le([ge],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:l,inputMax:i,fineStep:u,coarseStep:p}=t.sd.steps,{steps:m}=e,{shouldUseSliders:h}=n,g=r.shift?u:p;return{steps:m,initial:o,min:s,sliderMax:l,inputMax:i,step:g,shouldUseSliders:h}},Ce),Mue=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:l}=W(Eue),i=te(),{t:u}=Z(),p=d.useCallback(g=>{i(tm(g))},[i]),m=d.useCallback(()=>{i(tm(t))},[i,t]),h=d.useCallback(()=>{i(ib())},[i]);return l?a.jsx(Ot,{feature:"paramSteps",children:a.jsx(rt,{label:u("parameters.steps"),min:n,max:r,step:s,onChange:p,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}})}):a.jsx(Ot,{feature:"paramSteps",children:a.jsx(Qc,{label:u("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:h})})},Es=d.memo(Mue);function GO(){const e=te(),t=W(o=>o.generation.shouldFitToWidthHeight),n=o=>e(yT(o.target.checked)),{t:r}=Z();return a.jsx(kn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function Oue(){const e=W(l=>l.generation.seed),t=W(l=>l.generation.shouldRandomizeSeed),n=W(l=>l.generation.shouldGenerateVariations),{t:r}=Z(),o=te(),s=l=>o(Jp(l));return a.jsx(Qc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:AI,max:TI,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const Due=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function Rue(){const e=te(),t=W(o=>o.generation.shouldRandomizeSeed),{t:n}=Z(),r=()=>e(Jp(Due(AI,TI)));return a.jsx(Be,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(iee,{})})}const Aue=()=>{const e=te(),{t}=Z(),n=W(o=>o.generation.shouldRandomizeSeed),r=o=>e(CT(o.target.checked));return a.jsx(kn,{label:t("common.random"),isChecked:n,onChange:r})},Tue=d.memo(Aue),$ue=()=>a.jsx(Ot,{feature:"paramSeed",children:a.jsxs(N,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(Oue,{}),a.jsx(Rue,{}),a.jsx(Tue,{})]})}),Ms=d.memo($ue),KO=_e((e,t)=>a.jsxs(N,{ref:t,sx:{flexDir:"column",gap:2,bg:"base.100",px:4,pt:2,pb:4,borderRadius:"base",_dark:{bg:"base.750"}},children:[a.jsx(be,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]}));KO.displayName="SubSettingsWrapper";const Ac=d.memo(KO),Nue=le([ge],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},Ce),Lue=()=>{const{sdxlImg2ImgDenoisingStrength:e}=W(Nue),t=te(),{t:n}=Z(),r=d.useCallback(s=>t(jw(s)),[t]),o=d.useCallback(()=>{t(jw(.7))},[t]);return a.jsx(Ot,{feature:"paramDenoisingStrength",children:a.jsx(Ac,{children:a.jsx(rt,{label:n("sdxl.denoisingStrength"),step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})})},qO=d.memo(Lue),zue=le([RI,ss],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),Fue=()=>{const{t:e}=Z(),{shouldUseSliders:t,activeLabel:n}=W(zue);return a.jsx(to,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Rc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Rc,{})]}),a.jsx(qO,{}),a.jsx(GO,{})]})})},Bue=d.memo(Fue),Hue=()=>a.jsxs(a.Fragment,{children:[a.jsx(d2,{}),a.jsx(Bue,{}),a.jsx(f2,{}),a.jsx(eu,{}),a.jsx(Zc,{}),a.jsx(Yc,{}),a.jsx(Jc,{})]}),Vue=d.memo(Hue),p2=()=>{const{t:e}=Z(),t=W(l=>l.generation.shouldRandomizeSeed),n=W(l=>l.generation.iterations),r=d.useMemo(()=>n===1?e("parameters.iterationsWithCount_one",{count:1}):e("parameters.iterationsWithCount_other",{count:n}),[n,e]),o=d.useMemo(()=>e(t?"parameters.randomSeed":"parameters.manualSeed"),[t,e]);return{iterationsAndSeedLabel:d.useMemo(()=>[r,o].join(", "),[r,o]),iterationsLabel:r,seedLabel:o}},Wue=()=>{const{t:e}=Z(),t=W(r=>r.ui.shouldUseSliders),{iterationsAndSeedLabel:n}=p2();return a.jsx(to,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsx(N,{sx:{flexDirection:"column",gap:3},children:t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Rc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Rc,{})]})})})},XO=d.memo(Wue),Uue=()=>a.jsxs(a.Fragment,{children:[a.jsx(d2,{}),a.jsx(XO,{}),a.jsx(f2,{}),a.jsx(eu,{}),a.jsx(Zc,{}),a.jsx(Yc,{}),a.jsx(Jc,{})]}),Gue=d.memo(Uue),Kue=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],que=()=>{const e=te(),t=W(o=>o.generation.canvasCoherenceMode),{t:n}=Z(),r=o=>{o&&e(wT(o))};return a.jsx(Ot,{feature:"compositingCoherenceMode",children:a.jsx(On,{label:n("parameters.coherenceMode"),data:Kue,value:t,onChange:r})})},Xue=d.memo(que),Que=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceSteps),{t:n}=Z();return a.jsx(Ot,{feature:"compositingCoherenceSteps",children:a.jsx(rt,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(Iw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Iw(20))}})})},Yue=d.memo(Que),Zue=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceStrength),{t:n}=Z();return a.jsx(Ot,{feature:"compositingStrength",children:a.jsx(rt,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(Pw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Pw(.3))}})})},Jue=d.memo(Zue);function ede(){const e=te(),t=W(r=>r.generation.maskBlur),{t:n}=Z();return a.jsx(Ot,{feature:"compositingBlur",children:a.jsx(rt,{label:n("parameters.maskBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Ew(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Ew(16))}})})}const tde=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function nde(){const e=W(o=>o.generation.maskBlurMethod),t=te(),{t:n}=Z(),r=o=>{o&&t(ST(o))};return a.jsx(Ot,{feature:"compositingBlurMethod",children:a.jsx(On,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:tde})})}const rde=()=>{const{t:e}=Z();return a.jsx(to,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Ac,{label:e("parameters.coherencePassHeader"),children:[a.jsx(Xue,{}),a.jsx(Yue,{}),a.jsx(Jue,{})]}),a.jsx(Yn,{}),a.jsxs(Ac,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(ede,{}),a.jsx(nde,{})]})]})})},QO=d.memo(rde),ode=le([ge],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce),sde=()=>{const e=te(),{infillMethod:t}=W(ode),{data:n,isLoading:r}=cI(),o=n==null?void 0:n.infill_methods,{t:s}=Z(),l=d.useCallback(i=>{e(kT(i))},[e]);return a.jsx(Ot,{feature:"infillMethod",children:a.jsx(On,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:l})})},ade=d.memo(sde),lde=le([ss],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},Ce),ide=()=>{const e=te(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=W(lde),{t:r}=Z(),o=d.useCallback(l=>{e(Mw(l))},[e]),s=d.useCallback(()=>{e(Mw(2))},[e]);return a.jsx(rt,{isDisabled:n!=="patchmatch",label:r("parameters.patchmatchDownScaleSize"),min:1,max:10,value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},cde=d.memo(ide),ude=le([ss],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},Ce),dde=()=>{const e=te(),{infillTileSize:t,infillMethod:n}=W(ude),{t:r}=Z(),o=d.useCallback(l=>{e(Ow(l))},[e]),s=d.useCallback(()=>{e(Ow(32))},[e]);return a.jsx(rt,{isDisabled:n!=="tile",label:r("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},fde=d.memo(dde),pde=le([ss],e=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce);function mde(){const{infillMethod:e}=W(pde);return a.jsxs(N,{children:[e==="tile"&&a.jsx(fde,{}),e==="patchmatch"&&a.jsx(cde,{})]})}const Cn=e=>e.canvas,Eo=le([ge],({canvas:e})=>e.batchIds.length>0||e.layerState.stagingArea.images.length>0),hde=le([Cn],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Ce),gde=()=>{const e=te(),{boundingBoxScale:t}=W(hde),{t:n}=Z(),r=o=>{e(jT(o))};return a.jsx(Ot,{feature:"scaleBeforeProcessing",children:a.jsx(nn,{label:n("parameters.scaleBeforeProcessing"),data:_T,value:t,onChange:r})})},vde=d.memo(gde),xde=le([ss,Cn],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o,aspectRatio:s}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual",aspectRatio:s}},Ce),bde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(xde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:l}=Z(),i=p=>{let m=r.width;const h=Math.floor(p);o&&(m=Cr(h*o,64)),e(om({width:m,height:h}))},u=()=>{let p=r.width;const m=Math.floor(s);o&&(p=Cr(m*o,64)),e(om({width:p,height:m}))};return a.jsx(rt,{isDisabled:!n,label:l("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},yde=d.memo(bde),Cde=le([Cn,ss],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,scaledBoundingBoxDimensions:r,aspectRatio:s,isManual:n==="manual"}},Ce),wde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(Cde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:l}=Z(),i=p=>{const m=Math.floor(p);let h=r.height;o&&(h=Cr(m/o,64)),e(om({width:m,height:h}))},u=()=>{const p=Math.floor(s);let m=r.height;o&&(m=Cr(p/o,64)),e(om({width:p,height:m}))};return a.jsx(rt,{isDisabled:!n,label:l("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Sde=d.memo(wde),kde=()=>{const{t:e}=Z();return a.jsx(to,{label:e("parameters.infillScalingHeader"),children:a.jsxs(N,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Ac,{children:[a.jsx(ade,{}),a.jsx(mde,{})]}),a.jsx(Yn,{}),a.jsxs(Ac,{children:[a.jsx(vde,{}),a.jsx(Sde,{}),a.jsx(yde,{})]})]})})},YO=d.memo(kde),_de=le([ge,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Ce),jde=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(_de),{t:s}=Z(),l=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,i=p=>{if(e(Wo({...n,height:Math.floor(p)})),o){const m=Cr(p*o,64);e(Wo({width:m,height:Math.floor(p)}))}},u=()=>{if(e(Wo({...n,height:Math.floor(l)})),o){const p=Cr(l*o,64);e(Wo({width:p,height:Math.floor(l)}))}};return a.jsx(rt,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:i,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Ide=d.memo(jde),Pde=le([ge,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Ce),Ede=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(Pde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:l}=Z(),i=p=>{if(e(Wo({...n,width:Math.floor(p)})),o){const m=Cr(p/o,64);e(Wo({width:Math.floor(p),height:m}))}},u=()=>{if(e(Wo({...n,width:Math.floor(s)})),o){const p=Cr(s/o,64);e(Wo({width:Math.floor(s),height:p}))}};return a.jsx(rt,{label:l("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:i,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Mde=d.memo(Ede),Ode=le([ss,Cn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function hh(){const e=te(),{t}=Z(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=W(Ode),o=d.useCallback(()=>{n?(e(Zu(!1)),WO.includes(r.width/r.height)?e(zo(r.width/r.height)):e(zo(null))):(e(Zu(!0)),e(zo(r.width/r.height)))},[n,r,e]),s=d.useCallback(()=>{e(IT()),e(zo(null)),n&&e(zo(r.height/r.width))},[e,n,r]);return a.jsxs(N,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsx(Ot,{feature:"paramRatio",children:a.jsxs(Zt,{as:N,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(In,{children:t("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(UO,{}),a.jsx(Be,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(G8,{}),fontSize:20,onClick:s}),a.jsx(Be,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(CM,{}),isChecked:n,onClick:o})]})}),a.jsx(Mde,{}),a.jsx(Ide,{})]})}const Dde=le(ge,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),Rde=()=>{const{t:e}=Z(),{shouldUseSliders:t,activeLabel:n}=W(Dde);return a.jsx(to,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(hh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(hh,{})]}),a.jsx(qO,{})]})})},Ade=d.memo(Rde);function Tde(){return a.jsxs(a.Fragment,{children:[a.jsx(d2,{}),a.jsx(Ade,{}),a.jsx(f2,{}),a.jsx(eu,{}),a.jsx(Zc,{}),a.jsx(Yc,{}),a.jsx(YO,{}),a.jsx(QO,{}),a.jsx(Jc,{})]})}function m2(){return a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsx(BO,{}),a.jsx(FO,{})]})}function $de(){const e=W(o=>o.generation.horizontalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(rt,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(Dw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Dw(0))})}function Nde(){const e=W(o=>o.generation.verticalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(rt,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(Rw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Rw(0))})}function Lde(){const e=W(n=>n.generation.shouldUseSymmetry),t=te();return a.jsx(kn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(PT(n.target.checked))})}const zde=le(ge,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Ce),Fde=()=>{const{t:e}=Z(),{activeLabel:t}=W(zde);return $t("symmetry").isFeatureEnabled?a.jsx(to,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs(N,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(Lde,{}),a.jsx($de,{}),a.jsx(Nde,{})]})}):null},h2=d.memo(Fde),Bde=le([ge],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:l,fineStep:i,coarseStep:u}=n.sd.img2imgStrength,{img2imgStrength:p}=e,m=t.shift?i:u;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:l,step:m}},Ce),Hde=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=W(Bde),l=te(),{t:i}=Z(),u=d.useCallback(m=>l(nm(m)),[l]),p=d.useCallback(()=>{l(nm(t))},[l,t]);return a.jsx(Ot,{feature:"paramDenoisingStrength",children:a.jsx(Ac,{children:a.jsx(rt,{label:`${i("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:u,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})})})},ZO=d.memo(Hde),Vde=()=>{const{t:e}=Z(),t=W(r=>r.ui.shouldUseSliders),{iterationsAndSeedLabel:n}=p2();return a.jsx(to,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Rc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Rc,{})]}),a.jsx(ZO,{}),a.jsx(GO,{})]})})},Wde=d.memo(Vde),Ude=()=>a.jsxs(a.Fragment,{children:[a.jsx(m2,{}),a.jsx(Wde,{}),a.jsx(eu,{}),a.jsx(Zc,{}),a.jsx(Yc,{}),a.jsx(h2,{}),a.jsx(Jc,{})]}),Gde=d.memo(Ude),Kde=()=>a.jsxs(a.Fragment,{children:[a.jsx(m2,{}),a.jsx(XO,{}),a.jsx(eu,{}),a.jsx(Zc,{}),a.jsx(Yc,{}),a.jsx(h2,{}),a.jsx(Jc,{})]}),qde=d.memo(Kde),Xde=()=>{const{t:e}=Z(),t=W(r=>r.ui.shouldUseSliders),{iterationsAndSeedLabel:n}=p2();return a.jsx(to,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(hh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(hh,{})]}),a.jsx(ZO,{})]})})},Qde=d.memo(Xde),Yde=()=>a.jsxs(a.Fragment,{children:[a.jsx(m2,{}),a.jsx(Qde,{}),a.jsx(eu,{}),a.jsx(Zc,{}),a.jsx(Yc,{}),a.jsx(h2,{}),a.jsx(YO,{}),a.jsx(QO,{}),a.jsx(Jc,{})]}),Zde=d.memo(Yde),Jde=()=>{const e=W(Zn),t=W(n=>n.generation.model);return e==="txt2img"?a.jsx(Yp,{children:t&&t.base_model==="sdxl"?a.jsx(Gue,{}):a.jsx(qde,{})}):e==="img2img"?a.jsx(Yp,{children:t&&t.base_model==="sdxl"?a.jsx(Vue,{}):a.jsx(Gde,{})}):e==="unifiedCanvas"?a.jsx(Yp,{children:t&&t.base_model==="sdxl"?a.jsx(Tde,{}):a.jsx(Zde,{})}):null},efe=d.memo(Jde),Yp=d.memo(e=>a.jsxs(N,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(rO,{}),a.jsx(N,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx(N,{sx:{w:"full",h:"full",position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(xg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:800,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:a.jsx(N,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));Yp.displayName="ParametersPanelWrapper";const tfe=le([ge],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},Ce),nfe=()=>{const{initialImage:e}=W(tfe),{currentData:t}=wo((e==null?void 0:e.imageName)??Zr.skipToken),n=d.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),r=d.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(sl,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(tr,{label:"No initial image selected"}),dataTestId:"initial-image"})},rfe=d.memo(nfe),ofe=le([ge],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},Ce),sfe={type:"SET_INITIAL_IMAGE"},afe=()=>{const{isResetButtonDisabled:e}=W(ofe),t=te(),{getUploadButtonProps:n,getUploadInputProps:r}=Qy({postUploadAction:sfe}),o=d.useCallback(()=>{t(ET())},[t]);return a.jsxs(N,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs(N,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(be,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(ba,{}),a.jsx(Be,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(fg,{}),...n()}),a.jsx(Be,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(dg,{}),onClick:o,isDisabled:e})]}),a.jsx(rfe,{}),a.jsx("input",{...r()})]})},lfe=d.memo(afe),ife=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=Z(),o=W(s=>s.system.isConnected);return a.jsx(Be,{onClick:t,icon:a.jsx(Fr,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},JO=()=>{const[e,{isLoading:t}]=Sh({fixedCacheKey:"enqueueBatch"}),[n,{isLoading:r}]=MT({fixedCacheKey:"enqueueGraph"}),[o,{isLoading:s}]=PI({fixedCacheKey:"resumeProcessor"}),[l,{isLoading:i}]=jI({fixedCacheKey:"pauseProcessor"}),[u,{isLoading:p}]=sb({fixedCacheKey:"cancelQueueItem"}),[m,{isLoading:h}]=_I({fixedCacheKey:"clearQueue"}),[g,{isLoading:x}]=$I({fixedCacheKey:"pruneQueue"});return t||r||s||i||p||h||x},cfe=[{label:"RealESRGAN x2 Plus",value:"RealESRGAN_x2plus.pth",tooltip:"Attempts to retain sharpness, low smoothing",group:"x2 Upscalers"},{label:"RealESRGAN x4 Plus",value:"RealESRGAN_x4plus.pth",tooltip:"Best for photos and highly detailed images, medium smoothing",group:"x4 Upscalers"},{label:"RealESRGAN x4 Plus (anime 6B)",value:"RealESRGAN_x4plus_anime_6B.pth",tooltip:"Best for anime/manga, high smoothing",group:"x4 Upscalers"},{label:"ESRGAN SRx4",value:"ESRGAN_SRx4_DF2KOST_official-ff704c30.pth",tooltip:"Retains sharpness, low smoothing",group:"x4 Upscalers"}];function ufe(){const e=W(r=>r.postprocessing.esrganModelName),t=te(),n=r=>t(OT(r));return a.jsx(On,{label:"ESRGAN Model",value:e,itemComponent:fl,onChange:n,data:cfe})}const dfe=e=>{const{imageDTO:t}=e,n=te(),r=JO(),{t:o}=Z(),{isOpen:s,onOpen:l,onClose:i}=Lr(),{isAllowedToUpscale:u,detail:p}=DT(t),m=d.useCallback(()=>{i(),!(!t||!u)&&n(NI({imageDTO:t}))},[n,t,u,i]);return a.jsx(Qd,{isOpen:s,onClose:i,triggerComponent:a.jsx(Be,{tooltip:o("parameters.upscale"),onClick:l,icon:a.jsx(vM,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs(N,{sx:{flexDirection:"column",gap:4},children:[a.jsx(ufe,{}),a.jsx(ot,{tooltip:p,size:"sm",isDisabled:!t||r||!u,onClick:m,children:o("parameters.upscaleImage")})]})})},ffe=d.memo(dfe),pfe=le([ge,Zn],({gallery:e,system:t,ui:n,config:r},o)=>{const{isConnected:s,shouldConfirmOnDelete:l,denoiseProgress:i}=t,{shouldShowImageDetails:u,shouldHidePreview:p,shouldShowProgressInViewer:m}=n,{shouldFetchMetadataFromApi:h}=r,g=e.selection[e.selection.length-1];return{shouldConfirmOnDelete:l,isConnected:s,shouldDisableToolbarButtons:!!(i!=null&&i.progress_image)||!g,shouldShowImageDetails:u,activeTabName:o,shouldHidePreview:p,shouldShowProgressInViewer:m,lastSelectedImage:g,shouldFetchMetadataFromApi:h}},{memoizeOptions:{resultEqualityCheck:Bt}}),mfe=()=>{const e=te(),{isConnected:t,shouldDisableToolbarButtons:n,shouldShowImageDetails:r,lastSelectedImage:o,shouldShowProgressInViewer:s,shouldFetchMetadataFromApi:l}=W(pfe),i=$t("upscaling").isFeatureEnabled,u=JO(),p=si(),{t:m}=Z(),{recallBothPrompts:h,recallSeed:g,recallAllParameters:x}=jg(),{currentData:y}=wo((o==null?void 0:o.image_name)??Zr.skipToken),b=d.useMemo(()=>o?{image:o,shouldFetchMetadataFromApi:l}:Zr.skipToken,[o,l]),{metadata:C,workflow:S,isLoading:_}=eb(b,{selectFromResult:X=>{var z,V;return{isLoading:X.isFetching,metadata:(z=X==null?void 0:X.currentData)==null?void 0:z.metadata,workflow:(V=X==null?void 0:X.currentData)==null?void 0:V.workflow}}}),j=d.useCallback(()=>{S&&e(rb(S))},[e,S]),E=d.useCallback(()=>{x(C)},[C,x]);tt("a",E,[C]);const I=d.useCallback(()=>{g(C==null?void 0:C.seed)},[C==null?void 0:C.seed,g]);tt("s",I,[y]);const M=d.useCallback(()=>{h(C==null?void 0:C.positive_prompt,C==null?void 0:C.negative_prompt,C==null?void 0:C.positive_style_prompt,C==null?void 0:C.negative_style_prompt)},[C==null?void 0:C.negative_prompt,C==null?void 0:C.positive_prompt,C==null?void 0:C.positive_style_prompt,C==null?void 0:C.negative_style_prompt,h]);tt("p",M,[y]),tt("w",j,[S]);const D=d.useCallback(()=>{e(K8()),e(Ch(y))},[e,y]);tt("shift+i",D,[y]);const R=d.useCallback(()=>{y&&e(NI({imageDTO:y}))},[e,y]),A=d.useCallback(()=>{y&&e(wh([y]))},[e,y]);tt("Shift+U",()=>{R()},{enabled:()=>!!(i&&!n&&t)},[i,y,n,t]);const O=d.useCallback(()=>e(RT(!r)),[e,r]);tt("i",()=>{y?O():p({title:m("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[y,r,p]),tt("delete",()=>{A()},[e,y]);const $=d.useCallback(()=>{e(uI(!s))},[e,s]);return a.jsx(a.Fragment,{children:a.jsxs(N,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(Ht,{isAttached:!0,isDisabled:n,children:a.jsxs(Nh,{isLazy:!0,children:[a.jsx(Lh,{as:Be,"aria-label":m("parameters.imageActions"),tooltip:m("parameters.imageActions"),isDisabled:!y,icon:a.jsx(Poe,{})}),a.jsx(Gl,{motionProps:bc,children:y&&a.jsx(q8,{imageDTO:y})})]})}),a.jsxs(Ht,{isAttached:!0,isDisabled:n,children:[a.jsx(Be,{isLoading:_,icon:a.jsx(Yy,{}),tooltip:`${m("nodes.loadWorkflow")} (W)`,"aria-label":`${m("nodes.loadWorkflow")} (W)`,isDisabled:!S,onClick:j}),a.jsx(Be,{isLoading:_,icon:a.jsx(SM,{}),tooltip:`${m("parameters.usePrompt")} (P)`,"aria-label":`${m("parameters.usePrompt")} (P)`,isDisabled:!(C!=null&&C.positive_prompt),onClick:M}),a.jsx(Be,{isLoading:_,icon:a.jsx(kM,{}),tooltip:`${m("parameters.useSeed")} (S)`,"aria-label":`${m("parameters.useSeed")} (S)`,isDisabled:(C==null?void 0:C.seed)===null||(C==null?void 0:C.seed)===void 0,onClick:I}),a.jsx(Be,{isLoading:_,icon:a.jsx(pM,{}),tooltip:`${m("parameters.useAll")} (A)`,"aria-label":`${m("parameters.useAll")} (A)`,isDisabled:!C,onClick:E})]}),i&&a.jsx(Ht,{isAttached:!0,isDisabled:u,children:i&&a.jsx(ffe,{imageDTO:y})}),a.jsx(Ht,{isAttached:!0,children:a.jsx(Be,{icon:a.jsx(hM,{}),tooltip:`${m("parameters.info")} (I)`,"aria-label":`${m("parameters.info")} (I)`,isChecked:r,onClick:O})}),a.jsx(Ht,{isAttached:!0,children:a.jsx(Be,{"aria-label":m("settings.displayInProgress"),tooltip:m("settings.displayInProgress"),icon:a.jsx(JJ,{}),isChecked:s,onClick:$})}),a.jsx(Ht,{isAttached:!0,children:a.jsx(ife,{onClick:A})})]})})},hfe=d.memo(mfe),gfe=le([ge,ob],(e,t)=>{var _,j;const{data:n,status:r}=AT.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?Aw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):Aw.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(e),s=e.gallery.selection[e.gallery.selection.length-1],l=r==="pending";if(!n||!s||(o==null?void 0:o.total)===0)return{isFetching:l,queryArgs:t,isOnFirstImage:!0,isOnLastImage:!0};const i={...t,offset:n.ids.length,limit:kI},u=TT.getSelectors(),p=u.selectAll(n),m=p.findIndex(E=>E.image_name===s.image_name),h=Bl(m+1,0,p.length-1),g=Bl(m-1,0,p.length-1),x=(_=p[h])==null?void 0:_.image_name,y=(j=p[g])==null?void 0:j.image_name,b=x?u.selectById(n,x):void 0,C=y?u.selectById(n,y):void 0,S=p.length;return{loadedImagesCount:p.length,currentImageIndex:m,areMoreImagesAvailable:((o==null?void 0:o.total)??0)>S,isFetching:r==="pending",nextImage:b,prevImage:C,queryArgs:i}},{memoizeOptions:{resultEqualityCheck:Bt}}),e7=()=>{const e=te(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:l,currentImageIndex:i}=W(gfe),u=d.useCallback(()=>{n&&e(Tw(n))},[e,n]),p=d.useCallback(()=>{t&&e(Tw(t))},[e,t]),[m]=SI(),h=d.useCallback(()=>{m(s)},[m,s]);return{handlePrevImage:u,handleNextImage:p,isOnFirstImage:i===0,isOnLastImage:i!==void 0&&i===l-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:h,isFetching:o}};function vfe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const xfe=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:l}=Z();return t?a.jsxs(N,{gap:2,children:[n&&a.jsx(Vt,{label:`Recall ${e}`,children:a.jsx(Cs,{"aria-label":l("accessibility.useThisParameter"),icon:a.jsx(vfe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Vt,{label:`Copy ${e}`,children:a.jsx(Cs,{"aria-label":`Copy ${e}`,icon:a.jsx(Uc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs(N,{direction:o?"column":"row",children:[a.jsxs(be,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Th,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(a8,{mx:"2px"})]}):a.jsx(be,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},lr=d.memo(xfe),bfe=e=>{const{metadata:t}=e,{t:n}=Z(),{recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallCfgScale:l,recallModel:i,recallScheduler:u,recallSteps:p,recallWidth:m,recallHeight:h,recallStrength:g,recallLoRA:x,recallControlNet:y,recallIPAdapter:b,recallT2IAdapter:C}=jg(),S=d.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),_=d.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),j=d.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),E=d.useCallback(()=>{i(t==null?void 0:t.model)},[t==null?void 0:t.model,i]),I=d.useCallback(()=>{m(t==null?void 0:t.width)},[t==null?void 0:t.width,m]),M=d.useCallback(()=>{h(t==null?void 0:t.height)},[t==null?void 0:t.height,h]),D=d.useCallback(()=>{u(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,u]),R=d.useCallback(()=>{p(t==null?void 0:t.steps)},[t==null?void 0:t.steps,p]),A=d.useCallback(()=>{l(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,l]),O=d.useCallback(()=>{g(t==null?void 0:t.strength)},[t==null?void 0:t.strength,g]),$=d.useCallback(U=>{x(U)},[x]),X=d.useCallback(U=>{y(U)},[y]),z=d.useCallback(U=>{b(U)},[b]),V=d.useCallback(U=>{C(U)},[C]),Q=d.useMemo(()=>t!=null&&t.controlnets?t.controlnets.filter(U=>rm(U.control_model)):[],[t==null?void 0:t.controlnets]),G=d.useMemo(()=>t!=null&&t.ipAdapters?t.ipAdapters.filter(U=>rm(U.ip_adapter_model)):[],[t==null?void 0:t.ipAdapters]),F=d.useMemo(()=>t!=null&&t.t2iAdapters?t.t2iAdapters.filter(U=>$T(U.t2i_adapter_model)):[],[t==null?void 0:t.t2iAdapters]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx(lr,{label:n("metadata.createdBy"),value:t.created_by}),t.generation_mode&&a.jsx(lr,{label:n("metadata.generationMode"),value:t.generation_mode}),t.positive_prompt&&a.jsx(lr,{label:n("metadata.positivePrompt"),labelPosition:"top",value:t.positive_prompt,onClick:S}),t.negative_prompt&&a.jsx(lr,{label:n("metadata.negativePrompt"),labelPosition:"top",value:t.negative_prompt,onClick:_}),t.seed!==void 0&&t.seed!==null&&a.jsx(lr,{label:n("metadata.seed"),value:t.seed,onClick:j}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx(lr,{label:n("metadata.model"),value:t.model.model_name,onClick:E}),t.width&&a.jsx(lr,{label:n("metadata.width"),value:t.width,onClick:I}),t.height&&a.jsx(lr,{label:n("metadata.height"),value:t.height,onClick:M}),t.scheduler&&a.jsx(lr,{label:n("metadata.scheduler"),value:t.scheduler,onClick:D}),t.steps&&a.jsx(lr,{label:n("metadata.steps"),value:t.steps,onClick:R}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(lr,{label:n("metadata.cfgScale"),value:t.cfg_scale,onClick:A}),t.strength&&a.jsx(lr,{label:n("metadata.strength"),value:t.strength,onClick:O}),t.loras&&t.loras.map((U,T)=>{if(mI(U.lora))return a.jsx(lr,{label:"LoRA",value:`${U.lora.model_name} - ${U.weight}`,onClick:()=>$(U)},T)}),Q.map((U,T)=>{var B;return a.jsx(lr,{label:"ControlNet",value:`${(B=U.control_model)==null?void 0:B.model_name} - ${U.control_weight}`,onClick:()=>X(U)},T)}),G.map((U,T)=>{var B;return a.jsx(lr,{label:"IP Adapter",value:`${(B=U.ip_adapter_model)==null?void 0:B.model_name} - ${U.weight}`,onClick:()=>z(U)},T)}),F.map((U,T)=>{var B;return a.jsx(lr,{label:"T2I Adapter",value:`${(B=U.t2i_adapter_model)==null?void 0:B.model_name} - ${U.weight}`,onClick:()=>V(U)},T)})]})},yfe=d.memo(bfe),Cfe=({image:e})=>{const{t}=Z(),{shouldFetchMetadataFromApi:n}=W(e2),{metadata:r,workflow:o}=eb({image:e,shouldFetchMetadataFromApi:n},{selectFromResult:s=>{var l,i;return{metadata:(l=s==null?void 0:s.currentData)==null?void 0:l.metadata,workflow:(i=s==null?void 0:s.currentData)==null?void 0:i.workflow}}});return a.jsxs(N,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs(N,{gap:2,children:[a.jsx(be,{fontWeight:"semibold",children:"File:"}),a.jsxs(Th,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(a8,{mx:"2px"})]})]}),a.jsx(yfe,{metadata:r}),a.jsxs(ri,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(oi,{children:[a.jsx($r,{children:t("metadata.metadata")}),a.jsx($r,{children:t("metadata.imageDetails")}),a.jsx($r,{children:t("metadata.workflow")})]}),a.jsxs(Hc,{children:[a.jsx(Co,{children:r?a.jsx(Za,{data:r,label:t("metadata.metadata")}):a.jsx(tr,{label:t("metadata.noMetaData")})}),a.jsx(Co,{children:e?a.jsx(Za,{data:e,label:t("metadata.imageDetails")}):a.jsx(tr,{label:t("metadata.noImageDetails")})}),a.jsx(Co,{children:o?a.jsx(Za,{data:o,label:t("metadata.workflow")}):a.jsx(tr,{label:t("nodes.noWorkflow")})})]})]})]})},wfe=d.memo(Cfe),t1={color:"base.100",pointerEvents:"auto"},Sfe=()=>{const{t:e}=Z(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:l,isFetching:i}=e7();return a.jsxs(Ie,{sx:{position:"relative",height:"100%",width:"100%"},children:[a.jsx(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineStart:0},children:!r&&a.jsx(Cs,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(AJ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:t1})}),a.jsxs(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(Cs,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(TJ,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:t1}),o&&l&&!i&&a.jsx(Cs,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(RJ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:t1}),o&&l&&i&&a.jsx(N,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(fa,{opacity:.5,size:"xl"})})]})]})},t7=d.memo(Sfe),kfe=le([ge,NT],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{denoiseProgress:l,shouldAntialiasProgressImage:i}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,denoiseProgress:l,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:i}},{memoizeOptions:{resultEqualityCheck:Bt}}),_fe=()=>{const{shouldShowImageDetails:e,imageName:t,denoiseProgress:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=W(kfe),{handlePrevImage:s,handleNextImage:l,isOnLastImage:i,handleLoadMoreImages:u,areMoreImagesAvailable:p,isFetching:m}=e7();tt("left",()=>{s()},[s]),tt("right",()=>{if(i&&p&&!m){u();return}i||l()},[i,p,u,m,l]);const{currentData:h}=wo(t??Zr.skipToken),g=d.useMemo(()=>{if(h)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:h}}},[h]),x=d.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,b]=d.useState(!1),C=d.useRef(0),{t:S}=Z(),_=d.useCallback(()=>{b(!0),window.clearTimeout(C.current)},[]),j=d.useCallback(()=>{C.current=window.setTimeout(()=>{b(!1)},500)},[]);return a.jsxs(N,{onMouseOver:_,onMouseOut:j,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n!=null&&n.progress_image&&r?a.jsx(ga,{src:n.progress_image.dataURL,width:n.progress_image.width,height:n.progress_image.height,draggable:!1,"data-testid":"progress-image",sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(sl,{imageDTO:h,droppableData:x,draggableData:g,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:S("gallery.setCurrentImage"),noContentFallback:a.jsx(tr,{icon:Yl,label:"No image selected"}),dataTestId:"image-preview"}),e&&h&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(wfe,{image:h})}),a.jsx(dr,{children:!e&&h&&y&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:"0",width:"100%",height:"100%",pointerEvents:"none"},children:a.jsx(t7,{})},"nextPrevButtons")})]})},jfe=d.memo(_fe),Ife=()=>a.jsxs(N,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(hfe,{}),a.jsx(jfe,{})]}),Pfe=d.memo(Ife),Efe=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx(N,{sx:{width:"100%",height:"100%"},children:a.jsx(Pfe,{})})}),n7=d.memo(Efe),Mfe=()=>{const e=d.useRef(null),t=d.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=a2();return a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsxs(Mg,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Ya,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(lfe,{})}),a.jsx(ph,{onDoubleClick:t}),a.jsx(Ya,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(n7,{})})]})})},Ofe=d.memo(Mfe);var Dfe=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var l=s[o];if(!e(t[l],n[l]))return!1}return!0}return t!==t&&n!==n};const pj=Cd(Dfe);function Dx(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var Rfe=Object.defineProperty,mj=Object.getOwnPropertySymbols,Afe=Object.prototype.hasOwnProperty,Tfe=Object.prototype.propertyIsEnumerable,hj=(e,t,n)=>t in e?Rfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$fe=(e,t)=>{for(var n in t||(t={}))Afe.call(t,n)&&hj(e,n,t[n]);if(mj)for(var n of mj(t))Tfe.call(t,n)&&hj(e,n,t[n]);return e};function r7(e,t){if(t===null||typeof t!="object")return{};const n=$fe({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const Nfe="__MANTINE_FORM_INDEX__";function gj(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${Nfe}`)):!1:!1}function vj(e,t,n){typeof n.value=="object"&&(n.value=nc(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function nc(e){if(typeof e!="object")return e;var t=0,n,r,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(l){o.add(nc(l))})):s==="[object Map]"?(o=new Map,e.forEach(function(l,i){o.set(nc(i),nc(l))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(nc(e.buffer)):s==="[object ArrayBuffer]"?o=e.slice(0):s.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)vj(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||vj(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function o7(e){return typeof e!="string"?[]:e.split(".")}function Ng(e,t,n){const r=o7(e);if(r.length===0)return n;const o=nc(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let l=1;l<r.length-1;l+=1){if(s===void 0)return o;s=s[r[l]]}return s[r[r.length-1]]=t,o}function Ys(e,t){const n=o7(e);if(n.length===0||typeof t!="object"||t===null)return;let r=t[n[0]];for(let o=1;o<n.length&&r!==void 0;o+=1)r=r[n[o]];return r}function xj(e){const t=Dx(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Rx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const l=e[s],i=`${n===""?"":`${n}.`}${s}`,u=Ys(i,t);let p=!1;return typeof l=="function"&&(o[i]=l(u,t,i)),typeof l=="object"&&Array.isArray(u)&&(p=!0,u.forEach((m,h)=>Rx(l,t,`${i}.${h}`,o))),typeof l=="object"&&typeof u=="object"&&u!==null&&(p||Rx(l,t,i,o)),o},r)}function Ax(e,t){return xj(typeof e=="function"?e(t):Rx(e,t))}function $p(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Ax(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((l,i)=>l===s.split(".")[i]));return{hasError:!!o,error:o?r.errors[o]:null}}function Lfe(e,{from:t,to:n},r){const o=Ys(e,r);if(!Array.isArray(o))return r;const s=[...o],l=o[t];return s.splice(t,1),s.splice(n,0,l),Ng(e,s,r)}var zfe=Object.defineProperty,bj=Object.getOwnPropertySymbols,Ffe=Object.prototype.hasOwnProperty,Bfe=Object.prototype.propertyIsEnumerable,yj=(e,t,n)=>t in e?zfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hfe=(e,t)=>{for(var n in t||(t={}))Ffe.call(t,n)&&yj(e,n,t[n]);if(bj)for(var n of bj(t))Bfe.call(t,n)&&yj(e,n,t[n]);return e};function Vfe(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,l=Hfe({},r);return Object.keys(r).every(i=>{let u,p;if(i.startsWith(o)&&(u=i,p=i.replace(o,s)),i.startsWith(s)&&(u=i.replace(s,o),p=i),u&&p){const m=l[u],h=l[p];return h===void 0?delete l[u]:l[u]=h,m===void 0?delete l[p]:l[p]=m,!1}return!0}),l}function Wfe(e,t,n){const r=Ys(e,n);return Array.isArray(r)?Ng(e,r.filter((o,s)=>s!==t),n):n}var Ufe=Object.defineProperty,Cj=Object.getOwnPropertySymbols,Gfe=Object.prototype.hasOwnProperty,Kfe=Object.prototype.propertyIsEnumerable,wj=(e,t,n)=>t in e?Ufe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qfe=(e,t)=>{for(var n in t||(t={}))Gfe.call(t,n)&&wj(e,n,t[n]);if(Cj)for(var n of Cj(t))Kfe.call(t,n)&&wj(e,n,t[n]);return e};function Sj(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function kj(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=r7(`${o}.${t}`,s));const l=qfe({},s),i=new Set;return Object.entries(s).filter(([u])=>{if(!u.startsWith(`${o}.`))return!1;const p=Sj(u,o);return Number.isNaN(p)?!1:p>=t}).forEach(([u,p])=>{const m=Sj(u,o),h=u.replace(`${o}.${m}`,`${o}.${m+r}`);l[h]=p,i.add(h),i.has(u)||delete l[u]}),l}function Xfe(e,t,n,r){const o=Ys(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),Ng(e,s,r)}function _j(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(o=>o.startsWith(`${t}.`));return e[t]||r.some(o=>e[o])||!1}return n.some(r=>e[r])}function Qfe(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var Yfe=Object.defineProperty,Zfe=Object.defineProperties,Jfe=Object.getOwnPropertyDescriptors,jj=Object.getOwnPropertySymbols,epe=Object.prototype.hasOwnProperty,tpe=Object.prototype.propertyIsEnumerable,Ij=(e,t,n)=>t in e?Yfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,La=(e,t)=>{for(var n in t||(t={}))epe.call(t,n)&&Ij(e,n,t[n]);if(jj)for(var n of jj(t))tpe.call(t,n)&&Ij(e,n,t[n]);return e},n1=(e,t)=>Zfe(e,Jfe(t));function fi({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:l=!1,transformValues:i=p=>p,validate:u}={}){const[p,m]=d.useState(r),[h,g]=d.useState(n),[x,y]=d.useState(e),[b,C]=d.useState(Dx(t)),S=d.useRef(e),_=q=>{S.current=q},j=d.useCallback(()=>m({}),[]),E=q=>{const K=q?La(La({},x),q):x;_(K),g({})},I=d.useCallback(q=>C(K=>Dx(typeof q=="function"?q(K):q)),[]),M=d.useCallback(()=>C({}),[]),D=d.useCallback(()=>{y(e),M(),_(e),g({}),j()},[]),R=d.useCallback((q,K)=>I(ee=>n1(La({},ee),{[q]:K})),[]),A=d.useCallback(q=>I(K=>{if(typeof q!="string")return K;const ee=La({},K);return delete ee[q],ee}),[]),O=d.useCallback(q=>g(K=>{if(typeof q!="string")return K;const ee=r7(q,K);return delete ee[q],ee}),[]),$=d.useCallback((q,K)=>{const ee=gj(q,s);O(q),m(ce=>n1(La({},ce),{[q]:!0})),y(ce=>{const J=Ng(q,K,ce);if(ee){const ie=$p(q,u,J);ie.hasError?R(q,ie.error):A(q)}return J}),!ee&&o&&R(q,null)},[]),X=d.useCallback(q=>{y(K=>{const ee=typeof q=="function"?q(K):q;return La(La({},K),ee)}),o&&M()},[]),z=d.useCallback((q,K)=>{O(q),y(ee=>Lfe(q,K,ee)),C(ee=>Vfe(q,K,ee))},[]),V=d.useCallback((q,K)=>{O(q),y(ee=>Wfe(q,K,ee)),C(ee=>kj(q,K,ee,-1))},[]),Q=d.useCallback((q,K,ee)=>{O(q),y(ce=>Xfe(q,K,ee,ce)),C(ce=>kj(q,ee,ce,1))},[]),G=d.useCallback(()=>{const q=Ax(u,x);return C(q.errors),q},[x,u]),F=d.useCallback(q=>{const K=$p(q,u,x);return K.hasError?R(q,K.error):A(q),K},[x,u]),U=(q,{type:K="input",withError:ee=!0,withFocus:ce=!0}={})=>{const ie={onChange:Qfe(de=>$(q,de))};return ee&&(ie.error=b[q]),K==="checkbox"?ie.checked=Ys(q,x):ie.value=Ys(q,x),ce&&(ie.onFocus=()=>m(de=>n1(La({},de),{[q]:!0})),ie.onBlur=()=>{if(gj(q,l)){const de=$p(q,u,x);de.hasError?R(q,de.error):A(q)}}),ie},T=(q,K)=>ee=>{ee==null||ee.preventDefault();const ce=G();ce.hasErrors?K==null||K(ce.errors,x,ee):q==null||q(i(x),ee)},B=q=>i(q||x),Y=d.useCallback(q=>{q.preventDefault(),D()},[]),re=q=>{if(q){const ee=Ys(q,h);if(typeof ee=="boolean")return ee;const ce=Ys(q,x),J=Ys(q,S.current);return!pj(ce,J)}return Object.keys(h).length>0?_j(h):!pj(x,S.current)},ae=d.useCallback(q=>_j(p,q),[p]),oe=d.useCallback(q=>q?!$p(q,u,x).hasError:!Ax(u,x).hasErrors,[x,u]);return{values:x,errors:b,setValues:X,setErrors:I,setFieldValue:$,setFieldError:R,clearFieldError:A,clearErrors:M,reset:D,validate:G,validateField:F,reorderListItem:z,removeListItem:V,insertListItem:Q,getInputProps:U,onSubmit:T,onReset:Y,isDirty:re,isTouched:ae,setTouched:m,setDirty:g,resetTouched:j,resetDirty:E,isValid:oe,getTransformedValues:B}}function _n(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:l,base700:i,base900:u,accent500:p,accent300:m}=Kd(),{colorMode:h}=ha();return a.jsx(rM,{styles:()=>({input:{color:Ae(u,r)(h),backgroundColor:Ae(n,u)(h),borderColor:Ae(o,l)(h),borderWidth:2,outline:"none",":focus":{borderColor:Ae(m,p)(h)}},label:{color:Ae(i,s)(h),fontWeight:"normal",marginBottom:4}}),...t})}const npe=[{value:"sd-1",label:pn["sd-1"]},{value:"sd-2",label:pn["sd-2"]},{value:"sdxl",label:pn.sdxl},{value:"sdxl-refiner",label:pn["sdxl-refiner"]}];function tf(e){const{...t}=e,{t:n}=Z();return a.jsx(On,{label:n("modelManager.baseModel"),data:npe,...t})}function s7(e){const{data:t}=LI(),{...n}=e;return a.jsx(On,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const rpe=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Lg(e){const{...t}=e,{t:n}=Z();return a.jsx(On,{label:n("modelManager.variant"),data:rpe,...t})}function gh(e,t=!0){let n;t?n=new RegExp("[^\\\\/]+(?=\\.)"):n=new RegExp("[^\\\\/]+(?=[\\\\/]?$)");const r=e.match(n);return r?r[0]:""}function a7(e){const{t}=Z(),n=te(),{model_path:r}=e,o=fi({initialValues:{model_name:r?gh(r):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"checkpoint",error:void 0,vae:"",variant:"normal",config:"configs\\stable-diffusion\\v1-inference.yaml"}}),[s]=zI(),[l,i]=d.useState(!1),u=p=>{s({body:p}).unwrap().then(m=>{n(lt(Qt({title:t("modelManager.modelAdded",{modelName:p.model_name}),status:"success"}))),o.reset(),r&&n(jd(null))}).catch(m=>{m&&n(lt(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(p=>u(p)),style:{width:"100%"},children:a.jsxs(N,{flexDirection:"column",gap:2,children:[a.jsx(_n,{label:t("modelManager.model"),required:!0,...o.getInputProps("model_name")}),a.jsx(tf,{label:t("modelManager.baseModel"),...o.getInputProps("base_model")}),a.jsx(_n,{label:t("modelManager.modelLocation"),required:!0,...o.getInputProps("path"),onBlur:p=>{if(o.values.model_name===""){const m=gh(p.currentTarget.value);m&&o.setFieldValue("model_name",m)}}}),a.jsx(_n,{label:t("modelManager.description"),...o.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...o.getInputProps("vae")}),a.jsx(Lg,{label:t("modelManager.variant"),...o.getInputProps("variant")}),a.jsxs(N,{flexDirection:"column",width:"100%",gap:2,children:[l?a.jsx(_n,{required:!0,label:t("modelManager.customConfigFileLocation"),...o.getInputProps("config")}):a.jsx(s7,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(xr,{isChecked:l,onChange:()=>i(!l),label:t("modelManager.useCustomConfig")}),a.jsx(ot,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function l7(e){const{t}=Z(),n=te(),{model_path:r}=e,[o]=zI(),s=fi({initialValues:{model_name:r?gh(r,!1):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"diffusers",error:void 0,vae:"",variant:"normal"}}),l=i=>{o({body:i}).unwrap().then(u=>{n(lt(Qt({title:t("modelManager.modelAdded",{modelName:i.model_name}),status:"success"}))),s.reset(),r&&n(jd(null))}).catch(u=>{u&&n(lt(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(i=>l(i)),style:{width:"100%"},children:a.jsxs(N,{flexDirection:"column",gap:2,children:[a.jsx(_n,{required:!0,label:t("modelManager.model"),...s.getInputProps("model_name")}),a.jsx(tf,{label:t("modelManager.baseModel"),...s.getInputProps("base_model")}),a.jsx(_n,{required:!0,label:t("modelManager.modelLocation"),placeholder:t("modelManager.modelLocationValidationMsg"),...s.getInputProps("path"),onBlur:i=>{if(s.values.model_name===""){const u=gh(i.currentTarget.value,!1);u&&s.setFieldValue("model_name",u)}}}),a.jsx(_n,{label:t("modelManager.description"),...s.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(Lg,{label:t("modelManager.variant"),...s.getInputProps("variant")}),a.jsx(ot,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const i7=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function ope(){const[e,t]=d.useState("diffusers"),{t:n}=Z();return a.jsxs(N,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx(On,{label:n("modelManager.modelType"),value:e,data:i7,onChange:r=>{r&&t(r)}}),a.jsxs(N,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(l7,{}),e==="checkpoint"&&a.jsx(a7,{})]})]})}const spe=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function ape(){const e=te(),{t}=Z(),[n,{isLoading:r}]=FI(),o=fi({initialValues:{location:"",prediction_type:void 0}}),s=l=>{const i={location:l.location,prediction_type:l.prediction_type==="none"?void 0:l.prediction_type};n({body:i}).unwrap().then(u=>{e(lt(Qt({title:t("toast.modelAddedSimple"),status:"success"}))),o.reset()}).catch(u=>{u&&e(lt(Qt({title:`${u.data.detail} `,status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(l=>s(l)),style:{width:"100%"},children:a.jsxs(N,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(_n,{label:t("modelManager.modelLocation"),placeholder:t("modelManager.simpleModelDesc"),w:"100%",...o.getInputProps("location")}),a.jsx(On,{label:t("modelManager.predictionType"),data:spe,defaultValue:"none",...o.getInputProps("prediction_type")}),a.jsx(ot,{type:"submit",isLoading:r,children:t("modelManager.addModel")})]})})}function lpe(){const[e,t]=d.useState("simple");return a.jsxs(N,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(Ht,{isAttached:!0,children:[a.jsx(ot,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(ot,{size:"sm",isChecked:e=="advanced",onClick:()=>t("advanced"),children:"Advanced"})]}),a.jsxs(N,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(ape,{}),e==="advanced"&&a.jsx(ope,{})]})]})}function ipe(e){const{...t}=e;return a.jsx(Q6,{w:"100%",...t,children:e.children})}function cpe(){const e=W(b=>b.modelmanager.searchFolder),[t,n]=d.useState(""),{data:r}=Qo(Ol),{foundModels:o,alreadyInstalled:s,filteredModels:l}=BI({search_path:e||""},{selectFromResult:({data:b})=>{const C=oN(r==null?void 0:r.entities),S=Sr(C,"path"),_=J$(b,S),j=cN(b,S);return{foundModels:b,alreadyInstalled:Pj(j,t),filteredModels:Pj(_,t)}}}),[i,{isLoading:u}]=FI(),p=te(),{t:m}=Z(),h=d.useCallback(b=>{const C=b.currentTarget.id.split("\\").splice(-1)[0];i({body:{location:b.currentTarget.id}}).unwrap().then(S=>{p(lt(Qt({title:`Added Model: ${C}`,status:"success"})))}).catch(S=>{S&&p(lt(Qt({title:m("toast.modelAddFailed"),status:"error"})))})},[p,i,m]),g=d.useCallback(b=>{n(b.target.value)},[]),x=({models:b,showActions:C=!0})=>b.map(S=>a.jsxs(N,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(N,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(be,{sx:{fontWeight:600},children:S.split("\\").slice(-1)[0]}),a.jsx(be,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:S})]}),C?a.jsxs(N,{gap:2,children:[a.jsx(ot,{id:S,onClick:h,isLoading:u,children:m("modelManager.quickAdd")}),a.jsx(ot,{onClick:()=>p(jd(S)),isLoading:u,children:m("modelManager.advanced")})]}):a.jsx(be,{sx:{fontWeight:600,p:2,borderRadius:4,color:"accent.50",bg:"accent.400",_dark:{color:"accent.100",bg:"accent.600"}},children:"Installed"})]},S));return(()=>e?!o||o.length===0?a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(be,{variant:"subtext",children:m("modelManager.noModels")})}):a.jsxs(N,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(mo,{onChange:g,label:m("modelManager.search"),labelPos:"side"}),a.jsxs(N,{p:2,gap:2,children:[a.jsxs(be,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(be,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",l.length]})]}),a.jsx(ipe,{offsetScrollbars:!0,children:a.jsxs(N,{gap:2,flexDirection:"column",children:[x({models:l}),x({models:s,showActions:!1})]})})]}):null)()}const Pj=(e,t)=>{const n=[];return Wn(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function upe(){const e=W(i=>i.modelmanager.advancedAddScanModel),{t}=Z(),[n,r]=d.useState("diffusers"),[o,s]=d.useState(!0);d.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(i=>e.endsWith(i))?r("checkpoint"):r("diffusers")},[e,r,o]);const l=te();return e?a.jsxs(Ie,{as:jn.div,initial:{x:-100,opacity:0},animate:{x:0,opacity:1,transition:{duration:.2}},sx:{display:"flex",flexDirection:"column",minWidth:"40%",maxHeight:window.innerHeight-300,overflow:"scroll",p:4,gap:4,borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(N,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(be,{size:"xl",fontWeight:600,children:o||n==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Be,{icon:a.jsx(Ec,{}),"aria-label":t("modelManager.closeAdvanced"),onClick:()=>l(jd(null)),size:"sm"})]}),a.jsx(On,{label:t("modelManager.modelType"),value:n,data:i7,onChange:i=>{i&&(r(i),s(i==="checkpoint"))}}),o?a.jsx(a7,{model_path:e},e):a.jsx(l7,{model_path:e},e)]}):null}function dpe(){const e=te(),{t}=Z(),n=W(i=>i.modelmanager.searchFolder),{refetch:r}=BI({search_path:n||""}),o=fi({initialValues:{folder:""}}),s=d.useCallback(i=>{e($w(i.folder))},[e]),l=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(i=>s(i)),style:{width:"100%"},children:a.jsxs(N,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs(N,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(be,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx(N,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(mo,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs(N,{gap:2,children:[n?a.jsx(Be,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(jM,{}),onClick:l,fontSize:18,size:"sm"}):a.jsx(Be,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(dee,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Be,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Fr,{}),size:"sm",onClick:()=>{e($w(null)),e(jd(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const fpe=d.memo(dpe);function ppe(){return a.jsxs(N,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(fpe,{}),a.jsxs(N,{gap:4,children:[a.jsx(N,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(cpe,{})}),a.jsx(upe,{})]})]})}function mpe(){const[e,t]=d.useState("add"),{t:n}=Z();return a.jsxs(N,{flexDirection:"column",gap:4,children:[a.jsxs(Ht,{isAttached:!0,children:[a.jsx(ot,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(ot,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx(lpe,{}),e=="scan"&&a.jsx(ppe,{})]})}const hpe=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function gpe(){var F,U;const{t:e}=Z(),t=te(),{data:n}=Qo(Ol),[r,{isLoading:o}]=LT(),[s,l]=d.useState("sd-1"),i=Xw(n==null?void 0:n.entities,(T,B)=>(T==null?void 0:T.model_format)==="diffusers"&&(T==null?void 0:T.base_model)==="sd-1"),u=Xw(n==null?void 0:n.entities,(T,B)=>(T==null?void 0:T.model_format)==="diffusers"&&(T==null?void 0:T.base_model)==="sd-2"),p=d.useMemo(()=>({"sd-1":i,"sd-2":u}),[i,u]),[m,h]=d.useState(((F=Object.keys(p[s]))==null?void 0:F[0])??null),[g,x]=d.useState(((U=Object.keys(p[s]))==null?void 0:U[1])??null),[y,b]=d.useState(null),[C,S]=d.useState(""),[_,j]=d.useState(.5),[E,I]=d.useState("weighted_sum"),[M,D]=d.useState("root"),[R,A]=d.useState(""),[O,$]=d.useState(!1),X=Object.keys(p[s]).filter(T=>T!==g&&T!==y),z=Object.keys(p[s]).filter(T=>T!==m&&T!==y),V=Object.keys(p[s]).filter(T=>T!==m&&T!==g),Q=T=>{l(T),h(null),x(null)},G=()=>{const T=[];let B=[m,g,y];B=B.filter(re=>re!==null),B.forEach(re=>{var oe;const ae=(oe=re==null?void 0:re.split("/"))==null?void 0:oe[2];ae&&T.push(ae)});const Y={model_names:T,merged_model_name:C!==""?C:T.join("-"),alpha:_,interp:E,force:O,merge_dest_directory:M==="root"?void 0:R};r({base_model:s,body:Y}).unwrap().then(re=>{t(lt(Qt({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(re=>{re&&t(lt(Qt({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs(N,{flexDirection:"column",rowGap:4,children:[a.jsxs(N,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(be,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(be,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs(N,{columnGap:4,children:[a.jsx(On,{label:"Model Type",w:"100%",data:hpe,value:s,onChange:Q}),a.jsx(nn,{label:e("modelManager.modelOne"),w:"100%",value:m,placeholder:e("modelManager.selectModel"),data:X,onChange:T=>h(T)}),a.jsx(nn,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:g,data:z,onChange:T=>x(T)}),a.jsx(nn,{label:e("modelManager.modelThree"),data:V,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:T=>{T?(b(T),I("weighted_sum")):(b(null),I("add_difference"))}})]}),a.jsx(mo,{label:e("modelManager.mergedModelName"),value:C,onChange:T=>S(T.target.value)}),a.jsxs(N,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(rt,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:_,onChange:T=>j(T),withInput:!0,withReset:!0,handleReset:()=>j(.5),withSliderMarks:!0}),a.jsx(be,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs(N,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(be,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(mm,{value:E,onChange:T=>I(T),children:a.jsx(N,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(qs,{value:"weighted_sum",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(qs,{value:"sigmoid",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(qs,{value:"inv_sigmoid",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(qs,{value:"add_difference",children:a.jsx(Vt,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(be,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs(N,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs(N,{columnGap:4,children:[a.jsx(be,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(mm,{value:M,onChange:T=>D(T),children:a.jsxs(N,{columnGap:4,children:[a.jsx(qs,{value:"root",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(qs,{value:"custom",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),M==="custom"&&a.jsx(mo,{label:e("modelManager.mergedModelCustomSaveLocation"),value:R,onChange:T=>A(T.target.value)})]}),a.jsx(xr,{label:e("modelManager.ignoreMismatch"),isChecked:O,onChange:T=>$(T.target.checked),fontWeight:"500"}),a.jsx(ot,{onClick:G,isLoading:o,isDisabled:m===null||g===null,children:e("modelManager.merge")})]})}function vpe(e){const{model:t}=e,n=te(),{t:r}=Z(),[o,{isLoading:s}]=zT(),[l,i]=d.useState("InvokeAIRoot"),[u,p]=d.useState("");d.useEffect(()=>{i("InvokeAIRoot")},[t]);const m=()=>{i("InvokeAIRoot")},h=()=>{const g={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:l==="Custom"?u:void 0};if(l==="Custom"&&u===""){n(lt(Qt({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(lt(Qt({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(g).unwrap().then(()=>{n(lt(Qt({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(lt(Qt({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(Ig,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:h,cancelCallback:m,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(ot,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs(N,{flexDirection:"column",rowGap:4,children:[a.jsx(be,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Ad,{children:[a.jsx(ho,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(ho,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(ho,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(ho,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(be,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs(N,{flexDir:"column",gap:2,children:[a.jsxs(N,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(be,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(mm,{value:l,onChange:g=>i(g),children:a.jsxs(N,{gap:4,children:[a.jsx(qs,{value:"InvokeAIRoot",children:a.jsx(Vt,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(qs,{value:"Custom",children:a.jsx(Vt,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),l==="Custom"&&a.jsxs(N,{flexDirection:"column",rowGap:2,children:[a.jsx(be,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(mo,{value:u,onChange:g=>{p(g.target.value)},width:"full"})]})]})]})}function xpe(e){const{model:t}=e,[n,{isLoading:r}]=HI(),{data:o}=LI(),[s,l]=d.useState(!1);d.useEffect(()=>{o!=null&&o.includes(t.config)||l(!0)},[o,t.config]);const i=te(),{t:u}=Z(),p=fi({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"checkpoint",vae:t.vae?t.vae:"",config:t.config?t.config:"",variant:t.variant},validate:{path:h=>h.trim().length===0?"Must provide a path":null}}),m=d.useCallback(h=>{const g={base_model:t.base_model,model_name:t.model_name,body:h};n(g).unwrap().then(x=>{p.setValues(x),i(lt(Qt({title:u("modelManager.modelUpdated"),status:"success"})))}).catch(x=>{p.reset(),i(lt(Qt({title:u("modelManager.modelUpdateFailed"),status:"error"})))})},[p,i,t.base_model,t.model_name,u,n]);return a.jsxs(N,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(N,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs(N,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[pn[t.base_model]," Model"]})]}),[""].includes(t.base_model)?a.jsx(As,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(vpe,{model:t})]}),a.jsx(Yn,{}),a.jsx(N,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:p.onSubmit(h=>m(h)),children:a.jsxs(N,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:u("modelManager.name"),...p.getInputProps("model_name")}),a.jsx(_n,{label:u("modelManager.description"),...p.getInputProps("description")}),a.jsx(tf,{required:!0,...p.getInputProps("base_model")}),a.jsx(Lg,{required:!0,...p.getInputProps("variant")}),a.jsx(_n,{required:!0,label:u("modelManager.modelLocation"),...p.getInputProps("path")}),a.jsx(_n,{label:u("modelManager.vaeLocation"),...p.getInputProps("vae")}),a.jsxs(N,{flexDirection:"column",gap:2,children:[s?a.jsx(_n,{required:!0,label:u("modelManager.config"),...p.getInputProps("config")}):a.jsx(s7,{required:!0,...p.getInputProps("config")}),a.jsx(xr,{isChecked:s,onChange:()=>l(!s),label:"Use Custom Config"})]}),a.jsx(ot,{type:"submit",isLoading:r,children:u("modelManager.updateModel")})]})})})]})}function bpe(e){const{model:t}=e,[n,{isLoading:r}]=HI(),o=te(),{t:s}=Z(),l=fi({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"diffusers",vae:t.vae?t.vae:"",variant:t.variant},validate:{path:u=>u.trim().length===0?"Must provide a path":null}}),i=d.useCallback(u=>{const p={base_model:t.base_model,model_name:t.model_name,body:u};n(p).unwrap().then(m=>{l.setValues(m),o(lt(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),o(lt(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[l,o,t.base_model,t.model_name,s,n]);return a.jsxs(N,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(N,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[pn[t.base_model]," Model"]})]}),a.jsx(Yn,{}),a.jsx("form",{onSubmit:l.onSubmit(u=>i(u)),children:a.jsxs(N,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...l.getInputProps("description")}),a.jsx(tf,{required:!0,...l.getInputProps("base_model")}),a.jsx(Lg,{required:!0,...l.getInputProps("variant")}),a.jsx(_n,{required:!0,label:s("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(_n,{label:s("modelManager.vaeLocation"),...l.getInputProps("vae")}),a.jsx(ot,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function ype(e){const{model:t}=e,[n,{isLoading:r}]=FT(),o=te(),{t:s}=Z(),l=fi({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"lora",path:t.path?t.path:"",description:t.description?t.description:"",model_format:t.model_format},validate:{path:u=>u.trim().length===0?"Must provide a path":null}}),i=d.useCallback(u=>{const p={base_model:t.base_model,model_name:t.model_name,body:u};n(p).unwrap().then(m=>{l.setValues(m),o(lt(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),o(lt(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[o,l,t.base_model,t.model_name,s,n]);return a.jsxs(N,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(N,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[pn[t.base_model]," Model ⋅"," ",BT[t.model_format]," format"]})]}),a.jsx(Yn,{}),a.jsx("form",{onSubmit:l.onSubmit(u=>i(u)),children:a.jsxs(N,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...l.getInputProps("description")}),a.jsx(tf,{...l.getInputProps("base_model")}),a.jsx(_n,{label:s("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(ot,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function Cpe(e){const{t}=Z(),n=te(),[r]=HT(),[o]=VT(),{model:s,isSelected:l,setSelectedModelId:i}=e,u=d.useCallback(()=>{i(s.id)},[s.id,i]),p=d.useCallback(()=>{const m={main:r,lora:o,onnx:r}[s.model_type];m(s).unwrap().then(h=>{n(lt(Qt({title:`${t("modelManager.modelDeleted")}: ${s.model_name}`,status:"success"})))}).catch(h=>{h&&n(lt(Qt({title:`${t("modelManager.modelDeleteFailed")}: ${s.model_name}`,status:"error"})))}),i(void 0)},[r,o,s,i,n,t]);return a.jsxs(N,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx(N,{as:ot,isChecked:l,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:l?"accent.400":"base.100",color:l?"base.50":"base.800",_hover:{bg:l?"accent.500":"base.300",color:l?"base.50":"base.800"},_dark:{color:l?"base.50":"base.100",bg:l?"accent.600":"base.850",_hover:{color:l?"base.50":"base.100",bg:l?"accent.550":"base.700"}}},onClick:u,children:a.jsxs(N,{gap:4,alignItems:"center",children:[a.jsx(As,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:WT[s.base_model]}),a.jsx(Vt,{label:s.description,hasArrow:!0,placement:"bottom",children:a.jsx(be,{sx:{fontWeight:500},children:s.model_name})})]})}),a.jsx(Ig,{title:t("modelManager.deleteModel"),acceptCallback:p,acceptButtonText:t("modelManager.delete"),triggerComponent:a.jsx(Be,{icon:a.jsx(pne,{}),"aria-label":t("modelManager.deleteConfig"),colorScheme:"error"}),children:a.jsxs(N,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:t("modelManager.deleteMsg1")}),a.jsx("p",{children:t("modelManager.deleteMsg2")})]})})]})}const wpe=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=Z(),[o,s]=d.useState(""),[l,i]=d.useState("all"),{filteredDiffusersModels:u,isLoadingDiffusersModels:p}=Qo(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredDiffusersModels:Ou(j,"main","diffusers",o),isLoadingDiffusersModels:E})}),{filteredCheckpointModels:m,isLoadingCheckpointModels:h}=Qo(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredCheckpointModels:Ou(j,"main","checkpoint",o),isLoadingCheckpointModels:E})}),{filteredLoraModels:g,isLoadingLoraModels:x}=kd(void 0,{selectFromResult:({data:j,isLoading:E})=>({filteredLoraModels:Ou(j,"lora",void 0,o),isLoadingLoraModels:E})}),{filteredOnnxModels:y,isLoadingOnnxModels:b}=Yu(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredOnnxModels:Ou(j,"onnx","onnx",o),isLoadingOnnxModels:E})}),{filteredOliveModels:C,isLoadingOliveModels:S}=Yu(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredOliveModels:Ou(j,"onnx","olive",o),isLoadingOliveModels:E})}),_=d.useCallback(j=>{s(j.target.value)},[]);return a.jsx(N,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs(N,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(Ht,{isAttached:!0,children:[a.jsx(ot,{onClick:()=>i("all"),isChecked:l==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("diffusers"),isChecked:l==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("checkpoint"),isChecked:l==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("onnx"),isChecked:l==="onnx",children:r("modelManager.onnxModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("olive"),isChecked:l==="olive",children:r("modelManager.oliveModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("lora"),isChecked:l==="lora",children:r("modelManager.loraModels")})]}),a.jsx(mo,{onChange:_,label:r("modelManager.search"),labelPos:"side"}),a.jsxs(N,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Qi,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(l)&&!p&&u.length>0&&a.jsx(Xi,{title:"Diffusers",modelList:u,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),h&&a.jsx(Qi,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(l)&&!h&&m.length>0&&a.jsx(Xi,{title:"Checkpoints",modelList:m,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),x&&a.jsx(Qi,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(l)&&!x&&g.length>0&&a.jsx(Xi,{title:"LoRAs",modelList:g,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),S&&a.jsx(Qi,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(l)&&!S&&C.length>0&&a.jsx(Xi,{title:"Olives",modelList:C,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),b&&a.jsx(Qi,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(l)&&!b&&y.length>0&&a.jsx(Xi,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},Spe=d.memo(wpe),Ou=(e,t,n,r)=>{const o=[];return Wn(e==null?void 0:e.entities,s=>{if(!s)return;const l=s.model_name.toLowerCase().includes(r.toLowerCase()),i=n===void 0||s.model_format===n,u=s.model_type===t;l&&i&&u&&o.push(s)}),o},g2=d.memo(e=>a.jsx(N,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));g2.displayName="StyledModelContainer";const Xi=d.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(g2,{children:a.jsxs(N,{sx:{gap:2,flexDir:"column"},children:[a.jsx(be,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(Cpe,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});Xi.displayName="ModelListWrapper";const Qi=d.memo(({loadingMessage:e})=>a.jsx(g2,{children:a.jsxs(N,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(fa,{}),a.jsx(be,{variant:"subtext",children:e||"Fetching..."})]})}));Qi.displayName="FetchingModelsLoader";function kpe(){const[e,t]=d.useState(),{mainModel:n}=Qo(Ol,{selectFromResult:({data:s})=>({mainModel:e?s==null?void 0:s.entities[e]:void 0})}),{loraModel:r}=kd(void 0,{selectFromResult:({data:s})=>({loraModel:e?s==null?void 0:s.entities[e]:void 0})}),o=n||r;return a.jsxs(N,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(Spe,{selectedModelId:e,setSelectedModelId:t}),a.jsx(_pe,{model:o})]})}const _pe=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(xpe,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(bpe,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(ype,{model:t},t.id):a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(be,{variant:"subtext",children:"No Model Selected"})})};function jpe(){const{t:e}=Z();return a.jsxs(N,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsx(be,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(be,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Xc,{})]})}function Ipe(){return a.jsx(N,{children:a.jsx(jpe,{})})}const Ej=[{id:"modelManager",label:bt.t("modelManager.modelManager"),content:a.jsx(kpe,{})},{id:"importModels",label:bt.t("modelManager.importModels"),content:a.jsx(mpe,{})},{id:"mergeModels",label:bt.t("modelManager.mergeModels"),content:a.jsx(gpe,{})},{id:"settings",label:bt.t("modelManager.settings"),content:a.jsx(Ipe,{})}],Ppe=()=>a.jsxs(ri,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(oi,{children:Ej.map(e=>a.jsx($r,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(Hc,{sx:{w:"full",h:"full"},children:Ej.map(e=>a.jsx(Co,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),Epe=d.memo(Ppe),Mpe={enum:"",BoardField:void 0,boolean:!1,BooleanCollection:[],BooleanPolymorphic:!1,ClipField:void 0,Collection:[],CollectionItem:void 0,ColorCollection:[],ColorField:void 0,ColorPolymorphic:void 0,ConditioningCollection:[],ConditioningField:void 0,ConditioningPolymorphic:void 0,ControlCollection:[],ControlField:void 0,ControlNetModelField:void 0,ControlPolymorphic:void 0,DenoiseMaskField:void 0,float:0,FloatCollection:[],FloatPolymorphic:0,ImageCollection:[],ImageField:void 0,ImagePolymorphic:void 0,integer:0,IntegerCollection:[],IntegerPolymorphic:0,IPAdapterCollection:[],IPAdapterField:void 0,IPAdapterModelField:void 0,IPAdapterPolymorphic:void 0,LatentsCollection:[],LatentsField:void 0,LatentsPolymorphic:void 0,LoRAModelField:void 0,MainModelField:void 0,ONNXModelField:void 0,Scheduler:"euler",SDXLMainModelField:void 0,SDXLRefinerModelField:void 0,string:"",StringCollection:[],StringPolymorphic:"",T2IAdapterCollection:[],T2IAdapterField:void 0,T2IAdapterModelField:void 0,T2IAdapterPolymorphic:void 0,UNetField:void 0,VaeField:void 0,VaeModelField:void 0},Ope=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return n.value=t.default??Mpe[t.type],n},Dpe=le([e=>e.nodes],e=>e.nodeTemplates),r1={dragHandle:`.${ti}`},Rpe=()=>{const e=W(Dpe),t=db();return d.useCallback(n=>{var x;const r=Js();let o=window.innerWidth/2,s=window.innerHeight/2;const l=(x=document.querySelector("#workflow-editor"))==null?void 0:x.getBoundingClientRect();l&&(o=l.width/2-x1/2,s=l.height/2-x1/2);const{x:i,y:u}=t.project({x:o,y:s});if(n==="current_image")return{...r1,id:r,type:"current_image",position:{x:i,y:u},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...r1,id:r,type:"notes",position:{x:i,y:u},data:{id:r,isOpen:!0,label:"Notes",notes:"",type:"notes"}};const p=e[n];if(p===void 0){console.error(`Unable to find template ${n}.`);return}const m=Nw(p.inputs,(y,b,C)=>{const S=Js(),_=Ope(S,b);return y[C]=_,y},{}),h=Nw(p.outputs,(y,b,C)=>{const _={id:Js(),name:C,type:b.type,fieldKind:"output"};return y[C]=_,y},{});return{...r1,id:r,type:"invocation",position:{x:i,y:u},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:n!=="save_image",inputs:m,outputs:h,useCache:p.useCache}}},[e,t])},c7=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(be,{fontWeight:600,children:e}),a.jsx(be,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));c7.displayName="AddNodePopoverSelectItem";const Ape=(e,t)=>{const n=new RegExp(e.trim().replace(/[-[\]{}()*+!<=:?./\\^$|#,]/g,"").split(" ").join(".*"),"gi");return n.test(t.label)||n.test(t.description)||t.tags.some(r=>n.test(r))},Tpe=()=>{const e=te(),t=Rpe(),n=si(),{t:r}=Z(),o=W(C=>C.nodes.currentConnectionFieldType),s=W(C=>{var S;return(S=C.nodes.connectionStartParams)==null?void 0:S.handleType}),l=le([ge],({nodes:C})=>{const S=o?tN(C.nodeTemplates,j=>{const E=s=="source"?j.inputs:j.outputs;return Vo(E,I=>{const M=s=="source"?o:I.type,D=s=="target"?o:I.type;return fb(M,D)})}):Sr(C.nodeTemplates),_=Sr(S,j=>({label:j.title,value:j.type,description:j.description,tags:j.tags}));return o===null&&(_.push({label:r("nodes.currentImage"),value:"current_image",description:r("nodes.currentImageDescription"),tags:["progress"]}),_.push({label:r("nodes.notes"),value:"notes",description:r("nodes.notesDescription"),tags:["notes"]})),_.sort((j,E)=>j.label.localeCompare(E.label)),{data:_,t:r}},Ce),{data:i}=W(l),u=W(C=>C.nodes.isAddNodePopoverOpen),p=d.useRef(null),m=d.useCallback(C=>{const S=t(C);if(!S){const _=r("nodes.unknownNode",{nodeType:C});n({status:"error",title:_});return}e(UT(S))},[e,t,n,r]),h=d.useCallback(C=>{C&&m(C)},[m]),g=d.useCallback(()=>{e(GT())},[e]),x=d.useCallback(()=>{e(VI())},[e]),y=d.useCallback(C=>{C.preventDefault(),x(),setTimeout(()=>{var S;(S=p.current)==null||S.focus()},0)},[x]),b=d.useCallback(()=>{g()},[g]);return tt(["shift+a","space"],y),tt(["escape"],b),a.jsxs(Bd,{initialFocusRef:p,isOpen:u,onClose:g,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(U3,{children:a.jsx(N,{sx:{position:"absolute",top:"15%",insetInlineStart:"50%",pointerEvents:"none"}})}),a.jsx(Hd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(qh,{sx:{p:0},children:a.jsx(nn,{inputRef:p,selectOnBlur:!1,placeholder:r("nodes.nodeSearch"),value:null,data:i,maxDropdownHeight:400,nothingFound:r("nodes.noMatchingNodes"),itemComponent:c7,filter:Ape,onChange:h,hoverOnSearchChange:!0,onDropdownClose:g,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},$pe=d.memo(Tpe),Npe=()=>{const e=db(),t=W(r=>r.nodes.shouldValidateGraph);return d.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:l})=>{var x,y;const i=e.getEdges(),u=e.getNodes();if(!(r&&o&&s&&l))return!1;const p=e.getNode(r),m=e.getNode(s);if(!(p&&m&&p.data&&m.data))return!1;const h=(x=p.data.outputs[o])==null?void 0:x.type,g=(y=m.data.inputs[l])==null?void 0:y.type;return!h||!g||r===s?!1:t?i.find(b=>{b.target===s&&b.targetHandle===l&&b.source===r&&b.sourceHandle})||i.find(b=>b.target===s&&b.targetHandle===l)&&g!=="CollectionItem"||!fb(h,g)?!1:WI(r,s,u,i):!0},[e,t])},xd=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,Lpe=le(ge,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=xd(n&&r?_d[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),zpe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:l,className:i}=W(Lpe),u={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=pb(u);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:l,strokeWidth:2,className:i,d:p,style:{opacity:.8}})})},Fpe=d.memo(zpe),u7=(e,t,n,r,o)=>le(ge,({nodes:s})=>{var g,x;const l=s.nodes.find(y=>y.id===e),i=s.nodes.find(y=>y.id===n),u=Mn(l)&&Mn(i),p=(l==null?void 0:l.selected)||(i==null?void 0:i.selected)||o,m=u?(x=(g=l==null?void 0:l.data)==null?void 0:g.outputs[t||""])==null?void 0:x.type:void 0,h=m&&s.shouldColorEdges?xd(_d[m].color):xd("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:h}},Ce),Bpe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:l,data:i,selected:u,source:p,target:m,sourceHandleId:h,targetHandleId:g})=>{const x=d.useMemo(()=>u7(p,h,m,g,u),[u,p,h,m,g]),{isSelected:y,shouldAnimate:b}=W(x),[C,S,_]=pb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:j}=Kd();return a.jsxs(a.Fragment,{children:[a.jsx(UI,{path:C,markerEnd:l,style:{strokeWidth:y?3:2,stroke:j,opacity:y?.8:.5,animation:b?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:b?5:"none"}}),(i==null?void 0:i.count)&&i.count>1&&a.jsx(KT,{children:a.jsx(N,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${S}px,${_}px)`},className:"nodrag nopan",children:a.jsx(As,{variant:"solid",sx:{bg:"base.500",opacity:y?.8:.5,boxShadow:"base"},children:i.count})})})]})},Hpe=d.memo(Bpe),Vpe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:l,selected:i,source:u,target:p,sourceHandleId:m,targetHandleId:h})=>{const g=d.useMemo(()=>u7(u,m,p,h,i),[u,m,p,h,i]),{isSelected:x,shouldAnimate:y,stroke:b}=W(g),[C]=pb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(UI,{path:C,markerEnd:l,style:{strokeWidth:x?3:2,stroke:b,opacity:x?.8:.5,animation:y?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:y?5:"none"}})},Wpe=d.memo(Vpe),Upe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:l,handleMouseOver:i}=bO(t),u=d.useMemo(()=>le(ge,({nodes:_})=>{var j;return((j=_.nodeExecutionStates[t])==null?void 0:j.status)===Zs.IN_PROGRESS}),[t]),p=W(u),[m,h,g,x]=Ho("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=te(),b=aa(m,h),C=W(_=>_.nodes.nodeOpacity),S=d.useCallback(_=>{!_.ctrlKey&&!_.altKey&&!_.metaKey&&!_.shiftKey&&y(qT(t)),y(GI())},[y,t]);return a.jsxs(Ie,{onClick:S,onMouseEnter:i,onMouseLeave:l,className:ti,sx:{h:"full",position:"relative",borderRadius:"base",w:n??x1,transitionProperty:"common",transitionDuration:"0.1s",cursor:"grab",opacity:C},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",pointerEvents:"none",shadow:`${g}, ${x}, ${x}`,zIndex:-1}}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"md",pointerEvents:"none",transitionProperty:"common",transitionDuration:"0.1s",opacity:.7,shadow:p?b:void 0,zIndex:-1}}),r,a.jsx(xO,{isSelected:o,isHovered:s})]})},zg=d.memo(Upe),Gpe=le(ge,({system:e,gallery:t})=>{var r;return{imageDTO:t.selection[t.selection.length-1],progressImage:(r=e.denoiseProgress)==null?void 0:r.progress_image}}),Kpe=e=>{const{progressImage:t,imageDTO:n}=XT(Gpe);return t?a.jsx(o1,{nodeProps:e,children:a.jsx(ga,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(o1,{nodeProps:e,children:a.jsx(sl,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(o1,{nodeProps:e,children:a.jsx(tr,{})})},qpe=d.memo(Kpe),o1=e=>{const[t,n]=d.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(zg,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs(N,{onMouseEnter:r,onMouseLeave:o,className:ti,sx:{position:"relative",flexDirection:"column"},children:[a.jsx(N,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(be,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs(N,{layerStyle:"nodeBody",sx:{w:"full",h:"full",borderBottomRadius:"base",p:2},children:[e.children,t&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:40,left:-2,right:-2,bottom:0,pointerEvents:"none"},children:a.jsx(t7,{})},"nextPrevButtons")]})]})})},Xpe=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return[];const s=r.nodeTemplates[o.data.type];return s?Sr(s.inputs).filter(l=>(["any","direct"].includes(l.input)||mb.includes(l.type))&&KI.includes(l.type)).filter(l=>!l.ui_hidden).sort((l,i)=>(l.ui_order??0)-(i.ui_order??0)).map(l=>l.name).filter(l=>l!=="is_intermediate"):[]},Ce),[e]);return W(t)},Qpe=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return[];const s=r.nodeTemplates[o.data.type];return s?Sr(s.inputs).filter(l=>l.input==="connection"&&!mb.includes(l.type)||!KI.includes(l.type)).filter(l=>!l.ui_hidden).sort((l,i)=>(l.ui_order??0)-(i.ui_order??0)).map(l=>l.name).filter(l=>l!=="is_intermediate"):[]},Ce),[e]);return W(t)},Ype=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return[];const s=r.nodeTemplates[o.data.type];return s?Sr(s.outputs).filter(l=>!l.ui_hidden).sort((l,i)=>(l.ui_order??0)-(i.ui_order??0)).map(l=>l.name).filter(l=>l!=="is_intermediate"):[]},Ce),[e]);return W(t)},Zpe=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.embedWorkflow:!1},Ce),[e]);return W(t)},Fg=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?Vo(o.data.outputs,s=>QT.includes(s.type)&&o.data.type!=="image"):!1},Ce),[e]);return W(t)},Jpe=({nodeId:e})=>{const t=te(),n=Fg(e),r=Zpe(e),o=d.useCallback(s=>{t(YT({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(Zt,{as:N,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(In,{sx:{fontSize:"xs",mb:"1px"},children:"Workflow"}),a.jsx(Rd,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},eme=d.memo(Jpe),tme=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.isIntermediate:!1},Ce),[e]);return W(t)},nme=({nodeId:e})=>{const t=te(),n=Fg(e),r=tme(e),o=d.useCallback(s=>{t(ZT({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(Zt,{as:N,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(In,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Rd,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},rme=d.memo(nme),ome=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.useCache:!1},Ce),[e]);return W(t)},sme=({nodeId:e})=>{const t=te(),n=ome(e),r=d.useCallback(o=>{t(JT({nodeId:e,useCache:o.target.checked}))},[t,e]);return a.jsxs(Zt,{as:N,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(In,{sx:{fontSize:"xs",mb:"1px"},children:"Use Cache"}),a.jsx(Rd,{className:"nopan",size:"sm",onChange:r,isChecked:n})]})},ame=d.memo(sme),lme=({nodeId:e})=>{const t=Fg(e),n=$t("invocationCache").isFeatureEnabled;return a.jsxs(N,{className:ti,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[n&&a.jsx(ame,{nodeId:e}),t&&a.jsx(eme,{nodeId:e}),t&&a.jsx(rme,{nodeId:e})]})},ime=d.memo(lme),cme=({nodeId:e,isOpen:t})=>{const n=te(),r=e9(),o=d.useCallback(()=>{n(t9({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(Be,{className:"nodrag",onClick:o,"aria-label":"Minimize",sx:{minW:8,w:8,h:8,color:"base.500",_dark:{color:"base.500"},_hover:{color:"base.700",_dark:{color:"base.300"}}},variant:"link",icon:a.jsx(bg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})})},v2=d.memo(cme),d7=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.label:!1},Ce),[e]);return W(t)},f7=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},Ce),[e]);return W(t)},ume=({nodeId:e,title:t})=>{const n=te(),r=d7(e),o=f7(e),{t:s}=Z(),[l,i]=d.useState(""),u=d.useCallback(async m=>{n(n9({nodeId:e,label:m})),i(r||t||o||s("nodes.problemSettingTitle"))},[n,e,t,o,r,s]),p=d.useCallback(m=>{i(m)},[]);return d.useEffect(()=>{i(r||t||o||s("nodes.problemSettingTitle"))},[r,o,t,s]),a.jsx(N,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(Oh,{as:N,value:l,onChange:p,onSubmit:u,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(Mh,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(Eh,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(dme,{})]})})},p7=d.memo(ume);function dme(){const{isEditing:e,getEditButtonProps:t}=_5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:ti,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const x2=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},Ce),[e]);return W(t)},fme=({nodeId:e})=>{const t=x2(e),{base400:n,base600:r}=Kd(),o=aa(n,r),s=d.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return sm(t)?a.jsxs(a.Fragment,{children:[a.jsx(Tu,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Yi.Left,style:{...s,left:"-0.5rem"}}),Sr(t.inputs,l=>a.jsx(Tu,{type:"target",id:l.name,isConnectable:!1,position:Yi.Left,style:{visibility:"hidden"}},`${t.id}-${l.name}-collapsed-input-handle`)),a.jsx(Tu,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Yi.Right,style:{...s,right:"-0.5rem"}}),Sr(t.outputs,l=>a.jsx(Tu,{type:"source",id:l.name,isConnectable:!1,position:Yi.Right,style:{visibility:"hidden"}},`${t.id}-${l.name}-collapsed-output-handle`))]}):null},pme=d.memo(fme),mme=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},Ce),[e]);return W(t)},hme=({nodeId:e})=>{const t=te(),n=x2(e),{t:r}=Z(),o=d.useCallback(s=>{t(r9({nodeId:e,notes:s.target.value}))},[t,e]);return sm(n)?a.jsxs(Zt,{children:[a.jsx(In,{children:r("nodes.notes")}),a.jsx(da,{value:n==null?void 0:n.notes,onChange:o,rows:10})]}):null},gme=d.memo(hme),vme=e=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>{var l;const o=r.nodes.find(i=>i.id===e);if(!Mn(o))return!1;const s=r.nodeTemplates[(o==null?void 0:o.data.type)??""];return!(s!=null&&s.version)||!((l=o.data)!=null&&l.version)?!1:Jj(s.version,o.data.version)===0},Ce),[e]);return W(t)},xme=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Lr(),o=d7(e),s=f7(e),l=vme(e),{t:i}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{label:a.jsx(m7,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx(N,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(Tn,{as:bM,sx:{boxSize:4,w:8,color:l?"base.400":"error.400"}})})}),a.jsxs(ql,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{children:o||s||i("nodes.unknownNode")}),a.jsx(Fd,{}),a.jsx(Jo,{children:a.jsx(gme,{nodeId:e})}),a.jsx(ks,{})]})]})]})},bme=d.memo(xme),m7=d.memo(({nodeId:e})=>{const t=x2(e),n=mme(e),{t:r}=Z(),o=d.useMemo(()=>t!=null&&t.label&&(n!=null&&n.title)?`${t.label} (${n.title})`:t!=null&&t.label&&!n?t.label:!(t!=null&&t.label)&&n?n.title:r("nodes.unknownNode"),[t,n,r]),s=d.useMemo(()=>!sm(t)||!n?null:t.version?n.version?Qw(t.version,n.version,"<")?a.jsxs(be,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateNode"),")"]}):Qw(t.version,n.version,">")?a.jsxs(be,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateApp"),")"]}):a.jsxs(be,{as:"span",children:[r("nodes.version")," ",t.version]}):a.jsxs(be,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.unknownTemplate"),")"]}):a.jsx(be,{as:"span",sx:{color:"error.500"},children:r("nodes.versionUnknown")}),[t,n,r]);return sm(t)?a.jsxs(N,{sx:{flexDir:"column"},children:[a.jsx(be,{as:"span",sx:{fontWeight:600},children:o}),a.jsx(be,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),s,(t==null?void 0:t.notes)&&a.jsx(be,{children:t.notes})]}):a.jsx(be,{sx:{fontWeight:600},children:r("nodes.unknownNode")})});m7.displayName="TooltipContent";const s1=3,Mj={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},yme=({nodeId:e})=>{const t=d.useMemo(()=>le(ge,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=W(t);return n?a.jsx(Vt,{label:a.jsx(h7,{nodeExecutionState:n}),placement:"top",children:a.jsx(N,{className:ti,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(g7,{nodeExecutionState:n})})}):null},Cme=d.memo(yme),h7=d.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e,{t:o}=Z();return t===Zs.PENDING?a.jsx(be,{children:"Pending"}):t===Zs.IN_PROGRESS?r?a.jsxs(N,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(ga,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(As,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(be,{children:[o("nodes.executionStateInProgress")," (",Math.round(n*100),"%)"]}):a.jsx(be,{children:o("nodes.executionStateInProgress")}):t===Zs.COMPLETED?a.jsx(be,{children:o("nodes.executionStateCompleted")}):t===Zs.FAILED?a.jsx(be,{children:o("nodes.executionStateError")}):null});h7.displayName="TooltipLabel";const g7=d.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Zs.PENDING?a.jsx(Tn,{as:WJ,sx:{boxSize:s1,color:"base.600",_dark:{color:"base.300"}}}):n===Zs.IN_PROGRESS?t===null?a.jsx(V1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:Mj}):a.jsx(V1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:Mj}):n===Zs.COMPLETED?a.jsx(Tn,{as:mM,sx:{boxSize:s1,color:"ok.600",_dark:{color:"ok.300"}}}):n===Zs.FAILED?a.jsx(Tn,{as:KJ,sx:{boxSize:s1,color:"error.600",_dark:{color:"error.300"}}}):null});g7.displayName="StatusIcon";const wme=({nodeId:e,isOpen:t})=>a.jsxs(N,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",justifyContent:"space-between",h:8,textAlign:"center",fontWeight:500,color:"base.700",_dark:{color:"base.200"}},children:[a.jsx(v2,{nodeId:e,isOpen:t}),a.jsx(p7,{nodeId:e}),a.jsxs(N,{alignItems:"center",children:[a.jsx(Cme,{nodeId:e}),a.jsx(bme,{nodeId:e})]}),!t&&a.jsx(pme,{nodeId:e})]}),Sme=d.memo(wme),kme=(e,t,n,r)=>le(ge,o=>{if(!r)return bt.t("nodes.noFieldType");const{currentConnectionFieldType:s,connectionStartParams:l,nodes:i,edges:u}=o.nodes;if(!l||!s)return bt.t("nodes.noConnectionInProgress");const{handleType:p,nodeId:m,handleId:h}=l;if(!p||!m||!h)return bt.t("nodes.noConnectionData");const g=n==="target"?r:s,x=n==="source"?r:s;if(e===m)return bt.t("nodes.cannotConnectToSelf");if(n===p)return n==="source"?bt.t("nodes.cannotConnectOutputToOutput"):bt.t("nodes.cannotConnectInputToInput");const y=n==="target"?e:m,b=n==="target"?t:h,C=n==="source"?e:m,S=n==="source"?t:h;return u.find(j=>{j.target===y&&j.targetHandle===b&&j.source===C&&j.sourceHandle})?bt.t("nodes.cannotDuplicateConnection"):u.find(j=>j.target===y&&j.targetHandle===b)&&g!=="CollectionItem"?bt.t("nodes.inputMayOnlyHaveOneConnection"):fb(x,g)?WI(p==="source"?m:e,p==="source"?e:m,i,u)?null:bt.t("nodes.connectionWouldCreateCycle"):bt.t("nodes.fieldTypesMustMatch")}),_me=(e,t,n)=>{const r=d.useMemo(()=>le(ge,({nodes:s})=>{var i;const l=s.nodes.find(u=>u.id===e);if(Mn(l))return(i=l==null?void 0:l.data[cb[n]][t])==null?void 0:i.type},Ce),[t,n,e]);return W(r)},jme=le(ge,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),v7=({nodeId:e,fieldName:t,kind:n})=>{const r=_me(e,t,n),o=d.useMemo(()=>le(ge,({nodes:g})=>!!g.edges.filter(x=>(n==="input"?x.target:x.source)===e&&(n==="input"?x.targetHandle:x.sourceHandle)===t).length),[t,n,e]),s=d.useMemo(()=>kme(e,t,n==="input"?"target":"source",r),[e,t,n,r]),l=d.useMemo(()=>le(ge,({nodes:g})=>{var x,y,b;return((x=g.connectionStartParams)==null?void 0:x.nodeId)===e&&((y=g.connectionStartParams)==null?void 0:y.handleId)===t&&((b=g.connectionStartParams)==null?void 0:b.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),i=W(o),u=W(jme),p=W(l),m=W(s),h=d.useMemo(()=>!!(u&&m&&!p),[m,u,p]);return{isConnected:i,isConnectionInProgress:u,isConnectionStartField:p,connectionError:m,shouldDim:h}},Ime=(e,t)=>{const n=d.useMemo(()=>le(ge,({nodes:o})=>{var l;const s=o.nodes.find(i=>i.id===e);if(Mn(s))return((l=s==null?void 0:s.data.inputs[t])==null?void 0:l.value)!==void 0},Ce),[t,e]);return W(n)},Pme=(e,t)=>{const n=d.useMemo(()=>le(ge,({nodes:o})=>{const s=o.nodes.find(u=>u.id===e);if(!Mn(s))return;const l=o.nodeTemplates[(s==null?void 0:s.data.type)??""],i=l==null?void 0:l.inputs[t];return i==null?void 0:i.input},Ce),[t,e]);return W(n)},Eme=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=te(),s=yO(e,t),l=CO(e,t,n),i=Pme(e,t),{t:u}=Z(),p=d.useCallback(C=>{C.preventDefault()},[]),m=d.useMemo(()=>le(ge,({nodes:C})=>({isExposed:!!C.workflow.exposedFields.find(_=>_.nodeId===e&&_.fieldName===t)}),Ce),[t,e]),h=d.useMemo(()=>["any","direct"].includes(i??"__UNKNOWN_INPUT__"),[i]),{isExposed:g}=W(m),x=d.useCallback(()=>{o(o9({nodeId:e,fieldName:t}))},[o,t,e]),y=d.useCallback(()=>{o(OI({nodeId:e,fieldName:t}))},[o,t,e]),b=d.useMemo(()=>{const C=[];return h&&!g&&C.push(a.jsx(Kt,{icon:a.jsx(Xa,{}),onClick:x,children:"Add to Linear View"},`${e}.${t}.expose-field`)),h&&g&&C.push(a.jsx(Kt,{icon:a.jsx(oee,{}),onClick:y,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),C},[t,x,y,g,h,e]);return a.jsx(zy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>b.length?a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:p,children:a.jsx(sd,{title:s||l||u("nodes.unknownField"),children:b})}):null,children:r})},Mme=d.memo(Eme),Ome=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:l,type:i}=t,{color:u,title:p}=_d[i],m=d.useMemo(()=>{const g=s9.includes(i),x=mb.includes(i),y=a9.includes(i),b=xd(u),C={backgroundColor:g||x?"var(--invokeai-colors-base-900)":b,position:"absolute",width:"1rem",height:"1rem",borderWidth:g||x?4:0,borderStyle:"solid",borderColor:b,borderRadius:y?4:"100%",zIndex:1};return n==="target"?C.insetInlineStart="-1rem":C.insetInlineEnd="-1rem",r&&!o&&s&&(C.filter="opacity(0.4) grayscale(0.7)"),r&&s?o?C.cursor="grab":C.cursor="not-allowed":C.cursor="crosshair",C},[s,n,r,o,i,u]),h=d.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Vt,{label:h,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:kh,children:a.jsx(Tu,{type:n,id:l,position:n==="target"?Yi.Left:Yi.Right,style:m})})},x7=d.memo(Ome),Dme=({nodeId:e,fieldName:t})=>{const n=Og(e,t,"input"),r=Ime(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:l,connectionError:i,shouldDim:u}=v7({nodeId:e,fieldName:t,kind:"input"}),p=d.useMemo(()=>{if((n==null?void 0:n.fieldKind)!=="input"||!n.required)return!1;if(!o&&n.input==="connection"||!r&&!o&&n.input==="any")return!0},[n,o,r]);return(n==null?void 0:n.fieldKind)!=="input"?a.jsx(Tx,{shouldDim:u,children:a.jsxs(Zt,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Tx,{shouldDim:u,children:[a.jsxs(Zt,{isInvalid:p,isDisabled:o,sx:{alignItems:"stretch",justifyContent:"space-between",ps:n.input==="direct"?0:2,gap:2,h:"full",w:"full"},children:[a.jsx(Mme,{nodeId:e,fieldName:t,kind:"input",children:m=>a.jsx(In,{sx:{display:"flex",alignItems:"center",h:"full",mb:0,px:1,gap:2},children:a.jsx(SO,{ref:m,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(AO,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(x7,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:l,connectionError:i})]})},Oj=d.memo(Dme),Tx=d.memo(({shouldDim:e,children:t})=>a.jsx(N,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Tx.displayName="InputFieldWrapper";const Rme=({nodeId:e,fieldName:t})=>{const n=Og(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:l,shouldDim:i}=v7({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx($x,{shouldDim:i,children:a.jsxs(Zt,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs($x,{shouldDim:i,children:[a.jsx(Vt,{label:a.jsx(i2,{nodeId:e,fieldName:t,kind:"output"}),openDelay:kh,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(Zt,{isDisabled:r,pe:2,children:a.jsx(In,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(x7,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:l})]})},Ame=d.memo(Rme),$x=d.memo(({shouldDim:e,children:t})=>a.jsx(N,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));$x.displayName="OutputFieldWrapper";const Tme=e=>{const t=Fg(e),n=$t("invocationCache").isFeatureEnabled;return d.useMemo(()=>t||n,[t,n])},$me=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=Qpe(e),l=Xpe(e),i=Tme(e),u=Ype(e);return a.jsxs(zg,{nodeId:e,selected:o,children:[a.jsx(Sme,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx(N,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:i?0:"base"},children:a.jsxs(N,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(el,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,m)=>a.jsx(nd,{gridColumnStart:1,gridRowStart:m+1,children:a.jsx(Oj,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),u.map((p,m)=>a.jsx(nd,{gridColumnStart:2,gridRowStart:m+1,children:a.jsx(Ame,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),l.map(p=>a.jsx(Oj,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),i&&a.jsx(ime,{nodeId:e})]})]})},Nme=d.memo($me),Lme=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(zg,{nodeId:e,selected:o,children:[a.jsxs(N,{className:ti,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(v2,{nodeId:e,isOpen:t}),a.jsx(be,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx(N,{layerStyle:"nodeBody",sx:{userSelect:"auto",flexDirection:"column",w:"full",h:"full",p:4,gap:1,borderBottomRadius:"base",fontSize:"sm"},children:a.jsxs(Ie,{children:[a.jsx(be,{as:"span",children:"Unknown node type: "}),a.jsx(be,{as:"span",fontWeight:600,children:r})]})})]}),zme=d.memo(Lme),Fme=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:l}=t,i=d.useMemo(()=>le(ge,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return W(i)?a.jsx(Nme,{nodeId:r,isOpen:s,label:l,type:o,selected:n}):a.jsx(zme,{nodeId:r,isOpen:s,label:l,type:o,selected:n})},Bme=d.memo(Fme),Hme=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,l=te(),i=d.useCallback(u=>{l(l9({nodeId:t,value:u.target.value}))},[l,t]);return a.jsxs(zg,{nodeId:t,selected:r,children:[a.jsxs(N,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(v2,{nodeId:t,isOpen:s}),a.jsx(p7,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx(N,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx(N,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(da,{value:o,onChange:i,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},Vme=d.memo(Hme),Wme=["Delete","Backspace"],Ume={collapsed:Hpe,default:Wpe},Gme={invocation:Bme,current_image:qpe,notes:Vme},Kme={hideAttribution:!0},qme=le(ge,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},Ce),Xme=()=>{const e=te(),t=W(O=>O.nodes.nodes),n=W(O=>O.nodes.edges),r=W(O=>O.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=W(qme),l=d.useRef(null),i=d.useRef(),u=Npe(),[p]=Ho("radii",["base"]),m=d.useCallback(O=>{e(i9(O))},[e]),h=d.useCallback(O=>{e(c9(O))},[e]),g=d.useCallback((O,$)=>{e(u9($))},[e]),x=d.useCallback(O=>{e(Lw(O))},[e]),y=d.useCallback(()=>{e(d9({cursorPosition:i.current}))},[e]),b=d.useCallback(O=>{e(f9(O))},[e]),C=d.useCallback(O=>{e(p9(O))},[e]),S=d.useCallback(({nodes:O,edges:$})=>{e(m9(O?O.map(X=>X.id):[])),e(h9($?$.map(X=>X.id):[]))},[e]),_=d.useCallback((O,$)=>{e(g9($))},[e]),j=d.useCallback(()=>{e(GI())},[e]),E=d.useCallback(O=>{zw.set(O),O.fitView()},[]),I=d.useCallback(O=>{var X,z;const $=(X=l.current)==null?void 0:X.getBoundingClientRect();if($){const V=(z=zw.get())==null?void 0:z.project({x:O.clientX-$.left,y:O.clientY-$.top});i.current=V}},[]),M=d.useRef(),D=d.useCallback((O,$,X)=>{M.current=O,e(v9($.id)),e(x9())},[e]),R=d.useCallback((O,$)=>{e(Lw($))},[e]),A=d.useCallback((O,$,X)=>{var z,V;!("touches"in O)&&((z=M.current)==null?void 0:z.clientX)===O.clientX&&((V=M.current)==null?void 0:V.clientY)===O.clientY&&e(b9($)),M.current=void 0},[e]);return tt(["Ctrl+c","Meta+c"],O=>{O.preventDefault(),e(y9())}),tt(["Ctrl+a","Meta+a"],O=>{O.preventDefault(),e(C9())}),tt(["Ctrl+v","Meta+v"],O=>{O.preventDefault(),e(w9({cursorPosition:i.current}))}),a.jsx(S9,{id:"workflow-editor",ref:l,defaultViewport:r,nodeTypes:Gme,edgeTypes:Ume,nodes:t,edges:n,onInit:E,onMouseMove:I,onNodesChange:m,onEdgesChange:h,onEdgesDelete:b,onEdgeUpdate:R,onEdgeUpdateStart:D,onEdgeUpdateEnd:A,onNodesDelete:C,onConnectStart:g,onConnect:x,onConnectEnd:y,onMoveEnd:_,connectionLineComponent:Fpe,onSelectionChange:S,isValidConnection:u,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:Kme,style:{borderRadius:p},onPaneClick:j,deleteKeyCode:Wme,selectionMode:s,children:a.jsx(EN,{})})},Qme=()=>{const e=te(),{t}=Z(),n=d.useCallback(()=>{e(VI())},[e]);return a.jsx(N,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(Be,{tooltip:t("nodes.addNodeToolTip"),"aria-label":t("nodes.addNode"),icon:a.jsx(Xa,{}),onClick:n})})},Yme=d.memo(Qme),Zme=()=>{const e=te(),t=yP("nodes"),{t:n}=Z();return d.useCallback(o=>{if(!o)return;const s=new FileReader;s.onload=async()=>{const l=s.result;try{const i=JSON.parse(String(l)),u=k9.safeParse(i);if(!u.success){const{message:p}=_9(u.error,{prefix:n("nodes.workflowValidation")});t.error({error:j9(u.error)},p),e(lt(Qt({title:n("nodes.unableToValidateWorkflow"),status:"error",duration:5e3}))),s.abort();return}e(rb(u.data)),s.abort()}catch{e(lt(Qt({title:n("nodes.unableToLoadWorkflow"),status:"error"})))}},s.readAsText(o)},[e,t,n])},Jme=d.memo(e=>e.error.issues[0]?a.jsx(be,{children:Fw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Ad,{children:e.error.issues.map((t,n)=>a.jsx(ho,{children:a.jsx(be,{children:Fw(t,{prefix:null}).toString()})},n))}));Jme.displayName="WorkflowValidationErrorContent";const ehe=()=>{const{t:e}=Z(),t=d.useRef(null),n=Zme();return a.jsx(BE,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(Be,{icon:a.jsx(fg,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},the=d.memo(ehe),nhe=()=>{const{t:e}=Z(),t=te(),{isOpen:n,onOpen:r,onClose:o}=Lr(),s=d.useRef(null),l=W(u=>u.nodes.nodes.length),i=d.useCallback(()=>{t(I9()),t(lt(Qt({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Be,{icon:a.jsx(Fr,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!l,colorScheme:"error"}),a.jsxs(Ld,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(zd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Jo,{py:4,children:a.jsxs(N,{flexDir:"column",gap:2,children:[a.jsx(be,{children:e("nodes.resetWorkflowDesc")}),a.jsx(be,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(ks,{children:[a.jsx(Ja,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(Ja,{colorScheme:"error",ml:3,onClick:i,children:e("common.accept")})]})]})]})]})},rhe=d.memo(nhe),ohe=()=>{const{t:e}=Z(),t=vO(),n=d.useCallback(()=>{const r=new Blob([JSON.stringify(t,null,2)]),o=document.createElement("a");o.href=URL.createObjectURL(r),o.download=`${t.name||"My Workflow"}.json`,document.body.appendChild(o),o.click(),o.remove()},[t]);return a.jsx(Be,{icon:a.jsx(Gc,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},she=d.memo(ohe),ahe=()=>a.jsxs(N,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(she,{}),a.jsx(the,{}),a.jsx(rhe,{})]}),lhe=d.memo(ahe),ihe=()=>a.jsx(N,{sx:{gap:2,flexDir:"column"},children:Sr(_d,({title:e,description:t,color:n},r)=>a.jsx(Vt,{label:t,children:a.jsx(As,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),che=d.memo(ihe),uhe=()=>{const{t:e}=Z(),t=te(),n=d.useCallback(()=>{t(P9())},[t]);return a.jsx(ot,{leftIcon:a.jsx(mee,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},dhe=d.memo(uhe),Du={fontWeight:600},fhe=le(ge,({nodes:e})=>{const{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionMode:s}=e;return{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionModeIsChecked:s===E9.Full}},Ce),phe=_e((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Lr(),s=te(),{shouldAnimateEdges:l,shouldValidateGraph:i,shouldSnapToGrid:u,shouldColorEdges:p,selectionModeIsChecked:m}=W(fhe),h=d.useCallback(S=>{s(M9(S.target.checked))},[s]),g=d.useCallback(S=>{s(O9(S.target.checked))},[s]),x=d.useCallback(S=>{s(D9(S.target.checked))},[s]),y=d.useCallback(S=>{s(R9(S.target.checked))},[s]),b=d.useCallback(S=>{s(A9(S.target.checked))},[s]),{t:C}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Be,{ref:t,"aria-label":C("nodes.workflowSettings"),tooltip:C("nodes.workflowSettings"),icon:a.jsx(gM,{}),onClick:r}),a.jsxs(ql,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{children:C("nodes.workflowSettings")}),a.jsx(Fd,{}),a.jsx(Jo,{children:a.jsxs(N,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(cr,{size:"sm",children:"General"}),a.jsx(kn,{formLabelProps:Du,onChange:g,isChecked:l,label:C("nodes.animatedEdges"),helperText:C("nodes.animatedEdgesHelp")}),a.jsx(Yn,{}),a.jsx(kn,{formLabelProps:Du,isChecked:u,onChange:x,label:C("nodes.snapToGrid"),helperText:C("nodes.snapToGridHelp")}),a.jsx(Yn,{}),a.jsx(kn,{formLabelProps:Du,isChecked:p,onChange:y,label:C("nodes.colorCodeEdges"),helperText:C("nodes.colorCodeEdgesHelp")}),a.jsx(kn,{formLabelProps:Du,isChecked:m,onChange:b,label:C("nodes.fullyContainNodes"),helperText:C("nodes.fullyContainNodesHelp")}),a.jsx(cr,{size:"sm",pt:4,children:"Advanced"}),a.jsx(kn,{formLabelProps:Du,isChecked:i,onChange:h,label:C("nodes.validateConnections"),helperText:C("nodes.validateConnectionsHelp")}),a.jsx(dhe,{})]})})]})]})]})}),mhe=d.memo(phe),hhe=()=>{const e=W(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs(N,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(mhe,{}),e&&a.jsx(che,{})]})},ghe=d.memo(hhe);function vhe(){const e=te(),t=W(o=>o.nodes.nodeOpacity),{t:n}=Z(),r=d.useCallback(o=>{e(T9(o))},[e]);return a.jsx(N,{alignItems:"center",children:a.jsxs(Yb,{"aria-label":n("nodes.nodeOpacity"),value:t,min:.5,max:1,step:.01,onChange:r,orientation:"vertical",defaultValue:30,h:"calc(100% - 0.5rem)",children:[a.jsx(Jb,{children:a.jsx(ey,{})}),a.jsx(Zb,{})]})})}const xhe=()=>{const{t:e}=Z(),{zoomIn:t,zoomOut:n,fitView:r}=db(),o=te(),s=W(m=>m.nodes.shouldShowMinimapPanel),l=d.useCallback(()=>{t()},[t]),i=d.useCallback(()=>{n()},[n]),u=d.useCallback(()=>{r()},[r]),p=d.useCallback(()=>{o($9(!s))},[s,o]);return a.jsxs(Ht,{isAttached:!0,orientation:"vertical",children:[a.jsx(Be,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:l,icon:a.jsx(Moe,{})}),a.jsx(Be,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:i,icon:a.jsx(Eoe,{})}),a.jsx(Be,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:u,icon:a.jsx(vM,{})}),a.jsx(Be,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(ree,{})})]})},bhe=d.memo(xhe),yhe=()=>a.jsxs(N,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(bhe,{}),a.jsx(vhe,{})]}),Che=d.memo(yhe),whe=Se(SN),She=()=>{const e=W(r=>r.nodes.shouldShowMinimapPanel),t=aa("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=aa("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx(N,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(whe,{pannable:!0,zoomable:!0,nodeBorderRadius:15,sx:{m:"0 !important",backgroundColor:"base.200 !important",borderRadius:"base",_dark:{backgroundColor:"base.500 !important"},svg:{borderRadius:"inherit"}},nodeColor:t,maskColor:n})})},khe=d.memo(She),_he=()=>{const e=W(n=>n.nodes.isReady),{t}=Z();return a.jsxs(N,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(dr,{children:e&&a.jsxs(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"relative",width:"100%",height:"100%"},children:[a.jsx(Xme,{}),a.jsx($pe,{}),a.jsx(Yme,{}),a.jsx(lhe,{}),a.jsx(ghe,{}),a.jsx(Che,{}),a.jsx(khe,{})]})}),a.jsx(dr,{children:!e&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"absolute",width:"100%",height:"100%"},children:a.jsx(N,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(tr,{label:t("nodes.loadingNodes"),icon:Ooe})})})})]})},jhe=d.memo(_he),Ihe=()=>a.jsx(N9,{children:a.jsx(jhe,{})}),Phe=d.memo(Ihe),Ehe=()=>{const{t:e}=Z(),t=te(),{data:n}=Id(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=L9({fixedCacheKey:"clearInvocationCache"}),l=d.useMemo(()=>!(n!=null&&n.size)||!r,[n==null?void 0:n.size,r]);return{clearInvocationCache:d.useCallback(async()=>{if(!l)try{await o().unwrap(),t(lt({title:e("invocationCache.clearSucceeded"),status:"success"}))}catch{t(lt({title:e("invocationCache.clearFailed"),status:"error"}))}},[l,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:l}},Mhe=()=>{const{t:e}=Z(),{clearInvocationCache:t,isDisabled:n,isLoading:r}=Ehe();return a.jsx(ot,{isDisabled:n,isLoading:r,onClick:t,children:e("invocationCache.clear")})},Ohe=d.memo(Mhe),Dhe=()=>{const{t:e}=Z(),t=te(),{data:n}=Id(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=z9({fixedCacheKey:"disableInvocationCache"}),l=d.useMemo(()=>!(n!=null&&n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{disableInvocationCache:d.useCallback(async()=>{if(!l)try{await o().unwrap(),t(lt({title:e("invocationCache.disableSucceeded"),status:"success"}))}catch{t(lt({title:e("invocationCache.disableFailed"),status:"error"}))}},[l,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:l}},Rhe=()=>{const{t:e}=Z(),t=te(),{data:n}=Id(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=F9({fixedCacheKey:"enableInvocationCache"}),l=d.useMemo(()=>(n==null?void 0:n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{enableInvocationCache:d.useCallback(async()=>{if(!l)try{await o().unwrap(),t(lt({title:e("invocationCache.enableSucceeded"),status:"success"}))}catch{t(lt({title:e("invocationCache.enableFailed"),status:"error"}))}},[l,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:l}},Ahe=()=>{const{t:e}=Z(),{data:t}=Id(),{enableInvocationCache:n,isDisabled:r,isLoading:o}=Rhe(),{disableInvocationCache:s,isDisabled:l,isLoading:i}=Dhe();return t!=null&&t.enabled?a.jsx(ot,{isDisabled:l,isLoading:i,onClick:s,children:e("invocationCache.disable")}):a.jsx(ot,{isDisabled:r,isLoading:o,onClick:n,children:e("invocationCache.enable")})},The=d.memo(Ahe),$he=({children:e,...t})=>a.jsx(mP,{alignItems:"center",justifyContent:"center",w:"full",h:"full",layerStyle:"second",borderRadius:"base",py:2,px:3,gap:6,flexWrap:"nowrap",...t,children:e}),b7=d.memo($he),Nhe={'&[aria-disabled="true"]':{color:"base.400",_dark:{color:"base.500"}}},Lhe=({label:e,value:t,isDisabled:n=!1,...r})=>a.jsxs(pP,{flexGrow:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","aria-disabled":n,sx:Nhe,...r,children:[a.jsx(hP,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:e}),a.jsx(gP,{children:t})]}),gs=d.memo(Lhe),zhe=()=>{const{t:e}=Z(),{data:t}=Id(void 0);return a.jsxs(b7,{children:[a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.cacheSize"),value:(t==null?void 0:t.size)??0}),a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.hits"),value:(t==null?void 0:t.hits)??0}),a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.misses"),value:(t==null?void 0:t.misses)??0}),a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.maxCacheSize"),value:(t==null?void 0:t.max_size)??0}),a.jsxs(Ht,{w:24,orientation:"vertical",size:"xs",children:[a.jsx(Ohe,{}),a.jsx(The,{})]})]})},Fhe=d.memo(zhe),y7=e=>{const t=W(i=>i.system.isConnected),[n,{isLoading:r}]=sb(),o=te(),{t:s}=Z();return{cancelQueueItem:d.useCallback(async()=>{try{await n(e).unwrap(),o(lt({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(lt({title:s("queue.cancelFailed"),status:"error"}))}},[o,e,s,n]),isLoading:r,isDisabled:!t}},C7=(e,t)=>Number(((Date.parse(t)-Date.parse(e))/1e3).toFixed(2)),Dj={pending:{colorScheme:"cyan",translationKey:"queue.pending"},in_progress:{colorScheme:"yellow",translationKey:"queue.in_progress"},completed:{colorScheme:"green",translationKey:"queue.completed"},failed:{colorScheme:"red",translationKey:"queue.failed"},canceled:{colorScheme:"orange",translationKey:"queue.canceled"}},Bhe=({status:e})=>{const{t}=Z();return a.jsx(As,{colorScheme:Dj[e].colorScheme,children:t(Dj[e].translationKey)})},Hhe=d.memo(Bhe),Vhe=e=>{const t=W(u=>u.system.isConnected),{isCanceled:n}=B9({batch_id:e},{selectFromResult:({data:u})=>u?{isCanceled:(u==null?void 0:u.in_progress)===0&&(u==null?void 0:u.pending)===0}:{isCanceled:!0}}),[r,{isLoading:o}]=H9({fixedCacheKey:"cancelByBatchIds"}),s=te(),{t:l}=Z();return{cancelBatch:d.useCallback(async()=>{if(!n)try{await r({batch_ids:[e]}).unwrap(),s(lt({title:l("queue.cancelBatchSucceeded"),status:"success"}))}catch{s(lt({title:l("queue.cancelBatchFailed"),status:"error"}))}},[e,s,n,l,r]),isLoading:o,isCanceled:n,isDisabled:!t}},Whe=({queueItemDTO:e})=>{const{session_id:t,batch_id:n,item_id:r}=e,{t:o}=Z(),{cancelBatch:s,isLoading:l,isCanceled:i}=Vhe(n),{cancelQueueItem:u,isLoading:p}=y7(r),{data:m}=V9(r),h=d.useMemo(()=>{if(!m)return o("common.loading");if(!m.completed_at||!m.started_at)return o(`queue.${m.status}`);const g=C7(m.started_at,m.completed_at);return m.status==="completed"?`${o("queue.completedIn")} ${g}${g===1?"":"s"}`:`${g}s`},[m,o]);return a.jsxs(N,{layerStyle:"third",flexDir:"column",p:2,pt:0,borderRadius:"base",gap:2,children:[a.jsxs(N,{layerStyle:"second",p:2,gap:2,justifyContent:"space-between",alignItems:"center",borderRadius:"base",h:20,children:[a.jsx(Np,{label:o("queue.status"),data:h}),a.jsx(Np,{label:o("queue.item"),data:r}),a.jsx(Np,{label:o("queue.batch"),data:n}),a.jsx(Np,{label:o("queue.session"),data:t}),a.jsxs(Ht,{size:"xs",orientation:"vertical",children:[a.jsx(ot,{onClick:u,isLoading:p,isDisabled:m?["canceled","completed","failed"].includes(m.status):!0,"aria-label":o("queue.cancelItem"),icon:a.jsx(Ec,{}),colorScheme:"error",children:o("queue.cancelItem")}),a.jsx(ot,{onClick:s,isLoading:l,isDisabled:i,"aria-label":o("queue.cancelBatch"),icon:a.jsx(Ec,{}),colorScheme:"error",children:o("queue.cancelBatch")})]})]}),(m==null?void 0:m.error)&&a.jsxs(N,{layerStyle:"second",p:3,gap:1,justifyContent:"space-between",alignItems:"flex-start",borderRadius:"base",flexDir:"column",children:[a.jsx(cr,{size:"sm",color:"error.500",_dark:{color:"error.400"},children:"Error"}),a.jsx("pre",{children:m.error})]}),a.jsx(N,{layerStyle:"second",h:512,w:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",children:m?a.jsx(ef,{children:a.jsx(Za,{label:"Queue Item",data:m})}):a.jsx(fa,{opacity:.5})})]})},Uhe=d.memo(Whe),Np=({label:e,data:t})=>a.jsxs(N,{flexDir:"column",justifyContent:"flex-start",p:1,gap:1,overflow:"hidden",h:"full",w:"full",children:[a.jsx(cr,{size:"md",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e}),a.jsx(be,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t})]}),xs={number:"3rem",statusBadge:"5.7rem",statusDot:2,time:"4rem",batchId:"5rem",fieldValues:"auto",actions:"auto"},Rj={bg:"base.300",_dark:{bg:"base.750"}},Ghe={_hover:Rj,"&[aria-selected='true']":Rj},Khe=({index:e,item:t,context:n})=>{const{t:r}=Z(),o=d.useCallback(()=>{n.toggleQueueItem(t.item_id)},[n,t.item_id]),{cancelQueueItem:s,isLoading:l}=y7(t.item_id),i=d.useCallback(h=>{h.stopPropagation(),s()},[s]),u=d.useMemo(()=>n.openQueueItems.includes(t.item_id),[n.openQueueItems,t.item_id]),p=d.useMemo(()=>!t.completed_at||!t.started_at?void 0:`${C7(t.started_at,t.completed_at)}s`,[t]),m=d.useMemo(()=>["canceled","completed","failed"].includes(t.status),[t.status]);return a.jsxs(N,{flexDir:"column","aria-selected":u,fontSize:"sm",borderRadius:"base",justifyContent:"center",sx:Ghe,"data-testid":"queue-item",children:[a.jsxs(N,{minH:9,alignItems:"center",gap:4,p:1.5,cursor:"pointer",onClick:o,children:[a.jsx(N,{w:xs.number,justifyContent:"flex-end",alignItems:"center",flexShrink:0,children:a.jsx(be,{variant:"subtext",children:e+1})}),a.jsx(N,{w:xs.statusBadge,alignItems:"center",flexShrink:0,children:a.jsx(Hhe,{status:t.status})}),a.jsx(N,{w:xs.time,alignItems:"center",flexShrink:0,children:p||"-"}),a.jsx(N,{w:xs.batchId,flexShrink:0,children:a.jsx(be,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",alignItems:"center",children:t.batch_id})}),a.jsx(N,{alignItems:"center",overflow:"hidden",flexGrow:1,children:t.field_values&&a.jsx(N,{gap:2,w:"full",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:t.field_values.filter(h=>h.node_path!=="metadata_accumulator").map(({node_path:h,field_name:g,value:x})=>a.jsxs(be,{as:"span",children:[a.jsxs(be,{as:"span",fontWeight:600,children:[h,".",g]}),": ",x]},`${t.item_id}.${h}.${g}.${x}`))})}),a.jsx(N,{alignItems:"center",w:xs.actions,pe:3,children:a.jsx(Ht,{size:"xs",variant:"ghost",children:a.jsx(Be,{onClick:i,isDisabled:m,isLoading:l,"aria-label":r("queue.cancelItem"),icon:a.jsx(Ec,{})})})})]}),a.jsx(Md,{in:u,transition:{enter:{duration:.1},exit:{duration:.1}},unmountOnExit:!0,children:a.jsx(Uhe,{queueItemDTO:t})})]})},qhe=d.memo(Khe),Xhe=d.memo(_e((e,t)=>a.jsx(N,{...e,ref:t,flexDirection:"column",gap:.5,children:e.children}))),Qhe=d.memo(Xhe),Yhe=()=>a.jsxs(N,{alignItems:"center",gap:4,p:1,pb:2,textTransform:"uppercase",fontWeight:700,fontSize:"xs",letterSpacing:1,children:[a.jsx(N,{w:xs.number,justifyContent:"flex-end",alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"#"})}),a.jsx(N,{ps:.5,w:xs.statusBadge,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"status"})}),a.jsx(N,{ps:.5,w:xs.time,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"time"})}),a.jsx(N,{ps:.5,w:xs.batchId,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"batch"})}),a.jsx(N,{ps:.5,w:xs.fieldValues,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"batch field values"})})]}),Zhe=d.memo(Yhe),Jhe={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},ege=le(ge,({queue:e})=>{const{listCursor:t,listPriority:n}=e;return{listCursor:t,listPriority:n}},Ce),tge=(e,t)=>t.item_id,nge={List:Qhe},rge=(e,t,n)=>a.jsx(qhe,{index:e,item:t,context:n}),oge=()=>{const{listCursor:e,listPriority:t}=W(ege),n=te(),r=d.useRef(null),[o,s]=d.useState(null),[l,i]=$y(Jhe),{t:u}=Z();d.useEffect(()=>{const{current:S}=r;return o&&S&&l({target:S,elements:{viewport:o}}),()=>{var _;return(_=i())==null?void 0:_.destroy()}},[o,l,i]);const{data:p,isLoading:m}=W9({cursor:e,priority:t}),h=d.useMemo(()=>p?U9.getSelectors().selectAll(p):[],[p]),g=d.useCallback(()=>{if(!(p!=null&&p.has_more))return;const S=h[h.length-1];S&&(n(ab(S.item_id)),n(lb(S.priority)))},[n,p==null?void 0:p.has_more,h]),[x,y]=d.useState([]),b=d.useCallback(S=>{y(_=>_.includes(S)?_.filter(j=>j!==S):[..._,S])},[]),C=d.useMemo(()=>({openQueueItems:x,toggleQueueItem:b}),[x,b]);return m?a.jsx(Kne,{}):h.length?a.jsxs(N,{w:"full",h:"full",flexDir:"column",children:[a.jsx(Zhe,{}),a.jsx(N,{ref:r,w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(ooe,{data:h,endReached:g,scrollerRef:s,itemContent:rge,computeItemKey:tge,components:nge,context:C})})]}):a.jsx(N,{w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(cr,{color:"base.400",_dark:{color:"base.500"},children:u("queue.queueEmpty")})})},sge=d.memo(oge),age=()=>{const{data:e}=va(),{t}=Z();return a.jsxs(b7,{"data-testid":"queue-status",children:[a.jsx(gs,{label:t("queue.in_progress"),value:(e==null?void 0:e.queue.in_progress)??0}),a.jsx(gs,{label:t("queue.pending"),value:(e==null?void 0:e.queue.pending)??0}),a.jsx(gs,{label:t("queue.completed"),value:(e==null?void 0:e.queue.completed)??0}),a.jsx(gs,{label:t("queue.failed"),value:(e==null?void 0:e.queue.failed)??0}),a.jsx(gs,{label:t("queue.canceled"),value:(e==null?void 0:e.queue.canceled)??0}),a.jsx(gs,{label:t("queue.total"),value:(e==null?void 0:e.queue.total)??0})]})},lge=d.memo(age);function ige(e){return Te({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828l.645-1.937zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.734 1.734 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.734 1.734 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.734 1.734 0 0 0 3.407 2.31l.387-1.162zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L10.863.1z"}}]})(e)}const cge=()=>{const e=te(),{t}=Z(),n=W(u=>u.system.isConnected),[r,{isLoading:o}]=$I({fixedCacheKey:"pruneQueue"}),{finishedCount:s}=va(void 0,{selectFromResult:({data:u})=>u?{finishedCount:u.queue.completed+u.queue.canceled+u.queue.failed}:{finishedCount:0}}),l=d.useCallback(async()=>{if(s)try{const u=await r().unwrap();e(lt({title:t("queue.pruneSucceeded",{item_count:u.deleted}),status:"success"})),e(ab(void 0)),e(lb(void 0))}catch{e(lt({title:t("queue.pruneFailed"),status:"error"}))}},[s,r,e,t]),i=d.useMemo(()=>!n||!s,[s,n]);return{pruneQueue:l,isLoading:o,finishedCount:s,isDisabled:i}},uge=({asIconButton:e})=>{const{t}=Z(),{pruneQueue:n,isLoading:r,finishedCount:o,isDisabled:s}=cge();return a.jsx(ui,{isDisabled:s,isLoading:r,asIconButton:e,label:t("queue.prune"),tooltip:t("queue.pruneTooltip",{item_count:o}),icon:a.jsx(ige,{}),onClick:n,colorScheme:"blue"})},dge=d.memo(uge),fge=()=>{const e=$t("pauseQueue").isFeatureEnabled,t=$t("resumeQueue").isFeatureEnabled;return a.jsxs(N,{layerStyle:"second",borderRadius:"base",p:2,gap:2,children:[e||t?a.jsxs(Ht,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[t?a.jsx(nO,{}):a.jsx(a.Fragment,{}),e?a.jsx(Q8,{}):a.jsx(a.Fragment,{})]}):a.jsx(a.Fragment,{}),a.jsxs(Ht,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[a.jsx(dge,{}),a.jsx(t2,{})]})]})},pge=d.memo(fge),mge=()=>{const e=$t("invocationCache").isFeatureEnabled;return a.jsxs(N,{layerStyle:"first",borderRadius:"base",w:"full",h:"full",p:2,flexDir:"column",gap:2,children:[a.jsxs(N,{gap:2,w:"full",children:[a.jsx(pge,{}),a.jsx(lge,{}),e&&a.jsx(Fhe,{})]}),a.jsx(Ie,{layerStyle:"second",p:2,borderRadius:"base",w:"full",h:"full",children:a.jsx(sge,{})})]})},hge=d.memo(mge),gge=()=>a.jsx(hge,{}),vge=d.memo(gge),xge=()=>a.jsx(n7,{}),bge=d.memo(xge);var Nx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=Bw;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=Bw;e.exports=r.Konva})(Nx,Nx.exports);var yge=Nx.exports;const bd=Cd(yge);var w7={exports:{}};/**
+ * @license React
+ * react-reconciler.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Cge=function(t){var n={},r=d,o=Lp,s=Object.assign;function l(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,v=1;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),I=Symbol.iterator;function M(c){return c===null||typeof c!="object"?null:(c=I&&c[I]||c["@@iterator"],typeof c=="function"?c:null)}function D(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case m:return"Fragment";case p:return"Portal";case g:return"Profiler";case h:return"StrictMode";case C:return"Suspense";case S:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case y:return(c.displayName||"Context")+".Consumer";case x:return(c._context.displayName||"Context")+".Provider";case b:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case _:return f=c.displayName||null,f!==null?f:D(c.type)||"Memo";case j:f=c._payload,c=c._init;try{return D(c(f))}catch{}}return null}function R(c){var f=c.type;switch(c.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=f.render,c=c.displayName||c.name||"",f.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return D(f);case 8:return f===h?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function A(c){var f=c,v=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(v=f.return),c=f.return;while(c)}return f.tag===3?v:null}function O(c){if(A(c)!==c)throw Error(l(188))}function $(c){var f=c.alternate;if(!f){if(f=A(c),f===null)throw Error(l(188));return f!==c?null:c}for(var v=c,w=f;;){var k=v.return;if(k===null)break;var P=k.alternate;if(P===null){if(w=k.return,w!==null){v=w;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===v)return O(k),c;if(P===w)return O(k),f;P=P.sibling}throw Error(l(188))}if(v.return!==w.return)v=k,w=P;else{for(var L=!1,ne=k.child;ne;){if(ne===v){L=!0,v=k,w=P;break}if(ne===w){L=!0,w=k,v=P;break}ne=ne.sibling}if(!L){for(ne=P.child;ne;){if(ne===v){L=!0,v=P,w=k;break}if(ne===w){L=!0,w=P,v=k;break}ne=ne.sibling}if(!L)throw Error(l(189))}}if(v.alternate!==w)throw Error(l(190))}if(v.tag!==3)throw Error(l(188));return v.stateNode.current===v?c:f}function X(c){return c=$(c),c!==null?z(c):null}function z(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=z(c);if(f!==null)return f;c=c.sibling}return null}function V(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var f=V(c);if(f!==null)return f}c=c.sibling}return null}var Q=Array.isArray,G=t.getPublicInstance,F=t.getRootHostContext,U=t.getChildHostContext,T=t.prepareForCommit,B=t.resetAfterCommit,Y=t.createInstance,re=t.appendInitialChild,ae=t.finalizeInitialChildren,oe=t.prepareUpdate,q=t.shouldSetTextContent,K=t.createTextInstance,ee=t.scheduleTimeout,ce=t.cancelTimeout,J=t.noTimeout,ie=t.isPrimaryRenderer,de=t.supportsMutation,xe=t.supportsPersistence,we=t.supportsHydration,ve=t.getInstanceFromNode,fe=t.preparePortalMount,Oe=t.getCurrentEventPriority,je=t.detachDeletedInstance,$e=t.supportsMicrotasks,st=t.scheduleMicrotask,Ve=t.supportsTestSelectors,Ct=t.findFiberRoot,Ye=t.getBoundingRect,Ke=t.getTextContent,he=t.isHiddenSubtree,Re=t.matchAccessibilityRole,ut=t.setFocusIfFocusable,yt=t.setupIntersectionObserver,ye=t.appendChild,et=t.appendChildToContainer,ct=t.commitTextUpdate,ft=t.commitMount,Me=t.commitUpdate,Ne=t.insertBefore,Ut=t.insertInContainerBefore,ke=t.removeChild,ze=t.removeChildFromContainer,Le=t.resetTextContent,Ge=t.hideInstance,pt=t.hideTextInstance,Pn=t.unhideInstance,Rt=t.unhideTextInstance,At=t.clearContainer,pr=t.cloneInstance,Nn=t.createContainerChildSet,wn=t.appendChildToContainerChildSet,hn=t.finalizeContainerChildren,an=t.replaceContainerChildren,_r=t.cloneHiddenInstance,Mo=t.cloneHiddenTextInstance,mr=t.canHydrateInstance,hr=t.canHydrateTextInstance,Ns=t.canHydrateSuspenseInstance,Ls=t.isSuspenseInstancePending,Sa=t.isSuspenseInstanceFallback,ka=t.getSuspenseInstanceFallbackErrorDetails,mi=t.registerSuspenseInstanceRetry,_a=t.getNextHydratableSibling,hi=t.getFirstHydratableChild,Ze=t.getFirstHydratableChildWithinContainer,Gt=t.getFirstHydratableChildWithinSuspenseInstance,Ln=t.hydrateInstance,kt=t.hydrateTextInstance,ja=t.hydrateSuspenseInstance,Vr=t.getNextHydratableInstanceAfterSuspenseInstance,nf=t.commitHydratedContainer,Hg=t.commitHydratedSuspenseInstance,Vg=t.clearSuspenseBoundary,zn=t.clearSuspenseBoundaryFromContainer,zs=t.shouldDeleteUnhydratedTailInstances,rf=t.didNotMatchHydratedContainerTextInstance,gi=t.didNotMatchHydratedTextInstance,tu;function vl(c){if(tu===void 0)try{throw Error()}catch(v){var f=v.stack.trim().match(/\n( *(at )?)/);tu=f&&f[1]||""}return`
+`+tu+c}var nu=!1;function ru(c,f){if(!c||nu)return"";nu=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ee){var w=Ee}Reflect.construct(c,[],f)}else{try{f.call()}catch(Ee){w=Ee}c.call(f.prototype)}else{try{throw Error()}catch(Ee){w=Ee}c()}}catch(Ee){if(Ee&&w&&typeof Ee.stack=="string"){for(var k=Ee.stack.split(`
+`),P=w.stack.split(`
+`),L=k.length-1,ne=P.length-1;1<=L&&0<=ne&&k[L]!==P[ne];)ne--;for(;1<=L&&0<=ne;L--,ne--)if(k[L]!==P[ne]){if(L!==1||ne!==1)do if(L--,ne--,0>ne||k[L]!==P[ne]){var pe=`
+`+k[L].replace(" at new "," at ");return c.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",c.displayName)),pe}while(1<=L&&0<=ne);break}}}finally{nu=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?vl(c):""}var Wg=Object.prototype.hasOwnProperty,Ia=[],nt=-1;function Et(c){return{current:c}}function _t(c){0>nt||(c.current=Ia[nt],Ia[nt]=null,nt--)}function Mt(c,f){nt++,Ia[nt]=c.current,c.current=f}var nr={},rn=Et(nr),Rn=Et(!1),gr=nr;function vi(c,f){var v=c.type.contextTypes;if(!v)return nr;var w=c.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===f)return w.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in v)k[P]=f[P];return w&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=k),k}function jr(c){return c=c.childContextTypes,c!=null}function of(){_t(Rn),_t(rn)}function w2(c,f,v){if(rn.current!==nr)throw Error(l(168));Mt(rn,f),Mt(Rn,v)}function S2(c,f,v){var w=c.stateNode;if(f=f.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var k in w)if(!(k in f))throw Error(l(108,R(c)||"Unknown",k));return s({},v,w)}function sf(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||nr,gr=rn.current,Mt(rn,c),Mt(Rn,Rn.current),!0}function k2(c,f,v){var w=c.stateNode;if(!w)throw Error(l(169));v?(c=S2(c,f,gr),w.__reactInternalMemoizedMergedChildContext=c,_t(Rn),_t(rn),Mt(rn,c)):_t(Rn),Mt(Rn,v)}var Oo=Math.clz32?Math.clz32:N7,T7=Math.log,$7=Math.LN2;function N7(c){return c>>>=0,c===0?32:31-(T7(c)/$7|0)|0}var af=64,lf=4194304;function ou(c){switch(c&-c){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function cf(c,f){var v=c.pendingLanes;if(v===0)return 0;var w=0,k=c.suspendedLanes,P=c.pingedLanes,L=v&268435455;if(L!==0){var ne=L&~k;ne!==0?w=ou(ne):(P&=L,P!==0&&(w=ou(P)))}else L=v&~k,L!==0?w=ou(L):P!==0&&(w=ou(P));if(w===0)return 0;if(f!==0&&f!==w&&!(f&k)&&(k=w&-w,P=f&-f,k>=P||k===16&&(P&4194240)!==0))return f;if(w&4&&(w|=v&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=w;0<f;)v=31-Oo(f),k=1<<v,w|=c[v],f&=~k;return w}function L7(c,f){switch(c){case 1:case 2:case 4:return f+250;case 8: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 f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function z7(c,f){for(var v=c.suspendedLanes,w=c.pingedLanes,k=c.expirationTimes,P=c.pendingLanes;0<P;){var L=31-Oo(P),ne=1<<L,pe=k[L];pe===-1?(!(ne&v)||ne&w)&&(k[L]=L7(ne,f)):pe<=f&&(c.expiredLanes|=ne),P&=~ne}}function Ug(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function _2(){var c=af;return af<<=1,!(af&4194240)&&(af=64),c}function Gg(c){for(var f=[],v=0;31>v;v++)f.push(c);return f}function su(c,f,v){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Oo(f),c[f]=v}function F7(c,f){var v=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var w=c.eventTimes;for(c=c.expirationTimes;0<v;){var k=31-Oo(v),P=1<<k;f[k]=0,w[k]=-1,c[k]=-1,v&=~P}}function Kg(c,f){var v=c.entangledLanes|=f;for(c=c.entanglements;v;){var w=31-Oo(v),k=1<<w;k&f|c[w]&f&&(c[w]|=f),v&=~k}}var Nt=0;function j2(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var qg=o.unstable_scheduleCallback,I2=o.unstable_cancelCallback,B7=o.unstable_shouldYield,H7=o.unstable_requestPaint,Gn=o.unstable_now,Xg=o.unstable_ImmediatePriority,V7=o.unstable_UserBlockingPriority,Qg=o.unstable_NormalPriority,W7=o.unstable_IdlePriority,uf=null,as=null;function U7(c){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(uf,c,void 0,(c.current.flags&128)===128)}catch{}}function G7(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var Do=typeof Object.is=="function"?Object.is:G7,Fs=null,df=!1,Yg=!1;function P2(c){Fs===null?Fs=[c]:Fs.push(c)}function K7(c){df=!0,P2(c)}function ls(){if(!Yg&&Fs!==null){Yg=!0;var c=0,f=Nt;try{var v=Fs;for(Nt=1;c<v.length;c++){var w=v[c];do w=w(!0);while(w!==null)}Fs=null,df=!1}catch(k){throw Fs!==null&&(Fs=Fs.slice(c+1)),qg(Xg,ls),k}finally{Nt=f,Yg=!1}}return null}var xi=[],bi=0,ff=null,pf=0,no=[],ro=0,xl=null,Bs=1,Hs="";function bl(c,f){xi[bi++]=pf,xi[bi++]=ff,ff=c,pf=f}function E2(c,f,v){no[ro++]=Bs,no[ro++]=Hs,no[ro++]=xl,xl=c;var w=Bs;c=Hs;var k=32-Oo(w)-1;w&=~(1<<k),v+=1;var P=32-Oo(f)+k;if(30<P){var L=k-k%5;P=(w&(1<<L)-1).toString(32),w>>=L,k-=L,Bs=1<<32-Oo(f)+k|v<<k|w,Hs=P+c}else Bs=1<<P|v<<k|w,Hs=c}function Zg(c){c.return!==null&&(bl(c,1),E2(c,1,0))}function Jg(c){for(;c===ff;)ff=xi[--bi],xi[bi]=null,pf=xi[--bi],xi[bi]=null;for(;c===xl;)xl=no[--ro],no[ro]=null,Hs=no[--ro],no[ro]=null,Bs=no[--ro],no[ro]=null}var Wr=null,oo=null,ln=!1,au=!1,Ro=null;function M2(c,f){var v=co(5,null,null,0);v.elementType="DELETED",v.stateNode=f,v.return=c,f=c.deletions,f===null?(c.deletions=[v],c.flags|=16):f.push(v)}function O2(c,f){switch(c.tag){case 5:return f=mr(f,c.type,c.pendingProps),f!==null?(c.stateNode=f,Wr=c,oo=hi(f),!0):!1;case 6:return f=hr(f,c.pendingProps),f!==null?(c.stateNode=f,Wr=c,oo=null,!0):!1;case 13:if(f=Ns(f),f!==null){var v=xl!==null?{id:Bs,overflow:Hs}:null;return c.memoizedState={dehydrated:f,treeContext:v,retryLane:1073741824},v=co(18,null,null,0),v.stateNode=f,v.return=c,c.child=v,Wr=c,oo=null,!0}return!1;default:return!1}}function e0(c){return(c.mode&1)!==0&&(c.flags&128)===0}function t0(c){if(ln){var f=oo;if(f){var v=f;if(!O2(c,f)){if(e0(c))throw Error(l(418));f=_a(v);var w=Wr;f&&O2(c,f)?M2(w,v):(c.flags=c.flags&-4097|2,ln=!1,Wr=c)}}else{if(e0(c))throw Error(l(418));c.flags=c.flags&-4097|2,ln=!1,Wr=c}}}function D2(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Wr=c}function mf(c){if(!we||c!==Wr)return!1;if(!ln)return D2(c),ln=!0,!1;if(c.tag!==3&&(c.tag!==5||zs(c.type)&&!q(c.type,c.memoizedProps))){var f=oo;if(f){if(e0(c))throw R2(),Error(l(418));for(;f;)M2(c,f),f=_a(f)}}if(D2(c),c.tag===13){if(!we)throw Error(l(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));oo=Vr(c)}else oo=Wr?_a(c.stateNode):null;return!0}function R2(){for(var c=oo;c;)c=_a(c)}function yi(){we&&(oo=Wr=null,au=ln=!1)}function n0(c){Ro===null?Ro=[c]:Ro.push(c)}var q7=i.ReactCurrentBatchConfig;function hf(c,f){if(Do(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var v=Object.keys(c),w=Object.keys(f);if(v.length!==w.length)return!1;for(w=0;w<v.length;w++){var k=v[w];if(!Wg.call(f,k)||!Do(c[k],f[k]))return!1}return!0}function X7(c){switch(c.tag){case 5:return vl(c.type);case 16:return vl("Lazy");case 13:return vl("Suspense");case 19:return vl("SuspenseList");case 0:case 2:case 15:return c=ru(c.type,!1),c;case 11:return c=ru(c.type.render,!1),c;case 1:return c=ru(c.type,!0),c;default:return""}}function Ao(c,f){if(c&&c.defaultProps){f=s({},f),c=c.defaultProps;for(var v in c)f[v]===void 0&&(f[v]=c[v]);return f}return f}var gf=Et(null),vf=null,Ci=null,r0=null;function o0(){r0=Ci=vf=null}function A2(c,f,v){ie?(Mt(gf,f._currentValue),f._currentValue=v):(Mt(gf,f._currentValue2),f._currentValue2=v)}function s0(c){var f=gf.current;_t(gf),ie?c._currentValue=f:c._currentValue2=f}function a0(c,f,v){for(;c!==null;){var w=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,w!==null&&(w.childLanes|=f)):w!==null&&(w.childLanes&f)!==f&&(w.childLanes|=f),c===v)break;c=c.return}}function wi(c,f){vf=c,r0=Ci=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(Ir=!0),c.firstContext=null)}function so(c){var f=ie?c._currentValue:c._currentValue2;if(r0!==c)if(c={context:c,memoizedValue:f,next:null},Ci===null){if(vf===null)throw Error(l(308));Ci=c,vf.dependencies={lanes:0,firstContext:c}}else Ci=Ci.next=c;return f}var yl=null;function l0(c){yl===null?yl=[c]:yl.push(c)}function T2(c,f,v,w){var k=f.interleaved;return k===null?(v.next=v,l0(f)):(v.next=k.next,k.next=v),f.interleaved=v,is(c,w)}function is(c,f){c.lanes|=f;var v=c.alternate;for(v!==null&&(v.lanes|=f),v=c,c=c.return;c!==null;)c.childLanes|=f,v=c.alternate,v!==null&&(v.childLanes|=f),v=c,c=c.return;return v.tag===3?v.stateNode:null}var Pa=!1;function i0(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $2(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Vs(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function Ea(c,f,v){var w=c.updateQueue;if(w===null)return null;if(w=w.shared,jt&2){var k=w.pending;return k===null?f.next=f:(f.next=k.next,k.next=f),w.pending=f,is(c,v)}return k=w.interleaved,k===null?(f.next=f,l0(w)):(f.next=k.next,k.next=f),w.interleaved=f,is(c,v)}function xf(c,f,v){if(f=f.updateQueue,f!==null&&(f=f.shared,(v&4194240)!==0)){var w=f.lanes;w&=c.pendingLanes,v|=w,f.lanes=v,Kg(c,v)}}function N2(c,f){var v=c.updateQueue,w=c.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var k=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var L={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?k=P=L:P=P.next=L,v=v.next}while(v!==null);P===null?k=P=f:P=P.next=f}else k=P=f;v={baseState:w.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:w.shared,effects:w.effects},c.updateQueue=v;return}c=v.lastBaseUpdate,c===null?v.firstBaseUpdate=f:c.next=f,v.lastBaseUpdate=f}function bf(c,f,v,w){var k=c.updateQueue;Pa=!1;var P=k.firstBaseUpdate,L=k.lastBaseUpdate,ne=k.shared.pending;if(ne!==null){k.shared.pending=null;var pe=ne,Ee=pe.next;pe.next=null,L===null?P=Ee:L.next=Ee,L=pe;var Xe=c.alternate;Xe!==null&&(Xe=Xe.updateQueue,ne=Xe.lastBaseUpdate,ne!==L&&(ne===null?Xe.firstBaseUpdate=Ee:ne.next=Ee,Xe.lastBaseUpdate=pe))}if(P!==null){var vt=k.baseState;L=0,Xe=Ee=pe=null,ne=P;do{var We=ne.lane,sn=ne.eventTime;if((w&We)===We){Xe!==null&&(Xe=Xe.next={eventTime:sn,lane:0,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null});e:{var Jt=c,Mr=ne;switch(We=f,sn=v,Mr.tag){case 1:if(Jt=Mr.payload,typeof Jt=="function"){vt=Jt.call(sn,vt,We);break e}vt=Jt;break e;case 3:Jt.flags=Jt.flags&-65537|128;case 0:if(Jt=Mr.payload,We=typeof Jt=="function"?Jt.call(sn,vt,We):Jt,We==null)break e;vt=s({},vt,We);break e;case 2:Pa=!0}}ne.callback!==null&&ne.lane!==0&&(c.flags|=64,We=k.effects,We===null?k.effects=[ne]:We.push(ne))}else sn={eventTime:sn,lane:We,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Xe===null?(Ee=Xe=sn,pe=vt):Xe=Xe.next=sn,L|=We;if(ne=ne.next,ne===null){if(ne=k.shared.pending,ne===null)break;We=ne,ne=We.next,We.next=null,k.lastBaseUpdate=We,k.shared.pending=null}}while(1);if(Xe===null&&(pe=vt),k.baseState=pe,k.firstBaseUpdate=Ee,k.lastBaseUpdate=Xe,f=k.shared.interleaved,f!==null){k=f;do L|=k.lane,k=k.next;while(k!==f)}else P===null&&(k.shared.lanes=0);wl|=L,c.lanes=L,c.memoizedState=vt}}function L2(c,f,v){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var w=c[f],k=w.callback;if(k!==null){if(w.callback=null,w=v,typeof k!="function")throw Error(l(191,k));k.call(w)}}}var z2=new r.Component().refs;function c0(c,f,v,w){f=c.memoizedState,v=v(w,f),v=v==null?f:s({},f,v),c.memoizedState=v,c.lanes===0&&(c.updateQueue.baseState=v)}var yf={isMounted:function(c){return(c=c._reactInternals)?A(c)===c:!1},enqueueSetState:function(c,f,v){c=c._reactInternals;var w=ar(),k=Da(c),P=Vs(w,k);P.payload=f,v!=null&&(P.callback=v),f=Ea(c,P,k),f!==null&&(io(f,c,k,w),xf(f,c,k))},enqueueReplaceState:function(c,f,v){c=c._reactInternals;var w=ar(),k=Da(c),P=Vs(w,k);P.tag=1,P.payload=f,v!=null&&(P.callback=v),f=Ea(c,P,k),f!==null&&(io(f,c,k,w),xf(f,c,k))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var v=ar(),w=Da(c),k=Vs(v,w);k.tag=2,f!=null&&(k.callback=f),f=Ea(c,k,w),f!==null&&(io(f,c,w,v),xf(f,c,w))}};function F2(c,f,v,w,k,P,L){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(w,P,L):f.prototype&&f.prototype.isPureReactComponent?!hf(v,w)||!hf(k,P):!0}function B2(c,f,v){var w=!1,k=nr,P=f.contextType;return typeof P=="object"&&P!==null?P=so(P):(k=jr(f)?gr:rn.current,w=f.contextTypes,P=(w=w!=null)?vi(c,k):nr),f=new f(v,P),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=yf,c.stateNode=f,f._reactInternals=c,w&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=k,c.__reactInternalMemoizedMaskedChildContext=P),f}function H2(c,f,v,w){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(v,w),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(v,w),f.state!==c&&yf.enqueueReplaceState(f,f.state,null)}function u0(c,f,v,w){var k=c.stateNode;k.props=v,k.state=c.memoizedState,k.refs=z2,i0(c);var P=f.contextType;typeof P=="object"&&P!==null?k.context=so(P):(P=jr(f)?gr:rn.current,k.context=vi(c,P)),k.state=c.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(c0(c,f,P,v),k.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(f=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),f!==k.state&&yf.enqueueReplaceState(k,k.state,null),bf(c,v,k,w),k.state=c.memoizedState),typeof k.componentDidMount=="function"&&(c.flags|=4194308)}function lu(c,f,v){if(c=v.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(l(309));var w=v.stateNode}if(!w)throw Error(l(147,c));var k=w,P=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===P?f.ref:(f=function(L){var ne=k.refs;ne===z2&&(ne=k.refs={}),L===null?delete ne[P]:ne[P]=L},f._stringRef=P,f)}if(typeof c!="string")throw Error(l(284));if(!v._owner)throw Error(l(290,c))}return c}function Cf(c,f){throw c=Object.prototype.toString.call(f),Error(l(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function V2(c){var f=c._init;return f(c._payload)}function W2(c){function f(ue,se){if(c){var me=ue.deletions;me===null?(ue.deletions=[se],ue.flags|=16):me.push(se)}}function v(ue,se){if(!c)return null;for(;se!==null;)f(ue,se),se=se.sibling;return null}function w(ue,se){for(ue=new Map;se!==null;)se.key!==null?ue.set(se.key,se):ue.set(se.index,se),se=se.sibling;return ue}function k(ue,se){return ue=Aa(ue,se),ue.index=0,ue.sibling=null,ue}function P(ue,se,me){return ue.index=me,c?(me=ue.alternate,me!==null?(me=me.index,me<se?(ue.flags|=2,se):me):(ue.flags|=2,se)):(ue.flags|=1048576,se)}function L(ue){return c&&ue.alternate===null&&(ue.flags|=2),ue}function ne(ue,se,me,Ue){return se===null||se.tag!==6?(se=Y0(me,ue.mode,Ue),se.return=ue,se):(se=k(se,me),se.return=ue,se)}function pe(ue,se,me,Ue){var it=me.type;return it===m?Xe(ue,se,me.props.children,Ue,me.key):se!==null&&(se.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===j&&V2(it)===se.type)?(Ue=k(se,me.props),Ue.ref=lu(ue,se,me),Ue.return=ue,Ue):(Ue=Kf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=lu(ue,se,me),Ue.return=ue,Ue)}function Ee(ue,se,me,Ue){return se===null||se.tag!==4||se.stateNode.containerInfo!==me.containerInfo||se.stateNode.implementation!==me.implementation?(se=Z0(me,ue.mode,Ue),se.return=ue,se):(se=k(se,me.children||[]),se.return=ue,se)}function Xe(ue,se,me,Ue,it){return se===null||se.tag!==7?(se=jl(me,ue.mode,Ue,it),se.return=ue,se):(se=k(se,me),se.return=ue,se)}function vt(ue,se,me){if(typeof se=="string"&&se!==""||typeof se=="number")return se=Y0(""+se,ue.mode,me),se.return=ue,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case u:return me=Kf(se.type,se.key,se.props,null,ue.mode,me),me.ref=lu(ue,null,se),me.return=ue,me;case p:return se=Z0(se,ue.mode,me),se.return=ue,se;case j:var Ue=se._init;return vt(ue,Ue(se._payload),me)}if(Q(se)||M(se))return se=jl(se,ue.mode,me,null),se.return=ue,se;Cf(ue,se)}return null}function We(ue,se,me,Ue){var it=se!==null?se.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return it!==null?null:ne(ue,se,""+me,Ue);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case u:return me.key===it?pe(ue,se,me,Ue):null;case p:return me.key===it?Ee(ue,se,me,Ue):null;case j:return it=me._init,We(ue,se,it(me._payload),Ue)}if(Q(me)||M(me))return it!==null?null:Xe(ue,se,me,Ue,null);Cf(ue,me)}return null}function sn(ue,se,me,Ue,it){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return ue=ue.get(me)||null,ne(se,ue,""+Ue,it);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case u:return ue=ue.get(Ue.key===null?me:Ue.key)||null,pe(se,ue,Ue,it);case p:return ue=ue.get(Ue.key===null?me:Ue.key)||null,Ee(se,ue,Ue,it);case j:var wt=Ue._init;return sn(ue,se,me,wt(Ue._payload),it)}if(Q(Ue)||M(Ue))return ue=ue.get(me)||null,Xe(se,ue,Ue,it,null);Cf(se,Ue)}return null}function Jt(ue,se,me,Ue){for(var it=null,wt=null,xt=se,Lt=se=0,Xn=null;xt!==null&&Lt<me.length;Lt++){xt.index>Lt?(Xn=xt,xt=null):Xn=xt.sibling;var zt=We(ue,xt,me[Lt],Ue);if(zt===null){xt===null&&(xt=Xn);break}c&&xt&&zt.alternate===null&&f(ue,xt),se=P(zt,se,Lt),wt===null?it=zt:wt.sibling=zt,wt=zt,xt=Xn}if(Lt===me.length)return v(ue,xt),ln&&bl(ue,Lt),it;if(xt===null){for(;Lt<me.length;Lt++)xt=vt(ue,me[Lt],Ue),xt!==null&&(se=P(xt,se,Lt),wt===null?it=xt:wt.sibling=xt,wt=xt);return ln&&bl(ue,Lt),it}for(xt=w(ue,xt);Lt<me.length;Lt++)Xn=sn(xt,ue,Lt,me[Lt],Ue),Xn!==null&&(c&&Xn.alternate!==null&&xt.delete(Xn.key===null?Lt:Xn.key),se=P(Xn,se,Lt),wt===null?it=Xn:wt.sibling=Xn,wt=Xn);return c&&xt.forEach(function(Ta){return f(ue,Ta)}),ln&&bl(ue,Lt),it}function Mr(ue,se,me,Ue){var it=M(me);if(typeof it!="function")throw Error(l(150));if(me=it.call(me),me==null)throw Error(l(151));for(var wt=it=null,xt=se,Lt=se=0,Xn=null,zt=me.next();xt!==null&&!zt.done;Lt++,zt=me.next()){xt.index>Lt?(Xn=xt,xt=null):Xn=xt.sibling;var Ta=We(ue,xt,zt.value,Ue);if(Ta===null){xt===null&&(xt=Xn);break}c&&xt&&Ta.alternate===null&&f(ue,xt),se=P(Ta,se,Lt),wt===null?it=Ta:wt.sibling=Ta,wt=Ta,xt=Xn}if(zt.done)return v(ue,xt),ln&&bl(ue,Lt),it;if(xt===null){for(;!zt.done;Lt++,zt=me.next())zt=vt(ue,zt.value,Ue),zt!==null&&(se=P(zt,se,Lt),wt===null?it=zt:wt.sibling=zt,wt=zt);return ln&&bl(ue,Lt),it}for(xt=w(ue,xt);!zt.done;Lt++,zt=me.next())zt=sn(xt,ue,Lt,zt.value,Ue),zt!==null&&(c&&zt.alternate!==null&&xt.delete(zt.key===null?Lt:zt.key),se=P(zt,se,Lt),wt===null?it=zt:wt.sibling=zt,wt=zt);return c&&xt.forEach(function(_D){return f(ue,_D)}),ln&&bl(ue,Lt),it}function Gs(ue,se,me,Ue){if(typeof me=="object"&&me!==null&&me.type===m&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case u:e:{for(var it=me.key,wt=se;wt!==null;){if(wt.key===it){if(it=me.type,it===m){if(wt.tag===7){v(ue,wt.sibling),se=k(wt,me.props.children),se.return=ue,ue=se;break e}}else if(wt.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===j&&V2(it)===wt.type){v(ue,wt.sibling),se=k(wt,me.props),se.ref=lu(ue,wt,me),se.return=ue,ue=se;break e}v(ue,wt);break}else f(ue,wt);wt=wt.sibling}me.type===m?(se=jl(me.props.children,ue.mode,Ue,me.key),se.return=ue,ue=se):(Ue=Kf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=lu(ue,se,me),Ue.return=ue,ue=Ue)}return L(ue);case p:e:{for(wt=me.key;se!==null;){if(se.key===wt)if(se.tag===4&&se.stateNode.containerInfo===me.containerInfo&&se.stateNode.implementation===me.implementation){v(ue,se.sibling),se=k(se,me.children||[]),se.return=ue,ue=se;break e}else{v(ue,se);break}else f(ue,se);se=se.sibling}se=Z0(me,ue.mode,Ue),se.return=ue,ue=se}return L(ue);case j:return wt=me._init,Gs(ue,se,wt(me._payload),Ue)}if(Q(me))return Jt(ue,se,me,Ue);if(M(me))return Mr(ue,se,me,Ue);Cf(ue,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,se!==null&&se.tag===6?(v(ue,se.sibling),se=k(se,me),se.return=ue,ue=se):(v(ue,se),se=Y0(me,ue.mode,Ue),se.return=ue,ue=se),L(ue)):v(ue,se)}return Gs}var Si=W2(!0),U2=W2(!1),iu={},ao=Et(iu),cu=Et(iu),ki=Et(iu);function cs(c){if(c===iu)throw Error(l(174));return c}function d0(c,f){Mt(ki,f),Mt(cu,c),Mt(ao,iu),c=F(f),_t(ao),Mt(ao,c)}function _i(){_t(ao),_t(cu),_t(ki)}function G2(c){var f=cs(ki.current),v=cs(ao.current);f=U(v,c.type,f),v!==f&&(Mt(cu,c),Mt(ao,f))}function f0(c){cu.current===c&&(_t(ao),_t(cu))}var gn=Et(0);function wf(c){for(var f=c;f!==null;){if(f.tag===13){var v=f.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Ls(v)||Sa(v)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var p0=[];function m0(){for(var c=0;c<p0.length;c++){var f=p0[c];ie?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}p0.length=0}var Sf=i.ReactCurrentDispatcher,h0=i.ReactCurrentBatchConfig,Cl=0,vn=null,Fn=null,Kn=null,kf=!1,uu=!1,du=0,Q7=0;function rr(){throw Error(l(321))}function g0(c,f){if(f===null)return!1;for(var v=0;v<f.length&&v<c.length;v++)if(!Do(c[v],f[v]))return!1;return!0}function v0(c,f,v,w,k,P){if(Cl=P,vn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Sf.current=c===null||c.memoizedState===null?eD:tD,c=v(w,k),uu){P=0;do{if(uu=!1,du=0,25<=P)throw Error(l(301));P+=1,Kn=Fn=null,f.updateQueue=null,Sf.current=nD,c=v(w,k)}while(uu)}if(Sf.current=If,f=Fn!==null&&Fn.next!==null,Cl=0,Kn=Fn=vn=null,kf=!1,f)throw Error(l(300));return c}function x0(){var c=du!==0;return du=0,c}function us(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?vn.memoizedState=Kn=c:Kn=Kn.next=c,Kn}function lo(){if(Fn===null){var c=vn.alternate;c=c!==null?c.memoizedState:null}else c=Fn.next;var f=Kn===null?vn.memoizedState:Kn.next;if(f!==null)Kn=f,Fn=c;else{if(c===null)throw Error(l(310));Fn=c,c={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},Kn===null?vn.memoizedState=Kn=c:Kn=Kn.next=c}return Kn}function fu(c,f){return typeof f=="function"?f(c):f}function b0(c){var f=lo(),v=f.queue;if(v===null)throw Error(l(311));v.lastRenderedReducer=c;var w=Fn,k=w.baseQueue,P=v.pending;if(P!==null){if(k!==null){var L=k.next;k.next=P.next,P.next=L}w.baseQueue=k=P,v.pending=null}if(k!==null){P=k.next,w=w.baseState;var ne=L=null,pe=null,Ee=P;do{var Xe=Ee.lane;if((Cl&Xe)===Xe)pe!==null&&(pe=pe.next={lane:0,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),w=Ee.hasEagerState?Ee.eagerState:c(w,Ee.action);else{var vt={lane:Xe,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};pe===null?(ne=pe=vt,L=w):pe=pe.next=vt,vn.lanes|=Xe,wl|=Xe}Ee=Ee.next}while(Ee!==null&&Ee!==P);pe===null?L=w:pe.next=ne,Do(w,f.memoizedState)||(Ir=!0),f.memoizedState=w,f.baseState=L,f.baseQueue=pe,v.lastRenderedState=w}if(c=v.interleaved,c!==null){k=c;do P=k.lane,vn.lanes|=P,wl|=P,k=k.next;while(k!==c)}else k===null&&(v.lanes=0);return[f.memoizedState,v.dispatch]}function y0(c){var f=lo(),v=f.queue;if(v===null)throw Error(l(311));v.lastRenderedReducer=c;var w=v.dispatch,k=v.pending,P=f.memoizedState;if(k!==null){v.pending=null;var L=k=k.next;do P=c(P,L.action),L=L.next;while(L!==k);Do(P,f.memoizedState)||(Ir=!0),f.memoizedState=P,f.baseQueue===null&&(f.baseState=P),v.lastRenderedState=P}return[P,w]}function K2(){}function q2(c,f){var v=vn,w=lo(),k=f(),P=!Do(w.memoizedState,k);if(P&&(w.memoizedState=k,Ir=!0),w=w.queue,C0(Y2.bind(null,v,w,c),[c]),w.getSnapshot!==f||P||Kn!==null&&Kn.memoizedState.tag&1){if(v.flags|=2048,pu(9,Q2.bind(null,v,w,k,f),void 0,null),qn===null)throw Error(l(349));Cl&30||X2(v,f,k)}return k}function X2(c,f,v){c.flags|=16384,c={getSnapshot:f,value:v},f=vn.updateQueue,f===null?(f={lastEffect:null,stores:null},vn.updateQueue=f,f.stores=[c]):(v=f.stores,v===null?f.stores=[c]:v.push(c))}function Q2(c,f,v,w){f.value=v,f.getSnapshot=w,Z2(f)&&J2(c)}function Y2(c,f,v){return v(function(){Z2(f)&&J2(c)})}function Z2(c){var f=c.getSnapshot;c=c.value;try{var v=f();return!Do(c,v)}catch{return!0}}function J2(c){var f=is(c,1);f!==null&&io(f,c,1,-1)}function eC(c){var f=us();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fu,lastRenderedState:c},f.queue=c,c=c.dispatch=J7.bind(null,vn,c),[f.memoizedState,c]}function pu(c,f,v,w){return c={tag:c,create:f,destroy:v,deps:w,next:null},f=vn.updateQueue,f===null?(f={lastEffect:null,stores:null},vn.updateQueue=f,f.lastEffect=c.next=c):(v=f.lastEffect,v===null?f.lastEffect=c.next=c:(w=v.next,v.next=c,c.next=w,f.lastEffect=c)),c}function tC(){return lo().memoizedState}function _f(c,f,v,w){var k=us();vn.flags|=c,k.memoizedState=pu(1|f,v,void 0,w===void 0?null:w)}function jf(c,f,v,w){var k=lo();w=w===void 0?null:w;var P=void 0;if(Fn!==null){var L=Fn.memoizedState;if(P=L.destroy,w!==null&&g0(w,L.deps)){k.memoizedState=pu(f,v,P,w);return}}vn.flags|=c,k.memoizedState=pu(1|f,v,P,w)}function nC(c,f){return _f(8390656,8,c,f)}function C0(c,f){return jf(2048,8,c,f)}function rC(c,f){return jf(4,2,c,f)}function oC(c,f){return jf(4,4,c,f)}function sC(c,f){if(typeof f=="function")return c=c(),f(c),function(){f(null)};if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function aC(c,f,v){return v=v!=null?v.concat([c]):null,jf(4,4,sC.bind(null,f,c),v)}function w0(){}function lC(c,f){var v=lo();f=f===void 0?null:f;var w=v.memoizedState;return w!==null&&f!==null&&g0(f,w[1])?w[0]:(v.memoizedState=[c,f],c)}function iC(c,f){var v=lo();f=f===void 0?null:f;var w=v.memoizedState;return w!==null&&f!==null&&g0(f,w[1])?w[0]:(c=c(),v.memoizedState=[c,f],c)}function cC(c,f,v){return Cl&21?(Do(v,f)||(v=_2(),vn.lanes|=v,wl|=v,c.baseState=!0),f):(c.baseState&&(c.baseState=!1,Ir=!0),c.memoizedState=v)}function Y7(c,f){var v=Nt;Nt=v!==0&&4>v?v:4,c(!0);var w=h0.transition;h0.transition={};try{c(!1),f()}finally{Nt=v,h0.transition=w}}function uC(){return lo().memoizedState}function Z7(c,f,v){var w=Da(c);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},dC(c))fC(f,v);else if(v=T2(c,f,v,w),v!==null){var k=ar();io(v,c,w,k),pC(v,f,w)}}function J7(c,f,v){var w=Da(c),k={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(dC(c))fC(f,k);else{var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var L=f.lastRenderedState,ne=P(L,v);if(k.hasEagerState=!0,k.eagerState=ne,Do(ne,L)){var pe=f.interleaved;pe===null?(k.next=k,l0(f)):(k.next=pe.next,pe.next=k),f.interleaved=k;return}}catch{}finally{}v=T2(c,f,k,w),v!==null&&(k=ar(),io(v,c,w,k),pC(v,f,w))}}function dC(c){var f=c.alternate;return c===vn||f!==null&&f===vn}function fC(c,f){uu=kf=!0;var v=c.pending;v===null?f.next=f:(f.next=v.next,v.next=f),c.pending=f}function pC(c,f,v){if(v&4194240){var w=f.lanes;w&=c.pendingLanes,v|=w,f.lanes=v,Kg(c,v)}}var If={readContext:so,useCallback:rr,useContext:rr,useEffect:rr,useImperativeHandle:rr,useInsertionEffect:rr,useLayoutEffect:rr,useMemo:rr,useReducer:rr,useRef:rr,useState:rr,useDebugValue:rr,useDeferredValue:rr,useTransition:rr,useMutableSource:rr,useSyncExternalStore:rr,useId:rr,unstable_isNewReconciler:!1},eD={readContext:so,useCallback:function(c,f){return us().memoizedState=[c,f===void 0?null:f],c},useContext:so,useEffect:nC,useImperativeHandle:function(c,f,v){return v=v!=null?v.concat([c]):null,_f(4194308,4,sC.bind(null,f,c),v)},useLayoutEffect:function(c,f){return _f(4194308,4,c,f)},useInsertionEffect:function(c,f){return _f(4,2,c,f)},useMemo:function(c,f){var v=us();return f=f===void 0?null:f,c=c(),v.memoizedState=[c,f],c},useReducer:function(c,f,v){var w=us();return f=v!==void 0?v(f):f,w.memoizedState=w.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},w.queue=c,c=c.dispatch=Z7.bind(null,vn,c),[w.memoizedState,c]},useRef:function(c){var f=us();return c={current:c},f.memoizedState=c},useState:eC,useDebugValue:w0,useDeferredValue:function(c){return us().memoizedState=c},useTransition:function(){var c=eC(!1),f=c[0];return c=Y7.bind(null,c[1]),us().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,v){var w=vn,k=us();if(ln){if(v===void 0)throw Error(l(407));v=v()}else{if(v=f(),qn===null)throw Error(l(349));Cl&30||X2(w,f,v)}k.memoizedState=v;var P={value:v,getSnapshot:f};return k.queue=P,nC(Y2.bind(null,w,P,c),[c]),w.flags|=2048,pu(9,Q2.bind(null,w,P,v,f),void 0,null),v},useId:function(){var c=us(),f=qn.identifierPrefix;if(ln){var v=Hs,w=Bs;v=(w&~(1<<32-Oo(w)-1)).toString(32)+v,f=":"+f+"R"+v,v=du++,0<v&&(f+="H"+v.toString(32)),f+=":"}else v=Q7++,f=":"+f+"r"+v.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},tD={readContext:so,useCallback:lC,useContext:so,useEffect:C0,useImperativeHandle:aC,useInsertionEffect:rC,useLayoutEffect:oC,useMemo:iC,useReducer:b0,useRef:tC,useState:function(){return b0(fu)},useDebugValue:w0,useDeferredValue:function(c){var f=lo();return cC(f,Fn.memoizedState,c)},useTransition:function(){var c=b0(fu)[0],f=lo().memoizedState;return[c,f]},useMutableSource:K2,useSyncExternalStore:q2,useId:uC,unstable_isNewReconciler:!1},nD={readContext:so,useCallback:lC,useContext:so,useEffect:C0,useImperativeHandle:aC,useInsertionEffect:rC,useLayoutEffect:oC,useMemo:iC,useReducer:y0,useRef:tC,useState:function(){return y0(fu)},useDebugValue:w0,useDeferredValue:function(c){var f=lo();return Fn===null?f.memoizedState=c:cC(f,Fn.memoizedState,c)},useTransition:function(){var c=y0(fu)[0],f=lo().memoizedState;return[c,f]},useMutableSource:K2,useSyncExternalStore:q2,useId:uC,unstable_isNewReconciler:!1};function ji(c,f){try{var v="",w=f;do v+=X7(w),w=w.return;while(w);var k=v}catch(P){k=`
+Error generating stack: `+P.message+`
+`+P.stack}return{value:c,source:f,stack:k,digest:null}}function S0(c,f,v){return{value:c,source:null,stack:v??null,digest:f??null}}function k0(c,f){try{console.error(f.value)}catch(v){setTimeout(function(){throw v})}}var rD=typeof WeakMap=="function"?WeakMap:Map;function mC(c,f,v){v=Vs(-1,v),v.tag=3,v.payload={element:null};var w=f.value;return v.callback=function(){Bf||(Bf=!0,W0=w),k0(c,f)},v}function hC(c,f,v){v=Vs(-1,v),v.tag=3;var w=c.type.getDerivedStateFromError;if(typeof w=="function"){var k=f.value;v.payload=function(){return w(k)},v.callback=function(){k0(c,f)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){k0(c,f),typeof w!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})}),v}function gC(c,f,v){var w=c.pingCache;if(w===null){w=c.pingCache=new rD;var k=new Set;w.set(f,k)}else k=w.get(f),k===void 0&&(k=new Set,w.set(f,k));k.has(v)||(k.add(v),c=vD.bind(null,c,f,v),f.then(c,c))}function vC(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function xC(c,f,v,w,k){return c.mode&1?(c.flags|=65536,c.lanes=k,c):(c===f?c.flags|=65536:(c.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(f=Vs(-1,1),f.tag=2,Ea(v,f,1))),v.lanes|=1),c)}var oD=i.ReactCurrentOwner,Ir=!1;function vr(c,f,v,w){f.child=c===null?U2(f,null,v,w):Si(f,c.child,v,w)}function bC(c,f,v,w,k){v=v.render;var P=f.ref;return wi(f,k),w=v0(c,f,v,w,P,k),v=x0(),c!==null&&!Ir?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~k,Ws(c,f,k)):(ln&&v&&Zg(f),f.flags|=1,vr(c,f,w,k),f.child)}function yC(c,f,v,w,k){if(c===null){var P=v.type;return typeof P=="function"&&!Q0(P)&&P.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(f.tag=15,f.type=P,CC(c,f,P,w,k)):(c=Kf(v.type,null,w,f,f.mode,k),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,!(c.lanes&k)){var L=P.memoizedProps;if(v=v.compare,v=v!==null?v:hf,v(L,w)&&c.ref===f.ref)return Ws(c,f,k)}return f.flags|=1,c=Aa(P,w),c.ref=f.ref,c.return=f,f.child=c}function CC(c,f,v,w,k){if(c!==null){var P=c.memoizedProps;if(hf(P,w)&&c.ref===f.ref)if(Ir=!1,f.pendingProps=w=P,(c.lanes&k)!==0)c.flags&131072&&(Ir=!0);else return f.lanes=c.lanes,Ws(c,f,k)}return _0(c,f,v,w,k)}function wC(c,f,v){var w=f.pendingProps,k=w.children,P=c!==null?c.memoizedState:null;if(w.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(Pi,Ur),Ur|=v;else{if(!(v&1073741824))return c=P!==null?P.baseLanes|v:v,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null,transitions:null},f.updateQueue=null,Mt(Pi,Ur),Ur|=c,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:v,Mt(Pi,Ur),Ur|=w}else P!==null?(w=P.baseLanes|v,f.memoizedState=null):w=v,Mt(Pi,Ur),Ur|=w;return vr(c,f,k,v),f.child}function SC(c,f){var v=f.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(f.flags|=512,f.flags|=2097152)}function _0(c,f,v,w,k){var P=jr(v)?gr:rn.current;return P=vi(f,P),wi(f,k),v=v0(c,f,v,w,P,k),w=x0(),c!==null&&!Ir?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~k,Ws(c,f,k)):(ln&&w&&Zg(f),f.flags|=1,vr(c,f,v,k),f.child)}function kC(c,f,v,w,k){if(jr(v)){var P=!0;sf(f)}else P=!1;if(wi(f,k),f.stateNode===null)Ef(c,f),B2(f,v,w),u0(f,v,w,k),w=!0;else if(c===null){var L=f.stateNode,ne=f.memoizedProps;L.props=ne;var pe=L.context,Ee=v.contextType;typeof Ee=="object"&&Ee!==null?Ee=so(Ee):(Ee=jr(v)?gr:rn.current,Ee=vi(f,Ee));var Xe=v.getDerivedStateFromProps,vt=typeof Xe=="function"||typeof L.getSnapshotBeforeUpdate=="function";vt||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(ne!==w||pe!==Ee)&&H2(f,L,w,Ee),Pa=!1;var We=f.memoizedState;L.state=We,bf(f,w,L,k),pe=f.memoizedState,ne!==w||We!==pe||Rn.current||Pa?(typeof Xe=="function"&&(c0(f,v,Xe,w),pe=f.memoizedState),(ne=Pa||F2(f,v,ne,w,We,pe,Ee))?(vt||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(f.flags|=4194308)):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=w,f.memoizedState=pe),L.props=w,L.state=pe,L.context=Ee,w=ne):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),w=!1)}else{L=f.stateNode,$2(c,f),ne=f.memoizedProps,Ee=f.type===f.elementType?ne:Ao(f.type,ne),L.props=Ee,vt=f.pendingProps,We=L.context,pe=v.contextType,typeof pe=="object"&&pe!==null?pe=so(pe):(pe=jr(v)?gr:rn.current,pe=vi(f,pe));var sn=v.getDerivedStateFromProps;(Xe=typeof sn=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(ne!==vt||We!==pe)&&H2(f,L,w,pe),Pa=!1,We=f.memoizedState,L.state=We,bf(f,w,L,k);var Jt=f.memoizedState;ne!==vt||We!==Jt||Rn.current||Pa?(typeof sn=="function"&&(c0(f,v,sn,w),Jt=f.memoizedState),(Ee=Pa||F2(f,v,Ee,w,We,Jt,pe)||!1)?(Xe||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(w,Jt,pe),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(w,Jt,pe)),typeof L.componentDidUpdate=="function"&&(f.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof L.componentDidUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=1024),f.memoizedProps=w,f.memoizedState=Jt),L.props=w,L.state=Jt,L.context=pe,w=Ee):(typeof L.componentDidUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=1024),w=!1)}return j0(c,f,v,w,P,k)}function j0(c,f,v,w,k,P){SC(c,f);var L=(f.flags&128)!==0;if(!w&&!L)return k&&k2(f,v,!1),Ws(c,f,P);w=f.stateNode,oD.current=f;var ne=L&&typeof v.getDerivedStateFromError!="function"?null:w.render();return f.flags|=1,c!==null&&L?(f.child=Si(f,c.child,null,P),f.child=Si(f,null,ne,P)):vr(c,f,ne,P),f.memoizedState=w.state,k&&k2(f,v,!0),f.child}function _C(c){var f=c.stateNode;f.pendingContext?w2(c,f.pendingContext,f.pendingContext!==f.context):f.context&&w2(c,f.context,!1),d0(c,f.containerInfo)}function jC(c,f,v,w,k){return yi(),n0(k),f.flags|=256,vr(c,f,v,w),f.child}var I0={dehydrated:null,treeContext:null,retryLane:0};function P0(c){return{baseLanes:c,cachePool:null,transitions:null}}function IC(c,f,v){var w=f.pendingProps,k=gn.current,P=!1,L=(f.flags&128)!==0,ne;if((ne=L)||(ne=c!==null&&c.memoizedState===null?!1:(k&2)!==0),ne?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(k|=1),Mt(gn,k&1),c===null)return t0(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?Sa(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(L=w.children,c=w.fallback,P?(w=f.mode,P=f.child,L={mode:"hidden",children:L},!(w&1)&&P!==null?(P.childLanes=0,P.pendingProps=L):P=qf(L,w,0,null),c=jl(c,w,v,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=P0(v),f.memoizedState=I0,c):E0(f,L));if(k=c.memoizedState,k!==null&&(ne=k.dehydrated,ne!==null))return sD(c,f,L,w,ne,k,v);if(P){P=w.fallback,L=f.mode,k=c.child,ne=k.sibling;var pe={mode:"hidden",children:w.children};return!(L&1)&&f.child!==k?(w=f.child,w.childLanes=0,w.pendingProps=pe,f.deletions=null):(w=Aa(k,pe),w.subtreeFlags=k.subtreeFlags&14680064),ne!==null?P=Aa(ne,P):(P=jl(P,L,v,null),P.flags|=2),P.return=f,w.return=f,w.sibling=P,f.child=w,w=P,P=f.child,L=c.child.memoizedState,L=L===null?P0(v):{baseLanes:L.baseLanes|v,cachePool:null,transitions:L.transitions},P.memoizedState=L,P.childLanes=c.childLanes&~v,f.memoizedState=I0,w}return P=c.child,c=P.sibling,w=Aa(P,{mode:"visible",children:w.children}),!(f.mode&1)&&(w.lanes=v),w.return=f,w.sibling=null,c!==null&&(v=f.deletions,v===null?(f.deletions=[c],f.flags|=16):v.push(c)),f.child=w,f.memoizedState=null,w}function E0(c,f){return f=qf({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function Pf(c,f,v,w){return w!==null&&n0(w),Si(f,c.child,null,v),c=E0(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function sD(c,f,v,w,k,P,L){if(v)return f.flags&256?(f.flags&=-257,w=S0(Error(l(422))),Pf(c,f,L,w)):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=w.fallback,k=f.mode,w=qf({mode:"visible",children:w.children},k,0,null),P=jl(P,k,L,null),P.flags|=2,w.return=f,P.return=f,w.sibling=P,f.child=w,f.mode&1&&Si(f,c.child,null,L),f.child.memoizedState=P0(L),f.memoizedState=I0,P);if(!(f.mode&1))return Pf(c,f,L,null);if(Sa(k))return w=ka(k).digest,P=Error(l(419)),w=S0(P,w,void 0),Pf(c,f,L,w);if(v=(L&c.childLanes)!==0,Ir||v){if(w=qn,w!==null){switch(L&-L){case 4:k=2;break;case 16:k=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:k=32;break;case 536870912:k=268435456;break;default:k=0}k=k&(w.suspendedLanes|L)?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,is(c,k),io(w,c,k,-1))}return X0(),w=S0(Error(l(421))),Pf(c,f,L,w)}return Ls(k)?(f.flags|=128,f.child=c.child,f=xD.bind(null,c),mi(k,f),null):(c=P.treeContext,we&&(oo=Gt(k),Wr=f,ln=!0,Ro=null,au=!1,c!==null&&(no[ro++]=Bs,no[ro++]=Hs,no[ro++]=xl,Bs=c.id,Hs=c.overflow,xl=f)),f=E0(f,w.children),f.flags|=4096,f)}function PC(c,f,v){c.lanes|=f;var w=c.alternate;w!==null&&(w.lanes|=f),a0(c.return,f,v)}function M0(c,f,v,w,k){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:k}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=v,P.tailMode=k)}function EC(c,f,v){var w=f.pendingProps,k=w.revealOrder,P=w.tail;if(vr(c,f,w.children,v),w=gn.current,w&2)w=w&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&PC(c,v,f);else if(c.tag===19)PC(c,v,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}w&=1}if(Mt(gn,w),!(f.mode&1))f.memoizedState=null;else switch(k){case"forwards":for(v=f.child,k=null;v!==null;)c=v.alternate,c!==null&&wf(c)===null&&(k=v),v=v.sibling;v=k,v===null?(k=f.child,f.child=null):(k=v.sibling,v.sibling=null),M0(f,!1,k,v,P);break;case"backwards":for(v=null,k=f.child,f.child=null;k!==null;){if(c=k.alternate,c!==null&&wf(c)===null){f.child=k;break}c=k.sibling,k.sibling=v,v=k,k=c}M0(f,!0,v,null,P);break;case"together":M0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Ef(c,f){!(f.mode&1)&&c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2)}function Ws(c,f,v){if(c!==null&&(f.dependencies=c.dependencies),wl|=f.lanes,!(v&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(l(153));if(f.child!==null){for(c=f.child,v=Aa(c,c.pendingProps),f.child=v,v.return=f;c.sibling!==null;)c=c.sibling,v=v.sibling=Aa(c,c.pendingProps),v.return=f;v.sibling=null}return f.child}function aD(c,f,v){switch(f.tag){case 3:_C(f),yi();break;case 5:G2(f);break;case 1:jr(f.type)&&sf(f);break;case 4:d0(f,f.stateNode.containerInfo);break;case 10:A2(f,f.type._context,f.memoizedProps.value);break;case 13:var w=f.memoizedState;if(w!==null)return w.dehydrated!==null?(Mt(gn,gn.current&1),f.flags|=128,null):v&f.child.childLanes?IC(c,f,v):(Mt(gn,gn.current&1),c=Ws(c,f,v),c!==null?c.sibling:null);Mt(gn,gn.current&1);break;case 19:if(w=(v&f.childLanes)!==0,c.flags&128){if(w)return EC(c,f,v);f.flags|=128}var k=f.memoizedState;if(k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Mt(gn,gn.current),w)break;return null;case 22:case 23:return f.lanes=0,wC(c,f,v)}return Ws(c,f,v)}function ds(c){c.flags|=4}function MC(c,f){if(c!==null&&c.child===f.child)return!0;if(f.flags&16)return!1;for(c=f.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var mu,hu,Mf,Of;if(de)mu=function(c,f){for(var v=f.child;v!==null;){if(v.tag===5||v.tag===6)re(c,v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},hu=function(){},Mf=function(c,f,v,w,k){if(c=c.memoizedProps,c!==w){var P=f.stateNode,L=cs(ao.current);v=oe(P,v,c,w,k,L),(f.updateQueue=v)&&ds(f)}},Of=function(c,f,v,w){v!==w&&ds(f)};else if(xe){mu=function(c,f,v,w){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&w&&(P=_r(P,k.type,k.memoizedProps,k)),re(c,P)}else if(k.tag===6)P=k.stateNode,v&&w&&(P=Mo(P,k.memoizedProps,k)),re(c,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),mu(c,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};var OC=function(c,f,v,w){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&w&&(P=_r(P,k.type,k.memoizedProps,k)),wn(c,P)}else if(k.tag===6)P=k.stateNode,v&&w&&(P=Mo(P,k.memoizedProps,k)),wn(c,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),OC(c,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};hu=function(c,f){var v=f.stateNode;if(!MC(c,f)){c=v.containerInfo;var w=Nn(c);OC(w,f,!1,!1),v.pendingChildren=w,ds(f),hn(c,w)}},Mf=function(c,f,v,w,k){var P=c.stateNode,L=c.memoizedProps;if((c=MC(c,f))&&L===w)f.stateNode=P;else{var ne=f.stateNode,pe=cs(ao.current),Ee=null;L!==w&&(Ee=oe(ne,v,L,w,k,pe)),c&&Ee===null?f.stateNode=P:(P=pr(P,Ee,v,L,w,f,c,ne),ae(P,v,w,k,pe)&&ds(f),f.stateNode=P,c?ds(f):mu(P,f,!1,!1))}},Of=function(c,f,v,w){v!==w?(c=cs(ki.current),v=cs(ao.current),f.stateNode=K(w,c,v,f),ds(f)):f.stateNode=c.stateNode}}else hu=function(){},Mf=function(){},Of=function(){};function gu(c,f){if(!ln)switch(c.tailMode){case"hidden":f=c.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?c.tail=null:v.sibling=null;break;case"collapsed":v=c.tail;for(var w=null;v!==null;)v.alternate!==null&&(w=v),v=v.sibling;w===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:w.sibling=null}}function or(c){var f=c.alternate!==null&&c.alternate.child===c.child,v=0,w=0;if(f)for(var k=c.child;k!==null;)v|=k.lanes|k.childLanes,w|=k.subtreeFlags&14680064,w|=k.flags&14680064,k.return=c,k=k.sibling;else for(k=c.child;k!==null;)v|=k.lanes|k.childLanes,w|=k.subtreeFlags,w|=k.flags,k.return=c,k=k.sibling;return c.subtreeFlags|=w,c.childLanes=v,f}function lD(c,f,v){var w=f.pendingProps;switch(Jg(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return or(f),null;case 1:return jr(f.type)&&of(),or(f),null;case 3:return v=f.stateNode,_i(),_t(Rn),_t(rn),m0(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(c===null||c.child===null)&&(mf(f)?ds(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Ro!==null&&(K0(Ro),Ro=null))),hu(c,f),or(f),null;case 5:f0(f),v=cs(ki.current);var k=f.type;if(c!==null&&f.stateNode!=null)Mf(c,f,k,w,v),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!w){if(f.stateNode===null)throw Error(l(166));return or(f),null}if(c=cs(ao.current),mf(f)){if(!we)throw Error(l(175));c=Ln(f.stateNode,f.type,f.memoizedProps,v,c,f,!au),f.updateQueue=c,c!==null&&ds(f)}else{var P=Y(k,w,v,c,f);mu(P,f,!1,!1),f.stateNode=P,ae(P,k,w,v,c)&&ds(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return or(f),null;case 6:if(c&&f.stateNode!=null)Of(c,f,c.memoizedProps,w);else{if(typeof w!="string"&&f.stateNode===null)throw Error(l(166));if(c=cs(ki.current),v=cs(ao.current),mf(f)){if(!we)throw Error(l(176));if(c=f.stateNode,v=f.memoizedProps,(w=kt(c,v,f,!au))&&(k=Wr,k!==null))switch(k.tag){case 3:rf(k.stateNode.containerInfo,c,v,(k.mode&1)!==0);break;case 5:gi(k.type,k.memoizedProps,k.stateNode,c,v,(k.mode&1)!==0)}w&&ds(f)}else f.stateNode=K(w,c,v,f)}return or(f),null;case 13:if(_t(gn),w=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(ln&&oo!==null&&f.mode&1&&!(f.flags&128))R2(),yi(),f.flags|=98560,k=!1;else if(k=mf(f),w!==null&&w.dehydrated!==null){if(c===null){if(!k)throw Error(l(318));if(!we)throw Error(l(344));if(k=f.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(l(317));ja(k,f)}else yi(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;or(f),k=!1}else Ro!==null&&(K0(Ro),Ro=null),k=!0;if(!k)return f.flags&65536?f:null}return f.flags&128?(f.lanes=v,f):(v=w!==null,v!==(c!==null&&c.memoizedState!==null)&&v&&(f.child.flags|=8192,f.mode&1&&(c===null||gn.current&1?Bn===0&&(Bn=3):X0())),f.updateQueue!==null&&(f.flags|=4),or(f),null);case 4:return _i(),hu(c,f),c===null&&fe(f.stateNode.containerInfo),or(f),null;case 10:return s0(f.type._context),or(f),null;case 17:return jr(f.type)&&of(),or(f),null;case 19:if(_t(gn),k=f.memoizedState,k===null)return or(f),null;if(w=(f.flags&128)!==0,P=k.rendering,P===null)if(w)gu(k,!1);else{if(Bn!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(P=wf(c),P!==null){for(f.flags|=128,gu(k,!1),c=P.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=v,v=f.child;v!==null;)w=v,k=c,w.flags&=14680066,P=w.alternate,P===null?(w.childLanes=0,w.lanes=k,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=P.childLanes,w.lanes=P.lanes,w.child=P.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=P.memoizedProps,w.memoizedState=P.memoizedState,w.updateQueue=P.updateQueue,w.type=P.type,k=P.dependencies,w.dependencies=k===null?null:{lanes:k.lanes,firstContext:k.firstContext}),v=v.sibling;return Mt(gn,gn.current&1|2),f.child}c=c.sibling}k.tail!==null&&Gn()>V0&&(f.flags|=128,w=!0,gu(k,!1),f.lanes=4194304)}else{if(!w)if(c=wf(P),c!==null){if(f.flags|=128,w=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),gu(k,!0),k.tail===null&&k.tailMode==="hidden"&&!P.alternate&&!ln)return or(f),null}else 2*Gn()-k.renderingStartTime>V0&&v!==1073741824&&(f.flags|=128,w=!0,gu(k,!1),f.lanes=4194304);k.isBackwards?(P.sibling=f.child,f.child=P):(c=k.last,c!==null?c.sibling=P:f.child=P,k.last=P)}return k.tail!==null?(f=k.tail,k.rendering=f,k.tail=f.sibling,k.renderingStartTime=Gn(),f.sibling=null,c=gn.current,Mt(gn,w?c&1|2:c&1),f):(or(f),null);case 22:case 23:return q0(),v=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==v&&(f.flags|=8192),v&&f.mode&1?Ur&1073741824&&(or(f),de&&f.subtreeFlags&6&&(f.flags|=8192)):or(f),null;case 24:return null;case 25:return null}throw Error(l(156,f.tag))}function iD(c,f){switch(Jg(f),f.tag){case 1:return jr(f.type)&&of(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return _i(),_t(Rn),_t(rn),m0(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return f0(f),null;case 13:if(_t(gn),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(l(340));yi()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return _t(gn),null;case 4:return _i(),null;case 10:return s0(f.type._context),null;case 22:case 23:return q0(),null;case 24:return null;default:return null}}var Df=!1,sr=!1,cD=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Ii(c,f){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){cn(c,f,w)}else v.current=null}function O0(c,f,v){try{v()}catch(w){cn(c,f,w)}}var DC=!1;function uD(c,f){for(T(c.containerInfo),qe=f;qe!==null;)if(c=qe,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,qe=f;else for(;qe!==null;){c=qe;try{var v=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,k=v.memoizedState,P=c.stateNode,L=P.getSnapshotBeforeUpdate(c.elementType===c.type?w:Ao(c.type,w),k);P.__reactInternalSnapshotBeforeUpdate=L}break;case 3:de&&At(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ne){cn(c,c.return,ne)}if(f=c.sibling,f!==null){f.return=c.return,qe=f;break}qe=c.return}return v=DC,DC=!1,v}function vu(c,f,v){var w=f.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var k=w=w.next;do{if((k.tag&c)===c){var P=k.destroy;k.destroy=void 0,P!==void 0&&O0(f,v,P)}k=k.next}while(k!==w)}}function Rf(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var v=f=f.next;do{if((v.tag&c)===c){var w=v.create;v.destroy=w()}v=v.next}while(v!==f)}}function D0(c){var f=c.ref;if(f!==null){var v=c.stateNode;switch(c.tag){case 5:c=G(v);break;default:c=v}typeof f=="function"?f(c):f.current=c}}function RC(c){var f=c.alternate;f!==null&&(c.alternate=null,RC(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&je(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function AC(c){return c.tag===5||c.tag===3||c.tag===4}function TC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||AC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function R0(c,f,v){var w=c.tag;if(w===5||w===6)c=c.stateNode,f?Ut(v,c,f):et(v,c);else if(w!==4&&(c=c.child,c!==null))for(R0(c,f,v),c=c.sibling;c!==null;)R0(c,f,v),c=c.sibling}function A0(c,f,v){var w=c.tag;if(w===5||w===6)c=c.stateNode,f?Ne(v,c,f):ye(v,c);else if(w!==4&&(c=c.child,c!==null))for(A0(c,f,v),c=c.sibling;c!==null;)A0(c,f,v),c=c.sibling}var Jn=null,To=!1;function fs(c,f,v){for(v=v.child;v!==null;)T0(c,f,v),v=v.sibling}function T0(c,f,v){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(uf,v)}catch{}switch(v.tag){case 5:sr||Ii(v,f);case 6:if(de){var w=Jn,k=To;Jn=null,fs(c,f,v),Jn=w,To=k,Jn!==null&&(To?ze(Jn,v.stateNode):ke(Jn,v.stateNode))}else fs(c,f,v);break;case 18:de&&Jn!==null&&(To?zn(Jn,v.stateNode):Vg(Jn,v.stateNode));break;case 4:de?(w=Jn,k=To,Jn=v.stateNode.containerInfo,To=!0,fs(c,f,v),Jn=w,To=k):(xe&&(w=v.stateNode.containerInfo,k=Nn(w),an(w,k)),fs(c,f,v));break;case 0:case 11:case 14:case 15:if(!sr&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){k=w=w.next;do{var P=k,L=P.destroy;P=P.tag,L!==void 0&&(P&2||P&4)&&O0(v,f,L),k=k.next}while(k!==w)}fs(c,f,v);break;case 1:if(!sr&&(Ii(v,f),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(ne){cn(v,f,ne)}fs(c,f,v);break;case 21:fs(c,f,v);break;case 22:v.mode&1?(sr=(w=sr)||v.memoizedState!==null,fs(c,f,v),sr=w):fs(c,f,v);break;default:fs(c,f,v)}}function $C(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new cD),f.forEach(function(w){var k=bD.bind(null,c,w);v.has(w)||(v.add(w),w.then(k,k))})}}function $o(c,f){var v=f.deletions;if(v!==null)for(var w=0;w<v.length;w++){var k=v[w];try{var P=c,L=f;if(de){var ne=L;e:for(;ne!==null;){switch(ne.tag){case 5:Jn=ne.stateNode,To=!1;break e;case 3:Jn=ne.stateNode.containerInfo,To=!0;break e;case 4:Jn=ne.stateNode.containerInfo,To=!0;break e}ne=ne.return}if(Jn===null)throw Error(l(160));T0(P,L,k),Jn=null,To=!1}else T0(P,L,k);var pe=k.alternate;pe!==null&&(pe.return=null),k.return=null}catch(Ee){cn(k,f,Ee)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)NC(f,c),f=f.sibling}function NC(c,f){var v=c.alternate,w=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if($o(f,c),ps(c),w&4){try{vu(3,c,c.return),Rf(3,c)}catch(We){cn(c,c.return,We)}try{vu(5,c,c.return)}catch(We){cn(c,c.return,We)}}break;case 1:$o(f,c),ps(c),w&512&&v!==null&&Ii(v,v.return);break;case 5:if($o(f,c),ps(c),w&512&&v!==null&&Ii(v,v.return),de){if(c.flags&32){var k=c.stateNode;try{Le(k)}catch(We){cn(c,c.return,We)}}if(w&4&&(k=c.stateNode,k!=null)){var P=c.memoizedProps;if(v=v!==null?v.memoizedProps:P,w=c.type,f=c.updateQueue,c.updateQueue=null,f!==null)try{Me(k,f,w,v,P,c)}catch(We){cn(c,c.return,We)}}}break;case 6:if($o(f,c),ps(c),w&4&&de){if(c.stateNode===null)throw Error(l(162));k=c.stateNode,P=c.memoizedProps,v=v!==null?v.memoizedProps:P;try{ct(k,v,P)}catch(We){cn(c,c.return,We)}}break;case 3:if($o(f,c),ps(c),w&4){if(de&&we&&v!==null&&v.memoizedState.isDehydrated)try{nf(f.containerInfo)}catch(We){cn(c,c.return,We)}if(xe){k=f.containerInfo,P=f.pendingChildren;try{an(k,P)}catch(We){cn(c,c.return,We)}}}break;case 4:if($o(f,c),ps(c),w&4&&xe){P=c.stateNode,k=P.containerInfo,P=P.pendingChildren;try{an(k,P)}catch(We){cn(c,c.return,We)}}break;case 13:$o(f,c),ps(c),k=c.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(H0=Gn())),w&4&&$C(c);break;case 22:var L=v!==null&&v.memoizedState!==null;if(c.mode&1?(sr=(v=sr)||L,$o(f,c),sr=v):$o(f,c),ps(c),w&8192){if(v=c.memoizedState!==null,(c.stateNode.isHidden=v)&&!L&&c.mode&1)for(qe=c,w=c.child;w!==null;){for(f=qe=w;qe!==null;){L=qe;var ne=L.child;switch(L.tag){case 0:case 11:case 14:case 15:vu(4,L,L.return);break;case 1:Ii(L,L.return);var pe=L.stateNode;if(typeof pe.componentWillUnmount=="function"){var Ee=L,Xe=L.return;try{var vt=Ee;pe.props=vt.memoizedProps,pe.state=vt.memoizedState,pe.componentWillUnmount()}catch(We){cn(Ee,Xe,We)}}break;case 5:Ii(L,L.return);break;case 22:if(L.memoizedState!==null){FC(f);continue}}ne!==null?(ne.return=L,qe=ne):FC(f)}w=w.sibling}if(de){e:if(w=null,de)for(f=c;;){if(f.tag===5){if(w===null){w=f;try{k=f.stateNode,v?Ge(k):Pn(f.stateNode,f.memoizedProps)}catch(We){cn(c,c.return,We)}}}else if(f.tag===6){if(w===null)try{P=f.stateNode,v?pt(P):Rt(P,f.memoizedProps)}catch(We){cn(c,c.return,We)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===c)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break e;for(;f.sibling===null;){if(f.return===null||f.return===c)break e;w===f&&(w=null),f=f.return}w===f&&(w=null),f.sibling.return=f.return,f=f.sibling}}}break;case 19:$o(f,c),ps(c),w&4&&$C(c);break;case 21:break;default:$o(f,c),ps(c)}}function ps(c){var f=c.flags;if(f&2){try{if(de){e:{for(var v=c.return;v!==null;){if(AC(v)){var w=v;break e}v=v.return}throw Error(l(160))}switch(w.tag){case 5:var k=w.stateNode;w.flags&32&&(Le(k),w.flags&=-33);var P=TC(c);A0(c,P,k);break;case 3:case 4:var L=w.stateNode.containerInfo,ne=TC(c);R0(c,ne,L);break;default:throw Error(l(161))}}}catch(pe){cn(c,c.return,pe)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function dD(c,f,v){qe=c,LC(c)}function LC(c,f,v){for(var w=(c.mode&1)!==0;qe!==null;){var k=qe,P=k.child;if(k.tag===22&&w){var L=k.memoizedState!==null||Df;if(!L){var ne=k.alternate,pe=ne!==null&&ne.memoizedState!==null||sr;ne=Df;var Ee=sr;if(Df=L,(sr=pe)&&!Ee)for(qe=k;qe!==null;)L=qe,pe=L.child,L.tag===22&&L.memoizedState!==null?BC(k):pe!==null?(pe.return=L,qe=pe):BC(k);for(;P!==null;)qe=P,LC(P),P=P.sibling;qe=k,Df=ne,sr=Ee}zC(c)}else k.subtreeFlags&8772&&P!==null?(P.return=k,qe=P):zC(c)}}function zC(c){for(;qe!==null;){var f=qe;if(f.flags&8772){var v=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:sr||Rf(5,f);break;case 1:var w=f.stateNode;if(f.flags&4&&!sr)if(v===null)w.componentDidMount();else{var k=f.elementType===f.type?v.memoizedProps:Ao(f.type,v.memoizedProps);w.componentDidUpdate(k,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&L2(f,P,w);break;case 3:var L=f.updateQueue;if(L!==null){if(v=null,f.child!==null)switch(f.child.tag){case 5:v=G(f.child.stateNode);break;case 1:v=f.child.stateNode}L2(f,L,v)}break;case 5:var ne=f.stateNode;v===null&&f.flags&4&&ft(ne,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(we&&f.memoizedState===null){var pe=f.alternate;if(pe!==null){var Ee=pe.memoizedState;if(Ee!==null){var Xe=Ee.dehydrated;Xe!==null&&Hg(Xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}sr||f.flags&512&&D0(f)}catch(vt){cn(f,f.return,vt)}}if(f===c){qe=null;break}if(v=f.sibling,v!==null){v.return=f.return,qe=v;break}qe=f.return}}function FC(c){for(;qe!==null;){var f=qe;if(f===c){qe=null;break}var v=f.sibling;if(v!==null){v.return=f.return,qe=v;break}qe=f.return}}function BC(c){for(;qe!==null;){var f=qe;try{switch(f.tag){case 0:case 11:case 15:var v=f.return;try{Rf(4,f)}catch(pe){cn(f,v,pe)}break;case 1:var w=f.stateNode;if(typeof w.componentDidMount=="function"){var k=f.return;try{w.componentDidMount()}catch(pe){cn(f,k,pe)}}var P=f.return;try{D0(f)}catch(pe){cn(f,P,pe)}break;case 5:var L=f.return;try{D0(f)}catch(pe){cn(f,L,pe)}}}catch(pe){cn(f,f.return,pe)}if(f===c){qe=null;break}var ne=f.sibling;if(ne!==null){ne.return=f.return,qe=ne;break}qe=f.return}}var Af=0,Tf=1,$f=2,Nf=3,Lf=4;if(typeof Symbol=="function"&&Symbol.for){var xu=Symbol.for;Af=xu("selector.component"),Tf=xu("selector.has_pseudo_class"),$f=xu("selector.role"),Nf=xu("selector.test_id"),Lf=xu("selector.text")}function $0(c){var f=ve(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(l(364));return f}if(c=Ct(c),c===null)throw Error(l(362));return c.stateNode.current}function N0(c,f){switch(f.$$typeof){case Af:if(c.type===f.value)return!0;break;case Tf:e:{f=f.value,c=[c,0];for(var v=0;v<c.length;){var w=c[v++],k=c[v++],P=f[k];if(w.tag!==5||!he(w)){for(;P!=null&&N0(w,P);)k++,P=f[k];if(k===f.length){f=!0;break e}else for(w=w.child;w!==null;)c.push(w,k),w=w.sibling}}f=!1}return f;case $f:if(c.tag===5&&Re(c.stateNode,f.value))return!0;break;case Lf:if((c.tag===5||c.tag===6)&&(c=Ke(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case Nf:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function L0(c){switch(c.$$typeof){case Af:return"<"+(D(c.value)||"Unknown")+">";case Tf:return":has("+(L0(c)||"")+")";case $f:return'[role="'+c.value+'"]';case Lf:return'"'+c.value+'"';case Nf:return'[data-testname="'+c.value+'"]';default:throw Error(l(365))}}function HC(c,f){var v=[];c=[c,0];for(var w=0;w<c.length;){var k=c[w++],P=c[w++],L=f[P];if(k.tag!==5||!he(k)){for(;L!=null&&N0(k,L);)P++,L=f[P];if(P===f.length)v.push(k);else for(k=k.child;k!==null;)c.push(k,P),k=k.sibling}}return v}function z0(c,f){if(!Ve)throw Error(l(363));c=$0(c),c=HC(c,f),f=[],c=Array.from(c);for(var v=0;v<c.length;){var w=c[v++];if(w.tag===5)he(w)||f.push(w.stateNode);else for(w=w.child;w!==null;)c.push(w),w=w.sibling}return f}var fD=Math.ceil,zf=i.ReactCurrentDispatcher,F0=i.ReactCurrentOwner,En=i.ReactCurrentBatchConfig,jt=0,qn=null,An=null,er=0,Ur=0,Pi=Et(0),Bn=0,bu=null,wl=0,Ff=0,B0=0,yu=null,Pr=null,H0=0,V0=1/0,Us=null;function Ei(){V0=Gn()+500}var Bf=!1,W0=null,Ma=null,Hf=!1,Oa=null,Vf=0,Cu=0,U0=null,Wf=-1,Uf=0;function ar(){return jt&6?Gn():Wf!==-1?Wf:Wf=Gn()}function Da(c){return c.mode&1?jt&2&&er!==0?er&-er:q7.transition!==null?(Uf===0&&(Uf=_2()),Uf):(c=Nt,c!==0?c:Oe()):1}function io(c,f,v,w){if(50<Cu)throw Cu=0,U0=null,Error(l(185));su(c,v,w),(!(jt&2)||c!==qn)&&(c===qn&&(!(jt&2)&&(Ff|=v),Bn===4&&Ra(c,er)),Er(c,w),v===1&&jt===0&&!(f.mode&1)&&(Ei(),df&&ls()))}function Er(c,f){var v=c.callbackNode;z7(c,f);var w=cf(c,c===qn?er:0);if(w===0)v!==null&&I2(v),c.callbackNode=null,c.callbackPriority=0;else if(f=w&-w,c.callbackPriority!==f){if(v!=null&&I2(v),f===1)c.tag===0?K7(WC.bind(null,c)):P2(WC.bind(null,c)),$e?st(function(){!(jt&6)&&ls()}):qg(Xg,ls),v=null;else{switch(j2(w)){case 1:v=Xg;break;case 4:v=V7;break;case 16:v=Qg;break;case 536870912:v=W7;break;default:v=Qg}v=JC(v,VC.bind(null,c))}c.callbackPriority=f,c.callbackNode=v}}function VC(c,f){if(Wf=-1,Uf=0,jt&6)throw Error(l(327));var v=c.callbackNode;if(_l()&&c.callbackNode!==v)return null;var w=cf(c,c===qn?er:0);if(w===0)return null;if(w&30||w&c.expiredLanes||f)f=Gf(c,w);else{f=w;var k=jt;jt|=2;var P=KC();(qn!==c||er!==f)&&(Us=null,Ei(),Sl(c,f));do try{hD();break}catch(ne){GC(c,ne)}while(1);o0(),zf.current=P,jt=k,An!==null?f=0:(qn=null,er=0,f=Bn)}if(f!==0){if(f===2&&(k=Ug(c),k!==0&&(w=k,f=G0(c,k))),f===1)throw v=bu,Sl(c,0),Ra(c,w),Er(c,Gn()),v;if(f===6)Ra(c,w);else{if(k=c.current.alternate,!(w&30)&&!pD(k)&&(f=Gf(c,w),f===2&&(P=Ug(c),P!==0&&(w=P,f=G0(c,P))),f===1))throw v=bu,Sl(c,0),Ra(c,w),Er(c,Gn()),v;switch(c.finishedWork=k,c.finishedLanes=w,f){case 0:case 1:throw Error(l(345));case 2:kl(c,Pr,Us);break;case 3:if(Ra(c,w),(w&130023424)===w&&(f=H0+500-Gn(),10<f)){if(cf(c,0)!==0)break;if(k=c.suspendedLanes,(k&w)!==w){ar(),c.pingedLanes|=c.suspendedLanes&k;break}c.timeoutHandle=ee(kl.bind(null,c,Pr,Us),f);break}kl(c,Pr,Us);break;case 4:if(Ra(c,w),(w&4194240)===w)break;for(f=c.eventTimes,k=-1;0<w;){var L=31-Oo(w);P=1<<L,L=f[L],L>k&&(k=L),w&=~P}if(w=k,w=Gn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*fD(w/1960))-w,10<w){c.timeoutHandle=ee(kl.bind(null,c,Pr,Us),w);break}kl(c,Pr,Us);break;case 5:kl(c,Pr,Us);break;default:throw Error(l(329))}}}return Er(c,Gn()),c.callbackNode===v?VC.bind(null,c):null}function G0(c,f){var v=yu;return c.current.memoizedState.isDehydrated&&(Sl(c,f).flags|=256),c=Gf(c,f),c!==2&&(f=Pr,Pr=v,f!==null&&K0(f)),c}function K0(c){Pr===null?Pr=c:Pr.push.apply(Pr,c)}function pD(c){for(var f=c;;){if(f.flags&16384){var v=f.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var w=0;w<v.length;w++){var k=v[w],P=k.getSnapshot;k=k.value;try{if(!Do(P(),k))return!1}catch{return!1}}}if(v=f.child,f.subtreeFlags&16384&&v!==null)v.return=f,f=v;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Ra(c,f){for(f&=~B0,f&=~Ff,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var v=31-Oo(f),w=1<<v;c[v]=-1,f&=~w}}function WC(c){if(jt&6)throw Error(l(327));_l();var f=cf(c,0);if(!(f&1))return Er(c,Gn()),null;var v=Gf(c,f);if(c.tag!==0&&v===2){var w=Ug(c);w!==0&&(f=w,v=G0(c,w))}if(v===1)throw v=bu,Sl(c,0),Ra(c,f),Er(c,Gn()),v;if(v===6)throw Error(l(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,kl(c,Pr,Us),Er(c,Gn()),null}function UC(c){Oa!==null&&Oa.tag===0&&!(jt&6)&&_l();var f=jt;jt|=1;var v=En.transition,w=Nt;try{if(En.transition=null,Nt=1,c)return c()}finally{Nt=w,En.transition=v,jt=f,!(jt&6)&&ls()}}function q0(){Ur=Pi.current,_t(Pi)}function Sl(c,f){c.finishedWork=null,c.finishedLanes=0;var v=c.timeoutHandle;if(v!==J&&(c.timeoutHandle=J,ce(v)),An!==null)for(v=An.return;v!==null;){var w=v;switch(Jg(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&of();break;case 3:_i(),_t(Rn),_t(rn),m0();break;case 5:f0(w);break;case 4:_i();break;case 13:_t(gn);break;case 19:_t(gn);break;case 10:s0(w.type._context);break;case 22:case 23:q0()}v=v.return}if(qn=c,An=c=Aa(c.current,null),er=Ur=f,Bn=0,bu=null,B0=Ff=wl=0,Pr=yu=null,yl!==null){for(f=0;f<yl.length;f++)if(v=yl[f],w=v.interleaved,w!==null){v.interleaved=null;var k=w.next,P=v.pending;if(P!==null){var L=P.next;P.next=k,w.next=L}v.pending=w}yl=null}return c}function GC(c,f){do{var v=An;try{if(o0(),Sf.current=If,kf){for(var w=vn.memoizedState;w!==null;){var k=w.queue;k!==null&&(k.pending=null),w=w.next}kf=!1}if(Cl=0,Kn=Fn=vn=null,uu=!1,du=0,F0.current=null,v===null||v.return===null){Bn=1,bu=f,An=null;break}e:{var P=c,L=v.return,ne=v,pe=f;if(f=er,ne.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ee=pe,Xe=ne,vt=Xe.tag;if(!(Xe.mode&1)&&(vt===0||vt===11||vt===15)){var We=Xe.alternate;We?(Xe.updateQueue=We.updateQueue,Xe.memoizedState=We.memoizedState,Xe.lanes=We.lanes):(Xe.updateQueue=null,Xe.memoizedState=null)}var sn=vC(L);if(sn!==null){sn.flags&=-257,xC(sn,L,ne,P,f),sn.mode&1&&gC(P,Ee,f),f=sn,pe=Ee;var Jt=f.updateQueue;if(Jt===null){var Mr=new Set;Mr.add(pe),f.updateQueue=Mr}else Jt.add(pe);break e}else{if(!(f&1)){gC(P,Ee,f),X0();break e}pe=Error(l(426))}}else if(ln&&ne.mode&1){var Gs=vC(L);if(Gs!==null){!(Gs.flags&65536)&&(Gs.flags|=256),xC(Gs,L,ne,P,f),n0(ji(pe,ne));break e}}P=pe=ji(pe,ne),Bn!==4&&(Bn=2),yu===null?yu=[P]:yu.push(P),P=L;do{switch(P.tag){case 3:P.flags|=65536,f&=-f,P.lanes|=f;var ue=mC(P,pe,f);N2(P,ue);break e;case 1:ne=pe;var se=P.type,me=P.stateNode;if(!(P.flags&128)&&(typeof se.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Ma===null||!Ma.has(me)))){P.flags|=65536,f&=-f,P.lanes|=f;var Ue=hC(P,ne,f);N2(P,Ue);break e}}P=P.return}while(P!==null)}XC(v)}catch(it){f=it,An===v&&v!==null&&(An=v=v.return);continue}break}while(1)}function KC(){var c=zf.current;return zf.current=If,c===null?If:c}function X0(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),qn===null||!(wl&268435455)&&!(Ff&268435455)||Ra(qn,er)}function Gf(c,f){var v=jt;jt|=2;var w=KC();(qn!==c||er!==f)&&(Us=null,Sl(c,f));do try{mD();break}catch(k){GC(c,k)}while(1);if(o0(),jt=v,zf.current=w,An!==null)throw Error(l(261));return qn=null,er=0,Bn}function mD(){for(;An!==null;)qC(An)}function hD(){for(;An!==null&&!B7();)qC(An)}function qC(c){var f=ZC(c.alternate,c,Ur);c.memoizedProps=c.pendingProps,f===null?XC(c):An=f,F0.current=null}function XC(c){var f=c;do{var v=f.alternate;if(c=f.return,f.flags&32768){if(v=iD(v,f),v!==null){v.flags&=32767,An=v;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Bn=6,An=null;return}}else if(v=lD(v,f,Ur),v!==null){An=v;return}if(f=f.sibling,f!==null){An=f;return}An=f=c}while(f!==null);Bn===0&&(Bn=5)}function kl(c,f,v){var w=Nt,k=En.transition;try{En.transition=null,Nt=1,gD(c,f,v,w)}finally{En.transition=k,Nt=w}return null}function gD(c,f,v,w){do _l();while(Oa!==null);if(jt&6)throw Error(l(327));v=c.finishedWork;var k=c.finishedLanes;if(v===null)return null;if(c.finishedWork=null,c.finishedLanes=0,v===c.current)throw Error(l(177));c.callbackNode=null,c.callbackPriority=0;var P=v.lanes|v.childLanes;if(F7(c,P),c===qn&&(An=qn=null,er=0),!(v.subtreeFlags&2064)&&!(v.flags&2064)||Hf||(Hf=!0,JC(Qg,function(){return _l(),null})),P=(v.flags&15990)!==0,v.subtreeFlags&15990||P){P=En.transition,En.transition=null;var L=Nt;Nt=1;var ne=jt;jt|=4,F0.current=null,uD(c,v),NC(v,c),B(c.containerInfo),c.current=v,dD(v),H7(),jt=ne,Nt=L,En.transition=P}else c.current=v;if(Hf&&(Hf=!1,Oa=c,Vf=k),P=c.pendingLanes,P===0&&(Ma=null),U7(v.stateNode),Er(c,Gn()),f!==null)for(w=c.onRecoverableError,v=0;v<f.length;v++)k=f[v],w(k.value,{componentStack:k.stack,digest:k.digest});if(Bf)throw Bf=!1,c=W0,W0=null,c;return Vf&1&&c.tag!==0&&_l(),P=c.pendingLanes,P&1?c===U0?Cu++:(Cu=0,U0=c):Cu=0,ls(),null}function _l(){if(Oa!==null){var c=j2(Vf),f=En.transition,v=Nt;try{if(En.transition=null,Nt=16>c?16:c,Oa===null)var w=!1;else{if(c=Oa,Oa=null,Vf=0,jt&6)throw Error(l(331));var k=jt;for(jt|=4,qe=c.current;qe!==null;){var P=qe,L=P.child;if(qe.flags&16){var ne=P.deletions;if(ne!==null){for(var pe=0;pe<ne.length;pe++){var Ee=ne[pe];for(qe=Ee;qe!==null;){var Xe=qe;switch(Xe.tag){case 0:case 11:case 15:vu(8,Xe,P)}var vt=Xe.child;if(vt!==null)vt.return=Xe,qe=vt;else for(;qe!==null;){Xe=qe;var We=Xe.sibling,sn=Xe.return;if(RC(Xe),Xe===Ee){qe=null;break}if(We!==null){We.return=sn,qe=We;break}qe=sn}}}var Jt=P.alternate;if(Jt!==null){var Mr=Jt.child;if(Mr!==null){Jt.child=null;do{var Gs=Mr.sibling;Mr.sibling=null,Mr=Gs}while(Mr!==null)}}qe=P}}if(P.subtreeFlags&2064&&L!==null)L.return=P,qe=L;else e:for(;qe!==null;){if(P=qe,P.flags&2048)switch(P.tag){case 0:case 11:case 15:vu(9,P,P.return)}var ue=P.sibling;if(ue!==null){ue.return=P.return,qe=ue;break e}qe=P.return}}var se=c.current;for(qe=se;qe!==null;){L=qe;var me=L.child;if(L.subtreeFlags&2064&&me!==null)me.return=L,qe=me;else e:for(L=se;qe!==null;){if(ne=qe,ne.flags&2048)try{switch(ne.tag){case 0:case 11:case 15:Rf(9,ne)}}catch(it){cn(ne,ne.return,it)}if(ne===L){qe=null;break e}var Ue=ne.sibling;if(Ue!==null){Ue.return=ne.return,qe=Ue;break e}qe=ne.return}}if(jt=k,ls(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(uf,c)}catch{}w=!0}return w}finally{Nt=v,En.transition=f}}return!1}function QC(c,f,v){f=ji(v,f),f=mC(c,f,1),c=Ea(c,f,1),f=ar(),c!==null&&(su(c,1,f),Er(c,f))}function cn(c,f,v){if(c.tag===3)QC(c,c,v);else for(;f!==null;){if(f.tag===3){QC(f,c,v);break}else if(f.tag===1){var w=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Ma===null||!Ma.has(w))){c=ji(v,c),c=hC(f,c,1),f=Ea(f,c,1),c=ar(),f!==null&&(su(f,1,c),Er(f,c));break}}f=f.return}}function vD(c,f,v){var w=c.pingCache;w!==null&&w.delete(f),f=ar(),c.pingedLanes|=c.suspendedLanes&v,qn===c&&(er&v)===v&&(Bn===4||Bn===3&&(er&130023424)===er&&500>Gn()-H0?Sl(c,0):B0|=v),Er(c,f)}function YC(c,f){f===0&&(c.mode&1?(f=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):f=1);var v=ar();c=is(c,f),c!==null&&(su(c,f,v),Er(c,v))}function xD(c){var f=c.memoizedState,v=0;f!==null&&(v=f.retryLane),YC(c,v)}function bD(c,f){var v=0;switch(c.tag){case 13:var w=c.stateNode,k=c.memoizedState;k!==null&&(v=k.retryLane);break;case 19:w=c.stateNode;break;default:throw Error(l(314))}w!==null&&w.delete(f),YC(c,v)}var ZC;ZC=function(c,f,v){if(c!==null)if(c.memoizedProps!==f.pendingProps||Rn.current)Ir=!0;else{if(!(c.lanes&v)&&!(f.flags&128))return Ir=!1,aD(c,f,v);Ir=!!(c.flags&131072)}else Ir=!1,ln&&f.flags&1048576&&E2(f,pf,f.index);switch(f.lanes=0,f.tag){case 2:var w=f.type;Ef(c,f),c=f.pendingProps;var k=vi(f,rn.current);wi(f,v),k=v0(null,f,w,c,k,v);var P=x0();return f.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,jr(w)?(P=!0,sf(f)):P=!1,f.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,i0(f),k.updater=yf,f.stateNode=k,k._reactInternals=f,u0(f,w,c,v),f=j0(null,f,w,!0,P,v)):(f.tag=0,ln&&P&&Zg(f),vr(null,f,k,v),f=f.child),f;case 16:w=f.elementType;e:{switch(Ef(c,f),c=f.pendingProps,k=w._init,w=k(w._payload),f.type=w,k=f.tag=CD(w),c=Ao(w,c),k){case 0:f=_0(null,f,w,c,v);break e;case 1:f=kC(null,f,w,c,v);break e;case 11:f=bC(null,f,w,c,v);break e;case 14:f=yC(null,f,w,Ao(w.type,c),v);break e}throw Error(l(306,w,""))}return f;case 0:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),_0(c,f,w,k,v);case 1:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),kC(c,f,w,k,v);case 3:e:{if(_C(f),c===null)throw Error(l(387));w=f.pendingProps,P=f.memoizedState,k=P.element,$2(c,f),bf(f,w,null,v);var L=f.memoizedState;if(w=L.element,we&&P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){k=ji(Error(l(423)),f),f=jC(c,f,w,v,k);break e}else if(w!==k){k=ji(Error(l(424)),f),f=jC(c,f,w,v,k);break e}else for(we&&(oo=Ze(f.stateNode.containerInfo),Wr=f,ln=!0,Ro=null,au=!1),v=U2(f,null,w,v),f.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(yi(),w===k){f=Ws(c,f,v);break e}vr(c,f,w,v)}f=f.child}return f;case 5:return G2(f),c===null&&t0(f),w=f.type,k=f.pendingProps,P=c!==null?c.memoizedProps:null,L=k.children,q(w,k)?L=null:P!==null&&q(w,P)&&(f.flags|=32),SC(c,f),vr(c,f,L,v),f.child;case 6:return c===null&&t0(f),null;case 13:return IC(c,f,v);case 4:return d0(f,f.stateNode.containerInfo),w=f.pendingProps,c===null?f.child=Si(f,null,w,v):vr(c,f,w,v),f.child;case 11:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),bC(c,f,w,k,v);case 7:return vr(c,f,f.pendingProps,v),f.child;case 8:return vr(c,f,f.pendingProps.children,v),f.child;case 12:return vr(c,f,f.pendingProps.children,v),f.child;case 10:e:{if(w=f.type._context,k=f.pendingProps,P=f.memoizedProps,L=k.value,A2(f,w,L),P!==null)if(Do(P.value,L)){if(P.children===k.children&&!Rn.current){f=Ws(c,f,v);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var ne=P.dependencies;if(ne!==null){L=P.child;for(var pe=ne.firstContext;pe!==null;){if(pe.context===w){if(P.tag===1){pe=Vs(-1,v&-v),pe.tag=2;var Ee=P.updateQueue;if(Ee!==null){Ee=Ee.shared;var Xe=Ee.pending;Xe===null?pe.next=pe:(pe.next=Xe.next,Xe.next=pe),Ee.pending=pe}}P.lanes|=v,pe=P.alternate,pe!==null&&(pe.lanes|=v),a0(P.return,v,f),ne.lanes|=v;break}pe=pe.next}}else if(P.tag===10)L=P.type===f.type?null:P.child;else if(P.tag===18){if(L=P.return,L===null)throw Error(l(341));L.lanes|=v,ne=L.alternate,ne!==null&&(ne.lanes|=v),a0(L,v,f),L=P.sibling}else L=P.child;if(L!==null)L.return=P;else for(L=P;L!==null;){if(L===f){L=null;break}if(P=L.sibling,P!==null){P.return=L.return,L=P;break}L=L.return}P=L}vr(c,f,k.children,v),f=f.child}return f;case 9:return k=f.type,w=f.pendingProps.children,wi(f,v),k=so(k),w=w(k),f.flags|=1,vr(c,f,w,v),f.child;case 14:return w=f.type,k=Ao(w,f.pendingProps),k=Ao(w.type,k),yC(c,f,w,k,v);case 15:return CC(c,f,f.type,f.pendingProps,v);case 17:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),Ef(c,f),f.tag=1,jr(w)?(c=!0,sf(f)):c=!1,wi(f,v),B2(f,w,k),u0(f,w,k,v),j0(null,f,w,!0,c,v);case 19:return EC(c,f,v);case 22:return wC(c,f,v)}throw Error(l(156,f.tag))};function JC(c,f){return qg(c,f)}function yD(c,f,v,w){this.tag=c,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function co(c,f,v,w){return new yD(c,f,v,w)}function Q0(c){return c=c.prototype,!(!c||!c.isReactComponent)}function CD(c){if(typeof c=="function")return Q0(c)?1:0;if(c!=null){if(c=c.$$typeof,c===b)return 11;if(c===_)return 14}return 2}function Aa(c,f){var v=c.alternate;return v===null?(v=co(c.tag,f,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=f,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&14680064,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,f=c.dependencies,v.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v}function Kf(c,f,v,w,k,P){var L=2;if(w=c,typeof c=="function")Q0(c)&&(L=1);else if(typeof c=="string")L=5;else e:switch(c){case m:return jl(v.children,k,P,f);case h:L=8,k|=8;break;case g:return c=co(12,v,f,k|2),c.elementType=g,c.lanes=P,c;case C:return c=co(13,v,f,k),c.elementType=C,c.lanes=P,c;case S:return c=co(19,v,f,k),c.elementType=S,c.lanes=P,c;case E:return qf(v,k,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case x:L=10;break e;case y:L=9;break e;case b:L=11;break e;case _:L=14;break e;case j:L=16,w=null;break e}throw Error(l(130,c==null?c:typeof c,""))}return f=co(L,v,f,k),f.elementType=c,f.type=w,f.lanes=P,f}function jl(c,f,v,w){return c=co(7,c,w,f),c.lanes=v,c}function qf(c,f,v,w){return c=co(22,c,w,f),c.elementType=E,c.lanes=v,c.stateNode={isHidden:!1},c}function Y0(c,f,v){return c=co(6,c,null,f),c.lanes=v,c}function Z0(c,f,v){return f=co(4,c.children!==null?c.children:[],c.key,f),f.lanes=v,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function wD(c,f,v,w,k){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=J,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gg(0),this.expirationTimes=Gg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gg(0),this.identifierPrefix=w,this.onRecoverableError=k,we&&(this.mutableSourceEagerHydrationData=null)}function ew(c,f,v,w,k,P,L,ne,pe){return c=new wD(c,f,v,ne,pe),f===1?(f=1,P===!0&&(f|=8)):f=0,P=co(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},i0(P),c}function tw(c){if(!c)return nr;c=c._reactInternals;e:{if(A(c)!==c||c.tag!==1)throw Error(l(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(jr(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(l(171))}if(c.tag===1){var v=c.type;if(jr(v))return S2(c,v,f)}return f}function nw(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(l(188)):(c=Object.keys(c).join(","),Error(l(268,c)));return c=X(f),c===null?null:c.stateNode}function rw(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<f?v:f}}function Xf(c,f){rw(c,f),(c=c.alternate)&&rw(c,f)}function SD(c){return c=X(c),c===null?null:c.stateNode}function kD(){return null}return n.attemptContinuousHydration=function(c){if(c.tag===13){var f=is(c,134217728);if(f!==null){var v=ar();io(f,c,134217728,v)}Xf(c,134217728)}},n.attemptDiscreteHydration=function(c){if(c.tag===13){var f=is(c,1);if(f!==null){var v=ar();io(f,c,1,v)}Xf(c,1)}},n.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var f=Da(c),v=is(c,f);if(v!==null){var w=ar();io(v,c,f,w)}Xf(c,f)}},n.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var v=ou(f.pendingLanes);v!==0&&(Kg(f,v|1),Er(f,Gn()),!(jt&6)&&(Ei(),ls()))}break;case 13:UC(function(){var w=is(c,1);if(w!==null){var k=ar();io(w,c,1,k)}}),Xf(c,1)}},n.batchedUpdates=function(c,f){var v=jt;jt|=1;try{return c(f)}finally{jt=v,jt===0&&(Ei(),df&&ls())}},n.createComponentSelector=function(c){return{$$typeof:Af,value:c}},n.createContainer=function(c,f,v,w,k,P,L){return ew(c,f,!1,null,v,w,k,P,L)},n.createHasPseudoClassSelector=function(c){return{$$typeof:Tf,value:c}},n.createHydrationContainer=function(c,f,v,w,k,P,L,ne,pe){return c=ew(v,w,!0,c,k,P,L,ne,pe),c.context=tw(null),v=c.current,w=ar(),k=Da(v),P=Vs(w,k),P.callback=f??null,Ea(v,P,k),c.current.lanes=k,su(c,k,w),Er(c,w),c},n.createPortal=function(c,f,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:w==null?null:""+w,children:c,containerInfo:f,implementation:v}},n.createRoleSelector=function(c){return{$$typeof:$f,value:c}},n.createTestNameSelector=function(c){return{$$typeof:Nf,value:c}},n.createTextSelector=function(c){return{$$typeof:Lf,value:c}},n.deferredUpdates=function(c){var f=Nt,v=En.transition;try{return En.transition=null,Nt=16,c()}finally{Nt=f,En.transition=v}},n.discreteUpdates=function(c,f,v,w,k){var P=Nt,L=En.transition;try{return En.transition=null,Nt=1,c(f,v,w,k)}finally{Nt=P,En.transition=L,jt===0&&Ei()}},n.findAllNodes=z0,n.findBoundingRects=function(c,f){if(!Ve)throw Error(l(363));f=z0(c,f),c=[];for(var v=0;v<f.length;v++)c.push(Ye(f[v]));for(f=c.length-1;0<f;f--){v=c[f];for(var w=v.x,k=w+v.width,P=v.y,L=P+v.height,ne=f-1;0<=ne;ne--)if(f!==ne){var pe=c[ne],Ee=pe.x,Xe=Ee+pe.width,vt=pe.y,We=vt+pe.height;if(w>=Ee&&P>=vt&&k<=Xe&&L<=We){c.splice(f,1);break}else if(w!==Ee||v.width!==pe.width||We<P||vt>L){if(!(P!==vt||v.height!==pe.height||Xe<w||Ee>k)){Ee>w&&(pe.width+=Ee-w,pe.x=w),Xe<k&&(pe.width=k-Ee),c.splice(f,1);break}}else{vt>P&&(pe.height+=vt-P,pe.y=P),We<L&&(pe.height=L-vt),c.splice(f,1);break}}}return c},n.findHostInstance=nw,n.findHostInstanceWithNoPortals=function(c){return c=$(c),c=c!==null?V(c):null,c===null?null:c.stateNode},n.findHostInstanceWithWarning=function(c){return nw(c)},n.flushControlled=function(c){var f=jt;jt|=1;var v=En.transition,w=Nt;try{En.transition=null,Nt=1,c()}finally{Nt=w,En.transition=v,jt=f,jt===0&&(Ei(),ls())}},n.flushPassiveEffects=_l,n.flushSync=UC,n.focusWithin=function(c,f){if(!Ve)throw Error(l(363));for(c=$0(c),f=HC(c,f),f=Array.from(f),c=0;c<f.length;){var v=f[c++];if(!he(v)){if(v.tag===5&&ut(v.stateNode))return!0;for(v=v.child;v!==null;)f.push(v),v=v.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Nt},n.getFindAllNodesFailureDescription=function(c,f){if(!Ve)throw Error(l(363));var v=0,w=[];c=[$0(c),0];for(var k=0;k<c.length;){var P=c[k++],L=c[k++],ne=f[L];if((P.tag!==5||!he(P))&&(N0(P,ne)&&(w.push(L0(ne)),L++,L>v&&(v=L)),L<f.length))for(P=P.child;P!==null;)c.push(P,L),P=P.sibling}if(v<f.length){for(c=[];v<f.length;v++)c.push(L0(f[v]));return`findAllNodes was able to match part of the selector:
+  `+(w.join(" > ")+`
+
+No matching component was found for:
+  `)+c.join(" > ")}return null},n.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return G(c.child.stateNode);default:return c.child.stateNode}},n.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:i.ReactCurrentDispatcher,findHostInstanceByFiber:SD,findFiberByHostInstance:c.findFiberByHostInstance||kD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{uf=f.inject(c),as=f}catch{}c=!!f.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,f,v,w){if(!Ve)throw Error(l(363));c=z0(c,f);var k=yt(c,v,w).disconnect;return{disconnect:function(){k()}}},n.registerMutableSourceForHydration=function(c,f){var v=f._getVersion;v=v(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,v]:c.mutableSourceEagerHydrationData.push(f,v)},n.runWithPriority=function(c,f){var v=Nt;try{return Nt=c,f()}finally{Nt=v}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,f,v,w){var k=f.current,P=ar(),L=Da(k);return v=tw(v),f.context===null?f.context=v:f.pendingContext=v,f=Vs(P,L),f.payload={element:c},w=w===void 0?null:w,w!==null&&(f.callback=w),c=Ea(k,f,L),c!==null&&(io(c,k,L,P),xf(c,k,L)),L},n};w7.exports=Cge;var wge=w7.exports;const Sge=Cd(wge);var S7={exports:{}},pi={};/**
+ * @license React
+ * react-reconciler-constants.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */pi.ConcurrentRoot=1;pi.ContinuousEventPriority=4;pi.DefaultEventPriority=16;pi.DiscreteEventPriority=1;pi.IdleEventPriority=536870912;pi.LegacyRoot=0;S7.exports=pi;var k7=S7.exports;const Aj={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Tj=!1,$j=!1;const b2=".react-konva-event",kge=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
+Position of a node will be changed during drag&drop, so you should update state of the react app as well.
+Consider to add onDragMove or onDragEnd events.
+For more info see: https://github.com/konvajs/react-konva/issues/256
+`,_ge=`ReactKonva: You are using "zIndex" attribute for a Konva node.
+react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
+For more info see: https://github.com/konvajs/react-konva/issues/194
+`,jge={};function Bg(e,t,n=jge){if(!Tj&&"zIndex"in t&&(console.warn(_ge),Tj=!0),!$j&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(kge),$j=!0)}for(var s in n)if(!Aj[s]){var l=s.slice(0,2)==="on",i=n[s]!==t[s];if(l&&i){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var m=t._useStrictMode,h={},g=!1;const x={};for(var s in t)if(!Aj[s]){var l=s.slice(0,2)==="on",y=n[s]!==t[s];if(l&&y){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[s]&&(x[u]=t[s])}!l&&(t[s]!==n[s]||m&&t[s]!==e.getAttr(s))&&(g=!0,h[s]=t[s])}g&&(e.setAttrs(h),gl(e));for(var u in x)e.on(u+b2,x[u])}function gl(e){if(!G9.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const _7={},Ige={};bd.Node.prototype._applyProps=Bg;function Pge(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),gl(e)}function Ege(e,t,n){let r=bd[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}"  If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=bd.Group);const o={},s={};for(var l in t){var i=l.slice(0,2)==="on";i?s[l]=t[l]:o[l]=t[l]}const u=new r(o);return Bg(u,s),u}function Mge(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Oge(e,t,n){return!1}function Dge(e){return e}function Rge(){return null}function Age(){return null}function Tge(e,t,n,r){return Ige}function $ge(){}function Nge(e){}function Lge(e,t){return!1}function zge(){return _7}function Fge(){return _7}const Bge=setTimeout,Hge=clearTimeout,Vge=-1;function Wge(e,t){return!1}const Uge=!1,Gge=!0,Kge=!0;function qge(e,t){t.parent===e?t.moveToTop():e.add(t),gl(e)}function Xge(e,t){t.parent===e?t.moveToTop():e.add(t),gl(e)}function j7(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),gl(e)}function Qge(e,t,n){j7(e,t,n)}function Yge(e,t){t.destroy(),t.off(b2),gl(e)}function Zge(e,t){t.destroy(),t.off(b2),gl(e)}function Jge(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function e0e(e,t,n){}function t0e(e,t,n,r,o){Bg(e,o,r)}function n0e(e){e.hide(),gl(e)}function r0e(e){}function o0e(e,t){(t.visible==null||t.visible)&&e.show()}function s0e(e,t){}function a0e(e){}function l0e(){}const i0e=()=>k7.DefaultEventPriority,c0e=Object.freeze(Object.defineProperty({__proto__:null,appendChild:qge,appendChildToContainer:Xge,appendInitialChild:Pge,cancelTimeout:Hge,clearContainer:a0e,commitMount:e0e,commitTextUpdate:Jge,commitUpdate:t0e,createInstance:Ege,createTextInstance:Mge,detachDeletedInstance:l0e,finalizeInitialChildren:Oge,getChildHostContext:Fge,getCurrentEventPriority:i0e,getPublicInstance:Dge,getRootHostContext:zge,hideInstance:n0e,hideTextInstance:r0e,idlePriority:Lp.unstable_IdlePriority,insertBefore:j7,insertInContainerBefore:Qge,isPrimaryRenderer:Uge,noTimeout:Vge,now:Lp.unstable_now,prepareForCommit:Rge,preparePortalMount:Age,prepareUpdate:Tge,removeChild:Yge,removeChildFromContainer:Zge,resetAfterCommit:$ge,resetTextContent:Nge,run:Lp.unstable_runWithPriority,scheduleTimeout:Bge,shouldDeprioritizeSubtree:Lge,shouldSetTextContent:Wge,supportsMutation:Kge,unhideInstance:o0e,unhideTextInstance:s0e,warnsIfNotActing:Gge},Symbol.toStringTag,{value:"Module"}));var u0e=Object.defineProperty,d0e=Object.defineProperties,f0e=Object.getOwnPropertyDescriptors,Nj=Object.getOwnPropertySymbols,p0e=Object.prototype.hasOwnProperty,m0e=Object.prototype.propertyIsEnumerable,Lj=(e,t,n)=>t in e?u0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zj=(e,t)=>{for(var n in t||(t={}))p0e.call(t,n)&&Lj(e,n,t[n]);if(Nj)for(var n of Nj(t))m0e.call(t,n)&&Lj(e,n,t[n]);return e},h0e=(e,t)=>d0e(e,f0e(t));function I7(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=I7(r,t,n);if(o)return o;r=t?null:r.sibling}}function P7(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const y2=P7(d.createContext(null));class E7 extends d.Component{render(){return d.createElement(y2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Fj,ReactCurrentDispatcher:Bj}=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g0e(){const e=d.useContext(y2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=d.useId();return d.useMemo(()=>{for(const r of[Fj==null?void 0:Fj.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=I7(r,!1,s=>{let l=s.memoizedState;for(;l;){if(l.memoizedState===t)return!0;l=l.next}});if(o)return o}},[e,t])}function v0e(){var e,t;const n=g0e(),[r]=d.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==y2&&!r.has(s)&&r.set(s,(t=Bj==null?void 0:Bj.current)==null?void 0:t.readContext(P7(s))),o=o.return}return r}function x0e(){const e=v0e();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,h0e(zj({},r),{value:e.get(n)}))),t=>d.createElement(E7,zj({},t))),[e])}function b0e(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const y0e=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=b0e(e),s=x0e(),l=i=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(i):u.current=i)};return H.useLayoutEffect(()=>(n.current=new bd.Stage({width:e.width,height:e.height,container:t.current}),l(n.current),r.current=zu.createContainer(n.current,k7.LegacyRoot,!1,null),zu.updateContainer(H.createElement(s,{},e.children),r.current),()=>{bd.isBrowser&&(l(null),zu.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{l(n.current),Bg(n.current,e,o),zu.updateContainer(H.createElement(s,{},e.children),r.current,null)}),H.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Ru="Layer",Os="Group",Ds="Rect",Il="Circle",vh="Line",M7="Image",C0e="Text",w0e="Transformer",zu=Sge(c0e);zu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const S0e=H.forwardRef((e,t)=>H.createElement(E7,{},H.createElement(y0e,{...e,forwardedRef:t}))),k0e=le([Cn,Eo],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),_0e=()=>{const e=te(),{tool:t,isStaging:n,isMovingBoundingBox:r}=W(k0e);return{handleDragStart:d.useCallback(()=>{(t==="move"||n)&&!r&&e(am(!0))},[e,r,n,t]),handleDragMove:d.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(qI(s))},[e,r,n,t]),handleDragEnd:d.useCallback(()=>{(t==="move"||n)&&!r&&e(am(!1))},[e,r,n,t])}},j0e=le([Cn,Zn,Eo],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:l,isMaskEnabled:i,shouldSnapToGrid:u}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:l,isStaging:n,isMaskEnabled:i,shouldSnapToGrid:u}},{memoizeOptions:{resultEqualityCheck:Bt}}),I0e=()=>{const e=te(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:l}=W(j0e),i=d.useRef(null),u=XI(),p=()=>e(QI());tt(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const m=()=>e(hb(!s));tt(["h"],()=>{m()},{enabled:()=>!o,preventDefault:!0},[s]),tt(["n"],()=>{e(lm(!l))},{enabled:!0,preventDefault:!0},[l]),tt("esc",()=>{e(K9())},{enabled:()=>!0,preventDefault:!0}),tt("shift+h",()=>{e(q9(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),tt(["space"],h=>{h.repeat||(u==null||u.container().focus(),r!=="move"&&(i.current=r,e(sc("move"))),r==="move"&&i.current&&i.current!=="move"&&(e(sc(i.current)),i.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,i])},C2=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},O7=()=>{const e=te(),t=b1(),n=XI();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=X9.pixelRatio,[s,l,i,u]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;u&&s&&l&&i&&e(Q9({r:s,g:l,b:i,a:u}))},commitColorUnderCursor:()=>{e(Y9())}}},P0e=le([Zn,Cn,Eo],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),E0e=e=>{const t=te(),{tool:n,isStaging:r}=W(P0e),{commitColorUnderCursor:o}=O7();return d.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(am(!0));return}if(n==="colorPicker"){o();return}const l=C2(e.current);l&&(s.evt.preventDefault(),t(YI(!0)),t(Z9([l.x,l.y])))},[e,n,r,t,o])},M0e=le([Zn,Cn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),O0e=(e,t,n)=>{const r=te(),{isDrawing:o,tool:s,isStaging:l}=W(M0e),{updateColorUnderCursor:i}=O7();return d.useCallback(()=>{if(!e.current)return;const u=C2(e.current);if(u){if(r(J9(u)),n.current=u,s==="colorPicker"){i();return}!o||s==="move"||l||(t.current=!0,r(ZI([u.x,u.y])))}},[t,r,o,l,n,e,s,i])},D0e=()=>{const e=te();return d.useCallback(()=>{e(e$())},[e])},R0e=le([Zn,Cn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),A0e=(e,t)=>{const n=te(),{tool:r,isDrawing:o,isStaging:s}=W(R0e);return d.useCallback(()=>{if(r==="move"||s){n(am(!1));return}if(!t.current&&o&&e.current){const l=C2(e.current);if(!l)return;n(ZI([l.x,l.y]))}else t.current=!1;n(YI(!1))},[t,n,o,s,e,r])},T0e=le([Cn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),$0e=e=>{const t=te(),{isMoveStageKeyHeld:n,stageScale:r}=W(T0e);return d.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const l={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let i=o.evt.deltaY;o.evt.ctrlKey&&(i=-i);const u=Bl(r*r$**i,n$,t$),p={x:s.x-l.x*u,y:s.y-l.y*u};t(o$(u)),t(qI(p))},[e,n,r,t])},N0e=le(Cn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:l,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),L0e=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(N0e);return a.jsxs(Os,{children:[a.jsx(Ds,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),a.jsx(Ds,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},z0e=d.memo(L0e),F0e=le([Cn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),B0e=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=W(F0e),{colorMode:r}=ha(),[o,s]=d.useState([]),[l,i]=Ho("colors",["base.800","base.200"]),u=d.useCallback(p=>p/e,[e]);return d.useLayoutEffect(()=>{const{width:p,height:m}=n,{x:h,y:g}=t,x={x1:0,y1:0,x2:p,y2:m,offset:{x:u(h),y:u(g)}},y={x:Math.ceil(u(h)/64)*64,y:Math.ceil(u(g)/64)*64},b={x1:-y.x,y1:-y.y,x2:u(p)-y.x+64,y2:u(m)-y.y+64},S={x1:Math.min(x.x1,b.x1),y1:Math.min(x.y1,b.y1),x2:Math.max(x.x2,b.x2),y2:Math.max(x.y2,b.y2)},_=S.x2-S.x1,j=S.y2-S.y1,E=Math.round(_/64)+1,I=Math.round(j/64)+1,M=Hw(0,E).map(R=>a.jsx(vh,{x:S.x1+R*64,y:S.y1,points:[0,0,0,j],stroke:r==="dark"?l:i,strokeWidth:1},`x_${R}`)),D=Hw(0,I).map(R=>a.jsx(vh,{x:S.x1,y:S.y1+R*64,points:[0,0,_,0],stroke:r==="dark"?l:i,strokeWidth:1},`y_${R}`));s(M.concat(D))},[e,t,n,u,r,l,i]),a.jsx(Os,{children:o})},H0e=d.memo(B0e),V0e=le([ge],({system:e,canvas:t})=>{const{denoiseProgress:n}=e,{boundingBox:r}=t.layerState.stagingArea,{batchIds:o}=t;return{boundingBox:r,progressImage:n&&o.includes(n.batch_id)?n.progress_image:void 0}},{memoizeOptions:{resultEqualityCheck:Bt}}),W0e=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=W(V0e),[o,s]=d.useState(null);return d.useEffect(()=>{if(!n)return;const l=new Image;l.onload=()=>{s(l)},l.src=n.dataURL},[n]),n&&r&&o?a.jsx(M7,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},U0e=d.memo(W0e),Fl=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},G0e=le(Cn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Fl(t)}}),Hj=e=>`data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+  <svg width="60px" height="60px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
+  <g transform="matrix(0.5,0,0,0.5,0,0)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,2.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,7.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,10)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,12.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,15)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,17.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,20)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,22.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,25)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,27.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,30)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-2.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-7.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-10)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-12.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-15)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-17.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-20)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-22.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-25)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-27.5)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+  <g transform="matrix(0.5,0,0,0.5,0,-30)">
+      <path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
+  </g>
+</svg>`.replaceAll("black",e),K0e=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(G0e),[l,i]=d.useState(null),[u,p]=d.useState(0),m=d.useRef(null),h=d.useCallback(()=>{p(u+1),setTimeout(h,500)},[u]);return d.useEffect(()=>{if(l)return;const g=new Image;g.onload=()=>{i(g)},g.src=Hj(n)},[l,n]),d.useEffect(()=>{l&&(l.src=Hj(n))},[l,n]),d.useEffect(()=>{const g=setInterval(()=>p(x=>(x+1)%5),50);return()=>clearInterval(g)},[]),!l||!Oi(r.x)||!Oi(r.y)||!Oi(s)||!Oi(o.width)||!Oi(o.height)?null:a.jsx(Ds,{ref:m,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:l,fillPatternOffsetY:Oi(u)?u:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},q0e=d.memo(K0e),X0e=le([Cn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Bt}}),Q0e=e=>{const{...t}=e,{objects:n}=W(X0e);return a.jsx(Os,{listening:!1,...t,children:n.filter(s$).map((r,o)=>a.jsx(vh,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})},Y0e=d.memo(Q0e);var Pl=d,Z0e=function(t,n,r){const o=Pl.useRef("loading"),s=Pl.useRef(),[l,i]=Pl.useState(0),u=Pl.useRef(),p=Pl.useRef(),m=Pl.useRef();return(u.current!==t||p.current!==n||m.current!==r)&&(o.current="loading",s.current=void 0,u.current=t,p.current=n,m.current=r),Pl.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function g(){o.current="loaded",s.current=h,i(Math.random())}function x(){o.current="failed",s.current=void 0,i(Math.random())}return h.addEventListener("load",g),h.addEventListener("error",x),n&&(h.crossOrigin=n),r&&(h.referrerPolicy=r),h.src=t,function(){h.removeEventListener("load",g),h.removeEventListener("error",x)}},[t,n,r]),[s.current,o.current]};const J0e=Cd(Z0e),eve=({canvasImage:e})=>{const[t,n,r,o]=Ho("colors",["base.400","base.500","base.700","base.900"]),s=aa(t,n),l=aa(r,o),{t:i}=Z();return a.jsxs(Os,{children:[a.jsx(Ds,{x:e.x,y:e.y,width:e.width,height:e.height,fill:s}),a.jsx(C0e,{x:e.x,y:e.y,width:e.width,height:e.height,align:"center",verticalAlign:"middle",fontFamily:'"Inter Variable", sans-serif',fontSize:e.width/16,fontStyle:"600",text:i("common.imageFailedToLoad"),fill:l})]})},tve=d.memo(eve),nve=e=>{const{x:t,y:n,imageName:r}=e.canvasImage,{currentData:o,isError:s}=wo(r??Zr.skipToken),[l,i]=J0e((o==null?void 0:o.image_url)??"",a$.get()?"use-credentials":"anonymous");return s||i==="failed"?a.jsx(tve,{canvasImage:e.canvasImage}):a.jsx(M7,{x:t,y:n,image:l,listening:!1})},D7=d.memo(nve),rve=le([Cn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),ove=()=>{const{objects:e}=W(rve);return e?a.jsx(Os,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(l$(t))return a.jsx(D7,{canvasImage:t},n);if(i$(t)){const r=a.jsx(vh,{points:t.points,stroke:t.color?Fl(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?a.jsx(Os,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(c$(t))return a.jsx(Ds,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Fl(t.color)},n);if(u$(t))return a.jsx(Ds,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},sve=d.memo(ove),ave=le([Cn],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:o,boundingBoxDimensions:s}=e,{selectedImageIndex:l,images:i,boundingBox:u}=t.stagingArea;return{currentStagingAreaImage:i.length>0&&l!==void 0?i[l]:void 0,isOnFirstImage:l===0,isOnLastImage:l===i.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:(u==null?void 0:u.x)??o.x,y:(u==null?void 0:u.y)??o.y,width:(u==null?void 0:u.width)??s.width,height:(u==null?void 0:u.height)??s.height}},{memoizeOptions:{resultEqualityCheck:Bt}}),lve=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:l,width:i,height:u}=W(ave);return a.jsxs(Os,{...t,children:[r&&n&&a.jsx(D7,{canvasImage:n}),o&&a.jsxs(Os,{children:[a.jsx(Ds,{x:s,y:l,width:i,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Ds,{x:s,y:l,width:i,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},ive=d.memo(lve),cve=le([Cn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentIndex:n,total:t.length,currentStagingAreaImage:t.length>0?t[n]:void 0,shouldShowStagingImage:o,shouldShowStagingOutline:r}},Ce),uve=()=>{const e=te(),{currentStagingAreaImage:t,shouldShowStagingImage:n,currentIndex:r,total:o}=W(cve),{t:s}=Z(),l=d.useCallback(()=>{e(Vw(!0))},[e]),i=d.useCallback(()=>{e(Vw(!1))},[e]),u=d.useCallback(()=>e(d$()),[e]),p=d.useCallback(()=>e(f$()),[e]),m=d.useCallback(()=>e(p$()),[e]);tt(["left"],u,{enabled:()=>!0,preventDefault:!0}),tt(["right"],p,{enabled:()=>!0,preventDefault:!0}),tt(["enter"],()=>m,{enabled:()=>!0,preventDefault:!0});const{data:h}=wo((t==null?void 0:t.imageName)??Zr.skipToken),g=d.useCallback(()=>{e(m$(!n))},[e,n]),x=d.useCallback(()=>{h&&e(h$({imageDTO:h}))},[e,h]),y=d.useCallback(()=>{e(g$())},[e]);return t?a.jsxs(N,{pos:"absolute",bottom:4,gap:2,w:"100%",align:"center",justify:"center",onMouseEnter:l,onMouseLeave:i,children:[a.jsxs(Ht,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Be,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:a.jsx($J,{}),onClick:u,colorScheme:"accent",isDisabled:!n}),a.jsx(ot,{colorScheme:"base",pointerEvents:"none",isDisabled:!n,minW:20,children:`${r+1}/${o}`}),a.jsx(Be,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:a.jsx(NJ,{}),onClick:p,colorScheme:"accent",isDisabled:!n})]}),a.jsxs(Ht,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Be,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(mM,{}),onClick:m,colorScheme:"accent"}),a.jsx(Be,{tooltip:s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"aria-label":s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"data-alert":!n,icon:n?a.jsx(QJ,{}):a.jsx(XJ,{}),onClick:g,colorScheme:"accent"}),a.jsx(Be,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),isDisabled:!h||!h.is_intermediate,icon:a.jsx(ug,{}),onClick:x,colorScheme:"accent"}),a.jsx(Be,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:a.jsx(Ec,{}),onClick:y,colorScheme:"error",fontSize:20})]})]}):null},dve=d.memo(uve),fve=()=>{const e=W(i=>i.canvas.layerState),t=W(i=>i.canvas.boundingBoxCoordinates),n=W(i=>i.canvas.boundingBoxDimensions),r=W(i=>i.canvas.isMaskEnabled),o=W(i=>i.canvas.shouldPreserveMaskedArea),[s,l]=d.useState();return d.useEffect(()=>{l(void 0)},[e,t,n,r,o]),wee(async()=>{const i=await v$(e,t,n,r,o);if(!i)return;const{baseImageData:u,maskImageData:p}=i,m=x$(u,p);l(m)},1e3,[e,t,n,r,o]),s},pve={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},mve=()=>{const e=fve();return a.jsxs(Ie,{children:["Mode: ",e?pve[e]:"..."]})},hve=d.memo(mve),rc=e=>Math.round(e*100)/100,gve=le([Cn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${rc(n)}, ${rc(r)})`}},{memoizeOptions:{resultEqualityCheck:Bt}});function vve(){const{cursorCoordinatesString:e}=W(gve),{t}=Z();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Lx="var(--invokeai-colors-warning-500)",xve=le([Cn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:l},scaledBoundingBoxDimensions:{width:i,height:u},boundingBoxCoordinates:{x:p,y:m},stageScale:h,shouldShowCanvasDebugInfo:g,layer:x,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:b}=e;let C="inherit";return(y==="none"&&(s<512||l<512)||y==="manual"&&i*u<512*512)&&(C=Lx),{activeLayerColor:x==="mask"?Lx:"inherit",layer:x,boundingBoxColor:C,boundingBoxCoordinatesString:`(${rc(p)}, ${rc(m)})`,boundingBoxDimensionsString:`${s}×${l}`,scaledBoundingBoxDimensionsString:`${i}×${u}`,canvasCoordinatesString:`${rc(r)}×${rc(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:g,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:b}},{memoizeOptions:{resultEqualityCheck:Bt}}),bve=()=>{const{activeLayerColor:e,layer:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:l,canvasCoordinatesString:i,canvasDimensionsString:u,canvasScaleString:p,shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:h,shouldPreserveMaskedArea:g}=W(xve),{t:x}=Z();return a.jsxs(N,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(hve,{}),a.jsx(Ie,{style:{color:e},children:`${x("unifiedCanvas.activeLayer")}: ${x(`unifiedCanvas.${t}`)}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasScale")}: ${p}%`}),g&&a.jsxs(Ie,{style:{color:Lx},children:[x("unifiedCanvas.preserveMaskedArea"),": ",x("common.on")]}),h&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.boundingBox")}: ${o}`}),l&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.scaledBoundingBox")}: ${s}`}),m&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${x("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasDimensions")}: ${u}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasPosition")}: ${i}`}),a.jsx(vve,{})]})]})},yve=d.memo(bve),Cve=le([ge],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:l,isMovingBoundingBox:i,tool:u,shouldSnapToGrid:p}=e,{aspectRatio:m}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:l,stageScale:o,shouldSnapToGrid:p,tool:u,hitStrokeWidth:20/o,aspectRatio:m}},{memoizeOptions:{resultEqualityCheck:Bt}}),wve=e=>{const{...t}=e,n=te(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:l,isTransformingBoundingBox:i,stageScale:u,shouldSnapToGrid:p,tool:m,hitStrokeWidth:h,aspectRatio:g}=W(Cve),x=d.useRef(null),y=d.useRef(null),[b,C]=d.useState(!1);d.useEffect(()=>{var z;!x.current||!y.current||(x.current.nodes([y.current]),(z=x.current.getLayer())==null||z.batchDraw())},[]);const S=64*u;tt("N",()=>{n(lm(!p))});const _=d.useCallback(z=>{if(!p){n(ov({x:Math.floor(z.target.x()),y:Math.floor(z.target.y())}));return}const V=z.target.x(),Q=z.target.y(),G=Cr(V,64),F=Cr(Q,64);z.target.x(G),z.target.y(F),n(ov({x:G,y:F}))},[n,p]),j=d.useCallback(()=>{if(!y.current)return;const z=y.current,V=z.scaleX(),Q=z.scaleY(),G=Math.round(z.width()*V),F=Math.round(z.height()*Q),U=Math.round(z.x()),T=Math.round(z.y());if(g){const B=Cr(G/g,64);n(Wo({width:G,height:B}))}else n(Wo({width:G,height:F}));n(ov({x:p?Au(U,64):U,y:p?Au(T,64):T})),z.scaleX(1),z.scaleY(1)},[n,p,g]),E=d.useCallback((z,V,Q)=>{const G=z.x%S,F=z.y%S;return{x:Au(V.x,S)+G,y:Au(V.y,S)+F}},[S]),I=d.useCallback(()=>{n(sv(!0))},[n]),M=d.useCallback(()=>{n(sv(!1)),n(av(!1)),n(ep(!1)),C(!1)},[n]),D=d.useCallback(()=>{n(av(!0))},[n]),R=d.useCallback(()=>{n(sv(!1)),n(av(!1)),n(ep(!1)),C(!1)},[n]),A=d.useCallback(()=>{C(!0)},[]),O=d.useCallback(()=>{!i&&!l&&C(!1)},[l,i]),$=d.useCallback(()=>{n(ep(!0))},[n]),X=d.useCallback(()=>{n(ep(!1))},[n]);return a.jsxs(Os,{...t,children:[a.jsx(Ds,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:$,onMouseOver:$,onMouseLeave:X,onMouseOut:X}),a.jsx(Ds,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:h,listening:!s&&m==="move",onDragStart:D,onDragEnd:R,onDragMove:_,onMouseDown:D,onMouseOut:O,onMouseOver:A,onMouseEnter:A,onMouseUp:R,onTransform:j,onTransformEnd:M,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/u,width:o.width,x:r.x,y:r.y}),a.jsx(w0e,{anchorCornerRadius:3,anchorDragBoundFunc:E,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:m==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&m==="move",onDragStart:D,onDragEnd:R,onMouseDown:I,onMouseUp:M,onTransformEnd:M,ref:x,rotateEnabled:!1})]})},Sve=d.memo(wve),kve=le(Cn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:l,layer:i,shouldShowBrush:u,isMovingBoundingBox:p,isTransformingBoundingBox:m,stageScale:h,stageDimensions:g,boundingBoxCoordinates:x,boundingBoxDimensions:y,shouldRestrictStrokesToBox:b}=e,C=b?{clipX:x.x,clipY:x.y,clipWidth:y.width,clipHeight:y.height}:{};return{cursorPosition:t,brushX:t?t.x:g.width/2,brushY:t?t.y:g.height/2,radius:n/2,colorPickerOuterRadius:Ww/h,colorPickerInnerRadius:(Ww-y1+1)/h,maskColorString:Fl({...o,a:.5}),brushColorString:Fl(s),colorPickerColorString:Fl(r),tool:l,layer:i,shouldShowBrush:u,shouldDrawBrushPreview:!(p||m||!t)&&u,strokeWidth:1.5/h,dotRadius:1.5/h,clip:C}},{memoizeOptions:{resultEqualityCheck:Bt}}),_ve=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:l,layer:i,shouldDrawBrushPreview:u,dotRadius:p,strokeWidth:m,brushColorString:h,colorPickerColorString:g,colorPickerInnerRadius:x,colorPickerOuterRadius:y,clip:b}=W(kve);return u?a.jsxs(Os,{listening:!1,...b,...t,children:[l==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(Il,{x:n,y:r,radius:y,stroke:h,strokeWidth:y1,strokeScaleEnabled:!1}),a.jsx(Il,{x:n,y:r,radius:x,stroke:g,strokeWidth:y1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(Il,{x:n,y:r,radius:o,fill:i==="mask"?s:h,globalCompositeOperation:l==="eraser"?"destination-out":"source-out"}),a.jsx(Il,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:m*2,strokeEnabled:!0,listening:!1}),a.jsx(Il,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:m,strokeEnabled:!0,listening:!1})]}),a.jsx(Il,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(Il,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},jve=d.memo(_ve),Ive=le([Cn,Eo],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:l,isMovingBoundingBox:i,stageDimensions:u,stageCoordinates:p,tool:m,isMovingStage:h,shouldShowIntermediates:g,shouldShowGrid:x,shouldRestrictStrokesToBox:y,shouldAntialias:b}=e;let C="none";return m==="move"||t?h?C="grabbing":C="grab":s?C=void 0:y&&!l&&(C="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||i,shouldShowBoundingBox:o,shouldShowGrid:x,stageCoordinates:p,stageCursor:C,stageDimensions:u,stageScale:r,tool:m,isStaging:t,shouldShowIntermediates:g,shouldAntialias:b}},Ce),Pve=Se(S0e,{shouldForwardProp:e=>!["sx"].includes(e)}),Eve=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:l,stageScale:i,tool:u,isStaging:p,shouldShowIntermediates:m,shouldAntialias:h}=W(Ive);I0e();const g=te(),x=d.useRef(null),y=d.useRef(null),b=d.useRef(null),C=d.useCallback(z=>{b$(z),y.current=z},[]),S=d.useCallback(z=>{y$(z),b.current=z},[]),_=d.useRef({x:0,y:0}),j=d.useRef(!1),E=$0e(y),I=E0e(y),M=A0e(y,j),D=O0e(y,j,_),R=D0e(),{handleDragStart:A,handleDragMove:O,handleDragEnd:$}=_0e(),X=d.useCallback(z=>z.evt.preventDefault(),[]);return d.useEffect(()=>{if(!x.current)return;const z=new ResizeObserver(G=>{for(const F of G)if(F.contentBoxSize){const{width:U,height:T}=F.contentRect;g(Uw({width:U,height:T}))}});z.observe(x.current);const{width:V,height:Q}=x.current.getBoundingClientRect();return g(Uw({width:V,height:Q})),()=>{z.disconnect()}},[g]),a.jsxs(N,{id:"canvas-container",ref:x,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(Pve,{tabIndex:-1,ref:C,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:l.width,height:l.height,scale:{x:i,y:i},onTouchStart:I,onTouchMove:D,onTouchEnd:M,onMouseDown:I,onMouseLeave:R,onMouseMove:D,onMouseUp:M,onDragStart:A,onDragMove:O,onDragEnd:$,onContextMenu:X,onWheel:E,draggable:(u==="move"||p)&&!t,children:[a.jsx(Ru,{id:"grid",visible:r,children:a.jsx(H0e,{})}),a.jsx(Ru,{id:"base",ref:S,listening:!1,imageSmoothingEnabled:h,children:a.jsx(sve,{})}),a.jsxs(Ru,{id:"mask",visible:e&&!p,listening:!1,children:[a.jsx(Y0e,{visible:!0,listening:!1}),a.jsx(q0e,{listening:!1})]}),a.jsx(Ru,{children:a.jsx(z0e,{})}),a.jsxs(Ru,{id:"preview",imageSmoothingEnabled:h,children:[!p&&a.jsx(jve,{visible:u!=="move",listening:!1}),a.jsx(ive,{visible:p}),m&&a.jsx(U0e,{}),a.jsx(Sve,{visible:n&&!p})]})]})}),a.jsx(yve,{}),a.jsx(dve,{})]})},Mve=d.memo(Eve);function Ove(e,t,n=250){const[r,o]=d.useState(0);return d.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),o(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>o(s=>s+1)}const a1={width:6,height:6,borderColor:"base.100"},Dve={".react-colorful__hue-pointer":a1,".react-colorful__saturation-pointer":a1,".react-colorful__alpha-pointer":a1},Rve=e=>a.jsx(Ie,{sx:Dve,children:a.jsx(PO,{...e})}),R7=d.memo(Rve),Ave=le([Cn,Eo],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Fl(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),Tve=()=>{const e=te(),{t}=Z(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:l}=W(Ave);tt(["q"],()=>{i()},{enabled:()=>!l,preventDefault:!0},[n]),tt(["shift+c"],()=>{u()},{enabled:()=>!l,preventDefault:!0},[]),tt(["h"],()=>{p()},{enabled:()=>!l,preventDefault:!0},[o]);const i=()=>{e(JI(n==="mask"?"base":"mask"))},u=()=>e(QI()),p=()=>e(hb(!o)),m=async()=>{e(S$())};return a.jsx(Qd,{triggerComponent:a.jsx(Ht,{children:a.jsx(Be,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(wM,{}),isChecked:n==="mask",isDisabled:l})}),children:a.jsxs(N,{direction:"column",gap:2,children:[a.jsx(xr,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(xr,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(C$(h.target.checked))}),a.jsx(Ie,{sx:{paddingTop:2,paddingBottom:2},children:a.jsx(R7,{color:r,onChange:h=>e(w$(h))})}),a.jsx(ot,{size:"sm",leftIcon:a.jsx(ug,{}),onClick:m,children:"Save Mask"}),a.jsxs(ot,{size:"sm",leftIcon:a.jsx(Fr,{}),onClick:u,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},$ve=d.memo(Tve),Nve=le([ge,Zn],({canvas:e},t)=>{const{futureLayerStates:n}=e;return{canRedo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function Lve(){const e=te(),{canRedo:t,activeTabName:n}=W(Nve),{t:r}=Z(),o=()=>{e(k$())};return tt(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Be,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(cee,{}),onClick:o,isDisabled:!t})}const zve=()=>{const e=W(Eo),t=te(),{t:n}=Z();return a.jsxs(Ig,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(_$()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(ot,{size:"sm",leftIcon:a.jsx(Fr,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},Fve=d.memo(zve),Bve=le([Cn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:l,shouldSnapToGrid:i,shouldRestrictStrokesToBox:u,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:l,shouldSnapToGrid:i,shouldRestrictStrokesToBox:u,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),Hve=()=>{const e=te(),{t}=Z(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:l,shouldShowIntermediates:i,shouldSnapToGrid:u,shouldRestrictStrokesToBox:p,shouldAntialias:m}=W(Bve);tt(["n"],()=>{e(lm(!u))},{enabled:!0,preventDefault:!0},[u]);const h=g=>e(lm(g.target.checked));return a.jsx(Qd,{isLazy:!1,triggerComponent:a.jsx(Be,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(IM,{})}),children:a.jsxs(N,{direction:"column",gap:2,children:[a.jsx(xr,{label:t("unifiedCanvas.showIntermediates"),isChecked:i,onChange:g=>e(j$(g.target.checked))}),a.jsx(xr,{label:t("unifiedCanvas.showGrid"),isChecked:l,onChange:g=>e(I$(g.target.checked))}),a.jsx(xr,{label:t("unifiedCanvas.snapToGrid"),isChecked:u,onChange:h}),a.jsx(xr,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:g=>e(P$(g.target.checked))}),a.jsx(xr,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:g=>e(E$(g.target.checked))}),a.jsx(xr,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:g=>e(M$(g.target.checked))}),a.jsx(xr,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:g=>e(O$(g.target.checked))}),a.jsx(xr,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:g=>e(D$(g.target.checked))}),a.jsx(xr,{label:t("unifiedCanvas.antialiasing"),isChecked:m,onChange:g=>e(R$(g.target.checked))}),a.jsx(Fve,{})]})})},Vve=d.memo(Hve),Wve=le([ge,Eo],({canvas:e},t)=>{const{tool:n,brushColor:r,brushSize:o}=e;return{tool:n,isStaging:t,brushColor:r,brushSize:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),Uve=()=>{const e=te(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=W(Wve),{t:s}=Z();tt(["b"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[]),tt(["e"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[t]),tt(["c"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),tt(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),tt(["delete","backspace"],()=>{m()},{enabled:()=>!o,preventDefault:!0}),tt(["BracketLeft"],()=>{r-5<=5?e(tp(Math.max(r-1,1))):e(tp(Math.max(r-5,1)))},{enabled:()=>!o,preventDefault:!0},[r]),tt(["BracketRight"],()=>{e(tp(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),tt(["Shift+BracketLeft"],()=>{e(lv({...n,a:Bl(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),tt(["Shift+BracketRight"],()=>{e(lv({...n,a:Bl(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const l=()=>e(sc("brush")),i=()=>e(sc("eraser")),u=()=>e(sc("colorPicker")),p=()=>e(A$()),m=()=>e(T$());return a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(see,{}),isChecked:t==="brush"&&!o,onClick:l,isDisabled:o}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(UJ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:i}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(YJ,{}),isDisabled:o,onClick:p}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(Xa,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:m}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(qJ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:u}),a.jsx(Qd,{triggerComponent:a.jsx(Be,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(_M,{})}),children:a.jsxs(N,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx(N,{gap:4,justifyContent:"space-between",children:a.jsx(rt,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:h=>e(tp(h)),sliderNumberInputProps:{max:500}})}),a.jsx(Ie,{sx:{width:"100%",paddingTop:2,paddingBottom:2},children:a.jsx(R7,{color:n,onChange:h=>e(lv(h))})})]})})]})},Gve=d.memo(Uve),Kve=le([ge,Zn],({canvas:e},t)=>{const{pastLayerStates:n}=e;return{canUndo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function qve(){const e=te(),{t}=Z(),{canUndo:n,activeTabName:r}=W(Kve),o=()=>{e($$())};return tt(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Be,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(dg,{}),onClick:o,isDisabled:!n})}const Xve=le([ge,Eo],({canvas:e},t)=>{const{tool:n,shouldCropToBoundingBoxOnSave:r,layer:o,isMaskEnabled:s}=e;return{isStaging:t,isMaskEnabled:s,tool:n,layer:o,shouldCropToBoundingBoxOnSave:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),Qve=()=>{const e=te(),{isStaging:t,isMaskEnabled:n,layer:r,tool:o}=W(Xve),s=b1(),{t:l}=Z(),{isClipboardAPIAvailable:i}=U8(),{getUploadButtonProps:u,getUploadInputProps:p}=Qy({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});tt(["v"],()=>{m()},{enabled:()=>!t,preventDefault:!0},[]),tt(["r"],()=>{g()},{enabled:()=>!0,preventDefault:!0},[s]),tt(["shift+m"],()=>{y()},{enabled:()=>!t,preventDefault:!0},[s]),tt(["shift+s"],()=>{b()},{enabled:()=>!t,preventDefault:!0},[s]),tt(["meta+c","ctrl+c"],()=>{C()},{enabled:()=>!t&&i,preventDefault:!0},[s,i]),tt(["shift+d"],()=>{S()},{enabled:()=>!t,preventDefault:!0},[s]);const m=()=>e(sc("move")),h=Ove(()=>g(!1),()=>g(!0)),g=(j=!1)=>{const E=b1();if(!E)return;const I=E.getClientRect({skipTransform:!0});e(L$({contentRect:I,shouldScaleTo1:j}))},x=()=>{e(iI())},y=()=>{e(z$())},b=()=>{e(F$())},C=()=>{i&&e(B$())},S=()=>{e(H$())},_=j=>{const E=j;e(JI(E)),E==="mask"&&!n&&e(hb(!0))};return a.jsxs(N,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx(On,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,value:r,data:N$,onChange:_,disabled:t})}),a.jsx($ve,{}),a.jsx(Gve,{}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:a.jsx(LJ,{}),isChecked:o==="move"||t,onClick:m}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:a.jsx(HJ,{}),onClick:h})]}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(nee,{}),onClick:y,isDisabled:t}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(ug,{}),onClick:b,isDisabled:t}),i&&a.jsx(Be,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Uc,{}),onClick:C,isDisabled:t}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(Gc,{}),onClick:S,isDisabled:t})]}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(qve,{}),a.jsx(Lve,{})]}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:a.jsx(fg,{}),isDisabled:t,...u()}),a.jsx("input",{...p()}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Fr,{}),onClick:x,colorScheme:"error",isDisabled:t})]}),a.jsx(Ht,{isAttached:!0,children:a.jsx(Vve,{})})]})},Yve=d.memo(Qve),Vj={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Zve=()=>{const{isOver:e,setNodeRef:t,active:n}=l8({id:"unifiedCanvas",data:Vj});return a.jsxs(N,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(Yve,{}),a.jsx(Mve,{}),i8(Vj,n)&&a.jsx(c8,{isOver:e,label:"Set Canvas Initial Image"})]})},Jve=d.memo(Zve),e1e=()=>a.jsx(Jve,{}),t1e=d.memo(e1e),n1e=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(Tn,{as:ZJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(bge,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(Tn,{as:Yl,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Ofe,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(Tn,{as:Doe,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(t1e,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(Tn,{as:Yy,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Phe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(Tn,{as:VJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Epe,{})},{id:"queue",translationKey:"queue.queue",icon:a.jsx(Tn,{as:pee,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(vge,{})}],r1e=le([ge],({config:e})=>{const{disabledTabs:t}=e;return n1e.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:Bt}}),o1e=448,s1e=448,a1e=360,l1e=["modelManager","queue"],i1e=["modelManager","queue"],c1e=()=>{const e=W(V$),t=W(Zn),n=W(r1e),{t:r}=Z(),o=te(),s=d.useCallback(O=>{O.target instanceof HTMLElement&&O.target.blur()},[]),l=d.useMemo(()=>n.map(O=>a.jsx(Vt,{hasArrow:!0,label:String(r(O.translationKey)),placement:"end",children:a.jsxs($r,{onClick:s,children:[a.jsx(g5,{children:String(r(O.translationKey))}),O.icon]})},O.id)),[n,r,s]),i=d.useMemo(()=>n.map(O=>a.jsx(Co,{children:O.content},O.id)),[n]),u=d.useCallback(O=>{const $=n[O];$&&o(Qs($.id))},[o,n]),{minSize:p,isCollapsed:m,setIsCollapsed:h,ref:g,reset:x,expand:y,collapse:b,toggle:C}=ej(o1e,"pixels"),{ref:S,minSize:_,isCollapsed:j,setIsCollapsed:E,reset:I,expand:M,collapse:D,toggle:R}=ej(a1e,"pixels");tt("f",()=>{j||m?(M(),y()):(b(),D())},[o,j,m]),tt(["t","o"],()=>{C()},[o]),tt("g",()=>{R()},[o]);const A=a2();return a.jsxs(ri,{variant:"appTabs",defaultIndex:e,index:e,onChange:u,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(oi,{sx:{pt:2,gap:4,flexDir:"column"},children:[l,a.jsx(ba,{})]}),a.jsxs(Mg,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!i1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Ya,{order:0,id:"side",ref:g,defaultSize:p,minSize:p,onCollapse:h,collapsible:!0,children:t==="nodes"?a.jsx(Dle,{}):a.jsx(efe,{})}),a.jsx(ph,{onDoubleClick:x,collapsedDirection:m?"left":void 0}),a.jsx($le,{isSidePanelCollapsed:m,sidePanelRef:g})]}),a.jsx(Ya,{id:"main",order:1,minSize:s1e,children:a.jsx(Hc,{style:{height:"100%",width:"100%"},children:i})}),!l1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(ph,{onDoubleClick:I,collapsedDirection:j?"right":void 0}),a.jsx(Ya,{id:"gallery",ref:S,order:2,defaultSize:_,minSize:_,onCollapse:E,collapsible:!0,children:a.jsx(ise,{})}),a.jsx(Ale,{isGalleryCollapsed:j,galleryPanelRef:S})]})]})]})},u1e=d.memo(c1e),d1e=d.createContext(null),l1={didCatch:!1,error:null};class f1e extends d.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=l1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(l1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&p1e(t.resetKeys,o)){var s,l;(s=(l=this.props).onReset)===null||s===void 0||s.call(l,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(l1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:s,error:l}=this.state;let i=t;if(s){const u={error:l,resetErrorBoundary:this.resetErrorBoundary};if(d.isValidElement(o))i=o;else if(typeof n=="function")i=n(u);else if(r)i=d.createElement(r,u);else throw l}return d.createElement(d1e.Provider,{value:{didCatch:s,error:l,resetErrorBoundary:this.resetErrorBoundary}},i)}}function p1e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function m1e(e={}){let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");const n=new URL(`${t}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(const o of r){let s=e[o];if(s!==void 0){if(o==="labels"||o==="projects"){if(!Array.isArray(s))throw new TypeError(`The \`${o}\` option should be an array`);s=s.join(",")}n.searchParams.set(o,s)}}return n.toString()}const h1e=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(e=>[e.name,e]),g1e=new Map(h1e),v1e=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],zx=new WeakSet,x1e=e=>{zx.add(e);const t=e.toJSON();return zx.delete(e),t},b1e=e=>g1e.get(e)??Error,A7=({from:e,seen:t,to:n,forceEnumerable:r,maxDepth:o,depth:s,useToJSON:l,serialize:i})=>{if(!n)if(Array.isArray(e))n=[];else if(!i&&Wj(e)){const p=b1e(e.name);n=new p}else n={};if(t.push(e),s>=o)return n;if(l&&typeof e.toJSON=="function"&&!zx.has(e))return x1e(e);const u=p=>A7({from:p,seen:[...t],forceEnumerable:r,maxDepth:o,depth:s,useToJSON:l,serialize:i});for(const[p,m]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(m)){n[p]="[object Buffer]";continue}if(m!==null&&typeof m=="object"&&typeof m.pipe=="function"){n[p]="[object Stream]";continue}if(typeof m!="function"){if(!m||typeof m!="object"){n[p]=m;continue}if(!t.includes(e[p])){s++,n[p]=u(e[p]);continue}n[p]="[Circular]"}}for(const{property:p,enumerable:m}of v1e)typeof e[p]<"u"&&e[p]!==null&&Object.defineProperty(n,p,{value:Wj(e[p])?u(e[p]):e[p],enumerable:r?!0:m,configurable:!0,writable:!0});return n};function y1e(e,t={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:r=!0}=t;return typeof e=="object"&&e!==null?A7({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:r,serialize:!0}):typeof e=="function"?`[Function: ${e.name??"anonymous"}]`:e}function Wj(e){return!!e&&typeof e=="object"&&"name"in e&&"message"in e&&"stack"in e}const C1e=({error:e,resetErrorBoundary:t})=>{const n=i5(),r=d.useCallback(()=>{const s=JSON.stringify(y1e(e),null,2);navigator.clipboard.writeText(`\`\`\`
+${s}
+\`\`\``),n({title:"Error Copied"})},[e,n]),o=d.useMemo(()=>m1e({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx(N,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs(N,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(cr,{children:"Something went wrong"}),a.jsx(N,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(be,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs(N,{sx:{gap:4},children:[a.jsx(ot,{leftIcon:a.jsx(_oe,{}),onClick:t,children:"Reset UI"}),a.jsx(ot,{leftIcon:a.jsx(Uc,{}),onClick:r,children:"Copy Error"}),a.jsx(Th,{href:o,isExternal:!0,children:a.jsx(ot,{leftIcon:a.jsx(yy,{}),children:"Create Issue"})})]})]})})},w1e=d.memo(C1e),S1e=le([ge],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),k1e=()=>{const e=te(),{shift:t,ctrl:n,meta:r}=W(S1e),{queueBack:o,isDisabled:s,isLoading:l}=Y8();tt(["ctrl+enter","meta+enter"],o,{enabled:()=>!s&&!l,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s,l]);const{queueFront:i,isDisabled:u,isLoading:p}=tO();return tt(["ctrl+shift+enter","meta+shift+enter"],i,{enabled:()=>!u&&!p,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,u,p]),tt("*",()=>{Gp("shift")?!t&&e(Nr(!0)):t&&e(Nr(!1)),Gp("ctrl")?!n&&e(Gw(!0)):n&&e(Gw(!1)),Gp("meta")?!r&&e(Kw(!0)):r&&e(Kw(!1))},{keyup:!0,keydown:!0},[t,n,r]),tt("1",()=>{e(Qs("txt2img"))}),tt("2",()=>{e(Qs("img2img"))}),tt("3",()=>{e(Qs("unifiedCanvas"))}),tt("4",()=>{e(Qs("nodes"))}),tt("5",()=>{e(Qs("modelManager"))}),null},_1e=d.memo(k1e),j1e=e=>{const t=te(),{recallAllParameters:n}=jg(),r=si(),{currentData:o}=wo((e==null?void 0:e.imageName)??Zr.skipToken),{currentData:s}=W$((e==null?void 0:e.imageName)??Zr.skipToken),l=d.useCallback(()=>{o&&(t(yI(o)),t(Qs("unifiedCanvas")),r({title:dI("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))},[t,r,o]),i=d.useCallback(()=>{o&&t(Ch(o))},[t,o]),u=d.useCallback(()=>{s&&n(s.metadata)},[s]);return d.useEffect(()=>{e&&e.action==="sendToCanvas"&&l()},[e,l]),d.useEffect(()=>{e&&e.action==="sendToImg2Img"&&i()},[e,i]),d.useEffect(()=>{e&&e.action==="useAllParameters"&&u()},[e,u]),{handleSendToCanvas:l,handleSendToImg2Img:i,handleUseAllMetadata:u}},I1e=e=>(j1e(e.selectedImage),null),P1e=d.memo(I1e),E1e={},M1e=({config:e=E1e,selectedImage:t})=>{const n=W(MM),r=yP("system"),o=te(),s=d.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);d.useEffect(()=>{bt.changeLanguage(n)},[n]),d.useEffect(()=>{DI(e)&&(r.info({config:e},"Received config"),o(U$(e)))},[o,e,r]),d.useEffect(()=>{o(G$())},[o]);const l=ng(K$);return a.jsxs(f1e,{onReset:s,FallbackComponent:w1e,children:[a.jsx(el,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(fG,{children:a.jsxs(el,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[l||a.jsx(Bee,{}),a.jsx(N,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(u1e,{})})]})})}),a.jsx(PJ,{}),a.jsx(kJ,{}),a.jsx(tU,{}),a.jsx(_1e,{}),a.jsx(P1e,{selectedImage:t})]})},$1e=d.memo(M1e);export{$1e as default};
diff --git a/invokeai/frontend/web/dist/assets/MantineProvider-2b56c833.js b/invokeai/frontend/web/dist/assets/MantineProvider-70b4f32d.js
similarity index 99%
rename from invokeai/frontend/web/dist/assets/MantineProvider-2b56c833.js
rename to invokeai/frontend/web/dist/assets/MantineProvider-70b4f32d.js
index 5daf427371..55f1fe838f 100644
--- a/invokeai/frontend/web/dist/assets/MantineProvider-2b56c833.js
+++ b/invokeai/frontend/web/dist/assets/MantineProvider-70b4f32d.js
@@ -1 +1 @@
-import{a9 as d,h_ as _,u as h,i9 as X}from"./index-a24a7159.js";const Y={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function q(r){return()=>({fontFamily:r.fontFamily||"sans-serif"})}var J=Object.defineProperty,x=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,z=(r,e,o)=>e in r?J(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,j=(r,e)=>{for(var o in e||(e={}))K.call(e,o)&&z(r,o,e[o]);if(x)for(var o of x(e))Q.call(e,o)&&z(r,o,e[o]);return r};function Z(r){return e=>({WebkitTapHighlightColor:"transparent",[e||"&:focus"]:j({},r.focusRing==="always"||r.focusRing==="auto"?r.focusRingStyles.styles(r):r.focusRingStyles.resetStyles(r)),[e?e.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:j({},r.focusRing==="auto"||r.focusRing==="never"?r.focusRingStyles.resetStyles(r):null)})}function y(r){return e=>typeof r.primaryShade=="number"?r.primaryShade:r.primaryShade[e||r.colorScheme]}function w(r){const e=y(r);return(o,n,a=!0,t=!0)=>{if(typeof o=="string"&&o.includes(".")){const[s,l]=o.split("."),g=parseInt(l,10);if(s in r.colors&&g>=0&&g<10)return r.colors[s][typeof n=="number"&&!t?n:g]}const i=typeof n=="number"?n:e();return o in r.colors?r.colors[o][i]:a?r.colors[r.primaryColor][i]:o}}function T(r){let e="";for(let o=1;o<r.length-1;o+=1)e+=`${r[o]} ${o/(r.length-1)*100}%, `;return`${r[0]} 0%, ${e}${r[r.length-1]} 100%`}function B(r,...e){return`linear-gradient(${r}deg, ${T(e)})`}function rr(...r){return`radial-gradient(circle, ${T(r)})`}function G(r){const e=w(r),o=y(r);return n=>{const a={from:(n==null?void 0:n.from)||r.defaultGradient.from,to:(n==null?void 0:n.to)||r.defaultGradient.to,deg:(n==null?void 0:n.deg)||r.defaultGradient.deg};return`linear-gradient(${a.deg}deg, ${e(a.from,o(),!1)} 0%, ${e(a.to,o(),!1)} 100%)`}}function D(r){return e=>{if(typeof e=="number")return`${e/16}${r}`;if(typeof e=="string"){const o=e.replace("px","");if(!Number.isNaN(Number(o)))return`${Number(o)/16}${r}`}return e}}const u=D("rem"),k=D("em");function V({size:r,sizes:e,units:o}){return r in e?e[r]:typeof r=="number"?o==="em"?k(r):u(r):r||e.md}function S(r){return typeof r=="number"?r:typeof r=="string"&&r.includes("rem")?Number(r.replace("rem",""))*16:typeof r=="string"&&r.includes("em")?Number(r.replace("em",""))*16:Number(r)}function er(r){return e=>`@media (min-width: ${k(S(V({size:e,sizes:r.breakpoints})))})`}function or(r){return e=>`@media (max-width: ${k(S(V({size:e,sizes:r.breakpoints}))-1)})`}function nr(r){return/^#?([0-9A-F]{3}){1,2}$/i.test(r)}function tr(r){let e=r.replace("#","");if(e.length===3){const i=e.split("");e=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}const o=parseInt(e,16),n=o>>16&255,a=o>>8&255,t=o&255;return{r:n,g:a,b:t,a:1}}function ar(r){const[e,o,n,a]=r.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:e,g:o,b:n,a:a||1}}function C(r){return nr(r)?tr(r):r.startsWith("rgb")?ar(r):{r:0,g:0,b:0,a:1}}function p(r,e){if(typeof r!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(r.startsWith("var(--"))return r;const{r:o,g:n,b:a}=C(r);return`rgba(${o}, ${n}, ${a}, ${e})`}function ir(r=0){return{position:"absolute",top:u(r),right:u(r),left:u(r),bottom:u(r)}}function sr(r,e){if(typeof r=="string"&&r.startsWith("var(--"))return r;const{r:o,g:n,b:a,a:t}=C(r),i=1-e,s=l=>Math.round(l*i);return`rgba(${s(o)}, ${s(n)}, ${s(a)}, ${t})`}function lr(r,e){if(typeof r=="string"&&r.startsWith("var(--"))return r;const{r:o,g:n,b:a,a:t}=C(r),i=s=>Math.round(s+(255-s)*e);return`rgba(${i(o)}, ${i(n)}, ${i(a)}, ${t})`}function fr(r){return e=>{if(typeof e=="number")return u(e);const o=typeof r.defaultRadius=="number"?r.defaultRadius:r.radius[r.defaultRadius]||r.defaultRadius;return r.radius[e]||e||o}}function cr(r,e){if(typeof r=="string"&&r.includes(".")){const[o,n]=r.split("."),a=parseInt(n,10);if(o in e.colors&&a>=0&&a<10)return{isSplittedColor:!0,key:o,shade:a}}return{isSplittedColor:!1}}function dr(r){const e=w(r),o=y(r),n=G(r);return({variant:a,color:t,gradient:i,primaryFallback:s})=>{const l=cr(t,r);switch(a){case"light":return{border:"transparent",background:p(e(t,r.colorScheme==="dark"?8:0,s,!1),r.colorScheme==="dark"?.2:1),color:t==="dark"?r.colorScheme==="dark"?r.colors.dark[0]:r.colors.dark[9]:e(t,r.colorScheme==="dark"?2:o("light")),hover:p(e(t,r.colorScheme==="dark"?7:1,s,!1),r.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:t==="dark"?r.colorScheme==="dark"?r.colors.dark[0]:r.colors.dark[9]:e(t,r.colorScheme==="dark"?2:o("light")),hover:p(e(t,r.colorScheme==="dark"?8:0,s,!1),r.colorScheme==="dark"?.2:1)};case"outline":return{border:e(t,r.colorScheme==="dark"?5:o("light")),background:"transparent",color:e(t,r.colorScheme==="dark"?5:o("light")),hover:r.colorScheme==="dark"?p(e(t,5,s,!1),.05):p(e(t,0,s,!1),.35)};case"default":return{border:r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[4],background:r.colorScheme==="dark"?r.colors.dark[6]:r.white,color:r.colorScheme==="dark"?r.white:r.black,hover:r.colorScheme==="dark"?r.colors.dark[5]:r.colors.gray[0]};case"white":return{border:"transparent",background:r.white,color:e(t,o()),hover:null};case"transparent":return{border:"transparent",color:t==="dark"?r.colorScheme==="dark"?r.colors.dark[0]:r.colors.dark[9]:e(t,r.colorScheme==="dark"?2:o("light")),background:"transparent",hover:null};case"gradient":return{background:n(i),color:r.white,border:"transparent",hover:null};default:{const g=o(),$=l.isSplittedColor?l.shade:g,O=l.isSplittedColor?l.key:t;return{border:"transparent",background:e(O,$,s),color:r.white,hover:e(O,$===9?8:$+1)}}}}}function ur(r){return e=>{const o=y(r)(e);return r.colors[r.primaryColor][o]}}function pr(r){return{"@media (hover: hover)":{"&:hover":r},"@media (hover: none)":{"&:active":r}}}function gr(r){return()=>({userSelect:"none",color:r.colorScheme==="dark"?r.colors.dark[3]:r.colors.gray[5]})}function br(r){return()=>r.colorScheme==="dark"?r.colors.dark[2]:r.colors.gray[6]}const f={fontStyles:q,themeColor:w,focusStyles:Z,linearGradient:B,radialGradient:rr,smallerThan:or,largerThan:er,rgba:p,cover:ir,darken:sr,lighten:lr,radius:fr,variant:dr,primaryShade:y,hover:pr,gradient:G,primaryColor:ur,placeholderStyles:gr,dimmed:br};var mr=Object.defineProperty,yr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,vr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,F=(r,e,o)=>e in r?mr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,hr=(r,e)=>{for(var o in e||(e={}))vr.call(e,o)&&F(r,o,e[o]);if(R)for(var o of R(e))_r.call(e,o)&&F(r,o,e[o]);return r},kr=(r,e)=>yr(r,Sr(e));function U(r){return kr(hr({},r),{fn:{fontStyles:f.fontStyles(r),themeColor:f.themeColor(r),focusStyles:f.focusStyles(r),largerThan:f.largerThan(r),smallerThan:f.smallerThan(r),radialGradient:f.radialGradient,linearGradient:f.linearGradient,gradient:f.gradient(r),rgba:f.rgba,cover:f.cover,lighten:f.lighten,darken:f.darken,primaryShade:f.primaryShade(r),radius:f.radius(r),variant:f.variant(r),hover:f.hover,primaryColor:f.primaryColor(r),placeholderStyles:f.placeholderStyles(r),dimmed:f.dimmed(r)}})}const $r={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:Y,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:r=>({outlineOffset:"0.125rem",outline:`0.125rem solid ${r.colors[r.primaryColor][r.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:r=>({outline:"none",borderColor:r.colors[r.primaryColor][typeof r.primaryShade=="object"?r.primaryShade[r.colorScheme]:r.primaryShade]})}},E=U($r);var Pr=Object.defineProperty,wr=Object.defineProperties,Cr=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,Er=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,M=(r,e,o)=>e in r?Pr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,xr=(r,e)=>{for(var o in e||(e={}))Er.call(e,o)&&M(r,o,e[o]);if(H)for(var o of H(e))Or.call(e,o)&&M(r,o,e[o]);return r},zr=(r,e)=>wr(r,Cr(e));function jr({theme:r}){return d.createElement(_,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:r.colorScheme==="dark"?"dark":"light"},body:zr(xr({},r.fn.fontStyles()),{backgroundColor:r.colorScheme==="dark"?r.colors.dark[7]:r.white,color:r.colorScheme==="dark"?r.colors.dark[0]:r.black,lineHeight:r.lineHeight,fontSize:r.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function b(r,e,o,n=u){Object.keys(e).forEach(a=>{r[`--mantine-${o}-${a}`]=n(e[a])})}function Rr({theme:r}){const e={"--mantine-color-white":r.white,"--mantine-color-black":r.black,"--mantine-transition-timing-function":r.transitionTimingFunction,"--mantine-line-height":`${r.lineHeight}`,"--mantine-font-family":r.fontFamily,"--mantine-font-family-monospace":r.fontFamilyMonospace,"--mantine-font-family-headings":r.headings.fontFamily,"--mantine-heading-font-weight":`${r.headings.fontWeight}`};b(e,r.shadows,"shadow"),b(e,r.fontSizes,"font-size"),b(e,r.radius,"radius"),b(e,r.spacing,"spacing"),b(e,r.breakpoints,"breakpoints",k),Object.keys(r.colors).forEach(n=>{r.colors[n].forEach((a,t)=>{e[`--mantine-color-${n}-${t}`]=a})});const o=r.headings.sizes;return Object.keys(o).forEach(n=>{e[`--mantine-${n}-font-size`]=o[n].fontSize,e[`--mantine-${n}-line-height`]=`${o[n].lineHeight}`}),d.createElement(_,{styles:{":root":e}})}var Fr=Object.defineProperty,Hr=Object.defineProperties,Mr=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,A=(r,e,o)=>e in r?Fr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,c=(r,e)=>{for(var o in e||(e={}))Ir.call(e,o)&&A(r,o,e[o]);if(I)for(var o of I(e))Ar.call(e,o)&&A(r,o,e[o]);return r},P=(r,e)=>Hr(r,Mr(e));function Nr(r,e){var o;if(!e)return r;const n=Object.keys(r).reduce((a,t)=>{if(t==="headings"&&e.headings){const i=e.headings.sizes?Object.keys(r.headings.sizes).reduce((s,l)=>(s[l]=c(c({},r.headings.sizes[l]),e.headings.sizes[l]),s),{}):r.headings.sizes;return P(c({},a),{headings:P(c(c({},r.headings),e.headings),{sizes:i})})}if(t==="breakpoints"&&e.breakpoints){const i=c(c({},r.breakpoints),e.breakpoints);return P(c({},a),{breakpoints:Object.fromEntries(Object.entries(i).sort((s,l)=>S(s[1])-S(l[1])))})}return a[t]=typeof e[t]=="object"?c(c({},r[t]),e[t]):typeof e[t]=="number"||typeof e[t]=="boolean"||typeof e[t]=="function"?e[t]:e[t]||r[t],a},{});if(e!=null&&e.fontFamily&&!((o=e==null?void 0:e.headings)!=null&&o.fontFamily)&&(n.headings.fontFamily=e.fontFamily),!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function Wr(r,e){return U(Nr(r,e))}function Tr(r){return Object.keys(r).reduce((e,o)=>(r[o]!==void 0&&(e[o]=r[o]),e),{})}const Gr={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${u(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function Dr(){return d.createElement(_,{styles:Gr})}var Vr=Object.defineProperty,N=Object.getOwnPropertySymbols,Ur=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable,W=(r,e,o)=>e in r?Vr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,m=(r,e)=>{for(var o in e||(e={}))Ur.call(e,o)&&W(r,o,e[o]);if(N)for(var o of N(e))Lr.call(e,o)&&W(r,o,e[o]);return r};const v=h.createContext({theme:E});function L(){var r;return((r=h.useContext(v))==null?void 0:r.theme)||E}function qr(r){const e=L(),o=n=>{var a,t,i,s;return{styles:((a=e.components[n])==null?void 0:a.styles)||{},classNames:((t=e.components[n])==null?void 0:t.classNames)||{},variants:(i=e.components[n])==null?void 0:i.variants,sizes:(s=e.components[n])==null?void 0:s.sizes}};return Array.isArray(r)?r.map(o):[o(r)]}function Jr(){var r;return(r=h.useContext(v))==null?void 0:r.emotionCache}function Kr(r,e,o){var n;const a=L(),t=(n=a.components[r])==null?void 0:n.defaultProps,i=typeof t=="function"?t(a):t;return m(m(m({},e),i),Tr(o))}function Xr({theme:r,emotionCache:e,withNormalizeCSS:o=!1,withGlobalStyles:n=!1,withCSSVariables:a=!1,inherit:t=!1,children:i}){const s=h.useContext(v),l=Wr(E,t?m(m({},s.theme),r):r);return d.createElement(X,{theme:l},d.createElement(v.Provider,{value:{theme:l,emotionCache:e}},o&&d.createElement(Dr,null),n&&d.createElement(jr,{theme:l}),a&&d.createElement(Rr,{theme:l}),typeof l.globalStyles=="function"&&d.createElement(_,{styles:l.globalStyles(l)}),i))}Xr.displayName="@mantine/core/MantineProvider";export{Xr as M,L as a,qr as b,V as c,Kr as d,Tr as f,S as g,u as r,Jr as u};
+import{aa as d,i2 as _,v as h,id as X}from"./index-27e8922c.js";const Y={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function q(r){return()=>({fontFamily:r.fontFamily||"sans-serif"})}var J=Object.defineProperty,x=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,z=(r,e,o)=>e in r?J(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,j=(r,e)=>{for(var o in e||(e={}))K.call(e,o)&&z(r,o,e[o]);if(x)for(var o of x(e))Q.call(e,o)&&z(r,o,e[o]);return r};function Z(r){return e=>({WebkitTapHighlightColor:"transparent",[e||"&:focus"]:j({},r.focusRing==="always"||r.focusRing==="auto"?r.focusRingStyles.styles(r):r.focusRingStyles.resetStyles(r)),[e?e.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:j({},r.focusRing==="auto"||r.focusRing==="never"?r.focusRingStyles.resetStyles(r):null)})}function y(r){return e=>typeof r.primaryShade=="number"?r.primaryShade:r.primaryShade[e||r.colorScheme]}function w(r){const e=y(r);return(o,n,a=!0,t=!0)=>{if(typeof o=="string"&&o.includes(".")){const[s,l]=o.split("."),g=parseInt(l,10);if(s in r.colors&&g>=0&&g<10)return r.colors[s][typeof n=="number"&&!t?n:g]}const i=typeof n=="number"?n:e();return o in r.colors?r.colors[o][i]:a?r.colors[r.primaryColor][i]:o}}function T(r){let e="";for(let o=1;o<r.length-1;o+=1)e+=`${r[o]} ${o/(r.length-1)*100}%, `;return`${r[0]} 0%, ${e}${r[r.length-1]} 100%`}function B(r,...e){return`linear-gradient(${r}deg, ${T(e)})`}function rr(...r){return`radial-gradient(circle, ${T(r)})`}function G(r){const e=w(r),o=y(r);return n=>{const a={from:(n==null?void 0:n.from)||r.defaultGradient.from,to:(n==null?void 0:n.to)||r.defaultGradient.to,deg:(n==null?void 0:n.deg)||r.defaultGradient.deg};return`linear-gradient(${a.deg}deg, ${e(a.from,o(),!1)} 0%, ${e(a.to,o(),!1)} 100%)`}}function D(r){return e=>{if(typeof e=="number")return`${e/16}${r}`;if(typeof e=="string"){const o=e.replace("px","");if(!Number.isNaN(Number(o)))return`${Number(o)/16}${r}`}return e}}const u=D("rem"),k=D("em");function V({size:r,sizes:e,units:o}){return r in e?e[r]:typeof r=="number"?o==="em"?k(r):u(r):r||e.md}function S(r){return typeof r=="number"?r:typeof r=="string"&&r.includes("rem")?Number(r.replace("rem",""))*16:typeof r=="string"&&r.includes("em")?Number(r.replace("em",""))*16:Number(r)}function er(r){return e=>`@media (min-width: ${k(S(V({size:e,sizes:r.breakpoints})))})`}function or(r){return e=>`@media (max-width: ${k(S(V({size:e,sizes:r.breakpoints}))-1)})`}function nr(r){return/^#?([0-9A-F]{3}){1,2}$/i.test(r)}function tr(r){let e=r.replace("#","");if(e.length===3){const i=e.split("");e=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}const o=parseInt(e,16),n=o>>16&255,a=o>>8&255,t=o&255;return{r:n,g:a,b:t,a:1}}function ar(r){const[e,o,n,a]=r.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:e,g:o,b:n,a:a||1}}function C(r){return nr(r)?tr(r):r.startsWith("rgb")?ar(r):{r:0,g:0,b:0,a:1}}function p(r,e){if(typeof r!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(r.startsWith("var(--"))return r;const{r:o,g:n,b:a}=C(r);return`rgba(${o}, ${n}, ${a}, ${e})`}function ir(r=0){return{position:"absolute",top:u(r),right:u(r),left:u(r),bottom:u(r)}}function sr(r,e){if(typeof r=="string"&&r.startsWith("var(--"))return r;const{r:o,g:n,b:a,a:t}=C(r),i=1-e,s=l=>Math.round(l*i);return`rgba(${s(o)}, ${s(n)}, ${s(a)}, ${t})`}function lr(r,e){if(typeof r=="string"&&r.startsWith("var(--"))return r;const{r:o,g:n,b:a,a:t}=C(r),i=s=>Math.round(s+(255-s)*e);return`rgba(${i(o)}, ${i(n)}, ${i(a)}, ${t})`}function fr(r){return e=>{if(typeof e=="number")return u(e);const o=typeof r.defaultRadius=="number"?r.defaultRadius:r.radius[r.defaultRadius]||r.defaultRadius;return r.radius[e]||e||o}}function cr(r,e){if(typeof r=="string"&&r.includes(".")){const[o,n]=r.split("."),a=parseInt(n,10);if(o in e.colors&&a>=0&&a<10)return{isSplittedColor:!0,key:o,shade:a}}return{isSplittedColor:!1}}function dr(r){const e=w(r),o=y(r),n=G(r);return({variant:a,color:t,gradient:i,primaryFallback:s})=>{const l=cr(t,r);switch(a){case"light":return{border:"transparent",background:p(e(t,r.colorScheme==="dark"?8:0,s,!1),r.colorScheme==="dark"?.2:1),color:t==="dark"?r.colorScheme==="dark"?r.colors.dark[0]:r.colors.dark[9]:e(t,r.colorScheme==="dark"?2:o("light")),hover:p(e(t,r.colorScheme==="dark"?7:1,s,!1),r.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:t==="dark"?r.colorScheme==="dark"?r.colors.dark[0]:r.colors.dark[9]:e(t,r.colorScheme==="dark"?2:o("light")),hover:p(e(t,r.colorScheme==="dark"?8:0,s,!1),r.colorScheme==="dark"?.2:1)};case"outline":return{border:e(t,r.colorScheme==="dark"?5:o("light")),background:"transparent",color:e(t,r.colorScheme==="dark"?5:o("light")),hover:r.colorScheme==="dark"?p(e(t,5,s,!1),.05):p(e(t,0,s,!1),.35)};case"default":return{border:r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[4],background:r.colorScheme==="dark"?r.colors.dark[6]:r.white,color:r.colorScheme==="dark"?r.white:r.black,hover:r.colorScheme==="dark"?r.colors.dark[5]:r.colors.gray[0]};case"white":return{border:"transparent",background:r.white,color:e(t,o()),hover:null};case"transparent":return{border:"transparent",color:t==="dark"?r.colorScheme==="dark"?r.colors.dark[0]:r.colors.dark[9]:e(t,r.colorScheme==="dark"?2:o("light")),background:"transparent",hover:null};case"gradient":return{background:n(i),color:r.white,border:"transparent",hover:null};default:{const g=o(),$=l.isSplittedColor?l.shade:g,O=l.isSplittedColor?l.key:t;return{border:"transparent",background:e(O,$,s),color:r.white,hover:e(O,$===9?8:$+1)}}}}}function ur(r){return e=>{const o=y(r)(e);return r.colors[r.primaryColor][o]}}function pr(r){return{"@media (hover: hover)":{"&:hover":r},"@media (hover: none)":{"&:active":r}}}function gr(r){return()=>({userSelect:"none",color:r.colorScheme==="dark"?r.colors.dark[3]:r.colors.gray[5]})}function br(r){return()=>r.colorScheme==="dark"?r.colors.dark[2]:r.colors.gray[6]}const f={fontStyles:q,themeColor:w,focusStyles:Z,linearGradient:B,radialGradient:rr,smallerThan:or,largerThan:er,rgba:p,cover:ir,darken:sr,lighten:lr,radius:fr,variant:dr,primaryShade:y,hover:pr,gradient:G,primaryColor:ur,placeholderStyles:gr,dimmed:br};var mr=Object.defineProperty,yr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,vr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,F=(r,e,o)=>e in r?mr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,hr=(r,e)=>{for(var o in e||(e={}))vr.call(e,o)&&F(r,o,e[o]);if(R)for(var o of R(e))_r.call(e,o)&&F(r,o,e[o]);return r},kr=(r,e)=>yr(r,Sr(e));function U(r){return kr(hr({},r),{fn:{fontStyles:f.fontStyles(r),themeColor:f.themeColor(r),focusStyles:f.focusStyles(r),largerThan:f.largerThan(r),smallerThan:f.smallerThan(r),radialGradient:f.radialGradient,linearGradient:f.linearGradient,gradient:f.gradient(r),rgba:f.rgba,cover:f.cover,lighten:f.lighten,darken:f.darken,primaryShade:f.primaryShade(r),radius:f.radius(r),variant:f.variant(r),hover:f.hover,primaryColor:f.primaryColor(r),placeholderStyles:f.placeholderStyles(r),dimmed:f.dimmed(r)}})}const $r={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:Y,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:r=>({outlineOffset:"0.125rem",outline:`0.125rem solid ${r.colors[r.primaryColor][r.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:r=>({outline:"none",borderColor:r.colors[r.primaryColor][typeof r.primaryShade=="object"?r.primaryShade[r.colorScheme]:r.primaryShade]})}},E=U($r);var Pr=Object.defineProperty,wr=Object.defineProperties,Cr=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,Er=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,M=(r,e,o)=>e in r?Pr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,xr=(r,e)=>{for(var o in e||(e={}))Er.call(e,o)&&M(r,o,e[o]);if(H)for(var o of H(e))Or.call(e,o)&&M(r,o,e[o]);return r},zr=(r,e)=>wr(r,Cr(e));function jr({theme:r}){return d.createElement(_,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:r.colorScheme==="dark"?"dark":"light"},body:zr(xr({},r.fn.fontStyles()),{backgroundColor:r.colorScheme==="dark"?r.colors.dark[7]:r.white,color:r.colorScheme==="dark"?r.colors.dark[0]:r.black,lineHeight:r.lineHeight,fontSize:r.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function b(r,e,o,n=u){Object.keys(e).forEach(a=>{r[`--mantine-${o}-${a}`]=n(e[a])})}function Rr({theme:r}){const e={"--mantine-color-white":r.white,"--mantine-color-black":r.black,"--mantine-transition-timing-function":r.transitionTimingFunction,"--mantine-line-height":`${r.lineHeight}`,"--mantine-font-family":r.fontFamily,"--mantine-font-family-monospace":r.fontFamilyMonospace,"--mantine-font-family-headings":r.headings.fontFamily,"--mantine-heading-font-weight":`${r.headings.fontWeight}`};b(e,r.shadows,"shadow"),b(e,r.fontSizes,"font-size"),b(e,r.radius,"radius"),b(e,r.spacing,"spacing"),b(e,r.breakpoints,"breakpoints",k),Object.keys(r.colors).forEach(n=>{r.colors[n].forEach((a,t)=>{e[`--mantine-color-${n}-${t}`]=a})});const o=r.headings.sizes;return Object.keys(o).forEach(n=>{e[`--mantine-${n}-font-size`]=o[n].fontSize,e[`--mantine-${n}-line-height`]=`${o[n].lineHeight}`}),d.createElement(_,{styles:{":root":e}})}var Fr=Object.defineProperty,Hr=Object.defineProperties,Mr=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,A=(r,e,o)=>e in r?Fr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,c=(r,e)=>{for(var o in e||(e={}))Ir.call(e,o)&&A(r,o,e[o]);if(I)for(var o of I(e))Ar.call(e,o)&&A(r,o,e[o]);return r},P=(r,e)=>Hr(r,Mr(e));function Nr(r,e){var o;if(!e)return r;const n=Object.keys(r).reduce((a,t)=>{if(t==="headings"&&e.headings){const i=e.headings.sizes?Object.keys(r.headings.sizes).reduce((s,l)=>(s[l]=c(c({},r.headings.sizes[l]),e.headings.sizes[l]),s),{}):r.headings.sizes;return P(c({},a),{headings:P(c(c({},r.headings),e.headings),{sizes:i})})}if(t==="breakpoints"&&e.breakpoints){const i=c(c({},r.breakpoints),e.breakpoints);return P(c({},a),{breakpoints:Object.fromEntries(Object.entries(i).sort((s,l)=>S(s[1])-S(l[1])))})}return a[t]=typeof e[t]=="object"?c(c({},r[t]),e[t]):typeof e[t]=="number"||typeof e[t]=="boolean"||typeof e[t]=="function"?e[t]:e[t]||r[t],a},{});if(e!=null&&e.fontFamily&&!((o=e==null?void 0:e.headings)!=null&&o.fontFamily)&&(n.headings.fontFamily=e.fontFamily),!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function Wr(r,e){return U(Nr(r,e))}function Tr(r){return Object.keys(r).reduce((e,o)=>(r[o]!==void 0&&(e[o]=r[o]),e),{})}const Gr={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${u(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function Dr(){return d.createElement(_,{styles:Gr})}var Vr=Object.defineProperty,N=Object.getOwnPropertySymbols,Ur=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable,W=(r,e,o)=>e in r?Vr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,m=(r,e)=>{for(var o in e||(e={}))Ur.call(e,o)&&W(r,o,e[o]);if(N)for(var o of N(e))Lr.call(e,o)&&W(r,o,e[o]);return r};const v=h.createContext({theme:E});function L(){var r;return((r=h.useContext(v))==null?void 0:r.theme)||E}function qr(r){const e=L(),o=n=>{var a,t,i,s;return{styles:((a=e.components[n])==null?void 0:a.styles)||{},classNames:((t=e.components[n])==null?void 0:t.classNames)||{},variants:(i=e.components[n])==null?void 0:i.variants,sizes:(s=e.components[n])==null?void 0:s.sizes}};return Array.isArray(r)?r.map(o):[o(r)]}function Jr(){var r;return(r=h.useContext(v))==null?void 0:r.emotionCache}function Kr(r,e,o){var n;const a=L(),t=(n=a.components[r])==null?void 0:n.defaultProps,i=typeof t=="function"?t(a):t;return m(m(m({},e),i),Tr(o))}function Xr({theme:r,emotionCache:e,withNormalizeCSS:o=!1,withGlobalStyles:n=!1,withCSSVariables:a=!1,inherit:t=!1,children:i}){const s=h.useContext(v),l=Wr(E,t?m(m({},s.theme),r):r);return d.createElement(X,{theme:l},d.createElement(v.Provider,{value:{theme:l,emotionCache:e}},o&&d.createElement(Dr,null),n&&d.createElement(jr,{theme:l}),a&&d.createElement(Rr,{theme:l}),typeof l.globalStyles=="function"&&d.createElement(_,{styles:l.globalStyles(l)}),i))}Xr.displayName="@mantine/core/MantineProvider";export{Xr as M,L as a,qr as b,V as c,Kr as d,Tr as f,S as g,u as r,Jr as u};
diff --git a/invokeai/frontend/web/dist/assets/ThemeLocaleProvider-6be4f995.js b/invokeai/frontend/web/dist/assets/ThemeLocaleProvider-b6697945.js
similarity index 92%
rename from invokeai/frontend/web/dist/assets/ThemeLocaleProvider-6be4f995.js
rename to invokeai/frontend/web/dist/assets/ThemeLocaleProvider-b6697945.js
index 3d6db01aa7..08e3ce8116 100644
--- a/invokeai/frontend/web/dist/assets/ThemeLocaleProvider-6be4f995.js
+++ b/invokeai/frontend/web/dist/assets/ThemeLocaleProvider-b6697945.js
@@ -1,4 +1,4 @@
-import{v as s,h_ as T,u as l,a1 as I,h$ as R,ad as V,i0 as z,i1 as j,i2 as D,i3 as F,i4 as G,i5 as W,i6 as K,aF as H,i7 as U,i8 as Y}from"./index-a24a7159.js";import{M as Z}from"./MantineProvider-2b56c833.js";var P=String.raw,E=P`
+import{w as s,i2 as T,v as l,a2 as I,i3 as R,ae as V,i4 as z,i5 as j,i6 as D,i7 as F,i8 as G,i9 as W,ia as K,aG as H,ib as U,ic as Y}from"./index-27e8922c.js";import{M as Z}from"./MantineProvider-70b4f32d.js";var P=String.raw,E=P`
   :root,
   :host {
     --chakra-vh: 100vh;
@@ -277,4 +277,4 @@ import{v as s,h_ as T,u as l,a1 as I,h$ as R,ad as V,i0 as z,i1 as j,i2 as D,i3
       }
 
       ${E}
-    `}),g={light:"chakra-ui-light",dark:"chakra-ui-dark"};function Q(e={}){const{preventTransition:o=!0}=e,n={setDataset:r=>{const t=o?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,t==null||t()},setClassName(r){document.body.classList.add(r?g.dark:g.light),document.body.classList.remove(r?g.light:g.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var t;return((t=n.query().matches)!=null?t:r==="dark")?"dark":"light"},addListener(r){const t=n.query(),i=a=>{r(a.matches?"dark":"light")};return typeof t.addListener=="function"?t.addListener(i):t.addEventListener("change",i),()=>{typeof t.removeListener=="function"?t.removeListener(i):t.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var X="chakra-ui-color-mode";function L(e){return{ssr:!1,type:"localStorage",get(o){if(!(globalThis!=null&&globalThis.document))return o;let n;try{n=localStorage.getItem(e)||o}catch{}return n||o},set(o){try{localStorage.setItem(e,o)}catch{}}}}var ee=L(X),M=()=>{};function S(e,o){return e.type==="cookie"&&e.ssr?e.get(o):o}function O(e){const{value:o,children:n,options:{useSystemColorMode:r,initialColorMode:t,disableTransitionOnChange:i}={},colorModeManager:a=ee}=e,d=t==="dark"?"dark":"light",[u,p]=l.useState(()=>S(a,d)),[y,b]=l.useState(()=>S(a)),{getSystemTheme:w,setClassName:k,setDataset:x,addListener:$}=l.useMemo(()=>Q({preventTransition:i}),[i]),v=t==="system"&&!u?y:u,c=l.useCallback(h=>{const f=h==="system"?w():h;p(f),k(f==="dark"),x(f),a.set(f)},[a,w,k,x]);I(()=>{t==="system"&&b(w())},[]),l.useEffect(()=>{const h=a.get();if(h){c(h);return}if(t==="system"){c("system");return}c(d)},[a,d,t,c]);const C=l.useCallback(()=>{c(v==="dark"?"light":"dark")},[v,c]);l.useEffect(()=>{if(r)return $(c)},[r,$,c]);const A=l.useMemo(()=>({colorMode:o??v,toggleColorMode:o?M:C,setColorMode:o?M:c,forced:o!==void 0}),[v,C,c,o]);return s.jsx(R.Provider,{value:A,children:n})}O.displayName="ColorModeProvider";var te=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function re(e){return V(e)?te.every(o=>Object.prototype.hasOwnProperty.call(e,o)):!1}function m(e){return typeof e=="function"}function oe(...e){return o=>e.reduce((n,r)=>r(n),o)}var ne=e=>function(...n){let r=[...n],t=n[n.length-1];return re(t)&&r.length>1?r=r.slice(0,r.length-1):t=e,oe(...r.map(i=>a=>m(i)?i(a):ae(a,i)))(t)},ie=ne(j);function ae(...e){return z({},...e,_)}function _(e,o,n,r){if((m(e)||m(o))&&Object.prototype.hasOwnProperty.call(r,n))return(...t)=>{const i=m(e)?e(...t):e,a=m(o)?o(...t):o;return z({},i,a,_)}}var q=l.createContext({getDocument(){return document},getWindow(){return window}});q.displayName="EnvironmentContext";function N(e){const{children:o,environment:n,disabled:r}=e,t=l.useRef(null),i=l.useMemo(()=>n||{getDocument:()=>{var d,u;return(u=(d=t.current)==null?void 0:d.ownerDocument)!=null?u:document},getWindow:()=>{var d,u;return(u=(d=t.current)==null?void 0:d.ownerDocument.defaultView)!=null?u:window}},[n]),a=!r||!n;return s.jsxs(q.Provider,{value:i,children:[o,a&&s.jsx("span",{id:"__chakra_env",hidden:!0,ref:t})]})}N.displayName="EnvironmentProvider";var se=e=>{const{children:o,colorModeManager:n,portalZIndex:r,resetScope:t,resetCSS:i=!0,theme:a={},environment:d,cssVarsRoot:u,disableEnvironment:p,disableGlobalStyle:y}=e,b=s.jsx(N,{environment:d,disabled:p,children:o});return s.jsx(D,{theme:a,cssVarsRoot:u,children:s.jsxs(O,{colorModeManager:n,options:a.config,children:[i?s.jsx(J,{scope:t}):s.jsx(B,{}),!y&&s.jsx(F,{}),r?s.jsx(G,{zIndex:r,children:b}):b]})})},le=e=>function({children:n,theme:r=e,toastOptions:t,...i}){return s.jsxs(se,{theme:r,...i,children:[s.jsx(W,{value:t==null?void 0:t.defaultOptions,children:n}),s.jsx(K,{...t})]})},de=le(j);const ue=()=>l.useMemo(()=>({colorScheme:"dark",fontFamily:"'Inter Variable', sans-serif",components:{ScrollArea:{defaultProps:{scrollbarSize:10},styles:{scrollbar:{"&:hover":{backgroundColor:"var(--invokeai-colors-baseAlpha-300)"}},thumb:{backgroundColor:"var(--invokeai-colors-baseAlpha-300)"}}}}}),[]),ce=L("@@invokeai-color-mode");function he({children:e}){const{i18n:o}=H(),n=o.dir(),r=l.useMemo(()=>ie({...U,direction:n}),[n]);l.useEffect(()=>{document.body.dir=n},[n]);const t=ue();return s.jsx(Z,{theme:t,children:s.jsx(de,{theme:r,colorModeManager:ce,toastOptions:Y,children:e})})}const ve=l.memo(he);export{ve as default};
+    `}),g={light:"chakra-ui-light",dark:"chakra-ui-dark"};function Q(e={}){const{preventTransition:o=!0}=e,n={setDataset:r=>{const t=o?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,t==null||t()},setClassName(r){document.body.classList.add(r?g.dark:g.light),document.body.classList.remove(r?g.light:g.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var t;return((t=n.query().matches)!=null?t:r==="dark")?"dark":"light"},addListener(r){const t=n.query(),i=a=>{r(a.matches?"dark":"light")};return typeof t.addListener=="function"?t.addListener(i):t.addEventListener("change",i),()=>{typeof t.removeListener=="function"?t.removeListener(i):t.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var X="chakra-ui-color-mode";function L(e){return{ssr:!1,type:"localStorage",get(o){if(!(globalThis!=null&&globalThis.document))return o;let n;try{n=localStorage.getItem(e)||o}catch{}return n||o},set(o){try{localStorage.setItem(e,o)}catch{}}}}var ee=L(X),M=()=>{};function S(e,o){return e.type==="cookie"&&e.ssr?e.get(o):o}function O(e){const{value:o,children:n,options:{useSystemColorMode:r,initialColorMode:t,disableTransitionOnChange:i}={},colorModeManager:a=ee}=e,d=t==="dark"?"dark":"light",[u,p]=l.useState(()=>S(a,d)),[y,b]=l.useState(()=>S(a)),{getSystemTheme:w,setClassName:k,setDataset:x,addListener:$}=l.useMemo(()=>Q({preventTransition:i}),[i]),v=t==="system"&&!u?y:u,c=l.useCallback(m=>{const f=m==="system"?w():m;p(f),k(f==="dark"),x(f),a.set(f)},[a,w,k,x]);I(()=>{t==="system"&&b(w())},[]),l.useEffect(()=>{const m=a.get();if(m){c(m);return}if(t==="system"){c("system");return}c(d)},[a,d,t,c]);const C=l.useCallback(()=>{c(v==="dark"?"light":"dark")},[v,c]);l.useEffect(()=>{if(r)return $(c)},[r,$,c]);const A=l.useMemo(()=>({colorMode:o??v,toggleColorMode:o?M:C,setColorMode:o?M:c,forced:o!==void 0}),[v,C,c,o]);return s.jsx(R.Provider,{value:A,children:n})}O.displayName="ColorModeProvider";var te=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function re(e){return V(e)?te.every(o=>Object.prototype.hasOwnProperty.call(e,o)):!1}function h(e){return typeof e=="function"}function oe(...e){return o=>e.reduce((n,r)=>r(n),o)}var ne=e=>function(...n){let r=[...n],t=n[n.length-1];return re(t)&&r.length>1?r=r.slice(0,r.length-1):t=e,oe(...r.map(i=>a=>h(i)?i(a):ae(a,i)))(t)},ie=ne(j);function ae(...e){return z({},...e,_)}function _(e,o,n,r){if((h(e)||h(o))&&Object.prototype.hasOwnProperty.call(r,n))return(...t)=>{const i=h(e)?e(...t):e,a=h(o)?o(...t):o;return z({},i,a,_)}}var q=l.createContext({getDocument(){return document},getWindow(){return window}});q.displayName="EnvironmentContext";function N(e){const{children:o,environment:n,disabled:r}=e,t=l.useRef(null),i=l.useMemo(()=>n||{getDocument:()=>{var d,u;return(u=(d=t.current)==null?void 0:d.ownerDocument)!=null?u:document},getWindow:()=>{var d,u;return(u=(d=t.current)==null?void 0:d.ownerDocument.defaultView)!=null?u:window}},[n]),a=!r||!n;return s.jsxs(q.Provider,{value:i,children:[o,a&&s.jsx("span",{id:"__chakra_env",hidden:!0,ref:t})]})}N.displayName="EnvironmentProvider";var se=e=>{const{children:o,colorModeManager:n,portalZIndex:r,resetScope:t,resetCSS:i=!0,theme:a={},environment:d,cssVarsRoot:u,disableEnvironment:p,disableGlobalStyle:y}=e,b=s.jsx(N,{environment:d,disabled:p,children:o});return s.jsx(D,{theme:a,cssVarsRoot:u,children:s.jsxs(O,{colorModeManager:n,options:a.config,children:[i?s.jsx(J,{scope:t}):s.jsx(B,{}),!y&&s.jsx(F,{}),r?s.jsx(G,{zIndex:r,children:b}):b]})})},le=e=>function({children:n,theme:r=e,toastOptions:t,...i}){return s.jsxs(se,{theme:r,...i,children:[s.jsx(W,{value:t==null?void 0:t.defaultOptions,children:n}),s.jsx(K,{...t})]})},de=le(j);const ue=()=>l.useMemo(()=>({colorScheme:"dark",fontFamily:"'Inter Variable', sans-serif",components:{ScrollArea:{defaultProps:{scrollbarSize:10},styles:{scrollbar:{"&:hover":{backgroundColor:"var(--invokeai-colors-baseAlpha-300)"}},thumb:{backgroundColor:"var(--invokeai-colors-baseAlpha-300)"}}}}}),[]),ce=L("@@invokeai-color-mode");function me({children:e}){const{i18n:o}=H(),n=o.dir(),r=l.useMemo(()=>ie({...U,direction:n}),[n]);l.useEffect(()=>{document.body.dir=n},[n]);const t=ue();return s.jsx(Z,{theme:t,children:s.jsx(de,{theme:r,colorModeManager:ce,toastOptions:Y,children:e})})}const ve=l.memo(me);export{ve as default};
diff --git a/invokeai/frontend/web/dist/assets/index-27e8922c.js b/invokeai/frontend/web/dist/assets/index-27e8922c.js
new file mode 100644
index 0000000000..64114559c9
--- /dev/null
+++ b/invokeai/frontend/web/dist/assets/index-27e8922c.js
@@ -0,0 +1,158 @@
+var nQ=Object.defineProperty;var rQ=(e,t,n)=>t in e?nQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Mw=(e,t,n)=>(rQ(e,typeof t!="symbol"?t+"":t,n),n),$w=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ae=(e,t,n)=>($w(e,t,"read from private field"),n?n.call(e):t.get(e)),Yn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ca=(e,t,n,r)=>($w(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var zp=(e,t,n,r)=>({set _(i){ca(e,t,i,n)},get _(){return ae(e,t,r)}}),_s=(e,t,n)=>($w(e,t,"access private method"),n);function nN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xS(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var rN={exports:{}},wS={},iN={exports:{}},Dt={};/**
+ * @license React
+ * react.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var J0=Symbol.for("react.element"),iQ=Symbol.for("react.portal"),oQ=Symbol.for("react.fragment"),aQ=Symbol.for("react.strict_mode"),sQ=Symbol.for("react.profiler"),lQ=Symbol.for("react.provider"),uQ=Symbol.for("react.context"),cQ=Symbol.for("react.forward_ref"),dQ=Symbol.for("react.suspense"),fQ=Symbol.for("react.memo"),hQ=Symbol.for("react.lazy"),t6=Symbol.iterator;function pQ(e){return e===null||typeof e!="object"?null:(e=t6&&e[t6]||e["@@iterator"],typeof e=="function"?e:null)}var oN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},aN=Object.assign,sN={};function yp(e,t,n){this.props=e,this.context=t,this.refs=sN,this.updater=n||oN}yp.prototype.isReactComponent={};yp.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};yp.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lN(){}lN.prototype=yp.prototype;function oT(e,t,n){this.props=e,this.context=t,this.refs=sN,this.updater=n||oN}var aT=oT.prototype=new lN;aT.constructor=oT;aN(aT,yp.prototype);aT.isPureReactComponent=!0;var n6=Array.isArray,uN=Object.prototype.hasOwnProperty,sT={current:null},cN={key:!0,ref:!0,__self:!0,__source:!0};function dN(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)uN.call(t,r)&&!cN.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:J0,type:e,key:o,ref:a,props:i,_owner:sT.current}}function gQ(e,t){return{$$typeof:J0,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function lT(e){return typeof e=="object"&&e!==null&&e.$$typeof===J0}function mQ(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var r6=/\/+/g;function Nw(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mQ(""+e.key):t.toString(36)}function P1(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case J0:case iQ:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Nw(a,0):r,n6(i)?(n="",e!=null&&(n=e.replace(r6,"$&/")+"/"),P1(i,t,n,"",function(u){return u})):i!=null&&(lT(i)&&(i=gQ(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(r6,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",n6(e))for(var s=0;s<e.length;s++){o=e[s];var l=r+Nw(o,s);a+=P1(o,t,n,l,i)}else if(l=pQ(e),typeof l=="function")for(e=l.call(e),s=0;!(o=e.next()).done;)o=o.value,l=r+Nw(o,s++),a+=P1(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Jy(e,t,n){if(e==null)return e;var r=[],i=0;return P1(e,r,"","",function(o){return t.call(n,o,i++)}),r}function yQ(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var fo={current:null},I1={transition:null},vQ={ReactCurrentDispatcher:fo,ReactCurrentBatchConfig:I1,ReactCurrentOwner:sT};Dt.Children={map:Jy,forEach:function(e,t,n){Jy(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Jy(e,function(){t++}),t},toArray:function(e){return Jy(e,function(t){return t})||[]},only:function(e){if(!lT(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Dt.Component=yp;Dt.Fragment=oQ;Dt.Profiler=sQ;Dt.PureComponent=oT;Dt.StrictMode=aQ;Dt.Suspense=dQ;Dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vQ;Dt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=aN({},e.props),i=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=sT.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)uN.call(t,l)&&!cN.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:J0,type:e.type,key:i,ref:o,props:r,_owner:a}};Dt.createContext=function(e){return e={$$typeof:uQ,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:lQ,_context:e},e.Consumer=e};Dt.createElement=dN;Dt.createFactory=function(e){var t=dN.bind(null,e);return t.type=e,t};Dt.createRef=function(){return{current:null}};Dt.forwardRef=function(e){return{$$typeof:cQ,render:e}};Dt.isValidElement=lT;Dt.lazy=function(e){return{$$typeof:hQ,_payload:{_status:-1,_result:e},_init:yQ}};Dt.memo=function(e,t){return{$$typeof:fQ,type:e,compare:t===void 0?null:t}};Dt.startTransition=function(e){var t=I1.transition;I1.transition={};try{e()}finally{I1.transition=t}};Dt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Dt.useCallback=function(e,t){return fo.current.useCallback(e,t)};Dt.useContext=function(e){return fo.current.useContext(e)};Dt.useDebugValue=function(){};Dt.useDeferredValue=function(e){return fo.current.useDeferredValue(e)};Dt.useEffect=function(e,t){return fo.current.useEffect(e,t)};Dt.useId=function(){return fo.current.useId()};Dt.useImperativeHandle=function(e,t,n){return fo.current.useImperativeHandle(e,t,n)};Dt.useInsertionEffect=function(e,t){return fo.current.useInsertionEffect(e,t)};Dt.useLayoutEffect=function(e,t){return fo.current.useLayoutEffect(e,t)};Dt.useMemo=function(e,t){return fo.current.useMemo(e,t)};Dt.useReducer=function(e,t,n){return fo.current.useReducer(e,t,n)};Dt.useRef=function(e){return fo.current.useRef(e)};Dt.useState=function(e){return fo.current.useState(e)};Dt.useSyncExternalStore=function(e,t,n){return fo.current.useSyncExternalStore(e,t,n)};Dt.useTransition=function(){return fo.current.useTransition()};Dt.version="18.2.0";iN.exports=Dt;var I=iN.exports;const An=Sc(I),i6=nN({__proto__:null,default:An},[I]);/**
+ * @license React
+ * react-jsx-runtime.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var bQ=I,_Q=Symbol.for("react.element"),SQ=Symbol.for("react.fragment"),xQ=Object.prototype.hasOwnProperty,wQ=bQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,CQ={key:!0,ref:!0,__self:!0,__source:!0};function fN(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)xQ.call(t,r)&&!CQ.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:_Q,type:e,key:o,ref:a,props:i,_owner:wQ.current}}wS.Fragment=SQ;wS.jsx=fN;wS.jsxs=fN;rN.exports=wS;var W=rN.exports,r3={},hN={exports:{}},oa={},pN={exports:{}},gN={};/**
+ * @license React
+ * scheduler.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */(function(e){function t(M,R){var $=M.length;M.push(R);e:for(;0<$;){var B=$-1>>>1,U=M[B];if(0<i(U,R))M[B]=R,M[$]=U,$=B;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var R=M[0],$=M.pop();if($!==R){M[0]=$;e:for(var B=0,U=M.length,G=U>>>1;B<G;){var Y=2*(B+1)-1,ee=M[Y],J=Y+1,j=M[J];if(0>i(ee,$))J<U&&0>i(j,ee)?(M[B]=j,M[J]=$,B=J):(M[B]=ee,M[Y]=$,B=Y);else if(J<U&&0>i(j,$))M[B]=j,M[J]=$,B=J;else break e}}return R}function i(M,R){var $=M.sortIndex-R.sortIndex;return $!==0?$:M.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(M){for(var R=n(u);R!==null;){if(R.callback===null)r(u);else if(R.startTime<=M)r(u),R.sortIndex=R.expirationTime,t(l,R);else break;R=n(u)}}function v(M){if(m=!1,g(M),!p)if(n(l)!==null)p=!0,D(S);else{var R=n(u);R!==null&&L(v,R.startTime-M)}}function S(M,R){p=!1,m&&(m=!1,b(C),C=-1),h=!0;var $=f;try{for(g(R),d=n(l);d!==null&&(!(d.expirationTime>R)||M&&!P());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var U=B(d.expirationTime<=R);R=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(l)&&r(l),g(R)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var Y=n(u);Y!==null&&L(v,Y.startTime-R),G=!1}return G}finally{d=null,f=$,h=!1}}var w=!1,x=null,C=-1,T=5,E=-1;function P(){return!(e.unstable_now()-E<T)}function N(){if(x!==null){var M=e.unstable_now();E=M;var R=!0;try{R=x(!0,M)}finally{R?O():(w=!1,x=null)}}else w=!1}var O;if(typeof y=="function")O=function(){y(N)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,k=A.port2;A.port1.onmessage=N,O=function(){k.postMessage(null)}}else O=function(){_(N,0)};function D(M){x=M,w||(w=!0,O())}function L(M,R){C=_(function(){M(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,D(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(M){switch(f){case 1:case 2:case 3:var R=3;break;default:R=f}var $=f;f=R;try{return M()}finally{f=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,R){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var $=f;f=M;try{return R()}finally{f=$}},e.unstable_scheduleCallback=function(M,R,$){var B=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?B+$:B):$=B,M){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=$+U,M={id:c++,callback:R,priorityLevel:M,startTime:$,expirationTime:U,sortIndex:-1},$>B?(M.sortIndex=$,t(u,M),n(l)===null&&M===n(u)&&(m?(b(C),C=-1):m=!0,L(v,$-B))):(M.sortIndex=U,t(l,M),p||h||(p=!0,D(S))),M},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(M){var R=f;return function(){var $=f;f=R;try{return M.apply(this,arguments)}finally{f=$}}}})(gN);pN.exports=gN;var AQ=pN.exports;/**
+ * @license React
+ * react-dom.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var mN=I,ta=AQ;function le(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var yN=new Set,ym={};function qd(e,t){Bh(e,t),Bh(e+"Capture",t)}function Bh(e,t){for(ym[e]=t,e=0;e<t.length;e++)yN.add(t[e])}var ql=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),i3=Object.prototype.hasOwnProperty,EQ=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,o6={},a6={};function TQ(e){return i3.call(a6,e)?!0:i3.call(o6,e)?!1:EQ.test(e)?a6[e]=!0:(o6[e]=!0,!1)}function kQ(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function PQ(e,t,n,r){if(t===null||typeof t>"u"||kQ(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ho(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ri={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ri[e]=new ho(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ri[t]=new ho(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ri[e]=new ho(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ri[e]=new ho(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ri[e]=new ho(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ri[e]=new ho(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ri[e]=new ho(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ri[e]=new ho(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ri[e]=new ho(e,5,!1,e.toLowerCase(),null,!1,!1)});var uT=/[\-:]([a-z])/g;function cT(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(uT,cT);Ri[t]=new ho(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(uT,cT);Ri[t]=new ho(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(uT,cT);Ri[t]=new ho(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ri[e]=new ho(e,1,!1,e.toLowerCase(),null,!1,!1)});Ri.xlinkHref=new ho("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ri[e]=new ho(e,1,!1,e.toLowerCase(),null,!0,!0)});function dT(e,t,n,r){var i=Ri.hasOwnProperty(t)?Ri[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(PQ(t,n,i,r)&&(n=null),r||i===null?TQ(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var nu=mN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ev=Symbol.for("react.element"),$f=Symbol.for("react.portal"),Nf=Symbol.for("react.fragment"),fT=Symbol.for("react.strict_mode"),o3=Symbol.for("react.profiler"),vN=Symbol.for("react.provider"),bN=Symbol.for("react.context"),hT=Symbol.for("react.forward_ref"),a3=Symbol.for("react.suspense"),s3=Symbol.for("react.suspense_list"),pT=Symbol.for("react.memo"),wu=Symbol.for("react.lazy"),_N=Symbol.for("react.offscreen"),s6=Symbol.iterator;function jp(e){return e===null||typeof e!="object"?null:(e=s6&&e[s6]||e["@@iterator"],typeof e=="function"?e:null)}var dr=Object.assign,Dw;function _g(e){if(Dw===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Dw=t&&t[1]||""}return`
+`+Dw+e}var Lw=!1;function Fw(e,t){if(!e||Lw)return"";Lw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
+`),o=r.stack.split(`
+`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
+`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Lw=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_g(e):""}function IQ(e){switch(e.tag){case 5:return _g(e.type);case 16:return _g("Lazy");case 13:return _g("Suspense");case 19:return _g("SuspenseList");case 0:case 2:case 15:return e=Fw(e.type,!1),e;case 11:return e=Fw(e.type.render,!1),e;case 1:return e=Fw(e.type,!0),e;default:return""}}function l3(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Nf:return"Fragment";case $f:return"Portal";case o3:return"Profiler";case fT:return"StrictMode";case a3:return"Suspense";case s3:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bN:return(e.displayName||"Context")+".Consumer";case vN:return(e._context.displayName||"Context")+".Provider";case hT:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pT:return t=e.displayName||null,t!==null?t:l3(e.type)||"Memo";case wu:t=e._payload,e=e._init;try{return l3(e(t))}catch{}}return null}function RQ(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return l3(t);case 8:return t===fT?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function oc(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function SN(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OQ(e){var t=SN(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tv(e){e._valueTracker||(e._valueTracker=OQ(e))}function xN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=SN(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function xb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function u3(e,t){var n=t.checked;return dr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function l6(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=oc(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wN(e,t){t=t.checked,t!=null&&dT(e,"checked",t,!1)}function c3(e,t){wN(e,t);var n=oc(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?d3(e,t.type,n):t.hasOwnProperty("defaultValue")&&d3(e,t.type,oc(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function u6(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function d3(e,t,n){(t!=="number"||xb(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Sg=Array.isArray;function rh(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+oc(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function f3(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(le(91));return dr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function c6(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(le(92));if(Sg(n)){if(1<n.length)throw Error(le(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:oc(n)}}function CN(e,t){var n=oc(t.value),r=oc(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function d6(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function AN(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function h3(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?AN(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nv,EN=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(nv=nv||document.createElement("div"),nv.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nv.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function vm(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zg={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},MQ=["Webkit","ms","Moz","O"];Object.keys(zg).forEach(function(e){MQ.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zg[t]=zg[e]})});function TN(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zg.hasOwnProperty(e)&&zg[e]?(""+t).trim():t+"px"}function kN(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=TN(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var $Q=dr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function p3(e,t){if(t){if($Q[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function g3(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var m3=null;function gT(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var y3=null,ih=null,oh=null;function f6(e){if(e=ny(e)){if(typeof y3!="function")throw Error(le(280));var t=e.stateNode;t&&(t=kS(t),y3(e.stateNode,e.type,t))}}function PN(e){ih?oh?oh.push(e):oh=[e]:ih=e}function IN(){if(ih){var e=ih,t=oh;if(oh=ih=null,f6(e),t)for(e=0;e<t.length;e++)f6(t[e])}}function RN(e,t){return e(t)}function ON(){}var Bw=!1;function MN(e,t,n){if(Bw)return e(t,n);Bw=!0;try{return RN(e,t,n)}finally{Bw=!1,(ih!==null||oh!==null)&&(ON(),IN())}}function bm(e,t){var n=e.stateNode;if(n===null)return null;var r=kS(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(le(231,t,typeof n));return n}var v3=!1;if(ql)try{var Up={};Object.defineProperty(Up,"passive",{get:function(){v3=!0}}),window.addEventListener("test",Up,Up),window.removeEventListener("test",Up,Up)}catch{v3=!1}function NQ(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var jg=!1,wb=null,Cb=!1,b3=null,DQ={onError:function(e){jg=!0,wb=e}};function LQ(e,t,n,r,i,o,a,s,l){jg=!1,wb=null,NQ.apply(DQ,arguments)}function FQ(e,t,n,r,i,o,a,s,l){if(LQ.apply(this,arguments),jg){if(jg){var u=wb;jg=!1,wb=null}else throw Error(le(198));Cb||(Cb=!0,b3=u)}}function Hd(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function $N(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h6(e){if(Hd(e)!==e)throw Error(le(188))}function BQ(e){var t=e.alternate;if(!t){if(t=Hd(e),t===null)throw Error(le(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return h6(i),e;if(o===r)return h6(i),t;o=o.sibling}throw Error(le(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(le(189))}}if(n.alternate!==r)throw Error(le(190))}if(n.tag!==3)throw Error(le(188));return n.stateNode.current===n?e:t}function NN(e){return e=BQ(e),e!==null?DN(e):null}function DN(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=DN(e);if(t!==null)return t;e=e.sibling}return null}var LN=ta.unstable_scheduleCallback,p6=ta.unstable_cancelCallback,zQ=ta.unstable_shouldYield,jQ=ta.unstable_requestPaint,Ar=ta.unstable_now,UQ=ta.unstable_getCurrentPriorityLevel,mT=ta.unstable_ImmediatePriority,FN=ta.unstable_UserBlockingPriority,Ab=ta.unstable_NormalPriority,VQ=ta.unstable_LowPriority,BN=ta.unstable_IdlePriority,CS=null,Gs=null;function GQ(e){if(Gs&&typeof Gs.onCommitFiberRoot=="function")try{Gs.onCommitFiberRoot(CS,e,void 0,(e.current.flags&128)===128)}catch{}}var os=Math.clz32?Math.clz32:WQ,qQ=Math.log,HQ=Math.LN2;function WQ(e){return e>>>=0,e===0?32:31-(qQ(e)/HQ|0)|0}var rv=64,iv=4194304;function xg(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Eb(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=xg(s):(o&=a,o!==0&&(r=xg(o)))}else a=n&~i,a!==0?r=xg(a):o!==0&&(r=xg(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-os(t),i=1<<n,r|=e[n],t&=~i;return r}function KQ(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function QQ(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-os(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=KQ(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function _3(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zN(){var e=rv;return rv<<=1,!(rv&4194240)&&(rv=64),e}function zw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ey(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-os(t),e[t]=n}function XQ(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-os(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function yT(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-os(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var yn=0;function jN(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var UN,vT,VN,GN,qN,S3=!1,ov=[],Vu=null,Gu=null,qu=null,_m=new Map,Sm=new Map,Pu=[],YQ="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function g6(e,t){switch(e){case"focusin":case"focusout":Vu=null;break;case"dragenter":case"dragleave":Gu=null;break;case"mouseover":case"mouseout":qu=null;break;case"pointerover":case"pointerout":_m.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sm.delete(t.pointerId)}}function Vp(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=ny(t),t!==null&&vT(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ZQ(e,t,n,r,i){switch(t){case"focusin":return Vu=Vp(Vu,e,t,n,r,i),!0;case"dragenter":return Gu=Vp(Gu,e,t,n,r,i),!0;case"mouseover":return qu=Vp(qu,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return _m.set(o,Vp(_m.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Sm.set(o,Vp(Sm.get(o)||null,e,t,n,r,i)),!0}return!1}function HN(e){var t=id(e.target);if(t!==null){var n=Hd(t);if(n!==null){if(t=n.tag,t===13){if(t=$N(n),t!==null){e.blockedOn=t,qN(e.priority,function(){VN(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function R1(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=x3(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);m3=r,n.target.dispatchEvent(r),m3=null}else return t=ny(n),t!==null&&vT(t),e.blockedOn=n,!1;t.shift()}return!0}function m6(e,t,n){R1(e)&&n.delete(t)}function JQ(){S3=!1,Vu!==null&&R1(Vu)&&(Vu=null),Gu!==null&&R1(Gu)&&(Gu=null),qu!==null&&R1(qu)&&(qu=null),_m.forEach(m6),Sm.forEach(m6)}function Gp(e,t){e.blockedOn===t&&(e.blockedOn=null,S3||(S3=!0,ta.unstable_scheduleCallback(ta.unstable_NormalPriority,JQ)))}function xm(e){function t(i){return Gp(i,e)}if(0<ov.length){Gp(ov[0],e);for(var n=1;n<ov.length;n++){var r=ov[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Vu!==null&&Gp(Vu,e),Gu!==null&&Gp(Gu,e),qu!==null&&Gp(qu,e),_m.forEach(t),Sm.forEach(t),n=0;n<Pu.length;n++)r=Pu[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Pu.length&&(n=Pu[0],n.blockedOn===null);)HN(n),n.blockedOn===null&&Pu.shift()}var ah=nu.ReactCurrentBatchConfig,Tb=!0;function eX(e,t,n,r){var i=yn,o=ah.transition;ah.transition=null;try{yn=1,bT(e,t,n,r)}finally{yn=i,ah.transition=o}}function tX(e,t,n,r){var i=yn,o=ah.transition;ah.transition=null;try{yn=4,bT(e,t,n,r)}finally{yn=i,ah.transition=o}}function bT(e,t,n,r){if(Tb){var i=x3(e,t,n,r);if(i===null)Xw(e,t,r,kb,n),g6(e,r);else if(ZQ(i,e,t,n,r))r.stopPropagation();else if(g6(e,r),t&4&&-1<YQ.indexOf(e)){for(;i!==null;){var o=ny(i);if(o!==null&&UN(o),o=x3(e,t,n,r),o===null&&Xw(e,t,r,kb,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Xw(e,t,r,null,n)}}var kb=null;function x3(e,t,n,r){if(kb=null,e=gT(r),e=id(e),e!==null)if(t=Hd(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$N(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return kb=e,null}function WN(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(UQ()){case mT:return 1;case FN:return 4;case Ab:case VQ:return 16;case BN:return 536870912;default:return 16}default:return 16}}var Lu=null,_T=null,O1=null;function KN(){if(O1)return O1;var e,t=_T,n=t.length,r,i="value"in Lu?Lu.value:Lu.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return O1=i.slice(e,1<r?1-r:void 0)}function M1(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function av(){return!0}function y6(){return!1}function aa(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?av:y6,this.isPropagationStopped=y6,this}return dr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=av)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=av)},persist:function(){},isPersistent:av}),t}var vp={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ST=aa(vp),ty=dr({},vp,{view:0,detail:0}),nX=aa(ty),jw,Uw,qp,AS=dr({},ty,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xT,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==qp&&(qp&&e.type==="mousemove"?(jw=e.screenX-qp.screenX,Uw=e.screenY-qp.screenY):Uw=jw=0,qp=e),jw)},movementY:function(e){return"movementY"in e?e.movementY:Uw}}),v6=aa(AS),rX=dr({},AS,{dataTransfer:0}),iX=aa(rX),oX=dr({},ty,{relatedTarget:0}),Vw=aa(oX),aX=dr({},vp,{animationName:0,elapsedTime:0,pseudoElement:0}),sX=aa(aX),lX=dr({},vp,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uX=aa(lX),cX=dr({},vp,{data:0}),b6=aa(cX),dX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fX={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},hX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pX(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hX[e])?!!t[e]:!1}function xT(){return pX}var gX=dr({},ty,{key:function(e){if(e.key){var t=dX[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=M1(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fX[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xT,charCode:function(e){return e.type==="keypress"?M1(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?M1(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mX=aa(gX),yX=dr({},AS,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_6=aa(yX),vX=dr({},ty,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xT}),bX=aa(vX),_X=dr({},vp,{propertyName:0,elapsedTime:0,pseudoElement:0}),SX=aa(_X),xX=dr({},AS,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wX=aa(xX),CX=[9,13,27,32],wT=ql&&"CompositionEvent"in window,Ug=null;ql&&"documentMode"in document&&(Ug=document.documentMode);var AX=ql&&"TextEvent"in window&&!Ug,QN=ql&&(!wT||Ug&&8<Ug&&11>=Ug),S6=String.fromCharCode(32),x6=!1;function XN(e,t){switch(e){case"keyup":return CX.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function YN(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Df=!1;function EX(e,t){switch(e){case"compositionend":return YN(t);case"keypress":return t.which!==32?null:(x6=!0,S6);case"textInput":return e=t.data,e===S6&&x6?null:e;default:return null}}function TX(e,t){if(Df)return e==="compositionend"||!wT&&XN(e,t)?(e=KN(),O1=_T=Lu=null,Df=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return QN&&t.locale!=="ko"?null:t.data;default:return null}}var kX={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function w6(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kX[e.type]:t==="textarea"}function ZN(e,t,n,r){PN(r),t=Pb(t,"onChange"),0<t.length&&(n=new ST("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vg=null,wm=null;function PX(e){uD(e,0)}function ES(e){var t=Bf(e);if(xN(t))return e}function IX(e,t){if(e==="change")return t}var JN=!1;if(ql){var Gw;if(ql){var qw="oninput"in document;if(!qw){var C6=document.createElement("div");C6.setAttribute("oninput","return;"),qw=typeof C6.oninput=="function"}Gw=qw}else Gw=!1;JN=Gw&&(!document.documentMode||9<document.documentMode)}function A6(){Vg&&(Vg.detachEvent("onpropertychange",eD),wm=Vg=null)}function eD(e){if(e.propertyName==="value"&&ES(wm)){var t=[];ZN(t,wm,e,gT(e)),MN(PX,t)}}function RX(e,t,n){e==="focusin"?(A6(),Vg=t,wm=n,Vg.attachEvent("onpropertychange",eD)):e==="focusout"&&A6()}function OX(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ES(wm)}function MX(e,t){if(e==="click")return ES(t)}function $X(e,t){if(e==="input"||e==="change")return ES(t)}function NX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ds=typeof Object.is=="function"?Object.is:NX;function Cm(e,t){if(ds(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!i3.call(t,i)||!ds(e[i],t[i]))return!1}return!0}function E6(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function T6(e,t){var n=E6(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=E6(n)}}function tD(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tD(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nD(){for(var e=window,t=xb();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=xb(e.document)}return t}function CT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function DX(e){var t=nD(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&tD(n.ownerDocument.documentElement,n)){if(r!==null&&CT(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=T6(n,o);var a=T6(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var LX=ql&&"documentMode"in document&&11>=document.documentMode,Lf=null,w3=null,Gg=null,C3=!1;function k6(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;C3||Lf==null||Lf!==xb(r)||(r=Lf,"selectionStart"in r&&CT(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gg&&Cm(Gg,r)||(Gg=r,r=Pb(w3,"onSelect"),0<r.length&&(t=new ST("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Lf)))}function sv(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ff={animationend:sv("Animation","AnimationEnd"),animationiteration:sv("Animation","AnimationIteration"),animationstart:sv("Animation","AnimationStart"),transitionend:sv("Transition","TransitionEnd")},Hw={},rD={};ql&&(rD=document.createElement("div").style,"AnimationEvent"in window||(delete Ff.animationend.animation,delete Ff.animationiteration.animation,delete Ff.animationstart.animation),"TransitionEvent"in window||delete Ff.transitionend.transition);function TS(e){if(Hw[e])return Hw[e];if(!Ff[e])return e;var t=Ff[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in rD)return Hw[e]=t[n];return e}var iD=TS("animationend"),oD=TS("animationiteration"),aD=TS("animationstart"),sD=TS("transitionend"),lD=new Map,P6="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xc(e,t){lD.set(e,t),qd(t,[e])}for(var Ww=0;Ww<P6.length;Ww++){var Kw=P6[Ww],FX=Kw.toLowerCase(),BX=Kw[0].toUpperCase()+Kw.slice(1);xc(FX,"on"+BX)}xc(iD,"onAnimationEnd");xc(oD,"onAnimationIteration");xc(aD,"onAnimationStart");xc("dblclick","onDoubleClick");xc("focusin","onFocus");xc("focusout","onBlur");xc(sD,"onTransitionEnd");Bh("onMouseEnter",["mouseout","mouseover"]);Bh("onMouseLeave",["mouseout","mouseover"]);Bh("onPointerEnter",["pointerout","pointerover"]);Bh("onPointerLeave",["pointerout","pointerover"]);qd("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qd("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qd("onBeforeInput",["compositionend","keypress","textInput","paste"]);qd("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qd("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qd("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wg="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),zX=new Set("cancel close invalid load scroll toggle".split(" ").concat(wg));function I6(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,FQ(r,t,void 0,e),e.currentTarget=null}function uD(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;I6(i,s,u),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;I6(i,s,u),o=l}}}if(Cb)throw e=b3,Cb=!1,b3=null,e}function jn(e,t){var n=t[P3];n===void 0&&(n=t[P3]=new Set);var r=e+"__bubble";n.has(r)||(cD(t,e,2,!1),n.add(r))}function Qw(e,t,n){var r=0;t&&(r|=4),cD(n,e,r,t)}var lv="_reactListening"+Math.random().toString(36).slice(2);function Am(e){if(!e[lv]){e[lv]=!0,yN.forEach(function(n){n!=="selectionchange"&&(zX.has(n)||Qw(n,!1,e),Qw(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lv]||(t[lv]=!0,Qw("selectionchange",!1,t))}}function cD(e,t,n,r){switch(WN(t)){case 1:var i=eX;break;case 4:i=tX;break;default:i=bT}n=i.bind(null,t,n,e),i=void 0,!v3||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Xw(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=id(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}MN(function(){var u=o,c=gT(n),d=[];e:{var f=lD.get(e);if(f!==void 0){var h=ST,p=e;switch(e){case"keypress":if(M1(n)===0)break e;case"keydown":case"keyup":h=mX;break;case"focusin":p="focus",h=Vw;break;case"focusout":p="blur",h=Vw;break;case"beforeblur":case"afterblur":h=Vw;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=v6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=iX;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=bX;break;case iD:case oD:case aD:h=sX;break;case sD:h=SX;break;case"scroll":h=nX;break;case"wheel":h=wX;break;case"copy":case"cut":case"paste":h=uX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=_6}var m=(t&4)!==0,_=!m&&e==="scroll",b=m?f!==null?f+"Capture":null:f;m=[];for(var y=u,g;y!==null;){g=y;var v=g.stateNode;if(g.tag===5&&v!==null&&(g=v,b!==null&&(v=bm(y,b),v!=null&&m.push(Em(y,v,g)))),_)break;y=y.return}0<m.length&&(f=new h(f,p,null,n,c),d.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==m3&&(p=n.relatedTarget||n.fromElement)&&(id(p)||p[Hl]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=u,p=p?id(p):null,p!==null&&(_=Hd(p),p!==_||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(m=v6,v="onMouseLeave",b="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=_6,v="onPointerLeave",b="onPointerEnter",y="pointer"),_=h==null?f:Bf(h),g=p==null?f:Bf(p),f=new m(v,y+"leave",h,n,c),f.target=_,f.relatedTarget=g,v=null,id(c)===u&&(m=new m(b,y+"enter",p,n,c),m.target=g,m.relatedTarget=_,v=m),_=v,h&&p)t:{for(m=h,b=p,y=0,g=m;g;g=df(g))y++;for(g=0,v=b;v;v=df(v))g++;for(;0<y-g;)m=df(m),y--;for(;0<g-y;)b=df(b),g--;for(;y--;){if(m===b||b!==null&&m===b.alternate)break t;m=df(m),b=df(b)}m=null}else m=null;h!==null&&R6(d,f,h,m,!1),p!==null&&_!==null&&R6(d,_,p,m,!0)}}e:{if(f=u?Bf(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=IX;else if(w6(f))if(JN)S=$X;else{S=OX;var w=RX}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=MX);if(S&&(S=S(e,u))){ZN(d,S,n,c);break e}w&&w(e,f,u),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&d3(f,"number",f.value)}switch(w=u?Bf(u):window,e){case"focusin":(w6(w)||w.contentEditable==="true")&&(Lf=w,w3=u,Gg=null);break;case"focusout":Gg=w3=Lf=null;break;case"mousedown":C3=!0;break;case"contextmenu":case"mouseup":case"dragend":C3=!1,k6(d,n,c);break;case"selectionchange":if(LX)break;case"keydown":case"keyup":k6(d,n,c)}var x;if(wT)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Df?XN(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(QN&&n.locale!=="ko"&&(Df||C!=="onCompositionStart"?C==="onCompositionEnd"&&Df&&(x=KN()):(Lu=c,_T="value"in Lu?Lu.value:Lu.textContent,Df=!0)),w=Pb(u,C),0<w.length&&(C=new b6(C,e,null,n,c),d.push({event:C,listeners:w}),x?C.data=x:(x=YN(n),x!==null&&(C.data=x)))),(x=AX?EX(e,n):TX(e,n))&&(u=Pb(u,"onBeforeInput"),0<u.length&&(c=new b6("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=x))}uD(d,t)})}function Em(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pb(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=bm(e,n),o!=null&&r.unshift(Em(e,o,i)),o=bm(e,t),o!=null&&r.push(Em(e,o,i))),e=e.return}return r}function df(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function R6(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=bm(n,o),l!=null&&a.unshift(Em(n,l,s))):i||(l=bm(n,o),l!=null&&a.push(Em(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var jX=/\r\n?/g,UX=/\u0000|\uFFFD/g;function O6(e){return(typeof e=="string"?e:""+e).replace(jX,`
+`).replace(UX,"")}function uv(e,t,n){if(t=O6(t),O6(e)!==t&&n)throw Error(le(425))}function Ib(){}var A3=null,E3=null;function T3(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var k3=typeof setTimeout=="function"?setTimeout:void 0,VX=typeof clearTimeout=="function"?clearTimeout:void 0,M6=typeof Promise=="function"?Promise:void 0,GX=typeof queueMicrotask=="function"?queueMicrotask:typeof M6<"u"?function(e){return M6.resolve(null).then(e).catch(qX)}:k3;function qX(e){setTimeout(function(){throw e})}function Yw(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),xm(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);xm(t)}function Hu(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $6(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var bp=Math.random().toString(36).slice(2),Ns="__reactFiber$"+bp,Tm="__reactProps$"+bp,Hl="__reactContainer$"+bp,P3="__reactEvents$"+bp,HX="__reactListeners$"+bp,WX="__reactHandles$"+bp;function id(e){var t=e[Ns];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Hl]||n[Ns]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$6(e);e!==null;){if(n=e[Ns])return n;e=$6(e)}return t}e=n,n=e.parentNode}return null}function ny(e){return e=e[Ns]||e[Hl],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bf(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(le(33))}function kS(e){return e[Tm]||null}var I3=[],zf=-1;function wc(e){return{current:e}}function Kn(e){0>zf||(e.current=I3[zf],I3[zf]=null,zf--)}function $n(e,t){zf++,I3[zf]=e.current,e.current=t}var ac={},Wi=wc(ac),Po=wc(!1),kd=ac;function zh(e,t){var n=e.type.contextTypes;if(!n)return ac;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Io(e){return e=e.childContextTypes,e!=null}function Rb(){Kn(Po),Kn(Wi)}function N6(e,t,n){if(Wi.current!==ac)throw Error(le(168));$n(Wi,t),$n(Po,n)}function dD(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(le(108,RQ(e)||"Unknown",i));return dr({},n,r)}function Ob(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ac,kd=Wi.current,$n(Wi,e),$n(Po,Po.current),!0}function D6(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=dD(e,t,kd),r.__reactInternalMemoizedMergedChildContext=e,Kn(Po),Kn(Wi),$n(Wi,e)):Kn(Po),$n(Po,n)}var wl=null,PS=!1,Zw=!1;function fD(e){wl===null?wl=[e]:wl.push(e)}function KX(e){PS=!0,fD(e)}function Cc(){if(!Zw&&wl!==null){Zw=!0;var e=0,t=yn;try{var n=wl;for(yn=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}wl=null,PS=!1}catch(i){throw wl!==null&&(wl=wl.slice(e+1)),LN(mT,Cc),i}finally{yn=t,Zw=!1}}return null}var jf=[],Uf=0,Mb=null,$b=0,ba=[],_a=0,Pd=null,Ml=1,$l="";function qc(e,t){jf[Uf++]=$b,jf[Uf++]=Mb,Mb=e,$b=t}function hD(e,t,n){ba[_a++]=Ml,ba[_a++]=$l,ba[_a++]=Pd,Pd=e;var r=Ml;e=$l;var i=32-os(r)-1;r&=~(1<<i),n+=1;var o=32-os(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Ml=1<<32-os(t)+i|n<<i|r,$l=o+e}else Ml=1<<o|n<<i|r,$l=e}function AT(e){e.return!==null&&(qc(e,1),hD(e,1,0))}function ET(e){for(;e===Mb;)Mb=jf[--Uf],jf[Uf]=null,$b=jf[--Uf],jf[Uf]=null;for(;e===Pd;)Pd=ba[--_a],ba[_a]=null,$l=ba[--_a],ba[_a]=null,Ml=ba[--_a],ba[_a]=null}var Zo=null,Xo=null,tr=!1,Za=null;function pD(e,t){var n=wa(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function L6(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Zo=e,Xo=Hu(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Zo=e,Xo=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Pd!==null?{id:Ml,overflow:$l}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wa(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Zo=e,Xo=null,!0):!1;default:return!1}}function R3(e){return(e.mode&1)!==0&&(e.flags&128)===0}function O3(e){if(tr){var t=Xo;if(t){var n=t;if(!L6(e,t)){if(R3(e))throw Error(le(418));t=Hu(n.nextSibling);var r=Zo;t&&L6(e,t)?pD(r,n):(e.flags=e.flags&-4097|2,tr=!1,Zo=e)}}else{if(R3(e))throw Error(le(418));e.flags=e.flags&-4097|2,tr=!1,Zo=e}}}function F6(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Zo=e}function cv(e){if(e!==Zo)return!1;if(!tr)return F6(e),tr=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!T3(e.type,e.memoizedProps)),t&&(t=Xo)){if(R3(e))throw gD(),Error(le(418));for(;t;)pD(e,t),t=Hu(t.nextSibling)}if(F6(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(le(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Xo=Hu(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Xo=null}}else Xo=Zo?Hu(e.stateNode.nextSibling):null;return!0}function gD(){for(var e=Xo;e;)e=Hu(e.nextSibling)}function jh(){Xo=Zo=null,tr=!1}function TT(e){Za===null?Za=[e]:Za.push(e)}var QX=nu.ReactCurrentBatchConfig;function Ka(e,t){if(e&&e.defaultProps){t=dr({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Nb=wc(null),Db=null,Vf=null,kT=null;function PT(){kT=Vf=Db=null}function IT(e){var t=Nb.current;Kn(Nb),e._currentValue=t}function M3(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function sh(e,t){Db=e,kT=Vf=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ao=!0),e.firstContext=null)}function Ea(e){var t=e._currentValue;if(kT!==e)if(e={context:e,memoizedValue:t,next:null},Vf===null){if(Db===null)throw Error(le(308));Vf=e,Db.dependencies={lanes:0,firstContext:e}}else Vf=Vf.next=e;return t}var od=null;function RT(e){od===null?od=[e]:od.push(e)}function mD(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,RT(t)):(n.next=i.next,i.next=n),t.interleaved=n,Wl(e,r)}function Wl(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Cu=!1;function OT(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yD(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Fl(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wu(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Wl(e,n)}return i=r.interleaved,i===null?(t.next=t,RT(r)):(t.next=i.next,i.next=t),r.interleaved=t,Wl(e,n)}function $1(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yT(e,n)}}function B6(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Lb(e,t,n,r){var i=e.updateQueue;Cu=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,c=u=l=null,s=o;do{var f=s.lane,h=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=dr({},d,f);break e;case 2:Cu=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Rd|=a,e.lanes=a,e.memoizedState=d}}function z6(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(le(191,i));i.call(r)}}}var vD=new mN.Component().refs;function $3(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:dr({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var IS={isMounted:function(e){return(e=e._reactInternals)?Hd(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=so(),i=Qu(e),o=Fl(r,i);o.payload=t,n!=null&&(o.callback=n),t=Wu(e,o,i),t!==null&&(as(t,e,i,r),$1(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=so(),i=Qu(e),o=Fl(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Wu(e,o,i),t!==null&&(as(t,e,i,r),$1(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=so(),r=Qu(e),i=Fl(n,r);i.tag=2,t!=null&&(i.callback=t),t=Wu(e,i,r),t!==null&&(as(t,e,r,n),$1(t,e,r))}};function j6(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!Cm(n,r)||!Cm(i,o):!0}function bD(e,t,n){var r=!1,i=ac,o=t.contextType;return typeof o=="object"&&o!==null?o=Ea(o):(i=Io(t)?kd:Wi.current,r=t.contextTypes,o=(r=r!=null)?zh(e,i):ac),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=IS,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function U6(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&IS.enqueueReplaceState(t,t.state,null)}function N3(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=vD,OT(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Ea(o):(o=Io(t)?kd:Wi.current,i.context=zh(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&($3(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&IS.enqueueReplaceState(i,i.state,null),Lb(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Hp(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(le(309));var r=n.stateNode}if(!r)throw Error(le(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;s===vD&&(s=i.refs={}),a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(le(284));if(!n._owner)throw Error(le(290,e))}return e}function dv(e,t){throw e=Object.prototype.toString.call(t),Error(le(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function V6(e){var t=e._init;return t(e._payload)}function _D(e){function t(b,y){if(e){var g=b.deletions;g===null?(b.deletions=[y],b.flags|=16):g.push(y)}}function n(b,y){if(!e)return null;for(;y!==null;)t(b,y),y=y.sibling;return null}function r(b,y){for(b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function i(b,y){return b=Xu(b,y),b.index=0,b.sibling=null,b}function o(b,y,g){return b.index=g,e?(g=b.alternate,g!==null?(g=g.index,g<y?(b.flags|=2,y):g):(b.flags|=2,y)):(b.flags|=1048576,y)}function a(b){return e&&b.alternate===null&&(b.flags|=2),b}function s(b,y,g,v){return y===null||y.tag!==6?(y=oC(g,b.mode,v),y.return=b,y):(y=i(y,g),y.return=b,y)}function l(b,y,g,v){var S=g.type;return S===Nf?c(b,y,g.props.children,v,g.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wu&&V6(S)===y.type)?(v=i(y,g.props),v.ref=Hp(b,y,g),v.return=b,v):(v=z1(g.type,g.key,g.props,null,b.mode,v),v.ref=Hp(b,y,g),v.return=b,v)}function u(b,y,g,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=aC(g,b.mode,v),y.return=b,y):(y=i(y,g.children||[]),y.return=b,y)}function c(b,y,g,v,S){return y===null||y.tag!==7?(y=vd(g,b.mode,v,S),y.return=b,y):(y=i(y,g),y.return=b,y)}function d(b,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=oC(""+y,b.mode,g),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ev:return g=z1(y.type,y.key,y.props,null,b.mode,g),g.ref=Hp(b,null,y),g.return=b,g;case $f:return y=aC(y,b.mode,g),y.return=b,y;case wu:var v=y._init;return d(b,v(y._payload),g)}if(Sg(y)||jp(y))return y=vd(y,b.mode,g,null),y.return=b,y;dv(b,y)}return null}function f(b,y,g,v){var S=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:s(b,y,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ev:return g.key===S?l(b,y,g,v):null;case $f:return g.key===S?u(b,y,g,v):null;case wu:return S=g._init,f(b,y,S(g._payload),v)}if(Sg(g)||jp(g))return S!==null?null:c(b,y,g,v,null);dv(b,g)}return null}function h(b,y,g,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return b=b.get(g)||null,s(y,b,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ev:return b=b.get(v.key===null?g:v.key)||null,l(y,b,v,S);case $f:return b=b.get(v.key===null?g:v.key)||null,u(y,b,v,S);case wu:var w=v._init;return h(b,y,g,w(v._payload),S)}if(Sg(v)||jp(v))return b=b.get(g)||null,c(y,b,v,S,null);dv(y,v)}return null}function p(b,y,g,v){for(var S=null,w=null,x=y,C=y=0,T=null;x!==null&&C<g.length;C++){x.index>C?(T=x,x=null):T=x.sibling;var E=f(b,x,g[C],v);if(E===null){x===null&&(x=T);break}e&&x&&E.alternate===null&&t(b,x),y=o(E,y,C),w===null?S=E:w.sibling=E,w=E,x=T}if(C===g.length)return n(b,x),tr&&qc(b,C),S;if(x===null){for(;C<g.length;C++)x=d(b,g[C],v),x!==null&&(y=o(x,y,C),w===null?S=x:w.sibling=x,w=x);return tr&&qc(b,C),S}for(x=r(b,x);C<g.length;C++)T=h(x,b,C,g[C],v),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?C:T.key),y=o(T,y,C),w===null?S=T:w.sibling=T,w=T);return e&&x.forEach(function(P){return t(b,P)}),tr&&qc(b,C),S}function m(b,y,g,v){var S=jp(g);if(typeof S!="function")throw Error(le(150));if(g=S.call(g),g==null)throw Error(le(151));for(var w=S=null,x=y,C=y=0,T=null,E=g.next();x!==null&&!E.done;C++,E=g.next()){x.index>C?(T=x,x=null):T=x.sibling;var P=f(b,x,E.value,v);if(P===null){x===null&&(x=T);break}e&&x&&P.alternate===null&&t(b,x),y=o(P,y,C),w===null?S=P:w.sibling=P,w=P,x=T}if(E.done)return n(b,x),tr&&qc(b,C),S;if(x===null){for(;!E.done;C++,E=g.next())E=d(b,E.value,v),E!==null&&(y=o(E,y,C),w===null?S=E:w.sibling=E,w=E);return tr&&qc(b,C),S}for(x=r(b,x);!E.done;C++,E=g.next())E=h(x,b,C,E.value,v),E!==null&&(e&&E.alternate!==null&&x.delete(E.key===null?C:E.key),y=o(E,y,C),w===null?S=E:w.sibling=E,w=E);return e&&x.forEach(function(N){return t(b,N)}),tr&&qc(b,C),S}function _(b,y,g,v){if(typeof g=="object"&&g!==null&&g.type===Nf&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ev:e:{for(var S=g.key,w=y;w!==null;){if(w.key===S){if(S=g.type,S===Nf){if(w.tag===7){n(b,w.sibling),y=i(w,g.props.children),y.return=b,b=y;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wu&&V6(S)===w.type){n(b,w.sibling),y=i(w,g.props),y.ref=Hp(b,w,g),y.return=b,b=y;break e}n(b,w);break}else t(b,w);w=w.sibling}g.type===Nf?(y=vd(g.props.children,b.mode,v,g.key),y.return=b,b=y):(v=z1(g.type,g.key,g.props,null,b.mode,v),v.ref=Hp(b,y,g),v.return=b,b=v)}return a(b);case $f:e:{for(w=g.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(b,y.sibling),y=i(y,g.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=aC(g,b.mode,v),y.return=b,b=y}return a(b);case wu:return w=g._init,_(b,y,w(g._payload),v)}if(Sg(g))return p(b,y,g,v);if(jp(g))return m(b,y,g,v);dv(b,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(b,y.sibling),y=i(y,g),y.return=b,b=y):(n(b,y),y=oC(g,b.mode,v),y.return=b,b=y),a(b)):n(b,y)}return _}var Uh=_D(!0),SD=_D(!1),ry={},qs=wc(ry),km=wc(ry),Pm=wc(ry);function ad(e){if(e===ry)throw Error(le(174));return e}function MT(e,t){switch($n(Pm,t),$n(km,e),$n(qs,ry),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:h3(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=h3(t,e)}Kn(qs),$n(qs,t)}function Vh(){Kn(qs),Kn(km),Kn(Pm)}function xD(e){ad(Pm.current);var t=ad(qs.current),n=h3(t,e.type);t!==n&&($n(km,e),$n(qs,n))}function $T(e){km.current===e&&(Kn(qs),Kn(km))}var lr=wc(0);function Fb(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Jw=[];function NT(){for(var e=0;e<Jw.length;e++)Jw[e]._workInProgressVersionPrimary=null;Jw.length=0}var N1=nu.ReactCurrentDispatcher,eC=nu.ReactCurrentBatchConfig,Id=0,cr=null,Hr=null,li=null,Bb=!1,qg=!1,Im=0,XX=0;function Li(){throw Error(le(321))}function DT(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ds(e[n],t[n]))return!1;return!0}function LT(e,t,n,r,i,o){if(Id=o,cr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N1.current=e===null||e.memoizedState===null?eY:tY,e=n(r,i),qg){o=0;do{if(qg=!1,Im=0,25<=o)throw Error(le(301));o+=1,li=Hr=null,t.updateQueue=null,N1.current=nY,e=n(r,i)}while(qg)}if(N1.current=zb,t=Hr!==null&&Hr.next!==null,Id=0,li=Hr=cr=null,Bb=!1,t)throw Error(le(300));return e}function FT(){var e=Im!==0;return Im=0,e}function Es(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return li===null?cr.memoizedState=li=e:li=li.next=e,li}function Ta(){if(Hr===null){var e=cr.alternate;e=e!==null?e.memoizedState:null}else e=Hr.next;var t=li===null?cr.memoizedState:li.next;if(t!==null)li=t,Hr=e;else{if(e===null)throw Error(le(310));Hr=e,e={memoizedState:Hr.memoizedState,baseState:Hr.baseState,baseQueue:Hr.baseQueue,queue:Hr.queue,next:null},li===null?cr.memoizedState=li=e:li=li.next=e}return li}function Rm(e,t){return typeof t=="function"?t(e):t}function tC(e){var t=Ta(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=Hr,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,u=o;do{var c=u.lane;if((Id&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=d,a=r):l=l.next=d,cr.lanes|=c,Rd|=c}u=u.next}while(u!==null&&u!==o);l===null?a=r:l.next=s,ds(r,t.memoizedState)||(Ao=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,cr.lanes|=o,Rd|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function nC(e){var t=Ta(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);ds(o,t.memoizedState)||(Ao=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function wD(){}function CD(e,t){var n=cr,r=Ta(),i=t(),o=!ds(r.memoizedState,i);if(o&&(r.memoizedState=i,Ao=!0),r=r.queue,BT(TD.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||li!==null&&li.memoizedState.tag&1){if(n.flags|=2048,Om(9,ED.bind(null,n,r,i,t),void 0,null),di===null)throw Error(le(349));Id&30||AD(n,t,i)}return i}function AD(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=cr.updateQueue,t===null?(t={lastEffect:null,stores:null},cr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ED(e,t,n,r){t.value=n,t.getSnapshot=r,kD(t)&&PD(e)}function TD(e,t,n){return n(function(){kD(t)&&PD(e)})}function kD(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ds(e,n)}catch{return!0}}function PD(e){var t=Wl(e,1);t!==null&&as(t,e,1,-1)}function G6(e){var t=Es();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Rm,lastRenderedState:e},t.queue=e,e=e.dispatch=JX.bind(null,cr,e),[t.memoizedState,e]}function Om(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=cr.updateQueue,t===null?(t={lastEffect:null,stores:null},cr.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ID(){return Ta().memoizedState}function D1(e,t,n,r){var i=Es();cr.flags|=e,i.memoizedState=Om(1|t,n,void 0,r===void 0?null:r)}function RS(e,t,n,r){var i=Ta();r=r===void 0?null:r;var o=void 0;if(Hr!==null){var a=Hr.memoizedState;if(o=a.destroy,r!==null&&DT(r,a.deps)){i.memoizedState=Om(t,n,o,r);return}}cr.flags|=e,i.memoizedState=Om(1|t,n,o,r)}function q6(e,t){return D1(8390656,8,e,t)}function BT(e,t){return RS(2048,8,e,t)}function RD(e,t){return RS(4,2,e,t)}function OD(e,t){return RS(4,4,e,t)}function MD(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $D(e,t,n){return n=n!=null?n.concat([e]):null,RS(4,4,MD.bind(null,t,e),n)}function zT(){}function ND(e,t){var n=Ta();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&DT(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function DD(e,t){var n=Ta();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&DT(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function LD(e,t,n){return Id&21?(ds(n,t)||(n=zN(),cr.lanes|=n,Rd|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ao=!0),e.memoizedState=n)}function YX(e,t){var n=yn;yn=n!==0&&4>n?n:4,e(!0);var r=eC.transition;eC.transition={};try{e(!1),t()}finally{yn=n,eC.transition=r}}function FD(){return Ta().memoizedState}function ZX(e,t,n){var r=Qu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},BD(e))zD(t,n);else if(n=mD(e,t,n,r),n!==null){var i=so();as(n,e,r,i),jD(n,t,r)}}function JX(e,t,n){var r=Qu(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(BD(e))zD(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,ds(s,a)){var l=t.interleaved;l===null?(i.next=i,RT(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=mD(e,t,i,r),n!==null&&(i=so(),as(n,e,r,i),jD(n,t,r))}}function BD(e){var t=e.alternate;return e===cr||t!==null&&t===cr}function zD(e,t){qg=Bb=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jD(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yT(e,n)}}var zb={readContext:Ea,useCallback:Li,useContext:Li,useEffect:Li,useImperativeHandle:Li,useInsertionEffect:Li,useLayoutEffect:Li,useMemo:Li,useReducer:Li,useRef:Li,useState:Li,useDebugValue:Li,useDeferredValue:Li,useTransition:Li,useMutableSource:Li,useSyncExternalStore:Li,useId:Li,unstable_isNewReconciler:!1},eY={readContext:Ea,useCallback:function(e,t){return Es().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:q6,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,D1(4194308,4,MD.bind(null,t,e),n)},useLayoutEffect:function(e,t){return D1(4194308,4,e,t)},useInsertionEffect:function(e,t){return D1(4,2,e,t)},useMemo:function(e,t){var n=Es();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Es();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ZX.bind(null,cr,e),[r.memoizedState,e]},useRef:function(e){var t=Es();return e={current:e},t.memoizedState=e},useState:G6,useDebugValue:zT,useDeferredValue:function(e){return Es().memoizedState=e},useTransition:function(){var e=G6(!1),t=e[0];return e=YX.bind(null,e[1]),Es().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=cr,i=Es();if(tr){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),di===null)throw Error(le(349));Id&30||AD(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,q6(TD.bind(null,r,o,e),[e]),r.flags|=2048,Om(9,ED.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Es(),t=di.identifierPrefix;if(tr){var n=$l,r=Ml;n=(r&~(1<<32-os(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Im++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=XX++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tY={readContext:Ea,useCallback:ND,useContext:Ea,useEffect:BT,useImperativeHandle:$D,useInsertionEffect:RD,useLayoutEffect:OD,useMemo:DD,useReducer:tC,useRef:ID,useState:function(){return tC(Rm)},useDebugValue:zT,useDeferredValue:function(e){var t=Ta();return LD(t,Hr.memoizedState,e)},useTransition:function(){var e=tC(Rm)[0],t=Ta().memoizedState;return[e,t]},useMutableSource:wD,useSyncExternalStore:CD,useId:FD,unstable_isNewReconciler:!1},nY={readContext:Ea,useCallback:ND,useContext:Ea,useEffect:BT,useImperativeHandle:$D,useInsertionEffect:RD,useLayoutEffect:OD,useMemo:DD,useReducer:nC,useRef:ID,useState:function(){return nC(Rm)},useDebugValue:zT,useDeferredValue:function(e){var t=Ta();return Hr===null?t.memoizedState=e:LD(t,Hr.memoizedState,e)},useTransition:function(){var e=nC(Rm)[0],t=Ta().memoizedState;return[e,t]},useMutableSource:wD,useSyncExternalStore:CD,useId:FD,unstable_isNewReconciler:!1};function Gh(e,t){try{var n="",r=t;do n+=IQ(r),r=r.return;while(r);var i=n}catch(o){i=`
+Error generating stack: `+o.message+`
+`+o.stack}return{value:e,source:t,stack:i,digest:null}}function rC(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function D3(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rY=typeof WeakMap=="function"?WeakMap:Map;function UD(e,t,n){n=Fl(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ub||(Ub=!0,H3=r),D3(e,t)},n}function VD(e,t,n){n=Fl(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){D3(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){D3(e,t),typeof r!="function"&&(Ku===null?Ku=new Set([this]):Ku.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function H6(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rY;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=yY.bind(null,e,t,n),t.then(e,e))}function W6(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function K6(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Fl(-1,1),t.tag=2,Wu(n,t,1))),n.lanes|=1),e)}var iY=nu.ReactCurrentOwner,Ao=!1;function io(e,t,n,r){t.child=e===null?SD(t,null,n,r):Uh(t,e.child,n,r)}function Q6(e,t,n,r,i){n=n.render;var o=t.ref;return sh(t,i),r=LT(e,t,n,r,o,i),n=FT(),e!==null&&!Ao?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Kl(e,t,i)):(tr&&n&&AT(t),t.flags|=1,io(e,t,r,i),t.child)}function X6(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!KT(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,GD(e,t,o,r,i)):(e=z1(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Cm,n(a,r)&&e.ref===t.ref)return Kl(e,t,i)}return t.flags|=1,e=Xu(o,r),e.ref=t.ref,e.return=t,t.child=e}function GD(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Cm(o,r)&&e.ref===t.ref)if(Ao=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Ao=!0);else return t.lanes=e.lanes,Kl(e,t,i)}return L3(e,t,n,r,i)}function qD(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},$n(qf,Go),Go|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,$n(qf,Go),Go|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,$n(qf,Go),Go|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,$n(qf,Go),Go|=r;return io(e,t,i,n),t.child}function HD(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function L3(e,t,n,r,i){var o=Io(n)?kd:Wi.current;return o=zh(t,o),sh(t,i),n=LT(e,t,n,r,o,i),r=FT(),e!==null&&!Ao?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Kl(e,t,i)):(tr&&r&&AT(t),t.flags|=1,io(e,t,n,i),t.child)}function Y6(e,t,n,r,i){if(Io(n)){var o=!0;Ob(t)}else o=!1;if(sh(t,i),t.stateNode===null)L1(e,t),bD(t,n,r),N3(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ea(u):(u=Io(n)?kd:Wi.current,u=zh(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&U6(t,a,r,u),Cu=!1;var f=t.memoizedState;a.state=f,Lb(t,r,a,i),l=t.memoizedState,s!==r||f!==l||Po.current||Cu?(typeof c=="function"&&($3(t,n,c,r),l=t.memoizedState),(s=Cu||j6(t,n,s,r,f,l,u))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,yD(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ka(t.type,s),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ea(l):(l=Io(n)?kd:Wi.current,l=zh(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==d||f!==l)&&U6(t,a,r,l),Cu=!1,f=t.memoizedState,a.state=f,Lb(t,r,a,i);var p=t.memoizedState;s!==d||f!==p||Po.current||Cu?(typeof h=="function"&&($3(t,n,h,r),p=t.memoizedState),(u=Cu||j6(t,n,u,r,f,p,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return F3(e,t,n,r,o,i)}function F3(e,t,n,r,i,o){HD(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&D6(t,n,!1),Kl(e,t,o);r=t.stateNode,iY.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Uh(t,e.child,null,o),t.child=Uh(t,null,s,o)):io(e,t,s,o),t.memoizedState=r.state,i&&D6(t,n,!0),t.child}function WD(e){var t=e.stateNode;t.pendingContext?N6(e,t.pendingContext,t.pendingContext!==t.context):t.context&&N6(e,t.context,!1),MT(e,t.containerInfo)}function Z6(e,t,n,r,i){return jh(),TT(i),t.flags|=256,io(e,t,n,r),t.child}var B3={dehydrated:null,treeContext:null,retryLane:0};function z3(e){return{baseLanes:e,cachePool:null,transitions:null}}function KD(e,t,n){var r=t.pendingProps,i=lr.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),$n(lr,i&1),e===null)return O3(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=$S(a,r,0,null),e=vd(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=z3(n),t.memoizedState=B3,e):jT(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return oY(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Xu(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=Xu(s,o):(o=vd(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?z3(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=B3,r}return o=e.child,e=o.sibling,r=Xu(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function jT(e,t){return t=$S({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fv(e,t,n,r){return r!==null&&TT(r),Uh(t,e.child,null,n),e=jT(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oY(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=rC(Error(le(422))),fv(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=$S({mode:"visible",children:r.children},i,0,null),o=vd(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Uh(t,e.child,null,a),t.child.memoizedState=z3(a),t.memoizedState=B3,o);if(!(t.mode&1))return fv(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(le(419)),r=rC(o,r,void 0),fv(e,t,a,r)}if(s=(a&e.childLanes)!==0,Ao||s){if(r=di,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Wl(e,i),as(r,e,i,-1))}return WT(),r=rC(Error(le(421))),fv(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=vY.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Xo=Hu(i.nextSibling),Zo=t,tr=!0,Za=null,e!==null&&(ba[_a++]=Ml,ba[_a++]=$l,ba[_a++]=Pd,Ml=e.id,$l=e.overflow,Pd=t),t=jT(t,r.children),t.flags|=4096,t)}function J6(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),M3(e.return,t,n)}function iC(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function QD(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(io(e,t,r.children,n),r=lr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&J6(e,n,t);else if(e.tag===19)J6(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($n(lr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Fb(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),iC(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Fb(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}iC(t,!0,n,null,o);break;case"together":iC(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function L1(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Kl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Rd|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(le(153));if(t.child!==null){for(e=t.child,n=Xu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Xu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function aY(e,t,n){switch(t.tag){case 3:WD(t),jh();break;case 5:xD(t);break;case 1:Io(t.type)&&Ob(t);break;case 4:MT(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;$n(Nb,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?($n(lr,lr.current&1),t.flags|=128,null):n&t.child.childLanes?KD(e,t,n):($n(lr,lr.current&1),e=Kl(e,t,n),e!==null?e.sibling:null);$n(lr,lr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return QD(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$n(lr,lr.current),r)break;return null;case 22:case 23:return t.lanes=0,qD(e,t,n)}return Kl(e,t,n)}var XD,j3,YD,ZD;XD=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};j3=function(){};YD=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ad(qs.current);var o=null;switch(n){case"input":i=u3(e,i),r=u3(e,r),o=[];break;case"select":i=dr({},i,{value:void 0}),r=dr({},r,{value:void 0}),o=[];break;case"textarea":i=f3(e,i),r=f3(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ib)}p3(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ym.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ym.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&jn("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};ZD=function(e,t,n,r){n!==r&&(t.flags|=4)};function Wp(e,t){if(!tr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fi(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function sY(e,t,n){var r=t.pendingProps;switch(ET(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fi(t),null;case 1:return Io(t.type)&&Rb(),Fi(t),null;case 3:return r=t.stateNode,Vh(),Kn(Po),Kn(Wi),NT(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(cv(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Za!==null&&(Q3(Za),Za=null))),j3(e,t),Fi(t),null;case 5:$T(t);var i=ad(Pm.current);if(n=t.type,e!==null&&t.stateNode!=null)YD(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(le(166));return Fi(t),null}if(e=ad(qs.current),cv(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Ns]=t,r[Tm]=o,e=(t.mode&1)!==0,n){case"dialog":jn("cancel",r),jn("close",r);break;case"iframe":case"object":case"embed":jn("load",r);break;case"video":case"audio":for(i=0;i<wg.length;i++)jn(wg[i],r);break;case"source":jn("error",r);break;case"img":case"image":case"link":jn("error",r),jn("load",r);break;case"details":jn("toggle",r);break;case"input":l6(r,o),jn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},jn("invalid",r);break;case"textarea":c6(r,o),jn("invalid",r)}p3(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&uv(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&uv(r.textContent,s,e),i=["children",""+s]):ym.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&jn("scroll",r)}switch(n){case"input":tv(r),u6(r,o,!0);break;case"textarea":tv(r),d6(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Ib)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=AN(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Ns]=t,e[Tm]=r,XD(e,t,!1,!1),t.stateNode=e;e:{switch(a=g3(n,r),n){case"dialog":jn("cancel",e),jn("close",e),i=r;break;case"iframe":case"object":case"embed":jn("load",e),i=r;break;case"video":case"audio":for(i=0;i<wg.length;i++)jn(wg[i],e);i=r;break;case"source":jn("error",e),i=r;break;case"img":case"image":case"link":jn("error",e),jn("load",e),i=r;break;case"details":jn("toggle",e),i=r;break;case"input":l6(e,r),i=u3(e,r),jn("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=dr({},r,{value:void 0}),jn("invalid",e);break;case"textarea":c6(e,r),i=f3(e,r),jn("invalid",e);break;default:i=r}p3(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?kN(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&EN(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&vm(e,l):typeof l=="number"&&vm(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(ym.hasOwnProperty(o)?l!=null&&o==="onScroll"&&jn("scroll",e):l!=null&&dT(e,o,l,a))}switch(n){case"input":tv(e),u6(e,r,!1);break;case"textarea":tv(e),d6(e);break;case"option":r.value!=null&&e.setAttribute("value",""+oc(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?rh(e,!!r.multiple,o,!1):r.defaultValue!=null&&rh(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ib)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Fi(t),null;case 6:if(e&&t.stateNode!=null)ZD(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(le(166));if(n=ad(Pm.current),ad(qs.current),cv(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ns]=t,(o=r.nodeValue!==n)&&(e=Zo,e!==null))switch(e.tag){case 3:uv(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uv(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ns]=t,t.stateNode=r}return Fi(t),null;case 13:if(Kn(lr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(tr&&Xo!==null&&t.mode&1&&!(t.flags&128))gD(),jh(),t.flags|=98560,o=!1;else if(o=cv(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(le(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(le(317));o[Ns]=t}else jh(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fi(t),o=!1}else Za!==null&&(Q3(Za),Za=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||lr.current&1?Qr===0&&(Qr=3):WT())),t.updateQueue!==null&&(t.flags|=4),Fi(t),null);case 4:return Vh(),j3(e,t),e===null&&Am(t.stateNode.containerInfo),Fi(t),null;case 10:return IT(t.type._context),Fi(t),null;case 17:return Io(t.type)&&Rb(),Fi(t),null;case 19:if(Kn(lr),o=t.memoizedState,o===null)return Fi(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)Wp(o,!1);else{if(Qr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Fb(e),a!==null){for(t.flags|=128,Wp(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return $n(lr,lr.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ar()>qh&&(t.flags|=128,r=!0,Wp(o,!1),t.lanes=4194304)}else{if(!r)if(e=Fb(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wp(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!tr)return Fi(t),null}else 2*Ar()-o.renderingStartTime>qh&&n!==1073741824&&(t.flags|=128,r=!0,Wp(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ar(),t.sibling=null,n=lr.current,$n(lr,r?n&1|2:n&1),t):(Fi(t),null);case 22:case 23:return HT(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Go&1073741824&&(Fi(t),t.subtreeFlags&6&&(t.flags|=8192)):Fi(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}function lY(e,t){switch(ET(t),t.tag){case 1:return Io(t.type)&&Rb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vh(),Kn(Po),Kn(Wi),NT(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $T(t),null;case 13:if(Kn(lr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));jh()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Kn(lr),null;case 4:return Vh(),null;case 10:return IT(t.type._context),null;case 22:case 23:return HT(),null;case 24:return null;default:return null}}var hv=!1,Gi=!1,uY=typeof WeakSet=="function"?WeakSet:Set,Le=null;function Gf(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){mr(e,t,r)}else n.current=null}function U3(e,t,n){try{n()}catch(r){mr(e,t,r)}}var e8=!1;function cY(e,t){if(A3=Tb,e=nD(),CT(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=a),f===o&&++c===r&&(l=a),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(E3={focusedElem:e,selectionRange:n},Tb=!1,Le=t;Le!==null;)if(t=Le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Le=e;else for(;Le!==null;){t=Le;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,_=p.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ka(t.type,m),_);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(v){mr(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,Le=e;break}Le=t.return}return p=e8,e8=!1,p}function Hg(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&U3(t,n,o)}i=i.next}while(i!==r)}}function OS(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function V3(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function JD(e){var t=e.alternate;t!==null&&(e.alternate=null,JD(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ns],delete t[Tm],delete t[P3],delete t[HX],delete t[WX])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function eL(e){return e.tag===5||e.tag===3||e.tag===4}function t8(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||eL(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function G3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ib));else if(r!==4&&(e=e.child,e!==null))for(G3(e,t,n),e=e.sibling;e!==null;)G3(e,t,n),e=e.sibling}function q3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(q3(e,t,n),e=e.sibling;e!==null;)q3(e,t,n),e=e.sibling}var wi=null,Xa=!1;function hu(e,t,n){for(n=n.child;n!==null;)tL(e,t,n),n=n.sibling}function tL(e,t,n){if(Gs&&typeof Gs.onCommitFiberUnmount=="function")try{Gs.onCommitFiberUnmount(CS,n)}catch{}switch(n.tag){case 5:Gi||Gf(n,t);case 6:var r=wi,i=Xa;wi=null,hu(e,t,n),wi=r,Xa=i,wi!==null&&(Xa?(e=wi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wi.removeChild(n.stateNode));break;case 18:wi!==null&&(Xa?(e=wi,n=n.stateNode,e.nodeType===8?Yw(e.parentNode,n):e.nodeType===1&&Yw(e,n),xm(e)):Yw(wi,n.stateNode));break;case 4:r=wi,i=Xa,wi=n.stateNode.containerInfo,Xa=!0,hu(e,t,n),wi=r,Xa=i;break;case 0:case 11:case 14:case 15:if(!Gi&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&U3(n,t,a),i=i.next}while(i!==r)}hu(e,t,n);break;case 1:if(!Gi&&(Gf(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){mr(n,t,s)}hu(e,t,n);break;case 21:hu(e,t,n);break;case 22:n.mode&1?(Gi=(r=Gi)||n.memoizedState!==null,hu(e,t,n),Gi=r):hu(e,t,n);break;default:hu(e,t,n)}}function n8(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uY),t.forEach(function(r){var i=bY.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function qa(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:wi=s.stateNode,Xa=!1;break e;case 3:wi=s.stateNode.containerInfo,Xa=!0;break e;case 4:wi=s.stateNode.containerInfo,Xa=!0;break e}s=s.return}if(wi===null)throw Error(le(160));tL(o,a,i),wi=null,Xa=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){mr(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)nL(t,e),t=t.sibling}function nL(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qa(t,e),Ss(e),r&4){try{Hg(3,e,e.return),OS(3,e)}catch(m){mr(e,e.return,m)}try{Hg(5,e,e.return)}catch(m){mr(e,e.return,m)}}break;case 1:qa(t,e),Ss(e),r&512&&n!==null&&Gf(n,n.return);break;case 5:if(qa(t,e),Ss(e),r&512&&n!==null&&Gf(n,n.return),e.flags&32){var i=e.stateNode;try{vm(i,"")}catch(m){mr(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&wN(i,o),g3(s,a);var u=g3(s,o);for(a=0;a<l.length;a+=2){var c=l[a],d=l[a+1];c==="style"?kN(i,d):c==="dangerouslySetInnerHTML"?EN(i,d):c==="children"?vm(i,d):dT(i,c,d,u)}switch(s){case"input":c3(i,o);break;case"textarea":CN(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?rh(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?rh(i,!!o.multiple,o.defaultValue,!0):rh(i,!!o.multiple,o.multiple?[]:"",!1))}i[Tm]=o}catch(m){mr(e,e.return,m)}}break;case 6:if(qa(t,e),Ss(e),r&4){if(e.stateNode===null)throw Error(le(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){mr(e,e.return,m)}}break;case 3:if(qa(t,e),Ss(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xm(t.containerInfo)}catch(m){mr(e,e.return,m)}break;case 4:qa(t,e),Ss(e);break;case 13:qa(t,e),Ss(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(GT=Ar())),r&4&&n8(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Gi=(u=Gi)||c,qa(t,e),Gi=u):qa(t,e),Ss(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Le=e,c=e.child;c!==null;){for(d=Le=c;Le!==null;){switch(f=Le,h=f.child,f.tag){case 0:case 11:case 14:case 15:Hg(4,f,f.return);break;case 1:Gf(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){mr(r,n,m)}}break;case 5:Gf(f,f.return);break;case 22:if(f.memoizedState!==null){i8(d);continue}}h!==null?(h.return=f,Le=h):i8(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=TN("display",a))}catch(m){mr(e,e.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){mr(e,e.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:qa(t,e),Ss(e),r&4&&n8(e);break;case 21:break;default:qa(t,e),Ss(e)}}function Ss(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(eL(n)){var r=n;break e}n=n.return}throw Error(le(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(vm(i,""),r.flags&=-33);var o=t8(e);q3(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=t8(e);G3(e,s,a);break;default:throw Error(le(161))}}catch(l){mr(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dY(e,t,n){Le=e,rL(e)}function rL(e,t,n){for(var r=(e.mode&1)!==0;Le!==null;){var i=Le,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||hv;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||Gi;s=hv;var u=Gi;if(hv=a,(Gi=l)&&!u)for(Le=i;Le!==null;)a=Le,l=a.child,a.tag===22&&a.memoizedState!==null?o8(i):l!==null?(l.return=a,Le=l):o8(i);for(;o!==null;)Le=o,rL(o),o=o.sibling;Le=i,hv=s,Gi=u}r8(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,Le=o):r8(e)}}function r8(e){for(;Le!==null;){var t=Le;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Gi||OS(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Gi)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ka(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&z6(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}z6(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&xm(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(le(163))}Gi||t.flags&512&&V3(t)}catch(f){mr(t,t.return,f)}}if(t===e){Le=null;break}if(n=t.sibling,n!==null){n.return=t.return,Le=n;break}Le=t.return}}function i8(e){for(;Le!==null;){var t=Le;if(t===e){Le=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Le=n;break}Le=t.return}}function o8(e){for(;Le!==null;){var t=Le;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{OS(4,t)}catch(l){mr(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){mr(t,i,l)}}var o=t.return;try{V3(t)}catch(l){mr(t,o,l)}break;case 5:var a=t.return;try{V3(t)}catch(l){mr(t,a,l)}}}catch(l){mr(t,t.return,l)}if(t===e){Le=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Le=s;break}Le=t.return}}var fY=Math.ceil,jb=nu.ReactCurrentDispatcher,UT=nu.ReactCurrentOwner,Aa=nu.ReactCurrentBatchConfig,Ht=0,di=null,Fr=null,Pi=0,Go=0,qf=wc(0),Qr=0,Mm=null,Rd=0,MS=0,VT=0,Wg=null,xo=null,GT=0,qh=1/0,xl=null,Ub=!1,H3=null,Ku=null,pv=!1,Fu=null,Vb=0,Kg=0,W3=null,F1=-1,B1=0;function so(){return Ht&6?Ar():F1!==-1?F1:F1=Ar()}function Qu(e){return e.mode&1?Ht&2&&Pi!==0?Pi&-Pi:QX.transition!==null?(B1===0&&(B1=zN()),B1):(e=yn,e!==0||(e=window.event,e=e===void 0?16:WN(e.type)),e):1}function as(e,t,n,r){if(50<Kg)throw Kg=0,W3=null,Error(le(185));ey(e,n,r),(!(Ht&2)||e!==di)&&(e===di&&(!(Ht&2)&&(MS|=n),Qr===4&&Iu(e,Pi)),Ro(e,r),n===1&&Ht===0&&!(t.mode&1)&&(qh=Ar()+500,PS&&Cc()))}function Ro(e,t){var n=e.callbackNode;QQ(e,t);var r=Eb(e,e===di?Pi:0);if(r===0)n!==null&&p6(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&p6(n),t===1)e.tag===0?KX(a8.bind(null,e)):fD(a8.bind(null,e)),GX(function(){!(Ht&6)&&Cc()}),n=null;else{switch(jN(r)){case 1:n=mT;break;case 4:n=FN;break;case 16:n=Ab;break;case 536870912:n=BN;break;default:n=Ab}n=dL(n,iL.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function iL(e,t){if(F1=-1,B1=0,Ht&6)throw Error(le(327));var n=e.callbackNode;if(lh()&&e.callbackNode!==n)return null;var r=Eb(e,e===di?Pi:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Gb(e,r);else{t=r;var i=Ht;Ht|=2;var o=aL();(di!==e||Pi!==t)&&(xl=null,qh=Ar()+500,yd(e,t));do try{gY();break}catch(s){oL(e,s)}while(1);PT(),jb.current=o,Ht=i,Fr!==null?t=0:(di=null,Pi=0,t=Qr)}if(t!==0){if(t===2&&(i=_3(e),i!==0&&(r=i,t=K3(e,i))),t===1)throw n=Mm,yd(e,0),Iu(e,r),Ro(e,Ar()),n;if(t===6)Iu(e,r);else{if(i=e.current.alternate,!(r&30)&&!hY(i)&&(t=Gb(e,r),t===2&&(o=_3(e),o!==0&&(r=o,t=K3(e,o))),t===1))throw n=Mm,yd(e,0),Iu(e,r),Ro(e,Ar()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(le(345));case 2:Hc(e,xo,xl);break;case 3:if(Iu(e,r),(r&130023424)===r&&(t=GT+500-Ar(),10<t)){if(Eb(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){so(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=k3(Hc.bind(null,e,xo,xl),t);break}Hc(e,xo,xl);break;case 4:if(Iu(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-os(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=Ar()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fY(r/1960))-r,10<r){e.timeoutHandle=k3(Hc.bind(null,e,xo,xl),r);break}Hc(e,xo,xl);break;case 5:Hc(e,xo,xl);break;default:throw Error(le(329))}}}return Ro(e,Ar()),e.callbackNode===n?iL.bind(null,e):null}function K3(e,t){var n=Wg;return e.current.memoizedState.isDehydrated&&(yd(e,t).flags|=256),e=Gb(e,t),e!==2&&(t=xo,xo=n,t!==null&&Q3(t)),e}function Q3(e){xo===null?xo=e:xo.push.apply(xo,e)}function hY(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!ds(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Iu(e,t){for(t&=~VT,t&=~MS,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-os(t),r=1<<n;e[n]=-1,t&=~r}}function a8(e){if(Ht&6)throw Error(le(327));lh();var t=Eb(e,0);if(!(t&1))return Ro(e,Ar()),null;var n=Gb(e,t);if(e.tag!==0&&n===2){var r=_3(e);r!==0&&(t=r,n=K3(e,r))}if(n===1)throw n=Mm,yd(e,0),Iu(e,t),Ro(e,Ar()),n;if(n===6)throw Error(le(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Hc(e,xo,xl),Ro(e,Ar()),null}function qT(e,t){var n=Ht;Ht|=1;try{return e(t)}finally{Ht=n,Ht===0&&(qh=Ar()+500,PS&&Cc())}}function Od(e){Fu!==null&&Fu.tag===0&&!(Ht&6)&&lh();var t=Ht;Ht|=1;var n=Aa.transition,r=yn;try{if(Aa.transition=null,yn=1,e)return e()}finally{yn=r,Aa.transition=n,Ht=t,!(Ht&6)&&Cc()}}function HT(){Go=qf.current,Kn(qf)}function yd(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,VX(n)),Fr!==null)for(n=Fr.return;n!==null;){var r=n;switch(ET(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Rb();break;case 3:Vh(),Kn(Po),Kn(Wi),NT();break;case 5:$T(r);break;case 4:Vh();break;case 13:Kn(lr);break;case 19:Kn(lr);break;case 10:IT(r.type._context);break;case 22:case 23:HT()}n=n.return}if(di=e,Fr=e=Xu(e.current,null),Pi=Go=t,Qr=0,Mm=null,VT=MS=Rd=0,xo=Wg=null,od!==null){for(t=0;t<od.length;t++)if(n=od[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}od=null}return e}function oL(e,t){do{var n=Fr;try{if(PT(),N1.current=zb,Bb){for(var r=cr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Bb=!1}if(Id=0,li=Hr=cr=null,qg=!1,Im=0,UT.current=null,n===null||n.return===null){Qr=1,Mm=t,Fr=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=Pi,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=W6(a);if(h!==null){h.flags&=-257,K6(h,a,s,o,t),h.mode&1&&H6(o,u,t),t=h,l=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}else{if(!(t&1)){H6(o,u,t),WT();break e}l=Error(le(426))}}else if(tr&&s.mode&1){var _=W6(a);if(_!==null){!(_.flags&65536)&&(_.flags|=256),K6(_,a,s,o,t),TT(Gh(l,s));break e}}o=l=Gh(l,s),Qr!==4&&(Qr=2),Wg===null?Wg=[o]:Wg.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var b=UD(o,l,t);B6(o,b);break e;case 1:s=l;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Ku===null||!Ku.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var v=VD(o,s,t);B6(o,v);break e}}o=o.return}while(o!==null)}lL(n)}catch(S){t=S,Fr===n&&n!==null&&(Fr=n=n.return);continue}break}while(1)}function aL(){var e=jb.current;return jb.current=zb,e===null?zb:e}function WT(){(Qr===0||Qr===3||Qr===2)&&(Qr=4),di===null||!(Rd&268435455)&&!(MS&268435455)||Iu(di,Pi)}function Gb(e,t){var n=Ht;Ht|=2;var r=aL();(di!==e||Pi!==t)&&(xl=null,yd(e,t));do try{pY();break}catch(i){oL(e,i)}while(1);if(PT(),Ht=n,jb.current=r,Fr!==null)throw Error(le(261));return di=null,Pi=0,Qr}function pY(){for(;Fr!==null;)sL(Fr)}function gY(){for(;Fr!==null&&!zQ();)sL(Fr)}function sL(e){var t=cL(e.alternate,e,Go);e.memoizedProps=e.pendingProps,t===null?lL(e):Fr=t,UT.current=null}function lL(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lY(n,t),n!==null){n.flags&=32767,Fr=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qr=6,Fr=null;return}}else if(n=sY(n,t,Go),n!==null){Fr=n;return}if(t=t.sibling,t!==null){Fr=t;return}Fr=t=e}while(t!==null);Qr===0&&(Qr=5)}function Hc(e,t,n){var r=yn,i=Aa.transition;try{Aa.transition=null,yn=1,mY(e,t,n,r)}finally{Aa.transition=i,yn=r}return null}function mY(e,t,n,r){do lh();while(Fu!==null);if(Ht&6)throw Error(le(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(le(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(XQ(e,o),e===di&&(Fr=di=null,Pi=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||pv||(pv=!0,dL(Ab,function(){return lh(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Aa.transition,Aa.transition=null;var a=yn;yn=1;var s=Ht;Ht|=4,UT.current=null,cY(e,n),nL(n,e),DX(E3),Tb=!!A3,E3=A3=null,e.current=n,dY(n),jQ(),Ht=s,yn=a,Aa.transition=o}else e.current=n;if(pv&&(pv=!1,Fu=e,Vb=i),o=e.pendingLanes,o===0&&(Ku=null),GQ(n.stateNode),Ro(e,Ar()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ub)throw Ub=!1,e=H3,H3=null,e;return Vb&1&&e.tag!==0&&lh(),o=e.pendingLanes,o&1?e===W3?Kg++:(Kg=0,W3=e):Kg=0,Cc(),null}function lh(){if(Fu!==null){var e=jN(Vb),t=Aa.transition,n=yn;try{if(Aa.transition=null,yn=16>e?16:e,Fu===null)var r=!1;else{if(e=Fu,Fu=null,Vb=0,Ht&6)throw Error(le(331));var i=Ht;for(Ht|=4,Le=e.current;Le!==null;){var o=Le,a=o.child;if(Le.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(Le=u;Le!==null;){var c=Le;switch(c.tag){case 0:case 11:case 15:Hg(8,c,o)}var d=c.child;if(d!==null)d.return=c,Le=d;else for(;Le!==null;){c=Le;var f=c.sibling,h=c.return;if(JD(c),c===u){Le=null;break}if(f!==null){f.return=h,Le=f;break}Le=h}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}Le=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,Le=a;else e:for(;Le!==null;){if(o=Le,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Hg(9,o,o.return)}var b=o.sibling;if(b!==null){b.return=o.return,Le=b;break e}Le=o.return}}var y=e.current;for(Le=y;Le!==null;){a=Le;var g=a.child;if(a.subtreeFlags&2064&&g!==null)g.return=a,Le=g;else e:for(a=y;Le!==null;){if(s=Le,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:OS(9,s)}}catch(S){mr(s,s.return,S)}if(s===a){Le=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,Le=v;break e}Le=s.return}}if(Ht=i,Cc(),Gs&&typeof Gs.onPostCommitFiberRoot=="function")try{Gs.onPostCommitFiberRoot(CS,e)}catch{}r=!0}return r}finally{yn=n,Aa.transition=t}}return!1}function s8(e,t,n){t=Gh(n,t),t=UD(e,t,1),e=Wu(e,t,1),t=so(),e!==null&&(ey(e,1,t),Ro(e,t))}function mr(e,t,n){if(e.tag===3)s8(e,e,n);else for(;t!==null;){if(t.tag===3){s8(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ku===null||!Ku.has(r))){e=Gh(n,e),e=VD(t,e,1),t=Wu(t,e,1),e=so(),t!==null&&(ey(t,1,e),Ro(t,e));break}}t=t.return}}function yY(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=so(),e.pingedLanes|=e.suspendedLanes&n,di===e&&(Pi&n)===n&&(Qr===4||Qr===3&&(Pi&130023424)===Pi&&500>Ar()-GT?yd(e,0):VT|=n),Ro(e,t)}function uL(e,t){t===0&&(e.mode&1?(t=iv,iv<<=1,!(iv&130023424)&&(iv=4194304)):t=1);var n=so();e=Wl(e,t),e!==null&&(ey(e,t,n),Ro(e,n))}function vY(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),uL(e,n)}function bY(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),uL(e,n)}var cL;cL=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Po.current)Ao=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ao=!1,aY(e,t,n);Ao=!!(e.flags&131072)}else Ao=!1,tr&&t.flags&1048576&&hD(t,$b,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;L1(e,t),e=t.pendingProps;var i=zh(t,Wi.current);sh(t,n),i=LT(null,t,r,e,i,n);var o=FT();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Io(r)?(o=!0,Ob(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,OT(t),i.updater=IS,t.stateNode=i,i._reactInternals=t,N3(t,r,e,n),t=F3(null,t,r,!0,o,n)):(t.tag=0,tr&&o&&AT(t),io(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(L1(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=SY(r),e=Ka(r,e),i){case 0:t=L3(null,t,r,e,n);break e;case 1:t=Y6(null,t,r,e,n);break e;case 11:t=Q6(null,t,r,e,n);break e;case 14:t=X6(null,t,r,Ka(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ka(r,i),L3(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ka(r,i),Y6(e,t,r,i,n);case 3:e:{if(WD(t),e===null)throw Error(le(387));r=t.pendingProps,o=t.memoizedState,i=o.element,yD(e,t),Lb(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Gh(Error(le(423)),t),t=Z6(e,t,r,n,i);break e}else if(r!==i){i=Gh(Error(le(424)),t),t=Z6(e,t,r,n,i);break e}else for(Xo=Hu(t.stateNode.containerInfo.firstChild),Zo=t,tr=!0,Za=null,n=SD(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jh(),r===i){t=Kl(e,t,n);break e}io(e,t,r,n)}t=t.child}return t;case 5:return xD(t),e===null&&O3(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,T3(r,i)?a=null:o!==null&&T3(r,o)&&(t.flags|=32),HD(e,t),io(e,t,a,n),t.child;case 6:return e===null&&O3(t),null;case 13:return KD(e,t,n);case 4:return MT(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Uh(t,null,r,n):io(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ka(r,i),Q6(e,t,r,i,n);case 7:return io(e,t,t.pendingProps,n),t.child;case 8:return io(e,t,t.pendingProps.children,n),t.child;case 12:return io(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,$n(Nb,r._currentValue),r._currentValue=a,o!==null)if(ds(o.value,a)){if(o.children===i.children&&!Po.current){t=Kl(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Fl(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),M3(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(le(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),M3(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}io(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,sh(t,n),i=Ea(i),r=r(i),t.flags|=1,io(e,t,r,n),t.child;case 14:return r=t.type,i=Ka(r,t.pendingProps),i=Ka(r.type,i),X6(e,t,r,i,n);case 15:return GD(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ka(r,i),L1(e,t),t.tag=1,Io(r)?(e=!0,Ob(t)):e=!1,sh(t,n),bD(t,r,i),N3(t,r,i,n),F3(null,t,r,!0,e,n);case 19:return QD(e,t,n);case 22:return qD(e,t,n)}throw Error(le(156,t.tag))};function dL(e,t){return LN(e,t)}function _Y(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wa(e,t,n,r){return new _Y(e,t,n,r)}function KT(e){return e=e.prototype,!(!e||!e.isReactComponent)}function SY(e){if(typeof e=="function")return KT(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hT)return 11;if(e===pT)return 14}return 2}function Xu(e,t){var n=e.alternate;return n===null?(n=wa(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function z1(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")KT(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Nf:return vd(n.children,i,o,t);case fT:a=8,i|=8;break;case o3:return e=wa(12,n,t,i|2),e.elementType=o3,e.lanes=o,e;case a3:return e=wa(13,n,t,i),e.elementType=a3,e.lanes=o,e;case s3:return e=wa(19,n,t,i),e.elementType=s3,e.lanes=o,e;case _N:return $S(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vN:a=10;break e;case bN:a=9;break e;case hT:a=11;break e;case pT:a=14;break e;case wu:a=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=wa(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function vd(e,t,n,r){return e=wa(7,e,r,t),e.lanes=n,e}function $S(e,t,n,r){return e=wa(22,e,r,t),e.elementType=_N,e.lanes=n,e.stateNode={isHidden:!1},e}function oC(e,t,n){return e=wa(6,e,null,t),e.lanes=n,e}function aC(e,t,n){return t=wa(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xY(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zw(0),this.expirationTimes=zw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zw(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function QT(e,t,n,r,i,o,a,s,l){return e=new xY(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=wa(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},OT(o),e}function wY(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$f,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function fL(e){if(!e)return ac;e=e._reactInternals;e:{if(Hd(e)!==e||e.tag!==1)throw Error(le(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Io(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(le(171))}if(e.tag===1){var n=e.type;if(Io(n))return dD(e,n,t)}return t}function hL(e,t,n,r,i,o,a,s,l){return e=QT(n,r,!0,e,i,o,a,s,l),e.context=fL(null),n=e.current,r=so(),i=Qu(n),o=Fl(r,i),o.callback=t??null,Wu(n,o,i),e.current.lanes=i,ey(e,i,r),Ro(e,r),e}function NS(e,t,n,r){var i=t.current,o=so(),a=Qu(i);return n=fL(n),t.context===null?t.context=n:t.pendingContext=n,t=Fl(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wu(i,t,a),e!==null&&(as(e,i,a,o),$1(e,i,a)),a}function qb(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function l8(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function XT(e,t){l8(e,t),(e=e.alternate)&&l8(e,t)}function CY(){return null}var pL=typeof reportError=="function"?reportError:function(e){console.error(e)};function YT(e){this._internalRoot=e}DS.prototype.render=YT.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(le(409));NS(e,t,null,null)};DS.prototype.unmount=YT.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Od(function(){NS(null,e,null,null)}),t[Hl]=null}};function DS(e){this._internalRoot=e}DS.prototype.unstable_scheduleHydration=function(e){if(e){var t=GN();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pu.length&&t!==0&&t<Pu[n].priority;n++);Pu.splice(n,0,e),n===0&&HN(e)}};function ZT(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function LS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function u8(){}function AY(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=qb(a);o.call(u)}}var a=hL(t,r,e,0,null,!1,!1,"",u8);return e._reactRootContainer=a,e[Hl]=a.current,Am(e.nodeType===8?e.parentNode:e),Od(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=qb(l);s.call(u)}}var l=QT(e,0,!1,null,null,!1,!1,"",u8);return e._reactRootContainer=l,e[Hl]=l.current,Am(e.nodeType===8?e.parentNode:e),Od(function(){NS(t,l,n,r)}),l}function FS(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=qb(a);s.call(l)}}NS(t,a,e,i)}else a=AY(n,t,e,i,r);return qb(a)}UN=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xg(t.pendingLanes);n!==0&&(yT(t,n|1),Ro(t,Ar()),!(Ht&6)&&(qh=Ar()+500,Cc()))}break;case 13:Od(function(){var r=Wl(e,1);if(r!==null){var i=so();as(r,e,1,i)}}),XT(e,1)}};vT=function(e){if(e.tag===13){var t=Wl(e,134217728);if(t!==null){var n=so();as(t,e,134217728,n)}XT(e,134217728)}};VN=function(e){if(e.tag===13){var t=Qu(e),n=Wl(e,t);if(n!==null){var r=so();as(n,e,t,r)}XT(e,t)}};GN=function(){return yn};qN=function(e,t){var n=yn;try{return yn=e,t()}finally{yn=n}};y3=function(e,t,n){switch(t){case"input":if(c3(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=kS(r);if(!i)throw Error(le(90));xN(r),c3(r,i)}}}break;case"textarea":CN(e,n);break;case"select":t=n.value,t!=null&&rh(e,!!n.multiple,t,!1)}};RN=qT;ON=Od;var EY={usingClientEntryPoint:!1,Events:[ny,Bf,kS,PN,IN,qT]},Kp={findFiberByHostInstance:id,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},TY={bundleType:Kp.bundleType,version:Kp.version,rendererPackageName:Kp.rendererPackageName,rendererConfig:Kp.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:nu.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=NN(e),e===null?null:e.stateNode},findFiberByHostInstance:Kp.findFiberByHostInstance||CY,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gv.isDisabled&&gv.supportsFiber)try{CS=gv.inject(TY),Gs=gv}catch{}}oa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EY;oa.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ZT(t))throw Error(le(200));return wY(e,t,null,n)};oa.createRoot=function(e,t){if(!ZT(e))throw Error(le(299));var n=!1,r="",i=pL;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=QT(e,1,!1,null,null,n,!1,r,i),e[Hl]=t.current,Am(e.nodeType===8?e.parentNode:e),new YT(t)};oa.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(le(188)):(e=Object.keys(e).join(","),Error(le(268,e)));return e=NN(t),e=e===null?null:e.stateNode,e};oa.flushSync=function(e){return Od(e)};oa.hydrate=function(e,t,n){if(!LS(t))throw Error(le(200));return FS(null,e,t,!0,n)};oa.hydrateRoot=function(e,t,n){if(!ZT(e))throw Error(le(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=pL;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=hL(t,null,e,1,n??null,i,!1,o,a),e[Hl]=t.current,Am(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new DS(t)};oa.render=function(e,t,n){if(!LS(t))throw Error(le(200));return FS(null,e,t,!1,n)};oa.unmountComponentAtNode=function(e){if(!LS(e))throw Error(le(40));return e._reactRootContainer?(Od(function(){FS(null,null,e,!1,function(){e._reactRootContainer=null,e[Hl]=null})}),!0):!1};oa.unstable_batchedUpdates=qT;oa.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!LS(n))throw Error(le(200));if(e==null||e._reactInternals===void 0)throw Error(le(38));return FS(e,t,n,!1,r)};oa.version="18.2.0-next-9e3b772b8-20220608";function gL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gL)}catch(e){console.error(e)}}gL(),hN.exports=oa;var Wo=hN.exports;const TUe=Sc(Wo);var c8=Wo;r3.createRoot=c8.createRoot,r3.hydrateRoot=c8.hydrateRoot;const kY="modulepreload",PY=function(e,t){return new URL(e,t).href},d8={},mL=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=PY(o,r),o in d8)return;d8[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const d=i[c];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":kY,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})};function ci(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function uo(e){return!!e&&!!e[St]}function Oo(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===LY}(e)||Array.isArray(e)||!!e[uh]||!!(!((t=e.constructor)===null||t===void 0)&&t[uh])||BS(e)||zS(e))}function JT(e){return uo(e)||ci(23,e),e[St].t}function Ql(e,t,n){n===void 0&&(n=!1),sc(e)===0?(n?Object.keys:ch)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,i){return t(i,r,e)})}function sc(e){var t=e[St];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:BS(e)?2:zS(e)?3:0}function Yu(e,t){return sc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function j1(e,t){return sc(e)===2?e.get(t):e[t]}function yL(e,t,n){var r=sc(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function vL(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function BS(e){return NY&&e instanceof Map}function zS(e){return DY&&e instanceof Set}function ri(e){return e.o||e.t}function ek(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=_L(e);delete t[St];for(var n=ch(t),r=0;r<n.length;r++){var i=n[r],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function iy(e,t){return t===void 0&&(t=!1),tk(e)||uo(e)||!Oo(e)||(sc(e)>1&&(e.set=e.add=e.clear=e.delete=IY),Object.freeze(e),t&&Ql(e,function(n,r){return iy(r,!0)},!0)),e}function IY(){ci(2)}function tk(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Hs(e){var t=Y3[e];return t||ci(18,e),t}function nk(e,t){Y3[e]||(Y3[e]=t)}function $m(){return Dm}function sC(e,t){t&&(Hs("Patches"),e.u=[],e.s=[],e.v=t)}function Hb(e){X3(e),e.p.forEach(RY),e.p=null}function X3(e){e===Dm&&(Dm=e.l)}function f8(e){return Dm={p:[],l:Dm,h:e,m:!0,_:0}}function RY(e){var t=e[St];t.i===0||t.i===1?t.j():t.g=!0}function lC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||Hs("ES5").S(t,e,r),r?(n[St].P&&(Hb(t),ci(4)),Oo(e)&&(e=Wb(t,e),t.l||Kb(t,e)),t.u&&Hs("Patches").M(n[St].t,e,t.u,t.s)):e=Wb(t,n,[]),Hb(t),t.u&&t.v(t.u,t.s),e!==US?e:void 0}function Wb(e,t,n){if(tk(t))return t;var r=t[St];if(!r)return Ql(t,function(s,l){return h8(e,r,t,s,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Kb(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=ek(r.k):r.o,o=i,a=!1;r.i===3&&(o=new Set(i),i.clear(),a=!0),Ql(o,function(s,l){return h8(e,r,i,s,l,n,a)}),Kb(e,i,!1),n&&e.u&&Hs("Patches").N(r,n,e.u,e.s)}return r.o}function h8(e,t,n,r,i,o,a){if(uo(i)){var s=Wb(e,i,o&&t&&t.i!==3&&!Yu(t.R,r)?o.concat(r):void 0);if(yL(n,r,s),!uo(s))return;e.m=!1}else a&&n.add(i);if(Oo(i)&&!tk(i)){if(!e.h.D&&e._<1)return;Wb(e,i),t&&t.A.l||Kb(e,i)}}function Kb(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&iy(t,n)}function uC(e,t){var n=e[St];return(n?ri(n):e)[t]}function p8(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function wo(e){e.P||(e.P=!0,e.l&&wo(e.l))}function cC(e){e.o||(e.o=ek(e.t))}function Nm(e,t,n){var r=BS(t)?Hs("MapSet").F(t,n):zS(t)?Hs("MapSet").T(t,n):e.O?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:$m(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Lm;a&&(l=[s],u=Cg);var c=Proxy.revocable(l,u),d=c.revoke,f=c.proxy;return s.k=f,s.j=d,f}(t,n):Hs("ES5").J(t,n);return(n?n.A:$m()).p.push(r),r}function jS(e){return uo(e)||ci(22,e),function t(n){if(!Oo(n))return n;var r,i=n[St],o=sc(n);if(i){if(!i.P&&(i.i<4||!Hs("ES5").K(i)))return i.t;i.I=!0,r=g8(n,o),i.I=!1}else r=g8(n,o);return Ql(r,function(a,s){i&&j1(i.t,a)===s||yL(r,a,t(s))}),o===3?new Set(r):r}(e)}function g8(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return ek(e)}function rk(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[St];return Lm.get(l,o)},set:function(l){var u=this[St];Lm.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][St];if(!s.P)switch(s.i){case 5:r(s)&&wo(s);break;case 4:n(s)&&wo(s)}}}function n(o){for(var a=o.t,s=o.k,l=ch(s),u=l.length-1;u>=0;u--){var c=l[u];if(c!==St){var d=a[c];if(d===void 0&&!Yu(a,c))return!0;var f=s[c],h=f&&f[St];if(h?h.t!==d:!vL(f,d))return!0}}var p=!!a[St];return l.length!==ch(a).length+(p?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l<a.length;l++)if(!a.hasOwnProperty(l))return!0;return!1}var i={};nk("ES5",{J:function(o,a){var s=Array.isArray(o),l=function(c,d){if(c){for(var f=Array(d.length),h=0;h<d.length;h++)Object.defineProperty(f,""+h,e(h,!0));return f}var p=_L(d);delete p[St];for(var m=ch(p),_=0;_<m.length;_++){var b=m[_];p[b]=e(b,c||!!p[b].enumerable)}return Object.create(Object.getPrototypeOf(d),p)}(s,o),u={i:s?5:4,A:a?a.A:$m(),P:!1,I:!1,R:{},l:a,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,St,{value:u,writable:!0}),l},S:function(o,a,s){s?uo(a)&&a[St].A===o&&t(o.p):(o.u&&function l(u){if(u&&typeof u=="object"){var c=u[St];if(c){var d=c.t,f=c.k,h=c.R,p=c.i;if(p===4)Ql(f,function(g){g!==St&&(d[g]!==void 0||Yu(d,g)?h[g]||l(f[g]):(h[g]=!0,wo(c)))}),Ql(d,function(g){f[g]!==void 0||Yu(f,g)||(h[g]=!1,wo(c))});else if(p===5){if(r(c)&&(wo(c),h.length=!0),f.length<d.length)for(var m=f.length;m<d.length;m++)h[m]=!1;else for(var _=d.length;_<f.length;_++)h[_]=!0;for(var b=Math.min(f.length,d.length),y=0;y<b;y++)f.hasOwnProperty(y)||(h[y]=!0),h[y]===void 0&&l(f[y])}}}}(o.p[0]),t(o.p))},K:function(o){return o.i===4?n(o):r(o)}})}function ik(){function e(r){if(!Oo(r))return r;if(Array.isArray(r))return r.map(e);if(BS(r))return new Map(Array.from(r.entries()).map(function(a){return[a[0],e(a[1])]}));if(zS(r))return new Set(Array.from(r).map(e));var i=Object.create(Object.getPrototypeOf(r));for(var o in r)i[o]=e(r[o]);return Yu(r,uh)&&(i[uh]=r[uh]),i}function t(r){return uo(r)?e(r):r}var n="add";nk("Patches",{$:function(r,i){return i.forEach(function(o){for(var a=o.path,s=o.op,l=r,u=0;u<a.length-1;u++){var c=sc(l),d=a[u];typeof d!="string"&&typeof d!="number"&&(d=""+d),c!==0&&c!==1||d!=="__proto__"&&d!=="constructor"||ci(24),typeof l=="function"&&d==="prototype"&&ci(24),typeof(l=j1(l,d))!="object"&&ci(15,a.join("/"))}var f=sc(l),h=e(o.value),p=a[a.length-1];switch(s){case"replace":switch(f){case 2:return l.set(p,h);case 3:ci(16);default:return l[p]=h}case n:switch(f){case 1:return p==="-"?l.push(h):l.splice(p,0,h);case 2:return l.set(p,h);case 3:return l.add(h);default:return l[p]=h}case"remove":switch(f){case 1:return l.splice(p,1);case 2:return l.delete(p);case 3:return l.delete(o.value);default:return delete l[p]}default:ci(17,s)}}),r},N:function(r,i,o,a){switch(r.i){case 0:case 4:case 2:return function(s,l,u,c){var d=s.t,f=s.o;Ql(s.R,function(h,p){var m=j1(d,h),_=j1(f,h),b=p?Yu(d,h)?"replace":n:"remove";if(m!==_||b!=="replace"){var y=l.concat(h);u.push(b==="remove"?{op:b,path:y}:{op:b,path:y,value:_}),c.push(b===n?{op:"remove",path:y}:b==="remove"?{op:n,path:y,value:t(m)}:{op:"replace",path:y,value:t(m)})}})}(r,i,o,a);case 5:case 1:return function(s,l,u,c){var d=s.t,f=s.R,h=s.o;if(h.length<d.length){var p=[h,d];d=p[0],h=p[1];var m=[c,u];u=m[0],c=m[1]}for(var _=0;_<d.length;_++)if(f[_]&&h[_]!==d[_]){var b=l.concat([_]);u.push({op:"replace",path:b,value:t(h[_])}),c.push({op:"replace",path:b,value:t(d[_])})}for(var y=d.length;y<h.length;y++){var g=l.concat([y]);u.push({op:n,path:g,value:t(h[y])})}d.length<h.length&&c.push({op:"replace",path:l.concat(["length"]),value:d.length})}(r,i,o,a);case 3:return function(s,l,u,c){var d=s.t,f=s.o,h=0;d.forEach(function(p){if(!f.has(p)){var m=l.concat([h]);u.push({op:"remove",path:m,value:p}),c.unshift({op:n,path:m,value:p})}h++}),h=0,f.forEach(function(p){if(!d.has(p)){var m=l.concat([h]);u.push({op:n,path:m,value:p}),c.unshift({op:"remove",path:m,value:p})}h++})}(r,i,o,a)}},M:function(r,i,o,a){o.push({op:"replace",path:[],value:i===US?void 0:i}),a.push({op:"replace",path:[],value:r})}})}function bL(){function e(s,l){function u(){this.constructor=s}i(s,l),s.prototype=(u.prototype=l.prototype,new u)}function t(s){s.o||(s.R=new Map,s.o=new Map(s.t))}function n(s){s.o||(s.o=new Set,s.t.forEach(function(l){if(Oo(l)){var u=Nm(s.A.h,l,s);s.p.set(l,u),s.o.add(u)}else s.o.add(l)}))}function r(s){s.g&&ci(3,JSON.stringify(ri(s)))}var i=function(s,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var d in c)c.hasOwnProperty(d)&&(u[d]=c[d])})(s,l)},o=function(){function s(u,c){return this[St]={i:2,l:c,A:c?c.A:$m(),P:!1,I:!1,o:void 0,R:void 0,t:u,k:this,C:!1,g:!1},this}e(s,Map);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return ri(this[St]).size}}),l.has=function(u){return ri(this[St]).has(u)},l.set=function(u,c){var d=this[St];return r(d),ri(d).has(u)&&ri(d).get(u)===c||(t(d),wo(d),d.R.set(u,!0),d.o.set(u,c),d.R.set(u,!0)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[St];return r(c),t(c),wo(c),c.t.has(u)?c.R.set(u,!1):c.R.delete(u),c.o.delete(u),!0},l.clear=function(){var u=this[St];r(u),ri(u).size&&(t(u),wo(u),u.R=new Map,Ql(u.t,function(c){u.R.set(c,!1)}),u.o.clear())},l.forEach=function(u,c){var d=this;ri(this[St]).forEach(function(f,h){u.call(c,d.get(h),h,d)})},l.get=function(u){var c=this[St];r(c);var d=ri(c).get(u);if(c.I||!Oo(d)||d!==c.t.get(u))return d;var f=Nm(c.A.h,d,c);return t(c),c.o.set(u,f),f},l.keys=function(){return ri(this[St]).keys()},l.values=function(){var u,c=this,d=this.keys();return(u={})[mv]=function(){return c.values()},u.next=function(){var f=d.next();return f.done?f:{done:!1,value:c.get(f.value)}},u},l.entries=function(){var u,c=this,d=this.keys();return(u={})[mv]=function(){return c.entries()},u.next=function(){var f=d.next();if(f.done)return f;var h=c.get(f.value);return{done:!1,value:[f.value,h]}},u},l[mv]=function(){return this.entries()},s}(),a=function(){function s(u,c){return this[St]={i:3,l:c,A:c?c.A:$m(),P:!1,I:!1,o:void 0,t:u,k:this,p:new Map,g:!1,C:!1},this}e(s,Set);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return ri(this[St]).size}}),l.has=function(u){var c=this[St];return r(c),c.o?!!c.o.has(u)||!(!c.p.has(u)||!c.o.has(c.p.get(u))):c.t.has(u)},l.add=function(u){var c=this[St];return r(c),this.has(u)||(n(c),wo(c),c.o.add(u)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[St];return r(c),n(c),wo(c),c.o.delete(u)||!!c.p.has(u)&&c.o.delete(c.p.get(u))},l.clear=function(){var u=this[St];r(u),ri(u).size&&(n(u),wo(u),u.o.clear())},l.values=function(){var u=this[St];return r(u),n(u),u.o.values()},l.entries=function(){var u=this[St];return r(u),n(u),u.o.entries()},l.keys=function(){return this.values()},l[mv]=function(){return this.values()},l.forEach=function(u,c){for(var d=this.values(),f=d.next();!f.done;)u.call(c,f.value,f.value,this),f=d.next()},s}();nk("MapSet",{F:function(s,l){return new o(s,l)},T:function(s,l){return new a(s,l)}})}function OY(){rk(),bL(),ik()}function MY(e){return e}function $Y(e){return e}var m8,Dm,ok=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",NY=typeof Map<"u",DY=typeof Set<"u",y8=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",US=ok?Symbol.for("immer-nothing"):((m8={})["immer-nothing"]=!0,m8),uh=ok?Symbol.for("immer-draftable"):"__$immer_draftable",St=ok?Symbol.for("immer-state"):"__$immer_state",mv=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",LY=""+Object.prototype.constructor,ch=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,_L=Object.getOwnPropertyDescriptors||function(e){var t={};return ch(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Y3={},Lm={get:function(e,t){if(t===St)return e;var n=ri(e);if(!Yu(n,t))return function(i,o,a){var s,l=p8(o,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!Oo(r)?r:r===uC(e.t,t)?(cC(e),e.o[t]=Nm(e.A.h,r,e)):r},has:function(e,t){return t in ri(e)},ownKeys:function(e){return Reflect.ownKeys(ri(e))},set:function(e,t,n){var r=p8(ri(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=uC(ri(e),t),o=i==null?void 0:i[St];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(vL(n,i)&&(n!==void 0||Yu(e.t,t)))return!0;cC(e),wo(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return uC(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,cC(e),wo(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=ri(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){ci(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ci(12)}},Cg={};Ql(Lm,function(e,t){Cg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Cg.deleteProperty=function(e,t){return Cg.set.call(this,e,t,void 0)},Cg.set=function(e,t,n){return Lm.set.call(this,e[0],t,n,e[0])};var SL=function(){function e(n){var r=this;this.O=y8,this.D=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var l=r;return function(m){var _=this;m===void 0&&(m=s);for(var b=arguments.length,y=Array(b>1?b-1:0),g=1;g<b;g++)y[g-1]=arguments[g];return l.produce(m,function(v){var S;return(S=o).call.apply(S,[_,v].concat(y))})}}var u;if(typeof o!="function"&&ci(6),a!==void 0&&typeof a!="function"&&ci(7),Oo(i)){var c=f8(r),d=Nm(r,i,void 0),f=!0;try{u=o(d),f=!1}finally{f?Hb(c):X3(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(m){return sC(c,a),lC(m,c)},function(m){throw Hb(c),m}):(sC(c,a),lC(u,c))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===US&&(u=void 0),r.D&&iy(u,!0),a){var h=[],p=[];Hs("Patches").M(i,u,h,p),a(h,p)}return u}ci(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return r.produceWithPatches(u,function(h){return i.apply(void 0,[h].concat(d))})};var a,s,l=r.produce(i,o,function(u,c){a=u,s=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,a,s]}):[l,a,s]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){Oo(n)||ci(8),uo(n)&&(n=jS(n));var r=f8(this),i=Nm(this,n,void 0);return i[St].C=!0,X3(r),i},t.finishDraft=function(n,r){var i=n&&n[St],o=i.A;return sC(o,r),lC(void 0,o)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!y8&&ci(20),this.O=n},t.applyPatches=function(n,r){var i;for(i=r.length-1;i>=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=Hs("Patches").$;return uo(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),na=new SL,xL=na.produce,ak=na.produceWithPatches.bind(na),FY=na.setAutoFreeze.bind(na),BY=na.setUseProxies.bind(na),Z3=na.applyPatches.bind(na),zY=na.createDraft.bind(na),jY=na.finishDraft.bind(na);const Ac=xL,UY=Object.freeze(Object.defineProperty({__proto__:null,Immer:SL,applyPatches:Z3,castDraft:MY,castImmutable:$Y,createDraft:zY,current:jS,default:Ac,enableAllPlugins:OY,enableES5:rk,enableMapSet:bL,enablePatches:ik,finishDraft:jY,freeze:iy,immerable:uh,isDraft:uo,isDraftable:Oo,nothing:US,original:JT,produce:xL,produceWithPatches:ak,setAutoFreeze:FY,setUseProxies:BY},Symbol.toStringTag,{value:"Module"}));function Fm(e){"@babel/helpers - typeof";return Fm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fm(e)}function VY(e,t){if(Fm(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fm(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GY(e){var t=VY(e,"string");return Fm(t)==="symbol"?t:String(t)}function qY(e,t,n){return t=GY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function b8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v8(Object(n),!0).forEach(function(r){qY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ci(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var _8=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),dC=function(){return Math.random().toString(36).substring(7).split("").join(".")},Hh={INIT:"@@redux/INIT"+dC(),REPLACE:"@@redux/REPLACE"+dC(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+dC()}};function HY(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function oy(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ci(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ci(1));return n(oy)(e,t)}if(typeof e!="function")throw new Error(Ci(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(Ci(3));return o}function d(m){if(typeof m!="function")throw new Error(Ci(4));if(l)throw new Error(Ci(5));var _=!0;return u(),s.push(m),function(){if(_){if(l)throw new Error(Ci(6));_=!1,u();var y=s.indexOf(m);s.splice(y,1),a=null}}}function f(m){if(!HY(m))throw new Error(Ci(7));if(typeof m.type>"u")throw new Error(Ci(8));if(l)throw new Error(Ci(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var _=a=s,b=0;b<_.length;b++){var y=_[b];y()}return m}function h(m){if(typeof m!="function")throw new Error(Ci(10));i=m,f({type:Hh.REPLACE})}function p(){var m,_=d;return m={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(Ci(11));function g(){y.next&&y.next(c())}g();var v=_(g);return{unsubscribe:v}}},m[_8]=function(){return this},m}return f({type:Hh.INIT}),r={dispatch:f,subscribe:d,getState:c,replaceReducer:h},r[_8]=p,r}var wL=oy;function WY(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Hh.INIT});if(typeof r>"u")throw new Error(Ci(12));if(typeof n(void 0,{type:Hh.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ci(13))})}function _p(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];typeof e[i]=="function"&&(n[i]=e[i])}var o=Object.keys(n),a;try{WY(n)}catch(s){a=s}return function(l,u){if(l===void 0&&(l={}),a)throw a;for(var c=!1,d={},f=0;f<o.length;f++){var h=o[f],p=n[h],m=l[h],_=p(m,u);if(typeof _>"u")throw u&&u.type,new Error(Ci(14));d[h]=_,c=c||_!==m}return c=c||o.length!==Object.keys(l).length,c?d:l}}function S8(e,t){return function(){return t(e.apply(this,arguments))}}function CL(e,t){if(typeof e=="function")return S8(e,t);if(typeof e!="object"||e===null)throw new Error(Ci(16));var n={};for(var r in e){var i=e[r];typeof i=="function"&&(n[r]=S8(i,t))}return n}function Wh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}function sk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var i=r.apply(void 0,arguments),o=function(){throw new Error(Ci(15))},a={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},s=t.map(function(l){return l(a)});return o=Wh.apply(void 0,s)(i.dispatch),b8(b8({},i),{},{dispatch:o})}}}const KY=Object.freeze(Object.defineProperty({__proto__:null,__DO_NOT_USE__ActionTypes:Hh,applyMiddleware:sk,bindActionCreators:CL,combineReducers:_p,compose:Wh,createStore:oy,legacy_createStore:wL},Symbol.toStringTag,{value:"Module"}));var Qb="NOT_FOUND";function QY(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Qb},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function XY(e,t){var n=[];function r(s){var l=n.findIndex(function(c){return t(s,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return Qb}function i(s,l){r(s)===Qb&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var AL=function(t,n){return t===n};function YY(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function Xb(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?AL:r,o=n.maxSize,a=o===void 0?1:o,s=n.resultEqualityCheck,l=YY(i),u=a===1?QY(l):XY(a,l);function c(){var d=u.get(arguments);if(d===Qb){if(d=e.apply(null,arguments),s){var f=u.getEntries(),h=f.find(function(p){return s(p.value,d)});h&&(d=h.value)}u.put(arguments,d)}return d}return c.clearCache=function(){return u.clear()},c}function ZY(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function EL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u=0,c,d={memoizeOptions:void 0},f=s.pop();if(typeof f=="object"&&(d=f,f=s.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var h=d,p=h.memoizeOptions,m=p===void 0?n:p,_=Array.isArray(m)?m:[m],b=ZY(s),y=e.apply(void 0,[function(){return u++,f.apply(null,arguments)}].concat(_)),g=e(function(){for(var S=[],w=b.length,x=0;x<w;x++)S.push(b[x].apply(null,arguments));return c=y.apply(null,S),c});return Object.assign(g,{resultFunc:f,memoizedResultFunc:y,dependencies:b,lastResult:function(){return c},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),g};return i}var Ii=EL(Xb),JY=function(t,n){if(n===void 0&&(n=Ii),typeof t!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof t));var r=Object.keys(t),i=n(r.map(function(o){return t[o]}),function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return a.reduce(function(l,u,c){return l[r[c]]=u,l},{})});return i};const eZ=Object.freeze(Object.defineProperty({__proto__:null,createSelector:Ii,createSelectorCreator:EL,createStructuredSelector:JY,defaultEqualityCheck:AL,defaultMemoize:Xb},Symbol.toStringTag,{value:"Module"}));function TL(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(a){return function(s){return typeof s=="function"?s(i,o,e):a(s)}}};return t}var kL=TL();kL.withExtraArgument=TL;const x8=kL;var PL=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ay=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},lc=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},tZ=Object.defineProperty,nZ=Object.defineProperties,rZ=Object.getOwnPropertyDescriptors,w8=Object.getOwnPropertySymbols,iZ=Object.prototype.hasOwnProperty,oZ=Object.prototype.propertyIsEnumerable,C8=function(e,t,n){return t in e?tZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Eo=function(e,t){for(var n in t||(t={}))iZ.call(t,n)&&C8(e,n,t[n]);if(w8)for(var r=0,i=w8(t);r<i.length;r++){var n=i[r];oZ.call(t,n)&&C8(e,n,t[n])}return e},fC=function(e,t){return nZ(e,rZ(t))},sy=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},bl=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ii.apply(void 0,e),r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return n.apply(void 0,lc([uo(i)?jS(i):i],o))};return r},aZ=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Wh:Wh.apply(null,arguments)};function fs(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var IL=function(e){PL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,lc([void 0],n[0].concat(this)))):new(t.bind.apply(t,lc([void 0],n.concat(this))))},t}(Array),RL=function(e){PL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,lc([void 0],n[0].concat(this)))):new(t.bind.apply(t,lc([void 0],n.concat(this))))},t}(Array);function J3(e){return Oo(e)?Ac(e,function(){}):e}function sZ(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function lZ(e){return function(){return function(t){return function(n){return t(n)}}}}function OL(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||fs(e)}function ML(e,t,n,r,i,o){t===void 0&&(t=""),n===void 0&&(n=OL),i===void 0&&(i=[]);var a;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o!=null&&o.has(e))return!1;for(var s=r!=null?r(e):Object.entries(e),l=i.length>0,u=function(_,b){var y=t?t+"."+_:_;if(l){var g=i.some(function(v){return v instanceof RegExp?v.test(y):y===v});if(g)return"continue"}if(!n(b))return{value:{keyPath:y,value:b}};if(typeof b=="object"&&(a=ML(b,y,n,r,i,o),a))return{value:a}},c=0,d=s;c<d.length;c++){var f=d[c],h=f[0],p=f[1],m=u(h,p);if(typeof m=="object")return m.value}return o&&$L(e)&&o.add(e),!1}function $L(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if(!(typeof r!="object"||r===null)&&!$L(r))return!1}return!0}function uZ(e){return function(){return function(t){return function(n){return t(n)}}}}function cZ(e){return typeof e=="boolean"}function dZ(){return function(t){return NL(t)}}function NL(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t;e.immutableCheck,e.serializableCheck;var r=new IL;return n&&(cZ(n)?r.push(x8):r.push(x8.withExtraArgument(n.extraArgument))),r}var fZ=!0;function DL(e){var t=dZ(),n=e||{},r=n.reducer,i=r===void 0?void 0:r,o=n.middleware,a=o===void 0?t():o,s=n.devTools,l=s===void 0?!0:s,u=n.preloadedState,c=u===void 0?void 0:u,d=n.enhancers,f=d===void 0?void 0:d,h;if(typeof i=="function")h=i;else if(fs(i))h=_p(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var p=a;typeof p=="function"&&(p=p(t));var m=sk.apply(void 0,p),_=Wh;l&&(_=aZ(Eo({trace:!fZ},typeof l=="object"&&l)));var b=new RL(m),y=b;Array.isArray(f)?y=lc([m],f):typeof f=="function"&&(y=f(b));var g=_.apply(void 0,y);return oy(h,c,g)}function Ne(e,t){function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(t){var o=t.apply(void 0,r);if(!o)throw new Error("prepareAction did not return an object");return Eo(Eo({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function lk(e){return fs(e)&&"type"in e}function LL(e){return lk(e)&&typeof e.type=="string"&&Object.keys(e).every(hZ)}function hZ(e){return["type","payload","error","meta"].indexOf(e)>-1}function pZ(e){return""+e}function FL(e){var t={},n=[],r,i={addCase:function(o,a){var s=typeof o=="string"?o:o.type;if(s in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[s]=a,i},addMatcher:function(o,a){return n.push({matcher:o,reducer:a}),i},addDefaultCase:function(o){return r=o,i}};return e(i),[t,n,r]}function gZ(e){return typeof e=="function"}function BL(e,t,n,r){n===void 0&&(n=[]);var i=typeof t=="function"?FL(t):[t,n,r],o=i[0],a=i[1],s=i[2],l;if(gZ(e))l=function(){return J3(e())};else{var u=J3(e);l=function(){return u}}function c(d,f){d===void 0&&(d=l());var h=lc([o[f.type]],a.filter(function(p){var m=p.matcher;return m(f)}).map(function(p){var m=p.reducer;return m}));return h.filter(function(p){return!!p}).length===0&&(h=[s]),h.reduce(function(p,m){if(m)if(uo(p)){var _=p,b=m(_,f);return b===void 0?p:b}else{if(Oo(p))return Ac(p,function(y){return m(y,f)});var b=m(p,f);if(b===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}return p},d)}return c.getInitialState=l,c}function mZ(e,t){return e+"/"+t}function nr(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:J3(e.initialState),r=e.reducers||{},i=Object.keys(r),o={},a={},s={};i.forEach(function(c){var d=r[c],f=mZ(t,c),h,p;"reducer"in d?(h=d.reducer,p=d.prepare):h=d,o[c]=h,a[f]=h,s[c]=p?Ne(f,p):Ne(f)});function l(){var c=typeof e.extraReducers=="function"?FL(e.extraReducers):[e.extraReducers],d=c[0],f=d===void 0?{}:d,h=c[1],p=h===void 0?[]:h,m=c[2],_=m===void 0?void 0:m,b=Eo(Eo({},f),a);return BL(n,function(y){for(var g in b)y.addCase(g,b[g]);for(var v=0,S=p;v<S.length;v++){var w=S[v];y.addMatcher(w.matcher,w.reducer)}_&&y.addDefaultCase(_)})}var u;return{name:t,reducer:function(c,d){return u||(u=l()),u(c,d)},actions:s,caseReducers:o,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}function yZ(){return{ids:[],entities:{}}}function vZ(){function e(t){return t===void 0&&(t={}),Object.assign(yZ(),t)}return{getInitialState:e}}function bZ(){function e(t){var n=function(u){return u.ids},r=function(u){return u.entities},i=bl(n,r,function(u,c){return u.map(function(d){return c[d]})}),o=function(u,c){return c},a=function(u,c){return u[c]},s=bl(n,function(u){return u.length});if(!t)return{selectIds:n,selectEntities:r,selectAll:i,selectTotal:s,selectById:bl(r,o,a)};var l=bl(t,r);return{selectIds:bl(t,n),selectEntities:l,selectAll:bl(t,i),selectTotal:bl(t,s),selectById:bl(l,o,a)}}return{getSelectors:e}}function _Z(e){var t=wr(function(n,r){return e(r)});return function(r){return t(r,void 0)}}function wr(e){return function(n,r){function i(a){return LL(a)}var o=function(a){i(r)?e(r.payload,a):e(r,a)};return uo(n)?(o(n),n):Ac(n,o)}}function Qg(e,t){var n=t(e);return n}function bd(e){return Array.isArray(e)||(e=Object.values(e)),e}function zL(e,t,n){e=bd(e);for(var r=[],i=[],o=0,a=e;o<a.length;o++){var s=a[o],l=Qg(s,t);l in n.entities?i.push({id:l,changes:s}):r.push(s)}return[r,i]}function jL(e){function t(p,m){var _=Qg(p,e);_ in m.entities||(m.ids.push(_),m.entities[_]=p)}function n(p,m){p=bd(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];t(y,m)}}function r(p,m){var _=Qg(p,e);_ in m.entities||m.ids.push(_),m.entities[_]=p}function i(p,m){p=bd(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];r(y,m)}}function o(p,m){p=bd(p),m.ids=[],m.entities={},n(p,m)}function a(p,m){return s([p],m)}function s(p,m){var _=!1;p.forEach(function(b){b in m.entities&&(delete m.entities[b],_=!0)}),_&&(m.ids=m.ids.filter(function(b){return b in m.entities}))}function l(p){Object.assign(p,{ids:[],entities:{}})}function u(p,m,_){var b=_.entities[m.id],y=Object.assign({},b,m.changes),g=Qg(y,e),v=g!==m.id;return v&&(p[m.id]=g,delete _.entities[m.id]),_.entities[g]=y,v}function c(p,m){return d([p],m)}function d(p,m){var _={},b={};p.forEach(function(v){v.id in m.entities&&(b[v.id]={id:v.id,changes:Eo(Eo({},b[v.id]?b[v.id].changes:null),v.changes)})}),p=Object.values(b);var y=p.length>0;if(y){var g=p.filter(function(v){return u(_,v,m)}).length>0;g&&(m.ids=Object.keys(m.entities))}}function f(p,m){return h([p],m)}function h(p,m){var _=zL(p,e,m),b=_[0],y=_[1];d(y,m),n(b,m)}return{removeAll:_Z(l),addOne:wr(t),addMany:wr(n),setOne:wr(r),setMany:wr(i),setAll:wr(o),updateOne:wr(c),updateMany:wr(d),upsertOne:wr(f),upsertMany:wr(h),removeOne:wr(a),removeMany:wr(s)}}function SZ(e,t){var n=jL(e),r=n.removeOne,i=n.removeMany,o=n.removeAll;function a(y,g){return s([y],g)}function s(y,g){y=bd(y);var v=y.filter(function(S){return!(Qg(S,e)in g.entities)});v.length!==0&&_(v,g)}function l(y,g){return u([y],g)}function u(y,g){y=bd(y),y.length!==0&&_(y,g)}function c(y,g){y=bd(y),g.entities={},g.ids=[],s(y,g)}function d(y,g){return f([y],g)}function f(y,g){for(var v=!1,S=0,w=y;S<w.length;S++){var x=w[S],C=g.entities[x.id];if(C){v=!0,Object.assign(C,x.changes);var T=e(C);x.id!==T&&(delete g.entities[x.id],g.entities[T]=C)}}v&&b(g)}function h(y,g){return p([y],g)}function p(y,g){var v=zL(y,e,g),S=v[0],w=v[1];f(w,g),s(S,g)}function m(y,g){if(y.length!==g.length)return!1;for(var v=0;v<y.length&&v<g.length;v++)if(y[v]!==g[v])return!1;return!0}function _(y,g){y.forEach(function(v){g.entities[e(v)]=v}),b(g)}function b(y){var g=Object.values(y.entities);g.sort(t);var v=g.map(e),S=y.ids;m(S,v)||(y.ids=v)}return{removeOne:r,removeMany:i,removeAll:o,addOne:wr(a),updateOne:wr(d),upsertOne:wr(h),setOne:wr(l),setMany:wr(u),setAll:wr(c),addMany:wr(s),updateMany:wr(f),upsertMany:wr(p)}}function Ra(e){e===void 0&&(e={});var t=Eo({sortComparer:!1,selectId:function(s){return s.id}},e),n=t.selectId,r=t.sortComparer,i=vZ(),o=bZ(),a=r?SZ(n,r):jL(n);return Eo(Eo(Eo({selectId:n,sortComparer:r},i),o),a)}var xZ="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",VS=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=xZ[Math.random()*64|0];return t},wZ=["name","message","stack","code"],hC=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),A8=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),UL=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=wZ;n<r.length;n++){var i=r[n];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},Yb=function(){function e(t,n,r){var i=Ne(t+"/fulfilled",function(u,c,d,f){return{payload:u,meta:fC(Eo({},f||{}),{arg:d,requestId:c,requestStatus:"fulfilled"})}}),o=Ne(t+"/pending",function(u,c,d){return{payload:void 0,meta:fC(Eo({},d||{}),{arg:c,requestId:u,requestStatus:"pending"})}}),a=Ne(t+"/rejected",function(u,c,d,f,h){return{payload:f,error:(r&&r.serializeError||UL)(u||"Rejected"),meta:fC(Eo({},h||{}),{arg:d,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),s=typeof AbortController<"u"?AbortController:function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u}();function l(u){return function(c,d,f){var h=r!=null&&r.idGenerator?r.idGenerator(u):VS(),p=new s,m;function _(y){m=y,p.abort()}var b=function(){return sy(this,null,function(){var y,g,v,S,w,x,C;return ay(this,function(T){switch(T.label){case 0:return T.trys.push([0,4,,5]),S=(y=r==null?void 0:r.condition)==null?void 0:y.call(r,u,{getState:d,extra:f}),CZ(S)?[4,S]:[3,2];case 1:S=T.sent(),T.label=2;case 2:if(S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=new Promise(function(E,P){return p.signal.addEventListener("abort",function(){return P({name:"AbortError",message:m||"Aborted"})})}),c(o(h,u,(g=r==null?void 0:r.getPendingMeta)==null?void 0:g.call(r,{requestId:h,arg:u},{getState:d,extra:f}))),[4,Promise.race([w,Promise.resolve(n(u,{dispatch:c,getState:d,extra:f,requestId:h,signal:p.signal,abort:_,rejectWithValue:function(E,P){return new hC(E,P)},fulfillWithValue:function(E,P){return new A8(E,P)}})).then(function(E){if(E instanceof hC)throw E;return E instanceof A8?i(E.payload,h,u,E.meta):i(E,h,u)})])];case 3:return v=T.sent(),[3,5];case 4:return x=T.sent(),v=x instanceof hC?a(null,h,u,x.payload,x.meta):a(x,h,u),[3,5];case 5:return C=r&&!r.dispatchConditionRejection&&a.match(v)&&v.meta.condition,C||c(v),[2,v]}})})}();return Object.assign(b,{abort:_,requestId:h,arg:u,unwrap:function(){return b.then(VL)}})}}return Object.assign(l,{pending:o,rejected:a,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e}();function VL(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function CZ(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var AZ=function(e){return e&&typeof e.match=="function"},GL=function(e,t){return AZ(e)?e.match(t):e(t)};function Qi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.some(function(r){return GL(r,n)})}}function dh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.every(function(r){return GL(r,n)})}}function GS(e,t){if(!e||!e.meta)return!1;var n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function ly(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function qS(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return GS(n,["pending"])}:ly(e)?function(n){var r=e.map(function(o){return o.pending}),i=Qi.apply(void 0,r);return i(n)}:qS()(e[0])}function Kh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return GS(n,["rejected"])}:ly(e)?function(n){var r=e.map(function(o){return o.rejected}),i=Qi.apply(void 0,r);return i(n)}:Kh()(e[0])}function uy(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(r){return r&&r.meta&&r.meta.rejectedWithValue};return e.length===0?function(r){var i=dh(Kh.apply(void 0,e),n);return i(r)}:ly(e)?function(r){var i=dh(Kh.apply(void 0,e),n);return i(r)}:uy()(e[0])}function Ec(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return GS(n,["fulfilled"])}:ly(e)?function(n){var r=e.map(function(o){return o.fulfilled}),i=Qi.apply(void 0,r);return i(n)}:Ec()(e[0])}function Zb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return GS(n,["pending","fulfilled","rejected"])}:ly(e)?function(n){for(var r=[],i=0,o=e;i<o.length;i++){var a=o[i];r.push(a.pending,a.rejected,a.fulfilled)}var s=Qi.apply(void 0,r);return s(n)}:Zb()(e[0])}var uk=function(e,t){if(typeof e!="function")throw new TypeError(t+" is not a function")},eA=function(){},qL=function(e,t){return t===void 0&&(t=eA),e.catch(t),e},HL=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},fh=function(e,t){var n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},EZ="task",WL="listener",KL="completed",ck="cancelled",TZ="task-"+ck,kZ="task-"+KL,QL=WL+"-"+ck,PZ=WL+"-"+KL,cy=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=EZ+" "+ck+" (reason: "+t+")"}return e}(),hh=function(e){if(e.aborted)throw new cy(e.reason)};function XL(e,t){var n=eA;return new Promise(function(r,i){var o=function(){return i(new cy(e.reason))};if(e.aborted){o();return}n=HL(e,o),t.finally(function(){return n()}).then(r,i)}).finally(function(){n=eA})}var IZ=function(e,t){return sy(void 0,null,function(){var n,r;return ay(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return i.sent(),[4,e()];case 2:return n=i.sent(),[2,{status:"ok",value:n}];case 3:return r=i.sent(),[2,{status:r instanceof cy?"cancelled":"rejected",error:r}];case 4:return t==null||t(),[7];case 5:return[2]}})})},Jb=function(e){return function(t){return qL(XL(e,t).then(function(n){return hh(e),n}))}},YL=function(e){var t=Jb(e);return function(n){return t(new Promise(function(r){return setTimeout(r,n)}))}},RZ=Object.assign,E8={},dy="listenerMiddleware",OZ=function(e){var t=function(n){return HL(e,function(){return fh(n,e.reason)})};return function(n){uk(n,"taskExecutor");var r=new AbortController;t(r);var i=IZ(function(){return sy(void 0,null,function(){var o;return ay(this,function(a){switch(a.label){case 0:return hh(e),hh(r.signal),[4,n({pause:Jb(r.signal),delay:YL(r.signal),signal:r.signal})];case 1:return o=a.sent(),hh(r.signal),[2,o]}})})},function(){return fh(r,kZ)});return{result:Jb(e)(i),cancel:function(){fh(r,TZ)}}}},MZ=function(e,t){var n=function(r,i){return sy(void 0,null,function(){var o,a,s,l;return ay(this,function(u){switch(u.label){case 0:hh(t),o=function(){},a=new Promise(function(c,d){var f=e({predicate:r,effect:function(h,p){p.unsubscribe(),c([h,p.getState(),p.getOriginalState()])}});o=function(){f(),d()}}),s=[a],i!=null&&s.push(new Promise(function(c){return setTimeout(c,i,null)})),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,XL(t,Promise.race(s))];case 2:return l=u.sent(),hh(t),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(r,i){return qL(n(r,i))}},ZL=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(t)i=Ne(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return uk(o,"options.listener"),{predicate:i,type:t,effect:o}},$Z=function(e){var t=ZL(e),n=t.type,r=t.predicate,i=t.effect,o=VS(),a={id:o,effect:i,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return a},tA=function(e){e.pending.forEach(function(t){fh(t,QL)})},NZ=function(e){return function(){e.forEach(tA),e.clear()}},T8=function(e,t,n){try{e(t,n)}catch(r){setTimeout(function(){throw r},0)}},JL=Ne(dy+"/add"),eF=Ne(dy+"/removeAll"),tF=Ne(dy+"/remove"),DZ=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,lc([dy+"/error"],e))};function nF(e){var t=this;e===void 0&&(e={});var n=new Map,r=e.extra,i=e.onError,o=i===void 0?DZ:i;uk(o,"onError");var a=function(h){return h.unsubscribe=function(){return n.delete(h.id)},n.set(h.id,h),function(p){h.unsubscribe(),p!=null&&p.cancelActive&&tA(h)}},s=function(h){for(var p=0,m=Array.from(n.values());p<m.length;p++){var _=m[p];if(h(_))return _}},l=function(h){var p=s(function(m){return m.effect===h.effect});return p||(p=$Z(h)),a(p)},u=function(h){var p=ZL(h),m=p.type,_=p.effect,b=p.predicate,y=s(function(g){var v=typeof m=="string"?g.type===m:g.predicate===b;return v&&g.effect===_});return y&&(y.unsubscribe(),h.cancelActive&&tA(y)),!!y},c=function(h,p,m,_){return sy(t,null,function(){var b,y,g;return ay(this,function(v){switch(v.label){case 0:b=new AbortController,y=MZ(l,b.signal),v.label=1;case 1:return v.trys.push([1,3,4,5]),h.pending.add(b),[4,Promise.resolve(h.effect(p,RZ({},m,{getOriginalState:_,condition:function(S,w){return y(S,w).then(Boolean)},take:y,delay:YL(b.signal),pause:Jb(b.signal),extra:r,signal:b.signal,fork:OZ(b.signal),unsubscribe:h.unsubscribe,subscribe:function(){n.set(h.id,h)},cancelActiveListeners:function(){h.pending.forEach(function(S,w,x){S!==b&&(fh(S,QL),x.delete(S))})}})))];case 2:return v.sent(),[3,5];case 3:return g=v.sent(),g instanceof cy||T8(o,g,{raisedBy:"effect"}),[3,5];case 4:return fh(b,PZ),h.pending.delete(b),[7];case 5:return[2]}})})},d=NZ(n),f=function(h){return function(p){return function(m){if(!lk(m))return p(m);if(JL.match(m))return l(m.payload);if(eF.match(m)){d();return}if(tF.match(m))return u(m.payload);var _=h.getState(),b=function(){if(_===E8)throw new Error(dy+": getOriginalState can only be called synchronously");return _},y;try{if(y=p(m),n.size>0)for(var g=h.getState(),v=Array.from(n.values()),S=0,w=v;S<w.length;S++){var x=w[S],C=!1;try{C=x.predicate(m,g,_)}catch(T){C=!1,T8(o,T,{raisedBy:"predicate"})}C&&c(x,m,h,b)}}finally{_=E8}return y}}};return{middleware:f,startListening:l,stopListening:u,clearListeners:d}}var sd="RTK_autoBatch",U1=function(){return function(e){var t;return{payload:e,meta:(t={},t[sd]=!0,t)}}},k8,LZ=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(k8||(k8=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},rF=function(e){return function(t){setTimeout(t,e)}},FZ=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rF(10),iF=function(e){return e===void 0&&(e={type:"raf"}),function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.apply(void 0,n),o=!0,a=!1,s=!1,l=new Set,u=e.type==="tick"?LZ:e.type==="raf"?FZ:e.type==="callback"?e.queueNotification:rF(e.timeout),c=function(){s=!1,a&&(a=!1,l.forEach(function(d){return d()}))};return Object.assign({},i,{subscribe:function(d){var f=function(){return o&&d()},h=i.subscribe(f);return l.add(d),function(){h(),l.delete(d)}},dispatch:function(d){var f;try{return o=!((f=d==null?void 0:d.meta)!=null&&f[sd]),a=!o,a&&(s||(s=!0,u(c))),i.dispatch(d)}finally{o=!0}}})}}};rk();const BZ=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:RL,MiddlewareArray:IL,SHOULD_AUTOBATCH:sd,TaskAbortError:cy,__DO_NOT_USE__ActionTypes:Hh,addListener:JL,applyMiddleware:sk,autoBatchEnhancer:iF,bindActionCreators:CL,clearAllListeners:eF,combineReducers:_p,compose:Wh,configureStore:DL,createAction:Ne,createAsyncThunk:Yb,createDraftSafeSelector:bl,createEntityAdapter:Ra,createImmutableStateInvariantMiddleware:lZ,createListenerMiddleware:nF,createNextState:Ac,createReducer:BL,createSelector:Ii,createSerializableStateInvariantMiddleware:uZ,createSlice:nr,createStore:oy,current:jS,findNonSerializableValue:ML,freeze:iy,getDefaultMiddleware:NL,getType:pZ,isAction:lk,isAllOf:dh,isAnyOf:Qi,isAsyncThunkAction:Zb,isDraft:uo,isFluxStandardAction:LL,isFulfilled:Ec,isImmutableDefault:sZ,isPending:qS,isPlain:OL,isPlainObject:fs,isRejected:Kh,isRejectedWithValue:uy,legacy_createStore:wL,miniSerializeError:UL,nanoid:VS,original:JT,prepareAutoBatched:U1,removeListener:tF,unwrapResult:VL},Symbol.toStringTag,{value:"Module"})),yv=(e,t)=>Math.floor(e/t)*t,Ho=(e,t)=>Math.round(e/t)*t;var zZ=typeof global=="object"&&global&&global.Object===Object&&global;const oF=zZ;var jZ=typeof self=="object"&&self&&self.Object===Object&&self,UZ=oF||jZ||Function("return this")();const al=UZ;var VZ=al.Symbol;const ka=VZ;var aF=Object.prototype,GZ=aF.hasOwnProperty,qZ=aF.toString,Qp=ka?ka.toStringTag:void 0;function HZ(e){var t=GZ.call(e,Qp),n=e[Qp];try{e[Qp]=void 0;var r=!0}catch{}var i=qZ.call(e);return r&&(t?e[Qp]=n:delete e[Qp]),i}var WZ=Object.prototype,KZ=WZ.toString;function QZ(e){return KZ.call(e)}var XZ="[object Null]",YZ="[object Undefined]",P8=ka?ka.toStringTag:void 0;function ms(e){return e==null?e===void 0?YZ:XZ:P8&&P8 in Object(e)?HZ(e):QZ(e)}function Mo(e){return e!=null&&typeof e=="object"}var ZZ="[object Symbol]";function HS(e){return typeof e=="symbol"||Mo(e)&&ms(e)==ZZ}function sF(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var JZ=Array.isArray;const fi=JZ;var eJ=1/0,I8=ka?ka.prototype:void 0,R8=I8?I8.toString:void 0;function e_(e){if(typeof e=="string")return e;if(fi(e))return sF(e,e_)+"";if(HS(e))return R8?R8.call(e):"";var t=e+"";return t=="0"&&1/e==-eJ?"-0":t}var tJ=/\s/;function nJ(e){for(var t=e.length;t--&&tJ.test(e.charAt(t)););return t}var rJ=/^\s+/;function iJ(e){return e&&e.slice(0,nJ(e)+1).replace(rJ,"")}function $o(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var O8=0/0,oJ=/^[-+]0x[0-9a-f]+$/i,aJ=/^0b[01]+$/i,sJ=/^0o[0-7]+$/i,lJ=parseInt;function V1(e){if(typeof e=="number")return e;if(HS(e))return O8;if($o(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$o(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=iJ(e);var n=aJ.test(e);return n||sJ.test(e)?lJ(e.slice(2),n?2:8):oJ.test(e)?O8:+e}var M8=1/0,uJ=17976931348623157e292;function ph(e){if(!e)return e===0?e:0;if(e=V1(e),e===M8||e===-M8){var t=e<0?-1:1;return t*uJ}return e===e?e:0}function lF(e){var t=ph(e),n=t%1;return t===t?n?t-n:t:0}function WS(e){return e}var cJ="[object AsyncFunction]",dJ="[object Function]",fJ="[object GeneratorFunction]",hJ="[object Proxy]";function dk(e){if(!$o(e))return!1;var t=ms(e);return t==dJ||t==fJ||t==cJ||t==hJ}var pJ=al["__core-js_shared__"];const pC=pJ;var $8=function(){var e=/[^.]+$/.exec(pC&&pC.keys&&pC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function gJ(e){return!!$8&&$8 in e}var mJ=Function.prototype,yJ=mJ.toString;function Wd(e){if(e!=null){try{return yJ.call(e)}catch{}try{return e+""}catch{}}return""}var vJ=/[\\^$.*+?()[\]{}|]/g,bJ=/^\[object .+?Constructor\]$/,_J=Function.prototype,SJ=Object.prototype,xJ=_J.toString,wJ=SJ.hasOwnProperty,CJ=RegExp("^"+xJ.call(wJ).replace(vJ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function AJ(e){if(!$o(e)||gJ(e))return!1;var t=dk(e)?CJ:bJ;return t.test(Wd(e))}function EJ(e,t){return e==null?void 0:e[t]}function Kd(e,t){var n=EJ(e,t);return AJ(n)?n:void 0}var TJ=Kd(al,"WeakMap");const nA=TJ;var N8=Object.create,kJ=function(){function e(){}return function(t){if(!$o(t))return{};if(N8)return N8(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const PJ=kJ;function uF(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function IJ(){}function cF(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var RJ=800,OJ=16,MJ=Date.now;function $J(e){var t=0,n=0;return function(){var r=MJ(),i=OJ-(r-n);if(n=r,i>0){if(++t>=RJ)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function NJ(e){return function(){return e}}var DJ=function(){try{var e=Kd(Object,"defineProperty");return e({},"",{}),e}catch{}}();const t_=DJ;var LJ=t_?function(e,t){return t_(e,"toString",{configurable:!0,enumerable:!1,value:NJ(t),writable:!0})}:WS;const FJ=LJ;var BJ=$J(FJ);const dF=BJ;function fF(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function zJ(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function jJ(e){return e!==e}function UJ(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function VJ(e,t,n){return t===t?UJ(e,t,n):zJ(e,jJ,n)}function GJ(e,t){var n=e==null?0:e.length;return!!n&&VJ(e,t,0)>-1}var qJ=9007199254740991,HJ=/^(?:0|[1-9]\d*)$/;function fk(e,t){var n=typeof e;return t=t??qJ,!!t&&(n=="number"||n!="symbol"&&HJ.test(e))&&e>-1&&e%1==0&&e<t}function KS(e,t,n){t=="__proto__"&&t_?t_(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function fy(e,t){return e===t||e!==e&&t!==t}var WJ=Object.prototype,KJ=WJ.hasOwnProperty;function hF(e,t,n){var r=e[t];(!(KJ.call(e,t)&&fy(r,n))||n===void 0&&!(t in e))&&KS(e,t,n)}function Sp(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?KS(n,s,l):hF(n,s,l)}return n}var D8=Math.max;function pF(e,t,n){return t=D8(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=D8(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),uF(e,this,s)}}function gF(e,t){return dF(pF(e,t,WS),e+"")}var QJ=9007199254740991;function hk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=QJ}function xp(e){return e!=null&&hk(e.length)&&!dk(e)}function QS(e,t,n){if(!$o(n))return!1;var r=typeof t;return(r=="number"?xp(n)&&fk(t,n.length):r=="string"&&t in n)?fy(n[t],e):!1}function mF(e){return gF(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&QS(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var XJ=Object.prototype;function pk(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||XJ;return e===n}function YJ(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ZJ="[object Arguments]";function L8(e){return Mo(e)&&ms(e)==ZJ}var yF=Object.prototype,JJ=yF.hasOwnProperty,eee=yF.propertyIsEnumerable,tee=L8(function(){return arguments}())?L8:function(e){return Mo(e)&&JJ.call(e,"callee")&&!eee.call(e,"callee")};const Bm=tee;function nee(){return!1}var vF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,F8=vF&&typeof module=="object"&&module&&!module.nodeType&&module,ree=F8&&F8.exports===vF,B8=ree?al.Buffer:void 0,iee=B8?B8.isBuffer:void 0,oee=iee||nee;const zm=oee;var aee="[object Arguments]",see="[object Array]",lee="[object Boolean]",uee="[object Date]",cee="[object Error]",dee="[object Function]",fee="[object Map]",hee="[object Number]",pee="[object Object]",gee="[object RegExp]",mee="[object Set]",yee="[object String]",vee="[object WeakMap]",bee="[object ArrayBuffer]",_ee="[object DataView]",See="[object Float32Array]",xee="[object Float64Array]",wee="[object Int8Array]",Cee="[object Int16Array]",Aee="[object Int32Array]",Eee="[object Uint8Array]",Tee="[object Uint8ClampedArray]",kee="[object Uint16Array]",Pee="[object Uint32Array]",Gn={};Gn[See]=Gn[xee]=Gn[wee]=Gn[Cee]=Gn[Aee]=Gn[Eee]=Gn[Tee]=Gn[kee]=Gn[Pee]=!0;Gn[aee]=Gn[see]=Gn[bee]=Gn[lee]=Gn[_ee]=Gn[uee]=Gn[cee]=Gn[dee]=Gn[fee]=Gn[hee]=Gn[pee]=Gn[gee]=Gn[mee]=Gn[yee]=Gn[vee]=!1;function Iee(e){return Mo(e)&&hk(e.length)&&!!Gn[ms(e)]}function XS(e){return function(t){return e(t)}}var bF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xg=bF&&typeof module=="object"&&module&&!module.nodeType&&module,Ree=Xg&&Xg.exports===bF,gC=Ree&&oF.process,Oee=function(){try{var e=Xg&&Xg.require&&Xg.require("util").types;return e||gC&&gC.binding&&gC.binding("util")}catch{}}();const uc=Oee;var z8=uc&&uc.isTypedArray,Mee=z8?XS(z8):Iee;const gk=Mee;var $ee=Object.prototype,Nee=$ee.hasOwnProperty;function _F(e,t){var n=fi(e),r=!n&&Bm(e),i=!n&&!r&&zm(e),o=!n&&!r&&!i&&gk(e),a=n||r||i||o,s=a?YJ(e.length,String):[],l=s.length;for(var u in e)(t||Nee.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||fk(u,l)))&&s.push(u);return s}function SF(e,t){return function(n){return e(t(n))}}var Dee=SF(Object.keys,Object);const Lee=Dee;var Fee=Object.prototype,Bee=Fee.hasOwnProperty;function xF(e){if(!pk(e))return Lee(e);var t=[];for(var n in Object(e))Bee.call(e,n)&&n!="constructor"&&t.push(n);return t}function hy(e){return xp(e)?_F(e):xF(e)}function zee(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var jee=Object.prototype,Uee=jee.hasOwnProperty;function Vee(e){if(!$o(e))return zee(e);var t=pk(e),n=[];for(var r in e)r=="constructor"&&(t||!Uee.call(e,r))||n.push(r);return n}function py(e){return xp(e)?_F(e,!0):Vee(e)}var Gee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qee=/^\w*$/;function mk(e,t){if(fi(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||HS(e)?!0:qee.test(e)||!Gee.test(e)||t!=null&&e in Object(t)}var Hee=Kd(Object,"create");const jm=Hee;function Wee(){this.__data__=jm?jm(null):{},this.size=0}function Kee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Qee="__lodash_hash_undefined__",Xee=Object.prototype,Yee=Xee.hasOwnProperty;function Zee(e){var t=this.__data__;if(jm){var n=t[e];return n===Qee?void 0:n}return Yee.call(t,e)?t[e]:void 0}var Jee=Object.prototype,ete=Jee.hasOwnProperty;function tte(e){var t=this.__data__;return jm?t[e]!==void 0:ete.call(t,e)}var nte="__lodash_hash_undefined__";function rte(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jm&&t===void 0?nte:t,this}function Md(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Md.prototype.clear=Wee;Md.prototype.delete=Kee;Md.prototype.get=Zee;Md.prototype.has=tte;Md.prototype.set=rte;function ite(){this.__data__=[],this.size=0}function YS(e,t){for(var n=e.length;n--;)if(fy(e[n][0],t))return n;return-1}var ote=Array.prototype,ate=ote.splice;function ste(e){var t=this.__data__,n=YS(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ate.call(t,n,1),--this.size,!0}function lte(e){var t=this.__data__,n=YS(t,e);return n<0?void 0:t[n][1]}function ute(e){return YS(this.__data__,e)>-1}function cte(e,t){var n=this.__data__,r=YS(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ru(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ru.prototype.clear=ite;ru.prototype.delete=ste;ru.prototype.get=lte;ru.prototype.has=ute;ru.prototype.set=cte;var dte=Kd(al,"Map");const Um=dte;function fte(){this.size=0,this.__data__={hash:new Md,map:new(Um||ru),string:new Md}}function hte(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ZS(e,t){var n=e.__data__;return hte(t)?n[typeof t=="string"?"string":"hash"]:n.map}function pte(e){var t=ZS(this,e).delete(e);return this.size-=t?1:0,t}function gte(e){return ZS(this,e).get(e)}function mte(e){return ZS(this,e).has(e)}function yte(e,t){var n=ZS(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function iu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}iu.prototype.clear=fte;iu.prototype.delete=pte;iu.prototype.get=gte;iu.prototype.has=mte;iu.prototype.set=yte;var vte="Expected a function";function yk(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(vte);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(yk.Cache||iu),n}yk.Cache=iu;var bte=500;function _te(e){var t=yk(e,function(r){return n.size===bte&&n.clear(),r}),n=t.cache;return t}var Ste=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xte=/\\(\\)?/g,wte=_te(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ste,function(n,r,i,o){t.push(i?o.replace(xte,"$1"):r||n)}),t});const Cte=wte;function Qh(e){return e==null?"":e_(e)}function JS(e,t){return fi(e)?e:mk(e,t)?[e]:Cte(Qh(e))}var Ate=1/0;function gy(e){if(typeof e=="string"||HS(e))return e;var t=e+"";return t=="0"&&1/e==-Ate?"-0":t}function vk(e,t){t=JS(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[gy(t[n++])];return n&&n==r?e:void 0}function gh(e,t,n){var r=e==null?void 0:vk(e,t);return r===void 0?n:r}function bk(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var j8=ka?ka.isConcatSpreadable:void 0;function Ete(e){return fi(e)||Bm(e)||!!(j8&&e&&e[j8])}function wF(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=Ete),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?wF(s,t-1,n,r,i):bk(i,s):r||(i[i.length]=s)}return i}function Tte(e){var t=e==null?0:e.length;return t?wF(e,1):[]}function kte(e){return dF(pF(e,void 0,Tte),e+"")}var Pte=SF(Object.getPrototypeOf,Object);const _k=Pte;var Ite="[object Object]",Rte=Function.prototype,Ote=Object.prototype,CF=Rte.toString,Mte=Ote.hasOwnProperty,$te=CF.call(Object);function AF(e){if(!Mo(e)||ms(e)!=Ite)return!1;var t=_k(e);if(t===null)return!0;var n=Mte.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&CF.call(n)==$te}function EF(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function TF(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:EF(e,t,n)}var Nte="\\ud800-\\udfff",Dte="\\u0300-\\u036f",Lte="\\ufe20-\\ufe2f",Fte="\\u20d0-\\u20ff",Bte=Dte+Lte+Fte,zte="\\ufe0e\\ufe0f",jte="\\u200d",Ute=RegExp("["+jte+Nte+Bte+zte+"]");function e2(e){return Ute.test(e)}function Vte(e){return e.split("")}var kF="\\ud800-\\udfff",Gte="\\u0300-\\u036f",qte="\\ufe20-\\ufe2f",Hte="\\u20d0-\\u20ff",Wte=Gte+qte+Hte,Kte="\\ufe0e\\ufe0f",Qte="["+kF+"]",rA="["+Wte+"]",iA="\\ud83c[\\udffb-\\udfff]",Xte="(?:"+rA+"|"+iA+")",PF="[^"+kF+"]",IF="(?:\\ud83c[\\udde6-\\uddff]){2}",RF="[\\ud800-\\udbff][\\udc00-\\udfff]",Yte="\\u200d",OF=Xte+"?",MF="["+Kte+"]?",Zte="(?:"+Yte+"(?:"+[PF,IF,RF].join("|")+")"+MF+OF+")*",Jte=MF+OF+Zte,ene="(?:"+[PF+rA+"?",rA,IF,RF,Qte].join("|")+")",tne=RegExp(iA+"(?="+iA+")|"+ene+Jte,"g");function nne(e){return e.match(tne)||[]}function $F(e){return e2(e)?nne(e):Vte(e)}function rne(e){return function(t){t=Qh(t);var n=e2(t)?$F(t):void 0,r=n?n[0]:t.charAt(0),i=n?TF(n,1).join(""):t.slice(1);return r[e]()+i}}var ine=rne("toUpperCase");const NF=ine;function DF(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function one(e){return function(t){return e==null?void 0:e[t]}}var ane={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},sne=one(ane);const lne=sne;var une=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cne="\\u0300-\\u036f",dne="\\ufe20-\\ufe2f",fne="\\u20d0-\\u20ff",hne=cne+dne+fne,pne="["+hne+"]",gne=RegExp(pne,"g");function mne(e){return e=Qh(e),e&&e.replace(une,lne).replace(gne,"")}var yne=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function vne(e){return e.match(yne)||[]}var bne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function _ne(e){return bne.test(e)}var LF="\\ud800-\\udfff",Sne="\\u0300-\\u036f",xne="\\ufe20-\\ufe2f",wne="\\u20d0-\\u20ff",Cne=Sne+xne+wne,FF="\\u2700-\\u27bf",BF="a-z\\xdf-\\xf6\\xf8-\\xff",Ane="\\xac\\xb1\\xd7\\xf7",Ene="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Tne="\\u2000-\\u206f",kne=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zF="A-Z\\xc0-\\xd6\\xd8-\\xde",Pne="\\ufe0e\\ufe0f",jF=Ane+Ene+Tne+kne,UF="['’]",U8="["+jF+"]",Ine="["+Cne+"]",VF="\\d+",Rne="["+FF+"]",GF="["+BF+"]",qF="[^"+LF+jF+VF+FF+BF+zF+"]",One="\\ud83c[\\udffb-\\udfff]",Mne="(?:"+Ine+"|"+One+")",$ne="[^"+LF+"]",HF="(?:\\ud83c[\\udde6-\\uddff]){2}",WF="[\\ud800-\\udbff][\\udc00-\\udfff]",kf="["+zF+"]",Nne="\\u200d",V8="(?:"+GF+"|"+qF+")",Dne="(?:"+kf+"|"+qF+")",G8="(?:"+UF+"(?:d|ll|m|re|s|t|ve))?",q8="(?:"+UF+"(?:D|LL|M|RE|S|T|VE))?",KF=Mne+"?",QF="["+Pne+"]?",Lne="(?:"+Nne+"(?:"+[$ne,HF,WF].join("|")+")"+QF+KF+")*",Fne="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bne="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",zne=QF+KF+Lne,jne="(?:"+[Rne,HF,WF].join("|")+")"+zne,Une=RegExp([kf+"?"+GF+"+"+G8+"(?="+[U8,kf,"$"].join("|")+")",Dne+"+"+q8+"(?="+[U8,kf+V8,"$"].join("|")+")",kf+"?"+V8+"+"+G8,kf+"+"+q8,Bne,Fne,VF,jne].join("|"),"g");function Vne(e){return e.match(Une)||[]}function Gne(e,t,n){return e=Qh(e),t=n?void 0:t,t===void 0?_ne(e)?Vne(e):vne(e):e.match(t)||[]}var qne="['’]",Hne=RegExp(qne,"g");function Wne(e){return function(t){return DF(Gne(mne(t).replace(Hne,"")),e,"")}}function Kne(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Bu(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=V1(n),n=n===n?n:0),t!==void 0&&(t=V1(t),t=t===t?t:0),Kne(V1(e),t,n)}function Qne(){this.__data__=new ru,this.size=0}function Xne(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Yne(e){return this.__data__.get(e)}function Zne(e){return this.__data__.has(e)}var Jne=200;function ere(e,t){var n=this.__data__;if(n instanceof ru){var r=n.__data__;if(!Um||r.length<Jne-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new iu(r)}return n.set(e,t),this.size=n.size,this}function ss(e){var t=this.__data__=new ru(e);this.size=t.size}ss.prototype.clear=Qne;ss.prototype.delete=Xne;ss.prototype.get=Yne;ss.prototype.has=Zne;ss.prototype.set=ere;function tre(e,t){return e&&Sp(t,hy(t),e)}function nre(e,t){return e&&Sp(t,py(t),e)}var XF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,H8=XF&&typeof module=="object"&&module&&!module.nodeType&&module,rre=H8&&H8.exports===XF,W8=rre?al.Buffer:void 0,K8=W8?W8.allocUnsafe:void 0;function YF(e,t){if(t)return e.slice();var n=e.length,r=K8?K8(n):new e.constructor(n);return e.copy(r),r}function ire(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function ZF(){return[]}var ore=Object.prototype,are=ore.propertyIsEnumerable,Q8=Object.getOwnPropertySymbols,sre=Q8?function(e){return e==null?[]:(e=Object(e),ire(Q8(e),function(t){return are.call(e,t)}))}:ZF;const Sk=sre;function lre(e,t){return Sp(e,Sk(e),t)}var ure=Object.getOwnPropertySymbols,cre=ure?function(e){for(var t=[];e;)bk(t,Sk(e)),e=_k(e);return t}:ZF;const JF=cre;function dre(e,t){return Sp(e,JF(e),t)}function eB(e,t,n){var r=t(e);return fi(e)?r:bk(r,n(e))}function oA(e){return eB(e,hy,Sk)}function tB(e){return eB(e,py,JF)}var fre=Kd(al,"DataView");const aA=fre;var hre=Kd(al,"Promise");const sA=hre;var pre=Kd(al,"Set");const mh=pre;var X8="[object Map]",gre="[object Object]",Y8="[object Promise]",Z8="[object Set]",J8="[object WeakMap]",eI="[object DataView]",mre=Wd(aA),yre=Wd(Um),vre=Wd(sA),bre=Wd(mh),_re=Wd(nA),Wc=ms;(aA&&Wc(new aA(new ArrayBuffer(1)))!=eI||Um&&Wc(new Um)!=X8||sA&&Wc(sA.resolve())!=Y8||mh&&Wc(new mh)!=Z8||nA&&Wc(new nA)!=J8)&&(Wc=function(e){var t=ms(e),n=t==gre?e.constructor:void 0,r=n?Wd(n):"";if(r)switch(r){case mre:return eI;case yre:return X8;case vre:return Y8;case bre:return Z8;case _re:return J8}return t});const Xh=Wc;var Sre=Object.prototype,xre=Sre.hasOwnProperty;function wre(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&xre.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Cre=al.Uint8Array;const n_=Cre;function xk(e){var t=new e.constructor(e.byteLength);return new n_(t).set(new n_(e)),t}function Are(e,t){var n=t?xk(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ere=/\w*$/;function Tre(e){var t=new e.constructor(e.source,Ere.exec(e));return t.lastIndex=e.lastIndex,t}var tI=ka?ka.prototype:void 0,nI=tI?tI.valueOf:void 0;function kre(e){return nI?Object(nI.call(e)):{}}function nB(e,t){var n=t?xk(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Pre="[object Boolean]",Ire="[object Date]",Rre="[object Map]",Ore="[object Number]",Mre="[object RegExp]",$re="[object Set]",Nre="[object String]",Dre="[object Symbol]",Lre="[object ArrayBuffer]",Fre="[object DataView]",Bre="[object Float32Array]",zre="[object Float64Array]",jre="[object Int8Array]",Ure="[object Int16Array]",Vre="[object Int32Array]",Gre="[object Uint8Array]",qre="[object Uint8ClampedArray]",Hre="[object Uint16Array]",Wre="[object Uint32Array]";function Kre(e,t,n){var r=e.constructor;switch(t){case Lre:return xk(e);case Pre:case Ire:return new r(+e);case Fre:return Are(e,n);case Bre:case zre:case jre:case Ure:case Vre:case Gre:case qre:case Hre:case Wre:return nB(e,n);case Rre:return new r;case Ore:case Nre:return new r(e);case Mre:return Tre(e);case $re:return new r;case Dre:return kre(e)}}function rB(e){return typeof e.constructor=="function"&&!pk(e)?PJ(_k(e)):{}}var Qre="[object Map]";function Xre(e){return Mo(e)&&Xh(e)==Qre}var rI=uc&&uc.isMap,Yre=rI?XS(rI):Xre;const Zre=Yre;var Jre="[object Set]";function eie(e){return Mo(e)&&Xh(e)==Jre}var iI=uc&&uc.isSet,tie=iI?XS(iI):eie;const nie=tie;var rie=1,iie=2,oie=4,iB="[object Arguments]",aie="[object Array]",sie="[object Boolean]",lie="[object Date]",uie="[object Error]",oB="[object Function]",cie="[object GeneratorFunction]",die="[object Map]",fie="[object Number]",aB="[object Object]",hie="[object RegExp]",pie="[object Set]",gie="[object String]",mie="[object Symbol]",yie="[object WeakMap]",vie="[object ArrayBuffer]",bie="[object DataView]",_ie="[object Float32Array]",Sie="[object Float64Array]",xie="[object Int8Array]",wie="[object Int16Array]",Cie="[object Int32Array]",Aie="[object Uint8Array]",Eie="[object Uint8ClampedArray]",Tie="[object Uint16Array]",kie="[object Uint32Array]",Rn={};Rn[iB]=Rn[aie]=Rn[vie]=Rn[bie]=Rn[sie]=Rn[lie]=Rn[_ie]=Rn[Sie]=Rn[xie]=Rn[wie]=Rn[Cie]=Rn[die]=Rn[fie]=Rn[aB]=Rn[hie]=Rn[pie]=Rn[gie]=Rn[mie]=Rn[Aie]=Rn[Eie]=Rn[Tie]=Rn[kie]=!0;Rn[uie]=Rn[oB]=Rn[yie]=!1;function Yg(e,t,n,r,i,o){var a,s=t&rie,l=t&iie,u=t&oie;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!$o(e))return e;var c=fi(e);if(c){if(a=wre(e),!s)return cF(e,a)}else{var d=Xh(e),f=d==oB||d==cie;if(zm(e))return YF(e,s);if(d==aB||d==iB||f&&!i){if(a=l||f?{}:rB(e),!s)return l?dre(e,nre(a,e)):lre(e,tre(a,e))}else{if(!Rn[d])return i?e:{};a=Kre(e,d,s)}}o||(o=new ss);var h=o.get(e);if(h)return h;o.set(e,a),nie(e)?e.forEach(function(_){a.add(Yg(_,t,n,_,e,o))}):Zre(e)&&e.forEach(function(_,b){a.set(b,Yg(_,t,n,b,e,o))});var p=u?l?tB:oA:l?py:hy,m=c?void 0:p(e);return fF(m||e,function(_,b){m&&(b=_,_=e[b]),hF(a,b,Yg(_,t,n,b,e,o))}),a}var Pie=1,Iie=4;function Ut(e){return Yg(e,Pie|Iie)}var Rie="__lodash_hash_undefined__";function Oie(e){return this.__data__.set(e,Rie),this}function Mie(e){return this.__data__.has(e)}function Vm(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new iu;++t<n;)this.add(e[t])}Vm.prototype.add=Vm.prototype.push=Oie;Vm.prototype.has=Mie;function sB(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function lB(e,t){return e.has(t)}var $ie=1,Nie=2;function uB(e,t,n,r,i,o){var a=n&$ie,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=n&Nie?new Vm:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var p=e[d],m=t[d];if(r)var _=a?r(m,p,d,t,e,o):r(p,m,d,e,t,o);if(_!==void 0){if(_)continue;f=!1;break}if(h){if(!sB(t,function(b,y){if(!lB(h,y)&&(p===b||i(p,b,n,r,o)))return h.push(y)})){f=!1;break}}else if(!(p===m||i(p,m,n,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Die(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function wk(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Lie=1,Fie=2,Bie="[object Boolean]",zie="[object Date]",jie="[object Error]",Uie="[object Map]",Vie="[object Number]",Gie="[object RegExp]",qie="[object Set]",Hie="[object String]",Wie="[object Symbol]",Kie="[object ArrayBuffer]",Qie="[object DataView]",oI=ka?ka.prototype:void 0,mC=oI?oI.valueOf:void 0;function Xie(e,t,n,r,i,o,a){switch(n){case Qie:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Kie:return!(e.byteLength!=t.byteLength||!o(new n_(e),new n_(t)));case Bie:case zie:case Vie:return fy(+e,+t);case jie:return e.name==t.name&&e.message==t.message;case Gie:case Hie:return e==t+"";case Uie:var s=Die;case qie:var l=r&Lie;if(s||(s=wk),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=Fie,a.set(e,t);var c=uB(s(e),s(t),r,i,o,a);return a.delete(e),c;case Wie:if(mC)return mC.call(e)==mC.call(t)}return!1}var Yie=1,Zie=Object.prototype,Jie=Zie.hasOwnProperty;function eoe(e,t,n,r,i,o){var a=n&Yie,s=oA(e),l=s.length,u=oA(t),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in t:Jie.call(t,f)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var _=a;++d<l;){f=s[d];var b=e[f],y=t[f];if(r)var g=a?r(y,b,f,t,e,o):r(b,y,f,e,t,o);if(!(g===void 0?b===y||i(b,y,n,r,o):g)){m=!1;break}_||(_=f=="constructor")}if(m&&!_){var v=e.constructor,S=t.constructor;v!=S&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return o.delete(e),o.delete(t),m}var toe=1,aI="[object Arguments]",sI="[object Array]",vv="[object Object]",noe=Object.prototype,lI=noe.hasOwnProperty;function roe(e,t,n,r,i,o){var a=fi(e),s=fi(t),l=a?sI:Xh(e),u=s?sI:Xh(t);l=l==aI?vv:l,u=u==aI?vv:u;var c=l==vv,d=u==vv,f=l==u;if(f&&zm(e)){if(!zm(t))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new ss),a||gk(e)?uB(e,t,n,r,i,o):Xie(e,t,l,n,r,i,o);if(!(n&toe)){var h=c&&lI.call(e,"__wrapped__"),p=d&&lI.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,_=p?t.value():t;return o||(o=new ss),i(m,_,n,r,o)}}return f?(o||(o=new ss),eoe(e,t,n,r,i,o)):!1}function t2(e,t,n,r,i){return e===t?!0:e==null||t==null||!Mo(e)&&!Mo(t)?e!==e&&t!==t:roe(e,t,n,r,t2,i)}var ioe=1,ooe=2;function aoe(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],u=e[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in e))return!1}else{var d=new ss;if(r)var f=r(u,c,l,e,t,d);if(!(f===void 0?t2(c,u,ioe|ooe,r,d):f))return!1}}return!0}function cB(e){return e===e&&!$o(e)}function soe(e){for(var t=hy(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,cB(i)]}return t}function dB(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function loe(e){var t=soe(e);return t.length==1&&t[0][2]?dB(t[0][0],t[0][1]):function(n){return n===e||aoe(n,e,t)}}function uoe(e,t){return e!=null&&t in Object(e)}function fB(e,t,n){t=JS(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=gy(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&hk(i)&&fk(a,i)&&(fi(e)||Bm(e)))}function coe(e,t){return e!=null&&fB(e,t,uoe)}var doe=1,foe=2;function hoe(e,t){return mk(e)&&cB(t)?dB(gy(e),t):function(n){var r=gh(n,e);return r===void 0&&r===t?coe(n,e):t2(t,r,doe|foe)}}function hB(e){return function(t){return t==null?void 0:t[e]}}function poe(e){return function(t){return vk(t,e)}}function goe(e){return mk(e)?hB(gy(e)):poe(e)}function n2(e){return typeof e=="function"?e:e==null?WS:typeof e=="object"?fi(e)?hoe(e[0],e[1]):loe(e):goe(e)}function moe(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function yoe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(n(o[l],l,o)===!1)break}return t}}var voe=yoe();const pB=voe;function boe(e,t){return e&&pB(e,t,hy)}function _oe(e,t){return function(n,r){if(n==null)return n;if(!xp(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var Soe=_oe(boe);const r2=Soe;function xoe(e,t,n,r){return r2(e,function(i,o,a){t(r,i,n(i),a)}),r}function woe(e,t){return function(n,r){var i=fi(n)?moe:xoe,o=t?t():{};return i(n,e,n2(r),o)}}function lA(e,t,n){(n!==void 0&&!fy(e[t],n)||n===void 0&&!(t in e))&&KS(e,t,n)}function Coe(e){return Mo(e)&&xp(e)}function uA(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Aoe(e){return Sp(e,py(e))}function Eoe(e,t,n,r,i,o,a){var s=uA(e,n),l=uA(t,n),u=a.get(l);if(u){lA(e,n,u);return}var c=o?o(s,l,n+"",e,t,a):void 0,d=c===void 0;if(d){var f=fi(l),h=!f&&zm(l),p=!f&&!h&&gk(l);c=l,f||h||p?fi(s)?c=s:Coe(s)?c=cF(s):h?(d=!1,c=YF(l,!0)):p?(d=!1,c=nB(l,!0)):c=[]:AF(l)||Bm(l)?(c=s,Bm(s)?c=Aoe(s):(!$o(s)||dk(s))&&(c=rB(l))):d=!1}d&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),lA(e,n,c)}function i2(e,t,n,r,i){e!==t&&pB(t,function(o,a){if(i||(i=new ss),$o(o))Eoe(e,t,a,n,i2,r,i);else{var s=r?r(uA(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),lA(e,a,s)}},py)}function gB(e,t,n,r,i,o){return $o(e)&&$o(t)&&(o.set(t,e),i2(e,t,void 0,gB,o),o.delete(t)),e}var Toe=mF(function(e,t,n,r){i2(e,t,n,r)});const koe=Toe;var Poe=gF(function(e){return e.push(void 0,gB),uF(koe,void 0,e)});const Ioe=Poe;function Roe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Ooe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Moe(e){return typeof e=="function"?e:WS}function Xl(e,t){var n=fi(e)?fF:r2;return n(e,Moe(t))}var $oe=Object.prototype,Noe=$oe.hasOwnProperty;function Doe(e,t){return e!=null&&Noe.call(e,t)}function Loe(e,t){return e!=null&&fB(e,t,Doe)}var Foe="[object String]";function Ck(e){return typeof e=="string"||!fi(e)&&Mo(e)&&ms(e)==Foe}function Boe(e,t){return t.length<2?e:vk(e,EF(t,0,-1))}var zoe="[object Boolean]";function joe(e){return e===!0||e===!1||Mo(e)&&ms(e)==zoe}function Ak(e,t){return t2(e,t)}function Uoe(e){return typeof e=="number"&&e==lF(e)}var Voe="[object Number]";function mB(e){return typeof e=="number"||Mo(e)&&ms(e)==Voe}var Goe="[object RegExp]";function qoe(e){return Mo(e)&&ms(e)==Goe}var uI=uc&&uc.isRegExp,Hoe=uI?XS(uI):qoe;const Woe=Hoe;var Koe=woe(function(e,t,n){KS(e,n,t)});const Ek=Koe;var Qoe=mF(function(e,t,n){i2(e,t,n)});const yh=Qoe;function yB(e,t){return t=JS(t,e),e=Boe(e,t),e==null||delete e[gy(Ooe(t))]}function Xoe(e){return AF(e)?void 0:e}var Yoe=1,Zoe=2,Joe=4,eae=kte(function(e,t){var n={};if(e==null)return n;var r=!1;t=sF(t,function(o){return o=JS(o,e),r||(r=o.length>1),o}),Sp(e,tB(e),n),r&&(n=Yg(n,Yoe|Zoe|Joe,Xoe));for(var i=t.length;i--;)yB(n,t[i]);return n});const my=eae;var tae=hB("length");const nae=tae;var vB="\\ud800-\\udfff",rae="\\u0300-\\u036f",iae="\\ufe20-\\ufe2f",oae="\\u20d0-\\u20ff",aae=rae+iae+oae,sae="\\ufe0e\\ufe0f",lae="["+vB+"]",cA="["+aae+"]",dA="\\ud83c[\\udffb-\\udfff]",uae="(?:"+cA+"|"+dA+")",bB="[^"+vB+"]",_B="(?:\\ud83c[\\udde6-\\uddff]){2}",SB="[\\ud800-\\udbff][\\udc00-\\udfff]",cae="\\u200d",xB=uae+"?",wB="["+sae+"]?",dae="(?:"+cae+"(?:"+[bB,_B,SB].join("|")+")"+wB+xB+")*",fae=wB+xB+dae,hae="(?:"+[bB+cA+"?",cA,_B,SB,lae].join("|")+")",cI=RegExp(dA+"(?="+dA+")|"+hae+fae,"g");function pae(e){for(var t=cI.lastIndex=0;cI.test(e);)++t;return t}function CB(e){return e2(e)?pae(e):nae(e)}var gae=Math.floor,mae=Math.random;function yae(e,t){return e+gae(mae()*(t-e+1))}var vae=parseFloat,bae=Math.min,_ae=Math.random;function Sae(e,t,n){if(n&&typeof n!="boolean"&&QS(e,t,n)&&(t=n=void 0),n===void 0&&(typeof t=="boolean"?(n=t,t=void 0):typeof e=="boolean"&&(n=e,e=void 0)),e===void 0&&t===void 0?(e=0,t=1):(e=ph(e),t===void 0?(t=e,e=0):t=ph(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=_ae();return bae(e+i*(t-e+vae("1e-"+((i+"").length-1))),t)}return yae(e,t)}var xae=Math.ceil,wae=Math.max;function Cae(e,t,n,r){for(var i=-1,o=wae(xae((t-e)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=n;return a}function Aae(e){return function(t,n,r){return r&&typeof r!="number"&&QS(t,n,r)&&(n=r=void 0),t=ph(t),n===void 0?(n=t,t=0):n=ph(n),r=r===void 0?t<n?1:-1:ph(r),Cae(t,n,r,e)}}var Eae=Aae();const Tae=Eae;function kae(e,t,n,r,i){return i(e,function(o,a,s){n=r?(r=!1,o):t(n,o,a,s)}),n}function fA(e,t,n){var r=fi(e)?DF:kae,i=arguments.length<3;return r(e,n2(t),n,i,r2)}var Pae="[object Map]",Iae="[object Set]";function o2(e){if(e==null)return 0;if(xp(e))return Ck(e)?CB(e):e.length;var t=Xh(e);return t==Pae||t==Iae?e.size:xF(e).length}function Rae(e,t){var n;return r2(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function Pf(e,t,n){var r=fi(e)?sB:Rae;return n&&QS(e,t,n)&&(t=void 0),r(e,n2(t))}var Oae=Wne(function(e,t,n){return e+(n?" ":"")+NF(t)});const Mae=Oae;var $ae=30,Nae="...",Dae=/\w*$/;function dI(e,t){var n=$ae,r=Nae;if($o(t)){var i="separator"in t?t.separator:i;n="length"in t?lF(t.length):n,r="omission"in t?e_(t.omission):r}e=Qh(e);var o=e.length;if(e2(e)){var a=$F(e);o=a.length}if(n>=o)return e;var s=n-CB(r);if(s<1)return r;var l=a?TF(a,0,s).join(""):e.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),Woe(i)){if(e.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Qh(Dae.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(e.indexOf(e_(i),s)!=s){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}var Lae=1/0,Fae=mh&&1/wk(new mh([,-0]))[1]==Lae?function(e){return new mh(e)}:IJ;const Bae=Fae;var zae=200;function AB(e,t,n){var r=-1,i=GJ,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Roe;else if(o>=zae){var u=t?null:Bae(e);if(u)return wk(u);a=!1,i=lB,l=new Vm}else l=t?[]:s;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}function jae(e){return e&&e.length?AB(e):[]}function hA(e,t){return e&&e.length?AB(e,n2(t)):[]}function fI(e,t){return e==null?!0:yB(e,t)}const EB={shouldUpdateImagesOnConnect:!1,shouldFetchMetadataFromApi:!1,disabledTabs:[],disabledFeatures:["lightbox","faceRestore","batches","bulkDownload"],disabledSDFeatures:["variation","symmetry","hires","perlinNoise","noiseThreshold"],nodesAllowlist:void 0,nodesDenylist:void 0,canRestoreDeletedImagesFromBin:!0,sd:{disabledControlNetModels:[],disabledControlNetProcessors:[],iterations:{initial:1,min:1,sliderMax:1e3,inputMax:1e4,fineStep:1,coarseStep:1},width:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},height:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},steps:{initial:30,min:1,sliderMax:100,inputMax:500,fineStep:1,coarseStep:1},guidance:{initial:7,min:1,sliderMax:20,inputMax:200,fineStep:.1,coarseStep:.5},img2imgStrength:{initial:.7,min:0,sliderMax:1,inputMax:1,fineStep:.01,coarseStep:.05},dynamicPrompts:{maxPrompts:{initial:100,min:1,sliderMax:1e3,inputMax:1e4}}}},TB=nr({name:"config",initialState:EB,reducers:{configChanged:(e,t)=>{yh(e,t.payload)}}}),{configChanged:Uae}=TB.actions,Vae=TB.reducer,kB=Ne("socket/socketConnected"),Tk=Ne("socket/appSocketConnected"),PB=Ne("socket/socketDisconnected"),IB=Ne("socket/appSocketDisconnected"),Gae=Ne("socket/socketSubscribedSession"),qae=Ne("socket/appSocketSubscribedSession"),Hae=Ne("socket/socketUnsubscribedSession"),Wae=Ne("socket/appSocketUnsubscribedSession"),RB=Ne("socket/socketInvocationStarted"),kk=Ne("socket/appSocketInvocationStarted"),Pk=Ne("socket/socketInvocationComplete"),Ik=Ne("socket/appSocketInvocationComplete"),OB=Ne("socket/socketInvocationError"),a2=Ne("socket/appSocketInvocationError"),MB=Ne("socket/socketGraphExecutionStateComplete"),$B=Ne("socket/appSocketGraphExecutionStateComplete"),NB=Ne("socket/socketGeneratorProgress"),Rk=Ne("socket/appSocketGeneratorProgress"),DB=Ne("socket/socketModelLoadStarted"),LB=Ne("socket/appSocketModelLoadStarted"),FB=Ne("socket/socketModelLoadCompleted"),BB=Ne("socket/appSocketModelLoadCompleted"),zB=Ne("socket/socketSessionRetrievalError"),jB=Ne("socket/appSocketSessionRetrievalError"),UB=Ne("socket/socketInvocationRetrievalError"),VB=Ne("socket/appSocketInvocationRetrievalError"),GB=Ne("socket/socketQueueItemStatusChanged"),s2=Ne("socket/appSocketQueueItemStatusChanged");let bv;const Kae=new Uint8Array(16);function Qae(){if(!bv&&(bv=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bv))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bv(Kae)}const xi=[];for(let e=0;e<256;++e)xi.push((e+256).toString(16).slice(1));function Xae(e,t=0){return(xi[e[t+0]]+xi[e[t+1]]+xi[e[t+2]]+xi[e[t+3]]+"-"+xi[e[t+4]]+xi[e[t+5]]+"-"+xi[e[t+6]]+xi[e[t+7]]+"-"+xi[e[t+8]]+xi[e[t+9]]+"-"+xi[e[t+10]]+xi[e[t+11]]+xi[e[t+12]]+xi[e[t+13]]+xi[e[t+14]]+xi[e[t+15]]).toLowerCase()}const Yae=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),hI={randomUUID:Yae};function Zg(e,t,n){if(hI.randomUUID&&!t&&!e)return hI.randomUUID();e=e||{};const r=e.random||(e.rng||Qae)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Xae(r)}const Zae={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class r_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Zae,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new r_(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new r_(this.logger,t)}}var zs=new r_;class l2{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(a=>{a(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[t,...r])})}}function Xp(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function pI(e){return e==null?"":""+e}function Jae(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function Ok(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function gI(e,t,n){const{obj:r,k:i}=Ok(e,t,Object);r[i]=n}function ese(e,t,n,r){const{obj:i,k:o}=Ok(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function i_(e,t){const{obj:n,k:r}=Ok(e,t);if(n)return n[r]}function tse(e,t,n){const r=i_(e,n);return r!==void 0?r:i_(t,n)}function qB(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):qB(e[r],t[r],n):e[r]=t[r]);return e}function ff(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var nse={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function rse(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>nse[t]):e}const ise=[" ",",","?","!",";"];function ose(e,t,n){t=t||"",n=n||"";const r=ise.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=new RegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function o_(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){let a=2,s=r.slice(o,o+a).join(n),l=i[s];for(;l===void 0&&r.length>o+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const u=r.slice(o+a).join(n);return u?o_(l,u,n):void 0}i=i[r[o]]}return i}function a_(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class mI extends l2{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,n];r&&typeof r!="string"&&(s=s.concat(r)),r&&typeof r=="string"&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split("."));const l=i_(this.data,s);return l||!a||typeof r!="string"?l:o_(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),gI(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Object.prototype.toString.apply(r[o])==="[object Array]")&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=i_(this.data,s)||{};i?qB(l,r,o):l={...l,...r},gI(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var HB={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const yI={};class s_ extends l2{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Jae(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=zs.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!ose(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const v=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${v}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l}:`${l}${v}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l}:a}const d=this.resolve(t,n);let f=d&&d.res;const h=d&&d.usedKey||a,p=d&&d.exactUsedKey||a,m=Object.prototype.toString.apply(f),_=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&_.indexOf(m)<0&&!(typeof b=="string"&&m==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=v,d):v}if(o){const v=m==="[object Array]",S=v?[]:{},w=v?p:h;for(const x in f)if(Object.prototype.hasOwnProperty.call(f,x)){const C=`${w}${o}${x}`;S[x]=this.translate(C,{...n,joinArrays:!1,ns:s}),S[x]===C&&(S[x]=f[x])}f=S}}else if(y&&typeof b=="string"&&m==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let v=!1,S=!1;const w=n.count!==void 0&&typeof n.count!="string",x=s_.hasDefaultValue(n),C=w?this.pluralResolver.getSuffix(u,n.count,n):"",T=n.ordinal&&w?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",E=n[`defaultValue${C}`]||n[`defaultValue${T}`]||n.defaultValue;!this.isValidLookup(f)&&x&&(v=!0,f=E),this.isValidLookup(f)||(S=!0,f=a);const N=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:f,O=x&&E!==f&&this.options.updateMissing;if(S||v||O){if(this.logger.log(O?"updateKey":"missingKey",u,l,a,O?E:f),o){const L=this.resolve(a,{...n,keySeparator:!1});L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let A=[];const k=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&k&&k[0])for(let L=0;L<k.length;L++)A.push(k[L]);else this.options.saveMissingTo==="all"?A=this.languageUtils.toResolveHierarchy(n.lng||this.language):A.push(n.lng||this.language);const D=(L,M,R)=>{const $=x&&R!==f?R:N;this.options.missingKeyHandler?this.options.missingKeyHandler(L,l,M,$,O,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(L,l,M,$,O,n),this.emit("missingKey",L,l,M,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?A.forEach(L=>{this.pluralResolver.getSuffixes(L,n).forEach(M=>{D([L],a+M,n[`defaultValue${M}`]||E)})}):D(A,a,E))}f=this.extendTranslation(f,t,n,d,r),S&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${a}`),(S||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,v?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d):f}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language,r),u){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;c<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,h=new Array(f),p=0;p<f;p++)h[p]=arguments[p];return o&&o[0]===h[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):a.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=HB.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:i,...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(_=>{this.isValidLookup(r)||(s=_,!yI[`${m[0]}-${_}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(yI[`${m[0]}-${_}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(b=>{if(this.isValidLookup(r))return;a=b;const y=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,c,b,_,n);else{let v;f&&(v=this.pluralResolver.getSuffix(b,n.count,n));const S=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(c+v),n.ordinal&&v.indexOf(w)===0&&y.push(c+v.replace(w,this.options.pluralSeparator)),h&&y.push(c+S)),p){const x=`${c}${this.options.contextSeparator}${n.context}`;y.push(x),f&&(y.push(x+v),n.ordinal&&v.indexOf(w)===0&&y.push(x+v.replace(w,this.options.pluralSeparator)),h&&y.push(x+S))}}let g;for(;g=y.pop();)this.isValidLookup(r)||(o=g,r=this.getResource(b,_,g,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function yC(e){return e.charAt(0).toUpperCase()+e.slice(1)}class vI{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=zs.create("languageUtils")}getScriptPartFromCode(t){if(t=a_(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=a_(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=yC(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=yC(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=yC(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let ase=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],sse={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const lse=["v1","v2","v3"],use=["v4"],bI={zero:0,one:1,two:2,few:3,many:4,other:5};function cse(){const e={};return ase.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:sse[t.fc]}})}),e}class dse{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=zs.create("pluralResolver"),(!this.options.compatibilityJSON||use.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=cse()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(a_(t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>bI[i]-bI[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!lse.includes(this.options.compatibilityJSON)}}function _I(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=tse(e,t,n);return!o&&i&&typeof n=="string"&&(o=o_(e,n,r),o===void 0&&(o=o_(t,n,r))),o}class fse{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=zs.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const n=t.interpolation;this.escape=n.escape!==void 0?n.escape:rse,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?ff(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?ff(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?ff(n.nestingPrefix):n.nestingPrefixEscaped||ff("$t("),this.nestingSuffix=n.nestingSuffix?ff(n.nestingSuffix):n.nestingSuffixEscaped||ff(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(p){return p.replace(/\$/g,"$$$$")}const c=p=>{if(p.indexOf(this.formatSeparator)<0){const y=_I(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:p}):y}const m=p.split(this.formatSeparator),_=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(_I(n,l,_,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:_})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>u(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?u(this.escape(p)):u(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof d=="function"){const b=d(t,o,i);a=typeof b=="string"?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=pI(a));const _=p.safeValue(a);if(t=t.replace(o[0],_),f?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,a);const h=f.match(/'/g),p=f.match(/"/g);(h&&h.length%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),u&&(a={...u,...a})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${c}${f}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=pI(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function hse(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(!a)return;const[s,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,"");n[s.trim()]||(n[s.trim()]=u),u==="false"&&(n[s.trim()]=!1),u==="true"&&(n[s.trim()]=!0),isNaN(u)||(n[s.trim()]=parseInt(u,10))})}return{formatName:t,formatOptions:n}}function hf(e){const t={};return function(r,i,o){const a=i+JSON.stringify(o);let s=t[a];return s||(s=e(a_(i),o),t[a]=s),s(r)}}class pse{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=zs.create("formatter"),this.options=t,this.formats={number:hf((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:hf((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:hf((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:hf((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:hf((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=hf(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((s,l)=>{const{formatName:u,formatOptions:c}=hse(l);if(this.formats[u]){let d=s;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=f.locale||f.lng||i.locale||i.lng||r;d=this.formats[u](s,h,{...c,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return s},t)}}function gse(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class mse extends l2{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=zs.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,c=!1,a[f]===void 0&&(a[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),r&&this.store.addResourceBundle(o,a,r),this.state[t]=n?-1:2;const s={};this.queue.forEach(l=>{ese(l.loaded,[o],a),gse(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...a,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(t,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}else u(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}function SI(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(i=>{n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function xI(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function _v(){}function yse(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class Gm extends l2{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=xI(t),this.services={},this.logger=zs,this.modules={external:[]},yse(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=SI();this.options={...i,...this.options,...xI(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function o(c){return c?typeof c=="function"?new c:c:null}if(!this.options.isClone){this.modules.logger?zs.init(o(this.modules.logger),this.options):zs.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=pse);const d=new vI(this.options);this.store=new mI(this.options.resources,this.options);const f=this.services;f.logger=zs,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new dse(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new fse(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new mse(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new s_(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=_v),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const l=Xp(),u=()=>{const c=(d,f)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),r(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_v;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return r();const o=[],a=s=>{if(!s)return;this.services.languageUtils.toResolveHierarchy(s).forEach(u=>{o.indexOf(u)<0&&o.push(u)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=Xp();return t||(t=this.languages),n||(n=this.options.ns),r||(r=_v),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&HB.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Xp();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{a(c,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d<u;d++)c[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(c))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||r||o.keyPrefix;const f=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(a)?h=a.map(p=>`${l.keyPrefix}${f}${p}`):h=l.keyPrefix?`${l.keyPrefix}${f}${a}`:a,i.t(h,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Xp();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Xp();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new vI(SI());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Gm(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_v;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Gm(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new mI(this.store.data,i),o.services.resourceStore=o.store),o.translator=new s_(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];o.emit(s,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const me=Gm.createInstance();me.createInstance=Gm.createInstance;me.createInstance;me.dir;me.init;me.loadResources;me.reloadResources;me.use;me.changeLanguage;me.getFixedT;const Z=me.t;me.exists;me.setDefaultNamespace;me.hasLoadedNamespace;me.loadNamespaces;me.loadLanguages;const Zc={none:{type:"none",get label(){return me.t("controlnet.none")},get description(){return me.t("controlnet.noneDescription")},default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",get label(){return me.t("controlnet.canny")},get description(){return me.t("controlnet.cannyDescription")},default:{id:"canny_image_processor",type:"canny_image_processor",low_threshold:100,high_threshold:200}},color_map_image_processor:{type:"color_map_image_processor",get label(){return me.t("controlnet.colorMap")},get description(){return me.t("controlnet.colorMapDescription")},default:{id:"color_map_image_processor",type:"color_map_image_processor",color_map_tile_size:64}},content_shuffle_image_processor:{type:"content_shuffle_image_processor",get label(){return me.t("controlnet.contentShuffle")},get description(){return me.t("controlnet.contentShuffleDescription")},default:{id:"content_shuffle_image_processor",type:"content_shuffle_image_processor",detect_resolution:512,image_resolution:512,h:512,w:512,f:256}},hed_image_processor:{type:"hed_image_processor",get label(){return me.t("controlnet.hed")},get description(){return me.t("controlnet.hedDescription")},default:{id:"hed_image_processor",type:"hed_image_processor",detect_resolution:512,image_resolution:512,scribble:!1}},lineart_anime_image_processor:{type:"lineart_anime_image_processor",get label(){return me.t("controlnet.lineartAnime")},get description(){return me.t("controlnet.lineartAnimeDescription")},default:{id:"lineart_anime_image_processor",type:"lineart_anime_image_processor",detect_resolution:512,image_resolution:512}},lineart_image_processor:{type:"lineart_image_processor",get label(){return me.t("controlnet.lineart")},get description(){return me.t("controlnet.lineartDescription")},default:{id:"lineart_image_processor",type:"lineart_image_processor",detect_resolution:512,image_resolution:512,coarse:!1}},mediapipe_face_processor:{type:"mediapipe_face_processor",get label(){return me.t("controlnet.mediapipeFace")},get description(){return me.t("controlnet.mediapipeFaceDescription")},default:{id:"mediapipe_face_processor",type:"mediapipe_face_processor",max_faces:1,min_confidence:.5}},midas_depth_image_processor:{type:"midas_depth_image_processor",get label(){return me.t("controlnet.depthMidas")},get description(){return me.t("controlnet.depthMidasDescription")},default:{id:"midas_depth_image_processor",type:"midas_depth_image_processor",a_mult:2,bg_th:.1}},mlsd_image_processor:{type:"mlsd_image_processor",get label(){return me.t("controlnet.mlsd")},get description(){return me.t("controlnet.mlsdDescription")},default:{id:"mlsd_image_processor",type:"mlsd_image_processor",detect_resolution:512,image_resolution:512,thr_d:.1,thr_v:.1}},normalbae_image_processor:{type:"normalbae_image_processor",get label(){return me.t("controlnet.normalBae")},get description(){return me.t("controlnet.normalBaeDescription")},default:{id:"normalbae_image_processor",type:"normalbae_image_processor",detect_resolution:512,image_resolution:512}},openpose_image_processor:{type:"openpose_image_processor",get label(){return me.t("controlnet.openPose")},get description(){return me.t("controlnet.openPoseDescription")},default:{id:"openpose_image_processor",type:"openpose_image_processor",detect_resolution:512,image_resolution:512,hand_and_face:!1}},pidi_image_processor:{type:"pidi_image_processor",get label(){return me.t("controlnet.pidi")},get description(){return me.t("controlnet.pidiDescription")},default:{id:"pidi_image_processor",type:"pidi_image_processor",detect_resolution:512,image_resolution:512,scribble:!1,safe:!1}},zoe_depth_image_processor:{type:"zoe_depth_image_processor",get label(){return me.t("controlnet.depthZoe")},get description(){return me.t("controlnet.depthZoeDescription")},default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},Sv={canny:"canny_image_processor",mlsd:"mlsd_image_processor",depth:"midas_depth_image_processor",bae:"normalbae_image_processor",sketch:"lineart_image_processor",scribble:"lineart_image_processor",lineart:"lineart_image_processor",lineart_anime:"lineart_anime_image_processor",softedge:"hed_image_processor",shuffle:"content_shuffle_image_processor",openpose:"openpose_image_processor",mediapipe:"mediapipe_face_processor",pidi:"pidi_image_processor",zoe:"zoe_depth_image_processor",color:"color_map_image_processor"},vse={type:"controlnet",isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,controlMode:"balanced",resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Zc.canny_image_processor.default,shouldAutoConfig:!0},bse={type:"t2i_adapter",isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Zc.canny_image_processor.default,shouldAutoConfig:!0},_se={type:"ip_adapter",isEnabled:!0,controlImage:null,model:null,weight:1,beginStepPct:0,endStepPct:1},wI=(e,t,n={})=>{switch(t){case"controlnet":return yh(Ut(vse),{id:e,...n});case"t2i_adapter":return yh(Ut(bse),{id:e,...n});case"ip_adapter":return yh(Ut(_se),{id:e,...n});default:throw new Error(`Unknown control adapter type: ${t}`)}},Mk=Ne("controlAdapters/imageProcessed"),u2=e=>e.type==="controlnet",WB=e=>e.type==="ip_adapter",$k=e=>e.type==="t2i_adapter",qo=e=>u2(e)||$k(e),ar=Ra(),{selectById:eo,selectAll:Pa,selectEntities:kUe,selectIds:PUe,selectTotal:IUe}=ar.getSelectors(),pA=ar.getInitialState({pendingControlImages:[]}),KB=e=>Pa(e).filter(u2),Sse=e=>Pa(e).filter(u2).filter(t=>t.isEnabled&&t.model&&(!!t.processedControlImage||t.processorType==="none"&&!!t.controlImage)),xse=e=>Pa(e).filter(WB),wse=e=>Pa(e).filter(WB).filter(t=>t.isEnabled&&t.model&&!!t.controlImage),QB=e=>Pa(e).filter($k),Cse=e=>Pa(e).filter($k).filter(t=>t.isEnabled&&t.model&&(!!t.processedControlImage||t.processorType==="none"&&!!t.controlImage)),Ase=(e,t)=>{const n=KB(e).filter(r=>r.id!==t).map(r=>({id:r.id,changes:{isEnabled:!1}}));ar.updateMany(e,n)},Ese=(e,t)=>{const n=QB(e).filter(r=>r.id!==t).map(r=>({id:r.id,changes:{isEnabled:!1}}));ar.updateMany(e,n)},Yp=(e,t,n)=>{t==="controlnet"&&Ese(e,n),t==="t2i_adapter"&&Ase(e,n)},XB=nr({name:"controlAdapters",initialState:pA,reducers:{controlAdapterAdded:{reducer:(e,t)=>{const{id:n,type:r,overrides:i}=t.payload;ar.addOne(e,wI(n,r,i)),Yp(e,r,n)},prepare:({type:e,overrides:t})=>({payload:{id:Zg(),type:e,overrides:t}})},controlAdapterRecalled:(e,t)=>{ar.addOne(e,t.payload);const{type:n,id:r}=t.payload;Yp(e,n,r)},controlAdapterDuplicated:{reducer:(e,t)=>{const{id:n,newId:r}=t.payload,i=eo(e,n);if(!i)return;const o=yh(Ut(i),{id:r,isEnabled:!0});ar.addOne(e,o);const{type:a}=o;Yp(e,a,r)},prepare:e=>({payload:{id:e,newId:Zg()}})},controlAdapterAddedFromImage:{reducer:(e,t)=>{const{id:n,type:r,controlImage:i}=t.payload;ar.addOne(e,wI(n,r,{controlImage:i})),Yp(e,r,n)},prepare:e=>({payload:{...e,id:Zg()}})},controlAdapterRemoved:(e,t)=>{ar.removeOne(e,t.payload.id)},controlAdapterIsEnabledChanged:(e,t)=>{const{id:n,isEnabled:r}=t.payload;if(ar.updateOne(e,{id:n,changes:{isEnabled:r}}),r){const i=eo(e,n);i&&Yp(e,i.type,n)}},controlAdapterImageChanged:(e,t)=>{const{id:n,controlImage:r}=t.payload,i=eo(e,n);i&&(ar.updateOne(e,{id:n,changes:{controlImage:r,processedControlImage:null}}),r!==null&&qo(i)&&i.processorType!=="none"&&e.pendingControlImages.push(n))},controlAdapterProcessedImageChanged:(e,t)=>{const{id:n,processedControlImage:r}=t.payload,i=eo(e,n);i&&qo(i)&&(ar.updateOne(e,{id:n,changes:{processedControlImage:r}}),e.pendingControlImages=e.pendingControlImages.filter(o=>o!==n))},controlAdapterModelCleared:(e,t)=>{ar.updateOne(e,{id:t.payload.id,changes:{model:null}})},controlAdapterModelChanged:(e,t)=>{const{id:n,model:r}=t.payload,i=eo(e,n);if(!i)return;if(!qo(i)){ar.updateOne(e,{id:n,changes:{model:r}});return}const o={id:n,changes:{model:r}};if(o.changes.processedControlImage=null,i.shouldAutoConfig){let a;for(const s in Sv)if(r.model_name.includes(s)){a=Sv[s];break}a?(o.changes.processorType=a,o.changes.processorNode=Zc[a].default):(o.changes.processorType="none",o.changes.processorNode=Zc.none.default)}ar.updateOne(e,o)},controlAdapterWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload;ar.updateOne(e,{id:n,changes:{weight:r}})},controlAdapterBeginStepPctChanged:(e,t)=>{const{id:n,beginStepPct:r}=t.payload;ar.updateOne(e,{id:n,changes:{beginStepPct:r}})},controlAdapterEndStepPctChanged:(e,t)=>{const{id:n,endStepPct:r}=t.payload;ar.updateOne(e,{id:n,changes:{endStepPct:r}})},controlAdapterControlModeChanged:(e,t)=>{const{id:n,controlMode:r}=t.payload,i=eo(e,n);!i||!u2(i)||ar.updateOne(e,{id:n,changes:{controlMode:r}})},controlAdapterResizeModeChanged:(e,t)=>{const{id:n,resizeMode:r}=t.payload,i=eo(e,n);!i||!qo(i)||ar.updateOne(e,{id:n,changes:{resizeMode:r}})},controlAdapterProcessorParamsChanged:(e,t)=>{const{id:n,params:r}=t.payload,i=eo(e,n);if(!i||!qo(i)||!i.processorNode)return;const o=yh(Ut(i.processorNode),r);ar.updateOne(e,{id:n,changes:{shouldAutoConfig:!1,processorNode:o}})},controlAdapterProcessortTypeChanged:(e,t)=>{const{id:n,processorType:r}=t.payload,i=eo(e,n);if(!i||!qo(i))return;const o=Ut(Zc[r].default);ar.updateOne(e,{id:n,changes:{processorType:r,processedControlImage:null,processorNode:o,shouldAutoConfig:!1}})},controlAdapterAutoConfigToggled:(e,t)=>{var o;const{id:n}=t.payload,r=eo(e,n);if(!r||!qo(r))return;const i={id:n,changes:{shouldAutoConfig:!r.shouldAutoConfig}};if(i.changes.shouldAutoConfig){let a;for(const s in Sv)if((o=r.model)!=null&&o.model_name.includes(s)){a=Sv[s];break}a?(i.changes.processorType=a,i.changes.processorNode=Zc[a].default):(i.changes.processorType="none",i.changes.processorNode=Zc.none.default)}ar.updateOne(e,i)},controlAdaptersReset:()=>Ut(pA),pendingControlImagesCleared:e=>{e.pendingControlImages=[]}},extraReducers:e=>{e.addCase(Mk,(t,n)=>{const r=eo(t,n.payload.id);r&&r.controlImage!==null&&(t.pendingControlImages=jae(t.pendingControlImages.concat(n.payload.id)))}),e.addCase(a2,t=>{t.pendingControlImages=[]})}}),{controlAdapterAdded:Nk,controlAdapterRecalled:Dk,controlAdapterDuplicated:RUe,controlAdapterAddedFromImage:Lk,controlAdapterRemoved:OUe,controlAdapterImageChanged:Tc,controlAdapterProcessedImageChanged:Fk,controlAdapterIsEnabledChanged:yy,controlAdapterModelChanged:CI,controlAdapterWeightChanged:MUe,controlAdapterBeginStepPctChanged:$Ue,controlAdapterEndStepPctChanged:NUe,controlAdapterControlModeChanged:DUe,controlAdapterResizeModeChanged:LUe,controlAdapterProcessorParamsChanged:Tse,controlAdapterProcessortTypeChanged:kse,controlAdaptersReset:Pse,controlAdapterAutoConfigToggled:AI,pendingControlImagesCleared:Ise,controlAdapterModelCleared:vC}=XB.actions,Rse=XB.reducer,Ose=Qi(Nk,Lk,Dk),FUe={any:"Any","sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},BUe={any:"Any","sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},Mse={any:{maxClip:0,markers:[]},"sd-1":{maxClip:12,markers:[0,1,2,3,4,8,12]},"sd-2":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},sdxl:{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},"sdxl-refiner":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]}},zUe={lycoris:"LyCORIS",diffusers:"Diffusers"},$se=0,Jg=4294967295;var Yt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Yt||(Yt={}));var gA;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(gA||(gA={}));const Oe=Yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ru=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},he=Yt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Nse=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ls extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ls.create=e=>new ls(e);const qm=(e,t)=>{let n;switch(e.code){case he.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case he.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Yt.jsonStringifyReplacer)}`;break;case he.unrecognized_keys:n=`Unrecognized key(s) in object: ${Yt.joinValues(e.keys,", ")}`;break;case he.invalid_union:n="Invalid input";break;case he.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Yt.joinValues(e.options)}`;break;case he.invalid_enum_value:n=`Invalid enum value. Expected ${Yt.joinValues(e.options)}, received '${e.received}'`;break;case he.invalid_arguments:n="Invalid function arguments";break;case he.invalid_return_type:n="Invalid function return type";break;case he.invalid_date:n="Invalid date";break;case he.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case he.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case he.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case he.custom:n="Invalid input";break;case he.invalid_intersection_types:n="Intersection results could not be merged";break;case he.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case he.not_finite:n="Number must be finite";break;default:n=t.defaultError,Yt.assertNever(e)}return{message:n}};let YB=qm;function Dse(e){YB=e}function l_(){return YB}const u_=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}},Lse=[];function $e(e,t){const n=u_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,l_(),qm].filter(r=>!!r)});e.common.issues.push(n)}class Ki{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return vt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Ki.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return vt;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const vt=Object.freeze({status:"aborted"}),ZB=e=>({status:"dirty",value:e}),co=e=>({status:"valid",value:e}),mA=e=>e.status==="aborted",yA=e=>e.status==="dirty",Hm=e=>e.status==="valid",c_=e=>typeof Promise<"u"&&e instanceof Promise;var rt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(rt||(rt={}));class tl{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const EI=(e,t)=>{if(Hm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ls(e.common.issues);return this._error=n,this._error}}};function xt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>a.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class At{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Ru(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ru(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ki,ctx:{common:t.parent.common,data:t.data,parsedType:Ru(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(c_(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ru(t)},o=this._parseSync({data:t,path:i.path,parent:i});return EI(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ru(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(c_(i)?i:Promise.resolve(i));return EI(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:he.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new hs({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Bl.create(this,this._def)}nullable(){return Dd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return us.create(this,this._def)}promise(){return Zh.create(this,this._def)}or(t){return Xm.create([this,t],this._def)}and(t){return Ym.create(this,t,this._def)}transform(t){return new hs({...xt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new n0({...xt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new ez({typeName:lt.ZodBranded,type:this,...xt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new p_({...xt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return vy.create(this,t)}readonly(){return m_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Fse=/^c[^\s-]{8,}$/i,Bse=/^[a-z][a-z0-9]*$/,zse=/[0-9A-HJKMNP-TV-Z]{26}/,jse=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Use=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vse=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,Gse=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,qse=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Hse=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Wse(e,t){return!!((t==="v4"||!t)&&Gse.test(e)||(t==="v6"||!t)&&qse.test(e))}class rs extends At{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:he.invalid_string,...rt.errToObj(r)}),this.nonempty=t=>this.min(1,rt.errToObj(t)),this.trim=()=>new rs({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new rs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new rs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const o=this._getOrReturnCtx(t);return $e(o,{code:he.invalid_type,expected:Oe.string,received:o.parsedType}),vt}const r=new Ki;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),$e(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),$e(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?$e(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&$e(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Use.test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"email",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Vse.test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"emoji",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")jse.test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"uuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Fse.test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"cuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Bse.test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"cuid2",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")zse.test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"ulid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),$e(i,{validation:"url",code:he.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"regex",code:he.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),$e(i,{code:he.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),$e(i,{code:he.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),$e(i,{code:he.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Hse(o).test(t.data)||(i=this._getOrReturnCtx(t,i),$e(i,{code:he.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Wse(t.data,o.version)||(i=this._getOrReturnCtx(t,i),$e(i,{validation:"ip",code:he.invalid_string,message:o.message}),r.dirty()):Yt.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new rs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...rt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...rt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...rt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...rt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...rt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...rt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...rt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...rt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...rt.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...rt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...rt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...rt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...rt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...rt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...rt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...rt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}rs.create=e=>{var t;return new rs({checks:[],typeName:lt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xt(e)})};function Kse(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class cc extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const o=this._getOrReturnCtx(t);return $e(o,{code:he.invalid_type,expected:Oe.number,received:o.parsedType}),vt}let r;const i=new Ki;for(const o of this._def.checks)o.kind==="int"?Yt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),$e(r,{code:he.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),$e(r,{code:he.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),$e(r,{code:he.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Kse(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),$e(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),$e(r,{code:he.not_finite,message:o.message}),i.dirty()):Yt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,rt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,rt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,rt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,rt.toString(n))}setLimit(t,n,r,i){return new cc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:rt.toString(i)}]})}_addCheck(t){return new cc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:rt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:rt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:rt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Yt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}cc.create=e=>new cc({checks:[],typeName:lt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...xt(e)});class dc extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const o=this._getOrReturnCtx(t);return $e(o,{code:he.invalid_type,expected:Oe.bigint,received:o.parsedType}),vt}let r;const i=new Ki;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),$e(r,{code:he.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),$e(r,{code:he.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),$e(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Yt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,rt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,rt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,rt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,rt.toString(n))}setLimit(t,n,r,i){return new dc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:rt.toString(i)}]})}_addCheck(t){return new dc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:rt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}dc.create=e=>{var t;return new dc({checks:[],typeName:lt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xt(e)})};class Wm extends At{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return $e(r,{code:he.invalid_type,expected:Oe.boolean,received:r.parsedType}),vt}return co(t.data)}}Wm.create=e=>new Wm({typeName:lt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...xt(e)});class $d extends At{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const o=this._getOrReturnCtx(t);return $e(o,{code:he.invalid_type,expected:Oe.date,received:o.parsedType}),vt}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return $e(o,{code:he.invalid_date}),vt}const r=new Ki;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),$e(i,{code:he.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),$e(i,{code:he.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Yt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new $d({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:rt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:rt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}$d.create=e=>new $d({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:lt.ZodDate,...xt(e)});class d_ extends At{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return $e(r,{code:he.invalid_type,expected:Oe.symbol,received:r.parsedType}),vt}return co(t.data)}}d_.create=e=>new d_({typeName:lt.ZodSymbol,...xt(e)});class Km extends At{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return $e(r,{code:he.invalid_type,expected:Oe.undefined,received:r.parsedType}),vt}return co(t.data)}}Km.create=e=>new Km({typeName:lt.ZodUndefined,...xt(e)});class Qm extends At{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return $e(r,{code:he.invalid_type,expected:Oe.null,received:r.parsedType}),vt}return co(t.data)}}Qm.create=e=>new Qm({typeName:lt.ZodNull,...xt(e)});class Yh extends At{constructor(){super(...arguments),this._any=!0}_parse(t){return co(t.data)}}Yh.create=e=>new Yh({typeName:lt.ZodAny,...xt(e)});class _d extends At{constructor(){super(...arguments),this._unknown=!0}_parse(t){return co(t.data)}}_d.create=e=>new _d({typeName:lt.ZodUnknown,...xt(e)});class Yl extends At{_parse(t){const n=this._getOrReturnCtx(t);return $e(n,{code:he.invalid_type,expected:Oe.never,received:n.parsedType}),vt}}Yl.create=e=>new Yl({typeName:lt.ZodNever,...xt(e)});class f_ extends At{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return $e(r,{code:he.invalid_type,expected:Oe.void,received:r.parsedType}),vt}return co(t.data)}}f_.create=e=>new f_({typeName:lt.ZodVoid,...xt(e)});class us extends At{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return $e(n,{code:he.invalid_type,expected:Oe.array,received:n.parsedType}),vt;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&($e(n,{code:a?he.too_big:he.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&($e(n,{code:he.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&($e(n,{code:he.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new tl(n,a,n.path,s)))).then(a=>Ki.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new tl(n,a,n.path,s)));return Ki.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new us({...this._def,minLength:{value:t,message:rt.toString(n)}})}max(t,n){return new us({...this._def,maxLength:{value:t,message:rt.toString(n)}})}length(t,n){return new us({...this._def,exactLength:{value:t,message:rt.toString(n)}})}nonempty(t){return this.min(1,t)}}us.create=(e,t)=>new us({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...xt(t)});function If(e){if(e instanceof sr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Bl.create(If(r))}return new sr({...e._def,shape:()=>t})}else return e instanceof us?new us({...e._def,type:If(e.element)}):e instanceof Bl?Bl.create(If(e.unwrap())):e instanceof Dd?Dd.create(If(e.unwrap())):e instanceof nl?nl.create(e.items.map(t=>If(t))):e}class sr extends At{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Yt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const u=this._getOrReturnCtx(t);return $e(u,{code:he.invalid_type,expected:Oe.object,received:u.parsedType}),vt}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Yl&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new tl(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Yl){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&($e(i,{code:he.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new tl(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key;u.push({key:d,value:await c.value,alwaysSet:c.alwaysSet})}return u}).then(u=>Ki.mergeObjectSync(r,u)):Ki.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return rt.errToObj,new sr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=rt.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new sr({...this._def,unknownKeys:"strip"})}passthrough(){return new sr({...this._def,unknownKeys:"passthrough"})}extend(t){return new sr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new sr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:lt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new sr({...this._def,catchall:t})}pick(t){const n={};return Yt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new sr({...this._def,shape:()=>n})}omit(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new sr({...this._def,shape:()=>n})}deepPartial(){return If(this)}partial(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new sr({...this._def,shape:()=>n})}required(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Bl;)o=o._def.innerType;n[r]=o}}),new sr({...this._def,shape:()=>n})}keyof(){return JB(Yt.objectKeys(this.shape))}}sr.create=(e,t)=>new sr({shape:()=>e,unknownKeys:"strip",catchall:Yl.create(),typeName:lt.ZodObject,...xt(t)});sr.strictCreate=(e,t)=>new sr({shape:()=>e,unknownKeys:"strict",catchall:Yl.create(),typeName:lt.ZodObject,...xt(t)});sr.lazycreate=(e,t)=>new sr({shape:e,unknownKeys:"strip",catchall:Yl.create(),typeName:lt.ZodObject,...xt(t)});class Xm extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new ls(s.ctx.common.issues));return $e(n,{code:he.invalid_union,unionErrors:a}),vt}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new ls(l));return $e(n,{code:he.invalid_union,unionErrors:s}),vt}}get options(){return this._def.options}}Xm.create=(e,t)=>new Xm({options:e,typeName:lt.ZodUnion,...xt(t)});const G1=e=>e instanceof Jm?G1(e.schema):e instanceof hs?G1(e.innerType()):e instanceof e0?[e.value]:e instanceof fc?e.options:e instanceof t0?Object.keys(e.enum):e instanceof n0?G1(e._def.innerType):e instanceof Km?[void 0]:e instanceof Qm?[null]:null;class c2 extends At{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return $e(n,{code:he.invalid_type,expected:Oe.object,received:n.parsedType}),vt;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):($e(n,{code:he.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),vt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=G1(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new c2({typeName:lt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...xt(r)})}}function vA(e,t){const n=Ru(e),r=Ru(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=Yt.objectKeys(t),o=Yt.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=vA(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=vA(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ym extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(mA(o)||mA(a))return vt;const s=vA(o.value,a.value);return s.valid?((yA(o)||yA(a))&&n.dirty(),{status:n.value,value:s.data}):($e(r,{code:he.invalid_intersection_types}),vt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ym.create=(e,t,n)=>new Ym({left:e,right:t,typeName:lt.ZodIntersection,...xt(n)});class nl extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return $e(r,{code:he.invalid_type,expected:Oe.array,received:r.parsedType}),vt;if(r.data.length<this._def.items.length)return $e(r,{code:he.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&r.data.length>this._def.items.length&&($e(r,{code:he.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new tl(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ki.mergeArray(n,a)):Ki.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new nl({...this._def,rest:t})}}nl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nl({items:e,typeName:lt.ZodTuple,rest:null,...xt(t)})};class Zm extends At{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return $e(r,{code:he.invalid_type,expected:Oe.object,received:r.parsedType}),vt;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new tl(r,s,r.path,s)),value:a._parse(new tl(r,r.data[s],r.path,s))});return r.common.async?Ki.mergeObjectAsync(n,i):Ki.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof At?new Zm({keyType:t,valueType:n,typeName:lt.ZodRecord,...xt(r)}):new Zm({keyType:rs.create(),valueType:t,typeName:lt.ZodRecord,...xt(n)})}}class h_ extends At{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return $e(r,{code:he.invalid_type,expected:Oe.map,received:r.parsedType}),vt;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],u)=>({key:i._parse(new tl(r,s,r.path,[u,"key"])),value:o._parse(new tl(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return vt;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return vt;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}h_.create=(e,t,n)=>new h_({valueType:t,keyType:e,typeName:lt.ZodMap,...xt(n)});class Nd extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return $e(r,{code:he.invalid_type,expected:Oe.set,received:r.parsedType}),vt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&($e(r,{code:he.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&($e(r,{code:he.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return vt;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>o._parse(new tl(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new Nd({...this._def,minSize:{value:t,message:rt.toString(n)}})}max(t,n){return new Nd({...this._def,maxSize:{value:t,message:rt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Nd.create=(e,t)=>new Nd({valueType:e,minSize:null,maxSize:null,typeName:lt.ZodSet,...xt(t)});class vh extends At{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return $e(n,{code:he.invalid_type,expected:Oe.function,received:n.parsedType}),vt;function r(s,l){return u_({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,l_(),qm].filter(u=>!!u),issueData:{code:he.invalid_arguments,argumentsError:l}})}function i(s,l){return u_({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,l_(),qm].filter(u=>!!u),issueData:{code:he.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Zh){const s=this;return co(async function(...l){const u=new ls([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const s=this;return co(function(...l){const u=s._def.args.safeParse(l,o);if(!u.success)throw new ls([r(l,u.error)]);const c=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new ls([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new vh({...this._def,args:nl.create(t).rest(_d.create())})}returns(t){return new vh({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new vh({args:t||nl.create([]).rest(_d.create()),returns:n||_d.create(),typeName:lt.ZodFunction,...xt(r)})}}class Jm extends At{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Jm.create=(e,t)=>new Jm({getter:e,typeName:lt.ZodLazy,...xt(t)});class e0 extends At{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return $e(n,{received:n.data,code:he.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:t.data}}get value(){return this._def.value}}e0.create=(e,t)=>new e0({value:e,typeName:lt.ZodLiteral,...xt(t)});function JB(e,t){return new fc({values:e,typeName:lt.ZodEnum,...xt(t)})}class fc extends At{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return $e(n,{expected:Yt.joinValues(r),received:n.parsedType,code:he.invalid_type}),vt}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return $e(n,{received:n.data,code:he.invalid_enum_value,options:r}),vt}return co(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return fc.create(t)}exclude(t){return fc.create(this.options.filter(n=>!t.includes(n)))}}fc.create=JB;class t0 extends At{_parse(t){const n=Yt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=Yt.objectValues(n);return $e(r,{expected:Yt.joinValues(i),received:r.parsedType,code:he.invalid_type}),vt}if(n.indexOf(t.data)===-1){const i=Yt.objectValues(n);return $e(r,{received:r.data,code:he.invalid_enum_value,options:i}),vt}return co(t.data)}get enum(){return this._def.values}}t0.create=(e,t)=>new t0({values:e,typeName:lt.ZodNativeEnum,...xt(t)});class Zh extends At{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return $e(n,{code:he.invalid_type,expected:Oe.promise,received:n.parsedType}),vt;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return co(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Zh.create=(e,t)=>new Zh({type:e,typeName:lt.ZodPromise,...xt(t)});class hs extends At{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{$e(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?vt:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?vt:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Hm(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Hm(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);Yt.assertNever(i)}}hs.create=(e,t,n)=>new hs({schema:e,typeName:lt.ZodEffects,effect:t,...xt(n)});hs.createWithPreprocess=(e,t,n)=>new hs({schema:t,effect:{type:"preprocess",transform:e},typeName:lt.ZodEffects,...xt(n)});class Bl extends At{_parse(t){return this._getType(t)===Oe.undefined?co(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Bl.create=(e,t)=>new Bl({innerType:e,typeName:lt.ZodOptional,...xt(t)});class Dd extends At{_parse(t){return this._getType(t)===Oe.null?co(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Dd.create=(e,t)=>new Dd({innerType:e,typeName:lt.ZodNullable,...xt(t)});class n0 extends At{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}n0.create=(e,t)=>new n0({innerType:e,typeName:lt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xt(t)});class p_ extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return c_(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ls(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ls(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}p_.create=(e,t)=>new p_({innerType:e,typeName:lt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xt(t)});class g_ extends At{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return $e(r,{code:he.invalid_type,expected:Oe.nan,received:r.parsedType}),vt}return{status:"valid",value:t.data}}}g_.create=e=>new g_({typeName:lt.ZodNaN,...xt(e)});const Qse=Symbol("zod_brand");class ez extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vy extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?vt:o.status==="dirty"?(n.dirty(),ZB(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?vt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new vy({in:t,out:n,typeName:lt.ZodPipeline})}}class m_ extends At{_parse(t){const n=this._def.innerType._parse(t);return Hm(n)&&(n.value=Object.freeze(n.value)),n}}m_.create=(e,t)=>new m_({innerType:e,typeName:lt.ZodReadonly,...xt(t)});const tz=(e,t={},n)=>e?Yh.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):Yh.create(),Xse={object:sr.lazycreate};var lt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(lt||(lt={}));const Yse=(e,t={message:`Input not instance of ${e.name}`})=>tz(n=>n instanceof e,t),nz=rs.create,rz=cc.create,Zse=g_.create,Jse=dc.create,iz=Wm.create,ele=$d.create,tle=d_.create,nle=Km.create,rle=Qm.create,ile=Yh.create,ole=_d.create,ale=Yl.create,sle=f_.create,lle=us.create,ule=sr.create,cle=sr.strictCreate,dle=Xm.create,fle=c2.create,hle=Ym.create,ple=nl.create,gle=Zm.create,mle=h_.create,yle=Nd.create,vle=vh.create,ble=Jm.create,_le=e0.create,Sle=fc.create,xle=t0.create,wle=Zh.create,TI=hs.create,Cle=Bl.create,Ale=Dd.create,Ele=hs.createWithPreprocess,Tle=vy.create,kle=()=>nz().optional(),Ple=()=>rz().optional(),Ile=()=>iz().optional(),Rle={string:e=>rs.create({...e,coerce:!0}),number:e=>cc.create({...e,coerce:!0}),boolean:e=>Wm.create({...e,coerce:!0}),bigint:e=>dc.create({...e,coerce:!0}),date:e=>$d.create({...e,coerce:!0})},Ole=vt;var z=Object.freeze({__proto__:null,defaultErrorMap:qm,setErrorMap:Dse,getErrorMap:l_,makeIssue:u_,EMPTY_PATH:Lse,addIssueToContext:$e,ParseStatus:Ki,INVALID:vt,DIRTY:ZB,OK:co,isAborted:mA,isDirty:yA,isValid:Hm,isAsync:c_,get util(){return Yt},get objectUtil(){return gA},ZodParsedType:Oe,getParsedType:Ru,ZodType:At,ZodString:rs,ZodNumber:cc,ZodBigInt:dc,ZodBoolean:Wm,ZodDate:$d,ZodSymbol:d_,ZodUndefined:Km,ZodNull:Qm,ZodAny:Yh,ZodUnknown:_d,ZodNever:Yl,ZodVoid:f_,ZodArray:us,ZodObject:sr,ZodUnion:Xm,ZodDiscriminatedUnion:c2,ZodIntersection:Ym,ZodTuple:nl,ZodRecord:Zm,ZodMap:h_,ZodSet:Nd,ZodFunction:vh,ZodLazy:Jm,ZodLiteral:e0,ZodEnum:fc,ZodNativeEnum:t0,ZodPromise:Zh,ZodEffects:hs,ZodTransformer:hs,ZodOptional:Bl,ZodNullable:Dd,ZodDefault:n0,ZodCatch:p_,ZodNaN:g_,BRAND:Qse,ZodBranded:ez,ZodPipeline:vy,ZodReadonly:m_,custom:tz,Schema:At,ZodSchema:At,late:Xse,get ZodFirstPartyTypeKind(){return lt},coerce:Rle,any:ile,array:lle,bigint:Jse,boolean:iz,date:ele,discriminatedUnion:fle,effect:TI,enum:Sle,function:vle,instanceof:Yse,intersection:hle,lazy:ble,literal:_le,map:mle,nan:Zse,nativeEnum:xle,never:ale,null:rle,nullable:Ale,number:rz,object:ule,oboolean:Ile,onumber:Ple,optional:Cle,ostring:kle,pipeline:Tle,preprocess:Ele,promise:wle,record:gle,set:yle,strictObject:cle,string:nz,symbol:tle,transformer:TI,tuple:ple,undefined:nle,union:dle,unknown:ole,void:sle,NEVER:Ole,ZodIssueCode:he,quotelessJson:Nse,ZodError:ls});const Mle=z.string(),jUe=e=>Mle.safeParse(e).success,$le=z.string(),UUe=e=>$le.safeParse(e).success,Nle=z.string(),VUe=e=>Nle.safeParse(e).success,Dle=z.string(),GUe=e=>Dle.safeParse(e).success,Lle=z.number().int().min(1),qUe=e=>Lle.safeParse(e).success,Fle=z.number().min(1),HUe=e=>Fle.safeParse(e).success,oz=z.enum(["euler","deis","ddim","ddpm","dpmpp_2s","dpmpp_2m","dpmpp_2m_sde","dpmpp_sde","heun","kdpm_2","lms","pndm","unipc","euler_k","dpmpp_2s_k","dpmpp_2m_k","dpmpp_2m_sde_k","dpmpp_sde_k","heun_k","lms_k","euler_a","kdpm_2_a"]),WUe=e=>oz.safeParse(e).success,KUe={euler:"Euler",deis:"DEIS",ddim:"DDIM",ddpm:"DDPM",dpmpp_sde:"DPM++ SDE",dpmpp_2s:"DPM++ 2S",dpmpp_2m:"DPM++ 2M",dpmpp_2m_sde:"DPM++ 2M SDE",heun:"Heun",kdpm_2:"KDPM 2",lms:"LMS",pndm:"PNDM",unipc:"UniPC",euler_k:"Euler Karras",dpmpp_sde_k:"DPM++ SDE Karras",dpmpp_2s_k:"DPM++ 2S Karras",dpmpp_2m_k:"DPM++ 2M Karras",dpmpp_2m_sde_k:"DPM++ 2M SDE Karras",heun_k:"Heun Karras",lms_k:"LMS Karras",euler_a:"Euler Ancestral",kdpm_2_a:"KDPM 2 Ancestral"},Ble=z.number().int().min(0).max(Jg),QUe=e=>Ble.safeParse(e).success,zle=z.number().multipleOf(8).min(64),XUe=e=>zle.safeParse(e).success,jle=z.number().multipleOf(8).min(64),YUe=e=>jle.safeParse(e).success,kc=z.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),d2=z.object({model_name:z.string().min(1),base_model:kc,model_type:z.literal("main")}),ZUe=e=>d2.safeParse(e).success,Bk=z.object({model_name:z.string().min(1),base_model:z.literal("sdxl-refiner"),model_type:z.literal("main")}),JUe=e=>Bk.safeParse(e).success,az=z.object({model_name:z.string().min(1),base_model:kc,model_type:z.literal("onnx")}),by=z.union([d2,az]),Ule=z.object({model_name:z.string().min(1),base_model:kc}),Vle=z.object({model_name:z.string().min(1),base_model:kc}),eVe=e=>Vle.safeParse(e).success,Gle=z.object({model_name:z.string().min(1),base_model:kc}),tVe=e=>Gle.safeParse(e).success,qle=z.object({model_name:z.string().min(1),base_model:kc}),Hle=z.object({model_name:z.string().min(1),base_model:kc}),nVe=e=>Hle.safeParse(e).success,rVe=e=>qle.safeParse(e).success,Wle=z.number().min(0).max(1),iVe=e=>Wle.safeParse(e).success;z.enum(["fp16","fp32"]);const Kle=z.number().min(1).max(10),oVe=e=>Kle.safeParse(e).success,Qle=z.number().min(1).max(10),aVe=e=>Qle.safeParse(e).success,Xle=z.number().min(0).max(1),sVe=e=>Xle.safeParse(e).success;z.enum(["box","gaussian"]);z.enum(["unmasked","mask","edge"]);const zk={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,perlin:0,positivePrompt:"",negativePrompt:"",scheduler:"euler",maskBlur:16,maskBlurMethod:"box",canvasCoherenceMode:"unmasked",canvasCoherenceSteps:20,canvasCoherenceStrength:.3,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,infillTileSize:32,infillPatchmatchDownscaleSize:1,variationAmount:.1,width:512,shouldUseSymmetry:!1,horizontalSymmetrySteps:0,verticalSymmetrySteps:0,model:null,vae:null,vaePrecision:"fp32",seamlessXAxis:!1,seamlessYAxis:!1,clipSkip:0,shouldUseCpuNoise:!0,shouldShowAdvancedOptions:!1,aspectRatio:null,shouldLockAspectRatio:!1},Yle=zk,sz=nr({name:"generation",initialState:Yle,reducers:{setPositivePrompt:(e,t)=>{e.positivePrompt=t.payload},setNegativePrompt:(e,t)=>{e.negativePrompt=t.payload},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},clampSymmetrySteps:e=>{e.horizontalSymmetrySteps=Bu(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=Bu(e.verticalSymmetrySteps,0,e.steps)},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},toggleSize:e=>{const[t,n]=[e.width,e.height];e.width=n,e.height=t},setScheduler:(e,t)=>{e.scheduler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setSeamlessXAxis:(e,t)=>{e.seamlessXAxis=t.payload},setSeamlessYAxis:(e,t)=>{e.seamlessYAxis=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},resetParametersState:e=>({...e,...zk}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setMaskBlur:(e,t)=>{e.maskBlur=t.payload},setMaskBlurMethod:(e,t)=>{e.maskBlurMethod=t.payload},setCanvasCoherenceMode:(e,t)=>{e.canvasCoherenceMode=t.payload},setCanvasCoherenceSteps:(e,t)=>{e.canvasCoherenceSteps=t.payload},setCanvasCoherenceStrength:(e,t)=>{e.canvasCoherenceStrength=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setInfillTileSize:(e,t)=>{e.infillTileSize=t.payload},setInfillPatchmatchDownscaleSize:(e,t)=>{e.infillPatchmatchDownscaleSize=t.payload},setShouldUseSymmetry:(e,t)=>{e.shouldUseSymmetry=t.payload},setHorizontalSymmetrySteps:(e,t)=>{e.horizontalSymmetrySteps=t.payload},setVerticalSymmetrySteps:(e,t)=>{e.verticalSymmetrySteps=t.payload},initialImageChanged:(e,t)=>{const{image_name:n,width:r,height:i}=t.payload;e.initialImage={imageName:n,width:r,height:i}},modelChanged:(e,t)=>{if(e.model=t.payload,e.model===null)return;const{maxClip:n}=Mse[e.model.base_model];e.clipSkip=Bu(e.clipSkip,0,n)},vaeSelected:(e,t)=>{e.vae=t.payload},vaePrecisionChanged:(e,t)=>{e.vaePrecision=t.payload},setClipSkip:(e,t)=>{e.clipSkip=t.payload},shouldUseCpuNoiseChanged:(e,t)=>{e.shouldUseCpuNoise=t.payload},setAspectRatio:(e,t)=>{const n=t.payload;e.aspectRatio=n,n&&(e.height=Ho(e.width/n,8))},setShouldLockAspectRatio:(e,t)=>{e.shouldLockAspectRatio=t.payload}},extraReducers:e=>{e.addCase(Uae,(t,n)=>{var i;const r=(i=n.payload.sd)==null?void 0:i.defaultModel;if(r&&!t.model){const[o,a,s]=r.split("/"),l=d2.safeParse({model_name:s,base_model:o,model_type:a});l.success&&(t.model=l.data)}}),e.addMatcher(Ose,(t,n)=>{n.payload.type==="t2i_adapter"&&(t.width=Ho(t.width,64),t.height=Ho(t.height,64))})}}),{clampSymmetrySteps:lVe,clearInitialImage:jk,resetParametersState:uVe,resetSeed:cVe,setCfgScale:dVe,setWidth:kI,setHeight:PI,toggleSize:fVe,setImg2imgStrength:hVe,setInfillMethod:Zle,setIterations:pVe,setPerlin:gVe,setPositivePrompt:Jle,setNegativePrompt:mVe,setScheduler:yVe,setMaskBlur:vVe,setMaskBlurMethod:bVe,setCanvasCoherenceMode:_Ve,setCanvasCoherenceSteps:SVe,setCanvasCoherenceStrength:xVe,setSeed:wVe,setSeedWeights:CVe,setShouldFitToWidthHeight:AVe,setShouldGenerateVariations:EVe,setShouldRandomizeSeed:TVe,setSteps:kVe,setThreshold:PVe,setInfillTileSize:IVe,setInfillPatchmatchDownscaleSize:RVe,setVariationAmount:OVe,setShouldUseSymmetry:MVe,setHorizontalSymmetrySteps:$Ve,setVerticalSymmetrySteps:NVe,initialImageChanged:f2,modelChanged:zu,vaeSelected:lz,setSeamlessXAxis:DVe,setSeamlessYAxis:LVe,setClipSkip:FVe,shouldUseCpuNoiseChanged:BVe,setAspectRatio:eue,setShouldLockAspectRatio:zVe,vaePrecisionChanged:jVe}=sz.actions,tue=sz.reducer,xv=(e,t,n,r,i,o,a)=>{const s=Math.floor(e/2-(n+i/2)*a),l=Math.floor(t/2-(r+o/2)*a);return{x:s,y:l}},wv=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r,s=Math.min(1,Math.min(o,a));return s||1},UVe=.999,VVe=.1,GVe=20,Cv=.95,qVe=30,HVe=10,nue=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),pf=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a<i;)if(s+=64,t===n){r.width=512,r.height=512;break}else o>1?(r.width=s,r.height=Ho(s/o,64)):o<1&&(r.height=s,r.width=Ho(s*o,64)),a=r.width*r.height;return r},rue=e=>({width:Ho(e.width,64),height:Ho(e.height,64)}),WVe=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],KVe=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],uz=e=>e.kind==="line"&&e.layer==="mask",QVe=e=>e.kind==="line"&&e.layer==="base",iue=e=>e.kind==="image"&&e.layer==="base",XVe=e=>e.kind==="fillRect"&&e.layer==="base",YVe=e=>e.kind==="eraseRect"&&e.layer==="base",oue=e=>e.kind==="line",Ag={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},cz={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"none",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,futureLayerStates:[],isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Ag,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAntialias:!0,shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush",batchIds:[]},dz=nr({name:"canvas",initialState:cz,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(Ut(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!uz(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{width:r,height:i}=n,{stageDimensions:o}=e,a={width:yv(Bu(r,64,512),64),height:yv(Bu(i,64,512),64)},s={x:Ho(r/2-a.width/2,64),y:Ho(i/2-a.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const c=pf(a);e.scaledBoundingBoxDimensions=c}e.boundingBoxDimensions=a,e.boundingBoxCoordinates=s,e.pastLayerStates.push(Ut(e.layerState)),e.layerState={...Ut(Ag),objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[],e.batchIds=[];const l=wv(o.width,o.height,r,i,Cv),u=xv(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=u},setBoundingBoxDimensions:(e,t)=>{const n=rue(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=pf(n);e.scaledBoundingBoxDimensions=r}},flipBoundingBoxAxes:e=>{const[t,n]=[e.boundingBoxDimensions.width,e.boundingBoxDimensions.height],[r,i]=[e.scaledBoundingBoxDimensions.width,e.scaledBoundingBoxDimensions.height];e.boundingBoxDimensions={width:n,height:t},e.scaledBoundingBoxDimensions={width:i,height:r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=nue(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},canvasBatchIdAdded:(e,t)=>{e.batchIds.push(t.payload)},canvasBatchIdsReset:e=>{e.batchIds=[]},stagingAreaInitialized:(e,t)=>{const{boundingBox:n}=t.payload;e.layerState.stagingArea={boundingBox:n,images:[],selectedImageIndex:-1}},addImageToStagingArea:(e,t)=>{const n=t.payload;!n||!e.layerState.stagingArea.boundingBox||(e.pastLayerStates.push(Ut(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...e.layerState.stagingArea.boundingBox,imageName:n.image_name}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(Ut(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea=Ut(Ut(Ag)).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Ut(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(Ut(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Ut(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(oue);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Ut(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Ut(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(Ut(e.layerState)),e.layerState=Ut(Ag),e.futureLayerStates=[],e.batchIds=[]},canvasResized:(e,t)=>{const{width:n,height:r}=t.payload,i={width:Math.floor(n),height:Math.floor(r)};if(e.stageDimensions=i,!e.layerState.objects.find(iue)){const o=wv(i.width,i.height,512,512,Cv),a=xv(i.width,i.height,0,0,512,512,o),s={width:512,height:512};if(e.stageScale=o,e.stageCoordinates=a,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=s,e.boundingBoxScaleMethod==="auto"){const l=pf(s);e.scaledBoundingBoxDimensions=l}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const c=r?1:wv(i,o,l,u,Cv),d=xv(i,o,a,s,l,u,c);e.stageScale=c,e.stageCoordinates=d}else{const c=wv(i,o,512,512,Cv),d=xv(i,o,0,0,512,512,c),f={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=d,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,e.boundingBoxScaleMethod==="auto"){const h=pf(f);e.scaledBoundingBoxDimensions=h}}},nextStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex+1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t>n?0:t},prevStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex-1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t<0?n:t},commitStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Ut(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const r=t[n];r&&e.layerState.objects.push({...r}),e.layerState.stagingArea=Ut(Ag).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:yv(Bu(o,64,512),64),height:yv(Bu(a,64,512),64)},l={x:Ho(o/2-s.width/2,64),y:Ho(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=pf(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=pf(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldAntialias:(e,t)=>{e.shouldAntialias=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(Ut(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}},extraReducers:e=>{e.addCase(s2,(t,n)=>{const r=n.payload.data.batch_status;t.batchIds.includes(r.batch_id)&&r.in_progress===0&&r.pending===0&&(t.batchIds=t.batchIds.filter(i=>i!==r.batch_id))}),e.addCase(eue,(t,n)=>{const r=n.payload;r&&(t.boundingBoxDimensions.height=Ho(t.boundingBoxDimensions.width/r,64),t.scaledBoundingBoxDimensions.height=Ho(t.scaledBoundingBoxDimensions.width/r,64))})}}),{addEraseRect:ZVe,addFillRect:JVe,addImageToStagingArea:aue,addLine:eGe,addPointToCurrentLine:tGe,clearCanvasHistory:nGe,clearMask:rGe,commitColorPickerColor:iGe,commitStagingAreaImage:sue,discardStagedImages:lue,fitBoundingBoxToStage:oGe,mouseLeftCanvas:aGe,nextStagingAreaImage:sGe,prevStagingAreaImage:lGe,redo:uGe,resetCanvas:Uk,resetCanvasInteractionState:cGe,resetCanvasView:dGe,setBoundingBoxCoordinates:fGe,setBoundingBoxDimensions:II,setBoundingBoxPreviewFill:hGe,setBoundingBoxScaleMethod:pGe,flipBoundingBoxAxes:gGe,setBrushColor:mGe,setBrushSize:yGe,setColorPickerColor:vGe,setCursorPosition:bGe,setInitialCanvasImage:fz,setIsDrawing:_Ge,setIsMaskEnabled:SGe,setIsMouseOverBoundingBox:xGe,setIsMoveBoundingBoxKeyHeld:wGe,setIsMoveStageKeyHeld:CGe,setIsMovingBoundingBox:AGe,setIsMovingStage:EGe,setIsTransformingBoundingBox:TGe,setLayer:kGe,setMaskColor:PGe,setMergedCanvas:uue,setShouldAutoSave:IGe,setShouldCropToBoundingBoxOnSave:RGe,setShouldDarkenOutsideBoundingBox:OGe,setShouldLockBoundingBox:MGe,setShouldPreserveMaskedArea:$Ge,setShouldShowBoundingBox:NGe,setShouldShowBrush:DGe,setShouldShowBrushPreview:LGe,setShouldShowCanvasDebugInfo:FGe,setShouldShowCheckboardTransparency:BGe,setShouldShowGrid:zGe,setShouldShowIntermediates:jGe,setShouldShowStagingImage:UGe,setShouldShowStagingOutline:VGe,setShouldSnapToGrid:GGe,setStageCoordinates:qGe,setStageScale:HGe,setTool:WGe,toggleShouldLockBoundingBox:KGe,toggleTool:QGe,undo:XGe,setScaledBoundingBoxDimensions:YGe,setShouldRestrictStrokesToBox:ZGe,stagingAreaInitialized:cue,setShouldAntialias:JGe,canvasResized:eqe,canvasBatchIdAdded:due,canvasBatchIdsReset:fue}=dz.actions,hue=dz.reducer,pue={isModalOpen:!1,imagesToChange:[]},hz=nr({name:"changeBoardModal",initialState:pue,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:tqe,imagesToChangeSelected:nqe,changeBoardReset:rqe}=hz.actions,gue=hz.reducer,mue={imagesToDelete:[],isModalOpen:!1},pz=nr({name:"deleteImageModal",initialState:mue,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:Vk,imagesToDeleteSelected:yue,imageDeletionCanceled:iqe}=pz.actions,vue=pz.reducer,Gk={maxPrompts:100,combinatorial:!0,prompts:[],parsingError:void 0,isError:!1,isLoading:!1,seedBehaviour:"PER_ITERATION"},bue=Gk,gz=nr({name:"dynamicPrompts",initialState:bue,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=Gk.maxPrompts},combinatorialToggled:e=>{e.combinatorial=!e.combinatorial},promptsChanged:(e,t)=>{e.prompts=t.payload},parsingErrorChanged:(e,t)=>{e.parsingError=t.payload},isErrorChanged:(e,t)=>{e.isError=t.payload},isLoadingChanged:(e,t)=>{e.isLoading=t.payload},seedBehaviourChanged:(e,t)=>{e.seedBehaviour=t.payload}}}),{maxPromptsChanged:_ue,maxPromptsReset:Sue,combinatorialToggled:xue,promptsChanged:wue,parsingErrorChanged:Cue,isErrorChanged:RI,isLoadingChanged:bC,seedBehaviourChanged:oqe}=gz.actions,Aue=gz.reducer,ii=["general"],to=["control","mask","user","other"],Eue=100,Av=20;var y_=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},v_=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Tue=Object.defineProperty,kue=Object.defineProperties,Pue=Object.getOwnPropertyDescriptors,b_=Object.getOwnPropertySymbols,mz=Object.prototype.hasOwnProperty,yz=Object.prototype.propertyIsEnumerable,OI=function(e,t,n){return t in e?Tue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Cr=function(e,t){for(var n in t||(t={}))mz.call(t,n)&&OI(e,n,t[n]);if(b_)for(var r=0,i=b_(t);r<i.length;r++){var n=i[r];yz.call(t,n)&&OI(e,n,t[n])}return e},js=function(e,t){return kue(e,Pue(t))},MI=function(e,t){var n={};for(var r in e)mz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&b_)for(var i=0,o=b_(e);i<o.length;i++){var r=o[i];t.indexOf(r)<0&&yz.call(e,r)&&(n[r]=e[r])}return n},__=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},er;(function(e){e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"})(er||(er={}));function Iue(e){return{status:e,isUninitialized:e===er.uninitialized,isLoading:e===er.pending,isSuccess:e===er.fulfilled,isError:e===er.rejected}}function Rue(e){return new RegExp("(^|:)//").test(e)}var Oue=function(e){return e.replace(/\/$/,"")},Mue=function(e){return e.replace(/^\//,"")};function $ue(e,t){if(!e)return t;if(!t)return e;if(Rue(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Oue(e),t=Mue(t),""+e+n+t}var $I=function(e){return[].concat.apply([],e)};function Nue(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function Due(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var NI=fs;function vz(e,t){if(e===t||!(NI(e)&&NI(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,o=Array.isArray(t)?[]:{},a=0,s=n;a<s.length;a++){var l=s[a];o[l]=vz(e[l],t[l]),i&&(i=e[l]===o[l])}return i?e:o}var DI=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},Lue=function(e){return e.status>=200&&e.status<=299},Fue=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function LI(e){if(!fs(e))return e;for(var t=Cr({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],o=i[0],a=i[1];a===void 0&&delete t[o]}return t}function Bue(e){var t=this;e===void 0&&(e={});var n=e,r=n.baseUrl,i=n.prepareHeaders,o=i===void 0?function(g){return g}:i,a=n.fetchFn,s=a===void 0?DI:a,l=n.paramsSerializer,u=n.isJsonContentType,c=u===void 0?Fue:u,d=n.jsonContentType,f=d===void 0?"application/json":d,h=n.jsonReplacer,p=n.timeout,m=n.responseHandler,_=n.validateStatus,b=MI(n,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&s===DI&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(g,v){return __(t,null,function(){var S,w,x,C,T,E,P,N,O,A,k,D,L,M,R,$,B,U,G,Y,ee,J,j,Q,ne,se,be,ce,bt,ot,ze,mt,Ie,en,Ir,Dn;return y_(this,function(Tn){switch(Tn.label){case 0:return S=v.signal,w=v.getState,x=v.extra,C=v.endpoint,T=v.forced,E=v.type,N=typeof g=="string"?{url:g}:g,O=N.url,A=N.headers,k=A===void 0?new Headers(b.headers):A,D=N.params,L=D===void 0?void 0:D,M=N.responseHandler,R=M===void 0?m??"json":M,$=N.validateStatus,B=$===void 0?_??Lue:$,U=N.timeout,G=U===void 0?p:U,Y=MI(N,["url","headers","params","responseHandler","validateStatus","timeout"]),ee=Cr(js(Cr({},b),{signal:S}),Y),k=new Headers(LI(k)),J=ee,[4,o(k,{getState:w,extra:x,endpoint:C,forced:T,type:E})];case 1:J.headers=Tn.sent()||k,j=function(tn){return typeof tn=="object"&&(fs(tn)||Array.isArray(tn)||typeof tn.toJSON=="function")},!ee.headers.has("content-type")&&j(ee.body)&&ee.headers.set("content-type",f),j(ee.body)&&c(ee.headers)&&(ee.body=JSON.stringify(ee.body,h)),L&&(Q=~O.indexOf("?")?"&":"?",ne=l?l(L):new URLSearchParams(LI(L)),O+=Q+ne),O=$ue(r,O),se=new Request(O,ee),be=se.clone(),P={request:be},bt=!1,ot=G&&setTimeout(function(){bt=!0,v.abort()},G),Tn.label=2;case 2:return Tn.trys.push([2,4,5,6]),[4,s(se)];case 3:return ce=Tn.sent(),[3,6];case 4:return ze=Tn.sent(),[2,{error:{status:bt?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ze)},meta:P}];case 5:return ot&&clearTimeout(ot),[7];case 6:mt=ce.clone(),P.response=mt,en="",Tn.label=7;case 7:return Tn.trys.push([7,9,,10]),[4,Promise.all([y(ce,R).then(function(tn){return Ie=tn},function(tn){return Ir=tn}),mt.text().then(function(tn){return en=tn},function(){})])];case 8:if(Tn.sent(),Ir)throw Ir;return[3,10];case 9:return Dn=Tn.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ce.status,data:en,error:String(Dn)},meta:P}];case 10:return[2,B(ce,Ie)?{data:Ie,meta:P}:{error:{status:ce.status,data:Ie},meta:P}]}})})};function y(g,v){return __(this,null,function(){var S;return y_(this,function(w){switch(w.label){case 0:return typeof v=="function"?[2,v(g)]:(v==="content-type"&&(v=c(g.headers)?"json":"text"),v!=="json"?[3,2]:[4,g.text()]);case 1:return S=w.sent(),[2,S.length?JSON.parse(S):null];case 2:return[2,g.text()]}})})}}var FI=function(){function e(t,n){n===void 0&&(n=void 0),this.value=t,this.meta=n}return e}(),qk=Ne("__rtkq/focused"),bz=Ne("__rtkq/unfocused"),Hk=Ne("__rtkq/online"),_z=Ne("__rtkq/offline"),rl;(function(e){e.query="query",e.mutation="mutation"})(rl||(rl={}));function Sz(e){return e.type===rl.query}function zue(e){return e.type===rl.mutation}function xz(e,t,n,r,i,o){return jue(e)?e(t,n,r,i).map(bA).map(o):Array.isArray(e)?e.map(bA).map(o):[]}function jue(e){return typeof e=="function"}function bA(e){return typeof e=="string"?{type:e}:e}function _C(e){return e!=null}var r0=Symbol("forceQueryFn"),_A=function(e){return typeof e[r0]=="function"};function Uue(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,o=e.context,a=new Map,s=new Map,l=i.internalActions,u=l.unsubscribeQueryResult,c=l.removeMutationResult,d=l.updateSubscriptionOptions;return{buildInitiateQuery:y,buildInitiateMutation:g,getRunningQueryThunk:p,getRunningMutationThunk:m,getRunningQueriesThunk:_,getRunningMutationsThunk:b,getRunningOperationPromises:h,removalWarning:f};function f(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
+       Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
+       See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}function h(){typeof process<"u";var v=function(S){return Array.from(S.values()).flatMap(function(w){return w?Object.values(w):[]})};return v_(v_([],v(a)),v(s)).filter(_C)}function p(v,S){return function(w){var x,C=o.endpointDefinitions[v],T=t({queryArgs:S,endpointDefinition:C,endpointName:v});return(x=a.get(w))==null?void 0:x[T]}}function m(v,S){return function(w){var x;return(x=s.get(w))==null?void 0:x[S]}}function _(){return function(v){return Object.values(a.get(v)||{}).filter(_C)}}function b(){return function(v){return Object.values(s.get(v)||{}).filter(_C)}}function y(v,S){var w=function(x,C){var T=C===void 0?{}:C,E=T.subscribe,P=E===void 0?!0:E,N=T.forceRefetch,O=T.subscriptionOptions,A=r0,k=T[A];return function(D,L){var M,R,$=t({queryArgs:x,endpointDefinition:S,endpointName:v}),B=n((M={type:"query",subscribe:P,forceRefetch:N,subscriptionOptions:O,endpointName:v,originalArgs:x,queryCacheKey:$},M[r0]=k,M)),U=i.endpoints[v].select(x),G=D(B),Y=U(L()),ee=G.requestId,J=G.abort,j=Y.requestId!==ee,Q=(R=a.get(D))==null?void 0:R[$],ne=function(){return U(L())},se=Object.assign(k?G.then(ne):j&&!Q?Promise.resolve(Y):Promise.all([Q,G]).then(ne),{arg:x,requestId:ee,subscriptionOptions:O,queryCacheKey:$,abort:J,unwrap:function(){return __(this,null,function(){var ce;return y_(this,function(bt){switch(bt.label){case 0:return[4,se];case 1:if(ce=bt.sent(),ce.isError)throw ce.error;return[2,ce.data]}})})},refetch:function(){return D(w(x,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){P&&D(u({queryCacheKey:$,requestId:ee}))},updateSubscriptionOptions:function(ce){se.subscriptionOptions=ce,D(d({endpointName:v,requestId:ee,queryCacheKey:$,options:ce}))}});if(!Q&&!j&&!k){var be=a.get(D)||{};be[$]=se,a.set(D,be),se.then(function(){delete be[$],Object.keys(be).length||a.delete(D)})}return se}};return w}function g(v){return function(S,w){var x=w===void 0?{}:w,C=x.track,T=C===void 0?!0:C,E=x.fixedCacheKey;return function(P,N){var O=r({type:"mutation",endpointName:v,originalArgs:S,track:T,fixedCacheKey:E}),A=P(O),k=A.requestId,D=A.abort,L=A.unwrap,M=A.unwrap().then(function(U){return{data:U}}).catch(function(U){return{error:U}}),R=function(){P(c({requestId:k,fixedCacheKey:E}))},$=Object.assign(M,{arg:A.arg,requestId:k,abort:D,unwrap:L,unsubscribe:R,reset:R}),B=s.get(P)||{};return s.set(P,B),B[k]=$,$.then(function(){delete B[k],Object.keys(B).length||s.delete(P)}),E&&(B[E]=$,$.then(function(){B[E]===$&&(delete B[E],Object.keys(B).length||s.delete(P))})),$}}}}function BI(e){return e}function Vue(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,o=e.serializeQueryArgs,a=e.api,s=function(g,v,S){return function(w){var x=i[g];w(a.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:v,endpointDefinition:x,endpointName:g}),patches:S}))}},l=function(g,v,S){return function(w,x){var C,T,E=a.endpoints[g].select(v)(x()),P={patches:[],inversePatches:[],undo:function(){return w(a.util.patchQueryData(g,v,P.inversePatches))}};if(E.status===er.uninitialized)return P;if("data"in E)if(Oo(E.data)){var N=ak(E.data,S),O=N[1],A=N[2];(C=P.patches).push.apply(C,O),(T=P.inversePatches).push.apply(T,A)}else{var k=S(E.data);P.patches.push({op:"replace",path:[],value:k}),P.inversePatches.push({op:"replace",path:[],value:E.data})}return w(a.util.patchQueryData(g,v,P.patches)),P}},u=function(g,v,S){return function(w){var x;return w(a.endpoints[g].initiate(v,(x={subscribe:!1,forceRefetch:!0},x[r0]=function(){return{data:S}},x)))}},c=function(g,v){return __(t,[g,v],function(S,w){var x,C,T,E,P,N,O,A,k,D,L,M,R,$,B,U,G,Y,ee=w.signal,J=w.abort,j=w.rejectWithValue,Q=w.fulfillWithValue,ne=w.dispatch,se=w.getState,be=w.extra;return y_(this,function(ce){switch(ce.label){case 0:x=i[S.endpointName],ce.label=1;case 1:return ce.trys.push([1,8,,13]),C=BI,T=void 0,E={signal:ee,abort:J,dispatch:ne,getState:se,extra:be,endpoint:S.endpointName,type:S.type,forced:S.type==="query"?d(S,se()):void 0},P=S.type==="query"?S[r0]:void 0,P?(T=P(),[3,6]):[3,2];case 2:return x.query?[4,r(x.query(S.originalArgs),E,x.extraOptions)]:[3,4];case 3:return T=ce.sent(),x.transformResponse&&(C=x.transformResponse),[3,6];case 4:return[4,x.queryFn(S.originalArgs,E,x.extraOptions,function(bt){return r(bt,E,x.extraOptions)})];case 5:T=ce.sent(),ce.label=6;case 6:if(typeof process<"u",T.error)throw new FI(T.error,T.meta);return L=Q,[4,C(T.data,T.meta,S.originalArgs)];case 7:return[2,L.apply(void 0,[ce.sent(),(G={fulfilledTimeStamp:Date.now(),baseQueryMeta:T.meta},G[sd]=!0,G)])];case 8:if(M=ce.sent(),R=M,!(R instanceof FI))return[3,12];$=BI,x.query&&x.transformErrorResponse&&($=x.transformErrorResponse),ce.label=9;case 9:return ce.trys.push([9,11,,12]),B=j,[4,$(R.value,R.meta,S.originalArgs)];case 10:return[2,B.apply(void 0,[ce.sent(),(Y={baseQueryMeta:R.meta},Y[sd]=!0,Y)])];case 11:return U=ce.sent(),R=U,[3,12];case 12:throw typeof process<"u",console.error(R),R;case 13:return[2]}})})};function d(g,v){var S,w,x,C,T=(w=(S=v[n])==null?void 0:S.queries)==null?void 0:w[g.queryCacheKey],E=(x=v[n])==null?void 0:x.config.refetchOnMountOrArgChange,P=T==null?void 0:T.fulfilledTimeStamp,N=(C=g.forceRefetch)!=null?C:g.subscribe&&E;return N?N===!0||(Number(new Date)-Number(P))/1e3>=N:!1}var f=Yb(n+"/executeQuery",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[sd]=!0,g},condition:function(g,v){var S=v.getState,w,x,C,T=S(),E=(x=(w=T[n])==null?void 0:w.queries)==null?void 0:x[g.queryCacheKey],P=E==null?void 0:E.fulfilledTimeStamp,N=g.originalArgs,O=E==null?void 0:E.originalArgs,A=i[g.endpointName];return _A(g)?!0:(E==null?void 0:E.status)==="pending"?!1:d(g,T)||Sz(A)&&((C=A==null?void 0:A.forceRefetch)!=null&&C.call(A,{currentArg:N,previousArg:O,endpointState:E,state:T}))?!0:!P},dispatchConditionRejection:!0}),h=Yb(n+"/executeMutation",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[sd]=!0,g}}),p=function(g){return"force"in g},m=function(g){return"ifOlderThan"in g},_=function(g,v,S){return function(w,x){var C=p(S)&&S.force,T=m(S)&&S.ifOlderThan,E=function(A){return A===void 0&&(A=!0),a.endpoints[g].initiate(v,{forceRefetch:A})},P=a.endpoints[g].select(v)(x());if(C)w(E());else if(T){var N=P==null?void 0:P.fulfilledTimeStamp;if(!N){w(E());return}var O=(Number(new Date)-Number(new Date(N)))/1e3>=T;O&&w(E())}else w(E(!1))}};function b(g){return function(v){var S,w;return((w=(S=v==null?void 0:v.meta)==null?void 0:S.arg)==null?void 0:w.endpointName)===g}}function y(g,v){return{matchPending:dh(qS(g),b(v)),matchFulfilled:dh(Ec(g),b(v)),matchRejected:dh(Kh(g),b(v))}}return{queryThunk:f,mutationThunk:h,prefetch:_,updateQueryData:l,upsertQueryData:u,patchQueryData:s,buildMatchThunkActions:y}}function wz(e,t,n,r){return xz(n[e.meta.arg.endpointName][t],Ec(e)?e.payload:void 0,uy(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function Ev(e,t,n){var r=e[t];r&&n(r)}function i0(e){var t;return(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)!=null?t:e.requestId}function zI(e,t,n){var r=e[i0(t)];r&&n(r)}var Zp={};function Gue(e){var t=e.reducerPath,n=e.queryThunk,r=e.mutationThunk,i=e.context,o=i.endpointDefinitions,a=i.apiUid,s=i.extractRehydrationInfo,l=i.hasRehydrationInfo,u=e.assertTagType,c=e.config,d=Ne(t+"/resetApiState"),f=nr({name:t+"/queries",initialState:Zp,reducers:{removeQueryResult:{reducer:function(S,w){var x=w.payload.queryCacheKey;delete S[x]},prepare:U1()},queryResultPatched:function(S,w){var x=w.payload,C=x.queryCacheKey,T=x.patches;Ev(S,C,function(E){E.data=Z3(E.data,T.concat())})}},extraReducers:function(S){S.addCase(n.pending,function(w,x){var C=x.meta,T=x.meta.arg,E,P,N=_A(T);(T.subscribe||N)&&((P=w[E=T.queryCacheKey])!=null||(w[E]={status:er.uninitialized,endpointName:T.endpointName})),Ev(w,T.queryCacheKey,function(O){O.status=er.pending,O.requestId=N&&O.requestId?O.requestId:C.requestId,T.originalArgs!==void 0&&(O.originalArgs=T.originalArgs),O.startedTimeStamp=C.startedTimeStamp})}).addCase(n.fulfilled,function(w,x){var C=x.meta,T=x.payload;Ev(w,C.arg.queryCacheKey,function(E){var P;if(!(E.requestId!==C.requestId&&!_A(C.arg))){var N=o[C.arg.endpointName].merge;if(E.status=er.fulfilled,N)if(E.data!==void 0){var O=C.fulfilledTimeStamp,A=C.arg,k=C.baseQueryMeta,D=C.requestId,L=Ac(E.data,function(M){return N(M,T,{arg:A.originalArgs,baseQueryMeta:k,fulfilledTimeStamp:O,requestId:D})});E.data=L}else E.data=T;else E.data=(P=o[C.arg.endpointName].structuralSharing)==null||P?vz(uo(E.data)?JT(E.data):E.data,T):T;delete E.error,E.fulfilledTimeStamp=C.fulfilledTimeStamp}})}).addCase(n.rejected,function(w,x){var C=x.meta,T=C.condition,E=C.arg,P=C.requestId,N=x.error,O=x.payload;Ev(w,E.queryCacheKey,function(A){if(!T){if(A.requestId!==P)return;A.status=er.rejected,A.error=O??N}})}).addMatcher(l,function(w,x){for(var C=s(x).queries,T=0,E=Object.entries(C);T<E.length;T++){var P=E[T],N=P[0],O=P[1];((O==null?void 0:O.status)===er.fulfilled||(O==null?void 0:O.status)===er.rejected)&&(w[N]=O)}})}}),h=nr({name:t+"/mutations",initialState:Zp,reducers:{removeMutationResult:{reducer:function(S,w){var x=w.payload,C=i0(x);C in S&&delete S[C]},prepare:U1()}},extraReducers:function(S){S.addCase(r.pending,function(w,x){var C=x.meta,T=x.meta,E=T.requestId,P=T.arg,N=T.startedTimeStamp;P.track&&(w[i0(C)]={requestId:E,status:er.pending,endpointName:P.endpointName,startedTimeStamp:N})}).addCase(r.fulfilled,function(w,x){var C=x.payload,T=x.meta;T.arg.track&&zI(w,T,function(E){E.requestId===T.requestId&&(E.status=er.fulfilled,E.data=C,E.fulfilledTimeStamp=T.fulfilledTimeStamp)})}).addCase(r.rejected,function(w,x){var C=x.payload,T=x.error,E=x.meta;E.arg.track&&zI(w,E,function(P){P.requestId===E.requestId&&(P.status=er.rejected,P.error=C??T)})}).addMatcher(l,function(w,x){for(var C=s(x).mutations,T=0,E=Object.entries(C);T<E.length;T++){var P=E[T],N=P[0],O=P[1];((O==null?void 0:O.status)===er.fulfilled||(O==null?void 0:O.status)===er.rejected)&&N!==(O==null?void 0:O.requestId)&&(w[N]=O)}})}}),p=nr({name:t+"/invalidation",initialState:Zp,reducers:{},extraReducers:function(S){S.addCase(f.actions.removeQueryResult,function(w,x){for(var C=x.payload.queryCacheKey,T=0,E=Object.values(w);T<E.length;T++)for(var P=E[T],N=0,O=Object.values(P);N<O.length;N++){var A=O[N],k=A.indexOf(C);k!==-1&&A.splice(k,1)}}).addMatcher(l,function(w,x){for(var C,T,E,P,N=s(x).provided,O=0,A=Object.entries(N);O<A.length;O++)for(var k=A[O],D=k[0],L=k[1],M=0,R=Object.entries(L);M<R.length;M++)for(var $=R[M],B=$[0],U=$[1],G=(P=(T=(C=w[D])!=null?C:w[D]={})[E=B||"__internal_without_id"])!=null?P:T[E]=[],Y=0,ee=U;Y<ee.length;Y++){var J=ee[Y],j=G.includes(J);j||G.push(J)}}).addMatcher(Qi(Ec(n),uy(n)),function(w,x){for(var C,T,E,P,N=wz(x,"providesTags",o,u),O=x.meta.arg.queryCacheKey,A=0,k=Object.values(w);A<k.length;A++)for(var D=k[A],L=0,M=Object.values(D);L<M.length;L++){var R=M[L],$=R.indexOf(O);$!==-1&&R.splice($,1)}for(var B=0,U=N;B<U.length;B++){var G=U[B],Y=G.type,ee=G.id,J=(P=(T=(C=w[Y])!=null?C:w[Y]={})[E=ee||"__internal_without_id"])!=null?P:T[E]=[],j=J.includes(O);j||J.push(O)}})}}),m=nr({name:t+"/subscriptions",initialState:Zp,reducers:{updateSubscriptionOptions:function(S,w){},unsubscribeQueryResult:function(S,w){},internal_probeSubscription:function(S,w){}}}),_=nr({name:t+"/internalSubscriptions",initialState:Zp,reducers:{subscriptionsUpdated:{reducer:function(S,w){return Z3(S,w.payload)},prepare:U1()}}}),b=nr({name:t+"/config",initialState:Cr({online:Nue(),focused:Due(),middlewareRegistered:!1},c),reducers:{middlewareRegistered:function(S,w){var x=w.payload;S.middlewareRegistered=S.middlewareRegistered==="conflict"||a!==x?"conflict":!0}},extraReducers:function(S){S.addCase(Hk,function(w){w.online=!0}).addCase(_z,function(w){w.online=!1}).addCase(qk,function(w){w.focused=!0}).addCase(bz,function(w){w.focused=!1}).addMatcher(l,function(w){return Cr({},w)})}}),y=_p({queries:f.reducer,mutations:h.reducer,provided:p.reducer,subscriptions:_.reducer,config:b.reducer}),g=function(S,w){return y(d.match(w)?void 0:S,w)},v=js(Cr(Cr(Cr(Cr(Cr({},b.actions),f.actions),m.actions),_.actions),h.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:d});return{reducer:g,actions:v}}var ld=Symbol.for("RTKQ/skipToken"),Cz={status:er.uninitialized},jI=Ac(Cz,function(){}),UI=Ac(Cz,function(){});function que(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(c){return jI},i=function(c){return UI};return{buildQuerySelector:s,buildMutationSelector:l,selectInvalidatedBy:u};function o(c){return Cr(Cr({},c),Iue(c.status))}function a(c){var d=c[n];return d}function s(c,d){return function(f){var h=t({queryArgs:f,endpointDefinition:d,endpointName:c}),p=function(_){var b,y,g;return(g=(y=(b=a(_))==null?void 0:b.queries)==null?void 0:y[h])!=null?g:jI},m=f===ld?r:p;return Ii(m,o)}}function l(){return function(c){var d,f;typeof c=="object"?f=(d=i0(c))!=null?d:ld:f=c;var h=function(m){var _,b,y;return(y=(b=(_=a(m))==null?void 0:_.mutations)==null?void 0:b[f])!=null?y:UI},p=f===ld?i:h;return Ii(p,o)}}function u(c,d){for(var f,h=c[n],p=new Set,m=0,_=d.map(bA);m<_.length;m++){var b=_[m],y=h.provided[b.type];if(y)for(var g=(f=b.id!==void 0?y[b.id]:$I(Object.values(y)))!=null?f:[],v=0,S=g;v<S.length;v++){var w=S[v];p.add(w)}}return $I(Array.from(p.values()).map(function(x){var C=h.queries[x];return C?[{queryCacheKey:x,endpointName:C.endpointName,originalArgs:C.originalArgs}]:[]}))}}var Tv=WeakMap?new WeakMap:void 0,VI=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Tv==null?void 0:Tv.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return fs(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});fs(n)&&(Tv==null||Tv.set(n,o)),r=o}return t+"("+r+")"};function Hue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var i=Xb(function(c){var d,f;return(f=r.extractRehydrationInfo)==null?void 0:f.call(r,c,{reducerPath:(d=r.reducerPath)!=null?d:"api"})}),o=js(Cr({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},r),{extractRehydrationInfo:i,serializeQueryArgs:function(c){var d=VI;if("serializeQueryArgs"in c.endpointDefinition){var f=c.endpointDefinition.serializeQueryArgs;d=function(h){var p=f(h);return typeof p=="string"?p:VI(js(Cr({},h),{queryArgs:p}))}}else r.serializeQueryArgs&&(d=r.serializeQueryArgs);return d(c)},tagTypes:v_([],r.tagTypes||[])}),a={endpointDefinitions:{},batch:function(c){c()},apiUid:VS(),extractRehydrationInfo:i,hasRehydrationInfo:Xb(function(c){return i(c)!=null})},s={injectEndpoints:u,enhanceEndpoints:function(c){var d=c.addTagTypes,f=c.endpoints;if(d)for(var h=0,p=d;h<p.length;h++){var m=p[h];o.tagTypes.includes(m)||o.tagTypes.push(m)}if(f)for(var _=0,b=Object.entries(f);_<b.length;_++){var y=b[_],g=y[0],v=y[1];typeof v=="function"?v(a.endpointDefinitions[g]):Object.assign(a.endpointDefinitions[g]||{},v)}return s}},l=e.map(function(c){return c.init(s,o,a)});function u(c){for(var d=c.endpoints({query:function(v){return js(Cr({},v),{type:rl.query})},mutation:function(v){return js(Cr({},v),{type:rl.mutation})}}),f=0,h=Object.entries(d);f<h.length;f++){var p=h[f],m=p[0],_=p[1];if(!c.overrideExisting&&m in a.endpointDefinitions){typeof process<"u";continue}a.endpointDefinitions[m]=_;for(var b=0,y=l;b<y.length;b++){var g=y[b];g.injectEndpoint(m,_)}}return s}return s.injectEndpoints({endpoints:r.endpoints})}}function Wue(e){for(var t in e)return!1;return!0}var Kue=2147483647/1e3-1,Que=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,o=n.internalActions,a=o.removeQueryResult,s=o.unsubscribeQueryResult;function l(f){var h=i.currentSubscriptions[f];return!!h&&!Wue(h)}var u={},c=function(f,h,p){var m;if(s.match(f)){var _=h.getState()[t],b=f.payload.queryCacheKey;d(b,(m=_.queries[b])==null?void 0:m.endpointName,h,_.config)}if(n.util.resetApiState.match(f))for(var y=0,g=Object.entries(u);y<g.length;y++){var v=g[y],S=v[0],w=v[1];w&&clearTimeout(w),delete u[S]}if(r.hasRehydrationInfo(f))for(var _=h.getState()[t],x=r.extractRehydrationInfo(f).queries,C=0,T=Object.entries(x);C<T.length;C++){var E=T[C],b=E[0],P=E[1];d(b,P==null?void 0:P.endpointName,h,_.config)}};function d(f,h,p,m){var _,b=r.endpointDefinitions[h],y=(_=b==null?void 0:b.keepUnusedDataFor)!=null?_:m.keepUnusedDataFor;if(y!==1/0){var g=Math.max(0,Math.min(y,Kue));if(!l(f)){var v=u[f];v&&clearTimeout(v),u[f]=setTimeout(function(){l(f)||p.dispatch(a({queryCacheKey:f})),delete u[f]},g*1e3)}}}return c},Xue=function(e){var t=e.reducerPath,n=e.context,r=e.context.endpointDefinitions,i=e.mutationThunk,o=e.api,a=e.assertTagType,s=e.refetchQuery,l=o.internalActions.removeQueryResult,u=Qi(Ec(i),uy(i)),c=function(f,h){u(f)&&d(wz(f,"invalidatesTags",r,a),h),o.util.invalidateTags.match(f)&&d(xz(f.payload,void 0,void 0,void 0,void 0,a),h)};function d(f,h){var p=h.getState(),m=p[t],_=o.util.selectInvalidatedBy(p,f);n.batch(function(){for(var b,y=Array.from(_.values()),g=0,v=y;g<v.length;g++){var S=v[g].queryCacheKey,w=m.queries[S],x=(b=m.subscriptions[S])!=null?b:{};w&&(Object.keys(x).length===0?h.dispatch(l({queryCacheKey:S})):w.status!==er.uninitialized&&h.dispatch(s(w,S)))}})}return c},Yue=function(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.refetchQuery,o=e.internalState,a={},s=function(h,p){(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&u(h.payload,p),(n.pending.match(h)||n.rejected.match(h)&&h.meta.condition)&&u(h.meta.arg,p),(n.fulfilled.match(h)||n.rejected.match(h)&&!h.meta.condition)&&l(h.meta.arg,p),r.util.resetApiState.match(h)&&d()};function l(h,p){var m=h.queryCacheKey,_=p.getState()[t],b=_.queries[m],y=o.currentSubscriptions[m];if(!(!b||b.status===er.uninitialized)){var g=f(y);if(Number.isFinite(g)){var v=a[m];v!=null&&v.timeout&&(clearTimeout(v.timeout),v.timeout=void 0);var S=Date.now()+g,w=a[m]={nextPollTimestamp:S,pollingInterval:g,timeout:setTimeout(function(){w.timeout=void 0,p.dispatch(i(b,m))},g)}}}}function u(h,p){var m=h.queryCacheKey,_=p.getState()[t],b=_.queries[m],y=o.currentSubscriptions[m];if(!(!b||b.status===er.uninitialized)){var g=f(y);if(!Number.isFinite(g)){c(m);return}var v=a[m],S=Date.now()+g;(!v||S<v.nextPollTimestamp)&&l({queryCacheKey:m},p)}}function c(h){var p=a[h];p!=null&&p.timeout&&clearTimeout(p.timeout),delete a[h]}function d(){for(var h=0,p=Object.keys(a);h<p.length;h++){var m=p[h];c(m)}}function f(h){h===void 0&&(h={});var p=Number.POSITIVE_INFINITY;for(var m in h)h[m].pollingInterval&&(p=Math.min(h[m].pollingInterval,p));return p}return s},Zue=function(e){var t=e.reducerPath,n=e.context,r=e.api,i=e.refetchQuery,o=e.internalState,a=r.internalActions.removeQueryResult,s=function(u,c){qk.match(u)&&l(c,"refetchOnFocus"),Hk.match(u)&&l(c,"refetchOnReconnect")};function l(u,c){var d=u.getState()[t],f=d.queries,h=o.currentSubscriptions;n.batch(function(){for(var p=0,m=Object.keys(h);p<m.length;p++){var _=m[p],b=f[_],y=h[_];if(!(!y||!b)){var g=Object.values(y).some(function(v){return v[c]===!0})||Object.values(y).every(function(v){return v[c]===void 0})&&d.config[c];g&&(Object.keys(y).length===0?u.dispatch(a({queryCacheKey:_})):b.status!==er.uninitialized&&u.dispatch(i(b,_)))}}})}return s},GI=new Error("Promise never resolved before cacheEntryRemoved."),Jue=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,o=e.mutationThunk;e.internalState;var a=Zb(i),s=Zb(o),l=Ec(i,o),u={},c=function(h,p,m){var _=d(h);if(i.pending.match(h)){var b=m[n].queries[_],y=p.getState()[n].queries[_];!b&&y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(o.pending.match(h)){var y=p.getState()[n].mutations[_];y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(l(h)){var g=u[_];g!=null&&g.valueResolved&&(g.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete g.valueResolved)}else if(t.internalActions.removeQueryResult.match(h)||t.internalActions.removeMutationResult.match(h)){var g=u[_];g&&(delete u[_],g.cacheEntryRemoved())}else if(t.util.resetApiState.match(h))for(var v=0,S=Object.entries(u);v<S.length;v++){var w=S[v],x=w[0],g=w[1];delete u[x],g.cacheEntryRemoved()}};function d(h){return a(h)?h.meta.arg.queryCacheKey:s(h)?h.meta.requestId:t.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:t.internalActions.removeMutationResult.match(h)?i0(h.payload):""}function f(h,p,m,_,b){var y=r.endpointDefinitions[h],g=y==null?void 0:y.onCacheEntryAdded;if(g){var v={},S=new Promise(function(P){v.cacheEntryRemoved=P}),w=Promise.race([new Promise(function(P){v.valueResolved=P}),S.then(function(){throw GI})]);w.catch(function(){}),u[m]=v;var x=t.endpoints[h].select(y.type===rl.query?p:m),C=_.dispatch(function(P,N,O){return O}),T=js(Cr({},_),{getCacheEntry:function(){return x(_.getState())},requestId:b,extra:C,updateCachedData:y.type===rl.query?function(P){return _.dispatch(t.util.updateQueryData(h,p,P))}:void 0,cacheDataLoaded:w,cacheEntryRemoved:S}),E=g(p,T);Promise.resolve(E).catch(function(P){if(P!==GI)throw P})}}return c},ece=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,o=qS(r,i),a=Kh(r,i),s=Ec(r,i),l={},u=function(c,d){var f,h,p;if(o(c)){var m=c.meta,_=m.requestId,b=m.arg,y=b.endpointName,g=b.originalArgs,v=n.endpointDefinitions[y],S=v==null?void 0:v.onQueryStarted;if(S){var w={},x=new Promise(function(k,D){w.resolve=k,w.reject=D});x.catch(function(){}),l[_]=w;var C=t.endpoints[y].select(v.type===rl.query?g:_),T=d.dispatch(function(k,D,L){return L}),E=js(Cr({},d),{getCacheEntry:function(){return C(d.getState())},requestId:_,extra:T,updateCachedData:v.type===rl.query?function(k){return d.dispatch(t.util.updateQueryData(y,g,k))}:void 0,queryFulfilled:x});S(g,E)}}else if(s(c)){var P=c.meta,_=P.requestId,N=P.baseQueryMeta;(f=l[_])==null||f.resolve({data:c.payload,meta:N}),delete l[_]}else if(a(c)){var O=c.meta,_=O.requestId,A=O.rejectedWithValue,N=O.baseQueryMeta;(p=l[_])==null||p.reject({error:(h=c.payload)!=null?h:c.error,isUnhandledError:!A,meta:N}),delete l[_]}};return u},tce=function(e){var t=e.api,n=e.context.apiUid,r=e.reducerPath;return function(i,o){var a,s;t.util.resetApiState.match(i)&&o.dispatch(t.internalActions.middlewareRegistered(n)),typeof process<"u"}},qI,nce=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(qI||(qI=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},rce=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",o=null,a=!1,s=t.internalActions,l=s.updateSubscriptionOptions,u=s.unsubscribeQueryResult,c=function(d,f){var h,p,m,_,b,y,g,v,S;if(l.match(f)){var w=f.payload,x=w.queryCacheKey,C=w.requestId,T=w.options;return(h=d==null?void 0:d[x])!=null&&h[C]&&(d[x][C]=T),!0}if(u.match(f)){var E=f.payload,x=E.queryCacheKey,C=E.requestId;return d[x]&&delete d[x][C],!0}if(t.internalActions.removeQueryResult.match(f))return delete d[f.payload.queryCacheKey],!0;if(n.pending.match(f)){var P=f.meta,N=P.arg,C=P.requestId;if(N.subscribe){var O=(m=d[p=N.queryCacheKey])!=null?m:d[p]={};return O[C]=(b=(_=N.subscriptionOptions)!=null?_:O[C])!=null?b:{},!0}}if(n.rejected.match(f)){var A=f.meta,k=A.condition,N=A.arg,C=A.requestId;if(k&&N.subscribe){var O=(g=d[y=N.queryCacheKey])!=null?g:d[y]={};return O[C]=(S=(v=N.subscriptionOptions)!=null?v:O[C])!=null?S:{},!0}}return!1};return function(d,f){var h,p;if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(d))return o=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(d)){var m=d.payload,_=m.queryCacheKey,b=m.requestId,y=!!((h=r.currentSubscriptions[_])!=null&&h[b]);return[!1,y]}var g=c(r.currentSubscriptions,d);if(g){a||(nce(function(){var x=JSON.parse(JSON.stringify(r.currentSubscriptions)),C=ak(o,function(){return x}),T=C[1];f.next(t.internalActions.subscriptionsUpdated(T)),o=x,a=!1}),a=!0);var v=!!((p=d.type)!=null&&p.startsWith(i)),S=n.rejected.match(d)&&d.meta.condition&&!!d.meta.arg.subscribe,w=!v&&!S;return[w,!1]}return[!0,!1]}};function ice(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.context,o=i.apiUid,a={invalidateTags:Ne(t+"/invalidateTags")},s=function(d){return!!d&&typeof d.type=="string"&&d.type.startsWith(t+"/")},l=[tce,Que,Xue,Yue,Jue,ece],u=function(d){var f=!1,h={currentSubscriptions:{}},p=js(Cr({},e),{internalState:h,refetchQuery:c}),m=l.map(function(y){return y(p)}),_=rce(p),b=Zue(p);return function(y){return function(g){f||(f=!0,d.dispatch(r.internalActions.middlewareRegistered(o)));var v=js(Cr({},d),{next:y}),S=d.getState(),w=_(g,v,S),x=w[0],C=w[1],T;if(x?T=y(g):T=C,d.getState()[t]&&(b(g,v,S),s(g)||i.hasRehydrationInfo(g)))for(var E=0,P=m;E<P.length;E++){var N=P[E];N(g,v,S)}return T}}};return{middleware:u,actions:a};function c(d,f,h){return h===void 0&&(h={}),n(Cr({type:"query",endpointName:d.endpointName,originalArgs:d.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:f},h))}}function pu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,v_([e],t))}var HI=Symbol(),oce=function(){return{name:HI,init:function(e,t,n){var r=t.baseQuery,i=t.tagTypes,o=t.reducerPath,a=t.serializeQueryArgs,s=t.keepUnusedDataFor,l=t.refetchOnMountOrArgChange,u=t.refetchOnFocus,c=t.refetchOnReconnect;ik();var d=function(G){return typeof process<"u",G};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:Hk,onOffline:_z,onFocus:qk,onFocusLost:bz},util:{}});var f=Vue({baseQuery:r,reducerPath:o,context:n,api:e,serializeQueryArgs:a}),h=f.queryThunk,p=f.mutationThunk,m=f.patchQueryData,_=f.updateQueryData,b=f.upsertQueryData,y=f.prefetch,g=f.buildMatchThunkActions,v=Gue({context:n,queryThunk:h,mutationThunk:p,reducerPath:o,assertTagType:d,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:l,keepUnusedDataFor:s,reducerPath:o}}),S=v.reducer,w=v.actions;pu(e.util,{patchQueryData:m,updateQueryData:_,upsertQueryData:b,prefetch:y,resetApiState:w.resetApiState}),pu(e.internalActions,w);var x=ice({reducerPath:o,context:n,queryThunk:h,mutationThunk:p,api:e,assertTagType:d}),C=x.middleware,T=x.actions;pu(e.util,T),pu(e,{reducer:S,middleware:C});var E=que({serializeQueryArgs:a,reducerPath:o}),P=E.buildQuerySelector,N=E.buildMutationSelector,O=E.selectInvalidatedBy;pu(e.util,{selectInvalidatedBy:O});var A=Uue({queryThunk:h,mutationThunk:p,api:e,serializeQueryArgs:a,context:n}),k=A.buildInitiateQuery,D=A.buildInitiateMutation,L=A.getRunningMutationThunk,M=A.getRunningMutationsThunk,R=A.getRunningQueriesThunk,$=A.getRunningQueryThunk,B=A.getRunningOperationPromises,U=A.removalWarning;return pu(e.util,{getRunningOperationPromises:B,getRunningOperationPromise:U,getRunningMutationThunk:L,getRunningMutationsThunk:M,getRunningQueryThunk:$,getRunningQueriesThunk:R}),{name:HI,injectEndpoint:function(G,Y){var ee,J,j=e;(J=(ee=j.endpoints)[G])!=null||(ee[G]={}),Sz(Y)?pu(j.endpoints[G],{name:G,select:P(G,Y),initiate:k(G,Y)},g(h,G)):zue(Y)&&pu(j.endpoints[G],{name:G,select:N(),initiate:D(G)},g(p,G))}}}}},Az={exports:{}},Ez={};/**
+ * @license React
+ * use-sync-external-store-shim.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Jh=I;function ace(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sce=typeof Object.is=="function"?Object.is:ace,lce=Jh.useState,uce=Jh.useEffect,cce=Jh.useLayoutEffect,dce=Jh.useDebugValue;function fce(e,t){var n=t(),r=lce({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return cce(function(){i.value=n,i.getSnapshot=t,SC(i)&&o({inst:i})},[e,n,t]),uce(function(){return SC(i)&&o({inst:i}),e(function(){SC(i)&&o({inst:i})})},[e]),dce(n),n}function SC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sce(e,n)}catch{return!0}}function hce(e,t){return t()}var pce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?hce:fce;Ez.useSyncExternalStore=Jh.useSyncExternalStore!==void 0?Jh.useSyncExternalStore:pce;Az.exports=Ez;var gce=Az.exports,Tz={exports:{}},kz={};/**
+ * @license React
+ * use-sync-external-store-shim/with-selector.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var h2=I,mce=gce;function yce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vce=typeof Object.is=="function"?Object.is:yce,bce=mce.useSyncExternalStore,_ce=h2.useRef,Sce=h2.useEffect,xce=h2.useMemo,wce=h2.useDebugValue;kz.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=_ce(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=xce(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&a.hasValue){var p=a.value;if(i(p,h))return d=p}return d=h}if(p=d,vce(c,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(c=h,d=m)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var s=bce(e,o[0],o[1]);return Sce(function(){a.hasValue=!0,a.value=s},[s]),wce(s),s};Tz.exports=kz;var Pz=Tz.exports;const Cce=Sc(Pz);function Ace(e){e()}let Iz=Ace;const Ece=e=>Iz=e,Tce=()=>Iz,WI=Symbol.for("react-redux-context"),KI=typeof globalThis<"u"?globalThis:{};function kce(){var e;if(!I.createContext)return{};const t=(e=KI[WI])!=null?e:KI[WI]=new Map;let n=t.get(I.createContext);return n||(n=I.createContext(null),t.set(I.createContext,n)),n}const hc=kce();function Wk(e=hc){return function(){return I.useContext(e)}}const Rz=Wk(),Pce=()=>{throw new Error("uSES not initialized!")};let Oz=Pce;const Ice=e=>{Oz=e},Rce=(e,t)=>e===t;function Oce(e=hc){const t=e===hc?Rz:Wk(e);return function(r,i={}){const{equalityFn:o=Rce,stabilityCheck:a=void 0,noopCheck:s=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:l,subscription:u,getServerState:c,stabilityCheck:d,noopCheck:f}=t();I.useRef(!0);const h=I.useCallback({[r.name](m){return r(m)}}[r.name],[r,d,a]),p=Oz(u.addNestedSub,l.getState,c||l.getState,h,o);return I.useDebugValue(p),p}}const Mz=Oce();function S_(){return S_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S_.apply(this,arguments)}var $z={exports:{}},vn={};/** @license React v16.13.1
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var hi=typeof Symbol=="function"&&Symbol.for,Kk=hi?Symbol.for("react.element"):60103,Qk=hi?Symbol.for("react.portal"):60106,p2=hi?Symbol.for("react.fragment"):60107,g2=hi?Symbol.for("react.strict_mode"):60108,m2=hi?Symbol.for("react.profiler"):60114,y2=hi?Symbol.for("react.provider"):60109,v2=hi?Symbol.for("react.context"):60110,Xk=hi?Symbol.for("react.async_mode"):60111,b2=hi?Symbol.for("react.concurrent_mode"):60111,_2=hi?Symbol.for("react.forward_ref"):60112,S2=hi?Symbol.for("react.suspense"):60113,Mce=hi?Symbol.for("react.suspense_list"):60120,x2=hi?Symbol.for("react.memo"):60115,w2=hi?Symbol.for("react.lazy"):60116,$ce=hi?Symbol.for("react.block"):60121,Nce=hi?Symbol.for("react.fundamental"):60117,Dce=hi?Symbol.for("react.responder"):60118,Lce=hi?Symbol.for("react.scope"):60119;function sa(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Kk:switch(e=e.type,e){case Xk:case b2:case p2:case m2:case g2:case S2:return e;default:switch(e=e&&e.$$typeof,e){case v2:case _2:case w2:case x2:case y2:return e;default:return t}}case Qk:return t}}}function Nz(e){return sa(e)===b2}vn.AsyncMode=Xk;vn.ConcurrentMode=b2;vn.ContextConsumer=v2;vn.ContextProvider=y2;vn.Element=Kk;vn.ForwardRef=_2;vn.Fragment=p2;vn.Lazy=w2;vn.Memo=x2;vn.Portal=Qk;vn.Profiler=m2;vn.StrictMode=g2;vn.Suspense=S2;vn.isAsyncMode=function(e){return Nz(e)||sa(e)===Xk};vn.isConcurrentMode=Nz;vn.isContextConsumer=function(e){return sa(e)===v2};vn.isContextProvider=function(e){return sa(e)===y2};vn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kk};vn.isForwardRef=function(e){return sa(e)===_2};vn.isFragment=function(e){return sa(e)===p2};vn.isLazy=function(e){return sa(e)===w2};vn.isMemo=function(e){return sa(e)===x2};vn.isPortal=function(e){return sa(e)===Qk};vn.isProfiler=function(e){return sa(e)===m2};vn.isStrictMode=function(e){return sa(e)===g2};vn.isSuspense=function(e){return sa(e)===S2};vn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===p2||e===b2||e===m2||e===g2||e===S2||e===Mce||typeof e=="object"&&e!==null&&(e.$$typeof===w2||e.$$typeof===x2||e.$$typeof===y2||e.$$typeof===v2||e.$$typeof===_2||e.$$typeof===Nce||e.$$typeof===Dce||e.$$typeof===Lce||e.$$typeof===$ce)};vn.typeOf=sa;$z.exports=vn;var Fce=$z.exports,Dz=Fce,Bce={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zce={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Lz={};Lz[Dz.ForwardRef]=Bce;Lz[Dz.Memo]=zce;var En={};/**
+ * @license React
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Yk=Symbol.for("react.element"),Zk=Symbol.for("react.portal"),C2=Symbol.for("react.fragment"),A2=Symbol.for("react.strict_mode"),E2=Symbol.for("react.profiler"),T2=Symbol.for("react.provider"),k2=Symbol.for("react.context"),jce=Symbol.for("react.server_context"),P2=Symbol.for("react.forward_ref"),I2=Symbol.for("react.suspense"),R2=Symbol.for("react.suspense_list"),O2=Symbol.for("react.memo"),M2=Symbol.for("react.lazy"),Uce=Symbol.for("react.offscreen"),Fz;Fz=Symbol.for("react.module.reference");function Oa(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Yk:switch(e=e.type,e){case C2:case E2:case A2:case I2:case R2:return e;default:switch(e=e&&e.$$typeof,e){case jce:case k2:case P2:case M2:case O2:case T2:return e;default:return t}}case Zk:return t}}}En.ContextConsumer=k2;En.ContextProvider=T2;En.Element=Yk;En.ForwardRef=P2;En.Fragment=C2;En.Lazy=M2;En.Memo=O2;En.Portal=Zk;En.Profiler=E2;En.StrictMode=A2;En.Suspense=I2;En.SuspenseList=R2;En.isAsyncMode=function(){return!1};En.isConcurrentMode=function(){return!1};En.isContextConsumer=function(e){return Oa(e)===k2};En.isContextProvider=function(e){return Oa(e)===T2};En.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yk};En.isForwardRef=function(e){return Oa(e)===P2};En.isFragment=function(e){return Oa(e)===C2};En.isLazy=function(e){return Oa(e)===M2};En.isMemo=function(e){return Oa(e)===O2};En.isPortal=function(e){return Oa(e)===Zk};En.isProfiler=function(e){return Oa(e)===E2};En.isStrictMode=function(e){return Oa(e)===A2};En.isSuspense=function(e){return Oa(e)===I2};En.isSuspenseList=function(e){return Oa(e)===R2};En.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===C2||e===E2||e===A2||e===I2||e===R2||e===Uce||typeof e=="object"&&e!==null&&(e.$$typeof===M2||e.$$typeof===O2||e.$$typeof===T2||e.$$typeof===k2||e.$$typeof===P2||e.$$typeof===Fz||e.getModuleId!==void 0)};En.typeOf=Oa;function Vce(){const e=Tce();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const QI={notify(){},get:()=>[]};function Gce(e,t){let n,r=QI;function i(d){return l(),r.subscribe(d)}function o(){r.notify()}function a(){c.onStateChange&&c.onStateChange()}function s(){return!!n}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=Vce())}function u(){n&&(n(),n=void 0,r.clear(),r=QI)}const c={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}const qce=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Hce=qce?I.useLayoutEffect:I.useEffect;function XI(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function x_(e,t){if(XI(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!XI(e[n[i]],t[n[i]]))return!1;return!0}function Wce({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const a=I.useMemo(()=>{const u=Gce(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[e,r,i,o]),s=I.useMemo(()=>e.getState(),[e]);Hce(()=>{const{subscription:u}=a;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),s!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[a,s]);const l=t||hc;return I.createElement(l.Provider,{value:a},n)}function Bz(e=hc){const t=e===hc?Rz:Wk(e);return function(){const{store:r}=t();return r}}const zz=Bz();function Kce(e=hc){const t=e===hc?zz:Bz(e);return function(){return t().dispatch}}const jz=Kce();Ice(Pz.useSyncExternalStoreWithSelector);Ece(Wo.unstable_batchedUpdates);var Qce=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Xce=Object.defineProperty,Yce=Object.defineProperties,Zce=Object.getOwnPropertyDescriptors,YI=Object.getOwnPropertySymbols,Jce=Object.prototype.hasOwnProperty,ede=Object.prototype.propertyIsEnumerable,ZI=function(e,t,n){return t in e?Xce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},_l=function(e,t){for(var n in t||(t={}))Jce.call(t,n)&&ZI(e,n,t[n]);if(YI)for(var r=0,i=YI(t);r<i.length;r++){var n=i[r];ede.call(t,n)&&ZI(e,n,t[n])}return e},q1=function(e,t){return Yce(e,Zce(t))};function JI(e,t,n,r){var i=I.useMemo(function(){return{queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}},[e,t,n,r]),o=I.useRef(i);return I.useEffect(function(){o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var xC=Symbol();function wC(e){var t=I.useRef(e);return I.useEffect(function(){x_(t.current,e)||(t.current=e)},[e]),x_(t.current,e)?t.current:e}var kv=WeakMap?new WeakMap:void 0,tde=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=kv==null?void 0:kv.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return fs(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});fs(n)&&(kv==null||kv.set(n,o)),r=o}return t+"("+r+")"},nde=typeof window<"u"&&window.document&&window.document.createElement?I.useLayoutEffect:I.useEffect,rde=function(e){return e},ide=function(e){return e.isUninitialized?q1(_l({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:er.pending}):e};function ode(e){var t=e.api,n=e.moduleOptions,r=n.batch,i=n.useDispatch,o=n.useSelector,a=n.useStore,s=n.unstable__sideEffectsInRender,l=e.serializeQueryArgs,u=e.context,c=s?function(m){return m()}:I.useEffect;return{buildQueryHooks:h,buildMutationHook:p,usePrefetch:f};function d(m,_,b){if(_!=null&&_.endpointName&&m.isUninitialized){var y=_.endpointName,g=u.endpointDefinitions[y];l({queryArgs:_.originalArgs,endpointDefinition:g,endpointName:y})===l({queryArgs:b,endpointDefinition:g,endpointName:y})&&(_=void 0)}var v=m.isSuccess?m.data:_==null?void 0:_.data;v===void 0&&(v=m.data);var S=v!==void 0,w=m.isLoading,x=!S&&w,C=m.isSuccess||w&&S;return q1(_l({},m),{data:v,currentData:m.data,isFetching:w,isLoading:x,isSuccess:C})}function f(m,_){var b=i(),y=wC(_);return I.useCallback(function(g,v){return b(t.util.prefetch(m,g,_l(_l({},y),v)))},[m,b,y])}function h(m){var _=function(g,v){var S=v===void 0?{}:v,w=S.refetchOnReconnect,x=S.refetchOnFocus,C=S.refetchOnMountOrArgChange,T=S.skip,E=T===void 0?!1:T,P=S.pollingInterval,N=P===void 0?0:P,O=t.endpoints[m].initiate,A=i(),k=JI(E?ld:g,tde,u.endpointDefinitions[m],m),D=wC({refetchOnReconnect:w,refetchOnFocus:x,pollingInterval:N}),L=I.useRef(!1),M=I.useRef(),R=M.current||{},$=R.queryCacheKey,B=R.requestId,U=!1;if($&&B){var G=A(t.internalActions.internal_probeSubscription({queryCacheKey:$,requestId:B}));U=!!G}var Y=!U&&L.current;return c(function(){L.current=U}),c(function(){Y&&(M.current=void 0)},[Y]),c(function(){var ee,J=M.current;if(typeof process<"u",k===ld){J==null||J.unsubscribe(),M.current=void 0;return}var j=(ee=M.current)==null?void 0:ee.subscriptionOptions;if(!J||J.arg!==k){J==null||J.unsubscribe();var Q=A(O(k,{subscriptionOptions:D,forceRefetch:C}));M.current=Q}else D!==j&&J.updateSubscriptionOptions(D)},[A,O,C,k,D,Y]),I.useEffect(function(){return function(){var ee;(ee=M.current)==null||ee.unsubscribe(),M.current=void 0}},[]),I.useMemo(function(){return{refetch:function(){var ee;if(!M.current)throw new Error("Cannot refetch a query that has not been started yet.");return(ee=M.current)==null?void 0:ee.refetch()}}},[])},b=function(g){var v=g===void 0?{}:g,S=v.refetchOnReconnect,w=v.refetchOnFocus,x=v.pollingInterval,C=x===void 0?0:x,T=t.endpoints[m].initiate,E=i(),P=I.useState(xC),N=P[0],O=P[1],A=I.useRef(),k=wC({refetchOnReconnect:S,refetchOnFocus:w,pollingInterval:C});c(function(){var M,R,$=(M=A.current)==null?void 0:M.subscriptionOptions;k!==$&&((R=A.current)==null||R.updateSubscriptionOptions(k))},[k]);var D=I.useRef(k);c(function(){D.current=k},[k]);var L=I.useCallback(function(M,R){R===void 0&&(R=!1);var $;return r(function(){var B;(B=A.current)==null||B.unsubscribe(),A.current=$=E(T(M,{subscriptionOptions:D.current,forceRefetch:!R})),O(M)}),$},[E,T]);return I.useEffect(function(){return function(){var M;(M=A==null?void 0:A.current)==null||M.unsubscribe()}},[]),I.useEffect(function(){N!==xC&&!A.current&&L(N,!0)},[N,L]),I.useMemo(function(){return[L,N]},[L,N])},y=function(g,v){var S=v===void 0?{}:v,w=S.skip,x=w===void 0?!1:w,C=S.selectFromResult,T=t.endpoints[m].select,E=JI(x?ld:g,l,u.endpointDefinitions[m],m),P=I.useRef(),N=I.useMemo(function(){return Ii([T(E),function(L,M){return M},function(L){return E}],d)},[T,E]),O=I.useMemo(function(){return C?Ii([N],C):N},[N,C]),A=o(function(L){return O(L,P.current)},x_),k=a(),D=N(k.getState(),P.current);return nde(function(){P.current=D},[D]),A};return{useQueryState:y,useQuerySubscription:_,useLazyQuerySubscription:b,useLazyQuery:function(g){var v=b(g),S=v[0],w=v[1],x=y(w,q1(_l({},g),{skip:w===xC})),C=I.useMemo(function(){return{lastArg:w}},[w]);return I.useMemo(function(){return[S,x,C]},[S,x,C])},useQuery:function(g,v){var S=_(g,v),w=y(g,_l({selectFromResult:g===ld||v!=null&&v.skip?void 0:ide},v)),x=w.data,C=w.status,T=w.isLoading,E=w.isSuccess,P=w.isError,N=w.error;return I.useDebugValue({data:x,status:C,isLoading:T,isSuccess:E,isError:P,error:N}),I.useMemo(function(){return _l(_l({},w),S)},[w,S])}}}function p(m){return function(_){var b=_===void 0?{}:_,y=b.selectFromResult,g=y===void 0?rde:y,v=b.fixedCacheKey,S=t.endpoints[m],w=S.select,x=S.initiate,C=i(),T=I.useState(),E=T[0],P=T[1];I.useEffect(function(){return function(){E!=null&&E.arg.fixedCacheKey||E==null||E.reset()}},[E]);var N=I.useCallback(function(J){var j=C(x(J,{fixedCacheKey:v}));return P(j),j},[C,x,v]),O=(E||{}).requestId,A=I.useMemo(function(){return Ii([w({fixedCacheKey:v,requestId:E==null?void 0:E.requestId})],g)},[w,E,g,v]),k=o(A,x_),D=v==null?E==null?void 0:E.arg.originalArgs:void 0,L=I.useCallback(function(){r(function(){E&&P(void 0),v&&C(t.internalActions.removeMutationResult({requestId:O,fixedCacheKey:v}))})},[C,v,E,O]),M=k.endpointName,R=k.data,$=k.status,B=k.isLoading,U=k.isSuccess,G=k.isError,Y=k.error;I.useDebugValue({endpointName:M,data:R,status:$,isLoading:B,isSuccess:U,isError:G,error:Y});var ee=I.useMemo(function(){return q1(_l({},k),{originalArgs:D,reset:L})},[k,D,L]);return I.useMemo(function(){return[N,ee]},[N,ee])}}}var w_;(function(e){e.query="query",e.mutation="mutation"})(w_||(w_={}));function ade(e){return e.type===w_.query}function sde(e){return e.type===w_.mutation}function CC(e){return e.replace(e[0],e[0].toUpperCase())}function Pv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,Qce([e],t))}var lde=Symbol(),ude=function(e){var t=e===void 0?{}:e,n=t.batch,r=n===void 0?Wo.unstable_batchedUpdates:n,i=t.useDispatch,o=i===void 0?jz:i,a=t.useSelector,s=a===void 0?Mz:a,l=t.useStore,u=l===void 0?zz:l,c=t.unstable__sideEffectsInRender,d=c===void 0?!1:c;return{name:lde,init:function(f,h,p){var m=h.serializeQueryArgs,_=f,b=ode({api:f,moduleOptions:{batch:r,useDispatch:o,useSelector:s,useStore:u,unstable__sideEffectsInRender:d},serializeQueryArgs:m,context:p}),y=b.buildQueryHooks,g=b.buildMutationHook,v=b.usePrefetch;return Pv(_,{usePrefetch:v}),Pv(p,{batch:r}),{injectEndpoint:function(S,w){if(ade(w)){var x=y(S),C=x.useQuery,T=x.useLazyQuery,E=x.useLazyQuerySubscription,P=x.useQueryState,N=x.useQuerySubscription;Pv(_.endpoints[S],{useQuery:C,useLazyQuery:T,useLazyQuerySubscription:E,useQueryState:P,useQuerySubscription:N}),f["use"+CC(S)+"Query"]=C,f["useLazy"+CC(S)+"Query"]=T}else if(sde(w)){var O=g(S);Pv(_.endpoints[S],{useMutation:O}),f["use"+CC(S)+"Mutation"]=O}}}}}},cde=Hue(oce(),ude());let Zi=[],sl=(e,t)=>{let n=[],r={get(){return r.lc||r.listen(()=>{})(),r.value},l:t||0,lc:0,listen(i,o){return r.lc=n.push(i,o||r.l)/2,()=>{let a=n.indexOf(i);~a&&(n.splice(a,2),r.lc--,r.lc||r.off())}},notify(i){let o=!Zi.length;for(let a=0;a<n.length;a+=2)Zi.push(n[a],r.value,i,n[a+1]);if(o){for(let a=0;a<Zi.length;a+=4){let s=!1;for(let l=a+7;l<Zi.length;l+=4)if(Zi[l]<Zi[a+3]){s=!0;break}s?Zi.push(Zi[a],Zi[a+1],Zi[a+2],Zi[a+3]):Zi[a](Zi[a+1],Zi[a+2])}Zi.length=0}},off(){},set(i){r.value!==i&&(r.value=i,r.notify())},subscribe(i,o){let a=r.listen(i,o);return i(r.value),a},value:e};return r};const dde=5,Iv=6,Rv=10;let fde=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Rv]||(e.events[n+Rv]=r(i=>{e.events[n].reduceRight((o,a)=>(a(o),o),{shared:{},...i})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let i=e.events[n],o=i.indexOf(t);i.splice(o,1),i.length||(delete e.events[n],e.events[n+Rv](),delete e.events[n+Rv])}),hde=1e3,pde=(e,t)=>fde(e,r=>{let i=t(r);i&&e.events[Iv].push(i)},dde,r=>{let i=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...a));let o=e.off;return e.events[Iv]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[Iv])a();e.events[Iv]=[]}},hde)},()=>{e.listen=i,e.off=o}}),gde=(e,t)=>{Array.isArray(e)||(e=[e]);let n,r=()=>{let o=e.map(a=>a.get());(n===void 0||o.some((a,s)=>a!==n[s]))&&(n=o,i.set(t(...o)))},i=sl(void 0,Math.max(...e.map(o=>o.l))+1);return pde(i,()=>{let o=e.map(a=>a.listen(r,i.l));return r(),()=>{for(let a of o)a()}}),i};const mde={"Content-Type":"application/json"},yde=/\/*$/;function vde(e={}){const{fetch:t=globalThis.fetch,querySerializer:n,bodySerializer:r,...i}=e;async function o(a,s){const{headers:l,body:u,params:c={},parseAs:d="json",querySerializer:f=n??bde,bodySerializer:h=r??_de,...p}=s||{},m=Sde(a,{baseUrl:i.baseUrl,params:c,querySerializer:f}),_=xde(mde,e==null?void 0:e.headers,l,c.header),b={redirect:"follow",...i,...p,headers:_};u&&(b.body=h(u)),b.body instanceof FormData&&_.delete("Content-Type");const y=await t(m,b);if(y.status===204||y.headers.get("Content-Length")==="0")return y.ok?{data:{},response:y}:{error:{},response:y};if(y.ok){let v=y.body;if(d!=="stream"){const S=y.clone();v=typeof S[d]=="function"?await S[d]():await S.text()}return{data:v,response:y}}let g={};try{g=await y.clone().json()}catch{g=await y.clone().text()}return{error:g,response:y}}return{async GET(a,s){return o(a,{...s,method:"GET"})},async PUT(a,s){return o(a,{...s,method:"PUT"})},async POST(a,s){return o(a,{...s,method:"POST"})},async DELETE(a,s){return o(a,{...s,method:"DELETE"})},async OPTIONS(a,s){return o(a,{...s,method:"OPTIONS"})},async HEAD(a,s){return o(a,{...s,method:"HEAD"})},async PATCH(a,s){return o(a,{...s,method:"PATCH"})},async TRACE(a,s){return o(a,{...s,method:"TRACE"})}}}function bde(e){const t=new URLSearchParams;if(e&&typeof e=="object")for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r);return t.toString()}function _de(e){return JSON.stringify(e)}function Sde(e,t){let n=`${t.baseUrl?t.baseUrl.replace(yde,""):""}${e}`;if(t.params.path)for(const[r,i]of Object.entries(t.params.path))n=n.replace(`{${r}}`,encodeURIComponent(String(i)));if(t.params.query){const r=t.querySerializer(t.params.query);r&&(n+=`?${r}`)}return n}function xde(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,o]of r)o===null?t.delete(i):o!==void 0&&t.set(i,o)}return t}const ep=sl(),o0=sl(),a0=sl();gde([ep,o0,a0],(e,t,n)=>vde({headers:{...e?{Authorization:`Bearer ${e}`}:{},...n?{"project-id":n}:{}},baseUrl:`${t??""}`}));const wde=["AppVersion","AppConfig","Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","ImageMetadataFromFile","IntermediatesCount","SessionQueueItem","SessionQueueStatus","SessionProcessorStatus","CurrentSessionQueueItem","NextSessionQueueItem","BatchStatus","InvocationCacheStatus","Model","T2IAdapterModel","MainModel","OnnxModel","VaeModel","IPAdapterModel","TextualInversionModel","ControlNetModel","LoRAModel","SDXLRefinerModel"],no="LIST",Cde=async(e,t,n)=>{const r=o0.get(),i=ep.get(),o=a0.get();return Bue({baseUrl:`${r??""}/api/v1`,prepareHeaders:s=>(i&&s.set("Authorization",`Bearer ${i}`),o&&s.set("project-id",o),s)})(e,t,n)},ps=cde({baseQuery:Cde,reducerPath:"api",tagTypes:wde,endpoints:()=>({})}),Ade=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},Uz="%[a-f0-9]{2}",eR=new RegExp("("+Uz+")|([^%]+?)","gi"),tR=new RegExp("("+Uz+")+","gi");function SA(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],SA(n),SA(r))}function Ede(e){try{return decodeURIComponent(e)}catch{let t=e.match(eR)||[];for(let n=1;n<t.length;n++)e=SA(t,n).join(""),t=e.match(eR)||[];return e}}function Tde(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=tR.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=Ede(n[0]);i!==n[0]&&(t[n[0]]=i)}n=tR.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const i of r)e=e.replace(new RegExp(i,"g"),t[i]);return e}function kde(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Tde(e)}}function Vz(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}function Pde(e,t){const n={};if(Array.isArray(t))for(const r of t){const i=Object.getOwnPropertyDescriptor(e,r);i!=null&&i.enumerable&&Object.defineProperty(n,r,i)}else for(const r of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){const o=e[r];t(r,o,e)&&Object.defineProperty(n,r,i)}}return n}const Ide=e=>e==null,Rde=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),xA=Symbol("encodeFragmentIdentifier");function Ode(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),"[",i,"]"].join("")]:[...n,[Nr(t,e),"[",Nr(i,e),"]=",Nr(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),"[]"].join("")]:[...n,[Nr(t,e),"[]=",Nr(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),":list="].join("")]:[...n,[Nr(t,e),":list=",Nr(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?r:(i=i===null?"":i,r.length===0?[[Nr(n,e),t,Nr(i,e)].join("")]:[[r,Nr(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,Nr(t,e)]:[...n,[Nr(t,e),"=",Nr(r,e)].join("")]}}function Mde(e){let t;switch(e.arrayFormat){case"index":return(n,r,i)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){i[n]=r;return}i[n]===void 0&&(i[n]={}),i[n][t[1]]=r};case"bracket":return(n,r,i)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"colon-list-separator":return(n,r,i)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"comma":case"separator":return(n,r,i)=>{const o=typeof r=="string"&&r.includes(e.arrayFormatSeparator),a=typeof r=="string"&&!o&&Cl(r,e).includes(e.arrayFormatSeparator);r=a?Cl(r,e):r;const s=o||a?r.split(e.arrayFormatSeparator).map(l=>Cl(l,e)):r===null?r:Cl(r,e);i[n]=s};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&Cl(r,e);return}const a=r===null?[]:r.split(e.arrayFormatSeparator).map(s=>Cl(s,e));if(i[n]===void 0){i[n]=a;return}i[n]=[...i[n],...a]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function Gz(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Nr(e,t){return t.encode?t.strict?Rde(e):encodeURIComponent(e):e}function Cl(e,t){return t.decode?kde(e):e}function qz(e){return Array.isArray(e)?e.sort():typeof e=="object"?qz(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function Hz(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function $de(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function nR(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function Jk(e){e=Hz(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function e4(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},Gz(t.arrayFormatSeparator);const n=Mde(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const i of e.split("&")){if(i==="")continue;const o=t.decode?i.replace(/\+/g," "):i;let[a,s]=Vz(o,"=");a===void 0&&(a=o),s=s===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:Cl(s,t),n(Cl(a,t),s,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[a,s]of Object.entries(o))o[a]=nR(s,t);else r[i]=nR(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const a=r[o];return a&&typeof a=="object"&&!Array.isArray(a)?i[o]=qz(a):i[o]=a,i},Object.create(null))}function Wz(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},Gz(t.arrayFormatSeparator);const n=a=>t.skipNull&&Ide(e[a])||t.skipEmptyString&&e[a]==="",r=Ode(t),i={};for(const[a,s]of Object.entries(e))n(a)||(i[a]=s);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(a=>{const s=e[a];return s===void 0?"":s===null?Nr(a,t):Array.isArray(s)?s.length===0&&t.arrayFormat==="bracket-separator"?Nr(a,t)+"[]":s.reduce(r(a),[]).join("&"):Nr(a,t)+"="+Nr(s,t)}).filter(a=>a.length>0).join("&")}function Kz(e,t){var i;t={decode:!0,...t};let[n,r]=Vz(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:e4(Jk(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Cl(r,t)}:{}}}function Qz(e,t){t={encode:!0,strict:!0,[xA]:!0,...t};const n=Hz(e.url).split("?")[0]||"",r=Jk(e.url),i={...e4(r,{sort:!1}),...e.query};let o=Wz(i,t);o&&(o=`?${o}`);let a=$de(e.url);if(e.fragmentIdentifier){const s=new URL(n);s.hash=e.fragmentIdentifier,a=t[xA]?s.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${a}`}function Xz(e,t,n){n={parseFragmentIdentifier:!0,[xA]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=Kz(e,n);return Qz({url:r,query:Pde(i,t),fragmentIdentifier:o},n)}function Nde(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return Xz(e,r,n)}const em=Object.freeze(Object.defineProperty({__proto__:null,exclude:Nde,extract:Jk,parse:e4,parseUrl:Kz,pick:Xz,stringify:Wz,stringifyUrl:Qz},Symbol.toStringTag,{value:"Module"})),Fc=(e,t)=>{if(!e)return!1;const n=s0.selectAll(e);if(n.length<=1)return!0;const r=[],i=[];for(let o=0;o<n.length;o++){const a=n[o];a!=null&&a.starred&&r.push(a),a!=null&&a.starred||i.push(a)}if(t.starred){const o=r[r.length-1];if(!o)return!0;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}else{const o=i[i.length-1];if(!o)return!1;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}},da=e=>ii.includes(e.image_category)?ii:to,Vn=Ra({selectId:e=>e.image_name,sortComparer:(e,t)=>e.starred&&!t.starred?-1:!e.starred&&t.starred?1:Ade(t.created_at,e.created_at)}),s0=Vn.getSelectors(),jo=e=>`images/?${em.stringify(e,{arrayFormat:"none"})}`,Lt=ps.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:t=>{const n=[{type:"Board",id:no}];return t&&n.push(...t.items.map(({board_id:r})=>({type:"Board",id:r}))),n}}),listAllBoards:e.query({query:()=>({url:"boards/",params:{all:!0}}),providesTags:t=>{const n=[{type:"Board",id:no}];return t&&n.push(...t.map(({board_id:r})=>({type:"Board",id:r}))),n}}),listAllImageNamesForBoard:e.query({query:t=>({url:`boards/${t}/image_names`}),providesTags:(t,n,r)=>[{type:"ImageNameList",id:r}],keepUnusedDataFor:0}),getBoardImagesTotal:e.query({query:t=>({url:jo({board_id:t??"none",categories:ii,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardImagesTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),getBoardAssetsTotal:e.query({query:t=>({url:jo({board_id:t??"none",categories:to,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardAssetsTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),createBoard:e.mutation({query:t=>({url:"boards/",method:"POST",params:{board_name:t}}),invalidatesTags:[{type:"Board",id:no}]}),updateBoard:e.mutation({query:({board_id:t,changes:n})=>({url:`boards/${t}`,method:"PATCH",body:n}),invalidatesTags:(t,n,r)=>[{type:"Board",id:r.board_id}]})})}),{useListBoardsQuery:aqe,useListAllBoardsQuery:sqe,useGetBoardImagesTotalQuery:lqe,useGetBoardAssetsTotalQuery:uqe,useCreateBoardMutation:cqe,useUpdateBoardMutation:dqe,useListAllImageNamesForBoardQuery:fqe}=Lt;var Yz={exports:{}},Zz={};const zo=xS(BZ),Jp=xS(UY),Dde=xS(eZ);(function(e){var t,n,r=yt&&yt.__generator||function(H,te){var re,de,oe,je,Ge={label:0,sent:function(){if(1&oe[0])throw oe[1];return oe[1]},trys:[],ops:[]};return je={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(je[Symbol.iterator]=function(){return this}),je;function ut(De){return function(qe){return function(Re){if(re)throw new TypeError("Generator is already executing.");for(;Ge;)try{if(re=1,de&&(oe=2&Re[0]?de.return:Re[0]?de.throw||((oe=de.return)&&oe.call(de),0):de.next)&&!(oe=oe.call(de,Re[1])).done)return oe;switch(de=0,oe&&(Re=[2&Re[0],oe.value]),Re[0]){case 0:case 1:oe=Re;break;case 4:return Ge.label++,{value:Re[1],done:!1};case 5:Ge.label++,de=Re[1],Re=[0];continue;case 7:Re=Ge.ops.pop(),Ge.trys.pop();continue;default:if(!((oe=(oe=Ge.trys).length>0&&oe[oe.length-1])||Re[0]!==6&&Re[0]!==2)){Ge=0;continue}if(Re[0]===3&&(!oe||Re[1]>oe[0]&&Re[1]<oe[3])){Ge.label=Re[1];break}if(Re[0]===6&&Ge.label<oe[1]){Ge.label=oe[1],oe=Re;break}if(oe&&Ge.label<oe[2]){Ge.label=oe[2],Ge.ops.push(Re);break}oe[2]&&Ge.ops.pop(),Ge.trys.pop();continue}Re=te.call(H,Ge)}catch(ie){Re=[6,ie],de=0}finally{re=oe=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([De,qe])}}},i=yt&&yt.__spreadArray||function(H,te){for(var re=0,de=te.length,oe=H.length;re<de;re++,oe++)H[oe]=te[re];return H},o=Object.create,a=Object.defineProperty,s=Object.defineProperties,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=function(H,te,re){return te in H?a(H,te,{enumerable:!0,configurable:!0,writable:!0,value:re}):H[te]=re},_=function(H,te){for(var re in te||(te={}))h.call(te,re)&&m(H,re,te[re]);if(d)for(var de=0,oe=d(te);de<oe.length;de++)p.call(te,re=oe[de])&&m(H,re,te[re]);return H},b=function(H,te){return s(H,u(te))},y=function(H){return a(H,"__esModule",{value:!0})},g=function(H,te){var re={};for(var de in H)h.call(H,de)&&te.indexOf(de)<0&&(re[de]=H[de]);if(H!=null&&d)for(var oe=0,je=d(H);oe<je.length;oe++)te.indexOf(de=je[oe])<0&&p.call(H,de)&&(re[de]=H[de]);return re},v=function(H){return function(te,re,de){if(re&&typeof re=="object"||typeof re=="function")for(var oe=function(ut){h.call(te,ut)||ut==="default"||a(te,ut,{get:function(){return re[ut]},enumerable:!(de=l(re,ut))||de.enumerable})},je=0,Ge=c(re);je<Ge.length;je++)oe(Ge[je]);return te}(y(a(H!=null?o(f(H)):{},"default",H&&H.__esModule&&"default"in H?{get:function(){return H.default},enumerable:!0}:{value:H,enumerable:!0})),H)},S=function(H,te,re){return new Promise(function(de,oe){var je=function(De){try{ut(re.next(De))}catch(qe){oe(qe)}},Ge=function(De){try{ut(re.throw(De))}catch(qe){oe(qe)}},ut=function(De){return De.done?de(De.value):Promise.resolve(De.value).then(je,Ge)};ut((re=re.apply(H,te)).next())})};y(e),function(H,te){for(var re in te)a(H,re,{get:te[re],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return yo},copyWithStructuralSharing:function(){return C},coreModule:function(){return ni},createApi:function(){return hl},defaultSerializeQueryArgs:function(){return Xi},fakeBaseQuery:function(){return dl},fetchBaseQuery:function(){return A},retry:function(){return M},setupListeners:function(){return ee},skipSelector:function(){return zr},skipToken:function(){return pr}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var w=function(H){return[].concat.apply([],H)},x=v(zo).isPlainObject;function C(H,te){if(H===te||!(x(H)&&x(te)||Array.isArray(H)&&Array.isArray(te)))return te;for(var re=Object.keys(te),de=Object.keys(H),oe=re.length===de.length,je=Array.isArray(te)?[]:{},Ge=0,ut=re;Ge<ut.length;Ge++){var De=ut[Ge];je[De]=C(H[De],te[De]),oe&&(oe=H[De]===je[De])}return oe?H:je}var T=v(zo),E=function(){for(var H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];return fetch.apply(void 0,H)},P=function(H){return H.status>=200&&H.status<=299},N=function(H){return/ion\/(vnd\.api\+)?json/.test(H.get("content-type")||"")};function O(H){if(!(0,T.isPlainObject)(H))return H;for(var te=_({},H),re=0,de=Object.entries(te);re<de.length;re++){var oe=de[re];oe[1]===void 0&&delete te[oe[0]]}return te}function A(H){var te=this;H===void 0&&(H={});var re=H.baseUrl,de=H.prepareHeaders,oe=de===void 0?function(wt){return wt}:de,je=H.fetchFn,Ge=je===void 0?E:je,ut=H.paramsSerializer,De=H.isJsonContentType,qe=De===void 0?N:De,Re=H.jsonContentType,ie=Re===void 0?"application/json":Re,xe=H.jsonReplacer,Ye=H.timeout,Ze=H.responseHandler,ct=H.validateStatus,ft=g(H,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&Ge===E&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(wt,Et){return S(te,null,function(){var dn,fn,Ni,Bo,Di,Sr,vi,Qn,bo,Ga,it,hn,rn,ir,xr,bi,Sn,Mt,Wt,xn,on,mn,we,Je,Ue,ke,He,ht,Ve,Ce,ue,Te,fe,ge,Ae,et;return r(this,function(Qe){switch(Qe.label){case 0:return dn=Et.signal,fn=Et.getState,Ni=Et.extra,Bo=Et.endpoint,Di=Et.forced,Sr=Et.type,bo=(Qn=typeof wt=="string"?{url:wt}:wt).url,it=(Ga=Qn.headers)===void 0?new Headers(ft.headers):Ga,rn=(hn=Qn.params)===void 0?void 0:hn,xr=(ir=Qn.responseHandler)===void 0?Ze??"json":ir,Sn=(bi=Qn.validateStatus)===void 0?ct??P:bi,Wt=(Mt=Qn.timeout)===void 0?Ye:Mt,xn=g(Qn,["url","headers","params","responseHandler","validateStatus","timeout"]),on=_(b(_({},ft),{signal:dn}),xn),it=new Headers(O(it)),mn=on,[4,oe(it,{getState:fn,extra:Ni,endpoint:Bo,forced:Di,type:Sr})];case 1:mn.headers=Qe.sent()||it,we=function(Pe){return typeof Pe=="object"&&((0,T.isPlainObject)(Pe)||Array.isArray(Pe)||typeof Pe.toJSON=="function")},!on.headers.has("content-type")&&we(on.body)&&on.headers.set("content-type",ie),we(on.body)&&qe(on.headers)&&(on.body=JSON.stringify(on.body,xe)),rn&&(Je=~bo.indexOf("?")?"&":"?",Ue=ut?ut(rn):new URLSearchParams(O(rn)),bo+=Je+Ue),bo=function(Pe,Tt){if(!Pe)return Tt;if(!Tt)return Pe;if(function(Gt){return new RegExp("(^|:)//").test(Gt)}(Tt))return Tt;var jt=Pe.endsWith("/")||!Tt.startsWith("?")?"/":"";return Pe=function(Gt){return Gt.replace(/\/$/,"")}(Pe),""+Pe+jt+function(Gt){return Gt.replace(/^\//,"")}(Tt)}(re,bo),ke=new Request(bo,on),He=ke.clone(),vi={request:He},Ve=!1,Ce=Wt&&setTimeout(function(){Ve=!0,Et.abort()},Wt),Qe.label=2;case 2:return Qe.trys.push([2,4,5,6]),[4,Ge(ke)];case 3:return ht=Qe.sent(),[3,6];case 4:return ue=Qe.sent(),[2,{error:{status:Ve?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:vi}];case 5:return Ce&&clearTimeout(Ce),[7];case 6:Te=ht.clone(),vi.response=Te,ge="",Qe.label=7;case 7:return Qe.trys.push([7,9,,10]),[4,Promise.all([_t(ht,xr).then(function(Pe){return fe=Pe},function(Pe){return Ae=Pe}),Te.text().then(function(Pe){return ge=Pe},function(){})])];case 8:if(Qe.sent(),Ae)throw Ae;return[3,10];case 9:return et=Qe.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ht.status,data:ge,error:String(et)},meta:vi}];case 10:return[2,Sn(ht,fe)?{data:fe,meta:vi}:{error:{status:ht.status,data:fe},meta:vi}]}})})};function _t(wt,Et){return S(this,null,function(){var dn;return r(this,function(fn){switch(fn.label){case 0:return typeof Et=="function"?[2,Et(wt)]:(Et==="content-type"&&(Et=qe(wt.headers)?"json":"text"),Et!=="json"?[3,2]:[4,wt.text()]);case 1:return[2,(dn=fn.sent()).length?JSON.parse(dn):null];case 2:return[2,wt.text()]}})})}}var k=function(H,te){te===void 0&&(te=void 0),this.value=H,this.meta=te};function D(H,te){return H===void 0&&(H=0),te===void 0&&(te=5),S(this,null,function(){var re,de;return r(this,function(oe){switch(oe.label){case 0:return re=Math.min(H,te),de=~~((Math.random()+.4)*(300<<re)),[4,new Promise(function(je){return setTimeout(function(Ge){return je(Ge)},de)})];case 1:return oe.sent(),[2]}})})}var L={},M=Object.assign(function(H,te){return function(re,de,oe){return S(void 0,null,function(){var je,Ge,ut,De,qe,Re,ie;return r(this,function(xe){switch(xe.label){case 0:je=[5,(te||L).maxRetries,(oe||L).maxRetries].filter(function(Ye){return Ye!==void 0}),Ge=je.slice(-1)[0],ut=function(Ye,Ze,ct){return ct.attempt<=Ge},De=_(_({maxRetries:Ge,backoff:D,retryCondition:ut},te),oe),qe=0,xe.label=1;case 1:xe.label=2;case 2:return xe.trys.push([2,4,,6]),[4,H(re,de,oe)];case 3:if((Re=xe.sent()).error)throw new k(Re);return[2,Re];case 4:if(ie=xe.sent(),qe++,ie.throwImmediately){if(ie instanceof k)return[2,ie.value];throw ie}return ie instanceof k&&!De.retryCondition(ie.value.error,re,{attempt:qe,baseQueryApi:de,extraOptions:oe})?[2,ie.value]:[4,De.backoff(qe,De.maxRetries)];case 5:return xe.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(H){throw Object.assign(new k({error:H}),{throwImmediately:!0})}}),R=v(zo),$=(0,R.createAction)("__rtkq/focused"),B=(0,R.createAction)("__rtkq/unfocused"),U=(0,R.createAction)("__rtkq/online"),G=(0,R.createAction)("__rtkq/offline"),Y=!1;function ee(H,te){return te?te(H,{onFocus:$,onFocusLost:B,onOffline:G,onOnline:U}):(re=function(){return H($())},de=function(){return H(U())},oe=function(){return H(G())},je=function(){window.document.visibilityState==="visible"?re():H(B())},Y||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",je,!1),window.addEventListener("focus",re,!1),window.addEventListener("online",de,!1),window.addEventListener("offline",oe,!1),Y=!0),function(){window.removeEventListener("focus",re),window.removeEventListener("visibilitychange",je),window.removeEventListener("online",de),window.removeEventListener("offline",oe),Y=!1});var re,de,oe,je}var J,j,Q=v(zo);function ne(H){return H.type===J.query}function se(H,te,re,de,oe,je){return typeof H=="function"?H(te,re,de,oe).map(be).map(je):Array.isArray(H)?H.map(be).map(je):[]}function be(H){return typeof H=="string"?{type:H}:H}(j=J||(J={})).query="query",j.mutation="mutation";var ce=v(zo);function bt(H){return H!=null}var ot=Symbol("forceQueryFn"),ze=function(H){return typeof H[ot]=="function"},mt=v(zo),Ie=v(Jp),en=v(zo);function Ir(H){return H}function Dn(H,te,re,de){return se(re[H.meta.arg.endpointName][te],(0,mt.isFulfilled)(H)?H.payload:void 0,(0,mt.isRejectedWithValue)(H)?H.payload:void 0,H.meta.arg.originalArgs,"baseQueryMeta"in H.meta?H.meta.baseQueryMeta:void 0,de)}var Tn=v(Jp),tn=v(Jp);function Ln(H,te,re){var de=H[te];de&&re(de)}function Rr(H){var te;return(te="arg"in H?H.arg.fixedCacheKey:H.fixedCacheKey)!=null?te:H.requestId}function mo(H,te,re){var de=H[Rr(te)];de&&re(de)}var Jr={},pr=Symbol.for("RTKQ/skipToken"),zr=pr,ei={status:t.uninitialized},Fn=(0,Q.createNextState)(ei,function(){}),_n=(0,Q.createNextState)(ei,function(){}),Mi=v(zo),gi=WeakMap?new WeakMap:void 0,Xi=function(H){var te=H.endpointName,re=H.queryArgs,de="",oe=gi==null?void 0:gi.get(re);if(typeof oe=="string")de=oe;else{var je=JSON.stringify(re,function(Ge,ut){return(0,Mi.isPlainObject)(ut)?Object.keys(ut).sort().reduce(function(De,qe){return De[qe]=ut[qe],De},{}):ut});(0,Mi.isPlainObject)(re)&&(gi==null||gi.set(re,je)),de=je}return te+"("+de+")"},Ua=v(zo),Or=v(Dde);function yo(){for(var H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];return function(re){var de=(0,Or.defaultMemoize)(function(De){var qe,Re;return(Re=re.extractRehydrationInfo)==null?void 0:Re.call(re,De,{reducerPath:(qe=re.reducerPath)!=null?qe:"api"})}),oe=b(_({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},re),{extractRehydrationInfo:de,serializeQueryArgs:function(De){var qe=Xi;if("serializeQueryArgs"in De.endpointDefinition){var Re=De.endpointDefinition.serializeQueryArgs;qe=function(ie){var xe=Re(ie);return typeof xe=="string"?xe:Xi(b(_({},ie),{queryArgs:xe}))}}else re.serializeQueryArgs&&(qe=re.serializeQueryArgs);return qe(De)},tagTypes:i([],re.tagTypes||[])}),je={endpointDefinitions:{},batch:function(De){De()},apiUid:(0,Ua.nanoid)(),extractRehydrationInfo:de,hasRehydrationInfo:(0,Or.defaultMemoize)(function(De){return de(De)!=null})},Ge={injectEndpoints:function(De){for(var qe=De.endpoints({query:function(_t){return b(_({},_t),{type:J.query})},mutation:function(_t){return b(_({},_t),{type:J.mutation})}}),Re=0,ie=Object.entries(qe);Re<ie.length;Re++){var xe=ie[Re],Ye=xe[0],Ze=xe[1];if(De.overrideExisting||!(Ye in je.endpointDefinitions)){je.endpointDefinitions[Ye]=Ze;for(var ct=0,ft=ut;ct<ft.length;ct++)ft[ct].injectEndpoint(Ye,Ze)}}return Ge},enhanceEndpoints:function(De){var qe=De.addTagTypes,Re=De.endpoints;if(qe)for(var ie=0,xe=qe;ie<xe.length;ie++){var Ye=xe[ie];oe.tagTypes.includes(Ye)||oe.tagTypes.push(Ye)}if(Re)for(var Ze=0,ct=Object.entries(Re);Ze<ct.length;Ze++){var ft=ct[Ze],_t=ft[0],wt=ft[1];typeof wt=="function"?wt(je.endpointDefinitions[_t]):Object.assign(je.endpointDefinitions[_t]||{},wt)}return Ge}},ut=H.map(function(De){return De.init(Ge,oe,je)});return Ge.injectEndpoints({endpoints:re.endpoints})}}function dl(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Fo,fl=v(zo),Bn=function(H){var te=H.reducerPath,re=H.api,de=H.context,oe=H.internalState,je=re.internalActions,Ge=je.removeQueryResult,ut=je.unsubscribeQueryResult;function De(ie){var xe=oe.currentSubscriptions[ie];return!!xe&&!function(Ye){for(var Ze in Ye)return!1;return!0}(xe)}var qe={};function Re(ie,xe,Ye,Ze){var ct,ft=de.endpointDefinitions[xe],_t=(ct=ft==null?void 0:ft.keepUnusedDataFor)!=null?ct:Ze.keepUnusedDataFor;if(_t!==1/0){var wt=Math.max(0,Math.min(_t,2147482647e-3));if(!De(ie)){var Et=qe[ie];Et&&clearTimeout(Et),qe[ie]=setTimeout(function(){De(ie)||Ye.dispatch(Ge({queryCacheKey:ie})),delete qe[ie]},1e3*wt)}}}return function(ie,xe,Ye){var Ze;if(ut.match(ie)){var ct=xe.getState()[te];Re(Di=ie.payload.queryCacheKey,(Ze=ct.queries[Di])==null?void 0:Ze.endpointName,xe,ct.config)}if(re.util.resetApiState.match(ie))for(var ft=0,_t=Object.entries(qe);ft<_t.length;ft++){var wt=_t[ft],Et=wt[0],dn=wt[1];dn&&clearTimeout(dn),delete qe[Et]}if(de.hasRehydrationInfo(ie)){ct=xe.getState()[te];for(var fn=de.extractRehydrationInfo(ie).queries,Ni=0,Bo=Object.entries(fn);Ni<Bo.length;Ni++){var Di,Sr=Bo[Ni],vi=Sr[1];Re(Di=Sr[0],vi==null?void 0:vi.endpointName,xe,ct.config)}}}},nn=v(zo),jr=function(H){var te=H.reducerPath,re=H.context,de=H.context.endpointDefinitions,oe=H.mutationThunk,je=H.api,Ge=H.assertTagType,ut=H.refetchQuery,De=je.internalActions.removeQueryResult,qe=(0,nn.isAnyOf)((0,nn.isFulfilled)(oe),(0,nn.isRejectedWithValue)(oe));function Re(ie,xe){var Ye=xe.getState(),Ze=Ye[te],ct=je.util.selectInvalidatedBy(Ye,ie);re.batch(function(){for(var ft,_t=0,wt=Array.from(ct.values());_t<wt.length;_t++){var Et=wt[_t].queryCacheKey,dn=Ze.queries[Et],fn=(ft=Ze.subscriptions[Et])!=null?ft:{};dn&&(Object.keys(fn).length===0?xe.dispatch(De({queryCacheKey:Et})):dn.status!==t.uninitialized&&xe.dispatch(ut(dn,Et)))}})}return function(ie,xe){qe(ie)&&Re(Dn(ie,"invalidatesTags",de,Ge),xe),je.util.invalidateTags.match(ie)&&Re(se(ie.payload,void 0,void 0,void 0,void 0,Ge),xe)}},Mr=function(H){var te=H.reducerPath,re=H.queryThunk,de=H.api,oe=H.refetchQuery,je=H.internalState,Ge={};function ut(ie,xe){var Ye=ie.queryCacheKey,Ze=xe.getState()[te].queries[Ye];if(Ze&&Ze.status!==t.uninitialized){var ct=Re(je.currentSubscriptions[Ye]);if(Number.isFinite(ct)){var ft=Ge[Ye];ft!=null&&ft.timeout&&(clearTimeout(ft.timeout),ft.timeout=void 0);var _t=Date.now()+ct,wt=Ge[Ye]={nextPollTimestamp:_t,pollingInterval:ct,timeout:setTimeout(function(){wt.timeout=void 0,xe.dispatch(oe(Ze,Ye))},ct)}}}}function De(ie,xe){var Ye=ie.queryCacheKey,Ze=xe.getState()[te].queries[Ye];if(Ze&&Ze.status!==t.uninitialized){var ct=Re(je.currentSubscriptions[Ye]);if(Number.isFinite(ct)){var ft=Ge[Ye],_t=Date.now()+ct;(!ft||_t<ft.nextPollTimestamp)&&ut({queryCacheKey:Ye},xe)}else qe(Ye)}}function qe(ie){var xe=Ge[ie];xe!=null&&xe.timeout&&clearTimeout(xe.timeout),delete Ge[ie]}function Re(ie){ie===void 0&&(ie={});var xe=Number.POSITIVE_INFINITY;for(var Ye in ie)ie[Ye].pollingInterval&&(xe=Math.min(ie[Ye].pollingInterval,xe));return xe}return function(ie,xe){(de.internalActions.updateSubscriptionOptions.match(ie)||de.internalActions.unsubscribeQueryResult.match(ie))&&De(ie.payload,xe),(re.pending.match(ie)||re.rejected.match(ie)&&ie.meta.condition)&&De(ie.meta.arg,xe),(re.fulfilled.match(ie)||re.rejected.match(ie)&&!ie.meta.condition)&&ut(ie.meta.arg,xe),de.util.resetApiState.match(ie)&&function(){for(var Ye=0,Ze=Object.keys(Ge);Ye<Ze.length;Ye++)qe(Ze[Ye])}()}},$r=v(zo),ti=new Error("Promise never resolved before cacheEntryRemoved."),$i=function(H){var te=H.api,re=H.reducerPath,de=H.context,oe=H.queryThunk,je=H.mutationThunk,Ge=(0,$r.isAsyncThunkAction)(oe),ut=(0,$r.isAsyncThunkAction)(je),De=(0,$r.isFulfilled)(oe,je),qe={};function Re(ie,xe,Ye,Ze,ct){var ft=de.endpointDefinitions[ie],_t=ft==null?void 0:ft.onCacheEntryAdded;if(_t){var wt={},Et=new Promise(function(Sr){wt.cacheEntryRemoved=Sr}),dn=Promise.race([new Promise(function(Sr){wt.valueResolved=Sr}),Et.then(function(){throw ti})]);dn.catch(function(){}),qe[Ye]=wt;var fn=te.endpoints[ie].select(ft.type===J.query?xe:Ye),Ni=Ze.dispatch(function(Sr,vi,Qn){return Qn}),Bo=b(_({},Ze),{getCacheEntry:function(){return fn(Ze.getState())},requestId:ct,extra:Ni,updateCachedData:ft.type===J.query?function(Sr){return Ze.dispatch(te.util.updateQueryData(ie,xe,Sr))}:void 0,cacheDataLoaded:dn,cacheEntryRemoved:Et}),Di=_t(xe,Bo);Promise.resolve(Di).catch(function(Sr){if(Sr!==ti)throw Sr})}}return function(ie,xe,Ye){var Ze=function(fn){return Ge(fn)?fn.meta.arg.queryCacheKey:ut(fn)?fn.meta.requestId:te.internalActions.removeQueryResult.match(fn)?fn.payload.queryCacheKey:te.internalActions.removeMutationResult.match(fn)?Rr(fn.payload):""}(ie);if(oe.pending.match(ie)){var ct=Ye[re].queries[Ze],ft=xe.getState()[re].queries[Ze];!ct&&ft&&Re(ie.meta.arg.endpointName,ie.meta.arg.originalArgs,Ze,xe,ie.meta.requestId)}else if(je.pending.match(ie))(ft=xe.getState()[re].mutations[Ze])&&Re(ie.meta.arg.endpointName,ie.meta.arg.originalArgs,Ze,xe,ie.meta.requestId);else if(De(ie))(dn=qe[Ze])!=null&&dn.valueResolved&&(dn.valueResolved({data:ie.payload,meta:ie.meta.baseQueryMeta}),delete dn.valueResolved);else if(te.internalActions.removeQueryResult.match(ie)||te.internalActions.removeMutationResult.match(ie))(dn=qe[Ze])&&(delete qe[Ze],dn.cacheEntryRemoved());else if(te.util.resetApiState.match(ie))for(var _t=0,wt=Object.entries(qe);_t<wt.length;_t++){var Et=wt[_t],dn=Et[1];delete qe[Et[0]],dn.cacheEntryRemoved()}}},vo=v(zo),mi=function(H){var te=H.api,re=H.context,de=H.queryThunk,oe=H.mutationThunk,je=(0,vo.isPending)(de,oe),Ge=(0,vo.isRejected)(de,oe),ut=(0,vo.isFulfilled)(de,oe),De={};return function(qe,Re){var ie,xe,Ye;if(je(qe)){var Ze=qe.meta,ct=Ze.requestId,ft=Ze.arg,_t=ft.endpointName,wt=ft.originalArgs,Et=re.endpointDefinitions[_t],dn=Et==null?void 0:Et.onQueryStarted;if(dn){var fn={},Ni=new Promise(function(Ga,it){fn.resolve=Ga,fn.reject=it});Ni.catch(function(){}),De[ct]=fn;var Bo=te.endpoints[_t].select(Et.type===J.query?wt:ct),Di=Re.dispatch(function(Ga,it,hn){return hn}),Sr=b(_({},Re),{getCacheEntry:function(){return Bo(Re.getState())},requestId:ct,extra:Di,updateCachedData:Et.type===J.query?function(Ga){return Re.dispatch(te.util.updateQueryData(_t,wt,Ga))}:void 0,queryFulfilled:Ni});dn(wt,Sr)}}else if(ut(qe)){var vi=qe.meta,Qn=vi.baseQueryMeta;(ie=De[ct=vi.requestId])==null||ie.resolve({data:qe.payload,meta:Qn}),delete De[ct]}else if(Ge(qe)){var bo=qe.meta;Qn=bo.baseQueryMeta,(Ye=De[ct=bo.requestId])==null||Ye.reject({error:(xe=qe.payload)!=null?xe:qe.error,isUnhandledError:!bo.rejectedWithValue,meta:Qn}),delete De[ct]}}},Ur=function(H){var te=H.api,re=H.context.apiUid;return function(de,oe){te.util.resetApiState.match(de)&&oe.dispatch(te.internalActions.middlewareRegistered(re))}},Va=v(Jp),bs=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof yt<"u"?yt:globalThis):function(H){return(Fo||(Fo=Promise.resolve())).then(H).catch(function(te){return setTimeout(function(){throw te},0)})};function yi(H){for(var te=[],re=1;re<arguments.length;re++)te[re-1]=arguments[re];Object.assign.apply(Object,i([H],te))}var cu=v(Jp),ua=Symbol(),ni=function(){return{name:ua,init:function(H,te,re){var de=te.baseQuery,oe=te.reducerPath,je=te.serializeQueryArgs,Ge=te.keepUnusedDataFor,ut=te.refetchOnMountOrArgChange,De=te.refetchOnFocus,qe=te.refetchOnReconnect;(0,cu.enablePatches)();var Re=function(it){return it};Object.assign(H,{reducerPath:oe,endpoints:{},internalActions:{onOnline:U,onOffline:G,onFocus:$,onFocusLost:B},util:{}});var ie=function(it){var hn=this,rn=it.reducerPath,ir=it.baseQuery,xr=it.context.endpointDefinitions,bi=it.serializeQueryArgs,Sn=it.api,Mt=function(we,Je){return S(hn,[we,Je],function(Ue,ke){var He,ht,Ve,Ce,ue,Te,fe,ge,Ae,et,Qe,Pe,Tt,jt=ke.signal,Gt=ke.abort,or=ke.rejectWithValue,gr=ke.fulfillWithValue,zn=ke.dispatch,kn=ke.getState,Yi=ke.extra;return r(this,function(F){switch(F.label){case 0:He=xr[Ue.endpointName],F.label=1;case 1:return F.trys.push([1,8,,13]),ht=Ir,Ve=void 0,Ce={signal:jt,abort:Gt,dispatch:zn,getState:kn,extra:Yi,endpoint:Ue.endpointName,type:Ue.type,forced:Ue.type==="query"?Wt(Ue,kn()):void 0},(ue=Ue.type==="query"?Ue[ot]:void 0)?(Ve=ue(),[3,6]):[3,2];case 2:return He.query?[4,ir(He.query(Ue.originalArgs),Ce,He.extraOptions)]:[3,4];case 3:return Ve=F.sent(),He.transformResponse&&(ht=He.transformResponse),[3,6];case 4:return[4,He.queryFn(Ue.originalArgs,Ce,He.extraOptions,function(V){return ir(V,Ce,He.extraOptions)})];case 5:Ve=F.sent(),F.label=6;case 6:if(Ve.error)throw new k(Ve.error,Ve.meta);return Te=gr,[4,ht(Ve.data,Ve.meta,Ue.originalArgs)];case 7:return[2,Te.apply(void 0,[F.sent(),(Pe={fulfilledTimeStamp:Date.now(),baseQueryMeta:Ve.meta},Pe[en.SHOULD_AUTOBATCH]=!0,Pe)])];case 8:if(fe=F.sent(),!((ge=fe)instanceof k))return[3,12];Ae=Ir,He.query&&He.transformErrorResponse&&(Ae=He.transformErrorResponse),F.label=9;case 9:return F.trys.push([9,11,,12]),et=or,[4,Ae(ge.value,ge.meta,Ue.originalArgs)];case 10:return[2,et.apply(void 0,[F.sent(),(Tt={baseQueryMeta:ge.meta},Tt[en.SHOULD_AUTOBATCH]=!0,Tt)])];case 11:return Qe=F.sent(),ge=Qe,[3,12];case 12:throw console.error(ge),ge;case 13:return[2]}})})};function Wt(we,Je){var Ue,ke,He,ht,Ve=(ke=(Ue=Je[rn])==null?void 0:Ue.queries)==null?void 0:ke[we.queryCacheKey],Ce=(He=Je[rn])==null?void 0:He.config.refetchOnMountOrArgChange,ue=Ve==null?void 0:Ve.fulfilledTimeStamp,Te=(ht=we.forceRefetch)!=null?ht:we.subscribe&&Ce;return!!Te&&(Te===!0||(Number(new Date)-Number(ue))/1e3>=Te)}var xn=(0,en.createAsyncThunk)(rn+"/executeQuery",Mt,{getPendingMeta:function(){var we;return(we={startedTimeStamp:Date.now()})[en.SHOULD_AUTOBATCH]=!0,we},condition:function(we,Je){var Ue,ke,He,ht=(0,Je.getState)(),Ve=(ke=(Ue=ht[rn])==null?void 0:Ue.queries)==null?void 0:ke[we.queryCacheKey],Ce=Ve==null?void 0:Ve.fulfilledTimeStamp,ue=we.originalArgs,Te=Ve==null?void 0:Ve.originalArgs,fe=xr[we.endpointName];return!(!ze(we)&&((Ve==null?void 0:Ve.status)==="pending"||!Wt(we,ht)&&(!ne(fe)||!((He=fe==null?void 0:fe.forceRefetch)!=null&&He.call(fe,{currentArg:ue,previousArg:Te,endpointState:Ve,state:ht})))&&Ce))},dispatchConditionRejection:!0}),on=(0,en.createAsyncThunk)(rn+"/executeMutation",Mt,{getPendingMeta:function(){var we;return(we={startedTimeStamp:Date.now()})[en.SHOULD_AUTOBATCH]=!0,we}});function mn(we){return function(Je){var Ue,ke;return((ke=(Ue=Je==null?void 0:Je.meta)==null?void 0:Ue.arg)==null?void 0:ke.endpointName)===we}}return{queryThunk:xn,mutationThunk:on,prefetch:function(we,Je,Ue){return function(ke,He){var ht=function(fe){return"force"in fe}(Ue)&&Ue.force,Ve=function(fe){return"ifOlderThan"in fe}(Ue)&&Ue.ifOlderThan,Ce=function(fe){return fe===void 0&&(fe=!0),Sn.endpoints[we].initiate(Je,{forceRefetch:fe})},ue=Sn.endpoints[we].select(Je)(He());if(ht)ke(Ce());else if(Ve){var Te=ue==null?void 0:ue.fulfilledTimeStamp;if(!Te)return void ke(Ce());(Number(new Date)-Number(new Date(Te)))/1e3>=Ve&&ke(Ce())}else ke(Ce(!1))}},updateQueryData:function(we,Je,Ue){return function(ke,He){var ht,Ve,Ce=Sn.endpoints[we].select(Je)(He()),ue={patches:[],inversePatches:[],undo:function(){return ke(Sn.util.patchQueryData(we,Je,ue.inversePatches))}};if(Ce.status===t.uninitialized)return ue;if("data"in Ce)if((0,Ie.isDraftable)(Ce.data)){var Te=(0,Ie.produceWithPatches)(Ce.data,Ue),fe=Te[2];(ht=ue.patches).push.apply(ht,Te[1]),(Ve=ue.inversePatches).push.apply(Ve,fe)}else{var ge=Ue(Ce.data);ue.patches.push({op:"replace",path:[],value:ge}),ue.inversePatches.push({op:"replace",path:[],value:Ce.data})}return ke(Sn.util.patchQueryData(we,Je,ue.patches)),ue}},upsertQueryData:function(we,Je,Ue){return function(ke){var He;return ke(Sn.endpoints[we].initiate(Je,((He={subscribe:!1,forceRefetch:!0})[ot]=function(){return{data:Ue}},He)))}},patchQueryData:function(we,Je,Ue){return function(ke){ke(Sn.internalActions.queryResultPatched({queryCacheKey:bi({queryArgs:Je,endpointDefinition:xr[we],endpointName:we}),patches:Ue}))}},buildMatchThunkActions:function(we,Je){return{matchPending:(0,mt.isAllOf)((0,mt.isPending)(we),mn(Je)),matchFulfilled:(0,mt.isAllOf)((0,mt.isFulfilled)(we),mn(Je)),matchRejected:(0,mt.isAllOf)((0,mt.isRejected)(we),mn(Je))}}}}({baseQuery:de,reducerPath:oe,context:re,api:H,serializeQueryArgs:je}),xe=ie.queryThunk,Ye=ie.mutationThunk,Ze=ie.patchQueryData,ct=ie.updateQueryData,ft=ie.upsertQueryData,_t=ie.prefetch,wt=ie.buildMatchThunkActions,Et=function(it){var hn=it.reducerPath,rn=it.queryThunk,ir=it.mutationThunk,xr=it.context,bi=xr.endpointDefinitions,Sn=xr.apiUid,Mt=xr.extractRehydrationInfo,Wt=xr.hasRehydrationInfo,xn=it.assertTagType,on=it.config,mn=(0,ce.createAction)(hn+"/resetApiState"),we=(0,ce.createSlice)({name:hn+"/queries",initialState:Jr,reducers:{removeQueryResult:{reducer:function(Ce,ue){delete Ce[ue.payload.queryCacheKey]},prepare:(0,ce.prepareAutoBatched)()},queryResultPatched:function(Ce,ue){var Te=ue.payload,fe=Te.patches;Ln(Ce,Te.queryCacheKey,function(ge){ge.data=(0,tn.applyPatches)(ge.data,fe.concat())})}},extraReducers:function(Ce){Ce.addCase(rn.pending,function(ue,Te){var fe,ge=Te.meta,Ae=Te.meta.arg,et=ze(Ae);(Ae.subscribe||et)&&(ue[fe=Ae.queryCacheKey]!=null||(ue[fe]={status:t.uninitialized,endpointName:Ae.endpointName})),Ln(ue,Ae.queryCacheKey,function(Qe){Qe.status=t.pending,Qe.requestId=et&&Qe.requestId?Qe.requestId:ge.requestId,Ae.originalArgs!==void 0&&(Qe.originalArgs=Ae.originalArgs),Qe.startedTimeStamp=ge.startedTimeStamp})}).addCase(rn.fulfilled,function(ue,Te){var fe=Te.meta,ge=Te.payload;Ln(ue,fe.arg.queryCacheKey,function(Ae){var et;if(Ae.requestId===fe.requestId||ze(fe.arg)){var Qe=bi[fe.arg.endpointName].merge;if(Ae.status=t.fulfilled,Qe)if(Ae.data!==void 0){var Pe=fe.fulfilledTimeStamp,Tt=fe.arg,jt=fe.baseQueryMeta,Gt=fe.requestId,or=(0,ce.createNextState)(Ae.data,function(gr){return Qe(gr,ge,{arg:Tt.originalArgs,baseQueryMeta:jt,fulfilledTimeStamp:Pe,requestId:Gt})});Ae.data=or}else Ae.data=ge;else Ae.data=(et=bi[fe.arg.endpointName].structuralSharing)==null||et?C((0,Tn.isDraft)(Ae.data)?(0,tn.original)(Ae.data):Ae.data,ge):ge;delete Ae.error,Ae.fulfilledTimeStamp=fe.fulfilledTimeStamp}})}).addCase(rn.rejected,function(ue,Te){var fe=Te.meta,ge=fe.condition,Ae=fe.requestId,et=Te.error,Qe=Te.payload;Ln(ue,fe.arg.queryCacheKey,function(Pe){if(!ge){if(Pe.requestId!==Ae)return;Pe.status=t.rejected,Pe.error=Qe??et}})}).addMatcher(Wt,function(ue,Te){for(var fe=Mt(Te).queries,ge=0,Ae=Object.entries(fe);ge<Ae.length;ge++){var et=Ae[ge],Qe=et[1];(Qe==null?void 0:Qe.status)!==t.fulfilled&&(Qe==null?void 0:Qe.status)!==t.rejected||(ue[et[0]]=Qe)}})}}),Je=(0,ce.createSlice)({name:hn+"/mutations",initialState:Jr,reducers:{removeMutationResult:{reducer:function(Ce,ue){var Te=Rr(ue.payload);Te in Ce&&delete Ce[Te]},prepare:(0,ce.prepareAutoBatched)()}},extraReducers:function(Ce){Ce.addCase(ir.pending,function(ue,Te){var fe=Te.meta,ge=fe.requestId,Ae=fe.arg,et=fe.startedTimeStamp;Ae.track&&(ue[Rr(Te.meta)]={requestId:ge,status:t.pending,endpointName:Ae.endpointName,startedTimeStamp:et})}).addCase(ir.fulfilled,function(ue,Te){var fe=Te.payload,ge=Te.meta;ge.arg.track&&mo(ue,ge,function(Ae){Ae.requestId===ge.requestId&&(Ae.status=t.fulfilled,Ae.data=fe,Ae.fulfilledTimeStamp=ge.fulfilledTimeStamp)})}).addCase(ir.rejected,function(ue,Te){var fe=Te.payload,ge=Te.error,Ae=Te.meta;Ae.arg.track&&mo(ue,Ae,function(et){et.requestId===Ae.requestId&&(et.status=t.rejected,et.error=fe??ge)})}).addMatcher(Wt,function(ue,Te){for(var fe=Mt(Te).mutations,ge=0,Ae=Object.entries(fe);ge<Ae.length;ge++){var et=Ae[ge],Qe=et[0],Pe=et[1];(Pe==null?void 0:Pe.status)!==t.fulfilled&&(Pe==null?void 0:Pe.status)!==t.rejected||Qe===(Pe==null?void 0:Pe.requestId)||(ue[Qe]=Pe)}})}}),Ue=(0,ce.createSlice)({name:hn+"/invalidation",initialState:Jr,reducers:{},extraReducers:function(Ce){Ce.addCase(we.actions.removeQueryResult,function(ue,Te){for(var fe=Te.payload.queryCacheKey,ge=0,Ae=Object.values(ue);ge<Ae.length;ge++)for(var et=0,Qe=Object.values(Ae[ge]);et<Qe.length;et++){var Pe=Qe[et],Tt=Pe.indexOf(fe);Tt!==-1&&Pe.splice(Tt,1)}}).addMatcher(Wt,function(ue,Te){for(var fe,ge,Ae,et,Qe=Mt(Te).provided,Pe=0,Tt=Object.entries(Qe);Pe<Tt.length;Pe++)for(var jt=Tt[Pe],Gt=jt[0],or=0,gr=Object.entries(jt[1]);or<gr.length;or++)for(var zn=gr[or],kn=zn[0],Yi=zn[1],F=(et=(ge=(fe=ue[Gt])!=null?fe:ue[Gt]={})[Ae=kn||"__internal_without_id"])!=null?et:ge[Ae]=[],V=0,X=Yi;V<X.length;V++){var pe=X[V];F.includes(pe)||F.push(pe)}}).addMatcher((0,ce.isAnyOf)((0,ce.isFulfilled)(rn),(0,ce.isRejectedWithValue)(rn)),function(ue,Te){for(var fe,ge,Ae,et,Qe=Dn(Te,"providesTags",bi,xn),Pe=Te.meta.arg.queryCacheKey,Tt=0,jt=Object.values(ue);Tt<jt.length;Tt++)for(var Gt=0,or=Object.values(jt[Tt]);Gt<or.length;Gt++){var gr=or[Gt],zn=gr.indexOf(Pe);zn!==-1&&gr.splice(zn,1)}for(var kn=0,Yi=Qe;kn<Yi.length;kn++){var F=Yi[kn],V=F.type,X=F.id,pe=(et=(ge=(fe=ue[V])!=null?fe:ue[V]={})[Ae=X||"__internal_without_id"])!=null?et:ge[Ae]=[];pe.includes(Pe)||pe.push(Pe)}})}}),ke=(0,ce.createSlice)({name:hn+"/subscriptions",initialState:Jr,reducers:{updateSubscriptionOptions:function(Ce,ue){},unsubscribeQueryResult:function(Ce,ue){},internal_probeSubscription:function(Ce,ue){}}}),He=(0,ce.createSlice)({name:hn+"/internalSubscriptions",initialState:Jr,reducers:{subscriptionsUpdated:{reducer:function(Ce,ue){return(0,tn.applyPatches)(Ce,ue.payload)},prepare:(0,ce.prepareAutoBatched)()}}}),ht=(0,ce.createSlice)({name:hn+"/config",initialState:_({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},on),reducers:{middlewareRegistered:function(Ce,ue){Ce.middlewareRegistered=Ce.middlewareRegistered!=="conflict"&&Sn===ue.payload||"conflict"}},extraReducers:function(Ce){Ce.addCase(U,function(ue){ue.online=!0}).addCase(G,function(ue){ue.online=!1}).addCase($,function(ue){ue.focused=!0}).addCase(B,function(ue){ue.focused=!1}).addMatcher(Wt,function(ue){return _({},ue)})}}),Ve=(0,ce.combineReducers)({queries:we.reducer,mutations:Je.reducer,provided:Ue.reducer,subscriptions:He.reducer,config:ht.reducer});return{reducer:function(Ce,ue){return Ve(mn.match(ue)?void 0:Ce,ue)},actions:b(_(_(_(_(_({},ht.actions),we.actions),ke.actions),He.actions),Je.actions),{unsubscribeMutationResult:Je.actions.removeMutationResult,resetApiState:mn})}}({context:re,queryThunk:xe,mutationThunk:Ye,reducerPath:oe,assertTagType:Re,config:{refetchOnFocus:De,refetchOnReconnect:qe,refetchOnMountOrArgChange:ut,keepUnusedDataFor:Ge,reducerPath:oe}}),dn=Et.reducer,fn=Et.actions;yi(H.util,{patchQueryData:Ze,updateQueryData:ct,upsertQueryData:ft,prefetch:_t,resetApiState:fn.resetApiState}),yi(H.internalActions,fn);var Ni=function(it){var hn=it.reducerPath,rn=it.queryThunk,ir=it.api,xr=it.context,bi=xr.apiUid,Sn={invalidateTags:(0,fl.createAction)(hn+"/invalidateTags")},Mt=[Ur,Bn,jr,Mr,$i,mi];return{middleware:function(xn){var on=!1,mn=b(_({},it),{internalState:{currentSubscriptions:{}},refetchQuery:Wt}),we=Mt.map(function(ke){return ke(mn)}),Je=function(ke){var He=ke.api,ht=ke.queryThunk,Ve=ke.internalState,Ce=He.reducerPath+"/subscriptions",ue=null,Te=!1,fe=He.internalActions,ge=fe.updateSubscriptionOptions,Ae=fe.unsubscribeQueryResult;return function(et,Qe){var Pe,Tt;if(ue||(ue=JSON.parse(JSON.stringify(Ve.currentSubscriptions))),He.util.resetApiState.match(et))return ue=Ve.currentSubscriptions={},[!0,!1];if(He.internalActions.internal_probeSubscription.match(et)){var jt=et.payload;return[!1,!!((Pe=Ve.currentSubscriptions[jt.queryCacheKey])!=null&&Pe[jt.requestId])]}var Gt=function(zn,kn){var Yi,F,V,X,pe,Ct,pn,Pn,It;if(ge.match(kn)){var wn=kn.payload,_i=wn.queryCacheKey,Xn=wn.requestId;return(Yi=zn==null?void 0:zn[_i])!=null&&Yi[Xn]&&(zn[_i][Xn]=wn.options),!0}if(Ae.match(kn)){var du=kn.payload;return Xn=du.requestId,zn[_i=du.queryCacheKey]&&delete zn[_i][Xn],!0}if(He.internalActions.removeQueryResult.match(kn))return delete zn[kn.payload.queryCacheKey],!0;if(ht.pending.match(kn)){var lf=kn.meta;if(Xn=lf.requestId,(cf=lf.arg).subscribe)return(fu=(V=zn[F=cf.queryCacheKey])!=null?V:zn[F]={})[Xn]=(pe=(X=cf.subscriptionOptions)!=null?X:fu[Xn])!=null?pe:{},!0}if(ht.rejected.match(kn)){var fu,uf=kn.meta,cf=uf.arg;if(Xn=uf.requestId,uf.condition&&cf.subscribe)return(fu=(pn=zn[Ct=cf.queryCacheKey])!=null?pn:zn[Ct]={})[Xn]=(It=(Pn=cf.subscriptionOptions)!=null?Pn:fu[Xn])!=null?It:{},!0}return!1}(Ve.currentSubscriptions,et);if(Gt){Te||(bs(function(){var zn=JSON.parse(JSON.stringify(Ve.currentSubscriptions)),kn=(0,Va.produceWithPatches)(ue,function(){return zn});Qe.next(He.internalActions.subscriptionsUpdated(kn[1])),ue=zn,Te=!1}),Te=!0);var or=!!((Tt=et.type)!=null&&Tt.startsWith(Ce)),gr=ht.rejected.match(et)&&et.meta.condition&&!!et.meta.arg.subscribe;return[!or&&!gr,!1]}return[!0,!1]}}(mn),Ue=function(ke){var He=ke.reducerPath,ht=ke.context,Ve=ke.refetchQuery,Ce=ke.internalState,ue=ke.api.internalActions.removeQueryResult;function Te(fe,ge){var Ae=fe.getState()[He],et=Ae.queries,Qe=Ce.currentSubscriptions;ht.batch(function(){for(var Pe=0,Tt=Object.keys(Qe);Pe<Tt.length;Pe++){var jt=Tt[Pe],Gt=et[jt],or=Qe[jt];or&&Gt&&(Object.values(or).some(function(gr){return gr[ge]===!0})||Object.values(or).every(function(gr){return gr[ge]===void 0})&&Ae.config[ge])&&(Object.keys(or).length===0?fe.dispatch(ue({queryCacheKey:jt})):Gt.status!==t.uninitialized&&fe.dispatch(Ve(Gt,jt)))}})}return function(fe,ge){$.match(fe)&&Te(ge,"refetchOnFocus"),U.match(fe)&&Te(ge,"refetchOnReconnect")}}(mn);return function(ke){return function(He){on||(on=!0,xn.dispatch(ir.internalActions.middlewareRegistered(bi)));var ht,Ve=b(_({},xn),{next:ke}),Ce=xn.getState(),ue=Je(He,Ve,Ce),Te=ue[1];if(ht=ue[0]?ke(He):Te,xn.getState()[hn]&&(Ue(He,Ve,Ce),function(Ae){return!!Ae&&typeof Ae.type=="string"&&Ae.type.startsWith(hn+"/")}(He)||xr.hasRehydrationInfo(He)))for(var fe=0,ge=we;fe<ge.length;fe++)(0,ge[fe])(He,Ve,Ce);return ht}}},actions:Sn};function Wt(xn,on,mn){return mn===void 0&&(mn={}),rn(_({type:"query",endpointName:xn.endpointName,originalArgs:xn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:on},mn))}}({reducerPath:oe,context:re,queryThunk:xe,mutationThunk:Ye,api:H,assertTagType:Re}),Bo=Ni.middleware;yi(H.util,Ni.actions),yi(H,{reducer:dn,middleware:Bo});var Di=function(it){var hn=it.serializeQueryArgs,rn=it.reducerPath,ir=function(Mt){return Fn},xr=function(Mt){return _n};return{buildQuerySelector:function(Mt,Wt){return function(xn){var on=hn({queryArgs:xn,endpointDefinition:Wt,endpointName:Mt});return(0,Q.createSelector)(xn===pr?ir:function(mn){var we,Je,Ue;return(Ue=(Je=(we=Sn(mn))==null?void 0:we.queries)==null?void 0:Je[on])!=null?Ue:Fn},bi)}},buildMutationSelector:function(){return function(Mt){var Wt,xn;return xn=typeof Mt=="object"?(Wt=Rr(Mt))!=null?Wt:pr:Mt,(0,Q.createSelector)(xn===pr?xr:function(on){var mn,we,Je;return(Je=(we=(mn=Sn(on))==null?void 0:mn.mutations)==null?void 0:we[xn])!=null?Je:_n},bi)}},selectInvalidatedBy:function(Mt,Wt){for(var xn,on=Mt[rn],mn=new Set,we=0,Je=Wt.map(be);we<Je.length;we++){var Ue=Je[we],ke=on.provided[Ue.type];if(ke)for(var He=0,ht=(xn=Ue.id!==void 0?ke[Ue.id]:w(Object.values(ke)))!=null?xn:[];He<ht.length;He++)mn.add(ht[He])}return w(Array.from(mn.values()).map(function(Ve){var Ce=on.queries[Ve];return Ce?[{queryCacheKey:Ve,endpointName:Ce.endpointName,originalArgs:Ce.originalArgs}]:[]}))}};function bi(Mt){return _(_({},Mt),{status:Wt=Mt.status,isUninitialized:Wt===t.uninitialized,isLoading:Wt===t.pending,isSuccess:Wt===t.fulfilled,isError:Wt===t.rejected});var Wt}function Sn(Mt){return Mt[rn]}}({serializeQueryArgs:je,reducerPath:oe}),Sr=Di.buildQuerySelector,vi=Di.buildMutationSelector;yi(H.util,{selectInvalidatedBy:Di.selectInvalidatedBy});var Qn=function(it){var hn=it.serializeQueryArgs,rn=it.queryThunk,ir=it.mutationThunk,xr=it.api,bi=it.context,Sn=new Map,Mt=new Map,Wt=xr.internalActions,xn=Wt.unsubscribeQueryResult,on=Wt.removeMutationResult,mn=Wt.updateSubscriptionOptions;return{buildInitiateQuery:function(we,Je){var Ue=function(ke,He){var ht=He===void 0?{}:He,Ve=ht.subscribe,Ce=Ve===void 0||Ve,ue=ht.forceRefetch,Te=ht.subscriptionOptions,fe=ht[ot];return function(ge,Ae){var et,Qe,Pe=hn({queryArgs:ke,endpointDefinition:Je,endpointName:we}),Tt=rn(((et={type:"query",subscribe:Ce,forceRefetch:ue,subscriptionOptions:Te,endpointName:we,originalArgs:ke,queryCacheKey:Pe})[ot]=fe,et)),jt=xr.endpoints[we].select(ke),Gt=ge(Tt),or=jt(Ae()),gr=Gt.requestId,zn=Gt.abort,kn=or.requestId!==gr,Yi=(Qe=Sn.get(ge))==null?void 0:Qe[Pe],F=function(){return jt(Ae())},V=Object.assign(fe?Gt.then(F):kn&&!Yi?Promise.resolve(or):Promise.all([Yi,Gt]).then(F),{arg:ke,requestId:gr,subscriptionOptions:Te,queryCacheKey:Pe,abort:zn,unwrap:function(){return S(this,null,function(){var pe;return r(this,function(Ct){switch(Ct.label){case 0:return[4,V];case 1:if((pe=Ct.sent()).isError)throw pe.error;return[2,pe.data]}})})},refetch:function(){return ge(Ue(ke,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){Ce&&ge(xn({queryCacheKey:Pe,requestId:gr}))},updateSubscriptionOptions:function(pe){V.subscriptionOptions=pe,ge(mn({endpointName:we,requestId:gr,queryCacheKey:Pe,options:pe}))}});if(!Yi&&!kn&&!fe){var X=Sn.get(ge)||{};X[Pe]=V,Sn.set(ge,X),V.then(function(){delete X[Pe],Object.keys(X).length||Sn.delete(ge)})}return V}};return Ue},buildInitiateMutation:function(we){return function(Je,Ue){var ke=Ue===void 0?{}:Ue,He=ke.track,ht=He===void 0||He,Ve=ke.fixedCacheKey;return function(Ce,ue){var Te=ir({type:"mutation",endpointName:we,originalArgs:Je,track:ht,fixedCacheKey:Ve}),fe=Ce(Te),ge=fe.requestId,Ae=fe.abort,et=fe.unwrap,Qe=fe.unwrap().then(function(Gt){return{data:Gt}}).catch(function(Gt){return{error:Gt}}),Pe=function(){Ce(on({requestId:ge,fixedCacheKey:Ve}))},Tt=Object.assign(Qe,{arg:fe.arg,requestId:ge,abort:Ae,unwrap:et,unsubscribe:Pe,reset:Pe}),jt=Mt.get(Ce)||{};return Mt.set(Ce,jt),jt[ge]=Tt,Tt.then(function(){delete jt[ge],Object.keys(jt).length||Mt.delete(Ce)}),Ve&&(jt[Ve]=Tt,Tt.then(function(){jt[Ve]===Tt&&(delete jt[Ve],Object.keys(jt).length||Mt.delete(Ce))})),Tt}}},getRunningQueryThunk:function(we,Je){return function(Ue){var ke,He=hn({queryArgs:Je,endpointDefinition:bi.endpointDefinitions[we],endpointName:we});return(ke=Sn.get(Ue))==null?void 0:ke[He]}},getRunningMutationThunk:function(we,Je){return function(Ue){var ke;return(ke=Mt.get(Ue))==null?void 0:ke[Je]}},getRunningQueriesThunk:function(){return function(we){return Object.values(Sn.get(we)||{}).filter(bt)}},getRunningMutationsThunk:function(){return function(we){return Object.values(Mt.get(we)||{}).filter(bt)}},getRunningOperationPromises:function(){var we=function(Je){return Array.from(Je.values()).flatMap(function(Ue){return Ue?Object.values(Ue):[]})};return i(i([],we(Sn)),we(Mt)).filter(bt)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
+       Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
+       See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:xe,mutationThunk:Ye,api:H,serializeQueryArgs:je,context:re}),bo=Qn.buildInitiateQuery,Ga=Qn.buildInitiateMutation;return yi(H.util,{getRunningOperationPromises:Qn.getRunningOperationPromises,getRunningOperationPromise:Qn.removalWarning,getRunningMutationThunk:Qn.getRunningMutationThunk,getRunningMutationsThunk:Qn.getRunningMutationsThunk,getRunningQueryThunk:Qn.getRunningQueryThunk,getRunningQueriesThunk:Qn.getRunningQueriesThunk}),{name:ua,injectEndpoint:function(it,hn){var rn,ir=H;(rn=ir.endpoints)[it]!=null||(rn[it]={}),ne(hn)?yi(ir.endpoints[it],{name:it,select:Sr(it,hn),initiate:bo(it,hn)},wt(xe,it)):hn.type===J.mutation&&yi(ir.endpoints[it],{name:it,select:vi(),initiate:Ga(it)},wt(Ye,it))}}}}},hl=yo(ni())})(Zz);Yz.exports=Zz;var Lde=Yz.exports;const Jz=sl(),ej=z.enum(["BoardField","boolean","BooleanCollection","BooleanPolymorphic","ClipField","Collection","CollectionItem","ColorCollection","ColorField","ColorPolymorphic","ConditioningCollection","ConditioningField","ConditioningPolymorphic","ControlCollection","ControlField","ControlNetModelField","ControlPolymorphic","DenoiseMaskField","enum","float","FloatCollection","FloatPolymorphic","ImageCollection","ImageField","ImagePolymorphic","integer","IntegerCollection","IntegerPolymorphic","IPAdapterCollection","IPAdapterField","IPAdapterModelField","IPAdapterPolymorphic","LatentsCollection","LatentsField","LatentsPolymorphic","LoRAModelField","MainModelField","ONNXModelField","Scheduler","SDXLMainModelField","SDXLRefinerModelField","string","StringCollection","StringPolymorphic","T2IAdapterCollection","T2IAdapterField","T2IAdapterModelField","T2IAdapterPolymorphic","UNetField","VaeField","VaeModelField"]),Fde=z.enum(["WorkflowField","IsIntermediate","MetadataField"]),rR=e=>ej.safeParse(e).success||Fde.safeParse(e).success;z.enum(["connection","direct","any"]);const tj=z.object({id:z.string().trim().min(1),name:z.string().trim().min(1),type:ej}),Bde=tj.extend({fieldKind:z.literal("output")}),at=tj.extend({fieldKind:z.literal("input"),label:z.string()}),ou=z.object({model_name:z.string().trim().min(1),base_model:kc}),wp=z.object({image_name:z.string().trim().min(1)}),zde=z.object({board_id:z.string().trim().min(1)}),C_=z.object({latents_name:z.string().trim().min(1),seed:z.number().int().optional()}),A_=z.object({conditioning_name:z.string().trim().min(1)}),jde=z.object({mask_name:z.string().trim().min(1),masked_latents_name:z.string().trim().min(1).optional()}),Ude=at.extend({type:z.literal("integer"),value:z.number().int().optional()}),Vde=at.extend({type:z.literal("IntegerCollection"),value:z.array(z.number().int()).optional()}),Gde=at.extend({type:z.literal("IntegerPolymorphic"),value:z.number().int().optional()}),qde=at.extend({type:z.literal("float"),value:z.number().optional()}),Hde=at.extend({type:z.literal("FloatCollection"),value:z.array(z.number()).optional()}),Wde=at.extend({type:z.literal("FloatPolymorphic"),value:z.number().optional()}),Kde=at.extend({type:z.literal("string"),value:z.string().optional()}),Qde=at.extend({type:z.literal("StringCollection"),value:z.array(z.string()).optional()}),Xde=at.extend({type:z.literal("StringPolymorphic"),value:z.string().optional()}),Yde=at.extend({type:z.literal("boolean"),value:z.boolean().optional()}),Zde=at.extend({type:z.literal("BooleanCollection"),value:z.array(z.boolean()).optional()}),Jde=at.extend({type:z.literal("BooleanPolymorphic"),value:z.boolean().optional()}),efe=at.extend({type:z.literal("enum"),value:z.string().optional()}),tfe=at.extend({type:z.literal("LatentsField"),value:C_.optional()}),nfe=at.extend({type:z.literal("LatentsCollection"),value:z.array(C_).optional()}),rfe=at.extend({type:z.literal("LatentsPolymorphic"),value:z.union([C_,z.array(C_)]).optional()}),ife=at.extend({type:z.literal("DenoiseMaskField"),value:jde.optional()}),ofe=at.extend({type:z.literal("ConditioningField"),value:A_.optional()}),afe=at.extend({type:z.literal("ConditioningCollection"),value:z.array(A_).optional()}),sfe=at.extend({type:z.literal("ConditioningPolymorphic"),value:z.union([A_,z.array(A_)]).optional()}),lfe=ou,l0=z.object({image:wp,control_model:lfe,control_weight:z.union([z.number(),z.array(z.number())]).optional(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional(),control_mode:z.enum(["balanced","more_prompt","more_control","unbalanced"]).optional(),resize_mode:z.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),ufe=at.extend({type:z.literal("ControlField"),value:l0.optional()}),cfe=at.extend({type:z.literal("ControlPolymorphic"),value:z.union([l0,z.array(l0)]).optional()}),dfe=at.extend({type:z.literal("ControlCollection"),value:z.array(l0).optional()}),ffe=ou,u0=z.object({image:wp,ip_adapter_model:ffe,weight:z.number(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional()}),hfe=at.extend({type:z.literal("IPAdapterField"),value:u0.optional()}),pfe=at.extend({type:z.literal("IPAdapterPolymorphic"),value:z.union([u0,z.array(u0)]).optional()}),gfe=at.extend({type:z.literal("IPAdapterCollection"),value:z.array(u0).optional()}),mfe=ou,c0=z.object({image:wp,t2i_adapter_model:mfe,weight:z.union([z.number(),z.array(z.number())]).optional(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional(),resize_mode:z.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),yfe=at.extend({type:z.literal("T2IAdapterField"),value:c0.optional()}),vfe=at.extend({type:z.literal("T2IAdapterPolymorphic"),value:z.union([c0,z.array(c0)]).optional()}),bfe=at.extend({type:z.literal("T2IAdapterCollection"),value:z.array(c0).optional()}),_fe=z.enum(["onnx","main","vae","lora","controlnet","embedding"]),Sfe=z.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),tp=ou.extend({model_type:_fe,submodel:Sfe.optional()}),nj=tp.extend({weight:z.number().optional()}),xfe=z.object({unet:tp,scheduler:tp,loras:z.array(nj)}),wfe=at.extend({type:z.literal("UNetField"),value:xfe.optional()}),Cfe=z.object({tokenizer:tp,text_encoder:tp,skipped_layers:z.number(),loras:z.array(nj)}),Afe=at.extend({type:z.literal("ClipField"),value:Cfe.optional()}),Efe=z.object({vae:tp}),Tfe=at.extend({type:z.literal("VaeField"),value:Efe.optional()}),kfe=at.extend({type:z.literal("ImageField"),value:wp.optional()}),Pfe=at.extend({type:z.literal("BoardField"),value:zde.optional()}),Ife=at.extend({type:z.literal("ImagePolymorphic"),value:wp.optional()}),Rfe=at.extend({type:z.literal("ImageCollection"),value:z.array(wp).optional()}),Ofe=at.extend({type:z.literal("MainModelField"),value:by.optional()}),Mfe=at.extend({type:z.literal("SDXLMainModelField"),value:by.optional()}),$fe=at.extend({type:z.literal("SDXLRefinerModelField"),value:by.optional()}),rj=ou,Nfe=at.extend({type:z.literal("VaeModelField"),value:rj.optional()}),ij=ou,Dfe=at.extend({type:z.literal("LoRAModelField"),value:ij.optional()}),Lfe=ou,Ffe=at.extend({type:z.literal("ControlNetModelField"),value:Lfe.optional()}),Bfe=ou,zfe=at.extend({type:z.literal("IPAdapterModelField"),value:Bfe.optional()}),jfe=ou,Ufe=at.extend({type:z.literal("T2IAdapterModelField"),value:jfe.optional()}),Vfe=at.extend({type:z.literal("Collection"),value:z.array(z.any()).optional()}),Gfe=at.extend({type:z.literal("CollectionItem"),value:z.any().optional()}),E_=z.object({r:z.number().int().min(0).max(255),g:z.number().int().min(0).max(255),b:z.number().int().min(0).max(255),a:z.number().int().min(0).max(255)}),qfe=at.extend({type:z.literal("ColorField"),value:E_.optional()}),Hfe=at.extend({type:z.literal("ColorCollection"),value:z.array(E_).optional()}),Wfe=at.extend({type:z.literal("ColorPolymorphic"),value:z.union([E_,z.array(E_)]).optional()}),Kfe=at.extend({type:z.literal("Scheduler"),value:oz.optional()}),Qfe=z.discriminatedUnion("type",[Pfe,Zde,Yde,Jde,Afe,Vfe,Gfe,qfe,Hfe,Wfe,ofe,afe,sfe,ufe,Ffe,dfe,cfe,ife,efe,Hde,qde,Wde,Rfe,Ife,kfe,Vde,Gde,Ude,hfe,zfe,gfe,pfe,tfe,nfe,rfe,Dfe,Ofe,Kfe,Mfe,$fe,Qde,Xde,Kde,yfe,Ufe,bfe,vfe,wfe,Tfe,Nfe]),hqe=e=>!!(e&&e.fieldKind==="input"),pqe=e=>!!(e&&e.fieldKind==="input"),Xfe=e=>!!(e&&!("$ref"in e)),iR=e=>!!(e&&!("$ref"in e)&&e.type==="array"),Ov=e=>!!(e&&!("$ref"in e)&&e.type!=="array"),eg=e=>!!(e&&"$ref"in e),Yfe=e=>"class"in e&&e.class==="invocation",Zfe=e=>"class"in e&&e.class==="output",oR=e=>!("$ref"in e),Jfe=z.object({lora:ij.deepPartial(),weight:z.number()}),ehe=l0.deepPartial(),the=u0.deepPartial(),nhe=c0.deepPartial(),oj=z.object({app_version:z.string().nullish().catch(null),generation_mode:z.string().nullish().catch(null),created_by:z.string().nullish().catch(null),positive_prompt:z.string().nullish().catch(null),negative_prompt:z.string().nullish().catch(null),width:z.number().int().nullish().catch(null),height:z.number().int().nullish().catch(null),seed:z.number().int().nullish().catch(null),rand_device:z.string().nullish().catch(null),cfg_scale:z.number().nullish().catch(null),steps:z.number().int().nullish().catch(null),scheduler:z.string().nullish().catch(null),clip_skip:z.number().int().nullish().catch(null),model:z.union([d2.deepPartial(),az.deepPartial()]).nullish().catch(null),controlnets:z.array(ehe).nullish().catch(null),ipAdapters:z.array(the).nullish().catch(null),t2iAdapters:z.array(nhe).nullish().catch(null),loras:z.array(Jfe).nullish().catch(null),vae:rj.nullish().catch(null),strength:z.number().nullish().catch(null),init_image:z.string().nullish().catch(null),positive_style_prompt:z.string().nullish().catch(null),negative_style_prompt:z.string().nullish().catch(null),refiner_model:Bk.deepPartial().nullish().catch(null),refiner_cfg_scale:z.number().nullish().catch(null),refiner_steps:z.number().int().nullish().catch(null),refiner_scheduler:z.string().nullish().catch(null),refiner_positive_aesthetic_score:z.number().nullish().catch(null),refiner_negative_aesthetic_score:z.number().nullish().catch(null),refiner_start:z.number().nullish().catch(null)}).passthrough(),t4=z.string().refine(e=>{const[t,n,r]=e.split(".");return t!==void 0&&Number.isInteger(Number(t))&&n!==void 0&&Number.isInteger(Number(n))&&r!==void 0&&Number.isInteger(Number(r))});t4.transform(e=>{const[t,n,r]=e.split(".");return{major:Number(t),minor:Number(n),patch:Number(r)}});const aR=z.object({id:z.string().trim().min(1),type:z.string().trim().min(1),inputs:z.record(Qfe),outputs:z.record(Bde),label:z.string(),isOpen:z.boolean(),notes:z.string(),embedWorkflow:z.boolean(),isIntermediate:z.boolean(),useCache:z.boolean().optional(),version:t4.optional()}),rhe=z.preprocess(e=>{var t;try{const n=aR.parse(e);if(!Loe(n,"useCache")){const r=(t=Jz.get())==null?void 0:t.getState().nodes.nodeTemplates,i=r==null?void 0:r[n.type];let o=!0;i&&(o=i.useCache),Object.assign(n,{useCache:o})}return n}catch{return e}},aR.extend({useCache:z.boolean()})),ihe=z.object({id:z.string().trim().min(1),type:z.literal("notes"),label:z.string(),isOpen:z.boolean(),notes:z.string()}),aj=z.object({x:z.number(),y:z.number()}).default({x:0,y:0}),T_=z.number().gt(0).nullish(),sj=z.object({id:z.string().trim().min(1),type:z.literal("invocation"),data:rhe,width:T_,height:T_,position:aj}),wA=e=>sj.safeParse(e).success,ohe=z.object({id:z.string().trim().min(1),type:z.literal("notes"),data:ihe,width:T_,height:T_,position:aj}),lj=z.discriminatedUnion("type",[sj,ohe]),ahe=z.object({source:z.string().trim().min(1),sourceHandle:z.string().trim().min(1),target:z.string().trim().min(1),targetHandle:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("default")}),she=z.object({source:z.string().trim().min(1),target:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("collapsed")}),uj=z.union([ahe,she]),lhe=z.object({nodeId:z.string().trim().min(1),fieldName:z.string().trim().min(1)}),uhe="1.0.0",cj=z.object({name:z.string().default(""),author:z.string().default(""),description:z.string().default(""),version:z.string().default(""),contact:z.string().default(""),tags:z.string().default(""),notes:z.string().default(""),nodes:z.array(lj).default([]),edges:z.array(uj).default([]),exposedFields:z.array(lhe).default([]),meta:z.object({version:t4}).default({version:uhe})});cj.transform(e=>{const{nodes:t,edges:n}=e,r=[],i=t.filter(wA),o=Ek(i,"id");return n.forEach((a,s)=>{const l=o[a.source],u=o[a.target],c=[];if(l?a.type==="default"&&!(a.sourceHandle in l.data.outputs)&&c.push(`${me.t("nodes.outputField")}"${a.source}.${a.sourceHandle}" ${me.t("nodes.doesNotExist")}`):c.push(`${me.t("nodes.outputNode")} ${a.source} ${me.t("nodes.doesNotExist")}`),u?a.type==="default"&&!(a.targetHandle in u.data.inputs)&&c.push(`${me.t("nodes.inputField")} "${a.target}.${a.targetHandle}" ${me.t("nodes.doesNotExist")}`):c.push(`${me.t("nodes.inputNode")} ${a.target} ${me.t("nodes.doesNotExist")}`),c.length){delete n[s];const d=a.type==="default"?a.sourceHandle:a.source,f=a.type==="default"?a.targetHandle:a.target;r.push({message:`${me.t("nodes.edge")} "${d} -> ${f}" ${me.t("nodes.skipped")}`,issues:c,data:a})}}),{workflow:e,warnings:r}});const Vr=e=>!!(e&&e.type==="invocation"),gqe=e=>!!(e&&!["notes","current_image"].includes(e.type)),sR=e=>!!(e&&e.type==="notes");var Jc=(e=>(e[e.PENDING=0]="PENDING",e[e.IN_PROGRESS=1]="IN_PROGRESS",e[e.COMPLETED=2]="COMPLETED",e[e.FAILED=3]="FAILED",e))(Jc||{});/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const che=4,lR=0,uR=1,dhe=2;function Cp(e){let t=e.length;for(;--t>=0;)e[t]=0}const fhe=0,dj=1,hhe=2,phe=3,ghe=258,n4=29,_y=256,d0=_y+1+n4,bh=30,r4=19,fj=2*d0+1,ud=15,AC=16,mhe=7,i4=256,hj=16,pj=17,gj=18,CA=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),H1=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),yhe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mj=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vhe=512,Al=new Array((d0+2)*2);Cp(Al);const tm=new Array(bh*2);Cp(tm);const f0=new Array(vhe);Cp(f0);const h0=new Array(ghe-phe+1);Cp(h0);const o4=new Array(n4);Cp(o4);const k_=new Array(bh);Cp(k_);function EC(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let yj,vj,bj;function TC(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const _j=e=>e<256?f0[e]:f0[256+(e>>>7)],p0=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},To=(e,t,n)=>{e.bi_valid>AC-n?(e.bi_buf|=t<<e.bi_valid&65535,p0(e,e.bi_buf),e.bi_buf=t>>AC-e.bi_valid,e.bi_valid+=n-AC):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Ds=(e,t,n)=>{To(e,n[t*2],n[t*2+1])},Sj=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},bhe=e=>{e.bi_valid===16?(p0(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},_he=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let u,c,d,f,h,p,m=0;for(f=0;f<=ud;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<fj;u++)c=e.heap[u],f=n[n[c*2+1]*2+1]+1,f>l&&(f=l,m++),n[c*2+1]=f,!(c>r)&&(e.bl_count[f]++,h=0,c>=s&&(h=a[c-s]),p=n[c*2],e.opt_len+=p*(f+h),o&&(e.static_len+=p*(i[c*2+1]+h)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(c=e.bl_count[f];c!==0;)d=e.heap[--u],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),c--)}},xj=(e,t,n)=>{const r=new Array(ud+1);let i=0,o,a;for(o=1;o<=ud;o++)i=i+n[o-1]<<1,r[o]=i;for(a=0;a<=t;a++){let s=e[a*2+1];s!==0&&(e[a*2]=Sj(r[s]++,s))}},She=()=>{let e,t,n,r,i;const o=new Array(ud+1);for(n=0,r=0;r<n4-1;r++)for(o4[r]=n,e=0;e<1<<CA[r];e++)h0[n++]=r;for(h0[n-1]=r,i=0,r=0;r<16;r++)for(k_[r]=i,e=0;e<1<<H1[r];e++)f0[i++]=r;for(i>>=7;r<bh;r++)for(k_[r]=i<<7,e=0;e<1<<H1[r]-7;e++)f0[256+i++]=r;for(t=0;t<=ud;t++)o[t]=0;for(e=0;e<=143;)Al[e*2+1]=8,e++,o[8]++;for(;e<=255;)Al[e*2+1]=9,e++,o[9]++;for(;e<=279;)Al[e*2+1]=7,e++,o[7]++;for(;e<=287;)Al[e*2+1]=8,e++,o[8]++;for(xj(Al,d0+1,o),e=0;e<bh;e++)tm[e*2+1]=5,tm[e*2]=Sj(e,5);yj=new EC(Al,CA,_y+1,d0,ud),vj=new EC(tm,H1,0,bh,ud),bj=new EC(new Array(0),yhe,0,r4,mhe)},wj=e=>{let t;for(t=0;t<d0;t++)e.dyn_ltree[t*2]=0;for(t=0;t<bh;t++)e.dyn_dtree[t*2]=0;for(t=0;t<r4;t++)e.bl_tree[t*2]=0;e.dyn_ltree[i4*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Cj=e=>{e.bi_valid>8?p0(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},cR=(e,t,n,r)=>{const i=t*2,o=n*2;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},kC=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&cR(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!cR(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},dR=(e,t,n)=>{let r,i,o=0,a,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],r===0?Ds(e,i,t):(a=h0[i],Ds(e,a+_y+1,t),s=CA[a],s!==0&&(i-=o4[a],To(e,i,s)),r--,a=_j(r),Ds(e,a,n),s=H1[a],s!==0&&(r-=k_[a],To(e,r,s)));while(o<e.sym_next);Ds(e,i4,t)},AA=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,l=-1,u;for(e.heap_len=0,e.heap_max=fj,a=0;a<o;a++)n[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)kC(e,n,a);u=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],kC(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[u*2]=n[a*2]+n[s*2],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[a*2+1]=n[s*2+1]=u,e.heap[1]=u++,kC(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],_he(e,t),xj(n,l,e.bl_count)},fR=(e,t,n)=>{let r,i=-1,o,a=t[0*2+1],s=0,l=7,u=4;for(a===0&&(l=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=a,a=t[(r+1)*2+1],!(++s<l&&o===a)&&(s<u?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[hj*2]++):s<=10?e.bl_tree[pj*2]++:e.bl_tree[gj*2]++,s=0,i=o,a===0?(l=138,u=3):o===a?(l=6,u=3):(l=7,u=4))},hR=(e,t,n)=>{let r,i=-1,o,a=t[0*2+1],s=0,l=7,u=4;for(a===0&&(l=138,u=3),r=0;r<=n;r++)if(o=a,a=t[(r+1)*2+1],!(++s<l&&o===a)){if(s<u)do Ds(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(Ds(e,o,e.bl_tree),s--),Ds(e,hj,e.bl_tree),To(e,s-3,2)):s<=10?(Ds(e,pj,e.bl_tree),To(e,s-3,3)):(Ds(e,gj,e.bl_tree),To(e,s-11,7));s=0,i=o,a===0?(l=138,u=3):o===a?(l=6,u=3):(l=7,u=4)}},xhe=e=>{let t;for(fR(e,e.dyn_ltree,e.l_desc.max_code),fR(e,e.dyn_dtree,e.d_desc.max_code),AA(e,e.bl_desc),t=r4-1;t>=3&&e.bl_tree[mj[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},whe=(e,t,n,r)=>{let i;for(To(e,t-257,5),To(e,n-1,5),To(e,r-4,4),i=0;i<r;i++)To(e,e.bl_tree[mj[i]*2+1],3);hR(e,e.dyn_ltree,t-1),hR(e,e.dyn_dtree,n-1)},Che=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return lR;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return uR;for(n=32;n<_y;n++)if(e.dyn_ltree[n*2]!==0)return uR;return lR};let pR=!1;const Ahe=e=>{pR||(She(),pR=!0),e.l_desc=new TC(e.dyn_ltree,yj),e.d_desc=new TC(e.dyn_dtree,vj),e.bl_desc=new TC(e.bl_tree,bj),e.bi_buf=0,e.bi_valid=0,wj(e)},Aj=(e,t,n,r)=>{To(e,(fhe<<1)+(r?1:0),3),Cj(e),p0(e,n),p0(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Ehe=e=>{To(e,dj<<1,3),Ds(e,i4,Al),bhe(e)},The=(e,t,n,r)=>{let i,o,a=0;e.level>0?(e.strm.data_type===dhe&&(e.strm.data_type=Che(e)),AA(e,e.l_desc),AA(e,e.d_desc),a=xhe(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&t!==-1?Aj(e,t,n,r):e.strategy===che||o===i?(To(e,(dj<<1)+(r?1:0),3),dR(e,Al,tm)):(To(e,(hhe<<1)+(r?1:0),3),whe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),dR(e,e.dyn_ltree,e.dyn_dtree)),wj(e),r&&Cj(e)},khe=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(h0[n]+_y+1)*2]++,e.dyn_dtree[_j(t)*2]++),e.sym_next===e.sym_end);var Phe=Ahe,Ihe=Aj,Rhe=The,Ohe=khe,Mhe=Ehe,$he={_tr_init:Phe,_tr_stored_block:Ihe,_tr_flush_block:Rhe,_tr_tally:Ohe,_tr_align:Mhe};const Nhe=(e,t,n,r)=>{let i=e&65535|0,o=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do i=i+t[r++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};var g0=Nhe;const Dhe=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},Lhe=new Uint32Array(Dhe()),Fhe=(e,t,n,r)=>{const i=Lhe,o=r+n;e^=-1;for(let a=r;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1};var ai=Fhe,np={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Sy={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Bhe,_tr_stored_block:EA,_tr_flush_block:zhe,_tr_tally:Zu,_tr_align:jhe}=$he,{Z_NO_FLUSH:Ju,Z_PARTIAL_FLUSH:Uhe,Z_FULL_FLUSH:Vhe,Z_FINISH:xa,Z_BLOCK:gR,Z_OK:Ai,Z_STREAM_END:mR,Z_STREAM_ERROR:Ws,Z_DATA_ERROR:Ghe,Z_BUF_ERROR:PC,Z_DEFAULT_COMPRESSION:qhe,Z_FILTERED:Hhe,Z_HUFFMAN_ONLY:Mv,Z_RLE:Whe,Z_FIXED:Khe,Z_DEFAULT_STRATEGY:Qhe,Z_UNKNOWN:Xhe,Z_DEFLATED:$2}=Sy,Yhe=9,Zhe=15,Jhe=8,epe=29,tpe=256,TA=tpe+1+epe,npe=30,rpe=19,ipe=2*TA+1,ope=15,Bt=3,ju=258,Ks=ju+Bt+1,ape=32,rp=42,a4=57,kA=69,PA=73,IA=91,RA=103,cd=113,Eg=666,oo=1,Ap=2,Ld=3,Ep=4,spe=3,dd=(e,t)=>(e.msg=np[t],t),yR=e=>e*2-(e>4?9:0),Ou=e=>{let t=e.length;for(;--t>=0;)e[t]=0},lpe=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let upe=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,ec=upe;const Uo=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Yo=(e,t)=>{zhe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Uo(e.strm)},an=(e,t)=>{e.pending_buf[e.pending++]=t},tg=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},OA=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=g0(e.adler,t,i,n):e.state.wrap===2&&(e.adler=ai(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Ej=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,o,a=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-Ks?e.strstart-(e.w_size-Ks):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+ju;let h=u[r+a-1],p=u[r+a];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(u[i+a]!==p||u[i+a-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<f);if(o=ju-(f-r),r=f-ju,o>a){if(e.match_start=t,a=o,o>=s)break;h=u[r+a-1],p=u[r+a]}}while((t=d[t&c])>l&&--n!==0);return a<=e.lookahead?a:e.lookahead},ip=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ks)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),lpe(e),r+=t),e.strm.avail_in===0)break;if(n=OA(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=Bt)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=ec(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=ec(e,e.ins_h,e.window[i+Bt-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<Bt)););}while(e.lookahead<Ks&&e.strm.avail_in!==0)},Tj=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,o,a=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>o&&(r=o),r<n&&(r===0&&t!==xa||t===Ju||r!==i+e.strm.avail_in)))break;a=t===xa&&r===i+e.strm.avail_in?1:0,EA(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Uo(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(OA(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?Ep:t!==Ju&&t!==xa&&e.strm.avail_in===0&&e.strstart===e.block_start?Ap:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(OA(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=n||(i||t===xa)&&t!==Ju&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,a=t===xa&&e.strm.avail_in===0&&r===i?1:0,EA(e,e.block_start,r,a),e.block_start+=r,Uo(e.strm)),a?Ld:oo)},IC=(e,t)=>{let n,r;for(;;){if(e.lookahead<Ks){if(ip(e),e.lookahead<Ks&&t===Ju)return oo;if(e.lookahead===0)break}if(n=0,e.lookahead>=Bt&&(e.ins_h=ec(e,e.ins_h,e.window[e.strstart+Bt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Ks&&(e.match_length=Ej(e,n)),e.match_length>=Bt)if(r=Zu(e,e.strstart-e.match_start,e.match_length-Bt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Bt){e.match_length--;do e.strstart++,e.ins_h=ec(e,e.ins_h,e.window[e.strstart+Bt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ec(e,e.ins_h,e.window[e.strstart+1]);else r=Zu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Yo(e,!1),e.strm.avail_out===0))return oo}return e.insert=e.strstart<Bt-1?e.strstart:Bt-1,t===xa?(Yo(e,!0),e.strm.avail_out===0?Ld:Ep):e.sym_next&&(Yo(e,!1),e.strm.avail_out===0)?oo:Ap},gf=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Ks){if(ip(e),e.lookahead<Ks&&t===Ju)return oo;if(e.lookahead===0)break}if(n=0,e.lookahead>=Bt&&(e.ins_h=ec(e,e.ins_h,e.window[e.strstart+Bt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Bt-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Ks&&(e.match_length=Ej(e,n),e.match_length<=5&&(e.strategy===Hhe||e.match_length===Bt&&e.strstart-e.match_start>4096)&&(e.match_length=Bt-1)),e.prev_length>=Bt&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Bt,r=Zu(e,e.strstart-1-e.prev_match,e.prev_length-Bt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=ec(e,e.ins_h,e.window[e.strstart+Bt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Bt-1,e.strstart++,r&&(Yo(e,!1),e.strm.avail_out===0))return oo}else if(e.match_available){if(r=Zu(e,0,e.window[e.strstart-1]),r&&Yo(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return oo}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Zu(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Bt-1?e.strstart:Bt-1,t===xa?(Yo(e,!0),e.strm.avail_out===0?Ld:Ep):e.sym_next&&(Yo(e,!1),e.strm.avail_out===0)?oo:Ap},cpe=(e,t)=>{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=ju){if(ip(e),e.lookahead<=ju&&t===Ju)return oo;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Bt&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+ju;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=ju-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Bt?(n=Zu(e,1,e.match_length-Bt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Zu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Yo(e,!1),e.strm.avail_out===0))return oo}return e.insert=0,t===xa?(Yo(e,!0),e.strm.avail_out===0?Ld:Ep):e.sym_next&&(Yo(e,!1),e.strm.avail_out===0)?oo:Ap},dpe=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(ip(e),e.lookahead===0)){if(t===Ju)return oo;break}if(e.match_length=0,n=Zu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Yo(e,!1),e.strm.avail_out===0))return oo}return e.insert=0,t===xa?(Yo(e,!0),e.strm.avail_out===0?Ld:Ep):e.sym_next&&(Yo(e,!1),e.strm.avail_out===0)?oo:Ap};function xs(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Tg=[new xs(0,0,0,0,Tj),new xs(4,4,8,4,IC),new xs(4,5,16,8,IC),new xs(4,6,32,32,IC),new xs(4,4,16,16,gf),new xs(8,16,32,32,gf),new xs(8,16,128,128,gf),new xs(8,32,128,256,gf),new xs(32,128,258,1024,gf),new xs(32,258,258,4096,gf)],fpe=e=>{e.window_size=2*e.w_size,Ou(e.head),e.max_lazy_match=Tg[e.level].max_lazy,e.good_match=Tg[e.level].good_length,e.nice_match=Tg[e.level].nice_length,e.max_chain_length=Tg[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Bt-1,e.match_available=0,e.ins_h=0};function hpe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ipe*2),this.dyn_dtree=new Uint16Array((2*npe+1)*2),this.bl_tree=new Uint16Array((2*rpe+1)*2),Ou(this.dyn_ltree),Ou(this.dyn_dtree),Ou(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ope+1),this.heap=new Uint16Array(2*TA+1),Ou(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*TA+1),Ou(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const xy=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==rp&&t.status!==a4&&t.status!==kA&&t.status!==PA&&t.status!==IA&&t.status!==RA&&t.status!==cd&&t.status!==Eg?1:0},kj=e=>{if(xy(e))return dd(e,Ws);e.total_in=e.total_out=0,e.data_type=Xhe;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?a4:t.wrap?rp:cd,e.adler=t.wrap===2?0:1,t.last_flush=-2,Bhe(t),Ai},Pj=e=>{const t=kj(e);return t===Ai&&fpe(e.state),t},ppe=(e,t)=>xy(e)||e.state.wrap!==2?Ws:(e.state.gzhead=t,Ai),Ij=(e,t,n,r,i,o)=>{if(!e)return Ws;let a=1;if(t===qhe&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>Yhe||n!==$2||r<8||r>15||t<0||t>9||o<0||o>Khe||r===8&&a!==1)return dd(e,Ws);r===8&&(r=9);const s=new hpe;return e.state=s,s.strm=e,s.status=rp,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Bt-1)/Bt),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=o,s.method=n,Pj(e)},gpe=(e,t)=>Ij(e,t,$2,Zhe,Jhe,Qhe),mpe=(e,t)=>{if(xy(e)||t>gR||t<0)return e?dd(e,Ws):Ws;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Eg&&t!==xa)return dd(e,e.avail_out===0?PC:Ws);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Uo(e),e.avail_out===0)return n.last_flush=-1,Ai}else if(e.avail_in===0&&yR(t)<=yR(r)&&t!==xa)return dd(e,PC);if(n.status===Eg&&e.avail_in!==0)return dd(e,PC);if(n.status===rp&&n.wrap===0&&(n.status=cd),n.status===rp){let i=$2+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Mv||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=ape),i+=31-i%31,tg(n,i),n.strstart!==0&&(tg(n,e.adler>>>16),tg(n,e.adler&65535)),e.adler=1,n.status=cd,Uo(e),n.pending!==0)return n.last_flush=-1,Ai}if(n.status===a4){if(e.adler=0,an(n,31),an(n,139),an(n,8),n.gzhead)an(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),an(n,n.gzhead.time&255),an(n,n.gzhead.time>>8&255),an(n,n.gzhead.time>>16&255),an(n,n.gzhead.time>>24&255),an(n,n.level===9?2:n.strategy>=Mv||n.level<2?4:0),an(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(an(n,n.gzhead.extra.length&255),an(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=ai(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=kA;else if(an(n,0),an(n,0),an(n,0),an(n,0),an(n,0),an(n,n.level===9?2:n.strategy>=Mv||n.level<2?4:0),an(n,spe),n.status=cd,Uo(e),n.pending!==0)return n.last_flush=-1,Ai}if(n.status===kA){if(n.gzhead.extra){let i=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=ai(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,Uo(e),n.pending!==0)return n.last_flush=-1,Ai;i=0,o-=s}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=ai(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=PA}if(n.status===PA){if(n.gzhead.name){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=ai(e.adler,n.pending_buf,n.pending-i,i)),Uo(e),n.pending!==0)return n.last_flush=-1,Ai;i=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,an(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=ai(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=IA}if(n.status===IA){if(n.gzhead.comment){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=ai(e.adler,n.pending_buf,n.pending-i,i)),Uo(e),n.pending!==0)return n.last_flush=-1,Ai;i=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,an(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=ai(e.adler,n.pending_buf,n.pending-i,i))}n.status=RA}if(n.status===RA){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Uo(e),n.pending!==0))return n.last_flush=-1,Ai;an(n,e.adler&255),an(n,e.adler>>8&255),e.adler=0}if(n.status=cd,Uo(e),n.pending!==0)return n.last_flush=-1,Ai}if(e.avail_in!==0||n.lookahead!==0||t!==Ju&&n.status!==Eg){let i=n.level===0?Tj(n,t):n.strategy===Mv?dpe(n,t):n.strategy===Whe?cpe(n,t):Tg[n.level].func(n,t);if((i===Ld||i===Ep)&&(n.status=Eg),i===oo||i===Ld)return e.avail_out===0&&(n.last_flush=-1),Ai;if(i===Ap&&(t===Uhe?jhe(n):t!==gR&&(EA(n,0,0,!1),t===Vhe&&(Ou(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Uo(e),e.avail_out===0))return n.last_flush=-1,Ai}return t!==xa?Ai:n.wrap<=0?mR:(n.wrap===2?(an(n,e.adler&255),an(n,e.adler>>8&255),an(n,e.adler>>16&255),an(n,e.adler>>24&255),an(n,e.total_in&255),an(n,e.total_in>>8&255),an(n,e.total_in>>16&255),an(n,e.total_in>>24&255)):(tg(n,e.adler>>>16),tg(n,e.adler&65535)),Uo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ai:mR)},ype=e=>{if(xy(e))return Ws;const t=e.state.status;return e.state=null,t===cd?dd(e,Ghe):Ai},vpe=(e,t)=>{let n=t.length;if(xy(e))return Ws;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==rp||r.lookahead)return Ws;if(i===1&&(e.adler=g0(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Ou(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(t.subarray(n-r.w_size,n),0),t=l,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,ip(r);r.lookahead>=Bt;){let l=r.strstart,u=r.lookahead-(Bt-1);do r.ins_h=ec(r,r.ins_h,r.window[l+Bt-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=Bt-1,ip(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Bt-1,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,Ai};var bpe=gpe,_pe=Ij,Spe=Pj,xpe=kj,wpe=ppe,Cpe=mpe,Ape=ype,Epe=vpe,Tpe="pako deflate (from Nodeca project)",nm={deflateInit:bpe,deflateInit2:_pe,deflateReset:Spe,deflateResetKeep:xpe,deflateSetHeader:wpe,deflate:Cpe,deflateEnd:Ape,deflateSetDictionary:Epe,deflateInfo:Tpe};const kpe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ppe=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)kpe(n,r)&&(e[r]=n[r])}}return e},Ipe=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,o=e.length;r<o;r++){let a=e[r];n.set(a,i),i+=a.length}return n},N2={assign:Ppe,flattenChunks:Ipe};let Rj=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Rj=!1}const m0=new Uint8Array(256);for(let e=0;e<256;e++)m0[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;m0[254]=m0[254]=1;var Rpe=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const Ope=(e,t)=>{if(t<65534&&e.subarray&&Rj)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var Mpe=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const o=new Array(n*2);for(i=0,r=0;r<n;){let a=e[r++];if(a<128){o[i++]=a;continue}let s=m0[a];if(s>4){o[i++]=65533,r+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&r<n;)a=a<<6|e[r++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return Ope(o,i)},$pe=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+m0[e[n]]>t?n:t},y0={string2buf:Rpe,buf2string:Mpe,utf8border:$pe};function Npe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Oj=Npe;const Mj=Object.prototype.toString,{Z_NO_FLUSH:Dpe,Z_SYNC_FLUSH:Lpe,Z_FULL_FLUSH:Fpe,Z_FINISH:Bpe,Z_OK:P_,Z_STREAM_END:zpe,Z_DEFAULT_COMPRESSION:jpe,Z_DEFAULT_STRATEGY:Upe,Z_DEFLATED:Vpe}=Sy;function s4(e){this.options=N2.assign({level:jpe,method:Vpe,chunkSize:16384,windowBits:15,memLevel:8,strategy:Upe},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Oj,this.strm.avail_out=0;let n=nm.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==P_)throw new Error(np[n]);if(t.header&&nm.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=y0.string2buf(t.dictionary):Mj.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=nm.deflateSetDictionary(this.strm,r),n!==P_)throw new Error(np[n]);this._dict_set=!0}}s4.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?Bpe:Dpe,typeof e=="string"?n.input=y0.string2buf(e):Mj.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===Lpe||o===Fpe)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=nm.deflate(n,o),i===zpe)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=nm.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===P_;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};s4.prototype.onData=function(e){this.chunks.push(e)};s4.prototype.onEnd=function(e){e===P_&&(this.result=N2.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const $v=16209,Gpe=16191;var qpe=function(t,n){let r,i,o,a,s,l,u,c,d,f,h,p,m,_,b,y,g,v,S,w,x,C,T,E;const P=t.state;r=t.next_in,T=t.input,i=r+(t.avail_in-5),o=t.next_out,E=t.output,a=o-(n-t.avail_out),s=o+(t.avail_out-257),l=P.dmax,u=P.wsize,c=P.whave,d=P.wnext,f=P.window,h=P.hold,p=P.bits,m=P.lencode,_=P.distcode,b=(1<<P.lenbits)-1,y=(1<<P.distbits)-1;e:do{p<15&&(h+=T[r++]<<p,p+=8,h+=T[r++]<<p,p+=8),g=m[h&b];t:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v===0)E[o++]=g&65535;else if(v&16){S=g&65535,v&=15,v&&(p<v&&(h+=T[r++]<<p,p+=8),S+=h&(1<<v)-1,h>>>=v,p-=v),p<15&&(h+=T[r++]<<p,p+=8,h+=T[r++]<<p,p+=8),g=_[h&y];n:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v&16){if(w=g&65535,v&=15,p<v&&(h+=T[r++]<<p,p+=8,p<v&&(h+=T[r++]<<p,p+=8)),w+=h&(1<<v)-1,w>l){t.msg="invalid distance too far back",P.mode=$v;break e}if(h>>>=v,p-=v,v=o-a,w>v){if(v=w-v,v>c&&P.sane){t.msg="invalid distance too far back",P.mode=$v;break e}if(x=0,C=f,d===0){if(x+=u-v,v<S){S-=v;do E[o++]=f[x++];while(--v);x=o-w,C=E}}else if(d<v){if(x+=u+d-v,v-=d,v<S){S-=v;do E[o++]=f[x++];while(--v);if(x=0,d<S){v=d,S-=v;do E[o++]=f[x++];while(--v);x=o-w,C=E}}}else if(x+=d-v,v<S){S-=v;do E[o++]=f[x++];while(--v);x=o-w,C=E}for(;S>2;)E[o++]=C[x++],E[o++]=C[x++],E[o++]=C[x++],S-=3;S&&(E[o++]=C[x++],S>1&&(E[o++]=C[x++]))}else{x=o-w;do E[o++]=E[x++],E[o++]=E[x++],E[o++]=E[x++],S-=3;while(S>2);S&&(E[o++]=E[x++],S>1&&(E[o++]=E[x++]))}}else if(v&64){t.msg="invalid distance code",P.mode=$v;break e}else{g=_[(g&65535)+(h&(1<<v)-1)];continue n}break}}else if(v&64)if(v&32){P.mode=Gpe;break e}else{t.msg="invalid literal/length code",P.mode=$v;break e}else{g=m[(g&65535)+(h&(1<<v)-1)];continue t}break}}while(r<i&&o<s);S=p>>3,r-=S,p-=S<<3,h&=(1<<p)-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=o<s?257+(s-o):257-(o-s),P.hold=h,P.bits=p};const mf=15,vR=852,bR=592,_R=0,RC=1,SR=2,Hpe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Wpe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Kpe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Qpe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Xpe=(e,t,n,r,i,o,a,s)=>{const l=s.bits;let u=0,c=0,d=0,f=0,h=0,p=0,m=0,_=0,b=0,y=0,g,v,S,w,x,C=null,T;const E=new Uint16Array(mf+1),P=new Uint16Array(mf+1);let N=null,O,A,k;for(u=0;u<=mf;u++)E[u]=0;for(c=0;c<r;c++)E[t[n+c]]++;for(h=l,f=mf;f>=1&&E[f]===0;f--);if(h>f&&(h=f),f===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(h<d&&(h=d),_=1,u=1;u<=mf;u++)if(_<<=1,_-=E[u],_<0)return-1;if(_>0&&(e===_R||f!==1))return-1;for(P[1]=0,u=1;u<mf;u++)P[u+1]=P[u]+E[u];for(c=0;c<r;c++)t[n+c]!==0&&(a[P[t[n+c]]++]=c);if(e===_R?(C=N=a,T=20):e===RC?(C=Hpe,N=Wpe,T=257):(C=Kpe,N=Qpe,T=0),y=0,c=0,u=d,x=o,p=h,m=0,S=-1,b=1<<h,w=b-1,e===RC&&b>vR||e===SR&&b>bR)return 1;for(;;){O=u-m,a[c]+1<T?(A=0,k=a[c]):a[c]>=T?(A=N[a[c]-T],k=C[a[c]-T]):(A=32+64,k=0),g=1<<u-m,v=1<<p,d=v;do v-=g,i[x+(y>>m)+v]=O<<24|A<<16|k|0;while(v!==0);for(g=1<<u-1;y&g;)g>>=1;if(g!==0?(y&=g-1,y+=g):y=0,c++,--E[u]===0){if(u===f)break;u=t[n+a[c]]}if(u>h&&(y&w)!==S){for(m===0&&(m=h),x+=d,p=u-m,_=1<<p;p+m<f&&(_-=E[p+m],!(_<=0));)p++,_<<=1;if(b+=1<<p,e===RC&&b>vR||e===SR&&b>bR)return 1;S=y&w,i[S]=h<<24|p<<16|x-o|0}}return y!==0&&(i[x+y]=u-m<<24|64<<16|0),s.bits=h,0};var rm=Xpe;const Ype=0,$j=1,Nj=2,{Z_FINISH:xR,Z_BLOCK:Zpe,Z_TREES:Nv,Z_OK:Fd,Z_STREAM_END:Jpe,Z_NEED_DICT:ege,Z_STREAM_ERROR:Ia,Z_DATA_ERROR:Dj,Z_MEM_ERROR:Lj,Z_BUF_ERROR:tge,Z_DEFLATED:wR}=Sy,D2=16180,CR=16181,AR=16182,ER=16183,TR=16184,kR=16185,PR=16186,IR=16187,RR=16188,OR=16189,I_=16190,pl=16191,OC=16192,MR=16193,MC=16194,$R=16195,NR=16196,DR=16197,LR=16198,Dv=16199,Lv=16200,FR=16201,BR=16202,zR=16203,jR=16204,UR=16205,$C=16206,VR=16207,GR=16208,Zn=16209,Fj=16210,Bj=16211,nge=852,rge=592,ige=15,oge=ige,qR=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function age(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Qd=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<D2||t.mode>Bj?1:0},zj=e=>{if(Qd(e))return Ia;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=D2,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(nge),t.distcode=t.distdyn=new Int32Array(rge),t.sane=1,t.back=-1,Fd},jj=e=>{if(Qd(e))return Ia;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,zj(e)},Uj=(e,t)=>{let n;if(Qd(e))return Ia;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Ia:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,jj(e))},Vj=(e,t)=>{if(!e)return Ia;const n=new age;e.state=n,n.strm=e,n.window=null,n.mode=D2;const r=Uj(e,t);return r!==Fd&&(e.state=null),r},sge=e=>Vj(e,oge);let HR=!0,NC,DC;const lge=e=>{if(HR){NC=new Int32Array(512),DC=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(rm($j,e.lens,0,288,NC,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;rm(Nj,e.lens,0,32,DC,0,e.work,{bits:5}),HR=!1}e.lencode=NC,e.lenbits=9,e.distcode=DC,e.distbits=5},Gj=(e,t,n,r)=>{let i;const o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),r-=i,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},uge=(e,t)=>{let n,r,i,o,a,s,l,u,c,d,f,h,p,m,_=0,b,y,g,v,S,w,x,C;const T=new Uint8Array(4);let E,P;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Qd(e)||!e.output||!e.input&&e.avail_in!==0)return Ia;n=e.state,n.mode===pl&&(n.mode=OC),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,d=s,f=l,C=Fd;e:for(;;)switch(n.mode){case D2:if(n.wrap===0){n.mode=OC;break}for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=u&255,T[1]=u>>>8&255,n.check=ai(n.check,T,2,0),u=0,c=0,n.mode=CR;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Zn;break}if((u&15)!==wR){e.msg="unknown compression method",n.mode=Zn;break}if(u>>>=4,c-=4,x=(u&15)+8,n.wbits===0&&(n.wbits=x),x>15||x>n.wbits){e.msg="invalid window size",n.mode=Zn;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?OR:pl,u=0,c=0;break;case CR:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.flags=u,(n.flags&255)!==wR){e.msg="unknown compression method",n.mode=Zn;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Zn;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,n.check=ai(n.check,T,2,0)),u=0,c=0,n.mode=AR;case AR:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,n.check=ai(n.check,T,4,0)),u=0,c=0,n.mode=ER;case ER:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,n.check=ai(n.check,T,2,0)),u=0,c=0,n.mode=TR;case TR:if(n.flags&1024){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,n.check=ai(n.check,T,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=kR;case kR:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+h),x)),n.flags&512&&n.wrap&4&&(n.check=ai(n.check,r,h,o)),s-=h,o+=h,n.length-=h),n.length))break e;n.length=0,n.mode=PR;case PR:if(n.flags&2048){if(s===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x));while(x&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=ai(n.check,r,h,o)),s-=h,o+=h,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=IR;case IR:if(n.flags&4096){if(s===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x));while(x&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=ai(n.check,r,h,o)),s-=h,o+=h,x)break e}else n.head&&(n.head.comment=null);n.mode=RR;case RR:if(n.flags&512){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Zn;break}u=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=pl;break;case OR:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}e.adler=n.check=qR(u),u=0,c=0,n.mode=I_;case I_:if(n.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,ege;e.adler=n.check=1,n.mode=pl;case pl:if(t===Zpe||t===Nv)break e;case OC:if(n.last){u>>>=c&7,c-=c&7,n.mode=$C;break}for(;c<3;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}switch(n.last=u&1,u>>>=1,c-=1,u&3){case 0:n.mode=MR;break;case 1:if(lge(n),n.mode=Dv,t===Nv){u>>>=2,c-=2;break e}break;case 2:n.mode=NR;break;case 3:e.msg="invalid block type",n.mode=Zn}u>>>=2,c-=2;break;case MR:for(u>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Zn;break}if(n.length=u&65535,u=0,c=0,n.mode=MC,t===Nv)break e;case MC:n.mode=$R;case $R:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;i.set(r.subarray(o,o+h),a),s-=h,o+=h,l-=h,a+=h,n.length-=h;break}n.mode=pl;break;case NR:for(;c<14;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.nlen=(u&31)+257,u>>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Zn;break}n.have=0,n.mode=DR;case DR:for(;n.have<n.ncode;){for(;c<3;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.lens[N[n.have++]]=u&7,u>>>=3,c-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},C=rm(Ype,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,C){e.msg="invalid code lengths set",n.mode=Zn;break}n.have=0,n.mode=LR;case LR:for(;n.have<n.nlen+n.ndist;){for(;_=n.lencode[u&(1<<n.lenbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(g<16)u>>>=b,c-=b,n.lens[n.have++]=g;else{if(g===16){for(P=b+2;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(u>>>=b,c-=b,n.have===0){e.msg="invalid bit length repeat",n.mode=Zn;break}x=n.lens[n.have-1],h=3+(u&3),u>>>=2,c-=2}else if(g===17){for(P=b+3;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=b,c-=b,x=0,h=3+(u&7),u>>>=3,c-=3}else{for(P=b+7;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=b,c-=b,x=0,h=11+(u&127),u>>>=7,c-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Zn;break}for(;h--;)n.lens[n.have++]=x}}if(n.mode===Zn)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Zn;break}if(n.lenbits=9,E={bits:n.lenbits},C=rm($j,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,C){e.msg="invalid literal/lengths set",n.mode=Zn;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},C=rm(Nj,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,C){e.msg="invalid distances set",n.mode=Zn;break}if(n.mode=Dv,t===Nv)break e;case Dv:n.mode=Lv;case Lv:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,qpe(e,f),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,n.mode===pl&&(n.back=-1);break}for(n.back=0;_=n.lencode[u&(1<<n.lenbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(y&&!(y&240)){for(v=b,S=y,w=g;_=n.lencode[w+((u&(1<<v+S)-1)>>v)],b=_>>>24,y=_>>>16&255,g=_&65535,!(v+b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=b,c-=b,n.back+=b,n.length=g,y===0){n.mode=UR;break}if(y&32){n.back=-1,n.mode=pl;break}if(y&64){e.msg="invalid literal/length code",n.mode=Zn;break}n.extra=y&15,n.mode=FR;case FR:if(n.extra){for(P=n.extra;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=BR;case BR:for(;_=n.distcode[u&(1<<n.distbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(!(y&240)){for(v=b,S=y,w=g;_=n.distcode[w+((u&(1<<v+S)-1)>>v)],b=_>>>24,y=_>>>16&255,g=_&65535,!(v+b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=b,c-=b,n.back+=b,y&64){e.msg="invalid distance code",n.mode=Zn;break}n.offset=g,n.extra=y&15,n.mode=zR;case zR:if(n.extra){for(P=n.extra;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Zn;break}n.mode=jR;case jR:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Zn;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=i,p=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[a++]=m[p++];while(--h);n.length===0&&(n.mode=Lv);break;case UR:if(l===0)break e;i[a++]=n.length,l--,n.mode=Lv;break;case $C:if(n.wrap){for(;c<32;){if(s===0)break e;s--,u|=r[o++]<<c,c+=8}if(f-=l,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?ai(n.check,i,f,a-f):g0(n.check,i,f,a-f)),f=l,n.wrap&4&&(n.flags?u:qR(u))!==n.check){e.msg="incorrect data check",n.mode=Zn;break}u=0,c=0}n.mode=VR;case VR:if(n.wrap&&n.flags){for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Zn;break}u=0,c=0}n.mode=GR;case GR:C=Jpe;break e;case Zn:C=Dj;break e;case Fj:return Lj;case Bj:default:return Ia}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,(n.wsize||f!==e.avail_out&&n.mode<Zn&&(n.mode<$C||t!==xR))&&Gj(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?ai(n.check,i,f,e.next_out-f):g0(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===pl?128:0)+(n.mode===Dv||n.mode===MC?256:0),(d===0&&f===0||t===xR)&&C===Fd&&(C=tge),C},cge=e=>{if(Qd(e))return Ia;let t=e.state;return t.window&&(t.window=null),e.state=null,Fd},dge=(e,t)=>{if(Qd(e))return Ia;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Fd):Ia},fge=(e,t)=>{const n=t.length;let r,i,o;return Qd(e)||(r=e.state,r.wrap!==0&&r.mode!==I_)?Ia:r.mode===I_&&(i=1,i=g0(i,t,n,0),i!==r.check)?Dj:(o=Gj(e,t,n,n),o?(r.mode=Fj,Lj):(r.havedict=1,Fd))};var hge=jj,pge=Uj,gge=zj,mge=sge,yge=Vj,vge=uge,bge=cge,_ge=dge,Sge=fge,xge="pako inflate (from Nodeca project)",El={inflateReset:hge,inflateReset2:pge,inflateResetKeep:gge,inflateInit:mge,inflateInit2:yge,inflate:vge,inflateEnd:bge,inflateGetHeader:_ge,inflateSetDictionary:Sge,inflateInfo:xge};function wge(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Cge=wge;const qj=Object.prototype.toString,{Z_NO_FLUSH:Age,Z_FINISH:Ege,Z_OK:v0,Z_STREAM_END:LC,Z_NEED_DICT:FC,Z_STREAM_ERROR:Tge,Z_DATA_ERROR:WR,Z_MEM_ERROR:kge}=Sy;function wy(e){this.options=N2.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Oj,this.strm.avail_out=0;let n=El.inflateInit2(this.strm,t.windowBits);if(n!==v0)throw new Error(np[n]);if(this.header=new Cge,El.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=y0.string2buf(t.dictionary):qj.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=El.inflateSetDictionary(this.strm,t.dictionary),n!==v0)))throw new Error(np[n])}wy.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Ege:Age,qj.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=El.inflate(n,a),o===FC&&i&&(o=El.inflateSetDictionary(n,i),o===v0?o=El.inflate(n,a):o===WR&&(o=FC));n.avail_in>0&&o===LC&&n.state.wrap>0&&e[n.next_in]!==0;)El.inflateReset(n),o=El.inflate(n,a);switch(o){case Tge:case WR:case FC:case kge:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===LC))if(this.options.to==="string"){let l=y0.utf8border(n.output,n.next_out),u=n.next_out-l,c=y0.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===v0&&s===0)){if(o===LC)return o=El.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};wy.prototype.onData=function(e){this.chunks.push(e)};wy.prototype.onEnd=function(e){e===v0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=N2.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function l4(e,t){const n=new wy(t);if(n.push(e),n.err)throw n.msg||np[n.err];return n.result}function Pge(e,t){return t=t||{},t.raw=!0,l4(e,t)}var Ige=wy,Rge=l4,Oge=Pge,Mge=l4,$ge=Sy,Nge={Inflate:Ige,inflate:Rge,inflateRaw:Oge,ungzip:Mge,constants:$ge};const{Inflate:mqe,inflate:Dge,inflateRaw:yqe,ungzip:vqe}=Nge;var Hj=Dge;const Wj=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;Wj[e]=t}function Lge(e){let t=-1;for(let n=0;n<e.length;n++)t=Wj[(t^e[n])&255]^t>>>8;return t^-1}var Jn;(function(e){e[e.GRAYSCALE=0]="GRAYSCALE",e[e.TRUE_COLOR=2]="TRUE_COLOR",e[e.PALETTE=3]="PALETTE",e[e.GRAYSCALE_WITH_ALPHA=4]="GRAYSCALE_WITH_ALPHA",e[e.TRUE_COLOR_WITH_ALPHA=6]="TRUE_COLOR_WITH_ALPHA"})(Jn||(Jn={}));const Fge={[Jn.GRAYSCALE]:1,[Jn.TRUE_COLOR]:3,[Jn.PALETTE]:1,[Jn.GRAYSCALE_WITH_ALPHA]:2,[Jn.TRUE_COLOR_WITH_ALPHA]:4},Bge=1;var Ko;(function(e){e[e.NONE=0]="NONE",e[e.SUB=1]="SUB",e[e.UP=2]="UP",e[e.AVERAGE=3]="AVERAGE",e[e.PAETH=4]="PAETH"})(Ko||(Ko={}));const zge={[Ko.NONE](e){return e},[Ko.SUB](e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++){const i=n[r-t]||0;n[r]=e[r]+i}return n},[Ko.UP](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=n[i]||0;r[i]=o+e[i]}return r},[Ko.AVERAGE](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,a=n[i]||0,s=o+a>>1;r[i]=e[i]+s}return r},[Ko.PAETH](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,a=n[i],s=n[i-t]||0,l=Kj(o,a,s);r[i]=e[i]+l}return r}};Ko.NONE+"",Ko.SUB+"",Ko.UP+"",Ko.AVERAGE+"",Ko.PAETH+"";function Kj(e,t,n){const r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),a=Math.abs(r-n);return i<=o&&i<=a?e:o<=a?t:n}function si(e,t,n){if(t===n)return e;const r=2**t-1,i=2**n-1;return Math.round(e*i/r)}function jge(e,t){const n=[];let r=0;for(;r<e.length;)if(t===1){const i=e[r++];n.push(i>>7&1,i>>6&1,i>>5&1,i>>4&1,i>>3&1,i>>2&1,i>>1&1,i&1)}else if(t===2){const i=e[r++];n.push(i>>6&3,i>>4&3,i>>2&3,i&3)}else if(t===4){const i=e[r++];n.push(i>>4&15,i&15)}else if(t===8){const i=e[r++];n.push(i)}else if(t===16)n.push(e[r++]<<8|e[r++]);else throw new Error("Unsupported depth: "+t);return n}const Qj=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];function Uge(e,t,n){if(!e)return[{passWidth:t,passHeight:n,passIndex:0}];const r=[];return Qj.forEach(function({x:i,y:o},a){const s=t%8,l=n%8,u=t-s>>3,c=n-l>>3;let d=u*i.length;for(let h=0;h<i.length&&i[h]<s;h++)d++;let f=c*o.length;for(let h=0;h<o.length&&o[h]<l;h++)f++;d&&f&&r.push({passWidth:d,passHeight:f,passIndex:a})}),r}function Vge(e,t,n,r,i){if(!e)return t*i+r<<2;const o=Qj[n],a=r%o.x.length,s=i%o.y.length,l=(r-a)/o.x.length,u=(i-s)/o.y.length,c=o.x[a],d=o.y[s];return t*((u<<3)+d)+(l<<3)+c<<2}function Gge(e,t,n,r,i,o,a,s){let l=[];const u=Hj(e),c=Uge(t,r,i),f=Fge[n]*o,h=f>>3||1;let p=0,m=new Uint8Array;for(let _=0;_<c.length;_++){const{passWidth:b,passHeight:y,passIndex:g}=c[_];for(let v=0;v<y;v++){let P=function(){if(n===Jn.GRAYSCALE){const N=si(E[T++],o,8);return[N,N,N,255]}if(n===Jn.TRUE_COLOR)return[si(E[T++],o,8),si(E[T++],o,8),si(E[T++],o,8),255];if(n===Jn.PALETTE){const N=E[T++];if(!a)throw new Error("Mising chunk: PLTE");return a[N]}if(n===Jn.GRAYSCALE_WITH_ALPHA){const N=si(E[T++],o,8);return[N,N,N,si(E[T++],o,8)]}if(n===Jn.TRUE_COLOR_WITH_ALPHA)return[si(E[T++],o,8),si(E[T++],o,8),si(E[T++],o,8),si(E[T++],o,8)];throw new Error("Unsupported color type: "+n)};const S=(b*f+7>>3)+Bge,w=u[p];if(!(w in Ko))throw new Error("Unsupported filter type: "+w);const x=zge[w],C=x(u.slice(p+1,p+S),h,m);m=C;let T=0;const E=jge(C,o);for(let N=0;N<b;N++){const O=P();s&&O[0]===s[0]&&O[1]===s[1]&&O[2]===s[2]&&(O[3]=0);const A=Vge(t,r,g,N,v);for(let k=0;k<O.length;k++)l[A+k]=O[k]}p+=S}}return l}const BC=[137,80,78,71,13,10,26,10],qge=1e5;function zC(e){let t=0,n="";for(;t<e.length;){let r=e[t++];if(r>127)if(r>191&&r<224){if(t>=e.length)throw new Error("UTF-8 decode: incomplete 2-byte sequence");r=(r&31)<<6|e[t++]&63}else if(r>223&&r<240){if(t+1>=e.length)throw new Error("UTF-8 decode: incomplete 3-byte sequence");r=(r&15)<<12|(e[t++]&63)<<6|e[t++]&63}else if(r>239&&r<248){if(t+2>=e.length)throw new Error("UTF-8 decode: incomplete 4-byte sequence");r=(r&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63}else throw new Error("UTF-8 decode: unknown multibyte start 0x"+r.toString(16)+" at index "+(t-1));if(r<=65535)n+=String.fromCharCode(r);else if(r<=1114111)r-=65536,n+=String.fromCharCode(r>>10|55296),n+=String.fromCharCode(r&1023|56320);else throw new Error("UTF-8 decode: code point 0x"+r.toString(16)+" exceeds UTF-16 reach")}return n}function Hge(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}const gu=1e5;function Wge(e){const t=new Uint8Array(e);let n=new Uint8Array;const r={width:0,height:0,depth:0,colorType:0,compression:0,interlace:0,filter:0,data:[]};let i=0;function o(){return t[i++]<<24|t[i++]<<16|t[i++]<<8|t[i++]}function a(){return t[i++]<<8|t[i++]}function s(){return t[i++]}function l(){const M=[];let R=0;for(;(R=t[i++])!==0;)M.push(R);return new Uint8Array(M)}function u(M){const R=i+M;let $="";for(;i<R;){const B=s();if(B===0)break;$+=String.fromCharCode(B)}return $}function c(M){let R="";for(;i<M;){const $=s();R+=String.fromCharCode($)}return R}function d(M){const R=t.slice(i,M);return i=M,Hj(R)}function f(){let M="";for(const R=i+4;i<R;i++)M+=String.fromCharCode(t[i]);return M}for(;i<BC.length;i++)if(t[i]!==BC[i])throw new Error(`Invalid file signature, at position ${i}: ${t[i]} !== ${BC[i]}`);const h={IHDR:p,PLTE:m,IDAT:_,IEND:b,tRNS:y,cHRM:g,gAMA:v,iCCP:S,sBIT:w,sRGB:x,tEXt:C,zTXt:T,iTXt:E,bKGD:P,hIST:N,pHYs:O,sPLT:A,tIME:k};function p(){r.width=o(),r.height=o(),r.depth=s();const M=s();if(!(M in Jn))throw new Error("Unsupported color type: "+M);r.colorType=M,r.compression=s(),r.filter=s(),r.interlace=s()}function m(M){const R=[];for(let $=0;$<M;$+=3)R.push([t[i++],t[i++],t[i++],255]);r.palette=R}function _(M){n=Hge(n,t.slice(i,i+M)),i+=M}function b(M){i+=M}function y(M){if(r.colorType===Jn.GRAYSCALE){const R=si(t[i++]<<8|t[i++],r.depth,8);r.transparent=[R,R,R,255]}else if(r.colorType===Jn.TRUE_COLOR)r.transparent=[si(t[i++]<<8|t[i++],r.depth,8),si(t[i++]<<8|t[i++],r.depth,8),si(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===Jn.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");for(let R=0;R<M;R++)r.palette[R][3]=t[i++]}}function g(){r.chromaticities={white:{x:o()/gu,y:o()/gu},red:{x:o()/gu,y:o()/gu},green:{x:o()/gu,y:o()/gu},blue:{x:o()/gu,y:o()/gu}}}function v(){r.gamma=o()/qge}function S(M){const R=i+M,$=u(80);s();const B=d(R);r.icc={name:$,profile:Array.from(B)}}function w(){if(r.colorType===Jn.GRAYSCALE){const M=s();r.significantBits=[M,M,M,r.depth]}else if(r.colorType===Jn.TRUE_COLOR||r.colorType===Jn.PALETTE)r.significantBits=[s(),s(),s(),r.depth];else if(r.colorType===Jn.GRAYSCALE_WITH_ALPHA){const M=s();r.significantBits=[M,M,M,s()]}else r.colorType===Jn.TRUE_COLOR_WITH_ALPHA&&(r.significantBits=[s(),s(),s(),s()])}function x(){r.sRGB=s()}function C(M){const R=i+M,$=u(80),B=c(R);r.text||(r.text={}),r.text[$]=B}function T(M){const R=i+M,$=u(80);s();const B=d(R);let U="";for(let G=0;G<B.length;G++)U+=String.fromCharCode(B[G]);r.compressedText||(r.compressedText={}),r.compressedText[$]=U}function E(M){const R=i+M,$=u(80),B=s();s();const U=u(1/0),G=zC(l());let Y="";if(B===0)Y=zC(t.slice(i,R)),i=R;else{const ee=d(R);Y=zC(ee)}r.internationalText||(r.internationalText={}),r.internationalText[$]={languageTag:U,translatedKeyword:G,text:Y}}function P(){if((r.colorType&3)===Jn.GRAYSCALE){const M=si(t[i++]<<8|t[i++],r.depth,8);r.background=[M,M,M,255]}else if((r.colorType&3)===Jn.TRUE_COLOR)r.background=[si(t[i++]<<8|t[i++],r.depth,8),si(t[i++]<<8|t[i++],r.depth,8),si(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===Jn.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");r.background=r.palette[t[i++]]}}function N(M){const R=i+M,$=[];for(;i<R;)$.push(a());r.histogram=$}function O(){const M=o(),R=o(),$=s();r.physicalDimensions={pixelPerUnitX:M,pixelPerUnitY:R,unit:$}}function A(M){const R=i+M,$=u(80),B=s(),U=[];if(B===8)for(;i<R;)U.push([s(),s(),s(),s(),a()]);else if(B===16)for(;i<R;)U.push([a(),a(),a(),a(),a()]);r.suggestedPalette={name:$,depth:B,palette:U}}function k(){const M=a(),R=s(),$=s(),B=s(),U=s(),G=s();r.lastModificationTime=Date.UTC(M,R-1,$,B,U,G)}function D(){const M=i,R=o(),$=f();h[$]?h[$](R):($.charCodeAt(0)&32,i+=R),L(M,R)}function L(M,R){const $=o(),B=Lge(t.slice(M+4,M+8+R));if($!==B)throw new Error("Crc32 error: calculated "+B+", expected "+$);i<t.length&&D()}return D(),r.data=Gge(n,r.interlace,r.colorType,r.width,r.height,r.depth,r.palette,r.transparent),r}var Xj={},L2={},F2={};Object.defineProperty(F2,"__esModule",{value:!0});F2.createLogMethods=void 0;var Kge=function(){return{debug:console.debug.bind(console),error:console.error.bind(console),fatal:console.error.bind(console),info:console.info.bind(console),trace:console.debug.bind(console),warn:console.warn.bind(console)}};F2.createLogMethods=Kge;var u4={},B2={};Object.defineProperty(B2,"__esModule",{value:!0});B2.boolean=void 0;const Qge=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};B2.boolean=Qge;var z2={};Object.defineProperty(z2,"__esModule",{value:!0});z2.isBooleanable=void 0;const Xge=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};z2.isBooleanable=Xge;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=B2;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=z2;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(u4);var KR=Object.prototype.toString,Yj=function(t){var n=KR.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&KR.call(t.callee)==="[object Function]"),r},jC,QR;function Yge(){if(QR)return jC;QR=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Yj,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var h=f.constructor;return h&&h.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&t.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),d=function(f){if(typeof window>"u"||!c)return l(f);try{return l(f)}catch{return!1}};e=function(h){var p=h!==null&&typeof h=="object",m=n.call(h)==="[object Function]",_=r(h),b=p&&n.call(h)==="[object String]",y=[];if(!p&&!m&&!_)throw new TypeError("Object.keys called on a non-object");var g=a&&m;if(b&&h.length>0&&!t.call(h,0))for(var v=0;v<h.length;++v)y.push(String(v));if(_&&h.length>0)for(var S=0;S<h.length;++S)y.push(String(S));else for(var w in h)!(g&&w==="prototype")&&t.call(h,w)&&y.push(String(w));if(o)for(var x=d(h),C=0;C<s.length;++C)!(x&&s[C]==="constructor")&&t.call(h,s[C])&&y.push(s[C]);return y}}return jC=e,jC}var Zge=Array.prototype.slice,Jge=Yj,XR=Object.keys,W1=XR?function(t){return XR(t)}:Yge(),YR=Object.keys;W1.shim=function(){if(Object.keys){var t=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);t||(Object.keys=function(r){return Jge(r)?YR(Zge.call(r)):YR(r)})}else Object.keys=W1;return Object.keys||W1};var eme=W1,tme=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0},ZR=typeof Symbol<"u"&&Symbol,nme=tme,rme=function(){return typeof ZR!="function"||typeof Symbol!="function"||typeof ZR("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:nme()},JR={foo:{}},ime=Object,ome=function(){return{__proto__:JR}.foo===JR.foo&&!({__proto__:null}instanceof ime)},ame="Function.prototype.bind called on incompatible ",UC=Array.prototype.slice,sme=Object.prototype.toString,lme="[object Function]",ume=function(t){var n=this;if(typeof n!="function"||sme.call(n)!==lme)throw new TypeError(ame+n);for(var r=UC.call(arguments,1),i,o=function(){if(this instanceof i){var c=n.apply(this,r.concat(UC.call(arguments)));return Object(c)===c?c:this}else return n.apply(t,r.concat(UC.call(arguments)))},a=Math.max(0,n.length-r.length),s=[],l=0;l<a;l++)s.push("$"+l);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i},cme=ume,Zj=Function.prototype.bind||cme,dme=Zj,fme=dme.call(Function.call,Object.prototype.hasOwnProperty),Nt,op=SyntaxError,Jj=Function,_h=TypeError,VC=function(e){try{return Jj('"use strict"; return ('+e+").constructor;")()}catch{}},Sd=Object.getOwnPropertyDescriptor;if(Sd)try{Sd({},"")}catch{Sd=null}var GC=function(){throw new _h},hme=Sd?function(){try{return arguments.callee,GC}catch{try{return Sd(arguments,"callee").get}catch{return GC}}}():GC,yf=rme(),pme=ome(),oi=Object.getPrototypeOf||(pme?function(e){return e.__proto__}:null),Rf={},gme=typeof Uint8Array>"u"||!oi?Nt:oi(Uint8Array),xd={"%AggregateError%":typeof AggregateError>"u"?Nt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Nt:ArrayBuffer,"%ArrayIteratorPrototype%":yf&&oi?oi([][Symbol.iterator]()):Nt,"%AsyncFromSyncIteratorPrototype%":Nt,"%AsyncFunction%":Rf,"%AsyncGenerator%":Rf,"%AsyncGeneratorFunction%":Rf,"%AsyncIteratorPrototype%":Rf,"%Atomics%":typeof Atomics>"u"?Nt:Atomics,"%BigInt%":typeof BigInt>"u"?Nt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Nt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Nt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Nt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Nt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Nt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Nt:FinalizationRegistry,"%Function%":Jj,"%GeneratorFunction%":Rf,"%Int8Array%":typeof Int8Array>"u"?Nt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Nt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Nt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":yf&&oi?oi(oi([][Symbol.iterator]())):Nt,"%JSON%":typeof JSON=="object"?JSON:Nt,"%Map%":typeof Map>"u"?Nt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!yf||!oi?Nt:oi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Nt:Promise,"%Proxy%":typeof Proxy>"u"?Nt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Nt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Nt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!yf||!oi?Nt:oi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Nt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":yf&&oi?oi(""[Symbol.iterator]()):Nt,"%Symbol%":yf?Symbol:Nt,"%SyntaxError%":op,"%ThrowTypeError%":hme,"%TypedArray%":gme,"%TypeError%":_h,"%Uint8Array%":typeof Uint8Array>"u"?Nt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Nt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Nt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Nt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Nt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Nt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Nt:WeakSet};if(oi)try{null.error}catch(e){var mme=oi(oi(e));xd["%Error.prototype%"]=mme}var yme=function e(t){var n;if(t==="%AsyncFunction%")n=VC("async function () {}");else if(t==="%GeneratorFunction%")n=VC("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=VC("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&oi&&(n=oi(i.prototype))}return xd[t]=n,n},e9={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Cy=Zj,R_=fme,vme=Cy.call(Function.call,Array.prototype.concat),bme=Cy.call(Function.apply,Array.prototype.splice),t9=Cy.call(Function.call,String.prototype.replace),O_=Cy.call(Function.call,String.prototype.slice),_me=Cy.call(Function.call,RegExp.prototype.exec),Sme=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xme=/\\(\\)?/g,wme=function(t){var n=O_(t,0,1),r=O_(t,-1);if(n==="%"&&r!=="%")throw new op("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new op("invalid intrinsic syntax, expected opening `%`");var i=[];return t9(t,Sme,function(o,a,s,l){i[i.length]=s?t9(l,xme,"$1"):a||o}),i},Cme=function(t,n){var r=t,i;if(R_(e9,r)&&(i=e9[r],r="%"+i[0]+"%"),R_(xd,r)){var o=xd[r];if(o===Rf&&(o=yme(r)),typeof o>"u"&&!n)throw new _h("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new op("intrinsic "+t+" does not exist!")},Ame=function(t,n){if(typeof t!="string"||t.length===0)throw new _h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new _h('"allowMissing" argument must be a boolean');if(_me(/^%?[^%]*%?$/,t)===null)throw new op("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=wme(t),i=r.length>0?r[0]:"",o=Cme("%"+i+"%",n),a=o.name,s=o.value,l=!1,u=o.alias;u&&(i=u[0],bme(r,vme([0,1],u)));for(var c=1,d=!0;c<r.length;c+=1){var f=r[c],h=O_(f,0,1),p=O_(f,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new op("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),i+="."+f,a="%"+i+"%",R_(xd,a))s=xd[a];else if(s!=null){if(!(f in s)){if(!n)throw new _h("base intrinsic for "+t+" exists, but the property is not available.");return}if(Sd&&c+1>=r.length){var m=Sd(s,f);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else d=R_(s,f),s=s[f];d&&!l&&(xd[a]=s)}}return s},Eme=Ame,MA=Eme("%Object.defineProperty%",!0),$A=function(){if(MA)try{return MA({},"a",{value:1}),!0}catch{return!1}return!1};$A.hasArrayLengthDefineBug=function(){if(!$A())return null;try{return MA([],"length",{value:1}).length!==1}catch{return!0}};var Tme=$A,kme=eme,Pme=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Ime=Object.prototype.toString,Rme=Array.prototype.concat,eU=Object.defineProperty,Ome=function(e){return typeof e=="function"&&Ime.call(e)==="[object Function]"},Mme=Tme(),tU=eU&&Mme,$me=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!Ome(r)||!r())return}tU?eU(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},nU=function(e,t){var n=arguments.length>2?arguments[2]:{},r=kme(t);Pme&&(r=Rme.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)$me(e,r[i],t[r[i]],n[r[i]])};nU.supportsDescriptors=!!tU;var rU=nU,K1={exports:{}};typeof self<"u"?K1.exports=self:typeof window<"u"?K1.exports=window:K1.exports=Function("return this")();var iU=K1.exports,Nme=iU,oU=function(){return typeof yt!="object"||!yt||yt.Math!==Math||yt.Array!==Array?Nme:yt},Dme=rU,Lme=oU,Fme=function(){var t=Lme();if(Dme.supportsDescriptors){var n=Object.getOwnPropertyDescriptor(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},Bme=rU,zme=iU,aU=oU,jme=Fme,Ume=aU(),sU=function(){return Ume};Bme(sU,{getPolyfill:aU,implementation:zme,shim:jme});var c4=sU,lU={},Ay={},d4={},j2={},U2={};Object.defineProperty(U2,"__esModule",{value:!0});U2.convertWildcardToRegex=void 0;var Vme=/\*+/g,Gme=function(e){return new RegExp(e.replace(Vme,"(.+?)"))};U2.convertWildcardToRegex=Gme;var Ey={};Object.defineProperty(Ey,"__esModule",{value:!0});Ey.escapeRegexString=void 0;var qme=/[$()*+.?[\\\]^{|}]/g,Hme=/-/g,Wme=function(e){return e.replace(qme,"\\$&").replace(Hme,"\\x2d")};Ey.escapeRegexString=Wme;var V2={};Object.defineProperty(V2,"__esModule",{value:!0});V2.parseRegex=void 0;var Kme=/(\/?)(.+)\1([a-z]*)/,Qme=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,Xme=function(e){var t=Kme.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!Qme.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};V2.parseRegex=Xme;Object.defineProperty(j2,"__esModule",{value:!0});j2.createStringTest=void 0;var Yme=U2,Zme=Ey,Jme=V2,qC=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,Jme.parseRegex)(t),function(r){var i,o;return(o=(i=r.match(n))===null||i===void 0?void 0:i[0])!==null&&o!==void 0?o:!1}},e0e=function(e,t){if(t.type!=="Tag")throw new Error("Expected a tag expression.");var n=t.expression;if(n.type==="RangeExpression")throw new Error("Unexpected range expression.");if(n.type==="RegexExpression")return qC(e,n.value);if(n.type!=="LiteralExpression")throw new Error("Expected a literal expression.");var r=String(n.value);return r.includes("*")&&n.quoted===!1?qC(e,String((0,Yme.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):qC(e,"/("+(0,Zme.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};j2.createStringTest=e0e;var G2={};Object.defineProperty(G2,"__esModule",{value:!0});G2.testComparisonRange=void 0;var t0e=function(e,t,n){switch(n){case":=":return t===e;case":>":return t>e;case":<":return t<e;case":>=":return t>=e;case":<=":return t<=e;default:throw new Error("Unimplemented comparison operator: ".concat(n))}};G2.testComparisonRange=t0e;var q2={};Object.defineProperty(q2,"__esModule",{value:!0});q2.testRange=void 0;var n0e=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};q2.testRange=n0e;(function(e){var t=yt&&yt.__assign||function(){return t=Object.assign||function(c){for(var d,f=1,h=arguments.length;f<h;f++){d=arguments[f];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},t.apply(this,arguments)},n=yt&&yt.__spreadArray||function(c,d,f){if(f||arguments.length===2)for(var h=0,p=d.length,m;h<p;h++)(m||!(h in d))&&(m||(m=Array.prototype.slice.call(d,0,h)),m[h]=d[h]);return c.concat(m||Array.prototype.slice.call(d))};Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var r=j2,i=G2,o=q2,a=function(c){if(c.type!=="Tag")throw new Error("Expected a tag expression.");var d=c.expression;if(d.type==="RangeExpression")return function(m){return(0,o.testRange)(m,d.range)};if(d.type==="EmptyExpression")return function(){return!1};var f=d.value;if(c.operator&&c.operator.operator!==":"){var h=c.operator;if(typeof f!="number")throw new TypeError("Expected a number.");return function(m){return typeof m!="number"?!1:(0,i.testComparisonRange)(f,m,h.operator)}}else{if(typeof f=="boolean")return function(m){return m===f};if(f===null)return function(m){return m===null};var p=(0,r.createStringTest)({},c);return function(m){return p(String(m))}}},s=function(c,d,f,h,p){if(Array.isArray(d)){for(var m=!1,_=0,b=0,y=d;b<y.length;b++){var g=y[b];if(s(c,g,f,n(n([],h,!0),[String(_++)],!1),p)){if(f)return!0;m=!0}}return m}else if(typeof d=="object"&&d!==null){var m=!1;for(var v in d)if(s(c,d[v],f,n(n([],h,!0),[v],!1),p)){if(f)return!0;m=!0}return m}if(c.type!=="Tag")throw new Error("Expected a tag expression.");if(!c.test)throw new Error("Expected test to be defined.");var S=c.test(d);return S?(p.push(t(t({},typeof S=="string"&&{keyword:S}),{path:h.join(".")})),!0):!!S},l=function(c,d,f,h,p){if(d.type!=="Tag")throw new Error("Expected a tag expression.");if(d.test||(d.test=a(d)),d.field.type==="ImplicitField"){var m=!1;for(var _ in c)if(s(t(t({},d),{field:{location:{end:-1,start:-1},name:_,quoted:!0,quotes:"double",type:"Field"}}),c[_],f,n(n([],h,!0),[_],!1),p)){if(f)return!0;m=!0}return m}if(d.field.name in c)return s(d,c[d.field.name],f,h,p);if(d.getValue&&d.field.path)return s(d,d.getValue(c),f,d.field.path,p);if(d.field.path){for(var b=c,y=0,g=d.field.path;y<g.length;y++){var v=g[y];if(typeof b!="object"||b===null)return!1;if(v in b)b=b[v];else return!1}return s(d,b,f,d.field.path,p)}else return!1},u=function(c,d,f,h,p){if(f===void 0&&(f=!0),h===void 0&&(h=[]),p===void 0&&(p=[]),c.type==="Tag")return d.filter(function(y){return l(y,c,f,c.field.type==="ImplicitField"?h:n(n([],h,!0),[c.field.name],!1),p)});if(c.type==="UnaryOperator"){var m=(0,e.internalFilter)(c.operand,d,f,h,[]);return d.filter(function(y){return!m.includes(y)})}if(!c.left)throw new Error("Expected left to be defined.");var _=(0,e.internalFilter)(c.left,d,f,h,p);if(!c.right)throw new Error("Expected right to be defined.");if(c.type!=="LogicalExpression")throw new Error("Expected a tag expression.");if(c.operator.operator==="OR"){var b=(0,e.internalFilter)(c.right,d,f,h,p);return Array.from(new Set(n(n([],_,!0),b,!0)))}else if(c.operator.operator==="AND")return(0,e.internalFilter)(c.right,_,f,h,p);throw new Error("Unexpected state.")};e.internalFilter=u})(d4);Object.defineProperty(Ay,"__esModule",{value:!0});Ay.filter=void 0;var r0e=d4,i0e=function(e,t){return(0,r0e.internalFilter)(e,t)};Ay.filter=i0e;var H2={};Object.defineProperty(H2,"__esModule",{value:!0});H2.highlight=void 0;var o0e=Ey,a0e=d4,s0e=function(e,t){var n=[];(0,a0e.internalFilter)(e,[t],!1,[],n);for(var r=[],i=function(l){var u=r.find(function(c){return c.path===l.path});u||(u={keywords:[],path:l.path},r.push(u)),l.keyword&&u.keywords.push(l.keyword)},o=0,a=n;o<a.length;o++){var s=a[o];i(s)}return r.map(function(l){return l.keywords.length>0?{path:l.path,query:new RegExp("("+l.keywords.map(function(u){return(0,o0e.escapeRegexString)(u.trim())}).join("|")+")")}:{path:l.path}})};H2.highlight=s0e;var W2={},uU={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(yt,function(){function t(u,c,d){return this.id=++t.highestId,this.name=u,this.symbols=c,this.postprocess=d,this}t.highestId=0,t.prototype.toString=function(u){var c=typeof u>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,u).map(l).join(" ")+" ● "+this.symbols.slice(u).map(l).join(" ");return this.name+" → "+c};function n(u,c,d,f){this.rule=u,this.dot=c,this.reference=d,this.data=[],this.wantedBy=f,this.isComplete=this.dot===u.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(u){var c=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return c.left=this,c.right=u,c.isComplete&&(c.data=c.build(),c.right=void 0),c},n.prototype.build=function(){var u=[],c=this;do u.push(c.right.data),c=c.left;while(c.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,a.fail))};function r(u,c){this.grammar=u,this.index=c,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var c=this.states,d=this.wants,f=this.completed,h=0;h<c.length;h++){var p=c[h];if(p.isComplete){if(p.finish(),p.data!==a.fail){for(var m=p.wantedBy,_=m.length;_--;){var b=m[_];this.complete(b,p)}if(p.reference===this.index){var y=p.rule.name;(this.completed[y]=this.completed[y]||[]).push(p)}}}else{var y=p.rule.symbols[p.dot];if(typeof y!="string"){this.scannable.push(p);continue}if(d[y]){if(d[y].push(p),f.hasOwnProperty(y))for(var g=f[y],_=0;_<g.length;_++){var v=g[_];this.complete(p,v)}}else d[y]=[p],this.predict(y)}}},r.prototype.predict=function(u){for(var c=this.grammar.byName[u]||[],d=0;d<c.length;d++){var f=c[d],h=this.wants[u],p=new n(f,0,this.index,h);this.states.push(p)}},r.prototype.complete=function(u,c){var d=u.nextState(c);this.states.push(d)};function i(u,c){this.rules=u,this.start=c||this.rules[0].name;var d=this.byName={};this.rules.forEach(function(f){d.hasOwnProperty(f.name)||(d[f.name]=[]),d[f.name].push(f)})}i.fromCompiled=function(f,c){var d=f.Lexer;f.ParserStart&&(c=f.ParserStart,f=f.ParserRules);var f=f.map(function(p){return new t(p.name,p.symbols,p.postprocess)}),h=new i(f,c);return h.lexer=d,h};function o(){this.reset("")}o.prototype.reset=function(u,c){this.buffer=u,this.index=0,this.line=c?c.line:1,this.lastLineBreak=c?-c.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var u=this.buffer[this.index++];return u===`
+`&&(this.line+=1,this.lastLineBreak=this.index),{value:u}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(u,c){var d=this.buffer;if(typeof d=="string"){var f=d.split(`
+`).slice(Math.max(0,this.line-5),this.line),h=d.indexOf(`
+`,this.index);h===-1&&(h=d.length);var p=this.index-this.lastLineBreak,m=String(this.line).length;return c+=" at line "+this.line+" col "+p+`:
+
+`,c+=f.map(function(b,y){return _(this.line-f.length+y+1,m)+" "+b},this).join(`
+`),c+=`
+`+_("",m+p)+`^
+`,c}else return c+" at index "+(this.index-1);function _(b,y){var g=String(b);return Array(y-g.length+1).join(" ")+g}};function a(u,c,d){if(u instanceof i)var f=u,d=c;else var f=i.fromCompiled(u,c);this.grammar=f,this.options={keepHistory:!1,lexer:f.lexer||new o};for(var h in d||{})this.options[h]=d[h];this.lexer=this.options.lexer,this.lexerState=void 0;var p=new r(f,0);this.table=[p],p.wants[f.start]=[],p.predict(f.start),p.process(),this.current=0}a.fail={},a.prototype.feed=function(u){var c=this.lexer;c.reset(u,this.lexerState);for(var d;;){try{if(d=c.next(),!d)break}catch(x){var m=new r(this.grammar,this.current+1);this.table.push(m);var f=new Error(this.reportLexerError(x));throw f.offset=this.current,f.token=x.token,f}var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var p=this.current+1,m=new r(this.grammar,p);this.table.push(m);for(var _=d.text!==void 0?d.text:d.value,b=c.constructor===o?d.value:d,y=h.scannable,g=y.length;g--;){var v=y[g],S=v.rule.symbols[v.dot];if(S.test?S.test(b):S.type?S.type===d.type:S.literal===_){var w=v.nextState({data:b,token:d,isToken:!0,reference:p-1});m.states.push(w)}}if(m.process(),m.states.length===0){var f=new Error(this.reportError(d));throw f.offset=this.current,f.token=d,f}this.options.keepHistory&&(h.lexerState=c.save()),this.current++}return h&&(this.lexerState=c.save()),this.results=this.finish(),this},a.prototype.reportLexerError=function(u){var c,d,f=u.token;return f?(c="input "+JSON.stringify(f.text[0])+" (lexer error)",d=this.lexer.formatError(f,"Syntax error")):(c="input (lexer error)",d=u.message),this.reportErrorCommon(d,c)},a.prototype.reportError=function(u){var c=(u.type?u.type+" token: ":"")+JSON.stringify(u.value!==void 0?u.value:u),d=this.lexer.formatError(u,"Syntax error");return this.reportErrorCommon(d,c)},a.prototype.reportErrorCommon=function(u,c){var d=[];d.push(u);var f=this.table.length-2,h=this.table[f],p=h.states.filter(function(_){var b=_.rule.symbols[_.dot];return b&&typeof b!="string"});if(p.length===0)d.push("Unexpected "+c+`. I did not expect any more input. Here is the state of my parse table:
+`),this.displayStateStack(h.states,d);else{d.push("Unexpected "+c+`. Instead, I was expecting to see one of the following:
+`);var m=p.map(function(_){return this.buildFirstStateStack(_,[])||[_]},this);m.forEach(function(_){var b=_[0],y=b.rule.symbols[b.dot],g=this.getSymbolDisplay(y);d.push("A "+g+" based on:"),this.displayStateStack(_,d)},this)}return d.push(""),d.join(`
+`)},a.prototype.displayStateStack=function(u,c){for(var d,f=0,h=0;h<u.length;h++){var p=u[h],m=p.rule.toString(p.dot);m===d?f++:(f>0&&c.push("    ^ "+f+" more lines identical to this"),f=0,c.push("    "+m)),d=m}},a.prototype.getSymbolDisplay=function(u){return s(u)},a.prototype.buildFirstStateStack=function(u,c){if(c.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var d=u.wantedBy[0],f=[u].concat(c),h=this.buildFirstStateStack(d,f);return h===null?null:[u].concat(h)},a.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},a.prototype.restore=function(u){var c=u.index;this.current=c,this.table[c]=u,this.table.splice(c+1),this.lexerState=u.lexerState,this.results=this.finish()},a.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},a.prototype.finish=function(){var u=[],c=this.grammar.start,d=this.table[this.table.length-1];return d.states.forEach(function(f){f.rule.name===c&&f.dot===f.rule.symbols.length&&f.reference===0&&f.data!==a.fail&&u.push(f)}),u.map(function(f){return f.data})};function s(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return"character matching "+u;if(u.type)return u.type+" token";if(u.test)return"token matching "+String(u.test);throw new Error("Unknown symbol type: "+u)}}function l(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return u.toString();if(u.type)return"%"+u.type;if(u.test)return"<"+String(u.test)+">";throw new Error("Unknown symbol type: "+u)}}return{Parser:a,Grammar:i,Rule:t}})})(uU);var l0e=uU.exports,Bd={},cU={},Pc={};Pc.__esModule=void 0;Pc.__esModule=!0;var u0e=typeof Object.setPrototypeOf=="function",c0e=typeof Object.getPrototypeOf=="function",d0e=typeof Object.defineProperty=="function",f0e=typeof Object.create=="function",h0e=typeof Object.prototype.hasOwnProperty=="function",p0e=function(t,n){u0e?Object.setPrototypeOf(t,n):t.__proto__=n};Pc.setPrototypeOf=p0e;var g0e=function(t){return c0e?Object.getPrototypeOf(t):t.__proto__||t.prototype};Pc.getPrototypeOf=g0e;var n9=!1,m0e=function e(t,n,r){if(d0e&&!n9)try{Object.defineProperty(t,n,r)}catch{n9=!0,e(t,n,r)}else t[n]=r.value};Pc.defineProperty=m0e;var dU=function(t,n){return h0e?t.hasOwnProperty(t,n):t[n]===void 0};Pc.hasOwnProperty=dU;var y0e=function(t,n){if(f0e)return Object.create(t,n);var r=function(){};r.prototype=t;var i=new r;if(typeof n>"u")return i;if(typeof n=="null")throw new Error("PropertyDescriptors must not be null.");if(typeof n=="object")for(var o in n)dU(n,o)&&(i[o]=n[o].value);return i};Pc.objectCreate=y0e;(function(e){e.__esModule=void 0,e.__esModule=!0;var t=Pc,n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,o=t.objectCreate,a=new Error().toString()==="[object Error]",s="";function l(u){var c=this.constructor,d=c.name||function(){var _=c.toString().match(/^function\s*([^\s(]+)/);return _===null?s||"Error":_[1]}(),f=d==="Error",h=f?s:d,p=Error.apply(this,arguments);if(n(p,r(this)),!(p instanceof c)||!(p instanceof l)){var p=this;Error.apply(this,arguments),i(p,"message",{configurable:!0,enumerable:!1,value:u,writable:!0})}if(i(p,"name",{configurable:!0,enumerable:!1,value:h,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(p,f?l:c),p.stack===void 0){var m=new Error(u);m.name=p.name,p.stack=m.stack}return a&&i(p,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),p}s=l.name||"ExtendableError",l.prototype=o(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),e.ExtendableError=l,e.default=e.ExtendableError})(cU);var fU=yt&&yt.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Bd,"__esModule",{value:!0});Bd.SyntaxError=Bd.LiqeError=void 0;var v0e=cU,hU=function(e){fU(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(v0e.ExtendableError);Bd.LiqeError=hU;var b0e=function(e){fU(t,e);function t(n,r,i,o){var a=e.call(this,n)||this;return a.message=n,a.offset=r,a.line=i,a.column=o,a}return t}(hU);Bd.SyntaxError=b0e;var f4={},M_=yt&&yt.__assign||function(){return M_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},M_.apply(this,arguments)};Object.defineProperty(f4,"__esModule",{value:!0});function gl(e){return e[0]}var _0e={Lexer:void 0,ParserRules:[{name:"main",symbols:["_","logical_expression","_"],postprocess:function(e){return e[1]}},{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"__$ebnf$1",symbols:["whitespace_character"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"whitespace_character",symbols:[/[ \t\n\v\f]/],postprocess:gl},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:gl},{name:"decimal$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"decimal$ebnf$2",symbols:[/[0-9]/]},{name:"decimal$ebnf$2",symbols:["decimal$ebnf$2",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:[/[0-9]/]},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:["decimal$ebnf$3$subexpression$1$ebnf$1",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1",symbols:[{literal:"."},"decimal$ebnf$3$subexpression$1$ebnf$1"]},{name:"decimal$ebnf$3",symbols:["decimal$ebnf$3$subexpression$1"],postprocess:gl},{name:"decimal$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"decimal",symbols:["decimal$ebnf$1","decimal$ebnf$2","decimal$ebnf$3"],postprocess:function(e){return parseFloat((e[0]||"")+e[1].join("")+(e[2]?"."+e[2][1].join(""):""))}},{name:"dqstring$ebnf$1",symbols:[]},{name:"dqstring$ebnf$1",symbols:["dqstring$ebnf$1","dstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"dqstring",symbols:[{literal:'"'},"dqstring$ebnf$1",{literal:'"'}],postprocess:function(e){return e[1].join("")}},{name:"sqstring$ebnf$1",symbols:[]},{name:"sqstring$ebnf$1",symbols:["sqstring$ebnf$1","sstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"sqstring",symbols:[{literal:"'"},"sqstring$ebnf$1",{literal:"'"}],postprocess:function(e){return e[1].join("")}},{name:"dstrchar",symbols:[/[^\\"\n]/],postprocess:gl},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:gl},{name:"sstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar$string$1",symbols:[{literal:"\\"},{literal:"'"}],postprocess:function(e){return e.join("")}},{name:"sstrchar",symbols:["sstrchar$string$1"],postprocess:function(){return"'"}},{name:"strescape",symbols:[/["\\/bfnrt]/],postprocess:gl},{name:"strescape",symbols:[{literal:"u"},/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/],postprocess:function(e){return e.join("")}},{name:"logical_expression",symbols:["two_op_logical_expression"],postprocess:gl},{name:"two_op_logical_expression",symbols:["pre_two_op_logical_expression","boolean_operator","post_one_op_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:e[1],left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["pre_two_op_implicit_logical_expression","__","post_one_op_implicit_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:{operator:"AND",type:"ImplicitBooleanOperator"},left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["two_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"post_one_op_implicit_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"post_one_op_implicit_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"pre_two_op_logical_expression",symbols:["two_op_logical_expression","__"],postprocess:function(e){return e[0]}},{name:"pre_two_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[2].location.start+1},type:"ParenthesizedExpression",expression:{type:"EmptyExpression",location:{start:e[0].location.start+1,end:e[0].location.start+1}}}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression$string$1",symbols:[{literal:"N"},{literal:"O"},{literal:"T"}],postprocess:function(e){return e.join("")}},{name:"one_op_logical_expression",symbols:["one_op_logical_expression$string$1","post_boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"NOT",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:[{literal:"-"},"boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"-",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:["boolean_primary"],postprocess:function(e){return e[0]}},{name:"post_one_op_logical_expression",symbols:["__","one_op_logical_expression"],postprocess:function(e){return e[1]}},{name:"post_one_op_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location,end:e[4].location+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"parentheses_open",symbols:[{literal:"("}],postprocess:function(e,t){return{location:{start:t}}}},{name:"parentheses_close",symbols:[{literal:")"}],postprocess:function(e,t){return{location:{start:t}}}},{name:"boolean_operator$string$1",symbols:[{literal:"O"},{literal:"R"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$1"],postprocess:function(e,t){return{location:{start:t,end:t+2},operator:"OR",type:"BooleanOperator"}}},{name:"boolean_operator$string$2",symbols:[{literal:"A"},{literal:"N"},{literal:"D"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$2"],postprocess:function(e,t){return{location:{start:t,end:t+3},operator:"AND",type:"BooleanOperator"}}},{name:"boolean_primary",symbols:["tag_expression"],postprocess:gl},{name:"post_boolean_primary",symbols:["__","parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[1].location.start,end:e[5].location.start+1},type:"ParenthesizedExpression",expression:e[3]}}},{name:"post_boolean_primary",symbols:["__","boolean_primary"],postprocess:function(e){return e[1]}},{name:"tag_expression",symbols:["field","comparison_operator","expression"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,M_({location:{start:t,end:e[2].expression.location.end},field:n,operator:e[1]},e[2])}},{name:"tag_expression",symbols:["field","comparison_operator"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,{type:"Tag",location:{start:t,end:e[1].location.end},field:n,operator:e[1],expression:{type:"EmptyExpression",location:{start:e[1].location.end,end:e[1].location.end}}}}},{name:"tag_expression",symbols:["expression"],postprocess:function(e,t){return M_({location:{start:t,end:e[0].expression.location.end},field:{type:"ImplicitField"}},e[0])}},{name:"field$ebnf$1",symbols:[]},{name:"field$ebnf$1",symbols:["field$ebnf$1",/[a-zA-Z\d_$.]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"field",symbols:[/[_a-zA-Z$]/,"field$ebnf$1"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0]+e[1].join(""),quoted:!1,location:{start:t,end:t+(e[0]+e[1].join("")).length}}}},{name:"field",symbols:["sqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"single",location:{start:t,end:t+e[0].length+2}}}},{name:"field",symbols:["dqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"double",location:{start:t,end:t+e[0].length+2}}}},{name:"expression",symbols:["decimal"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"LiteralExpression",quoted:!1,value:Number(e.join(""))}}}},{name:"expression",symbols:["regex"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"RegexExpression",value:e.join("")}}}},{name:"expression",symbols:["range"],postprocess:function(e){return e[0]}},{name:"expression",symbols:["unquoted_value"],postprocess:function(e,t,n){var r=e.join("");if(e[0]==="AND"||e[0]==="OR"||e[0]==="NOT")return n;var i;return r==="true"?i=!0:r==="false"?i=!1:r==="null"?i=null:i=r,{type:"Tag",expression:{location:{start:t,end:t+r.length},type:"LiteralExpression",quoted:!1,value:i}}}},{name:"expression",symbols:["sqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"single",value:e.join("")}}}},{name:"expression",symbols:["dqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"double",value:e.join("")}}}},{name:"range$string$1",symbols:[{literal:" "},{literal:"T"},{literal:"O"},{literal:" "}],postprocess:function(e){return e.join("")}},{name:"range",symbols:["range_open","decimal","range$string$1","decimal","range_close"],postprocess:function(e,t){return{location:{start:t},type:"Tag",expression:{location:{start:e[0].location.start,end:e[4].location.start+1},type:"RangeExpression",range:{min:e[1],minInclusive:e[0].inclusive,maxInclusive:e[4].inclusive,max:e[3]}}}}},{name:"range_open",symbols:[{literal:"["}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_open",symbols:[{literal:"{"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"range_close",symbols:[{literal:"]"}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_close",symbols:[{literal:"}"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"comparison_operator$subexpression$1",symbols:[{literal:":"}]},{name:"comparison_operator$subexpression$1$string$1",symbols:[{literal:":"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$1"]},{name:"comparison_operator$subexpression$1$string$2",symbols:[{literal:":"},{literal:">"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$2"]},{name:"comparison_operator$subexpression$1$string$3",symbols:[{literal:":"},{literal:"<"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$3"]},{name:"comparison_operator$subexpression$1$string$4",symbols:[{literal:":"},{literal:">"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$4"]},{name:"comparison_operator$subexpression$1$string$5",symbols:[{literal:":"},{literal:"<"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$5"]},{name:"comparison_operator",symbols:["comparison_operator$subexpression$1"],postprocess:function(e,t){return{location:{start:t,end:t+e[0][0].length},type:"ComparisonOperator",operator:e[0][0]}}},{name:"regex",symbols:["regex_body","regex_flags"],postprocess:function(e){return e.join("")}},{name:"regex_body$ebnf$1",symbols:[]},{name:"regex_body$ebnf$1",symbols:["regex_body$ebnf$1","regex_body_char"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_body",symbols:[{literal:"/"},"regex_body$ebnf$1",{literal:"/"}],postprocess:function(e){return"/"+e[1].join("")+"/"}},{name:"regex_body_char",symbols:[/[^\\]/],postprocess:gl},{name:"regex_body_char",symbols:[{literal:"\\"},/[^\\]/],postprocess:function(e){return"\\"+e[1]}},{name:"regex_flags",symbols:[]},{name:"regex_flags$ebnf$1",symbols:[/[gmiyusd]/]},{name:"regex_flags$ebnf$1",symbols:["regex_flags$ebnf$1",/[gmiyusd]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_flags",symbols:["regex_flags$ebnf$1"],postprocess:function(e){return e[0].join("")}},{name:"unquoted_value$ebnf$1",symbols:[]},{name:"unquoted_value$ebnf$1",symbols:["unquoted_value$ebnf$1",/[a-zA-Z\.\-_*@#$]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"unquoted_value",symbols:[/[a-zA-Z_*@#$]/,"unquoted_value$ebnf$1"],postprocess:function(e){return e[0]+e[1].join("")}}],ParserStart:"main"};f4.default=_0e;var pU={},K2={},Ty={};Object.defineProperty(Ty,"__esModule",{value:!0});Ty.isSafePath=void 0;var S0e=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,x0e=function(e){return S0e.test(e)};Ty.isSafePath=x0e;Object.defineProperty(K2,"__esModule",{value:!0});K2.createGetValueFunctionBody=void 0;var w0e=Ty,C0e=function(e){if(!(0,w0e.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};K2.createGetValueFunctionBody=C0e;(function(e){var t=yt&&yt.__assign||function(){return t=Object.assign||function(o){for(var a,s=1,l=arguments.length;s<l;s++){a=arguments[s];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])}return o},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var n=K2,r=Ty,i=function(o){var a=t({},o);return o.type==="Tag"&&o.field.type==="Field"&&"field"in o&&(0,r.isSafePath)(o.field.name)&&(a.getValue=new Function("subject",(0,n.createGetValueFunctionBody)(o.field.name))),"left"in o&&(a.left=(0,e.hydrateAst)(o.left)),"right"in o&&(a.right=(0,e.hydrateAst)(o.right)),"operand"in o&&(a.operand=(0,e.hydrateAst)(o.operand)),a};e.hydrateAst=i})(pU);var gU=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(W2,"__esModule",{value:!0});W2.parse=void 0;var mU=gU(l0e),A0e=Bd,E0e=gU(f4),T0e=pU,k0e=mU.default.Grammar.fromCompiled(E0e.default),P0e=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,I0e=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new mU.default.Parser(k0e),n;try{n=t.feed(e).results}catch(o){if(typeof(o==null?void 0:o.message)=="string"&&typeof(o==null?void 0:o.offset)=="number"){var r=o.message.match(P0e);throw r?new A0e.SyntaxError("Syntax error at line ".concat(r.groups.line," column ").concat(r.groups.column),o.offset,Number(r.groups.line),Number(r.groups.column)):o}throw o}if(n.length===0)throw new Error("Found no parsings.");if(n.length>1)throw new Error("Ambiguous results.");var i=(0,T0e.hydrateAst)(n[0]);return i};W2.parse=I0e;var Q2={};Object.defineProperty(Q2,"__esModule",{value:!0});Q2.test=void 0;var R0e=Ay,O0e=function(e,t){return(0,R0e.filter)(e,[t]).length===1};Q2.test=O0e;var yU={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=function(o,a){return a==="double"?'"'.concat(o,'"'):a==="single"?"'".concat(o,"'"):o},n=function(o){if(o.type==="LiteralExpression")return o.quoted&&typeof o.value=="string"?t(o.value,o.quotes):String(o.value);if(o.type==="RegexExpression")return String(o.value);if(o.type==="RangeExpression"){var a=o.range,s=a.min,l=a.max,u=a.minInclusive,c=a.maxInclusive;return"".concat(u?"[":"{").concat(s," TO ").concat(l).concat(c?"]":"}")}if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")},r=function(o){if(o.type!=="Tag")throw new Error("Expected a tag expression.");var a=o.field,s=o.expression,l=o.operator;if(a.type==="ImplicitField")return n(s);var u=a.quoted?t(a.name,a.quotes):a.name,c=" ".repeat(s.location.start-l.location.end);return u+l.operator+c+n(s)},i=function(o){if(o.type==="ParenthesizedExpression"){if(!("location"in o.expression))throw new Error("Expected location in expression.");if(!o.location.end)throw new Error("Expected location end.");var a=" ".repeat(o.expression.location.start-(o.location.start+1)),s=" ".repeat(o.location.end-o.expression.location.end-1);return"(".concat(a).concat((0,e.serialize)(o.expression)).concat(s,")")}if(o.type==="Tag")return r(o);if(o.type==="LogicalExpression"){var l="";return o.operator.type==="BooleanOperator"?(l+=" ".repeat(o.operator.location.start-o.left.location.end),l+=o.operator.operator,l+=" ".repeat(o.right.location.start-o.operator.location.end)):l=" ".repeat(o.right.location.start-o.left.location.end),"".concat((0,e.serialize)(o.left)).concat(l).concat((0,e.serialize)(o.right))}if(o.type==="UnaryOperator")return(o.operator==="NOT"?"NOT ":o.operator)+(0,e.serialize)(o.operand);if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")};e.serialize=i})(yU);var X2={};Object.defineProperty(X2,"__esModule",{value:!0});X2.isSafeUnquotedExpression=void 0;var M0e=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};X2.isSafeUnquotedExpression=M0e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isSafeUnquotedExpression=e.serialize=e.SyntaxError=e.LiqeError=e.test=e.parse=e.highlight=e.filter=void 0;var t=Ay;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=H2;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=W2;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=Q2;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=Bd;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var a=yU;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return a.serialize}});var s=X2;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return s.isSafeUnquotedExpression}})})(lU);var ky={},vU={},zd={};Object.defineProperty(zd,"__esModule",{value:!0});zd.ROARR_LOG_FORMAT_VERSION=zd.ROARR_VERSION=void 0;zd.ROARR_VERSION="5.0.0";zd.ROARR_LOG_FORMAT_VERSION="2.0.0";var Py={};Object.defineProperty(Py,"__esModule",{value:!0});Py.logLevels=void 0;Py.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var bU={},Y2={};Object.defineProperty(Y2,"__esModule",{value:!0});Y2.hasOwnProperty=void 0;const $0e=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Y2.hasOwnProperty=$0e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=Y2;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(bU);var _U={},Z2={},J2={};Object.defineProperty(J2,"__esModule",{value:!0});J2.tokenize=void 0;const N0e=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,D0e=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=N0e.exec(e))!==null;){t.index>i&&(o={literal:e.slice(i,t.index),type:"literal"},n.push(o));const a=t[0];i=t.index+a.length,a==="\\%"||a==="%%"?o&&o.type==="literal"?o.literal+="%":(o={literal:"%",type:"literal"},n.push(o)):t.groups&&(o={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:a,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:r++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},n.push(o))}return i<=e.length-1&&(o&&o.type==="literal"?o.literal+=e.slice(i):n.push({literal:e.slice(i),type:"literal"})),n};J2.tokenize=D0e;Object.defineProperty(Z2,"__esModule",{value:!0});Z2.createPrintf=void 0;const r9=u4,L0e=J2,F0e=(e,t)=>t.placeholder,B0e=e=>{var t;const n=(o,a,s)=>s==="-"?o.padEnd(a," "):s==="-+"?((Number(o)>=0?"+":"")+o).padEnd(a," "):s==="+"?((Number(o)>=0?"+":"")+o).padStart(a," "):s==="0"?o.padStart(a,"0"):o.padStart(a," "),r=(t=e==null?void 0:e.formatUnboundExpression)!==null&&t!==void 0?t:F0e,i={};return(o,...a)=>{let s=i[o];s||(s=i[o]=L0e.tokenize(o));let l="";for(const u of s)if(u.type==="literal")l+=u.literal;else{let c=a[u.position];if(c===void 0)l+=r(o,u,a);else if(u.conversion==="b")l+=r9.boolean(c)?"true":"false";else if(u.conversion==="B")l+=r9.boolean(c)?"TRUE":"FALSE";else if(u.conversion==="c")l+=c;else if(u.conversion==="C")l+=String(c).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")c=String(Math.trunc(c)),u.width!==null&&(c=n(c,u.width,u.flag)),l+=c;else if(u.conversion==="e")l+=Number(c).toExponential();else if(u.conversion==="E")l+=Number(c).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(c=Number(c).toFixed(u.precision)),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="o")l+=(Number.parseInt(String(c),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="S")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=String(c).toUpperCase();else if(u.conversion==="u")l+=Number.parseInt(String(c),10)>>>0;else if(u.conversion==="x")c=(Number.parseInt(String(c),10)>>>0).toString(16),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else throw new Error("Unknown format specifier.")}return l}};Z2.createPrintf=B0e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=Z2;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(_U);var NA={exports:{}};(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,t.stringify=r,t.configure=_,e.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function o(b){return b.length<5e3&&!i.test(b)?`"${b}"`:JSON.stringify(b)}function a(b){if(b.length>200)return b.sort();for(let y=1;y<b.length;y++){const g=b[y];let v=y;for(;v!==0&&b[v-1]>g;)b[v]=b[v-1],v--;b[v]=g}return b}const s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(b){return s.call(b)!==void 0&&b.length!==0}function u(b,y,g){b.length<g&&(g=b.length);const v=y===","?"":" ";let S=`"0":${v}${b[0]}`;for(let w=1;w<g;w++)S+=`${y}"${w}":${v}${b[w]}`;return S}function c(b){if(n.call(b,"circularValue")){const y=b.circularValue;if(typeof y=="string")return`"${y}"`;if(y==null)return y;if(y===Error||y===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(b,y){let g;if(n.call(b,y)&&(g=b[y],typeof g!="boolean"))throw new TypeError(`The "${y}" argument must be of type boolean`);return g===void 0?!0:g}function f(b,y){let g;if(n.call(b,y)){if(g=b[y],typeof g!="number")throw new TypeError(`The "${y}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${y}" argument must be an integer`);if(g<1)throw new RangeError(`The "${y}" argument must be >= 1`)}return g===void 0?1/0:g}function h(b){return b===1?"1 item":`${b} items`}function p(b){const y=new Set;for(const g of b)(typeof g=="string"||typeof g=="number")&&y.add(String(g));return y}function m(b){if(n.call(b,"strict")){const y=b.strict;if(typeof y!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(y)return g=>{let v=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(v+=` (${g.toString()})`),new Error(v)}}}function _(b){b={...b};const y=m(b);y&&(b.bigint===void 0&&(b.bigint=!1),"circularValue"in b||(b.circularValue=Error));const g=c(b),v=d(b,"bigint"),S=d(b,"deterministic"),w=f(b,"maximumDepth"),x=f(b,"maximumBreadth");function C(O,A,k,D,L,M){let R=A[O];switch(typeof R=="object"&&R!==null&&typeof R.toJSON=="function"&&(R=R.toJSON(O)),R=D.call(A,O,R),typeof R){case"string":return o(R);case"object":{if(R===null)return"null";if(k.indexOf(R)!==-1)return g;let $="",B=",";const U=M;if(Array.isArray(R)){if(R.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(R),L!==""&&(M+=L,$+=`
+${M}`,B=`,
+${M}`);const Q=Math.min(R.length,x);let ne=0;for(;ne<Q-1;ne++){const be=C(String(ne),R,k,D,L,M);$+=be!==void 0?be:"null",$+=B}const se=C(String(ne),R,k,D,L,M);if($+=se!==void 0?se:"null",R.length-1>x){const be=R.length-x-1;$+=`${B}"... ${h(be)} not stringified"`}return L!==""&&($+=`
+${U}`),k.pop(),`[${$}]`}let G=Object.keys(R);const Y=G.length;if(Y===0)return"{}";if(w<k.length+1)return'"[Object]"';let ee="",J="";L!==""&&(M+=L,B=`,
+${M}`,ee=" ");const j=Math.min(Y,x);S&&!l(R)&&(G=a(G)),k.push(R);for(let Q=0;Q<j;Q++){const ne=G[Q],se=C(ne,R,k,D,L,M);se!==void 0&&($+=`${J}${o(ne)}:${ee}${se}`,J=B)}if(Y>x){const Q=Y-x;$+=`${J}"...":${ee}"${h(Q)} not stringified"`,J=B}return L!==""&&J.length>1&&($=`
+${M}${$}
+${U}`),k.pop(),`{${$}}`}case"number":return isFinite(R)?String(R):y?y(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(R);default:return y?y(R):void 0}}function T(O,A,k,D,L,M){switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(O)),typeof A){case"string":return o(A);case"object":{if(A===null)return"null";if(k.indexOf(A)!==-1)return g;const R=M;let $="",B=",";if(Array.isArray(A)){if(A.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(A),L!==""&&(M+=L,$+=`
+${M}`,B=`,
+${M}`);const Y=Math.min(A.length,x);let ee=0;for(;ee<Y-1;ee++){const j=T(String(ee),A[ee],k,D,L,M);$+=j!==void 0?j:"null",$+=B}const J=T(String(ee),A[ee],k,D,L,M);if($+=J!==void 0?J:"null",A.length-1>x){const j=A.length-x-1;$+=`${B}"... ${h(j)} not stringified"`}return L!==""&&($+=`
+${R}`),k.pop(),`[${$}]`}k.push(A);let U="";L!==""&&(M+=L,B=`,
+${M}`,U=" ");let G="";for(const Y of D){const ee=T(Y,A[Y],k,D,L,M);ee!==void 0&&($+=`${G}${o(Y)}:${U}${ee}`,G=B)}return L!==""&&G.length>1&&($=`
+${M}${$}
+${R}`),k.pop(),`{${$}}`}case"number":return isFinite(A)?String(A):y?y(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(A);default:return y?y(A):void 0}}function E(O,A,k,D,L){switch(typeof A){case"string":return o(A);case"object":{if(A===null)return"null";if(typeof A.toJSON=="function"){if(A=A.toJSON(O),typeof A!="object")return E(O,A,k,D,L);if(A===null)return"null"}if(k.indexOf(A)!==-1)return g;const M=L;if(Array.isArray(A)){if(A.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(A),L+=D;let ee=`
+${L}`;const J=`,
+${L}`,j=Math.min(A.length,x);let Q=0;for(;Q<j-1;Q++){const se=E(String(Q),A[Q],k,D,L);ee+=se!==void 0?se:"null",ee+=J}const ne=E(String(Q),A[Q],k,D,L);if(ee+=ne!==void 0?ne:"null",A.length-1>x){const se=A.length-x-1;ee+=`${J}"... ${h(se)} not stringified"`}return ee+=`
+${M}`,k.pop(),`[${ee}]`}let R=Object.keys(A);const $=R.length;if($===0)return"{}";if(w<k.length+1)return'"[Object]"';L+=D;const B=`,
+${L}`;let U="",G="",Y=Math.min($,x);l(A)&&(U+=u(A,B,x),R=R.slice(A.length),Y-=A.length,G=B),S&&(R=a(R)),k.push(A);for(let ee=0;ee<Y;ee++){const J=R[ee],j=E(J,A[J],k,D,L);j!==void 0&&(U+=`${G}${o(J)}: ${j}`,G=B)}if($>x){const ee=$-x;U+=`${G}"...": "${h(ee)} not stringified"`,G=B}return G!==""&&(U=`
+${L}${U}
+${M}`),k.pop(),`{${U}}`}case"number":return isFinite(A)?String(A):y?y(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(A);default:return y?y(A):void 0}}function P(O,A,k){switch(typeof A){case"string":return o(A);case"object":{if(A===null)return"null";if(typeof A.toJSON=="function"){if(A=A.toJSON(O),typeof A!="object")return P(O,A,k);if(A===null)return"null"}if(k.indexOf(A)!==-1)return g;let D="";if(Array.isArray(A)){if(A.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(A);const B=Math.min(A.length,x);let U=0;for(;U<B-1;U++){const Y=P(String(U),A[U],k);D+=Y!==void 0?Y:"null",D+=","}const G=P(String(U),A[U],k);if(D+=G!==void 0?G:"null",A.length-1>x){const Y=A.length-x-1;D+=`,"... ${h(Y)} not stringified"`}return k.pop(),`[${D}]`}let L=Object.keys(A);const M=L.length;if(M===0)return"{}";if(w<k.length+1)return'"[Object]"';let R="",$=Math.min(M,x);l(A)&&(D+=u(A,",",x),L=L.slice(A.length),$-=A.length,R=","),S&&(L=a(L)),k.push(A);for(let B=0;B<$;B++){const U=L[B],G=P(U,A[U],k);G!==void 0&&(D+=`${R}${o(U)}:${G}`,R=",")}if(M>x){const B=M-x;D+=`${R}"...":"${h(B)} not stringified"`}return k.pop(),`{${D}}`}case"number":return isFinite(A)?String(A):y?y(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(A);default:return y?y(A):void 0}}function N(O,A,k){if(arguments.length>1){let D="";if(typeof k=="number"?D=" ".repeat(Math.min(k,10)):typeof k=="string"&&(D=k.slice(0,10)),A!=null){if(typeof A=="function")return C("",{"":O},[],A,D,"");if(Array.isArray(A))return T("",O,[],p(A),D,"")}if(D.length!==0)return E("",O,[],D,"")}return P("",O,[])}return N}})(NA,NA.exports);var z0e=NA.exports;(function(e){var t=yt&&yt.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=zd,r=Py,i=bU,o=_U,a=t(c4),s=t(z0e);let l=!1;const u=(0,a.default)(),c=()=>u.ROARR,d=()=>({messageContext:{},transforms:[]}),f=()=>{const g=c().asyncLocalStorage;if(!g)throw new Error("AsyncLocalContext is unavailable.");const v=g.getStore();return v||d()},h=()=>!!c().asyncLocalStorage,p=()=>{if(h()){const g=f();return(0,i.hasOwnProperty)(g,"sequenceRoot")&&(0,i.hasOwnProperty)(g,"sequence")&&typeof g.sequence=="number"?String(g.sequenceRoot)+"."+String(g.sequence++):String(c().sequence++)}return String(c().sequence++)},m=(g,v)=>(S,w,x,C,T,E,P,N,O,A)=>{g.child({logLevel:v})(S,w,x,C,T,E,P,N,O,A)},_=1e3,b=(g,v)=>(S,w,x,C,T,E,P,N,O,A)=>{const k=(0,s.default)({a:S,b:w,c:x,d:C,e:T,f:E,g:P,h:N,i:O,j:A,logLevel:v});if(!k)throw new Error("Expected key to be a string");const D=c().onceLog;D.has(k)||(D.add(k),D.size>_&&D.clear(),g.child({logLevel:v})(S,w,x,C,T,E,P,N,O,A))},y=(g,v={},S=[])=>{const w=(x,C,T,E,P,N,O,A,k,D)=>{const L=Date.now(),M=p();let R;h()?R=f():R=d();let $,B;if(typeof x=="string"?$={...R.messageContext,...v}:$={...R.messageContext,...v,...x},typeof x=="string"&&C===void 0)B=x;else if(typeof x=="string"){if(!x.includes("%"))throw new Error("When a string parameter is followed by other arguments, then it is assumed that you are attempting to format a message using printf syntax. You either forgot to add printf bindings or if you meant to add context to the log message, pass them in an object as the first parameter.");B=(0,o.printf)(x,C,T,E,P,N,O,A,k,D)}else{let G=C;if(typeof C!="string")if(C===void 0)G="";else throw new TypeError("Message must be a string. Received "+typeof C+".");B=(0,o.printf)(G,T,E,P,N,O,A,k,D)}let U={context:$,message:B,sequence:M,time:L,version:n.ROARR_LOG_FORMAT_VERSION};for(const G of[...R.transforms,...S])if(U=G(U),typeof U!="object"||U===null)throw new Error("Message transform function must return a message object.");g(U)};return w.child=x=>{let C;return h()?C=f():C=d(),typeof x=="function"?(0,e.createLogger)(g,{...C.messageContext,...v,...x},[x,...S]):(0,e.createLogger)(g,{...C.messageContext,...v,...x},S)},w.getContext=()=>{let x;return h()?x=f():x=d(),{...x.messageContext,...v}},w.adopt=async(x,C)=>{if(!h())return l===!1&&(l=!0,g({context:{logLevel:r.logLevels.warn,package:"roarr"},message:"async_hooks are unavailable; Roarr.adopt will not function as expected",sequence:p(),time:Date.now(),version:n.ROARR_LOG_FORMAT_VERSION})),x();const T=f();let E;(0,i.hasOwnProperty)(T,"sequenceRoot")&&(0,i.hasOwnProperty)(T,"sequence")&&typeof T.sequence=="number"?E=T.sequenceRoot+"."+String(T.sequence++):E=String(c().sequence++);let P={...T.messageContext};const N=[...T.transforms];typeof C=="function"?N.push(C):P={...P,...C};const O=c().asyncLocalStorage;if(!O)throw new Error("Async local context unavailable.");return O.run({messageContext:P,sequence:0,sequenceRoot:E,transforms:N},()=>x())},w.debug=m(w,r.logLevels.debug),w.debugOnce=b(w,r.logLevels.debug),w.error=m(w,r.logLevels.error),w.errorOnce=b(w,r.logLevels.error),w.fatal=m(w,r.logLevels.fatal),w.fatalOnce=b(w,r.logLevels.fatal),w.info=m(w,r.logLevels.info),w.infoOnce=b(w,r.logLevels.info),w.trace=m(w,r.logLevels.trace),w.traceOnce=b(w,r.logLevels.trace),w.warn=m(w,r.logLevels.warn),w.warnOnce=b(w,r.logLevels.warn),w};e.createLogger=y})(vU);var ex={},j0e=function(t,n){for(var r=t.split("."),i=n.split("."),o=0;o<3;o++){var a=Number(r[o]),s=Number(i[o]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0},U0e=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ex,"__esModule",{value:!0});ex.createRoarrInitialGlobalStateBrowser=void 0;const i9=zd,o9=U0e(j0e),V0e=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(o9.default),t.includes(i9.ROARR_VERSION)||t.push(i9.ROARR_VERSION),t.sort(o9.default),{sequence:0,...e,versions:t}};ex.createRoarrInitialGlobalStateBrowser=V0e;var tx={};Object.defineProperty(tx,"__esModule",{value:!0});tx.getLogLevelName=void 0;const G0e=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";tx.getLogLevelName=G0e;(function(e){var t=yt&&yt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLogLevelName=e.logLevels=e.Roarr=e.ROARR=void 0;const n=vU,r=ex,o=(0,t(c4).default)(),a=(0,r.createRoarrInitialGlobalStateBrowser)(o.ROARR||{});e.ROARR=a,o.ROARR=a;const s=d=>JSON.stringify(d),l=(0,n.createLogger)(d=>{var f;a.write&&a.write(((f=a.serializeMessage)!==null&&f!==void 0?f:s)(d))});e.Roarr=l;var u=Py;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return u.logLevels}});var c=tx;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return c.getLogLevelName}})})(ky);var q0e=yt&&yt.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},H0e=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(L2,"__esModule",{value:!0});L2.createLogWriter=void 0;var W0e=F2,K0e=u4,Q0e=H0e(c4),SU=lU,X0e=ky,a9=(0,Q0e.default)(),Y0e={debug:{backgroundColor:"#712bde",color:"#fff"},error:{backgroundColor:"#f05033",color:"#fff"},fatal:{backgroundColor:"#f05033",color:"#fff"},info:{backgroundColor:"#3174f1",color:"#fff"},trace:{backgroundColor:"#666",color:"#fff"},warn:{backgroundColor:"#f5a623",color:"#000"}},Z0e={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},J0e=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,SU.parse)(t):null},eye=function(e){var t,n;e===void 0&&(e={});var r=(t=e==null?void 0:e.storage)!==null&&t!==void 0?t:a9.localStorage,i=(n=e==null?void 0:e.logMethods)!==null&&n!==void 0?n:(0,W0e.createLogMethods)();if(!r&&!a9.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,K0e.boolean)(r.getItem("ROARR_LOG")))return function(){};var o=J0e(r);return function(a){var s=JSON.parse(a),l=s.context,u=l.logLevel,c=l.namespace,d=q0e(l,["logLevel","namespace"]);if(!(o&&!(0,SU.test)(o,s))){var f=(0,X0e.getLogLevelName)(Number(u)),h=i[f],p=Y0e[f],m=`
+      background-color: `.concat(p.backgroundColor,`;
+      color: `).concat(p.color,`;
+      font-weight: bold;
+    `),_=`
+      color: `.concat(Z0e[f].color,`;
+    `),b=`
+      color: inherit;
+    `;Object.keys(d).length>0?h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(s.message," %O"),m,_,b,d):h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(s.message),m,_,b)}}};L2.createLogWriter=eye;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=L2;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(Xj);ky.ROARR.write=Xj.createLogWriter();const xU={};ky.Roarr.child(xU);const nx=sl(ky.Roarr.child(xU)),_e=e=>nx.get().child({namespace:e}),bqe=["trace","debug","info","warn","error","fatal"],_qe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Xt=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return"Error parsing object"}},tye=async e=>{const t={},n=await e.arrayBuffer(),r=Wge(n).text,i=gh(r,"invokeai_metadata");if(i){const a=oj.safeParse(JSON.parse(i));a.success?t.metadata=a.data:_e("system").error({error:Xt(a.error)},"Problem reading metadata from image")}const o=gh(r,"invokeai_workflow");if(o){const a=cj.safeParse(JSON.parse(o));a.success?t.workflow=a.data:_e("system").error({error:Xt(a.error)},"Problem reading workflow from image")}return t},Se=ps.injectEndpoints({endpoints:e=>({listImages:e.query({query:t=>({url:jo(t),method:"GET"}),providesTags:(t,n,{board_id:r,categories:i})=>[{type:"ImageList",id:jo({board_id:r,categories:i})}],serializeQueryArgs:({queryArgs:t})=>{const{board_id:n,categories:r}=t;return jo({board_id:n,categories:r})},transformResponse(t){const{items:n}=t;return Vn.addMany(Vn.getInitialState(),n)},merge:(t,n)=>{Vn.addMany(t,s0.selectAll(n))},forceRefetch({currentArg:t,previousArg:n}){return(t==null?void 0:t.offset)!==(n==null?void 0:n.offset)},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;s0.selectAll(i).forEach(o=>{n(Se.util.upsertQueryData("getImageDTO",o.image_name,o))})}catch{}},keepUnusedDataFor:86400}),getIntermediatesCount:e.query({query:()=>({url:jo({is_intermediate:!0})}),providesTags:["IntermediatesCount"],transformResponse:t=>t.total}),getImageDTO:e.query({query:t=>({url:`images/i/${t}`}),providesTags:(t,n,r)=>[{type:"Image",id:r}],keepUnusedDataFor:86400}),getImageMetadata:e.query({query:t=>({url:`images/i/${t}/metadata`}),providesTags:(t,n,r)=>[{type:"ImageMetadata",id:r}],keepUnusedDataFor:86400}),getImageMetadataFromFile:e.query({queryFn:async(t,n,r,i)=>{var o;if(t.shouldFetchMetadataFromApi){let a;const s=await i(`images/i/${t.image.image_name}/metadata`);if(s.data){const l=oj.safeParse((o=s.data)==null?void 0:o.metadata);l.success&&(a=l.data)}return{data:{metadata:a}}}else{const a=ep.get(),s=a0.get(),u=await Lde.fetchBaseQuery({baseUrl:"",prepareHeaders:d=>(a&&d.set("Authorization",`Bearer ${a}`),s&&d.set("project-id",s),d),responseHandler:async d=>await d.blob()})(t.image.image_url,n,r);return{data:await tye(u.data)}}},providesTags:(t,n,{image:r})=>[{type:"ImageMetadataFromFile",id:r.image_name}],keepUnusedDataFor:86400}),clearIntermediates:e.mutation({query:()=>({url:"images/clear-intermediates",method:"POST"}),invalidatesTags:["IntermediatesCount"]}),deleteImage:e.mutation({query:({image_name:t})=>({url:`images/i/${t}`,method:"DELETE"}),async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){const{image_name:i,board_id:o}=t,a=to.includes(t.image_category),s={board_id:o??"none",categories:da(t)},l=[];l.push(n(Se.util.updateQueryData("listImages",s,u=>{Vn.removeOne(u,i)}))),l.push(n(Lt.util.updateQueryData(a?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));try{await r}catch{l.forEach(u=>{u.undo()})}}}),deleteImages:e.mutation({query:({imageDTOs:t})=>({url:"images/delete",method:"POST",body:{image_names:t.map(r=>r.image_name)}}),async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,o=Ek(t,"image_name");i.deleted_images.forEach(a=>{const s=o[a];if(s){const l={board_id:s.board_id??"none",categories:da(s)};n(Se.util.updateQueryData("listImages",l,c=>{Vn.removeOne(c,a)}));const u=to.includes(s.image_category);n(Lt.util.updateQueryData(u?"getBoardAssetsTotal":"getBoardImagesTotal",s.board_id??"none",c=>{c.total=Math.max(c.total-1,0)}))}})}catch{}}}),changeImageIsIntermediate:e.mutation({query:({imageDTO:t,is_intermediate:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{is_intermediate:n}}),async onQueryStarted({imageDTO:t,is_intermediate:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[];a.push(r(Se.util.updateQueryData("getImageDTO",t.image_name,u=>{Object.assign(u,{is_intermediate:n})})));const s=da(t),l=to.includes(t.image_category);if(n)a.push(r(Se.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:s},u=>{Vn.removeOne(u,t.image_name)}))),a.push(r(Lt.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));else{a.push(r(Lt.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",p=>{p.total+=1})));const u={board_id:t.board_id??"none",categories:s},c=Se.endpoints.listImages.select(u)(o()),{data:d}=ii.includes(t.image_category)?Lt.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):Lt.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=Fc(c.data,t);(f||h)&&a.push(r(Se.util.updateQueryData("listImages",u,p=>{Vn.upsertOne(p,t)})))}try{await i}catch{a.forEach(u=>u.undo())}}}),changeImageSessionId:e.mutation({query:({imageDTO:t,session_id:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{session_id:n}}),async onQueryStarted({imageDTO:t,session_id:n},{dispatch:r,queryFulfilled:i}){const o=[];o.push(r(Se.util.updateQueryData("getImageDTO",t.image_name,a=>{Object.assign(a,{session_id:n})})));try{await i}catch{o.forEach(a=>a.undo())}}}),starImages:e.mutation({query:({imageDTOs:t})=>({url:"images/star",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=da(r[0]),o=r[0].board_id;return[{type:"ImageList",id:jo({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=da(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(Se.util.updateQueryData("getImageDTO",c,_=>{_.starred=!0}));const d={board_id:l??"none",categories:s},f=Se.endpoints.listImages.select(d)(i()),{data:h}=ii.includes(u.image_category)?Lt.endpoints.getBoardImagesTotal.select(l??"none")(i()):Lt.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=Av?Fc(f.data,u):!0;(p||m)&&n(Se.util.updateQueryData("listImages",d,_=>{Vn.upsertOne(_,{...u,starred:!0})}))})}catch{}}}),unstarImages:e.mutation({query:({imageDTOs:t})=>({url:"images/unstar",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=da(r[0]),o=r[0].board_id;return[{type:"ImageList",id:jo({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=da(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(Se.util.updateQueryData("getImageDTO",c,_=>{_.starred=!1}));const d={board_id:l??"none",categories:s},f=Se.endpoints.listImages.select(d)(i()),{data:h}=ii.includes(u.image_category)?Lt.endpoints.getBoardImagesTotal.select(l??"none")(i()):Lt.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=Av?Fc(f.data,u):!0;(p||m)&&n(Se.util.updateQueryData("listImages",d,_=>{Vn.upsertOne(_,{...u,starred:!1})}))})}catch{}}}),uploadImage:e.mutation({query:({file:t,image_category:n,is_intermediate:r,session_id:i,board_id:o,crop_visible:a})=>{const s=new FormData;return s.append("file",t),{url:"images/upload",method:"POST",body:s,params:{image_category:n,is_intermediate:r,session_id:i,board_id:o==="none"?void 0:o,crop_visible:a}}},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;if(i.is_intermediate)return;n(Se.util.upsertQueryData("getImageDTO",i.image_name,i));const o=da(i);n(Se.util.updateQueryData("listImages",{board_id:i.board_id??"none",categories:o},a=>{Vn.addOne(a,i)})),n(Lt.util.updateQueryData("getBoardAssetsTotal",i.board_id??"none",a=>{a.total+=1}))}catch{}}}),deleteBoard:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"Board",id:no},{type:"ImageList",id:jo({board_id:"none",categories:ii})},{type:"ImageList",id:jo({board_id:"none",categories:to})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_board_images:o}=i;o.forEach(l=>{n(Se.util.updateQueryData("getImageDTO",l,u=>{u.board_id=void 0}))}),n(Lt.util.updateQueryData("getBoardAssetsTotal",t,l=>{l.total=0})),n(Lt.util.updateQueryData("getBoardImagesTotal",t,l=>{l.total=0}));const a=[{categories:ii},{categories:to}],s=o.map(l=>({id:l,changes:{board_id:void 0}}));a.forEach(l=>{n(Se.util.updateQueryData("listImages",l,u=>{Vn.updateMany(u,s)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:()=>[{type:"Board",id:no},{type:"ImageList",id:jo({board_id:"none",categories:ii})},{type:"ImageList",id:jo({board_id:"none",categories:to})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_images:o}=i;[{categories:ii},{categories:to}].forEach(s=>{n(Se.util.updateQueryData("listImages",s,l=>{Vn.removeMany(l,o)}))}),n(Lt.util.updateQueryData("getBoardAssetsTotal",t,s=>{s.total=0})),n(Lt.util.updateQueryData("getBoardImagesTotal",t,s=>{s.total=0}))}catch{}}}),addImageToBoard:e.mutation({query:({board_id:t,imageDTO:n})=>{const{image_name:r}=n;return{url:"board_images/",method:"POST",body:{board_id:t,image_name:r}}},invalidatesTags:(t,n,{board_id:r})=>[{type:"Board",id:r}],async onQueryStarted({board_id:t,imageDTO:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[],s=da(n),l=to.includes(n.image_category);if(a.push(r(Se.util.updateQueryData("getImageDTO",n.image_name,u=>{u.board_id=t}))),!n.is_intermediate){a.push(r(Se.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:s},p=>{Vn.removeOne(p,n.image_name)}))),a.push(r(Lt.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",n.board_id??"none",p=>{p.total=Math.max(p.total-1,0)}))),a.push(r(Lt.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",p=>{p.total+=1})));const u={board_id:t??"none",categories:s},c=Se.endpoints.listImages.select(u)(o()),{data:d}=ii.includes(n.image_category)?Lt.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):Lt.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=Fc(c.data,n);(f||h)&&a.push(r(Se.util.updateQueryData("listImages",u,p=>{Vn.addOne(p,n)})))}try{await i}catch{a.forEach(u=>u.undo())}}}),removeImageFromBoard:e.mutation({query:({imageDTO:t})=>{const{image_name:n}=t;return{url:"board_images/",method:"DELETE",body:{image_name:n}}},invalidatesTags:(t,n,{imageDTO:r})=>{const{board_id:i}=r;return[{type:"Board",id:i??"none"}]},async onQueryStarted({imageDTO:t},{dispatch:n,queryFulfilled:r,getState:i}){const o=da(t),a=[],s=to.includes(t.image_category);a.push(n(Se.util.updateQueryData("getImageDTO",t.image_name,h=>{h.board_id=void 0}))),a.push(n(Se.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},h=>{Vn.removeOne(h,t.image_name)}))),a.push(n(Lt.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",h=>{h.total=Math.max(h.total-1,0)}))),a.push(n(Lt.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal","none",h=>{h.total+=1})));const l={board_id:"none",categories:o},u=Se.endpoints.listImages.select(l)(i()),{data:c}=ii.includes(t.image_category)?Lt.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):Lt.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),d=u.data&&u.data.ids.length>=((c==null?void 0:c.total)??0),f=Fc(u.data,t);(d||f)&&a.push(n(Se.util.updateQueryData("listImages",l,h=>{Vn.upsertOne(h,t)})));try{await r}catch{a.forEach(h=>h.undo())}}}),addImagesToBoard:e.mutation({query:({board_id:t,imageDTOs:n})=>({url:"board_images/batch",method:"POST",body:{image_names:n.map(r=>r.image_name),board_id:t}}),invalidatesTags:(t,n,{board_id:r})=>[{type:"Board",id:r??"none"}],async onQueryStarted({board_id:t,imageDTOs:n},{dispatch:r,queryFulfilled:i,getState:o}){try{const{data:a}=await i,{added_image_names:s}=a;s.forEach(l=>{r(Se.util.updateQueryData("getImageDTO",l,y=>{y.board_id=t==="none"?void 0:t}));const u=n.find(y=>y.image_name===l);if(!u)return;const c=da(u),d=u.board_id,f=to.includes(u.image_category);r(Se.util.updateQueryData("listImages",{board_id:d??"none",categories:c},y=>{Vn.removeOne(y,u.image_name)})),r(Lt.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",d??"none",y=>{y.total=Math.max(y.total-1,0)})),r(Lt.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",y=>{y.total+=1}));const h={board_id:t,categories:c},p=Se.endpoints.listImages.select(h)(o()),{data:m}=ii.includes(u.image_category)?Lt.endpoints.getBoardImagesTotal.select(t??"none")(o()):Lt.endpoints.getBoardAssetsTotal.select(t??"none")(o()),_=p.data&&p.data.ids.length>=((m==null?void 0:m.total)??0),b=((m==null?void 0:m.total)??0)>=Av?Fc(p.data,u):!0;(_||b)&&r(Se.util.updateQueryData("listImages",h,y=>{Vn.upsertOne(y,{...u,board_id:t})}))})}catch{}}}),removeImagesFromBoard:e.mutation({query:({imageDTOs:t})=>({url:"board_images/batch/delete",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{const i=[],o=[];return t==null||t.removed_image_names.forEach(a=>{var l;const s=(l=r.find(u=>u.image_name===a))==null?void 0:l.board_id;!s||i.includes(s)||o.push({type:"Board",id:s})}),o},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{removed_image_names:a}=o;a.forEach(s=>{n(Se.util.updateQueryData("getImageDTO",s,_=>{_.board_id=void 0}));const l=t.find(_=>_.image_name===s);if(!l)return;const u=da(l),c=to.includes(l.image_category);n(Se.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:u},_=>{Vn.removeOne(_,l.image_name)})),n(Lt.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal",l.board_id??"none",_=>{_.total=Math.max(_.total-1,0)})),n(Lt.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal","none",_=>{_.total+=1}));const d={board_id:"none",categories:u},f=Se.endpoints.listImages.select(d)(i()),{data:h}=ii.includes(l.image_category)?Lt.endpoints.getBoardImagesTotal.select(l.board_id??"none")(i()):Lt.endpoints.getBoardAssetsTotal.select(l.board_id??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=Av?Fc(f.data,l):!0;(p||m)&&n(Se.util.updateQueryData("listImages",d,_=>{Vn.upsertOne(_,{...l,board_id:"none"})}))})}catch{}}}),bulkDownloadImages:e.mutation({query:({image_names:t,board_id:n})=>({url:"images/download",method:"POST",body:{image_names:t,board_id:n}})})})}),{useGetIntermediatesCountQuery:Sqe,useListImagesQuery:xqe,useLazyListImagesQuery:wqe,useGetImageDTOQuery:Cqe,useGetImageMetadataQuery:Aqe,useDeleteImageMutation:Eqe,useDeleteImagesMutation:Tqe,useUploadImageMutation:kqe,useClearIntermediatesMutation:Pqe,useAddImagesToBoardMutation:Iqe,useRemoveImagesFromBoardMutation:Rqe,useAddImageToBoardMutation:Oqe,useRemoveImageFromBoardMutation:Mqe,useChangeImageIsIntermediateMutation:$qe,useChangeImageSessionIdMutation:Nqe,useDeleteBoardAndImagesMutation:Dqe,useDeleteBoardMutation:Lqe,useStarImagesMutation:Fqe,useUnstarImagesMutation:Bqe,useGetImageMetadataFromFileQuery:zqe,useBulkDownloadImagesMutation:jqe}=Se,wU={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",boardSearchText:""},CU=nr({name:"gallery",initialState:wU,reducers:{imageSelected:(e,t)=>{e.selection=t.payload?[t.payload]:[]},selectionChanged:(e,t)=>{e.selection=hA(t.payload,n=>n.image_name)},shouldAutoSwitchChanged:(e,t)=>{e.shouldAutoSwitch=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},autoAssignBoardOnClickChanged:(e,t)=>{e.autoAssignBoardOnClick=t.payload},boardIdSelected:(e,t)=>{e.selectedBoardId=t.payload.boardId,e.galleryView="images"},autoAddBoardIdChanged:(e,t)=>{if(!t.payload){e.autoAddBoardId="none";return}e.autoAddBoardId=t.payload},galleryViewChanged:(e,t)=>{e.galleryView=t.payload},boardSearchTextChanged:(e,t)=>{e.boardSearchText=t.payload}},extraReducers:e=>{e.addMatcher(rye,(t,n)=>{const r=n.meta.arg.originalArgs;r===t.selectedBoardId&&(t.selectedBoardId="none",t.galleryView="images"),r===t.autoAddBoardId&&(t.autoAddBoardId="none")}),e.addMatcher(Lt.endpoints.listAllBoards.matchFulfilled,(t,n)=>{const r=n.payload;t.autoAddBoardId&&(r.map(i=>i.board_id).includes(t.autoAddBoardId)||(t.autoAddBoardId="none"))})}}),{imageSelected:Qs,shouldAutoSwitchChanged:Uqe,autoAssignBoardOnClickChanged:Vqe,setGalleryImageMinimumWidth:Gqe,boardIdSelected:$_,autoAddBoardIdChanged:qqe,galleryViewChanged:DA,selectionChanged:AU,boardSearchTextChanged:Hqe}=CU.actions,nye=CU.reducer,rye=Qi(Se.endpoints.deleteBoard.matchFulfilled,Se.endpoints.deleteBoardAndImages.matchFulfilled),s9={weight:.75},iye={loras:{}},EU=nr({name:"lora",initialState:iye,reducers:{loraAdded:(e,t)=>{const{model_name:n,id:r,base_model:i}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,...s9}},loraRecalled:(e,t)=>{const{model_name:n,id:r,base_model:i,weight:o}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,weight:o}},loraRemoved:(e,t)=>{const n=t.payload;delete e.loras[n]},lorasCleared:e=>{e.loras={}},loraWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload,i=e.loras[n];i&&(i.weight=r)},loraWeightReset:(e,t)=>{const n=t.payload,r=e.loras[n];r&&(r.weight=s9.weight)}}}),{loraAdded:Wqe,loraRemoved:TU,loraWeightChanged:Kqe,loraWeightReset:Qqe,lorasCleared:Xqe,loraRecalled:Yqe}=EU.actions,oye=EU.reducer;function Ma(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ma(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const l9=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,s),s},aye=e=>e?l9(e):l9,{useSyncExternalStoreWithSelector:sye}=Cce;function kU(e,t=e.getState,n){const r=sye(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return I.useDebugValue(r),r}const u9=(e,t)=>{const n=aye(e),r=(i,o=t)=>kU(n,i,o);return Object.assign(r,n),r},lye=(e,t)=>e?u9(e,t):u9;function No(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var uye={value:()=>{}};function rx(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Q1(n)}function Q1(e){this._=e}function cye(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Q1.prototype=rx.prototype={constructor:Q1,on:function(e,t){var n=this._,r=cye(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=dye(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=c9(n[i],e.name,t);else if(t==null)for(i in n)n[i]=c9(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Q1(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function dye(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function c9(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=uye,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var LA="http://www.w3.org/1999/xhtml";const d9={svg:"http://www.w3.org/2000/svg",xhtml:LA,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ix(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),d9.hasOwnProperty(t)?{space:d9[t],local:e}:e}function fye(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===LA&&t.documentElement.namespaceURI===LA?t.createElement(e):t.createElementNS(n,e)}}function hye(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function PU(e){var t=ix(e);return(t.local?hye:fye)(t)}function pye(){}function h4(e){return e==null?pye:function(){return this.querySelector(e)}}function gye(e){typeof e!="function"&&(e=h4(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new ra(r,this._parents)}function mye(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yye(){return[]}function IU(e){return e==null?yye:function(){return this.querySelectorAll(e)}}function vye(e){return function(){return mye(e.apply(this,arguments))}}function bye(e){typeof e=="function"?e=vye(e):e=IU(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new ra(r,i)}function RU(e){return function(){return this.matches(e)}}function OU(e){return function(t){return t.matches(e)}}var _ye=Array.prototype.find;function Sye(e){return function(){return _ye.call(this.children,e)}}function xye(){return this.firstElementChild}function wye(e){return this.select(e==null?xye:Sye(typeof e=="function"?e:OU(e)))}var Cye=Array.prototype.filter;function Aye(){return Array.from(this.children)}function Eye(e){return function(){return Cye.call(this.children,e)}}function Tye(e){return this.selectAll(e==null?Aye:Eye(typeof e=="function"?e:OU(e)))}function kye(e){typeof e!="function"&&(e=RU(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new ra(r,this._parents)}function MU(e){return new Array(e.length)}function Pye(){return new ra(this._enter||this._groups.map(MU),this._parents)}function N_(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}N_.prototype={constructor:N_,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Iye(e){return function(){return e}}function Rye(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new N_(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function Oye(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,d=o.length,f=new Array(c),h;for(s=0;s<c;++s)(l=t[s])&&(f[s]=h=a.call(l,l.__data__,s,t)+"",u.has(h)?i[s]=l:u.set(h,l));for(s=0;s<d;++s)h=a.call(e,o[s],s,o)+"",(l=u.get(h))?(r[s]=l,l.__data__=o[s],u.delete(h)):n[s]=new N_(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function Mye(e){return e.__data__}function $ye(e,t){if(!arguments.length)return Array.from(this,Mye);var n=t?Oye:Rye,r=this._parents,i=this._groups;typeof e!="function"&&(e=Iye(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],d=i[u],f=d.length,h=Nye(e.call(c,c&&c.__data__,u,r)),p=h.length,m=s[u]=new Array(p),_=a[u]=new Array(p),b=l[u]=new Array(f);n(c,d,m,_,b,h,t);for(var y=0,g=0,v,S;y<p;++y)if(v=m[y]){for(y>=g&&(g=y+1);!(S=_[g])&&++g<p;);v._next=S||null}}return a=new ra(a,r),a._enter=s,a._exit=l,a}function Nye(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Dye(){return new ra(this._exit||this._groups.map(MU),this._parents)}function Lye(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Fye(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],d=u.length,f=s[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<i;++l)s[l]=n[l];return new ra(s,this._parents)}function Bye(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function zye(e){e||(e=jye);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new ra(i,this._parents).order()}function jye(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Uye(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Vye(){return Array.from(this)}function Gye(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function qye(){let e=0;for(const t of this)++e;return e}function Hye(){return!this.node()}function Wye(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function Kye(e){return function(){this.removeAttribute(e)}}function Qye(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xye(e,t){return function(){this.setAttribute(e,t)}}function Yye(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Zye(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Jye(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function eve(e,t){var n=ix(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Qye:Kye:typeof t=="function"?n.local?Jye:Zye:n.local?Yye:Xye)(n,t))}function $U(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function tve(e){return function(){this.style.removeProperty(e)}}function nve(e,t,n){return function(){this.style.setProperty(e,t,n)}}function rve(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ive(e,t,n){return arguments.length>1?this.each((t==null?tve:typeof t=="function"?rve:nve)(e,t,n??"")):ap(this.node(),e)}function ap(e,t){return e.style.getPropertyValue(t)||$U(e).getComputedStyle(e,null).getPropertyValue(t)}function ove(e){return function(){delete this[e]}}function ave(e,t){return function(){this[e]=t}}function sve(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function lve(e,t){return arguments.length>1?this.each((t==null?ove:typeof t=="function"?sve:ave)(e,t)):this.node()[e]}function NU(e){return e.trim().split(/^|\s+/)}function p4(e){return e.classList||new DU(e)}function DU(e){this._node=e,this._names=NU(e.getAttribute("class")||"")}DU.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function LU(e,t){for(var n=p4(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function FU(e,t){for(var n=p4(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function uve(e){return function(){LU(this,e)}}function cve(e){return function(){FU(this,e)}}function dve(e,t){return function(){(t.apply(this,arguments)?LU:FU)(this,e)}}function fve(e,t){var n=NU(e+"");if(arguments.length<2){for(var r=p4(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?dve:t?uve:cve)(n,t))}function hve(){this.textContent=""}function pve(e){return function(){this.textContent=e}}function gve(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function mve(e){return arguments.length?this.each(e==null?hve:(typeof e=="function"?gve:pve)(e)):this.node().textContent}function yve(){this.innerHTML=""}function vve(e){return function(){this.innerHTML=e}}function bve(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _ve(e){return arguments.length?this.each(e==null?yve:(typeof e=="function"?bve:vve)(e)):this.node().innerHTML}function Sve(){this.nextSibling&&this.parentNode.appendChild(this)}function xve(){return this.each(Sve)}function wve(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cve(){return this.each(wve)}function Ave(e){var t=typeof e=="function"?e:PU(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Eve(){return null}function Tve(e,t){var n=typeof e=="function"?e:PU(e),r=t==null?Eve:typeof t=="function"?t:h4(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function kve(){var e=this.parentNode;e&&e.removeChild(this)}function Pve(){return this.each(kve)}function Ive(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rve(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ove(e){return this.select(e?Rve:Ive)}function Mve(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $ve(e){return function(t){e.call(this,t,this.__data__)}}function Nve(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Dve(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function Lve(e,t,n){return function(){var r=this.__on,i,o=$ve(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Fve(e,t,n){var r=Nve(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?Lve:Dve,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function BU(e,t,n){var r=$U(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Bve(e,t){return function(){return BU(this,e,t)}}function zve(e,t){return function(){return BU(this,e,t.apply(this,arguments))}}function jve(e,t){return this.each((typeof t=="function"?zve:Bve)(e,t))}function*Uve(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var zU=[null];function ra(e,t){this._groups=e,this._parents=t}function Iy(){return new ra([[document.documentElement]],zU)}function Vve(){return this}ra.prototype=Iy.prototype={constructor:ra,select:gye,selectAll:bye,selectChild:wye,selectChildren:Tye,filter:kye,data:$ye,enter:Pye,exit:Dye,join:Lye,merge:Fye,selection:Vve,order:Bye,sort:zye,call:Uye,nodes:Vye,node:Gye,size:qye,empty:Hye,each:Wye,attr:eve,style:ive,property:lve,classed:fve,text:mve,html:_ve,raise:xve,lower:Cve,append:Ave,insert:Tve,remove:Pve,clone:Ove,datum:Mve,on:Fve,dispatch:jve,[Symbol.iterator]:Uve};function Ja(e){return typeof e=="string"?new ra([[document.querySelector(e)]],[document.documentElement]):new ra([[e]],zU)}function Gve(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ps(e,t){if(e=Gve(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const qve={passive:!1},b0={capture:!0,passive:!1};function HC(e){e.stopImmediatePropagation()}function Sh(e){e.preventDefault(),e.stopImmediatePropagation()}function jU(e){var t=e.document.documentElement,n=Ja(e).on("dragstart.drag",Sh,b0);"onselectstart"in t?n.on("selectstart.drag",Sh,b0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function UU(e,t){var n=e.document.documentElement,r=Ja(e).on("dragstart.drag",null);t&&(r.on("click.drag",Sh,b0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Fv=e=>()=>e;function FA(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}FA.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Hve(e){return!e.ctrlKey&&!e.button}function Wve(){return this.parentNode}function Kve(e,t){return t??{x:e.x,y:e.y}}function Qve(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xve(){var e=Hve,t=Wve,n=Kve,r=Qve,i={},o=rx("start","drag","end"),a=0,s,l,u,c,d=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",_).on("touchmove.drag",b,qve).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,S){if(!(c||!e.call(this,v,S))){var w=g(this,t.call(this,v,S),v,S,"mouse");w&&(Ja(v.view).on("mousemove.drag",p,b0).on("mouseup.drag",m,b0),jU(v.view),HC(v),u=!1,s=v.clientX,l=v.clientY,w("start",v))}}function p(v){if(Sh(v),!u){var S=v.clientX-s,w=v.clientY-l;u=S*S+w*w>d}i.mouse("drag",v)}function m(v){Ja(v.view).on("mousemove.drag mouseup.drag",null),UU(v.view,u),Sh(v),i.mouse("end",v)}function _(v,S){if(e.call(this,v,S)){var w=v.changedTouches,x=t.call(this,v,S),C=w.length,T,E;for(T=0;T<C;++T)(E=g(this,x,v,S,w[T].identifier,w[T]))&&(HC(v),E("start",v,w[T]))}}function b(v){var S=v.changedTouches,w=S.length,x,C;for(x=0;x<w;++x)(C=i[S[x].identifier])&&(Sh(v),C("drag",v,S[x]))}function y(v){var S=v.changedTouches,w=S.length,x,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),x=0;x<w;++x)(C=i[S[x].identifier])&&(HC(v),C("end",v,S[x]))}function g(v,S,w,x,C,T){var E=o.copy(),P=Ps(T||w,S),N,O,A;if((A=n.call(v,new FA("beforestart",{sourceEvent:w,target:f,identifier:C,active:a,x:P[0],y:P[1],dx:0,dy:0,dispatch:E}),x))!=null)return N=A.x-P[0]||0,O=A.y-P[1]||0,function k(D,L,M){var R=P,$;switch(D){case"start":i[C]=k,$=a++;break;case"end":delete i[C],--a;case"drag":P=Ps(M||L,S),$=a;break}E.call(D,v,new FA(D,{sourceEvent:L,subject:A,target:f,identifier:C,active:$,x:P[0]+N,y:P[1]+O,dx:P[0]-R[0],dy:P[1]-R[1],dispatch:E}),x)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Fv(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:Fv(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:Fv(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Fv(!!v),f):r},f.on=function(){var v=o.on.apply(o,arguments);return v===o?f:v},f.clickDistance=function(v){return arguments.length?(d=(v=+v)*v,f):Math.sqrt(d)},f}function g4(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function VU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ry(){}var _0=.7,D_=1/_0,xh="\\s*([+-]?\\d+)\\s*",S0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yve=/^#([0-9a-f]{3,8})$/,Zve=new RegExp(`^rgb\\(${xh},${xh},${xh}\\)$`),Jve=new RegExp(`^rgb\\(${Xs},${Xs},${Xs}\\)$`),e1e=new RegExp(`^rgba\\(${xh},${xh},${xh},${S0}\\)$`),t1e=new RegExp(`^rgba\\(${Xs},${Xs},${Xs},${S0}\\)$`),n1e=new RegExp(`^hsl\\(${S0},${Xs},${Xs}\\)$`),r1e=new RegExp(`^hsla\\(${S0},${Xs},${Xs},${S0}\\)$`),f9={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};g4(Ry,x0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:h9,formatHex:h9,formatHex8:i1e,formatHsl:o1e,formatRgb:p9,toString:p9});function h9(){return this.rgb().formatHex()}function i1e(){return this.rgb().formatHex8()}function o1e(){return GU(this).formatHsl()}function p9(){return this.rgb().formatRgb()}function x0(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Yve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?g9(t):n===3?new ko(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Zve.exec(e))?new ko(t[1],t[2],t[3],1):(t=Jve.exec(e))?new ko(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=e1e.exec(e))?Bv(t[1],t[2],t[3],t[4]):(t=t1e.exec(e))?Bv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=n1e.exec(e))?v9(t[1],t[2]/100,t[3]/100,1):(t=r1e.exec(e))?v9(t[1],t[2]/100,t[3]/100,t[4]):f9.hasOwnProperty(e)?g9(f9[e]):e==="transparent"?new ko(NaN,NaN,NaN,0):null}function g9(e){return new ko(e>>16&255,e>>8&255,e&255,1)}function Bv(e,t,n,r){return r<=0&&(e=t=n=NaN),new ko(e,t,n,r)}function a1e(e){return e instanceof Ry||(e=x0(e)),e?(e=e.rgb(),new ko(e.r,e.g,e.b,e.opacity)):new ko}function BA(e,t,n,r){return arguments.length===1?a1e(e):new ko(e,t,n,r??1)}function ko(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}g4(ko,BA,VU(Ry,{brighter(e){return e=e==null?D_:Math.pow(D_,e),new ko(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_0:Math.pow(_0,e),new ko(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ko(wd(this.r),wd(this.g),wd(this.b),L_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:m9,formatHex:m9,formatHex8:s1e,formatRgb:y9,toString:y9}));function m9(){return`#${fd(this.r)}${fd(this.g)}${fd(this.b)}`}function s1e(){return`#${fd(this.r)}${fd(this.g)}${fd(this.b)}${fd((isNaN(this.opacity)?1:this.opacity)*255)}`}function y9(){const e=L_(this.opacity);return`${e===1?"rgb(":"rgba("}${wd(this.r)}, ${wd(this.g)}, ${wd(this.b)}${e===1?")":`, ${e})`}`}function L_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fd(e){return e=wd(e),(e<16?"0":"")+e.toString(16)}function v9(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new es(e,t,n,r)}function GU(e){if(e instanceof es)return new es(e.h,e.s,e.l,e.opacity);if(e instanceof Ry||(e=x0(e)),!e)return new es;if(e instanceof es)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new es(a,s,l,e.opacity)}function l1e(e,t,n,r){return arguments.length===1?GU(e):new es(e,t,n,r??1)}function es(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}g4(es,l1e,VU(Ry,{brighter(e){return e=e==null?D_:Math.pow(D_,e),new es(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_0:Math.pow(_0,e),new es(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ko(WC(e>=240?e-240:e+120,i,r),WC(e,i,r),WC(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new es(b9(this.h),zv(this.s),zv(this.l),L_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=L_(this.opacity);return`${e===1?"hsl(":"hsla("}${b9(this.h)}, ${zv(this.s)*100}%, ${zv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function b9(e){return e=(e||0)%360,e<0?e+360:e}function zv(e){return Math.max(0,Math.min(1,e||0))}function WC(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const qU=e=>()=>e;function u1e(e,t){return function(n){return e+n*t}}function c1e(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function d1e(e){return(e=+e)==1?HU:function(t,n){return n-t?c1e(t,n,e):qU(isNaN(t)?n:t)}}function HU(e,t){var n=t-e;return n?u1e(e,n):qU(isNaN(e)?t:e)}const _9=function e(t){var n=d1e(t);function r(i,o){var a=n((i=BA(i)).r,(o=BA(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=HU(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function Au(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var zA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,KC=new RegExp(zA.source,"g");function f1e(e){return function(){return e}}function h1e(e){return function(t){return e(t)+""}}function p1e(e,t){var n=zA.lastIndex=KC.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=zA.exec(e))&&(i=KC.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Au(r,i)})),n=KC.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?h1e(l[0].x):f1e(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}var S9=180/Math.PI,jA={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function WU(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*S9,skewX:Math.atan(l)*S9,scaleX:a,scaleY:s}}var jv;function g1e(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jA:WU(t.a,t.b,t.c,t.d,t.e,t.f)}function m1e(e){return e==null||(jv||(jv=document.createElementNS("http://www.w3.org/2000/svg","g")),jv.setAttribute("transform",e),!(e=jv.transform.baseVal.consolidate()))?jA:(e=e.matrix,WU(e.a,e.b,e.c,e.d,e.e,e.f))}function KU(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:Au(u,d)},{i:m-2,x:Au(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function a(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Au(u,c)})):c&&d.push(i(d)+"rotate("+c+r)}function s(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Au(u,c)}):c&&d.push(i(d)+"skewX("+c+r)}function l(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:Au(u,d)},{i:m-2,x:Au(c,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,d,f),a(u.rotate,c.rotate,d,f),s(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var p=-1,m=f.length,_;++p<m;)d[(_=f[p]).i]=_.x(h);return d.join("")}}}var y1e=KU(g1e,"px, ","px)","deg)"),v1e=KU(m1e,", ",")",")"),b1e=1e-12;function x9(e){return((e=Math.exp(e))+1/e)/2}function _1e(e){return((e=Math.exp(e))-1/e)/2}function S1e(e){return((e=Math.exp(2*e))-1)/(e+1)}const x1e=function e(t,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],d=a[1],f=a[2],h=c-s,p=d-l,m=h*h+p*p,_,b;if(m<b1e)b=Math.log(f/u)/t,_=function(x){return[s+x*h,l+x*p,u*Math.exp(t*x*b)]};else{var y=Math.sqrt(m),g=(f*f-u*u+r*m)/(2*u*n*y),v=(f*f-u*u-r*m)/(2*f*n*y),S=Math.log(Math.sqrt(g*g+1)-g),w=Math.log(Math.sqrt(v*v+1)-v);b=(w-S)/t,_=function(x){var C=x*b,T=x9(S),E=u/(n*y)*(T*S1e(t*C+S)-_1e(S));return[s+E*h,l+E*p,u*T/x9(t*C+S)]}}return _.duration=b*1e3*t/Math.SQRT2,_}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var sp=0,kg=0,ng=0,QU=1e3,F_,Pg,B_=0,jd=0,ox=0,w0=typeof performance=="object"&&performance.now?performance:Date,XU=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function m4(){return jd||(XU(w1e),jd=w0.now()+ox)}function w1e(){jd=0}function z_(){this._call=this._time=this._next=null}z_.prototype=YU.prototype={constructor:z_,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?m4():+n)+(t==null?0:+t),!this._next&&Pg!==this&&(Pg?Pg._next=this:F_=this,Pg=this),this._call=e,this._time=n,UA()},stop:function(){this._call&&(this._call=null,this._time=1/0,UA())}};function YU(e,t,n){var r=new z_;return r.restart(e,t,n),r}function C1e(){m4(),++sp;for(var e=F_,t;e;)(t=jd-e._time)>=0&&e._call.call(void 0,t),e=e._next;--sp}function w9(){jd=(B_=w0.now())+ox,sp=kg=0;try{C1e()}finally{sp=0,E1e(),jd=0}}function A1e(){var e=w0.now(),t=e-B_;t>QU&&(ox-=t,B_=e)}function E1e(){for(var e,t=F_,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:F_=n);Pg=e,UA(r)}function UA(e){if(!sp){kg&&(kg=clearTimeout(kg));var t=e-jd;t>24?(e<1/0&&(kg=setTimeout(w9,e-w0.now()-ox)),ng&&(ng=clearInterval(ng))):(ng||(B_=w0.now(),ng=setInterval(A1e,QU)),sp=1,XU(w9))}}function C9(e,t,n){var r=new z_;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var T1e=rx("start","end","cancel","interrupt"),k1e=[],ZU=0,A9=1,VA=2,X1=3,E9=4,GA=5,Y1=6;function ax(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;P1e(e,n,{name:t,index:r,group:i,on:T1e,tween:k1e,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ZU})}function y4(e,t){var n=ys(e,t);if(n.state>ZU)throw new Error("too late; already scheduled");return n}function ll(e,t){var n=ys(e,t);if(n.state>X1)throw new Error("too late; already running");return n}function ys(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P1e(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=YU(o,0,n.time);function o(u){n.state=A9,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,f,h;if(n.state!==A9)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===X1)return C9(a);h.state===E9?(h.state=Y1,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=Y1,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(C9(function(){n.state===X1&&(n.state=E9,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=VA,n.on.call("start",e,e.__data__,n.index,n.group),n.state===VA){for(n.state=X1,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=GA,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===GA&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Y1,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Z1(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>VA&&r.state<GA,r.state=Y1,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function I1e(e){return this.each(function(){Z1(this,e)})}function R1e(e,t){var n,r;return function(){var i=ll(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function O1e(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=ll(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function M1e(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ys(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?R1e:O1e)(n,e,t))}function v4(e,t,n){var r=e._id;return e.each(function(){var i=ll(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ys(i,r).value[t]}}function JU(e,t){var n;return(typeof t=="number"?Au:t instanceof x0?_9:(n=x0(t))?(t=n,_9):p1e)(e,t)}function $1e(e){return function(){this.removeAttribute(e)}}function N1e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function D1e(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function L1e(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function F1e(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function B1e(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function z1e(e,t){var n=ix(e),r=n==="transform"?v1e:JU;return this.attrTween(e,typeof t=="function"?(n.local?B1e:F1e)(n,r,v4(this,"attr."+e,t)):t==null?(n.local?N1e:$1e)(n):(n.local?L1e:D1e)(n,r,t))}function j1e(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function U1e(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function V1e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&U1e(e,o)),n}return i._value=t,i}function G1e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&j1e(e,o)),n}return i._value=t,i}function q1e(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ix(e);return this.tween(n,(r.local?V1e:G1e)(r,t))}function H1e(e,t){return function(){y4(this,e).delay=+t.apply(this,arguments)}}function W1e(e,t){return t=+t,function(){y4(this,e).delay=t}}function K1e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?H1e:W1e)(t,e)):ys(this.node(),t).delay}function Q1e(e,t){return function(){ll(this,e).duration=+t.apply(this,arguments)}}function X1e(e,t){return t=+t,function(){ll(this,e).duration=t}}function Y1e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Q1e:X1e)(t,e)):ys(this.node(),t).duration}function Z1e(e,t){if(typeof t!="function")throw new Error;return function(){ll(this,e).ease=t}}function J1e(e){var t=this._id;return arguments.length?this.each(Z1e(t,e)):ys(this.node(),t).ease}function ebe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ll(this,e).ease=n}}function tbe(e){if(typeof e!="function")throw new Error;return this.each(ebe(this._id,e))}function nbe(e){typeof e!="function"&&(e=RU(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Zl(r,this._parents,this._name,this._id)}function rbe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;s<r;++s)a[s]=t[s];return new Zl(a,this._parents,this._name,this._id)}function ibe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function obe(e,t,n){var r,i,o=ibe(t)?y4:ll;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function abe(e,t){var n=this._id;return arguments.length<2?ys(this.node(),n).on.on(e):this.each(obe(n,e,t))}function sbe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function lbe(){return this.on("end.remove",sbe(this._id))}function ube(e){var t=this._name,n=this._id;typeof e!="function"&&(e=h4(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,d,f=0;f<l;++f)(c=s[f])&&(d=e.call(c,c.__data__,f,s))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,ax(u[f],t,n,f,u,ys(c,n)));return new Zl(o,this._parents,t,n)}function cbe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=IU(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,p=ys(c,n),m=0,_=f.length;m<_;++m)(h=f[m])&&ax(h,t,n,m,f,p);o.push(f),a.push(c)}return new Zl(o,a,t,n)}var dbe=Iy.prototype.constructor;function fbe(){return new dbe(this._groups,this._parents)}function hbe(e,t){var n,r,i;return function(){var o=ap(this,e),a=(this.style.removeProperty(e),ap(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function eV(e){return function(){this.style.removeProperty(e)}}function pbe(e,t,n){var r,i=n+"",o;return function(){var a=ap(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function gbe(e,t,n){var r,i,o;return function(){var a=ap(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),ap(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function mbe(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=ll(this,e),u=l.on,c=l.value[o]==null?s||(s=eV(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function ybe(e,t,n){var r=(e+="")=="transform"?y1e:JU;return t==null?this.styleTween(e,hbe(e,r)).on("end.style."+e,eV(e)):typeof t=="function"?this.styleTween(e,gbe(e,r,v4(this,"style."+e,t))).each(mbe(this._id,e)):this.styleTween(e,pbe(e,r,t),n).on("end.style."+e,null)}function vbe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function bbe(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&vbe(e,a,n)),r}return o._value=t,o}function _be(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,bbe(e,t,n??""))}function Sbe(e){return function(){this.textContent=e}}function xbe(e){return function(){var t=e(this);this.textContent=t??""}}function wbe(e){return this.tween("text",typeof e=="function"?xbe(v4(this,"text",e)):Sbe(e==null?"":e+""))}function Cbe(e){return function(t){this.textContent=e.call(this,t)}}function Abe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cbe(i)),t}return r._value=e,r}function Ebe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Abe(e))}function Tbe(){for(var e=this._name,t=this._id,n=tV(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=ys(l,t);ax(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Zl(r,this._parents,e,n)}function kbe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=ll(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var Pbe=0;function Zl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function tV(){return++Pbe}var ml=Iy.prototype;Zl.prototype={constructor:Zl,select:ube,selectAll:cbe,selectChild:ml.selectChild,selectChildren:ml.selectChildren,filter:nbe,merge:rbe,selection:fbe,transition:Tbe,call:ml.call,nodes:ml.nodes,node:ml.node,size:ml.size,empty:ml.empty,each:ml.each,on:abe,attr:z1e,attrTween:q1e,style:ybe,styleTween:_be,text:wbe,textTween:Ebe,remove:lbe,tween:M1e,delay:K1e,duration:Y1e,ease:J1e,easeVarying:tbe,end:kbe,[Symbol.iterator]:ml[Symbol.iterator]};function Ibe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Rbe={time:null,delay:0,duration:250,ease:Ibe};function Obe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Mbe(e){var t,n;e instanceof Zl?(t=e._id,e=e._name):(t=tV(),(n=Rbe).time=m4(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&ax(l,e,t,u,a,n||Obe(l,t));return new Zl(r,this._parents,e,t)}Iy.prototype.interrupt=I1e;Iy.prototype.transition=Mbe;const Uv=e=>()=>e;function $be(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Nl(e,t,n){this.k=e,this.x=t,this.y=n}Nl.prototype={constructor:Nl,scale:function(e){return e===1?this:new Nl(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Nl(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tc=new Nl(1,0,0);Nl.prototype;function QC(e){e.stopImmediatePropagation()}function rg(e){e.preventDefault(),e.stopImmediatePropagation()}function Nbe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Dbe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function T9(){return this.__zoom||tc}function Lbe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Fbe(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bbe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function zbe(){var e=Nbe,t=Dbe,n=Bbe,r=Lbe,i=Fbe,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=x1e,u=rx("start","zoom","end"),c,d,f,h=500,p=150,m=0,_=10;function b(A){A.property("__zoom",T9).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",E).filter(i).on("touchstart.zoom",P).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(A,k,D,L){var M=A.selection?A.selection():A;M.property("__zoom",T9),A!==M?S(A,k,D,L):M.interrupt().each(function(){w(this,arguments).event(L).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},b.scaleBy=function(A,k,D,L){b.scaleTo(A,function(){var M=this.__zoom.k,R=typeof k=="function"?k.apply(this,arguments):k;return M*R},D,L)},b.scaleTo=function(A,k,D,L){b.transform(A,function(){var M=t.apply(this,arguments),R=this.__zoom,$=D==null?v(M):typeof D=="function"?D.apply(this,arguments):D,B=R.invert($),U=typeof k=="function"?k.apply(this,arguments):k;return n(g(y(R,U),$,B),M,a)},D,L)},b.translateBy=function(A,k,D,L){b.transform(A,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),a)},null,L)},b.translateTo=function(A,k,D,L,M){b.transform(A,function(){var R=t.apply(this,arguments),$=this.__zoom,B=L==null?v(R):typeof L=="function"?L.apply(this,arguments):L;return n(tc.translate(B[0],B[1]).scale($.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof D=="function"?-D.apply(this,arguments):-D),R,a)},L,M)};function y(A,k){return k=Math.max(o[0],Math.min(o[1],k)),k===A.k?A:new Nl(k,A.x,A.y)}function g(A,k,D){var L=k[0]-D[0]*A.k,M=k[1]-D[1]*A.k;return L===A.x&&M===A.y?A:new Nl(A.k,L,M)}function v(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function S(A,k,D,L){A.on("start.zoom",function(){w(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,R=arguments,$=w(M,R).event(L),B=t.apply(M,R),U=D==null?v(B):typeof D=="function"?D.apply(M,R):D,G=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Y=M.__zoom,ee=typeof k=="function"?k.apply(M,R):k,J=l(Y.invert(U).concat(G/Y.k),ee.invert(U).concat(G/ee.k));return function(j){if(j===1)j=ee;else{var Q=J(j),ne=G/Q[2];j=new Nl(ne,U[0]-Q[0]*ne,U[1]-Q[1]*ne)}$.zoom(null,j)}})}function w(A,k,D){return!D&&A.__zooming||new x(A,k)}function x(A,k){this.that=A,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(A,k),this.taps=0}x.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,k){return this.mouse&&A!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var k=Ja(this.that).datum();u.call(A,this.that,new $be(A,{sourceEvent:this.sourceEvent,target:b,type:A,transform:this.that.__zoom,dispatch:u}),k)}};function C(A,...k){if(!e.apply(this,arguments))return;var D=w(this,k).event(A),L=this.__zoom,M=Math.max(o[0],Math.min(o[1],L.k*Math.pow(2,r.apply(this,arguments)))),R=Ps(A);if(D.wheel)(D.mouse[0][0]!==R[0]||D.mouse[0][1]!==R[1])&&(D.mouse[1]=L.invert(D.mouse[0]=R)),clearTimeout(D.wheel);else{if(L.k===M)return;D.mouse=[R,L.invert(R)],Z1(this),D.start()}rg(A),D.wheel=setTimeout($,p),D.zoom("mouse",n(g(y(L,M),D.mouse[0],D.mouse[1]),D.extent,a));function $(){D.wheel=null,D.end()}}function T(A,...k){if(f||!e.apply(this,arguments))return;var D=A.currentTarget,L=w(this,k,!0).event(A),M=Ja(A.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),R=Ps(A,D),$=A.clientX,B=A.clientY;jU(A.view),QC(A),L.mouse=[R,this.__zoom.invert(R)],Z1(this),L.start();function U(Y){if(rg(Y),!L.moved){var ee=Y.clientX-$,J=Y.clientY-B;L.moved=ee*ee+J*J>m}L.event(Y).zoom("mouse",n(g(L.that.__zoom,L.mouse[0]=Ps(Y,D),L.mouse[1]),L.extent,a))}function G(Y){M.on("mousemove.zoom mouseup.zoom",null),UU(Y.view,L.moved),rg(Y),L.event(Y).end()}}function E(A,...k){if(e.apply(this,arguments)){var D=this.__zoom,L=Ps(A.changedTouches?A.changedTouches[0]:A,this),M=D.invert(L),R=D.k*(A.shiftKey?.5:2),$=n(g(y(D,R),L,M),t.apply(this,k),a);rg(A),s>0?Ja(this).transition().duration(s).call(S,$,L,A):Ja(this).call(b.transform,$,L,A)}}function P(A,...k){if(e.apply(this,arguments)){var D=A.touches,L=D.length,M=w(this,k,A.changedTouches.length===L).event(A),R,$,B,U;for(QC(A),$=0;$<L;++$)B=D[$],U=Ps(B,this),U=[U,this.__zoom.invert(U),B.identifier],M.touch0?!M.touch1&&M.touch0[2]!==U[2]&&(M.touch1=U,M.taps=0):(M.touch0=U,R=!0,M.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(M.taps<2&&(d=U[0],c=setTimeout(function(){c=null},h)),Z1(this),M.start())}}function N(A,...k){if(this.__zooming){var D=w(this,k).event(A),L=A.changedTouches,M=L.length,R,$,B,U;for(rg(A),R=0;R<M;++R)$=L[R],B=Ps($,this),D.touch0&&D.touch0[2]===$.identifier?D.touch0[0]=B:D.touch1&&D.touch1[2]===$.identifier&&(D.touch1[0]=B);if($=D.that.__zoom,D.touch1){var G=D.touch0[0],Y=D.touch0[1],ee=D.touch1[0],J=D.touch1[1],j=(j=ee[0]-G[0])*j+(j=ee[1]-G[1])*j,Q=(Q=J[0]-Y[0])*Q+(Q=J[1]-Y[1])*Q;$=y($,Math.sqrt(j/Q)),B=[(G[0]+ee[0])/2,(G[1]+ee[1])/2],U=[(Y[0]+J[0])/2,(Y[1]+J[1])/2]}else if(D.touch0)B=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(g($,B,U),D.extent,a))}}function O(A,...k){if(this.__zooming){var D=w(this,k).event(A),L=A.changedTouches,M=L.length,R,$;for(QC(A),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),R=0;R<M;++R)$=L[R],D.touch0&&D.touch0[2]===$.identifier?delete D.touch0:D.touch1&&D.touch1[2]===$.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&($=Ps($,this),Math.hypot(d[0]-$[0],d[1]-$[1])<_)){var B=Ja(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return b.wheelDelta=function(A){return arguments.length?(r=typeof A=="function"?A:Uv(+A),b):r},b.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Uv(!!A),b):e},b.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Uv(!!A),b):i},b.extent=function(A){return arguments.length?(t=typeof A=="function"?A:Uv([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),b):t},b.scaleExtent=function(A){return arguments.length?(o[0]=+A[0],o[1]=+A[1],b):[o[0],o[1]]},b.translateExtent=function(A){return arguments.length?(a[0][0]=+A[0][0],a[1][0]=+A[1][0],a[0][1]=+A[0][1],a[1][1]=+A[1][1],b):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},b.constrain=function(A){return arguments.length?(n=A,b):n},b.duration=function(A){return arguments.length?(s=+A,b):s},b.interpolate=function(A){return arguments.length?(l=A,b):l},b.on=function(){var A=u.on.apply(u,arguments);return A===u?b:A},b.clickDistance=function(A){return arguments.length?(m=(A=+A)*A,b):Math.sqrt(m)},b.tapDistance=function(A){return arguments.length?(_=+A,b):_},b}const sx=I.createContext(null),jbe=sx.Provider,Jl={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},nV=Jl.error001();function _r(e,t){const n=I.useContext(sx);if(n===null)throw new Error(nV);return kU(n,e,t)}const pi=()=>{const e=I.useContext(sx);if(e===null)throw new Error(nV);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Ube=e=>e.userSelectionActive?"none":"all";function Vbe({position:e,children:t,className:n,style:r,...i}){const o=_r(Ube),a=`${e}`.split("-");return W.jsx("div",{className:Ma(["react-flow__panel",n,...a]),style:{...r,pointerEvents:o},...i,children:t})}function Gbe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:W.jsx(Vbe,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:W.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const qbe=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:a=[2,4],labelBgBorderRadius:s=2,children:l,className:u,...c})=>{const d=I.useRef(null),[f,h]=I.useState({x:0,y:0,width:0,height:0}),p=Ma(["react-flow__edge-textwrapper",u]);return I.useEffect(()=>{if(d.current){const m=d.current.getBBox();h({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),typeof n>"u"||!n?null:W.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c,children:[i&&W.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:s,ry:s}),W.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var Hbe=I.memo(qbe);const b4=e=>({width:e.offsetWidth,height:e.offsetHeight}),lp=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),_4=(e={x:0,y:0},t)=>({x:lp(e.x,t[0][0],t[1][0]),y:lp(e.y,t[0][1],t[1][1])}),k9=(e,t,n)=>e<t?lp(Math.abs(e-t),1,50)/50:e>n?-lp(Math.abs(e-n),1,50)/50:0,rV=(e,t)=>{const n=k9(e.x,35,t.width-35)*20,r=k9(e.y,35,t.height-35)*20;return[n,r]},iV=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},oV=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),C0=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),aV=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),P9=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Zqe=(e,t)=>aV(oV(C0(e),C0(t))),qA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Wbe=e=>Ca(e.width)&&Ca(e.height)&&Ca(e.x)&&Ca(e.y),Ca=e=>!isNaN(e)&&isFinite(e),Xr=Symbol.for("internals"),sV=["Enter"," ","Escape"],Kbe=(e,t)=>{},Qbe=e=>"nativeEvent"in e;function HA(e){var i,o;const t=Qbe(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const lV=e=>"clientX"in e,nc=(e,t)=>{var o,a;const n=lV(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},j_=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Oy=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h=20})=>W.jsxs(W.Fragment,{children:[W.jsx("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&W.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Ca(n)&&Ca(r)?W.jsx(Hbe,{x:n,y:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null]});Oy.displayName="BaseEdge";function ig(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function uV({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,a=Math.abs(r-t)/2,s=r<t?r+a:r-a;return[o,s,i,a]}function cV({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:s}){const l=e*.125+i*.375+a*.375+n*.125,u=t*.125+o*.375+s*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var Ud;(function(e){e.Strict="strict",e.Loose="loose"})(Ud||(Ud={}));var hd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(hd||(hd={}));var pc;(function(e){e.Partial="partial",e.Full="full"})(pc||(pc={}));var Mu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Mu||(Mu={}));var U_;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(U_||(U_={}));var tt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(tt||(tt={}));function I9({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===tt.Left||e===tt.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function dV({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top}){const[a,s]=I9({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=I9({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,d,f,h]=cV({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${s} ${l},${u} ${r},${i}`,c,d,f,h]}const S4=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=tt.Bottom,targetPosition:o=tt.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[_,b,y]=dV({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return W.jsx(Oy,{path:_,labelX:b,labelY:y,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})});S4.displayName="SimpleBezierEdge";const R9={[tt.Left]:{x:-1,y:0},[tt.Right]:{x:1,y:0},[tt.Top]:{x:0,y:-1},[tt.Bottom]:{x:0,y:1}},Xbe=({source:e,sourcePosition:t=tt.Bottom,target:n})=>t===tt.Left||t===tt.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},O9=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Ybe({source:e,sourcePosition:t=tt.Bottom,target:n,targetPosition:r=tt.Top,center:i,offset:o}){const a=R9[t],s=R9[r],l={x:e.x+a.x*o,y:e.y+a.y*o},u={x:n.x+s.x*o,y:n.y+s.y*o},c=Xbe({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],p,m;const _={x:0,y:0},b={x:0,y:0},[y,g,v,S]=uV({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){p=i.x||y,m=i.y||g;const x=[{x:p,y:l.y},{x:p,y:u.y}],C=[{x:l.x,y:m},{x:u.x,y:m}];a[d]===f?h=d==="x"?x:C:h=d==="x"?C:x}else{const x=[{x:l.x,y:u.y}],C=[{x:u.x,y:l.y}];if(d==="x"?h=a.x===f?C:x:h=a.y===f?x:C,t===r){const O=Math.abs(e[d]-n[d]);if(O<=o){const A=Math.min(o-1,o-O);a[d]===f?_[d]=(l[d]>e[d]?-1:1)*A:b[d]=(u[d]>n[d]?-1:1)*A}}if(t!==r){const O=d==="x"?"y":"x",A=a[d]===s[O],k=l[O]>u[O],D=l[O]<u[O];(a[d]===1&&(!A&&k||A&&D)||a[d]!==1&&(!A&&D||A&&k))&&(h=d==="x"?x:C)}const T={x:l.x+_.x,y:l.y+_.y},E={x:u.x+b.x,y:u.y+b.y},P=Math.max(Math.abs(T.x-h[0].x),Math.abs(E.x-h[0].x)),N=Math.max(Math.abs(T.y-h[0].y),Math.abs(E.y-h[0].y));P>=N?(p=(T.x+E.x)/2,m=h[0].y):(p=h[0].x,m=(T.y+E.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...h,{x:u.x+b.x,y:u.y+b.y},n],p,m,v,S]}function Zbe(e,t,n,r){const i=Math.min(O9(e,t)/2,O9(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${o+i*u},${a}Q ${o},${a} ${o},${a+i*c}`}const s=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${a+i*l}Q ${o},${a} ${o+i*s},${a}`}function WA({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top,borderRadius:a=5,centerX:s,centerY:l,offset:u=20}){const[c,d,f,h,p]=Ybe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:s,y:l},offset:u});return[c.reduce((_,b,y)=>{let g="";return y>0&&y<c.length-1?g=Zbe(c[y-1],b,c[y+1],a):g=`${y===0?"M":"L"}${b.x} ${b.y}`,_+=g,_},""),d,f,h,p]}const lx=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=tt.Bottom,targetPosition:f=tt.Top,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[b,y,g]=WA({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset});return W.jsx(Oy,{path:b,labelX:y,labelY:g,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:p,interactionWidth:_})});lx.displayName="SmoothStepEdge";const x4=I.memo(e=>{var t;return W.jsx(lx,{...e,pathOptions:I.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});x4.displayName="StepEdge";function Jbe({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,a,s]=uV({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,s]}const w4=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[p,m,_]=Jbe({sourceX:e,sourceY:t,targetX:n,targetY:r});return W.jsx(Oy,{path:p,labelX:m,labelY:_,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});w4.displayName="StraightEdge";function Vv(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function M9({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case tt.Left:return[t-Vv(t-r,o),n];case tt.Right:return[t+Vv(r-t,o),n];case tt.Top:return[t,n-Vv(n-i,o)];case tt.Bottom:return[t,n+Vv(i-n,o)]}}function fV({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top,curvature:a=.25}){const[s,l]=M9({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,c]=M9({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[d,f,h,p]=cV({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${l} ${u},${c} ${r},${i}`,d,f,h,p]}const V_=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=tt.Bottom,targetPosition:o=tt.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[b,y,g]=fV({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:m==null?void 0:m.curvature});return W.jsx(Oy,{path:b,labelX:y,labelY:g,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:_})});V_.displayName="BezierEdge";const C4=I.createContext(null),e_e=C4.Provider;C4.Consumer;const t_e=()=>I.useContext(C4),n_e=e=>"id"in e&&"source"in e&&"target"in e,hV=e=>"id"in e&&!("source"in e)&&!("target"in e),r_e=(e,t,n)=>{if(!hV(e))return[];const r=n.filter(i=>i.source===e.id).map(i=>i.target);return t.filter(i=>r.includes(i.id))},i_e=(e,t,n)=>{if(!hV(e))return[];const r=n.filter(i=>i.target===e.id).map(i=>i.source);return t.filter(i=>r.includes(i.id))},pV=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,KA=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,o_e=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Ig=(e,t)=>{if(!e.source||!e.target)return t;let n;return n_e(e)?n={...e}:n={...e,id:pV(e)},o_e(n,t)?t:t.concat(n)},a_e=(e,t,n,r={shouldReplaceId:!0})=>{const{id:i,...o}=e;if(!t.source||!t.target||!n.find(l=>l.id===i))return n;const s={...o,id:r.shouldReplaceId?pV(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==i).concat(s)},gV=({x:e,y:t},[n,r,i],o,[a,s])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},s_e=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),wh=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},A4=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:a}=wh(i,t).positionAbsolute;return oV(r,C0({x:o,y:a,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return aV(n)},mV=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1,s=[0,0])=>{const l={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:h=!0,hidden:p=!1}=c;if(a&&!h||p)return!1;const{positionAbsolute:m}=wh(c,s),_={x:m.x,y:m.y,width:d||0,height:f||0},b=qA(l,_),y=typeof d>"u"||typeof f>"u"||d===null||f===null,g=o&&b>0,v=(d||0)*(f||0);(y||g||b>=v||c.dragging)&&u.push(c)}),u},E4=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},yV=(e,t,n,r,i,o=.1)=>{const a=t/(e.width*(1+o)),s=n/(e.height*(1+o)),l=Math.min(a,s),u=lp(l,r,i),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},Kc=(e,t=0)=>e.transition().duration(t);function $9(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var a,s;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((a=e.positionAbsolute)==null?void 0:a.x)??0)+o.x+o.width/2,y:(((s=e.positionAbsolute)==null?void 0:s.y)??0)+o.y+o.height/2}),i},[])}function l_e(e,t,n,r,i,o){const{x:a,y:s}=nc(e),u=t.elementsFromPoint(a,s).find(p=>p.classList.contains("react-flow__handle"));if(u){const p=u.getAttribute("data-nodeid");if(p){const m=T4(void 0,u),_=u.getAttribute("data-handleid"),b=o({nodeId:p,id:_,type:m});if(b)return{handle:{id:_,type:m,nodeId:p,x:n.x,y:n.y},validHandleResult:b}}}let c=[],d=1/0;if(i.forEach(p=>{const m=Math.sqrt((p.x-n.x)**2+(p.y-n.y)**2);if(m<=r){const _=o(p);m<=d&&(m<d?c=[{handle:p,validHandleResult:_}]:m===d&&c.push({handle:p,validHandleResult:_}),d=m)}}),!c.length)return{handle:null,validHandleResult:vV()};if(c.length===1)return c[0];const f=c.some(({validHandleResult:p})=>p.isValid),h=c.some(({handle:p})=>p.type==="target");return c.find(({handle:p,validHandleResult:m})=>h?p.type==="target":f?m.isValid:!0)||c[0]}const u_e={source:null,target:null,sourceHandle:null,targetHandle:null},vV=()=>({handleDomNode:null,isValid:!1,connection:u_e,endHandle:null});function bV(e,t,n,r,i,o,a){const s=i==="target",l=a.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...vV(),handleDomNode:l};if(l){const c=T4(void 0,l),d=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),p=l.classList.contains("connectableend"),m={source:s?d:n,sourceHandle:s?f:r,target:s?n:d,targetHandle:s?r:f};u.connection=m,h&&p&&(t===Ud.Strict?s&&c==="source"||!s&&c==="target":d!==n||f!==r)&&(u.endHandle={nodeId:d,handleId:f,type:c},u.isValid=o(m))}return u}function c_e({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[Xr]){const{handleBounds:a}=o[Xr];let s=[],l=[];a&&(s=$9(o,a,"source",`${t}-${n}-${r}`),l=$9(o,a,"target",`${t}-${n}-${r}`)),i.push(...s,...l)}return i},[])}function T4(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function XC(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function d_e(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function _V({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:a,isValidConnection:s,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=iV(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:p,onConnectStart:m,panBy:_,getNodes:b,cancelConnection:y}=o();let g=0,v;const{x:S,y:w}=nc(e),x=c==null?void 0:c.elementFromPoint(S,w),C=T4(l,x),T=f==null?void 0:f.getBoundingClientRect();if(!T||!C)return;let E,P=nc(e,T),N=!1,O=null,A=!1,k=null;const D=c_e({nodes:b(),nodeId:n,handleId:t,handleType:C}),L=()=>{if(!h)return;const[$,B]=rV(P,T);_({x:$,y:B}),g=requestAnimationFrame(L)};a({connectionPosition:P,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:C,connectionStartHandle:{nodeId:n,handleId:t,type:C},connectionEndHandle:null}),m==null||m(e,{nodeId:n,handleId:t,handleType:C});function M($){const{transform:B}=o();P=nc($,T);const{handle:U,validHandleResult:G}=l_e($,c,gV(P,B,!1,[1,1]),p,D,Y=>bV(Y,d,n,t,i?"target":"source",s,c));if(v=U,N||(L(),N=!0),k=G.handleDomNode,O=G.connection,A=G.isValid,a({connectionPosition:v&&A?s_e({x:v.x,y:v.y},B):P,connectionStatus:d_e(!!v,A),connectionEndHandle:G.endHandle}),!v&&!A&&!k)return XC(E);O.source!==O.target&&k&&(XC(E),E=k,k.classList.add("connecting","react-flow__handle-connecting"),k.classList.toggle("valid",A),k.classList.toggle("react-flow__handle-valid",A))}function R($){var B,U;(v||k)&&O&&A&&(r==null||r(O)),(U=(B=o()).onConnectEnd)==null||U.call(B,$),l&&(u==null||u($)),XC(E),y(),cancelAnimationFrame(g),N=!1,A=!1,O=null,k=null,c.removeEventListener("mousemove",M),c.removeEventListener("mouseup",R),c.removeEventListener("touchmove",M),c.removeEventListener("touchend",R)}c.addEventListener("mousemove",M),c.addEventListener("mouseup",R),c.addEventListener("touchmove",M),c.addEventListener("touchend",R)}const N9=()=>!0,f_e=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),h_e=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:a}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n}},SV=I.forwardRef(({type:e="source",position:t=tt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:s,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var T,E;const p=a||null,m=e==="target",_=pi(),b=t_e(),{connectOnClick:y,noPanClassName:g}=_r(f_e,No),{connecting:v,clickConnecting:S}=_r(h_e(b,p,e),No);b||(E=(T=_.getState()).onError)==null||E.call(T,"010",Jl.error010());const w=P=>{const{defaultEdgeOptions:N,onConnect:O,hasDefaultEdges:A}=_.getState(),k={...N,...P};if(A){const{edges:D,setEdges:L}=_.getState();L(Ig(k,D))}O==null||O(k),s==null||s(k)},x=P=>{if(!b)return;const N=lV(P);i&&(N&&P.button===0||!N)&&_V({event:P,handleId:p,nodeId:b,onConnect:w,isTarget:m,getState:_.getState,setState:_.setState,isValidConnection:n||_.getState().isValidConnection||N9}),N?c==null||c(P):d==null||d(P)},C=P=>{const{onClickConnectStart:N,onClickConnectEnd:O,connectionClickStartHandle:A,connectionMode:k,isValidConnection:D}=_.getState();if(!b||!A&&!i)return;if(!A){N==null||N(P,{nodeId:b,handleId:p,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:p}});return}const L=iV(P.target),M=n||D||N9,{connection:R,isValid:$}=bV({nodeId:b,id:p,type:e},k,A.nodeId,A.handleId||null,A.type,M,L);$&&w(R),O==null||O(P),_.setState({connectionClickStartHandle:null})};return W.jsx("div",{"data-handleid":p,"data-nodeid":b,"data-handlepos":t,"data-id":`${b}-${p}-${e}`,className:Ma(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,connecting:S,connectionindicator:r&&(i&&!v||o&&v)}]),onMouseDown:x,onTouchStart:x,onClick:y?C:void 0,ref:h,...f,children:l})});SV.displayName="Handle";var G_=I.memo(SV);const xV=({data:e,isConnectable:t,targetPosition:n=tt.Top,sourcePosition:r=tt.Bottom})=>W.jsxs(W.Fragment,{children:[W.jsx(G_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,W.jsx(G_,{type:"source",position:r,isConnectable:t})]});xV.displayName="DefaultNode";var QA=I.memo(xV);const wV=({data:e,isConnectable:t,sourcePosition:n=tt.Bottom})=>W.jsxs(W.Fragment,{children:[e==null?void 0:e.label,W.jsx(G_,{type:"source",position:n,isConnectable:t})]});wV.displayName="InputNode";var CV=I.memo(wV);const AV=({data:e,isConnectable:t,targetPosition:n=tt.Top})=>W.jsxs(W.Fragment,{children:[W.jsx(G_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});AV.displayName="OutputNode";var EV=I.memo(AV);const k4=()=>null;k4.displayName="GroupNode";const p_e=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Gv=e=>e.id;function g_e(e,t){return No(e.selectedNodes.map(Gv),t.selectedNodes.map(Gv))&&No(e.selectedEdges.map(Gv),t.selectedEdges.map(Gv))}const TV=I.memo(({onSelectionChange:e})=>{const t=pi(),{selectedNodes:n,selectedEdges:r}=_r(p_e,g_e);return I.useEffect(()=>{var o,a;const i={nodes:n,edges:r};e==null||e(i),(a=(o=t.getState()).onSelectionChange)==null||a.call(o,i)},[n,r,e]),null});TV.displayName="SelectionListener";const m_e=e=>!!e.onSelectionChange;function y_e({onSelectionChange:e}){const t=_r(m_e);return e||t?W.jsx(TV,{onSelectionChange:e}):null}const v_e=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function vf(e,t){I.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ot(e,t,n){I.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const b_e=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:a,onClickConnectStart:s,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:m,maxZoom:_,nodeExtent:b,onNodesChange:y,onEdgesChange:g,elementsSelectable:v,connectionMode:S,snapGrid:w,snapToGrid:x,translateExtent:C,connectOnClick:T,defaultEdgeOptions:E,fitView:P,fitViewOptions:N,onNodesDelete:O,onEdgesDelete:A,onNodeDrag:k,onNodeDragStart:D,onNodeDragStop:L,onSelectionDrag:M,onSelectionDragStart:R,onSelectionDragStop:$,noPanClassName:B,nodeOrigin:U,rfId:G,autoPanOnConnect:Y,autoPanOnNodeDrag:ee,onError:J,connectionRadius:j,isValidConnection:Q})=>{const{setNodes:ne,setEdges:se,setDefaultNodesAndEdges:be,setMinZoom:ce,setMaxZoom:bt,setTranslateExtent:ot,setNodeExtent:ze,reset:mt}=_r(v_e,No),Ie=pi();return I.useEffect(()=>{const en=r==null?void 0:r.map(Ir=>({...Ir,...E}));return be(n,en),()=>{mt()}},[]),Ot("defaultEdgeOptions",E,Ie.setState),Ot("connectionMode",S,Ie.setState),Ot("onConnect",i,Ie.setState),Ot("onConnectStart",o,Ie.setState),Ot("onConnectEnd",a,Ie.setState),Ot("onClickConnectStart",s,Ie.setState),Ot("onClickConnectEnd",l,Ie.setState),Ot("nodesDraggable",u,Ie.setState),Ot("nodesConnectable",c,Ie.setState),Ot("nodesFocusable",d,Ie.setState),Ot("edgesFocusable",f,Ie.setState),Ot("edgesUpdatable",h,Ie.setState),Ot("elementsSelectable",v,Ie.setState),Ot("elevateNodesOnSelect",p,Ie.setState),Ot("snapToGrid",x,Ie.setState),Ot("snapGrid",w,Ie.setState),Ot("onNodesChange",y,Ie.setState),Ot("onEdgesChange",g,Ie.setState),Ot("connectOnClick",T,Ie.setState),Ot("fitViewOnInit",P,Ie.setState),Ot("fitViewOnInitOptions",N,Ie.setState),Ot("onNodesDelete",O,Ie.setState),Ot("onEdgesDelete",A,Ie.setState),Ot("onNodeDrag",k,Ie.setState),Ot("onNodeDragStart",D,Ie.setState),Ot("onNodeDragStop",L,Ie.setState),Ot("onSelectionDrag",M,Ie.setState),Ot("onSelectionDragStart",R,Ie.setState),Ot("onSelectionDragStop",$,Ie.setState),Ot("noPanClassName",B,Ie.setState),Ot("nodeOrigin",U,Ie.setState),Ot("rfId",G,Ie.setState),Ot("autoPanOnConnect",Y,Ie.setState),Ot("autoPanOnNodeDrag",ee,Ie.setState),Ot("onError",J,Ie.setState),Ot("connectionRadius",j,Ie.setState),Ot("isValidConnection",Q,Ie.setState),vf(e,ne),vf(t,se),vf(m,ce),vf(_,bt),vf(C,ot),vf(b,ze),null},D9={display:"none"},__e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},kV="react-flow__node-desc",PV="react-flow__edge-desc",S_e="react-flow__aria-live",x_e=e=>e.ariaLiveMessage;function w_e({rfId:e}){const t=_r(x_e);return W.jsx("div",{id:`${S_e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:__e,children:t})}function C_e({rfId:e,disableKeyboardA11y:t}){return W.jsxs(W.Fragment,{children:[W.jsxs("div",{id:`${kV}-${e}`,style:D9,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),W.jsx("div",{id:`${PV}-${e}`,style:D9,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&W.jsx(w_e,{rfId:e})]})}const A_e=typeof document<"u"?document:null;var A0=(e=null,t={target:A_e})=>{const[n,r]=I.useState(!1),i=I.useRef(!1),o=I.useRef(new Set([])),[a,s]=I.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return I.useEffect(()=>{var l,u;if(e!==null){const c=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,!i.current&&HA(h))return!1;const p=F9(h.code,s);o.current.add(h[p]),L9(a,o.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!i.current&&HA(h))return!1;const p=F9(h.code,s);L9(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[p]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var h,p;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",c),(p=t==null?void 0:t.target)==null||p.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function L9(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function F9(e,t){return t.includes(e)?"code":"key"}function IV(e,t,n,r){var a,s;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=wh(i,r);return IV(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((a=i[Xr])==null?void 0:a.z)??0)>(n.z??0)?((s=i[Xr])==null?void 0:s.z)??0:n.z??0},r)}function RV(e,t,n){e.forEach(r=>{var i;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:o,y:a,z:s}=IV(r,e,{...r.position,z:((i=r[Xr])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:a},r[Xr].z=s,n!=null&&n[r.id]&&(r[Xr].isParent=!0)}})}function YC(e,t,n,r){const i=new Map,o={},a=r?1e3:0;return e.forEach(s=>{var d;const l=(Ca(s.zIndex)?s.zIndex:0)+(s.selected?a:0),u=t.get(s.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...s,positionAbsolute:{x:s.position.x,y:s.position.y}};s.parentNode&&(c.parentNode=s.parentNode,o[s.parentNode]=!0),Object.defineProperty(c,Xr,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[Xr])==null?void 0:d.handleBounds,z:l}}),i.set(s.id,c)}),RV(i,n,o),i}function OV(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:a,d3Zoom:s,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(s&&l&&(f||!t.initial)){const p=n().filter(_=>{var y;const b=t.includeHiddenNodes?_.width&&_.height:!_.hidden;return(y=t.nodes)!=null&&y.length?b&&t.nodes.some(g=>g.id===_.id):b}),m=p.every(_=>_.width&&_.height);if(p.length>0&&m){const _=A4(p,d),[b,y,g]=yV(_,r,i,t.minZoom??o,t.maxZoom??a,t.padding??.1),v=tc.translate(b,y).scale(g);return typeof t.duration=="number"&&t.duration>0?s.transform(Kc(l,t.duration),v):s.transform(l,v),!0}}return!1}function E_e(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Xr]:r[Xr],selected:n.selected})}),new Map(t)}function T_e(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function qv({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:E_e(e,i)}),a==null||a(e)),t!=null&&t.length&&(u&&r({edges:T_e(t,o)}),s==null||s(t))}const bf=()=>{},k_e={zoomIn:bf,zoomOut:bf,zoomTo:bf,getZoom:()=>1,setViewport:bf,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:bf,fitBounds:bf,project:e=>e,viewportInitialized:!1},P_e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),I_e=()=>{const e=pi(),{d3Zoom:t,d3Selection:n}=_r(P_e,No);return I.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Kc(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Kc(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Kc(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[a,s,l]=e.getState().transform,u=tc.translate(i.x??a,i.y??s).scale(i.zoom??l);t.transform(Kc(n,o==null?void 0:o.duration),u)},getViewport:()=>{const[i,o,a]=e.getState().transform;return{x:i,y:o,zoom:a}},fitView:i=>OV(e.getState,i),setCenter:(i,o,a)=>{const{width:s,height:l,maxZoom:u}=e.getState(),c=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:u,d=s/2-i*c,f=l/2-o*c,h=tc.translate(d,f).scale(c);t.transform(Kc(n,a==null?void 0:a.duration),h)},fitBounds:(i,o)=>{const{width:a,height:s,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=yV(i,a,s,l,u,(o==null?void 0:o.padding)??.1),h=tc.translate(c,d).scale(f);t.transform(Kc(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:a,snapGrid:s}=e.getState();return gV(i,o,a,s)},viewportInitialized:!0}:k_e,[t,n])};function MV(){const e=I_e(),t=pi(),n=I.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=I.useCallback(m=>t.getState().nodeInternals.get(m),[]),i=I.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(_=>({..._}))},[]),o=I.useCallback(m=>{const{edges:_=[]}=t.getState();return _.find(b=>b.id===m)},[]),a=I.useCallback(m=>{const{getNodes:_,setNodes:b,hasDefaultNodes:y,onNodesChange:g}=t.getState(),v=_(),S=typeof m=="function"?m(v):m;if(y)b(S);else if(g){const w=S.length===0?v.map(x=>({type:"remove",id:x.id})):S.map(x=>({item:x,type:"reset"}));g(w)}},[]),s=I.useCallback(m=>{const{edges:_=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:g}=t.getState(),v=typeof m=="function"?m(_):m;if(y)b(v);else if(g){const S=v.length===0?_.map(w=>({type:"remove",id:w.id})):v.map(w=>({item:w,type:"reset"}));g(S)}},[]),l=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{getNodes:b,setNodes:y,hasDefaultNodes:g,onNodesChange:v}=t.getState();if(g){const w=[...b(),..._];y(w)}else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),u=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{edges:b=[],setEdges:y,hasDefaultEdges:g,onEdgesChange:v}=t.getState();if(g)y([...b,..._]);else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),c=I.useCallback(()=>{const{getNodes:m,edges:_=[],transform:b}=t.getState(),[y,g,v]=b;return{nodes:m().map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:y,y:g,zoom:v}}},[]),d=I.useCallback(({nodes:m,edges:_})=>{const{nodeInternals:b,getNodes:y,edges:g,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:w,onEdgesDelete:x,onNodesChange:C,onEdgesChange:T}=t.getState(),E=(m||[]).map(k=>k.id),P=(_||[]).map(k=>k.id),N=y().reduce((k,D)=>{const L=!E.includes(D.id)&&D.parentNode&&k.find(R=>R.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(E.includes(D.id)||L)&&k.push(D),k},[]),O=g.filter(k=>typeof k.deletable=="boolean"?k.deletable:!0),A=O.filter(k=>P.includes(k.id));if(N||A){const k=E4(N,O),D=[...A,...k],L=D.reduce((M,R)=>(M.includes(R.id)||M.push(R.id),M),[]);if((S||v)&&(S&&t.setState({edges:g.filter(M=>!L.includes(M.id))}),v&&(N.forEach(M=>{b.delete(M.id)}),t.setState({nodeInternals:new Map(b)}))),L.length>0&&(x==null||x(D),T&&T(L.map(M=>({id:M,type:"remove"})))),N.length>0&&(w==null||w(N),C)){const M=N.map(R=>({id:R.id,type:"remove"}));C(M)}}},[]),f=I.useCallback(m=>{const _=Wbe(m),b=_?null:t.getState().nodeInternals.get(m.id);return[_?m:P9(b),b,_]},[]),h=I.useCallback((m,_=!0,b)=>{const[y,g,v]=f(m);return y?(b||t.getState().getNodes()).filter(S=>{if(!v&&(S.id===g.id||!S.positionAbsolute))return!1;const w=P9(S),x=qA(w,y);return _&&x>0||x>=m.width*m.height}):[]},[]),p=I.useCallback((m,_,b=!0)=>{const[y]=f(m);if(!y)return!1;const g=qA(y,_);return b&&g>0||g>=m.width*m.height},[]);return I.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:a,setEdges:s,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,i,o,a,s,l,u,c,d,h,p])}var R_e=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=pi(),{deleteElements:r}=MV(),i=A0(e),o=A0(t);I.useEffect(()=>{if(i){const{edges:a,getNodes:s}=n.getState(),l=s().filter(c=>c.selected),u=a.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[i]),I.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function O_e(e){const t=pi();I.useEffect(()=>{let n;const r=()=>{var o,a;if(!e.current)return;const i=b4(e.current);(i.height===0||i.width===0)&&((a=(o=t.getState()).onError)==null||a.call(o,"004",Jl.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const P4={position:"absolute",width:"100%",height:"100%",top:0,left:0},M_e=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Hv=e=>({x:e.x,y:e.y,zoom:e.k}),_f=(e,t)=>e.target.closest(`.${t}`),B9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),z9=e=>{const t=e.ctrlKey&&j_()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},$_e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),N_e=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=hd.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:m,zoomActivationKeyCode:_,preventScrolling:b=!0,children:y,noWheelClassName:g,noPanClassName:v})=>{const S=I.useRef(),w=pi(),x=I.useRef(!1),C=I.useRef(!1),T=I.useRef(null),E=I.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:N,d3ZoomHandler:O,userSelectionActive:A}=_r($_e,No),k=A0(_),D=I.useRef(0),L=I.useRef(!1),M=I.useRef();return O_e(T),I.useEffect(()=>{if(T.current){const R=T.current.getBoundingClientRect(),$=zbe().scaleExtent([p,m]).translateExtent(h),B=Ja(T.current).call($),U=tc.translate(f.x,f.y).scale(lp(f.zoom,p,m)),G=[[0,0],[R.width,R.height]],Y=$.constrain()(U,G,h);$.transform(B,Y),$.wheelDelta(z9),w.setState({d3Zoom:$,d3Selection:B,d3ZoomHandler:B.on("wheel.zoom"),transform:[Y.x,Y.y,Y.k],domNode:T.current.closest(".react-flow")})}},[]),I.useEffect(()=>{N&&P&&(a&&!k&&!A?N.on("wheel.zoom",R=>{if(_f(R,g))return!1;R.preventDefault(),R.stopImmediatePropagation();const $=N.property("__zoom").k||1,B=j_();if(R.ctrlKey&&o&&B){const ne=Ps(R),se=z9(R),be=$*Math.pow(2,se);P.scaleTo(N,be,ne,R);return}const U=R.deltaMode===1?20:1;let G=l===hd.Vertical?0:R.deltaX*U,Y=l===hd.Horizontal?0:R.deltaY*U;!B&&R.shiftKey&&l!==hd.Vertical&&(G=R.deltaY*U,Y=0),P.translateBy(N,-(G/$)*s,-(Y/$)*s,{internal:!0});const ee=Hv(N.property("__zoom")),{onViewportChangeStart:J,onViewportChange:j,onViewportChangeEnd:Q}=w.getState();clearTimeout(M.current),L.current||(L.current=!0,t==null||t(R,ee),J==null||J(ee)),L.current&&(e==null||e(R,ee),j==null||j(ee),M.current=setTimeout(()=>{n==null||n(R,ee),Q==null||Q(ee),L.current=!1},150))},{passive:!1}):typeof O<"u"&&N.on("wheel.zoom",function(R,$){if(!b||_f(R,g))return null;R.preventDefault(),O.call(this,R,$)},{passive:!1}))},[A,a,l,N,P,O,k,o,b,g,t,e,n]),I.useEffect(()=>{P&&P.on("start",R=>{var U,G;if(!R.sourceEvent||R.sourceEvent.internal)return null;D.current=(U=R.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:$}=w.getState(),B=Hv(R.transform);x.current=!0,E.current=B,((G=R.sourceEvent)==null?void 0:G.type)==="mousedown"&&w.setState({paneDragging:!0}),$==null||$(B),t==null||t(R.sourceEvent,B)})},[P,t]),I.useEffect(()=>{P&&(A&&!x.current?P.on("zoom",null):A||P.on("zoom",R=>{var B;const{onViewportChange:$}=w.getState();if(w.setState({transform:[R.transform.x,R.transform.y,R.transform.k]}),C.current=!!(r&&B9(d,D.current??0)),(e||$)&&!((B=R.sourceEvent)!=null&&B.internal)){const U=Hv(R.transform);$==null||$(U),e==null||e(R.sourceEvent,U)}}))},[A,P,e,d,r]),I.useEffect(()=>{P&&P.on("end",R=>{if(!R.sourceEvent||R.sourceEvent.internal)return null;const{onViewportChangeEnd:$}=w.getState();if(x.current=!1,w.setState({paneDragging:!1}),r&&B9(d,D.current??0)&&!C.current&&r(R.sourceEvent),C.current=!1,(n||$)&&M_e(E.current,R.transform)){const B=Hv(R.transform);E.current=B,clearTimeout(S.current),S.current=setTimeout(()=>{$==null||$(B),n==null||n(R.sourceEvent,B)},a?150:0)}})},[P,a,d,n,r]),I.useEffect(()=>{P&&P.filter(R=>{const $=k||i,B=o&&R.ctrlKey;if(R.button===1&&R.type==="mousedown"&&(_f(R,"react-flow__node")||_f(R,"react-flow__edge")))return!0;if(!d&&!$&&!a&&!u&&!o||A||!u&&R.type==="dblclick"||_f(R,g)&&R.type==="wheel"||_f(R,v)&&R.type!=="wheel"||!o&&R.ctrlKey&&R.type==="wheel"||!$&&!a&&!B&&R.type==="wheel"||!d&&(R.type==="mousedown"||R.type==="touchstart")||Array.isArray(d)&&!d.includes(R.button)&&(R.type==="mousedown"||R.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(R.button)||!R.button||R.button<=1;return(!R.ctrlKey||R.type==="wheel")&&U})},[A,P,i,o,a,u,d,c,k]),W.jsx("div",{className:"react-flow__renderer",ref:T,style:P4,children:y})},D_e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function L_e(){const{userSelectionActive:e,userSelectionRect:t}=_r(D_e,No);return e&&t?W.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function j9(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(r>0||i>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),i>0&&(n.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);n.position.x=n.position.x-o,n.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);n.position.y=n.position.y-o,n.style.height+=o,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function $V(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(s=>s.id===i.id);if(o.length===0)return r.push(i),r;const a={...i};for(const s of o)if(s)switch(s.type){case"select":{a.selected=s.selected;break}case"position":{typeof s.position<"u"&&(a.position=s.position),typeof s.positionAbsolute<"u"&&(a.positionAbsolute=s.positionAbsolute),typeof s.dragging<"u"&&(a.dragging=s.dragging),a.expandParent&&j9(r,a);break}case"dimensions":{typeof s.dimensions<"u"&&(a.width=s.dimensions.width,a.height=s.dimensions.height),typeof s.updateStyle<"u"&&(a.style={...a.style||{},...s.dimensions}),typeof s.resizing=="boolean"&&(a.resizing=s.resizing),a.expandParent&&j9(r,a);break}case"remove":return r}return r.push(a),r},n)}function Qc(e,t){return $V(e,t)}function Bc(e,t){return $V(e,t)}const Eu=(e,t)=>({id:e,type:"select",selected:t});function Hf(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Eu(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Eu(r.id,!1))),n},[])}const ZC=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},F_e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),NV=I.memo(({isSelecting:e,selectionMode:t=pc.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:a,onPaneScroll:s,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=I.useRef(null),h=pi(),p=I.useRef(0),m=I.useRef(0),_=I.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:g}=_r(F_e,No),v=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},S=O=>{o==null||o(O),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},w=O=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){O.preventDefault();return}a==null||a(O)},x=s?O=>s(O):void 0,C=O=>{const{resetSelectedElements:A,domNode:k}=h.getState();if(_.current=k==null?void 0:k.getBoundingClientRect(),!y||!e||O.button!==0||O.target!==f.current||!_.current)return;const{x:D,y:L}=nc(O,_.current);A(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:L,x:D,y:L}}),r==null||r(O)},T=O=>{const{userSelectionRect:A,nodeInternals:k,edges:D,transform:L,onNodesChange:M,onEdgesChange:R,nodeOrigin:$,getNodes:B}=h.getState();if(!e||!_.current||!A)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=nc(O,_.current),G=A.startX??0,Y=A.startY??0,ee={...A,x:U.x<G?U.x:G,y:U.y<Y?U.y:Y,width:Math.abs(U.x-G),height:Math.abs(U.y-Y)},J=B(),j=mV(k,ee,L,t===pc.Partial,!0,$),Q=E4(j,D).map(se=>se.id),ne=j.map(se=>se.id);if(p.current!==ne.length){p.current=ne.length;const se=Hf(J,ne);se.length&&(M==null||M(se))}if(m.current!==Q.length){m.current=Q.length;const se=Hf(D,Q);se.length&&(R==null||R(se))}h.setState({userSelectionRect:ee})},E=O=>{if(O.button!==0)return;const{userSelectionRect:A}=h.getState();!b&&A&&O.target===f.current&&(S==null||S(O)),h.setState({nodesSelectionActive:p.current>0}),v(),i==null||i(O)},P=O=>{b&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(O)),v()},N=y&&(e||b);return W.jsxs("div",{className:Ma(["react-flow__pane",{dragging:g,selection:e}]),onClick:N?void 0:ZC(S,f),onContextMenu:ZC(w,f),onWheel:ZC(x,f),onMouseEnter:N?void 0:l,onMouseDown:N?C:void 0,onMouseMove:N?T:u,onMouseUp:N?E:void 0,onMouseLeave:N?P:c,ref:f,style:P4,children:[d,W.jsx(L_e,{})]})});NV.displayName="Pane";function DV(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:DV(n,t):!1}function U9(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function B_e(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!DV(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,a;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((a=i.positionAbsolute)==null?void 0:a.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height}})}function z_e(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function LV(e,t,n,r,i=[0,0],o){const a=z_e(e,e.extent||r);let s=a;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const c=n.get(e.parentNode),{x:d,y:f}=wh(c,i).positionAbsolute;s=c&&Ca(d)&&Ca(f)&&Ca(c.width)&&Ca(c.height)?[[d+e.width*i[0],f+e.height*i[1]],[d+c.width-e.width+e.width*i[0],f+c.height-e.height+e.height*i[1]]]:s}else o==null||o("005",Jl.error005()),s=a;else if(e.extent&&e.parentNode){const c=n.get(e.parentNode),{x:d,y:f}=wh(c,i).positionAbsolute;s=[[e.extent[0][0]+d,e.extent[0][1]+f],[e.extent[1][0]+d,e.extent[1][1]+f]]}let l={x:0,y:0};if(e.parentNode){const c=n.get(e.parentNode);l=wh(c,i).positionAbsolute}const u=s&&s!=="parent"?_4(t,s):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function JC({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const V9=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),a=t.getBoundingClientRect(),s={x:a.width*r[0],y:a.height*r[1]};return o.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-a.left-s.x)/n,y:(u.top-a.top-s.y)/n,...b4(l)}})};function og(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function XA({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),u=s.get(e);if(!u){l==null||l("012",Jl.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(o({nodes:[u]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function j_e(){const e=pi();return I.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),a=n.touches?n.touches[0].clientX:n.clientX,s=n.touches?n.touches[0].clientY:n.clientY,l={x:(a-r[0])/r[2],y:(s-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(l.x/i[0]):l.x,ySnapped:o?i[1]*Math.round(l.y/i[1]):l.y,...l}},[])}function e5(e){return(t,n,r)=>e==null?void 0:e(t,r)}function FV({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:a}){const s=pi(),[l,u]=I.useState(!1),c=I.useRef([]),d=I.useRef({x:null,y:null}),f=I.useRef(0),h=I.useRef(null),p=I.useRef({x:0,y:0}),m=I.useRef(null),_=I.useRef(!1),b=j_e();return I.useEffect(()=>{if(e!=null&&e.current){const y=Ja(e.current),g=({x:S,y:w})=>{const{nodeInternals:x,onNodeDrag:C,onSelectionDrag:T,updateNodePositions:E,nodeExtent:P,snapGrid:N,snapToGrid:O,nodeOrigin:A,onError:k}=s.getState();d.current={x:S,y:w};let D=!1,L={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&P){const R=A4(c.current,A);L=C0(R)}if(c.current=c.current.map(R=>{const $={x:S-R.distance.x,y:w-R.distance.y};O&&($.x=N[0]*Math.round($.x/N[0]),$.y=N[1]*Math.round($.y/N[1]));const B=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];c.current.length>1&&P&&!R.extent&&(B[0][0]=R.positionAbsolute.x-L.x+P[0][0],B[1][0]=R.positionAbsolute.x+(R.width??0)-L.x2+P[1][0],B[0][1]=R.positionAbsolute.y-L.y+P[0][1],B[1][1]=R.positionAbsolute.y+(R.height??0)-L.y2+P[1][1]);const U=LV(R,$,x,B,A,k);return D=D||R.position.x!==U.position.x||R.position.y!==U.position.y,R.position=U.position,R.positionAbsolute=U.positionAbsolute,R}),!D)return;E(c.current,!0,!0),u(!0);const M=i?C:e5(T);if(M&&m.current){const[R,$]=JC({nodeId:i,dragItems:c.current,nodeInternals:x});M(m.current,R,$)}},v=()=>{if(!h.current)return;const[S,w]=rV(p.current,h.current);if(S!==0||w!==0){const{transform:x,panBy:C}=s.getState();d.current.x=(d.current.x??0)-S/x[2],d.current.y=(d.current.y??0)-w/x[2],C({x:S,y:w})&&g(d.current)}f.current=requestAnimationFrame(v)};if(t)y.on(".drag",null);else{const S=Xve().on("start",w=>{var D;const{nodeInternals:x,multiSelectionActive:C,domNode:T,nodesDraggable:E,unselectNodesAndEdges:P,onNodeDragStart:N,onSelectionDragStart:O}=s.getState(),A=i?N:e5(O);!a&&!C&&i&&((D=x.get(i))!=null&&D.selected||P()),i&&o&&a&&XA({id:i,store:s,nodeRef:e});const k=b(w);if(d.current=k,c.current=B_e(x,E,k,i),A&&c.current){const[L,M]=JC({nodeId:i,dragItems:c.current,nodeInternals:x});A(w.sourceEvent,L,M)}h.current=(T==null?void 0:T.getBoundingClientRect())||null,p.current=nc(w.sourceEvent,h.current)}).on("drag",w=>{const x=b(w),{autoPanOnNodeDrag:C}=s.getState();!_.current&&C&&(_.current=!0,v()),(d.current.x!==x.xSnapped||d.current.y!==x.ySnapped)&&c.current&&(m.current=w.sourceEvent,p.current=nc(w.sourceEvent,h.current),g(x))}).on("end",w=>{if(u(!1),_.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:x,nodeInternals:C,onNodeDragStop:T,onSelectionDragStop:E}=s.getState(),P=i?T:e5(E);if(x(c.current,!1,!1),P){const[N,O]=JC({nodeId:i,dragItems:c.current,nodeInternals:C});P(w.sourceEvent,N,O)}}}).filter(w=>{const x=w.target;return!w.button&&(!n||!U9(x,`.${n}`,e))&&(!r||U9(x,r,e))});return y.call(S),()=>{y.on(".drag",null)}}}},[e,t,n,r,o,s,i,a,b]),l}function BV(){const e=pi();return I.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:a,snapToGrid:s,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=a().filter(y=>y.selected&&(y.draggable||c&&typeof y.draggable>"u")),f=s?l[0]:5,h=s?l[1]:5,p=n.isShiftPressed?4:1,m=n.x*f*p,_=n.y*h*p,b=d.map(y=>{if(y.positionAbsolute){const g={x:y.positionAbsolute.x+m,y:y.positionAbsolute.y+_};s&&(g.x=l[0]*Math.round(g.x/l[0]),g.y=l[1]*Math.round(g.y/l[1]));const{positionAbsolute:v,position:S}=LV(y,g,r,i,void 0,u);y.position=S,y.positionAbsolute=v}return y});o(b,!0,!1)},[])}const Ch={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ag=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:a,xPosOrigin:s,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:p,onDoubleClick:m,style:_,className:b,isDraggable:y,isSelectable:g,isConnectable:v,isFocusable:S,selectNodesOnDrag:w,sourcePosition:x,targetPosition:C,hidden:T,resizeObserver:E,dragHandle:P,zIndex:N,isParent:O,noDragClassName:A,noPanClassName:k,initialized:D,disableKeyboardA11y:L,ariaLabel:M,rfId:R})=>{const $=pi(),B=I.useRef(null),U=I.useRef(x),G=I.useRef(C),Y=I.useRef(r),ee=g||y||c||d||f||h,J=BV(),j=og(n,$.getState,d),Q=og(n,$.getState,f),ne=og(n,$.getState,h),se=og(n,$.getState,p),be=og(n,$.getState,m),ce=ze=>{if(g&&(!w||!y)&&XA({id:n,store:$,nodeRef:B}),c){const mt=$.getState().nodeInternals.get(n);mt&&c(ze,{...mt})}},bt=ze=>{if(!HA(ze))if(sV.includes(ze.key)&&g){const mt=ze.key==="Escape";XA({id:n,store:$,unselect:mt,nodeRef:B})}else!L&&y&&u&&Object.prototype.hasOwnProperty.call(Ch,ze.key)&&($.setState({ariaLiveMessage:`Moved selected node ${ze.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~a}`}),J({x:Ch[ze.key].x,y:Ch[ze.key].y,isShiftPressed:ze.shiftKey}))};I.useEffect(()=>{if(B.current&&!T){const ze=B.current;return E==null||E.observe(ze),()=>E==null?void 0:E.unobserve(ze)}},[T]),I.useEffect(()=>{const ze=Y.current!==r,mt=U.current!==x,Ie=G.current!==C;B.current&&(ze||mt||Ie)&&(ze&&(Y.current=r),mt&&(U.current=x),Ie&&(G.current=C),$.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,r,x,C]);const ot=FV({nodeRef:B,disabled:T||!y,noDragClassName:A,handleSelector:P,nodeId:n,isSelectable:g,selectNodesOnDrag:w});return T?null:W.jsx("div",{className:Ma(["react-flow__node",`react-flow__node-${r}`,{[k]:y},b,{selected:u,selectable:g,parent:O,dragging:ot}]),ref:B,style:{zIndex:N,transform:`translate(${s}px,${l}px)`,pointerEvents:ee?"all":"none",visibility:D?"visible":"hidden",..._},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:j,onMouseMove:Q,onMouseLeave:ne,onContextMenu:se,onClick:ce,onDoubleClick:be,onKeyDown:S?bt:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":L?void 0:`${kV}-${R}`,"aria-label":M,children:W.jsx(e_e,{value:n,children:W.jsx(e,{id:n,data:i,type:r,xPos:o,yPos:a,selected:u,isConnectable:v,sourcePosition:x,targetPosition:C,dragging:ot,dragHandle:P,zIndex:N})})})};return t.displayName="NodeWrapper",I.memo(t)};const U_e=e=>{const t=e.getNodes().filter(n=>n.selected);return{...A4(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function V_e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=pi(),{width:i,height:o,x:a,y:s,transformString:l,userSelectionActive:u}=_r(U_e,No),c=BV(),d=I.useRef(null);if(I.useEffect(()=>{var p;n||(p=d.current)==null||p.focus({preventScroll:!0})},[n]),FV({nodeRef:d}),u||!i||!o)return null;const f=e?p=>{const m=r.getState().getNodes().filter(_=>_.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Ch,p.key)&&c({x:Ch[p.key].x,y:Ch[p.key].y,isShiftPressed:p.shiftKey})};return W.jsx("div",{className:Ma(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:W.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:o,top:s,left:a}})})}var G_e=I.memo(V_e);const q_e=e=>e.nodesSelectionActive,zV=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,deleteKeyCode:s,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:_,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:T,panOnDrag:E,defaultViewport:P,translateExtent:N,minZoom:O,maxZoom:A,preventScrolling:k,onSelectionContextMenu:D,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:R})=>{const $=_r(q_e),B=A0(d),G=A0(b)||E,Y=B||f&&G!==!0;return R_e({deleteKeyCode:s,multiSelectionKeyCode:_}),W.jsx(N_e,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:T,panOnDrag:!B&&G,defaultViewport:P,translateExtent:N,minZoom:O,maxZoom:A,zoomActivationKeyCode:y,preventScrolling:k,noWheelClassName:L,noPanClassName:M,children:W.jsxs(NV,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:G,isSelecting:!!Y,selectionMode:h,children:[e,$&&W.jsx(G_e,{onSelectionContextMenu:D,noPanClassName:M,disableKeyboardA11y:R})]})})};zV.displayName="FlowRenderer";var H_e=I.memo(zV);function W_e(e){return _r(I.useCallback(n=>e?mV(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function K_e(e){const t={input:ag(e.input||CV),default:ag(e.default||QA),output:ag(e.output||EV),group:ag(e.group||k4)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=ag(e[o]||QA),i),n);return{...t,...r}}const Q_e=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},X_e=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),jV=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:a}=_r(X_e,No),s=W_e(e.onlyRenderVisibleElements),l=I.useRef(),u=I.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(f)});return l.current=c,c},[]);return I.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),W.jsx("div",{className:"react-flow__nodes",style:P4,children:s.map(c=>{var S,w;let d=c.type||"default";e.nodeTypes[d]||(a==null||a("003",Jl.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),p=!!(c.selectable||i&&typeof c.selectable>"u"),m=!!(c.connectable||n&&typeof c.connectable>"u"),_=!!(c.focusable||r&&typeof c.focusable>"u"),b=e.nodeExtent?_4(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,y=(b==null?void 0:b.x)??0,g=(b==null?void 0:b.y)??0,v=Q_e({x:y,y:g,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return W.jsx(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||tt.Bottom,targetPosition:c.targetPosition||tt.Top,hidden:c.hidden,xPos:y,yPos:g,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:p,isConnectable:m,isFocusable:_,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((S=c[Xr])==null?void 0:S.z)??0,isParent:!!((w=c[Xr])!=null&&w.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};jV.displayName="NodeRenderer";var Y_e=I.memo(jV);const Z_e=(e,t,n)=>n===tt.Left?e-t:n===tt.Right?e+t:e,J_e=(e,t,n)=>n===tt.Top?e-t:n===tt.Bottom?e+t:e,G9="react-flow__edgeupdater",q9=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:s})=>W.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:Ma([G9,`${G9}-${s}`]),cx:Z_e(t,r,e),cy:J_e(n,r,e),r,stroke:"transparent",fill:"transparent"}),eSe=()=>!0;var Sf=e=>{const t=({id:n,className:r,type:i,data:o,onClick:a,onEdgeDoubleClick:s,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:_,source:b,target:y,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,elementsSelectable:T,hidden:E,sourceHandleId:P,targetHandleId:N,onContextMenu:O,onMouseEnter:A,onMouseMove:k,onMouseLeave:D,edgeUpdaterRadius:L,onEdgeUpdate:M,onEdgeUpdateStart:R,onEdgeUpdateEnd:$,markerEnd:B,markerStart:U,rfId:G,ariaLabel:Y,isFocusable:ee,isUpdatable:J,pathOptions:j,interactionWidth:Q})=>{const ne=I.useRef(null),[se,be]=I.useState(!1),[ce,bt]=I.useState(!1),ot=pi(),ze=I.useMemo(()=>`url(#${KA(U,G)})`,[U,G]),mt=I.useMemo(()=>`url(#${KA(B,G)})`,[B,G]);if(E)return null;const Ie=Fn=>{const{edges:_n,addSelectedEdges:Mi}=ot.getState();if(T&&(ot.setState({nodesSelectionActive:!1}),Mi([n])),a){const gi=_n.find(Xi=>Xi.id===n);a(Fn,gi)}},en=ig(n,ot.getState,s),Ir=ig(n,ot.getState,O),Dn=ig(n,ot.getState,A),Tn=ig(n,ot.getState,k),tn=ig(n,ot.getState,D),Ln=(Fn,_n)=>{if(Fn.button!==0)return;const{edges:Mi,isValidConnection:gi}=ot.getState(),Xi=_n?y:b,Ua=(_n?N:P)||null,Or=_n?"target":"source",yo=gi||eSe,dl=_n,Fo=Mi.find(nn=>nn.id===n);bt(!0),R==null||R(Fn,Fo,Or);const fl=nn=>{bt(!1),$==null||$(nn,Fo,Or)};_V({event:Fn,handleId:Ua,nodeId:Xi,onConnect:nn=>M==null?void 0:M(Fo,nn),isTarget:dl,getState:ot.getState,setState:ot.setState,isValidConnection:yo,edgeUpdaterType:Or,onEdgeUpdateEnd:fl})},Rr=Fn=>Ln(Fn,!0),mo=Fn=>Ln(Fn,!1),Jr=()=>be(!0),pr=()=>be(!1),zr=!T&&!a,ei=Fn=>{var _n;if(sV.includes(Fn.key)&&T){const{unselectNodesAndEdges:Mi,addSelectedEdges:gi,edges:Xi}=ot.getState();Fn.key==="Escape"?((_n=ne.current)==null||_n.blur(),Mi({edges:[Xi.find(Or=>Or.id===n)]})):gi([n])}};return W.jsxs("g",{className:Ma(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:u,inactive:zr,updating:se}]),onClick:Ie,onDoubleClick:en,onContextMenu:Ir,onMouseEnter:Dn,onMouseMove:Tn,onMouseLeave:tn,onKeyDown:ee?ei:void 0,tabIndex:ee?0:void 0,role:ee?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Y===null?void 0:Y||`Edge from ${b} to ${y}`,"aria-describedby":ee?`${PV}-${G}`:void 0,ref:ne,children:[!ce&&W.jsx(e,{id:n,source:b,target:y,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,data:o,style:_,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,sourceHandleId:P,targetHandleId:N,markerStart:ze,markerEnd:mt,pathOptions:j,interactionWidth:Q}),J&&W.jsxs(W.Fragment,{children:[(J==="source"||J===!0)&&W.jsx(q9,{position:x,centerX:g,centerY:v,radius:L,onMouseDown:Rr,onMouseEnter:Jr,onMouseOut:pr,type:"source"}),(J==="target"||J===!0)&&W.jsx(q9,{position:C,centerX:S,centerY:w,radius:L,onMouseDown:mo,onMouseEnter:Jr,onMouseOut:pr,type:"target"})]})]})};return t.displayName="EdgeWrapper",I.memo(t)};function tSe(e){const t={default:Sf(e.default||V_),straight:Sf(e.bezier||w4),step:Sf(e.step||x4),smoothstep:Sf(e.step||lx),simplebezier:Sf(e.simplebezier||S4)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=Sf(e[o]||V_),i),n);return{...t,...r}}function H9(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,a=(n==null?void 0:n.height)||t.height;switch(e){case tt.Top:return{x:r+o/2,y:i};case tt.Right:return{x:r+o,y:i+a/2};case tt.Bottom:return{x:r+o/2,y:i+a};case tt.Left:return{x:r,y:i+a/2}}}function W9(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const nSe=(e,t,n,r,i,o)=>{const a=H9(n,e,t),s=H9(o,r,i);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}};function rSe({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:a,height:s,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=C0({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/l[2],height:s/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function K9(e){var r,i,o,a,s;const t=((r=e==null?void 0:e[Xr])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)||0,y:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const iSe=[{level:0,isMaxLevel:!0,edges:[]}];function oSe(e,t,n=!1){let r=-1;const i=e.reduce((a,s)=>{var c,d;const l=Ca(s.zIndex);let u=l?s.zIndex:0;if(n){const f=t.get(s.target),h=t.get(s.source),p=s.selected||(f==null?void 0:f.selected)||(h==null?void 0:h.selected),m=Math.max(((c=h==null?void 0:h[Xr])==null?void 0:c.z)||0,((d=f==null?void 0:f[Xr])==null?void 0:d.z)||0,1e3);u=(l?s.zIndex:0)+(p?m:0)}return a[u]?a[u].push(s):a[u]=[s],r=u>r?u:r,a},{}),o=Object.entries(i).map(([a,s])=>{const l=+a;return{edges:s,level:l,isMaxLevel:l===r}});return o.length===0?iSe:o}function aSe(e,t,n){const r=_r(I.useCallback(i=>e?i.edges.filter(o=>{const a=t.get(o.source),s=t.get(o.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&rSe({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:s.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:s.width,targetHeight:s.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return oSe(r,t,n)}const sSe=({color:e="none",strokeWidth:t=1})=>W.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),lSe=({color:e="none",strokeWidth:t=1})=>W.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),Q9={[U_.Arrow]:sSe,[U_.ArrowClosed]:lSe};function uSe(e){const t=pi();return I.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Q9,e)?Q9[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Jl.error009(e)),null)},[e])}const cSe=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:s="auto-start-reverse"})=>{const l=uSe(t);return l?W.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:s,refX:"0",refY:"0",children:W.jsx(l,{color:n,strokeWidth:a})}):null},dSe=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const s=KA(a,t);r.includes(s)||(i.push({id:s,color:a.color||e,...a}),r.push(s))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},UV=({defaultColor:e,rfId:t})=>{const n=_r(I.useCallback(dSe({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,a)=>o.id!==i[a].id)));return W.jsx("defs",{children:n.map(r=>W.jsx(cSe,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};UV.displayName="MarkerDefinitions";var fSe=I.memo(UV);const hSe=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),VV=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,children:_})=>{const{edgesFocusable:b,edgesUpdatable:y,elementsSelectable:g,width:v,height:S,connectionMode:w,nodeInternals:x,onError:C}=_r(hSe,No),T=aSe(t,x,n);return v?W.jsxs(W.Fragment,{children:[T.map(({level:E,edges:P,isMaxLevel:N})=>W.jsxs("svg",{style:{zIndex:E},width:v,height:S,className:"react-flow__edges react-flow__container",children:[N&&W.jsx(fSe,{defaultColor:e,rfId:r}),W.jsx("g",{children:P.map(O=>{const[A,k,D]=K9(x.get(O.source)),[L,M,R]=K9(x.get(O.target));if(!D||!R)return null;let $=O.type||"default";i[$]||(C==null||C("011",Jl.error011($)),$="default");const B=i[$]||i.default,U=w===Ud.Strict?M.target:(M.target??[]).concat(M.source??[]),G=W9(k.source,O.sourceHandle),Y=W9(U,O.targetHandle),ee=(G==null?void 0:G.position)||tt.Bottom,J=(Y==null?void 0:Y.position)||tt.Top,j=!!(O.focusable||b&&typeof O.focusable>"u"),Q=typeof a<"u"&&(O.updatable||y&&typeof O.updatable>"u");if(!G||!Y)return C==null||C("008",Jl.error008(G,O)),null;const{sourceX:ne,sourceY:se,targetX:be,targetY:ce}=nSe(A,G,ee,L,Y,J);return W.jsx(B,{id:O.id,className:Ma([O.className,o]),type:$,data:O.data,selected:!!O.selected,animated:!!O.animated,hidden:!!O.hidden,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,style:O.style,source:O.source,target:O.target,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerEnd:O.markerEnd,markerStart:O.markerStart,sourceX:ne,sourceY:se,targetX:be,targetY:ce,sourcePosition:ee,targetPosition:J,elementsSelectable:g,onEdgeUpdate:a,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,rfId:r,ariaLabel:O.ariaLabel,isFocusable:j,isUpdatable:Q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth},O.id)})})]},E)),_]}):null};VV.displayName="EdgeRenderer";var pSe=I.memo(VV);const gSe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function mSe({children:e}){const t=_r(gSe);return W.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function ySe(e){const t=MV(),n=I.useRef(!1);I.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const vSe={[tt.Left]:tt.Right,[tt.Right]:tt.Left,[tt.Top]:tt.Bottom,[tt.Bottom]:tt.Top},GV=({nodeId:e,handleType:t,style:n,type:r=Mu.Bezier,CustomComponent:i,connectionStatus:o})=>{var w,x,C;const{fromNode:a,handleId:s,toX:l,toY:u,connectionMode:c}=_r(I.useCallback(T=>({fromNode:T.nodeInternals.get(e),handleId:T.connectionHandleId,toX:(T.connectionPosition.x-T.transform[0])/T.transform[2],toY:(T.connectionPosition.y-T.transform[1])/T.transform[2],connectionMode:T.connectionMode}),[e]),No),d=(w=a==null?void 0:a[Xr])==null?void 0:w.handleBounds;let f=d==null?void 0:d[t];if(c===Ud.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!a||!f)return null;const h=s?f.find(T=>T.id===s):f[0],p=h?h.x+h.width/2:(a.width??0)/2,m=h?h.y+h.height/2:a.height??0,_=(((x=a.positionAbsolute)==null?void 0:x.x)??0)+p,b=(((C=a.positionAbsolute)==null?void 0:C.y)??0)+m,y=h==null?void 0:h.position,g=y?vSe[y]:null;if(!y||!g)return null;if(i)return W.jsx(i,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:h,fromX:_,fromY:b,toX:l,toY:u,fromPosition:y,toPosition:g,connectionStatus:o});let v="";const S={sourceX:_,sourceY:b,sourcePosition:y,targetX:l,targetY:u,targetPosition:g};return r===Mu.Bezier?[v]=fV(S):r===Mu.Step?[v]=WA({...S,borderRadius:0}):r===Mu.SmoothStep?[v]=WA(S):r===Mu.SimpleBezier?[v]=dV(S):v=`M${_},${b} ${l},${u}`,W.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};GV.displayName="ConnectionLine";const bSe=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function _Se({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:a,width:s,height:l,connectionStatus:u}=_r(bSe,No);return!(i&&o&&s&&a)?null:W.jsx("svg",{style:e,width:s,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:W.jsx("g",{className:Ma(["react-flow__connection",u]),children:W.jsx(GV,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}function X9(e,t){return I.useRef(null),pi(),I.useMemo(()=>t(e),[e])}const qV=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:_,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:g,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,multiSelectionKeyCode:C,panActivationKeyCode:T,zoomActivationKeyCode:E,deleteKeyCode:P,onlyRenderVisibleElements:N,elementsSelectable:O,selectNodesOnDrag:A,defaultViewport:k,translateExtent:D,minZoom:L,maxZoom:M,preventScrolling:R,defaultMarkerColor:$,zoomOnScroll:B,zoomOnPinch:U,panOnScroll:G,panOnScrollSpeed:Y,panOnScrollMode:ee,zoomOnDoubleClick:J,panOnDrag:j,onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:be,onPaneScroll:ce,onPaneContextMenu:bt,onEdgeUpdate:ot,onEdgeContextMenu:ze,onEdgeMouseEnter:mt,onEdgeMouseMove:Ie,onEdgeMouseLeave:en,edgeUpdaterRadius:Ir,onEdgeUpdateStart:Dn,onEdgeUpdateEnd:Tn,noDragClassName:tn,noWheelClassName:Ln,noPanClassName:Rr,elevateEdgesOnSelect:mo,disableKeyboardA11y:Jr,nodeOrigin:pr,nodeExtent:zr,rfId:ei})=>{const Fn=X9(e,K_e),_n=X9(t,tSe);return ySe(o),W.jsx(H_e,{onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:be,onPaneContextMenu:bt,onPaneScroll:ce,deleteKeyCode:P,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,onSelectionStart:m,onSelectionEnd:_,multiSelectionKeyCode:C,panActivationKeyCode:T,zoomActivationKeyCode:E,elementsSelectable:O,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:B,zoomOnPinch:U,zoomOnDoubleClick:J,panOnScroll:G,panOnScrollSpeed:Y,panOnScrollMode:ee,panOnDrag:j,defaultViewport:k,translateExtent:D,minZoom:L,maxZoom:M,onSelectionContextMenu:p,preventScrolling:R,noDragClassName:tn,noWheelClassName:Ln,noPanClassName:Rr,disableKeyboardA11y:Jr,children:W.jsxs(mSe,{children:[W.jsx(pSe,{edgeTypes:_n,onEdgeClick:s,onEdgeDoubleClick:u,onEdgeUpdate:ot,onlyRenderVisibleElements:N,onEdgeContextMenu:ze,onEdgeMouseEnter:mt,onEdgeMouseMove:Ie,onEdgeMouseLeave:en,onEdgeUpdateStart:Dn,onEdgeUpdateEnd:Tn,edgeUpdaterRadius:Ir,defaultMarkerColor:$,noPanClassName:Rr,elevateEdgesOnSelect:!!mo,disableKeyboardA11y:Jr,rfId:ei,children:W.jsx(_Se,{style:y,type:b,component:g,containerStyle:v})}),W.jsx("div",{className:"react-flow__edgelabel-renderer"}),W.jsx(Y_e,{nodeTypes:Fn,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:A,onlyRenderVisibleElements:N,noPanClassName:Rr,noDragClassName:tn,disableKeyboardA11y:Jr,nodeOrigin:pr,nodeExtent:zr,rfId:ei})]})})};qV.displayName="GraphView";var SSe=I.memo(qV);const YA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],mu={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:YA,nodeExtent:YA,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Ud.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Kbe,isValidConnection:void 0},xSe=()=>lye((e,t)=>({...mu,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:YC(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",a=i?YC(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:a,fitViewOnInitOptions:s,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((m,_)=>{const b=i.get(_.id);if(b){const y=b4(_.nodeElement);!!(y.width&&y.height&&(b.width!==y.width||b.height!==y.height||_.forceUpdate))&&(i.set(b.id,{...b,[Xr]:{...b[Xr],handleBounds:{source:V9(".source",_.nodeElement,f,u),target:V9(".target",_.nodeElement,f,u)}},...y}),m.push({id:b.id,type:"dimensions",dimensions:y}))}return m},[]);RV(i,u);const p=a||o&&!a&&OV(t,{initial:!0,...s});e({nodeInternals:new Map(i),fitViewOnInitDone:p}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),a=n.map(s=>{const l={id:s.id,type:"position",dragging:i};return r&&(l.positionAbsolute=s.positionAbsolute,l.position=s.position),l});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(o){const u=Qc(n,s()),c=YC(u,i,a,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Eu(l,!0)):(a=Hf(o(),n),s=Hf(i,[])),qv({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Eu(l,!0)):(a=Hf(i,n),s=Hf(o(),[])),qv({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),a=n||o(),s=r||i,l=a.map(c=>(c.selected=!1,Eu(c.id,!1))),u=s.map(c=>Eu(c.id,!1));qv({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(s=>s.selected).map(s=>Eu(s.id,!1)),a=n.filter(s=>s.selected).map(s=>Eu(s.id,!1));qv({changedNodes:o,changedEdges:a,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=_4(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:a,d3Selection:s,translateExtent:l}=t();if(!a||!s||!n.x&&!n.y)return!1;const u=tc.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[i,o]],d=a==null?void 0:a.constrain()(u,c,l);return a.transform(s,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:mu.connectionNodeId,connectionHandleId:mu.connectionHandleId,connectionHandleType:mu.connectionHandleType,connectionStatus:mu.connectionStatus,connectionStartHandle:mu.connectionStartHandle,connectionEndHandle:mu.connectionEndHandle}),reset:()=>e({...mu})}),Object.is),HV=({children:e})=>{const t=I.useRef(null);return t.current||(t.current=xSe()),W.jsx(jbe,{value:t.current,children:e})};HV.displayName="ReactFlowProvider";const WV=({children:e})=>I.useContext(sx)?W.jsx(W.Fragment,{children:e}):W.jsx(HV,{children:e});WV.displayName="ReactFlowWrapper";const wSe={input:CV,default:QA,output:EV,group:k4},CSe={default:V_,straight:w4,step:x4,smoothstep:lx,simplebezier:S4},ASe=[0,0],ESe=[15,15],TSe={x:0,y:0,zoom:1},kSe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},PSe=I.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=wSe,edgeTypes:a=CSe,onNodeClick:s,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:P,onSelectionChange:N,onSelectionDragStart:O,onSelectionDrag:A,onSelectionDragStop:k,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:M,connectionMode:R=Ud.Strict,connectionLineType:$=Mu.Bezier,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,deleteKeyCode:Y="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:J=!1,selectionMode:j=pc.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:ne=j_()?"Meta":"Control",zoomActivationKeyCode:se=j_()?"Meta":"Control",snapToGrid:be=!1,snapGrid:ce=ESe,onlyRenderVisibleElements:bt=!1,selectNodesOnDrag:ot=!0,nodesDraggable:ze,nodesConnectable:mt,nodesFocusable:Ie,nodeOrigin:en=ASe,edgesFocusable:Ir,edgesUpdatable:Dn,elementsSelectable:Tn,defaultViewport:tn=TSe,minZoom:Ln=.5,maxZoom:Rr=2,translateExtent:mo=YA,preventScrolling:Jr=!0,nodeExtent:pr,defaultMarkerColor:zr="#b1b1b7",zoomOnScroll:ei=!0,zoomOnPinch:Fn=!0,panOnScroll:_n=!1,panOnScrollSpeed:Mi=.5,panOnScrollMode:gi=hd.Free,zoomOnDoubleClick:Xi=!0,panOnDrag:Ua=!0,onPaneClick:Or,onPaneMouseEnter:yo,onPaneMouseMove:dl,onPaneMouseLeave:Fo,onPaneScroll:fl,onPaneContextMenu:Bn,children:nn,onEdgeUpdate:jr,onEdgeContextMenu:Mr,onEdgeDoubleClick:$r,onEdgeMouseEnter:ti,onEdgeMouseMove:$i,onEdgeMouseLeave:vo,onEdgeUpdateStart:mi,onEdgeUpdateEnd:Ur,edgeUpdaterRadius:Va=10,onNodesChange:bs,onEdgesChange:yi,noDragClassName:cu="nodrag",noWheelClassName:ua="nowheel",noPanClassName:ni="nopan",fitView:hl=!1,fitViewOptions:H,connectOnClick:te=!0,attributionPosition:re,proOptions:de,defaultEdgeOptions:oe,elevateNodesOnSelect:je=!0,elevateEdgesOnSelect:Ge=!1,disableKeyboardA11y:ut=!1,autoPanOnConnect:De=!0,autoPanOnNodeDrag:qe=!0,connectionRadius:Re=20,isValidConnection:ie,onError:xe,style:Ye,id:Ze,...ct},ft)=>{const _t=Ze||"1";return W.jsx("div",{...ct,style:{...Ye,...kSe},ref:ft,className:Ma(["react-flow",i]),"data-testid":"rf__wrapper",id:Ze,children:W.jsxs(WV,{children:[W.jsx(SSe,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:s,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,nodeTypes:o,edgeTypes:a,connectionLineType:$,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,selectionKeyCode:ee,selectionOnDrag:J,selectionMode:j,deleteKeyCode:Y,multiSelectionKeyCode:ne,panActivationKeyCode:Q,zoomActivationKeyCode:se,onlyRenderVisibleElements:bt,selectNodesOnDrag:ot,defaultViewport:tn,translateExtent:mo,minZoom:Ln,maxZoom:Rr,preventScrolling:Jr,zoomOnScroll:ei,zoomOnPinch:Fn,zoomOnDoubleClick:Xi,panOnScroll:_n,panOnScrollSpeed:Mi,panOnScrollMode:gi,panOnDrag:Ua,onPaneClick:Or,onPaneMouseEnter:yo,onPaneMouseMove:dl,onPaneMouseLeave:Fo,onPaneScroll:fl,onPaneContextMenu:Bn,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:M,onEdgeUpdate:jr,onEdgeContextMenu:Mr,onEdgeDoubleClick:$r,onEdgeMouseEnter:ti,onEdgeMouseMove:$i,onEdgeMouseLeave:vo,onEdgeUpdateStart:mi,onEdgeUpdateEnd:Ur,edgeUpdaterRadius:Va,defaultMarkerColor:zr,noDragClassName:cu,noWheelClassName:ua,noPanClassName:ni,elevateEdgesOnSelect:Ge,rfId:_t,disableKeyboardA11y:ut,nodeOrigin:en,nodeExtent:pr}),W.jsx(b_e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:b,nodesDraggable:ze,nodesConnectable:mt,nodesFocusable:Ie,edgesFocusable:Ir,edgesUpdatable:Dn,elementsSelectable:Tn,elevateNodesOnSelect:je,minZoom:Ln,maxZoom:Rr,nodeExtent:pr,onNodesChange:bs,onEdgesChange:yi,snapToGrid:be,snapGrid:ce,connectionMode:R,translateExtent:mo,connectOnClick:te,defaultEdgeOptions:oe,fitView:hl,fitViewOptions:H,onNodesDelete:E,onEdgesDelete:P,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:T,onSelectionDrag:A,onSelectionDragStart:O,onSelectionDragStop:k,noPanClassName:ni,nodeOrigin:en,rfId:_t,autoPanOnConnect:De,autoPanOnNodeDrag:qe,onError:xe,connectionRadius:Re,isValidConnection:ie}),W.jsx(y_e,{onSelectionChange:N}),nn,W.jsx(Gbe,{proOptions:de,position:re}),W.jsx(C_e,{rfId:_t,disableKeyboardA11y:ut})]})})});PSe.displayName="ReactFlow";const ISe=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Jqe({children:e}){const t=_r(ISe);return t?Wo.createPortal(e,t):null}function eHe(){const e=pi();return I.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((a,s)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${s}"]`);return l&&a.push({id:s,nodeElement:l,forceUpdate:!0}),a},[]);requestAnimationFrame(()=>r(o))},[])}function RSe(){const e=[];return function(t,n){if(typeof n!="object"||n===null)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}const E0=Yb("nodes/receivedOpenAPISchema",async(e,{rejectWithValue:t})=>{try{const n=[window.location.origin,"openapi.json"].join("/"),i=await(await fetch(n)).json();return JSON.parse(JSON.stringify(i,RSe()))}catch(n){return t({error:n})}}),tHe=500,nHe=320,OSe="node-drag-handle",rHe=["ImageField","ImageCollection"],iHe={input:"inputs",output:"outputs"},Wv=["Collection","IntegerCollection","BooleanCollection","FloatCollection","StringCollection","ImageCollection","LatentsCollection","ConditioningCollection","ControlCollection","ColorCollection","T2IAdapterCollection","IPAdapterCollection"],Rg=["IntegerPolymorphic","BooleanPolymorphic","FloatPolymorphic","StringPolymorphic","ImagePolymorphic","LatentsPolymorphic","ConditioningPolymorphic","ControlPolymorphic","ColorPolymorphic","T2IAdapterPolymorphic","IPAdapterPolymorphic"],oHe=["IPAdapterModelField","ControlNetModelField","LoRAModelField","MainModelField","ONNXModelField","SDXLMainModelField","SDXLRefinerModelField","VaeModelField","UNetField","VaeField","ClipField","T2IAdapterModelField","IPAdapterModelField"],I4={integer:"IntegerCollection",boolean:"BooleanCollection",number:"FloatCollection",float:"FloatCollection",string:"StringCollection",ImageField:"ImageCollection",LatentsField:"LatentsCollection",ConditioningField:"ConditioningCollection",ControlField:"ControlCollection",ColorField:"ColorCollection",T2IAdapterField:"T2IAdapterCollection",IPAdapterField:"IPAdapterCollection"},MSe=e=>!!(e&&e in I4),KV={integer:"IntegerPolymorphic",boolean:"BooleanPolymorphic",number:"FloatPolymorphic",float:"FloatPolymorphic",string:"StringPolymorphic",ImageField:"ImagePolymorphic",LatentsField:"LatentsPolymorphic",ConditioningField:"ConditioningPolymorphic",ControlField:"ControlPolymorphic",ColorField:"ColorPolymorphic",T2IAdapterField:"T2IAdapterPolymorphic",IPAdapterField:"IPAdapterPolymorphic"},$Se={IntegerPolymorphic:"integer",BooleanPolymorphic:"boolean",FloatPolymorphic:"float",StringPolymorphic:"string",ImagePolymorphic:"ImageField",LatentsPolymorphic:"LatentsField",ConditioningPolymorphic:"ConditioningField",ControlPolymorphic:"ControlField",ColorPolymorphic:"ColorField",T2IAdapterPolymorphic:"T2IAdapterField",IPAdapterPolymorphic:"IPAdapterField"},aHe=["string","StringPolymorphic","boolean","BooleanPolymorphic","integer","float","FloatPolymorphic","IntegerPolymorphic","enum","ImageField","ImagePolymorphic","MainModelField","SDXLRefinerModelField","VaeModelField","LoRAModelField","ControlNetModelField","ColorField","SDXLMainModelField","Scheduler","IPAdapterModelField","BoardField","T2IAdapterModelField"],NSe=e=>!!(e&&e in KV),sHe={boolean:{color:"green.500",description:Z("nodes.booleanDescription"),title:Z("nodes.boolean")},BooleanCollection:{color:"green.500",description:Z("nodes.booleanCollectionDescription"),title:Z("nodes.booleanCollection")},BooleanPolymorphic:{color:"green.500",description:Z("nodes.booleanPolymorphicDescription"),title:Z("nodes.booleanPolymorphic")},ClipField:{color:"green.500",description:Z("nodes.clipFieldDescription"),title:Z("nodes.clipField")},Collection:{color:"base.500",description:Z("nodes.collectionDescription"),title:Z("nodes.collection")},CollectionItem:{color:"base.500",description:Z("nodes.collectionItemDescription"),title:Z("nodes.collectionItem")},ColorCollection:{color:"pink.300",description:Z("nodes.colorCollectionDescription"),title:Z("nodes.colorCollection")},ColorField:{color:"pink.300",description:Z("nodes.colorFieldDescription"),title:Z("nodes.colorField")},ColorPolymorphic:{color:"pink.300",description:Z("nodes.colorPolymorphicDescription"),title:Z("nodes.colorPolymorphic")},ConditioningCollection:{color:"cyan.500",description:Z("nodes.conditioningCollectionDescription"),title:Z("nodes.conditioningCollection")},ConditioningField:{color:"cyan.500",description:Z("nodes.conditioningFieldDescription"),title:Z("nodes.conditioningField")},ConditioningPolymorphic:{color:"cyan.500",description:Z("nodes.conditioningPolymorphicDescription"),title:Z("nodes.conditioningPolymorphic")},ControlCollection:{color:"teal.500",description:Z("nodes.controlCollectionDescription"),title:Z("nodes.controlCollection")},ControlField:{color:"teal.500",description:Z("nodes.controlFieldDescription"),title:Z("nodes.controlField")},ControlNetModelField:{color:"teal.500",description:"TODO",title:"ControlNet"},ControlPolymorphic:{color:"teal.500",description:"Control info passed between nodes.",title:"Control Polymorphic"},DenoiseMaskField:{color:"blue.300",description:Z("nodes.denoiseMaskFieldDescription"),title:Z("nodes.denoiseMaskField")},enum:{color:"blue.500",description:Z("nodes.enumDescription"),title:Z("nodes.enum")},float:{color:"orange.500",description:Z("nodes.floatDescription"),title:Z("nodes.float")},FloatCollection:{color:"orange.500",description:Z("nodes.floatCollectionDescription"),title:Z("nodes.floatCollection")},FloatPolymorphic:{color:"orange.500",description:Z("nodes.floatPolymorphicDescription"),title:Z("nodes.floatPolymorphic")},ImageCollection:{color:"purple.500",description:Z("nodes.imageCollectionDescription"),title:Z("nodes.imageCollection")},ImageField:{color:"purple.500",description:Z("nodes.imageFieldDescription"),title:Z("nodes.imageField")},BoardField:{color:"purple.500",description:Z("nodes.imageFieldDescription"),title:Z("nodes.imageField")},ImagePolymorphic:{color:"purple.500",description:Z("nodes.imagePolymorphicDescription"),title:Z("nodes.imagePolymorphic")},integer:{color:"red.500",description:Z("nodes.integerDescription"),title:Z("nodes.integer")},IntegerCollection:{color:"red.500",description:Z("nodes.integerCollectionDescription"),title:Z("nodes.integerCollection")},IntegerPolymorphic:{color:"red.500",description:Z("nodes.integerPolymorphicDescription"),title:Z("nodes.integerPolymorphic")},IPAdapterCollection:{color:"teal.500",description:Z("nodes.ipAdapterCollectionDescription"),title:Z("nodes.ipAdapterCollection")},IPAdapterField:{color:"teal.500",description:Z("nodes.ipAdapterDescription"),title:Z("nodes.ipAdapter")},IPAdapterModelField:{color:"teal.500",description:Z("nodes.ipAdapterModelDescription"),title:Z("nodes.ipAdapterModel")},IPAdapterPolymorphic:{color:"teal.500",description:Z("nodes.ipAdapterPolymorphicDescription"),title:Z("nodes.ipAdapterPolymorphic")},LatentsCollection:{color:"pink.500",description:Z("nodes.latentsCollectionDescription"),title:Z("nodes.latentsCollection")},LatentsField:{color:"pink.500",description:Z("nodes.latentsFieldDescription"),title:Z("nodes.latentsField")},LatentsPolymorphic:{color:"pink.500",description:Z("nodes.latentsPolymorphicDescription"),title:Z("nodes.latentsPolymorphic")},LoRAModelField:{color:"teal.500",description:Z("nodes.loRAModelFieldDescription"),title:Z("nodes.loRAModelField")},MainModelField:{color:"teal.500",description:Z("nodes.mainModelFieldDescription"),title:Z("nodes.mainModelField")},ONNXModelField:{color:"teal.500",description:Z("nodes.oNNXModelFieldDescription"),title:Z("nodes.oNNXModelField")},Scheduler:{color:"base.500",description:Z("nodes.schedulerDescription"),title:Z("nodes.scheduler")},SDXLMainModelField:{color:"teal.500",description:Z("nodes.sDXLMainModelFieldDescription"),title:Z("nodes.sDXLMainModelField")},SDXLRefinerModelField:{color:"teal.500",description:Z("nodes.sDXLRefinerModelFieldDescription"),title:Z("nodes.sDXLRefinerModelField")},string:{color:"yellow.500",description:Z("nodes.stringDescription"),title:Z("nodes.string")},StringCollection:{color:"yellow.500",description:Z("nodes.stringCollectionDescription"),title:Z("nodes.stringCollection")},StringPolymorphic:{color:"yellow.500",description:Z("nodes.stringPolymorphicDescription"),title:Z("nodes.stringPolymorphic")},T2IAdapterCollection:{color:"teal.500",description:Z("nodes.t2iAdapterCollectionDescription"),title:Z("nodes.t2iAdapterCollection")},T2IAdapterField:{color:"teal.500",description:Z("nodes.t2iAdapterFieldDescription"),title:Z("nodes.t2iAdapterField")},T2IAdapterModelField:{color:"teal.500",description:"TODO",title:"T2I-Adapter"},T2IAdapterPolymorphic:{color:"teal.500",description:"T2I-Adapter info passed between nodes.",title:"T2I-Adapter Polymorphic"},UNetField:{color:"red.500",description:Z("nodes.uNetFieldDescription"),title:Z("nodes.uNetField")},VaeField:{color:"blue.500",description:Z("nodes.vaeFieldDescription"),title:Z("nodes.vaeField")},VaeModelField:{color:"teal.500",description:Z("nodes.vaeModelFieldDescription"),title:Z("nodes.vaeModelField")}},Y9=(e,t,n)=>{let r=t,i=n;for(;e.find(o=>o.position.x===r&&o.position.y===i);)r=r+50,i=i+50;return{x:r,y:i}},DSe=(e,t)=>{if(e==="Collection"&&t==="Collection")return!1;if(e===t)return!0;const n=e==="CollectionItem"&&!Wv.includes(t),r=t==="CollectionItem"&&!Wv.includes(e)&&!Rg.includes(e),i=Rg.includes(t)&&(()=>{if(!Rg.includes(t))return!1;const u=$Se[t],c=I4[u];return e===u||e===c})(),o=e==="Collection"&&(Wv.includes(t)||Rg.includes(t)),a=t==="Collection"&&Wv.includes(e);return n||r||i||o||a||e==="integer"&&t==="float"||(e==="integer"||e==="float")&&t==="string"};var LSe="\0",zc="\0",Z9="",So,md,Vo,Q0,$h,Nh,ya,Rs,Nu,Os,Du,Tl,kl,Dh,Lh,Pl,Qa,X0,ZA,eN;let FSe=(eN=class{constructor(t){Yn(this,X0);Yn(this,So,!0);Yn(this,md,!1);Yn(this,Vo,!1);Yn(this,Q0,void 0);Yn(this,$h,()=>{});Yn(this,Nh,()=>{});Yn(this,ya,{});Yn(this,Rs,{});Yn(this,Nu,{});Yn(this,Os,{});Yn(this,Du,{});Yn(this,Tl,{});Yn(this,kl,{});Yn(this,Dh,0);Yn(this,Lh,0);Yn(this,Pl,void 0);Yn(this,Qa,void 0);t&&(ca(this,So,t.hasOwnProperty("directed")?t.directed:!0),ca(this,md,t.hasOwnProperty("multigraph")?t.multigraph:!1),ca(this,Vo,t.hasOwnProperty("compound")?t.compound:!1)),ae(this,Vo)&&(ca(this,Pl,{}),ca(this,Qa,{}),ae(this,Qa)[zc]={})}isDirected(){return ae(this,So)}isMultigraph(){return ae(this,md)}isCompound(){return ae(this,Vo)}setGraph(t){return ca(this,Q0,t),this}graph(){return ae(this,Q0)}setDefaultNodeLabel(t){return ca(this,$h,t),typeof t!="function"&&ca(this,$h,()=>t),this}nodeCount(){return ae(this,Dh)}nodes(){return Object.keys(ae(this,ya))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(ae(t,Rs)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(ae(t,Os)[n]).length===0)}setNodes(t,n){var r=arguments,i=this;return t.forEach(function(o){r.length>1?i.setNode(o,n):i.setNode(o)}),this}setNode(t,n){return ae(this,ya).hasOwnProperty(t)?(arguments.length>1&&(ae(this,ya)[t]=n),this):(ae(this,ya)[t]=arguments.length>1?n:ae(this,$h).call(this,t),ae(this,Vo)&&(ae(this,Pl)[t]=zc,ae(this,Qa)[t]={},ae(this,Qa)[zc][t]=!0),ae(this,Rs)[t]={},ae(this,Nu)[t]={},ae(this,Os)[t]={},ae(this,Du)[t]={},++zp(this,Dh)._,this)}node(t){return ae(this,ya)[t]}hasNode(t){return ae(this,ya).hasOwnProperty(t)}removeNode(t){var n=this;if(ae(this,ya).hasOwnProperty(t)){var r=i=>n.removeEdge(ae(n,Tl)[i]);delete ae(this,ya)[t],ae(this,Vo)&&(_s(this,X0,ZA).call(this,t),delete ae(this,Pl)[t],this.children(t).forEach(function(i){n.setParent(i)}),delete ae(this,Qa)[t]),Object.keys(ae(this,Rs)[t]).forEach(r),delete ae(this,Rs)[t],delete ae(this,Nu)[t],Object.keys(ae(this,Os)[t]).forEach(r),delete ae(this,Os)[t],delete ae(this,Du)[t],--zp(this,Dh)._}return this}setParent(t,n){if(!ae(this,Vo))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=zc;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),_s(this,X0,ZA).call(this,t),ae(this,Pl)[t]=n,ae(this,Qa)[n][t]=!0,this}parent(t){if(ae(this,Vo)){var n=ae(this,Pl)[t];if(n!==zc)return n}}children(t=zc){if(ae(this,Vo)){var n=ae(this,Qa)[t];if(n)return Object.keys(n)}else{if(t===zc)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=ae(this,Nu)[t];if(n)return Object.keys(n)}successors(t){var n=ae(this,Du)[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const i=new Set(n);for(var r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:ae(this,So),multigraph:ae(this,md),compound:ae(this,Vo)});n.setGraph(this.graph());var r=this;Object.entries(ae(this,ya)).forEach(function([a,s]){t(a)&&n.setNode(a,s)}),Object.values(ae(this,Tl)).forEach(function(a){n.hasNode(a.v)&&n.hasNode(a.w)&&n.setEdge(a,r.edge(a))});var i={};function o(a){var s=r.parent(a);return s===void 0||n.hasNode(s)?(i[a]=s,s):s in i?i[s]:o(s)}return ae(this,Vo)&&n.nodes().forEach(a=>n.setParent(a,o(a))),n}setDefaultEdgeLabel(t){return ca(this,Nh,t),typeof t!="function"&&ca(this,Nh,()=>t),this}edgeCount(){return ae(this,Lh)}edges(){return Object.values(ae(this,Tl))}setPath(t,n){var r=this,i=arguments;return t.reduce(function(o,a){return i.length>1?r.setEdge(o,a,n):r.setEdge(o,a),a}),this}setEdge(){var t,n,r,i,o=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,n=a.w,r=a.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=a,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var s=Og(ae(this,So),t,n,r);if(ae(this,kl).hasOwnProperty(s))return o&&(ae(this,kl)[s]=i),this;if(r!==void 0&&!ae(this,md))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),ae(this,kl)[s]=o?i:ae(this,Nh).call(this,t,n,r);var l=BSe(ae(this,So),t,n,r);return t=l.v,n=l.w,Object.freeze(l),ae(this,Tl)[s]=l,J9(ae(this,Nu)[n],t),J9(ae(this,Du)[t],n),ae(this,Rs)[n][s]=l,ae(this,Os)[t][s]=l,zp(this,Lh)._++,this}edge(t,n,r){var i=arguments.length===1?t5(ae(this,So),arguments[0]):Og(ae(this,So),t,n,r);return ae(this,kl)[i]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var i=arguments.length===1?t5(ae(this,So),arguments[0]):Og(ae(this,So),t,n,r);return ae(this,kl).hasOwnProperty(i)}removeEdge(t,n,r){var i=arguments.length===1?t5(ae(this,So),arguments[0]):Og(ae(this,So),t,n,r),o=ae(this,Tl)[i];return o&&(t=o.v,n=o.w,delete ae(this,kl)[i],delete ae(this,Tl)[i],eO(ae(this,Nu)[n],t),eO(ae(this,Du)[t],n),delete ae(this,Rs)[n][i],delete ae(this,Os)[t][i],zp(this,Lh)._--),this}inEdges(t,n){var r=ae(this,Rs)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.v===n):i}}outEdges(t,n){var r=ae(this,Os)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.w===n):i}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}},So=new WeakMap,md=new WeakMap,Vo=new WeakMap,Q0=new WeakMap,$h=new WeakMap,Nh=new WeakMap,ya=new WeakMap,Rs=new WeakMap,Nu=new WeakMap,Os=new WeakMap,Du=new WeakMap,Tl=new WeakMap,kl=new WeakMap,Dh=new WeakMap,Lh=new WeakMap,Pl=new WeakMap,Qa=new WeakMap,X0=new WeakSet,ZA=function(t){delete ae(this,Qa)[ae(this,Pl)[t]][t]},eN);function J9(e,t){e[t]?e[t]++:e[t]=1}function eO(e,t){--e[t]||delete e[t]}function Og(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}return i+Z9+o+Z9+(r===void 0?LSe:r)}function BSe(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function t5(e,t){return Og(e,t.v,t.w,t.name)}var R4=FSe,zSe="2.1.13",jSe={Graph:R4,version:zSe},USe=R4,VSe={write:GSe,read:WSe};function GSe(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:qSe(e),edges:HSe(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function qSe(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function HSe(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function WSe(e){var t=new USe(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var KSe=QSe;function QSe(e){var t={},n=[],r;function i(o){t.hasOwnProperty(o)||(t[o]=!0,r.push(o),e.successors(o).forEach(i),e.predecessors(o).forEach(i))}return e.nodes().forEach(function(o){r=[],i(o),r.length&&n.push(r)}),n}var zi,Il,Y0,JA,Z0,eE,Fh,J1,tN;let XSe=(tN=class{constructor(){Yn(this,Y0);Yn(this,Z0);Yn(this,Fh);Yn(this,zi,[]);Yn(this,Il,{})}size(){return ae(this,zi).length}keys(){return ae(this,zi).map(function(t){return t.key})}has(t){return ae(this,Il).hasOwnProperty(t)}priority(t){var n=ae(this,Il)[t];if(n!==void 0)return ae(this,zi)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return ae(this,zi)[0].key}add(t,n){var r=ae(this,Il);if(t=String(t),!r.hasOwnProperty(t)){var i=ae(this,zi),o=i.length;return r[t]=o,i.push({key:t,priority:n}),_s(this,Z0,eE).call(this,o),!0}return!1}removeMin(){_s(this,Fh,J1).call(this,0,ae(this,zi).length-1);var t=ae(this,zi).pop();return delete ae(this,Il)[t.key],_s(this,Y0,JA).call(this,0),t.key}decrease(t,n){var r=ae(this,Il)[t];if(n>ae(this,zi)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+ae(this,zi)[r].priority+" New: "+n);ae(this,zi)[r].priority=n,_s(this,Z0,eE).call(this,r)}},zi=new WeakMap,Il=new WeakMap,Y0=new WeakSet,JA=function(t){var n=ae(this,zi),r=2*t,i=r+1,o=t;r<n.length&&(o=n[r].priority<n[o].priority?r:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(_s(this,Fh,J1).call(this,t,o),_s(this,Y0,JA).call(this,o)))},Z0=new WeakSet,eE=function(t){for(var n=ae(this,zi),r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)_s(this,Fh,J1).call(this,t,i),t=i},Fh=new WeakSet,J1=function(t,n){var r=ae(this,zi),i=ae(this,Il),o=r[t],a=r[n];r[t]=a,r[n]=o,i[a.key]=t,i[o.key]=n},tN);var QV=XSe,YSe=QV,XV=JSe,ZSe=()=>1;function JSe(e,t,n,r){return e2e(e,String(t),n||ZSe,r||function(i){return e.outEdges(i)})}function e2e(e,t,n,r){var i={},o=new YSe,a,s,l=function(u){var c=u.v!==a?u.v:u.w,d=i[c],f=n(u),h=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=a,o.decrease(c,h))};for(e.nodes().forEach(function(u){var c=u===t?0:Number.POSITIVE_INFINITY;i[u]={distance:c},o.add(u,c)});o.size()>0&&(a=o.removeMin(),s=i[a],s.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(l);return i}var t2e=XV,n2e=r2e;function r2e(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=t2e(e,i,t,n),r},{})}var YV=i2e;function i2e(e){var t=0,n=[],r={},i=[];function o(a){var s=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){r.hasOwnProperty(c)?r[c].onStack&&(s.lowlink=Math.min(s.lowlink,r[c].index)):(o(c),s.lowlink=Math.min(s.lowlink,r[c].lowlink))}),s.lowlink===s.index){var l=[],u;do u=n.pop(),r[u].onStack=!1,l.push(u);while(a!==u);i.push(l)}}return e.nodes().forEach(function(a){r.hasOwnProperty(a)||o(a)}),i}var o2e=YV,a2e=s2e;function s2e(e){return o2e(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var l2e=c2e,u2e=()=>1;function c2e(e,t,n){return d2e(e,t||u2e,n||function(r){return e.outEdges(r)})}function d2e(e,t,n){var r={},i=e.nodes();return i.forEach(function(o){r[o]={},r[o][o]={distance:0},i.forEach(function(a){o!==a&&(r[o][a]={distance:Number.POSITIVE_INFINITY})}),n(o).forEach(function(a){var s=a.v===o?a.w:a.v,l=t(a);r[o][s]={distance:l,predecessor:o}})}),i.forEach(function(o){var a=r[o];i.forEach(function(s){var l=r[s];i.forEach(function(u){var c=l[o],d=a[u],f=l[u],h=c.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),r}function ZV(e){var t={},n={},r=[];function i(o){if(n.hasOwnProperty(o))throw new tE;t.hasOwnProperty(o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(i),delete n[o],r.push(o))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new tE;return r}class tE extends Error{constructor(){super(...arguments)}}var JV=ZV;ZV.CycleException=tE;var tO=JV,f2e=h2e;function h2e(e){try{tO(e)}catch(t){if(t instanceof tO.CycleException)return!1;throw t}return!0}var eG=p2e;function p2e(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?s=>e.successors(s):s=>e.neighbors(s),i=n==="post"?g2e:m2e,o=[],a={};return t.forEach(s=>{if(!e.hasNode(s))throw new Error("Graph does not have node: "+s);i(s,r,a,o)}),o}function g2e(e,t,n,r){for(var i=[[e,!1]];i.length>0;){var o=i.pop();o[1]?r.push(o[0]):n.hasOwnProperty(o[0])||(n[o[0]]=!0,i.push([o[0],!0]),tG(t(o[0]),a=>i.push([a,!1])))}}function m2e(e,t,n,r){for(var i=[e];i.length>0;){var o=i.pop();n.hasOwnProperty(o)||(n[o]=!0,r.push(o),tG(t(o),a=>i.push(a)))}}function tG(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var y2e=eG,v2e=b2e;function b2e(e,t){return y2e(e,t,"post")}var _2e=eG,S2e=x2e;function x2e(e,t){return _2e(e,t,"pre")}var w2e=R4,C2e=QV,A2e=E2e;function E2e(e,t){var n=new w2e,r={},i=new C2e,o;function a(l){var u=l.v===o?l.w:l.v,c=i.priority(u);if(c!==void 0){var d=t(l);d<c&&(r[u]=o,i.decrease(u,d))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(l){i.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),i.decrease(e.nodes()[0],0);for(var s=!1;i.size()>0;){if(o=i.removeMin(),r.hasOwnProperty(o))n.setEdge(o,r[o]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(o).forEach(a)}return n}var T2e={components:KSe,dijkstra:XV,dijkstraAll:n2e,findCycles:a2e,floydWarshall:l2e,isAcyclic:f2e,postorder:v2e,preorder:S2e,prim:A2e,tarjan:YV,topsort:JV},nO=jSe,k2e={Graph:nO.Graph,json:VSe,alg:T2e,version:nO.version};const rO=Sc(k2e),iO=(e,t,n,r)=>{const i=new rO.Graph;return n.forEach(o=>{i.setNode(o.id)}),r.forEach(o=>{i.setEdge(o.source,o.target)}),i.setEdge(e,t),rO.alg.isAcyclic(i)},oO=(e,t,n,r,i)=>{let o=!0;return t==="source"?e.find(a=>a.target===r.id&&a.targetHandle===i.name)&&(o=!1):e.find(a=>a.source===r.id&&a.sourceHandle===i.name)&&(o=!1),DSe(n,i.type)||(o=!1),o},aO=(e,t,n,r,i,o,a)=>{if(e.id===r)return null;const s=o=="source"?e.data.inputs:e.data.outputs;if(s[i]){const l=s[i],u=o=="source"?r:e.id,c=o=="source"?e.id:r,d=o=="source"?i:l.name,f=o=="source"?l.name:i,h=iO(u,c,t,n),p=oO(n,o,a,e,l);if(h&&p)return{source:u,sourceHandle:d,target:c,targetHandle:f}}for(const l in s){const u=s[l],c=o=="source"?r:e.id,d=o=="source"?e.id:r,f=o=="source"?i:u.name,h=o=="source"?u.name:i,p=iO(c,d,t,n),m=oO(n,o,a,e,u);if(p&&m)return{source:c,sourceHandle:f,target:d,targetHandle:h}}return null},P2e="1.0.0",n5={status:Jc.PENDING,error:null,progress:null,progressImage:null,outputs:[]},nE={meta:{version:P2e},name:"",author:"",description:"",notes:"",tags:"",contact:"",version:"",exposedFields:[]},nG={nodes:[],edges:[],nodeTemplates:{},isReady:!1,connectionStartParams:null,currentConnectionFieldType:null,connectionMade:!1,modifyingEdge:!1,addNewNodePosition:null,shouldShowFieldTypeLegend:!1,shouldShowMinimapPanel:!0,shouldValidateGraph:!0,shouldAnimateEdges:!0,shouldSnapToGrid:!1,shouldColorEdges:!0,isAddNodePopoverOpen:!1,nodeOpacity:1,selectedNodes:[],selectedEdges:[],workflow:nE,nodeExecutionStates:{},viewport:{x:0,y:0,zoom:1},mouseOverField:null,mouseOverNode:null,nodesToCopy:[],edgesToCopy:[],selectionMode:pc.Partial},Ji=(e,t)=>{var l,u;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(c=>c.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!Vr(a))return;const s=(u=a.data)==null?void 0:u.inputs[r];s&&o>-1&&(s.value=i)},rG=nr({name:"nodes",initialState:nG,reducers:{nodesChanged:(e,t)=>{e.nodes=Qc(t.payload,e.nodes)},nodeAdded:(e,t)=>{var i,o;const n=t.payload,r=Y9(e.nodes,((i=e.addNewNodePosition)==null?void 0:i.x)??n.position.x,((o=e.addNewNodePosition)==null?void 0:o.y)??n.position.y);if(n.position=r,n.selected=!0,e.nodes=Qc(e.nodes.map(a=>({id:a.id,type:"select",selected:!1})),e.nodes),e.edges=Bc(e.edges.map(a=>({id:a.id,type:"select",selected:!1})),e.edges),e.nodes.push(n),!!Vr(n)){if(e.nodeExecutionStates[n.id]={nodeId:n.id,...n5},e.connectionStartParams){const{nodeId:a,handleId:s,handleType:l}=e.connectionStartParams;if(a&&s&&l&&e.currentConnectionFieldType){const u=aO(n,e.nodes,e.edges,a,s,l,e.currentConnectionFieldType);u&&(e.edges=Ig({...u,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}},edgeChangeStarted:e=>{e.modifyingEdge=!0},edgesChanged:(e,t)=>{e.edges=Bc(t.payload,e.edges)},edgeAdded:(e,t)=>{e.edges=Ig(t.payload,e.edges)},edgeUpdated:(e,t)=>{const{oldEdge:n,newConnection:r}=t.payload;e.edges=a_e(n,r,e.edges)},connectionStarted:(e,t)=>{var l;e.connectionStartParams=t.payload,e.connectionMade=e.modifyingEdge;const{nodeId:n,handleId:r,handleType:i}=t.payload;if(!n||!r)return;const o=e.nodes.findIndex(u=>u.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!Vr(a))return;const s=i==="source"?a.data.outputs[r]:a.data.inputs[r];e.currentConnectionFieldType=(s==null?void 0:s.type)??null},connectionMade:(e,t)=>{e.currentConnectionFieldType&&(e.edges=Ig({...t.payload,type:"default"},e.edges),e.connectionMade=!0)},connectionEnded:(e,t)=>{var n;if(e.connectionMade)e.connectionStartParams=null,e.currentConnectionFieldType=null;else if(e.mouseOverNode){const r=e.nodes.findIndex(o=>o.id===e.mouseOverNode),i=(n=e.nodes)==null?void 0:n[r];if(i&&e.connectionStartParams){const{nodeId:o,handleId:a,handleType:s}=e.connectionStartParams;if(o&&a&&s&&e.currentConnectionFieldType){const l=aO(i,e.nodes,e.edges,o,a,s,e.currentConnectionFieldType);l&&(e.edges=Ig({...l,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}else e.addNewNodePosition=t.payload.cursorPosition,e.isAddNodePopoverOpen=!0;e.modifyingEdge=!1},workflowExposedFieldAdded:(e,t)=>{e.workflow.exposedFields=hA(e.workflow.exposedFields.concat(t.payload),n=>`${n.nodeId}-${n.fieldName}`)},workflowExposedFieldRemoved:(e,t)=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(n=>!Ak(n,t.payload))},fieldLabelChanged:(e,t)=>{const{nodeId:n,fieldName:r,label:i}=t.payload,o=e.nodes.find(s=>s.id===n);if(!Vr(o))return;const a=o.data.inputs[r];a&&(a.label=i)},nodeEmbedWorkflowChanged:(e,t)=>{var a;const{nodeId:n,embedWorkflow:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Vr(o)&&(o.data.embedWorkflow=r)},nodeUseCacheChanged:(e,t)=>{var a;const{nodeId:n,useCache:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Vr(o)&&(o.data.useCache=r)},nodeIsIntermediateChanged:(e,t)=>{var a;const{nodeId:n,isIntermediate:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Vr(o)&&(o.data.isIntermediate=r)},nodeIsOpenChanged:(e,t)=>{var s;const{nodeId:n,isOpen:r}=t.payload,i=e.nodes.findIndex(l=>l.id===n),o=(s=e.nodes)==null?void 0:s[i];if(!Vr(o)&&!sR(o)||(o.data.isOpen=r,!Vr(o)))return;const a=E4([o],e.edges);if(r)a.forEach(l=>{delete l.hidden}),a.forEach(l=>{l.type==="collapsed"&&(e.edges=e.edges.filter(u=>u.id!==l.id))});else{const l=i_e(o,e.nodes,e.edges).filter(d=>Vr(d)&&d.data.isOpen===!1),u=r_e(o,e.nodes,e.edges).filter(d=>Vr(d)&&d.data.isOpen===!1),c=[];a.forEach(d=>{var f,h;if(d.target===n&&l.find(p=>p.id===d.source)){d.hidden=!0;const p=c.find(m=>m.source===d.source&&m.target===d.target);p?p.data={count:(((f=p.data)==null?void 0:f.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}if(d.source===n&&u.find(p=>p.id===d.target)){const p=c.find(m=>m.source===d.source&&m.target===d.target);d.hidden=!0,p?p.data={count:(((h=p.data)==null?void 0:h.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}}),c.length&&(e.edges=Bc(c.map(d=>({type:"add",item:d})),e.edges))}},edgeDeleted:(e,t)=>{e.edges=e.edges.filter(n=>n.id!==t.payload)},edgesDeleted:(e,t)=>{const r=t.payload.filter(i=>i.type==="collapsed");if(r.length){const i=[];r.forEach(o=>{e.edges.forEach(a=>{a.source===o.source&&a.target===o.target&&i.push({id:a.id,type:"remove"})})}),e.edges=Bc(i,e.edges)}},nodesDeleted:(e,t)=>{t.payload.forEach(n=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(r=>r.nodeId!==n.id),Vr(n)&&delete e.nodeExecutionStates[n.id]})},nodeLabelChanged:(e,t)=>{var a;const{nodeId:n,label:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Vr(o)&&(o.data.label=r)},nodeNotesChanged:(e,t)=>{var a;const{nodeId:n,notes:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Vr(o)&&(o.data.notes=r)},nodeExclusivelySelected:(e,t)=>{const n=t.payload;e.nodes=Qc(e.nodes.map(r=>({id:r.id,type:"select",selected:r.id===n})),e.nodes)},selectedNodesChanged:(e,t)=>{e.selectedNodes=t.payload},selectedEdgesChanged:(e,t)=>{e.selectedEdges=t.payload},fieldStringValueChanged:(e,t)=>{Ji(e,t)},fieldNumberValueChanged:(e,t)=>{Ji(e,t)},fieldBooleanValueChanged:(e,t)=>{Ji(e,t)},fieldBoardValueChanged:(e,t)=>{Ji(e,t)},fieldImageValueChanged:(e,t)=>{Ji(e,t)},fieldColorValueChanged:(e,t)=>{Ji(e,t)},fieldMainModelValueChanged:(e,t)=>{Ji(e,t)},fieldRefinerModelValueChanged:(e,t)=>{Ji(e,t)},fieldVaeModelValueChanged:(e,t)=>{Ji(e,t)},fieldLoRAModelValueChanged:(e,t)=>{Ji(e,t)},fieldControlNetModelValueChanged:(e,t)=>{Ji(e,t)},fieldIPAdapterModelValueChanged:(e,t)=>{Ji(e,t)},fieldT2IAdapterModelValueChanged:(e,t)=>{Ji(e,t)},fieldEnumModelValueChanged:(e,t)=>{Ji(e,t)},fieldSchedulerValueChanged:(e,t)=>{Ji(e,t)},imageCollectionFieldValueChanged:(e,t)=>{var u,c;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(d=>d.id===n);if(o===-1)return;const a=(u=e.nodes)==null?void 0:u[o];if(!Vr(a))return;const s=(c=a.data)==null?void 0:c.inputs[r];if(!s)return;const l=Ut(s.value);if(!l){s.value=i;return}s.value=hA(l.concat(i),"image_name")},notesNodeValueChanged:(e,t)=>{var a;const{nodeId:n,value:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];sR(o)&&(o.data.notes=r)},shouldShowFieldTypeLegendChanged:(e,t)=>{e.shouldShowFieldTypeLegend=t.payload},shouldShowMinimapPanelChanged:(e,t)=>{e.shouldShowMinimapPanel=t.payload},nodeTemplatesBuilt:(e,t)=>{e.nodeTemplates=t.payload,e.isReady=!0},nodeEditorReset:e=>{e.nodes=[],e.edges=[],e.workflow=Ut(nE)},shouldValidateGraphChanged:(e,t)=>{e.shouldValidateGraph=t.payload},shouldAnimateEdgesChanged:(e,t)=>{e.shouldAnimateEdges=t.payload},shouldSnapToGridChanged:(e,t)=>{e.shouldSnapToGrid=t.payload},shouldColorEdgesChanged:(e,t)=>{e.shouldColorEdges=t.payload},nodeOpacityChanged:(e,t)=>{e.nodeOpacity=t.payload},workflowNameChanged:(e,t)=>{e.workflow.name=t.payload},workflowDescriptionChanged:(e,t)=>{e.workflow.description=t.payload},workflowTagsChanged:(e,t)=>{e.workflow.tags=t.payload},workflowAuthorChanged:(e,t)=>{e.workflow.author=t.payload},workflowNotesChanged:(e,t)=>{e.workflow.notes=t.payload},workflowVersionChanged:(e,t)=>{e.workflow.version=t.payload},workflowContactChanged:(e,t)=>{e.workflow.contact=t.payload},workflowLoaded:(e,t)=>{const{nodes:n,edges:r,...i}=t.payload;e.workflow=i,e.nodes=Qc(n.map(o=>({item:{...o,dragHandle:`.${OSe}`},type:"add"})),[]),e.edges=Bc(r.map(o=>({item:o,type:"add"})),[]),e.nodeExecutionStates=n.reduce((o,a)=>(o[a.id]={nodeId:a.id,...n5},o),{})},workflowReset:e=>{e.workflow=Ut(nE)},viewportChanged:(e,t)=>{e.viewport=t.payload},mouseOverFieldChanged:(e,t)=>{e.mouseOverField=t.payload},mouseOverNodeChanged:(e,t)=>{e.mouseOverNode=t.payload},selectedAll:e=>{e.nodes=Qc(e.nodes.map(t=>({id:t.id,type:"select",selected:!0})),e.nodes),e.edges=Bc(e.edges.map(t=>({id:t.id,type:"select",selected:!0})),e.edges)},selectionCopied:e=>{if(e.nodesToCopy=e.nodes.filter(t=>t.selected).map(Ut),e.edgesToCopy=e.edges.filter(t=>t.selected).map(Ut),e.nodesToCopy.length>0){const t={x:0,y:0};e.nodesToCopy.forEach(n=>{const r=.15*(n.width??0),i=.5*(n.height??0);t.x+=n.position.x+r,t.y+=n.position.y+i}),t.x/=e.nodesToCopy.length,t.y/=e.nodesToCopy.length,e.nodesToCopy.forEach(n=>{n.position.x-=t.x,n.position.y-=t.y})}},selectionPasted:(e,t)=>{const{cursorPosition:n}=t.payload,r=e.nodesToCopy.map(Ut),i=r.map(c=>c.data.id),o=e.edgesToCopy.filter(c=>i.includes(c.source)&&i.includes(c.target)).map(Ut);o.forEach(c=>c.selected=!0),r.forEach(c=>{const d=Zg();o.forEach(h=>{h.source===c.data.id&&(h.source=d,h.id=h.id.replace(c.data.id,d)),h.target===c.data.id&&(h.target=d,h.id=h.id.replace(c.data.id,d))}),c.selected=!0,c.id=d,c.data.id=d;const f=Y9(e.nodes,c.position.x+((n==null?void 0:n.x)??0),c.position.y+((n==null?void 0:n.y)??0));c.position=f});const a=r.map(c=>({item:c,type:"add"})),s=e.nodes.map(c=>({id:c.data.id,type:"select",selected:!1})),l=o.map(c=>({item:c,type:"add"})),u=e.edges.map(c=>({id:c.id,type:"select",selected:!1}));e.nodes=Qc(a.concat(s),e.nodes),e.edges=Bc(l.concat(u),e.edges),r.forEach(c=>{e.nodeExecutionStates[c.id]={nodeId:c.id,...n5}})},addNodePopoverOpened:e=>{e.addNewNodePosition=null,e.isAddNodePopoverOpen=!0},addNodePopoverClosed:e=>{e.isAddNodePopoverOpen=!1,e.connectionStartParams=null,e.currentConnectionFieldType=null},addNodePopoverToggled:e=>{e.isAddNodePopoverOpen=!e.isAddNodePopoverOpen},selectionModeChanged:(e,t)=>{e.selectionMode=t.payload?pc.Full:pc.Partial}},extraReducers:e=>{e.addCase(E0.pending,t=>{t.isReady=!1}),e.addCase(kk,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Jc.IN_PROGRESS)}),e.addCase(Ik,(t,n)=>{const{source_node_id:r,result:i}=n.payload.data,o=t.nodeExecutionStates[r];o&&(o.status=Jc.COMPLETED,o.progress!==null&&(o.progress=1),o.outputs.push(i))}),e.addCase(a2,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Jc.FAILED,i.error=n.payload.data.error,i.progress=null,i.progressImage=null)}),e.addCase(Rk,(t,n)=>{const{source_node_id:r,step:i,total_steps:o,progress_image:a}=n.payload.data,s=t.nodeExecutionStates[r];s&&(s.status=Jc.IN_PROGRESS,s.progress=(i+1)/o,s.progressImage=a??null)}),e.addCase(s2,(t,n)=>{["in_progress"].includes(n.payload.data.queue_item.status)&&Xl(t.nodeExecutionStates,r=>{r.status=Jc.PENDING,r.error=null,r.progress=null,r.progressImage=null,r.outputs=[]})})}}),{addNodePopoverClosed:cHe,addNodePopoverOpened:dHe,addNodePopoverToggled:fHe,connectionEnded:hHe,connectionMade:pHe,connectionStarted:gHe,edgeDeleted:mHe,edgeChangeStarted:yHe,edgesChanged:vHe,edgesDeleted:bHe,edgeUpdated:_He,fieldBoardValueChanged:SHe,fieldBooleanValueChanged:xHe,fieldColorValueChanged:wHe,fieldControlNetModelValueChanged:CHe,fieldEnumModelValueChanged:AHe,fieldImageValueChanged:ux,fieldIPAdapterModelValueChanged:EHe,fieldT2IAdapterModelValueChanged:THe,fieldLabelChanged:kHe,fieldLoRAModelValueChanged:PHe,fieldMainModelValueChanged:IHe,fieldNumberValueChanged:RHe,fieldRefinerModelValueChanged:OHe,fieldSchedulerValueChanged:MHe,fieldStringValueChanged:$He,fieldVaeModelValueChanged:NHe,imageCollectionFieldValueChanged:DHe,mouseOverFieldChanged:LHe,mouseOverNodeChanged:FHe,nodeAdded:BHe,nodeEditorReset:I2e,nodeEmbedWorkflowChanged:zHe,nodeExclusivelySelected:jHe,nodeIsIntermediateChanged:UHe,nodeIsOpenChanged:VHe,nodeLabelChanged:GHe,nodeNotesChanged:qHe,nodeOpacityChanged:HHe,nodesChanged:WHe,nodesDeleted:KHe,nodeTemplatesBuilt:iG,nodeUseCacheChanged:QHe,notesNodeValueChanged:XHe,selectedAll:YHe,selectedEdgesChanged:ZHe,selectedNodesChanged:JHe,selectionCopied:eWe,selectionModeChanged:tWe,selectionPasted:nWe,shouldAnimateEdgesChanged:rWe,shouldColorEdgesChanged:iWe,shouldShowFieldTypeLegendChanged:oWe,shouldShowMinimapPanelChanged:aWe,shouldSnapToGridChanged:sWe,shouldValidateGraphChanged:lWe,viewportChanged:uWe,workflowAuthorChanged:cWe,workflowContactChanged:dWe,workflowDescriptionChanged:fWe,workflowExposedFieldAdded:R2e,workflowExposedFieldRemoved:hWe,workflowLoaded:O2e,workflowNameChanged:pWe,workflowNotesChanged:gWe,workflowTagsChanged:mWe,workflowVersionChanged:yWe,edgeAdded:vWe}=rG.actions,M2e=rG.reducer,oG={esrganModelName:"RealESRGAN_x4plus.pth"},aG=nr({name:"postprocessing",initialState:oG,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:bWe}=aG.actions,$2e=aG.reducer,sG={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.8},lG=nr({name:"sdxl",initialState:sG,reducers:{setPositiveStylePromptSDXL:(e,t)=>{e.positiveStylePrompt=t.payload},setNegativeStylePromptSDXL:(e,t)=>{e.negativeStylePrompt=t.payload},setShouldConcatSDXLStylePrompt:(e,t)=>{e.shouldConcatSDXLStylePrompt=t.payload},setShouldUseSDXLRefiner:(e,t)=>{e.shouldUseSDXLRefiner=t.payload},setSDXLImg2ImgDenoisingStrength:(e,t)=>{e.sdxlImg2ImgDenoisingStrength=t.payload},refinerModelChanged:(e,t)=>{e.refinerModel=t.payload},setRefinerSteps:(e,t)=>{e.refinerSteps=t.payload},setRefinerCFGScale:(e,t)=>{e.refinerCFGScale=t.payload},setRefinerScheduler:(e,t)=>{e.refinerScheduler=t.payload},setRefinerPositiveAestheticScore:(e,t)=>{e.refinerPositiveAestheticScore=t.payload},setRefinerNegativeAestheticScore:(e,t)=>{e.refinerNegativeAestheticScore=t.payload},setRefinerStart:(e,t)=>{e.refinerStart=t.payload}}}),{setPositiveStylePromptSDXL:_We,setNegativeStylePromptSDXL:SWe,setShouldConcatSDXLStylePrompt:xWe,setShouldUseSDXLRefiner:N2e,setSDXLImg2ImgDenoisingStrength:wWe,refinerModelChanged:sO,setRefinerSteps:CWe,setRefinerCFGScale:AWe,setRefinerScheduler:EWe,setRefinerPositiveAestheticScore:TWe,setRefinerNegativeAestheticScore:kWe,setRefinerStart:PWe}=lG.actions,D2e=lG.reducer,L2e=(e,t,n)=>t===0?0:n===2?Math.floor((e+1+1)/2)/Math.floor((t+1)/2):(e+1+1)/(t+1),Vd=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},uG={isInitialized:!1,isConnected:!1,shouldConfirmOnDelete:!0,enableImageDebugging:!1,toastQueue:[],denoiseProgress:null,shouldAntialiasProgressImage:!1,consoleLogLevel:"debug",shouldLogToConsole:!0,language:"en",shouldUseNSFWChecker:!1,shouldUseWatermarker:!1,shouldEnableInformationalPopovers:!1,status:"DISCONNECTED"},cG=nr({name:"system",initialState:uG,reducers:{setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},consoleLogLevelChanged:(e,t)=>{e.consoleLogLevel=t.payload},shouldLogToConsoleChanged:(e,t)=>{e.shouldLogToConsole=t.payload},shouldAntialiasProgressImageChanged:(e,t)=>{e.shouldAntialiasProgressImage=t.payload},languageChanged:(e,t)=>{e.language=t.payload},shouldUseNSFWCheckerChanged(e,t){e.shouldUseNSFWChecker=t.payload},shouldUseWatermarkerChanged(e,t){e.shouldUseWatermarker=t.payload},setShouldEnableInformationalPopovers(e,t){e.shouldEnableInformationalPopovers=t.payload},isInitializedChanged(e,t){e.isInitialized=t.payload}},extraReducers(e){e.addCase(Tk,t=>{t.isConnected=!0,t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(IB,t=>{t.isConnected=!1,t.denoiseProgress=null,t.status="DISCONNECTED"}),e.addCase(kk,t=>{t.denoiseProgress=null,t.status="PROCESSING"}),e.addCase(Rk,(t,n)=>{const{step:r,total_steps:i,order:o,progress_image:a,graph_execution_state_id:s,queue_batch_id:l}=n.payload.data;t.denoiseProgress={step:r,total_steps:i,order:o,percentage:L2e(r,i,o),progress_image:a,session_id:s,batch_id:l},t.status="PROCESSING"}),e.addCase(Ik,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase($B,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(LB,t=>{t.status="LOADING_MODEL"}),e.addCase(BB,t=>{t.status="CONNECTED"}),e.addCase(s2,(t,n)=>{["completed","canceled","failed"].includes(n.payload.data.queue_item.status)&&(t.status="CONNECTED",t.denoiseProgress=null)}),e.addMatcher(U2e,(t,n)=>{t.toastQueue.push(Vd({title:Z("toast.serverError"),status:"error",description:Mae(n.payload.data.error_type)}))})}}),{setShouldConfirmOnDelete:IWe,setEnableImageDebugging:RWe,addToast:qt,clearToastQueue:OWe,consoleLogLevelChanged:MWe,shouldLogToConsoleChanged:$We,shouldAntialiasProgressImageChanged:NWe,languageChanged:DWe,shouldUseNSFWCheckerChanged:F2e,shouldUseWatermarkerChanged:B2e,setShouldEnableInformationalPopovers:LWe,isInitializedChanged:z2e}=cG.actions,j2e=cG.reducer,U2e=Qi(a2,jB,VB),V2e={listCursor:void 0,listPriority:void 0,selectedQueueItem:void 0,resumeProcessorOnEnqueue:!0},G2e=V2e,dG=nr({name:"queue",initialState:G2e,reducers:{listCursorChanged:(e,t)=>{e.listCursor=t.payload},listPriorityChanged:(e,t)=>{e.listPriority=t.payload},listParamsReset:e=>{e.listCursor=void 0,e.listPriority=void 0},queueItemSelectionToggled:(e,t)=>{e.selectedQueueItem===t.payload?e.selectedQueueItem=void 0:e.selectedQueueItem=t.payload},resumeProcessorOnEnqueueChanged:(e,t)=>{e.resumeProcessorOnEnqueue=t.payload}}}),{listCursorChanged:FWe,listPriorityChanged:BWe,listParamsReset:q2e,queueItemSelectionToggled:zWe,resumeProcessorOnEnqueueChanged:jWe}=dG.actions,H2e=dG.reducer,W2e={searchFolder:null,advancedAddScanModel:null},fG=nr({name:"modelmanager",initialState:W2e,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:UWe,setAdvancedAddScanModel:VWe}=fG.actions,K2e=fG.reducer,hG={shift:!1,ctrl:!1,meta:!1},pG=nr({name:"hotkeys",initialState:hG,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload},ctrlKeyPressed:(e,t)=>{e.ctrl=t.payload},metaKeyPressed:(e,t)=>{e.meta=t.payload}}}),{shiftKeyPressed:GWe,ctrlKeyPressed:qWe,metaKeyPressed:HWe}=pG.actions,Q2e=pG.reducer,gG={activeTab:"txt2img",shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,shouldAutoChangeDimensions:!1,favoriteSchedulers:[],globalContextMenuCloseTrigger:0,panels:{}},mG=nr({name:"ui",initialState:gG,reducers:{setActiveTab:(e,t)=>{e.activeTab=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldHidePreview:(e,t)=>{e.shouldHidePreview=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setShouldUseSliders:(e,t)=>{e.shouldUseSliders=t.payload},setShouldShowProgressInViewer:(e,t)=>{e.shouldShowProgressInViewer=t.payload},favoriteSchedulersChanged:(e,t)=>{e.favoriteSchedulers=t.payload},toggleEmbeddingPicker:e=>{e.shouldShowEmbeddingPicker=!e.shouldShowEmbeddingPicker},setShouldAutoChangeDimensions:(e,t)=>{e.shouldAutoChangeDimensions=t.payload},contextMenusClosed:e=>{e.globalContextMenuCloseTrigger+=1},panelsChanged:(e,t)=>{e.panels[t.payload.name]=t.payload.value}},extraReducers(e){e.addCase(f2,t=>{t.activeTab="img2img"})}}),{setActiveTab:yG,setShouldShowImageDetails:WWe,setShouldUseCanvasBetaLayout:KWe,setShouldShowExistingModelsInSearch:QWe,setShouldUseSliders:XWe,setShouldHidePreview:YWe,setShouldShowProgressInViewer:ZWe,favoriteSchedulersChanged:JWe,toggleEmbeddingPicker:eKe,setShouldAutoChangeDimensions:tKe,contextMenusClosed:nKe,panelsChanged:rKe}=mG.actions,X2e=mG.reducer,Y2e=xS(KY);vG=rE=void 0;var Z2e=Y2e,J2e=function(){var t=[],n=[],r=void 0,i=function(u){return r=u,function(c){return function(d){return Z2e.compose.apply(void 0,n)(c)(d)}}},o=function(){for(var u,c,d=arguments.length,f=Array(d),h=0;h<d;h++)f[h]=arguments[h];(u=n).push.apply(u,f.map(function(p){return p(r)})),(c=t).push.apply(c,f)},a=function(u){var c=t.findIndex(function(d){return d===u});if(c===-1){console.error("Middleware does not exist!",u);return}t=t.filter(function(d,f){return f!==c}),n=n.filter(function(d,f){return f!==c})},s=function(){n=[],t=[]};return{enhancer:i,addMiddleware:o,removeMiddleware:a,resetMiddlewares:s}},cx=J2e(),exe=cx.enhancer,txe=cx.addMiddleware;cx.removeMiddleware;var nxe=cx.resetMiddlewares,rE=txe,vG=nxe,iE="@@REMEMBER_REHYDRATED",rxe="@@REMEMBER_PERSISTED";function oE(e){"@babel/helpers - typeof";return oE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oE(e)}var bG=function(t,n){if(t===null||oE(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];i[o]=t[o]}return i},ixe=function(t,n){var r=0,i;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=+new Date,u=(r||l)-l;if(u<=0&&!i){r=l+n,t.apply(void 0,a);return}i&&(clearTimeout(i),i=null),i=setTimeout(function(){r=+new Date+n,t.apply(void 0,a),clearTimeout(i),i=null},u)}},oxe=function(t,n){var r;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o),r=null},n)}};function lO(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function O4(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){lO(o,r,i,a,s,"next",l)}function s(l){lO(o,r,i,a,s,"throw",l)}a(void 0)})}}var axe=function(){var e=O4(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield r.getItem("".concat(i,"rootState"));return a==null?{}:bG(o(a,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),sxe=function(){var e=O4(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield Promise.all(n.map(function(s){return r.getItem("".concat(i).concat(s))}));return n.reduce(function(s,l,u){return a[u]!==null&&a[u]!==void 0&&(s[l]=o(a[u],l)),s},{})});return function(n){return e.apply(this,arguments)}}(),lxe=function(){var e=O4(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.persistWholeStore,s=r.unserialize,l={};try{var u=a?axe:sxe;l=yield u({rememberedKeys:n,driver:o,prefix:i,unserialize:s})}catch(c){console.warn("redux-remember: rehydrate error",c)}t.dispatch({type:iE,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function r5(e,t){return dxe(e)||cxe(e,t)||_G(e,t)||uxe()}function uxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cxe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function dxe(e){if(Array.isArray(e))return e}function i5(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_G(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function _G(e,t){if(e){if(typeof e=="string")return uO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uO(e,t)}}function uO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q_(e){"@babel/helpers - typeof";return q_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q_(e)}var cO=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},dO=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},fxe=function e(t,n){if(t===n)return!0;if(q_(t)!=="object"||q_(n)!=="object"||t===null||t===void 0||n===null||n===void 0)return t!==t&&n!==n;if(t.constructor!==n.constructor)return!1;if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(Array.isArray(t)){if(t.length!==n.length)return!1;for(var r=t.length;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(dO(t)&&dO(n)){if(t.byteLength!==n.byteLength)return!1;for(var i=t.byteLength;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}var o=cO(t),a=cO(n);if(o==="DataView"&&a==="DataView")return t.byteLength!==n.byteLength||t.byteOffset!==n.byteOffset?!1:e(t.buffer,n.buffer);if(o==="ArrayBuffer"&&a==="ArrayBuffer")return t.byteLength!==n.byteLength?!1:e(new Uint8Array(t),new Uint8Array(n));if(o==="Map"&&a==="Map"){if(t.size!==n.size)return!1;var s=i5(t.entries()),l;try{for(s.s();!(l=s.n()).done;){var u=r5(l.value,1),c=u[0];if(!n.has(c))return!1}}catch(C){s.e(C)}finally{s.f()}var d=i5(t.entries()),f;try{for(d.s();!(f=d.n()).done;){var h=r5(f.value,2),p=h[0],m=h[1];if(!e(m,n.get(p)))return!1}}catch(C){d.e(C)}finally{d.f()}return!0}if(o==="Set"&&a==="Set"){if(t.size!==n.size)return!1;var _=i5(t.entries()),b;try{for(_.s();!(b=_.n()).done;){var y=r5(b.value,1),g=y[0];if(!n.has(g))return!1}}catch(C){_.e(C)}finally{_.f()}return!0}if(o==="Date"&&a==="Date")return+t==+n;var v=Object.keys(t);if(v.length!==Object.keys(n).length)return!1;for(var S=v.length;S--!==0;)if(!Object.prototype.hasOwnProperty.call(n,v[S]))return!1;for(var w=v.length;w--!==0;){var x=v[w];if(!e(t[x],n[x]))return!1}return o!=="Object"&&a!=="Object"?t===n:!0};const M4=fxe;function fO(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function SG(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){fO(o,r,i,a,s,"next",l)}function s(l){fO(o,r,i,a,s,"throw",l)}a(void 0)})}}var hxe=function(){var e=SG(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;if(!M4(t,n))return o.setItem("".concat(i,"rootState"),a(t,"rootState"))});return function(n,r,i){return e.apply(this,arguments)}}(),pxe=function(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;return Promise.all(Object.keys(t).map(function(s){return M4(t[s],n[s])?Promise.resolve():o.setItem("".concat(i).concat(s),a(t[s],s))}))},gxe=function(){var e=SG(function*(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=r.prefix,o=r.driver,a=r.persistWholeStore,s=r.serialize;try{var l=a?hxe:pxe;yield l(t,n,{prefix:i,driver:o,serialize:s})}catch(u){console.warn("redux-remember: persist error",u)}});return function(){return e.apply(this,arguments)}}();function hO(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function pO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){hO(o,r,i,a,s,"next",l)}function s(l){hO(o,r,i,a,s,"throw",l)}a(void 0)})}}var mxe=function(){var e=pO(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize,s=r.unserialize,l=r.persistThrottle,u=r.persistDebounce,c=r.persistWholeStore;yield lxe(t,n,{prefix:i,driver:o,unserialize:s,persistWholeStore:c});var d={},f=function(){var h=pO(function*(){var p=bG(t.getState(),n);yield gxe(p,d,{prefix:i,driver:o,serialize:a,persistWholeStore:c}),M4(p,d)||t.dispatch({type:rxe,payload:p}),d=p});return function(){return h.apply(this,arguments)}}();u&&u>0?t.subscribe(oxe(f,u)):t.subscribe(ixe(f,l))});return function(n,r,i){return e.apply(this,arguments)}}();const yxe=mxe;function T0(e){"@babel/helpers - typeof";return T0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T0(e)}function gO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function o5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gO(Object(n),!0).forEach(function(r){vxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vxe(e,t,n){return t=bxe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bxe(e){var t=_xe(e,"string");return T0(t)==="symbol"?t:String(t)}function _xe(e,t){if(T0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(T0(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sxe=function(t){var n={state:{}};return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.state,i=arguments.length>1?arguments[1]:void 0;i.type&&(i.type==="@@INIT"||i.type.startsWith("@@redux/INIT"))&&(n.state=o5({},r));var o=typeof t=="function"?t:_p(t);switch(i.type){case iE:{var a=o5(o5({},n.state),i.payload||{});return n.state=o(a,{type:iE,payload:a}),n.state}default:return o(r,i)}}},xxe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.prefix,o=i===void 0?"@@remember-":i,a=r.serialize,s=a===void 0?function(_,b){return JSON.stringify(_)}:a,l=r.unserialize,u=l===void 0?function(_,b){return JSON.parse(_)}:l,c=r.persistThrottle,d=c===void 0?100:c,f=r.persistDebounce,h=r.persistWholeStore,p=h===void 0?!1:h;if(!t)throw Error("redux-remember error: driver required");if(!Array.isArray(n))throw Error("redux-remember error: rememberedKeys needs to be an array");var m=function(b){return function(y,g,v){var S=b(y,g,v);return yxe(S,n,{driver:t,prefix:o,serialize:s,unserialize:u,persistThrottle:d,persistDebounce:f,persistWholeStore:p}),S}};return m};const iKe=["chakra-ui-color-mode","i18nextLng","ROARR_FILTER","ROARR_LOG"],wxe="@@invokeai-",Cxe=["cursorPosition"],Axe=["pendingControlImages"],Exe=["prompts"],Txe=["selection","selectedBoardId","galleryView"],kxe=["nodeTemplates","connectionStartParams","currentConnectionFieldType","selectedNodes","selectedEdges","isReady","nodesToCopy","edgesToCopy","connectionMade","modifyingEdge","addNewNodePosition"],Pxe=[],Ixe=[],Rxe=["isInitialized","isConnected","denoiseProgress","status"],Oxe=["shouldShowImageDetails","globalContextMenuCloseTrigger","panels"],Mxe={canvas:Cxe,gallery:Txe,generation:Pxe,nodes:kxe,postprocessing:Ixe,system:Rxe,ui:Oxe,controlNet:Axe,dynamicPrompts:Exe},$xe=(e,t)=>{const n=my(e,Mxe[t]??[]);return JSON.stringify(n)},Nxe={canvas:cz,gallery:wU,generation:zk,nodes:nG,postprocessing:oG,system:uG,config:EB,ui:gG,hotkeys:hG,controlAdapters:pA,dynamicPrompts:Gk,sdxl:sG},Dxe=(e,t)=>Ioe(JSON.parse(e),Nxe[t]),Lxe=Ne("nodes/textToImageGraphBuilt"),Fxe=Ne("nodes/imageToImageGraphBuilt"),xG=Ne("nodes/canvasGraphBuilt"),Bxe=Ne("nodes/nodesGraphBuilt"),zxe=Qi(Lxe,Fxe,xG,Bxe),jxe=Ne("nodes/workflowLoadRequested"),Uxe=e=>{if(zxe(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return E0.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:iG.match(e)?{...e,payload:"<Node templates omitted>"}:e},Vxe=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","@@REMEMBER_PERSISTED"],Gxe=e=>e,wG="default",Gr=sl(wG),qxe=e=>{const t=e?em.stringify(e,{arrayFormat:"none"}):void 0;return t?`queue/${Gr.get()}/list?${t}`:`queue/${Gr.get()}/list`},ed=Ra({selectId:e=>e.item_id,sortComparer:(e,t)=>e.priority>t.priority?-1:e.priority<t.priority?1:e.item_id<t.item_id?-1:e.item_id>t.item_id?1:0}),Er=ps.injectEndpoints({endpoints:e=>({enqueueBatch:e.mutation({query:t=>({url:`queue/${Gr.get()}/enqueue_batch`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,sg(r)}catch{}}}),enqueueGraph:e.mutation({query:t=>({url:`queue/${Gr.get()}/enqueue_graph`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,sg(r)}catch{}}}),resumeProcessor:e.mutation({query:()=>({url:`queue/${Gr.get()}/processor/resume`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pauseProcessor:e.mutation({query:()=>({url:`queue/${Gr.get()}/processor/pause`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pruneQueue:e.mutation({query:()=>({url:`queue/${Gr.get()}/prune`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","BatchStatus"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,sg(r)}catch{}}}),clearQueue:e.mutation({query:()=>({url:`queue/${Gr.get()}/clear`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","SessionProcessorStatus","BatchStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,sg(r)}catch{}}}),getCurrentQueueItem:e.query({query:()=>({url:`queue/${Gr.get()}/current`,method:"GET"}),providesTags:t=>{const n=["CurrentSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getNextQueueItem:e.query({query:()=>({url:`queue/${Gr.get()}/next`,method:"GET"}),providesTags:t=>{const n=["NextSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getQueueStatus:e.query({query:()=>({url:`queue/${Gr.get()}/status`,method:"GET"}),providesTags:["SessionQueueStatus"]}),getBatchStatus:e.query({query:({batch_id:t})=>({url:`queue/${Gr.get()}/b/${t}/status`,method:"GET"}),providesTags:t=>t?[{type:"BatchStatus",id:t.batch_id}]:[]}),getQueueItem:e.query({query:t=>({url:`queue/${Gr.get()}/i/${t}`,method:"GET"}),providesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id}]:[]}),cancelQueueItem:e.mutation({query:t=>({url:`queue/${Gr.get()}/i/${t}/cancel`,method:"PUT"}),onQueryStarted:async(t,{dispatch:n,queryFulfilled:r})=>{try{const{data:i}=await r;n(Er.util.updateQueryData("listQueueItems",void 0,o=>{ed.updateOne(o,{id:t,changes:{status:i.status,completed_at:i.completed_at,updated_at:i.updated_at}})}))}catch{}},invalidatesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id},{type:"BatchStatus",id:t.batch_id}]:[]}),cancelByBatchIds:e.mutation({query:t=>({url:`queue/${Gr.get()}/cancel_by_batch_ids`,method:"PUT",body:t}),onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,sg(r)}catch{}},invalidatesTags:["SessionQueueStatus","BatchStatus"]}),listQueueItems:e.query({query:t=>({url:qxe(t),method:"GET"}),serializeQueryArgs:()=>`queue/${Gr.get()}/list`,transformResponse:t=>ed.addMany(ed.getInitialState({has_more:t.has_more}),t.items),merge:(t,n)=>{ed.addMany(t,ed.getSelectors().selectAll(n)),t.has_more=n.has_more},forceRefetch:({currentArg:t,previousArg:n})=>t!==n,keepUnusedDataFor:60*5})})}),{useCancelByBatchIdsMutation:oKe,useEnqueueGraphMutation:aKe,useEnqueueBatchMutation:sKe,usePauseProcessorMutation:lKe,useResumeProcessorMutation:uKe,useClearQueueMutation:cKe,usePruneQueueMutation:dKe,useGetCurrentQueueItemQuery:fKe,useGetQueueStatusQuery:hKe,useGetQueueItemQuery:pKe,useGetNextQueueItemQuery:gKe,useListQueueItemsQuery:mKe,useCancelQueueItemMutation:yKe,useGetBatchStatusQuery:vKe}=Er,sg=e=>{e(Er.util.updateQueryData("listQueueItems",void 0,t=>{ed.removeAll(t),t.has_more=!1})),e(q2e()),e(Er.endpoints.listQueueItems.initiate(void 0))},Hxe=Qi(sue,lue),Wxe=()=>{Me({matcher:Hxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),{batchIds:o}=i.canvas;try{const a=t(Er.endpoints.cancelByBatchIds.initiate({batch_ids:o},{fixedCacheKey:"cancelByBatchIds"})),{canceled:s}=await a.unwrap();a.reset(),s>0&&(r.debug(`Canceled ${s} canvas batches`),t(qt({title:Z("queue.cancelBatchSucceeded"),status:"success"}))),t(fue())}catch{r.error("Failed to cancel canvas batches"),t(qt({title:Z("queue.cancelBatchFailed"),status:"error"}))}}})};Ne("app/appStarted");const Kxe=()=>{Me({matcher:Se.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==jo({board_id:"none",categories:ii}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Vn.getSelectors().selectAll(i)[0];t(Qs(o??null))}}})},Qxe=Qi(Er.endpoints.enqueueBatch.matchFulfilled,Er.endpoints.enqueueGraph.matchFulfilled),Xxe=()=>{Me({matcher:Qxe,effect:async(e,{dispatch:t,getState:n})=>{const{data:r}=Er.endpoints.getQueueStatus.select()(n());!r||r.processor.is_started||t(Er.endpoints.resumeProcessor.initiate(void 0,{fixedCacheKey:"resumeProcessor"}))}})},CG=ps.injectEndpoints({endpoints:e=>({getAppVersion:e.query({query:()=>({url:"app/version",method:"GET"}),providesTags:["AppVersion"],keepUnusedDataFor:864e5}),getAppConfig:e.query({query:()=>({url:"app/config",method:"GET"}),providesTags:["AppConfig"],keepUnusedDataFor:864e5}),getInvocationCacheStatus:e.query({query:()=>({url:"app/invocation_cache/status",method:"GET"}),providesTags:["InvocationCacheStatus"]}),clearInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache",method:"DELETE"}),invalidatesTags:["InvocationCacheStatus"]}),enableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/enable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]}),disableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/disable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]})})}),{useGetAppVersionQuery:bKe,useGetAppConfigQuery:_Ke,useClearInvocationCacheMutation:SKe,useDisableInvocationCacheMutation:xKe,useEnableInvocationCacheMutation:wKe,useGetInvocationCacheStatusQuery:CKe}=CG,Yxe=()=>{Me({matcher:CG.endpoints.getAppConfig.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const{infill_methods:r=[],nsfw_methods:i=[],watermarking_methods:o=[]}=e.payload,a=t().generation.infillMethod;r.includes(a)||n(Zle(r[0])),i.includes("nsfw_checker")||n(F2e(!1)),o.includes("invisible_watermark")||n(B2e(!1))}})},Zxe=Ne("app/appStarted"),Jxe=()=>{Me({actionCreator:Zxe,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})},dx={memoizeOptions:{resultEqualityCheck:Ak}},AG=(e,t)=>{var d;const{generation:n,canvas:r,nodes:i,controlAdapters:o}=e,a=((d=n.initialImage)==null?void 0:d.imageName)===t,s=r.layerState.objects.some(f=>f.kind==="image"&&f.imageName===t),l=i.nodes.filter(Vr).some(f=>Pf(f.data.inputs,h=>{var p;return h.type==="ImageField"&&((p=h.value)==null?void 0:p.image_name)===t})),u=Pa(o).some(f=>f.controlImage===t||qo(f)&&f.processedControlImage===t);return{isInitialImage:a,isCanvasImage:s,isNodesImage:l,isControlImage:u}},ewe=Ii([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>AG(e,r.image_name)):[]},dx),twe=()=>{Me({matcher:Se.endpoints.deleteBoardAndImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{deleted_images:r}=e.payload;let i=!1,o=!1,a=!1,s=!1;const l=n();r.forEach(u=>{const c=AG(l,u);c.isInitialImage&&!i&&(t(jk()),i=!0),c.isCanvasImage&&!o&&(t(Uk()),o=!0),c.isNodesImage&&!a&&(t(I2e()),a=!0),c.isControlImage&&!s&&(t(Pse()),s=!0)})}})},nwe=()=>{Me({matcher:Qi($_,DA),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),a=$_.match(e)?e.payload.boardId:o.gallery.selectedBoardId,l=(DA.match(e)?e.payload:o.gallery.galleryView)==="images"?ii:to,u={board_id:a??"none",categories:l};if(await r(()=>Se.endpoints.listImages.select(u)(t()).isSuccess,5e3)){const{data:d}=Se.endpoints.listImages.select(u)(t());if(d){const f=s0.selectAll(d)[0],h=s0.selectById(d,e.payload.selectedImageName);n(Qs(h||f||null))}else n(Qs(null))}else n(Qs(null))}})},rwe=Ne("canvas/canvasSavedToGallery"),iwe=Ne("canvas/canvasMaskSavedToGallery"),owe=Ne("canvas/canvasCopiedToClipboard"),awe=Ne("canvas/canvasDownloadedAsImage"),swe=Ne("canvas/canvasMerged"),lwe=Ne("canvas/stagingAreaImageSaved"),uwe=Ne("canvas/canvasMaskToControlAdapter"),cwe=Ne("canvas/canvasImageToControlAdapter");let EG=null,TG=null;const AKe=e=>{EG=e},fx=()=>EG,EKe=e=>{TG=e},dwe=()=>TG,fwe=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),H_=async(e,t)=>await fwe(e.toCanvas(t)),hx=async(e,t=!1)=>{const n=fx();if(!n)throw new Error("Problem getting base layer blob");const{shouldCropToBoundingBoxOnSave:r,boundingBoxCoordinates:i,boundingBoxDimensions:o}=e.canvas,a=n.clone();a.scale({x:1,y:1});const s=a.getAbsolutePosition(),l=r||t?{x:i.x+s.x,y:i.y+s.y,width:o.width,height:o.height}:a.getClientRect();return H_(a,l)},hwe=(e,t="image/png")=>{navigator.clipboard.write([new ClipboardItem({[t]:e})])},pwe=()=>{Me({actionCreator:owe,effect:async(e,{dispatch:t,getState:n})=>{const r=nx.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n();try{const o=hx(i);hwe(o)}catch(o){r.error(String(o)),t(qt({title:Z("toast.problemCopyingCanvas"),description:Z("toast.problemCopyingCanvasDesc"),status:"error"}));return}t(qt({title:Z("toast.canvasCopiedClipboard"),status:"success"}))}})},gwe=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),r.remove()},mwe=()=>{Me({actionCreator:awe,effect:async(e,{dispatch:t,getState:n})=>{const r=nx.get().child({namespace:"canvasSavedToGalleryListener"}),i=n();let o;try{o=await hx(i)}catch(a){r.error(String(a)),t(qt({title:Z("toast.problemDownloadingCanvas"),description:Z("toast.problemDownloadingCanvasDesc"),status:"error"}));return}gwe(o,"canvas.png"),t(qt({title:Z("toast.canvasDownloaded"),status:"success"}))}})},ywe=()=>{Me({actionCreator:cwe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),{id:o}=e.payload;let a;try{a=await hx(i,!0)}catch(c){r.error(String(c)),t(qt({title:Z("toast.problemSavingCanvas"),description:Z("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery,l=await t(Se.endpoints.uploadImage.initiate({file:new File([a],"savedCanvas.png",{type:"image/png"}),image_category:"control",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:Z("toast.canvasSentControlnetAssets")}}})).unwrap(),{image_name:u}=l;t(Tc({id:o,controlImage:u}))}})};var $4={exports:{}},px={},kG={},Rt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;var t=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof yt<"u"?yt:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.2.0",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const r=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(Rt);var fr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Rt;class n{constructor(v=[1,0,0,1,0,0]){this.dirty=!1,this.m=v&&v.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(v){v.m[0]=this.m[0],v.m[1]=this.m[1],v.m[2]=this.m[2],v.m[3]=this.m[3],v.m[4]=this.m[4],v.m[5]=this.m[5]}point(v){var S=this.m;return{x:S[0]*v.x+S[2]*v.y+S[4],y:S[1]*v.x+S[3]*v.y+S[5]}}translate(v,S){return this.m[4]+=this.m[0]*v+this.m[2]*S,this.m[5]+=this.m[1]*v+this.m[3]*S,this}scale(v,S){return this.m[0]*=v,this.m[1]*=v,this.m[2]*=S,this.m[3]*=S,this}rotate(v){var S=Math.cos(v),w=Math.sin(v),x=this.m[0]*S+this.m[2]*w,C=this.m[1]*S+this.m[3]*w,T=this.m[0]*-w+this.m[2]*S,E=this.m[1]*-w+this.m[3]*S;return this.m[0]=x,this.m[1]=C,this.m[2]=T,this.m[3]=E,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(v,S){var w=this.m[0]+this.m[2]*S,x=this.m[1]+this.m[3]*S,C=this.m[2]+this.m[0]*v,T=this.m[3]+this.m[1]*v;return this.m[0]=w,this.m[1]=x,this.m[2]=C,this.m[3]=T,this}multiply(v){var S=this.m[0]*v.m[0]+this.m[2]*v.m[1],w=this.m[1]*v.m[0]+this.m[3]*v.m[1],x=this.m[0]*v.m[2]+this.m[2]*v.m[3],C=this.m[1]*v.m[2]+this.m[3]*v.m[3],T=this.m[0]*v.m[4]+this.m[2]*v.m[5]+this.m[4],E=this.m[1]*v.m[4]+this.m[3]*v.m[5]+this.m[5];return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=T,this.m[5]=E,this}invert(){var v=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),S=this.m[3]*v,w=-this.m[1]*v,x=-this.m[2]*v,C=this.m[0]*v,T=v*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),E=v*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=T,this.m[5]=E,this}getMatrix(){return this.m}decompose(){var v=this.m[0],S=this.m[1],w=this.m[2],x=this.m[3],C=this.m[4],T=this.m[5],E=v*x-S*w;let P={x:C,y:T,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(v!=0||S!=0){var N=Math.sqrt(v*v+S*S);P.rotation=S>0?Math.acos(v/N):-Math.acos(v/N),P.scaleX=N,P.scaleY=E/N,P.skewX=(v*w+S*x)/E,P.skewY=0}else if(w!=0||x!=0){var O=Math.sqrt(w*w+x*x);P.rotation=Math.PI/2-(x>0?Math.acos(-w/O):-Math.acos(w/O)),P.scaleX=E/O,P.scaleY=O,P.skewX=0,P.skewY=(v*w+S*x)/E}return P.rotation=e.Util._getRotation(P.rotation),P}}e.Transform=n;var r="[object Array]",i="[object Number]",o="[object String]",a="[object Boolean]",s=Math.PI/180,l=180/Math.PI,u="#",c="",d="0",f="Konva warning: ",h="Konva error: ",p="rgb(",m={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,b=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(g){setTimeout(g,60)};e.Util={_isElement(g){return!!(g&&g.nodeType==1)},_isFunction(g){return!!(g&&g.constructor&&g.call&&g.apply)},_isPlainObject(g){return!!g&&g.constructor===Object},_isArray(g){return Object.prototype.toString.call(g)===r},_isNumber(g){return Object.prototype.toString.call(g)===i&&!isNaN(g)&&isFinite(g)},_isString(g){return Object.prototype.toString.call(g)===o},_isBoolean(g){return Object.prototype.toString.call(g)===a},isObject(g){return g instanceof Object},isValidSelector(g){if(typeof g!="string")return!1;var v=g[0];return v==="#"||v==="."||v===v.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){b.push(g),b.length===1&&y(function(){const v=b;b=[],v.forEach(function(S){S()})})},createCanvasElement(){var g=document.createElement("canvas");try{g.style=g.style||{}}catch{}return g},createImageElement(){return document.createElement("img")},_isInDocument(g){for(;g=g.parentNode;)if(g==document)return!0;return!1},_urlToImage(g,v){var S=e.Util.createImageElement();S.onload=function(){v(S)},S.src=g},_rgbToHex(g,v,S){return((1<<24)+(g<<16)+(v<<8)+S).toString(16).slice(1)},_hexToRgb(g){g=g.replace(u,c);var v=parseInt(g,16);return{r:v>>16&255,g:v>>8&255,b:v&255}},getRandomColor(){for(var g=(Math.random()*16777215<<0).toString(16);g.length<6;)g=d+g;return u+g},getRGB(g){var v;return g in m?(v=m[g],{r:v[0],g:v[1],b:v[2]}):g[0]===u?this._hexToRgb(g.substring(1)):g.substr(0,4)===p?(v=_.exec(g.replace(/ /g,"")),{r:parseInt(v[1],10),g:parseInt(v[2],10),b:parseInt(v[3],10)}):{r:0,g:0,b:0}},colorToRGBA(g){return g=g||"black",e.Util._namedColorToRBA(g)||e.Util._hex3ColorToRGBA(g)||e.Util._hex4ColorToRGBA(g)||e.Util._hex6ColorToRGBA(g)||e.Util._hex8ColorToRGBA(g)||e.Util._rgbColorToRGBA(g)||e.Util._rgbaColorToRGBA(g)||e.Util._hslColorToRGBA(g)},_namedColorToRBA(g){var v=m[g.toLowerCase()];return v?{r:v[0],g:v[1],b:v[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];var v=g.split(/ *, */).map(Number);return{r:v[0],g:v[1],b:v[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];var v=g.split(/ *, */).map((S,w)=>S.slice(-1)==="%"?w===3?parseInt(S)/100:parseInt(S)/100*255:Number(S));return{r:v[0],g:v[1],b:v[2],a:v[3]}}},_hex8ColorToRGBA(g){if(g[0]==="#"&&g.length===9)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:parseInt(g.slice(7,9),16)/255}},_hex6ColorToRGBA(g){if(g[0]==="#"&&g.length===7)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:1}},_hex4ColorToRGBA(g){if(g[0]==="#"&&g.length===5)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:parseInt(g[4]+g[4],16)/255}},_hex3ColorToRGBA(g){if(g[0]==="#"&&g.length===4)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:1}},_hslColorToRGBA(g){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(g)){const[v,...S]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(g),w=Number(S[0])/360,x=Number(S[1])/100,C=Number(S[2])/100;let T,E,P;if(x===0)return P=C*255,{r:Math.round(P),g:Math.round(P),b:Math.round(P),a:1};C<.5?T=C*(1+x):T=C+x-C*x;const N=2*C-T,O=[0,0,0];for(let A=0;A<3;A++)E=w+1/3*-(A-1),E<0&&E++,E>1&&E--,6*E<1?P=N+(T-N)*6*E:2*E<1?P=T:3*E<2?P=N+(T-N)*(2/3-E)*6:P=N,O[A]=P*255;return{r:Math.round(O[0]),g:Math.round(O[1]),b:Math.round(O[2]),a:1}}},haveIntersection(g,v){return!(v.x>g.x+g.width||v.x+v.width<g.x||v.y>g.y+g.height||v.y+v.height<g.y)},cloneObject(g){var v={};for(var S in g)this._isPlainObject(g[S])?v[S]=this.cloneObject(g[S]):this._isArray(g[S])?v[S]=this.cloneArray(g[S]):v[S]=g[S];return v},cloneArray(g){return g.slice(0)},degToRad(g){return g*s},radToDeg(g){return g*l},_degToRad(g){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(g)},_radToDeg(g){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(g)},_getRotation(g){return t.Konva.angleDeg?e.Util.radToDeg(g):g},_capitalize(g){return g.charAt(0).toUpperCase()+g.slice(1)},throw(g){throw new Error(h+g)},error(g){console.error(h+g)},warn(g){t.Konva.showWarnings&&console.warn(f+g)},each(g,v){for(var S in g)v(S,g[S])},_inRange(g,v,S){return v<=g&&g<S},_getProjectionToSegment(g,v,S,w,x,C){var T,E,P,N=(g-S)*(g-S)+(v-w)*(v-w);if(N==0)T=g,E=v,P=(x-S)*(x-S)+(C-w)*(C-w);else{var O=((x-g)*(S-g)+(C-v)*(w-v))/N;O<0?(T=g,E=v,P=(g-x)*(g-x)+(v-C)*(v-C)):O>1?(T=S,E=w,P=(S-x)*(S-x)+(w-C)*(w-C)):(T=g+O*(S-g),E=v+O*(w-v),P=(T-x)*(T-x)+(E-C)*(E-C))}return[T,E,P]},_getProjectionToLine(g,v,S){var w=e.Util.cloneObject(g),x=Number.MAX_VALUE;return v.forEach(function(C,T){if(!(!S&&T===v.length-1)){var E=v[(T+1)%v.length],P=e.Util._getProjectionToSegment(C.x,C.y,E.x,E.y,g.x,g.y),N=P[0],O=P[1],A=P[2];A<x&&(w.x=N,w.y=O,x=A)}}),w},_prepareArrayForTween(g,v,S){var w,x=[],C=[];if(g.length>v.length){var T=v;v=g,g=T}for(w=0;w<g.length;w+=2)x.push({x:g[w],y:g[w+1]});for(w=0;w<v.length;w+=2)C.push({x:v[w],y:v[w+1]});var E=[];return C.forEach(function(P){var N=e.Util._getProjectionToLine(P,x,S);E.push(N.x),E.push(N.y)}),E},_prepareToStringify(g){var v;g.visitedByCircularReferenceRemoval=!0;for(var S in g)if(g.hasOwnProperty(S)&&g[S]&&typeof g[S]=="object"){if(v=Object.getOwnPropertyDescriptor(g,S),g[S].visitedByCircularReferenceRemoval||e.Util._isElement(g[S]))if(v.configurable)delete g[S];else return null;else if(e.Util._prepareToStringify(g[S])===null)if(v.configurable)delete g[S];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,v){for(var S in v)g[S]=v[S];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){t.Konva.releaseCanvasOnDestroy&&g.forEach(v=>{v.width=0,v.height=0})},drawRoundedRectPath(g,v,S,w){let x=0,C=0,T=0,E=0;typeof w=="number"?x=C=T=E=Math.min(w,v/2,S/2):(x=Math.min(w[0]||0,v/2,S/2),C=Math.min(w[1]||0,v/2,S/2),E=Math.min(w[2]||0,v/2,S/2),T=Math.min(w[3]||0,v/2,S/2)),g.moveTo(x,0),g.lineTo(v-C,0),g.arc(v-C,C,C,Math.PI*3/2,0,!1),g.lineTo(v,S-E),g.arc(v-E,S-E,E,0,Math.PI/2,!1),g.lineTo(T,S),g.arc(T,S-T,T,Math.PI/2,Math.PI,!1),g.lineTo(0,x),g.arc(x,x,x,Math.PI,Math.PI*3/2,!1)}}})(fr);var rr={},kt={},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.getComponentValidator=Xe.getBooleanValidator=Xe.getNumberArrayValidator=Xe.getFunctionValidator=Xe.getStringOrGradientValidator=Xe.getStringValidator=Xe.getNumberOrAutoValidator=Xe.getNumberOrArrayOfNumbersValidator=Xe.getNumberValidator=Xe.alphaComponent=Xe.RGBComponent=void 0;const au=Rt,br=fr;function su(e){return br.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||br.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function vwe(e){return e>255?255:e<0?0:Math.round(e)}Xe.RGBComponent=vwe;function bwe(e){return e>1?1:e<1e-4?1e-4:e}Xe.alphaComponent=bwe;function _we(){if(au.Konva.isUnminified)return function(e,t){return br.Util._isNumber(e)||br.Util.warn(su(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Xe.getNumberValidator=_we;function Swe(e){if(au.Konva.isUnminified)return function(t,n){let r=br.Util._isNumber(t),i=br.Util._isArray(t)&&t.length==e;return!r&&!i&&br.Util.warn(su(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Xe.getNumberOrArrayOfNumbersValidator=Swe;function xwe(){if(au.Konva.isUnminified)return function(e,t){var n=br.Util._isNumber(e),r=e==="auto";return n||r||br.Util.warn(su(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Xe.getNumberOrAutoValidator=xwe;function wwe(){if(au.Konva.isUnminified)return function(e,t){return br.Util._isString(e)||br.Util.warn(su(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Xe.getStringValidator=wwe;function Cwe(){if(au.Konva.isUnminified)return function(e,t){const n=br.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||br.Util.warn(su(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Xe.getStringOrGradientValidator=Cwe;function Awe(){if(au.Konva.isUnminified)return function(e,t){return br.Util._isFunction(e)||br.Util.warn(su(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Xe.getFunctionValidator=Awe;function Ewe(){if(au.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(br.Util._isArray(e)?e.forEach(function(r){br.Util._isNumber(r)||br.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):br.Util.warn(su(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Xe.getNumberArrayValidator=Ewe;function Twe(){if(au.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||br.Util.warn(su(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Xe.getBooleanValidator=Twe;function kwe(e){if(au.Konva.isUnminified)return function(t,n){return t==null||br.Util.isObject(t)||br.Util.warn(su(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Xe.getComponentValidator=kwe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=fr,n=Xe;var r="get",i="set";e.Factory={addGetterSetter(o,a,s,l,u){e.Factory.addGetter(o,a,s),e.Factory.addSetter(o,a,l,u),e.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,s){var l=r+t.Util._capitalize(a);o.prototype[l]=o.prototype[l]||function(){var u=this.attrs[a];return u===void 0?s:u}},addSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]||e.Factory.overWriteSetter(o,a,s,l)},overWriteSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]=function(c){return s&&c!==void 0&&c!==null&&(c=s.call(this,c,a)),this._setAttr(a,c),l&&l.call(this),this}},addComponentsGetterSetter(o,a,s,l,u){var c=s.length,d=t.Util._capitalize,f=r+d(a),h=i+d(a),p,m;o.prototype[f]=function(){var b={};for(p=0;p<c;p++)m=s[p],b[m]=this.getAttr(a+d(m));return b};var _=(0,n.getComponentValidator)(s);o.prototype[h]=function(b){var y=this.attrs[a],g;l&&(b=l.call(this,b)),_&&_.call(this,b,a);for(g in b)b.hasOwnProperty(g)&&this._setAttr(a+d(g),b[g]);return b||s.forEach(v=>{this._setAttr(a+d(v),void 0)}),this._fireChangeEvent(a,y,b),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){var s=t.Util._capitalize(a),l=i+s,u=r+s;o.prototype[a]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,a,s,l){t.Util.error("Adding deprecated "+a);var u=r+t.Util._capitalize(a),c=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(c);var d=this.attrs[a];return d===void 0?s:d},e.Factory.addSetter(o,a,l,function(){t.Util.error(c)}),e.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){t.Util.each(a,function(s,l){var u=o.prototype[l],c=r+t.Util._capitalize(s),d=i+t.Util._capitalize(s);function f(){u.apply(this,arguments),t.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[s]=f,o.prototype[c]=f,o.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}})(kt);var cs={},zl={};Object.defineProperty(zl,"__esModule",{value:!0});zl.HitContext=zl.SceneContext=zl.Context=void 0;const PG=fr,Pwe=Rt;function Iwe(e){var t=[],n=e.length,r=PG.Util,i,o;for(i=0;i<n;i++)o=e[i],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),t.push(o);return t}var mO=",",Rwe="(",Owe=")",Mwe="([",$we="])",Nwe=";",Dwe="()",Lwe="=",yO=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],Fwe=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const Bwe=100;class gx{constructor(t){this.canvas=t,Pwe.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,i=r.length,o="",a,s,l,u;for(a=0;a<i;a++)s=r[a],l=s.method,l?(u=s.args,o+=l,t?o+=Dwe:PG.Util._isArray(u[0])?o+=Mwe+u.join(mO)+$we:(n&&(u=u.map(c=>typeof c=="number"?Math.floor(c):c)),o+=Rwe+u.join(mO)+Owe)):(o+=s.property,t||(o+=Lwe+s.val)),o+=Nwe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=Bwe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var c=arguments,d=this._context;c.length===3?d.drawImage(t,n,r):c.length===5?d.drawImage(t,n,r,i,o):c.length===9&&d.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=yO.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=Iwe(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i<n;i++)a(yO[i]);t.setAttr=function(){r.apply(t,arguments);var s=arguments[0],l=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:s,val:l})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}zl.Context=gx;Fwe.forEach(function(e){Object.defineProperty(gx.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class zwe extends gx{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):o?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(var a=0;a<i.length;a+=2)o.addColorStop(i[a],i[a+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,i,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,s=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},l=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),c=l.x*u,d=l.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",s.x*c),this.setAttr("shadowOffsetY",s.y*d)}}zl.SceneContext=zwe;class jwe extends gx{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const o=t.getStrokeScaleEnabled();if(!o){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),i=r==="auto"?t.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),o||this.restore()}}}zl.HitContext=jwe;Object.defineProperty(cs,"__esModule",{value:!0});cs.HitCanvas=cs.SceneCanvas=cs.Canvas=void 0;const W_=fr,IG=zl,RG=Rt,Uwe=kt,Vwe=Xe;var Kv;function Gwe(){if(Kv)return Kv;var e=W_.Util.createCanvasElement(),t=e.getContext("2d");return Kv=function(){var n=RG.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),W_.Util.releaseCanvas(e),Kv}class mx{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||RG.Konva.pixelRatio||Gwe();this.pixelRatio=r,this._canvas=W_.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var n=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,n){this.setWidth(t||0),this.setHeight(n||0)}toDataURL(t,n){try{return this._canvas.toDataURL(t,n)}catch{try{return this._canvas.toDataURL()}catch(i){return W_.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}cs.Canvas=mx;Uwe.Factory.addGetterSetter(mx,"pixelRatio",void 0,(0,Vwe.getNumberValidator)());class qwe extends mx{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new IG.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}cs.SceneCanvas=qwe;class Hwe extends mx{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new IG.HitContext(this),this.setSize(t.width,t.height)}}cs.HitCanvas=Hwe;var yx={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Rt,n=fr;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];e.DD._dragElements.forEach((o,a)=>{const{node:s}=o,l=s.getStage();l.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(f=>f.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var c=s.dragDistance(),d=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(d<c||(s.startDrag({evt:r}),!s.isDragging()))return}s._setDragPosition(r,o),i.push(s)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];e.DD._dragElements.forEach(o=>{const{node:a}=o,s=a.getStage();if(r&&s.setPointersPositions(r),!s._changedPointerPositions.find(c=>c.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,o.dragStatus="stopped");const u=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;u&&i.indexOf(u)===-1&&i.push(u)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(yx);Object.defineProperty(rr,"__esModule",{value:!0});rr.Node=void 0;const $t=fr,My=kt,Qv=cs,jc=Rt,fa=yx,kr=Xe;var eb="absoluteOpacity",Xv="allEventListeners",Sl="absoluteTransform",vO="absoluteScale",Uc="canvas",Wwe="Change",Kwe="children",Qwe="konva",aE="listening",bO="mouseenter",_O="mouseleave",SO="set",xO="Shape",tb=" ",wO="stage",Su="transform",Xwe="Stage",sE="visible",Ywe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(tb);let Zwe=1;class gt{constructor(t){this._id=Zwe++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===Su||t===Sl)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===Su||t===Sl,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(tb);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Uc)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Sl&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Uc)){const{scene:t,filter:n,hit:r}=this._cache.get(Uc);$t.Util.releaseCanvas(t,n,r),this._cache.delete(Uc)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,c=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!i||!o){$t.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var f=new Qv.SceneCanvas({pixelRatio:a,width:i,height:o}),h=new Qv.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),p=new Qv.HitCanvas({pixelRatio:d,width:i,height:o}),m=f.getContext(),_=p.getContext();return p.isCache=!0,f.isCache=!0,this._cache.delete(Uc),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),m.save(),_.save(),m.translate(-s,-l),_.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(eb),this._clearSelfAndDescendantCache(vO),this.drawScene(f,this),this.drawHit(p,this),this._isUnderCache=!1,m.restore(),_.restore(),c&&(m.save(),m.beginPath(),m.rect(0,0,i,o),m.closePath(),m.setAttr("strokeStyle","red"),m.setAttr("lineWidth",5),m.stroke(),m.restore()),this._cache.set(Uc,{scene:f,filter:h,hit:p,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Uc)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var c=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/c,r.getHeight()/c),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l<a;l++){if(u=t[l],typeof u!="function"){$t.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,s),o.putImageData(s,0,0)}}catch(d){$t.Util.error("Unable to apply filter. "+d.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(t,n){if(this._cache&&this._cache.delete(Xv),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(tb),i=r.length,o,a,s,l,u;for(o=0;o<i;o++)a=r[o],s=a.split("."),l=s[0],u=s[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(tb),i=r.length,o,a,s,l,u,c;if(this._cache&&this._cache.delete(Xv),!t)for(a in this.eventListeners)this._off(a);for(o=0;o<i;o++)if(s=r[o],l=s.split("."),u=l[0],c=l[1],u)this.eventListeners[u]&&this._off(u,c,n);else for(a in this.eventListeners)this._off(a,c,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var i=this;this.on(t,function(o){for(var a=o.target.findAncestors(n,!0,i),s=0;s<a.length;s++)o=$t.Util.cloneObject(o),o.currentTarget=a[s],r.call(a[s],o)})}remove(){return this.isDragging()&&this.stopDrag(),fa.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Sl),this._clearSelfAndDescendantCache(eb),this._clearSelfAndDescendantCache(vO),this._clearSelfAndDescendantCache(wO),this._clearSelfAndDescendantCache(sE),this._clearSelfAndDescendantCache(aE)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var n="get"+$t.Util._capitalize(t);return $t.Util._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),n=[];t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var n,r;if(!t)return this;for(n in t)n!==Kwe&&(r=SO+$t.Util._capitalize(n),$t.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(aE,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(sE,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;fa.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!jc.Konva.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a<o;a++)s=u[a],r++,s.nodeType!==xO&&(i=i.concat(s.getChildren().slice())),s._id===n._id&&(a=o);i.length>0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==Xwe&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Su),this._clearSelfAndDescendantCache(Sl)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new $t.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(Su);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(Su),this._clearSelfAndDescendantCache(Sl),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a<o;a++)t(r[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return $t.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return $t.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return $t.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return $t.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return $t.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&$t.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(eb,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=$t.Util.isObject(i)&&!$t.Util._isPlainObject(i)&&!$t.Util._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),$t.Util._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],$t.Util.isValidSelector(o)||($t.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),$t.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),$t.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(wO,this._getStage)}_getStage(){var t=this.getParent();if(t)return t.getStage()}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Sl,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new $t.Transform,this._eachAncestorReverse(function(i){var o=i.transformsEnabled();o==="all"?n.multiply(i.getTransform()):o==="position"&&n.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),n;n=this._cache.get(Sl)||new $t.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,a=this.attrs.offsetX||0,s=this.attrs.offsetY||0;n.translate(i-a,o-s)}return n.dirty=!1,n}getAbsoluteScale(t){for(var n=this;n;)n._isUnderCache&&(t=n),n=n.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Su,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(Su)||new $t.Transform;r.reset();var i=this.x(),o=this.y(),a=jc.Konva.getAngle(this.rotation()),s=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,u=this.attrs.skewX||0,c=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),a!==0&&r.rotate(a),(u!==0||c!==0)&&r.skew(u,c),(s!==1||l!==1)&&r.scale(s,l),(d!==0||f!==0)&&r.translate(-1*d,-1*f),r.dirty=!1,r}clone(t){var n=$t.Util.cloneObject(this.attrs),r,i,o,a,s;for(r in t)n[r]=t[r];var l=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,a=0;a<o;a++)s=i[a],s.name.indexOf(Qwe)<0&&(l.eventListeners[r]||(l.eventListeners[r]=[]),l.eventListeners[r].push(s));return l}_toKonvaCanvas(t){t=t||{};var n=this.getClientRect(),r=this.getStage(),i=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),a=t.pixelRatio||1,s=new Qv.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),l=s.getContext();return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(i||o)&&l.translate(-1*i,-1*o),this.drawScene(s),l.restore(),s}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var n=t.mimeType||null,r=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(i),i}toImage(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,$t.Util._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():jc.Konva.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o<i.length;o++)if(a=i[o].name,s=i[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===s)){if(i.splice(o,1),i.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+Wwe,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){var n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();if(!n)return!1;var r=(n||"").split(/\s/g);return r.indexOf(t)!==-1}removeName(t){var n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){var r=this[SO+$t.Util._capitalize(t)];return $t.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(jc.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!$t.Util.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){var i;r!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,i,r))}_fireAndBubble(t,n,r){n&&this.nodeType===xO&&(n.target=this);var i=(t===bO||t===_O)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===bO||t===_O)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r,i;const o=(n=this._cache.get(Xv))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[t];if(a===void 0){a=[];let s=Object.getPrototypeOf(this);for(;s;){const l=(i=(r=s.eventListeners)===null||r===void 0?void 0:r[t])!==null&&i!==void 0?i:[];a.push(...l),s=Object.getPrototypeOf(s)}o[t]=a,this._cache.set(Xv,o)}return a}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition(),o=r._getPointerById(n)||r._changedPointerPositions[0]||i;fa.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(t,n=!0){fa.DD._dragElements.has(this._id)||this._createDragElement(t);const r=fa.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(r){var i={x:r.x-n.offset.x,y:r.y-n.offset.y},o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,i,t);a?i=a:$t.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const n=fa.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),fa.DD._endDragBefore(t),fa.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=fa.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var n=t.evt.button!==void 0,r=!n||jc.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;fa.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=fa.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&fa.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return $t.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return $t.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=gt.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),jc.Konva[r]||($t.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=jc.Konva[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s<a;s++)o.add(gt._createNode(i[s]));return o}}rr.Node=gt;gt.prototype.nodeType="Node";gt.prototype._attrsAffectingSize=[];gt.prototype.eventListeners={};gt.prototype.on.call(gt.prototype,Ywe,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Su),this._clearSelfAndDescendantCache(Sl)});gt.prototype.on.call(gt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(sE)});gt.prototype.on.call(gt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(aE)});gt.prototype.on.call(gt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(eb)});const In=My.Factory.addGetterSetter;In(gt,"zIndex");In(gt,"absolutePosition");In(gt,"position");In(gt,"x",0,(0,kr.getNumberValidator)());In(gt,"y",0,(0,kr.getNumberValidator)());In(gt,"globalCompositeOperation","source-over",(0,kr.getStringValidator)());In(gt,"opacity",1,(0,kr.getNumberValidator)());In(gt,"name","",(0,kr.getStringValidator)());In(gt,"id","",(0,kr.getStringValidator)());In(gt,"rotation",0,(0,kr.getNumberValidator)());My.Factory.addComponentsGetterSetter(gt,"scale",["x","y"]);In(gt,"scaleX",1,(0,kr.getNumberValidator)());In(gt,"scaleY",1,(0,kr.getNumberValidator)());My.Factory.addComponentsGetterSetter(gt,"skew",["x","y"]);In(gt,"skewX",0,(0,kr.getNumberValidator)());In(gt,"skewY",0,(0,kr.getNumberValidator)());My.Factory.addComponentsGetterSetter(gt,"offset",["x","y"]);In(gt,"offsetX",0,(0,kr.getNumberValidator)());In(gt,"offsetY",0,(0,kr.getNumberValidator)());In(gt,"dragDistance",null,(0,kr.getNumberValidator)());In(gt,"width",0,(0,kr.getNumberValidator)());In(gt,"height",0,(0,kr.getNumberValidator)());In(gt,"listening",!0,(0,kr.getBooleanValidator)());In(gt,"preventDefault",!0,(0,kr.getBooleanValidator)());In(gt,"filters",null,function(e){return this._filterUpToDate=!1,e});In(gt,"visible",!0,(0,kr.getBooleanValidator)());In(gt,"transformsEnabled","all",(0,kr.getStringValidator)());In(gt,"size");In(gt,"dragBoundFunc");In(gt,"draggable",!1,(0,kr.getBooleanValidator)());My.Factory.backCompat(gt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Xd={};Object.defineProperty(Xd,"__esModule",{value:!0});Xd.Container=void 0;const Tp=kt,a5=rr,vx=Xe;let Yd=class extends a5.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const n=this.children||[];var r=[];return n.forEach(function(i){t(i)&&r.push(i)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var n=0;n<t.length;n++)this.add(t[n]);return this}const r=t[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var n=this._generalFind(t,!0);return n.length>0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=a5.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=a5.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const c=r===this;if(u){o.save();var d=this.getAbsoluteTransform(r),f=d.getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath();let _;if(l)_=l.call(this,o,this);else{var h=this.clipX(),p=this.clipY();o.rect(h,p,a,s)}o.clip.apply(o,_),f=d.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var m=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(_){_[t](n,r)}),m&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(m){if(m.visible()){var _=m.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,s=_.x+_.width,l=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),s=Math.max(s,_.x+_.width),l=Math.max(l,_.y+_.height)))}});for(var d=this.find("Shape"),f=!1,h=0;h<d.length;h++){var p=d[h];if(p._isVisible(this)){f=!0;break}}return f&&o!==void 0?u={x:o,y:a,width:s-o,height:l-a}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,i)}};Xd.Container=Yd;Tp.Factory.addComponentsGetterSetter(Yd,"clip",["x","y","width","height"]);Tp.Factory.addGetterSetter(Yd,"clipX",void 0,(0,vx.getNumberValidator)());Tp.Factory.addGetterSetter(Yd,"clipY",void 0,(0,vx.getNumberValidator)());Tp.Factory.addGetterSetter(Yd,"clipWidth",void 0,(0,vx.getNumberValidator)());Tp.Factory.addGetterSetter(Yd,"clipHeight",void 0,(0,vx.getNumberValidator)());Tp.Factory.addGetterSetter(Yd,"clipFunc");var OG={},Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.releaseCapture=Qo.setPointerCapture=Qo.hasPointerCapture=Qo.createEvent=Qo.getCapturedShape=void 0;const Jwe=Rt,k0=new Map,MG=Jwe.Konva._global.PointerEvent!==void 0;function eCe(e){return k0.get(e)}Qo.getCapturedShape=eCe;function N4(e){return{evt:e,pointerId:e.pointerId}}Qo.createEvent=N4;function tCe(e,t){return k0.get(e)===t}Qo.hasPointerCapture=tCe;function nCe(e,t){$G(e),t.getStage()&&(k0.set(e,t),MG&&t._fire("gotpointercapture",N4(new PointerEvent("gotpointercapture"))))}Qo.setPointerCapture=nCe;function $G(e,t){const n=k0.get(e);if(!n)return;const r=n.getStage();r&&r.content,k0.delete(e),MG&&n._fire("lostpointercapture",N4(new PointerEvent("lostpointercapture")))}Qo.releaseCapture=$G;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=fr,n=kt,r=Xd,i=Rt,o=cs,a=yx,s=Rt,l=Qo;var u="Stage",c="string",d="px",f="mouseout",h="mouseleave",p="mouseover",m="mouseenter",_="mousemove",b="mousedown",y="mouseup",g="pointermove",v="pointerdown",S="pointerup",w="pointercancel",x="lostpointercapture",C="pointerout",T="pointerleave",E="pointerover",P="pointerenter",N="contextmenu",O="touchstart",A="touchend",k="touchmove",D="touchcancel",L="wheel",M=5,R=[[m,"_pointerenter"],[b,"_pointerdown"],[_,"_pointermove"],[y,"_pointerup"],[h,"_pointerleave"],[O,"_pointerdown"],[k,"_pointermove"],[A,"_pointerup"],[D,"_pointercancel"],[p,"_pointerover"],[L,"_wheel"],[N,"_contextmenu"],[v,"_pointerdown"],[g,"_pointermove"],[S,"_pointerup"],[w,"_pointercancel"],[x,"_lostpointercapture"]];const $={mouse:{[C]:f,[T]:h,[E]:p,[P]:m,[g]:_,[v]:b,[S]:y,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C]:"touchout",[T]:"touchleave",[E]:"touchover",[P]:"touchenter",[g]:k,[v]:O,[S]:A,[w]:D,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[C]:C,[T]:T,[E]:E,[P]:P,[g]:g,[v]:v,[S]:S,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},B=J=>J.indexOf("pointer")>=0?"pointer":J.indexOf("touch")>=0?"touch":"mouse",U=J=>{const j=B(J);if(j==="pointer")return i.Konva.pointerEventsEnabled&&$.pointer;if(j==="touch")return $.touch;if(j==="mouse")return $.mouse};function G(J={}){return(J.clipFunc||J.clipWidth||J.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),J}const Y="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class ee extends r.Container{constructor(j){super(G(j)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{G(this.attrs)}),this._checkVisibility()}_validateAdd(j){const Q=j.getType()==="Layer",ne=j.getType()==="FastLayer";Q||ne||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const j=this.visible()?"":"none";this.content.style.display=j}setContainer(j){if(typeof j===c){if(j.charAt(0)==="."){var Q=j.slice(1);j=document.getElementsByClassName(Q)[0]}else{var ne;j.charAt(0)!=="#"?ne=j:ne=j.slice(1),j=document.getElementById(ne)}if(!j)throw"Can not find container in document with id "+ne}return this._setAttr("container",j),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),j.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var j=this.children,Q=j.length,ne;for(ne=0;ne<Q;ne++)j[ne].clear();return this}clone(j){return j||(j={}),j.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,j)}destroy(){super.destroy();var j=this.content;j&&t.Util._isInDocument(j)&&this.container().removeChild(j);var Q=e.stages.indexOf(this);return Q>-1&&e.stages.splice(Q,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const j=this._pointerPositions[0]||this._changedPointerPositions[0];return j?{x:j.x,y:j.y}:(t.Util.warn(Y),null)}_getPointerById(j){return this._pointerPositions.find(Q=>Q.id===j)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(j){j=j||{},j.x=j.x||0,j.y=j.y||0,j.width=j.width||this.width(),j.height=j.height||this.height();var Q=new o.SceneCanvas({width:j.width,height:j.height,pixelRatio:j.pixelRatio||1}),ne=Q.getContext()._context,se=this.children;return(j.x||j.y)&&ne.translate(-1*j.x,-1*j.y),se.forEach(function(be){if(be.isVisible()){var ce=be._toKonvaCanvas(j);ne.drawImage(ce._canvas,j.x,j.y,ce.getWidth()/ce.getPixelRatio(),ce.getHeight()/ce.getPixelRatio())}}),Q}getIntersection(j){if(!j)return null;var Q=this.children,ne=Q.length,se=ne-1,be;for(be=se;be>=0;be--){const ce=Q[be].getIntersection(j);if(ce)return ce}return null}_resizeDOM(){var j=this.width(),Q=this.height();this.content&&(this.content.style.width=j+d,this.content.style.height=Q+d),this.bufferCanvas.setSize(j,Q),this.bufferHitCanvas.setSize(j,Q),this.children.forEach(ne=>{ne.setSize({width:j,height:Q}),ne.draw()})}add(j,...Q){if(arguments.length>1){for(var ne=0;ne<arguments.length;ne++)this.add(arguments[ne]);return this}super.add(j);var se=this.children.length;return se>M&&t.Util.warn("The stage has "+se+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),j.setSize({width:this.width(),height:this.height()}),j.draw(),i.Konva.isBrowser&&this.content.appendChild(j.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(j){return l.hasPointerCapture(j,this)}setPointerCapture(j){l.setPointerCapture(j,this)}releaseCapture(j){l.releaseCapture(j,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&R.forEach(([j,Q])=>{this.content.addEventListener(j,ne=>{this[Q](ne)},{passive:!1})})}_pointerenter(j){this.setPointersPositions(j);const Q=U(j.type);this._fire(Q.pointerenter,{evt:j,target:this,currentTarget:this})}_pointerover(j){this.setPointersPositions(j);const Q=U(j.type);this._fire(Q.pointerover,{evt:j,target:this,currentTarget:this})}_getTargetShape(j){let Q=this[j+"targetShape"];return Q&&!Q.getStage()&&(Q=null),Q}_pointerleave(j){const Q=U(j.type),ne=B(j.type);if(Q){this.setPointersPositions(j);var se=this._getTargetShape(ne),be=!a.DD.isDragging||i.Konva.hitOnDragEnabled;se&&be?(se._fireAndBubble(Q.pointerout,{evt:j}),se._fireAndBubble(Q.pointerleave,{evt:j}),this._fire(Q.pointerleave,{evt:j,target:this,currentTarget:this}),this[ne+"targetShape"]=null):be&&(this._fire(Q.pointerleave,{evt:j,target:this,currentTarget:this}),this._fire(Q.pointerout,{evt:j,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(j){const Q=U(j.type),ne=B(j.type);if(Q){this.setPointersPositions(j);var se=!1;this._changedPointerPositions.forEach(be=>{var ce=this.getIntersection(be);if(a.DD.justDragged=!1,i.Konva["_"+ne+"ListenClick"]=!0,!(ce&&ce.isListening()))return;i.Konva.capturePointerEventsEnabled&&ce.setPointerCapture(be.id),this[ne+"ClickStartShape"]=ce,ce._fireAndBubble(Q.pointerdown,{evt:j,pointerId:be.id}),se=!0;const ot=j.type.indexOf("touch")>=0;ce.preventDefault()&&j.cancelable&&ot&&j.preventDefault()}),se||this._fire(Q.pointerdown,{evt:j,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(j){const Q=U(j.type),ne=B(j.type);if(!Q)return;a.DD.isDragging&&a.DD.node.preventDefault()&&j.cancelable&&j.preventDefault(),this.setPointersPositions(j);var se=!a.DD.isDragging||i.Konva.hitOnDragEnabled;if(!se)return;var be={};let ce=!1;var bt=this._getTargetShape(ne);this._changedPointerPositions.forEach(ot=>{const ze=l.getCapturedShape(ot.id)||this.getIntersection(ot),mt=ot.id,Ie={evt:j,pointerId:mt};var en=bt!==ze;if(en&&bt&&(bt._fireAndBubble(Q.pointerout,Object.assign({},Ie),ze),bt._fireAndBubble(Q.pointerleave,Object.assign({},Ie),ze)),ze){if(be[ze._id])return;be[ze._id]=!0}ze&&ze.isListening()?(ce=!0,en&&(ze._fireAndBubble(Q.pointerover,Object.assign({},Ie),bt),ze._fireAndBubble(Q.pointerenter,Object.assign({},Ie),bt),this[ne+"targetShape"]=ze),ze._fireAndBubble(Q.pointermove,Object.assign({},Ie))):bt&&(this._fire(Q.pointerover,{evt:j,target:this,currentTarget:this,pointerId:mt}),this[ne+"targetShape"]=null)}),ce||this._fire(Q.pointermove,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(j){const Q=U(j.type),ne=B(j.type);if(!Q)return;this.setPointersPositions(j);const se=this[ne+"ClickStartShape"],be=this[ne+"ClickEndShape"];var ce={};let bt=!1;this._changedPointerPositions.forEach(ot=>{const ze=l.getCapturedShape(ot.id)||this.getIntersection(ot);if(ze){if(ze.releaseCapture(ot.id),ce[ze._id])return;ce[ze._id]=!0}const mt=ot.id,Ie={evt:j,pointerId:mt};let en=!1;i.Konva["_"+ne+"InDblClickWindow"]?(en=!0,clearTimeout(this[ne+"DblTimeout"])):a.DD.justDragged||(i.Konva["_"+ne+"InDblClickWindow"]=!0,clearTimeout(this[ne+"DblTimeout"])),this[ne+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ne+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),ze&&ze.isListening()?(bt=!0,this[ne+"ClickEndShape"]=ze,ze._fireAndBubble(Q.pointerup,Object.assign({},Ie)),i.Konva["_"+ne+"ListenClick"]&&se&&se===ze&&(ze._fireAndBubble(Q.pointerclick,Object.assign({},Ie)),en&&be&&be===ze&&ze._fireAndBubble(Q.pointerdblclick,Object.assign({},Ie)))):(this[ne+"ClickEndShape"]=null,i.Konva["_"+ne+"ListenClick"]&&this._fire(Q.pointerclick,{evt:j,target:this,currentTarget:this,pointerId:mt}),en&&this._fire(Q.pointerdblclick,{evt:j,target:this,currentTarget:this,pointerId:mt}))}),bt||this._fire(Q.pointerup,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ne+"ListenClick"]=!1,j.cancelable&&ne!=="touch"&&j.preventDefault()}_contextmenu(j){this.setPointersPositions(j);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(N,{evt:j}):this._fire(N,{evt:j,target:this,currentTarget:this})}_wheel(j){this.setPointersPositions(j);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(L,{evt:j}):this._fire(L,{evt:j,target:this,currentTarget:this})}_pointercancel(j){this.setPointersPositions(j);const Q=l.getCapturedShape(j.pointerId)||this.getIntersection(this.getPointerPosition());Q&&Q._fireAndBubble(S,l.createEvent(j)),l.releaseCapture(j.pointerId)}_lostpointercapture(j){l.releaseCapture(j.pointerId)}setPointersPositions(j){var Q=this._getContentPosition(),ne=null,se=null;j=j||window.event,j.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(j.touches,be=>{this._pointerPositions.push({id:be.identifier,x:(be.clientX-Q.left)/Q.scaleX,y:(be.clientY-Q.top)/Q.scaleY})}),Array.prototype.forEach.call(j.changedTouches||j.touches,be=>{this._changedPointerPositions.push({id:be.identifier,x:(be.clientX-Q.left)/Q.scaleX,y:(be.clientY-Q.top)/Q.scaleY})})):(ne=(j.clientX-Q.left)/Q.scaleX,se=(j.clientY-Q.top)/Q.scaleY,this.pointerPos={x:ne,y:se},this._pointerPositions=[{x:ne,y:se,id:t.Util._getFirstPointerId(j)}],this._changedPointerPositions=[{x:ne,y:se,id:t.Util._getFirstPointerId(j)}])}_setPointerPosition(j){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(j)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var j=this.content.getBoundingClientRect();return{top:j.top,left:j.left,scaleX:j.width/this.content.clientWidth||1,scaleY:j.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var j=this.container();if(!j)throw"Stage has no container. A container is required.";j.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),j.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(j){j.batchDraw()}),this}}e.Stage=ee,ee.prototype.nodeType=u,(0,s._registerNode)(ee),n.Factory.addGetterSetter(ee,"container")})(OG);var $y={},Yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Rt,n=fr,r=kt,i=rr,o=Xe,a=Rt,s=Qo;var l="hasShadow",u="shadowRGBA",c="patternImage",d="linearGradient",f="radialGradient";let h;function p(){return h||(h=n.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function m(T){const E=this.attrs.fillRule;E?T.fill(E):T.fill()}function _(T){T.stroke()}function b(T){T.fill()}function y(T){T.stroke()}function g(){this._clearCache(l)}function v(){this._clearCache(u)}function S(){this._clearCache(c)}function w(){this._clearCache(d)}function x(){this._clearCache(f)}class C extends i.Node{constructor(E){super(E);let P;for(;P=n.Util.getRandomColor(),!(P&&!(P in e.shapes)););this.colorKey=P,e.shapes[P]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(l,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var E=p();const P=E.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(P&&P.setTransform){const N=new n.Transform;N.translate(this.fillPatternX(),this.fillPatternY()),N.rotate(t.Konva.getAngle(this.fillPatternRotation())),N.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),N.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const O=N.getMatrix(),A=typeof DOMMatrix>"u"?{a:O[0],b:O[1],c:O[2],d:O[3],e:O[4],f:O[5]}:new DOMMatrix(O);P.setTransform(A)}return P}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var E=this.fillLinearGradientColorStops();if(E){for(var P=p(),N=this.fillLinearGradientStartPoint(),O=this.fillLinearGradientEndPoint(),A=P.createLinearGradient(N.x,N.y,O.x,O.y),k=0;k<E.length;k+=2)A.addColorStop(E[k],E[k+1]);return A}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var E=this.fillRadialGradientColorStops();if(E){for(var P=p(),N=this.fillRadialGradientStartPoint(),O=this.fillRadialGradientEndPoint(),A=P.createRadialGradient(N.x,N.y,this.fillRadialGradientStartRadius(),O.x,O.y,this.fillRadialGradientEndRadius()),k=0;k<E.length;k+=2)A.addColorStop(E[k],E[k+1]);return A}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var E=n.Util.colorToRGBA(this.shadowColor());if(E)return"rgba("+E.r+","+E.g+","+E.b+","+E.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const E=this.hitStrokeWidth();return E==="auto"?this.hasStroke():this.strokeEnabled()&&!!E}intersects(E){var P=this.getStage(),N=P.bufferHitCanvas,O;return N.getContext().clear(),this.drawHit(N,null,!0),O=N.context.getImageData(Math.round(E.x),Math.round(E.y),1,1).data,O[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(E){var P;if(!this.getStage()||!((P=this.attrs.perfectDrawEnabled)!==null&&P!==void 0?P:!0))return!1;const O=E||this.hasFill(),A=this.hasStroke(),k=this.getAbsoluteOpacity()!==1;if(O&&A&&k)return!0;const D=this.hasShadow(),L=this.shadowForStrokeEnabled();return!!(O&&A&&D&&L)}setStrokeHitEnabled(E){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),E?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var E=this.size();return{x:this._centroid?-E.width/2:0,y:this._centroid?-E.height/2:0,width:E.width,height:E.height}}getClientRect(E={}){const P=E.skipTransform,N=E.relativeTo,O=this.getSelfRect(),k=!E.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=O.width+k,L=O.height+k,M=!E.skipShadow&&this.hasShadow(),R=M?this.shadowOffsetX():0,$=M?this.shadowOffsetY():0,B=D+Math.abs(R),U=L+Math.abs($),G=M&&this.shadowBlur()||0,Y=B+G*2,ee=U+G*2,J={width:Y,height:ee,x:-(k/2+G)+Math.min(R,0)+O.x,y:-(k/2+G)+Math.min($,0)+O.y};return P?J:this._transformedRect(J,N)}drawScene(E,P){var N=this.getLayer(),O=E||N.getCanvas(),A=O.getContext(),k=this._getCanvasCache(),D=this.getSceneFunc(),L=this.hasShadow(),M,R,$,B=O.isCache,U=P===this;if(!this.isVisible()&&!U)return this;if(k){A.save();var G=this.getAbsoluteTransform(P).getMatrix();return A.transform(G[0],G[1],G[2],G[3],G[4],G[5]),this._drawCachedSceneCanvas(A),A.restore(),this}if(!D)return this;if(A.save(),this._useBufferCanvas()&&!B){M=this.getStage(),R=M.bufferCanvas,$=R.getContext(),$.clear(),$.save(),$._applyLineJoin(this);var Y=this.getAbsoluteTransform(P).getMatrix();$.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),D.call(this,$,this),$.restore();var ee=R.pixelRatio;L&&A._applyShadow(this),A._applyOpacity(this),A._applyGlobalCompositeOperation(this),A.drawImage(R._canvas,0,0,R.width/ee,R.height/ee)}else{if(A._applyLineJoin(this),!U){var Y=this.getAbsoluteTransform(P).getMatrix();A.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),A._applyOpacity(this),A._applyGlobalCompositeOperation(this)}L&&A._applyShadow(this),D.call(this,A,this)}return A.restore(),this}drawHit(E,P,N=!1){if(!this.shouldDrawHit(P,N))return this;var O=this.getLayer(),A=E||O.hitCanvas,k=A&&A.getContext(),D=this.hitFunc()||this.sceneFunc(),L=this._getCanvasCache(),M=L&&L.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),M){k.save();var R=this.getAbsoluteTransform(P).getMatrix();return k.transform(R[0],R[1],R[2],R[3],R[4],R[5]),this._drawCachedHitCanvas(k),k.restore(),this}if(!D)return this;if(k.save(),k._applyLineJoin(this),!(this===P)){var B=this.getAbsoluteTransform(P).getMatrix();k.transform(B[0],B[1],B[2],B[3],B[4],B[5])}return D.call(this,k,this),k.restore(),this}drawHitFromCache(E=0){var P=this._getCanvasCache(),N=this._getCachedSceneCanvas(),O=P.hit,A=O.getContext(),k=O.getWidth(),D=O.getHeight(),L,M,R,$,B,U;A.clear(),A.drawImage(N._canvas,0,0,k,D);try{for(L=A.getImageData(0,0,k,D),M=L.data,R=M.length,$=n.Util._hexToRgb(this.colorKey),B=0;B<R;B+=4)U=M[B+3],U>E?(M[B]=$.r,M[B+1]=$.g,M[B+2]=$.b,M[B+3]=255):M[B+3]=0;A.putImageData(L,0,0)}catch(G){n.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(E){return s.hasPointerCapture(E,this)}setPointerCapture(E){s.setPointerCapture(E,this)}releaseCapture(E){s.releaseCapture(E,this)}}e.Shape=C,C.prototype._fillFunc=m,C.prototype._strokeFunc=_,C.prototype._fillFuncHit=b,C.prototype._strokeFuncHit=y,C.prototype._centroid=!1,C.prototype.nodeType="Shape",(0,a._registerNode)(C),C.prototype.eventListeners={},C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",S),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",w),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",x),r.Factory.addGetterSetter(C,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(C,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(C,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"lineJoin"),r.Factory.addGetterSetter(C,"lineCap"),r.Factory.addGetterSetter(C,"sceneFunc"),r.Factory.addGetterSetter(C,"hitFunc"),r.Factory.addGetterSetter(C,"dash"),r.Factory.addGetterSetter(C,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(C,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(C,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternImage"),r.Factory.addGetterSetter(C,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(C,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(C,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(C,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(C,"fillEnabled",!0),r.Factory.addGetterSetter(C,"strokeEnabled",!0),r.Factory.addGetterSetter(C,"shadowEnabled",!0),r.Factory.addGetterSetter(C,"dashEnabled",!0),r.Factory.addGetterSetter(C,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(C,"fillPriority","color"),r.Factory.addComponentsGetterSetter(C,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(C,"fillPatternRotation",0),r.Factory.addGetterSetter(C,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(C,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Yr);Object.defineProperty($y,"__esModule",{value:!0});$y.Layer=void 0;const yl=fr,s5=Xd,xf=rr,D4=kt,CO=cs,rCe=Xe,iCe=Yr,oCe=Rt;var aCe="#",sCe="beforeDraw",lCe="draw",NG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],uCe=NG.length;class kp extends s5.Container{constructor(t){super(t),this.canvas=new CO.SceneCanvas,this.hitCanvas=new CO.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[t+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){xf.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=xf.Node.prototype.moveUp.call(this);if(!t)return!1;var n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(xf.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(xf.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return xf.Node.prototype.remove.call(this),t&&t.parentNode&&yl.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:n}){return this.canvas.setSize(t,n),this.hitCanvas.setSize(t,n),this._setSmoothEnabled(),this}_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&yl.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),xf.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){yl.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){yl.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,yl.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<uCe;i++){const o=NG[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=yl.Util._rgbToHex(r[0],r[1],r[2]),a=iCe.shapes[aCe+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(sCe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),s5.Container.prototype.drawScene.call(this,i,n),this._fire(lCe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),s5.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){yl.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return yl.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return yl.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}$y.Layer=kp;kp.prototype.nodeType="Layer";(0,oCe._registerNode)(kp);D4.Factory.addGetterSetter(kp,"imageSmoothingEnabled",!0);D4.Factory.addGetterSetter(kp,"clearBeforeDraw",!0);D4.Factory.addGetterSetter(kp,"hitGraphEnabled",!0,(0,rCe.getBooleanValidator)());var bx={};Object.defineProperty(bx,"__esModule",{value:!0});bx.FastLayer=void 0;const cCe=fr,dCe=$y,fCe=Rt;class L4 extends dCe.Layer{constructor(t){super(t),this.listening(!1),cCe.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}bx.FastLayer=L4;L4.prototype.nodeType="FastLayer";(0,fCe._registerNode)(L4);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Group=void 0;const hCe=fr,pCe=Xd,gCe=Rt;class F4 extends pCe.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&hCe.Util.throw("You may only add groups and shapes to groups.")}}Pp.Group=F4;F4.prototype.nodeType="Group";(0,gCe._registerNode)(F4);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Animation=void 0;const l5=Rt,AO=fr;var u5=function(){return l5.glob.performance&&l5.glob.performance.now?function(){return l5.glob.performance.now()}:function(){return new Date().getTime()}}();class Ls{constructor(t,n){this.id=Ls.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:u5(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){var t=Ls,n=t.animations,r=n.length,i;for(i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=u5(),Ls._addAnimation(this),this}stop(){return Ls._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){var n=t.id,r=this.animations,i=r.length,o;for(o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){var t={},n=this.animations,r,i,o,a,s,l,u,c,d;for(a=0;a<n.length;a++)if(r=n[a],i=r.layers,o=r.func,r._updateFrameObject(u5()),l=i.length,o?d=o.call(r,r.frame)!==!1:d=!0,!!d)for(s=0;s<l;s++)u=i[s],u._id!==void 0&&(t[u._id]=u);for(c in t)t.hasOwnProperty(c)&&t[c].batchDraw()}static _animationLoop(){var t=Ls;t.animations.length?(t._runFrames(),AO.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,AO.Util.requestAnimFrame(this._animationLoop))}}Ip.Animation=Ls;Ls.animations=[];Ls.animIdCounter=0;Ls.animRunning=!1;var DG={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=fr,n=Ip,r=rr,i=Rt;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,s=2,l=3,u=0,c=["fill","stroke","shadowColor"];class d{constructor(p,m,_,b,y,g,v){this.prop=p,this.propFunc=m,this.begin=b,this._pos=b,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=v,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=y-this.begin,this.pause()}fire(p){var m=this[p];m&&m()}setTime(p){p>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():p<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=p,this.update())}getTime(){return this._time}setPosition(p){this.prevPos=this._pos,this.propFunc(p),this._pos=p}getPosition(p){return p===void 0&&(p=this._time),this.func(p,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=l,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(p){this.pause(),this._time=p,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var p=this.getTimer()-this._startTime;this.state===s?this.setTime(p):this.state===l&&this.setTime(this.duration-p)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class f{constructor(p){var m=this,_=p.node,b=_._id,y,g=p.easing||e.Easings.Linear,v=!!p.yoyo,S;typeof p.duration>"u"?y=.3:p.duration===0?y=.001:y=p.duration,this.node=_,this._id=u++;var w=_.getLayer()||(_ instanceof i.Konva.Stage?_.getLayers():null);w||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){m.tween.onEnterFrame()},w),this.tween=new d(S,function(x){m._tweenFunc(x)},g,0,1,y*1e3,v),this._addListeners(),f.attrs[b]||(f.attrs[b]={}),f.attrs[b][this._id]||(f.attrs[b][this._id]={}),f.tweens[b]||(f.tweens[b]={});for(S in p)o[S]===void 0&&this._addAttr(S,p[S]);this.reset(),this.onFinish=p.onFinish,this.onReset=p.onReset,this.onUpdate=p.onUpdate}_addAttr(p,m){var _=this.node,b=_._id,y,g,v,S,w,x,C,T;if(v=f.tweens[b][p],v&&delete f.attrs[b][v][p],y=_.getAttr(p),t.Util._isArray(m))if(g=[],w=Math.max(m.length,y.length),p==="points"&&m.length!==y.length&&(m.length>y.length?(C=y,y=t.Util._prepareArrayForTween(y,m,_.closed())):(x=m,m=t.Util._prepareArrayForTween(m,y,_.closed()))),p.indexOf("fill")===0)for(S=0;S<w;S++)if(S%2===0)g.push(m[S]-y[S]);else{var E=t.Util.colorToRGBA(y[S]);T=t.Util.colorToRGBA(m[S]),y[S]=E,g.push({r:T.r-E.r,g:T.g-E.g,b:T.b-E.b,a:T.a-E.a})}else for(S=0;S<w;S++)g.push(m[S]-y[S]);else c.indexOf(p)!==-1?(y=t.Util.colorToRGBA(y),T=t.Util.colorToRGBA(m),g={r:T.r-y.r,g:T.g-y.g,b:T.b-y.b,a:T.a-y.a}):g=m-y;f.attrs[b][this._id][p]={start:y,diff:g,end:m,trueEnd:x,trueStart:C},f.tweens[b][p]=this._id}_tweenFunc(p){var m=this.node,_=f.attrs[m._id][this._id],b,y,g,v,S,w,x,C;for(b in _){if(y=_[b],g=y.start,v=y.diff,C=y.end,t.Util._isArray(g))if(S=[],x=Math.max(g.length,C.length),b.indexOf("fill")===0)for(w=0;w<x;w++)w%2===0?S.push((g[w]||0)+v[w]*p):S.push("rgba("+Math.round(g[w].r+v[w].r*p)+","+Math.round(g[w].g+v[w].g*p)+","+Math.round(g[w].b+v[w].b*p)+","+(g[w].a+v[w].a*p)+")");else for(w=0;w<x;w++)S.push((g[w]||0)+v[w]*p);else c.indexOf(b)!==-1?S="rgba("+Math.round(g.r+v.r*p)+","+Math.round(g.g+v.g*p)+","+Math.round(g.b+v.b*p)+","+(g.a+v.a*p)+")":S=g+v*p;m.setAttr(b,S)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var p=this.node,m=f.attrs[p._id][this._id];m.points&&m.points.trueEnd&&p.setAttr("points",m.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var p=this.node,m=f.attrs[p._id][this._id];m.points&&m.points.trueStart&&p.points(m.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(p){return this.tween.seek(p*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var p=this.node._id,m=this._id,_=f.tweens[p],b;this.pause();for(b in _)delete f.tweens[p][b];delete f.attrs[p][m]}}e.Tween=f,f.attrs={},f.tweens={},r.Node.prototype.to=function(h){var p=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),p&&p()};var m=new f(h);m.play()},e.Easings={BackEaseIn(h,p,m,_){var b=1.70158;return m*(h/=_)*h*((b+1)*h-b)+p},BackEaseOut(h,p,m,_){var b=1.70158;return m*((h=h/_-1)*h*((b+1)*h+b)+1)+p},BackEaseInOut(h,p,m,_){var b=1.70158;return(h/=_/2)<1?m/2*(h*h*(((b*=1.525)+1)*h-b))+p:m/2*((h-=2)*h*(((b*=1.525)+1)*h+b)+2)+p},ElasticEaseIn(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),-(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p)},ElasticEaseOut(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),b*Math.pow(2,-10*h)*Math.sin((h*_-g)*(2*Math.PI)/y)+m+p)},ElasticEaseInOut(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_/2)===2?p+m:(y||(y=_*(.3*1.5)),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),h<1?-.5*(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p:b*Math.pow(2,-10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y)*.5+m+p)},BounceEaseOut(h,p,m,_){return(h/=_)<1/2.75?m*(7.5625*h*h)+p:h<2/2.75?m*(7.5625*(h-=1.5/2.75)*h+.75)+p:h<2.5/2.75?m*(7.5625*(h-=2.25/2.75)*h+.9375)+p:m*(7.5625*(h-=2.625/2.75)*h+.984375)+p},BounceEaseIn(h,p,m,_){return m-e.Easings.BounceEaseOut(_-h,0,m,_)+p},BounceEaseInOut(h,p,m,_){return h<_/2?e.Easings.BounceEaseIn(h*2,0,m,_)*.5+p:e.Easings.BounceEaseOut(h*2-_,0,m,_)*.5+m*.5+p},EaseIn(h,p,m,_){return m*(h/=_)*h+p},EaseOut(h,p,m,_){return-m*(h/=_)*(h-2)+p},EaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h+p:-m/2*(--h*(h-2)-1)+p},StrongEaseIn(h,p,m,_){return m*(h/=_)*h*h*h*h+p},StrongEaseOut(h,p,m,_){return m*((h=h/_-1)*h*h*h*h+1)+p},StrongEaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h*h*h*h+p:m/2*((h-=2)*h*h*h*h+2)+p},Linear(h,p,m,_){return m*h/_+p}}})(DG);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Rt,n=fr,r=rr,i=Xd,o=OG,a=$y,s=bx,l=Pp,u=yx,c=Yr,d=Ip,f=DG,h=zl,p=cs;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:s.FastLayer,Group:l.Group,DD:u.DD,Shape:c.Shape,shapes:c.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:h.Context,Canvas:p.Canvas}),e.default=e.Konva})(kG);var _x={};Object.defineProperty(_x,"__esModule",{value:!0});_x.Arc=void 0;const Sx=kt,mCe=Yr,EO=Rt,xx=Xe,yCe=Rt;class lu extends mCe.Shape{_sceneFunc(t){var n=EO.Konva.getAngle(this.angle()),r=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,n,r),t.arc(0,0,this.innerRadius(),n,0,!r),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=EO.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),a=1,s=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),l=Math.sin(Math.min(i,Math.PI/2)),u=o*(o>0?t:n),c=a*n,d=s*(s>0?t:n),f=l*(l>0?n:t);return{x:u,y:r?-1*f:d,width:c-u,height:f-d}}}_x.Arc=lu;lu.prototype._centroid=!0;lu.prototype.className="Arc";lu.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,yCe._registerNode)(lu);Sx.Factory.addGetterSetter(lu,"innerRadius",0,(0,xx.getNumberValidator)());Sx.Factory.addGetterSetter(lu,"outerRadius",0,(0,xx.getNumberValidator)());Sx.Factory.addGetterSetter(lu,"angle",0,(0,xx.getNumberValidator)());Sx.Factory.addGetterSetter(lu,"clockwise",!1,(0,xx.getBooleanValidator)());var wx={},Ny={};Object.defineProperty(Ny,"__esModule",{value:!0});Ny.Line=void 0;const Cx=kt,vCe=Yr,LG=Xe,bCe=Rt;function lE(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),c=a*l/(s+l),d=n-u*(i-e),f=r-u*(o-t),h=n+c*(i-e),p=r+c*(o-t);return[d,f,h,p]}function TO(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=lE(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(o[0])&&(r.push(o[0]),r.push(o[1]),r.push(e[i]),r.push(e[i+1]),r.push(o[2]),r.push(o[3]));return r}class Ic extends vCe.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var n=this.points(),r=n.length,i=this.tension(),o=this.closed(),a=this.bezier(),s,l,u;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);u<l-2;)t.bezierCurveTo(s[u++],s[u++],s[u++],s[u++],s[u++],s[u++]);o||t.quadraticCurveTo(s[l-2],s[l-1],n[r-2],n[r-1])}else if(a)for(u=2;u<r;)t.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)t.lineTo(n[u],n[u+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():TO(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=lE(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=lE(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),a=TO(t,r),s=[i[2],i[3]].concat(a).concat([o[0],o[1],t[n-2],t[n-1],o[2],o[3],i[0],i[1],t[0],t[1]]);return s}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var n=t[0],r=t[0],i=t[1],o=t[1],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);return{x:n,y:i,width:r-n,height:o-i}}}Ny.Line=Ic;Ic.prototype.className="Line";Ic.prototype._attrsAffectingSize=["points","bezier","tension"];(0,bCe._registerNode)(Ic);Cx.Factory.addGetterSetter(Ic,"closed",!1);Cx.Factory.addGetterSetter(Ic,"bezier",!1);Cx.Factory.addGetterSetter(Ic,"tension",0,(0,LG.getNumberValidator)());Cx.Factory.addGetterSetter(Ic,"points",[],(0,LG.getNumberArrayValidator)());var Rp={},FG={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(a,s,l)=>{let u,c,d;u=l/2,c=0;for(let h=0;h<20;h++)d=u*e.tValues[20][h]+u,c+=e.cValues[20][h]*r(a,s,d);return u*c};e.getCubicArcLength=t;const n=(a,s,l)=>{l===void 0&&(l=1);const u=a[0]-2*a[1]+a[2],c=s[0]-2*s[1]+s[2],d=2*a[1]-2*a[0],f=2*s[1]-2*s[0],h=4*(u*u+c*c),p=4*(u*d+c*f),m=d*d+f*f;if(h===0)return l*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(s[2]-s[0],2));const _=p/(2*h),b=m/h,y=l+_,g=b-_*_,v=y*y+g>0?Math.sqrt(y*y+g):0,S=_*_+g>0?Math.sqrt(_*_+g):0,w=_+Math.sqrt(_*_+g)!==0?g*Math.log(Math.abs((y+v)/(_+S))):0;return Math.sqrt(h)/2*(y*v-_*S+w)};e.getQuadraticArcLength=n;function r(a,s,l){const u=i(1,l,a),c=i(1,l,s),d=u*u+c*c;return Math.sqrt(d)}const i=(a,s,l)=>{const u=l.length-1;let c,d;if(u===0)return 0;if(a===0){d=0;for(let f=0;f<=u;f++)d+=e.binomialCoefficients[u][f]*Math.pow(1-s,u-f)*Math.pow(s,f)*l[f];return d}else{c=new Array(u);for(let f=0;f<u;f++)c[f]=u*(l[f+1]-l[f]);return i(a-1,s,c)}},o=(a,s,l)=>{let u=1,c=a/s,d=(a-l(c))/s,f=0;for(;u>.001;){const h=l(c+d),p=Math.abs(a-h)/s;if(p<u)u=p,c+=d;else{const m=l(c-d),_=Math.abs(a-m)/s;_<u?(u=_,c-=d):d/=2}if(f++,f>500)break}return c};e.t2length=o})(FG);Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Path=void 0;const _Ce=kt,SCe=Yr,xCe=Rt,wf=FG;class qr extends SCe.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=qr.parsePathData(this.data()),this.pathLength=qr.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,i=0;i<n.length;i++){var o=n[i].command,a=n[i].points;switch(o){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var s=a[0],l=a[1],u=a[2],c=a[3],d=a[4],f=a[5],h=a[6],p=a[7],m=u>c?u:c,_=u>c?1:u/c,b=u>c?c/u:1;t.translate(s,l),t.rotate(h),t.scale(_,b),t.arc(0,0,m,d,d+f,1-p),t.scale(1/_,1/b),t.rotate(-h),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var c=u.points[4],d=u.points[5],f=u.points[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),d<0)for(let p=c-h;p>f;p-=h){const m=qr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}else for(let p=c+h;p<f;p+=h){const m=qr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}}else if(u.command==="C")for(let p=0;p<=1;p+=.01){const m=qr.getPointOnCubicBezier(p,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(m.x,m.y)}else t=t.concat(u.points)});for(var n=t[0],r=t[0],i=t[1],o=t[1],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(s)||(i=Math.min(i,s),o=Math.max(o,s));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return qr.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPathLength(t){let n=0;for(var r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){var r,i=0,o=n.length;if(!o)return null;for(;i<o&&t>n[i].pathLength;)t-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};var a=n[i],s=a.points;switch(a.command){case"L":return qr.getPointOnLine(t,a.start.x,a.start.y,s[0],s[1]);case"C":return qr.getPointOnCubicBezier((0,wf.t2length)(t,qr.getPathLength(n),m=>(0,wf.getCubicArcLength)([a.start.x,s[0],s[2],s[4]],[a.start.y,s[1],s[3],s[5]],m)),a.start.x,a.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return qr.getPointOnQuadraticBezier((0,wf.t2length)(t,qr.getPathLength(n),m=>(0,wf.getQuadraticArcLength)([a.start.x,s[0],s[2]],[a.start.y,s[1],s[3]],m)),a.start.x,a.start.y,s[0],s[1],s[2],s[3]);case"A":var l=s[0],u=s[1],c=s[2],d=s[3],f=s[4],h=s[5],p=s[6];return f+=h*t/a.pathLength,qr.getPointOnEllipticalArc(l,u,c,d,f,p)}return null}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i<n&&(u*=-1);var c=l*u,d;if(i===n)d={x:a,y:s+c};else if((s-r)/(a-n+1e-8)===l)d={x:a+u,y:s+c};else{var f,h,p=this.getLineLength(n,r,i,o),m=(a-n)*(i-n)+(s-r)*(o-r);m=m/(p*p),f=n+m*(i-n),h=r+m*(o-r);var _=this.getLineLength(a,s,f,h),b=Math.sqrt(t*t-_*_);u=Math.sqrt(b*b/(1+l*l)),i<n&&(u*=-1),c=l*u,d={x:f+u,y:h+c}}return d}static getPointOnCubicBezier(t,n,r,i,o,a,s,l,u){function c(_){return _*_*_}function d(_){return 3*_*_*(1-_)}function f(_){return 3*_*(1-_)*(1-_)}function h(_){return(1-_)*(1-_)*(1-_)}var p=l*c(t)+a*d(t)+i*f(t)+n*h(t),m=u*c(t)+s*d(t)+o*f(t)+r*h(t);return{x:p,y:m}}static getPointOnQuadraticBezier(t,n,r,i,o,a,s){function l(h){return h*h}function u(h){return 2*h*(1-h)}function c(h){return(1-h)*(1-h)}var d=a*l(t)+i*u(t)+n*c(t),f=s*l(t)+o*u(t)+r*c(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,n,r,i,o,a){var s=Math.cos(a),l=Math.sin(a),u={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(u.x*s-u.y*l),y:n+(u.x*l+u.y*s)}}static parsePathData(t){if(!t)return[];var n=t,r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);var o=n.split("|"),a=[],s=[],l=0,u=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(i=1;i<o.length;i++){var f=o[i],h=f.charAt(0);for(f=f.slice(1),s.length=0;d=c.exec(f);)s.push(d[0]);for(var p=[],m=0,_=s.length;m<_;m++){if(s[m]==="00"){p.push(0,0);continue}var b=parseFloat(s[m]);isNaN(b)?p.push(0):p.push(b)}for(;p.length>0&&!isNaN(p[0]);){var y=null,g=[],v=l,S=u,w,x,C,T,E,P,N,O,A,k;switch(h){case"l":l+=p.shift(),u+=p.shift(),y="L",g.push(l,u);break;case"L":l=p.shift(),u=p.shift(),g.push(l,u);break;case"m":var D=p.shift(),L=p.shift();if(l+=D,u+=L,y="M",a.length>2&&a[a.length-1].command==="z"){for(var M=a.length-2;M>=0;M--)if(a[M].command==="M"){l=a[M].points[0]+D,u=a[M].points[1]+L;break}}g.push(l,u),h="l";break;case"M":l=p.shift(),u=p.shift(),y="M",g.push(l,u),h="L";break;case"h":l+=p.shift(),y="L",g.push(l,u);break;case"H":l=p.shift(),y="L",g.push(l,u);break;case"v":u+=p.shift(),y="L",g.push(l,u);break;case"V":u=p.shift(),y="L",g.push(l,u);break;case"C":g.push(p.shift(),p.shift(),p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"c":g.push(l+p.shift(),u+p.shift(),l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"S":x=l,C=u,w=a[a.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,p.shift(),p.shift()),l=p.shift(),u=p.shift(),y="C",g.push(l,u);break;case"s":x=l,C=u,w=a[a.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"Q":g.push(p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"q":g.push(l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="Q",g.push(l,u);break;case"T":x=l,C=u,w=a[a.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l=p.shift(),u=p.shift(),y="Q",g.push(x,C,l,u);break;case"t":x=l,C=u,w=a[a.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l+=p.shift(),u+=p.shift(),y="Q",g.push(x,C,l,u);break;case"A":T=p.shift(),E=p.shift(),P=p.shift(),N=p.shift(),O=p.shift(),A=l,k=u,l=p.shift(),u=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(A,k,l,u,N,O,T,E,P);break;case"a":T=p.shift(),E=p.shift(),P=p.shift(),N=p.shift(),O=p.shift(),A=l,k=u,l+=p.shift(),u+=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(A,k,l,u,N,O,T,E,P);break}a.push({command:y||h,points:g,start:{x:v,y:S},pathLength:this.calcLength(v,S,y||h,g)})}(h==="z"||h==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=qr;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":return(0,wf.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,wf.getQuadraticArcLength)([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var c=i[4],d=i[5],f=i[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),d<0)for(l=c-h;l>f;l-=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=c+h;l<f;l+=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,a,s,l,u){var c=u*(Math.PI/180),d=Math.cos(c)*(t-r)/2+Math.sin(c)*(n-i)/2,f=-1*Math.sin(c)*(t-r)/2+Math.cos(c)*(n-i)/2,h=d*d/(s*s)+f*f/(l*l);h>1&&(s*=Math.sqrt(h),l*=Math.sqrt(h));var p=Math.sqrt((s*s*(l*l)-s*s*(f*f)-l*l*(d*d))/(s*s*(f*f)+l*l*(d*d)));o===a&&(p*=-1),isNaN(p)&&(p=0);var m=p*s*f/l,_=p*-l*d/s,b=(t+r)/2+Math.cos(c)*m-Math.sin(c)*_,y=(n+i)/2+Math.sin(c)*m+Math.cos(c)*_,g=function(E){return Math.sqrt(E[0]*E[0]+E[1]*E[1])},v=function(E,P){return(E[0]*P[0]+E[1]*P[1])/(g(E)*g(P))},S=function(E,P){return(E[0]*P[1]<E[1]*P[0]?-1:1)*Math.acos(v(E,P))},w=S([1,0],[(d-m)/s,(f-_)/l]),x=[(d-m)/s,(f-_)/l],C=[(-1*d-m)/s,(-1*f-_)/l],T=S(x,C);return v(x,C)<=-1&&(T=Math.PI),v(x,C)>=1&&(T=0),a===0&&T>0&&(T=T-2*Math.PI),a===1&&T<0&&(T=T+2*Math.PI),[b,y,s,l,w,T,c,a]}}Rp.Path=qr;qr.prototype.className="Path";qr.prototype._attrsAffectingSize=["data"];(0,xCe._registerNode)(qr);_Ce.Factory.addGetterSetter(qr,"data");Object.defineProperty(wx,"__esModule",{value:!0});wx.Arrow=void 0;const Ax=kt,wCe=Ny,BG=Xe,CCe=Rt,kO=Rp;class Zd extends wCe.Line{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const f=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],h=kO.Path.calcLength(i[i.length-4],i[i.length-3],"C",f),p=kO.Path.getPointOnQuadraticBezier(Math.min(1,1-a/h),f[0],f[1],f[2],f[3],f[4],f[5]);l=r[s-2]-p.x,u=r[s-1]-p.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var c=(Math.atan2(u,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}wx.Arrow=Zd;Zd.prototype.className="Arrow";(0,CCe._registerNode)(Zd);Ax.Factory.addGetterSetter(Zd,"pointerLength",10,(0,BG.getNumberValidator)());Ax.Factory.addGetterSetter(Zd,"pointerWidth",10,(0,BG.getNumberValidator)());Ax.Factory.addGetterSetter(Zd,"pointerAtBeginning",!1);Ax.Factory.addGetterSetter(Zd,"pointerAtEnding",!0);var Ex={};Object.defineProperty(Ex,"__esModule",{value:!0});Ex.Circle=void 0;const ACe=kt,ECe=Yr,TCe=Xe,kCe=Rt;let Op=class extends ECe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};Ex.Circle=Op;Op.prototype._centroid=!0;Op.prototype.className="Circle";Op.prototype._attrsAffectingSize=["radius"];(0,kCe._registerNode)(Op);ACe.Factory.addGetterSetter(Op,"radius",0,(0,TCe.getNumberValidator)());var Tx={};Object.defineProperty(Tx,"__esModule",{value:!0});Tx.Ellipse=void 0;const B4=kt,PCe=Yr,zG=Xe,ICe=Rt;class Rc extends PCe.Shape{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}Tx.Ellipse=Rc;Rc.prototype.className="Ellipse";Rc.prototype._centroid=!0;Rc.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,ICe._registerNode)(Rc);B4.Factory.addComponentsGetterSetter(Rc,"radius",["x","y"]);B4.Factory.addGetterSetter(Rc,"radiusX",0,(0,zG.getNumberValidator)());B4.Factory.addGetterSetter(Rc,"radiusY",0,(0,zG.getNumberValidator)());var kx={};Object.defineProperty(kx,"__esModule",{value:!0});kx.Image=void 0;const c5=fr,Jd=kt,RCe=Yr,OCe=Rt,Dy=Xe;let ul=class jG extends RCe.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?a=[o,this.cropX(),this.cropY(),s,l,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?c5.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?c5.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=c5.Util.createImageElement();i.onload=function(){var o=new jG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};kx.Image=ul;ul.prototype.className="Image";(0,OCe._registerNode)(ul);Jd.Factory.addGetterSetter(ul,"cornerRadius",0,(0,Dy.getNumberOrArrayOfNumbersValidator)(4));Jd.Factory.addGetterSetter(ul,"image");Jd.Factory.addComponentsGetterSetter(ul,"crop",["x","y","width","height"]);Jd.Factory.addGetterSetter(ul,"cropX",0,(0,Dy.getNumberValidator)());Jd.Factory.addGetterSetter(ul,"cropY",0,(0,Dy.getNumberValidator)());Jd.Factory.addGetterSetter(ul,"cropWidth",0,(0,Dy.getNumberValidator)());Jd.Factory.addGetterSetter(ul,"cropHeight",0,(0,Dy.getNumberValidator)());var up={};Object.defineProperty(up,"__esModule",{value:!0});up.Tag=up.Label=void 0;const Px=kt,MCe=Yr,$Ce=Pp,z4=Xe,UG=Rt;var VG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],NCe="Change.konva",DCe="none",uE="up",cE="right",dE="down",fE="left",LCe=VG.length;class j4 extends $Ce.Group{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r<LCe;r++)t.on(VG[r]+NCe,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),n=this.getTag(),r,i,o,a,s,l,u;if(t&&n){switch(r=t.width(),i=t.height(),o=n.pointerDirection(),a=n.pointerWidth(),u=n.pointerHeight(),s=0,l=0,o){case uE:s=r/2,l=-1*u;break;case cE:s=r+a,l=i/2;break;case dE:s=r/2,l=i+u;break;case fE:s=-1*a,l=i/2;break}n.setAttrs({x:-1*s,y:-1*l,width:r,height:i}),t.setAttrs({x:-1*s,y:-1*l})}}}up.Label=j4;j4.prototype.className="Label";(0,UG._registerNode)(j4);class ef extends MCe.Shape{_sceneFunc(t){var n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),a=this.pointerHeight(),s=this.cornerRadius();let l=0,u=0,c=0,d=0;typeof s=="number"?l=u=c=d=Math.min(s,n/2,r/2):(l=Math.min(s[0]||0,n/2,r/2),u=Math.min(s[1]||0,n/2,r/2),d=Math.min(s[2]||0,n/2,r/2),c=Math.min(s[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(l,0),i===uE&&(t.lineTo((n-o)/2,0),t.lineTo(n/2,-1*a),t.lineTo((n+o)/2,0)),t.lineTo(n-u,0),t.arc(n-u,u,u,Math.PI*3/2,0,!1),i===cE&&(t.lineTo(n,(r-a)/2),t.lineTo(n+o,r/2),t.lineTo(n,(r+a)/2)),t.lineTo(n,r-d),t.arc(n-d,r-d,d,0,Math.PI/2,!1),i===dE&&(t.lineTo((n+o)/2,r),t.lineTo(n/2,r+a),t.lineTo((n-o)/2,r)),t.lineTo(c,r),t.arc(c,r-c,c,Math.PI/2,Math.PI,!1),i===fE&&(t.lineTo(0,(r+a)/2),t.lineTo(-1*o,r/2),t.lineTo(0,(r-a)/2)),t.lineTo(0,l),t.arc(l,l,l,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),a=this.width(),s=this.height();return o===uE?(n-=i,s+=i):o===dE?s+=i:o===fE?(t-=r*1.5,a+=r):o===cE&&(a+=r*1.5),{x:t,y:n,width:a,height:s}}}up.Tag=ef;ef.prototype.className="Tag";(0,UG._registerNode)(ef);Px.Factory.addGetterSetter(ef,"pointerDirection",DCe);Px.Factory.addGetterSetter(ef,"pointerWidth",0,(0,z4.getNumberValidator)());Px.Factory.addGetterSetter(ef,"pointerHeight",0,(0,z4.getNumberValidator)());Px.Factory.addGetterSetter(ef,"cornerRadius",0,(0,z4.getNumberOrArrayOfNumbersValidator)(4));var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});Ly.Rect=void 0;const FCe=kt,BCe=Yr,zCe=Rt,jCe=fr,UCe=Xe;let Ix=class extends BCe.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?jCe.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};Ly.Rect=Ix;Ix.prototype.className="Rect";(0,zCe._registerNode)(Ix);FCe.Factory.addGetterSetter(Ix,"cornerRadius",0,(0,UCe.getNumberOrArrayOfNumbersValidator)(4));var Rx={};Object.defineProperty(Rx,"__esModule",{value:!0});Rx.RegularPolygon=void 0;const GG=kt,VCe=Yr,qG=Xe,GCe=Rt;class tf extends VCe.Shape{_sceneFunc(t){const n=this._getPoints();t.beginPath(),t.moveTo(n[0].x,n[0].y);for(var r=1;r<n.length;r++)t.lineTo(n[r].x,n[r].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,n=this.attrs.radius||0,r=[];for(var i=0;i<t;i++)r.push({x:n*Math.sin(i*2*Math.PI/t),y:-1*n*Math.cos(i*2*Math.PI/t)});return r}getSelfRect(){const t=this._getPoints();var n=t[0].x,r=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Rx.RegularPolygon=tf;tf.prototype.className="RegularPolygon";tf.prototype._centroid=!0;tf.prototype._attrsAffectingSize=["radius"];(0,GCe._registerNode)(tf);GG.Factory.addGetterSetter(tf,"radius",0,(0,qG.getNumberValidator)());GG.Factory.addGetterSetter(tf,"sides",0,(0,qG.getNumberValidator)());var Ox={};Object.defineProperty(Ox,"__esModule",{value:!0});Ox.Ring=void 0;const HG=kt,qCe=Yr,WG=Xe,HCe=Rt;var PO=Math.PI*2;class nf extends qCe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,PO,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),PO,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Ox.Ring=nf;nf.prototype.className="Ring";nf.prototype._centroid=!0;nf.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,HCe._registerNode)(nf);HG.Factory.addGetterSetter(nf,"innerRadius",0,(0,WG.getNumberValidator)());HG.Factory.addGetterSetter(nf,"outerRadius",0,(0,WG.getNumberValidator)());var Mx={};Object.defineProperty(Mx,"__esModule",{value:!0});Mx.Sprite=void 0;const rf=kt,WCe=Yr,KCe=Ip,KG=Xe,QCe=Rt;class cl extends WCe.Shape{constructor(t){super(t),this._updated=!0,this.anim=new KCe.Animation(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],c=o[i+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,c),t.closePath(),t.fillStrokeShape(this)),d)if(a){var f=a[n],h=r*2;t.drawImage(d,s,l,u,c,f[h+0],f[h+1],u,c)}else t.drawImage(d,s,l,u,c,0,0,u,c)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],c=r*2;t.rect(u[c+0],u[c+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t<o-1?this.frameIndex(t+1):this.frameIndex(0)}}Mx.Sprite=cl;cl.prototype.className="Sprite";(0,QCe._registerNode)(cl);rf.Factory.addGetterSetter(cl,"animation");rf.Factory.addGetterSetter(cl,"animations");rf.Factory.addGetterSetter(cl,"frameOffsets");rf.Factory.addGetterSetter(cl,"image");rf.Factory.addGetterSetter(cl,"frameIndex",0,(0,KG.getNumberValidator)());rf.Factory.addGetterSetter(cl,"frameRate",17,(0,KG.getNumberValidator)());rf.Factory.backCompat(cl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var $x={};Object.defineProperty($x,"__esModule",{value:!0});$x.Star=void 0;const U4=kt,XCe=Yr,V4=Xe,YCe=Rt;class Oc extends XCe.Shape{_sceneFunc(t){var n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-r);for(var o=1;o<i*2;o++){var a=o%2===0?r:n,s=a*Math.sin(o*Math.PI/i),l=-1*a*Math.cos(o*Math.PI/i);t.lineTo(s,l)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}$x.Star=Oc;Oc.prototype.className="Star";Oc.prototype._centroid=!0;Oc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,YCe._registerNode)(Oc);U4.Factory.addGetterSetter(Oc,"numPoints",5,(0,V4.getNumberValidator)());U4.Factory.addGetterSetter(Oc,"innerRadius",0,(0,V4.getNumberValidator)());U4.Factory.addGetterSetter(Oc,"outerRadius",0,(0,V4.getNumberValidator)());var Gd={};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.Text=Gd.stringToArray=void 0;const hE=fr,po=kt,ZCe=Yr,Mc=Xe,JCe=Rt;function QG(e){return Array.from(e)}Gd.stringToArray=QG;var Cf="auto",e5e="center",lg="justify",t5e="Change.konva",n5e="2d",IO="-",XG="left",r5e="text",i5e="Text",o5e="top",a5e="bottom",RO="middle",YG="normal",s5e="px ",Yv=" ",l5e="right",u5e="word",c5e="char",OO="none",d5="…",ZG=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],d5e=ZG.length;function f5e(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Zv;function f5(){return Zv||(Zv=hE.Util.createCanvasElement().getContext(n5e),Zv)}function h5e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function p5e(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function g5e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let Pr=class extends ZCe.Shape{constructor(t){super(g5e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<d5e;n++)this.on(ZG[n]+t5e,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,s=this.verticalAlign(),l=0,u=this.align(),c=this.getWidth(),d=this.letterSpacing(),f=this.fill(),h=this.textDecoration(),p=h.indexOf("underline")!==-1,m=h.indexOf("line-through")!==-1,_,b=0,b=a/2,y=0,g=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",RO),t.setAttr("textAlign",XG),s===RO?l=(this.getHeight()-r*a-i*2)/2:s===a5e&&(l=this.getHeight()-r*a-i*2),t.translate(i,l+i),_=0;_<r;_++){var y=0,g=0,v=n[_],S=v.text,w=v.width,x=v.lastInParagraph,C,T,E;if(t.save(),u===l5e?y+=c-w-i*2:u===e5e&&(y+=(c-w-i*2)/2),p){t.save(),t.beginPath(),t.moveTo(y,b+g+Math.round(o/2)),C=S.split(" ").length-1,T=C===0,E=u===lg&&!x?c-i*2:w,t.lineTo(y+Math.round(E),b+g+Math.round(o/2)),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(m){t.save(),t.beginPath(),t.moveTo(y,b+g),C=S.split(" ").length-1,T=C===0,E=u===lg&&x&&!T?c-i*2:w,t.lineTo(y+Math.round(E),b+g),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(d!==0||u===lg){C=S.split(" ").length-1;for(var P=QG(S),N=0;N<P.length;N++){var O=P[N];O===" "&&!x&&u===lg&&(y+=(c-i*2-w)/C),this._partialTextX=y,this._partialTextY=b+g,this._partialText=O,t.fillStrokeShape(this),y+=this.measureSize(O).width+d}}else this._partialTextX=y,this._partialTextY=b+g,this._partialText=S,t.fillStrokeShape(this);t.restore(),r>1&&(b+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=hE.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(r5e,n),this}getWidth(){var t=this.attrs.width===Cf||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Cf||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return hE.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=f5(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Yv+this.fontVariant()+Yv+(this.fontSize()+s5e)+f5e(this.fontFamily())}_addTextLine(t){this.align()===lg&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return f5().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(`
+`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Cf&&o!==void 0,l=a!==Cf&&a!==void 0,u=this.padding(),c=o-u*2,d=a-u*2,f=0,h=this.wrap(),p=h!==OO,m=h!==c5e&&p,_=this.ellipsis();this.textArr=[],f5().font=this._getContextFont();for(var b=_?this._getTextWidth(d5):0,y=0,g=t.length;y<g;++y){var v=t[y],S=this._getTextWidth(v);if(s&&S>c)for(;v.length>0;){for(var w=0,x=v.length,C="",T=0;w<x;){var E=w+x>>>1,P=v.slice(0,E+1),N=this._getTextWidth(P)+b;N<=c?(w=E+1,C=P,T=N):x=E}if(C){if(m){var O,A=v[C.length],k=A===Yv||A===IO;k&&T<=c?O=C.length:O=Math.max(C.lastIndexOf(Yv),C.lastIndexOf(IO))+1,O>0&&(w=O,C=C.slice(0,w),T=this._getTextWidth(C))}C=C.trimRight(),this._addTextLine(C),r=Math.max(r,T),f+=i;var D=this._shouldHandleEllipsis(f);if(D){this._tryToAddEllipsisToLastLine();break}if(v=v.slice(w),v=v.trimLeft(),v.length>0&&(S=this._getTextWidth(v),S<=c)){this._addTextLine(v),f+=i,r=Math.max(r,S);break}}else break}else this._addTextLine(v),f+=i,r=Math.max(r,S),this._shouldHandleEllipsis(f)&&y<g-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&f+i>d)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Cf&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==OO;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Cf&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+d5)<i;s||(a.text=a.text.slice(0,a.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+d5)}}getStrokeScaleEnabled(){return!0}};Gd.Text=Pr;Pr.prototype._fillFunc=h5e;Pr.prototype._strokeFunc=p5e;Pr.prototype.className=i5e;Pr.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,JCe._registerNode)(Pr);po.Factory.overWriteSetter(Pr,"width",(0,Mc.getNumberOrAutoValidator)());po.Factory.overWriteSetter(Pr,"height",(0,Mc.getNumberOrAutoValidator)());po.Factory.addGetterSetter(Pr,"fontFamily","Arial");po.Factory.addGetterSetter(Pr,"fontSize",12,(0,Mc.getNumberValidator)());po.Factory.addGetterSetter(Pr,"fontStyle",YG);po.Factory.addGetterSetter(Pr,"fontVariant",YG);po.Factory.addGetterSetter(Pr,"padding",0,(0,Mc.getNumberValidator)());po.Factory.addGetterSetter(Pr,"align",XG);po.Factory.addGetterSetter(Pr,"verticalAlign",o5e);po.Factory.addGetterSetter(Pr,"lineHeight",1,(0,Mc.getNumberValidator)());po.Factory.addGetterSetter(Pr,"wrap",u5e);po.Factory.addGetterSetter(Pr,"ellipsis",!1,(0,Mc.getBooleanValidator)());po.Factory.addGetterSetter(Pr,"letterSpacing",0,(0,Mc.getNumberValidator)());po.Factory.addGetterSetter(Pr,"text","",(0,Mc.getStringValidator)());po.Factory.addGetterSetter(Pr,"textDecoration","");var Nx={};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.TextPath=void 0;const h5=fr,vs=kt,m5e=Yr,ug=Rp,p5=Gd,JG=Xe,y5e=Rt;var v5e="",eq="normal";function tq(e){e.fillText(this.partialText,0,0)}function nq(e){e.strokeText(this.partialText,0,0)}class Zr extends m5e.Shape{constructor(t){super(t),this.dummyCanvas=h5.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return ug.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:ug.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=ug.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&t.beginPath();for(var a=0;a<o.length;a++){t.save();var s=o[a].p0;t.translate(s.x,s.y),t.rotate(o[a].rotation),this.partialText=o[a].text,t.fillStrokeShape(this),n==="underline"&&(a===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}n==="underline"&&(t.strokeStyle=r,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var n=this.glyphInfo;if(n.length>=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i<n.length;i++){var o=n[i].p1;t.lineTo(o.x,o.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return h5.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return p5.Text.prototype.setText.call(this,t)}_getContextFont(){return p5.Text.prototype._getContextFont.call(this)}_getTextSize(t){var n=this.dummyCanvas,r=n.getContext("2d");r.save(),r.font=this._getContextFont();var i=r.measureText(t);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let s=0;i==="center"&&(s=Math.max(0,this.pathLength/2-a/2)),i==="right"&&(s=Math.max(0,this.pathLength-a));const l=(0,p5.stringToArray)(this.text());let u=s;for(var c=0;c<l.length;c++){const d=this._getPointAtLength(u);if(!d)return;let f=this._getTextSize(l[c]).width+r;if(l[c]===" "&&i==="justify"){const y=this.text().split(" ").length-1;f+=(this.pathLength-a)/y}const h=this._getPointAtLength(u+f);if(!h)return;const p=ug.Path.getLineLength(d.x,d.y,h.x,h.y);let m=0;if(o)try{m=o(l[c-1],l[c])*this.fontSize()}catch{m=0}d.x+=m,h.x+=m,this.textWidth+=m;const _=ug.Path.getPointOnLine(m+p/2,d.x,d.y,h.x,h.y),b=Math.atan2(h.y-d.y,h.x-d.x);this.glyphInfo.push({transposeX:_.x,transposeY:_.y,text:l[c],rotation:b,p0:d,p1:h}),u+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});for(var n=t[0]||0,r=t[0]||0,i=t[1]||0,o=t[1]||0,a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);var u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:o-i+u}}destroy(){return h5.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}Nx.TextPath=Zr;Zr.prototype._fillFunc=tq;Zr.prototype._strokeFunc=nq;Zr.prototype._fillFuncHit=tq;Zr.prototype._strokeFuncHit=nq;Zr.prototype.className="TextPath";Zr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,y5e._registerNode)(Zr);vs.Factory.addGetterSetter(Zr,"data");vs.Factory.addGetterSetter(Zr,"fontFamily","Arial");vs.Factory.addGetterSetter(Zr,"fontSize",12,(0,JG.getNumberValidator)());vs.Factory.addGetterSetter(Zr,"fontStyle",eq);vs.Factory.addGetterSetter(Zr,"align","left");vs.Factory.addGetterSetter(Zr,"letterSpacing",0,(0,JG.getNumberValidator)());vs.Factory.addGetterSetter(Zr,"textBaseline","middle");vs.Factory.addGetterSetter(Zr,"fontVariant",eq);vs.Factory.addGetterSetter(Zr,"text",v5e);vs.Factory.addGetterSetter(Zr,"textDecoration",null);vs.Factory.addGetterSetter(Zr,"kerningFunc",null);var Dx={};Object.defineProperty(Dx,"__esModule",{value:!0});Dx.Transformer=void 0;const Cn=fr,bn=kt,MO=rr,b5e=Yr,_5e=Ly,$O=Pp,Wa=Rt,$c=Xe,S5e=Rt;var rq="tr-konva",x5e=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${rq}`).join(" "),NO="nodesRect",w5e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],C5e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const A5e="ontouchstart"in Wa.Konva._global;function E5e(e,t){if(e==="rotater")return"crosshair";t+=Cn.Util.degToRad(C5e[e]||0);var n=(Cn.Util.radToDeg(t)%360+360)%360;return Cn.Util._inRange(n,315+22.5,360)||Cn.Util._inRange(n,0,22.5)?"ns-resize":Cn.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":Cn.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":Cn.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":Cn.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":Cn.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":Cn.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":Cn.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Cn.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var K_=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],DO=1e8;function T5e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function iq(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function k5e(e,t){const n=T5e(e);return iq(e,t,n)}function P5e(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=Wa.Konva.getAngle(e[i]),a=Math.abs(o-t)%(Math.PI*2);Math.min(a,Math.PI*2-a)<n&&(r=o)}return r}class Jt extends $O.Group{constructor(t){super(t),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(x5e,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Cn.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return rq+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(Cn.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=n,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(a,o),i.on(w5e.map(s=>s+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache();var r=!!this.findOne(".top-left");return r&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(NO),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(NO,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(Wa.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return iq(c,-Wa.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-DO,y:-DO,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const c=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],f=u.getAbsoluteTransform();d.forEach(function(h){var p=f.point(h);n.push(p)})});const r=new Cn.Transform;r.rotate(-Wa.Konva.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var c=r.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:Wa.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),K_.forEach((function(t){this._createAnchor(t)}).bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new _5e.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:A5e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=Wa.Konva.getAngle(this.rotation()),o=E5e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new b5e.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*Cn.Util._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const c=o.getAbsolutePosition();if(!(u.x===c.x&&u.y===c.y)){if(this._movingAnchorName==="rotater"){var d=this._getNodeRect();n=o.x()-d.width/2,r=-o.y()+d.height/2;let O=Math.atan2(-r,n)+Math.PI/2;d.height<0&&(O-=Math.PI);var f=Wa.Konva.getAngle(this.rotation());const A=f+O,k=Wa.Konva.getAngle(this.rotationSnapTolerance()),L=P5e(this.rotationSnaps(),A,k)-d.rotation,M=k5e(d,L);this._fitNodesInto(M,t);return}var h=this.shiftBehavior(),p;h==="inverted"?p=this.keepRatio()&&!t.shiftKey:h==="none"?p=this.keepRatio():p=this.keepRatio()||t.shiftKey;var g=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(m.x-o.x(),2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-left").x()>m.x?-1:1,b=this.findOne(".top-left").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-left").x(m.x-n),this.findOne(".top-left").y(m.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-m.x,2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-right").x()<m.x?-1:1,b=this.findOne(".top-right").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-right").x(m.x+n),this.findOne(".top-right").y(m.y-r)}var y=o.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(m.x-o.x(),2)+Math.pow(o.y()-m.y,2));var _=m.x<o.x()?-1:1,b=o.y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,o.x(m.x-n),o.y(m.y+r)}y=o.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-m.x,2)+Math.pow(o.y()-m.y,2));var _=this.findOne(".bottom-right").x()<m.x?-1:1,b=this.findOne(".bottom-right").y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".bottom-right").x(m.x+n),this.findOne(".bottom-right").y(m.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var g=this.centeredScaling()||t.altKey;if(g){var v=this.findOne(".top-left"),S=this.findOne(".bottom-right"),w=v.x(),x=v.y(),C=this.getWidth()-S.x(),T=this.getHeight()-S.y();S.move({x:-w,y:-x}),v.move({x:C,y:T})}var E=this.findOne(".top-left").getAbsolutePosition();n=E.x,r=E.y;var P=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),N=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:P,height:N,rotation:Wa.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();this._fire("transformend",{evt:t,target:n}),n&&this._nodes.forEach(r=>{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(Cn.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(Cn.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Cn.Transform;if(a.rotate(Wa.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=a.point({x:-this.padding()*2,y:0});if(t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=a.point({x:0,y:-this.padding()*2});if(t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(r,t);d?t=d:Cn.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Cn.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Cn.Transform;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const c=u.multiply(l.invert());this._nodes.forEach(d=>{var f;const h=d.getParent().getAbsoluteTransform(),p=d.getTransform().copy();p.translate(d.offsetX(),d.offsetY());const m=new Cn.Transform;m.multiply(h.copy().invert()).multiply(c).multiply(h).multiply(p);const _=m.decompose();d.setAttrs(_),this._fire("transform",{evt:n,target:d}),d._fire("transform",{evt:n,target:d}),(f=d.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(Cn.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(Cn.Util._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();const u=this.find("._anchor");u.forEach(d=>{d.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*Cn.Util._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const c=this.anchorStyleFunc();c&&u.forEach(d=>{c(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),$O.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return MO.Node.prototype.toObject.call(this)}clone(t){var n=MO.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Dx.Transformer=Jt;function I5e(e){return e instanceof Array||Cn.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){K_.indexOf(t)===-1&&Cn.Util.warn("Unknown anchor name: "+t+". Available names are: "+K_.join(", "))}),e||[]}Jt.prototype.className="Transformer";(0,S5e._registerNode)(Jt);bn.Factory.addGetterSetter(Jt,"enabledAnchors",K_,I5e);bn.Factory.addGetterSetter(Jt,"flipEnabled",!0,(0,$c.getBooleanValidator)());bn.Factory.addGetterSetter(Jt,"resizeEnabled",!0);bn.Factory.addGetterSetter(Jt,"anchorSize",10,(0,$c.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"rotateEnabled",!0);bn.Factory.addGetterSetter(Jt,"rotationSnaps",[]);bn.Factory.addGetterSetter(Jt,"rotateAnchorOffset",50,(0,$c.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"rotationSnapTolerance",5,(0,$c.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderEnabled",!0);bn.Factory.addGetterSetter(Jt,"anchorStroke","rgb(0, 161, 255)");bn.Factory.addGetterSetter(Jt,"anchorStrokeWidth",1,(0,$c.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"anchorFill","white");bn.Factory.addGetterSetter(Jt,"anchorCornerRadius",0,(0,$c.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderStroke","rgb(0, 161, 255)");bn.Factory.addGetterSetter(Jt,"borderStrokeWidth",1,(0,$c.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderDash");bn.Factory.addGetterSetter(Jt,"keepRatio",!0);bn.Factory.addGetterSetter(Jt,"shiftBehavior","default");bn.Factory.addGetterSetter(Jt,"centeredScaling",!1);bn.Factory.addGetterSetter(Jt,"ignoreStroke",!1);bn.Factory.addGetterSetter(Jt,"padding",0,(0,$c.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"node");bn.Factory.addGetterSetter(Jt,"nodes");bn.Factory.addGetterSetter(Jt,"boundBoxFunc");bn.Factory.addGetterSetter(Jt,"anchorDragBoundFunc");bn.Factory.addGetterSetter(Jt,"anchorStyleFunc");bn.Factory.addGetterSetter(Jt,"shouldOverdrawWholeArea",!1);bn.Factory.addGetterSetter(Jt,"useSingleNodeRotation",!0);bn.Factory.backCompat(Jt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Lx={};Object.defineProperty(Lx,"__esModule",{value:!0});Lx.Wedge=void 0;const Fx=kt,R5e=Yr,O5e=Rt,oq=Xe,M5e=Rt;class uu extends R5e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,O5e.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Lx.Wedge=uu;uu.prototype.className="Wedge";uu.prototype._centroid=!0;uu.prototype._attrsAffectingSize=["radius"];(0,M5e._registerNode)(uu);Fx.Factory.addGetterSetter(uu,"radius",0,(0,oq.getNumberValidator)());Fx.Factory.addGetterSetter(uu,"angle",0,(0,oq.getNumberValidator)());Fx.Factory.addGetterSetter(uu,"clockwise",!1);Fx.Factory.backCompat(uu,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Bx={};Object.defineProperty(Bx,"__esModule",{value:!0});Bx.Blur=void 0;const LO=kt,$5e=rr,N5e=Xe;function FO(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var D5e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],L5e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function F5e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,c,d,f,h,p,m,_,b,y,g,v,S,w,x,C,T,E,P,N,O=t+t+1,A=r-1,k=i-1,D=t+1,L=D*(D+1)/2,M=new FO,R=null,$=M,B=null,U=null,G=D5e[t],Y=L5e[t];for(s=1;s<O;s++)$=$.next=new FO,s===D&&(R=$);for($.next=M,d=c=0,a=0;a<i;a++){for(v=S=w=x=f=h=p=m=0,_=D*(C=n[c]),b=D*(T=n[c+1]),y=D*(E=n[c+2]),g=D*(P=n[c+3]),f+=L*C,h+=L*T,p+=L*E,m+=L*P,$=M,s=0;s<D;s++)$.r=C,$.g=T,$.b=E,$.a=P,$=$.next;for(s=1;s<D;s++)l=c+((A<s?A:s)<<2),f+=($.r=C=n[l])*(N=D-s),h+=($.g=T=n[l+1])*N,p+=($.b=E=n[l+2])*N,m+=($.a=P=n[l+3])*N,v+=C,S+=T,w+=E,x+=P,$=$.next;for(B=M,U=R,o=0;o<r;o++)n[c+3]=P=m*G>>Y,P!==0?(P=255/P,n[c]=(f*G>>Y)*P,n[c+1]=(h*G>>Y)*P,n[c+2]=(p*G>>Y)*P):n[c]=n[c+1]=n[c+2]=0,f-=_,h-=b,p-=y,m-=g,_-=B.r,b-=B.g,y-=B.b,g-=B.a,l=d+((l=o+t+1)<A?l:A)<<2,v+=B.r=n[l],S+=B.g=n[l+1],w+=B.b=n[l+2],x+=B.a=n[l+3],f+=v,h+=S,p+=w,m+=x,B=B.next,_+=C=U.r,b+=T=U.g,y+=E=U.b,g+=P=U.a,v-=C,S-=T,w-=E,x-=P,U=U.next,c+=4;d+=r}for(o=0;o<r;o++){for(S=w=x=v=h=p=m=f=0,c=o<<2,_=D*(C=n[c]),b=D*(T=n[c+1]),y=D*(E=n[c+2]),g=D*(P=n[c+3]),f+=L*C,h+=L*T,p+=L*E,m+=L*P,$=M,s=0;s<D;s++)$.r=C,$.g=T,$.b=E,$.a=P,$=$.next;for(u=r,s=1;s<=t;s++)c=u+o<<2,f+=($.r=C=n[c])*(N=D-s),h+=($.g=T=n[c+1])*N,p+=($.b=E=n[c+2])*N,m+=($.a=P=n[c+3])*N,v+=C,S+=T,w+=E,x+=P,$=$.next,s<k&&(u+=r);for(c=o,B=M,U=R,a=0;a<i;a++)l=c<<2,n[l+3]=P=m*G>>Y,P>0?(P=255/P,n[l]=(f*G>>Y)*P,n[l+1]=(h*G>>Y)*P,n[l+2]=(p*G>>Y)*P):n[l]=n[l+1]=n[l+2]=0,f-=_,h-=b,p-=y,m-=g,_-=B.r,b-=B.g,y-=B.b,g-=B.a,l=o+((l=a+D)<k?l:k)*r<<2,f+=v+=B.r=n[l],h+=S+=B.g=n[l+1],p+=w+=B.b=n[l+2],m+=x+=B.a=n[l+3],B=B.next,_+=C=U.r,b+=T=U.g,y+=E=U.b,g+=P=U.a,v-=C,S-=T,w-=E,x-=P,U=U.next,c+=r}}const B5e=function(t){var n=Math.round(this.blurRadius());n>0&&F5e(t,n)};Bx.Blur=B5e;LO.Factory.addGetterSetter($5e.Node,"blurRadius",0,(0,N5e.getNumberValidator)(),LO.Factory.afterSetFilter);var zx={};Object.defineProperty(zx,"__esModule",{value:!0});zx.Brighten=void 0;const BO=kt,z5e=rr,j5e=Xe,U5e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=4)n[i]+=t,n[i+1]+=t,n[i+2]+=t};zx.Brighten=U5e;BO.Factory.addGetterSetter(z5e.Node,"brightness",0,(0,j5e.getNumberValidator)(),BO.Factory.afterSetFilter);var jx={};Object.defineProperty(jx,"__esModule",{value:!0});jx.Contrast=void 0;const zO=kt,V5e=rr,G5e=Xe,q5e=function(e){var t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,o=150,a=150,s;for(s=0;s<r;s+=4)i=n[s],o=n[s+1],a=n[s+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};jx.Contrast=q5e;zO.Factory.addGetterSetter(V5e.Node,"contrast",0,(0,G5e.getNumberValidator)(),zO.Factory.afterSetFilter);var Ux={};Object.defineProperty(Ux,"__esModule",{value:!0});Ux.Emboss=void 0;const gc=kt,Vx=rr,H5e=fr,aq=Xe,W5e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,c=l*4,d=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:H5e.Util.error("Unknown emboss direction: "+r)}do{var f=(d-1)*c,h=o;d+h<1&&(h=0),d+h>u&&(h=0);var p=(d-1+h)*l*4,m=l;do{var _=f+(m-1)*4,b=a;m+b<1&&(b=0),m+b>l&&(b=0);var y=p+(m-1+b)*4,g=s[_]-s[y],v=s[_+1]-s[y+1],S=s[_+2]-s[y+2],w=g,x=w>0?w:-w,C=v>0?v:-v,T=S>0?S:-S;if(C>x&&(w=v),T>x&&(w=S),w*=t,i){var E=s[_]+w,P=s[_+1]+w,N=s[_+2]+w;s[_]=E>255?255:E<0?0:E,s[_+1]=P>255?255:P<0?0:P,s[_+2]=N>255?255:N<0?0:N}else{var O=n-w;O<0?O=0:O>255&&(O=255),s[_]=s[_+1]=s[_+2]=O}}while(--m)}while(--d)};Ux.Emboss=W5e;gc.Factory.addGetterSetter(Vx.Node,"embossStrength",.5,(0,aq.getNumberValidator)(),gc.Factory.afterSetFilter);gc.Factory.addGetterSetter(Vx.Node,"embossWhiteLevel",.5,(0,aq.getNumberValidator)(),gc.Factory.afterSetFilter);gc.Factory.addGetterSetter(Vx.Node,"embossDirection","top-left",null,gc.Factory.afterSetFilter);gc.Factory.addGetterSetter(Vx.Node,"embossBlend",!1,null,gc.Factory.afterSetFilter);var Gx={};Object.defineProperty(Gx,"__esModule",{value:!0});Gx.Enhance=void 0;const jO=kt,K5e=rr,Q5e=Xe;function g5(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const X5e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],c=u,d,f,h=this.enhance();if(h!==0){for(f=0;f<n;f+=4)o=t[f+0],o<r?r=o:o>i&&(i=o),l=t[f+1],l<a?a=l:l>s&&(s=l),d=t[f+2],d<u?u=d:d>c&&(c=d);i===r&&(i=255,r=0),s===a&&(s=255,a=0),c===u&&(c=255,u=0);var p,m,_,b,y,g,v,S,w;for(h>0?(m=i+h*(255-i),_=r-h*(r-0),y=s+h*(255-s),g=a-h*(a-0),S=c+h*(255-c),w=u-h*(u-0)):(p=(i+r)*.5,m=i+h*(i-p),_=r+h*(r-p),b=(s+a)*.5,y=s+h*(s-b),g=a+h*(a-b),v=(c+u)*.5,S=c+h*(c-v),w=u+h*(u-v)),f=0;f<n;f+=4)t[f+0]=g5(t[f+0],r,i,_,m),t[f+1]=g5(t[f+1],a,s,g,y),t[f+2]=g5(t[f+2],u,c,w,S)}};Gx.Enhance=X5e;jO.Factory.addGetterSetter(K5e.Node,"enhance",0,(0,Q5e.getNumberValidator)(),jO.Factory.afterSetFilter);var qx={};Object.defineProperty(qx,"__esModule",{value:!0});qx.Grayscale=void 0;const Y5e=function(e){var t=e.data,n=t.length,r,i;for(r=0;r<n;r+=4)i=.34*t[r]+.5*t[r+1]+.16*t[r+2],t[r]=i,t[r+1]=i,t[r+2]=i};qx.Grayscale=Y5e;var Hx={};Object.defineProperty(Hx,"__esModule",{value:!0});Hx.HSL=void 0;const cp=kt,G4=rr,q4=Xe;cp.Factory.addGetterSetter(G4.Node,"hue",0,(0,q4.getNumberValidator)(),cp.Factory.afterSetFilter);cp.Factory.addGetterSetter(G4.Node,"saturation",0,(0,q4.getNumberValidator)(),cp.Factory.afterSetFilter);cp.Factory.addGetterSetter(G4.Node,"luminance",0,(0,q4.getNumberValidator)(),cp.Factory.afterSetFilter);const Z5e=function(e){var t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=this.luminance()*127,s,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),c=.299*r+.701*l+.167*u,d=.587*r-.587*l+.33*u,f=.114*r-.114*l-.497*u,h=.299*r-.299*l-.328*u,p=.587*r+.413*l+.035*u,m=.114*r-.114*l+.293*u,_=.299*r-.3*l+1.25*u,b=.587*r-.586*l-1.05*u,y=.114*r+.886*l-.2*u,g,v,S,w;for(s=0;s<n;s+=4)g=t[s+0],v=t[s+1],S=t[s+2],w=t[s+3],t[s+0]=c*g+d*v+f*S+a,t[s+1]=h*g+p*v+m*S+a,t[s+2]=_*g+b*v+y*S+a,t[s+3]=w};Hx.HSL=Z5e;var Wx={};Object.defineProperty(Wx,"__esModule",{value:!0});Wx.HSV=void 0;const dp=kt,H4=rr,W4=Xe,J5e=function(e){var t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a,s=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*s+.167*l,c=.587*r-.587*s+.33*l,d=.114*r-.114*s-.497*l,f=.299*r-.299*s-.328*l,h=.587*r+.413*s+.035*l,p=.114*r-.114*s+.293*l,m=.299*r-.3*s+1.25*l,_=.587*r-.586*s-1.05*l,b=.114*r+.886*s-.2*l,y,g,v,S;for(a=0;a<n;a+=4)y=t[a+0],g=t[a+1],v=t[a+2],S=t[a+3],t[a+0]=u*y+c*g+d*v,t[a+1]=f*y+h*g+p*v,t[a+2]=m*y+_*g+b*v,t[a+3]=S};Wx.HSV=J5e;dp.Factory.addGetterSetter(H4.Node,"hue",0,(0,W4.getNumberValidator)(),dp.Factory.afterSetFilter);dp.Factory.addGetterSetter(H4.Node,"saturation",0,(0,W4.getNumberValidator)(),dp.Factory.afterSetFilter);dp.Factory.addGetterSetter(H4.Node,"value",0,(0,W4.getNumberValidator)(),dp.Factory.afterSetFilter);var Kx={};Object.defineProperty(Kx,"__esModule",{value:!0});Kx.Invert=void 0;const e3e=function(e){var t=e.data,n=t.length,r;for(r=0;r<n;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]};Kx.Invert=e3e;var Qx={};Object.defineProperty(Qx,"__esModule",{value:!0});Qx.Kaleidoscope=void 0;const Q_=kt,sq=rr,UO=fr,lq=Xe;var t3e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f=0,h=0,p=0,m=0,_,b=Math.sqrt(s*s+l*l);c=o-s,d=a-l,_=Math.sqrt(c*c+d*d),b=_>b?_:b;var y=a,g=o,v,S,w=360/g*Math.PI/180,x,C;for(S=0;S<g;S+=1)for(x=Math.sin(S*w),C=Math.cos(S*w),v=0;v<y;v+=1)c=Math.floor(s+b*v/y*C),d=Math.floor(l+b*v/y*x),u=(d*o+c)*4,f=r[u+0],h=r[u+1],p=r[u+2],m=r[u+3],u=(S+v*o)*4,i[u+0]=f,i[u+1]=h,i[u+2]=p,i[u+3]=m},n3e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f,h,p=0,m=0,_=0,b=0,y,g=Math.sqrt(s*s+l*l);c=o-s,d=a-l,y=Math.sqrt(c*c+d*d),g=y>g?y:g;var v=a,S=o,w,x,C=n.polarRotation||0,T,E;for(c=0;c<o;c+=1)for(d=0;d<a;d+=1)f=c-s,h=d-l,w=Math.sqrt(f*f+h*h)*v/g,x=(Math.atan2(h,f)*180/Math.PI+360+C)%360,x=x*S/360,T=Math.floor(x),E=Math.floor(w),u=(E*o+T)*4,p=r[u+0],m=r[u+1],_=r[u+2],b=r[u+3],u=(d*o+c)*4,i[u+0]=p,i[u+1]=m,i[u+2]=_,i[u+3]=b};const r3e=function(e){var t=e.width,n=e.height,r,i,o,a,s,l,u,c,d,f,h=Math.round(this.kaleidoscopePower()),p=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(p%360)/360);if(!(h<1)){var _=UO.Util.createCanvasElement();_.width=t,_.height=n;var b=_.getContext("2d").getImageData(0,0,t,n);UO.Util.releaseCanvas(_),t3e(e,b,{polarCenterX:t/2,polarCenterY:n/2});for(var y=t/Math.pow(2,h);y<=8;)y=y*2,h-=1;y=Math.ceil(y);var g=y,v=0,S=g,w=1;for(m+y>t&&(v=g,S=0,w=-1),i=0;i<n;i+=1)for(r=v;r!==S;r+=w)o=Math.round(r+m)%t,d=(t*i+o)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+r)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;for(i=0;i<n;i+=1)for(g=Math.floor(y),a=0;a<h;a+=1){for(r=0;r<g+1;r+=1)d=(t*i+r)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+g*2-r-1)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;g*=2}n3e(b,e,{polarRotation:0})}};Qx.Kaleidoscope=r3e;Q_.Factory.addGetterSetter(sq.Node,"kaleidoscopePower",2,(0,lq.getNumberValidator)(),Q_.Factory.afterSetFilter);Q_.Factory.addGetterSetter(sq.Node,"kaleidoscopeAngle",0,(0,lq.getNumberValidator)(),Q_.Factory.afterSetFilter);var Xx={};Object.defineProperty(Xx,"__esModule",{value:!0});Xx.Mask=void 0;const VO=kt,i3e=rr,o3e=Xe;function Jv(e,t,n){var r=(n*e.width+t)*4,i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function cg(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function a3e(e){for(var t=[0,0,0],n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function s3e(e,t){var n=Jv(e,0,0),r=Jv(e,e.width-1,0),i=Jv(e,0,e.height-1),o=Jv(e,e.width-1,e.height-1),a=t||10;if(cg(n,r)<a&&cg(r,o)<a&&cg(o,i)<a&&cg(i,n)<a){for(var s=a3e([r,n,o,i]),l=[],u=0;u<e.width*e.height;u++){var c=cg(s,[e.data[u*4],e.data[u*4+1],e.data[u*4+2]]);l[u]=c<a?0:255}return l}}function l3e(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function u3e(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c===255*8?255:0}return a}function c3e(e,t,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c>=255*4?255:0}return a}function d3e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c}return a}const f3e=function(e){var t=this.threshold(),n=s3e(e,t);return n&&(n=u3e(n,e.width,e.height),n=c3e(n,e.width,e.height),n=d3e(n,e.width,e.height),l3e(e,n)),e};Xx.Mask=f3e;VO.Factory.addGetterSetter(i3e.Node,"threshold",0,(0,o3e.getNumberValidator)(),VO.Factory.afterSetFilter);var Yx={};Object.defineProperty(Yx,"__esModule",{value:!0});Yx.Noise=void 0;const GO=kt,h3e=rr,p3e=Xe,g3e=function(e){var t=this.noise()*255,n=e.data,r=n.length,i=t/2,o;for(o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};Yx.Noise=g3e;GO.Factory.addGetterSetter(h3e.Node,"noise",.2,(0,p3e.getNumberValidator)(),GO.Factory.afterSetFilter);var Zx={};Object.defineProperty(Zx,"__esModule",{value:!0});Zx.Pixelate=void 0;const qO=kt,m3e=fr,y3e=rr,v3e=Xe,b3e=function(e){var t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i,o,a,s,l,u,c,d=Math.ceil(n/t),f=Math.ceil(r/t),h,p,m,_,b,y,g,v=e.data;if(t<=0){m3e.Util.error("pixelSize value can not be <= 0");return}for(b=0;b<d;b+=1)for(y=0;y<f;y+=1){for(s=0,l=0,u=0,c=0,h=b*t,p=h+t,m=y*t,_=m+t,g=0,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(a=(n*o+i)*4,s+=v[a+0],l+=v[a+1],u+=v[a+2],c+=v[a+3],g+=1);for(s=s/g,l=l/g,u=u/g,c=c/g,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(a=(n*o+i)*4,v[a+0]=s,v[a+1]=l,v[a+2]=u,v[a+3]=c)}};Zx.Pixelate=b3e;qO.Factory.addGetterSetter(y3e.Node,"pixelSize",8,(0,v3e.getNumberValidator)(),qO.Factory.afterSetFilter);var Jx={};Object.defineProperty(Jx,"__esModule",{value:!0});Jx.Posterize=void 0;const HO=kt,_3e=rr,S3e=Xe,x3e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};Jx.Posterize=x3e;HO.Factory.addGetterSetter(_3e.Node,"levels",.5,(0,S3e.getNumberValidator)(),HO.Factory.afterSetFilter);var ew={};Object.defineProperty(ew,"__esModule",{value:!0});ew.RGB=void 0;const X_=kt,K4=rr,w3e=Xe,C3e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a,s;for(a=0;a<n;a+=4)s=(.34*t[a]+.5*t[a+1]+.16*t[a+2])/255,t[a]=s*r,t[a+1]=s*i,t[a+2]=s*o,t[a+3]=t[a+3]};ew.RGB=C3e;X_.Factory.addGetterSetter(K4.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});X_.Factory.addGetterSetter(K4.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});X_.Factory.addGetterSetter(K4.Node,"blue",0,w3e.RGBComponent,X_.Factory.afterSetFilter);var tw={};Object.defineProperty(tw,"__esModule",{value:!0});tw.RGBA=void 0;const P0=kt,nw=rr,A3e=Xe,E3e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s<n;s+=4)l=1-a,t[s]=r*a+t[s]*l,t[s+1]=i*a+t[s+1]*l,t[s+2]=o*a+t[s+2]*l};tw.RGBA=E3e;P0.Factory.addGetterSetter(nw.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});P0.Factory.addGetterSetter(nw.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});P0.Factory.addGetterSetter(nw.Node,"blue",0,A3e.RGBComponent,P0.Factory.afterSetFilter);P0.Factory.addGetterSetter(nw.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var rw={};Object.defineProperty(rw,"__esModule",{value:!0});rw.Sepia=void 0;const T3e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r<n;r+=4)i=t[r+0],o=t[r+1],a=t[r+2],t[r+0]=Math.min(255,i*.393+o*.769+a*.189),t[r+1]=Math.min(255,i*.349+o*.686+a*.168),t[r+2]=Math.min(255,i*.272+o*.534+a*.131)};rw.Sepia=T3e;var iw={};Object.defineProperty(iw,"__esModule",{value:!0});iw.Solarize=void 0;const k3e=function(e){var t=e.data,n=e.width,r=e.height,i=n*4,o=r;do{var a=(o-1)*i,s=n;do{var l=a+(s-1)*4,u=t[l],c=t[l+1],d=t[l+2];u>127&&(u=255-u),c>127&&(c=255-c),d>127&&(d=255-d),t[l]=u,t[l+1]=c,t[l+2]=d}while(--s)}while(--o)};iw.Solarize=k3e;var ow={};Object.defineProperty(ow,"__esModule",{value:!0});ow.Threshold=void 0;const WO=kt,P3e=rr,I3e=Xe,R3e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=1)n[i]=n[i]<t?0:255};ow.Threshold=R3e;WO.Factory.addGetterSetter(P3e.Node,"threshold",.5,(0,I3e.getNumberValidator)(),WO.Factory.afterSetFilter);Object.defineProperty(px,"__esModule",{value:!0});px.Konva=void 0;const KO=kG,O3e=_x,M3e=wx,$3e=Ex,N3e=Tx,D3e=kx,QO=up,L3e=Ny,F3e=Rp,B3e=Ly,z3e=Rx,j3e=Ox,U3e=Mx,V3e=$x,G3e=Gd,q3e=Nx,H3e=Dx,W3e=Lx,K3e=Bx,Q3e=zx,X3e=jx,Y3e=Ux,Z3e=Gx,J3e=qx,eAe=Hx,tAe=Wx,nAe=Kx,rAe=Qx,iAe=Xx,oAe=Yx,aAe=Zx,sAe=Jx,lAe=ew,uAe=tw,cAe=rw,dAe=iw,fAe=ow;px.Konva=KO.Konva.Util._assign(KO.Konva,{Arc:O3e.Arc,Arrow:M3e.Arrow,Circle:$3e.Circle,Ellipse:N3e.Ellipse,Image:D3e.Image,Label:QO.Label,Tag:QO.Tag,Line:L3e.Line,Path:F3e.Path,Rect:B3e.Rect,RegularPolygon:z3e.RegularPolygon,Ring:j3e.Ring,Sprite:U3e.Sprite,Star:V3e.Star,Text:G3e.Text,TextPath:q3e.TextPath,Transformer:H3e.Transformer,Wedge:W3e.Wedge,Filters:{Blur:K3e.Blur,Brighten:Q3e.Brighten,Contrast:X3e.Contrast,Emboss:Y3e.Emboss,Enhance:Z3e.Enhance,Grayscale:J3e.Grayscale,HSL:eAe.HSL,HSV:tAe.HSV,Invert:nAe.Invert,Kaleidoscope:rAe.Kaleidoscope,Mask:iAe.Mask,Noise:oAe.Noise,Pixelate:aAe.Pixelate,Posterize:sAe.Posterize,RGB:lAe.RGB,RGBA:uAe.RGBA,Sepia:cAe.Sepia,Solarize:dAe.Solarize,Threshold:fAe.Threshold}});var hAe=$4.exports;Object.defineProperty(hAe,"__esModule",{value:!0});const pAe=px;$4.exports=pAe.Konva;var gAe=$4.exports;const dg=Sc(gAe),mAe=async(e,t,n)=>{const{width:r,height:i}=t,o=document.createElement("div"),a=new dg.Stage({container:o,width:r,height:i}),s=new dg.Layer,l=new dg.Layer;return s.add(new dg.Rect({...t,fill:n?"black":"white"})),e.forEach(u=>l.add(new dg.Line({points:u.points,stroke:n?"white":"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),a.add(s),a.add(l),o.remove(),a},yAe=async(e,t,n)=>new Promise((r,i)=>{const o=document.createElement("canvas");o.width=t,o.height=n;const a=o.getContext("2d"),s=new Image;if(!a){o.remove(),i("Unable to get context");return}s.onload=function(){a.drawImage(s,0,0),o.remove(),r(a.getImageData(0,0,t,n))},s.src=e}),XO=async(e,t)=>{const n=e.toDataURL(t);return await yAe(n,t.width,t.height)},Q4=async(e,t,n,r,i)=>{const o=_e("canvas"),a=fx(),s=dwe();if(!a||!s){o.error("Unable to find canvas / stage");return}const l={...t,...n},u=a.clone();u.scale({x:1,y:1});const c=u.getAbsolutePosition(),d={x:l.x+c.x,y:l.y+c.y,width:l.width,height:l.height},f=await H_(u,d),h=await XO(u,d),p=await mAe(r?e.objects.filter(uz):[],l,i),m=await H_(p,l),_=await XO(p,l);return{baseBlob:f,baseImageData:h,maskBlob:m,maskImageData:_}},vAe=()=>{Me({actionCreator:iwe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),o=await Q4(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!o)return;const{maskBlob:a}=o;if(!a){r.error("Problem getting mask layer blob"),t(qt({title:Z("toast.problemSavingMask"),description:Z("toast.problemSavingMaskDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(Se.endpoints.uploadImage.initiate({file:new File([a],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Z("toast.maskSavedAssets")}}}))}})},bAe=()=>{Me({actionCreator:uwe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),{id:o}=e.payload,a=await Q4(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!a)return;const{maskBlob:s}=a;if(!s){r.error("Problem getting mask layer blob"),t(qt({title:Z("toast.problemImportingMask"),description:Z("toast.problemImportingMaskDesc"),status:"error"}));return}const{autoAddBoardId:l}=i.gallery,u=await t(Se.endpoints.uploadImage.initiate({file:new File([s],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:l==="none"?void 0:l,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:Z("toast.maskSentControlnetAssets")}}})).unwrap(),{image_name:c}=u;t(Tc({id:o,controlImage:c}))}})},_Ae=async()=>{const e=fx();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),H_(t,t.getClientRect())},SAe=()=>{Me({actionCreator:swe,effect:async(e,{dispatch:t})=>{const n=nx.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await _Ae();if(!r){n.error("Problem getting base layer blob"),t(qt({title:Z("toast.problemMergingCanvas"),description:Z("toast.problemMergingCanvasDesc"),status:"error"}));return}const i=fx();if(!i){n.error("Problem getting canvas base layer"),t(qt({title:Z("toast.problemMergingCanvas"),description:Z("toast.problemMergingCanvasDesc"),status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()}),a=await t(Se.endpoints.uploadImage.initiate({file:new File([r],"mergedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Z("toast.canvasMerged")}}})).unwrap(),{image_name:s}=a;t(uue({kind:"image",layer:"base",imageName:s,...o}))}})},xAe=()=>{Me({actionCreator:rwe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n();let o;try{o=await hx(i)}catch(s){r.error(String(s)),t(qt({title:Z("toast.problemSavingCanvas"),description:Z("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery;t(Se.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Z("toast.canvasSavedGallery")}}}))}})},wAe=(e,t,n)=>{if(!(Tse.match(e)||CI.match(e)||Tc.match(e)||kse.match(e)||AI.match(e)))return!1;const{id:i}=e.payload,o=eo(n.controlAdapters,i),a=eo(t.controlAdapters,i);if(!o||!qo(o)||!a||!qo(a)||AI.match(e)&&o.shouldAutoConfig===!0)return!1;const{controlImage:s,processorType:l,shouldAutoConfig:u}=a;return CI.match(e)&&!u?!1:l!=="none"&&!!s},CAe=()=>{Me({predicate:wAe,effect:async(e,{dispatch:t,cancelActiveListeners:n,delay:r})=>{const i=_e("session"),{id:o}=e.payload;n(),i.trace("ControlNet auto-process triggered"),await r(300),t(Mk({id:o}))}})},Be="positive_conditioning",We="negative_conditioning",Ee="denoise_latents",Ke="latents_to_image",is="save_image",Cd="nsfw_checker",td="invisible_watermark",Fe="noise",Nc="main_model_loader",aw="onnx_model_loader",ws="vae_loader",uq="lora_loader",Zt="clip_skip",qn="image_to_latents",Fs="resize_image",Ah="img2img_resize",ve="canvas_output",Wn="inpaint_image",ki="inpaint_image_resize_up",qi="inpaint_image_resize_down",Kt="inpaint_infill",Uu="inpaint_infill_resize_down",Hn="inpaint_create_mask",dt="canvas_coherence_denoise_latents",Vt="canvas_coherence_noise",mc="canvas_coherence_noise_increment",yr="canvas_coherence_mask_edge",zt="canvas_coherence_inpaint_create_mask",Eh="tomask",Ui="mask_blur",Ei="mask_combine",Mn="mask_resize_up",Hi="mask_resize_down",e1="control_net_collect",AAe="ip_adapter_collect",t1="t2i_adapter_collect",pt="metadata_accumulator",m5="esrgan",Vi="sdxl_model_loader",ye="sdxl_denoise_latents",Vc="sdxl_refiner_model_loader",n1="sdxl_refiner_positive_conditioning",r1="sdxl_refiner_negative_conditioning",Cs="sdxl_refiner_denoise_latents",ga="refiner_inpaint_create_mask",Kr="seamless",ts="refiner_seamless",cq="text_to_image_graph",pE="image_to_image_graph",dq="canvas_text_to_image_graph",gE="canvas_image_to_image_graph",sw="canvas_inpaint_graph",lw="canvas_outpaint_graph",X4="sdxl_text_to_image_graph",Y_="sxdl_image_to_image_graph",uw="sdxl_canvas_text_to_image_graph",I0="sdxl_canvas_image_to_image_graph",yc="sdxl_canvas_inpaint_graph",vc="sdxl_canvas_outpaint_graph",fq=e=>(e==null?void 0:e.type)==="image_output",EAe=()=>{Me({actionCreator:Mk,effect:async(e,{dispatch:t,getState:n,take:r})=>{var l;const i=_e("session"),{id:o}=e.payload,a=eo(n().controlAdapters,o);if(!(a!=null&&a.controlImage)||!qo(a)){i.error("Unable to process ControlNet image");return}if(a.processorType==="none"||a.processorNode.type==="none")return;const s={nodes:{[a.processorNode.id]:{...a.processorNode,is_intermediate:!0,image:{image_name:a.controlImage}},[is]:{id:is,type:"save_image",is_intermediate:!0,use_cache:!1}},edges:[{source:{node_id:a.processorNode.id,field:"image"},destination:{node_id:is,field:"image"}}]};try{const u=t(Er.endpoints.enqueueGraph.initiate({graph:s,prepend:!0},{fixedCacheKey:"enqueueGraph"})),c=await u.unwrap();u.reset(),i.debug({enqueueResult:Xt(c)},Z("queue.graphQueued"));const[d]=await r(f=>Pk.match(f)&&f.payload.data.graph_execution_state_id===c.queue_item.session_id&&f.payload.data.source_node_id===is);if(fq(d.payload.data.result)){const{image_name:f}=d.payload.data.result.image,[{payload:h}]=await r(m=>Se.endpoints.getImageDTO.matchFulfilled(m)&&m.payload.image_name===f),p=h;i.debug({controlNetId:e.payload,processedControlImage:p},"ControlNet image processed"),t(Fk({id:o,processedControlImage:p.image_name}))}}catch(u){if(i.error({graph:Xt(s)},Z("queue.graphFailedToQueue")),u instanceof Object&&"data"in u&&"status"in u&&u.status===403){const c=((l=u.data)==null?void 0:l.detail)||"Unknown Error";t(qt({title:Z("queue.graphFailedToQueue"),status:"error",description:c,duration:15e3})),t(Ise()),t(Tc({id:o,controlImage:null}));return}t(qt({title:Z("queue.graphFailedToQueue"),status:"error"}))}}})},Y4=Ne("app/enqueueRequested");Ne("app/batchEnqueued");const TAe=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("</br>"),t.document.write(r.outerHTML),t.document.write("</br></br>")})},YO=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>t(r.result),r.onerror=i=>n(r.error),r.onabort=i=>n(new Error("Read aborted")),r.readAsDataURL(e)}),kAe=e=>{let t=!0,n=!1;const r=e.length;let i=3;for(i;i<r;i+=4)if(e[i]===255?t=!1:n=!0,!t&&n)return{isFullyTransparent:t,isPartiallyTransparent:n};return{isFullyTransparent:t,isPartiallyTransparent:n}},PAe=e=>{const t=e.length;let n=0;for(n;n<t;)if(e[n++]===0&&e[n++]===0&&e[n++]===0&&e[n++]===255)return!0;return!1},IAe=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=kAe(e.data),i=PAe(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},$a=(e,t,n)=>{const r=Sse(e.controlAdapters).filter(o=>{var a,s;return((a=o.model)==null?void 0:a.base_model)===((s=e.generation.model)==null?void 0:s.base_model)}),i=t.nodes[pt];if(r.length){const o={id:e1,type:"collect",is_intermediate:!0};t.nodes[e1]=o,t.edges.push({source:{node_id:e1,field:"collection"},destination:{node_id:n,field:"control"}}),r.forEach(a=>{if(!a.model)return;const{id:s,controlImage:l,processedControlImage:u,beginStepPct:c,endStepPct:d,controlMode:f,resizeMode:h,model:p,processorType:m,weight:_}=a,b={id:`control_net_${s}`,type:"controlnet",is_intermediate:!0,begin_step_percent:c,end_step_percent:d,control_mode:f,resize_mode:h,control_model:p,control_weight:_};if(u&&m!=="none")b.image={image_name:u};else if(l)b.image={image_name:l};else return;if(t.nodes[b.id]=b,i!=null&&i.controlnets){const y=my(b,["id","type"]);i.controlnets.push(y)}t.edges.push({source:{node_id:b.id,field:"control"},destination:{node_id:e1,field:"item"}}),dt in t.nodes&&t.edges.push({source:{node_id:b.id,field:"control"},destination:{node_id:dt,field:"control"}})})}},Na=(e,t,n)=>{const r=wse(e.controlAdapters).filter(o=>{var a,s;return((a=o.model)==null?void 0:a.base_model)===((s=e.generation.model)==null?void 0:s.base_model)}),i=t.nodes[pt];if(r.length){const o={id:AAe,type:"collect",is_intermediate:!0};t.nodes[o.id]=o,t.edges.push({source:{node_id:o.id,field:"collection"},destination:{node_id:n,field:"ip_adapter"}}),r.forEach(a=>{if(!a.model)return;const{id:s,weight:l,model:u,beginStepPct:c,endStepPct:d}=a,f={id:`ip_adapter_${s}`,type:"ip_adapter",is_intermediate:!0,weight:l,ip_adapter_model:u,begin_step_percent:c,end_step_percent:d};if(a.controlImage)f.image={image_name:a.controlImage};else return;if(t.nodes[f.id]=f,i!=null&&i.ipAdapters){const h={image:{image_name:a.controlImage},weight:l,ip_adapter_model:u,begin_step_percent:c,end_step_percent:d};i.ipAdapters.push(h)}t.edges.push({source:{node_id:f.id,field:"ip_adapter"},destination:{node_id:o.id,field:"item"}}),dt in t.nodes&&t.edges.push({source:{node_id:f.id,field:"ip_adapter"},destination:{node_id:dt,field:"ip_adapter"}})})}},Mp=(e,t,n,r=Nc)=>{const{loras:i}=e.lora,o=o2(i),a=t.nodes[pt];o>0&&(t.edges=t.edges.filter(u=>!(u.source.node_id===r&&["unet"].includes(u.source.field))),t.edges=t.edges.filter(u=>!(u.source.node_id===Zt&&["clip"].includes(u.source.field))));let s="",l=0;Xl(i,u=>{const{model_name:c,base_model:d,weight:f}=u,h=`${uq}_${c.replace(".","_")}`,p={type:"lora_loader",id:h,is_intermediate:!0,lora:{model_name:c,base_model:d},weight:f};a!=null&&a.loras&&a.loras.push({lora:{model_name:c,base_model:d},weight:f}),t.nodes[h]=p,l===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:Zt,field:"clip"},destination:{node_id:h,field:"clip"}})):(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:s,field:"clip"},destination:{node_id:h,field:"clip"}})),l===o-1&&(t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[sw,lw].includes(t.id)&&t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:dt,field:"unet"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:We,field:"clip"}})),s=h,l+=1})},Da=(e,t,n=Ke)=>{const r=t.nodes[n];if(!r)return;r.is_intermediate=!0,r.use_cache=!0;const i={id:Cd,type:"img_nsfw",is_intermediate:!0};t.nodes[Cd]=i,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Cd,field:"image"}})},RAe=["txt2img","img2img","unifiedCanvas","nodes","modelManager","queue"],Z4=Ii(e=>e,({ui:e})=>Ck(e.activeTab)?e.activeTab:"txt2img"),RKe=Ii(e=>e,({ui:e,config:t})=>{const r=RAe.filter(i=>!t.disabledTabs.includes(i)).indexOf(e.activeTab);return r===-1?0:r}),OKe=Ii(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:Ak}}),La=(e,t)=>{const r=Z4(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,{autoAddBoardId:i}=e.gallery,o={id:is,type:"save_image",is_intermediate:r,use_cache:!1,board:i==="none"?void 0:{board_id:i}};t.nodes[is]=o,t.nodes[pt]&&t.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:is,field:"metadata"}});const s={node_id:is,field:"image"};td in t.nodes?t.edges.push({source:{node_id:td,field:"image"},destination:s}):Cd in t.nodes?t.edges.push({source:{node_id:Cd,field:"image"},destination:s}):ve in t.nodes?t.edges.push({source:{node_id:ve,field:"image"},destination:s}):Ke in t.nodes&&t.edges.push({source:{node_id:Ke,field:"image"},destination:s})},Fa=(e,t,n)=>{const{seamlessXAxis:r,seamlessYAxis:i}=e.generation;t.nodes[Kr]={id:Kr,type:"seamless",seamless_x:r,seamless_y:i};let o=Ee;(t.id===X4||t.id===Y_||t.id===uw||t.id===I0||t.id===yc||t.id===vc)&&(o=ye),t.edges=t.edges.filter(a=>!(a.source.node_id===n&&["unet"].includes(a.source.field))&&!(a.source.node_id===n&&["vae"].includes(a.source.field))),t.edges.push({source:{node_id:n,field:"unet"},destination:{node_id:Kr,field:"unet"}},{source:{node_id:n,field:"vae"},destination:{node_id:Kr,field:"vae"}},{source:{node_id:Kr,field:"unet"},destination:{node_id:o,field:"unet"}}),(t.id==sw||t.id===lw||t.id===yc||t.id===vc)&&t.edges.push({source:{node_id:Kr,field:"unet"},destination:{node_id:dt,field:"unet"}})},Ba=(e,t,n)=>{const r=Cse(e.controlAdapters).filter(o=>{var a,s;return((a=o.model)==null?void 0:a.base_model)===((s=e.generation.model)==null?void 0:s.base_model)}),i=t.nodes[pt];if(r.length){const o={id:t1,type:"collect",is_intermediate:!0};t.nodes[t1]=o,t.edges.push({source:{node_id:t1,field:"collection"},destination:{node_id:n,field:"t2i_adapter"}}),r.forEach(a=>{if(!a.model)return;const{id:s,controlImage:l,processedControlImage:u,beginStepPct:c,endStepPct:d,resizeMode:f,model:h,processorType:p,weight:m}=a,_={id:`t2i_adapter_${s}`,type:"t2i_adapter",is_intermediate:!0,begin_step_percent:c,end_step_percent:d,resize_mode:f,t2i_adapter_model:h,weight:m};if(u&&p!=="none")_.image={image_name:u};else if(l)_.image={image_name:l};else return;if(t.nodes[_.id]=_,i!=null&&i.ipAdapters){const b=my(_,["id","type"]);i.t2iAdapters.push(b)}t.edges.push({source:{node_id:_.id,field:"t2i_adapter"},destination:{node_id:t1,field:"item"}}),dt in t.nodes&&t.edges.push({source:{node_id:_.id,field:"t2i_adapter"},destination:{node_id:dt,field:"t2i_adapter"}})})}},za=(e,t,n=Nc)=>{const{vae:r,canvasCoherenceMode:i}=e.generation,{boundingBoxScaleMethod:o}=e.canvas,{shouldUseSDXLRefiner:a}=e.sdxl,s=["auto","manual"].includes(o),l=!r,u=t.nodes[pt];l||(t.nodes[ws]={type:"vae_loader",id:ws,is_intermediate:!0,vae_model:r});const c=n==aw;(t.id===cq||t.id===pE||t.id===X4||t.id===Y_)&&t.edges.push({source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ke,field:"vae"}}),(t.id===dq||t.id===gE||t.id===uw||t.id==I0)&&t.edges.push({source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:s?Ke:ve,field:"vae"}}),(t.id===pE||t.id===Y_||t.id===gE||t.id===I0)&&t.edges.push({source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:qn,field:"vae"}}),(t.id===sw||t.id===lw||t.id===yc||t.id===vc)&&(t.edges.push({source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Wn,field:"vae"}},{source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Hn,field:"vae"}},{source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ke,field:"vae"}}),i!=="unmasked"&&t.edges.push({source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:zt,field:"vae"}})),a&&(t.id===yc||t.id===vc)&&t.edges.push({source:{node_id:l?n:ws,field:l&&c?"vae_decoder":"vae"},destination:{node_id:ga,field:"vae"}}),r&&u&&(u.vae=r)},ja=(e,t,n=Ke)=>{const i=Z4(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],a=t.nodes[Cd],s=t.nodes[pt];if(!o)return;const l={id:td,type:"img_watermark",is_intermediate:i};t.nodes[td]=l,o.is_intermediate=!0,o.use_cache=!0,a?(a.is_intermediate=!0,t.edges.push({source:{node_id:Cd,field:"image"},destination:{node_id:td,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:td,field:"image"}}),s&&t.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:td,field:"metadata"}})},OAe=(e,t)=>{const n=_e("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,img2imgStrength:c,vaePrecision:d,clipSkip:f,shouldUseCpuNoise:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{width:_,height:b}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:y,boundingBoxScaleMethod:g}=e.canvas,v=d==="fp32",S=!0,w=["auto","manual"].includes(g);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let x=Nc;const C=h,T={id:gE,nodes:{[x]:{type:"main_model_loader",id:x,is_intermediate:S,model:o},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:S,skipped_layers:f},[Be]:{type:"compel",id:Be,is_intermediate:S,prompt:r},[We]:{type:"compel",id:We,is_intermediate:S,prompt:i},[Fe]:{type:"noise",id:Fe,is_intermediate:S,use_cpu:C,seed:l,width:w?y.width:_,height:w?y.height:b},[qn]:{type:"i2l",id:qn,is_intermediate:S},[Ee]:{type:"denoise_latents",id:Ee,is_intermediate:S,cfg_scale:a,scheduler:s,steps:u,denoising_start:1-c,denoising_end:1},[ve]:{type:"l2i",id:ve,is_intermediate:S}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Ee,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Ee,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Ee,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:Ee,field:"noise"}},{source:{node_id:qn,field:"latents"},destination:{node_id:Ee,field:"latents"}}]};return w?(T.nodes[Ah]={id:Ah,type:"img_resize",is_intermediate:S,image:t,width:y.width,height:y.height},T.nodes[Ke]={id:Ke,type:"l2i",is_intermediate:S,fp32:v},T.nodes[ve]={id:ve,type:"img_resize",is_intermediate:S,width:_,height:b},T.edges.push({source:{node_id:Ah,field:"image"},destination:{node_id:qn,field:"image"}},{source:{node_id:Ee,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}})):(T.nodes[ve]={type:"l2i",id:ve,is_intermediate:S,fp32:v},T.nodes[qn].image=t,T.edges.push({source:{node_id:Ee,field:"latents"},destination:{node_id:ve,field:"latents"}})),T.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:a,width:w?y.width:_,height:w?y.height:b,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:C?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[],clip_skip:f,strength:c,init_image:t.image_name},(p||m)&&(Fa(e,T,x),x=Kr),Mp(e,T,Ee),za(e,T,x),$a(e,T,Ee),Na(e,T,Ee),Ba(e,T,Ee),e.system.shouldUseNSFWChecker&&Da(e,T,ve),e.system.shouldUseWatermarker&&ja(e,T,ve),La(e,T),T},MAe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,maskBlurMethod:m,canvasCoherenceMode:_,canvasCoherenceSteps:b,canvasCoherenceStrength:y,clipSkip:g,seamlessXAxis:v,seamlessYAxis:S}=e.generation;if(!a)throw r.error("No Image found in state"),new Error("No Image found in state");const{width:w,height:x}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:C,boundingBoxScaleMethod:T}=e.canvas,E=!0,P=f==="fp32",N=["auto","manual"].includes(T);let O=Nc;const A=h,k={id:sw,nodes:{[O]:{type:"main_model_loader",id:O,is_intermediate:E,model:a},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:E,skipped_layers:g},[Be]:{type:"compel",id:Be,is_intermediate:E,prompt:i},[We]:{type:"compel",id:We,is_intermediate:E,prompt:o},[Ui]:{type:"img_blur",id:Ui,is_intermediate:E,radius:p,blur_type:m},[Wn]:{type:"i2l",id:Wn,is_intermediate:E,fp32:P},[Fe]:{type:"noise",id:Fe,use_cpu:A,seed:d,is_intermediate:E},[Hn]:{type:"create_denoise_mask",id:Hn,is_intermediate:E,fp32:P},[Ee]:{type:"denoise_latents",id:Ee,is_intermediate:E,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[Vt]:{type:"noise",id:Vt,use_cpu:A,seed:d+1,is_intermediate:E},[mc]:{type:"add",id:mc,b:1,is_intermediate:E},[dt]:{type:"denoise_latents",id:dt,is_intermediate:E,steps:b,cfg_scale:s,scheduler:l,denoising_start:1-y,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:E,fp32:P},[ve]:{type:"color_correct",id:ve,is_intermediate:E,reference:t}},edges:[{source:{node_id:O,field:"unet"},destination:{node_id:Ee,field:"unet"}},{source:{node_id:O,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Ee,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Ee,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:Ee,field:"noise"}},{source:{node_id:Wn,field:"latents"},destination:{node_id:Ee,field:"latents"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hn,field:"mask"}},{source:{node_id:Hn,field:"denoise_mask"},destination:{node_id:Ee,field:"denoise_mask"}},{source:{node_id:O,field:"unet"},destination:{node_id:dt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:dt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:dt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:dt,field:"noise"}},{source:{node_id:Ee,field:"latents"},destination:{node_id:dt,field:"latents"}},{source:{node_id:dt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(N){const D=C.width,L=C.height;k.nodes[ki]={type:"img_resize",id:ki,is_intermediate:E,width:D,height:L,image:t},k.nodes[Mn]={type:"img_resize",id:Mn,is_intermediate:E,width:D,height:L,image:n},k.nodes[qi]={type:"img_resize",id:qi,is_intermediate:E,width:w,height:x},k.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:E,width:w,height:x},k.nodes[Fe].width=D,k.nodes[Fe].height=L,k.nodes[Vt].width=D,k.nodes[Vt].height=L,k.edges.push({source:{node_id:ki,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Mn,field:"image"},destination:{node_id:Ui,field:"image"}},{source:{node_id:ki,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:qi,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:ve,field:"mask"}})}else k.nodes[Fe].width=w,k.nodes[Fe].height=x,k.nodes[Vt].width=w,k.nodes[Vt].height=x,k.nodes[Wn]={...k.nodes[Wn],image:t},k.nodes[Ui]={...k.nodes[Ui],image:n},k.nodes[Hn]={...k.nodes[Hn],image:t},k.edges.push({source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:ve,field:"mask"}});return _!=="unmasked"&&(k.nodes[zt]={type:"create_denoise_mask",id:zt,is_intermediate:E,fp32:P},N?k.edges.push({source:{node_id:ki,field:"image"},destination:{node_id:zt,field:"image"}}):k.nodes[zt]={...k.nodes[zt],image:t},_==="mask"&&(N?k.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:zt,field:"mask"}}):k.nodes[zt]={...k.nodes[zt],mask:n}),_==="edge"&&(k.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:E,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},N?k.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:yr,field:"image"}}):k.nodes[yr]={...k.nodes[yr],image:n},k.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:zt,field:"mask"}})),k.edges.push({source:{node_id:zt,field:"denoise_mask"},destination:{node_id:dt,field:"denoise_mask"}})),(v||S)&&(Fa(e,k,O),O=Kr),za(e,k,O),Mp(e,k,Ee,O),$a(e,k,Ee),Na(e,k,Ee),Ba(e,k,Ee),e.system.shouldUseNSFWChecker&&Da(e,k,ve),e.system.shouldUseWatermarker&&ja(e,k,ve),La(e,k),k},$Ae=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:b,infillTileSize:y,infillPatchmatchDownscaleSize:g,infillMethod:v,clipSkip:S,seamlessXAxis:w,seamlessYAxis:x}=e.generation;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:C,height:T}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:E,boundingBoxScaleMethod:P}=e.canvas,N=f==="fp32",O=!0,A=["auto","manual"].includes(P);let k=Nc;const D=h,L={id:lw,nodes:{[k]:{type:"main_model_loader",id:k,is_intermediate:O,model:a},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:O,skipped_layers:S},[Be]:{type:"compel",id:Be,is_intermediate:O,prompt:i},[We]:{type:"compel",id:We,is_intermediate:O,prompt:o},[Eh]:{type:"tomask",id:Eh,is_intermediate:O,image:t},[Ei]:{type:"mask_combine",id:Ei,is_intermediate:O,mask2:n},[Wn]:{type:"i2l",id:Wn,is_intermediate:O,fp32:N},[Fe]:{type:"noise",id:Fe,use_cpu:D,seed:d,is_intermediate:O},[Hn]:{type:"create_denoise_mask",id:Hn,is_intermediate:O,fp32:N},[Ee]:{type:"denoise_latents",id:Ee,is_intermediate:O,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[Vt]:{type:"noise",id:Vt,use_cpu:D,seed:d+1,is_intermediate:O},[mc]:{type:"add",id:mc,b:1,is_intermediate:O},[dt]:{type:"denoise_latents",id:dt,is_intermediate:O,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:O,fp32:N},[ve]:{type:"color_correct",id:ve,is_intermediate:O}},edges:[{source:{node_id:k,field:"unet"},destination:{node_id:Ee,field:"unet"}},{source:{node_id:k,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Eh,field:"image"},destination:{node_id:Ei,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Ee,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Ee,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:Ee,field:"noise"}},{source:{node_id:Wn,field:"latents"},destination:{node_id:Ee,field:"latents"}},{source:{node_id:A?Mn:Ei,field:"image"},destination:{node_id:Hn,field:"mask"}},{source:{node_id:Hn,field:"denoise_mask"},destination:{node_id:Ee,field:"denoise_mask"}},{source:{node_id:k,field:"unet"},destination:{node_id:dt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:dt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:dt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:dt,field:"noise"}},{source:{node_id:Ee,field:"latents"},destination:{node_id:dt,field:"latents"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:dt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(v==="patchmatch"&&(L.nodes[Kt]={type:"infill_patchmatch",id:Kt,is_intermediate:O,downscale:g}),v==="lama"&&(L.nodes[Kt]={type:"infill_lama",id:Kt,is_intermediate:O}),v==="cv2"&&(L.nodes[Kt]={type:"infill_cv2",id:Kt,is_intermediate:O}),v==="tile"&&(L.nodes[Kt]={type:"infill_tile",id:Kt,is_intermediate:O,tile_size:y}),A){const M=E.width,R=E.height;L.nodes[ki]={type:"img_resize",id:ki,is_intermediate:O,width:M,height:R,image:t},L.nodes[Mn]={type:"img_resize",id:Mn,is_intermediate:O,width:M,height:R},L.nodes[qi]={type:"img_resize",id:qi,is_intermediate:O,width:C,height:T},L.nodes[Uu]={type:"img_resize",id:Uu,is_intermediate:O,width:C,height:T},L.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:O,width:C,height:T},L.nodes[Fe].width=M,L.nodes[Fe].height=R,L.nodes[Vt].width=M,L.nodes[Vt].height=R,L.edges.push({source:{node_id:ki,field:"image"},destination:{node_id:Kt,field:"image"}},{source:{node_id:Ei,field:"image"},destination:{node_id:Mn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:Mn,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Uu,field:"image"}},{source:{node_id:Uu,field:"image"},destination:{node_id:ve,field:"reference"}},{source:{node_id:qi,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:ve,field:"mask"}})}else L.nodes[Kt]={...L.nodes[Kt],image:t},L.nodes[Fe].width=C,L.nodes[Fe].height=T,L.nodes[Vt].width=C,L.nodes[Vt].height=T,L.nodes[Wn]={...L.nodes[Wn],image:t},L.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:ve,field:"reference"}},{source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Ei,field:"image"},destination:{node_id:ve,field:"mask"}});return m!=="unmasked"&&(L.nodes[zt]={type:"create_denoise_mask",id:zt,is_intermediate:O,fp32:N},L.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:zt,field:"image"}}),m==="mask"&&(A?L.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:zt,field:"mask"}}):L.edges.push({source:{node_id:Ei,field:"image"},destination:{node_id:zt,field:"mask"}})),m==="edge"&&(L.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:O,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},A?L.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:yr,field:"image"}}):L.edges.push({source:{node_id:Ei,field:"image"},destination:{node_id:yr,field:"image"}}),L.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:zt,field:"mask"}})),L.edges.push({source:{node_id:zt,field:"denoise_mask"},destination:{node_id:dt,field:"denoise_mask"}})),(w||x)&&(Fa(e,L,k),k=Kr),za(e,L,k),Mp(e,L,Ee,k),$a(e,L,Ee),Na(e,L,Ee),Ba(e,L,Ee),e.system.shouldUseNSFWChecker&&Da(e,L,ve),e.system.shouldUseWatermarker&&ja(e,L,ve),La(e,L),L},$p=(e,t,n,r=Vi)=>{const{loras:i}=e.lora,o=o2(i),a=t.nodes[pt],s=r;let l=r;[Kr,ga].includes(r)&&(l=Vi),o>0&&(t.edges=t.edges.filter(d=>!(d.source.node_id===s&&["unet"].includes(d.source.field))&&!(d.source.node_id===l&&["clip"].includes(d.source.field))&&!(d.source.node_id===l&&["clip2"].includes(d.source.field))));let u="",c=0;Xl(i,d=>{const{model_name:f,base_model:h,weight:p}=d,m=`${uq}_${f.replace(".","_")}`,_={type:"sdxl_lora_loader",id:m,is_intermediate:!0,lora:{model_name:f,base_model:h},weight:p};a&&(a.loras||(a.loras=[]),a.loras.push({lora:{model_name:f,base_model:h},weight:p})),t.nodes[m]=_,c===0?(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:l,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:l,field:"clip2"},destination:{node_id:m,field:"clip2"}})):(t.edges.push({source:{node_id:u,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:u,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:u,field:"clip2"},destination:{node_id:m,field:"clip2"}})),c===o-1&&(t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[yc,vc].includes(t.id)&&t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:dt,field:"unet"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:We,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:Be,field:"clip2"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:We,field:"clip2"}})),u=m,c+=1})},of=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o,shouldConcatSDXLStylePrompt:a}=e.sdxl,s=a||t?[n,i].join(" "):i,l=a||t?[r,o].join(" "):o;return{joinedPositiveStylePrompt:s,joinedNegativeStylePrompt:l}},Np=(e,t,n,r,i,o)=>{const{refinerModel:a,refinerPositiveAestheticScore:s,refinerNegativeAestheticScore:l,refinerSteps:u,refinerScheduler:c,refinerCFGScale:d,refinerStart:f}=e.sdxl,{seamlessXAxis:h,seamlessYAxis:p,vaePrecision:m}=e.generation,{boundingBoxScaleMethod:_}=e.canvas,b=m==="fp32",y=["auto","manual"].includes(_);if(!a)return;const g=t.nodes[pt];g&&(g.refiner_model=a,g.refiner_positive_aesthetic_score=s,g.refiner_negative_aesthetic_score=l,g.refiner_cfg_scale=d,g.refiner_scheduler=c,g.refiner_start=f,g.refiner_steps=u);const v=r||Vi,{joinedPositiveStylePrompt:S,joinedNegativeStylePrompt:w}=of(e,!0);t.edges=t.edges.filter(x=>!(x.source.node_id===n&&["latents"].includes(x.source.field))),t.edges=t.edges.filter(x=>!(x.source.node_id===v&&["vae"].includes(x.source.field))),t.nodes[Vc]={type:"sdxl_refiner_model_loader",id:Vc,model:a},t.nodes[n1]={type:"sdxl_refiner_compel_prompt",id:n1,style:S,aesthetic_score:s},t.nodes[r1]={type:"sdxl_refiner_compel_prompt",id:r1,style:w,aesthetic_score:l},t.nodes[Cs]={type:"denoise_latents",id:Cs,cfg_scale:d,steps:u,scheduler:c,denoising_start:f,denoising_end:1},h||p?(t.nodes[ts]={id:ts,type:"seamless",seamless_x:h,seamless_y:p},t.edges.push({source:{node_id:Vc,field:"unet"},destination:{node_id:ts,field:"unet"}},{source:{node_id:Vc,field:"vae"},destination:{node_id:ts,field:"vae"}},{source:{node_id:ts,field:"unet"},destination:{node_id:Cs,field:"unet"}})):t.edges.push({source:{node_id:Vc,field:"unet"},destination:{node_id:Cs,field:"unet"}}),t.edges.push({source:{node_id:Vc,field:"clip2"},destination:{node_id:n1,field:"clip2"}},{source:{node_id:Vc,field:"clip2"},destination:{node_id:r1,field:"clip2"}},{source:{node_id:n1,field:"conditioning"},destination:{node_id:Cs,field:"positive_conditioning"}},{source:{node_id:r1,field:"conditioning"},destination:{node_id:Cs,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:Cs,field:"latents"}}),(t.id===yc||t.id===vc)&&(t.nodes[ga]={type:"create_denoise_mask",id:ga,is_intermediate:!0,fp32:b},y?t.edges.push({source:{node_id:ki,field:"image"},destination:{node_id:ga,field:"image"}}):t.nodes[ga]={...t.nodes[ga],image:i},t.id===yc&&(y?t.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:ga,field:"mask"}}):t.nodes[ga]={...t.nodes[ga],mask:o}),t.id===vc&&t.edges.push({source:{node_id:y?Mn:Ei,field:"image"},destination:{node_id:ga,field:"mask"}}),t.edges.push({source:{node_id:ga,field:"denoise_mask"},destination:{node_id:Cs,field:"denoise_mask"}})),t.id===uw||t.id===I0?t.edges.push({source:{node_id:Cs,field:"latents"},destination:{node_id:y?Ke:ve,field:"latents"}}):t.edges.push({source:{node_id:Cs,field:"latents"},destination:{node_id:Ke,field:"latents"}})},NAe=(e,t)=>{const n=_e("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,vaePrecision:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{shouldUseSDXLRefiner:p,refinerStart:m,sdxlImg2ImgDenoisingStrength:_}=e.sdxl,{width:b,height:y}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:g,boundingBoxScaleMethod:v}=e.canvas,S=c==="fp32",w=!0,x=["auto","manual"].includes(v);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let C=Vi;const T=d,{joinedPositiveStylePrompt:E,joinedNegativeStylePrompt:P}=of(e),N={id:I0,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:o},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:r,style:E},[We]:{type:"sdxl_compel_prompt",id:We,prompt:i,style:P},[Fe]:{type:"noise",id:Fe,is_intermediate:w,use_cpu:T,seed:l,width:x?g.width:b,height:x?g.height:y},[qn]:{type:"i2l",id:qn,is_intermediate:w,fp32:S},[ye]:{type:"denoise_latents",id:ye,is_intermediate:w,cfg_scale:a,scheduler:s,steps:u,denoising_start:p?Math.min(m,1-_):1-_,denoising_end:p?m:1}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:ye,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:ye,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:ye,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:ye,field:"noise"}},{source:{node_id:qn,field:"latents"},destination:{node_id:ye,field:"latents"}}]};return x?(N.nodes[Ah]={id:Ah,type:"img_resize",is_intermediate:w,image:t,width:g.width,height:g.height},N.nodes[Ke]={id:Ke,type:"l2i",is_intermediate:w,fp32:S},N.nodes[ve]={id:ve,type:"img_resize",is_intermediate:w,width:b,height:y},N.edges.push({source:{node_id:Ah,field:"image"},destination:{node_id:qn,field:"image"}},{source:{node_id:ye,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}})):(N.nodes[ve]={type:"l2i",id:ve,is_intermediate:w,fp32:S},N.nodes[qn].image=t,N.edges.push({source:{node_id:ye,field:"latents"},destination:{node_id:ve,field:"latents"}})),N.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:a,width:x?g.width:b,height:x?g.height:y,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:T?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[],strength:_,init_image:t.image_name},N.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:ve,field:"metadata"}}),(f||h)&&(Fa(e,N,C),C=Kr),p&&(Np(e,N,ye,C),(f||h)&&(C=ts)),za(e,N,C),$p(e,N,ye,C),$a(e,N,ye),Na(e,N,ye),Ba(e,N,ye),e.system.shouldUseNSFWChecker&&Da(e,N,ve),e.system.shouldUseWatermarker&&ja(e,N,ve),La(e,N),N},DAe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,maskBlurMethod:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:b,seamlessXAxis:y,seamlessYAxis:g}=e.generation,{sdxlImg2ImgDenoisingStrength:v,shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:x,height:C}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:T,boundingBoxScaleMethod:E}=e.canvas,P=d==="fp32",N=!0,O=["auto","manual"].includes(E);let A=Vi;const k=f,{joinedPositiveStylePrompt:D,joinedNegativeStylePrompt:L}=of(e),M={id:yc,nodes:{[A]:{type:"sdxl_model_loader",id:A,model:a},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:D},[We]:{type:"sdxl_compel_prompt",id:We,prompt:o,style:L},[Ui]:{type:"img_blur",id:Ui,is_intermediate:N,radius:h,blur_type:p},[Wn]:{type:"i2l",id:Wn,is_intermediate:N,fp32:P},[Fe]:{type:"noise",id:Fe,use_cpu:k,seed:c,is_intermediate:N},[Hn]:{type:"create_denoise_mask",id:Hn,is_intermediate:N,fp32:P},[ye]:{type:"denoise_latents",id:ye,is_intermediate:N,steps:u,cfg_scale:s,scheduler:l,denoising_start:S?Math.min(w,1-v):1-v,denoising_end:S?w:1},[Vt]:{type:"noise",id:Vt,use_cpu:k,seed:c+1,is_intermediate:N},[mc]:{type:"add",id:mc,b:1,is_intermediate:N},[dt]:{type:"denoise_latents",id:dt,is_intermediate:N,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:N,fp32:P},[ve]:{type:"color_correct",id:ve,is_intermediate:N,reference:t}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:ye,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:A,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:ye,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:ye,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:ye,field:"noise"}},{source:{node_id:Wn,field:"latents"},destination:{node_id:ye,field:"latents"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hn,field:"mask"}},{source:{node_id:Hn,field:"denoise_mask"},destination:{node_id:ye,field:"denoise_mask"}},{source:{node_id:A,field:"unet"},destination:{node_id:dt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:dt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:dt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:dt,field:"noise"}},{source:{node_id:ye,field:"latents"},destination:{node_id:dt,field:"latents"}},{source:{node_id:dt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(O){const R=T.width,$=T.height;M.nodes[ki]={type:"img_resize",id:ki,is_intermediate:N,width:R,height:$,image:t},M.nodes[Mn]={type:"img_resize",id:Mn,is_intermediate:N,width:R,height:$,image:n},M.nodes[qi]={type:"img_resize",id:qi,is_intermediate:N,width:x,height:C},M.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:N,width:x,height:C},M.nodes[Fe].width=R,M.nodes[Fe].height=$,M.nodes[Vt].width=R,M.nodes[Vt].height=$,M.edges.push({source:{node_id:ki,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Mn,field:"image"},destination:{node_id:Ui,field:"image"}},{source:{node_id:ki,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:qi,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:ve,field:"mask"}})}else M.nodes[Fe].width=x,M.nodes[Fe].height=C,M.nodes[Vt].width=x,M.nodes[Vt].height=C,M.nodes[Wn]={...M.nodes[Wn],image:t},M.nodes[Ui]={...M.nodes[Ui],image:n},M.nodes[Hn]={...M.nodes[Hn],image:t},M.edges.push({source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:ve,field:"mask"}});return m!=="unmasked"&&(M.nodes[zt]={type:"create_denoise_mask",id:zt,is_intermediate:N,fp32:P},O?M.edges.push({source:{node_id:ki,field:"image"},destination:{node_id:zt,field:"image"}}):M.nodes[zt]={...M.nodes[zt],image:t},m==="mask"&&(O?M.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:zt,field:"mask"}}):M.nodes[zt]={...M.nodes[zt],mask:n}),m==="edge"&&(M.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:N,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},O?M.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:yr,field:"image"}}):M.nodes[yr]={...M.nodes[yr],image:n},M.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:zt,field:"mask"}})),M.edges.push({source:{node_id:zt,field:"denoise_mask"},destination:{node_id:dt,field:"denoise_mask"}})),(y||g)&&(Fa(e,M,A),A=Kr),S&&(Np(e,M,dt,A,t,n),(y||g)&&(A=ts)),za(e,M,A),$p(e,M,ye,A),$a(e,M,ye),Na(e,M,ye),Ba(e,M,ye),e.system.shouldUseNSFWChecker&&Da(e,M,ve),e.system.shouldUseWatermarker&&ja(e,M,ve),La(e,M),M},LAe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,canvasCoherenceMode:p,canvasCoherenceSteps:m,canvasCoherenceStrength:_,infillTileSize:b,infillPatchmatchDownscaleSize:y,infillMethod:g,seamlessXAxis:v,seamlessYAxis:S}=e.generation,{sdxlImg2ImgDenoisingStrength:w,shouldUseSDXLRefiner:x,refinerStart:C}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:T,height:E}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:P,boundingBoxScaleMethod:N}=e.canvas,O=d==="fp32",A=!0,k=["auto","manual"].includes(N);let D=Vi;const L=f,{joinedPositiveStylePrompt:M,joinedNegativeStylePrompt:R}=of(e),$={id:vc,nodes:{[Vi]:{type:"sdxl_model_loader",id:Vi,model:a},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:M},[We]:{type:"sdxl_compel_prompt",id:We,prompt:o,style:R},[Eh]:{type:"tomask",id:Eh,is_intermediate:A,image:t},[Ei]:{type:"mask_combine",id:Ei,is_intermediate:A,mask2:n},[Wn]:{type:"i2l",id:Wn,is_intermediate:A,fp32:O},[Fe]:{type:"noise",id:Fe,use_cpu:L,seed:c,is_intermediate:A},[Hn]:{type:"create_denoise_mask",id:Hn,is_intermediate:A,fp32:O},[ye]:{type:"denoise_latents",id:ye,is_intermediate:A,steps:u,cfg_scale:s,scheduler:l,denoising_start:x?Math.min(C,1-w):1-w,denoising_end:x?C:1},[Vt]:{type:"noise",id:Vt,use_cpu:L,seed:c+1,is_intermediate:A},[mc]:{type:"add",id:mc,b:1,is_intermediate:A},[dt]:{type:"denoise_latents",id:dt,is_intermediate:A,steps:m,cfg_scale:s,scheduler:l,denoising_start:1-_,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:A,fp32:O},[ve]:{type:"color_correct",id:ve,is_intermediate:A}},edges:[{source:{node_id:Vi,field:"unet"},destination:{node_id:ye,field:"unet"}},{source:{node_id:Vi,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vi,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:Vi,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Vi,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Eh,field:"image"},destination:{node_id:Ei,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:ye,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:ye,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:ye,field:"noise"}},{source:{node_id:Wn,field:"latents"},destination:{node_id:ye,field:"latents"}},{source:{node_id:k?Mn:Ei,field:"image"},destination:{node_id:Hn,field:"mask"}},{source:{node_id:Hn,field:"denoise_mask"},destination:{node_id:ye,field:"denoise_mask"}},{source:{node_id:D,field:"unet"},destination:{node_id:dt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:dt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:dt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:dt,field:"noise"}},{source:{node_id:ye,field:"latents"},destination:{node_id:dt,field:"latents"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:dt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(g==="patchmatch"&&($.nodes[Kt]={type:"infill_patchmatch",id:Kt,is_intermediate:A,downscale:y}),g==="lama"&&($.nodes[Kt]={type:"infill_lama",id:Kt,is_intermediate:A}),g==="cv2"&&($.nodes[Kt]={type:"infill_cv2",id:Kt,is_intermediate:A}),g==="tile"&&($.nodes[Kt]={type:"infill_tile",id:Kt,is_intermediate:A,tile_size:b}),k){const B=P.width,U=P.height;$.nodes[ki]={type:"img_resize",id:ki,is_intermediate:A,width:B,height:U,image:t},$.nodes[Mn]={type:"img_resize",id:Mn,is_intermediate:A,width:B,height:U},$.nodes[qi]={type:"img_resize",id:qi,is_intermediate:A,width:T,height:E},$.nodes[Uu]={type:"img_resize",id:Uu,is_intermediate:A,width:T,height:E},$.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:A,width:T,height:E},$.nodes[Fe].width=B,$.nodes[Fe].height=U,$.nodes[Vt].width=B,$.nodes[Vt].height=U,$.edges.push({source:{node_id:ki,field:"image"},destination:{node_id:Kt,field:"image"}},{source:{node_id:Ei,field:"image"},destination:{node_id:Mn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:Mn,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Uu,field:"image"}},{source:{node_id:Uu,field:"image"},destination:{node_id:ve,field:"reference"}},{source:{node_id:qi,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:ve,field:"mask"}})}else $.nodes[Kt]={...$.nodes[Kt],image:t},$.nodes[Fe].width=T,$.nodes[Fe].height=E,$.nodes[Vt].width=T,$.nodes[Vt].height=E,$.nodes[Wn]={...$.nodes[Wn],image:t},$.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:ve,field:"reference"}},{source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}},{source:{node_id:Ei,field:"image"},destination:{node_id:ve,field:"mask"}});return p!=="unmasked"&&($.nodes[zt]={type:"create_denoise_mask",id:zt,is_intermediate:A,fp32:O},$.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:zt,field:"image"}}),p==="mask"&&(k?$.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:zt,field:"mask"}}):$.edges.push({source:{node_id:Ei,field:"image"},destination:{node_id:zt,field:"mask"}})),p==="edge"&&($.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:A,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},k?$.edges.push({source:{node_id:Mn,field:"image"},destination:{node_id:yr,field:"image"}}):$.edges.push({source:{node_id:Ei,field:"image"},destination:{node_id:yr,field:"image"}}),$.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:zt,field:"mask"}})),$.edges.push({source:{node_id:zt,field:"denoise_mask"},destination:{node_id:dt,field:"denoise_mask"}})),(v||S)&&(Fa(e,$,D),D=Kr),x&&(Np(e,$,dt,D,t),(v||S)&&(D=ts)),za(e,$,D),$p(e,$,ye,D),$a(e,$,ye),Na(e,$,ye),Ba(e,$,ye),e.system.shouldUseNSFWChecker&&Da(e,$,ve),e.system.shouldUseWatermarker&&ja(e,$,ve),La(e,$),$},FAe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,shouldUseCpuNoise:c,seamlessXAxis:d,seamlessYAxis:f}=e.generation,{width:h,height:p}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:m,boundingBoxScaleMethod:_}=e.canvas,b=u==="fp32",y=!0,g=["auto","manual"].includes(_),{shouldUseSDXLRefiner:v,refinerStart:S}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=c,x=i.model_type==="onnx";let C=x?aw:Vi;const T=x?"onnx_model_loader":"sdxl_model_loader",E=x?{type:"t2l_onnx",id:ye,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:ye,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:v?S:1},{joinedPositiveStylePrompt:P,joinedNegativeStylePrompt:N}=of(e),O={id:uw,nodes:{[C]:{type:T,id:C,is_intermediate:y,model:i},[Be]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:Be,is_intermediate:y,prompt:n,style:P},[We]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:We,is_intermediate:y,prompt:r,style:N},[Fe]:{type:"noise",id:Fe,is_intermediate:y,seed:s,width:g?m.width:h,height:g?m.height:p,use_cpu:w},[E.id]:E},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:ye,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:ye,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:ye,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:ye,field:"noise"}}]};return g?(O.nodes[Ke]={id:Ke,type:x?"l2i_onnx":"l2i",is_intermediate:y,fp32:b},O.nodes[ve]={id:ve,type:"img_resize",is_intermediate:y,width:h,height:p},O.edges.push({source:{node_id:ye,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}})):(O.nodes[ve]={type:x?"l2i_onnx":"l2i",id:ve,is_intermediate:y,fp32:b},O.edges.push({source:{node_id:ye,field:"latents"},destination:{node_id:ve,field:"latents"}})),O.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:g?m.width:h,height:g?m.height:p,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[]},O.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:ve,field:"metadata"}}),(d||f)&&(Fa(e,O,C),C=Kr),v&&(Np(e,O,ye,C),(d||f)&&(C=ts)),$p(e,O,ye,C),za(e,O,C),$a(e,O,ye),Na(e,O,ye),Ba(e,O,ye),e.system.shouldUseNSFWChecker&&Da(e,O,ve),e.system.shouldUseWatermarker&&ja(e,O,ve),La(e,O),O},BAe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,clipSkip:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:_,boundingBoxScaleMethod:b}=e.canvas,y=u==="fp32",g=!0,v=["auto","manual"].includes(b);if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=d,w=i.model_type==="onnx";let x=w?aw:Nc;const C=w?"onnx_model_loader":"main_model_loader",T=w?{type:"t2l_onnx",id:Ee,is_intermediate:g,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:Ee,is_intermediate:g,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:1},E={id:dq,nodes:{[x]:{type:C,id:x,is_intermediate:g,model:i},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:g,skipped_layers:c},[Be]:{type:w?"prompt_onnx":"compel",id:Be,is_intermediate:g,prompt:n},[We]:{type:w?"prompt_onnx":"compel",id:We,is_intermediate:g,prompt:r},[Fe]:{type:"noise",id:Fe,is_intermediate:g,seed:s,width:v?_.width:p,height:v?_.height:m,use_cpu:S},[T.id]:T},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Ee,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Ee,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Ee,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:Ee,field:"noise"}}]};return v?(E.nodes[Ke]={id:Ke,type:w?"l2i_onnx":"l2i",is_intermediate:g,fp32:y},E.nodes[ve]={id:ve,type:"img_resize",is_intermediate:g,width:p,height:m},E.edges.push({source:{node_id:Ee,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:ve,field:"image"}})):(E.nodes[ve]={type:w?"l2i_onnx":"l2i",id:ve,is_intermediate:g,fp32:y},E.edges.push({source:{node_id:Ee,field:"latents"},destination:{node_id:ve,field:"latents"}})),E.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:v?_.width:p,height:v?_.height:m,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:S?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[],clip_skip:c},E.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:ve,field:"metadata"}}),(f||h)&&(Fa(e,E,x),x=Kr),za(e,E,x),Mp(e,E,Ee,x),$a(e,E,Ee),Na(e,E,Ee),Ba(e,E,Ee),e.system.shouldUseNSFWChecker&&Da(e,E,ve),e.system.shouldUseWatermarker&&ja(e,E,ve),La(e,E),E},zAe=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=FAe(e):i=BAe(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=NAe(e,n):i=OAe(e,n)}else if(t==="inpaint"){if(!n||!r)throw new Error("Missing canvas init and mask images");e.generation.model&&e.generation.model.base_model==="sdxl"?i=DAe(e,n,r):i=MAe(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=LAe(e,n,r):i=$Ae(e,n,r)}return i},y5=({count:e,start:t,min:n=$se,max:r=Jg})=>{const i=t??Sae(n,r),o=[];for(let a=i;a<i+e;a++)o.push(a%r);return o},hq=(e,t,n)=>{const{iterations:r,model:i,shouldRandomizeSeed:o,seed:a}=e.generation,{shouldConcatSDXLStylePrompt:s,positiveStylePrompt:l}=e.sdxl,{prompts:u,seedBehaviour:c}=e.dynamicPrompts,d=[];if(u.length===1){fI(t.nodes[pt],"seed");const h=y5({count:r,start:o?void 0:a}),p=[];t.nodes[Fe]&&p.push({node_path:Fe,field_name:"seed",items:h}),t.nodes[pt]&&p.push({node_path:pt,field_name:"seed",items:h}),t.nodes[Vt]&&p.push({node_path:Vt,field_name:"seed",items:h.map(m=>(m+1)%Jg)}),d.push(p)}else{const h=[],p=[];if(c==="PER_PROMPT"){const _=y5({count:u.length*r,start:o?void 0:a});t.nodes[Fe]&&h.push({node_path:Fe,field_name:"seed",items:_}),t.nodes[pt]&&h.push({node_path:pt,field_name:"seed",items:_}),t.nodes[Vt]&&h.push({node_path:Vt,field_name:"seed",items:_.map(b=>(b+1)%Jg)})}else{const _=y5({count:r,start:o?void 0:a});t.nodes[Fe]&&p.push({node_path:Fe,field_name:"seed",items:_}),t.nodes[pt]&&p.push({node_path:pt,field_name:"seed",items:_}),t.nodes[Vt]&&p.push({node_path:Vt,field_name:"seed",items:_.map(b=>(b+1)%Jg)}),d.push(p)}const m=c==="PER_PROMPT"?Tae(r).flatMap(()=>u):u;if(t.nodes[Be]&&h.push({node_path:Be,field_name:"prompt",items:m}),t.nodes[pt]&&h.push({node_path:pt,field_name:"positive_prompt",items:m}),s&&(i==null?void 0:i.base_model)==="sdxl"){fI(t.nodes[pt],"positive_style_prompt");const _=m.map(b=>[b,l].join(" "));t.nodes[Be]&&h.push({node_path:Be,field_name:"style",items:_}),t.nodes[pt]&&h.push({node_path:pt,field_name:"positive_style_prompt",items:_})}d.push(h)}return{prepend:n,batch:{graph:t,runs:1,data:d}}},jAe=()=>{Me({predicate:e=>Y4.match(e)&&e.payload.tabName==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n})=>{const r=_e("queue"),{prepend:i}=e.payload,o=t(),{layerState:a,boundingBoxCoordinates:s,boundingBoxDimensions:l,isMaskEnabled:u,shouldPreserveMaskedArea:c}=o.canvas,d=await Q4(a,s,l,u,c);if(!d){r.error("Unable to create canvas data");return}const{baseBlob:f,baseImageData:h,maskBlob:p,maskImageData:m}=d,_=IAe(h,m);if(o.system.enableImageDebugging){const S=await YO(f),w=await YO(p);TAe([{base64:w,caption:"mask b64"},{base64:S,caption:"image b64"}])}r.debug(`Generation mode: ${_}`);let b,y;["img2img","inpaint","outpaint"].includes(_)&&(b=await n(Se.endpoints.uploadImage.initiate({file:new File([f],"canvasInitImage.png",{type:"image/png"}),image_category:"general",is_intermediate:!0})).unwrap()),["inpaint","outpaint"].includes(_)&&(y=await n(Se.endpoints.uploadImage.initiate({file:new File([p],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!0})).unwrap());const g=zAe(o,_,b,y);r.debug({graph:Xt(g)},"Canvas graph built"),n(xG(g));const v=hq(o,g,i);try{const S=n(Er.endpoints.enqueueBatch.initiate(v,{fixedCacheKey:"enqueueBatch"})),w=await S.unwrap();S.reset();const x=w.batch.batch_id;o.canvas.layerState.stagingArea.boundingBox||n(cue({boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(due(x))}catch{}}})},UAe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,img2imgStrength:c,shouldFitToWidthHeight:d,width:f,height:h,clipSkip:p,shouldUseCpuNoise:m,vaePrecision:_,seamlessXAxis:b,seamlessYAxis:y}=e.generation;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const g=_==="fp32",v=!0;let S=Nc;const w=m,x={id:pE,nodes:{[S]:{type:"main_model_loader",id:S,model:i,is_intermediate:v},[Zt]:{type:"clip_skip",id:Zt,skipped_layers:p,is_intermediate:v},[Be]:{type:"compel",id:Be,prompt:n,is_intermediate:v},[We]:{type:"compel",id:We,prompt:r,is_intermediate:v},[Fe]:{type:"noise",id:Fe,use_cpu:w,seed:s,is_intermediate:v},[Ke]:{type:"l2i",id:Ke,fp32:g,is_intermediate:v},[Ee]:{type:"denoise_latents",id:Ee,cfg_scale:o,scheduler:a,steps:l,denoising_start:1-c,denoising_end:1,is_intermediate:v},[qn]:{type:"i2l",id:qn,fp32:g,is_intermediate:v}},edges:[{source:{node_id:S,field:"unet"},destination:{node_id:Ee,field:"unet"}},{source:{node_id:S,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Ee,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Ee,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:Ee,field:"noise"}},{source:{node_id:qn,field:"latents"},destination:{node_id:Ee,field:"latents"}},{source:{node_id:Ee,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(d&&(u.width!==f||u.height!==h)){const C={id:Fs,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:f,height:h};x.nodes[Fs]=C,x.edges.push({source:{node_id:Fs,field:"image"},destination:{node_id:qn,field:"image"}}),x.edges.push({source:{node_id:Fs,field:"width"},destination:{node_id:Fe,field:"width"}}),x.edges.push({source:{node_id:Fs,field:"height"},destination:{node_id:Fe,field:"height"}})}else x.nodes[qn].image={image_name:u.imageName},x.edges.push({source:{node_id:qn,field:"width"},destination:{node_id:Fe,field:"width"}}),x.edges.push({source:{node_id:qn,field:"height"},destination:{node_id:Fe,field:"height"}});return x.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:o,height:h,width:f,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[],clip_skip:p,strength:c,init_image:u.imageName},x.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(b||y)&&(Fa(e,x,S),S=Kr),za(e,x,S),Mp(e,x,Ee,S),$a(e,x,Ee),Na(e,x,Ee),Ba(e,x,Ee),e.system.shouldUseNSFWChecker&&Da(e,x),e.system.shouldUseWatermarker&&ja(e,x),La(e,x),x},VAe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,shouldFitToWidthHeight:c,width:d,height:f,shouldUseCpuNoise:h,vaePrecision:p,seamlessXAxis:m,seamlessYAxis:_}=e.generation,{positiveStylePrompt:b,negativeStylePrompt:y,shouldUseSDXLRefiner:g,refinerStart:v,sdxlImg2ImgDenoisingStrength:S}=e.sdxl;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=p==="fp32",x=!0;let C=Vi;const T=h,{joinedPositiveStylePrompt:E,joinedNegativeStylePrompt:P}=of(e),N={id:Y_,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:i,is_intermediate:x},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:E,is_intermediate:x},[We]:{type:"sdxl_compel_prompt",id:We,prompt:r,style:P,is_intermediate:x},[Fe]:{type:"noise",id:Fe,use_cpu:T,seed:s,is_intermediate:x},[Ke]:{type:"l2i",id:Ke,fp32:w,is_intermediate:x},[ye]:{type:"denoise_latents",id:ye,cfg_scale:o,scheduler:a,steps:l,denoising_start:g?Math.min(v,1-S):1-S,denoising_end:g?v:1,is_intermediate:x},[qn]:{type:"i2l",id:qn,fp32:w,is_intermediate:x}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:ye,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:ye,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:ye,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:ye,field:"noise"}},{source:{node_id:qn,field:"latents"},destination:{node_id:ye,field:"latents"}},{source:{node_id:ye,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(c&&(u.width!==d||u.height!==f)){const O={id:Fs,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:d,height:f};N.nodes[Fs]=O,N.edges.push({source:{node_id:Fs,field:"image"},destination:{node_id:qn,field:"image"}}),N.edges.push({source:{node_id:Fs,field:"width"},destination:{node_id:Fe,field:"width"}}),N.edges.push({source:{node_id:Fs,field:"height"},destination:{node_id:Fe,field:"height"}})}else N.nodes[qn].image={image_name:u.imageName},N.edges.push({source:{node_id:qn,field:"width"},destination:{node_id:Fe,field:"width"}}),N.edges.push({source:{node_id:qn,field:"height"},destination:{node_id:Fe,field:"height"}});return N.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"sdxl_img2img",cfg_scale:o,height:f,width:d,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:T?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[],strength:S,init_image:u.imageName,positive_style_prompt:b,negative_style_prompt:y},N.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(m||_)&&(Fa(e,N,C),C=Kr),g&&(Np(e,N,ye),(m||_)&&(C=ts)),za(e,N,C),$p(e,N,ye,C),$a(e,N,ye),Na(e,N,ye),Ba(e,N,ye),e.system.shouldUseNSFWChecker&&Da(e,N),e.system.shouldUseWatermarker&&ja(e,N),La(e,N),N},GAe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,width:u,height:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{positiveStylePrompt:m,negativeStylePrompt:_,shouldUseSDXLRefiner:b,refinerStart:y}=e.sdxl,g=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const v=f==="fp32",S=!0,{joinedPositiveStylePrompt:w,joinedNegativeStylePrompt:x}=of(e);let C=Vi;const T={id:X4,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:i,is_intermediate:S},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:w,is_intermediate:S},[We]:{type:"sdxl_compel_prompt",id:We,prompt:r,style:x,is_intermediate:S},[Fe]:{type:"noise",id:Fe,seed:s,width:u,height:c,use_cpu:g,is_intermediate:S},[ye]:{type:"denoise_latents",id:ye,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:b?y:1,is_intermediate:S},[Ke]:{type:"l2i",id:Ke,fp32:v,is_intermediate:S}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:ye,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:ye,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:ye,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:ye,field:"noise"}},{source:{node_id:ye,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};return T.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"sdxl_txt2img",cfg_scale:o,height:c,width:u,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:g?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[],positive_style_prompt:m,negative_style_prompt:_},T.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(h||p)&&(Fa(e,T,C),C=Kr),b&&(Np(e,T,ye),(h||p)&&(C=ts)),za(e,T,C),$p(e,T,ye,C),$a(e,T,ye),Na(e,T,ye),Ba(e,T,ye),e.system.shouldUseNSFWChecker&&Da(e,T),e.system.shouldUseWatermarker&&ja(e,T),La(e,T),T},qAe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,steps:s,width:l,height:u,clipSkip:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p,seed:m}=e.generation,_=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const b=f==="fp32",y=!0,g=i.model_type==="onnx";let v=g?aw:Nc;const S=g?"onnx_model_loader":"main_model_loader",w=g?{type:"t2l_onnx",id:Ee,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s}:{type:"denoise_latents",id:Ee,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s,denoising_start:0,denoising_end:1},x={id:cq,nodes:{[v]:{type:S,id:v,is_intermediate:y,model:i},[Zt]:{type:"clip_skip",id:Zt,skipped_layers:c,is_intermediate:y},[Be]:{type:g?"prompt_onnx":"compel",id:Be,prompt:n,is_intermediate:y},[We]:{type:g?"prompt_onnx":"compel",id:We,prompt:r,is_intermediate:y},[Fe]:{type:"noise",id:Fe,seed:m,width:l,height:u,use_cpu:_,is_intermediate:y},[w.id]:w,[Ke]:{type:g?"l2i_onnx":"l2i",id:Ke,fp32:b,is_intermediate:y}},edges:[{source:{node_id:v,field:"unet"},destination:{node_id:Ee,field:"unet"}},{source:{node_id:v,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Ee,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Ee,field:"negative_conditioning"}},{source:{node_id:Fe,field:"noise"},destination:{node_id:Ee,field:"noise"}},{source:{node_id:Ee,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};return x.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:u,width:l,positive_prompt:n,negative_prompt:r,model:i,seed:m,steps:s,rand_device:_?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],t2iAdapters:[],clip_skip:c},x.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(h||p)&&(Fa(e,x,v),v=Kr),za(e,x,v),Mp(e,x,Ee,v),$a(e,x,Ee),Na(e,x,Ee),Ba(e,x,Ee),e.system.shouldUseNSFWChecker&&Da(e,x),e.system.shouldUseWatermarker&&ja(e,x),La(e,x),x},HAe=()=>{Me({predicate:e=>Y4.match(e)&&(e.payload.tabName==="txt2img"||e.payload.tabName==="img2img"),effect:async(e,{getState:t,dispatch:n})=>{const r=t(),i=r.generation.model,{prepend:o}=e.payload;let a;i&&i.base_model==="sdxl"?e.payload.tabName==="txt2img"?a=GAe(r):a=VAe(r):e.payload.tabName==="txt2img"?a=qAe(r):a=UAe(r);const s=hq(r,a,o);n(Er.endpoints.enqueueBatch.initiate(s,{fixedCacheKey:"enqueueBatch"})).reset()}})},WAe=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function KAe(e){return e.length===1?e[0].toString():e.reduce((t,n)=>{if(typeof n=="number")return t+"["+n.toString()+"]";if(n.includes('"'))return t+'["'+QAe(n)+'"]';if(!WAe.test(n))return t+'["'+n+'"]';const r=t.length===0?"":".";return t+r+n},"")}function QAe(e){return e.replace(/"/g,'\\"')}function XAe(e){return e.length!==0}const YAe=99,pq="; ",gq=", or ",J4="Validation error",mq=": ";class yq extends Error{constructor(n,r=[]){super(n);Mw(this,"details");Mw(this,"name");this.details=r,this.name="ZodValidationError"}toString(){return this.message}}function eP(e,t,n){if(e.code==="invalid_union")return e.unionErrors.reduce((r,i)=>{const o=i.issues.map(a=>eP(a,t,n)).join(t);return r.includes(o)||r.push(o),r},[]).join(n);if(XAe(e.path)){if(e.path.length===1){const r=e.path[0];if(typeof r=="number")return`${e.message} at index ${r}`}return`${e.message} at "${KAe(e.path)}"`}return e.message}function vq(e,t,n){return t!==null?e.length>0?[t,e].join(n):t:e.length>0?e:J4}function MKe(e,t={}){const{issueSeparator:n=pq,unionSeparator:r=gq,prefixSeparator:i=mq,prefix:o=J4}=t,a=eP(e,n,r),s=vq(a,o,i);return new yq(s,[e])}function ZO(e,t={}){const{maxIssuesInMessage:n=YAe,issueSeparator:r=pq,unionSeparator:i=gq,prefixSeparator:o=mq,prefix:a=J4}=t,s=e.errors.slice(0,n).map(u=>eP(u,r,i)).join(r),l=vq(s,a,o);return new yq(l,e.errors)}const ZAe=e=>{const{workflow:t,nodes:n,edges:r}=e,i={...t,nodes:[],edges:[]};return n.filter(o=>["invocation","notes"].includes(o.type??"__UNKNOWN_NODE_TYPE__")).forEach(o=>{const a=lj.safeParse(o);if(!a.success){const{message:s}=ZO(a.error,{prefix:me.t("nodes.unableToParseNode")});_e("nodes").warn({node:Xt(o)},s);return}i.nodes.push(a.data)}),r.forEach(o=>{const a=uj.safeParse(o);if(!a.success){const{message:s}=ZO(a.error,{prefix:me.t("nodes.unableToParseEdge")});_e("nodes").warn({edge:Xt(o)},s);return}i.edges.push(a.data)}),i},JAe=e=>{if(e.type==="ColorField"&&e.value){const t=Ut(e.value),{r:n,g:r,b:i,a:o}=e.value,a=Math.max(0,Math.min(o*255,255));return Object.assign(t,{r:n,g:r,b:i,a}),t}return e.value},eEe=e=>{const{nodes:t,edges:n}=e,r=t.filter(Vr),i=JSON.stringify(ZAe(e)),o=r.reduce((u,c)=>{const{id:d,data:f}=c,{type:h,inputs:p,isIntermediate:m,embedWorkflow:_}=f,b=fA(p,(g,v,S)=>{const w=JAe(v);return g[S]=w,g},{});b.use_cache=c.data.useCache;const y={type:h,id:d,...b,is_intermediate:m};return _&&Object.assign(y,{workflow:i}),Object.assign(u,{[d]:y}),u},{}),s=n.filter(u=>u.type!=="collapsed").reduce((u,c)=>{const{source:d,target:f,sourceHandle:h,targetHandle:p}=c;return u.push({source:{node_id:d,field:h},destination:{node_id:f,field:p}}),u},[]);return s.forEach(u=>{const c=o[u.destination.node_id],d=u.destination.field;o[u.destination.node_id]=my(c,d)}),{id:Zg(),nodes:o,edges:s}},tEe=()=>{Me({predicate:e=>Y4.match(e)&&e.payload.tabName==="nodes",effect:async(e,{getState:t,dispatch:n})=>{const r=t(),o={batch:{graph:eEe(r.nodes),runs:r.generation.iterations},prepend:e.payload.prepend};n(Er.endpoints.enqueueBatch.initiate(o,{fixedCacheKey:"enqueueBatch"})).reset()}})},nEe=()=>{Me({matcher:Se.endpoints.addImageToBoard.matchFulfilled,effect:e=>{const t=_e("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Image added to board")}})},rEe=()=>{Me({matcher:Se.endpoints.addImageToBoard.matchRejected,effect:e=>{const t=_e("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Problem adding image to board")}})},tP=Ne("deleteImageModal/imageDeletionConfirmed"),$Ke=Ii(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1],dx),bq=Ii([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?ii:to,offset:0,limit:Eue,is_intermediate:!1}},dx),iEe=()=>{Me({actionCreator:tP,effect:async(e,{dispatch:t,getState:n,condition:r})=>{var f;const{imageDTOs:i,imagesUsage:o}=e.payload;if(i.length!==1||o.length!==1)return;const a=i[0],s=o[0];if(!a||!s)return;t(Vk(!1));const l=n(),u=(f=l.gallery.selection[l.gallery.selection.length-1])==null?void 0:f.image_name;if(a&&(a==null?void 0:a.image_name)===u){const{image_name:h}=a,p=bq(l),{data:m}=Se.endpoints.listImages.select(p)(l),_=m?Vn.getSelectors().selectAll(m):[],b=_.findIndex(S=>S.image_name===h),y=_.filter(S=>S.image_name!==h),g=Bu(b,0,y.length-1),v=y[g];t(Qs(v||null))}s.isCanvasImage&&t(Uk()),i.forEach(h=>{var p;((p=n().generation.initialImage)==null?void 0:p.imageName)===h.image_name&&t(jk()),Xl(Pa(n().controlAdapters),m=>{(m.controlImage===h.image_name||qo(m)&&m.processedControlImage===h.image_name)&&(t(Tc({id:m.id,controlImage:null})),t(Fk({id:m.id,processedControlImage:null})))}),n().nodes.nodes.forEach(m=>{Vr(m)&&Xl(m.data.inputs,_=>{var b;_.type==="ImageField"&&((b=_.value)==null?void 0:b.image_name)===h.image_name&&t(ux({nodeId:m.data.id,fieldName:_.name,value:void 0}))})})});const{requestId:c}=t(Se.endpoints.deleteImage.initiate(a));await r(h=>Se.endpoints.deleteImage.matchFulfilled(h)&&h.meta.requestId===c,3e4)&&t(ps.util.invalidateTags([{type:"Board",id:a.board_id}]))}})},oEe=()=>{Me({actionCreator:tP,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTOs:r,imagesUsage:i}=e.payload;if(!(r.length<=1||i.length<=1))try{await t(Se.endpoints.deleteImages.initiate({imageDTOs:r})).unwrap();const o=n(),a=bq(o),{data:s}=Se.endpoints.listImages.select(a)(o),l=s?Vn.getSelectors().selectAll(s)[0]:void 0;t(Qs(l||null)),t(Vk(!1)),i.some(u=>u.isCanvasImage)&&t(Uk()),r.forEach(u=>{var c;((c=n().generation.initialImage)==null?void 0:c.imageName)===u.image_name&&t(jk()),Xl(Pa(n().controlAdapters),d=>{(d.controlImage===u.image_name||qo(d)&&d.processedControlImage===u.image_name)&&(t(Tc({id:d.id,controlImage:null})),t(Fk({id:d.id,processedControlImage:null})))}),n().nodes.nodes.forEach(d=>{Vr(d)&&Xl(d.data.inputs,f=>{var h;f.type==="ImageField"&&((h=f.value)==null?void 0:h.image_name)===u.image_name&&t(ux({nodeId:d.data.id,fieldName:f.name,value:void 0}))})})})}catch{}}})},aEe=()=>{Me({matcher:Se.endpoints.deleteImage.matchPending,effect:()=>{}})},sEe=()=>{Me({matcher:Se.endpoints.deleteImage.matchFulfilled,effect:e=>{_e("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},lEe=()=>{Me({matcher:Se.endpoints.deleteImage.matchRejected,effect:e=>{_e("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},_q=Ne("dnd/dndDropped"),uEe=()=>{Me({actionCreator:_q,effect:async(e,{dispatch:t})=>{const n=_e("dnd"),{activeData:r,overData:i}=e.payload;if(r.payloadType==="IMAGE_DTO"?n.debug({activeData:r,overData:i},"Image dropped"):r.payloadType==="IMAGE_DTOS"?n.debug({activeData:r,overData:i},`Images (${r.payload.imageDTOs.length}) dropped`):r.payloadType==="NODE_FIELD"?n.debug({activeData:Xt(r),overData:Xt(i)},"Node field dropped"):n.debug({activeData:r,overData:i},"Unknown payload dropped"),i.actionType==="ADD_FIELD_TO_LINEAR"&&r.payloadType==="NODE_FIELD"){const{nodeId:o,field:a}=r.payload;t(R2e({nodeId:o,fieldName:a.name}))}if(i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(Qs(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(f2(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROL_ADAPTER_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{id:o}=i.context;t(Tc({id:o,controlImage:r.payload.imageDTO.image_name})),t(yy({id:o,isEnabled:!0}));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(fz(r.payload.imageDTO));return}if(i.actionType==="SET_NODES_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{fieldName:o,nodeId:a}=i.context;t(ux({nodeId:a,fieldName:o,value:r.payload.imageDTO}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload,{boardId:a}=i.context;t(Se.endpoints.addImageToBoard.initiate({imageDTO:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload;t(Se.endpoints.removeImageFromBoard.initiate({imageDTO:o}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload,{boardId:a}=i.context;t(Se.endpoints.addImagesToBoard.initiate({imageDTOs:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload;t(Se.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},cEe=()=>{Me({matcher:Se.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=_e("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},dEe=()=>{Me({matcher:Se.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=_e("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},fEe=()=>{Me({actionCreator:yue,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,a=ewe(n()),s=a.some(l=>l.isCanvasImage)||a.some(l=>l.isInitialImage)||a.some(l=>l.isControlImage)||a.some(l=>l.isNodesImage);if(o||s){t(Vk(!0));return}t(tP({imageDTOs:r,imagesUsage:a}))}})},hEe=()=>{Me({matcher:Se.endpoints.uploadImage.matchFulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=_e("images"),i=e.payload,o=n(),{autoAddBoardId:a}=o.gallery;r.debug({imageDTO:i},"Image uploaded");const{postUploadAction:s}=e.meta.arg.originalArgs;if(e.payload.is_intermediate&&!s)return;const l={title:Z("toast.imageUploaded"),status:"success"};if((s==null?void 0:s.type)==="TOAST"){const{toastOptions:u}=s;if(!a||a==="none")t(qt({...l,...u}));else{t(Se.endpoints.addImageToBoard.initiate({board_id:a,imageDTO:i}));const{data:c}=Lt.endpoints.listAllBoards.select()(o),d=c==null?void 0:c.find(h=>h.board_id===a),f=d?`${Z("toast.addedToBoard")} ${d.board_name}`:`${Z("toast.addedToBoard")} ${a}`;t(qt({...l,description:f}))}return}if((s==null?void 0:s.type)==="SET_CANVAS_INITIAL_IMAGE"){t(fz(i)),t(qt({...l,description:Z("toast.setCanvasInitialImage")}));return}if((s==null?void 0:s.type)==="SET_CONTROL_ADAPTER_IMAGE"){const{id:u}=s;t(yy({id:u,isEnabled:!0})),t(Tc({id:u,controlImage:i.image_name})),t(qt({...l,description:Z("toast.setControlImage")}));return}if((s==null?void 0:s.type)==="SET_INITIAL_IMAGE"){t(f2(i)),t(qt({...l,description:Z("toast.setInitialImage")}));return}if((s==null?void 0:s.type)==="SET_NODES_IMAGE"){const{nodeId:u,fieldName:c}=s;t(ux({nodeId:u,fieldName:c,value:i})),t(qt({...l,description:`${Z("toast.setNodeField")} ${c}`}));return}}})},pEe=()=>{Me({matcher:Se.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=_e("images"),r={arg:{...my(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(qt({title:Z("toast.imageUploadFailed"),description:e.error.message,status:"error"}))}})},gEe=()=>{Me({matcher:Se.endpoints.starImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!0}):a.push(s)}),t(AU(a))}})},mEe=()=>{Me({matcher:Se.endpoints.unstarImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!1}):a.push(s)}),t(AU(a))}})},yEe=Ne("generation/initialImageSelected"),vEe=Ne("generation/modelSelected"),bEe=()=>{Me({actionCreator:yEe,effect:(e,{dispatch:t})=>{if(!e.payload){t(qt(Vd({title:Z("toast.imageNotLoadedDesc"),status:"error"})));return}t(f2(e.payload)),t(qt(Vd(Z("toast.sentToImageToImage"))))}})},_Ee=()=>{Me({actionCreator:vEe,effect:(e,{getState:t,dispatch:n})=>{var l,u;const r=_e("models"),i=t(),o=by.safeParse(e.payload);if(!o.success){r.error({error:o.error.format()},"Failed to parse main model");return}const a=o.data,{base_model:s}=a;if(((l=i.generation.model)==null?void 0:l.base_model)!==s){let c=0;Xl(i.lora.loras,(f,h)=>{f.base_model!==s&&(n(TU(h)),c+=1)});const{vae:d}=i.generation;d&&d.base_model!==s&&(n(lz(null)),c+=1),Pa(i.controlAdapters).forEach(f=>{var h;((h=f.model)==null?void 0:h.base_model)!==s&&(n(yy({id:f.id,isEnabled:!1})),c+=1)}),c>0&&n(qt(Vd({title:Z("toast.baseModelChangedCleared",{count:c}),status:"warning"})))}((u=i.generation.model)==null?void 0:u.base_model)!==a.base_model&&i.ui.shouldAutoChangeDimensions&&(["sdxl","sdxl-refiner"].includes(a.base_model)?(n(kI(1024)),n(PI(1024)),n(II({width:1024,height:1024}))):(n(kI(512)),n(PI(512)),n(II({width:512,height:512})))),n(zu(a))}})},R0=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),JO=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),eM=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),tM=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),nM=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),rM=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),iM=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),mE=Ra({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),SEe=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,yu=e=>{const t=[];return e.forEach(n=>{const r={...Ut(n),id:SEe(n)};t.push(r)}),t},Ts=ps.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${em.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"OnnxModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"OnnxModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return JO.setAll(JO.getInitialState(),n)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${em.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"MainModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"MainModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return R0.setAll(R0.getInitialState(),n)}}),updateMainModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/main/${n}`,method:"PATCH",body:r}),invalidatesTags:["Model"]}),importMainModels:e.mutation({query:({body:t})=>({url:"models/import",method:"POST",body:t}),invalidatesTags:["Model"]}),addMainModels:e.mutation({query:({body:t})=>({url:"models/add",method:"POST",body:t}),invalidatesTags:["Model"]}),deleteMainModels:e.mutation({query:({base_model:t,model_name:n,model_type:r})=>({url:`models/${t}/${r}/${n}`,method:"DELETE"}),invalidatesTags:["Model"]}),convertMainModels:e.mutation({query:({base_model:t,model_name:n,convert_dest_directory:r})=>({url:`models/convert/${t}/main/${n}`,method:"PUT",params:{convert_dest_directory:r}}),invalidatesTags:["Model"]}),mergeMainModels:e.mutation({query:({base_model:t,body:n})=>({url:`models/merge/${t}`,method:"PUT",body:n}),invalidatesTags:["Model"]}),syncModels:e.mutation({query:()=>({url:"models/sync",method:"POST"}),invalidatesTags:["Model"]}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:t=>{const n=[{type:"LoRAModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"LoRAModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return eM.setAll(eM.getInitialState(),n)}}),updateLoRAModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/lora/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"LoRAModel",id:no}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:no}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:t=>{const n=[{type:"ControlNetModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"ControlNetModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return tM.setAll(tM.getInitialState(),n)}}),getIPAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"ip_adapter"}}),providesTags:t=>{const n=[{type:"IPAdapterModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"IPAdapterModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return nM.setAll(nM.getInitialState(),n)}}),getT2IAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"t2i_adapter"}}),providesTags:t=>{const n=[{type:"T2IAdapterModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"T2IAdapterModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return rM.setAll(rM.getInitialState(),n)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:t=>{const n=[{type:"VaeModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"VaeModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return mE.setAll(mE.getInitialState(),n)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:t=>{const n=[{type:"TextualInversionModel",id:no},"Model"];return t&&n.push(...t.ids.map(r=>({type:"TextualInversionModel",id:r}))),n},transformResponse:t=>{const n=yu(t.models);return iM.setAll(iM.getInitialState(),n)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${em.stringify(t,{})}`})}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:NKe,useGetOnnxModelsQuery:DKe,useGetControlNetModelsQuery:LKe,useGetIPAdapterModelsQuery:FKe,useGetT2IAdapterModelsQuery:BKe,useGetLoRAModelsQuery:zKe,useGetTextualInversionModelsQuery:jKe,useGetVaeModelsQuery:UKe,useUpdateMainModelsMutation:VKe,useDeleteMainModelsMutation:GKe,useImportMainModelsMutation:qKe,useAddMainModelsMutation:HKe,useConvertMainModelsMutation:WKe,useMergeMainModelsMutation:KKe,useDeleteLoRAModelsMutation:QKe,useUpdateLoRAModelsMutation:XKe,useSyncModelsMutation:YKe,useGetModelsInFolderQuery:ZKe,useGetCheckpointConfigsQuery:JKe}=Ts,xEe=()=>{Me({predicate:e=>Ts.endpoints.getMainModels.matchFulfilled(e)&&!e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`Main models loaded (${e.payload.ids.length})`);const i=t().generation.model,o=R0.getSelectors().selectAll(e.payload);if(o.length===0){n(zu(null));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=by.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse main model");return}n(zu(s.data))}}),Me({predicate:e=>Ts.endpoints.getMainModels.matchFulfilled(e)&&e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`SDXL Refiner models loaded (${e.payload.ids.length})`);const i=t().sdxl.refinerModel,o=R0.getSelectors().selectAll(e.payload);if(o.length===0){n(sO(null)),n(N2e(!1));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=Bk.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse SDXL Refiner Model");return}n(sO(s.data))}}),Me({matcher:Ts.endpoints.getVaeModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`VAEs loaded (${e.payload.ids.length})`);const i=t().generation.vae;if(i===null||Pf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(i==null?void 0:i.model_name)&&(l==null?void 0:l.base_model)===(i==null?void 0:i.base_model)))return;const a=mE.getSelectors().selectAll(e.payload)[0];if(!a){n(zu(null));return}const s=Ule.safeParse(a);if(!s.success){r.error({error:s.error.format()},"Failed to parse VAE model");return}n(lz(s.data))}}),Me({matcher:Ts.endpoints.getLoRAModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`LoRAs loaded (${e.payload.ids.length})`);const i=t().lora.loras;Xl(i,(o,a)=>{Pf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(o==null?void 0:o.model_name)&&(l==null?void 0:l.base_model)===(o==null?void 0:o.base_model))||n(TU(a))})}}),Me({matcher:Ts.endpoints.getControlNetModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`),KB(t().controlAdapters).forEach(i=>{Pf(e.payload.entities,a=>{var s,l;return(a==null?void 0:a.model_name)===((s=i==null?void 0:i.model)==null?void 0:s.model_name)&&(a==null?void 0:a.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(vC({id:i.id}))})}}),Me({matcher:Ts.endpoints.getT2IAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`),QB(t().controlAdapters).forEach(i=>{Pf(e.payload.entities,a=>{var s,l;return(a==null?void 0:a.model_name)===((s=i==null?void 0:i.model)==null?void 0:s.model_name)&&(a==null?void 0:a.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(vC({id:i.id}))})}}),Me({matcher:Ts.endpoints.getIPAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`IP Adapter models loaded (${e.payload.ids.length})`),xse(t().controlAdapters).forEach(i=>{Pf(e.payload.entities,a=>{var s,l;return(a==null?void 0:a.model_name)===((s=i==null?void 0:i.model)==null?void 0:s.model_name)&&(a==null?void 0:a.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(vC({id:i.id}))})}}),Me({matcher:Ts.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{_e("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},wEe=ps.injectEndpoints({endpoints:e=>({dynamicPrompts:e.query({query:t=>({url:"utilities/dynamicprompts",body:t,method:"POST"}),keepUnusedDataFor:86400})})}),CEe=Qi(Jle,xue,_ue,Sue,Tk),AEe=()=>{Me({matcher:CEe,effect:async(e,{dispatch:t,getState:n,cancelActiveListeners:r,delay:i})=>{r(),await i(1e3);const o=n();if(o.config.disabledFeatures.includes("dynamicPrompting"))return;const{positivePrompt:a}=o.generation,{maxPrompts:s}=o.dynamicPrompts;t(bC(!0));try{const l=t(wEe.endpoints.dynamicPrompts.initiate({prompt:a,max_prompts:s})),u=await l.unwrap();l.unsubscribe(),t(wue(u.prompts)),t(Cue(u.error)),t(RI(!1)),t(bC(!1))}catch{t(RI(!0)),t(bC(!1))}}})},Af=e=>e.$ref.split("/").slice(-1)[0],EEe=({schemaObject:e,baseField:t})=>{const n={...t,type:"integer",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},TEe=({schemaObject:e,baseField:t})=>{const n={...t,type:"IntegerPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},kEe=({schemaObject:e,baseField:t})=>{const n=mB(e.item_default)&&Uoe(e.item_default)?e.item_default:0;return{...t,type:"IntegerCollection",default:e.default??[],item_default:n}},PEe=({schemaObject:e,baseField:t})=>{const n={...t,type:"float",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},IEe=({schemaObject:e,baseField:t})=>{const n={...t,type:"FloatPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},REe=({schemaObject:e,baseField:t})=>{const n=mB(e.item_default)?e.item_default:0;return{...t,type:"FloatCollection",default:e.default??[],item_default:n}},OEe=({schemaObject:e,baseField:t})=>{const n={...t,type:"string",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},MEe=({schemaObject:e,baseField:t})=>{const n={...t,type:"StringPolymorphic",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},$Ee=({schemaObject:e,baseField:t})=>{const n=Ck(e.item_default)?e.item_default:"";return{...t,type:"StringCollection",default:e.default??[],item_default:n}},NEe=({schemaObject:e,baseField:t})=>({...t,type:"boolean",default:e.default??!1}),DEe=({schemaObject:e,baseField:t})=>({...t,type:"BooleanPolymorphic",default:e.default??!1}),LEe=({schemaObject:e,baseField:t})=>{const n=e.item_default&&joe(e.item_default)?e.item_default:!1;return{...t,type:"BooleanCollection",default:e.default??[],item_default:n}},FEe=({schemaObject:e,baseField:t})=>({...t,type:"MainModelField",default:e.default??void 0}),BEe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLMainModelField",default:e.default??void 0}),zEe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLRefinerModelField",default:e.default??void 0}),jEe=({schemaObject:e,baseField:t})=>({...t,type:"VaeModelField",default:e.default??void 0}),UEe=({schemaObject:e,baseField:t})=>({...t,type:"LoRAModelField",default:e.default??void 0}),VEe=({schemaObject:e,baseField:t})=>({...t,type:"ControlNetModelField",default:e.default??void 0}),GEe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterModelField",default:e.default??void 0}),qEe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterModelField",default:e.default??void 0}),HEe=({schemaObject:e,baseField:t})=>({...t,type:"BoardField",default:e.default??void 0}),WEe=({schemaObject:e,baseField:t})=>({...t,type:"ImageField",default:e.default??void 0}),KEe=({schemaObject:e,baseField:t})=>({...t,type:"ImagePolymorphic",default:e.default??void 0}),QEe=({schemaObject:e,baseField:t})=>({...t,type:"ImageCollection",default:e.default??[],item_default:e.item_default??void 0}),XEe=({schemaObject:e,baseField:t})=>({...t,type:"DenoiseMaskField",default:e.default??void 0}),YEe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsField",default:e.default??void 0}),ZEe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsPolymorphic",default:e.default??void 0}),JEe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsCollection",default:e.default??[],item_default:e.item_default??void 0}),eTe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningField",default:e.default??void 0}),tTe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningPolymorphic",default:e.default??void 0}),nTe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningCollection",default:e.default??[],item_default:e.item_default??void 0}),rTe=({schemaObject:e,baseField:t})=>({...t,type:"UNetField",default:e.default??void 0}),iTe=({schemaObject:e,baseField:t})=>({...t,type:"ClipField",default:e.default??void 0}),oTe=({schemaObject:e,baseField:t})=>({...t,type:"VaeField",default:e.default??void 0}),aTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlField",default:e.default??void 0}),sTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlPolymorphic",default:e.default??void 0}),lTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlCollection",default:e.default??[],item_default:e.item_default??void 0}),uTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterField",default:e.default??void 0}),cTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterPolymorphic",default:e.default??void 0}),dTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),fTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterField",default:e.default??void 0}),hTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterPolymorphic",default:e.default??void 0}),pTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),gTe=({schemaObject:e,baseField:t})=>{const n=e.enum??[];return{...t,type:"enum",options:n,ui_choice_labels:e.ui_choice_labels,default:e.default??n[0]}},mTe=({baseField:e})=>({...e,type:"Collection",default:[]}),yTe=({baseField:e})=>({...e,type:"CollectionItem",default:void 0}),vTe=({schemaObject:e,baseField:t})=>({...t,type:"ColorField",default:e.default??{r:127,g:127,b:127,a:255}}),bTe=({schemaObject:e,baseField:t})=>({...t,type:"ColorPolymorphic",default:e.default??{r:127,g:127,b:127,a:255}}),_Te=({schemaObject:e,baseField:t})=>({...t,type:"ColorCollection",default:e.default??[]}),STe=({schemaObject:e,baseField:t})=>({...t,type:"Scheduler",default:e.default??"euler"}),oM=e=>{if(e!=null&&e.ui_type)return e.ui_type;if(e.type){if(e.enum)return"enum";if(e.type){if(e.type==="number")return"float";if(e.type==="array"){const t=Xfe(e.items)?e.items.type:Af(e.items);return MSe(t)?I4[t]:void 0}else return e.type}}else if(e.allOf){const t=e.allOf;if(t&&t[0]&&eg(t[0]))return Af(t[0])}else if(e.anyOf){const t=e.anyOf;let n,r;if(iR(t[0])){const i=t[0].items,o=t[1];eg(i)&&eg(o)?(n=Af(i),r=Af(o)):Ov(i)&&Ov(o)&&(n=i.type,r=o.type)}else if(iR(t[1])){const i=t[0],o=t[1].items;eg(i)&&eg(o)?(n=Af(i),r=Af(o)):Ov(i)&&Ov(o)&&(n=i.type,r=o.type)}if(n===r&&NSe(n))return KV[n]}},Sq={BoardField:HEe,boolean:NEe,BooleanCollection:LEe,BooleanPolymorphic:DEe,ClipField:iTe,Collection:mTe,CollectionItem:yTe,ColorCollection:_Te,ColorField:vTe,ColorPolymorphic:bTe,ConditioningCollection:nTe,ConditioningField:eTe,ConditioningPolymorphic:tTe,ControlCollection:lTe,ControlField:aTe,ControlNetModelField:VEe,ControlPolymorphic:sTe,DenoiseMaskField:XEe,enum:gTe,float:PEe,FloatCollection:REe,FloatPolymorphic:IEe,ImageCollection:QEe,ImageField:WEe,ImagePolymorphic:KEe,integer:EEe,IntegerCollection:kEe,IntegerPolymorphic:TEe,IPAdapterCollection:dTe,IPAdapterField:uTe,IPAdapterModelField:GEe,IPAdapterPolymorphic:cTe,LatentsCollection:JEe,LatentsField:YEe,LatentsPolymorphic:ZEe,LoRAModelField:UEe,MainModelField:FEe,Scheduler:STe,SDXLMainModelField:BEe,SDXLRefinerModelField:zEe,string:OEe,StringCollection:$Ee,StringPolymorphic:MEe,T2IAdapterCollection:pTe,T2IAdapterField:fTe,T2IAdapterModelField:qEe,T2IAdapterPolymorphic:hTe,UNetField:rTe,VaeField:oTe,VaeModelField:jEe},xTe=e=>!!(e&&e in Sq),wTe=(e,t,n,r)=>{var f;const{input:i,ui_hidden:o,ui_component:a,ui_type:s,ui_order:l}=t,u={input:Rg.includes(r)?"connection":i,ui_hidden:o,ui_component:a,ui_type:s,required:((f=e.required)==null?void 0:f.includes(n))??!1,ui_order:l},c={name:n,title:t.title??"",description:t.description??"",fieldKind:"input",...u};if(!xTe(r))return;const d=Sq[r];if(d)return d({schemaObject:t,baseField:c})},CTe=["id","type","metadata","use_cache"],ATe=["type"],ETe=["WorkflowField","MetadataField","IsIntermediate"],TTe=["graph","metadata_accumulator"],kTe=(e,t)=>!!(CTe.includes(t)||e==="collect"&&t==="collection"||e==="iterate"&&t==="index"),PTe=e=>!!ETe.includes(e),ITe=(e,t)=>!ATe.includes(t),RTe=e=>!TTe.includes(e.properties.type.default),OTe=(e,t=void 0,n=void 0)=>{var o;return Object.values(((o=e.components)==null?void 0:o.schemas)??{}).filter(Yfe).filter(RTe).filter(a=>t?t.includes(a.properties.type.default):!0).filter(a=>n?!n.includes(a.properties.type.default):!0).reduce((a,s)=>{var v,S;const l=s.properties.type.default,u=s.title.replace("Invocation",""),c=s.tags??[],d=s.description??"",f=s.version,h=fA(s.properties,(w,x,C)=>{if(kTe(l,C))return _e("nodes").trace({node:l,fieldName:C,field:Xt(x)},"Skipped reserved input field"),w;if(!oR(x))return _e("nodes").warn({node:l,propertyName:C,property:Xt(x)},"Unhandled input property"),w;const T=oM(x);if(!rR(T))return _e("nodes").warn({node:l,fieldName:C,fieldType:T,field:Xt(x)},"Skipping unknown input field type"),w;if(PTe(T))return _e("nodes").trace({node:l,fieldName:C,fieldType:T,field:Xt(x)},"Skipping reserved field type"),w;const E=wTe(s,x,C,T);return E?(w[C]=E,w):(_e("nodes").debug({node:l,fieldName:C,fieldType:T,field:Xt(x)},"Skipping input field with no template"),w)},{}),p=s.output.$ref.split("/").pop();if(!p)return _e("nodes").warn({outputRefObject:Xt(s.output)},"No output schema name found in ref object"),a;const m=(S=(v=e.components)==null?void 0:v.schemas)==null?void 0:S[p];if(!m)return _e("nodes").warn({outputSchemaName:p},"Output schema not found"),a;if(!Zfe(m))return _e("nodes").error({outputSchema:Xt(m)},"Invalid output schema"),a;const _=m.properties.type.default,b=fA(m.properties,(w,x,C)=>{if(!ITe(l,C))return _e("nodes").trace({type:l,propertyName:C,property:Xt(x)},"Skipped reserved output field"),w;if(!oR(x))return _e("nodes").warn({type:l,propertyName:C,property:Xt(x)},"Unhandled output property"),w;const T=oM(x);return rR(T)?(w[C]={fieldKind:"output",name:C,title:x.title??"",description:x.description??"",type:T,ui_hidden:x.ui_hidden??!1,ui_type:x.ui_type,ui_order:x.ui_order},w):(_e("nodes").warn({fieldName:C,fieldType:T,field:Xt(x)},"Skipping unknown output field type"),w)},{}),y=s.properties.use_cache.default,g={title:u,type:l,version:f,tags:c,description:d,outputType:_,inputs:h,outputs:b,useCache:y};return Object.assign(a,{[l]:g}),a},{})},MTe=()=>{Me({actionCreator:E0.fulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=_e("system"),i=e.payload;r.debug({schemaJSON:i},"Received OpenAPI schema");const{nodesAllowlist:o,nodesDenylist:a}=n().config,s=OTe(i,o,a);r.debug({nodeTemplates:Xt(s)},`Built ${o2(s)} node templates`),t(iG(s))}}),Me({actionCreator:E0.rejected,effect:e=>{_e("system").error({error:Xt(e.error)},"Problem retrieving OpenAPI Schema")}})},$Te=()=>{Me({actionCreator:kB,effect:(e,{dispatch:t,getState:n})=>{_e("socketio").debug("Connected");const{nodes:i,config:o,system:a}=n(),{disabledTabs:s}=o;!o2(i.nodeTemplates)&&!s.includes("nodes")&&t(E0()),a.isInitialized?t(ps.util.resetApiState()):t(z2e(!0)),t(Tk(e.payload))}})},NTe=()=>{Me({actionCreator:PB,effect:(e,{dispatch:t})=>{_e("socketio").debug("Disconnected"),t(IB(e.payload))}})},DTe=()=>{Me({actionCreator:NB,effect:(e,{dispatch:t})=>{_e("socketio").trace(e.payload,"Generator progress"),t(Rk(e.payload))}})},LTe=()=>{Me({actionCreator:MB,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Session complete"),t($B(e.payload))}})},FTe=["load_image","image"],BTe=()=>{Me({actionCreator:Pk,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("socketio"),{data:i}=e.payload;r.debug({data:Xt(i)},`Invocation complete (${e.payload.data.node.type})`);const{result:o,node:a,queue_batch_id:s}=i;if(fq(o)&&!FTe.includes(a.type)){const{image_name:l}=o.image,{canvas:u,gallery:c}=n(),d=await t(Se.endpoints.getImageDTO.initiate(l)).unwrap();if(u.batchIds.includes(s)&&[ve].includes(i.source_node_id)&&t(aue(d)),!d.is_intermediate){t(Se.util.updateQueryData("listImages",{board_id:d.board_id??"none",categories:ii},h=>{Vn.addOne(h,d)})),t(Lt.util.updateQueryData("getBoardImagesTotal",d.board_id??"none",h=>{h.total+=1})),t(Se.util.invalidateTags([{type:"Board",id:d.board_id??"none"}]));const{shouldAutoSwitch:f}=c;f&&(c.galleryView!=="images"&&t(DA("images")),d.board_id&&d.board_id!==c.selectedBoardId&&t($_({boardId:d.board_id,selectedImageName:d.image_name})),!d.board_id&&c.selectedBoardId!=="none"&&t($_({boardId:"none",selectedImageName:d.image_name})),t(Qs(d)))}}t(Ik(e.payload))}})},zTe=()=>{Me({actionCreator:OB,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(a2(e.payload))}})},jTe=()=>{Me({actionCreator:UB,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(VB(e.payload))}})},UTe=()=>{Me({actionCreator:RB,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(kk(e.payload))}})},VTe=()=>{Me({actionCreator:DB,effect:(e,{dispatch:t})=>{const n=_e("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load started: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(LB(e.payload))}}),Me({actionCreator:FB,effect:(e,{dispatch:t})=>{const n=_e("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load complete: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(BB(e.payload))}})},GTe=()=>{Me({actionCreator:GB,effect:async(e,{dispatch:t})=>{const n=_e("socketio"),{queue_item:r,batch_status:i,queue_status:o}=e.payload.data;n.debug(e.payload,`Queue item ${r.item_id} status updated: ${r.status}`),t(Er.util.updateQueryData("listQueueItems",void 0,a=>{ed.updateOne(a,{id:r.item_id,changes:r})})),t(Er.util.updateQueryData("getQueueStatus",void 0,a=>{a&&Object.assign(a.queue,o)})),t(Er.util.updateQueryData("getBatchStatus",{batch_id:i.batch_id},()=>i)),t(Er.util.updateQueryData("getQueueItem",r.item_id,a=>{a&&Object.assign(a,r)})),t(Er.util.invalidateTags(["CurrentSessionQueueItem","NextSessionQueueItem","InvocationCacheStatus"])),t(s2(e.payload))}})},qTe=()=>{Me({actionCreator:zB,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(jB(e.payload))}})},HTe=()=>{Me({actionCreator:Gae,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Subscribed"),t(qae(e.payload))}})},WTe=()=>{Me({actionCreator:Hae,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Unsubscribed"),t(Wae(e.payload))}})},KTe=()=>{Me({actionCreator:lwe,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTO:r}=e.payload;try{const i=await t(Se.endpoints.changeImageIsIntermediate.initiate({imageDTO:r,is_intermediate:!1})).unwrap(),{autoAddBoardId:o}=n().gallery;o&&o!=="none"&&await t(Se.endpoints.addImageToBoard.initiate({imageDTO:i,board_id:o})),t(qt({title:Z("toast.imageSaved"),status:"success"}))}catch(i){t(qt({title:Z("toast.imageSavingFailed"),description:i==null?void 0:i.message,status:"error"}))}}})},eQe=["sd-1","sd-2","sdxl","sdxl-refiner"],QTe=["sd-1","sd-2","sdxl"],tQe=["sdxl"],nQe=["sd-1","sd-2"],rQe=["sdxl-refiner"],XTe=()=>{Me({actionCreator:yG,effect:async(e,{getState:t,dispatch:n})=>{var i;if(e.payload==="unifiedCanvas"){const o=(i=t().generation.model)==null?void 0:i.base_model;if(o&&["sd-1","sd-2","sdxl"].includes(o))return;try{const a=n(Ts.endpoints.getMainModels.initiate(QTe)),s=await a.unwrap();if(a.unsubscribe(),!s.ids.length){n(zu(null));return}const u=R0.getSelectors().selectAll(s).filter(h=>["sd-1","sd-2","sxdl"].includes(h.base_model))[0];if(!u){n(zu(null));return}const{base_model:c,model_name:d,model_type:f}=u;n(zu({base_model:c,model_name:d,model_type:f}))}catch{n(zu(null))}}}})},YTe=({image_name:e,esrganModelName:t,autoAddBoardId:n})=>{const r={id:m5,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!0},i={id:is,type:"save_image",use_cache:!1,is_intermediate:!1,board:n==="none"?void 0:{board_id:n}};return{id:"adhoc-esrgan-graph",nodes:{[m5]:r,[is]:i},edges:[{source:{node_id:m5,field:"image"},destination:{node_id:is,field:"image"}}]}},ZTe=()=>jz(),xq=Mz;function JTe(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const aM={};function yE(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&aM[t[0]]||(typeof t[0]=="string"&&(aM[t[0]]=new Date),JTe(...t))}const wq=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function sM(e,t,n){e.loadNamespaces(t,wq(e,n))}function lM(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,wq(e,r))}function eke(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=t.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function tke(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(yE("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}):eke(e,t,n)}const nke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,rke={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},ike=e=>rke[e],oke=e=>e.replace(nke,ike);let vE={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:oke};function ake(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vE={...vE,...e}}function ske(){return vE}let Cq;function lke(e){Cq=e}function uke(){return Cq}const cke={type:"3rdParty",init(e){ake(e.options.react),lke(e)}},dke=I.createContext();class fke{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const hke=(e,t)=>{const n=I.useRef();return I.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current};function pke(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=I.useContext(dke)||{},o=n||r||uke();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new fke),!o){yE("You will need to pass in an i18next instance by using initReactI18next");const g=(S,w)=>typeof w=="string"?w:w&&typeof w=="object"&&typeof w.defaultValue=="string"?w.defaultValue:Array.isArray(S)?S[S.length-1]:S,v=[g,{},!1];return v.t=g,v.i18n={},v.ready=!1,v}o.options.react&&o.options.react.wait!==void 0&&yE("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...ske(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let u=e||i||o.options&&o.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(g=>tke(g,o,a));function d(){return o.getFixedT(t.lng||null,a.nsMode==="fallback"?u:u[0],l)}const[f,h]=I.useState(d);let p=u.join();t.lng&&(p=`${t.lng}${p}`);const m=hke(p),_=I.useRef(!0);I.useEffect(()=>{const{bindI18n:g,bindI18nStore:v}=a;_.current=!0,!c&&!s&&(t.lng?lM(o,t.lng,u,()=>{_.current&&h(d)}):sM(o,u,()=>{_.current&&h(d)})),c&&m&&m!==p&&_.current&&h(d);function S(){_.current&&h(d)}return g&&o&&o.on(g,S),v&&o&&o.store.on(v,S),()=>{_.current=!1,g&&o&&g.split(" ").forEach(w=>o.off(w,S)),v&&o&&v.split(" ").forEach(w=>o.store.off(w,S))}},[o,p]);const b=I.useRef(!0);I.useEffect(()=>{_.current&&!b.current&&h(d),b.current=!1},[o,l]);const y=[f,o,c];if(y.t=f,y.i18n=o,y.ready=c,c||!c&&!s)return y;throw new Promise(g=>{t.lng?lM(o,t.lng,u,()=>g()):sM(o,u,()=>g())})}const gke=(e,t)=>{if(!e||!t)return;const{width:n,height:r}=e,i=r*4*n*4,o=r*2*n*2;return{x4:i,x2:o}},mke=(e,t)=>{if(!e||!t)return{x4:!0,x2:!0};const n={x4:!1,x2:!1};return e.x4<=t&&(n.x4=!0),e.x2<=t&&(n.x2=!0),n},yke=(e,t)=>{if(!(!e||!t)&&!(e.x4&&e.x2)){if(!e.x2&&!e.x4)return"parameters.isAllowedToUpscale.tooLarge";if(!e.x4&&e.x2&&t===4)return"parameters.isAllowedToUpscale.useX2Model"}},Aq=e=>Ii(_K,({postprocessing:t,config:n})=>{const{esrganModelName:r}=t,{maxUpscalePixels:i}=n,o=gke(e,i),a=mke(o,i),s=r.includes("x2")?2:4,l=yke(a,s);return{isAllowedToUpscale:s===2?a.x2:a.x4,detailTKey:l}},dx),iQe=e=>{const{t}=pke(),n=I.useMemo(()=>Aq(e),[e]),{isAllowedToUpscale:r,detailTKey:i}=xq(n);return{isAllowedToUpscale:r,detail:i?t(i):void 0}},vke=Ne("upscale/upscaleRequested"),bke=()=>{Me({actionCreator:vke,effect:async(e,{dispatch:t,getState:n})=>{var f;const r=_e("session"),{imageDTO:i}=e.payload,{image_name:o}=i,a=n(),{isAllowedToUpscale:s,detailTKey:l}=Aq(i)(a);if(!s){r.error({imageDTO:i},Z(l??"parameters.isAllowedToUpscale.tooLarge")),t(qt({title:Z(l??"parameters.isAllowedToUpscale.tooLarge"),status:"error"}));return}const{esrganModelName:u}=a.postprocessing,{autoAddBoardId:c}=a.gallery,d=YTe({image_name:o,esrganModelName:u,autoAddBoardId:c});try{const h=t(Er.endpoints.enqueueGraph.initiate({graph:d,prepend:!0},{fixedCacheKey:"enqueueGraph"})),p=await h.unwrap();h.reset(),r.debug({enqueueResult:Xt(p)},Z("queue.graphQueued"))}catch(h){if(r.error({graph:Xt(d)},Z("queue.graphFailedToQueue")),h instanceof Object&&"data"in h&&"status"in h&&h.status===403){const p=((f=h.data)==null?void 0:f.detail)||"Unknown Error";t(qt({title:Z("queue.graphFailedToQueue"),status:"error",description:p,duration:15e3}));return}t(qt({title:Z("queue.graphFailedToQueue"),status:"error"}))}}})},_ke=sl(null),Ske=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,uM=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Ske);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},cM=e=>e==="*"||e==="x"||e==="X",dM=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},xke=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],wke=(e,t)=>{if(cM(e)||cM(t))return 0;const[n,r]=xke(dM(e),dM(t));return n>r?1:n<r?-1:0},fM=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=wke(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0},Cke=(e,t)=>{const n=uM(e),r=uM(t),i=n.pop(),o=r.pop(),a=fM(n,r);return a!==0?a:i&&o?fM(i.split("."),o.split(".")):i||o?i?-1:1:0},Ake=(e,t)=>{const n=Ut(e),{nodes:r,edges:i}=n,o=[],a=r.filter(wA),s=Ek(a,"id");return r.forEach(l=>{if(!wA(l))return;const u=t[l.data.type];if(!u){o.push({message:`${me.t("nodes.node")} "${l.data.type}" ${me.t("nodes.skipped")}`,issues:[`${me.t("nodes.nodeType")}"${l.data.type}" ${me.t("nodes.doesNotExist")}`],data:l});return}if(u.version&&l.data.version&&Cke(u.version,l.data.version)!==0){o.push({message:`${me.t("nodes.node")} "${l.data.type}" ${me.t("nodes.mismatchedVersion")}`,issues:[`${me.t("nodes.node")} "${l.data.type}" v${l.data.version} ${me.t("nodes.maybeIncompatible")} v${u.version}`],data:{node:l,nodeTemplate:Xt(u)}});return}}),i.forEach((l,u)=>{const c=s[l.source],d=s[l.target],f=[];if(c?l.type==="default"&&!(l.sourceHandle in c.data.outputs)&&f.push(`${me.t("nodes.outputNode")} "${l.source}.${l.sourceHandle}" ${me.t("nodes.doesNotExist")}`):f.push(`${me.t("nodes.outputNode")} ${l.source} ${me.t("nodes.doesNotExist")}`),d?l.type==="default"&&!(l.targetHandle in d.data.inputs)&&f.push(`${me.t("nodes.inputField")} "${l.target}.${l.targetHandle}" ${me.t("nodes.doesNotExist")}`):f.push(`${me.t("nodes.inputNode")} ${l.target} ${me.t("nodes.doesNotExist")}`),t[(c==null?void 0:c.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${me.t("nodes.sourceNode")} "${l.source}" ${me.t("nodes.missingTemplate")} "${c==null?void 0:c.data.type}"`),t[(d==null?void 0:d.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${me.t("nodes.sourceNode")}"${l.target}" ${me.t("nodes.missingTemplate")} "${d==null?void 0:d.data.type}"`),f.length){delete i[u];const h=l.type==="default"?l.sourceHandle:l.source,p=l.type==="default"?l.targetHandle:l.target;o.push({message:`Edge "${h} -> ${p}" skipped`,issues:f,data:l})}}),{workflow:n,errors:o}},Eke=()=>{Me({actionCreator:jxe,effect:(e,{dispatch:t,getState:n})=>{const r=_e("nodes"),i=e.payload,o=n().nodes.nodeTemplates,{workflow:a,errors:s}=Ake(i,o);t(O2e(a)),s.length?(t(qt(Vd({title:Z("toast.loadedWithWarnings"),status:"warning"}))),s.forEach(({message:l,...u})=>{r.warn(u,l)})):t(qt(Vd({title:Z("toast.workflowLoaded"),status:"success"}))),t(yG("nodes")),requestAnimationFrame(()=>{var l;(l=_ke.get())==null||l.fitView()})}})};function Tke(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function kke(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Pke=function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(kke(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Tke(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Bi="-ms-",Z_="-moz-",ln="-webkit-",Eq="comm",nP="rule",rP="decl",Ike="@import",Tq="@keyframes",Rke="@layer",Oke=Math.abs,cw=String.fromCharCode,Mke=Object.assign;function $ke(e,t){return Ti(e,0)^45?(((t<<2^Ti(e,0))<<2^Ti(e,1))<<2^Ti(e,2))<<2^Ti(e,3):0}function kq(e){return e.trim()}function Nke(e,t){return(e=t.exec(e))?e[0]:e}function un(e,t,n){return e.replace(t,n)}function bE(e,t){return e.indexOf(t)}function Ti(e,t){return e.charCodeAt(t)|0}function O0(e,t,n){return e.slice(t,n)}function Ms(e){return e.length}function iP(e){return e.length}function i1(e,t){return t.push(e),e}function Dke(e,t){return e.map(t).join("")}var dw=1,fp=1,Pq=0,Do=0,Lr=0,Dp="";function fw(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:dw,column:fp,length:a,return:""}}function fg(e,t){return Mke(fw("",null,null,"",null,null,0),e,{length:-e.length},t)}function Lke(){return Lr}function Fke(){return Lr=Do>0?Ti(Dp,--Do):0,fp--,Lr===10&&(fp=1,dw--),Lr}function Jo(){return Lr=Do<Pq?Ti(Dp,Do++):0,fp++,Lr===10&&(fp=1,dw++),Lr}function Ys(){return Ti(Dp,Do)}function nb(){return Do}function Fy(e,t){return O0(Dp,e,t)}function M0(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Iq(e){return dw=fp=1,Pq=Ms(Dp=e),Do=0,[]}function Rq(e){return Dp="",e}function rb(e){return kq(Fy(Do-1,_E(e===91?e+2:e===40?e+1:e)))}function Bke(e){for(;(Lr=Ys())&&Lr<33;)Jo();return M0(e)>2||M0(Lr)>3?"":" "}function zke(e,t){for(;--t&&Jo()&&!(Lr<48||Lr>102||Lr>57&&Lr<65||Lr>70&&Lr<97););return Fy(e,nb()+(t<6&&Ys()==32&&Jo()==32))}function _E(e){for(;Jo();)switch(Lr){case e:return Do;case 34:case 39:e!==34&&e!==39&&_E(Lr);break;case 40:e===41&&_E(e);break;case 92:Jo();break}return Do}function jke(e,t){for(;Jo()&&e+Lr!==47+10;)if(e+Lr===42+42&&Ys()===47)break;return"/*"+Fy(t,Do-1)+"*"+cw(e===47?e:Jo())}function Uke(e){for(;!M0(Ys());)Jo();return Fy(e,Do)}function Vke(e){return Rq(ib("",null,null,null,[""],e=Iq(e),0,[0],e))}function ib(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,d=a,f=0,h=0,p=0,m=1,_=1,b=1,y=0,g="",v=i,S=o,w=r,x=g;_;)switch(p=y,y=Jo()){case 40:if(p!=108&&Ti(x,d-1)==58){bE(x+=un(rb(y),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=rb(y);break;case 9:case 10:case 13:case 32:x+=Bke(p);break;case 92:x+=zke(nb()-1,7);continue;case 47:switch(Ys()){case 42:case 47:i1(Gke(jke(Jo(),nb()),t,n),l);break;default:x+="/"}break;case 123*m:s[u++]=Ms(x)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+c:b==-1&&(x=un(x,/\f/g,"")),h>0&&Ms(x)-d&&i1(h>32?pM(x+";",r,n,d-1):pM(un(x," ","")+";",r,n,d-2),l);break;case 59:x+=";";default:if(i1(w=hM(x,t,n,u,c,i,s,g,v=[],S=[],d),o),y===123)if(c===0)ib(x,t,w,w,v,o,d,s,S);else switch(f===99&&Ti(x,3)===110?100:f){case 100:case 108:case 109:case 115:ib(e,w,w,r&&i1(hM(e,w,w,0,0,i,s,g,i,v=[],d),S),i,S,d,s,r?v:S);break;default:ib(x,w,w,w,[""],S,0,s,S)}}u=c=h=0,m=b=1,g=x="",d=a;break;case 58:d=1+Ms(x),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&Fke()==125)continue}switch(x+=cw(y),y*m){case 38:b=c>0?1:(x+="\f",-1);break;case 44:s[u++]=(Ms(x)-1)*b,b=1;break;case 64:Ys()===45&&(x+=rb(Jo())),f=Ys(),c=d=Ms(g=x+=Uke(nb())),y++;break;case 45:p===45&&Ms(x)==2&&(m=0)}}return o}function hM(e,t,n,r,i,o,a,s,l,u,c){for(var d=i-1,f=i===0?o:[""],h=iP(f),p=0,m=0,_=0;p<r;++p)for(var b=0,y=O0(e,d+1,d=Oke(m=a[p])),g=e;b<h;++b)(g=kq(m>0?f[b]+" "+y:un(y,/&\f/g,f[b])))&&(l[_++]=g);return fw(e,t,n,i===0?nP:s,l,u,c)}function Gke(e,t,n){return fw(e,t,n,Eq,cw(Lke()),O0(e,2,-2),0)}function pM(e,t,n,r){return fw(e,t,n,rP,O0(e,0,r),O0(e,r+1,-1),r)}function Th(e,t){for(var n="",r=iP(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function qke(e,t,n,r){switch(e.type){case Rke:if(e.children.length)break;case Ike:case rP:return e.return=e.return||e.value;case Eq:return"";case Tq:return e.return=e.value+"{"+Th(e.children,r)+"}";case nP:e.value=e.props.join(",")}return Ms(n=Th(e.children,r))?e.return=e.value+"{"+n+"}":""}function Hke(e){var t=iP(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function Wke(e){return function(t){t.root||(t=t.return)&&e(t)}}var gM=function(t){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var i=t(r);return n.set(r,i),i}};function Oq(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Kke=function(t,n,r){for(var i=0,o=0;i=o,o=Ys(),i===38&&o===12&&(n[r]=1),!M0(o);)Jo();return Fy(t,Do)},Qke=function(t,n){var r=-1,i=44;do switch(M0(i)){case 0:i===38&&Ys()===12&&(n[r]=1),t[r]+=Kke(Do-1,n,r);break;case 2:t[r]+=rb(i);break;case 4:if(i===44){t[++r]=Ys()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=cw(i)}while(i=Jo());return t},Xke=function(t,n){return Rq(Qke(Iq(t),n))},mM=new WeakMap,Yke=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!mM.get(r))&&!i){mM.set(t,!0);for(var o=[],a=Xke(n,o),s=r.props,l=0,u=0;l<a.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=o[l]?a[l].replace(/&\f/g,s[c]):s[c]+" "+a[l]}}},Zke=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Mq(e,t){switch($ke(e,t)){case 5103:return ln+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ln+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ln+e+Z_+e+Bi+e+e;case 6828:case 4268:return ln+e+Bi+e+e;case 6165:return ln+e+Bi+"flex-"+e+e;case 5187:return ln+e+un(e,/(\w+).+(:[^]+)/,ln+"box-$1$2"+Bi+"flex-$1$2")+e;case 5443:return ln+e+Bi+"flex-item-"+un(e,/flex-|-self/,"")+e;case 4675:return ln+e+Bi+"flex-line-pack"+un(e,/align-content|flex-|-self/,"")+e;case 5548:return ln+e+Bi+un(e,"shrink","negative")+e;case 5292:return ln+e+Bi+un(e,"basis","preferred-size")+e;case 6060:return ln+"box-"+un(e,"-grow","")+ln+e+Bi+un(e,"grow","positive")+e;case 4554:return ln+un(e,/([^-])(transform)/g,"$1"+ln+"$2")+e;case 6187:return un(un(un(e,/(zoom-|grab)/,ln+"$1"),/(image-set)/,ln+"$1"),e,"")+e;case 5495:case 3959:return un(e,/(image-set\([^]*)/,ln+"$1$`$1");case 4968:return un(un(e,/(.+:)(flex-)?(.*)/,ln+"box-pack:$3"+Bi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ln+e+e;case 4095:case 3583:case 4068:case 2532:return un(e,/(.+)-inline(.+)/,ln+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ms(e)-1-t>6)switch(Ti(e,t+1)){case 109:if(Ti(e,t+4)!==45)break;case 102:return un(e,/(.+:)(.+)-([^]+)/,"$1"+ln+"$2-$3$1"+Z_+(Ti(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~bE(e,"stretch")?Mq(un(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ti(e,t+1)!==115)break;case 6444:switch(Ti(e,Ms(e)-3-(~bE(e,"!important")&&10))){case 107:return un(e,":",":"+ln)+e;case 101:return un(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ln+(Ti(e,14)===45?"inline-":"")+"box$3$1"+ln+"$2$3$1"+Bi+"$2box$3")+e}break;case 5936:switch(Ti(e,t+11)){case 114:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ln+e+Bi+e+e}return e}var Jke=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case rP:t.return=Mq(t.value,t.length);break;case Tq:return Th([fg(t,{value:un(t.value,"@","@"+ln)})],i);case nP:if(t.length)return Dke(t.props,function(o){switch(Nke(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Th([fg(t,{props:[un(o,/:(read-\w+)/,":"+Z_+"$1")]})],i);case"::placeholder":return Th([fg(t,{props:[un(o,/:(plac\w+)/,":"+ln+"input-$1")]}),fg(t,{props:[un(o,/:(plac\w+)/,":"+Z_+"$1")]}),fg(t,{props:[un(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},e4e=[Jke],t4e=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||e4e,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),b=1;b<_.length;b++)o[_[b]]=!0;s.push(m)});var l,u=[Yke,Zke];{var c,d=[qke,Wke(function(m){c.insert(m)})],f=Hke(u.concat(i,d)),h=function(_){return Th(Vke(_),f)};l=function(_,b,y,g){c=y,h(_?_+"{"+b.styles+"}":b.styles),g&&(p.inserted[b.name]=!0)}}var p={key:n,sheet:new Pke({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(s),p},n4e=!0;function r4e(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var $q=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||n4e===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Nq=function(t,n,r){$q(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function i4e(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var o4e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},a4e=/[A-Z]|^ms/g,s4e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Dq=function(t){return t.charCodeAt(1)===45},yM=function(t){return t!=null&&typeof t!="boolean"},v5=Oq(function(e){return Dq(e)?e:e.replace(a4e,"-$&").toLowerCase()}),vM=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(s4e,function(r,i,o){return $s={name:i,styles:o,next:$s},i})}return o4e[t]!==1&&!Dq(t)&&typeof n=="number"&&n!==0?n+"px":n};function $0(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return $s={name:n.name,styles:n.styles,next:$s},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)$s={name:r.name,styles:r.styles,next:$s},r=r.next;var i=n.styles+";";return i}return l4e(e,t,n)}case"function":{if(e!==void 0){var o=$s,a=n(e);return $s=o,$0(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function l4e(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=$0(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object")t!=null&&t[a]!==void 0?r+=o+"{"+t[a]+"}":yM(a)&&(r+=v5(o)+":"+vM(o,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var s=0;s<a.length;s++)yM(a[s])&&(r+=v5(o)+":"+vM(o,a[s])+";");else{var l=$0(e,t,a);switch(o){case"animation":case"animationName":{r+=v5(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var bM=/label:\s*([^\s;\n{]+)\s*(;|$)/g,$s,oP=function(t,n,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,o="";$s=void 0;var a=t[0];a==null||a.raw===void 0?(i=!1,o+=$0(r,n,a)):o+=a[0];for(var s=1;s<t.length;s++)o+=$0(r,n,t[s]),i&&(o+=a[s]);bM.lastIndex=0;for(var l="",u;(u=bM.exec(o))!==null;)l+="-"+u[1];var c=i4e(o)+l;return{name:c,styles:o,next:$s}},u4e=function(t){return t()},Lq=i6["useInsertionEffect"]?i6["useInsertionEffect"]:!1,c4e=Lq||u4e,_M=Lq||I.useLayoutEffect,Fq=I.createContext(typeof HTMLElement<"u"?t4e({key:"css"}):null);Fq.Provider;var Bq=function(t){return I.forwardRef(function(n,r){var i=I.useContext(Fq);return t(n,i,r)})},N0=I.createContext({}),d4e=function(t,n){if(typeof n=="function"){var r=n(t);return r}return S_({},t,n)},f4e=gM(function(e){return gM(function(t){return d4e(e,t)})}),h4e=function(t){var n=I.useContext(N0);return t.theme!==n&&(n=f4e(n)(t.theme)),I.createElement(N0.Provider,{value:n},t.children)},zq=Bq(function(e,t){var n=e.styles,r=oP([n],void 0,I.useContext(N0)),i=I.useRef();return _M(function(){var o=t.key+"-global",a=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[t]),_M(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(r.next!==void 0&&Nq(t,r.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}t.insert("",r,a,!1)},[t,r.name]),null});function p4e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return oP(t)}var g4e=function(){var t=p4e.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function m4e(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function By(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:a}=e,s=I.createContext(a);s.displayName=t;function l(){var u;const c=I.useContext(s);if(!c&&n){const d=new Error(o??m4e(r,i));throw d.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,d,l),d}return c}return[s.Provider,l,s]}var[y4e,v4e]=By({strict:!1,name:"PortalManagerContext"});function b4e(e){const{children:t,zIndex:n}=e;return W.jsx(y4e,{value:{zIndex:n},children:t})}b4e.displayName="PortalManager";var J_=globalThis!=null&&globalThis.document?I.useLayoutEffect:I.useEffect,[jq,_4e]=By({strict:!1,name:"PortalContext"}),aP="chakra-portal",S4e=".chakra-portal",x4e=e=>W.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),w4e=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=I.useState(null),o=I.useRef(null),[,a]=I.useState({});I.useEffect(()=>a({}),[]);const s=_4e(),l=v4e();J_(()=>{if(!r)return;const c=r.ownerDocument,d=t?s??c.body:c.body;if(!d)return;o.current=c.createElement("div"),o.current.className=aP,d.appendChild(o.current),a({});const f=o.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?W.jsx(x4e,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?Wo.createPortal(W.jsx(jq,{value:o.current,children:u}),o.current):W.jsx("span",{ref:c=>{c&&i(c)}})},C4e=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=I.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=aP),l},[i]),[,s]=I.useState({});return J_(()=>s({}),[]),J_(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Wo.createPortal(W.jsx(jq,{value:r?a:null,children:t}),a):null};function hw(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?W.jsx(C4e,{containerRef:n,...r}):W.jsx(w4e,{...r})}hw.className=aP;hw.selector=S4e;hw.displayName="Portal";function Uq(){const e=I.useContext(N0);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}var sP=I.createContext({});sP.displayName="ColorModeContext";function pw(){const e=I.useContext(sP);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function oQe(e,t){const{colorMode:n}=pw();return n==="dark"?t:e}function A4e(){const e=pw(),t=Uq();return{...e,theme:t}}function E4e(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function T4e(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function aQe(e,t,n){const r=Uq();return k4e(e,t,n)(r)}function k4e(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{var c,d;if(e==="breakpoints")return E4e(o,l,(c=a[u])!=null?c:l);const f=`${e}.${l}`;return T4e(o,f,(d=a[u])!=null?d:l)});return Array.isArray(t)?s:s[0]}}var Dc=(...e)=>e.filter(Boolean).join(" ");function P4e(){return!1}function Zs(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var sQe=e=>{const{condition:t,message:n}=e;t&&P4e()&&console.warn(n)};function Us(e,...t){return I4e(e)?e(...t):e}var I4e=e=>typeof e=="function",lQe=e=>e?"":void 0,uQe=e=>e?!0:void 0;function cQe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function dQe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var eS={exports:{}};eS.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",b="[object Null]",y="[object Object]",g="[object Proxy]",v="[object RegExp]",S="[object Set]",w="[object String]",x="[object Undefined]",C="[object WeakMap]",T="[object ArrayBuffer]",E="[object DataView]",P="[object Float32Array]",N="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",k="[object Int32Array]",D="[object Uint8Array]",L="[object Uint8ClampedArray]",M="[object Uint16Array]",R="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,G={};G[P]=G[N]=G[O]=G[A]=G[k]=G[D]=G[L]=G[M]=G[R]=!0,G[s]=G[l]=G[T]=G[c]=G[E]=G[d]=G[f]=G[h]=G[m]=G[_]=G[y]=G[v]=G[S]=G[w]=G[C]=!1;var Y=typeof yt=="object"&&yt&&yt.Object===Object&&yt,ee=typeof self=="object"&&self&&self.Object===Object&&self,J=Y||ee||Function("return this")(),j=t&&!t.nodeType&&t,Q=j&&!0&&e&&!e.nodeType&&e,ne=Q&&Q.exports===j,se=ne&&Y.process,be=function(){try{var F=Q&&Q.require&&Q.require("util").types;return F||se&&se.binding&&se.binding("util")}catch{}}(),ce=be&&be.isTypedArray;function bt(F,V,X){switch(X.length){case 0:return F.call(V);case 1:return F.call(V,X[0]);case 2:return F.call(V,X[0],X[1]);case 3:return F.call(V,X[0],X[1],X[2])}return F.apply(V,X)}function ot(F,V){for(var X=-1,pe=Array(F);++X<F;)pe[X]=V(X);return pe}function ze(F){return function(V){return F(V)}}function mt(F,V){return F==null?void 0:F[V]}function Ie(F,V){return function(X){return F(V(X))}}var en=Array.prototype,Ir=Function.prototype,Dn=Object.prototype,Tn=J["__core-js_shared__"],tn=Ir.toString,Ln=Dn.hasOwnProperty,Rr=function(){var F=/[^.]+$/.exec(Tn&&Tn.keys&&Tn.keys.IE_PROTO||"");return F?"Symbol(src)_1."+F:""}(),mo=Dn.toString,Jr=tn.call(Object),pr=RegExp("^"+tn.call(Ln).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zr=ne?J.Buffer:void 0,ei=J.Symbol,Fn=J.Uint8Array,_n=zr?zr.allocUnsafe:void 0,Mi=Ie(Object.getPrototypeOf,Object),gi=Object.create,Xi=Dn.propertyIsEnumerable,Ua=en.splice,Or=ei?ei.toStringTag:void 0,yo=function(){try{var F=ir(Object,"defineProperty");return F({},"",{}),F}catch{}}(),dl=zr?zr.isBuffer:void 0,Fo=Math.max,fl=Date.now,Bn=ir(J,"Map"),nn=ir(Object,"create"),jr=function(){function F(){}return function(V){if(!Qe(V))return{};if(gi)return gi(V);F.prototype=V;var X=new F;return F.prototype=void 0,X}}();function Mr(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function $r(){this.__data__=nn?nn(null):{},this.size=0}function ti(F){var V=this.has(F)&&delete this.__data__[F];return this.size-=V?1:0,V}function $i(F){var V=this.__data__;if(nn){var X=V[F];return X===r?void 0:X}return Ln.call(V,F)?V[F]:void 0}function vo(F){var V=this.__data__;return nn?V[F]!==void 0:Ln.call(V,F)}function mi(F,V){var X=this.__data__;return this.size+=this.has(F)?0:1,X[F]=nn&&V===void 0?r:V,this}Mr.prototype.clear=$r,Mr.prototype.delete=ti,Mr.prototype.get=$i,Mr.prototype.has=vo,Mr.prototype.set=mi;function Ur(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function Va(){this.__data__=[],this.size=0}function bs(F){var V=this.__data__,X=Ye(V,F);if(X<0)return!1;var pe=V.length-1;return X==pe?V.pop():Ua.call(V,X,1),--this.size,!0}function yi(F){var V=this.__data__,X=Ye(V,F);return X<0?void 0:V[X][1]}function cu(F){return Ye(this.__data__,F)>-1}function ua(F,V){var X=this.__data__,pe=Ye(X,F);return pe<0?(++this.size,X.push([F,V])):X[pe][1]=V,this}Ur.prototype.clear=Va,Ur.prototype.delete=bs,Ur.prototype.get=yi,Ur.prototype.has=cu,Ur.prototype.set=ua;function ni(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function hl(){this.size=0,this.__data__={hash:new Mr,map:new(Bn||Ur),string:new Mr}}function H(F){var V=rn(this,F).delete(F);return this.size-=V?1:0,V}function te(F){return rn(this,F).get(F)}function re(F){return rn(this,F).has(F)}function de(F,V){var X=rn(this,F),pe=X.size;return X.set(F,V),this.size+=X.size==pe?0:1,this}ni.prototype.clear=hl,ni.prototype.delete=H,ni.prototype.get=te,ni.prototype.has=re,ni.prototype.set=de;function oe(F){var V=this.__data__=new Ur(F);this.size=V.size}function je(){this.__data__=new Ur,this.size=0}function Ge(F){var V=this.__data__,X=V.delete(F);return this.size=V.size,X}function ut(F){return this.__data__.get(F)}function De(F){return this.__data__.has(F)}function qe(F,V){var X=this.__data__;if(X instanceof Ur){var pe=X.__data__;if(!Bn||pe.length<n-1)return pe.push([F,V]),this.size=++X.size,this;X=this.__data__=new ni(pe)}return X.set(F,V),this.size=X.size,this}oe.prototype.clear=je,oe.prototype.delete=Ge,oe.prototype.get=ut,oe.prototype.has=De,oe.prototype.set=qe;function Re(F,V){var X=ue(F),pe=!X&&Ce(F),Ct=!X&&!pe&&ge(F),pn=!X&&!pe&&!Ct&&jt(F),Pn=X||pe||Ct||pn,It=Pn?ot(F.length,String):[],wn=It.length;for(var _i in F)(V||Ln.call(F,_i))&&!(Pn&&(_i=="length"||Ct&&(_i=="offset"||_i=="parent")||pn&&(_i=="buffer"||_i=="byteLength"||_i=="byteOffset")||Sn(_i,wn)))&&It.push(_i);return It}function ie(F,V,X){(X!==void 0&&!Ve(F[V],X)||X===void 0&&!(V in F))&&Ze(F,V,X)}function xe(F,V,X){var pe=F[V];(!(Ln.call(F,V)&&Ve(pe,X))||X===void 0&&!(V in F))&&Ze(F,V,X)}function Ye(F,V){for(var X=F.length;X--;)if(Ve(F[X][0],V))return X;return-1}function Ze(F,V,X){V=="__proto__"&&yo?yo(F,V,{configurable:!0,enumerable:!0,value:X,writable:!0}):F[V]=X}var ct=hn();function ft(F){return F==null?F===void 0?x:b:Or&&Or in Object(F)?xr(F):we(F)}function _t(F){return Pe(F)&&ft(F)==s}function wt(F){if(!Qe(F)||xn(F))return!1;var V=Ae(F)?pr:B;return V.test(ht(F))}function Et(F){return Pe(F)&&et(F.length)&&!!G[ft(F)]}function dn(F){if(!Qe(F))return mn(F);var V=on(F),X=[];for(var pe in F)pe=="constructor"&&(V||!Ln.call(F,pe))||X.push(pe);return X}function fn(F,V,X,pe,Ct){F!==V&&ct(V,function(pn,Pn){if(Ct||(Ct=new oe),Qe(pn))Ni(F,V,Pn,X,fn,pe,Ct);else{var It=pe?pe(Ue(F,Pn),pn,Pn+"",F,V,Ct):void 0;It===void 0&&(It=pn),ie(F,Pn,It)}},or)}function Ni(F,V,X,pe,Ct,pn,Pn){var It=Ue(F,X),wn=Ue(V,X),_i=Pn.get(wn);if(_i){ie(F,X,_i);return}var Xn=pn?pn(It,wn,X+"",F,V,Pn):void 0,du=Xn===void 0;if(du){var lf=ue(wn),fu=!lf&&ge(wn),uf=!lf&&!fu&&jt(wn);Xn=wn,lf||fu||uf?ue(It)?Xn=It:fe(It)?Xn=bo(It):fu?(du=!1,Xn=Sr(wn,!0)):uf?(du=!1,Xn=Qn(wn,!0)):Xn=[]:Tt(wn)||Ce(wn)?(Xn=It,Ce(It)?Xn=Gt(It):(!Qe(It)||Ae(It))&&(Xn=bi(wn))):du=!1}du&&(Pn.set(wn,Xn),Ct(Xn,wn,pe,pn,Pn),Pn.delete(wn)),ie(F,X,Xn)}function Bo(F,V){return ke(Je(F,V,kn),F+"")}var Di=yo?function(F,V){return yo(F,"toString",{configurable:!0,enumerable:!1,value:zn(V),writable:!0})}:kn;function Sr(F,V){if(V)return F.slice();var X=F.length,pe=_n?_n(X):new F.constructor(X);return F.copy(pe),pe}function vi(F){var V=new F.constructor(F.byteLength);return new Fn(V).set(new Fn(F)),V}function Qn(F,V){var X=V?vi(F.buffer):F.buffer;return new F.constructor(X,F.byteOffset,F.length)}function bo(F,V){var X=-1,pe=F.length;for(V||(V=Array(pe));++X<pe;)V[X]=F[X];return V}function Ga(F,V,X,pe){var Ct=!X;X||(X={});for(var pn=-1,Pn=V.length;++pn<Pn;){var It=V[pn],wn=pe?pe(X[It],F[It],It,X,F):void 0;wn===void 0&&(wn=F[It]),Ct?Ze(X,It,wn):xe(X,It,wn)}return X}function it(F){return Bo(function(V,X){var pe=-1,Ct=X.length,pn=Ct>1?X[Ct-1]:void 0,Pn=Ct>2?X[2]:void 0;for(pn=F.length>3&&typeof pn=="function"?(Ct--,pn):void 0,Pn&&Mt(X[0],X[1],Pn)&&(pn=Ct<3?void 0:pn,Ct=1),V=Object(V);++pe<Ct;){var It=X[pe];It&&F(V,It,pe,pn)}return V})}function hn(F){return function(V,X,pe){for(var Ct=-1,pn=Object(V),Pn=pe(V),It=Pn.length;It--;){var wn=Pn[F?It:++Ct];if(X(pn[wn],wn,pn)===!1)break}return V}}function rn(F,V){var X=F.__data__;return Wt(V)?X[typeof V=="string"?"string":"hash"]:X.map}function ir(F,V){var X=mt(F,V);return wt(X)?X:void 0}function xr(F){var V=Ln.call(F,Or),X=F[Or];try{F[Or]=void 0;var pe=!0}catch{}var Ct=mo.call(F);return pe&&(V?F[Or]=X:delete F[Or]),Ct}function bi(F){return typeof F.constructor=="function"&&!on(F)?jr(Mi(F)):{}}function Sn(F,V){var X=typeof F;return V=V??a,!!V&&(X=="number"||X!="symbol"&&U.test(F))&&F>-1&&F%1==0&&F<V}function Mt(F,V,X){if(!Qe(X))return!1;var pe=typeof V;return(pe=="number"?Te(X)&&Sn(V,X.length):pe=="string"&&V in X)?Ve(X[V],F):!1}function Wt(F){var V=typeof F;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?F!=="__proto__":F===null}function xn(F){return!!Rr&&Rr in F}function on(F){var V=F&&F.constructor,X=typeof V=="function"&&V.prototype||Dn;return F===X}function mn(F){var V=[];if(F!=null)for(var X in Object(F))V.push(X);return V}function we(F){return mo.call(F)}function Je(F,V,X){return V=Fo(V===void 0?F.length-1:V,0),function(){for(var pe=arguments,Ct=-1,pn=Fo(pe.length-V,0),Pn=Array(pn);++Ct<pn;)Pn[Ct]=pe[V+Ct];Ct=-1;for(var It=Array(V+1);++Ct<V;)It[Ct]=pe[Ct];return It[V]=X(Pn),bt(F,this,It)}}function Ue(F,V){if(!(V==="constructor"&&typeof F[V]=="function")&&V!="__proto__")return F[V]}var ke=He(Di);function He(F){var V=0,X=0;return function(){var pe=fl(),Ct=o-(pe-X);if(X=pe,Ct>0){if(++V>=i)return arguments[0]}else V=0;return F.apply(void 0,arguments)}}function ht(F){if(F!=null){try{return tn.call(F)}catch{}try{return F+""}catch{}}return""}function Ve(F,V){return F===V||F!==F&&V!==V}var Ce=_t(function(){return arguments}())?_t:function(F){return Pe(F)&&Ln.call(F,"callee")&&!Xi.call(F,"callee")},ue=Array.isArray;function Te(F){return F!=null&&et(F.length)&&!Ae(F)}function fe(F){return Pe(F)&&Te(F)}var ge=dl||Yi;function Ae(F){if(!Qe(F))return!1;var V=ft(F);return V==h||V==p||V==u||V==g}function et(F){return typeof F=="number"&&F>-1&&F%1==0&&F<=a}function Qe(F){var V=typeof F;return F!=null&&(V=="object"||V=="function")}function Pe(F){return F!=null&&typeof F=="object"}function Tt(F){if(!Pe(F)||ft(F)!=y)return!1;var V=Mi(F);if(V===null)return!0;var X=Ln.call(V,"constructor")&&V.constructor;return typeof X=="function"&&X instanceof X&&tn.call(X)==Jr}var jt=ce?ze(ce):Et;function Gt(F){return Ga(F,or(F))}function or(F){return Te(F)?Re(F,!0):dn(F)}var gr=it(function(F,V,X,pe){fn(F,V,X,pe)});function zn(F){return function(){return F}}function kn(F){return F}function Yi(){return!1}e.exports=gr})(eS,eS.exports);var R4e=eS.exports;const Vs=Sc(R4e);var O4e=e=>/!(important)?$/.test(e),SM=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,M4e=(e,t)=>n=>{const r=String(t),i=O4e(r),o=SM(r),a=e?`${e}.${o}`:o;let s=Zs(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=SM(s),i?`${s} !important`:s};function lP(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var s;const l=M4e(t,o)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var o1=(...e)=>t=>e.reduce((n,r)=>r(n),t);function ha(e,t){return n=>{const r={property:n,scale:e};return r.transform=lP({scale:e,transform:t}),r}}var $4e=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function N4e(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:$4e(t),transform:n?lP({scale:n,compose:r}):r}}var Vq=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function D4e(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Vq].join(" ")}function L4e(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Vq].join(" ")}var F4e={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},B4e={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function z4e(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var j4e={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},SE={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},U4e=new Set(Object.values(SE)),xE=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),V4e=e=>e.trim();function G4e(e,t){if(e==null||xE.has(e))return e;if(!(wE(e)||xE.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],a=i==null?void 0:i[2];if(!o||!a)return e;const s=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=a.split(",").map(V4e).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in SE?SE[l]:l;u.unshift(c);const d=u.map(f=>{if(U4e.has(f))return f;const h=f.indexOf(" "),[p,m]=h!==-1?[f.substr(0,h),f.substr(h+1)]:[f],_=wE(m)?m:m&&m.split(" "),b=`colors.${p}`,y=b in t.__cssMap?t.__cssMap[b].varRef:p;return _?[y,...Array.isArray(_)?_:[_]].join(" "):y});return`${s}(${d.join(", ")})`}var wE=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),q4e=(e,t)=>G4e(e,t??{});function H4e(e){return/^var\(--.+\)$/.test(e)}var W4e=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},As=e=>t=>`${e}(${t})`,Qt={filter(e){return e!=="auto"?e:F4e},backdropFilter(e){return e!=="auto"?e:B4e},ring(e){return z4e(Qt.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?D4e():e==="auto-gpu"?L4e():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=W4e(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(H4e(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:q4e,blur:As("blur"),opacity:As("opacity"),brightness:As("brightness"),contrast:As("contrast"),dropShadow:As("drop-shadow"),grayscale:As("grayscale"),hueRotate:As("hue-rotate"),invert:As("invert"),saturate:As("saturate"),sepia:As("sepia"),bgImage(e){return e==null||wE(e)||xE.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=j4e[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},q={borderWidths:ha("borderWidths"),borderStyles:ha("borderStyles"),colors:ha("colors"),borders:ha("borders"),gradients:ha("gradients",Qt.gradient),radii:ha("radii",Qt.px),space:ha("space",o1(Qt.vh,Qt.px)),spaceT:ha("space",o1(Qt.vh,Qt.px)),degreeT(e){return{property:e,transform:Qt.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:lP({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:ha("sizes",o1(Qt.vh,Qt.px)),sizesT:ha("sizes",o1(Qt.vh,Qt.fraction)),shadows:ha("shadows"),logical:N4e,blur:ha("blur",Qt.blur)},ob={background:q.colors("background"),backgroundColor:q.colors("backgroundColor"),backgroundImage:q.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Qt.bgClip},bgSize:q.prop("backgroundSize"),bgPosition:q.prop("backgroundPosition"),bg:q.colors("background"),bgColor:q.colors("backgroundColor"),bgPos:q.prop("backgroundPosition"),bgRepeat:q.prop("backgroundRepeat"),bgAttachment:q.prop("backgroundAttachment"),bgGradient:q.gradients("backgroundImage"),bgClip:{transform:Qt.bgClip}};Object.assign(ob,{bgImage:ob.backgroundImage,bgImg:ob.backgroundImage});var sn={border:q.borders("border"),borderWidth:q.borderWidths("borderWidth"),borderStyle:q.borderStyles("borderStyle"),borderColor:q.colors("borderColor"),borderRadius:q.radii("borderRadius"),borderTop:q.borders("borderTop"),borderBlockStart:q.borders("borderBlockStart"),borderTopLeftRadius:q.radii("borderTopLeftRadius"),borderStartStartRadius:q.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:q.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:q.radii("borderTopRightRadius"),borderStartEndRadius:q.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:q.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:q.borders("borderRight"),borderInlineEnd:q.borders("borderInlineEnd"),borderBottom:q.borders("borderBottom"),borderBlockEnd:q.borders("borderBlockEnd"),borderBottomLeftRadius:q.radii("borderBottomLeftRadius"),borderBottomRightRadius:q.radii("borderBottomRightRadius"),borderLeft:q.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:q.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:q.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:q.borders(["borderLeft","borderRight"]),borderInline:q.borders("borderInline"),borderY:q.borders(["borderTop","borderBottom"]),borderBlock:q.borders("borderBlock"),borderTopWidth:q.borderWidths("borderTopWidth"),borderBlockStartWidth:q.borderWidths("borderBlockStartWidth"),borderTopColor:q.colors("borderTopColor"),borderBlockStartColor:q.colors("borderBlockStartColor"),borderTopStyle:q.borderStyles("borderTopStyle"),borderBlockStartStyle:q.borderStyles("borderBlockStartStyle"),borderBottomWidth:q.borderWidths("borderBottomWidth"),borderBlockEndWidth:q.borderWidths("borderBlockEndWidth"),borderBottomColor:q.colors("borderBottomColor"),borderBlockEndColor:q.colors("borderBlockEndColor"),borderBottomStyle:q.borderStyles("borderBottomStyle"),borderBlockEndStyle:q.borderStyles("borderBlockEndStyle"),borderLeftWidth:q.borderWidths("borderLeftWidth"),borderInlineStartWidth:q.borderWidths("borderInlineStartWidth"),borderLeftColor:q.colors("borderLeftColor"),borderInlineStartColor:q.colors("borderInlineStartColor"),borderLeftStyle:q.borderStyles("borderLeftStyle"),borderInlineStartStyle:q.borderStyles("borderInlineStartStyle"),borderRightWidth:q.borderWidths("borderRightWidth"),borderInlineEndWidth:q.borderWidths("borderInlineEndWidth"),borderRightColor:q.colors("borderRightColor"),borderInlineEndColor:q.colors("borderInlineEndColor"),borderRightStyle:q.borderStyles("borderRightStyle"),borderInlineEndStyle:q.borderStyles("borderInlineEndStyle"),borderTopRadius:q.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:q.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:q.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:q.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(sn,{rounded:sn.borderRadius,roundedTop:sn.borderTopRadius,roundedTopLeft:sn.borderTopLeftRadius,roundedTopRight:sn.borderTopRightRadius,roundedTopStart:sn.borderStartStartRadius,roundedTopEnd:sn.borderStartEndRadius,roundedBottom:sn.borderBottomRadius,roundedBottomLeft:sn.borderBottomLeftRadius,roundedBottomRight:sn.borderBottomRightRadius,roundedBottomStart:sn.borderEndStartRadius,roundedBottomEnd:sn.borderEndEndRadius,roundedLeft:sn.borderLeftRadius,roundedRight:sn.borderRightRadius,roundedStart:sn.borderInlineStartRadius,roundedEnd:sn.borderInlineEndRadius,borderStart:sn.borderInlineStart,borderEnd:sn.borderInlineEnd,borderTopStartRadius:sn.borderStartStartRadius,borderTopEndRadius:sn.borderStartEndRadius,borderBottomStartRadius:sn.borderEndStartRadius,borderBottomEndRadius:sn.borderEndEndRadius,borderStartRadius:sn.borderInlineStartRadius,borderEndRadius:sn.borderInlineEndRadius,borderStartWidth:sn.borderInlineStartWidth,borderEndWidth:sn.borderInlineEndWidth,borderStartColor:sn.borderInlineStartColor,borderEndColor:sn.borderInlineEndColor,borderStartStyle:sn.borderInlineStartStyle,borderEndStyle:sn.borderInlineEndStyle});var K4e={color:q.colors("color"),textColor:q.colors("color"),fill:q.colors("fill"),stroke:q.colors("stroke")},CE={boxShadow:q.shadows("boxShadow"),mixBlendMode:!0,blendMode:q.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:q.prop("backgroundBlendMode"),opacity:!0};Object.assign(CE,{shadow:CE.boxShadow});var Q4e={filter:{transform:Qt.filter},blur:q.blur("--chakra-blur"),brightness:q.propT("--chakra-brightness",Qt.brightness),contrast:q.propT("--chakra-contrast",Qt.contrast),hueRotate:q.degreeT("--chakra-hue-rotate"),invert:q.propT("--chakra-invert",Qt.invert),saturate:q.propT("--chakra-saturate",Qt.saturate),dropShadow:q.propT("--chakra-drop-shadow",Qt.dropShadow),backdropFilter:{transform:Qt.backdropFilter},backdropBlur:q.blur("--chakra-backdrop-blur"),backdropBrightness:q.propT("--chakra-backdrop-brightness",Qt.brightness),backdropContrast:q.propT("--chakra-backdrop-contrast",Qt.contrast),backdropHueRotate:q.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:q.propT("--chakra-backdrop-invert",Qt.invert),backdropSaturate:q.propT("--chakra-backdrop-saturate",Qt.saturate)},tS={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Qt.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:q.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:q.space("gap"),rowGap:q.space("rowGap"),columnGap:q.space("columnGap")};Object.assign(tS,{flexDir:tS.flexDirection});var Gq={gridGap:q.space("gridGap"),gridColumnGap:q.space("gridColumnGap"),gridRowGap:q.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},X4e={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Qt.outline},outlineOffset:!0,outlineColor:q.colors("outlineColor")},ma={width:q.sizesT("width"),inlineSize:q.sizesT("inlineSize"),height:q.sizes("height"),blockSize:q.sizes("blockSize"),boxSize:q.sizes(["width","height"]),minWidth:q.sizes("minWidth"),minInlineSize:q.sizes("minInlineSize"),minHeight:q.sizes("minHeight"),minBlockSize:q.sizes("minBlockSize"),maxWidth:q.sizes("maxWidth"),maxInlineSize:q.sizes("maxInlineSize"),maxHeight:q.sizes("maxHeight"),maxBlockSize:q.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (min-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?i:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (max-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?i:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:q.propT("float",Qt.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(ma,{w:ma.width,h:ma.height,minW:ma.minWidth,maxW:ma.maxWidth,minH:ma.minHeight,maxH:ma.maxHeight,overscroll:ma.overscrollBehavior,overscrollX:ma.overscrollBehaviorX,overscrollY:ma.overscrollBehaviorY});var Y4e={listStyleType:!0,listStylePosition:!0,listStylePos:q.prop("listStylePosition"),listStyleImage:!0,listStyleImg:q.prop("listStyleImage")};function Z4e(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var J4e=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},ePe=J4e(Z4e),tPe={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},nPe={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},b5=(e,t,n)=>{const r={},i=ePe(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},rPe={srOnly:{transform(e){return e===!0?tPe:e==="focusable"?nPe:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>b5(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>b5(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>b5(t,e,n)}},im={position:!0,pos:q.prop("position"),zIndex:q.prop("zIndex","zIndices"),inset:q.spaceT("inset"),insetX:q.spaceT(["left","right"]),insetInline:q.spaceT("insetInline"),insetY:q.spaceT(["top","bottom"]),insetBlock:q.spaceT("insetBlock"),top:q.spaceT("top"),insetBlockStart:q.spaceT("insetBlockStart"),bottom:q.spaceT("bottom"),insetBlockEnd:q.spaceT("insetBlockEnd"),left:q.spaceT("left"),insetInlineStart:q.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:q.spaceT("right"),insetInlineEnd:q.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(im,{insetStart:im.insetInlineStart,insetEnd:im.insetInlineEnd});var iPe={ring:{transform:Qt.ring},ringColor:q.colors("--chakra-ring-color"),ringOffset:q.prop("--chakra-ring-offset-width"),ringOffsetColor:q.colors("--chakra-ring-offset-color"),ringInset:q.prop("--chakra-ring-inset")},Un={margin:q.spaceT("margin"),marginTop:q.spaceT("marginTop"),marginBlockStart:q.spaceT("marginBlockStart"),marginRight:q.spaceT("marginRight"),marginInlineEnd:q.spaceT("marginInlineEnd"),marginBottom:q.spaceT("marginBottom"),marginBlockEnd:q.spaceT("marginBlockEnd"),marginLeft:q.spaceT("marginLeft"),marginInlineStart:q.spaceT("marginInlineStart"),marginX:q.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:q.spaceT("marginInline"),marginY:q.spaceT(["marginTop","marginBottom"]),marginBlock:q.spaceT("marginBlock"),padding:q.space("padding"),paddingTop:q.space("paddingTop"),paddingBlockStart:q.space("paddingBlockStart"),paddingRight:q.space("paddingRight"),paddingBottom:q.space("paddingBottom"),paddingBlockEnd:q.space("paddingBlockEnd"),paddingLeft:q.space("paddingLeft"),paddingInlineStart:q.space("paddingInlineStart"),paddingInlineEnd:q.space("paddingInlineEnd"),paddingX:q.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:q.space("paddingInline"),paddingY:q.space(["paddingTop","paddingBottom"]),paddingBlock:q.space("paddingBlock")};Object.assign(Un,{m:Un.margin,mt:Un.marginTop,mr:Un.marginRight,me:Un.marginInlineEnd,marginEnd:Un.marginInlineEnd,mb:Un.marginBottom,ml:Un.marginLeft,ms:Un.marginInlineStart,marginStart:Un.marginInlineStart,mx:Un.marginX,my:Un.marginY,p:Un.padding,pt:Un.paddingTop,py:Un.paddingY,px:Un.paddingX,pb:Un.paddingBottom,pl:Un.paddingLeft,ps:Un.paddingInlineStart,paddingStart:Un.paddingInlineStart,pr:Un.paddingRight,pe:Un.paddingInlineEnd,paddingEnd:Un.paddingInlineEnd});var oPe={textDecorationColor:q.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:q.shadows("textShadow")},aPe={clipPath:!0,transform:q.propT("transform",Qt.transform),transformOrigin:!0,translateX:q.spaceT("--chakra-translate-x"),translateY:q.spaceT("--chakra-translate-y"),skewX:q.degreeT("--chakra-skew-x"),skewY:q.degreeT("--chakra-skew-y"),scaleX:q.prop("--chakra-scale-x"),scaleY:q.prop("--chakra-scale-y"),scale:q.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:q.degreeT("--chakra-rotate")},sPe={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:q.prop("transitionDuration","transition.duration"),transitionProperty:q.prop("transitionProperty","transition.property"),transitionTimingFunction:q.prop("transitionTimingFunction","transition.easing")},lPe={fontFamily:q.prop("fontFamily","fonts"),fontSize:q.prop("fontSize","fontSizes",Qt.px),fontWeight:q.prop("fontWeight","fontWeights"),lineHeight:q.prop("lineHeight","lineHeights"),letterSpacing:q.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},uPe={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:q.spaceT("scrollMargin"),scrollMarginTop:q.spaceT("scrollMarginTop"),scrollMarginBottom:q.spaceT("scrollMarginBottom"),scrollMarginLeft:q.spaceT("scrollMarginLeft"),scrollMarginRight:q.spaceT("scrollMarginRight"),scrollMarginX:q.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:q.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:q.spaceT("scrollPadding"),scrollPaddingTop:q.spaceT("scrollPaddingTop"),scrollPaddingBottom:q.spaceT("scrollPaddingBottom"),scrollPaddingLeft:q.spaceT("scrollPaddingLeft"),scrollPaddingRight:q.spaceT("scrollPaddingRight"),scrollPaddingX:q.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:q.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function qq(e){return Zs(e)&&e.reference?e.reference:String(e)}var gw=(e,...t)=>t.map(qq).join(` ${e} `).replace(/calc/g,""),xM=(...e)=>`calc(${gw("+",...e)})`,wM=(...e)=>`calc(${gw("-",...e)})`,AE=(...e)=>`calc(${gw("*",...e)})`,CM=(...e)=>`calc(${gw("/",...e)})`,AM=e=>{const t=qq(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:AE(t,-1)},nd=Object.assign(e=>({add:(...t)=>nd(xM(e,...t)),subtract:(...t)=>nd(wM(e,...t)),multiply:(...t)=>nd(AE(e,...t)),divide:(...t)=>nd(CM(e,...t)),negate:()=>nd(AM(e)),toString:()=>e.toString()}),{add:xM,subtract:wM,multiply:AE,divide:CM,negate:AM});function cPe(e,t="-"){return e.replace(/\s+/g,t)}function dPe(e){const t=cPe(e.toString());return hPe(fPe(t))}function fPe(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function hPe(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function pPe(e,t=""){return[t,e].filter(Boolean).join("-")}function gPe(e,t){return`var(${e}${t?`, ${t}`:""})`}function mPe(e,t=""){return dPe(`--${pPe(e,t)}`)}function nt(e,t,n){const r=mPe(e,n);return{variable:r,reference:gPe(r,t)}}function yPe(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=nt(`${e}-${i}`,o);continue}n[r]=nt(`${e}-${r}`)}return n}function vPe(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function bPe(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function EE(e){if(e==null)return e;const{unitless:t}=bPe(e);return t||typeof e=="number"?`${e}px`:e}var Hq=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,uP=e=>Object.fromEntries(Object.entries(e).sort(Hq));function EM(e){const t=uP(e);return Object.assign(Object.values(t),t)}function _Pe(e){const t=Object.keys(uP(e));return new Set(t)}function TM(e){var t;if(!e)return e;e=(t=EE(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function Mg(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${EE(e)})`),t&&n.push("and",`(max-width: ${EE(t)})`),n.join(" ")}function SPe(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=EM(e),r=Object.entries(e).sort(Hq).map(([a,s],l,u)=>{var c;let[,d]=(c=u[l+1])!=null?c:[];return d=parseFloat(d)>0?TM(d):void 0,{_minW:TM(s),breakpoint:a,minW:s,maxW:d,maxWQuery:Mg(null,d),minWQuery:Mg(s),minMaxQuery:Mg(s,d)}}),i=_Pe(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>i.has(l))},asObject:uP(e),asArray:EM(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>Mg(a)).slice(1)],toArrayValue(a){if(!Zs(a))throw new Error("toArrayValue: value must be an object");const s=o.map(l=>{var u;return(u=a[l])!=null?u:null});for(;vPe(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=o[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var Si={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},vu=e=>Wq(t=>e(t,"&"),"[role=group]","[data-group]",".group"),vl=e=>Wq(t=>e(t,"~ &"),"[data-peer]",".peer"),Wq=(e,...t)=>t.map(e).join(", "),mw={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:vu(Si.hover),_peerHover:vl(Si.hover),_groupFocus:vu(Si.focus),_peerFocus:vl(Si.focus),_groupFocusVisible:vu(Si.focusVisible),_peerFocusVisible:vl(Si.focusVisible),_groupActive:vu(Si.active),_peerActive:vl(Si.active),_groupDisabled:vu(Si.disabled),_peerDisabled:vl(Si.disabled),_groupInvalid:vu(Si.invalid),_peerInvalid:vl(Si.invalid),_groupChecked:vu(Si.checked),_peerChecked:vl(Si.checked),_groupFocusWithin:vu(Si.focusWithin),_peerFocusWithin:vl(Si.focusWithin),_peerPlaceholderShown:vl(Si.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},Kq=Object.keys(mw);function kM(e,t){return nt(String(e).replace(/\./g,"-"),void 0,t)}function xPe(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=kM(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const f=i.split("."),[h,...p]=f,m=`${h}.-${p.join(".")}`,_=nd.negate(s),b=nd.negate(u);r[m]={value:_,var:l,varRef:b}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const c=f=>{const p=[String(i).split(".")[0],f].join(".");if(!e[p])return f;const{reference:_}=kM(p,t==null?void 0:t.cssVarPrefix);return _},d=Zs(s)?s:{default:s};n=Vs(n,Object.entries(d).reduce((f,[h,p])=>{var m,_;if(!p)return f;const b=c(`${p}`);if(h==="default")return f[l]=b,f;const y=(_=(m=mw)==null?void 0:m[h])!=null?_:h;return f[y]={[l]:b},f},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function wPe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function CPe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function APe(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function PM(e,t,n={}){const{stop:r,getKey:i}=n;function o(a,s=[]){var l;if(APe(a)||Array.isArray(a)){const u={};for(const[c,d]of Object.entries(a)){const f=(l=i==null?void 0:i(c))!=null?l:c,h=[...s,f];if(r!=null&&r(a,h))return t(a,s);u[f]=o(d,h)}return u}return t(a,s)}return o(e)}var EPe=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function TPe(e){return CPe(e,EPe)}function kPe(e){return e.semanticTokens}function PPe(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var IPe=e=>Kq.includes(e)||e==="default";function RPe({tokens:e,semanticTokens:t}){const n={};return PM(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),PM(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(IPe)}),n}function OPe(e){var t;const n=PPe(e),r=TPe(n),i=kPe(n),o=RPe({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=xPe(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:SPe(n.breakpoints)}),n}var cP=Vs({},ob,sn,K4e,tS,ma,Q4e,iPe,X4e,Gq,rPe,im,CE,Un,uPe,lPe,oPe,aPe,Y4e,sPe),MPe=Object.assign({},Un,ma,tS,Gq,im),fQe=Object.keys(MPe),$Pe=[...Object.keys(cP),...Kq],NPe={...cP,...mw},DPe=e=>e in NPe,LPe=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=Us(e[a],t);if(s==null)continue;if(s=Zs(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;u<l;u+=1){const c=i==null?void 0:i[u];if(!c){o[a]=s[u];continue}o[c]=o[c]||{},s[u]!=null&&(o[c][a]=s[u])}}return o};function FPe(e){const t=[];let n="",r=!1;for(let i=0;i<e.length;i++){const o=e[i];o==="("?(r=!0,n+=o):o===")"?(r=!1,n+=o):o===","&&!r?(t.push(n),n=""):n+=o}return n=n.trim(),n&&t.push(n),t}function BPe(e){return/^var\(--.+\)$/.test(e)}var zPe=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!BPe(t),jPe=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[a,s]=FPe(t);return t=(r=(n=i(a))!=null?n:o(s))!=null?r:o(t),t};function UPe(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s,l,u;const c=Us(o,r),d=LPe(c)(r);let f={};for(let h in d){const p=d[h];let m=Us(p,r);h in n&&(h=n[h]),zPe(h,m)&&(m=jPe(r,m));let _=t[h];if(_===!0&&(_={property:h}),Zs(m)){f[h]=(s=f[h])!=null?s:{},f[h]=Vs({},f[h],i(m,!0));continue}let b=(u=(l=_==null?void 0:_.transform)==null?void 0:l.call(_,m,r,c))!=null?u:m;b=_!=null&&_.processResult?i(b,!0):b;const y=Us(_==null?void 0:_.property,r);if(!a&&(_!=null&&_.static)){const g=Us(_.static,r);f=Vs({},f,g)}if(y&&Array.isArray(y)){for(const g of y)f[g]=b;continue}if(y){y==="&"&&Zs(b)?f=Vs({},f,b):f[y]=b;continue}if(Zs(b)){f=Vs({},f,b);continue}f[h]=b}return f};return i}var Qq=e=>t=>UPe({theme:t,pseudos:mw,configs:cP})(e);function Pt(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function VPe(e,t){if(Array.isArray(e))return e;if(Zs(e))return t(e);if(e!=null)return[e]}function GPe(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function qPe(e){const t=e.__breakpoints;return function(r,i,o,a){var s,l;if(!t)return;const u={},c=VPe(o,t.toArrayValue);if(!c)return u;const d=c.length,f=d===1,h=!!r.parts;for(let p=0;p<d;p++){const m=t.details[p],_=t.details[GPe(c,p)],b=Mg(m.minW,_==null?void 0:_._minW),y=Us((s=r[i])==null?void 0:s[c[p]],a);if(y){if(h){(l=r.parts)==null||l.forEach(g=>{Vs(u,{[g]:f?y[g]:{[b]:y[g]}})});continue}if(!h){f?Vs(u,y):u[b]=y;continue}u[b]=y}}return u}}function HPe(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,a=qPe(o);return Vs({},Us((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",i,t),a(e,"variants",r,t))}}function hQe(e,t,n){var r,i,o;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function zy(e){return wPe(e,["styleConfig","size","variant","colorScheme"])}var WPe={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},KPe={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},QPe={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},XPe={property:WPe,easing:KPe,duration:QPe},YPe=XPe,ZPe={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},JPe=ZPe,e6e={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},t6e=e6e,n6e={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},r6e=n6e,i6e={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},o6e=i6e,a6e={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},s6e=a6e,l6e={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},u6e=l6e,c6e={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},d6e=c6e,f6e={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},Xq=f6e,Yq={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},h6e={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},p6e={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},g6e={...Yq,...h6e,container:p6e},Zq=g6e,m6e={breakpoints:r6e,zIndices:JPe,radii:s6e,blur:d6e,colors:o6e,...Xq,sizes:Zq,shadows:u6e,space:Yq,borders:t6e,transition:YPe},{defineMultiStyleConfig:y6e,definePartsStyle:$g}=Pt(["stepper","step","title","description","indicator","separator","icon","number"]),Rl=nt("stepper-indicator-size"),Wf=nt("stepper-icon-size"),Kf=nt("stepper-title-font-size"),Ng=nt("stepper-description-font-size"),hg=nt("stepper-accent-color"),v6e=$g(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[hg.variable]:`colors.${e}.500`,_dark:{[hg.variable]:`colors.${e}.200`}},title:{fontSize:Kf.reference,fontWeight:"medium"},description:{fontSize:Ng.reference,color:"chakra-subtle-text"},number:{fontSize:Kf.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Wf.reference,height:Wf.reference},indicator:{flexShrink:0,borderRadius:"full",width:Rl.reference,height:Rl.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:hg.reference},"&[data-status=complete]":{bg:hg.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:hg.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Rl.reference} - 8px)`,top:`calc(${Rl.reference} + 4px)`,insetStart:`calc(${Rl.reference} / 2 - 1px)`}}})),b6e=y6e({baseStyle:v6e,sizes:{xs:$g({stepper:{[Rl.variable]:"sizes.4",[Wf.variable]:"sizes.3",[Kf.variable]:"fontSizes.xs",[Ng.variable]:"fontSizes.xs"}}),sm:$g({stepper:{[Rl.variable]:"sizes.6",[Wf.variable]:"sizes.4",[Kf.variable]:"fontSizes.sm",[Ng.variable]:"fontSizes.xs"}}),md:$g({stepper:{[Rl.variable]:"sizes.8",[Wf.variable]:"sizes.5",[Kf.variable]:"fontSizes.md",[Ng.variable]:"fontSizes.sm"}}),lg:$g({stepper:{[Rl.variable]:"sizes.10",[Wf.variable]:"sizes.6",[Kf.variable]:"fontSizes.lg",[Ng.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function gn(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)t[d]=l(d);return gn(e,t)}function o(...c){for(const d of c)d in t||(t[d]=l(d));return gn(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(c){const h=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>c}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Jq=gn("accordion").parts("root","container","button","panel").extend("icon"),_6e=gn("alert").parts("title","description","container").extend("icon","spinner"),S6e=gn("avatar").parts("label","badge","container").extend("excessLabel","group"),x6e=gn("breadcrumb").parts("link","item","container").extend("separator");gn("button").parts();var eH=gn("checkbox").parts("control","icon","container").extend("label");gn("progress").parts("track","filledTrack").extend("label");var w6e=gn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),tH=gn("editable").parts("preview","input","textarea"),C6e=gn("form").parts("container","requiredIndicator","helperText"),A6e=gn("formError").parts("text","icon"),nH=gn("input").parts("addon","field","element","group"),E6e=gn("list").parts("container","item","icon"),rH=gn("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),iH=gn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),oH=gn("numberinput").parts("root","field","stepperGroup","stepper");gn("pininput").parts("field");var aH=gn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),sH=gn("progress").parts("label","filledTrack","track"),T6e=gn("radio").parts("container","control","label"),lH=gn("select").parts("field","icon"),uH=gn("slider").parts("container","track","thumb","filledTrack","mark"),k6e=gn("stat").parts("container","label","helpText","number","icon"),cH=gn("switch").parts("container","track","thumb"),P6e=gn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),dH=gn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),I6e=gn("tag").parts("container","label","closeButton"),R6e=gn("card").parts("container","header","body","footer");function pd(e,t,n){return Math.min(Math.max(e,n),t)}class O6e extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Dg=O6e;function dP(e){if(typeof e!="string")throw new Dg(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=z6e.test(e)?N6e(e):e;const n=D6e.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(D0(s,2),16)),parseInt(D0(a[3]||"f",2),16)/255]}const r=L6e.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const i=F6e.exec(t);if(i){const a=Array.from(i).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const o=B6e.exec(t);if(o){const[a,s,l,u]=Array.from(o).slice(1).map(parseFloat);if(pd(0,100,s)!==s)throw new Dg(e);if(pd(0,100,l)!==l)throw new Dg(e);return[...j6e(a,s,l),Number.isNaN(u)?1:u]}throw new Dg(e)}function M6e(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const IM=e=>parseInt(e.replace(/_/g,""),36),$6e="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=IM(t.substring(0,3)),r=IM(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function N6e(e){const t=e.toLowerCase().trim(),n=$6e[M6e(t)];if(!n)throw new Dg(e);return`#${n}`}const D0=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),D6e=new RegExp(`^#${D0("([a-f0-9])",3)}([a-f0-9])?$`,"i"),L6e=new RegExp(`^#${D0("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),F6e=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${D0(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),B6e=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,z6e=/^[a-z]+$/i,RM=e=>Math.round(e*255),j6e=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(RM);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),a=o*(1-Math.abs(i%2-1));let s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);const c=r-o/2,d=s+c,f=l+c,h=u+c;return[d,f,h].map(RM)};function U6e(e,t,n,r){return`rgba(${pd(0,255,e).toFixed()}, ${pd(0,255,t).toFixed()}, ${pd(0,255,n).toFixed()}, ${parseFloat(pd(0,1,r).toFixed(3))})`}function V6e(e,t){const[n,r,i,o]=dP(e);return U6e(n,r,i,o-t)}function G6e(e){const[t,n,r,i]=dP(e);let o=a=>{const s=pd(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}function q6e(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var H6e=e=>Object.keys(e).length===0,ao=(e,t,n)=>{const r=q6e(e,`colors.${t}`,t);try{return G6e(r),r}catch{return n??"#000000"}},W6e=e=>{const[t,n,r]=dP(e);return(t*299+n*587+r*114)/1e3},K6e=e=>t=>{const n=ao(t,e);return W6e(n)<128?"dark":"light"},Q6e=e=>t=>K6e(e)(t)==="dark",hp=(e,t)=>n=>{const r=ao(n,e);return V6e(r,1-t)};function OM(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient(
+    45deg,
+    ${t} 25%,
+    transparent 25%,
+    transparent 50%,
+    ${t} 50%,
+    ${t} 75%,
+    transparent 75%,
+    transparent
+  )`,backgroundSize:`${e} ${e}`}}var X6e=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function Y6e(e){const t=X6e();return!e||H6e(e)?t:e.string&&e.colors?J6e(e.string,e.colors):e.string&&!e.colors?Z6e(e.string):e.colors&&!e.string?e8e(e.colors):t}function Z6e(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t),t=t&t;let n="#";for(let r=0;r<3;r+=1){const i=t>>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function J6e(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;r<e.length;r+=1)n=e.charCodeAt(r)+((n<<5)-n),n=n&n;return n=(n%t.length+t.length)%t.length,t[n]}function e8e(e){return e[Math.floor(Math.random()*e.length)]}function K(e,t){return n=>n.colorMode==="dark"?t:e}function fP(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function fH(e){return Zs(e)&&e.reference?e.reference:String(e)}var yw=(e,...t)=>t.map(fH).join(` ${e} `).replace(/calc/g,""),MM=(...e)=>`calc(${yw("+",...e)})`,$M=(...e)=>`calc(${yw("-",...e)})`,TE=(...e)=>`calc(${yw("*",...e)})`,NM=(...e)=>`calc(${yw("/",...e)})`,DM=e=>{const t=fH(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:TE(t,-1)},Ol=Object.assign(e=>({add:(...t)=>Ol(MM(e,...t)),subtract:(...t)=>Ol($M(e,...t)),multiply:(...t)=>Ol(TE(e,...t)),divide:(...t)=>Ol(NM(e,...t)),negate:()=>Ol(DM(e)),toString:()=>e.toString()}),{add:MM,subtract:$M,multiply:TE,divide:NM,negate:DM});function t8e(e){return!Number.isInteger(parseFloat(e.toString()))}function n8e(e,t="-"){return e.replace(/\s+/g,t)}function hH(e){const t=n8e(e.toString());return t.includes("\\.")?e:t8e(e)?t.replace(".","\\."):e}function r8e(e,t=""){return[t,hH(e)].filter(Boolean).join("-")}function i8e(e,t){return`var(${hH(e)}${t?`, ${t}`:""})`}function o8e(e,t=""){return`--${r8e(e,t)}`}function hr(e,t){const n=o8e(e,t==null?void 0:t.prefix);return{variable:n,reference:i8e(n,a8e(t==null?void 0:t.fallback))}}function a8e(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:s8e,definePartsStyle:ab}=Pt(cH.keys),om=hr("switch-track-width"),Ad=hr("switch-track-height"),_5=hr("switch-track-diff"),l8e=Ol.subtract(om,Ad),kE=hr("switch-thumb-x"),pg=hr("switch-bg"),u8e=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[om.reference],height:[Ad.reference],transitionProperty:"common",transitionDuration:"fast",[pg.variable]:"colors.gray.300",_dark:{[pg.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[pg.variable]:`colors.${t}.500`,_dark:{[pg.variable]:`colors.${t}.200`}},bg:pg.reference}},c8e={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Ad.reference],height:[Ad.reference],_checked:{transform:`translateX(${kE.reference})`}},d8e=ab(e=>({container:{[_5.variable]:l8e,[kE.variable]:_5.reference,_rtl:{[kE.variable]:Ol(_5).negate().toString()}},track:u8e(e),thumb:c8e})),f8e={sm:ab({container:{[om.variable]:"1.375rem",[Ad.variable]:"sizes.3"}}),md:ab({container:{[om.variable]:"1.875rem",[Ad.variable]:"sizes.4"}}),lg:ab({container:{[om.variable]:"2.875rem",[Ad.variable]:"sizes.6"}})},h8e=s8e({baseStyle:d8e,sizes:f8e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:p8e,definePartsStyle:kh}=Pt(P6e.keys),g8e=kh({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),nS={"&[data-is-numeric=true]":{textAlign:"end"}},m8e=kh(e=>{const{colorScheme:t}=e;return{th:{color:K("gray.600","gray.400")(e),borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...nS},td:{borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...nS},caption:{color:K("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),y8e=kh(e=>{const{colorScheme:t}=e;return{th:{color:K("gray.600","gray.400")(e),borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...nS},td:{borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...nS},caption:{color:K("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e)},td:{background:K(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),v8e={simple:m8e,striped:y8e,unstyled:{}},b8e={sm:kh({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:kh({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:kh({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},_8e=p8e({baseStyle:g8e,variants:v8e,sizes:b8e,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Co=nt("tabs-color"),ns=nt("tabs-bg"),a1=nt("tabs-border-color"),{defineMultiStyleConfig:S8e,definePartsStyle:Js}=Pt(dH.keys),x8e=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},w8e=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},C8e=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},A8e={p:4},E8e=Js(e=>({root:x8e(e),tab:w8e(e),tablist:C8e(e),tabpanel:A8e})),T8e={sm:Js({tab:{py:1,px:4,fontSize:"sm"}}),md:Js({tab:{fontSize:"md",py:2,px:4}}),lg:Js({tab:{fontSize:"lg",py:3,px:4}})},k8e=Js(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=r?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Co.variable]:`colors.${t}.600`,_dark:{[Co.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[ns.variable]:"colors.gray.200",_dark:{[ns.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Co.reference,bg:ns.reference}}}),P8e=Js(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[a1.variable]:"transparent",_selected:{[Co.variable]:`colors.${t}.600`,[a1.variable]:"colors.white",_dark:{[Co.variable]:`colors.${t}.300`,[a1.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:a1.reference},color:Co.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),I8e=Js(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[ns.variable]:"colors.gray.50",_dark:{[ns.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[ns.variable]:"colors.white",[Co.variable]:`colors.${t}.600`,_dark:{[ns.variable]:"colors.gray.800",[Co.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Co.reference,bg:ns.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),R8e=Js(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ao(n,`${t}.700`),bg:ao(n,`${t}.100`)}}}}),O8e=Js(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Co.variable]:"colors.gray.600",_dark:{[Co.variable]:"inherit"},_selected:{[Co.variable]:"colors.white",[ns.variable]:`colors.${t}.600`,_dark:{[Co.variable]:"colors.gray.800",[ns.variable]:`colors.${t}.300`}},color:Co.reference,bg:ns.reference}}}),M8e=Js({}),$8e={line:k8e,enclosed:P8e,"enclosed-colored":I8e,"soft-rounded":R8e,"solid-rounded":O8e,unstyled:M8e},N8e=S8e({baseStyle:E8e,sizes:T8e,variants:$8e,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Tr=yPe("badge",["bg","color","shadow"]),D8e={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Tr.bg.reference,color:Tr.color.reference,boxShadow:Tr.shadow.reference},L8e=e=>{const{colorScheme:t,theme:n}=e,r=hp(`${t}.500`,.6)(n);return{[Tr.bg.variable]:`colors.${t}.500`,[Tr.color.variable]:"colors.white",_dark:{[Tr.bg.variable]:r,[Tr.color.variable]:"colors.whiteAlpha.800"}}},F8e=e=>{const{colorScheme:t,theme:n}=e,r=hp(`${t}.200`,.16)(n);return{[Tr.bg.variable]:`colors.${t}.100`,[Tr.color.variable]:`colors.${t}.800`,_dark:{[Tr.bg.variable]:r,[Tr.color.variable]:`colors.${t}.200`}}},B8e=e=>{const{colorScheme:t,theme:n}=e,r=hp(`${t}.200`,.8)(n);return{[Tr.color.variable]:`colors.${t}.500`,_dark:{[Tr.color.variable]:r},[Tr.shadow.variable]:`inset 0 0 0px 1px ${Tr.color.reference}`}},z8e={solid:L8e,subtle:F8e,outline:B8e},am={baseStyle:D8e,variants:z8e,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:j8e,definePartsStyle:Ed}=Pt(I6e.keys),LM=nt("tag-bg"),FM=nt("tag-color"),S5=nt("tag-shadow"),sb=nt("tag-min-height"),lb=nt("tag-min-width"),ub=nt("tag-font-size"),cb=nt("tag-padding-inline"),U8e={fontWeight:"medium",lineHeight:1.2,outline:0,[FM.variable]:Tr.color.reference,[LM.variable]:Tr.bg.reference,[S5.variable]:Tr.shadow.reference,color:FM.reference,bg:LM.reference,boxShadow:S5.reference,borderRadius:"md",minH:sb.reference,minW:lb.reference,fontSize:ub.reference,px:cb.reference,_focusVisible:{[S5.variable]:"shadows.outline"}},V8e={lineHeight:1.2,overflow:"visible"},G8e={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},q8e=Ed({container:U8e,label:V8e,closeButton:G8e}),H8e={sm:Ed({container:{[sb.variable]:"sizes.5",[lb.variable]:"sizes.5",[ub.variable]:"fontSizes.xs",[cb.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Ed({container:{[sb.variable]:"sizes.6",[lb.variable]:"sizes.6",[ub.variable]:"fontSizes.sm",[cb.variable]:"space.2"}}),lg:Ed({container:{[sb.variable]:"sizes.8",[lb.variable]:"sizes.8",[ub.variable]:"fontSizes.md",[cb.variable]:"space.3"}})},W8e={subtle:Ed(e=>{var t;return{container:(t=am.variants)==null?void 0:t.subtle(e)}}),solid:Ed(e=>{var t;return{container:(t=am.variants)==null?void 0:t.solid(e)}}),outline:Ed(e=>{var t;return{container:(t=am.variants)==null?void 0:t.outline(e)}})},K8e=j8e({variants:W8e,baseStyle:q8e,sizes:H8e,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Dl,defineMultiStyleConfig:Q8e}=Pt(nH.keys),Qf=nt("input-height"),Xf=nt("input-font-size"),Yf=nt("input-padding"),Zf=nt("input-border-radius"),X8e=Dl({addon:{height:Qf.reference,fontSize:Xf.reference,px:Yf.reference,borderRadius:Zf.reference},field:{width:"100%",height:Qf.reference,fontSize:Xf.reference,px:Yf.reference,borderRadius:Zf.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),bu={lg:{[Xf.variable]:"fontSizes.lg",[Yf.variable]:"space.4",[Zf.variable]:"radii.md",[Qf.variable]:"sizes.12"},md:{[Xf.variable]:"fontSizes.md",[Yf.variable]:"space.4",[Zf.variable]:"radii.md",[Qf.variable]:"sizes.10"},sm:{[Xf.variable]:"fontSizes.sm",[Yf.variable]:"space.3",[Zf.variable]:"radii.sm",[Qf.variable]:"sizes.8"},xs:{[Xf.variable]:"fontSizes.xs",[Yf.variable]:"space.2",[Zf.variable]:"radii.sm",[Qf.variable]:"sizes.6"}},Y8e={lg:Dl({field:bu.lg,group:bu.lg}),md:Dl({field:bu.md,group:bu.md}),sm:Dl({field:bu.sm,group:bu.sm}),xs:Dl({field:bu.xs,group:bu.xs})};function hP(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||K("blue.500","blue.300")(e),errorBorderColor:n||K("red.500","red.300")(e)}}var Z8e=Dl(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=hP(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:K("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ao(t,r),boxShadow:`0 0 0 1px ${ao(t,r)}`},_focusVisible:{zIndex:1,borderColor:ao(t,n),boxShadow:`0 0 0 1px ${ao(t,n)}`}},addon:{border:"1px solid",borderColor:K("inherit","whiteAlpha.50")(e),bg:K("gray.100","whiteAlpha.300")(e)}}}),J8e=Dl(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=hP(e);return{field:{border:"2px solid",borderColor:"transparent",bg:K("gray.100","whiteAlpha.50")(e),_hover:{bg:K("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ao(t,r)},_focusVisible:{bg:"transparent",borderColor:ao(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:K("gray.100","whiteAlpha.50")(e)}}}),eIe=Dl(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=hP(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ao(t,r),boxShadow:`0px 1px 0px 0px ${ao(t,r)}`},_focusVisible:{borderColor:ao(t,n),boxShadow:`0px 1px 0px 0px ${ao(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),tIe=Dl({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),nIe={outline:Z8e,filled:J8e,flushed:eIe,unstyled:tIe},cn=Q8e({baseStyle:X8e,sizes:Y8e,variants:nIe,defaultProps:{size:"md",variant:"outline"}}),BM,rIe={...(BM=cn.baseStyle)==null?void 0:BM.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},zM,jM,iIe={outline:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(jM=(zM=cn.variants)==null?void 0:zM.unstyled.field)!=null?jM:{}},UM,VM,GM,qM,HM,WM,KM,QM,oIe={xs:(VM=(UM=cn.sizes)==null?void 0:UM.xs.field)!=null?VM:{},sm:(qM=(GM=cn.sizes)==null?void 0:GM.sm.field)!=null?qM:{},md:(WM=(HM=cn.sizes)==null?void 0:HM.md.field)!=null?WM:{},lg:(QM=(KM=cn.sizes)==null?void 0:KM.lg.field)!=null?QM:{}},aIe={baseStyle:rIe,sizes:oIe,variants:iIe,defaultProps:{size:"md",variant:"outline"}},s1=hr("tooltip-bg"),x5=hr("tooltip-fg"),sIe=hr("popper-arrow-bg"),lIe={bg:s1.reference,color:x5.reference,[s1.variable]:"colors.gray.700",[x5.variable]:"colors.whiteAlpha.900",_dark:{[s1.variable]:"colors.gray.300",[x5.variable]:"colors.gray.900"},[sIe.variable]:s1.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},uIe={baseStyle:lIe},{defineMultiStyleConfig:cIe,definePartsStyle:Lg}=Pt(sH.keys),dIe=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=K(OM(),OM("1rem","rgba(0,0,0,0.1)"))(e),a=K(`${t}.500`,`${t}.200`)(e),s=`linear-gradient(
+    to right,
+    transparent 0%,
+    ${ao(n,a)} 50%,
+    transparent 100%
+  )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},fIe={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},hIe=e=>({bg:K("gray.100","whiteAlpha.300")(e)}),pIe=e=>({transitionProperty:"common",transitionDuration:"slow",...dIe(e)}),gIe=Lg(e=>({label:fIe,filledTrack:pIe(e),track:hIe(e)})),mIe={xs:Lg({track:{h:"1"}}),sm:Lg({track:{h:"2"}}),md:Lg({track:{h:"3"}}),lg:Lg({track:{h:"4"}})},yIe=cIe({sizes:mIe,baseStyle:gIe,defaultProps:{size:"md",colorScheme:"blue"}}),vIe=e=>typeof e=="function";function lo(e,...t){return vIe(e)?e(...t):e}var{definePartsStyle:db,defineMultiStyleConfig:bIe}=Pt(eH.keys),sm=nt("checkbox-size"),_Ie=e=>{const{colorScheme:t}=e;return{w:sm.reference,h:sm.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:K(`${t}.500`,`${t}.200`)(e),borderColor:K(`${t}.500`,`${t}.200`)(e),color:K("white","gray.900")(e),_hover:{bg:K(`${t}.600`,`${t}.300`)(e),borderColor:K(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:K("gray.200","transparent")(e),bg:K("gray.200","whiteAlpha.300")(e),color:K("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:K(`${t}.500`,`${t}.200`)(e),borderColor:K(`${t}.500`,`${t}.200`)(e),color:K("white","gray.900")(e)},_disabled:{bg:K("gray.100","whiteAlpha.100")(e),borderColor:K("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:K("red.500","red.300")(e)}}},SIe={_disabled:{cursor:"not-allowed"}},xIe={userSelect:"none",_disabled:{opacity:.4}},wIe={transitionProperty:"transform",transitionDuration:"normal"},CIe=db(e=>({icon:wIe,container:SIe,control:lo(_Ie,e),label:xIe})),AIe={sm:db({control:{[sm.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:db({control:{[sm.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:db({control:{[sm.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},rS=bIe({baseStyle:CIe,sizes:AIe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:EIe,definePartsStyle:fb}=Pt(T6e.keys),TIe=e=>{var t;const n=(t=lo(rS.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},kIe=fb(e=>{var t,n,r,i;return{label:(n=(t=rS).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=rS).baseStyle)==null?void 0:i.call(r,e).container,control:TIe(e)}}),PIe={md:fb({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:fb({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:fb({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},IIe=EIe({baseStyle:kIe,sizes:PIe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:RIe,definePartsStyle:OIe}=Pt(lH.keys),l1=nt("select-bg"),XM,MIe={...(XM=cn.baseStyle)==null?void 0:XM.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:l1.reference,[l1.variable]:"colors.white",_dark:{[l1.variable]:"colors.gray.700"},"> option, > optgroup":{bg:l1.reference}},$Ie={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},NIe=OIe({field:MIe,icon:$Ie}),u1={paddingInlineEnd:"8"},YM,ZM,JM,e7,t7,n7,r7,i7,DIe={lg:{...(YM=cn.sizes)==null?void 0:YM.lg,field:{...(ZM=cn.sizes)==null?void 0:ZM.lg.field,...u1}},md:{...(JM=cn.sizes)==null?void 0:JM.md,field:{...(e7=cn.sizes)==null?void 0:e7.md.field,...u1}},sm:{...(t7=cn.sizes)==null?void 0:t7.sm,field:{...(n7=cn.sizes)==null?void 0:n7.sm.field,...u1}},xs:{...(r7=cn.sizes)==null?void 0:r7.xs,field:{...(i7=cn.sizes)==null?void 0:i7.xs.field,...u1},icon:{insetEnd:"1"}}},LIe=RIe({baseStyle:NIe,sizes:DIe,variants:cn.variants,defaultProps:cn.defaultProps}),w5=nt("skeleton-start-color"),C5=nt("skeleton-end-color"),FIe={[w5.variable]:"colors.gray.100",[C5.variable]:"colors.gray.400",_dark:{[w5.variable]:"colors.gray.800",[C5.variable]:"colors.gray.600"},background:w5.reference,borderColor:C5.reference,opacity:.7,borderRadius:"sm"},BIe={baseStyle:FIe},A5=nt("skip-link-bg"),zIe={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[A5.variable]:"colors.white",_dark:{[A5.variable]:"colors.gray.700"},bg:A5.reference}},jIe={baseStyle:zIe},{defineMultiStyleConfig:UIe,definePartsStyle:vw}=Pt(uH.keys),L0=nt("slider-thumb-size"),F0=nt("slider-track-size"),$u=nt("slider-bg"),VIe=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...fP({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},GIe=e=>({...fP({orientation:e.orientation,horizontal:{h:F0.reference},vertical:{w:F0.reference}}),overflow:"hidden",borderRadius:"sm",[$u.variable]:"colors.gray.200",_dark:{[$u.variable]:"colors.whiteAlpha.200"},_disabled:{[$u.variable]:"colors.gray.300",_dark:{[$u.variable]:"colors.whiteAlpha.300"}},bg:$u.reference}),qIe=e=>{const{orientation:t}=e;return{...fP({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:L0.reference,h:L0.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},HIe=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[$u.variable]:`colors.${t}.500`,_dark:{[$u.variable]:`colors.${t}.200`},bg:$u.reference}},WIe=vw(e=>({container:VIe(e),track:GIe(e),thumb:qIe(e),filledTrack:HIe(e)})),KIe=vw({container:{[L0.variable]:"sizes.4",[F0.variable]:"sizes.1"}}),QIe=vw({container:{[L0.variable]:"sizes.3.5",[F0.variable]:"sizes.1"}}),XIe=vw({container:{[L0.variable]:"sizes.2.5",[F0.variable]:"sizes.0.5"}}),YIe={lg:KIe,md:QIe,sm:XIe},ZIe=UIe({baseStyle:WIe,sizes:YIe,defaultProps:{size:"md",colorScheme:"blue"}}),rd=hr("spinner-size"),JIe={width:[rd.reference],height:[rd.reference]},eRe={xs:{[rd.variable]:"sizes.3"},sm:{[rd.variable]:"sizes.4"},md:{[rd.variable]:"sizes.6"},lg:{[rd.variable]:"sizes.8"},xl:{[rd.variable]:"sizes.12"}},tRe={baseStyle:JIe,sizes:eRe,defaultProps:{size:"md"}},{defineMultiStyleConfig:nRe,definePartsStyle:pH}=Pt(k6e.keys),rRe={fontWeight:"medium"},iRe={opacity:.8,marginBottom:"2"},oRe={verticalAlign:"baseline",fontWeight:"semibold"},aRe={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},sRe=pH({container:{},label:rRe,helpText:iRe,number:oRe,icon:aRe}),lRe={md:pH({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},uRe=nRe({baseStyle:sRe,sizes:lRe,defaultProps:{size:"md"}}),E5=nt("kbd-bg"),cRe={[E5.variable]:"colors.gray.100",_dark:{[E5.variable]:"colors.whiteAlpha.100"},bg:E5.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},dRe={baseStyle:cRe},fRe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},hRe={baseStyle:fRe},{defineMultiStyleConfig:pRe,definePartsStyle:gRe}=Pt(E6e.keys),mRe={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},yRe=gRe({icon:mRe}),vRe=pRe({baseStyle:yRe}),{defineMultiStyleConfig:bRe,definePartsStyle:_Re}=Pt(rH.keys),Is=nt("menu-bg"),T5=nt("menu-shadow"),SRe={[Is.variable]:"#fff",[T5.variable]:"shadows.sm",_dark:{[Is.variable]:"colors.gray.700",[T5.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Is.reference,boxShadow:T5.reference},xRe={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Is.variable]:"colors.gray.100",_dark:{[Is.variable]:"colors.whiteAlpha.100"}},_active:{[Is.variable]:"colors.gray.200",_dark:{[Is.variable]:"colors.whiteAlpha.200"}},_expanded:{[Is.variable]:"colors.gray.100",_dark:{[Is.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Is.reference},wRe={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},CRe={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},ARe={opacity:.6},ERe={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},TRe={transitionProperty:"common",transitionDuration:"normal"},kRe=_Re({button:TRe,list:SRe,item:xRe,groupTitle:wRe,icon:CRe,command:ARe,divider:ERe}),PRe=bRe({baseStyle:kRe}),{defineMultiStyleConfig:IRe,definePartsStyle:PE}=Pt(iH.keys),k5=nt("modal-bg"),P5=nt("modal-shadow"),RRe={bg:"blackAlpha.600",zIndex:"modal"},ORe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},MRe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[k5.variable]:"colors.white",[P5.variable]:"shadows.lg",_dark:{[k5.variable]:"colors.gray.700",[P5.variable]:"shadows.dark-lg"},bg:k5.reference,boxShadow:P5.reference}},$Re={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},NRe={position:"absolute",top:"2",insetEnd:"3"},DRe=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},LRe={px:"6",py:"4"},FRe=PE(e=>({overlay:RRe,dialogContainer:lo(ORe,e),dialog:lo(MRe,e),header:$Re,closeButton:NRe,body:lo(DRe,e),footer:LRe}));function Ha(e){return PE(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var BRe={xs:Ha("xs"),sm:Ha("sm"),md:Ha("md"),lg:Ha("lg"),xl:Ha("xl"),"2xl":Ha("2xl"),"3xl":Ha("3xl"),"4xl":Ha("4xl"),"5xl":Ha("5xl"),"6xl":Ha("6xl"),full:Ha("full")},zRe=IRe({baseStyle:FRe,sizes:BRe,defaultProps:{size:"md"}}),{defineMultiStyleConfig:jRe,definePartsStyle:gH}=Pt(oH.keys),pP=hr("number-input-stepper-width"),mH=hr("number-input-input-padding"),URe=Ol(pP).add("0.5rem").toString(),I5=hr("number-input-bg"),R5=hr("number-input-color"),O5=hr("number-input-border-color"),VRe={[pP.variable]:"sizes.6",[mH.variable]:URe},GRe=e=>{var t,n;return(n=(t=lo(cn.baseStyle,e))==null?void 0:t.field)!=null?n:{}},qRe={width:pP.reference},HRe={borderStart:"1px solid",borderStartColor:O5.reference,color:R5.reference,bg:I5.reference,[R5.variable]:"colors.chakra-body-text",[O5.variable]:"colors.chakra-border-color",_dark:{[R5.variable]:"colors.whiteAlpha.800",[O5.variable]:"colors.whiteAlpha.300"},_active:{[I5.variable]:"colors.gray.200",_dark:{[I5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},WRe=gH(e=>{var t;return{root:VRe,field:(t=lo(GRe,e))!=null?t:{},stepperGroup:qRe,stepper:HRe}});function c1(e){var t,n,r;const i=(t=cn.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=i.field)==null?void 0:n.fontSize)!=null?r:"md",s=Xq.fontSizes[a];return gH({field:{...i.field,paddingInlineEnd:mH.reference,verticalAlign:"top"},stepper:{fontSize:Ol(s).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var KRe={xs:c1("xs"),sm:c1("sm"),md:c1("md"),lg:c1("lg")},QRe=jRe({baseStyle:WRe,sizes:KRe,variants:cn.variants,defaultProps:cn.defaultProps}),o7,XRe={...(o7=cn.baseStyle)==null?void 0:o7.field,textAlign:"center"},YRe={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},a7,s7,ZRe={outline:e=>{var t,n,r;return(r=(n=lo((t=cn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=lo((t=cn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=lo((t=cn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(s7=(a7=cn.variants)==null?void 0:a7.unstyled.field)!=null?s7:{}},JRe={baseStyle:XRe,sizes:YRe,variants:ZRe,defaultProps:cn.defaultProps},{defineMultiStyleConfig:e9e,definePartsStyle:t9e}=Pt(aH.keys),d1=hr("popper-bg"),n9e=hr("popper-arrow-bg"),l7=hr("popper-arrow-shadow-color"),r9e={zIndex:10},i9e={[d1.variable]:"colors.white",bg:d1.reference,[n9e.variable]:d1.reference,[l7.variable]:"colors.gray.200",_dark:{[d1.variable]:"colors.gray.700",[l7.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},o9e={px:3,py:2,borderBottomWidth:"1px"},a9e={px:3,py:2},s9e={px:3,py:2,borderTopWidth:"1px"},l9e={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},u9e=t9e({popper:r9e,content:i9e,header:o9e,body:a9e,footer:s9e,closeButton:l9e}),c9e=e9e({baseStyle:u9e}),{definePartsStyle:IE,defineMultiStyleConfig:d9e}=Pt(w6e.keys),M5=nt("drawer-bg"),$5=nt("drawer-box-shadow");function Ef(e){return IE(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var f9e={bg:"blackAlpha.600",zIndex:"overlay"},h9e={display:"flex",zIndex:"modal",justifyContent:"center"},p9e=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[M5.variable]:"colors.white",[$5.variable]:"shadows.lg",_dark:{[M5.variable]:"colors.gray.700",[$5.variable]:"shadows.dark-lg"},bg:M5.reference,boxShadow:$5.reference}},g9e={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},m9e={position:"absolute",top:"2",insetEnd:"3"},y9e={px:"6",py:"2",flex:"1",overflow:"auto"},v9e={px:"6",py:"4"},b9e=IE(e=>({overlay:f9e,dialogContainer:h9e,dialog:lo(p9e,e),header:g9e,closeButton:m9e,body:y9e,footer:v9e})),_9e={xs:Ef("xs"),sm:Ef("md"),md:Ef("lg"),lg:Ef("2xl"),xl:Ef("4xl"),full:Ef("full")},S9e=d9e({baseStyle:b9e,sizes:_9e,defaultProps:{size:"xs"}}),{definePartsStyle:x9e,defineMultiStyleConfig:w9e}=Pt(tH.keys),C9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},A9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},E9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},T9e=x9e({preview:C9e,input:A9e,textarea:E9e}),k9e=w9e({baseStyle:T9e}),{definePartsStyle:P9e,defineMultiStyleConfig:I9e}=Pt(C6e.keys),Ph=nt("form-control-color"),R9e={marginStart:"1",[Ph.variable]:"colors.red.500",_dark:{[Ph.variable]:"colors.red.300"},color:Ph.reference},O9e={mt:"2",[Ph.variable]:"colors.gray.600",_dark:{[Ph.variable]:"colors.whiteAlpha.600"},color:Ph.reference,lineHeight:"normal",fontSize:"sm"},M9e=P9e({container:{width:"100%",position:"relative"},requiredIndicator:R9e,helperText:O9e}),$9e=I9e({baseStyle:M9e}),{definePartsStyle:N9e,defineMultiStyleConfig:D9e}=Pt(A6e.keys),Ih=nt("form-error-color"),L9e={[Ih.variable]:"colors.red.500",_dark:{[Ih.variable]:"colors.red.300"},color:Ih.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},F9e={marginEnd:"0.5em",[Ih.variable]:"colors.red.500",_dark:{[Ih.variable]:"colors.red.300"},color:Ih.reference},B9e=N9e({text:L9e,icon:F9e}),z9e=D9e({baseStyle:B9e}),j9e={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},U9e={baseStyle:j9e},V9e={fontFamily:"heading",fontWeight:"bold"},G9e={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},q9e={baseStyle:V9e,sizes:G9e,defaultProps:{size:"xl"}},{defineMultiStyleConfig:H9e,definePartsStyle:W9e}=Pt(x6e.keys),N5=nt("breadcrumb-link-decor"),K9e={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:N5.reference,[N5.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[N5.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},Q9e=W9e({link:K9e}),X9e=H9e({baseStyle:Q9e}),Y9e={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},yH=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:K("gray.800","whiteAlpha.900")(e),_hover:{bg:K("gray.100","whiteAlpha.200")(e)},_active:{bg:K("gray.200","whiteAlpha.300")(e)}};const r=hp(`${t}.200`,.12)(n),i=hp(`${t}.200`,.24)(n);return{color:K(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:K(`${t}.50`,r)(e)},_active:{bg:K(`${t}.100`,i)(e)}}},Z9e=e=>{const{colorScheme:t}=e,n=K("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...lo(yH,e)}},J9e={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},eOe=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=K("gray.100","whiteAlpha.200")(e);return{bg:l,color:K("gray.800","whiteAlpha.900")(e),_hover:{bg:K("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:K("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:i="white",hoverBg:o=`${n}.600`,activeBg:a=`${n}.700`}=(t=J9e[n])!=null?t:{},s=K(r,`${n}.200`)(e);return{bg:s,color:K(i,"gray.800")(e),_hover:{bg:K(o,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:K(a,`${n}.400`)(e)}}},tOe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:K(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:K(`${t}.700`,`${t}.500`)(e)}}},nOe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},rOe={ghost:yH,outline:Z9e,solid:eOe,link:tOe,unstyled:nOe},iOe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},oOe={baseStyle:Y9e,variants:rOe,sizes:iOe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Td,defineMultiStyleConfig:aOe}=Pt(R6e.keys),iS=nt("card-bg"),jl=nt("card-padding"),vH=nt("card-shadow"),hb=nt("card-radius"),bH=nt("card-border-width","0"),_H=nt("card-border-color"),sOe=Td({container:{[iS.variable]:"colors.chakra-body-bg",backgroundColor:iS.reference,boxShadow:vH.reference,borderRadius:hb.reference,color:"chakra-body-text",borderWidth:bH.reference,borderColor:_H.reference},body:{padding:jl.reference,flex:"1 1 0%"},header:{padding:jl.reference},footer:{padding:jl.reference}}),lOe={sm:Td({container:{[hb.variable]:"radii.base",[jl.variable]:"space.3"}}),md:Td({container:{[hb.variable]:"radii.md",[jl.variable]:"space.5"}}),lg:Td({container:{[hb.variable]:"radii.xl",[jl.variable]:"space.7"}})},uOe={elevated:Td({container:{[vH.variable]:"shadows.base",_dark:{[iS.variable]:"colors.gray.700"}}}),outline:Td({container:{[bH.variable]:"1px",[_H.variable]:"colors.chakra-border-color"}}),filled:Td({container:{[iS.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[jl.variable]:0},header:{[jl.variable]:0},footer:{[jl.variable]:0}}},cOe=aOe({baseStyle:sOe,variants:uOe,sizes:lOe,defaultProps:{variant:"elevated",size:"md"}}),lm=hr("close-button-size"),gg=hr("close-button-bg"),dOe={w:[lm.reference],h:[lm.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[gg.variable]:"colors.blackAlpha.100",_dark:{[gg.variable]:"colors.whiteAlpha.100"}},_active:{[gg.variable]:"colors.blackAlpha.200",_dark:{[gg.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:gg.reference},fOe={lg:{[lm.variable]:"sizes.10",fontSize:"md"},md:{[lm.variable]:"sizes.8",fontSize:"xs"},sm:{[lm.variable]:"sizes.6",fontSize:"2xs"}},hOe={baseStyle:dOe,sizes:fOe,defaultProps:{size:"md"}},{variants:pOe,defaultProps:gOe}=am,mOe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Tr.bg.reference,color:Tr.color.reference,boxShadow:Tr.shadow.reference},yOe={baseStyle:mOe,variants:pOe,defaultProps:gOe},vOe={w:"100%",mx:"auto",maxW:"prose",px:"4"},bOe={baseStyle:vOe},_Oe={opacity:.6,borderColor:"inherit"},SOe={borderStyle:"solid"},xOe={borderStyle:"dashed"},wOe={solid:SOe,dashed:xOe},COe={baseStyle:_Oe,variants:wOe,defaultProps:{variant:"solid"}},{definePartsStyle:AOe,defineMultiStyleConfig:EOe}=Pt(Jq.keys),TOe={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},kOe={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},POe={pt:"2",px:"4",pb:"5"},IOe={fontSize:"1.25em"},ROe=AOe({container:TOe,button:kOe,panel:POe,icon:IOe}),OOe=EOe({baseStyle:ROe}),{definePartsStyle:jy,defineMultiStyleConfig:MOe}=Pt(_6e.keys),ea=nt("alert-fg"),eu=nt("alert-bg"),$Oe=jy({container:{bg:eu.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:ea.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:ea.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function gP(e){const{theme:t,colorScheme:n}=e,r=hp(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var NOe=jy(e=>{const{colorScheme:t}=e,n=gP(e);return{container:{[ea.variable]:`colors.${t}.500`,[eu.variable]:n.light,_dark:{[ea.variable]:`colors.${t}.200`,[eu.variable]:n.dark}}}}),DOe=jy(e=>{const{colorScheme:t}=e,n=gP(e);return{container:{[ea.variable]:`colors.${t}.500`,[eu.variable]:n.light,_dark:{[ea.variable]:`colors.${t}.200`,[eu.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:ea.reference}}}),LOe=jy(e=>{const{colorScheme:t}=e,n=gP(e);return{container:{[ea.variable]:`colors.${t}.500`,[eu.variable]:n.light,_dark:{[ea.variable]:`colors.${t}.200`,[eu.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:ea.reference}}}),FOe=jy(e=>{const{colorScheme:t}=e;return{container:{[ea.variable]:"colors.white",[eu.variable]:`colors.${t}.500`,_dark:{[ea.variable]:"colors.gray.900",[eu.variable]:`colors.${t}.200`},color:ea.reference}}}),BOe={subtle:NOe,"left-accent":DOe,"top-accent":LOe,solid:FOe},zOe=MOe({baseStyle:$Oe,variants:BOe,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:SH,defineMultiStyleConfig:jOe}=Pt(S6e.keys),Rh=nt("avatar-border-color"),um=nt("avatar-bg"),B0=nt("avatar-font-size"),pp=nt("avatar-size"),UOe={borderRadius:"full",border:"0.2em solid",borderColor:Rh.reference,[Rh.variable]:"white",_dark:{[Rh.variable]:"colors.gray.800"}},VOe={bg:um.reference,fontSize:B0.reference,width:pp.reference,height:pp.reference,lineHeight:"1",[um.variable]:"colors.gray.200",_dark:{[um.variable]:"colors.whiteAlpha.400"}},GOe=e=>{const{name:t,theme:n}=e,r=t?Y6e({string:t}):"colors.gray.400",i=Q6e(r)(n);let o="white";return i||(o="gray.800"),{bg:um.reference,fontSize:B0.reference,color:o,borderColor:Rh.reference,verticalAlign:"top",width:pp.reference,height:pp.reference,"&:not([data-loaded])":{[um.variable]:r},[Rh.variable]:"colors.white",_dark:{[Rh.variable]:"colors.gray.800"}}},qOe={fontSize:B0.reference,lineHeight:"1"},HOe=SH(e=>({badge:lo(UOe,e),excessLabel:lo(VOe,e),container:lo(GOe,e),label:qOe}));function _u(e){const t=e!=="100%"?Zq[e]:void 0;return SH({container:{[pp.variable]:t??e,[B0.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[pp.variable]:t??e,[B0.variable]:`calc(${t??e} / 2.5)`}})}var WOe={"2xs":_u(4),xs:_u(6),sm:_u(8),md:_u(12),lg:_u(16),xl:_u(24),"2xl":_u(32),full:_u("100%")},KOe=jOe({baseStyle:HOe,sizes:WOe,defaultProps:{size:"md"}}),QOe={Accordion:OOe,Alert:zOe,Avatar:KOe,Badge:am,Breadcrumb:X9e,Button:oOe,Checkbox:rS,CloseButton:hOe,Code:yOe,Container:bOe,Divider:COe,Drawer:S9e,Editable:k9e,Form:$9e,FormError:z9e,FormLabel:U9e,Heading:q9e,Input:cn,Kbd:dRe,Link:hRe,List:vRe,Menu:PRe,Modal:zRe,NumberInput:QRe,PinInput:JRe,Popover:c9e,Progress:yIe,Radio:IIe,Select:LIe,Skeleton:BIe,SkipLink:jIe,Slider:ZIe,Spinner:tRe,Stat:uRe,Switch:h8e,Table:_8e,Tabs:N8e,Tag:K8e,Textarea:aIe,Tooltip:uIe,Card:cOe,Stepper:b6e},XOe={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},YOe={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},ZOe="ltr",JOe={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},eMe={semanticTokens:XOe,direction:ZOe,...m6e,components:QOe,styles:YOe,config:JOe},tMe=eMe;function nMe(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function rMe(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var iMe=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},xH=iMe(rMe);function wH(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var CH=e=>wH(e,t=>t!=null);function oMe(e){return typeof e=="function"}function AH(e,...t){return oMe(e)?e(...t):e}function pQe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var aMe=typeof Element<"u",sMe=typeof Map=="function",lMe=typeof Set=="function",uMe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function pb(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!pb(e[r],t[r]))return!1;return!0}var o;if(sMe&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!pb(r.value[1],t.get(r.value[0])))return!1;return!0}if(lMe&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(uMe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(aMe&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!pb(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var cMe=function(t,n){try{return pb(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const dMe=Sc(cMe);function EH(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:a}=A4e(),s=e?xH(o,`components.${e}`):void 0,l=r||s,u=Vs({theme:o,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},CH(nMe(i,["children"]))),c=I.useRef({});if(l){const f=HPe(l)(u);dMe(c.current,f)||(c.current=f)}return c.current}function Uy(e,t={}){return EH(e,t)}function fMe(e,t={}){return EH(e,t)}var hMe=new Set([...$Pe,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),pMe=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function gMe(e){return pMe.has(e)||!hMe.has(e)}function mMe(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i in n&&delete n[i],n[i]=r[i]);return n}function yMe(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var vMe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,bMe=Oq(function(e){return vMe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),_Me=bMe,SMe=function(t){return t!=="theme"},u7=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?_Me:SMe},c7=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},xMe=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return $q(n,r,i),c4e(function(){return Nq(n,r,i)}),null},wMe=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=c7(t,n,r),l=s||u7(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var p=Bq(function(m,_,b){var y=u&&m.as||i,g="",v=[],S=m;if(m.theme==null){S={};for(var w in m)S[w]=m[w];S.theme=I.useContext(N0)}typeof m.className=="string"?g=r4e(_.registered,v,m.className):m.className!=null&&(g=m.className+" ");var x=oP(d.concat(v),_.registered,S);g+=_.key+"-"+x.name,a!==void 0&&(g+=" "+a);var C=u&&s===void 0?u7(y):l,T={};for(var E in m)u&&E==="as"||C(E)&&(T[E]=m[E]);return T.className=g,T.ref=b,I.createElement(I.Fragment,null,I.createElement(xMe,{cache:_,serialized:x,isStringTag:typeof y=="string"}),I.createElement(y,T))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=d,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return"."+a}}),p.withComponent=function(m,_){return e(m,S_({},n,_,{shouldForwardProp:c7(p,_,!0)})).apply(void 0,d)},p}},CMe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],oS=wMe.bind();CMe.forEach(function(e){oS[e]=oS(e)});var d7,AMe=(d7=oS.default)!=null?d7:oS,EMe=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=wH(a,(d,f)=>DPe(f)),l=AH(e,t),u=mMe({},i,l,CH(s),o),c=Qq(u)(t.theme);return r?[c,r]:c};function D5(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=gMe);const i=EMe({baseStyle:n}),o=AMe(e,r)(i);return An.forwardRef(function(l,u){const{colorMode:c,forced:d}=pw();return An.createElement(o,{ref:u,"data-theme":d?c:void 0,...l})})}function TMe(){const e=new Map;return new Proxy(D5,{apply(t,n,r){return D5(...r)},get(t,n){return e.has(n)||e.set(n,D5(n)),e.get(n)}})}var Oi=TMe();function la(e){return I.forwardRef(e)}function kMe(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=I.createContext(void 0);i.displayName=r;function o(){var a;const s=I.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}function PMe(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=I.useMemo(()=>OPe(n),[n]);return W.jsxs(h4e,{theme:i,children:[W.jsx(IMe,{root:t}),r]})}function IMe({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return W.jsx(zq,{styles:n=>({[t]:n.__cssVars})})}kMe({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` "});function gQe(){const{colorMode:e}=pw();return W.jsx(zq,{styles:t=>{const n=xH(t,"styles.global"),r=AH(n,{theme:t,colorMode:e});return r?Qq(r)(t):void 0}})}var RMe=(e,t)=>e.find(n=>n.id===t);function f7(e,t){const n=TH(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function TH(e,t){for(const[n,r]of Object.entries(e))if(RMe(r,t))return n}function OMe(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function MMe(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}function $Me(e,t=[]){const n=I.useRef(e);return I.useEffect(()=>{n.current=e}),I.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function NMe(e,t){const n=$Me(e);I.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function h7(e,t){const n=I.useRef(!1),r=I.useRef(!1);I.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),I.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const kH=I.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),bw=I.createContext({}),Vy=I.createContext(null),_w=typeof document<"u",mP=_w?I.useLayoutEffect:I.useEffect,PH=I.createContext({strict:!1});function DMe(e,t,n,r){const{visualElement:i}=I.useContext(bw),o=I.useContext(PH),a=I.useContext(Vy),s=I.useContext(kH).reducedMotion,l=I.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;I.useInsertionEffect(()=>{u&&u.update(n,a)});const c=I.useRef(!!window.HandoffAppearAnimations);return mP(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),I.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function Jf(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function LMe(e,t,n){return I.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Jf(n)&&(n.current=r))},[t])}function z0(e){return typeof e=="string"||Array.isArray(e)}function Sw(e){return typeof e=="object"&&typeof e.start=="function"}const yP=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vP=["initial",...yP];function xw(e){return Sw(e.animate)||vP.some(t=>z0(e[t]))}function IH(e){return!!(xw(e)||e.variants)}function FMe(e,t){if(xw(e)){const{initial:n,animate:r}=e;return{initial:n===!1||z0(n)?n:void 0,animate:z0(r)?r:void 0}}return e.inherit!==!1?t:{}}function BMe(e){const{initial:t,animate:n}=FMe(e,I.useContext(bw));return I.useMemo(()=>({initial:t,animate:n}),[p7(t),p7(n)])}function p7(e){return Array.isArray(e)?e.join(" "):e}const g7={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},j0={};for(const e in g7)j0[e]={isEnabled:t=>g7[e].some(n=>!!t[n])};function zMe(e){for(const t in e)j0[t]={...j0[t],...e[t]}}const bP=I.createContext({}),RH=I.createContext({}),jMe=Symbol.for("motionComponentSymbol");function UMe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&zMe(e);function o(s,l){let u;const c={...I.useContext(kH),...s,layoutId:VMe(s)},{isStatic:d}=c,f=BMe(s),h=r(s,d);if(!d&&_w){f.visualElement=DMe(i,h,c,t);const p=I.useContext(RH),m=I.useContext(PH).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,m,e,p))}return I.createElement(bw.Provider,{value:f},u&&f.visualElement?I.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,s,LMe(h,f.visualElement,l),h,d,f.visualElement))}const a=I.forwardRef(o);return a[jMe]=i,a}function VMe({layoutId:e}){const t=I.useContext(bP).id;return t&&e!==void 0?t+"-"+e:e}function GMe(e){function t(r,i={}){return UMe(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const qMe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _P(e){return typeof e!="string"||e.includes("-")?!1:!!(qMe.indexOf(e)>-1||/[A-Z]/.test(e))}const aS={};function HMe(e){Object.assign(aS,e)}const Gy=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],af=new Set(Gy);function OH(e,{layout:t,layoutId:n}){return af.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!aS[e]||e==="opacity")}const Lo=e=>!!(e&&e.getVelocity),WMe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},KMe=Gy.length;function QMe(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;a<KMe;a++){const s=Gy[a];if(e[s]!==void 0){const l=WMe[s]||s;o+=`${l}(${e[s]}) `}}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}const MH=e=>t=>typeof t=="string"&&t.startsWith(e),$H=MH("--"),RE=MH("var(--"),XMe=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,YMe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,bc=(e,t,n)=>Math.min(Math.max(n,e),t),sf={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},cm={...sf,transform:e=>bc(0,1,e)},f1={...sf,default:1},dm=e=>Math.round(e*1e5)/1e5,ww=/(-)?([\d]*\.?[\d])+/g,NH=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,ZMe=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qy(e){return typeof e=="string"}const Hy=e=>({test:t=>qy(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xu=Hy("deg"),el=Hy("%"),st=Hy("px"),JMe=Hy("vh"),e7e=Hy("vw"),m7={...el,parse:e=>el.parse(e)/100,transform:e=>el.transform(e*100)},y7={...sf,transform:Math.round},DH={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:xu,rotateX:xu,rotateY:xu,rotateZ:xu,scale:f1,scaleX:f1,scaleY:f1,scaleZ:f1,skew:xu,skewX:xu,skewY:xu,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:cm,originX:m7,originY:m7,originZ:st,zIndex:y7,fillOpacity:cm,strokeOpacity:cm,numOctaves:y7};function SP(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const d in t){const f=t[d];if($H(d)){o[d]=f;continue}const h=DH[d],p=YMe(f,h);if(af.has(d)){if(l=!0,a[d]=p,!c)continue;f!==(h.default||0)&&(c=!1)}else d.startsWith("origin")?(u=!0,s[d]=p):i[d]=p}if(t.transform||(l||r?i.transform=QMe(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:h=0}=s;i.transformOrigin=`${d} ${f} ${h}`}}const xP=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LH(e,t,n){for(const r in t)!Lo(t[r])&&!OH(r,n)&&(e[r]=t[r])}function t7e({transformTemplate:e},t,n){return I.useMemo(()=>{const r=xP();return SP(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function n7e(e,t,n){const r=e.style||{},i={};return LH(i,r,e),Object.assign(i,t7e(e,t,n)),e.transformValues?e.transformValues(i):i}function r7e(e,t,n){const r={},i=n7e(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const i7e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function sS(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||i7e.has(e)}let FH=e=>!sS(e);function o7e(e){e&&(FH=t=>t.startsWith("on")?!sS(t):e(t))}try{o7e(require("@emotion/is-prop-valid").default)}catch{}function a7e(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(FH(i)||n===!0&&sS(i)||!t&&!sS(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function v7(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function s7e(e,t,n){const r=v7(t,e.x,e.width),i=v7(n,e.y,e.height);return`${r} ${i}`}const l7e={offset:"stroke-dashoffset",array:"stroke-dasharray"},u7e={offset:"strokeDashoffset",array:"strokeDasharray"};function c7e(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?l7e:u7e;e[o.offset]=st.transform(-r);const a=st.transform(t),s=st.transform(n);e[o.array]=`${a} ${s}`}function wP(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,d,f){if(SP(e,u,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=s7e(m,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&c7e(h,a,s,l,!1)}const BH=()=>({...xP(),attrs:{}}),CP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function d7e(e,t,n,r){const i=I.useMemo(()=>{const o=BH();return wP(o,t,{enableHardwareAcceleration:!1},CP(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};LH(o,e.style,e),i.style={...o,...i.style}}return i}function f7e(e=!1){return(n,r,i,{latestValues:o},a)=>{const l=(_P(n)?d7e:r7e)(r,o,a,n),c={...a7e(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=I.useMemo(()=>Lo(d)?d.get():d,[d]);return I.createElement(n,{...c,children:f})}}const AP=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function zH(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const jH=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function UH(e,t,n,r){zH(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(jH.has(i)?i:AP(i),t.attrs[i])}function EP(e,t){const{style:n}=e,r={};for(const i in n)(Lo(n[i])||t.style&&Lo(t.style[i])||OH(i,e))&&(r[i]=n[i]);return r}function VH(e,t){const n=EP(e,t);for(const r in e)if(Lo(e[r])||Lo(t[r])){const i=Gy.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function TP(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function GH(e){const t=I.useRef(null);return t.current===null&&(t.current=e()),t.current}const lS=e=>Array.isArray(e),h7e=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),p7e=e=>lS(e)?e[e.length-1]||0:e;function gb(e){const t=Lo(e)?e.get():e;return h7e(t)?t.toValue():t}function g7e({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:m7e(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const qH=e=>(t,n)=>{const r=I.useContext(bw),i=I.useContext(Vy),o=()=>g7e(e,t,r,i);return n?o():GH(o)};function m7e(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=gb(o[f]);let{initial:a,animate:s}=e;const l=xw(e),u=IH(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const d=c?s:a;return d&&typeof d!="boolean"&&!Sw(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const p=TP(e,h);if(!p)return;const{transitionEnd:m,transition:_,...b}=p;for(const y in b){let g=b[y];if(Array.isArray(g)){const v=c?g.length-1:0;g=g[v]}g!==null&&(i[y]=g)}for(const y in m)i[y]=m[y]}),i}const vr=e=>e;function y7e(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const d=c&&i,f=d?t:n;return u&&a.add(l),f.indexOf(l)===-1&&(f.push(l),d&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u<r;u++){const c=t[u];c(l),a.has(c)&&(s.schedule(c),e())}i=!1,o&&(o=!1,s.process(l))}};return s}const h1=["prepare","read","update","preRender","render","postRender"],v7e=40;function b7e(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=h1.reduce((d,f)=>(d[f]=y7e(()=>n=!0),d),{}),a=d=>o[d].process(i),s=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,v7e),1),i.timestamp=d,i.isProcessing=!0,h1.forEach(a),i.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,i.isProcessing||e(s)};return{schedule:h1.reduce((d,f)=>{const h=o[f];return d[f]=(p,m=!1,_=!1)=>(n||l(),h.schedule(p,m,_)),d},{}),cancel:d=>h1.forEach(f=>o[f].cancel(d)),state:i,steps:o}}const{schedule:Nn,cancel:tu,state:ji,steps:L5}=b7e(typeof requestAnimationFrame<"u"?requestAnimationFrame:vr,!0),_7e={useVisualState:qH({scrapeMotionValuesFromProps:VH,createRenderState:BH,onMount:(e,t,{renderState:n,latestValues:r})=>{Nn.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Nn.render(()=>{wP(n,r,{enableHardwareAcceleration:!1},CP(t.tagName),e.transformTemplate),UH(t,n)})}})},S7e={useVisualState:qH({scrapeMotionValuesFromProps:EP,createRenderState:xP})};function x7e(e,{forwardMotionProps:t=!1},n,r){return{..._P(e)?_7e:S7e,preloadedFeatures:n,useRender:f7e(t),createVisualElement:r,Component:e}}function Ll(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const HH=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Cw(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const w7e=e=>t=>HH(t)&&e(t,Cw(t));function Ul(e,t,n,r){return Ll(e,t,w7e(n),r)}const C7e=(e,t)=>n=>t(e(n)),rc=(...e)=>e.reduce(C7e);function WH(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const b7=WH("dragHorizontal"),_7=WH("dragVertical");function KH(e){let t=!1;if(e==="y")t=_7();else if(e==="x")t=b7();else{const n=b7(),r=_7();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function QH(){const e=KH(!0);return e?(e(),!1):!0}class Lc{constructor(t){this.isMounted=!1,this.node=t}update(){}}function S7(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,a)=>{if(o.type==="touch"||QH())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&Nn.update(()=>s[r](o,a))};return Ul(e.current,n,i,{passive:!e.getProps()[r]})}class A7e extends Lc{mount(){this.unmount=rc(S7(this.node,!0),S7(this.node,!1))}unmount(){}}class E7e extends Lc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=rc(Ll(this.node.current,"focus",()=>this.onFocus()),Ll(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const XH=(e,t)=>t?e===t?!0:XH(e,t.parentElement):!1;function F5(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Cw(n))}class T7e extends Lc{constructor(){super(...arguments),this.removeStartListeners=vr,this.removeEndListeners=vr,this.removeAccessibleListeners=vr,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Ul(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Nn.update(()=>{XH(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=Ul(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=rc(o,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||F5("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Nn.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Ll(this.node.current,"keyup",a),F5("down",(s,l)=>{this.startPress(s,l)})},n=Ll(this.node.current,"keydown",t),r=()=>{this.isPressing&&F5("cancel",(o,a)=>this.cancelPress(o,a))},i=Ll(this.node.current,"blur",r);this.removeAccessibleListeners=rc(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Nn.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!QH()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Nn.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ul(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ll(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=rc(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const OE=new WeakMap,B5=new WeakMap,k7e=e=>{const t=OE.get(e.target);t&&t(e)},P7e=e=>{e.forEach(k7e)};function I7e({root:e,...t}){const n=e||document;B5.has(n)||B5.set(n,{});const r=B5.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(P7e,{root:e,...t})),r[i]}function R7e(e,t,n){const r=I7e(t);return OE.set(e,n),r.observe(e),()=>{OE.delete(e),r.unobserve(e)}}const O7e={some:0,all:1};class M7e extends Lc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:O7e[i]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return R7e(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some($7e(t,n))&&this.startObserver()}unmount(){}}function $7e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const N7e={inView:{Feature:M7e},tap:{Feature:T7e},focus:{Feature:E7e},hover:{Feature:A7e}};function YH(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function D7e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function L7e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Aw(e,t,n){const r=e.getProps();return TP(r,t,n!==void 0?n:r.custom,D7e(e),L7e(e))}const F7e="framerAppearId",B7e="data-"+AP(F7e);let z7e=vr,kP=vr;const ic=e=>e*1e3,Vl=e=>e/1e3,j7e={current:!1},ZH=e=>Array.isArray(e)&&typeof e[0]=="number";function JH(e){return!!(!e||typeof e=="string"&&eW[e]||ZH(e)||Array.isArray(e)&&e.every(JH))}const Fg=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,eW={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Fg([0,.65,.55,1]),circOut:Fg([.55,0,1,.45]),backIn:Fg([.31,.01,.66,-.59]),backOut:Fg([.33,1.53,.69,.99])};function tW(e){if(e)return ZH(e)?Fg(e):Array.isArray(e)?e.map(tW):eW[e]}function U7e(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=tW(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}function V7e(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const nW=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,G7e=1e-7,q7e=12;function H7e(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=nW(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>G7e&&++s<q7e);return a}function Wy(e,t,n,r){if(e===t&&n===r)return vr;const i=o=>H7e(o,0,1,e,n);return o=>o===0||o===1?o:nW(i(o),t,r)}const W7e=Wy(.42,0,1,1),K7e=Wy(0,0,.58,1),rW=Wy(.42,0,.58,1),Q7e=e=>Array.isArray(e)&&typeof e[0]!="number",iW=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,oW=e=>t=>1-e(1-t),aW=e=>1-Math.sin(Math.acos(e)),PP=oW(aW),X7e=iW(PP),sW=Wy(.33,1.53,.69,.99),IP=oW(sW),Y7e=iW(IP),Z7e=e=>(e*=2)<1?.5*IP(e):.5*(2-Math.pow(2,-10*(e-1))),J7e={linear:vr,easeIn:W7e,easeInOut:rW,easeOut:K7e,circIn:aW,circInOut:X7e,circOut:PP,backIn:IP,backInOut:Y7e,backOut:sW,anticipate:Z7e},x7=e=>{if(Array.isArray(e)){kP(e.length===4);const[t,n,r,i]=e;return Wy(t,n,r,i)}else if(typeof e=="string")return J7e[e];return e},RP=(e,t)=>n=>!!(qy(n)&&ZMe.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),lW=(e,t,n)=>r=>{if(!qy(r))return r;const[i,o,a,s]=r.match(ww);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},e$e=e=>bc(0,255,e),z5={...sf,transform:e=>Math.round(e$e(e))},gd={test:RP("rgb","red"),parse:lW("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+z5.transform(e)+", "+z5.transform(t)+", "+z5.transform(n)+", "+dm(cm.transform(r))+")"};function t$e(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const ME={test:RP("#"),parse:t$e,transform:gd.transform},eh={test:RP("hsl","hue"),parse:lW("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+el.transform(dm(t))+", "+el.transform(dm(n))+", "+dm(cm.transform(r))+")"},ro={test:e=>gd.test(e)||ME.test(e)||eh.test(e),parse:e=>gd.test(e)?gd.parse(e):eh.test(e)?eh.parse(e):ME.parse(e),transform:e=>qy(e)?e:e.hasOwnProperty("red")?gd.transform(e):eh.transform(e)},ur=(e,t,n)=>-n*e+n*t+e;function j5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function n$e({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=j5(l,s,e+1/3),o=j5(l,s,e),a=j5(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const U5=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},r$e=[ME,gd,eh],i$e=e=>r$e.find(t=>t.test(e));function w7(e){const t=i$e(e);let n=t.parse(e);return t===eh&&(n=n$e(n)),n}const uW=(e,t)=>{const n=w7(e),r=w7(t),i={...n};return o=>(i.red=U5(n.red,r.red,o),i.green=U5(n.green,r.green,o),i.blue=U5(n.blue,r.blue,o),i.alpha=ur(n.alpha,r.alpha,o),gd.transform(i))};function o$e(e){var t,n;return isNaN(e)&&qy(e)&&(((t=e.match(ww))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(NH))===null||n===void 0?void 0:n.length)||0)>0}const cW={regex:XMe,countKey:"Vars",token:"${v}",parse:vr},dW={regex:NH,countKey:"Colors",token:"${c}",parse:ro.parse},fW={regex:ww,countKey:"Numbers",token:"${n}",parse:sf.parse};function V5(e,{regex:t,countKey:n,token:r,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+n]=o.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...o.map(i)))}function uS(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&V5(n,cW),V5(n,dW),V5(n,fW),n}function hW(e){return uS(e).values}function pW(e){const{values:t,numColors:n,numVars:r,tokenised:i}=uS(e),o=t.length;return a=>{let s=i;for(let l=0;l<o;l++)l<r?s=s.replace(cW.token,a[l]):l<r+n?s=s.replace(dW.token,ro.transform(a[l])):s=s.replace(fW.token,dm(a[l]));return s}}const a$e=e=>typeof e=="number"?0:e;function s$e(e){const t=hW(e);return pW(e)(t.map(a$e))}const _c={test:o$e,parse:hW,createTransformer:pW,getAnimatableNone:s$e},gW=(e,t)=>n=>`${n>0?t:e}`;function mW(e,t){return typeof e=="number"?n=>ur(e,t,n):ro.test(e)?uW(e,t):e.startsWith("var(")?gW(e,t):vW(e,t)}const yW=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>mW(o,t[a]));return o=>{for(let a=0;a<r;a++)n[a]=i[a](o);return n}},l$e=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=mW(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},vW=(e,t)=>{const n=_c.createTransformer(t),r=uS(e),i=uS(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?rc(yW(r.values,i.values),n):gW(e,t)},U0=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},C7=(e,t)=>n=>ur(e,t,n);function u$e(e){return typeof e=="number"?C7:typeof e=="string"?ro.test(e)?uW:vW:Array.isArray(e)?yW:typeof e=="object"?l$e:C7}function c$e(e,t,n){const r=[],i=n||u$e(e[0]),o=e.length-1;for(let a=0;a<o;a++){let s=i(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||vr:t;s=rc(l,s)}r.push(s)}return r}function bW(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(kP(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=c$e(t,r,i),s=a.length,l=u=>{let c=0;if(s>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=U0(e[c],e[c+1],u);return a[c](d)};return n?u=>l(bc(e[0],e[o-1],u)):l}function d$e(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=U0(0,t,r);e.push(ur(n,1,i))}}function f$e(e){const t=[0];return d$e(t,e.length-1),t}function h$e(e,t){return e.map(n=>n*t)}function p$e(e,t){return e.map(()=>t||rW).splice(0,e.length-1)}function cS({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Q7e(r)?r.map(x7):x7(r),o={done:!1,value:t[0]},a=h$e(n&&n.length===t.length?n:f$e(t),e),s=bW(a,t,{ease:Array.isArray(i)?i:p$e(t,i)});return{calculatedDuration:e,next:l=>(o.value=s(l),o.done=l>=e,o)}}function _W(e,t){return t?e*(1e3/t):0}const g$e=5;function SW(e,t,n){const r=Math.max(t-g$e,0);return _W(n-e(r),t-r)}const G5=.001,m$e=.01,A7=10,y$e=.05,v$e=1;function b$e({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;z7e(e<=ic(A7));let a=1-t;a=bc(y$e,v$e,a),e=bc(m$e,A7,Vl(e)),a<1?(i=u=>{const c=u*a,d=c*e,f=c-n,h=$E(u,a),p=Math.exp(-d);return G5-f/h*p},o=u=>{const d=u*a*e,f=d*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-d),m=$E(Math.pow(u,2),a);return(-i(u)+G5>0?-1:1)*((f-h)*p)/m}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-G5+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const s=5/e,l=S$e(i,o,s);if(e=ic(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const _$e=12;function S$e(e,t,n){let r=n;for(let i=1;i<_$e;i++)r=r-e(r)/t(r);return r}function $E(e,t){return e*Math.sqrt(1-t*t)}const x$e=["duration","bounce"],w$e=["stiffness","damping","mass"];function E7(e,t){return t.some(n=>e[n]!==void 0)}function C$e(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!E7(e,w$e)&&E7(e,x$e)){const n=b$e(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function xW({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:f}=C$e(r),h=c?-Vl(c):0,p=l/(2*Math.sqrt(s*u)),m=o-i,_=Vl(Math.sqrt(s/u)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let y;if(p<1){const g=$E(_,p);y=v=>{const S=Math.exp(-p*_*v);return o-S*((h+p*_*m)/g*Math.sin(g*v)+m*Math.cos(g*v))}}else if(p===1)y=g=>o-Math.exp(-_*g)*(m+(h+_*m)*g);else{const g=_*Math.sqrt(p*p-1);y=v=>{const S=Math.exp(-p*_*v),w=Math.min(g*v,300);return o-S*((h+p*_*m)*Math.sinh(w)+g*m*Math.cosh(w))/g}}return{calculatedDuration:f&&d||null,next:g=>{const v=y(g);if(f)a.done=g>=d;else{let S=h;g!==0&&(p<1?S=SW(y,g,v):S=0);const w=Math.abs(S)<=n,x=Math.abs(o-v)<=t;a.done=w&&x}return a.value=a.done?o:v,a}}}function T7({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=C=>s!==void 0&&C<s||l!==void 0&&C>l,p=C=>s===void 0?l:l===void 0||Math.abs(s-C)<Math.abs(l-C)?s:l;let m=n*t;const _=d+m,b=a===void 0?_:a(_);b!==_&&(m=b-d);const y=C=>-m*Math.exp(-C/r),g=C=>b+y(C),v=C=>{const T=y(C),E=g(C);f.done=Math.abs(T)<=u,f.value=f.done?b:E};let S,w;const x=C=>{h(f.value)&&(S=C,w=xW({keyframes:[f.value,p(f.value)],velocity:SW(g,C,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:C=>{let T=!1;return!w&&S===void 0&&(T=!0,v(C),x(C)),S!==void 0&&C>S?w.next(C-S):(!T&&v(C),f)}}}const A$e=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Nn.update(t,!0),stop:()=>tu(t),now:()=>ji.isProcessing?ji.timestamp:performance.now()}},k7=2e4;function P7(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<k7;)t+=n,r=e.next(t);return t>=k7?1/0:t}const E$e={decay:T7,inertia:T7,tween:cS,keyframes:cS,spring:xW};function dS({autoplay:e=!0,delay:t=0,driver:n=A$e,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...f}){let h=1,p=!1,m,_;const b=()=>{_=new Promise(B=>{m=B})};b();let y;const g=E$e[i]||cS;let v;g!==cS&&typeof r[0]!="number"&&(v=bW([0,100],r,{clamp:!1}),r=[0,100]);const S=g({...f,keyframes:r});let w;s==="mirror"&&(w=g({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let x="idle",C=null,T=null,E=null;S.calculatedDuration===null&&o&&(S.calculatedDuration=P7(S));const{calculatedDuration:P}=S;let N=1/0,O=1/0;P!==null&&(N=P+a,O=N*(o+1)-a);let A=0;const k=B=>{if(T===null)return;h>0&&(T=Math.min(T,B)),h<0&&(T=Math.min(B-O/h,T)),C!==null?A=C:A=Math.round(B-T)*h;const U=A-t*(h>=0?1:-1),G=h>=0?U<0:U>O;A=Math.max(U,0),x==="finished"&&C===null&&(A=O);let Y=A,ee=S;if(o){const ne=A/N;let se=Math.floor(ne),be=ne%1;!be&&ne>=1&&(be=1),be===1&&se--,se=Math.min(se,o+1);const ce=!!(se%2);ce&&(s==="reverse"?(be=1-be,a&&(be-=a/N)):s==="mirror"&&(ee=w));let bt=bc(0,1,be);A>O&&(bt=s==="reverse"&&ce?1:0),Y=bt*N}const J=G?{done:!1,value:r[0]}:ee.next(Y);v&&(J.value=v(J.value));let{done:j}=J;!G&&P!==null&&(j=h>=0?A>=O:A<=0);const Q=C===null&&(x==="finished"||x==="running"&&j);return d&&d(J.value),Q&&M(),J},D=()=>{y&&y.stop(),y=void 0},L=()=>{x="idle",D(),m(),b(),T=E=null},M=()=>{x="finished",c&&c(),D(),m()},R=()=>{if(p)return;y||(y=n(k));const B=y.now();l&&l(),C!==null?T=B-C:(!T||x==="finished")&&(T=B),x==="finished"&&b(),E=T,C=null,x="running",y.start()};e&&R();const $={then(B,U){return _.then(B,U)},get time(){return Vl(A)},set time(B){B=ic(B),A=B,C!==null||!y||h===0?C=B:T=y.now()-B/h},get duration(){const B=S.calculatedDuration===null?P7(S):S.calculatedDuration;return Vl(B)},get speed(){return h},set speed(B){B===h||!y||(h=B,$.time=Vl(A))},get state(){return x},play:R,pause:()=>{x="paused",C=A},stop:()=>{p=!0,x!=="idle"&&(x="idle",u&&u(),L())},cancel:()=>{E!==null&&k(E),L()},complete:()=>{x="finished"},sample:B=>(T=0,k(B))};return $}function T$e(e){let t;return()=>(t===void 0&&(t=e()),t)}const k$e=T$e(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),P$e=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),p1=10,I$e=2e4,R$e=(e,t)=>t.type==="spring"||e==="backgroundColor"||!JH(t.ease);function O$e(e,t,{onUpdate:n,onComplete:r,...i}){if(!(k$e()&&P$e.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(y=>{s=y})};u();let{keyframes:c,duration:d=300,ease:f,times:h}=i;if(R$e(t,i)){const y=dS({...i,repeat:0,delay:0});let g={done:!1,value:c[0]};const v=[];let S=0;for(;!g.done&&S<I$e;)g=y.sample(S),v.push(g.value),S+=p1;h=void 0,c=v,d=S-p1,f="linear"}const p=U7e(e.owner.current,t,c,{...i,duration:d,ease:f,times:h}),m=()=>p.cancel(),_=()=>{Nn.update(m),s(),u()};return p.onfinish=()=>{e.set(V7e(c,i)),r&&r(),_()},{then(y,g){return l.then(y,g)},attachTimeline(y){return p.timeline=y,p.onfinish=null,vr},get time(){return Vl(p.currentTime||0)},set time(y){p.currentTime=ic(y)},get speed(){return p.playbackRate},set speed(y){p.playbackRate=y},get duration(){return Vl(d)},play:()=>{a||(p.play(),tu(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,p.playState==="idle")return;const{currentTime:y}=p;if(y){const g=dS({...i,autoplay:!1});e.setWithVelocity(g.sample(y-p1).value,g.sample(y).value,p1)}_()},complete:()=>p.finish(),cancel:_}}function M$e({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:vr,pause:vr,stop:vr,then:o=>(o(),Promise.resolve()),cancel:vr,complete:vr});return t?dS({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const $$e={type:"spring",stiffness:500,damping:25,restSpeed:10},N$e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),D$e={type:"keyframes",duration:.8},L$e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},F$e=(e,{keyframes:t})=>t.length>2?D$e:af.has(e)?e.startsWith("scale")?N$e(t[1]):$$e:L$e,NE=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_c.test(t)||t==="0")&&!t.startsWith("url(")),B$e=new Set(["brightness","contrast","saturate","opacity"]);function z$e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ww)||[];if(!r)return e;const i=n.replace(r,"");let o=B$e.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const j$e=/([a-z-]*)\(.*?\)/g,DE={..._c,getAnimatableNone:e=>{const t=e.match(j$e);return t?t.map(z$e).join(" "):e}},U$e={...DH,color:ro,backgroundColor:ro,outlineColor:ro,fill:ro,stroke:ro,borderColor:ro,borderTopColor:ro,borderRightColor:ro,borderBottomColor:ro,borderLeftColor:ro,filter:DE,WebkitFilter:DE},OP=e=>U$e[e];function wW(e,t){let n=OP(e);return n!==DE&&(n=_c),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const CW=e=>/^0[^.\s]+$/.test(e);function V$e(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||CW(e)}function G$e(e,t,n,r){const i=NE(t,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;u<o.length;u++)o[u]===null&&(o[u]=u===0?a:o[u-1]),V$e(o[u])&&l.push(u),typeof o[u]=="string"&&o[u]!=="none"&&o[u]!=="0"&&(s=o[u]);if(i&&l.length&&s)for(let u=0;u<l.length;u++){const c=l[u];o[c]=wW(t,s)}return o}function q$e({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function AW(e,t){return e[t]||e.default||e}const MP=(e,t,n,r={})=>i=>{const o=AW(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s=s-ic(a);const l=G$e(t,e,n,o),u=l[0],c=l[l.length-1],d=NE(e,u),f=NE(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:p=>{t.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(q$e(o)||(h={...h,...F$e(e,h)}),h.duration&&(h.duration=ic(h.duration)),h.repeatDelay&&(h.repeatDelay=ic(h.repeatDelay)),!d||!f||j7e.current||o.type===!1)return M$e(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=O$e(t,e,h);if(p)return p}return dS(h)};function fS(e){return!!(Lo(e)&&e.add)}const EW=e=>/^\-?\d*\.?\d+$/.test(e);function $P(e,t){e.indexOf(t)===-1&&e.push(t)}function NP(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class DP{constructor(){this.subscriptions=[]}add(t){return $P(this.subscriptions,t),()=>NP(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const a=this.subscriptions[o];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const H$e=e=>!isNaN(parseFloat(e));class W$e{constructor(t,n={}){this.version="10.16.1",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:o,timestamp:a}=ji;this.lastUpdated!==a&&(this.timeDelta=o,this.lastUpdated=a,Nn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Nn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=H$e(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new DP);const r=this.events[t].add(n);return t==="change"?()=>{r(),Nn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?_W(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gp(e,t){return new W$e(e,t)}const TW=e=>t=>t.test(e),K$e={test:e=>e==="auto",parse:e=>e},kW=[sf,st,el,xu,e7e,JMe,K$e],mg=e=>kW.find(TW(e)),Q$e=[...kW,ro,_c],X$e=e=>Q$e.find(TW(e));function Y$e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,gp(n))}function Z$e(e,t){const n=Aw(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=p7e(o[a]);Y$e(e,a,s)}}function J$e(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;s<a;s++){const l=o[s],u=t[l];let c=null;Array.isArray(u)&&(c=u[0]),c===null&&(c=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),c!=null&&(typeof c=="string"&&(EW(c)||CW(c))?c=parseFloat(c):!X$e(c)&&_c.test(u)&&(c=wW(l,u)),e.addValue(l,gp(c,{owner:e})),n[l]===void 0&&(n[l]=c),c!==null&&e.setBaseTarget(l,c))}}function eNe(e,t){return t?(t[e]||t.default||t).from:void 0}function tNe(e,t,n){const r={};for(const i in e){const o=eNe(i,t);if(o!==void 0)r[i]=o;else{const a=n.getValue(i);a&&(r[i]=a.get())}}return r}function nNe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function PW(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const f=e.getValue(d),h=s[d];if(!f||h===void 0||c&&nNe(c,d))continue;const p={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!f.hasAnimated){const _=e.getProps()[B7e];_&&(p.elapsed=window.HandoffAppearAnimations(_,d,f,Nn))}f.start(MP(d,f,h,e.shouldReduceMotion&&af.has(d)?{type:!1}:p));const m=f.animation;fS(l)&&(l.add(d),m.then(()=>l.remove(d))),u.push(m)}return a&&Promise.all(u).then(()=>{a&&Z$e(e,a)}),u}function LE(e,t,n={}){const r=Aw(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(PW(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return rNe(e,t,u+l,c,d,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[l,u]=s==="beforeChildren"?[o,a]:[a,o];return l().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function rNe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(iNe).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(LE(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function iNe(e,t){return e.sortNodePosition(t)}function oNe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>LE(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=LE(e,t,n);else{const i=typeof t=="function"?Aw(e,t,n.custom):t;r=Promise.all(PW(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const aNe=[...yP].reverse(),sNe=yP.length;function lNe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>oNe(e,n,r)))}function uNe(e){let t=lNe(e);const n=dNe();let r=!0;const i=(l,u)=>{const c=Aw(e,u);if(c){const{transition:d,transitionEnd:f,...h}=c;l={...l,...h,...f}}return l};function o(l){t=l(e)}function a(l,u){const c=e.getProps(),d=e.getVariantContext(!0)||{},f=[],h=new Set;let p={},m=1/0;for(let b=0;b<sNe;b++){const y=aNe[b],g=n[y],v=c[y]!==void 0?c[y]:d[y],S=z0(v),w=y===u?g.isActive:null;w===!1&&(m=b);let x=v===d[y]&&v!==c[y]&&S;if(x&&r&&e.manuallyAnimateOnMount&&(x=!1),g.protectedKeys={...p},!g.isActive&&w===null||!v&&!g.prevProp||Sw(v)||typeof v=="boolean")continue;const C=cNe(g.prevProp,v);let T=C||y===u&&g.isActive&&!x&&S||b>m&&S;const E=Array.isArray(v)?v:[v];let P=E.reduce(i,{});w===!1&&(P={});const{prevResolvedValues:N={}}=g,O={...N,...P},A=k=>{T=!0,h.delete(k),g.needsAnimating[k]=!0};for(const k in O){const D=P[k],L=N[k];p.hasOwnProperty(k)||(D!==L?lS(D)&&lS(L)?!YH(D,L)||C?A(k):g.protectedKeys[k]=!0:D!==void 0?A(k):h.add(k):D!==void 0&&h.has(k)?A(k):g.protectedKeys[k]=!0)}g.prevProp=v,g.prevResolvedValues=P,g.isActive&&(p={...p,...P}),r&&e.blockInitialAnimation&&(T=!1),T&&!x&&f.push(...E.map(k=>({animation:k,options:{type:y,...l}})))}if(h.size){const b={};h.forEach(y=>{const g=e.getBaseTarget(y);g!==void 0&&(b[y]=g)}),f.push({animation:b})}let _=!!f.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(f):Promise.resolve()}function s(l,u,c){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(c,l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function cNe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!YH(t,e):!1}function Gc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dNe(){return{animate:Gc(!0),whileInView:Gc(),whileHover:Gc(),whileTap:Gc(),whileDrag:Gc(),whileFocus:Gc(),exit:Gc()}}class fNe extends Lc{constructor(t){super(t),t.animationState||(t.animationState=uNe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Sw(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let hNe=0;class pNe extends Lc{constructor(){super(...arguments),this.id=hNe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const o=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&o.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const gNe={animation:{Feature:fNe},exit:{Feature:pNe}},I7=(e,t)=>Math.abs(e-t);function mNe(e,t){const n=I7(e.x,t.x),r=I7(e.y,t.y);return Math.sqrt(n**2+r**2)}class IW{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=H5(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,d=mNe(u.offset,{x:0,y:0})>=3;if(!c&&!d)return;const{point:f}=u,{timestamp:h}=ji;this.history.push({...f,timestamp:h});const{onStart:p,onMove:m}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=q5(c,this.transformPagePoint),Nn.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,h=H5(u.type==="pointercancel"?this.lastMoveEventInfo:q5(c,this.transformPagePoint),this.history);this.startEvent&&d&&d(u,h),f&&f(u,h)},!HH(t))return;this.handlers=n,this.transformPagePoint=r;const i=Cw(t),o=q5(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=ji;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,H5(o,this.history)),this.removeListeners=rc(Ul(window,"pointermove",this.handlePointerMove),Ul(window,"pointerup",this.handlePointerUp),Ul(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),tu(this.updatePoint)}}function q5(e,t){return t?{point:t(e.point)}:e}function R7(e,t){return{x:e.x-t.x,y:e.y-t.y}}function H5({point:e},t){return{point:e,delta:R7(e,RW(t)),offset:R7(e,yNe(t)),velocity:vNe(t,.1)}}function yNe(e){return e[0]}function RW(e){return e[e.length-1]}function vNe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=RW(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ic(t)));)n--;if(!r)return{x:0,y:0};const o=Vl(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ia(e){return e.max-e.min}function FE(e,t=0,n=.01){return Math.abs(e-t)<=n}function O7(e,t,n,r=.5){e.origin=r,e.originPoint=ur(t.min,t.max,e.origin),e.scale=ia(n)/ia(t),(FE(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ur(n.min,n.max,e.origin)-e.originPoint,(FE(e.translate)||isNaN(e.translate))&&(e.translate=0)}function fm(e,t,n,r){O7(e.x,t.x,n.x,r?r.originX:void 0),O7(e.y,t.y,n.y,r?r.originY:void 0)}function M7(e,t,n){e.min=n.min+t.min,e.max=e.min+ia(t)}function bNe(e,t,n){M7(e.x,t.x,n.x),M7(e.y,t.y,n.y)}function $7(e,t,n){e.min=t.min-n.min,e.max=e.min+ia(t)}function hm(e,t,n){$7(e.x,t.x,n.x),$7(e.y,t.y,n.y)}function _Ne(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ur(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ur(n,e,r.max):Math.min(e,n)),e}function N7(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function SNe(e,{top:t,left:n,bottom:r,right:i}){return{x:N7(e.x,n,i),y:N7(e.y,t,r)}}function D7(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function xNe(e,t){return{x:D7(e.x,t.x),y:D7(e.y,t.y)}}function wNe(e,t){let n=.5;const r=ia(e),i=ia(t);return i>r?n=U0(t.min,t.max-r,e.min):r>i&&(n=U0(e.min,e.max-i,t.min)),bc(0,1,n)}function CNe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const BE=.35;function ANe(e=BE){return e===!1?e=0:e===!0&&(e=BE),{x:L7(e,"left","right"),y:L7(e,"top","bottom")}}function L7(e,t,n){return{min:F7(e,t),max:F7(e,n)}}function F7(e,t){return typeof e=="number"?e:e[t]||0}const B7=()=>({translate:0,scale:1,origin:0,originPoint:0}),th=()=>({x:B7(),y:B7()}),z7=()=>({min:0,max:0}),Dr=()=>({x:z7(),y:z7()});function ks(e){return[e("x"),e("y")]}function OW({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ENe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function TNe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function W5(e){return e===void 0||e===1}function zE({scale:e,scaleX:t,scaleY:n}){return!W5(e)||!W5(t)||!W5(n)}function Xc(e){return zE(e)||MW(e)||e.z||e.rotate||e.rotateX||e.rotateY}function MW(e){return j7(e.x)||j7(e.y)}function j7(e){return e&&e!=="0%"}function hS(e,t,n){const r=e-n,i=t*r;return n+i}function U7(e,t,n,r,i){return i!==void 0&&(e=hS(e,i,r)),hS(e,n,r)+t}function jE(e,t=0,n=1,r,i){e.min=U7(e.min,t,n,r,i),e.max=U7(e.max,t,n,r,i)}function $W(e,{x:t,y:n}){jE(e.x,t.translate,t.scale,t.originPoint),jE(e.y,n.translate,n.scale,n.originPoint)}function kNe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;s<i;s++){o=n[s],a=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&nh(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,$W(e,a)),r&&Xc(o.latestValues)&&nh(e,o.latestValues))}t.x=V7(t.x),t.y=V7(t.y)}function V7(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function Tu(e,t){e.min=e.min+t,e.max=e.max+t}function G7(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,a=ur(e.min,e.max,o);jE(e,t[n],t[r],a,t.scale)}const PNe=["x","scaleX","originX"],INe=["y","scaleY","originY"];function nh(e,t){G7(e.x,t,PNe),G7(e.y,t,INe)}function NW(e,t){return OW(TNe(e.getBoundingClientRect(),t))}function RNe(e,t,n){const r=NW(e,n),{scroll:i}=t;return i&&(Tu(r.x,i.offset.x),Tu(r.y,i.offset.y)),r}const ONe=new WeakMap;class MNe{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Dr(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(Cw(l,"page").point)},o=(l,u)=>{const{drag:c,dragPropagation:d,onDragStart:f}=this.getProps();if(c&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=KH(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ks(p=>{let m=this.getAxisMotionValue(p).get()||0;if(el.test(m)){const{projection:_}=this.visualElement;if(_&&_.layout){const b=_.layout.layoutBox[p];b&&(m=ia(b)*(parseFloat(m)/100))}}this.originPoint[p]=m}),f&&Nn.update(()=>f(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:d,onDirectionLock:f,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(d&&this.currentDirection===null){this.currentDirection=$Ne(p),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new IW(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Nn.update(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!g1(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=_Ne(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Jf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=SNe(r.layoutBox,t):this.constraints=!1,this.elastic=ANe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ks(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=CNe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Jf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=RNe(r,i.root,this.visualElement.getTransformPagePoint());let a=xNe(i.layout.layoutBox,o);if(n){const s=n(ENe(a));this.hasMutatedConstraints=!!s,s&&(a=OW(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=ks(c=>{if(!g1(c,n,this.currentDirection))return;let d=l&&l[c]||{};a&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(MP(t,r,0,n))}stopAnimation(){ks(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ks(n=>{const{drag:r}=this.getProps();if(!g1(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-ur(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Jf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ks(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();i[a]=wNe({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ks(a=>{if(!g1(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(ur(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;ONe.set(this.visualElement,this);const t=this.visualElement.current,n=Ul(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Jf(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const a=Ll(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(ks(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=BE,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function g1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $Ne(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class NNe extends Lc{constructor(t){super(t),this.removeGroupControls=vr,this.removeListeners=vr,this.controls=new MNe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vr}unmount(){this.removeGroupControls(),this.removeListeners()}}const q7=e=>(t,n)=>{e&&Nn.update(()=>e(t,n))};class DNe extends Lc{constructor(){super(...arguments),this.removePointerDownListener=vr}onPointerDown(t){this.session=new IW(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:q7(t),onStart:q7(n),onMove:r,onEnd:(o,a)=>{delete this.session,i&&Nn.update(()=>i(o,a))}}}mount(){this.removePointerDownListener=Ul(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function LNe(){const e=I.useContext(Vy);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=I.useId();return I.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function FNe(){return BNe(I.useContext(Vy))}function BNe(e){return e===null?!0:e.isPresent}const mb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function H7(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const yg={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=H7(e,t.target.x),r=H7(e,t.target.y);return`${n}% ${r}%`}},zNe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=_c.parse(e);if(i.length>5)return r;const o=_c.createTransformer(e),a=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;const u=ur(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),o(i)}};class jNe extends An.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;HMe(UNe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),mb.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Nn.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function DW(e){const[t,n]=LNe(),r=I.useContext(bP);return An.createElement(jNe,{...e,layoutGroup:r,switchLayoutGroup:I.useContext(RH),isPresent:t,safeToRemove:n})}const UNe={borderRadius:{...yg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:yg,borderTopRightRadius:yg,borderBottomLeftRadius:yg,borderBottomRightRadius:yg,boxShadow:zNe},LW=["TopLeft","TopRight","BottomLeft","BottomRight"],VNe=LW.length,W7=e=>typeof e=="string"?parseFloat(e):e,K7=e=>typeof e=="number"||st.test(e);function GNe(e,t,n,r,i,o){i?(e.opacity=ur(0,n.opacity!==void 0?n.opacity:1,qNe(r)),e.opacityExit=ur(t.opacity!==void 0?t.opacity:1,0,HNe(r))):o&&(e.opacity=ur(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;a<VNe;a++){const s=`border${LW[a]}Radius`;let l=Q7(t,s),u=Q7(n,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||K7(l)===K7(u)?(e[s]=Math.max(ur(W7(l),W7(u),r),0),(el.test(u)||el.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||n.rotate)&&(e.rotate=ur(t.rotate||0,n.rotate||0,r))}function Q7(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const qNe=FW(0,.5,PP),HNe=FW(.5,.95,vr);function FW(e,t,n){return r=>r<e?0:r>t?1:n(U0(e,t,r))}function X7(e,t){e.min=t.min,e.max=t.max}function pa(e,t){X7(e.x,t.x),X7(e.y,t.y)}function Y7(e,t,n,r,i){return e-=t,e=hS(e,1/n,r),i!==void 0&&(e=hS(e,1/i,r)),e}function WNe(e,t=0,n=1,r=.5,i,o=e,a=e){if(el.test(t)&&(t=parseFloat(t),t=ur(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=ur(o.min,o.max,r);e===o&&(s-=t),e.min=Y7(e.min,t,n,s,i),e.max=Y7(e.max,t,n,s,i)}function Z7(e,t,[n,r,i],o,a){WNe(e,t[n],t[r],t[i],t.scale,o,a)}const KNe=["x","scaleX","originX"],QNe=["y","scaleY","originY"];function J7(e,t,n,r){Z7(e.x,t,KNe,n?n.x:void 0,r?r.x:void 0),Z7(e.y,t,QNe,n?n.y:void 0,r?r.y:void 0)}function e$(e){return e.translate===0&&e.scale===1}function BW(e){return e$(e.x)&&e$(e.y)}function XNe(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function zW(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function t$(e){return ia(e.x)/ia(e.y)}class YNe{constructor(){this.members=[]}add(t){$P(this.members,t),t.scheduleRender()}remove(t){if(NP(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function n$(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const ZNe=(e,t)=>e.depth-t.depth;class JNe{constructor(){this.children=[],this.isDirty=!1}add(t){$P(this.children,t),this.isDirty=!0}remove(t){NP(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ZNe),this.isDirty=!1,this.children.forEach(t)}}function eDe(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(tu(r),e(o-t))};return Nn.read(r,!0),()=>tu(r)}function tDe(e){window.MotionDebug&&window.MotionDebug.record(e)}function nDe(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rDe(e,t,n){const r=Lo(e)?e:gp(e);return r.start(MP("",r,t,n)),r.animation}const r$=["","X","Y","Z"],i$=1e3;let iDe=0;const Yc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function jW({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},s=t==null?void 0:t()){this.id=iDe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Yc.totalNodes=Yc.resolvedTargetDeltas=Yc.recalculatedProjection=0,this.nodes.forEach(sDe),this.nodes.forEach(fDe),this.nodes.forEach(hDe),this.nodes.forEach(lDe),tDe(Yc)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new JNe)}addEventListener(a,s){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new DP),this.eventHandlers.get(a).add(s)}notifyListeners(a,...s){const l=this.eventHandlers.get(a);l&&l.notify(...s)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=nDe(a),this.instance=a;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=eDe(f,250),mb.hasAnimatedSinceResize&&(mb.hasAnimatedSinceResize=!1,this.nodes.forEach(a$))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||vDe,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!zW(this.targetLayout,p)||h,g=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const v={...AW(m,"layout"),onPlay:_,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v)}else f||a$(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,tu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(pDe),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(o$);return}this.isUpdating||this.nodes.forEach(cDe),this.isUpdating=!1,this.nodes.forEach(dDe),this.nodes.forEach(oDe),this.nodes.forEach(aDe),this.clearAllSnapshots();const s=performance.now();ji.delta=bc(0,1e3/60,s-ji.timestamp),ji.timestamp=s,ji.isProcessing=!0,L5.update.process(ji),L5.preRender.process(ji),L5.render.process(ji),ji.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(uDe),this.sharedNodes.forEach(gDe)}scheduleUpdateProjection(){Nn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Nn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Dr(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let s=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(s=!1),s&&(this.scroll={animationId:this.root.animationId,phase:a,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform,s=this.projectionDelta&&!BW(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;a&&(s||Xc(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return a&&(l=this.removeTransform(l)),bDe(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return Dr();const s=a.measureViewportBox(),{scroll:l}=this.root;return l&&(Tu(s.x,l.offset.x),Tu(s.y,l.offset.y)),s}removeElementScroll(a){const s=Dr();pa(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:d}=u;if(u!==this.root&&c&&d.layoutScroll){if(c.isRoot){pa(s,a);const{scroll:f}=this.root;f&&(Tu(s.x,-f.offset.x),Tu(s.y,-f.offset.y))}Tu(s.x,c.offset.x),Tu(s.y,c.offset.y)}}return s}applyTransform(a,s=!1){const l=Dr();pa(l,a);for(let u=0;u<this.path.length;u++){const c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&nh(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Xc(c.latestValues)&&nh(l,c.latestValues)}return Xc(this.latestValues)&&nh(l,this.latestValues),l}removeTransform(a){const s=Dr();pa(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Xc(u.latestValues))continue;zE(u.latestValues)&&u.updateSnapshot();const c=Dr(),d=u.measurePageBox();pa(c,d),J7(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Xc(this.latestValues)&&J7(s,this.latestValues),s}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ji.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var s;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=ji.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Dr(),this.relativeTargetOrigin=Dr(),hm(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),pa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Dr(),this.targetWithTransforms=Dr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bNe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):pa(this.target,this.layout.layoutBox),$W(this.target,this.targetDelta)):pa(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Dr(),this.relativeTargetOrigin=Dr(),hm(this.relativeTargetOrigin,this.target,h.target),pa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Yc.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||zE(this.parent.latestValues)||MW(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var a;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ji.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;pa(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;kNe(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox);const{target:p}=s;if(!p){this.projectionTransform&&(this.projectionDelta=th(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=th(),this.projectionDeltaWithTransform=th());const m=this.projectionTransform;fm(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=n$(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==f||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Yc.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),a){const s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(a,s=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=th();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=Dr(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,_=this.getStack(),b=!_||_.members.length<=1,y=!!(m&&!b&&this.options.crossfade===!0&&!this.path.some(yDe));this.animationProgress=0;let g;this.mixTargetDelta=v=>{const S=v/1e3;s$(d.x,a.x,S),s$(d.y,a.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hm(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mDe(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&XNe(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=Dr()),pa(g,this.relativeTarget)),m&&(this.animationValues=c,GNe(c,u,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(tu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Nn.update(()=>{mb.hasAnimatedSinceResize=!0,this.currentAnimation=rDe(0,i$,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(i$),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&UW(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Dr();const d=ia(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+d;const f=ia(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}pa(s,l),nh(s,c),fm(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new YNe),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c<r$.length;c++){const d="rotate"+r$[c];l[d]&&(u[d]=l[d],a.setStaticValue(d,0))}a.render();for(const c in u)a.setStaticValue(c,u[c]);a.scheduleRender()}getProjectionStyles(a={}){var s,l;const u={};if(!this.instance||this.isSVG)return u;if(this.isVisible)u.visibility="";else return{visibility:"hidden"};const c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=gb(a.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=gb(a.pointerEvents)||""),this.hasProjected&&!Xc(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=n$(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const m in aS){if(f[m]===void 0)continue;const{correct:_,applyTo:b}=aS[m],y=u.transform==="none"?f[m]:_(f[m],d);if(b){const g=b.length;for(let v=0;v<g;v++)u[b[v]]=y}else u[m]=y}return this.options.layoutId&&(u.pointerEvents=d===this?gb(a.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(o$),this.root.sharedNodes.clear()}}}function oDe(e){e.updateLayout()}function aDe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;o==="size"?ks(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=ia(f);f.min=r[d].min,f.max=f.min+h}):UW(o,n.layoutBox,r)&&ks(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=ia(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const s=th();fm(s,r,n.layoutBox);const l=th();a?fm(l,e.applyTransform(i,!0),n.measuredBox):fm(l,r,n.layoutBox);const u=!BW(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const p=Dr();hm(p,n.layoutBox,f.layoutBox);const m=Dr();hm(m,r,h.layoutBox),zW(p,m)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function sDe(e){Yc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function lDe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function uDe(e){e.clearSnapshot()}function o$(e){e.clearMeasurements()}function cDe(e){e.isLayoutDirty=!1}function dDe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function a$(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function fDe(e){e.resolveTargetDelta()}function hDe(e){e.calcProjection()}function pDe(e){e.resetRotation()}function gDe(e){e.removeLeadSnapshot()}function s$(e,t,n){e.translate=ur(t.translate,0,n),e.scale=ur(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function l$(e,t,n,r){e.min=ur(t.min,n.min,r),e.max=ur(t.max,n.max,r)}function mDe(e,t,n,r){l$(e.x,t.x,n.x,r),l$(e.y,t.y,n.y,r)}function yDe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vDe={duration:.45,ease:[.4,0,.1,1]},u$=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),c$=u$("applewebkit/")&&!u$("chrome/")?Math.round:vr;function d$(e){e.min=c$(e.min),e.max=c$(e.max)}function bDe(e){d$(e.x),d$(e.y)}function UW(e,t,n){return e==="position"||e==="preserve-aspect"&&!FE(t$(t),t$(n),.2)}const _De=jW({attachResizeListener:(e,t)=>Ll(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),K5={current:void 0},VW=jW({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!K5.current){const e=new _De({});e.mount(window),e.setOptions({layoutScroll:!0}),K5.current=e}return K5.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SDe={pan:{Feature:DNe},drag:{Feature:NNe,ProjectionNode:VW,MeasureLayout:DW}},xDe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function wDe(e){const t=xDe.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function UE(e,t,n=1){const[r,i]=wDe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return EW(a)?parseFloat(a):a}else return RE(i)?UE(i,t,n+1):i}function CDe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!RE(o))return;const a=UE(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!RE(o))continue;const a=UE(o,r);a&&(t[i]=a,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const ADe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),GW=e=>ADe.has(e),EDe=e=>Object.keys(e).some(GW),f$=e=>e===sf||e===st,h$=(e,t)=>parseFloat(e.split(", ")[t]),p$=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return h$(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?h$(o[1],e):0}},TDe=new Set(["x","y","z"]),kDe=Gy.filter(e=>!TDe.has(e));function PDe(e){const t=[];return kDe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const mp={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:p$(4,13),y:p$(5,14)};mp.translateX=mp.x;mp.translateY=mp.y;const IDe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=mp[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=mp[u](l,o)}),e},RDe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(GW);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],d=mg(c);const f=t[l];let h;if(lS(f)){const p=f.length,m=f[0]===null?1:0;c=f[m],d=mg(c);for(let _=m;_<p&&f[_]!==null;_++)h?kP(mg(f[_])===h):h=mg(f[_])}else h=mg(f);if(d!==h)if(f$(d)&&f$(h)){const p=u.get();typeof p=="string"&&u.set(parseFloat(p)),typeof f=="string"?t[l]=parseFloat(f):Array.isArray(f)&&h===st&&(t[l]=f.map(parseFloat))}else d!=null&&d.transform&&(h!=null&&h.transform)&&(c===0||f===0)?c===0?u.set(h.transform(c)):t[l]=d.transform(f):(a||(o=PDe(e),a=!0),s.push(l),r[l]=r[l]!==void 0?r[l]:t[l],u.jump(f))}),s.length){const l=s.indexOf("height")>=0?window.pageYOffset:null,u=IDe(t,e,s);return o.length&&o.forEach(([c,d])=>{e.getValue(c).set(d)}),e.render(),_w&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function ODe(e,t,n,r){return EDe(t)?RDe(e,t,n,r):{target:t,transitionEnd:r}}const MDe=(e,t,n,r)=>{const i=CDe(e,t,r);return t=i.target,r=i.transitionEnd,ODe(e,t,n,r)},VE={current:null},qW={current:!1};function $De(){if(qW.current=!0,!!_w)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>VE.current=e.matches;e.addListener(t),t()}else VE.current=!1}function NDe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(Lo(o))e.addValue(i,o),fS(r)&&r.add(i);else if(Lo(a))e.addValue(i,gp(o,{owner:e})),fS(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,gp(s!==void 0?s:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const g$=new WeakMap,HW=Object.keys(j0),DDe=HW.length,m$=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],LDe=vP.length;class FDe{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Nn.render(this.render,!1,!0);const{latestValues:s,renderState:l}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.isControllingVariants=xw(n),this.isVariantNode=IH(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const d in c){const f=c[d];s[d]!==void 0&&Lo(f)&&(f.set(s[d],!1),fS(u)&&u.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,g$.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),qW.current||$De(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:VE.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){g$.delete(this.current),this.projection&&this.projection.unmount(),tu(this.notifyUpdate),tu(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=af.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Nn.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,o){let a,s;for(let l=0;l<DDe;l++){const u=HW[l],{isEnabled:c,Feature:d,ProjectionNode:f,MeasureLayout:h}=j0[u];f&&(a=f),c(n)&&(!this.features[u]&&d&&(this.features[u]=new d(this)),h&&(s=h))}if(!this.projection&&a){this.projection=new a(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:u,drag:c,dragConstraints:d,layoutScroll:f,layoutRoot:h}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||d&&Jf(d),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:h})}return s}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Dr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<m$.length;r++){const i=m$[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o=t["on"+i];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=NDe(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<LDe;r++){const i=vP[r],o=this.props[i];(z0(o)||o===!1)&&(n[i]=o)}return n}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=gp(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=TP(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Lo(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new DP),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class WW extends FDe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=tNe(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){J$e(this,r,a);const s=MDe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function BDe(e){return window.getComputedStyle(e)}class zDe extends WW{readValueFromInstance(t,n){if(af.has(n)){const r=OP(n);return r&&r.default||0}else{const r=BDe(t),i=($H(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return NW(t,n)}build(t,n,r,i){SP(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return EP(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Lo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){zH(t,n,r,i)}}class jDe extends WW{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(af.has(n)){const r=OP(n);return r&&r.default||0}return n=jH.has(n)?n:AP(n),t.getAttribute(n)}measureInstanceViewportBox(){return Dr()}scrapeMotionValuesFromProps(t,n){return VH(t,n)}build(t,n,r,i){wP(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){UH(t,n,r,i)}mount(t){this.isSVGTag=CP(t.tagName),super.mount(t)}}const UDe=(e,t)=>_P(e)?new jDe(t,{enableHardwareAcceleration:!1}):new zDe(t,{enableHardwareAcceleration:!0}),VDe={layout:{ProjectionNode:VW,MeasureLayout:DW}},GDe={...gNe,...N7e,...SDe,...VDe},KW=GMe((e,t)=>x7e(e,t,GDe,UDe));function QW(){const e=I.useRef(!1);return mP(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function qDe(){const e=QW(),[t,n]=I.useState(0),r=I.useCallback(()=>{e.current&&n(t+1)},[t]);return[I.useCallback(()=>Nn.postRender(r),[r]),t]}class HDe extends I.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function WDe({children:e,isPresent:t}){const n=I.useId(),r=I.useRef(null),i=I.useRef({width:0,height:0,top:0,left:0});return I.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
+          [data-motion-pop-id="${n}"] {
+            position: absolute !important;
+            width: ${o}px !important;
+            height: ${a}px !important;
+            top: ${s}px !important;
+            left: ${l}px !important;
+          }
+        `),()=>{document.head.removeChild(u)}},[t]),I.createElement(HDe,{isPresent:t,childRef:r,sizeRef:i},I.cloneElement(e,{ref:r}))}const Q5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=GH(KDe),l=I.useId(),u=I.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c=>{s.set(c,!0);for(const d of s.values())if(!d)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),o?void 0:[n]);return I.useMemo(()=>{s.forEach((c,d)=>s.set(d,!1))},[n]),I.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=I.createElement(WDe,{isPresent:n},e)),I.createElement(Vy.Provider,{value:u},e)};function KDe(){return new Map}function QDe(e){return I.useEffect(()=>()=>e(),[])}const Of=e=>e.key||"";function XDe(e,t){e.forEach(n=>{const r=Of(n);t.set(r,n)})}function YDe(e){const t=[];return I.Children.forEach(e,n=>{I.isValidElement(n)&&t.push(n)}),t}const XW=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{const s=I.useContext(bP).forceRender||qDe()[0],l=QW(),u=YDe(e);let c=u;const d=I.useRef(new Map).current,f=I.useRef(c),h=I.useRef(new Map).current,p=I.useRef(!0);if(mP(()=>{p.current=!1,XDe(u,h),f.current=c}),QDe(()=>{p.current=!0,h.clear(),d.clear()}),p.current)return I.createElement(I.Fragment,null,c.map(y=>I.createElement(Q5,{key:Of(y),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},y)));c=[...c];const m=f.current.map(Of),_=u.map(Of),b=m.length;for(let y=0;y<b;y++){const g=m[y];_.indexOf(g)===-1&&!d.has(g)&&d.set(g,void 0)}return a==="wait"&&d.size&&(c=[]),d.forEach((y,g)=>{if(_.indexOf(g)!==-1)return;const v=h.get(g);if(!v)return;const S=m.indexOf(g);let w=y;if(!w){const x=()=>{h.delete(g),d.delete(g);const C=f.current.findIndex(T=>T.key===g);if(f.current.splice(C,1),!d.size){if(f.current=u,l.current===!1)return;s(),r&&r()}};w=I.createElement(Q5,{key:Of(v),isPresent:!1,onExitComplete:x,custom:t,presenceAffectsLayout:o,mode:a},v),d.set(g,w)}c.splice(S,0,w)}),c=c.map(y=>{const g=y.key;return d.has(g)?y:I.createElement(Q5,{key:Of(y),isPresent:!0,presenceAffectsLayout:o,mode:a},y)}),I.createElement(I.Fragment,null,d.size?c:c.map(y=>I.cloneElement(y)))};var ZDe={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},YW=I.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=ZDe,toastSpacing:c="0.5rem"}=e,[d,f]=I.useState(s),h=FNe();h7(()=>{h||r==null||r()},[h]),h7(()=>{f(s)},[s]);const p=()=>f(null),m=()=>f(s),_=()=>{h&&i()};I.useEffect(()=>{h&&o&&i()},[h,o,i]),NMe(_,d);const b=I.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),y=I.useMemo(()=>OMe(a),[a]);return W.jsx(KW.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:m,custom:{position:a},style:y,children:W.jsx(Oi.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Us(n,{id:t,onClose:_})})})});YW.displayName="ToastComponent";function JDe(e,t){var n;const r=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=o==null?void 0:o[t])!=null?n:r}var y$={path:W.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[W.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),W.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),W.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Ky=la((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,c=Dc("chakra-icon",s),d=Uy("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},h={ref:t,focusable:o,className:c,__css:f},p=r??y$.viewBox;if(n&&typeof n!="string")return W.jsx(Oi.svg,{as:n,...h,...u});const m=a??y$.path;return W.jsx(Oi.svg,{verticalAlign:"middle",viewBox:p,...h,...u,children:m})});Ky.displayName="Icon";function eLe(e){return W.jsx(Ky,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function tLe(e){return W.jsx(Ky,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function v$(e){return W.jsx(Ky,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var nLe=g4e({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),LP=la((e,t)=>{const n=Uy("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=zy(e),u=Dc("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${nLe} ${o} linear infinite`,...n};return W.jsx(Oi.div,{ref:t,__css:c,className:u,...l,children:r&&W.jsx(Oi.span,{srOnly:!0,children:r})})});LP.displayName="Spinner";var[rLe,FP]=By({name:"AlertContext",hookName:"useAlertContext",providerName:"<Alert />"}),[iLe,BP]=By({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:"<Alert />"}),ZW={info:{icon:tLe,colorScheme:"blue"},warning:{icon:v$,colorScheme:"orange"},success:{icon:eLe,colorScheme:"green"},error:{icon:v$,colorScheme:"red"},loading:{icon:LP,colorScheme:"blue"}};function oLe(e){return ZW[e].colorScheme}function aLe(e){return ZW[e].icon}var JW=la(function(t,n){const r=BP(),{status:i}=FP(),o={display:"inline",...r.description};return W.jsx(Oi.div,{ref:n,"data-status":i,...t,className:Dc("chakra-alert__desc",t.className),__css:o})});JW.displayName="AlertDescription";function eK(e){const{status:t}=FP(),n=aLe(t),r=BP(),i=t==="loading"?r.spinner:r.icon;return W.jsx(Oi.span,{display:"inherit","data-status":t,...e,className:Dc("chakra-alert__icon",e.className),__css:i,children:e.children||W.jsx(n,{h:"100%",w:"100%"})})}eK.displayName="AlertIcon";var tK=la(function(t,n){const r=BP(),{status:i}=FP();return W.jsx(Oi.div,{ref:n,"data-status":i,...t,className:Dc("chakra-alert__title",t.className),__css:r.title})});tK.displayName="AlertTitle";var nK=la(function(t,n){var r;const{status:i="info",addRole:o=!0,...a}=zy(t),s=(r=t.colorScheme)!=null?r:oLe(i),l=fMe("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return W.jsx(rLe,{value:{status:i},children:W.jsx(iLe,{value:l,children:W.jsx(Oi.div,{"data-status":i,role:o?"alert":void 0,ref:n,...a,className:Dc("chakra-alert",t.className),__css:u})})})});nK.displayName="Alert";function sLe(e){return W.jsx(Ky,{focusable:"false","aria-hidden":!0,...e,children:W.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var rK=la(function(t,n){const r=Uy("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=zy(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return W.jsx(Oi.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s,children:i||W.jsx(sLe,{width:"1em",height:"1em"})})});rK.displayName="CloseButton";var lLe={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Bs=uLe(lLe);function uLe(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=cLe(i,o),{position:s,id:l}=a;return r(u=>{var c,d;const h=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(d=u[s])!=null?d:[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=f7(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:iK(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(c=>({...c,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=TH(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>!!f7(Bs.getState(),i).position}}var b$=0;function cLe(e,t={}){var n,r;b$+=1;const i=(n=t.id)!=null?n:b$,o=(r=t.position)!=null?r:"bottom";return{id:i,message:e,position:o,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Bs.removeToast(String(i),o),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var dLe=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return W.jsxs(nK,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[W.jsx(eK,{children:u}),W.jsxs(Oi.div,{flex:"1",maxWidth:"100%",children:[i&&W.jsx(tK,{id:c==null?void 0:c.title,children:i}),s&&W.jsx(JW,{id:c==null?void 0:c.description,display:"block",children:s})]}),o&&W.jsx(rK,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function iK(e={}){const{render:t,toastComponent:n=dLe}=e;return i=>typeof t=="function"?t({...i,...e}):W.jsx(n,{...i,...e})}function fLe(e,t){const n=i=>{var o;return{...t,...i,position:JDe((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=iK(o);return Bs.notify(a,o)};return r.update=(i,o)=>{Bs.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...Us(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...Us(o.error,s)}))},r.closeAll=Bs.closeAll,r.close=Bs.close,r.isActive=Bs.isActive,r}var[yQe,vQe]=By({name:"ToastOptionsContext",strict:!1}),hLe=e=>{const t=I.useSyncExternalStore(Bs.subscribe,Bs.getState,Bs.getState),{motionVariants:n,component:r=YW,portalProps:i}=e,a=Object.keys(t).map(s=>{const l=t[s];return W.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${s}`,style:MMe(s),children:W.jsx(XW,{initial:!1,children:l.map(u=>W.jsx(r,{motionVariants:n,...u},u.id))})},s)});return W.jsx(hw,{...i,children:a})},pLe={duration:5e3,variant:"solid"},Tf={theme:tMe,colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{},defaultOptions:pLe,forced:!1};function gLe({theme:e=Tf.theme,colorMode:t=Tf.colorMode,toggleColorMode:n=Tf.toggleColorMode,setColorMode:r=Tf.setColorMode,defaultOptions:i=Tf.defaultOptions,motionVariants:o,toastSpacing:a,component:s,forced:l}=Tf){const u={colorMode:t,setColorMode:r,toggleColorMode:n,forced:l};return{ToastContainer:()=>W.jsx(PMe,{theme:e,children:W.jsx(sP.Provider,{value:u,children:W.jsx(hLe,{defaultOptions:i,motionVariants:o,toastSpacing:a,component:s})})}),toast:fLe(e.direction,i)}}var GE=la(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return W.jsx("img",{width:r,height:i,ref:n,alt:o,...a})});GE.displayName="NativeImage";function mLe(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=I.useState("pending");I.useEffect(()=>{c(n?"loading":"pending")},[n]);const d=I.useRef(),f=I.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,a&&(p.crossOrigin=a),r&&(p.srcset=r),s&&(p.sizes=s),t&&(p.loading=t),p.onload=m=>{h(),c("loaded"),i==null||i(m)},p.onerror=m=>{h(),c("failed"),o==null||o(m)},d.current=p},[n,a,r,s,i,o,t]),h=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return J_(()=>{if(!l)return u==="loading"&&f(),()=>{h()}},[u,f,l]),l?"loaded":u}var yLe=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function vLe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var zP=la(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||i!==void 0,_=u!=null||c||!m,b=mLe({...t,crossOrigin:d,ignoreFallback:_}),y=yLe(b,f),g={ref:n,objectFit:l,objectPosition:s,..._?p:vLe(p,["onError","onLoad"])};return y?i||W.jsx(Oi.img,{as:GE,className:"chakra-image__placeholder",src:r,...g}):W.jsx(Oi.img,{as:GE,src:o,srcSet:a,crossOrigin:d,loading:u,referrerPolicy:h,className:"chakra-image",...g})});zP.displayName="Image";var oK=la(function(t,n){const r=Uy("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=zy(t),u=yMe({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return W.jsx(Oi.p,{ref:n,className:Dc("chakra-text",t.className),...u,...l,__css:r})});oK.displayName="Text";var qE=la(function(t,n){const r=Uy("Heading",t),{className:i,...o}=zy(t);return W.jsx(Oi.h2,{ref:n,className:Dc("chakra-heading",t.className),...o,__css:r})});qE.displayName="Heading";var pS=Oi("div");pS.displayName="Box";var aK=la(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return W.jsx(pS,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});aK.displayName="Square";var bLe=la(function(t,n){const{size:r,...i}=t;return W.jsx(aK,{size:r,ref:n,borderRadius:"9999px",...i})});bLe.displayName="Circle";var jP=la(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...c}=t,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return W.jsx(Oi.div,{ref:n,__css:d,...c})});jP.displayName="Flex";const _Le=z.object({status:z.literal(422),data:z.object({detail:z.array(z.object({loc:z.array(z.string()),msg:z.string(),type:z.string()}))})});function _o(e,t,n=!1){e=String(e),t=String(t);const r=Array.from({length:21},(a,s)=>s*50),i=[0,5,10,15,20,25,30,35,40,45,50,55,59,64,68,73,77,82,86,95,100];return r.reduce((a,s,l)=>{const u=n?i[l]/100:1,c=n?50:i[r.length-1-l];return a[s]=`hsl(${e} ${t}% ${c}% / ${u})`,a},{})}const m1={H:220,S:16},y1={H:250,S:42},v1={H:47,S:42},b1={H:40,S:70},_1={H:28,S:42},S1={H:113,S:42},x1={H:0,S:42},SLe={base:_o(m1.H,m1.S),baseAlpha:_o(m1.H,m1.S,!0),accent:_o(y1.H,y1.S),accentAlpha:_o(y1.H,y1.S,!0),working:_o(v1.H,v1.S),workingAlpha:_o(v1.H,v1.S,!0),gold:_o(b1.H,b1.S),goldAlpha:_o(b1.H,b1.S,!0),warning:_o(_1.H,_1.S),warningAlpha:_o(_1.H,_1.S,!0),ok:_o(S1.H,S1.S),okAlpha:_o(S1.H,S1.S,!0),error:_o(x1.H,x1.S),errorAlpha:_o(x1.H,x1.S,!0)},{definePartsStyle:xLe,defineMultiStyleConfig:wLe}=Pt(Jq.keys),CLe={border:"none"},ALe=e=>{const{colorScheme:t}=e;return{fontWeight:"600",fontSize:"sm",border:"none",borderRadius:"base",bg:K(`${t}.200`,`${t}.700`)(e),color:K(`${t}.900`,`${t}.100`)(e),_hover:{bg:K(`${t}.250`,`${t}.650`)(e)},_expanded:{bg:K(`${t}.250`,`${t}.650`)(e),borderBottomRadius:"none",_hover:{bg:K(`${t}.300`,`${t}.600`)(e)}}}},ELe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.100`,`${t}.800`)(e),borderRadius:"base",borderTopRadius:"none"}},TLe={},kLe=xLe(e=>({container:CLe,button:ALe(e),panel:ELe(e),icon:TLe})),PLe=wLe({variants:{invokeAI:kLe},defaultProps:{variant:"invokeAI",colorScheme:"base"}}),ILe=e=>{const{colorScheme:t}=e;if(t==="base"){const r={bg:K("base.150","base.700")(e),color:K("base.300","base.500")(e),svg:{fill:K("base.300","base.500")(e)},opacity:1},i={bg:"none",color:K("base.300","base.500")(e),svg:{fill:K("base.500","base.500")(e)},opacity:1};return{bg:K("base.250","base.600")(e),color:K("base.850","base.100")(e),borderRadius:"base",svg:{fill:K("base.850","base.100")(e)},_hover:{bg:K("base.300","base.500")(e),color:K("base.900","base.50")(e),svg:{fill:K("base.900","base.50")(e)},_disabled:r},_disabled:r,'&[data-progress="true"]':{...i,_hover:i}}}const n={bg:K(`${t}.400`,`${t}.700`)(e),color:K(`${t}.600`,`${t}.500`)(e),svg:{fill:K(`${t}.600`,`${t}.500`)(e),filter:"unset"},opacity:.7,filter:"saturate(65%)"};return{bg:K(`${t}.400`,`${t}.600`)(e),color:K("base.50","base.100")(e),borderRadius:"base",svg:{fill:K("base.50","base.100")(e)},_disabled:n,_hover:{bg:K(`${t}.500`,`${t}.500`)(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)},_disabled:n}}},RLe=e=>{const{colorScheme:t}=e,n=K("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",_hover:{bg:K(`${t}.500`,`${t}.500`)(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)}},".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"}}},OLe={variants:{invokeAI:ILe,invokeAIOutline:RLe},defaultProps:{variant:"invokeAI",colorScheme:"base"}},{definePartsStyle:MLe,defineMultiStyleConfig:$Le}=Pt(eH.keys),NLe=e=>{const{colorScheme:t}=e;return{bg:K("base.200","base.700")(e),borderColor:K("base.300","base.600")(e),color:K("base.900","base.100")(e),_checked:{bg:K(`${t}.300`,`${t}.500`)(e),borderColor:K(`${t}.300`,`${t}.500`)(e),color:K(`${t}.900`,`${t}.100`)(e),_hover:{bg:K(`${t}.400`,`${t}.500`)(e),borderColor:K(`${t}.400`,`${t}.500`)(e)},_disabled:{borderColor:"transparent",bg:"whiteAlpha.300",color:"whiteAlpha.500"}},_indeterminate:{bg:K(`${t}.300`,`${t}.600`)(e),borderColor:K(`${t}.300`,`${t}.600`)(e),color:K(`${t}.900`,`${t}.100`)(e)},_disabled:{bg:"whiteAlpha.100",borderColor:"transparent"},_focusVisible:{boxShadow:"none",outline:"none"},_invalid:{borderColor:K("error.600","error.300")(e)}}},DLe=MLe(e=>({control:NLe(e)})),LLe=$Le({variants:{invokeAI:DLe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{definePartsStyle:FLe,defineMultiStyleConfig:BLe}=Pt(tH.keys),zLe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},jLe=e=>({borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6},"::selection":{color:K("accent.900","accent.50")(e),bg:K("accent.200","accent.400")(e)}}),ULe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},VLe=FLe(e=>({preview:zLe,input:jLe(e),textarea:ULe})),GLe=BLe({variants:{invokeAI:VLe},defaultProps:{size:"sm",variant:"invokeAI"}}),qLe=e=>({fontSize:"sm",marginEnd:0,mb:1,fontWeight:"400",transitionProperty:"common",transitionDuration:"normal",whiteSpace:"nowrap",_disabled:{opacity:.4},color:K("base.700","base.300")(e),_invalid:{color:K("error.500","error.300")(e)}}),HLe={variants:{invokeAI:qLe},defaultProps:{variant:"invokeAI"}},Ew=e=>({outline:"none",borderWidth:2,borderStyle:"solid",borderColor:K("base.200","base.800")(e),bg:K("base.50","base.900")(e),borderRadius:"base",color:K("base.900","base.100")(e),boxShadow:"none",_hover:{borderColor:K("base.300","base.600")(e)},_focus:{borderColor:K("accent.200","accent.600")(e),boxShadow:"none",_hover:{borderColor:K("accent.300","accent.500")(e)}},_invalid:{borderColor:K("error.300","error.600")(e),boxShadow:"none",_hover:{borderColor:K("error.400","error.500")(e)}},_disabled:{borderColor:K("base.300","base.700")(e),bg:K("base.300","base.700")(e),color:K("base.600","base.400")(e),_hover:{borderColor:K("base.300","base.700")(e)}},_placeholder:{color:K("base.700","base.400")(e)},"::selection":{bg:K("accent.200","accent.400")(e)}}),{definePartsStyle:WLe,defineMultiStyleConfig:KLe}=Pt(nH.keys),QLe=WLe(e=>({field:Ew(e)})),XLe=KLe({variants:{invokeAI:QLe},defaultProps:{size:"sm",variant:"invokeAI"}}),{definePartsStyle:YLe,defineMultiStyleConfig:ZLe}=Pt(rH.keys),JLe=YLe(e=>({button:{fontWeight:500,bg:K("base.300","base.500")(e),color:K("base.900","base.100")(e),_hover:{bg:K("base.400","base.600")(e),color:K("base.900","base.50")(e),fontWeight:600}},list:{zIndex:9999,color:K("base.900","base.150")(e),bg:K("base.200","base.800")(e),shadow:"dark-lg",border:"none"},item:{fontSize:"sm",bg:K("base.200","base.800")(e),_hover:{bg:K("base.300","base.700")(e),svg:{opacity:1}},_focus:{bg:K("base.400","base.600")(e)},svg:{opacity:.7,fontSize:14}}})),eFe=ZLe({variants:{invokeAI:JLe},defaultProps:{variant:"invokeAI"}}),bQe={variants:{enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.07,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.07,easings:"easeOut"}}}},{defineMultiStyleConfig:tFe,definePartsStyle:nFe}=Pt(iH.keys),rFe=e=>({bg:K("blackAlpha.700","blackAlpha.700")(e)}),iFe={},oFe=()=>({layerStyle:"first",maxH:"80vh"}),aFe=()=>({fontWeight:"600",fontSize:"lg",layerStyle:"first",borderTopRadius:"base",borderInlineEndRadius:"base"}),sFe={},lFe={overflowY:"scroll"},uFe={},cFe=nFe(e=>({overlay:rFe(e),dialogContainer:iFe,dialog:oFe(),header:aFe(),closeButton:sFe,body:lFe,footer:uFe})),dFe=tFe({variants:{invokeAI:cFe},defaultProps:{variant:"invokeAI",size:"lg"}}),{defineMultiStyleConfig:fFe,definePartsStyle:hFe}=Pt(oH.keys),pFe=e=>({height:8}),gFe=e=>({border:"none",fontWeight:"600",height:"auto",py:1,ps:2,pe:6,...Ew(e)}),mFe=e=>({display:"flex"}),yFe=e=>({border:"none",px:2,py:0,mx:-2,my:0,svg:{color:K("base.700","base.300")(e),width:2.5,height:2.5,_hover:{color:K("base.900","base.100")(e)}}}),vFe=hFe(e=>({root:pFe(e),field:gFe(e),stepperGroup:mFe(e),stepper:yFe(e)})),bFe=fFe({variants:{invokeAI:vFe},defaultProps:{size:"sm",variant:"invokeAI"}}),{defineMultiStyleConfig:_Fe,definePartsStyle:sK}=Pt(aH.keys),lK=hr("popper-bg"),uK=hr("popper-arrow-bg"),cK=hr("popper-arrow-shadow-color"),SFe=e=>({[uK.variable]:K("colors.base.100","colors.base.800")(e),[lK.variable]:K("colors.base.100","colors.base.800")(e),[cK.variable]:K("colors.base.400","colors.base.600")(e),minW:"unset",width:"unset",p:4,bg:K("base.100","base.800")(e),border:"none",shadow:"dark-lg"}),xFe=e=>({[uK.variable]:K("colors.base.100","colors.base.700")(e),[lK.variable]:K("colors.base.100","colors.base.700")(e),[cK.variable]:K("colors.base.400","colors.base.400")(e),p:4,bg:K("base.100","base.700")(e),border:"none",shadow:"dark-lg"}),wFe=sK(e=>({content:SFe(e),body:{padding:0}})),CFe=sK(e=>({content:xFe(e),body:{padding:0}})),AFe=_Fe({variants:{invokeAI:wFe,informational:CFe},defaultProps:{variant:"invokeAI"}}),{defineMultiStyleConfig:EFe,definePartsStyle:TFe}=Pt(sH.keys),kFe=e=>({bg:"accentAlpha.700"}),PFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.200`,`${t}.700`)(e)}},IFe=TFe(e=>({filledTrack:kFe(e),track:PFe(e)})),RFe=EFe({variants:{invokeAI:IFe},defaultProps:{variant:"invokeAI"}}),OFe={"::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},{definePartsStyle:MFe,defineMultiStyleConfig:$Fe}=Pt(lH.keys),NFe=e=>({color:K("base.200","base.300")(e)}),DFe=e=>({fontWeight:"600",...Ew(e)}),LFe=MFe(e=>({field:DFe(e),icon:NFe(e)})),FFe=$Fe({variants:{invokeAI:LFe},defaultProps:{size:"sm",variant:"invokeAI"}}),_$=nt("skeleton-start-color"),S$=nt("skeleton-end-color"),BFe={borderRadius:"base",maxW:"full",maxH:"full",_light:{[_$.variable]:"colors.base.250",[S$.variable]:"colors.base.450"},_dark:{[_$.variable]:"colors.base.700",[S$.variable]:"colors.base.500"}},zFe={variants:{invokeAI:BFe},defaultProps:{variant:"invokeAI"}},{definePartsStyle:jFe,defineMultiStyleConfig:UFe}=Pt(uH.keys),VFe=e=>({bg:K("base.400","base.600")(e),h:1.5}),GFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.400`,`${t}.600`)(e),h:1.5}},qFe=e=>({w:e.orientation==="horizontal"?2:4,h:e.orientation==="horizontal"?4:2,bg:K("base.50","base.100")(e)}),HFe=e=>({fontSize:"2xs",fontWeight:"500",color:K("base.700","base.400")(e),mt:2,insetInlineStart:"unset"}),WFe=jFe(e=>({container:{_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},track:VFe(e),filledTrack:GFe(e),thumb:qFe(e),mark:HFe(e)})),KFe=UFe({variants:{invokeAI:WFe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:QFe,definePartsStyle:XFe}=Pt(cH.keys),YFe=e=>{const{colorScheme:t}=e;return{bg:K("base.300","base.600")(e),_focusVisible:{boxShadow:"none"},_checked:{bg:K(`${t}.400`,`${t}.500`)(e)}}},ZFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.50`,`${t}.50`)(e)}},JFe=XFe(e=>({container:{},track:YFe(e),thumb:ZFe(e)})),eBe=QFe({variants:{invokeAI:JFe},defaultProps:{size:"md",variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:tBe,definePartsStyle:dK}=Pt(dH.keys),nBe=e=>({display:"flex",columnGap:4}),rBe=e=>({}),iBe=e=>{const{colorScheme:t}=e;return{display:"flex",flexDirection:"column",gap:1,color:K("base.700","base.400")(e),button:{fontSize:"sm",padding:2,borderRadius:"base",textShadow:K("0 0 0.3rem var(--invokeai-colors-accent-100)","0 0 0.3rem var(--invokeai-colors-accent-900)")(e),svg:{fill:K("base.700","base.300")(e)},_selected:{bg:K("accent.400","accent.600")(e),color:K("base.50","base.100")(e),svg:{fill:K("base.50","base.100")(e),filter:K(`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-600))`,`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-800))`)(e)},_hover:{bg:K("accent.500","accent.500")(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)}}},_hover:{bg:K("base.100","base.800")(e),color:K("base.900","base.50")(e),svg:{fill:K("base.800","base.100")(e)}}}}},oBe=e=>({padding:0,height:"100%"}),aBe=dK(e=>({root:nBe(e),tab:rBe(e),tablist:iBe(e),tabpanel:oBe(e)})),sBe=dK(e=>({tab:{borderTopRadius:"base",px:4,py:1,fontSize:"sm",color:K("base.600","base.400")(e),fontWeight:500,_selected:{color:K("accent.600","accent.400")(e)}},tabpanel:{p:0,pt:4,w:"full",h:"full"},tabpanels:{w:"full",h:"full"}})),lBe=tBe({variants:{line:sBe,appTabs:aBe},defaultProps:{variant:"appTabs",colorScheme:"accent"}}),uBe=e=>({color:K("error.500","error.400")(e)}),cBe=e=>({color:K("base.500","base.400")(e)}),dBe={variants:{subtext:cBe,error:uBe}},fBe=e=>({...Ew(e),"::-webkit-scrollbar":{display:"initial"},"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
+      var(--invokeai-colors-base-50) 0%,
+      var(--invokeai-colors-base-50) 70%,
+      var(--invokeai-colors-base-200) 70%,
+      var(--invokeai-colors-base-200) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
+        var(--invokeai-colors-base-50) 0%,
+        var(--invokeai-colors-base-50) 70%,
+        var(--invokeai-colors-base-200) 70%,
+        var(--invokeai-colors-base-200) 100%)`}},_dark:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
+        var(--invokeai-colors-base-900) 0%,
+        var(--invokeai-colors-base-900) 70%,
+        var(--invokeai-colors-base-800) 70%,
+        var(--invokeai-colors-base-800) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
+          var(--invokeai-colors-base-900) 0%,
+          var(--invokeai-colors-base-900) 70%,
+          var(--invokeai-colors-base-800) 70%,
+          var(--invokeai-colors-base-800) 100%)`}}},p:2}),hBe={variants:{invokeAI:fBe},defaultProps:{size:"md",variant:"invokeAI"}},pBe=hr("popper-arrow-bg"),gBe=e=>({borderRadius:"base",shadow:"dark-lg",bg:K("base.700","base.200")(e),[pBe.variable]:K("colors.base.700","colors.base.200")(e),pb:1.5}),mBe={baseStyle:gBe},x$={backgroundColor:"accentAlpha.150 !important",borderColor:"accentAlpha.700 !important",borderRadius:"base !important",borderStyle:"dashed !important",_dark:{borderColor:"accent.400 !important"}},yBe={".react-flow__nodesselection-rect":{...x$,padding:"1rem !important",boxSizing:"content-box !important",transform:"translate(-1rem, -1rem) !important"},".react-flow__selection":x$},vBe={config:{cssVarPrefix:"invokeai",initialColorMode:"dark",useSystemColorMode:!1},layerStyles:{body:{bg:"base.50",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.50"}},first:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.850",color:"base.100"}},second:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},third:{bg:"base.300",color:"base.900",".chakra-ui-dark &":{bg:"base.750",color:"base.100"}},nodeBody:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},nodeHeader:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}},nodeFooter:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}}},styles:{global:()=>({layerStyle:"body","*":{...OFe},...yBe})},direction:"ltr",fonts:{body:"'Inter Variable', sans-serif",heading:"'Inter Variable', sans-serif"},shadows:{light:{accent:"0 0 10px 0 var(--invokeai-colors-accent-300)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-400)",ok:"0 0 7px var(--invokeai-colors-ok-600)",working:"0 0 7px var(--invokeai-colors-working-600)",error:"0 0 7px var(--invokeai-colors-error-600)"},dark:{accent:"0 0 10px 0 var(--invokeai-colors-accent-600)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-500)",ok:"0 0 7px var(--invokeai-colors-ok-400)",working:"0 0 7px var(--invokeai-colors-working-400)",error:"0 0 7px var(--invokeai-colors-error-400)"},selected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-400)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-500)"},hoverSelected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-400)"},hoverUnselected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 3px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 3px var(--invokeai-colors-accent-400)"},nodeSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-400)",dark:"0 0 0 3px var(--invokeai-colors-accent-500)"},nodeHovered:{light:"0 0 0 2px var(--invokeai-colors-accent-500)",dark:"0 0 0 2px var(--invokeai-colors-accent-400)"},nodeHoveredSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-500)",dark:"0 0 0 3px var(--invokeai-colors-accent-400)"},nodeInProgress:{light:"0 0 0 2px var(--invokeai-colors-accent-500), 0 0 10px 2px var(--invokeai-colors-accent-600)",dark:"0 0 0 2px var(--invokeai-colors-yellow-400), 0 0 20px 2px var(--invokeai-colors-orange-700)"}},colors:SLe,components:{Button:OLe,Input:XLe,Editable:GLe,Textarea:hBe,Tabs:lBe,Progress:RFe,Accordion:PLe,FormLabel:HLe,Switch:eBe,NumberInput:bFe,Select:FFe,Skeleton:zFe,Slider:KFe,Popover:AFe,Modal:dFe,Checkbox:LLe,Menu:eFe,Text:dBe,Tooltip:mBe}},bBe={defaultOptions:{isClosable:!0}},{toast:vg}=gLe({theme:vBe,defaultOptions:bBe.defaultOptions}),_Be=()=>{Me({matcher:Er.endpoints.enqueueBatch.matchFulfilled,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;_e("queue").debug({enqueueResult:Xt(t)},"Batch enqueued"),vg.isActive("batch-queued")||vg({id:"batch-queued",title:Z("queue.batchQueued"),description:Z("queue.batchQueuedDesc",{count:t.enqueued,direction:n.prepend?Z("queue.front"):Z("queue.back")}),duration:1e3,status:"success"})}}),Me({matcher:Er.endpoints.enqueueBatch.matchRejected,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;if(!t){vg({title:Z("queue.batchFailedToQueue"),status:"error",description:"Unknown Error"}),_e("queue").error({batchConfig:Xt(n),error:Xt(t)},Z("queue.batchFailedToQueue"));return}const r=_Le.safeParse(t);if(r.success)r.data.data.detail.map(i=>{vg({id:"batch-failed-to-queue",title:dI(NF(i.msg),{length:128}),status:"error",description:dI(`Path:
+              ${i.loc.join(".")}`,{length:128})})});else{let i="Unknown Error",o;t.status===403&&"body"in t?i=gh(t,"body.detail","Unknown Error"):t.status===403&&"error"in t?i=gh(t,"error.detail","Unknown Error"):t.status===403&&"data"in t&&(i=gh(t,"data.detail","Unknown Error"),o=15e3),vg({title:Z("queue.batchFailedToQueue"),status:"error",description:i,...o?{duration:o}:{}})}_e("queue").error({batchConfig:Xt(n),error:Xt(t)},Z("queue.batchFailedToQueue"))}})};function HE(e){"@babel/helpers - typeof";return HE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HE(e)}var fK=[],SBe=fK.forEach,xBe=fK.slice;function WE(e){return SBe.call(xBe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function hK(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":HE(XMLHttpRequest))==="object"}function wBe(e){return!!e&&typeof e.then=="function"}function CBe(e){return wBe(e)?e:Promise.resolve(e)}function ABe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var KE={exports:{}},w1={exports:{}},w$;function EBe(){return w$||(w$=1,function(e,t){var n=typeof self<"u"?self:yt,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(A){return A&&DataView.prototype.isPrototypeOf(A)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(A){return A&&u.indexOf(Object.prototype.toString.call(A))>-1};function d(A){if(typeof A!="string"&&(A=String(A)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(A))throw new TypeError("Invalid character in header field name");return A.toLowerCase()}function f(A){return typeof A!="string"&&(A=String(A)),A}function h(A){var k={next:function(){var D=A.shift();return{done:D===void 0,value:D}}};return s.iterable&&(k[Symbol.iterator]=function(){return k}),k}function p(A){this.map={},A instanceof p?A.forEach(function(k,D){this.append(D,k)},this):Array.isArray(A)?A.forEach(function(k){this.append(k[0],k[1])},this):A&&Object.getOwnPropertyNames(A).forEach(function(k){this.append(k,A[k])},this)}p.prototype.append=function(A,k){A=d(A),k=f(k);var D=this.map[A];this.map[A]=D?D+", "+k:k},p.prototype.delete=function(A){delete this.map[d(A)]},p.prototype.get=function(A){return A=d(A),this.has(A)?this.map[A]:null},p.prototype.has=function(A){return this.map.hasOwnProperty(d(A))},p.prototype.set=function(A,k){this.map[d(A)]=f(k)},p.prototype.forEach=function(A,k){for(var D in this.map)this.map.hasOwnProperty(D)&&A.call(k,this.map[D],D,this)},p.prototype.keys=function(){var A=[];return this.forEach(function(k,D){A.push(D)}),h(A)},p.prototype.values=function(){var A=[];return this.forEach(function(k){A.push(k)}),h(A)},p.prototype.entries=function(){var A=[];return this.forEach(function(k,D){A.push([D,k])}),h(A)},s.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(A){if(A.bodyUsed)return Promise.reject(new TypeError("Already read"));A.bodyUsed=!0}function _(A){return new Promise(function(k,D){A.onload=function(){k(A.result)},A.onerror=function(){D(A.error)}})}function b(A){var k=new FileReader,D=_(k);return k.readAsArrayBuffer(A),D}function y(A){var k=new FileReader,D=_(k);return k.readAsText(A),D}function g(A){for(var k=new Uint8Array(A),D=new Array(k.length),L=0;L<k.length;L++)D[L]=String.fromCharCode(k[L]);return D.join("")}function v(A){if(A.slice)return A.slice(0);var k=new Uint8Array(A.byteLength);return k.set(new Uint8Array(A)),k.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(A){this._bodyInit=A,A?typeof A=="string"?this._bodyText=A:s.blob&&Blob.prototype.isPrototypeOf(A)?this._bodyBlob=A:s.formData&&FormData.prototype.isPrototypeOf(A)?this._bodyFormData=A:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)?this._bodyText=A.toString():s.arrayBuffer&&s.blob&&l(A)?(this._bodyArrayBuffer=v(A.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(A)||c(A))?this._bodyArrayBuffer=v(A):this._bodyText=A=Object.prototype.toString.call(A):this._bodyText="",this.headers.get("content-type")||(typeof A=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var A=m(this);if(A)return A;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var A=m(this);if(A)return A;if(this._bodyBlob)return y(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(g(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(T)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(A){var k=A.toUpperCase();return w.indexOf(k)>-1?k:A}function C(A,k){k=k||{};var D=k.body;if(A instanceof C){if(A.bodyUsed)throw new TypeError("Already read");this.url=A.url,this.credentials=A.credentials,k.headers||(this.headers=new p(A.headers)),this.method=A.method,this.mode=A.mode,this.signal=A.signal,!D&&A._bodyInit!=null&&(D=A._bodyInit,A.bodyUsed=!0)}else this.url=String(A);if(this.credentials=k.credentials||this.credentials||"same-origin",(k.headers||!this.headers)&&(this.headers=new p(k.headers)),this.method=x(k.method||this.method||"GET"),this.mode=k.mode||this.mode||null,this.signal=k.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function T(A){var k=new FormData;return A.trim().split("&").forEach(function(D){if(D){var L=D.split("="),M=L.shift().replace(/\+/g," "),R=L.join("=").replace(/\+/g," ");k.append(decodeURIComponent(M),decodeURIComponent(R))}}),k}function E(A){var k=new p,D=A.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(L){var M=L.split(":"),R=M.shift().trim();if(R){var $=M.join(":").trim();k.append(R,$)}}),k}S.call(C.prototype);function P(A,k){k||(k={}),this.type="default",this.status=k.status===void 0?200:k.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in k?k.statusText:"OK",this.headers=new p(k.headers),this.url=k.url||"",this._initBody(A)}S.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},P.error=function(){var A=new P(null,{status:0,statusText:""});return A.type="error",A};var N=[301,302,303,307,308];P.redirect=function(A,k){if(N.indexOf(k)===-1)throw new RangeError("Invalid status code");return new P(null,{status:k,headers:{location:A}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(k,D){this.message=k,this.name=D;var L=Error(k);this.stack=L.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function O(A,k){return new Promise(function(D,L){var M=new C(A,k);if(M.signal&&M.signal.aborted)return L(new a.DOMException("Aborted","AbortError"));var R=new XMLHttpRequest;function $(){R.abort()}R.onload=function(){var B={status:R.status,statusText:R.statusText,headers:E(R.getAllResponseHeaders()||"")};B.url="responseURL"in R?R.responseURL:B.headers.get("X-Request-URL");var U="response"in R?R.response:R.responseText;D(new P(U,B))},R.onerror=function(){L(new TypeError("Network request failed"))},R.ontimeout=function(){L(new TypeError("Network request failed"))},R.onabort=function(){L(new a.DOMException("Aborted","AbortError"))},R.open(M.method,M.url,!0),M.credentials==="include"?R.withCredentials=!0:M.credentials==="omit"&&(R.withCredentials=!1),"responseType"in R&&s.blob&&(R.responseType="blob"),M.headers.forEach(function(B,U){R.setRequestHeader(U,B)}),M.signal&&(M.signal.addEventListener("abort",$),R.onreadystatechange=function(){R.readyState===4&&M.signal.removeEventListener("abort",$)}),R.send(typeof M._bodyInit>"u"?null:M._bodyInit)})}return O.polyfill=!0,o.fetch||(o.fetch=O,o.Headers=p,o.Request=C,o.Response=P),a.Headers=p,a.Request=C,a.Response=P,a.fetch=O,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(w1,w1.exports)),w1.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof yt<"u"&&yt.fetch?n=yt.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof ABe<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||EBe();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(KE,KE.exports);var pK=KE.exports;const gK=Sc(pK),C$=nN({__proto__:null,default:gK},[pK]);function gS(e){"@babel/helpers - typeof";return gS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gS(e)}var Gl;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Gl=global.fetch:typeof window<"u"&&window.fetch?Gl=window.fetch:Gl=fetch);var V0;hK()&&(typeof global<"u"&&global.XMLHttpRequest?V0=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(V0=window.XMLHttpRequest));var mS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?mS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(mS=window.ActiveXObject));!Gl&&C$&&!V0&&!mS&&(Gl=gK||C$);typeof Gl!="function"&&(Gl=void 0);var QE=function(t,n){if(n&&gS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},A$=function(t,n,r){Gl(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},E$=!1,TBe=function(t,n,r,i){t.queryStringParams&&(n=QE(n,t.queryStringParams));var o=WE({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=WE({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},E$?{}:a);try{A$(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),A$(n,s,i),E$=!0}catch(u){i(u)}}},kBe=function(t,n,r,i){r&&gS(r)==="object"&&(r=QE("",r).slice(1)),t.queryStringParams&&(n=QE(n,t.queryStringParams));try{var o;V0?o=new V0:o=new mS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},PBe=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Gl&&n.indexOf("file:")!==0)return TBe(t,n,r,i);if(hK()||typeof ActiveXObject=="function")return kBe(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function G0(e){"@babel/helpers - typeof";return G0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G0(e)}function IBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T$(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mK(r.key),r)}}function RBe(e,t,n){return t&&T$(e.prototype,t),n&&T$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OBe(e,t,n){return t=mK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mK(e){var t=MBe(e,"string");return G0(t)==="symbol"?t:String(t)}function MBe(e,t){if(G0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(G0(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $Be=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return OBe({},r,i||"")},parseLoadPayload:function(n,r){},request:PBe,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},yK=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};IBe(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return RBe(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=WE(i,this.options||{},$Be()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=CBe(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(c,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+c.message,!0);if(c)return r(c,!1);var f,h;try{typeof d.data=="string"?f=a.options.parse(d.data,i,o):f=d.data}catch{h="failed parsing "+n+" to json"}if(h)return r(h,!1);r(null,f)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(f,r));var p=s.services.interpolator.interpolate(h,{lng:f,ns:r});s.options.request(s.options,p,l,function(m,_){u+=1,c.push(m),d.push(_),u===n.length&&typeof a=="function"&&a(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,h){f&&a.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&h&&a.log("loaded namespace ".concat(d," for language ").concat(c),h),i.loaded("".concat(c,"|").concat(d),f,h)})})})}}}]),e}();yK.type="backend";me.use(yK).use(cke).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const NBe=Qi(Nk,Lk,Dk,yy),DBe=()=>{Me({matcher:NBe,effect:async(e,{dispatch:t,getOriginalState:n})=>{var s;const r=n().controlAdapters,i=Pa(r).some(l=>l.isEnabled&&l.type==="controlnet"),o=Pa(r).some(l=>l.isEnabled&&l.type==="t2i_adapter");let a=null;if(Nk.match(e)&&(a=e.payload.type),Lk.match(e)&&(a=e.payload.type),Dk.match(e)&&(a=e.payload.type),yy.match(e)){const l=(s=eo(r,e.payload.id))==null?void 0:s.type;if(!l)return;a=l}if(a==="controlnet"&&o||a==="t2i_adapter"&&i){const l=a==="controlnet"?me.t("controlnet.controlNetEnabledT2IDisabled"):me.t("controlnet.t2iEnabledControlNetDisabled"),u=me.t("controlnet.controlNetT2IMutexDesc");t(qt({title:l,description:u,status:"warning"}))}}})},vK=nF(),Me=vK.startListening;hEe();pEe();bEe();iEe();oEe();aEe();sEe();lEe();twe();fEe();gEe();mEe();jAe();tEe();HAe();Xxe();_Be();xAe();vAe();ywe();bAe();mwe();pwe();SAe();KTe();Wxe();DTe();LTe();BTe();zTe();UTe();$Te();NTe();HTe();WTe();VTe();qTe();jTe();GTe();EAe();CAe();nEe();rEe();cEe();dEe();nwe();MTe();Eke();uEe();_Ee();Jxe();xEe();Yxe();Kxe();bke();XTe();AEe();DBe();const LBe={canvas:hue,gallery:nye,generation:tue,nodes:M2e,postprocessing:$2e,system:j2e,config:Vae,ui:X2e,hotkeys:Q2e,controlAdapters:Rse,dynamicPrompts:Aue,deleteImageModal:vue,changeBoardModal:gue,lora:oye,modelmanager:K2e,sdxl:D2e,queue:H2e,[ps.reducerPath]:ps.reducer},FBe=_p(LBe),BBe=Sxe(FBe),zBe=["canvas","gallery","generation","sdxl","nodes","postprocessing","system","ui","controlAdapters","dynamicPrompts","lora","modelmanager"],bK=DL({reducer:BBe,enhancers:e=>e.concat(xxe(window.localStorage,zBe,{persistDebounce:300,serialize:$xe,unserialize:Dxe,prefix:wxe})).concat(iF()),middleware:e=>e({serializableCheck:!1,immutableCheck:!1}).concat(ps.middleware).concat(exe).prepend(vK.middleware),devTools:{actionSanitizer:Uxe,stateSanitizer:Gxe,trace:!0,predicate:(e,t)=>!Vxe.includes(t.type)}}),_K=e=>e;Jz.set(bK);const jBe=e=>{const{socket:t,storeApi:n}=e,{dispatch:r}=n;t.on("connect",()=>{_e("socketio").debug("Connected"),r(kB());const o=Gr.get();t.emit("subscribe_queue",{queue_id:o})}),t.on("connect_error",i=>{i&&i.message&&i.data==="ERR_UNAUTHENTICATED"&&r(qt(Vd({title:i.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{r(PB())}),t.on("invocation_started",i=>{r(RB({data:i}))}),t.on("generator_progress",i=>{r(NB({data:i}))}),t.on("invocation_error",i=>{r(OB({data:i}))}),t.on("invocation_complete",i=>{r(Pk({data:i}))}),t.on("graph_execution_state_complete",i=>{r(MB({data:i}))}),t.on("model_load_started",i=>{r(DB({data:i}))}),t.on("model_load_completed",i=>{r(FB({data:i}))}),t.on("session_retrieval_error",i=>{r(zB({data:i}))}),t.on("invocation_retrieval_error",i=>{r(UB({data:i}))}),t.on("queue_item_status_changed",i=>{r(GB({data:i}))})},il=Object.create(null);il.open="0";il.close="1";il.ping="2";il.pong="3";il.message="4";il.upgrade="5";il.noop="6";const yb=Object.create(null);Object.keys(il).forEach(e=>{yb[il[e]]=e});const XE={type:"error",data:"parser error"},SK=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",xK=typeof ArrayBuffer=="function",wK=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,UP=({type:e,data:t},n,r)=>SK&&t instanceof Blob?n?r(t):k$(t,r):xK&&(t instanceof ArrayBuffer||wK(t))?n?r(t):k$(new Blob([t]),r):r(il[e]+(t||"")),k$=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function P$(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let X5;function UBe(e,t){if(SK&&e.data instanceof Blob)return e.data.arrayBuffer().then(P$).then(t);if(xK&&(e.data instanceof ArrayBuffer||wK(e.data)))return t(P$(e.data));UP(e,!1,n=>{X5||(X5=new TextEncoder),t(X5.encode(n))})}const I$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<I$.length;e++)Bg[I$.charCodeAt(e)]=e;const VBe=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=Bg[e.charCodeAt(r)],a=Bg[e.charCodeAt(r+1)],s=Bg[e.charCodeAt(r+2)],l=Bg[e.charCodeAt(r+3)],c[i++]=o<<2|a>>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},GBe=typeof ArrayBuffer=="function",VP=(e,t)=>{if(typeof e!="string")return{type:"message",data:CK(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:qBe(e.substring(1),t)}:yb[n]?e.length>1?{type:yb[n],data:e.substring(1)}:{type:yb[n]}:XE},qBe=(e,t)=>{if(GBe){const n=VBe(e);return CK(n,t)}else return{base64:!0,data:e}},CK=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},AK=String.fromCharCode(30),HBe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{UP(o,!1,s=>{r[a]=s,++i===n&&t(r.join(AK))})})},WBe=(e,t)=>{const n=e.split(AK),r=[];for(let i=0;i<n.length;i++){const o=VP(n[i],t);if(r.push(o),o.type==="error")break}return r};function KBe(){return new TransformStream({transform(e,t){UBe(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Y5;function C1(e){return e.reduce((t,n)=>t+n.length,0)}function A1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function QBe(e,t){Y5||(Y5=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(r===0){if(C1(n)<1)break;const l=A1(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(C1(n)<2)break;const l=A1(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(C1(n)<8)break;const l=A1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue(XE);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(C1(n)<i)break;const l=A1(n,i);s.enqueue(VP(o?l:Y5.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(XE);break}}}})}const EK=4;function Br(e){if(e)return XBe(e)}function XBe(e){for(var t in Br.prototype)e[t]=Br.prototype[t];return e}Br.prototype.on=Br.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Br.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Br.prototype.off=Br.prototype.removeListener=Br.prototype.removeAllListeners=Br.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Br.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Br.prototype.emitReserved=Br.prototype.emit;Br.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Br.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Sa=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function TK(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const YBe=Sa.setTimeout,ZBe=Sa.clearTimeout;function Tw(e,t){t.useNativeTimers?(e.setTimeoutFn=YBe.bind(Sa),e.clearTimeoutFn=ZBe.bind(Sa)):(e.setTimeoutFn=Sa.setTimeout.bind(Sa),e.clearTimeoutFn=Sa.clearTimeout.bind(Sa))}const JBe=1.33;function eze(e){return typeof e=="string"?tze(e):Math.ceil((e.byteLength||e.size)*JBe)}function tze(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function nze(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function rze(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class ize extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class GP extends Br{constructor(t){super(),this.writable=!1,Tw(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new ize(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=VP(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=nze(t);return n.length?"?"+n:""}}const kK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),YE=64,oze={};let R$=0,E1=0,O$;function M$(e){let t="";do t=kK[e%YE]+t,e=Math.floor(e/YE);while(e>0);return t}function PK(){const e=M$(+new Date);return e!==O$?(R$=0,O$=e):e+"."+M$(R$++)}for(;E1<YE;E1++)oze[kK[E1]]=E1;let IK=!1;try{IK=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const aze=IK;function RK(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||aze))return new XMLHttpRequest}catch{}if(!t)try{return new Sa[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function sze(){}const lze=function(){return new RK({xdomain:!1}).responseType!=null}();class uze extends GP{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=lze&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};WBe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,HBe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=PK()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Oh(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let Oh=class vb extends Br{constructor(t,n){super(),Tw(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=TK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new RK(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=vb.requestsCount++,vb.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=sze,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete vb.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Oh.requestsCount=0;Oh.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",$$);else if(typeof addEventListener=="function"){const e="onpagehide"in Sa?"pagehide":"unload";addEventListener(e,$$,!1)}}function $$(){for(let e in Oh.requests)Oh.requests.hasOwnProperty(e)&&Oh.requests[e].abort()}const qP=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),T1=Sa.WebSocket||Sa.MozWebSocket,N$=!0,cze="arraybuffer",D$=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class dze extends GP{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=D$?{}:TK(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=N$&&!D$?n?new T1(t,n):new T1(t):new T1(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;UP(r,this.supportsBinary,o=>{const a={};try{N$&&this.ws.send(o)}catch{}i&&qP(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=PK()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!T1}}class fze extends GP{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=QBe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=KBe();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),o())}).catch(s=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&qP(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const hze={websocket:dze,webtransport:fze,polling:uze},pze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,gze=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ZE(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=pze.exec(e||""),o={},a=14;for(;a--;)o[gze[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=mze(o,o.path),o.queryKey=yze(o,o.query),o}function mze(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function yze(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let OK=class Mf extends Br{constructor(t,n={}){super(),this.binaryType=cze,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=ZE(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=ZE(n.host).host),Tw(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=rze(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=EK,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new hze[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Mf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Mf.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Mf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const a=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function s(){a("transport closed")}function l(){a("socket closed")}function u(d){n&&d.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Mf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=eze(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Mf.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};OK.protocol=EK;function vze(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ZE(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const bze=typeof ArrayBuffer=="function",_ze=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,MK=Object.prototype.toString,Sze=typeof Blob=="function"||typeof Blob<"u"&&MK.call(Blob)==="[object BlobConstructor]",xze=typeof File=="function"||typeof File<"u"&&MK.call(File)==="[object FileConstructor]";function HP(e){return bze&&(e instanceof ArrayBuffer||_ze(e))||Sze&&e instanceof Blob||xze&&e instanceof File}function bb(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(bb(e[n]))return!0;return!1}if(HP(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return bb(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&bb(e[n]))return!0;return!1}function wze(e){const t=[],n=e.data,r=e;return r.data=JE(n,t),r.attachments=t.length,{packet:r,buffers:t}}function JE(e,t){if(!e)return e;if(HP(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=JE(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JE(e[r],t));return n}return e}function Cze(e,t){return e.data=eT(e.data,t),delete e.attachments,e}function eT(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=eT(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=eT(e[n],t));return e}const Aze=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Eze=5;var Ft;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ft||(Ft={}));class Tze{constructor(t){this.replacer=t}encode(t){return(t.type===Ft.EVENT||t.type===Ft.ACK)&&bb(t)?this.encodeAsBinary({type:t.type===Ft.EVENT?Ft.BINARY_EVENT:Ft.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ft.BINARY_EVENT||t.type===Ft.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=wze(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function L$(e){return Object.prototype.toString.call(e)==="[object Object]"}class WP extends Br{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ft.BINARY_EVENT;r||n.type===Ft.BINARY_ACK?(n.type=r?Ft.EVENT:Ft.ACK,this.reconstructor=new kze(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(HP(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ft[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ft.BINARY_EVENT||r.type===Ft.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(WP.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ft.CONNECT:return L$(n);case Ft.DISCONNECT:return n===void 0;case Ft.CONNECT_ERROR:return typeof n=="string"||L$(n);case Ft.EVENT:case Ft.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Aze.indexOf(n[0])===-1);case Ft.ACK:case Ft.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kze{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Cze(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Pze=Object.freeze(Object.defineProperty({__proto__:null,Decoder:WP,Encoder:Tze,get PacketType(){return Ft},protocol:Eze},Symbol.toStringTag,{value:"Module"}));function Ya(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Ize=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class $K extends Br{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ya(t,"open",this.onopen.bind(this)),Ya(t,"packet",this.onpacket.bind(this)),Ya(t,"error",this.onerror.bind(this)),Ya(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Ize.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Ft.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ft.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ft.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ft.EVENT:case Ft.BINARY_EVENT:this.onevent(t);break;case Ft.ACK:case Ft.BINARY_ACK:this.onack(t);break;case Ft.DISCONNECT:this.ondisconnect();break;case Ft.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Ft.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ft.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Lp(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Lp.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Lp.prototype.reset=function(){this.attempts=0};Lp.prototype.setMin=function(e){this.ms=e};Lp.prototype.setMax=function(e){this.max=e};Lp.prototype.setJitter=function(e){this.jitter=e};class tT extends Br{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Tw(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Lp({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||Pze;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new OK(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ya(n,"open",function(){r.onopen(),t&&t()}),o=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},a=Ya(n,"error",o);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ya(t,"ping",this.onping.bind(this)),Ya(t,"data",this.ondata.bind(this)),Ya(t,"error",this.onerror.bind(this)),Ya(t,"close",this.onclose.bind(this)),Ya(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){qP(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new $K(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const bg={};function _b(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=vze(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=bg[i]&&o in bg[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new tT(r,t):(bg[i]||(bg[i]=new tT(r,t)),l=bg[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(_b,{Manager:tT,Socket:$K,io:_b,connect:_b});const F$=()=>{let e=!1,n=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`;const r={timeout:6e4,path:"/ws/socket.io",autoConnect:!1};if(["nodes","package"].includes("production")){const a=o0.get();a&&(n=a.replace(/^https?\:\/\//i,""));const s=ep.get();s&&(r.auth={token:s}),r.transports=["websocket","polling"]}const i=_b(n,r);return a=>s=>l=>{e||(jBe({storeApi:a,socket:i}),e=!0,i.connect()),s(l)}},Rze=""+new URL("logo-13003d72.png",import.meta.url).href,Oze=()=>W.jsxs(jP,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[W.jsx(zP,{src:Rze,w:"8rem",h:"8rem"}),W.jsx(LP,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),Mze=I.memo(Oze),kw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fp(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function KP(e){return"nodeType"in e}function go(e){var t,n;return e?Fp(e)?e:KP(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function QP(e){const{Document:t}=go(e);return e instanceof t}function Qy(e){return Fp(e)?!1:e instanceof go(e).HTMLElement}function $ze(e){return e instanceof go(e).SVGElement}function Bp(e){return e?Fp(e)?e.document:KP(e)?QP(e)?e:Qy(e)?e.ownerDocument:document:document:document}const ol=kw?I.useLayoutEffect:I.useEffect;function Pw(e){const t=I.useRef(e);return ol(()=>{t.current=e}),I.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function Nze(){const e=I.useRef(null),t=I.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=I.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function q0(e,t){t===void 0&&(t=[e]);const n=I.useRef(e);return ol(()=>{n.current!==e&&(n.current=e)},t),n}function Xy(e,t){const n=I.useRef();return I.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function yS(e){const t=Pw(e),n=I.useRef(null),r=I.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function vS(e){const t=I.useRef();return I.useEffect(()=>{t.current=e},[e]),t.current}let Z5={};function Iw(e,t){return I.useMemo(()=>{if(t)return t;const n=Z5[e]==null?0:Z5[e]+1;return Z5[e]=n,e+"-"+n},[e,t])}function NK(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const s=Object.entries(a);for(const[l,u]of s){const c=o[l];c!=null&&(o[l]=c+e*u)}return o},{...t})}}const Mh=NK(1),bS=NK(-1);function Dze(e){return"clientX"in e&&"clientY"in e}function XP(e){if(!e)return!1;const{KeyboardEvent:t}=go(e.target);return t&&e instanceof t}function Lze(e){if(!e)return!1;const{TouchEvent:t}=go(e.target);return t&&e instanceof t}function H0(e){if(Lze(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Dze(e)?{x:e.clientX,y:e.clientY}:null}const W0=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[W0.Translate.toString(e),W0.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),B$="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fze(e){return e.matches(B$)?e:e.querySelector(B$)}const Bze={display:"none"};function zze(e){let{id:t,value:n}=e;return An.createElement("div",{id:t,style:Bze},n)}const jze={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function Uze(e){let{id:t,announcement:n}=e;return An.createElement("div",{id:t,style:jze,role:"status","aria-live":"assertive","aria-atomic":!0},n)}function Vze(){const[e,t]=I.useState("");return{announce:I.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const DK=I.createContext(null);function Gze(e){const t=I.useContext(DK);I.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function qze(){const[e]=I.useState(()=>new Set),t=I.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[I.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const Hze={draggable:`
+    To pick up a draggable item, press the space bar.
+    While dragging, use the arrow keys to move the item.
+    Press space again to drop the item in its new position, or press escape to cancel.
+  `},Wze={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Kze(e){let{announcements:t=Wze,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Hze}=e;const{announce:o,announcement:a}=Vze(),s=Iw("DndLiveRegion"),[l,u]=I.useState(!1);if(I.useEffect(()=>{u(!0)},[]),Gze(I.useMemo(()=>({onDragStart(d){let{active:f}=d;o(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&o(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;o(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;o(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;o(t.onDragCancel({active:f,over:h}))}}),[o,t])),!l)return null;const c=An.createElement(An.Fragment,null,An.createElement(zze,{id:r,value:i.draggable}),An.createElement(Uze,{id:s,announcement:a}));return n?Wo.createPortal(c,n):c}var Wr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Wr||(Wr={}));function _S(){}function z$(e,t){return I.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Qze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return I.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const gs=Object.freeze({x:0,y:0});function Xze(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yze(e,t){const n=H0(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Zze(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Jze(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function eje(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function tje(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function nje(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,c=a*s,d=c/(l+u-c);return Number(d.toFixed(4))}return 0}const rje=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const l=nje(s,t);l>0&&i.push({id:a,data:{droppableContainer:o,value:l}})}}return i.sort(Jze)};function ije(e,t){const{top:n,left:r,bottom:i,right:o}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=o}const oje=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const o of t){const{id:a}=o,s=n.get(a);if(s&&ije(r,s)){const u=eje(s).reduce((d,f)=>d+Xze(r,f),0),c=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(Zze)};function aje(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function LK(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:gs}function sje(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,s)=>({...a,top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),{...n})}}const lje=sje(1);function FK(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function uje(e,t,n){const r=FK(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l}}const cje={ignoreTransform:!1};function Yy(e,t){t===void 0&&(t=cje);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=go(e).getComputedStyle(e);u&&(n=uje(n,u,c))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function j$(e){return Yy(e,{ignoreTransform:!0})}function dje(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function fje(e,t){return t===void 0&&(t=go(e).getComputedStyle(e)),t.position==="fixed"}function hje(e,t){t===void 0&&(t=go(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function YP(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(QP(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Qy(i)||$ze(i)||n.includes(i))return n;const o=go(e).getComputedStyle(i);return i!==e&&hje(i,o)&&n.push(i),fje(i,o)?n:r(i.parentNode)}return e?r(e):n}function BK(e){const[t]=YP(e,1);return t??null}function J5(e){return!kw||!e?null:Fp(e)?e:KP(e)?QP(e)||e===Bp(e).scrollingElement?window:Qy(e)?e:null:null}function zK(e){return Fp(e)?e.scrollX:e.scrollLeft}function jK(e){return Fp(e)?e.scrollY:e.scrollTop}function nT(e){return{x:zK(e),y:jK(e)}}var ui;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ui||(ui={}));function UK(e){return!kw||!e?!1:e===document.scrollingElement}function VK(e){const t={x:0,y:0},n=UK(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const pje={x:.2,y:.2};function gje(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=pje);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=VK(e),h={x:0,y:0},p={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(h.y=ui.Backward,p.y=r*Math.abs((t.top+m.height-o)/m.height)):!c&&l>=t.bottom-m.height&&(h.y=ui.Forward,p.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!f&&s>=t.right-m.width?(h.x=ui.Forward,p.x=r*Math.abs((t.right-m.width-s)/m.width)):!d&&a<=t.left+m.width&&(h.x=ui.Backward,p.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:h,speed:p}}function mje(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function GK(e){return e.reduce((t,n)=>Mh(t,nT(n)),gs)}function yje(e){return e.reduce((t,n)=>t+zK(n),0)}function vje(e){return e.reduce((t,n)=>t+jK(n),0)}function qK(e,t){if(t===void 0&&(t=Yy),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);BK(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const bje=[["x",["left","right"],yje],["y",["top","bottom"],vje]];class ZP{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=YP(n),i=GK(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,s]of bje)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=s(r),c=i[o]-u;return this.rect[l]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class pm{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function _je(e){const{EventTarget:t}=go(e);return e instanceof t?e:Bp(e)}function e3(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var va;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(va||(va={}));function U$(e){e.preventDefault()}function Sje(e){e.stopPropagation()}var On;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(On||(On={}));const HK={start:[On.Space,On.Enter],cancel:[On.Esc],end:[On.Space,On.Enter]},xje=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case On.Right:return{...n,x:n.x+25};case On.Left:return{...n,x:n.x-25};case On.Down:return{...n,y:n.y+25};case On.Up:return{...n,y:n.y-25}}};class WK{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new pm(Bp(n)),this.windowListeners=new pm(go(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(va.Resize,this.handleCancel),this.windowListeners.add(va.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(va.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&qK(r),n(gs)}handleKeyDown(t){if(XP(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=HK,coordinateGetter:a=xje,scrollBehavior:s="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:gs;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=bS(d,c),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const m of p){const _=t.code,{isTop:b,isRight:y,isLeft:g,isBottom:v,maxScroll:S,minScroll:w}=VK(m),x=mje(m),C={x:Math.min(_===On.Right?x.right-x.width/2:x.right,Math.max(_===On.Right?x.left:x.left+x.width/2,d.x)),y:Math.min(_===On.Down?x.bottom-x.height/2:x.bottom,Math.max(_===On.Down?x.top:x.top+x.height/2,d.y))},T=_===On.Right&&!y||_===On.Left&&!g,E=_===On.Down&&!v||_===On.Up&&!b;if(T&&C.x!==d.x){const P=m.scrollLeft+f.x,N=_===On.Right&&P<=S.x||_===On.Left&&P>=w.x;if(N&&!f.y){m.scrollTo({left:P,behavior:s});return}N?h.x=m.scrollLeft-P:h.x=_===On.Right?m.scrollLeft-S.x:m.scrollLeft-w.x,h.x&&m.scrollBy({left:-h.x,behavior:s});break}else if(E&&C.y!==d.y){const P=m.scrollTop+f.y,N=_===On.Down&&P<=S.y||_===On.Up&&P>=w.y;if(N&&!f.x){m.scrollTo({top:P,behavior:s});return}N?h.y=m.scrollTop-P:h.y=_===On.Down?m.scrollTop-S.y:m.scrollTop-w.y,h.y&&m.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,Mh(bS(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}WK.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=HK,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function V$(e){return!!(e&&"distance"in e)}function G$(e){return!!(e&&"delay"in e)}class JP{constructor(t,n,r){var i;r===void 0&&(r=_je(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Bp(a),this.documentListeners=new pm(this.document),this.listeners=new pm(r),this.windowListeners=new pm(go(a)),this.initialCoordinates=(i=H0(o))!=null?i:gs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(va.Resize,this.handleCancel),this.windowListeners.add(va.DragStart,U$),this.windowListeners.add(va.VisibilityChange,this.handleCancel),this.windowListeners.add(va.ContextMenu,U$),this.documentListeners.add(va.Keydown,this.handleKeydown),n){if(V$(n))return;if(G$(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(va.Click,Sje,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(va.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const l=(n=H0(t))!=null?n:gs,u=bS(i,l);if(!r&&s){if(G$(s))return e3(u,s.tolerance)?this.handleCancel():void 0;if(V$(s))return s.tolerance!=null&&e3(u,s.tolerance)?this.handleCancel():e3(u,s.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===On.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const wje={move:{name:"pointermove"},end:{name:"pointerup"}};class KK extends JP{constructor(t){const{event:n}=t,r=Bp(n.target);super(t,wje,r)}}KK.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Cje={move:{name:"mousemove"},end:{name:"mouseup"}};var rT;(function(e){e[e.RightClick=2]="RightClick"})(rT||(rT={}));class QK extends JP{constructor(t){super(t,Cje,Bp(t.event.target))}}QK.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===rT.RightClick?!1:(r==null||r({event:n}),!0)}}];const t3={move:{name:"touchmove"},end:{name:"touchend"}};class XK extends JP{constructor(t){super(t,t3)}static setup(){return window.addEventListener(t3.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(t3.move.name,t)};function t(){}}}XK.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var gm;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(gm||(gm={}));var SS;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(SS||(SS={}));function Aje(e){let{acceleration:t,activator:n=gm.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=SS.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const h=Tje({delta:d,disabled:!o}),[p,m]=Nze(),_=I.useRef({x:0,y:0}),b=I.useRef({x:0,y:0}),y=I.useMemo(()=>{switch(n){case gm.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case gm.DraggableRect:return i}},[n,i,l]),g=I.useRef(null),v=I.useCallback(()=>{const w=g.current;if(!w)return;const x=_.current.x*b.current.x,C=_.current.y*b.current.y;w.scrollBy(x,C)},[]),S=I.useMemo(()=>s===SS.TreeOrder?[...u].reverse():u,[s,u]);I.useEffect(()=>{if(!o||!u.length||!y){m();return}for(const w of S){if((r==null?void 0:r(w))===!1)continue;const x=u.indexOf(w),C=c[x];if(!C)continue;const{direction:T,speed:E}=gje(w,C,y,t,f);for(const P of["x","y"])h[P][T[P]]||(E[P]=0,T[P]=0);if(E.x>0||E.y>0){m(),g.current=w,p(v,a),_.current=E,b.current=T;return}}_.current={x:0,y:0},b.current={x:0,y:0},m()},[t,v,r,m,o,a,JSON.stringify(y),JSON.stringify(h),p,u,S,c,JSON.stringify(f)])}const Eje={x:{[ui.Backward]:!1,[ui.Forward]:!1},y:{[ui.Backward]:!1,[ui.Forward]:!1}};function Tje(e){let{delta:t,disabled:n}=e;const r=vS(t);return Xy(i=>{if(n||!r||!i)return Eje;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ui.Backward]:i.x[ui.Backward]||o.x===-1,[ui.Forward]:i.x[ui.Forward]||o.x===1},y:{[ui.Backward]:i.y[ui.Backward]||o.y===-1,[ui.Forward]:i.y[ui.Forward]||o.y===1}}},[n,t,r])}function kje(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Xy(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function Pje(e,t){return I.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var K0;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(K0||(K0={}));var iT;(function(e){e.Optimized="optimized"})(iT||(iT={}));const q$=new Map;function Ije(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=I.useState(null),{frequency:s,measure:l,strategy:u}=i,c=I.useRef(e),d=_(),f=q0(d),h=I.useCallback(function(b){b===void 0&&(b=[]),!f.current&&a(y=>y===null?b:y.concat(b.filter(g=>!y.includes(g))))},[f]),p=I.useRef(null),m=Xy(b=>{if(d&&!n)return q$;if(!b||b===q$||c.current!==e||o!=null){const y=new Map;for(let g of e){if(!g)continue;if(o&&o.length>0&&!o.includes(g.id)&&g.rect.current){y.set(g.id,g.rect.current);continue}const v=g.node.current,S=v?new ZP(l(v),v):null;g.rect.current=S,S&&y.set(g.id,S)}return y}return b},[e,o,n,d,l]);return I.useEffect(()=>{c.current=e},[e]),I.useEffect(()=>{d||h()},[n,d]),I.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),I.useEffect(()=>{d||typeof s!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},s))},[s,d,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:o!=null};function _(){switch(u){case K0.Always:return!1;case K0.BeforeDragging:return n;default:return!n}}}function e6(e,t){return Xy(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Rje(e,t){return e6(e,t)}function Oje(e){let{callback:t,disabled:n}=e;const r=Pw(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Rw(e){let{callback:t,disabled:n}=e;const r=Pw(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Mje(e){return new ZP(Yy(e),e)}function H$(e,t,n){t===void 0&&(t=Mje);const[r,i]=I.useReducer(s,null),o=Oje({callback(l){if(e)for(const u of l){const{type:c,target:d}=u;if(c==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=Rw({callback:i});return ol(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r;function s(l){if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const c=t(e);return JSON.stringify(l)===JSON.stringify(c)?l:c}}function $je(e){const t=e6(e);return LK(e,t)}const W$=[];function Nje(e){const t=I.useRef(e),n=Xy(r=>e?r&&r!==W$&&e&&t.current&&e.parentNode===t.current.parentNode?r:YP(e):W$,[e]);return I.useEffect(()=>{t.current=e},[e]),n}function Dje(e){const[t,n]=I.useState(null),r=I.useRef(e),i=I.useCallback(o=>{const a=J5(o.target);a&&n(s=>s?(s.set(a,nT(a)),new Map(s)):null)},[]);return I.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(l=>{const u=J5(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,nT(u)]):null}).filter(l=>l!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(l=>{const u=J5(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),I.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>Mh(o,a),gs):GK(e):gs,[e,t])}function K$(e,t){t===void 0&&(t=[]);const n=I.useRef(null);return I.useEffect(()=>{n.current=null},t),I.useEffect(()=>{const r=e!==gs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bS(e,n.current):gs}function Lje(e){I.useEffect(()=>{if(!kw)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Fje(e,t){return I.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function YK(e){return I.useMemo(()=>e?dje(e):null,[e])}const n3=[];function Bje(e,t){t===void 0&&(t=Yy);const[n]=e,r=YK(n?go(n):null),[i,o]=I.useReducer(s,n3),a=Rw({callback:o});return e.length>0&&i===n3&&o(),ol(()=>{e.length?e.forEach(l=>a==null?void 0:a.observe(l)):(a==null||a.disconnect(),o())},[e]),i;function s(){return e.length?e.map(l=>UK(l)?r:new ZP(t(l),l)):n3}}function ZK(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qy(t)?t:e}function zje(e){let{measure:t}=e;const[n,r]=I.useState(null),i=I.useCallback(u=>{for(const{target:c}of u)if(Qy(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=Rw({callback:i}),a=I.useCallback(u=>{const c=ZK(u);o==null||o.disconnect(),c&&(o==null||o.observe(c)),r(c?t(c):null)},[t,o]),[s,l]=yS(a);return I.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}const jje=[{sensor:KK,options:{}},{sensor:WK,options:{}}],Uje={current:{}},Sb={draggable:{measure:j$},droppable:{measure:j$,strategy:K0.WhileDragging,frequency:iT.Optimized},dragOverlay:{measure:Yy}};class mm extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Vje={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mm,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_S},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sb,measureDroppableContainers:_S,windowRect:null,measuringScheduled:!1},JK={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_S,draggableNodes:new Map,over:null,measureDroppableContainers:_S},Zy=I.createContext(JK),eQ=I.createContext(Vje);function Gje(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mm}}}function qje(e,t){switch(t.type){case Wr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Wr.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Wr.DragEnd:case Wr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wr.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new mm(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Wr.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new mm(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case Wr.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new mm(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Hje(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=I.useContext(Zy),o=vS(r),a=vS(n==null?void 0:n.id);return I.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!XP(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[l.current,u.current]){if(!c)continue;const d=Fze(c);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function tQ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function Wje(e){return I.useMemo(()=>({draggable:{...Sb.draggable,...e==null?void 0:e.draggable},droppable:{...Sb.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Sb.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Kje(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=I.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;ol(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),d=LK(c,r);if(a||(d.x=0),s||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=BK(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,a,s,r,n])}const Ow=I.createContext({...gs,scaleX:1,scaleY:1});var ku;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ku||(ku={}));const Qje=I.memo(function(t){var n,r,i,o;let{id:a,accessibility:s,autoScroll:l=!0,children:u,sensors:c=jje,collisionDetection:d=rje,measuring:f,modifiers:h,...p}=t;const m=I.useReducer(qje,void 0,Gje),[_,b]=m,[y,g]=qze(),[v,S]=I.useState(ku.Uninitialized),w=v===ku.Initialized,{draggable:{active:x,nodes:C,translate:T},droppable:{containers:E}}=_,P=x?C.get(x):null,N=I.useRef({initial:null,translated:null}),O=I.useMemo(()=>{var Bn;return x!=null?{id:x,data:(Bn=P==null?void 0:P.data)!=null?Bn:Uje,rect:N}:null},[x,P]),A=I.useRef(null),[k,D]=I.useState(null),[L,M]=I.useState(null),R=q0(p,Object.values(p)),$=Iw("DndDescribedBy",a),B=I.useMemo(()=>E.getEnabled(),[E]),U=Wje(f),{droppableRects:G,measureDroppableContainers:Y,measuringScheduled:ee}=Ije(B,{dragging:w,dependencies:[T.x,T.y],config:U.droppable}),J=kje(C,x),j=I.useMemo(()=>L?H0(L):null,[L]),Q=fl(),ne=Rje(J,U.draggable.measure);Kje({activeNode:x?C.get(x):null,config:Q.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const se=H$(J,U.draggable.measure,ne),be=H$(J?J.parentElement:null),ce=I.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),bt=E.getNodeFor((n=ce.current.over)==null?void 0:n.id),ot=zje({measure:U.dragOverlay.measure}),ze=(r=ot.nodeRef.current)!=null?r:J,mt=w?(i=ot.rect)!=null?i:se:null,Ie=!!(ot.nodeRef.current&&ot.rect),en=$je(Ie?null:se),Ir=YK(ze?go(ze):null),Dn=Nje(w?bt??J:null),Tn=Bje(Dn),tn=tQ(h,{transform:{x:T.x-en.x,y:T.y-en.y,scaleX:1,scaleY:1},activatorEvent:L,active:O,activeNodeRect:se,containerNodeRect:be,draggingNodeRect:mt,over:ce.current.over,overlayNodeRect:ot.rect,scrollableAncestors:Dn,scrollableAncestorRects:Tn,windowRect:Ir}),Ln=j?Mh(j,T):null,Rr=Dje(Dn),mo=K$(Rr),Jr=K$(Rr,[se]),pr=Mh(tn,mo),zr=mt?lje(mt,tn):null,ei=O&&zr?d({active:O,collisionRect:zr,droppableRects:G,droppableContainers:B,pointerCoordinates:Ln}):null,Fn=tje(ei,"id"),[_n,Mi]=I.useState(null),gi=Ie?tn:Mh(tn,Jr),Xi=aje(gi,(o=_n==null?void 0:_n.rect)!=null?o:null,se),Ua=I.useCallback((Bn,nn)=>{let{sensor:jr,options:Mr}=nn;if(A.current==null)return;const $r=C.get(A.current);if(!$r)return;const ti=Bn.nativeEvent,$i=new jr({active:A.current,activeNode:$r,event:ti,options:Mr,context:ce,onStart(mi){const Ur=A.current;if(Ur==null)return;const Va=C.get(Ur);if(!Va)return;const{onDragStart:bs}=R.current,yi={active:{id:Ur,data:Va.data,rect:N}};Wo.unstable_batchedUpdates(()=>{bs==null||bs(yi),S(ku.Initializing),b({type:Wr.DragStart,initialCoordinates:mi,active:Ur}),y({type:"onDragStart",event:yi})})},onMove(mi){b({type:Wr.DragMove,coordinates:mi})},onEnd:vo(Wr.DragEnd),onCancel:vo(Wr.DragCancel)});Wo.unstable_batchedUpdates(()=>{D($i),M(Bn.nativeEvent)});function vo(mi){return async function(){const{active:Va,collisions:bs,over:yi,scrollAdjustedTranslate:cu}=ce.current;let ua=null;if(Va&&cu){const{cancelDrop:ni}=R.current;ua={activatorEvent:ti,active:Va,collisions:bs,delta:cu,over:yi},mi===Wr.DragEnd&&typeof ni=="function"&&await Promise.resolve(ni(ua))&&(mi=Wr.DragCancel)}A.current=null,Wo.unstable_batchedUpdates(()=>{b({type:mi}),S(ku.Uninitialized),Mi(null),D(null),M(null);const ni=mi===Wr.DragEnd?"onDragEnd":"onDragCancel";if(ua){const hl=R.current[ni];hl==null||hl(ua),y({type:ni,event:ua})}})}}},[C]),Or=I.useCallback((Bn,nn)=>(jr,Mr)=>{const $r=jr.nativeEvent,ti=C.get(Mr);if(A.current!==null||!ti||$r.dndKit||$r.defaultPrevented)return;const $i={active:ti};Bn(jr,nn.options,$i)===!0&&($r.dndKit={capturedBy:nn.sensor},A.current=Mr,Ua(jr,nn))},[C,Ua]),yo=Pje(c,Or);Lje(c),ol(()=>{se&&v===ku.Initializing&&S(ku.Initialized)},[se,v]),I.useEffect(()=>{const{onDragMove:Bn}=R.current,{active:nn,activatorEvent:jr,collisions:Mr,over:$r}=ce.current;if(!nn||!jr)return;const ti={active:nn,activatorEvent:jr,collisions:Mr,delta:{x:pr.x,y:pr.y},over:$r};Wo.unstable_batchedUpdates(()=>{Bn==null||Bn(ti),y({type:"onDragMove",event:ti})})},[pr.x,pr.y]),I.useEffect(()=>{const{active:Bn,activatorEvent:nn,collisions:jr,droppableContainers:Mr,scrollAdjustedTranslate:$r}=ce.current;if(!Bn||A.current==null||!nn||!$r)return;const{onDragOver:ti}=R.current,$i=Mr.get(Fn),vo=$i&&$i.rect.current?{id:$i.id,rect:$i.rect.current,data:$i.data,disabled:$i.disabled}:null,mi={active:Bn,activatorEvent:nn,collisions:jr,delta:{x:$r.x,y:$r.y},over:vo};Wo.unstable_batchedUpdates(()=>{Mi(vo),ti==null||ti(mi),y({type:"onDragOver",event:mi})})},[Fn]),ol(()=>{ce.current={activatorEvent:L,active:O,activeNode:J,collisionRect:zr,collisions:ei,droppableRects:G,draggableNodes:C,draggingNode:ze,draggingNodeRect:mt,droppableContainers:E,over:_n,scrollableAncestors:Dn,scrollAdjustedTranslate:pr},N.current={initial:mt,translated:zr}},[O,J,ei,zr,C,ze,mt,G,E,_n,Dn,pr]),Aje({...Q,delta:T,draggingRect:zr,pointerCoordinates:Ln,scrollableAncestors:Dn,scrollableAncestorRects:Tn});const dl=I.useMemo(()=>({active:O,activeNode:J,activeNodeRect:se,activatorEvent:L,collisions:ei,containerNodeRect:be,dragOverlay:ot,draggableNodes:C,droppableContainers:E,droppableRects:G,over:_n,measureDroppableContainers:Y,scrollableAncestors:Dn,scrollableAncestorRects:Tn,measuringConfiguration:U,measuringScheduled:ee,windowRect:Ir}),[O,J,se,L,ei,be,ot,C,E,G,_n,Y,Dn,Tn,U,ee,Ir]),Fo=I.useMemo(()=>({activatorEvent:L,activators:yo,active:O,activeNodeRect:se,ariaDescribedById:{draggable:$},dispatch:b,draggableNodes:C,over:_n,measureDroppableContainers:Y}),[L,yo,O,se,b,$,C,_n,Y]);return An.createElement(DK.Provider,{value:g},An.createElement(Zy.Provider,{value:Fo},An.createElement(eQ.Provider,{value:dl},An.createElement(Ow.Provider,{value:Xi},u)),An.createElement(Hje,{disabled:(s==null?void 0:s.restoreFocus)===!1})),An.createElement(Kze,{...s,hiddenTextDescribedById:$}));function fl(){const Bn=(k==null?void 0:k.autoScrollEnabled)===!1,nn=typeof l=="object"?l.enabled===!1:l===!1,jr=w&&!Bn&&!nn;return typeof l=="object"?{...l,enabled:jr}:{enabled:jr}}}),Xje=I.createContext(null),Q$="button",Yje="Droppable";function _Qe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Iw(Yje),{activators:a,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=I.useContext(Zy),{role:h=Q$,roleDescription:p="draggable",tabIndex:m=0}=i??{},_=(l==null?void 0:l.id)===t,b=I.useContext(_?Ow:Xje),[y,g]=yS(),[v,S]=yS(),w=Fje(a,t),x=q0(n);ol(()=>(d.set(t,{id:t,key:o,node:y,activatorNode:v,data:x}),()=>{const T=d.get(t);T&&T.key===o&&d.delete(t)}),[d,t]);const C=I.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":_&&h===Q$?!0:void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[r,h,m,_,p,c.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:C,isDragging:_,listeners:r?void 0:w,node:y,over:f,setNodeRef:g,setActivatorNodeRef:S,transform:b}}function Zje(){return I.useContext(eQ)}const Jje="Droppable",eUe={timeout:25};function SQe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Iw(Jje),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=I.useContext(Zy),c=I.useRef({disabled:n}),d=I.useRef(!1),f=I.useRef(null),h=I.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:_}={...eUe,...i},b=q0(m??r),y=I.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},_)},[_]),g=Rw({callback:y,disabled:p||!a}),v=I.useCallback((C,T)=>{g&&(T&&(g.unobserve(T),d.current=!1),C&&g.observe(C))},[g]),[S,w]=yS(v),x=q0(t);return I.useEffect(()=>{!g||!S.current||(g.disconnect(),d.current=!1,g.observe(S.current))},[S,g]),ol(()=>(s({type:Wr.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:x}}),()=>s({type:Wr.UnregisterDroppable,key:o,id:r})),[r]),I.useEffect(()=>{n!==c.current.disabled&&(s({type:Wr.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:w}}function tUe(e){let{animation:t,children:n}=e;const[r,i]=I.useState(null),[o,a]=I.useState(null),s=vS(n);return!n&&!r&&s&&i(s),ol(()=>{if(!o)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),An.createElement(An.Fragment,null,n,r?I.cloneElement(r,{ref:a}):null)}const nUe={x:0,y:0,scaleX:1,scaleY:1};function rUe(e){let{children:t}=e;return An.createElement(Zy.Provider,{value:JK},An.createElement(Ow.Provider,{value:nUe},t))}const iUe={position:"fixed",touchAction:"none"},oUe=e=>XP(e)?"transform 250ms ease":void 0,aUe=I.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:s,style:l,transform:u,transition:c=oUe}=e;if(!s)return null;const d=i?u:{...u,scaleX:1,scaleY:1},f={...iUe,width:s.width,height:s.height,top:s.top,left:s.left,transform:W0.Transform.toString(d),transformOrigin:i&&r?Yze(r,s):void 0,transition:typeof c=="function"?c(r):c,...l};return An.createElement(n,{className:a,style:f,ref:t},o)}),sUe=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[s,l]of Object.entries(o.active))l!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,l));if(o!=null&&o.dragOverlay)for(const[s,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(s,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},lUe=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:W0.Transform.toString(t)},{transform:W0.Transform.toString(n)}]},uUe={duration:250,easing:"ease",keyframes:lUe,sideEffects:sUe({styles:{active:{opacity:"0"}}})};function cUe(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Pw((o,a)=>{if(t===null)return;const s=n.get(o);if(!s)return;const l=s.node.current;if(!l)return;const u=ZK(a);if(!u)return;const{transform:c}=go(a).getComputedStyle(a),d=FK(c);if(!d)return;const f=typeof t=="function"?t:dUe(t);return qK(l,i.draggable.measure),f({active:{id:o,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function dUe(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...uUe,...e};return o=>{let{active:a,dragOverlay:s,transform:l,...u}=o;if(!t)return;const c={x:s.rect.left-a.rect.left,y:s.rect.top-a.rect.top},d={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/s.rect.height:1},f={x:l.x-c.x,y:l.y-c.y,...d},h=i({...u,active:a,dragOverlay:s,transform:{initial:l,final:f}}),[p]=h,m=h[h.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;const _=r==null?void 0:r({active:a,dragOverlay:s,...u}),b=s.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{_==null||_(),y()}})}}let X$=0;function fUe(e){return I.useMemo(()=>{if(e!=null)return X$++,X$},[e])}const hUe=An.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:s="div",className:l,zIndex:u=999}=e;const{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:m,dragOverlay:_,over:b,measuringConfiguration:y,scrollableAncestors:g,scrollableAncestorRects:v,windowRect:S}=Zje(),w=I.useContext(Ow),x=fUe(d==null?void 0:d.id),C=tQ(a,{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:_.rect,over:b,overlayNodeRect:_.rect,scrollableAncestors:g,scrollableAncestorRects:v,transform:w,windowRect:S}),T=e6(f),E=cUe({config:r,draggableNodes:p,droppableContainers:m,measuringConfiguration:y}),P=T?_.setRef:void 0;return An.createElement(rUe,null,An.createElement(tUe,{animation:E},d&&x?An.createElement(aUe,{key:x,id:d.id,ref:P,as:s,activatorEvent:c,adjustScale:t,className:l,transition:o,rect:T,style:{zIndex:u,...i},transform:C},n):null))}),pUe=Ii([_K,Z4],({nodes:e},t)=>t==="nodes"?e.viewport.zoom:1),gUe=()=>{const e=xq(pUe);return I.useCallback(({activatorEvent:n,draggingNodeRect:r,transform:i})=>{if(r&&n){const o=H0(n);if(!o)return i;const a=o.x-r.left,s=o.y-r.top,l=i.x+a-r.width/2,u=i.y+s-r.height/2,c=i.scaleX*e,d=i.scaleY*e;return{x:l,y:u,scaleX:c,scaleY:d}}return i},[e])},mUe=e=>{if(!e.pointerCoordinates)return[];const t=document.elementsFromPoint(e.pointerCoordinates.x,e.pointerCoordinates.y),n=e.droppableContainers.filter(r=>r.node.current?t.includes(r.node.current):!1);return oje({...e,droppableContainers:n})};function yUe(e){return W.jsx(Qje,{...e})}const k1=28,Y$={w:k1,h:k1,maxW:k1,maxH:k1,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},vUe=e=>{if(!e.dragData)return null;if(e.dragData.payloadType==="NODE_FIELD"){const{field:t,fieldTemplate:n}=e.dragData.payload;return W.jsx(pS,{sx:{position:"relative",p:2,px:3,opacity:.7,bg:"base.300",borderRadius:"base",boxShadow:"dark-lg",whiteSpace:"nowrap",fontSize:"sm"},children:W.jsx(oK,{children:t.label||n.title})})}if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:t,width:n,height:r}=e.dragData.payload.imageDTO;return W.jsx(pS,{sx:{position:"relative",width:"full",height:"full",display:"flex",alignItems:"center",justifyContent:"center"},children:W.jsx(zP,{sx:{...Y$},objectFit:"contain",src:t,width:n,height:r})})}return e.dragData.payloadType==="IMAGE_DTOS"?W.jsxs(jP,{sx:{position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...Y$},children:[W.jsx(qE,{children:e.dragData.payload.imageDTOs.length}),W.jsx(qE,{size:"sm",children:"Images"})]}):null},bUe=I.memo(vUe),_Ue=e=>{const[t,n]=I.useState(null),r=_e("images"),i=ZTe(),o=I.useCallback(d=>{r.trace({dragData:Xt(d.active.data.current)},"Drag started");const f=d.active.data.current;f&&n(f)},[r]),a=I.useCallback(d=>{var h;r.trace({dragData:Xt(d.active.data.current)},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(_q({overData:f,activeData:t})),n(null))},[t,i,r]),s=z$(QK,{activationConstraint:{distance:10}}),l=z$(XK,{activationConstraint:{distance:10}}),u=Qze(s,l),c=gUe();return W.jsxs(yUe,{onDragStart:o,onDragEnd:a,sensors:u,collisionDetection:mUe,autoScroll:!1,children:[e.children,W.jsx(hUe,{dropAnimation:null,modifiers:[c],style:{width:"min-content",height:"min-content",cursor:"grabbing",userSelect:"none",padding:"10rem"},children:W.jsx(XW,{children:t&&W.jsx(KW.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:W.jsx(bUe,{dragData:t})},"overlay-drag-image")})})]})},SUe=I.memo(_Ue),Z$=sl(void 0),J$=sl(void 0),xUe=I.lazy(()=>mL(()=>import("./App-8c45baef.js"),["./App-8c45baef.js","./MantineProvider-70b4f32d.js","./App-6125620a.css"],import.meta.url)),wUe=I.lazy(()=>mL(()=>import("./ThemeLocaleProvider-b6697945.js"),["./ThemeLocaleProvider-b6697945.js","./MantineProvider-70b4f32d.js","./ThemeLocaleProvider-90f0fcd3.css"],import.meta.url)),CUe=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o,queueId:a,selectedImage:s,customStarUi:l})=>(I.useEffect(()=>(t&&ep.set(t),e&&o0.set(e),o&&a0.set(o),a&&Gr.set(a),vG(),i&&i.length>0?rE(F$(),...i):rE(F$()),()=>{o0.set(void 0),ep.set(void 0),a0.set(void 0),Gr.set(wG)}),[e,t,i,o,a]),I.useEffect(()=>(l&&Z$.set(l),()=>{Z$.set(void 0)}),[l]),I.useEffect(()=>(r&&J$.set(r),()=>{J$.set(void 0)}),[r]),W.jsx(An.StrictMode,{children:W.jsx(Wce,{store:bK,children:W.jsx(An.Suspense,{fallback:W.jsx(Mze,{}),children:W.jsx(wUe,{children:W.jsx(SUe,{children:W.jsx(xUe,{config:n,selectedImage:s})})})})})})),AUe=I.memo(CUe);r3.createRoot(document.getElementById("root")).render(W.jsx(AUe,{}));export{Uy as $,pi as A,Ja as B,zbe as C,No as D,tc as E,Ps as F,Zqe as G,A4 as H,Cke as I,la as J,Ky as K,A4e as L,vQe as M,fLe as N,By as O,Vbe as P,Oi as Q,Dc as R,Vm as S,$Me as T,cQe as U,sQe as V,XW as W,KW as X,fMe as Y,zy as Z,LP as _,sF as a,Vk as a$,lQe as a0,uQe as a1,J_ as a2,h7 as a3,g4e as a4,dQe as a5,Us as a6,Sc as a7,S_ as a8,qY as a9,Vd as aA,pS as aB,jP as aC,qE as aD,Z4 as aE,dx as aF,pke as aG,kqe as aH,t4e as aI,oP as aJ,Nq as aK,r4e as aL,Wo as aM,i6 as aN,pw as aO,GWe as aP,sqe as aQ,Iqe as aR,Rqe as aS,rqe as aT,tqe as aU,oK as aV,Pf as aW,ewe as aX,AG as aY,IWe as aZ,iqe as a_,An as aa,AH as ab,pQe as ac,yMe as ad,Zs as ae,Uq as af,hw as ag,LNe as ah,rK as ai,fQe as aj,nt as ak,aQe as al,hQe as am,Ii as an,_K as ao,Ak as ap,xq as aq,_qe as ar,ky as as,Xj as at,xU as au,nx as av,_e as aw,ZTe as ax,OWe as ay,qt as az,XS as b,ZUe as b$,tP as b0,bKe as b1,zP as b2,Rze as b3,me as b4,Sqe as b5,Pqe as b6,Pse as b7,Uk as b8,KUe as b9,Zg as bA,Z as bB,jqe as bC,qqe as bD,lqe as bE,uqe as bF,Cqe as bG,$_ as bH,dqe as bI,Bu as bJ,yv as bK,Gqe as bL,Uqe as bM,Vqe as bN,TUe as bO,jUe as bP,UUe as bQ,VUe as bR,GUe as bS,Jle as bT,mVe as bU,_We as bV,SWe as bW,QUe as bX,wVe as bY,HUe as bZ,dVe as b_,JWe as ba,$We as bb,_Ke as bc,iKe as bd,wxe as be,MWe as bf,DWe as bg,F2e as bh,B2e as bi,XWe as bj,ZWe as bk,NWe as bl,tKe as bm,LWe as bn,bqe as bo,RWe as bp,hKe as bq,bQe as br,fqe as bs,Lde as bt,Lqe as bu,Dqe as bv,cqe as bw,Hqe as bx,SQe as by,_Qe as bz,GJ as c,BWe as c$,vEe as c0,WUe as c1,yVe as c2,qUe as c3,kVe as c4,XUe as c5,kI as c6,YUe as c7,PI as c8,iVe as c9,aVe as cA,kWe as cB,sVe as cC,PWe as cD,Xqe as cE,hwe as cF,Ne as cG,Z$ as cH,zqe as cI,Fqe as cJ,Bqe as cK,yue as cL,jxe as cM,yG as cN,fz as cO,nqe as cP,bq as cQ,xqe as cR,s0 as cS,AU as cT,oQe as cU,wqe as cV,Av as cW,DA as cX,yKe as cY,cKe as cZ,FWe as c_,hVe as ca,zKe as cb,eVe as cc,eM as cd,Yqe as ce,LKe as cf,tVe as cg,tM as ch,Zc as ci,vse as cj,Dk as ck,BKe as cl,rM as cm,bse as cn,FKe as co,rVe as cp,nM as cq,_se as cr,yEe as cs,JUe as ct,sO as cu,CWe as cv,AWe as cw,EWe as cx,oVe as cy,TWe as cz,Roe as d,Sue as d$,lKe as d0,Vr as d1,E4 as d2,Xl as d3,Pa as d4,qo as d5,sKe as d6,lVe as d7,Y4 as d8,uKe as d9,Vle as dA,PHe as dB,by as dC,YKe as dD,DKe as dE,nQe as dF,NKe as dG,IHe as dH,RHe as dI,rQe as dJ,OHe as dK,tQe as dL,MHe as dM,$He as dN,Ule as dO,UKe as dP,NHe as dQ,qle as dR,EHe as dS,Hle as dT,THe as dU,SHe as dV,hWe as dW,yh as dX,my as dY,pVe as dZ,_ue as d_,rKe as da,Ck as db,pWe as dc,cWe as dd,dWe as de,yWe as df,fWe as dg,mWe as dh,gWe as di,ZAe as dj,FHe as dk,iHe as dl,pqe as dm,hqe as dn,sHe as dp,Mae as dq,kHe as dr,tHe as ds,xHe as dt,wHe as du,Gle as dv,CHe as dw,FUe as dx,AHe as dy,ux as dz,lB as e,RVe as e$,oqe as e0,Kqe as e1,Qqe as e2,TU as e3,Wqe as e4,o2 as e5,BVe as e6,DVe as e7,LVe as e8,FVe as e9,Sse as eA,QB as eB,Cse as eC,PUe as eD,jKe as eE,xWe as eF,Bk as eG,N2e as eH,QTe as eI,lz as eJ,OKe as eK,jVe as eL,eue as eM,zVe as eN,Ho as eO,fVe as eP,AVe as eQ,$se as eR,Jg as eS,TVe as eT,wWe as eU,_Ve as eV,SVe as eW,xVe as eX,vVe as eY,bVe as eZ,Zle as e_,Mse as ea,eo as eb,CI as ec,MUe as ed,$qe as ee,Oqe as ef,Mqe as eg,Tc as eh,II as ei,Tse as ej,AI as ek,cwe as el,uwe as em,$Ue as en,NUe as eo,u2 as ep,DUe as eq,kse as er,LUe as es,OUe as et,RUe as eu,yy as ev,Nk as ew,xse as ex,wse as ey,KB as ez,gF as f,tt as f$,IVe as f0,KVe as f1,pGe as f2,YGe as f3,gGe as f4,$Ve as f5,NVe as f6,MVe as f7,jk as f8,aKe as f9,MV as fA,nHe as fB,fA as fC,OSe as fD,BHe as fE,cHe as fF,dHe as fG,DSe as fH,iO as fI,fV as fJ,Oy as fK,Jqe as fL,Jc as fM,jHe as fN,nKe as fO,Mz as fP,Rg as fQ,aHe as fR,rHe as fS,zHe as fT,UHe as fU,QHe as fV,eHe as fW,VHe as fX,GHe as fY,gqe as fZ,G_ as f_,dKe as fa,bWe as fb,iQe as fc,vke as fd,WWe as fe,Se as ff,Lt as fg,Vn as fh,Qs as fi,nVe as fj,$Ke as fk,JKe as fl,HKe as fm,VWe as fn,qKe as fo,eQe as fp,ZKe as fq,UWe as fr,KKe as fs,WKe as ft,VKe as fu,XKe as fv,zUe as fw,GKe as fx,QKe as fy,BUe as fz,wF as g,_Ge as g$,qHe as g0,R2e as g1,Wv as g2,oHe as g3,XHe as g4,WHe as g5,vHe as g6,gHe as g7,pHe as g8,hHe as g9,aWe as gA,HV as gB,CKe as gC,SKe as gD,xKe as gE,wKe as gF,vKe as gG,oKe as gH,pKe as gI,mKe as gJ,ed as gK,kG as gL,AQ as gM,Rt as gN,EGe as gO,qGe as gP,GGe as gQ,cGe as gR,NGe as gS,WGe as gT,dwe as gU,rGe as gV,SGe as gW,dg as gX,vGe as gY,iGe as gZ,fx as g_,bHe as ga,KHe as gb,JHe as gc,ZHe as gd,uWe as ge,_ke as gf,mHe as gg,yHe as gh,vWe as gi,eWe as gj,YHe as gk,nWe as gl,PSe as gm,MKe as gn,cj as go,ZO as gp,Xt as gq,I2e as gr,E0 as gs,pc as gt,lWe as gu,rWe as gv,sWe as gw,iWe as gx,tWe as gy,HHe as gz,r2 as h,Uae as h$,eGe as h0,bGe as h1,tGe as h2,aGe as h3,GVe as h4,VVe as h5,UVe as h6,HGe as h7,Tae as h8,mB as h9,kGe as hA,iwe as hB,uGe as hC,nGe as hD,jGe as hE,zGe as hF,OGe as hG,IGe as hH,RGe as hI,ZGe as hJ,FGe as hK,JGe as hL,yGe as hM,mGe as hN,JVe as hO,ZVe as hP,XGe as hQ,WVe as hR,dGe as hS,swe as hT,rwe as hU,owe as hV,awe as hW,RKe as hX,qWe as hY,HWe as hZ,Aqe as h_,uz as ha,ep as hb,iue as hc,QVe as hd,XVe as he,YVe as hf,VGe as hg,lGe as hh,sGe as hi,sue as hj,UGe as hk,lwe as hl,lue as hm,Q4 as hn,IAe as ho,fGe as hp,TGe as hq,AGe as hr,xGe as hs,qVe as ht,HVe as hu,eqe as hv,EKe as hw,AKe as hx,$Ge as hy,PGe as hz,Coe as i,Zxe as i0,J$ as i1,zq as i2,sP as i3,Vs as i4,eMe as i5,PMe as i6,gQe as i7,b4e as i8,yQe as i9,hLe as ia,vBe as ib,bBe as ic,h4e as id,fi as j,ire as k,n2 as l,xp as m,hy as n,$o as o,JS as p,fk as q,hF as r,vk as s,gy as t,tB as u,I as v,W as w,Ma as x,_r as y,wh as z};
diff --git a/invokeai/frontend/web/dist/assets/index-a24a7159.js b/invokeai/frontend/web/dist/assets/index-a24a7159.js
deleted file mode 100644
index 368af5e6d4..0000000000
--- a/invokeai/frontend/web/dist/assets/index-a24a7159.js
+++ /dev/null
@@ -1,158 +0,0 @@
-var HK=Object.defineProperty;var WK=(e,t,n)=>t in e?HK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xw=(e,t,n)=>(WK(e,typeof t!="symbol"?t+"":t,n),n),ww=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ae=(e,t,n)=>(ww(e,t,"read from private field"),n?n.call(e):t.get(e)),Zn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},aa=(e,t,n,r)=>(ww(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Np=(e,t,n,r)=>({set _(i){aa(e,t,i,n)},get _(){return ae(e,t,r)}}),ms=(e,t,n)=>(ww(e,t,"access private method"),n);function UN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hS(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var VN={exports:{}},pS={},GN={exports:{}},Lt={};/**
- * @license React
- * react.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var G0=Symbol.for("react.element"),KK=Symbol.for("react.portal"),QK=Symbol.for("react.fragment"),XK=Symbol.for("react.strict_mode"),YK=Symbol.for("react.profiler"),ZK=Symbol.for("react.provider"),JK=Symbol.for("react.context"),eQ=Symbol.for("react.forward_ref"),tQ=Symbol.for("react.suspense"),nQ=Symbol.for("react.memo"),rQ=Symbol.for("react.lazy"),jP=Symbol.iterator;function iQ(e){return e===null||typeof e!="object"?null:(e=jP&&e[jP]||e["@@iterator"],typeof e=="function"?e:null)}var qN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},HN=Object.assign,WN={};function dp(e,t,n){this.props=e,this.context=t,this.refs=WN,this.updater=n||qN}dp.prototype.isReactComponent={};dp.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};dp.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function KN(){}KN.prototype=dp.prototype;function KT(e,t,n){this.props=e,this.context=t,this.refs=WN,this.updater=n||qN}var QT=KT.prototype=new KN;QT.constructor=KT;HN(QT,dp.prototype);QT.isPureReactComponent=!0;var UP=Array.isArray,QN=Object.prototype.hasOwnProperty,XT={current:null},XN={key:!0,ref:!0,__self:!0,__source:!0};function YN(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)QN.call(t,r)&&!XN.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:G0,type:e,key:o,ref:a,props:i,_owner:XT.current}}function oQ(e,t){return{$$typeof:G0,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function YT(e){return typeof e=="object"&&e!==null&&e.$$typeof===G0}function aQ(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var VP=/\/+/g;function Cw(e,t){return typeof e=="object"&&e!==null&&e.key!=null?aQ(""+e.key):t.toString(36)}function b1(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case G0:case KK:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Cw(a,0):r,UP(i)?(n="",e!=null&&(n=e.replace(VP,"$&/")+"/"),b1(i,t,n,"",function(u){return u})):i!=null&&(YT(i)&&(i=oQ(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(VP,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",UP(e))for(var s=0;s<e.length;s++){o=e[s];var l=r+Cw(o,s);a+=b1(o,t,n,l,i)}else if(l=iQ(e),typeof l=="function")for(e=l.call(e),s=0;!(o=e.next()).done;)o=o.value,l=r+Cw(o,s++),a+=b1(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Gy(e,t,n){if(e==null)return e;var r=[],i=0;return b1(e,r,"","",function(o){return t.call(n,o,i++)}),r}function sQ(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var lo={current:null},_1={transition:null},lQ={ReactCurrentDispatcher:lo,ReactCurrentBatchConfig:_1,ReactCurrentOwner:XT};Lt.Children={map:Gy,forEach:function(e,t,n){Gy(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Gy(e,function(){t++}),t},toArray:function(e){return Gy(e,function(t){return t})||[]},only:function(e){if(!YT(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Lt.Component=dp;Lt.Fragment=QK;Lt.Profiler=YK;Lt.PureComponent=KT;Lt.StrictMode=XK;Lt.Suspense=tQ;Lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lQ;Lt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=HN({},e.props),i=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=XT.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)QN.call(t,l)&&!XN.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:G0,type:e.type,key:i,ref:o,props:r,_owner:a}};Lt.createContext=function(e){return e={$$typeof:JK,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ZK,_context:e},e.Consumer=e};Lt.createElement=YN;Lt.createFactory=function(e){var t=YN.bind(null,e);return t.type=e,t};Lt.createRef=function(){return{current:null}};Lt.forwardRef=function(e){return{$$typeof:eQ,render:e}};Lt.isValidElement=YT;Lt.lazy=function(e){return{$$typeof:rQ,_payload:{_status:-1,_result:e},_init:sQ}};Lt.memo=function(e,t){return{$$typeof:nQ,type:e,compare:t===void 0?null:t}};Lt.startTransition=function(e){var t=_1.transition;_1.transition={};try{e()}finally{_1.transition=t}};Lt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Lt.useCallback=function(e,t){return lo.current.useCallback(e,t)};Lt.useContext=function(e){return lo.current.useContext(e)};Lt.useDebugValue=function(){};Lt.useDeferredValue=function(e){return lo.current.useDeferredValue(e)};Lt.useEffect=function(e,t){return lo.current.useEffect(e,t)};Lt.useId=function(){return lo.current.useId()};Lt.useImperativeHandle=function(e,t,n){return lo.current.useImperativeHandle(e,t,n)};Lt.useInsertionEffect=function(e,t){return lo.current.useInsertionEffect(e,t)};Lt.useLayoutEffect=function(e,t){return lo.current.useLayoutEffect(e,t)};Lt.useMemo=function(e,t){return lo.current.useMemo(e,t)};Lt.useReducer=function(e,t,n){return lo.current.useReducer(e,t,n)};Lt.useRef=function(e){return lo.current.useRef(e)};Lt.useState=function(e){return lo.current.useState(e)};Lt.useSyncExternalStore=function(e,t,n){return lo.current.useSyncExternalStore(e,t,n)};Lt.useTransition=function(){return lo.current.useTransition()};Lt.version="18.2.0";GN.exports=Lt;var I=GN.exports;const Tn=mc(I),GP=UN({__proto__:null,default:Tn},[I]);/**
- * @license React
- * react-jsx-runtime.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var uQ=I,cQ=Symbol.for("react.element"),dQ=Symbol.for("react.fragment"),fQ=Object.prototype.hasOwnProperty,hQ=uQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pQ={key:!0,ref:!0,__self:!0,__source:!0};function ZN(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)fQ.call(t,r)&&!pQ.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:cQ,type:e,key:o,ref:a,props:i,_owner:hQ.current}}pS.Fragment=dQ;pS.jsx=ZN;pS.jsxs=ZN;VN.exports=pS;var W=VN.exports,q5={},JN={exports:{}},ta={},e$={exports:{}},t$={};/**
- * @license React
- * scheduler.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */(function(e){function t(M,R){var N=M.length;M.push(R);e:for(;0<N;){var B=N-1>>>1,U=M[B];if(0<i(U,R))M[B]=R,M[N]=U,N=B;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var R=M[0],N=M.pop();if(N!==R){M[0]=N;e:for(var B=0,U=M.length,G=U>>>1;B<G;){var Z=2*(B+1)-1,ee=M[Z],J=Z+1,j=M[J];if(0>i(ee,N))J<U&&0>i(j,ee)?(M[B]=j,M[J]=N,B=J):(M[B]=ee,M[Z]=N,B=Z);else if(J<U&&0>i(j,N))M[B]=j,M[J]=N,B=J;else break e}}return R}function i(M,R){var N=M.sortIndex-R.sortIndex;return N!==0?N:M.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(M){for(var R=n(u);R!==null;){if(R.callback===null)r(u);else if(R.startTime<=M)r(u),R.sortIndex=R.expirationTime,t(l,R);else break;R=n(u)}}function v(M){if(m=!1,g(M),!p)if(n(l)!==null)p=!0,D(S);else{var R=n(u);R!==null&&L(v,R.startTime-M)}}function S(M,R){p=!1,m&&(m=!1,b(C),C=-1),h=!0;var N=f;try{for(g(R),d=n(l);d!==null&&(!(d.expirationTime>R)||M&&!P());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var U=B(d.expirationTime<=R);R=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(l)&&r(l),g(R)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var Z=n(u);Z!==null&&L(v,Z.startTime-R),G=!1}return G}finally{d=null,f=N,h=!1}}var w=!1,x=null,C=-1,k=5,T=-1;function P(){return!(e.unstable_now()-T<k)}function $(){if(x!==null){var M=e.unstable_now();T=M;var R=!0;try{R=x(!0,M)}finally{R?O():(w=!1,x=null)}}else w=!1}var O;if(typeof y=="function")O=function(){y($)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,A=E.port2;E.port1.onmessage=$,O=function(){A.postMessage(null)}}else O=function(){_($,0)};function D(M){x=M,w||(w=!0,O())}function L(M,R){C=_(function(){M(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,D(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(M){switch(f){case 1:case 2:case 3:var R=3;break;default:R=f}var N=f;f=R;try{return M()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,R){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var N=f;f=M;try{return R()}finally{f=N}},e.unstable_scheduleCallback=function(M,R,N){var B=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?B+N:B):N=B,M){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=N+U,M={id:c++,callback:R,priorityLevel:M,startTime:N,expirationTime:U,sortIndex:-1},N>B?(M.sortIndex=N,t(u,M),n(l)===null&&M===n(u)&&(m?(b(C),C=-1):m=!0,L(v,N-B))):(M.sortIndex=U,t(l,M),p||h||(p=!0,D(S))),M},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(M){var R=f;return function(){var N=f;f=R;try{return M.apply(this,arguments)}finally{f=N}}}})(t$);e$.exports=t$;var gQ=e$.exports;/**
- * @license React
- * react-dom.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var n$=I,Yo=gQ;function le(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r$=new Set,um={};function Bd(e,t){Mh(e,t),Mh(e+"Capture",t)}function Mh(e,t){for(um[e]=t,e=0;e<t.length;e++)r$.add(t[e])}var jl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H5=Object.prototype.hasOwnProperty,mQ=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,qP={},HP={};function yQ(e){return H5.call(HP,e)?!0:H5.call(qP,e)?!1:mQ.test(e)?HP[e]=!0:(qP[e]=!0,!1)}function vQ(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bQ(e,t,n,r){if(t===null||typeof t>"u"||vQ(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function uo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ri={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ri[e]=new uo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ri[t]=new uo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ri[e]=new uo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ri[e]=new uo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ri[e]=new uo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ri[e]=new uo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ri[e]=new uo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ri[e]=new uo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ri[e]=new uo(e,5,!1,e.toLowerCase(),null,!1,!1)});var ZT=/[\-:]([a-z])/g;function JT(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ZT,JT);Ri[t]=new uo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ZT,JT);Ri[t]=new uo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ZT,JT);Ri[t]=new uo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ri[e]=new uo(e,1,!1,e.toLowerCase(),null,!1,!1)});Ri.xlinkHref=new uo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ri[e]=new uo(e,1,!1,e.toLowerCase(),null,!0,!0)});function e4(e,t,n,r){var i=Ri.hasOwnProperty(t)?Ri[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(bQ(t,n,i,r)&&(n=null),r||i===null?yQ(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Yl=n$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qy=Symbol.for("react.element"),Af=Symbol.for("react.portal"),Pf=Symbol.for("react.fragment"),t4=Symbol.for("react.strict_mode"),W5=Symbol.for("react.profiler"),i$=Symbol.for("react.provider"),o$=Symbol.for("react.context"),n4=Symbol.for("react.forward_ref"),K5=Symbol.for("react.suspense"),Q5=Symbol.for("react.suspense_list"),r4=Symbol.for("react.memo"),vu=Symbol.for("react.lazy"),a$=Symbol.for("react.offscreen"),WP=Symbol.iterator;function $p(e){return e===null||typeof e!="object"?null:(e=WP&&e[WP]||e["@@iterator"],typeof e=="function"?e:null)}var dr=Object.assign,Ew;function hg(e){if(Ew===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ew=t&&t[1]||""}return`
-`+Ew+e}var Tw=!1;function kw(e,t){if(!e||Tw)return"";Tw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
-`),o=r.stack.split(`
-`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
-`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Tw=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?hg(e):""}function _Q(e){switch(e.tag){case 5:return hg(e.type);case 16:return hg("Lazy");case 13:return hg("Suspense");case 19:return hg("SuspenseList");case 0:case 2:case 15:return e=kw(e.type,!1),e;case 11:return e=kw(e.type.render,!1),e;case 1:return e=kw(e.type,!0),e;default:return""}}function X5(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pf:return"Fragment";case Af:return"Portal";case W5:return"Profiler";case t4:return"StrictMode";case K5:return"Suspense";case Q5:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case o$:return(e.displayName||"Context")+".Consumer";case i$:return(e._context.displayName||"Context")+".Provider";case n4:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case r4:return t=e.displayName||null,t!==null?t:X5(e.type)||"Memo";case vu:t=e._payload,e=e._init;try{return X5(e(t))}catch{}}return null}function SQ(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X5(t);case 8:return t===t4?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ec(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function s$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xQ(e){var t=s$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hy(e){e._valueTracker||(e._valueTracker=xQ(e))}function l$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=s$(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Y5(e,t){var n=t.checked;return dr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function KP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ec(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function u$(e,t){t=t.checked,t!=null&&e4(e,"checked",t,!1)}function Z5(e,t){u$(e,t);var n=ec(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?J5(e,t.type,n):t.hasOwnProperty("defaultValue")&&J5(e,t.type,ec(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function QP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function J5(e,t,n){(t!=="number"||fb(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pg=Array.isArray;function Zf(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ec(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function e3(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(le(91));return dr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function XP(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(le(92));if(pg(n)){if(1<n.length)throw Error(le(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ec(n)}}function c$(e,t){var n=ec(t.value),r=ec(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function YP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function d$(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function t3(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?d$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wy,f$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Wy=Wy||document.createElement("div"),Wy.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wy.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cm(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mg={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wQ=["Webkit","ms","Moz","O"];Object.keys(Mg).forEach(function(e){wQ.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mg[t]=Mg[e]})});function h$(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mg.hasOwnProperty(e)&&Mg[e]?(""+t).trim():t+"px"}function p$(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=h$(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var CQ=dr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function n3(e,t){if(t){if(CQ[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function r3(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var i3=null;function i4(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var o3=null,Jf=null,eh=null;function ZP(e){if(e=W0(e)){if(typeof o3!="function")throw Error(le(280));var t=e.stateNode;t&&(t=bS(t),o3(e.stateNode,e.type,t))}}function g$(e){Jf?eh?eh.push(e):eh=[e]:Jf=e}function m$(){if(Jf){var e=Jf,t=eh;if(eh=Jf=null,ZP(e),t)for(e=0;e<t.length;e++)ZP(t[e])}}function y$(e,t){return e(t)}function v$(){}var Aw=!1;function b$(e,t,n){if(Aw)return e(t,n);Aw=!0;try{return y$(e,t,n)}finally{Aw=!1,(Jf!==null||eh!==null)&&(v$(),m$())}}function dm(e,t){var n=e.stateNode;if(n===null)return null;var r=bS(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(le(231,t,typeof n));return n}var a3=!1;if(jl)try{var Dp={};Object.defineProperty(Dp,"passive",{get:function(){a3=!0}}),window.addEventListener("test",Dp,Dp),window.removeEventListener("test",Dp,Dp)}catch{a3=!1}function EQ(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ng=!1,hb=null,pb=!1,s3=null,TQ={onError:function(e){Ng=!0,hb=e}};function kQ(e,t,n,r,i,o,a,s,l){Ng=!1,hb=null,EQ.apply(TQ,arguments)}function AQ(e,t,n,r,i,o,a,s,l){if(kQ.apply(this,arguments),Ng){if(Ng){var u=hb;Ng=!1,hb=null}else throw Error(le(198));pb||(pb=!0,s3=u)}}function zd(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function _$(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function JP(e){if(zd(e)!==e)throw Error(le(188))}function PQ(e){var t=e.alternate;if(!t){if(t=zd(e),t===null)throw Error(le(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return JP(i),e;if(o===r)return JP(i),t;o=o.sibling}throw Error(le(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(le(189))}}if(n.alternate!==r)throw Error(le(190))}if(n.tag!==3)throw Error(le(188));return n.stateNode.current===n?e:t}function S$(e){return e=PQ(e),e!==null?x$(e):null}function x$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=x$(e);if(t!==null)return t;e=e.sibling}return null}var w$=Yo.unstable_scheduleCallback,e6=Yo.unstable_cancelCallback,IQ=Yo.unstable_shouldYield,RQ=Yo.unstable_requestPaint,Er=Yo.unstable_now,OQ=Yo.unstable_getCurrentPriorityLevel,o4=Yo.unstable_ImmediatePriority,C$=Yo.unstable_UserBlockingPriority,gb=Yo.unstable_NormalPriority,MQ=Yo.unstable_LowPriority,E$=Yo.unstable_IdlePriority,gS=null,Bs=null;function NQ(e){if(Bs&&typeof Bs.onCommitFiberRoot=="function")try{Bs.onCommitFiberRoot(gS,e,void 0,(e.current.flags&128)===128)}catch{}}var es=Math.clz32?Math.clz32:LQ,$Q=Math.log,DQ=Math.LN2;function LQ(e){return e>>>=0,e===0?32:31-($Q(e)/DQ|0)|0}var Ky=64,Qy=4194304;function gg(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mb(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=gg(s):(o&=a,o!==0&&(r=gg(o)))}else a=n&~i,a!==0?r=gg(a):o!==0&&(r=gg(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-es(t),i=1<<n,r|=e[n],t&=~i;return r}function FQ(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function BQ(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-es(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=FQ(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function l3(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function T$(){var e=Ky;return Ky<<=1,!(Ky&4194240)&&(Ky=64),e}function Pw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function q0(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-es(t),e[t]=n}function zQ(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-es(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function a4(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-es(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var yn=0;function k$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var A$,s4,P$,I$,R$,u3=!1,Xy=[],Fu=null,Bu=null,zu=null,fm=new Map,hm=new Map,Cu=[],jQ="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function t6(e,t){switch(e){case"focusin":case"focusout":Fu=null;break;case"dragenter":case"dragleave":Bu=null;break;case"mouseover":case"mouseout":zu=null;break;case"pointerover":case"pointerout":fm.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hm.delete(t.pointerId)}}function Lp(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=W0(t),t!==null&&s4(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function UQ(e,t,n,r,i){switch(t){case"focusin":return Fu=Lp(Fu,e,t,n,r,i),!0;case"dragenter":return Bu=Lp(Bu,e,t,n,r,i),!0;case"mouseover":return zu=Lp(zu,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return fm.set(o,Lp(fm.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,hm.set(o,Lp(hm.get(o)||null,e,t,n,r,i)),!0}return!1}function O$(e){var t=Zc(e.target);if(t!==null){var n=zd(t);if(n!==null){if(t=n.tag,t===13){if(t=_$(n),t!==null){e.blockedOn=t,R$(e.priority,function(){P$(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function S1(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=c3(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);i3=r,n.target.dispatchEvent(r),i3=null}else return t=W0(n),t!==null&&s4(t),e.blockedOn=n,!1;t.shift()}return!0}function n6(e,t,n){S1(e)&&n.delete(t)}function VQ(){u3=!1,Fu!==null&&S1(Fu)&&(Fu=null),Bu!==null&&S1(Bu)&&(Bu=null),zu!==null&&S1(zu)&&(zu=null),fm.forEach(n6),hm.forEach(n6)}function Fp(e,t){e.blockedOn===t&&(e.blockedOn=null,u3||(u3=!0,Yo.unstable_scheduleCallback(Yo.unstable_NormalPriority,VQ)))}function pm(e){function t(i){return Fp(i,e)}if(0<Xy.length){Fp(Xy[0],e);for(var n=1;n<Xy.length;n++){var r=Xy[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Fu!==null&&Fp(Fu,e),Bu!==null&&Fp(Bu,e),zu!==null&&Fp(zu,e),fm.forEach(t),hm.forEach(t),n=0;n<Cu.length;n++)r=Cu[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cu.length&&(n=Cu[0],n.blockedOn===null);)O$(n),n.blockedOn===null&&Cu.shift()}var th=Yl.ReactCurrentBatchConfig,yb=!0;function GQ(e,t,n,r){var i=yn,o=th.transition;th.transition=null;try{yn=1,l4(e,t,n,r)}finally{yn=i,th.transition=o}}function qQ(e,t,n,r){var i=yn,o=th.transition;th.transition=null;try{yn=4,l4(e,t,n,r)}finally{yn=i,th.transition=o}}function l4(e,t,n,r){if(yb){var i=c3(e,t,n,r);if(i===null)Bw(e,t,r,vb,n),t6(e,r);else if(UQ(i,e,t,n,r))r.stopPropagation();else if(t6(e,r),t&4&&-1<jQ.indexOf(e)){for(;i!==null;){var o=W0(i);if(o!==null&&A$(o),o=c3(e,t,n,r),o===null&&Bw(e,t,r,vb,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Bw(e,t,r,null,n)}}var vb=null;function c3(e,t,n,r){if(vb=null,e=i4(r),e=Zc(e),e!==null)if(t=zd(e),t===null)e=null;else if(n=t.tag,n===13){if(e=_$(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return vb=e,null}function M$(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(OQ()){case o4:return 1;case C$:return 4;case gb:case MQ:return 16;case E$:return 536870912;default:return 16}default:return 16}}var Ou=null,u4=null,x1=null;function N$(){if(x1)return x1;var e,t=u4,n=t.length,r,i="value"in Ou?Ou.value:Ou.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return x1=i.slice(e,1<r?1-r:void 0)}function w1(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Yy(){return!0}function r6(){return!1}function na(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Yy:r6,this.isPropagationStopped=r6,this}return dr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Yy)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yy)},persist:function(){},isPersistent:Yy}),t}var fp={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},c4=na(fp),H0=dr({},fp,{view:0,detail:0}),HQ=na(H0),Iw,Rw,Bp,mS=dr({},H0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:d4,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Bp&&(Bp&&e.type==="mousemove"?(Iw=e.screenX-Bp.screenX,Rw=e.screenY-Bp.screenY):Rw=Iw=0,Bp=e),Iw)},movementY:function(e){return"movementY"in e?e.movementY:Rw}}),i6=na(mS),WQ=dr({},mS,{dataTransfer:0}),KQ=na(WQ),QQ=dr({},H0,{relatedTarget:0}),Ow=na(QQ),XQ=dr({},fp,{animationName:0,elapsedTime:0,pseudoElement:0}),YQ=na(XQ),ZQ=dr({},fp,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),JQ=na(ZQ),eX=dr({},fp,{data:0}),o6=na(eX),tX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nX={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},rX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iX(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rX[e])?!!t[e]:!1}function d4(){return iX}var oX=dr({},H0,{key:function(e){if(e.key){var t=tX[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=w1(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nX[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:d4,charCode:function(e){return e.type==="keypress"?w1(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?w1(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),aX=na(oX),sX=dr({},mS,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),a6=na(sX),lX=dr({},H0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:d4}),uX=na(lX),cX=dr({},fp,{propertyName:0,elapsedTime:0,pseudoElement:0}),dX=na(cX),fX=dr({},mS,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hX=na(fX),pX=[9,13,27,32],f4=jl&&"CompositionEvent"in window,$g=null;jl&&"documentMode"in document&&($g=document.documentMode);var gX=jl&&"TextEvent"in window&&!$g,$$=jl&&(!f4||$g&&8<$g&&11>=$g),s6=String.fromCharCode(32),l6=!1;function D$(e,t){switch(e){case"keyup":return pX.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function L$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var If=!1;function mX(e,t){switch(e){case"compositionend":return L$(t);case"keypress":return t.which!==32?null:(l6=!0,s6);case"textInput":return e=t.data,e===s6&&l6?null:e;default:return null}}function yX(e,t){if(If)return e==="compositionend"||!f4&&D$(e,t)?(e=N$(),x1=u4=Ou=null,If=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return $$&&t.locale!=="ko"?null:t.data;default:return null}}var vX={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function u6(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vX[e.type]:t==="textarea"}function F$(e,t,n,r){g$(r),t=bb(t,"onChange"),0<t.length&&(n=new c4("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dg=null,gm=null;function bX(e){Q$(e,0)}function yS(e){var t=Mf(e);if(l$(t))return e}function _X(e,t){if(e==="change")return t}var B$=!1;if(jl){var Mw;if(jl){var Nw="oninput"in document;if(!Nw){var c6=document.createElement("div");c6.setAttribute("oninput","return;"),Nw=typeof c6.oninput=="function"}Mw=Nw}else Mw=!1;B$=Mw&&(!document.documentMode||9<document.documentMode)}function d6(){Dg&&(Dg.detachEvent("onpropertychange",z$),gm=Dg=null)}function z$(e){if(e.propertyName==="value"&&yS(gm)){var t=[];F$(t,gm,e,i4(e)),b$(bX,t)}}function SX(e,t,n){e==="focusin"?(d6(),Dg=t,gm=n,Dg.attachEvent("onpropertychange",z$)):e==="focusout"&&d6()}function xX(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yS(gm)}function wX(e,t){if(e==="click")return yS(t)}function CX(e,t){if(e==="input"||e==="change")return yS(t)}function EX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var as=typeof Object.is=="function"?Object.is:EX;function mm(e,t){if(as(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!H5.call(t,i)||!as(e[i],t[i]))return!1}return!0}function f6(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function h6(e,t){var n=f6(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=f6(n)}}function j$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?j$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function U$(){for(var e=window,t=fb();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fb(e.document)}return t}function h4(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function TX(e){var t=U$(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&j$(n.ownerDocument.documentElement,n)){if(r!==null&&h4(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=h6(n,o);var a=h6(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kX=jl&&"documentMode"in document&&11>=document.documentMode,Rf=null,d3=null,Lg=null,f3=!1;function p6(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;f3||Rf==null||Rf!==fb(r)||(r=Rf,"selectionStart"in r&&h4(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Lg&&mm(Lg,r)||(Lg=r,r=bb(d3,"onSelect"),0<r.length&&(t=new c4("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Rf)))}function Zy(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Of={animationend:Zy("Animation","AnimationEnd"),animationiteration:Zy("Animation","AnimationIteration"),animationstart:Zy("Animation","AnimationStart"),transitionend:Zy("Transition","TransitionEnd")},$w={},V$={};jl&&(V$=document.createElement("div").style,"AnimationEvent"in window||(delete Of.animationend.animation,delete Of.animationiteration.animation,delete Of.animationstart.animation),"TransitionEvent"in window||delete Of.transitionend.transition);function vS(e){if($w[e])return $w[e];if(!Of[e])return e;var t=Of[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in V$)return $w[e]=t[n];return e}var G$=vS("animationend"),q$=vS("animationiteration"),H$=vS("animationstart"),W$=vS("transitionend"),K$=new Map,g6="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yc(e,t){K$.set(e,t),Bd(t,[e])}for(var Dw=0;Dw<g6.length;Dw++){var Lw=g6[Dw],AX=Lw.toLowerCase(),PX=Lw[0].toUpperCase()+Lw.slice(1);yc(AX,"on"+PX)}yc(G$,"onAnimationEnd");yc(q$,"onAnimationIteration");yc(H$,"onAnimationStart");yc("dblclick","onDoubleClick");yc("focusin","onFocus");yc("focusout","onBlur");yc(W$,"onTransitionEnd");Mh("onMouseEnter",["mouseout","mouseover"]);Mh("onMouseLeave",["mouseout","mouseover"]);Mh("onPointerEnter",["pointerout","pointerover"]);Mh("onPointerLeave",["pointerout","pointerover"]);Bd("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bd("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bd("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bd("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bd("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bd("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mg="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),IX=new Set("cancel close invalid load scroll toggle".split(" ").concat(mg));function m6(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,AQ(r,t,void 0,e),e.currentTarget=null}function Q$(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;m6(i,s,u),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;m6(i,s,u),o=l}}}if(pb)throw e=s3,pb=!1,s3=null,e}function Un(e,t){var n=t[y3];n===void 0&&(n=t[y3]=new Set);var r=e+"__bubble";n.has(r)||(X$(t,e,2,!1),n.add(r))}function Fw(e,t,n){var r=0;t&&(r|=4),X$(n,e,r,t)}var Jy="_reactListening"+Math.random().toString(36).slice(2);function ym(e){if(!e[Jy]){e[Jy]=!0,r$.forEach(function(n){n!=="selectionchange"&&(IX.has(n)||Fw(n,!1,e),Fw(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jy]||(t[Jy]=!0,Fw("selectionchange",!1,t))}}function X$(e,t,n,r){switch(M$(t)){case 1:var i=GQ;break;case 4:i=qQ;break;default:i=l4}n=i.bind(null,t,n,e),i=void 0,!a3||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Bw(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Zc(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}b$(function(){var u=o,c=i4(n),d=[];e:{var f=K$.get(e);if(f!==void 0){var h=c4,p=e;switch(e){case"keypress":if(w1(n)===0)break e;case"keydown":case"keyup":h=aX;break;case"focusin":p="focus",h=Ow;break;case"focusout":p="blur",h=Ow;break;case"beforeblur":case"afterblur":h=Ow;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=i6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=KQ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=uX;break;case G$:case q$:case H$:h=YQ;break;case W$:h=dX;break;case"scroll":h=HQ;break;case"wheel":h=hX;break;case"copy":case"cut":case"paste":h=JQ;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=a6}var m=(t&4)!==0,_=!m&&e==="scroll",b=m?f!==null?f+"Capture":null:f;m=[];for(var y=u,g;y!==null;){g=y;var v=g.stateNode;if(g.tag===5&&v!==null&&(g=v,b!==null&&(v=dm(y,b),v!=null&&m.push(vm(y,v,g)))),_)break;y=y.return}0<m.length&&(f=new h(f,p,null,n,c),d.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==i3&&(p=n.relatedTarget||n.fromElement)&&(Zc(p)||p[Ul]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=u,p=p?Zc(p):null,p!==null&&(_=zd(p),p!==_||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(m=i6,v="onMouseLeave",b="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=a6,v="onPointerLeave",b="onPointerEnter",y="pointer"),_=h==null?f:Mf(h),g=p==null?f:Mf(p),f=new m(v,y+"leave",h,n,c),f.target=_,f.relatedTarget=g,v=null,Zc(c)===u&&(m=new m(b,y+"enter",p,n,c),m.target=g,m.relatedTarget=_,v=m),_=v,h&&p)t:{for(m=h,b=p,y=0,g=m;g;g=of(g))y++;for(g=0,v=b;v;v=of(v))g++;for(;0<y-g;)m=of(m),y--;for(;0<g-y;)b=of(b),g--;for(;y--;){if(m===b||b!==null&&m===b.alternate)break t;m=of(m),b=of(b)}m=null}else m=null;h!==null&&y6(d,f,h,m,!1),p!==null&&_!==null&&y6(d,_,p,m,!0)}}e:{if(f=u?Mf(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=_X;else if(u6(f))if(B$)S=CX;else{S=xX;var w=SX}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=wX);if(S&&(S=S(e,u))){F$(d,S,n,c);break e}w&&w(e,f,u),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&J5(f,"number",f.value)}switch(w=u?Mf(u):window,e){case"focusin":(u6(w)||w.contentEditable==="true")&&(Rf=w,d3=u,Lg=null);break;case"focusout":Lg=d3=Rf=null;break;case"mousedown":f3=!0;break;case"contextmenu":case"mouseup":case"dragend":f3=!1,p6(d,n,c);break;case"selectionchange":if(kX)break;case"keydown":case"keyup":p6(d,n,c)}var x;if(f4)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else If?D$(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&($$&&n.locale!=="ko"&&(If||C!=="onCompositionStart"?C==="onCompositionEnd"&&If&&(x=N$()):(Ou=c,u4="value"in Ou?Ou.value:Ou.textContent,If=!0)),w=bb(u,C),0<w.length&&(C=new o6(C,e,null,n,c),d.push({event:C,listeners:w}),x?C.data=x:(x=L$(n),x!==null&&(C.data=x)))),(x=gX?mX(e,n):yX(e,n))&&(u=bb(u,"onBeforeInput"),0<u.length&&(c=new o6("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=x))}Q$(d,t)})}function vm(e,t,n){return{instance:e,listener:t,currentTarget:n}}function bb(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=dm(e,n),o!=null&&r.unshift(vm(e,o,i)),o=dm(e,t),o!=null&&r.push(vm(e,o,i))),e=e.return}return r}function of(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function y6(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=dm(n,o),l!=null&&a.unshift(vm(n,l,s))):i||(l=dm(n,o),l!=null&&a.push(vm(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var RX=/\r\n?/g,OX=/\u0000|\uFFFD/g;function v6(e){return(typeof e=="string"?e:""+e).replace(RX,`
-`).replace(OX,"")}function ev(e,t,n){if(t=v6(t),v6(e)!==t&&n)throw Error(le(425))}function _b(){}var h3=null,p3=null;function g3(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var m3=typeof setTimeout=="function"?setTimeout:void 0,MX=typeof clearTimeout=="function"?clearTimeout:void 0,b6=typeof Promise=="function"?Promise:void 0,NX=typeof queueMicrotask=="function"?queueMicrotask:typeof b6<"u"?function(e){return b6.resolve(null).then(e).catch($X)}:m3;function $X(e){setTimeout(function(){throw e})}function zw(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),pm(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);pm(t)}function ju(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function _6(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var hp=Math.random().toString(36).slice(2),Is="__reactFiber$"+hp,bm="__reactProps$"+hp,Ul="__reactContainer$"+hp,y3="__reactEvents$"+hp,DX="__reactListeners$"+hp,LX="__reactHandles$"+hp;function Zc(e){var t=e[Is];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ul]||n[Is]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_6(e);e!==null;){if(n=e[Is])return n;e=_6(e)}return t}e=n,n=e.parentNode}return null}function W0(e){return e=e[Is]||e[Ul],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mf(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(le(33))}function bS(e){return e[bm]||null}var v3=[],Nf=-1;function vc(e){return{current:e}}function Qn(e){0>Nf||(e.current=v3[Nf],v3[Nf]=null,Nf--)}function $n(e,t){Nf++,v3[Nf]=e.current,e.current=t}var tc={},Wi=vc(tc),To=vc(!1),xd=tc;function Nh(e,t){var n=e.type.contextTypes;if(!n)return tc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ko(e){return e=e.childContextTypes,e!=null}function Sb(){Qn(To),Qn(Wi)}function S6(e,t,n){if(Wi.current!==tc)throw Error(le(168));$n(Wi,t),$n(To,n)}function Y$(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(le(108,SQ(e)||"Unknown",i));return dr({},n,r)}function xb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tc,xd=Wi.current,$n(Wi,e),$n(To,To.current),!0}function x6(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=Y$(e,t,xd),r.__reactInternalMemoizedMergedChildContext=e,Qn(To),Qn(Wi),$n(Wi,e)):Qn(To),$n(To,n)}var bl=null,_S=!1,jw=!1;function Z$(e){bl===null?bl=[e]:bl.push(e)}function FX(e){_S=!0,Z$(e)}function bc(){if(!jw&&bl!==null){jw=!0;var e=0,t=yn;try{var n=bl;for(yn=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}bl=null,_S=!1}catch(i){throw bl!==null&&(bl=bl.slice(e+1)),w$(o4,bc),i}finally{yn=t,jw=!1}}return null}var $f=[],Df=0,wb=null,Cb=0,ga=[],ma=0,wd=null,Pl=1,Il="";function zc(e,t){$f[Df++]=Cb,$f[Df++]=wb,wb=e,Cb=t}function J$(e,t,n){ga[ma++]=Pl,ga[ma++]=Il,ga[ma++]=wd,wd=e;var r=Pl;e=Il;var i=32-es(r)-1;r&=~(1<<i),n+=1;var o=32-es(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Pl=1<<32-es(t)+i|n<<i|r,Il=o+e}else Pl=1<<o|n<<i|r,Il=e}function p4(e){e.return!==null&&(zc(e,1),J$(e,1,0))}function g4(e){for(;e===wb;)wb=$f[--Df],$f[Df]=null,Cb=$f[--Df],$f[Df]=null;for(;e===wd;)wd=ga[--ma],ga[ma]=null,Il=ga[--ma],ga[ma]=null,Pl=ga[--ma],ga[ma]=null}var Ko=null,Ho=null,nr=!1,Ha=null;function eD(e,t){var n=ba(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function w6(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ko=e,Ho=ju(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ko=e,Ho=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=wd!==null?{id:Pl,overflow:Il}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ba(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ko=e,Ho=null,!0):!1;default:return!1}}function b3(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _3(e){if(nr){var t=Ho;if(t){var n=t;if(!w6(e,t)){if(b3(e))throw Error(le(418));t=ju(n.nextSibling);var r=Ko;t&&w6(e,t)?eD(r,n):(e.flags=e.flags&-4097|2,nr=!1,Ko=e)}}else{if(b3(e))throw Error(le(418));e.flags=e.flags&-4097|2,nr=!1,Ko=e}}}function C6(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ko=e}function tv(e){if(e!==Ko)return!1;if(!nr)return C6(e),nr=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!g3(e.type,e.memoizedProps)),t&&(t=Ho)){if(b3(e))throw tD(),Error(le(418));for(;t;)eD(e,t),t=ju(t.nextSibling)}if(C6(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(le(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ho=ju(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ho=null}}else Ho=Ko?ju(e.stateNode.nextSibling):null;return!0}function tD(){for(var e=Ho;e;)e=ju(e.nextSibling)}function $h(){Ho=Ko=null,nr=!1}function m4(e){Ha===null?Ha=[e]:Ha.push(e)}var BX=Yl.ReactCurrentBatchConfig;function Ua(e,t){if(e&&e.defaultProps){t=dr({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Eb=vc(null),Tb=null,Lf=null,y4=null;function v4(){y4=Lf=Tb=null}function b4(e){var t=Eb.current;Qn(Eb),e._currentValue=t}function S3(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function nh(e,t){Tb=e,y4=Lf=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xo=!0),e.firstContext=null)}function xa(e){var t=e._currentValue;if(y4!==e)if(e={context:e,memoizedValue:t,next:null},Lf===null){if(Tb===null)throw Error(le(308));Lf=e,Tb.dependencies={lanes:0,firstContext:e}}else Lf=Lf.next=e;return t}var Jc=null;function _4(e){Jc===null?Jc=[e]:Jc.push(e)}function nD(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,_4(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vl(e,r)}function Vl(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bu=!1;function S4(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rD(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Nl(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Uu(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vl(e,n)}return i=r.interleaved,i===null?(t.next=t,_4(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vl(e,n)}function C1(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,a4(e,n)}}function E6(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function kb(e,t,n,r){var i=e.updateQueue;bu=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,c=u=l=null,s=o;do{var f=s.lane,h=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=dr({},d,f);break e;case 2:bu=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ed|=a,e.lanes=a,e.memoizedState=d}}function T6(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(le(191,i));i.call(r)}}}var iD=new n$.Component().refs;function x3(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:dr({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var SS={isMounted:function(e){return(e=e._reactInternals)?zd(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=io(),i=Gu(e),o=Nl(r,i);o.payload=t,n!=null&&(o.callback=n),t=Uu(e,o,i),t!==null&&(ts(t,e,i,r),C1(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=io(),i=Gu(e),o=Nl(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Uu(e,o,i),t!==null&&(ts(t,e,i,r),C1(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=io(),r=Gu(e),i=Nl(n,r);i.tag=2,t!=null&&(i.callback=t),t=Uu(e,i,r),t!==null&&(ts(t,e,r,n),C1(t,e,r))}};function k6(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!mm(n,r)||!mm(i,o):!0}function oD(e,t,n){var r=!1,i=tc,o=t.contextType;return typeof o=="object"&&o!==null?o=xa(o):(i=ko(t)?xd:Wi.current,r=t.contextTypes,o=(r=r!=null)?Nh(e,i):tc),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=SS,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function A6(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&SS.enqueueReplaceState(t,t.state,null)}function w3(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=iD,S4(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=xa(o):(o=ko(t)?xd:Wi.current,i.context=Nh(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(x3(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&SS.enqueueReplaceState(i,i.state,null),kb(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function zp(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(le(309));var r=n.stateNode}if(!r)throw Error(le(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;s===iD&&(s=i.refs={}),a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(le(284));if(!n._owner)throw Error(le(290,e))}return e}function nv(e,t){throw e=Object.prototype.toString.call(t),Error(le(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function P6(e){var t=e._init;return t(e._payload)}function aD(e){function t(b,y){if(e){var g=b.deletions;g===null?(b.deletions=[y],b.flags|=16):g.push(y)}}function n(b,y){if(!e)return null;for(;y!==null;)t(b,y),y=y.sibling;return null}function r(b,y){for(b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function i(b,y){return b=qu(b,y),b.index=0,b.sibling=null,b}function o(b,y,g){return b.index=g,e?(g=b.alternate,g!==null?(g=g.index,g<y?(b.flags|=2,y):g):(b.flags|=2,y)):(b.flags|=1048576,y)}function a(b){return e&&b.alternate===null&&(b.flags|=2),b}function s(b,y,g,v){return y===null||y.tag!==6?(y=Kw(g,b.mode,v),y.return=b,y):(y=i(y,g),y.return=b,y)}function l(b,y,g,v){var S=g.type;return S===Pf?c(b,y,g.props.children,v,g.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===vu&&P6(S)===y.type)?(v=i(y,g.props),v.ref=zp(b,y,g),v.return=b,v):(v=I1(g.type,g.key,g.props,null,b.mode,v),v.ref=zp(b,y,g),v.return=b,v)}function u(b,y,g,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=Qw(g,b.mode,v),y.return=b,y):(y=i(y,g.children||[]),y.return=b,y)}function c(b,y,g,v,S){return y===null||y.tag!==7?(y=fd(g,b.mode,v,S),y.return=b,y):(y=i(y,g),y.return=b,y)}function d(b,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Kw(""+y,b.mode,g),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case qy:return g=I1(y.type,y.key,y.props,null,b.mode,g),g.ref=zp(b,null,y),g.return=b,g;case Af:return y=Qw(y,b.mode,g),y.return=b,y;case vu:var v=y._init;return d(b,v(y._payload),g)}if(pg(y)||$p(y))return y=fd(y,b.mode,g,null),y.return=b,y;nv(b,y)}return null}function f(b,y,g,v){var S=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:s(b,y,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case qy:return g.key===S?l(b,y,g,v):null;case Af:return g.key===S?u(b,y,g,v):null;case vu:return S=g._init,f(b,y,S(g._payload),v)}if(pg(g)||$p(g))return S!==null?null:c(b,y,g,v,null);nv(b,g)}return null}function h(b,y,g,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return b=b.get(g)||null,s(y,b,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case qy:return b=b.get(v.key===null?g:v.key)||null,l(y,b,v,S);case Af:return b=b.get(v.key===null?g:v.key)||null,u(y,b,v,S);case vu:var w=v._init;return h(b,y,g,w(v._payload),S)}if(pg(v)||$p(v))return b=b.get(g)||null,c(y,b,v,S,null);nv(y,v)}return null}function p(b,y,g,v){for(var S=null,w=null,x=y,C=y=0,k=null;x!==null&&C<g.length;C++){x.index>C?(k=x,x=null):k=x.sibling;var T=f(b,x,g[C],v);if(T===null){x===null&&(x=k);break}e&&x&&T.alternate===null&&t(b,x),y=o(T,y,C),w===null?S=T:w.sibling=T,w=T,x=k}if(C===g.length)return n(b,x),nr&&zc(b,C),S;if(x===null){for(;C<g.length;C++)x=d(b,g[C],v),x!==null&&(y=o(x,y,C),w===null?S=x:w.sibling=x,w=x);return nr&&zc(b,C),S}for(x=r(b,x);C<g.length;C++)k=h(x,b,C,g[C],v),k!==null&&(e&&k.alternate!==null&&x.delete(k.key===null?C:k.key),y=o(k,y,C),w===null?S=k:w.sibling=k,w=k);return e&&x.forEach(function(P){return t(b,P)}),nr&&zc(b,C),S}function m(b,y,g,v){var S=$p(g);if(typeof S!="function")throw Error(le(150));if(g=S.call(g),g==null)throw Error(le(151));for(var w=S=null,x=y,C=y=0,k=null,T=g.next();x!==null&&!T.done;C++,T=g.next()){x.index>C?(k=x,x=null):k=x.sibling;var P=f(b,x,T.value,v);if(P===null){x===null&&(x=k);break}e&&x&&P.alternate===null&&t(b,x),y=o(P,y,C),w===null?S=P:w.sibling=P,w=P,x=k}if(T.done)return n(b,x),nr&&zc(b,C),S;if(x===null){for(;!T.done;C++,T=g.next())T=d(b,T.value,v),T!==null&&(y=o(T,y,C),w===null?S=T:w.sibling=T,w=T);return nr&&zc(b,C),S}for(x=r(b,x);!T.done;C++,T=g.next())T=h(x,b,C,T.value,v),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?C:T.key),y=o(T,y,C),w===null?S=T:w.sibling=T,w=T);return e&&x.forEach(function($){return t(b,$)}),nr&&zc(b,C),S}function _(b,y,g,v){if(typeof g=="object"&&g!==null&&g.type===Pf&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case qy:e:{for(var S=g.key,w=y;w!==null;){if(w.key===S){if(S=g.type,S===Pf){if(w.tag===7){n(b,w.sibling),y=i(w,g.props.children),y.return=b,b=y;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===vu&&P6(S)===w.type){n(b,w.sibling),y=i(w,g.props),y.ref=zp(b,w,g),y.return=b,b=y;break e}n(b,w);break}else t(b,w);w=w.sibling}g.type===Pf?(y=fd(g.props.children,b.mode,v,g.key),y.return=b,b=y):(v=I1(g.type,g.key,g.props,null,b.mode,v),v.ref=zp(b,y,g),v.return=b,b=v)}return a(b);case Af:e:{for(w=g.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(b,y.sibling),y=i(y,g.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=Qw(g,b.mode,v),y.return=b,b=y}return a(b);case vu:return w=g._init,_(b,y,w(g._payload),v)}if(pg(g))return p(b,y,g,v);if($p(g))return m(b,y,g,v);nv(b,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(b,y.sibling),y=i(y,g),y.return=b,b=y):(n(b,y),y=Kw(g,b.mode,v),y.return=b,b=y),a(b)):n(b,y)}return _}var Dh=aD(!0),sD=aD(!1),K0={},zs=vc(K0),_m=vc(K0),Sm=vc(K0);function ed(e){if(e===K0)throw Error(le(174));return e}function x4(e,t){switch($n(Sm,t),$n(_m,e),$n(zs,K0),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:t3(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=t3(t,e)}Qn(zs),$n(zs,t)}function Lh(){Qn(zs),Qn(_m),Qn(Sm)}function lD(e){ed(Sm.current);var t=ed(zs.current),n=t3(t,e.type);t!==n&&($n(_m,e),$n(zs,n))}function w4(e){_m.current===e&&(Qn(zs),Qn(_m))}var lr=vc(0);function Ab(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uw=[];function C4(){for(var e=0;e<Uw.length;e++)Uw[e]._workInProgressVersionPrimary=null;Uw.length=0}var E1=Yl.ReactCurrentDispatcher,Vw=Yl.ReactCurrentBatchConfig,Cd=0,cr=null,qr=null,ui=null,Pb=!1,Fg=!1,xm=0,zX=0;function Li(){throw Error(le(321))}function E4(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!as(e[n],t[n]))return!1;return!0}function T4(e,t,n,r,i,o){if(Cd=o,cr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E1.current=e===null||e.memoizedState===null?GX:qX,e=n(r,i),Fg){o=0;do{if(Fg=!1,xm=0,25<=o)throw Error(le(301));o+=1,ui=qr=null,t.updateQueue=null,E1.current=HX,e=n(r,i)}while(Fg)}if(E1.current=Ib,t=qr!==null&&qr.next!==null,Cd=0,ui=qr=cr=null,Pb=!1,t)throw Error(le(300));return e}function k4(){var e=xm!==0;return xm=0,e}function xs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ui===null?cr.memoizedState=ui=e:ui=ui.next=e,ui}function wa(){if(qr===null){var e=cr.alternate;e=e!==null?e.memoizedState:null}else e=qr.next;var t=ui===null?cr.memoizedState:ui.next;if(t!==null)ui=t,qr=e;else{if(e===null)throw Error(le(310));qr=e,e={memoizedState:qr.memoizedState,baseState:qr.baseState,baseQueue:qr.baseQueue,queue:qr.queue,next:null},ui===null?cr.memoizedState=ui=e:ui=ui.next=e}return ui}function wm(e,t){return typeof t=="function"?t(e):t}function Gw(e){var t=wa(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=qr,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,u=o;do{var c=u.lane;if((Cd&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=d,a=r):l=l.next=d,cr.lanes|=c,Ed|=c}u=u.next}while(u!==null&&u!==o);l===null?a=r:l.next=s,as(r,t.memoizedState)||(xo=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,cr.lanes|=o,Ed|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function qw(e){var t=wa(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);as(o,t.memoizedState)||(xo=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function uD(){}function cD(e,t){var n=cr,r=wa(),i=t(),o=!as(r.memoizedState,i);if(o&&(r.memoizedState=i,xo=!0),r=r.queue,A4(hD.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ui!==null&&ui.memoizedState.tag&1){if(n.flags|=2048,Cm(9,fD.bind(null,n,r,i,t),void 0,null),fi===null)throw Error(le(349));Cd&30||dD(n,t,i)}return i}function dD(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=cr.updateQueue,t===null?(t={lastEffect:null,stores:null},cr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fD(e,t,n,r){t.value=n,t.getSnapshot=r,pD(t)&&gD(e)}function hD(e,t,n){return n(function(){pD(t)&&gD(e)})}function pD(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!as(e,n)}catch{return!0}}function gD(e){var t=Vl(e,1);t!==null&&ts(t,e,1,-1)}function I6(e){var t=xs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wm,lastRenderedState:e},t.queue=e,e=e.dispatch=VX.bind(null,cr,e),[t.memoizedState,e]}function Cm(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=cr.updateQueue,t===null?(t={lastEffect:null,stores:null},cr.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function mD(){return wa().memoizedState}function T1(e,t,n,r){var i=xs();cr.flags|=e,i.memoizedState=Cm(1|t,n,void 0,r===void 0?null:r)}function xS(e,t,n,r){var i=wa();r=r===void 0?null:r;var o=void 0;if(qr!==null){var a=qr.memoizedState;if(o=a.destroy,r!==null&&E4(r,a.deps)){i.memoizedState=Cm(t,n,o,r);return}}cr.flags|=e,i.memoizedState=Cm(1|t,n,o,r)}function R6(e,t){return T1(8390656,8,e,t)}function A4(e,t){return xS(2048,8,e,t)}function yD(e,t){return xS(4,2,e,t)}function vD(e,t){return xS(4,4,e,t)}function bD(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _D(e,t,n){return n=n!=null?n.concat([e]):null,xS(4,4,bD.bind(null,t,e),n)}function P4(){}function SD(e,t){var n=wa();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&E4(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xD(e,t){var n=wa();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&E4(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function wD(e,t,n){return Cd&21?(as(n,t)||(n=T$(),cr.lanes|=n,Ed|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,xo=!0),e.memoizedState=n)}function jX(e,t){var n=yn;yn=n!==0&&4>n?n:4,e(!0);var r=Vw.transition;Vw.transition={};try{e(!1),t()}finally{yn=n,Vw.transition=r}}function CD(){return wa().memoizedState}function UX(e,t,n){var r=Gu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ED(e))TD(t,n);else if(n=nD(e,t,n,r),n!==null){var i=io();ts(n,e,r,i),kD(n,t,r)}}function VX(e,t,n){var r=Gu(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ED(e))TD(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,as(s,a)){var l=t.interleaved;l===null?(i.next=i,_4(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=nD(e,t,i,r),n!==null&&(i=io(),ts(n,e,r,i),kD(n,t,r))}}function ED(e){var t=e.alternate;return e===cr||t!==null&&t===cr}function TD(e,t){Fg=Pb=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kD(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,a4(e,n)}}var Ib={readContext:xa,useCallback:Li,useContext:Li,useEffect:Li,useImperativeHandle:Li,useInsertionEffect:Li,useLayoutEffect:Li,useMemo:Li,useReducer:Li,useRef:Li,useState:Li,useDebugValue:Li,useDeferredValue:Li,useTransition:Li,useMutableSource:Li,useSyncExternalStore:Li,useId:Li,unstable_isNewReconciler:!1},GX={readContext:xa,useCallback:function(e,t){return xs().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:R6,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,T1(4194308,4,bD.bind(null,t,e),n)},useLayoutEffect:function(e,t){return T1(4194308,4,e,t)},useInsertionEffect:function(e,t){return T1(4,2,e,t)},useMemo:function(e,t){var n=xs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xs();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=UX.bind(null,cr,e),[r.memoizedState,e]},useRef:function(e){var t=xs();return e={current:e},t.memoizedState=e},useState:I6,useDebugValue:P4,useDeferredValue:function(e){return xs().memoizedState=e},useTransition:function(){var e=I6(!1),t=e[0];return e=jX.bind(null,e[1]),xs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=cr,i=xs();if(nr){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),fi===null)throw Error(le(349));Cd&30||dD(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,R6(hD.bind(null,r,o,e),[e]),r.flags|=2048,Cm(9,fD.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=xs(),t=fi.identifierPrefix;if(nr){var n=Il,r=Pl;n=(r&~(1<<32-es(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xm++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=zX++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},qX={readContext:xa,useCallback:SD,useContext:xa,useEffect:A4,useImperativeHandle:_D,useInsertionEffect:yD,useLayoutEffect:vD,useMemo:xD,useReducer:Gw,useRef:mD,useState:function(){return Gw(wm)},useDebugValue:P4,useDeferredValue:function(e){var t=wa();return wD(t,qr.memoizedState,e)},useTransition:function(){var e=Gw(wm)[0],t=wa().memoizedState;return[e,t]},useMutableSource:uD,useSyncExternalStore:cD,useId:CD,unstable_isNewReconciler:!1},HX={readContext:xa,useCallback:SD,useContext:xa,useEffect:A4,useImperativeHandle:_D,useInsertionEffect:yD,useLayoutEffect:vD,useMemo:xD,useReducer:qw,useRef:mD,useState:function(){return qw(wm)},useDebugValue:P4,useDeferredValue:function(e){var t=wa();return qr===null?t.memoizedState=e:wD(t,qr.memoizedState,e)},useTransition:function(){var e=qw(wm)[0],t=wa().memoizedState;return[e,t]},useMutableSource:uD,useSyncExternalStore:cD,useId:CD,unstable_isNewReconciler:!1};function Fh(e,t){try{var n="",r=t;do n+=_Q(r),r=r.return;while(r);var i=n}catch(o){i=`
-Error generating stack: `+o.message+`
-`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Hw(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function C3(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var WX=typeof WeakMap=="function"?WeakMap:Map;function AD(e,t,n){n=Nl(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ob||(Ob=!0,N3=r),C3(e,t)},n}function PD(e,t,n){n=Nl(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){C3(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){C3(e,t),typeof r!="function"&&(Vu===null?Vu=new Set([this]):Vu.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function O6(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new WX;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=sY.bind(null,e,t,n),t.then(e,e))}function M6(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function N6(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Nl(-1,1),t.tag=2,Uu(n,t,1))),n.lanes|=1),e)}var KX=Yl.ReactCurrentOwner,xo=!1;function to(e,t,n,r){t.child=e===null?sD(t,null,n,r):Dh(t,e.child,n,r)}function $6(e,t,n,r,i){n=n.render;var o=t.ref;return nh(t,i),r=T4(e,t,n,r,o,i),n=k4(),e!==null&&!xo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Gl(e,t,i)):(nr&&n&&p4(t),t.flags|=1,to(e,t,r,i),t.child)}function D6(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!L4(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,ID(e,t,o,r,i)):(e=I1(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:mm,n(a,r)&&e.ref===t.ref)return Gl(e,t,i)}return t.flags|=1,e=qu(o,r),e.ref=t.ref,e.return=t,t.child=e}function ID(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(mm(o,r)&&e.ref===t.ref)if(xo=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(xo=!0);else return t.lanes=e.lanes,Gl(e,t,i)}return E3(e,t,n,r,i)}function RD(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},$n(Bf,Uo),Uo|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,$n(Bf,Uo),Uo|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,$n(Bf,Uo),Uo|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,$n(Bf,Uo),Uo|=r;return to(e,t,i,n),t.child}function OD(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function E3(e,t,n,r,i){var o=ko(n)?xd:Wi.current;return o=Nh(t,o),nh(t,i),n=T4(e,t,n,r,o,i),r=k4(),e!==null&&!xo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Gl(e,t,i)):(nr&&r&&p4(t),t.flags|=1,to(e,t,n,i),t.child)}function L6(e,t,n,r,i){if(ko(n)){var o=!0;xb(t)}else o=!1;if(nh(t,i),t.stateNode===null)k1(e,t),oD(t,n,r),w3(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=xa(u):(u=ko(n)?xd:Wi.current,u=Nh(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&A6(t,a,r,u),bu=!1;var f=t.memoizedState;a.state=f,kb(t,r,a,i),l=t.memoizedState,s!==r||f!==l||To.current||bu?(typeof c=="function"&&(x3(t,n,c,r),l=t.memoizedState),(s=bu||k6(t,n,s,r,f,l,u))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,rD(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ua(t.type,s),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=xa(l):(l=ko(n)?xd:Wi.current,l=Nh(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==d||f!==l)&&A6(t,a,r,l),bu=!1,f=t.memoizedState,a.state=f,kb(t,r,a,i);var p=t.memoizedState;s!==d||f!==p||To.current||bu?(typeof h=="function"&&(x3(t,n,h,r),p=t.memoizedState),(u=bu||k6(t,n,u,r,f,p,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return T3(e,t,n,r,o,i)}function T3(e,t,n,r,i,o){OD(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&x6(t,n,!1),Gl(e,t,o);r=t.stateNode,KX.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Dh(t,e.child,null,o),t.child=Dh(t,null,s,o)):to(e,t,s,o),t.memoizedState=r.state,i&&x6(t,n,!0),t.child}function MD(e){var t=e.stateNode;t.pendingContext?S6(e,t.pendingContext,t.pendingContext!==t.context):t.context&&S6(e,t.context,!1),x4(e,t.containerInfo)}function F6(e,t,n,r,i){return $h(),m4(i),t.flags|=256,to(e,t,n,r),t.child}var k3={dehydrated:null,treeContext:null,retryLane:0};function A3(e){return{baseLanes:e,cachePool:null,transitions:null}}function ND(e,t,n){var r=t.pendingProps,i=lr.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),$n(lr,i&1),e===null)return _3(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=ES(a,r,0,null),e=fd(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=A3(n),t.memoizedState=k3,e):I4(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return QX(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=qu(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=qu(s,o):(o=fd(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?A3(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=k3,r}return o=e.child,e=o.sibling,r=qu(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function I4(e,t){return t=ES({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rv(e,t,n,r){return r!==null&&m4(r),Dh(t,e.child,null,n),e=I4(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function QX(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=Hw(Error(le(422))),rv(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=ES({mode:"visible",children:r.children},i,0,null),o=fd(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Dh(t,e.child,null,a),t.child.memoizedState=A3(a),t.memoizedState=k3,o);if(!(t.mode&1))return rv(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(le(419)),r=Hw(o,r,void 0),rv(e,t,a,r)}if(s=(a&e.childLanes)!==0,xo||s){if(r=fi,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Vl(e,i),ts(r,e,i,-1))}return D4(),r=Hw(Error(le(421))),rv(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=lY.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Ho=ju(i.nextSibling),Ko=t,nr=!0,Ha=null,e!==null&&(ga[ma++]=Pl,ga[ma++]=Il,ga[ma++]=wd,Pl=e.id,Il=e.overflow,wd=t),t=I4(t,r.children),t.flags|=4096,t)}function B6(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),S3(e.return,t,n)}function Ww(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function $D(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(to(e,t,r.children,n),r=lr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&B6(e,n,t);else if(e.tag===19)B6(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($n(lr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ab(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ww(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ab(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ww(t,!0,n,null,o);break;case"together":Ww(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function k1(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Gl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ed|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(le(153));if(t.child!==null){for(e=t.child,n=qu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function XX(e,t,n){switch(t.tag){case 3:MD(t),$h();break;case 5:lD(t);break;case 1:ko(t.type)&&xb(t);break;case 4:x4(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;$n(Eb,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?($n(lr,lr.current&1),t.flags|=128,null):n&t.child.childLanes?ND(e,t,n):($n(lr,lr.current&1),e=Gl(e,t,n),e!==null?e.sibling:null);$n(lr,lr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return $D(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$n(lr,lr.current),r)break;return null;case 22:case 23:return t.lanes=0,RD(e,t,n)}return Gl(e,t,n)}var DD,P3,LD,FD;DD=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};P3=function(){};LD=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ed(zs.current);var o=null;switch(n){case"input":i=Y5(e,i),r=Y5(e,r),o=[];break;case"select":i=dr({},i,{value:void 0}),r=dr({},r,{value:void 0}),o=[];break;case"textarea":i=e3(e,i),r=e3(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=_b)}n3(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(um.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(um.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Un("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};FD=function(e,t,n,r){n!==r&&(t.flags|=4)};function jp(e,t){if(!nr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fi(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function YX(e,t,n){var r=t.pendingProps;switch(g4(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fi(t),null;case 1:return ko(t.type)&&Sb(),Fi(t),null;case 3:return r=t.stateNode,Lh(),Qn(To),Qn(Wi),C4(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(tv(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ha!==null&&(L3(Ha),Ha=null))),P3(e,t),Fi(t),null;case 5:w4(t);var i=ed(Sm.current);if(n=t.type,e!==null&&t.stateNode!=null)LD(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(le(166));return Fi(t),null}if(e=ed(zs.current),tv(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Is]=t,r[bm]=o,e=(t.mode&1)!==0,n){case"dialog":Un("cancel",r),Un("close",r);break;case"iframe":case"object":case"embed":Un("load",r);break;case"video":case"audio":for(i=0;i<mg.length;i++)Un(mg[i],r);break;case"source":Un("error",r);break;case"img":case"image":case"link":Un("error",r),Un("load",r);break;case"details":Un("toggle",r);break;case"input":KP(r,o),Un("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Un("invalid",r);break;case"textarea":XP(r,o),Un("invalid",r)}n3(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&ev(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&ev(r.textContent,s,e),i=["children",""+s]):um.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&Un("scroll",r)}switch(n){case"input":Hy(r),QP(r,o,!0);break;case"textarea":Hy(r),YP(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=_b)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=d$(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Is]=t,e[bm]=r,DD(e,t,!1,!1),t.stateNode=e;e:{switch(a=r3(n,r),n){case"dialog":Un("cancel",e),Un("close",e),i=r;break;case"iframe":case"object":case"embed":Un("load",e),i=r;break;case"video":case"audio":for(i=0;i<mg.length;i++)Un(mg[i],e);i=r;break;case"source":Un("error",e),i=r;break;case"img":case"image":case"link":Un("error",e),Un("load",e),i=r;break;case"details":Un("toggle",e),i=r;break;case"input":KP(e,r),i=Y5(e,r),Un("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=dr({},r,{value:void 0}),Un("invalid",e);break;case"textarea":XP(e,r),i=e3(e,r),Un("invalid",e);break;default:i=r}n3(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?p$(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&f$(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&cm(e,l):typeof l=="number"&&cm(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(um.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Un("scroll",e):l!=null&&e4(e,o,l,a))}switch(n){case"input":Hy(e),QP(e,r,!1);break;case"textarea":Hy(e),YP(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ec(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Zf(e,!!r.multiple,o,!1):r.defaultValue!=null&&Zf(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=_b)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Fi(t),null;case 6:if(e&&t.stateNode!=null)FD(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(le(166));if(n=ed(Sm.current),ed(zs.current),tv(t)){if(r=t.stateNode,n=t.memoizedProps,r[Is]=t,(o=r.nodeValue!==n)&&(e=Ko,e!==null))switch(e.tag){case 3:ev(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ev(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Is]=t,t.stateNode=r}return Fi(t),null;case 13:if(Qn(lr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(nr&&Ho!==null&&t.mode&1&&!(t.flags&128))tD(),$h(),t.flags|=98560,o=!1;else if(o=tv(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(le(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(le(317));o[Is]=t}else $h(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fi(t),o=!1}else Ha!==null&&(L3(Ha),Ha=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||lr.current&1?Kr===0&&(Kr=3):D4())),t.updateQueue!==null&&(t.flags|=4),Fi(t),null);case 4:return Lh(),P3(e,t),e===null&&ym(t.stateNode.containerInfo),Fi(t),null;case 10:return b4(t.type._context),Fi(t),null;case 17:return ko(t.type)&&Sb(),Fi(t),null;case 19:if(Qn(lr),o=t.memoizedState,o===null)return Fi(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)jp(o,!1);else{if(Kr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ab(e),a!==null){for(t.flags|=128,jp(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return $n(lr,lr.current&1|2),t.child}e=e.sibling}o.tail!==null&&Er()>Bh&&(t.flags|=128,r=!0,jp(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ab(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jp(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!nr)return Fi(t),null}else 2*Er()-o.renderingStartTime>Bh&&n!==1073741824&&(t.flags|=128,r=!0,jp(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Er(),t.sibling=null,n=lr.current,$n(lr,r?n&1|2:n&1),t):(Fi(t),null);case 22:case 23:return $4(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Uo&1073741824&&(Fi(t),t.subtreeFlags&6&&(t.flags|=8192)):Fi(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}function ZX(e,t){switch(g4(t),t.tag){case 1:return ko(t.type)&&Sb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lh(),Qn(To),Qn(Wi),C4(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return w4(t),null;case 13:if(Qn(lr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));$h()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qn(lr),null;case 4:return Lh(),null;case 10:return b4(t.type._context),null;case 22:case 23:return $4(),null;case 24:return null;default:return null}}var iv=!1,Gi=!1,JX=typeof WeakSet=="function"?WeakSet:Set,De=null;function Ff(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){mr(e,t,r)}else n.current=null}function I3(e,t,n){try{n()}catch(r){mr(e,t,r)}}var z6=!1;function eY(e,t){if(h3=yb,e=U$(),h4(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=a),f===o&&++c===r&&(l=a),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(p3={focusedElem:e,selectionRange:n},yb=!1,De=t;De!==null;)if(t=De,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,De=e;else for(;De!==null;){t=De;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,_=p.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ua(t.type,m),_);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(v){mr(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,De=e;break}De=t.return}return p=z6,z6=!1,p}function Bg(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&I3(t,n,o)}i=i.next}while(i!==r)}}function wS(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function R3(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function BD(e){var t=e.alternate;t!==null&&(e.alternate=null,BD(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Is],delete t[bm],delete t[y3],delete t[DX],delete t[LX])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function zD(e){return e.tag===5||e.tag===3||e.tag===4}function j6(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zD(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function O3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_b));else if(r!==4&&(e=e.child,e!==null))for(O3(e,t,n),e=e.sibling;e!==null;)O3(e,t,n),e=e.sibling}function M3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(M3(e,t,n),e=e.sibling;e!==null;)M3(e,t,n),e=e.sibling}var wi=null,Ga=!1;function lu(e,t,n){for(n=n.child;n!==null;)jD(e,t,n),n=n.sibling}function jD(e,t,n){if(Bs&&typeof Bs.onCommitFiberUnmount=="function")try{Bs.onCommitFiberUnmount(gS,n)}catch{}switch(n.tag){case 5:Gi||Ff(n,t);case 6:var r=wi,i=Ga;wi=null,lu(e,t,n),wi=r,Ga=i,wi!==null&&(Ga?(e=wi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wi.removeChild(n.stateNode));break;case 18:wi!==null&&(Ga?(e=wi,n=n.stateNode,e.nodeType===8?zw(e.parentNode,n):e.nodeType===1&&zw(e,n),pm(e)):zw(wi,n.stateNode));break;case 4:r=wi,i=Ga,wi=n.stateNode.containerInfo,Ga=!0,lu(e,t,n),wi=r,Ga=i;break;case 0:case 11:case 14:case 15:if(!Gi&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&I3(n,t,a),i=i.next}while(i!==r)}lu(e,t,n);break;case 1:if(!Gi&&(Ff(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){mr(n,t,s)}lu(e,t,n);break;case 21:lu(e,t,n);break;case 22:n.mode&1?(Gi=(r=Gi)||n.memoizedState!==null,lu(e,t,n),Gi=r):lu(e,t,n);break;default:lu(e,t,n)}}function U6(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new JX),t.forEach(function(r){var i=uY.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ba(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:wi=s.stateNode,Ga=!1;break e;case 3:wi=s.stateNode.containerInfo,Ga=!0;break e;case 4:wi=s.stateNode.containerInfo,Ga=!0;break e}s=s.return}if(wi===null)throw Error(le(160));jD(o,a,i),wi=null,Ga=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){mr(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)UD(t,e),t=t.sibling}function UD(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ba(t,e),ys(e),r&4){try{Bg(3,e,e.return),wS(3,e)}catch(m){mr(e,e.return,m)}try{Bg(5,e,e.return)}catch(m){mr(e,e.return,m)}}break;case 1:Ba(t,e),ys(e),r&512&&n!==null&&Ff(n,n.return);break;case 5:if(Ba(t,e),ys(e),r&512&&n!==null&&Ff(n,n.return),e.flags&32){var i=e.stateNode;try{cm(i,"")}catch(m){mr(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&u$(i,o),r3(s,a);var u=r3(s,o);for(a=0;a<l.length;a+=2){var c=l[a],d=l[a+1];c==="style"?p$(i,d):c==="dangerouslySetInnerHTML"?f$(i,d):c==="children"?cm(i,d):e4(i,c,d,u)}switch(s){case"input":Z5(i,o);break;case"textarea":c$(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Zf(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Zf(i,!!o.multiple,o.defaultValue,!0):Zf(i,!!o.multiple,o.multiple?[]:"",!1))}i[bm]=o}catch(m){mr(e,e.return,m)}}break;case 6:if(Ba(t,e),ys(e),r&4){if(e.stateNode===null)throw Error(le(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){mr(e,e.return,m)}}break;case 3:if(Ba(t,e),ys(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{pm(t.containerInfo)}catch(m){mr(e,e.return,m)}break;case 4:Ba(t,e),ys(e);break;case 13:Ba(t,e),ys(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(M4=Er())),r&4&&U6(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Gi=(u=Gi)||c,Ba(t,e),Gi=u):Ba(t,e),ys(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(De=e,c=e.child;c!==null;){for(d=De=c;De!==null;){switch(f=De,h=f.child,f.tag){case 0:case 11:case 14:case 15:Bg(4,f,f.return);break;case 1:Ff(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){mr(r,n,m)}}break;case 5:Ff(f,f.return);break;case 22:if(f.memoizedState!==null){G6(d);continue}}h!==null?(h.return=f,De=h):G6(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=h$("display",a))}catch(m){mr(e,e.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){mr(e,e.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ba(t,e),ys(e),r&4&&U6(e);break;case 21:break;default:Ba(t,e),ys(e)}}function ys(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(zD(n)){var r=n;break e}n=n.return}throw Error(le(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(cm(i,""),r.flags&=-33);var o=j6(e);M3(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=j6(e);O3(e,s,a);break;default:throw Error(le(161))}}catch(l){mr(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tY(e,t,n){De=e,VD(e)}function VD(e,t,n){for(var r=(e.mode&1)!==0;De!==null;){var i=De,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||iv;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||Gi;s=iv;var u=Gi;if(iv=a,(Gi=l)&&!u)for(De=i;De!==null;)a=De,l=a.child,a.tag===22&&a.memoizedState!==null?q6(i):l!==null?(l.return=a,De=l):q6(i);for(;o!==null;)De=o,VD(o),o=o.sibling;De=i,iv=s,Gi=u}V6(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,De=o):V6(e)}}function V6(e){for(;De!==null;){var t=De;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Gi||wS(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Gi)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ua(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&T6(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}T6(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&pm(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(le(163))}Gi||t.flags&512&&R3(t)}catch(f){mr(t,t.return,f)}}if(t===e){De=null;break}if(n=t.sibling,n!==null){n.return=t.return,De=n;break}De=t.return}}function G6(e){for(;De!==null;){var t=De;if(t===e){De=null;break}var n=t.sibling;if(n!==null){n.return=t.return,De=n;break}De=t.return}}function q6(e){for(;De!==null;){var t=De;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wS(4,t)}catch(l){mr(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){mr(t,i,l)}}var o=t.return;try{R3(t)}catch(l){mr(t,o,l)}break;case 5:var a=t.return;try{R3(t)}catch(l){mr(t,a,l)}}}catch(l){mr(t,t.return,l)}if(t===e){De=null;break}var s=t.sibling;if(s!==null){s.return=t.return,De=s;break}De=t.return}}var nY=Math.ceil,Rb=Yl.ReactCurrentDispatcher,R4=Yl.ReactCurrentOwner,Sa=Yl.ReactCurrentBatchConfig,Ht=0,fi=null,Lr=null,Pi=0,Uo=0,Bf=vc(0),Kr=0,Em=null,Ed=0,CS=0,O4=0,zg=null,bo=null,M4=0,Bh=1/0,yl=null,Ob=!1,N3=null,Vu=null,ov=!1,Mu=null,Mb=0,jg=0,$3=null,A1=-1,P1=0;function io(){return Ht&6?Er():A1!==-1?A1:A1=Er()}function Gu(e){return e.mode&1?Ht&2&&Pi!==0?Pi&-Pi:BX.transition!==null?(P1===0&&(P1=T$()),P1):(e=yn,e!==0||(e=window.event,e=e===void 0?16:M$(e.type)),e):1}function ts(e,t,n,r){if(50<jg)throw jg=0,$3=null,Error(le(185));q0(e,n,r),(!(Ht&2)||e!==fi)&&(e===fi&&(!(Ht&2)&&(CS|=n),Kr===4&&Eu(e,Pi)),Ao(e,r),n===1&&Ht===0&&!(t.mode&1)&&(Bh=Er()+500,_S&&bc()))}function Ao(e,t){var n=e.callbackNode;BQ(e,t);var r=mb(e,e===fi?Pi:0);if(r===0)n!==null&&e6(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&e6(n),t===1)e.tag===0?FX(H6.bind(null,e)):Z$(H6.bind(null,e)),NX(function(){!(Ht&6)&&bc()}),n=null;else{switch(k$(r)){case 1:n=o4;break;case 4:n=C$;break;case 16:n=gb;break;case 536870912:n=E$;break;default:n=gb}n=YD(n,GD.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function GD(e,t){if(A1=-1,P1=0,Ht&6)throw Error(le(327));var n=e.callbackNode;if(rh()&&e.callbackNode!==n)return null;var r=mb(e,e===fi?Pi:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Nb(e,r);else{t=r;var i=Ht;Ht|=2;var o=HD();(fi!==e||Pi!==t)&&(yl=null,Bh=Er()+500,dd(e,t));do try{oY();break}catch(s){qD(e,s)}while(1);v4(),Rb.current=o,Ht=i,Lr!==null?t=0:(fi=null,Pi=0,t=Kr)}if(t!==0){if(t===2&&(i=l3(e),i!==0&&(r=i,t=D3(e,i))),t===1)throw n=Em,dd(e,0),Eu(e,r),Ao(e,Er()),n;if(t===6)Eu(e,r);else{if(i=e.current.alternate,!(r&30)&&!rY(i)&&(t=Nb(e,r),t===2&&(o=l3(e),o!==0&&(r=o,t=D3(e,o))),t===1))throw n=Em,dd(e,0),Eu(e,r),Ao(e,Er()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(le(345));case 2:jc(e,bo,yl);break;case 3:if(Eu(e,r),(r&130023424)===r&&(t=M4+500-Er(),10<t)){if(mb(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){io(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=m3(jc.bind(null,e,bo,yl),t);break}jc(e,bo,yl);break;case 4:if(Eu(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-es(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=Er()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nY(r/1960))-r,10<r){e.timeoutHandle=m3(jc.bind(null,e,bo,yl),r);break}jc(e,bo,yl);break;case 5:jc(e,bo,yl);break;default:throw Error(le(329))}}}return Ao(e,Er()),e.callbackNode===n?GD.bind(null,e):null}function D3(e,t){var n=zg;return e.current.memoizedState.isDehydrated&&(dd(e,t).flags|=256),e=Nb(e,t),e!==2&&(t=bo,bo=n,t!==null&&L3(t)),e}function L3(e){bo===null?bo=e:bo.push.apply(bo,e)}function rY(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!as(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Eu(e,t){for(t&=~O4,t&=~CS,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-es(t),r=1<<n;e[n]=-1,t&=~r}}function H6(e){if(Ht&6)throw Error(le(327));rh();var t=mb(e,0);if(!(t&1))return Ao(e,Er()),null;var n=Nb(e,t);if(e.tag!==0&&n===2){var r=l3(e);r!==0&&(t=r,n=D3(e,r))}if(n===1)throw n=Em,dd(e,0),Eu(e,t),Ao(e,Er()),n;if(n===6)throw Error(le(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,jc(e,bo,yl),Ao(e,Er()),null}function N4(e,t){var n=Ht;Ht|=1;try{return e(t)}finally{Ht=n,Ht===0&&(Bh=Er()+500,_S&&bc())}}function Td(e){Mu!==null&&Mu.tag===0&&!(Ht&6)&&rh();var t=Ht;Ht|=1;var n=Sa.transition,r=yn;try{if(Sa.transition=null,yn=1,e)return e()}finally{yn=r,Sa.transition=n,Ht=t,!(Ht&6)&&bc()}}function $4(){Uo=Bf.current,Qn(Bf)}function dd(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,MX(n)),Lr!==null)for(n=Lr.return;n!==null;){var r=n;switch(g4(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sb();break;case 3:Lh(),Qn(To),Qn(Wi),C4();break;case 5:w4(r);break;case 4:Lh();break;case 13:Qn(lr);break;case 19:Qn(lr);break;case 10:b4(r.type._context);break;case 22:case 23:$4()}n=n.return}if(fi=e,Lr=e=qu(e.current,null),Pi=Uo=t,Kr=0,Em=null,O4=CS=Ed=0,bo=zg=null,Jc!==null){for(t=0;t<Jc.length;t++)if(n=Jc[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}Jc=null}return e}function qD(e,t){do{var n=Lr;try{if(v4(),E1.current=Ib,Pb){for(var r=cr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Pb=!1}if(Cd=0,ui=qr=cr=null,Fg=!1,xm=0,R4.current=null,n===null||n.return===null){Kr=1,Em=t,Lr=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=Pi,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=M6(a);if(h!==null){h.flags&=-257,N6(h,a,s,o,t),h.mode&1&&O6(o,u,t),t=h,l=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}else{if(!(t&1)){O6(o,u,t),D4();break e}l=Error(le(426))}}else if(nr&&s.mode&1){var _=M6(a);if(_!==null){!(_.flags&65536)&&(_.flags|=256),N6(_,a,s,o,t),m4(Fh(l,s));break e}}o=l=Fh(l,s),Kr!==4&&(Kr=2),zg===null?zg=[o]:zg.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var b=AD(o,l,t);E6(o,b);break e;case 1:s=l;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Vu===null||!Vu.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var v=PD(o,s,t);E6(o,v);break e}}o=o.return}while(o!==null)}KD(n)}catch(S){t=S,Lr===n&&n!==null&&(Lr=n=n.return);continue}break}while(1)}function HD(){var e=Rb.current;return Rb.current=Ib,e===null?Ib:e}function D4(){(Kr===0||Kr===3||Kr===2)&&(Kr=4),fi===null||!(Ed&268435455)&&!(CS&268435455)||Eu(fi,Pi)}function Nb(e,t){var n=Ht;Ht|=2;var r=HD();(fi!==e||Pi!==t)&&(yl=null,dd(e,t));do try{iY();break}catch(i){qD(e,i)}while(1);if(v4(),Ht=n,Rb.current=r,Lr!==null)throw Error(le(261));return fi=null,Pi=0,Kr}function iY(){for(;Lr!==null;)WD(Lr)}function oY(){for(;Lr!==null&&!IQ();)WD(Lr)}function WD(e){var t=XD(e.alternate,e,Uo);e.memoizedProps=e.pendingProps,t===null?KD(e):Lr=t,R4.current=null}function KD(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ZX(n,t),n!==null){n.flags&=32767,Lr=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Kr=6,Lr=null;return}}else if(n=YX(n,t,Uo),n!==null){Lr=n;return}if(t=t.sibling,t!==null){Lr=t;return}Lr=t=e}while(t!==null);Kr===0&&(Kr=5)}function jc(e,t,n){var r=yn,i=Sa.transition;try{Sa.transition=null,yn=1,aY(e,t,n,r)}finally{Sa.transition=i,yn=r}return null}function aY(e,t,n,r){do rh();while(Mu!==null);if(Ht&6)throw Error(le(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(le(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(zQ(e,o),e===fi&&(Lr=fi=null,Pi=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ov||(ov=!0,YD(gb,function(){return rh(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Sa.transition,Sa.transition=null;var a=yn;yn=1;var s=Ht;Ht|=4,R4.current=null,eY(e,n),UD(n,e),TX(p3),yb=!!h3,p3=h3=null,e.current=n,tY(n),RQ(),Ht=s,yn=a,Sa.transition=o}else e.current=n;if(ov&&(ov=!1,Mu=e,Mb=i),o=e.pendingLanes,o===0&&(Vu=null),NQ(n.stateNode),Ao(e,Er()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ob)throw Ob=!1,e=N3,N3=null,e;return Mb&1&&e.tag!==0&&rh(),o=e.pendingLanes,o&1?e===$3?jg++:(jg=0,$3=e):jg=0,bc(),null}function rh(){if(Mu!==null){var e=k$(Mb),t=Sa.transition,n=yn;try{if(Sa.transition=null,yn=16>e?16:e,Mu===null)var r=!1;else{if(e=Mu,Mu=null,Mb=0,Ht&6)throw Error(le(331));var i=Ht;for(Ht|=4,De=e.current;De!==null;){var o=De,a=o.child;if(De.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(De=u;De!==null;){var c=De;switch(c.tag){case 0:case 11:case 15:Bg(8,c,o)}var d=c.child;if(d!==null)d.return=c,De=d;else for(;De!==null;){c=De;var f=c.sibling,h=c.return;if(BD(c),c===u){De=null;break}if(f!==null){f.return=h,De=f;break}De=h}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}De=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,De=a;else e:for(;De!==null;){if(o=De,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Bg(9,o,o.return)}var b=o.sibling;if(b!==null){b.return=o.return,De=b;break e}De=o.return}}var y=e.current;for(De=y;De!==null;){a=De;var g=a.child;if(a.subtreeFlags&2064&&g!==null)g.return=a,De=g;else e:for(a=y;De!==null;){if(s=De,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:wS(9,s)}}catch(S){mr(s,s.return,S)}if(s===a){De=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,De=v;break e}De=s.return}}if(Ht=i,bc(),Bs&&typeof Bs.onPostCommitFiberRoot=="function")try{Bs.onPostCommitFiberRoot(gS,e)}catch{}r=!0}return r}finally{yn=n,Sa.transition=t}}return!1}function W6(e,t,n){t=Fh(n,t),t=AD(e,t,1),e=Uu(e,t,1),t=io(),e!==null&&(q0(e,1,t),Ao(e,t))}function mr(e,t,n){if(e.tag===3)W6(e,e,n);else for(;t!==null;){if(t.tag===3){W6(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Vu===null||!Vu.has(r))){e=Fh(n,e),e=PD(t,e,1),t=Uu(t,e,1),e=io(),t!==null&&(q0(t,1,e),Ao(t,e));break}}t=t.return}}function sY(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=io(),e.pingedLanes|=e.suspendedLanes&n,fi===e&&(Pi&n)===n&&(Kr===4||Kr===3&&(Pi&130023424)===Pi&&500>Er()-M4?dd(e,0):O4|=n),Ao(e,t)}function QD(e,t){t===0&&(e.mode&1?(t=Qy,Qy<<=1,!(Qy&130023424)&&(Qy=4194304)):t=1);var n=io();e=Vl(e,t),e!==null&&(q0(e,t,n),Ao(e,n))}function lY(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),QD(e,n)}function uY(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),QD(e,n)}var XD;XD=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||To.current)xo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xo=!1,XX(e,t,n);xo=!!(e.flags&131072)}else xo=!1,nr&&t.flags&1048576&&J$(t,Cb,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;k1(e,t),e=t.pendingProps;var i=Nh(t,Wi.current);nh(t,n),i=T4(null,t,r,e,i,n);var o=k4();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ko(r)?(o=!0,xb(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,S4(t),i.updater=SS,t.stateNode=i,i._reactInternals=t,w3(t,r,e,n),t=T3(null,t,r,!0,o,n)):(t.tag=0,nr&&o&&p4(t),to(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(k1(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=dY(r),e=Ua(r,e),i){case 0:t=E3(null,t,r,e,n);break e;case 1:t=L6(null,t,r,e,n);break e;case 11:t=$6(null,t,r,e,n);break e;case 14:t=D6(null,t,r,Ua(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),E3(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),L6(e,t,r,i,n);case 3:e:{if(MD(t),e===null)throw Error(le(387));r=t.pendingProps,o=t.memoizedState,i=o.element,rD(e,t),kb(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Fh(Error(le(423)),t),t=F6(e,t,r,n,i);break e}else if(r!==i){i=Fh(Error(le(424)),t),t=F6(e,t,r,n,i);break e}else for(Ho=ju(t.stateNode.containerInfo.firstChild),Ko=t,nr=!0,Ha=null,n=sD(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($h(),r===i){t=Gl(e,t,n);break e}to(e,t,r,n)}t=t.child}return t;case 5:return lD(t),e===null&&_3(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,g3(r,i)?a=null:o!==null&&g3(r,o)&&(t.flags|=32),OD(e,t),to(e,t,a,n),t.child;case 6:return e===null&&_3(t),null;case 13:return ND(e,t,n);case 4:return x4(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Dh(t,null,r,n):to(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),$6(e,t,r,i,n);case 7:return to(e,t,t.pendingProps,n),t.child;case 8:return to(e,t,t.pendingProps.children,n),t.child;case 12:return to(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,$n(Eb,r._currentValue),r._currentValue=a,o!==null)if(as(o.value,a)){if(o.children===i.children&&!To.current){t=Gl(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Nl(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),S3(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(le(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),S3(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}to(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,nh(t,n),i=xa(i),r=r(i),t.flags|=1,to(e,t,r,n),t.child;case 14:return r=t.type,i=Ua(r,t.pendingProps),i=Ua(r.type,i),D6(e,t,r,i,n);case 15:return ID(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),k1(e,t),t.tag=1,ko(r)?(e=!0,xb(t)):e=!1,nh(t,n),oD(t,r,i),w3(t,r,i,n),T3(null,t,r,!0,e,n);case 19:return $D(e,t,n);case 22:return RD(e,t,n)}throw Error(le(156,t.tag))};function YD(e,t){return w$(e,t)}function cY(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ba(e,t,n,r){return new cY(e,t,n,r)}function L4(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dY(e){if(typeof e=="function")return L4(e)?1:0;if(e!=null){if(e=e.$$typeof,e===n4)return 11;if(e===r4)return 14}return 2}function qu(e,t){var n=e.alternate;return n===null?(n=ba(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function I1(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")L4(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Pf:return fd(n.children,i,o,t);case t4:a=8,i|=8;break;case W5:return e=ba(12,n,t,i|2),e.elementType=W5,e.lanes=o,e;case K5:return e=ba(13,n,t,i),e.elementType=K5,e.lanes=o,e;case Q5:return e=ba(19,n,t,i),e.elementType=Q5,e.lanes=o,e;case a$:return ES(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case i$:a=10;break e;case o$:a=9;break e;case n4:a=11;break e;case r4:a=14;break e;case vu:a=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=ba(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function fd(e,t,n,r){return e=ba(7,e,r,t),e.lanes=n,e}function ES(e,t,n,r){return e=ba(22,e,r,t),e.elementType=a$,e.lanes=n,e.stateNode={isHidden:!1},e}function Kw(e,t,n){return e=ba(6,e,null,t),e.lanes=n,e}function Qw(e,t,n){return t=ba(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fY(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pw(0),this.expirationTimes=Pw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pw(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function F4(e,t,n,r,i,o,a,s,l){return e=new fY(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ba(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},S4(o),e}function hY(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Af,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ZD(e){if(!e)return tc;e=e._reactInternals;e:{if(zd(e)!==e||e.tag!==1)throw Error(le(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ko(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(le(171))}if(e.tag===1){var n=e.type;if(ko(n))return Y$(e,n,t)}return t}function JD(e,t,n,r,i,o,a,s,l){return e=F4(n,r,!0,e,i,o,a,s,l),e.context=ZD(null),n=e.current,r=io(),i=Gu(n),o=Nl(r,i),o.callback=t??null,Uu(n,o,i),e.current.lanes=i,q0(e,i,r),Ao(e,r),e}function TS(e,t,n,r){var i=t.current,o=io(),a=Gu(i);return n=ZD(n),t.context===null?t.context=n:t.pendingContext=n,t=Nl(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Uu(i,t,a),e!==null&&(ts(e,i,a,o),C1(e,i,a)),a}function $b(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function K6(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function B4(e,t){K6(e,t),(e=e.alternate)&&K6(e,t)}function pY(){return null}var eL=typeof reportError=="function"?reportError:function(e){console.error(e)};function z4(e){this._internalRoot=e}kS.prototype.render=z4.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(le(409));TS(e,t,null,null)};kS.prototype.unmount=z4.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Td(function(){TS(null,e,null,null)}),t[Ul]=null}};function kS(e){this._internalRoot=e}kS.prototype.unstable_scheduleHydration=function(e){if(e){var t=I$();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cu.length&&t!==0&&t<Cu[n].priority;n++);Cu.splice(n,0,e),n===0&&O$(e)}};function j4(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function AS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Q6(){}function gY(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=$b(a);o.call(u)}}var a=JD(t,r,e,0,null,!1,!1,"",Q6);return e._reactRootContainer=a,e[Ul]=a.current,ym(e.nodeType===8?e.parentNode:e),Td(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=$b(l);s.call(u)}}var l=F4(e,0,!1,null,null,!1,!1,"",Q6);return e._reactRootContainer=l,e[Ul]=l.current,ym(e.nodeType===8?e.parentNode:e),Td(function(){TS(t,l,n,r)}),l}function PS(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=$b(a);s.call(l)}}TS(t,a,e,i)}else a=gY(n,t,e,i,r);return $b(a)}A$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=gg(t.pendingLanes);n!==0&&(a4(t,n|1),Ao(t,Er()),!(Ht&6)&&(Bh=Er()+500,bc()))}break;case 13:Td(function(){var r=Vl(e,1);if(r!==null){var i=io();ts(r,e,1,i)}}),B4(e,1)}};s4=function(e){if(e.tag===13){var t=Vl(e,134217728);if(t!==null){var n=io();ts(t,e,134217728,n)}B4(e,134217728)}};P$=function(e){if(e.tag===13){var t=Gu(e),n=Vl(e,t);if(n!==null){var r=io();ts(n,e,t,r)}B4(e,t)}};I$=function(){return yn};R$=function(e,t){var n=yn;try{return yn=e,t()}finally{yn=n}};o3=function(e,t,n){switch(t){case"input":if(Z5(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=bS(r);if(!i)throw Error(le(90));l$(r),Z5(r,i)}}}break;case"textarea":c$(e,n);break;case"select":t=n.value,t!=null&&Zf(e,!!n.multiple,t,!1)}};y$=N4;v$=Td;var mY={usingClientEntryPoint:!1,Events:[W0,Mf,bS,g$,m$,N4]},Up={findFiberByHostInstance:Zc,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},yY={bundleType:Up.bundleType,version:Up.version,rendererPackageName:Up.rendererPackageName,rendererConfig:Up.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Yl.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=S$(e),e===null?null:e.stateNode},findFiberByHostInstance:Up.findFiberByHostInstance||pY,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var av=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!av.isDisabled&&av.supportsFiber)try{gS=av.inject(yY),Bs=av}catch{}}ta.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mY;ta.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!j4(t))throw Error(le(200));return hY(e,t,null,n)};ta.createRoot=function(e,t){if(!j4(e))throw Error(le(299));var n=!1,r="",i=eL;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=F4(e,1,!1,null,null,n,!1,r,i),e[Ul]=t.current,ym(e.nodeType===8?e.parentNode:e),new z4(t)};ta.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(le(188)):(e=Object.keys(e).join(","),Error(le(268,e)));return e=S$(t),e=e===null?null:e.stateNode,e};ta.flushSync=function(e){return Td(e)};ta.hydrate=function(e,t,n){if(!AS(t))throw Error(le(200));return PS(null,e,t,!0,n)};ta.hydrateRoot=function(e,t,n){if(!j4(e))throw Error(le(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=eL;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=JD(t,null,e,1,n??null,i,!1,o,a),e[Ul]=t.current,ym(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new kS(t)};ta.render=function(e,t,n){if(!AS(t))throw Error(le(200));return PS(null,e,t,!1,n)};ta.unmountComponentAtNode=function(e){if(!AS(e))throw Error(le(40));return e._reactRootContainer?(Td(function(){PS(null,null,e,!1,function(){e._reactRootContainer=null,e[Ul]=null})}),!0):!1};ta.unstable_batchedUpdates=N4;ta.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!AS(n))throw Error(le(200));if(e==null||e._reactInternals===void 0)throw Error(le(38));return PS(e,t,n,!1,r)};ta.version="18.2.0-next-9e3b772b8-20220608";function tL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tL)}catch(e){console.error(e)}}tL(),JN.exports=ta;var Vo=JN.exports;const iUe=mc(Vo);var X6=Vo;q5.createRoot=X6.createRoot,q5.hydrateRoot=X6.hydrateRoot;const vY="modulepreload",bY=function(e,t){return new URL(e,t).href},Y6={},nL=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=bY(o,r),o in Y6)return;Y6[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const d=i[c];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":vY,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})};function di(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ao(e){return!!e&&!!e[St]}function Po(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===kY}(e)||Array.isArray(e)||!!e[ih]||!!(!((t=e.constructor)===null||t===void 0)&&t[ih])||IS(e)||RS(e))}function U4(e){return ao(e)||di(23,e),e[St].t}function ql(e,t,n){n===void 0&&(n=!1),nc(e)===0?(n?Object.keys:oh)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,i){return t(i,r,e)})}function nc(e){var t=e[St];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:IS(e)?2:RS(e)?3:0}function Hu(e,t){return nc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function R1(e,t){return nc(e)===2?e.get(t):e[t]}function rL(e,t,n){var r=nc(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function iL(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function IS(e){return EY&&e instanceof Map}function RS(e){return TY&&e instanceof Set}function ii(e){return e.o||e.t}function V4(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=aL(e);delete t[St];for(var n=oh(t),r=0;r<n.length;r++){var i=n[r],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function Q0(e,t){return t===void 0&&(t=!1),G4(e)||ao(e)||!Po(e)||(nc(e)>1&&(e.set=e.add=e.clear=e.delete=_Y),Object.freeze(e),t&&ql(e,function(n,r){return Q0(r,!0)},!0)),e}function _Y(){di(2)}function G4(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function js(e){var t=B3[e];return t||di(18,e),t}function q4(e,t){B3[e]||(B3[e]=t)}function Tm(){return Am}function Xw(e,t){t&&(js("Patches"),e.u=[],e.s=[],e.v=t)}function Db(e){F3(e),e.p.forEach(SY),e.p=null}function F3(e){e===Am&&(Am=e.l)}function Z6(e){return Am={p:[],l:Am,h:e,m:!0,_:0}}function SY(e){var t=e[St];t.i===0||t.i===1?t.j():t.g=!0}function Yw(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||js("ES5").S(t,e,r),r?(n[St].P&&(Db(t),di(4)),Po(e)&&(e=Lb(t,e),t.l||Fb(t,e)),t.u&&js("Patches").M(n[St].t,e,t.u,t.s)):e=Lb(t,n,[]),Db(t),t.u&&t.v(t.u,t.s),e!==MS?e:void 0}function Lb(e,t,n){if(G4(t))return t;var r=t[St];if(!r)return ql(t,function(s,l){return J6(e,r,t,s,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Fb(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=V4(r.k):r.o,o=i,a=!1;r.i===3&&(o=new Set(i),i.clear(),a=!0),ql(o,function(s,l){return J6(e,r,i,s,l,n,a)}),Fb(e,i,!1),n&&e.u&&js("Patches").N(r,n,e.u,e.s)}return r.o}function J6(e,t,n,r,i,o,a){if(ao(i)){var s=Lb(e,i,o&&t&&t.i!==3&&!Hu(t.R,r)?o.concat(r):void 0);if(rL(n,r,s),!ao(s))return;e.m=!1}else a&&n.add(i);if(Po(i)&&!G4(i)){if(!e.h.D&&e._<1)return;Lb(e,i),t&&t.A.l||Fb(e,i)}}function Fb(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Q0(t,n)}function Zw(e,t){var n=e[St];return(n?ii(n):e)[t]}function e8(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function _o(e){e.P||(e.P=!0,e.l&&_o(e.l))}function Jw(e){e.o||(e.o=V4(e.t))}function km(e,t,n){var r=IS(t)?js("MapSet").F(t,n):RS(t)?js("MapSet").T(t,n):e.O?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:Tm(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Pm;a&&(l=[s],u=yg);var c=Proxy.revocable(l,u),d=c.revoke,f=c.proxy;return s.k=f,s.j=d,f}(t,n):js("ES5").J(t,n);return(n?n.A:Tm()).p.push(r),r}function OS(e){return ao(e)||di(22,e),function t(n){if(!Po(n))return n;var r,i=n[St],o=nc(n);if(i){if(!i.P&&(i.i<4||!js("ES5").K(i)))return i.t;i.I=!0,r=t8(n,o),i.I=!1}else r=t8(n,o);return ql(r,function(a,s){i&&R1(i.t,a)===s||rL(r,a,t(s))}),o===3?new Set(r):r}(e)}function t8(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return V4(e)}function H4(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[St];return Pm.get(l,o)},set:function(l){var u=this[St];Pm.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][St];if(!s.P)switch(s.i){case 5:r(s)&&_o(s);break;case 4:n(s)&&_o(s)}}}function n(o){for(var a=o.t,s=o.k,l=oh(s),u=l.length-1;u>=0;u--){var c=l[u];if(c!==St){var d=a[c];if(d===void 0&&!Hu(a,c))return!0;var f=s[c],h=f&&f[St];if(h?h.t!==d:!iL(f,d))return!0}}var p=!!a[St];return l.length!==oh(a).length+(p?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l<a.length;l++)if(!a.hasOwnProperty(l))return!0;return!1}var i={};q4("ES5",{J:function(o,a){var s=Array.isArray(o),l=function(c,d){if(c){for(var f=Array(d.length),h=0;h<d.length;h++)Object.defineProperty(f,""+h,e(h,!0));return f}var p=aL(d);delete p[St];for(var m=oh(p),_=0;_<m.length;_++){var b=m[_];p[b]=e(b,c||!!p[b].enumerable)}return Object.create(Object.getPrototypeOf(d),p)}(s,o),u={i:s?5:4,A:a?a.A:Tm(),P:!1,I:!1,R:{},l:a,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,St,{value:u,writable:!0}),l},S:function(o,a,s){s?ao(a)&&a[St].A===o&&t(o.p):(o.u&&function l(u){if(u&&typeof u=="object"){var c=u[St];if(c){var d=c.t,f=c.k,h=c.R,p=c.i;if(p===4)ql(f,function(g){g!==St&&(d[g]!==void 0||Hu(d,g)?h[g]||l(f[g]):(h[g]=!0,_o(c)))}),ql(d,function(g){f[g]!==void 0||Hu(f,g)||(h[g]=!1,_o(c))});else if(p===5){if(r(c)&&(_o(c),h.length=!0),f.length<d.length)for(var m=f.length;m<d.length;m++)h[m]=!1;else for(var _=d.length;_<f.length;_++)h[_]=!0;for(var b=Math.min(f.length,d.length),y=0;y<b;y++)f.hasOwnProperty(y)||(h[y]=!0),h[y]===void 0&&l(f[y])}}}}(o.p[0]),t(o.p))},K:function(o){return o.i===4?n(o):r(o)}})}function W4(){function e(r){if(!Po(r))return r;if(Array.isArray(r))return r.map(e);if(IS(r))return new Map(Array.from(r.entries()).map(function(a){return[a[0],e(a[1])]}));if(RS(r))return new Set(Array.from(r).map(e));var i=Object.create(Object.getPrototypeOf(r));for(var o in r)i[o]=e(r[o]);return Hu(r,ih)&&(i[ih]=r[ih]),i}function t(r){return ao(r)?e(r):r}var n="add";q4("Patches",{$:function(r,i){return i.forEach(function(o){for(var a=o.path,s=o.op,l=r,u=0;u<a.length-1;u++){var c=nc(l),d=a[u];typeof d!="string"&&typeof d!="number"&&(d=""+d),c!==0&&c!==1||d!=="__proto__"&&d!=="constructor"||di(24),typeof l=="function"&&d==="prototype"&&di(24),typeof(l=R1(l,d))!="object"&&di(15,a.join("/"))}var f=nc(l),h=e(o.value),p=a[a.length-1];switch(s){case"replace":switch(f){case 2:return l.set(p,h);case 3:di(16);default:return l[p]=h}case n:switch(f){case 1:return p==="-"?l.push(h):l.splice(p,0,h);case 2:return l.set(p,h);case 3:return l.add(h);default:return l[p]=h}case"remove":switch(f){case 1:return l.splice(p,1);case 2:return l.delete(p);case 3:return l.delete(o.value);default:return delete l[p]}default:di(17,s)}}),r},N:function(r,i,o,a){switch(r.i){case 0:case 4:case 2:return function(s,l,u,c){var d=s.t,f=s.o;ql(s.R,function(h,p){var m=R1(d,h),_=R1(f,h),b=p?Hu(d,h)?"replace":n:"remove";if(m!==_||b!=="replace"){var y=l.concat(h);u.push(b==="remove"?{op:b,path:y}:{op:b,path:y,value:_}),c.push(b===n?{op:"remove",path:y}:b==="remove"?{op:n,path:y,value:t(m)}:{op:"replace",path:y,value:t(m)})}})}(r,i,o,a);case 5:case 1:return function(s,l,u,c){var d=s.t,f=s.R,h=s.o;if(h.length<d.length){var p=[h,d];d=p[0],h=p[1];var m=[c,u];u=m[0],c=m[1]}for(var _=0;_<d.length;_++)if(f[_]&&h[_]!==d[_]){var b=l.concat([_]);u.push({op:"replace",path:b,value:t(h[_])}),c.push({op:"replace",path:b,value:t(d[_])})}for(var y=d.length;y<h.length;y++){var g=l.concat([y]);u.push({op:n,path:g,value:t(h[y])})}d.length<h.length&&c.push({op:"replace",path:l.concat(["length"]),value:d.length})}(r,i,o,a);case 3:return function(s,l,u,c){var d=s.t,f=s.o,h=0;d.forEach(function(p){if(!f.has(p)){var m=l.concat([h]);u.push({op:"remove",path:m,value:p}),c.unshift({op:n,path:m,value:p})}h++}),h=0,f.forEach(function(p){if(!d.has(p)){var m=l.concat([h]);u.push({op:n,path:m,value:p}),c.unshift({op:"remove",path:m,value:p})}h++})}(r,i,o,a)}},M:function(r,i,o,a){o.push({op:"replace",path:[],value:i===MS?void 0:i}),a.push({op:"replace",path:[],value:r})}})}function oL(){function e(s,l){function u(){this.constructor=s}i(s,l),s.prototype=(u.prototype=l.prototype,new u)}function t(s){s.o||(s.R=new Map,s.o=new Map(s.t))}function n(s){s.o||(s.o=new Set,s.t.forEach(function(l){if(Po(l)){var u=km(s.A.h,l,s);s.p.set(l,u),s.o.add(u)}else s.o.add(l)}))}function r(s){s.g&&di(3,JSON.stringify(ii(s)))}var i=function(s,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var d in c)c.hasOwnProperty(d)&&(u[d]=c[d])})(s,l)},o=function(){function s(u,c){return this[St]={i:2,l:c,A:c?c.A:Tm(),P:!1,I:!1,o:void 0,R:void 0,t:u,k:this,C:!1,g:!1},this}e(s,Map);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return ii(this[St]).size}}),l.has=function(u){return ii(this[St]).has(u)},l.set=function(u,c){var d=this[St];return r(d),ii(d).has(u)&&ii(d).get(u)===c||(t(d),_o(d),d.R.set(u,!0),d.o.set(u,c),d.R.set(u,!0)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[St];return r(c),t(c),_o(c),c.t.has(u)?c.R.set(u,!1):c.R.delete(u),c.o.delete(u),!0},l.clear=function(){var u=this[St];r(u),ii(u).size&&(t(u),_o(u),u.R=new Map,ql(u.t,function(c){u.R.set(c,!1)}),u.o.clear())},l.forEach=function(u,c){var d=this;ii(this[St]).forEach(function(f,h){u.call(c,d.get(h),h,d)})},l.get=function(u){var c=this[St];r(c);var d=ii(c).get(u);if(c.I||!Po(d)||d!==c.t.get(u))return d;var f=km(c.A.h,d,c);return t(c),c.o.set(u,f),f},l.keys=function(){return ii(this[St]).keys()},l.values=function(){var u,c=this,d=this.keys();return(u={})[sv]=function(){return c.values()},u.next=function(){var f=d.next();return f.done?f:{done:!1,value:c.get(f.value)}},u},l.entries=function(){var u,c=this,d=this.keys();return(u={})[sv]=function(){return c.entries()},u.next=function(){var f=d.next();if(f.done)return f;var h=c.get(f.value);return{done:!1,value:[f.value,h]}},u},l[sv]=function(){return this.entries()},s}(),a=function(){function s(u,c){return this[St]={i:3,l:c,A:c?c.A:Tm(),P:!1,I:!1,o:void 0,t:u,k:this,p:new Map,g:!1,C:!1},this}e(s,Set);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return ii(this[St]).size}}),l.has=function(u){var c=this[St];return r(c),c.o?!!c.o.has(u)||!(!c.p.has(u)||!c.o.has(c.p.get(u))):c.t.has(u)},l.add=function(u){var c=this[St];return r(c),this.has(u)||(n(c),_o(c),c.o.add(u)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[St];return r(c),n(c),_o(c),c.o.delete(u)||!!c.p.has(u)&&c.o.delete(c.p.get(u))},l.clear=function(){var u=this[St];r(u),ii(u).size&&(n(u),_o(u),u.o.clear())},l.values=function(){var u=this[St];return r(u),n(u),u.o.values()},l.entries=function(){var u=this[St];return r(u),n(u),u.o.entries()},l.keys=function(){return this.values()},l[sv]=function(){return this.values()},l.forEach=function(u,c){for(var d=this.values(),f=d.next();!f.done;)u.call(c,f.value,f.value,this),f=d.next()},s}();q4("MapSet",{F:function(s,l){return new o(s,l)},T:function(s,l){return new a(s,l)}})}function xY(){H4(),oL(),W4()}function wY(e){return e}function CY(e){return e}var n8,Am,K4=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",EY=typeof Map<"u",TY=typeof Set<"u",r8=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",MS=K4?Symbol.for("immer-nothing"):((n8={})["immer-nothing"]=!0,n8),ih=K4?Symbol.for("immer-draftable"):"__$immer_draftable",St=K4?Symbol.for("immer-state"):"__$immer_state",sv=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",kY=""+Object.prototype.constructor,oh=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,aL=Object.getOwnPropertyDescriptors||function(e){var t={};return oh(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},B3={},Pm={get:function(e,t){if(t===St)return e;var n=ii(e);if(!Hu(n,t))return function(i,o,a){var s,l=e8(o,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!Po(r)?r:r===Zw(e.t,t)?(Jw(e),e.o[t]=km(e.A.h,r,e)):r},has:function(e,t){return t in ii(e)},ownKeys:function(e){return Reflect.ownKeys(ii(e))},set:function(e,t,n){var r=e8(ii(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=Zw(ii(e),t),o=i==null?void 0:i[St];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(iL(n,i)&&(n!==void 0||Hu(e.t,t)))return!0;Jw(e),_o(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return Zw(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Jw(e),_o(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=ii(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){di(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){di(12)}},yg={};ql(Pm,function(e,t){yg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),yg.deleteProperty=function(e,t){return yg.set.call(this,e,t,void 0)},yg.set=function(e,t,n){return Pm.set.call(this,e[0],t,n,e[0])};var sL=function(){function e(n){var r=this;this.O=r8,this.D=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var l=r;return function(m){var _=this;m===void 0&&(m=s);for(var b=arguments.length,y=Array(b>1?b-1:0),g=1;g<b;g++)y[g-1]=arguments[g];return l.produce(m,function(v){var S;return(S=o).call.apply(S,[_,v].concat(y))})}}var u;if(typeof o!="function"&&di(6),a!==void 0&&typeof a!="function"&&di(7),Po(i)){var c=Z6(r),d=km(r,i,void 0),f=!0;try{u=o(d),f=!1}finally{f?Db(c):F3(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(m){return Xw(c,a),Yw(m,c)},function(m){throw Db(c),m}):(Xw(c,a),Yw(u,c))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===MS&&(u=void 0),r.D&&Q0(u,!0),a){var h=[],p=[];js("Patches").M(i,u,h,p),a(h,p)}return u}di(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return r.produceWithPatches(u,function(h){return i.apply(void 0,[h].concat(d))})};var a,s,l=r.produce(i,o,function(u,c){a=u,s=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,a,s]}):[l,a,s]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){Po(n)||di(8),ao(n)&&(n=OS(n));var r=Z6(this),i=km(this,n,void 0);return i[St].C=!0,F3(r),i},t.finishDraft=function(n,r){var i=n&&n[St],o=i.A;return Xw(o,r),Yw(void 0,o)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!r8&&di(20),this.O=n},t.applyPatches=function(n,r){var i;for(i=r.length-1;i>=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=js("Patches").$;return ao(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Zo=new sL,lL=Zo.produce,Q4=Zo.produceWithPatches.bind(Zo),AY=Zo.setAutoFreeze.bind(Zo),PY=Zo.setUseProxies.bind(Zo),z3=Zo.applyPatches.bind(Zo),IY=Zo.createDraft.bind(Zo),RY=Zo.finishDraft.bind(Zo);const _c=lL,OY=Object.freeze(Object.defineProperty({__proto__:null,Immer:sL,applyPatches:z3,castDraft:wY,castImmutable:CY,createDraft:IY,current:OS,default:_c,enableAllPlugins:xY,enableES5:H4,enableMapSet:oL,enablePatches:W4,finishDraft:RY,freeze:Q0,immerable:ih,isDraft:ao,isDraftable:Po,nothing:MS,original:U4,produce:lL,produceWithPatches:Q4,setAutoFreeze:AY,setUseProxies:PY},Symbol.toStringTag,{value:"Module"}));function Im(e){"@babel/helpers - typeof";return Im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Im(e)}function MY(e,t){if(Im(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Im(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NY(e){var t=MY(e,"string");return Im(t)==="symbol"?t:String(t)}function $Y(e,t,n){return t=NY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function o8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i8(Object(n),!0).forEach(function(r){$Y(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ci(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var a8=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),eC=function(){return Math.random().toString(36).substring(7).split("").join(".")},zh={INIT:"@@redux/INIT"+eC(),REPLACE:"@@redux/REPLACE"+eC(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+eC()}};function DY(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function X0(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ci(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ci(1));return n(X0)(e,t)}if(typeof e!="function")throw new Error(Ci(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(Ci(3));return o}function d(m){if(typeof m!="function")throw new Error(Ci(4));if(l)throw new Error(Ci(5));var _=!0;return u(),s.push(m),function(){if(_){if(l)throw new Error(Ci(6));_=!1,u();var y=s.indexOf(m);s.splice(y,1),a=null}}}function f(m){if(!DY(m))throw new Error(Ci(7));if(typeof m.type>"u")throw new Error(Ci(8));if(l)throw new Error(Ci(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var _=a=s,b=0;b<_.length;b++){var y=_[b];y()}return m}function h(m){if(typeof m!="function")throw new Error(Ci(10));i=m,f({type:zh.REPLACE})}function p(){var m,_=d;return m={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(Ci(11));function g(){y.next&&y.next(c())}g();var v=_(g);return{unsubscribe:v}}},m[a8]=function(){return this},m}return f({type:zh.INIT}),r={dispatch:f,subscribe:d,getState:c,replaceReducer:h},r[a8]=p,r}var uL=X0;function LY(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:zh.INIT});if(typeof r>"u")throw new Error(Ci(12));if(typeof n(void 0,{type:zh.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ci(13))})}function pp(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];typeof e[i]=="function"&&(n[i]=e[i])}var o=Object.keys(n),a;try{LY(n)}catch(s){a=s}return function(l,u){if(l===void 0&&(l={}),a)throw a;for(var c=!1,d={},f=0;f<o.length;f++){var h=o[f],p=n[h],m=l[h],_=p(m,u);if(typeof _>"u")throw u&&u.type,new Error(Ci(14));d[h]=_,c=c||_!==m}return c=c||o.length!==Object.keys(l).length,c?d:l}}function s8(e,t){return function(){return t(e.apply(this,arguments))}}function cL(e,t){if(typeof e=="function")return s8(e,t);if(typeof e!="object"||e===null)throw new Error(Ci(16));var n={};for(var r in e){var i=e[r];typeof i=="function"&&(n[r]=s8(i,t))}return n}function jh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}function X4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var i=r.apply(void 0,arguments),o=function(){throw new Error(Ci(15))},a={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},s=t.map(function(l){return l(a)});return o=jh.apply(void 0,s)(i.dispatch),o8(o8({},i),{},{dispatch:o})}}}const FY=Object.freeze(Object.defineProperty({__proto__:null,__DO_NOT_USE__ActionTypes:zh,applyMiddleware:X4,bindActionCreators:cL,combineReducers:pp,compose:jh,createStore:X0,legacy_createStore:uL},Symbol.toStringTag,{value:"Module"}));var Bb="NOT_FOUND";function BY(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Bb},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function zY(e,t){var n=[];function r(s){var l=n.findIndex(function(c){return t(s,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return Bb}function i(s,l){r(s)===Bb&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var dL=function(t,n){return t===n};function jY(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function zb(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?dL:r,o=n.maxSize,a=o===void 0?1:o,s=n.resultEqualityCheck,l=jY(i),u=a===1?BY(l):zY(a,l);function c(){var d=u.get(arguments);if(d===Bb){if(d=e.apply(null,arguments),s){var f=u.getEntries(),h=f.find(function(p){return s(p.value,d)});h&&(d=h.value)}u.put(arguments,d)}return d}return c.clearCache=function(){return u.clear()},c}function UY(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function fL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u=0,c,d={memoizeOptions:void 0},f=s.pop();if(typeof f=="object"&&(d=f,f=s.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var h=d,p=h.memoizeOptions,m=p===void 0?n:p,_=Array.isArray(m)?m:[m],b=UY(s),y=e.apply(void 0,[function(){return u++,f.apply(null,arguments)}].concat(_)),g=e(function(){for(var S=[],w=b.length,x=0;x<w;x++)S.push(b[x].apply(null,arguments));return c=y.apply(null,S),c});return Object.assign(g,{resultFunc:f,memoizedResultFunc:y,dependencies:b,lastResult:function(){return c},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),g};return i}var Ii=fL(zb),VY=function(t,n){if(n===void 0&&(n=Ii),typeof t!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof t));var r=Object.keys(t),i=n(r.map(function(o){return t[o]}),function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return a.reduce(function(l,u,c){return l[r[c]]=u,l},{})});return i};const GY=Object.freeze(Object.defineProperty({__proto__:null,createSelector:Ii,createSelectorCreator:fL,createStructuredSelector:VY,defaultEqualityCheck:dL,defaultMemoize:zb},Symbol.toStringTag,{value:"Module"}));function hL(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(a){return function(s){return typeof s=="function"?s(i,o,e):a(s)}}};return t}var pL=hL();pL.withExtraArgument=hL;const l8=pL;var gL=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y0=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},rc=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},qY=Object.defineProperty,HY=Object.defineProperties,WY=Object.getOwnPropertyDescriptors,u8=Object.getOwnPropertySymbols,KY=Object.prototype.hasOwnProperty,QY=Object.prototype.propertyIsEnumerable,c8=function(e,t,n){return t in e?qY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},wo=function(e,t){for(var n in t||(t={}))KY.call(t,n)&&c8(e,n,t[n]);if(u8)for(var r=0,i=u8(t);r<i.length;r++){var n=i[r];QY.call(t,n)&&c8(e,n,t[n])}return e},tC=function(e,t){return HY(e,WY(t))},Z0=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},pl=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ii.apply(void 0,e),r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return n.apply(void 0,rc([ao(i)?OS(i):i],o))};return r},XY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jh:jh.apply(null,arguments)};function ss(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var mL=function(e){gL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,rc([void 0],n[0].concat(this)))):new(t.bind.apply(t,rc([void 0],n.concat(this))))},t}(Array),yL=function(e){gL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,rc([void 0],n[0].concat(this)))):new(t.bind.apply(t,rc([void 0],n.concat(this))))},t}(Array);function j3(e){return Po(e)?_c(e,function(){}):e}function YY(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function ZY(e){return function(){return function(t){return function(n){return t(n)}}}}function vL(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||ss(e)}function bL(e,t,n,r,i,o){t===void 0&&(t=""),n===void 0&&(n=vL),i===void 0&&(i=[]);var a;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o!=null&&o.has(e))return!1;for(var s=r!=null?r(e):Object.entries(e),l=i.length>0,u=function(_,b){var y=t?t+"."+_:_;if(l){var g=i.some(function(v){return v instanceof RegExp?v.test(y):y===v});if(g)return"continue"}if(!n(b))return{value:{keyPath:y,value:b}};if(typeof b=="object"&&(a=bL(b,y,n,r,i,o),a))return{value:a}},c=0,d=s;c<d.length;c++){var f=d[c],h=f[0],p=f[1],m=u(h,p);if(typeof m=="object")return m.value}return o&&_L(e)&&o.add(e),!1}function _L(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if(!(typeof r!="object"||r===null)&&!_L(r))return!1}return!0}function JY(e){return function(){return function(t){return function(n){return t(n)}}}}function eZ(e){return typeof e=="boolean"}function tZ(){return function(t){return SL(t)}}function SL(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t;e.immutableCheck,e.serializableCheck;var r=new mL;return n&&(eZ(n)?r.push(l8):r.push(l8.withExtraArgument(n.extraArgument))),r}var nZ=!0;function xL(e){var t=tZ(),n=e||{},r=n.reducer,i=r===void 0?void 0:r,o=n.middleware,a=o===void 0?t():o,s=n.devTools,l=s===void 0?!0:s,u=n.preloadedState,c=u===void 0?void 0:u,d=n.enhancers,f=d===void 0?void 0:d,h;if(typeof i=="function")h=i;else if(ss(i))h=pp(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var p=a;typeof p=="function"&&(p=p(t));var m=X4.apply(void 0,p),_=jh;l&&(_=XY(wo({trace:!nZ},typeof l=="object"&&l)));var b=new yL(m),y=b;Array.isArray(f)?y=rc([m],f):typeof f=="function"&&(y=f(b));var g=_.apply(void 0,y);return X0(h,c,g)}function Ne(e,t){function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(t){var o=t.apply(void 0,r);if(!o)throw new Error("prepareAction did not return an object");return wo(wo({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function Y4(e){return ss(e)&&"type"in e}function wL(e){return Y4(e)&&typeof e.type=="string"&&Object.keys(e).every(rZ)}function rZ(e){return["type","payload","error","meta"].indexOf(e)>-1}function iZ(e){return""+e}function CL(e){var t={},n=[],r,i={addCase:function(o,a){var s=typeof o=="string"?o:o.type;if(s in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[s]=a,i},addMatcher:function(o,a){return n.push({matcher:o,reducer:a}),i},addDefaultCase:function(o){return r=o,i}};return e(i),[t,n,r]}function oZ(e){return typeof e=="function"}function EL(e,t,n,r){n===void 0&&(n=[]);var i=typeof t=="function"?CL(t):[t,n,r],o=i[0],a=i[1],s=i[2],l;if(oZ(e))l=function(){return j3(e())};else{var u=j3(e);l=function(){return u}}function c(d,f){d===void 0&&(d=l());var h=rc([o[f.type]],a.filter(function(p){var m=p.matcher;return m(f)}).map(function(p){var m=p.reducer;return m}));return h.filter(function(p){return!!p}).length===0&&(h=[s]),h.reduce(function(p,m){if(m)if(ao(p)){var _=p,b=m(_,f);return b===void 0?p:b}else{if(Po(p))return _c(p,function(y){return m(y,f)});var b=m(p,f);if(b===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}return p},d)}return c.getInitialState=l,c}function aZ(e,t){return e+"/"+t}function rr(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:j3(e.initialState),r=e.reducers||{},i=Object.keys(r),o={},a={},s={};i.forEach(function(c){var d=r[c],f=aZ(t,c),h,p;"reducer"in d?(h=d.reducer,p=d.prepare):h=d,o[c]=h,a[f]=h,s[c]=p?Ne(f,p):Ne(f)});function l(){var c=typeof e.extraReducers=="function"?CL(e.extraReducers):[e.extraReducers],d=c[0],f=d===void 0?{}:d,h=c[1],p=h===void 0?[]:h,m=c[2],_=m===void 0?void 0:m,b=wo(wo({},f),a);return EL(n,function(y){for(var g in b)y.addCase(g,b[g]);for(var v=0,S=p;v<S.length;v++){var w=S[v];y.addMatcher(w.matcher,w.reducer)}_&&y.addDefaultCase(_)})}var u;return{name:t,reducer:function(c,d){return u||(u=l()),u(c,d)},actions:s,caseReducers:o,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}function sZ(){return{ids:[],entities:{}}}function lZ(){function e(t){return t===void 0&&(t={}),Object.assign(sZ(),t)}return{getInitialState:e}}function uZ(){function e(t){var n=function(u){return u.ids},r=function(u){return u.entities},i=pl(n,r,function(u,c){return u.map(function(d){return c[d]})}),o=function(u,c){return c},a=function(u,c){return u[c]},s=pl(n,function(u){return u.length});if(!t)return{selectIds:n,selectEntities:r,selectAll:i,selectTotal:s,selectById:pl(r,o,a)};var l=pl(t,r);return{selectIds:pl(t,n),selectEntities:l,selectAll:pl(t,i),selectTotal:pl(t,s),selectById:pl(l,o,a)}}return{getSelectors:e}}function cZ(e){var t=wr(function(n,r){return e(r)});return function(r){return t(r,void 0)}}function wr(e){return function(n,r){function i(a){return wL(a)}var o=function(a){i(r)?e(r.payload,a):e(r,a)};return ao(n)?(o(n),n):_c(n,o)}}function Ug(e,t){var n=t(e);return n}function hd(e){return Array.isArray(e)||(e=Object.values(e)),e}function TL(e,t,n){e=hd(e);for(var r=[],i=[],o=0,a=e;o<a.length;o++){var s=a[o],l=Ug(s,t);l in n.entities?i.push({id:l,changes:s}):r.push(s)}return[r,i]}function kL(e){function t(p,m){var _=Ug(p,e);_ in m.entities||(m.ids.push(_),m.entities[_]=p)}function n(p,m){p=hd(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];t(y,m)}}function r(p,m){var _=Ug(p,e);_ in m.entities||m.ids.push(_),m.entities[_]=p}function i(p,m){p=hd(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];r(y,m)}}function o(p,m){p=hd(p),m.ids=[],m.entities={},n(p,m)}function a(p,m){return s([p],m)}function s(p,m){var _=!1;p.forEach(function(b){b in m.entities&&(delete m.entities[b],_=!0)}),_&&(m.ids=m.ids.filter(function(b){return b in m.entities}))}function l(p){Object.assign(p,{ids:[],entities:{}})}function u(p,m,_){var b=_.entities[m.id],y=Object.assign({},b,m.changes),g=Ug(y,e),v=g!==m.id;return v&&(p[m.id]=g,delete _.entities[m.id]),_.entities[g]=y,v}function c(p,m){return d([p],m)}function d(p,m){var _={},b={};p.forEach(function(v){v.id in m.entities&&(b[v.id]={id:v.id,changes:wo(wo({},b[v.id]?b[v.id].changes:null),v.changes)})}),p=Object.values(b);var y=p.length>0;if(y){var g=p.filter(function(v){return u(_,v,m)}).length>0;g&&(m.ids=Object.keys(m.entities))}}function f(p,m){return h([p],m)}function h(p,m){var _=TL(p,e,m),b=_[0],y=_[1];d(y,m),n(b,m)}return{removeAll:cZ(l),addOne:wr(t),addMany:wr(n),setOne:wr(r),setMany:wr(i),setAll:wr(o),updateOne:wr(c),updateMany:wr(d),upsertOne:wr(f),upsertMany:wr(h),removeOne:wr(a),removeMany:wr(s)}}function dZ(e,t){var n=kL(e),r=n.removeOne,i=n.removeMany,o=n.removeAll;function a(y,g){return s([y],g)}function s(y,g){y=hd(y);var v=y.filter(function(S){return!(Ug(S,e)in g.entities)});v.length!==0&&_(v,g)}function l(y,g){return u([y],g)}function u(y,g){y=hd(y),y.length!==0&&_(y,g)}function c(y,g){y=hd(y),g.entities={},g.ids=[],s(y,g)}function d(y,g){return f([y],g)}function f(y,g){for(var v=!1,S=0,w=y;S<w.length;S++){var x=w[S],C=g.entities[x.id];if(C){v=!0,Object.assign(C,x.changes);var k=e(C);x.id!==k&&(delete g.entities[x.id],g.entities[k]=C)}}v&&b(g)}function h(y,g){return p([y],g)}function p(y,g){var v=TL(y,e,g),S=v[0],w=v[1];f(w,g),s(S,g)}function m(y,g){if(y.length!==g.length)return!1;for(var v=0;v<y.length&&v<g.length;v++)if(y[v]!==g[v])return!1;return!0}function _(y,g){y.forEach(function(v){g.entities[e(v)]=v}),b(g)}function b(y){var g=Object.values(y.entities);g.sort(t);var v=g.map(e),S=y.ids;m(S,v)||(y.ids=v)}return{removeOne:r,removeMany:i,removeAll:o,addOne:wr(a),updateOne:wr(d),upsertOne:wr(h),setOne:wr(l),setMany:wr(u),setAll:wr(c),addMany:wr(s),updateMany:wr(f),upsertMany:wr(p)}}function ds(e){e===void 0&&(e={});var t=wo({sortComparer:!1,selectId:function(s){return s.id}},e),n=t.selectId,r=t.sortComparer,i=lZ(),o=uZ(),a=r?dZ(n,r):kL(n);return wo(wo(wo({selectId:n,sortComparer:r},i),o),a)}var fZ="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",NS=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=fZ[Math.random()*64|0];return t},hZ=["name","message","stack","code"],nC=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),d8=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),AL=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=hZ;n<r.length;n++){var i=r[n];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},jb=function(){function e(t,n,r){var i=Ne(t+"/fulfilled",function(u,c,d,f){return{payload:u,meta:tC(wo({},f||{}),{arg:d,requestId:c,requestStatus:"fulfilled"})}}),o=Ne(t+"/pending",function(u,c,d){return{payload:void 0,meta:tC(wo({},d||{}),{arg:c,requestId:u,requestStatus:"pending"})}}),a=Ne(t+"/rejected",function(u,c,d,f,h){return{payload:f,error:(r&&r.serializeError||AL)(u||"Rejected"),meta:tC(wo({},h||{}),{arg:d,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),s=typeof AbortController<"u"?AbortController:function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u}();function l(u){return function(c,d,f){var h=r!=null&&r.idGenerator?r.idGenerator(u):NS(),p=new s,m;function _(y){m=y,p.abort()}var b=function(){return Z0(this,null,function(){var y,g,v,S,w,x,C;return Y0(this,function(k){switch(k.label){case 0:return k.trys.push([0,4,,5]),S=(y=r==null?void 0:r.condition)==null?void 0:y.call(r,u,{getState:d,extra:f}),pZ(S)?[4,S]:[3,2];case 1:S=k.sent(),k.label=2;case 2:if(S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=new Promise(function(T,P){return p.signal.addEventListener("abort",function(){return P({name:"AbortError",message:m||"Aborted"})})}),c(o(h,u,(g=r==null?void 0:r.getPendingMeta)==null?void 0:g.call(r,{requestId:h,arg:u},{getState:d,extra:f}))),[4,Promise.race([w,Promise.resolve(n(u,{dispatch:c,getState:d,extra:f,requestId:h,signal:p.signal,abort:_,rejectWithValue:function(T,P){return new nC(T,P)},fulfillWithValue:function(T,P){return new d8(T,P)}})).then(function(T){if(T instanceof nC)throw T;return T instanceof d8?i(T.payload,h,u,T.meta):i(T,h,u)})])];case 3:return v=k.sent(),[3,5];case 4:return x=k.sent(),v=x instanceof nC?a(null,h,u,x.payload,x.meta):a(x,h,u),[3,5];case 5:return C=r&&!r.dispatchConditionRejection&&a.match(v)&&v.meta.condition,C||c(v),[2,v]}})})}();return Object.assign(b,{abort:_,requestId:h,arg:u,unwrap:function(){return b.then(PL)}})}}return Object.assign(l,{pending:o,rejected:a,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e}();function PL(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function pZ(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var gZ=function(e){return e&&typeof e.match=="function"},IL=function(e,t){return gZ(e)?e.match(t):e(t)};function $o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.some(function(r){return IL(r,n)})}}function ah(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.every(function(r){return IL(r,n)})}}function $S(e,t){if(!e||!e.meta)return!1;var n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function J0(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function DS(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["pending"])}:J0(e)?function(n){var r=e.map(function(o){return o.pending}),i=$o.apply(void 0,r);return i(n)}:DS()(e[0])}function Uh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["rejected"])}:J0(e)?function(n){var r=e.map(function(o){return o.rejected}),i=$o.apply(void 0,r);return i(n)}:Uh()(e[0])}function ey(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(r){return r&&r.meta&&r.meta.rejectedWithValue};return e.length===0?function(r){var i=ah(Uh.apply(void 0,e),n);return i(r)}:J0(e)?function(r){var i=ah(Uh.apply(void 0,e),n);return i(r)}:ey()(e[0])}function Sc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["fulfilled"])}:J0(e)?function(n){var r=e.map(function(o){return o.fulfilled}),i=$o.apply(void 0,r);return i(n)}:Sc()(e[0])}function Ub(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["pending","fulfilled","rejected"])}:J0(e)?function(n){for(var r=[],i=0,o=e;i<o.length;i++){var a=o[i];r.push(a.pending,a.rejected,a.fulfilled)}var s=$o.apply(void 0,r);return s(n)}:Ub()(e[0])}var Z4=function(e,t){if(typeof e!="function")throw new TypeError(t+" is not a function")},U3=function(){},RL=function(e,t){return t===void 0&&(t=U3),e.catch(t),e},OL=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},sh=function(e,t){var n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},mZ="task",ML="listener",NL="completed",J4="cancelled",yZ="task-"+J4,vZ="task-"+NL,$L=ML+"-"+J4,bZ=ML+"-"+NL,ty=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=mZ+" "+J4+" (reason: "+t+")"}return e}(),lh=function(e){if(e.aborted)throw new ty(e.reason)};function DL(e,t){var n=U3;return new Promise(function(r,i){var o=function(){return i(new ty(e.reason))};if(e.aborted){o();return}n=OL(e,o),t.finally(function(){return n()}).then(r,i)}).finally(function(){n=U3})}var _Z=function(e,t){return Z0(void 0,null,function(){var n,r;return Y0(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return i.sent(),[4,e()];case 2:return n=i.sent(),[2,{status:"ok",value:n}];case 3:return r=i.sent(),[2,{status:r instanceof ty?"cancelled":"rejected",error:r}];case 4:return t==null||t(),[7];case 5:return[2]}})})},Vb=function(e){return function(t){return RL(DL(e,t).then(function(n){return lh(e),n}))}},LL=function(e){var t=Vb(e);return function(n){return t(new Promise(function(r){return setTimeout(r,n)}))}},SZ=Object.assign,f8={},ny="listenerMiddleware",xZ=function(e){var t=function(n){return OL(e,function(){return sh(n,e.reason)})};return function(n){Z4(n,"taskExecutor");var r=new AbortController;t(r);var i=_Z(function(){return Z0(void 0,null,function(){var o;return Y0(this,function(a){switch(a.label){case 0:return lh(e),lh(r.signal),[4,n({pause:Vb(r.signal),delay:LL(r.signal),signal:r.signal})];case 1:return o=a.sent(),lh(r.signal),[2,o]}})})},function(){return sh(r,vZ)});return{result:Vb(e)(i),cancel:function(){sh(r,yZ)}}}},wZ=function(e,t){var n=function(r,i){return Z0(void 0,null,function(){var o,a,s,l;return Y0(this,function(u){switch(u.label){case 0:lh(t),o=function(){},a=new Promise(function(c,d){var f=e({predicate:r,effect:function(h,p){p.unsubscribe(),c([h,p.getState(),p.getOriginalState()])}});o=function(){f(),d()}}),s=[a],i!=null&&s.push(new Promise(function(c){return setTimeout(c,i,null)})),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,DL(t,Promise.race(s))];case 2:return l=u.sent(),lh(t),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(r,i){return RL(n(r,i))}},FL=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(t)i=Ne(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Z4(o,"options.listener"),{predicate:i,type:t,effect:o}},CZ=function(e){var t=FL(e),n=t.type,r=t.predicate,i=t.effect,o=NS(),a={id:o,effect:i,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return a},V3=function(e){e.pending.forEach(function(t){sh(t,$L)})},EZ=function(e){return function(){e.forEach(V3),e.clear()}},h8=function(e,t,n){try{e(t,n)}catch(r){setTimeout(function(){throw r},0)}},BL=Ne(ny+"/add"),zL=Ne(ny+"/removeAll"),jL=Ne(ny+"/remove"),TZ=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,rc([ny+"/error"],e))};function UL(e){var t=this;e===void 0&&(e={});var n=new Map,r=e.extra,i=e.onError,o=i===void 0?TZ:i;Z4(o,"onError");var a=function(h){return h.unsubscribe=function(){return n.delete(h.id)},n.set(h.id,h),function(p){h.unsubscribe(),p!=null&&p.cancelActive&&V3(h)}},s=function(h){for(var p=0,m=Array.from(n.values());p<m.length;p++){var _=m[p];if(h(_))return _}},l=function(h){var p=s(function(m){return m.effect===h.effect});return p||(p=CZ(h)),a(p)},u=function(h){var p=FL(h),m=p.type,_=p.effect,b=p.predicate,y=s(function(g){var v=typeof m=="string"?g.type===m:g.predicate===b;return v&&g.effect===_});return y&&(y.unsubscribe(),h.cancelActive&&V3(y)),!!y},c=function(h,p,m,_){return Z0(t,null,function(){var b,y,g;return Y0(this,function(v){switch(v.label){case 0:b=new AbortController,y=wZ(l,b.signal),v.label=1;case 1:return v.trys.push([1,3,4,5]),h.pending.add(b),[4,Promise.resolve(h.effect(p,SZ({},m,{getOriginalState:_,condition:function(S,w){return y(S,w).then(Boolean)},take:y,delay:LL(b.signal),pause:Vb(b.signal),extra:r,signal:b.signal,fork:xZ(b.signal),unsubscribe:h.unsubscribe,subscribe:function(){n.set(h.id,h)},cancelActiveListeners:function(){h.pending.forEach(function(S,w,x){S!==b&&(sh(S,$L),x.delete(S))})}})))];case 2:return v.sent(),[3,5];case 3:return g=v.sent(),g instanceof ty||h8(o,g,{raisedBy:"effect"}),[3,5];case 4:return sh(b,bZ),h.pending.delete(b),[7];case 5:return[2]}})})},d=EZ(n),f=function(h){return function(p){return function(m){if(!Y4(m))return p(m);if(BL.match(m))return l(m.payload);if(zL.match(m)){d();return}if(jL.match(m))return u(m.payload);var _=h.getState(),b=function(){if(_===f8)throw new Error(ny+": getOriginalState can only be called synchronously");return _},y;try{if(y=p(m),n.size>0)for(var g=h.getState(),v=Array.from(n.values()),S=0,w=v;S<w.length;S++){var x=w[S],C=!1;try{C=x.predicate(m,g,_)}catch(k){C=!1,h8(o,k,{raisedBy:"predicate"})}C&&c(x,m,h,b)}}finally{_=f8}return y}}};return{middleware:f,startListening:l,stopListening:u,clearListeners:d}}var td="RTK_autoBatch",O1=function(){return function(e){var t;return{payload:e,meta:(t={},t[td]=!0,t)}}},p8,kZ=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(p8||(p8=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},VL=function(e){return function(t){setTimeout(t,e)}},AZ=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:VL(10),GL=function(e){return e===void 0&&(e={type:"raf"}),function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.apply(void 0,n),o=!0,a=!1,s=!1,l=new Set,u=e.type==="tick"?kZ:e.type==="raf"?AZ:e.type==="callback"?e.queueNotification:VL(e.timeout),c=function(){s=!1,a&&(a=!1,l.forEach(function(d){return d()}))};return Object.assign({},i,{subscribe:function(d){var f=function(){return o&&d()},h=i.subscribe(f);return l.add(d),function(){h(),l.delete(d)}},dispatch:function(d){var f;try{return o=!((f=d==null?void 0:d.meta)!=null&&f[td]),a=!o,a&&(s||(s=!0,u(c))),i.dispatch(d)}finally{o=!0}}})}}};H4();const PZ=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:yL,MiddlewareArray:mL,SHOULD_AUTOBATCH:td,TaskAbortError:ty,__DO_NOT_USE__ActionTypes:zh,addListener:BL,applyMiddleware:X4,autoBatchEnhancer:GL,bindActionCreators:cL,clearAllListeners:zL,combineReducers:pp,compose:jh,configureStore:xL,createAction:Ne,createAsyncThunk:jb,createDraftSafeSelector:pl,createEntityAdapter:ds,createImmutableStateInvariantMiddleware:ZY,createListenerMiddleware:UL,createNextState:_c,createReducer:EL,createSelector:Ii,createSerializableStateInvariantMiddleware:JY,createSlice:rr,createStore:X0,current:OS,findNonSerializableValue:bL,freeze:Q0,getDefaultMiddleware:SL,getType:iZ,isAction:Y4,isAllOf:ah,isAnyOf:$o,isAsyncThunkAction:Ub,isDraft:ao,isFluxStandardAction:wL,isFulfilled:Sc,isImmutableDefault:YY,isPending:DS,isPlain:vL,isPlainObject:ss,isRejected:Uh,isRejectedWithValue:ey,legacy_createStore:uL,miniSerializeError:AL,nanoid:NS,original:U4,prepareAutoBatched:O1,removeListener:jL,unwrapResult:PL},Symbol.toStringTag,{value:"Module"})),lv=(e,t)=>Math.floor(e/t)*t,Wa=(e,t)=>Math.round(e/t)*t;var IZ=typeof global=="object"&&global&&global.Object===Object&&global;const qL=IZ;var RZ=typeof self=="object"&&self&&self.Object===Object&&self,OZ=qL||RZ||Function("return this")();const tl=OZ;var MZ=tl.Symbol;const Ca=MZ;var HL=Object.prototype,NZ=HL.hasOwnProperty,$Z=HL.toString,Vp=Ca?Ca.toStringTag:void 0;function DZ(e){var t=NZ.call(e,Vp),n=e[Vp];try{e[Vp]=void 0;var r=!0}catch{}var i=$Z.call(e);return r&&(t?e[Vp]=n:delete e[Vp]),i}var LZ=Object.prototype,FZ=LZ.toString;function BZ(e){return FZ.call(e)}var zZ="[object Null]",jZ="[object Undefined]",g8=Ca?Ca.toStringTag:void 0;function fs(e){return e==null?e===void 0?jZ:zZ:g8&&g8 in Object(e)?DZ(e):BZ(e)}function Io(e){return e!=null&&typeof e=="object"}var UZ="[object Symbol]";function LS(e){return typeof e=="symbol"||Io(e)&&fs(e)==UZ}function WL(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var VZ=Array.isArray;const Yr=VZ;var GZ=1/0,m8=Ca?Ca.prototype:void 0,y8=m8?m8.toString:void 0;function Gb(e){if(typeof e=="string")return e;if(Yr(e))return WL(e,Gb)+"";if(LS(e))return y8?y8.call(e):"";var t=e+"";return t=="0"&&1/e==-GZ?"-0":t}var qZ=/\s/;function HZ(e){for(var t=e.length;t--&&qZ.test(e.charAt(t)););return t}var WZ=/^\s+/;function KZ(e){return e&&e.slice(0,HZ(e)+1).replace(WZ,"")}function Ro(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var v8=0/0,QZ=/^[-+]0x[0-9a-f]+$/i,XZ=/^0b[01]+$/i,YZ=/^0o[0-7]+$/i,ZZ=parseInt;function M1(e){if(typeof e=="number")return e;if(LS(e))return v8;if(Ro(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ro(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=KZ(e);var n=XZ.test(e);return n||YZ.test(e)?ZZ(e.slice(2),n?2:8):QZ.test(e)?v8:+e}var b8=1/0,JZ=17976931348623157e292;function uh(e){if(!e)return e===0?e:0;if(e=M1(e),e===b8||e===-b8){var t=e<0?-1:1;return t*JZ}return e===e?e:0}function KL(e){var t=uh(e),n=t%1;return t===t?n?t-n:t:0}function FS(e){return e}var eJ="[object AsyncFunction]",tJ="[object Function]",nJ="[object GeneratorFunction]",rJ="[object Proxy]";function ek(e){if(!Ro(e))return!1;var t=fs(e);return t==tJ||t==nJ||t==eJ||t==rJ}var iJ=tl["__core-js_shared__"];const rC=iJ;var _8=function(){var e=/[^.]+$/.exec(rC&&rC.keys&&rC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function oJ(e){return!!_8&&_8 in e}var aJ=Function.prototype,sJ=aJ.toString;function jd(e){if(e!=null){try{return sJ.call(e)}catch{}try{return e+""}catch{}}return""}var lJ=/[\\^$.*+?()[\]{}|]/g,uJ=/^\[object .+?Constructor\]$/,cJ=Function.prototype,dJ=Object.prototype,fJ=cJ.toString,hJ=dJ.hasOwnProperty,pJ=RegExp("^"+fJ.call(hJ).replace(lJ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gJ(e){if(!Ro(e)||oJ(e))return!1;var t=ek(e)?pJ:uJ;return t.test(jd(e))}function mJ(e,t){return e==null?void 0:e[t]}function Ud(e,t){var n=mJ(e,t);return gJ(n)?n:void 0}var yJ=Ud(tl,"WeakMap");const G3=yJ;var S8=Object.create,vJ=function(){function e(){}return function(t){if(!Ro(t))return{};if(S8)return S8(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const bJ=vJ;function QL(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _J(){}function XL(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var SJ=800,xJ=16,wJ=Date.now;function CJ(e){var t=0,n=0;return function(){var r=wJ(),i=xJ-(r-n);if(n=r,i>0){if(++t>=SJ)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function EJ(e){return function(){return e}}var TJ=function(){try{var e=Ud(Object,"defineProperty");return e({},"",{}),e}catch{}}();const qb=TJ;var kJ=qb?function(e,t){return qb(e,"toString",{configurable:!0,enumerable:!1,value:EJ(t),writable:!0})}:FS;const AJ=kJ;var PJ=CJ(AJ);const YL=PJ;function ZL(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function IJ(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function RJ(e){return e!==e}function OJ(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function MJ(e,t,n){return t===t?OJ(e,t,n):IJ(e,RJ,n)}function NJ(e,t){var n=e==null?0:e.length;return!!n&&MJ(e,t,0)>-1}var $J=9007199254740991,DJ=/^(?:0|[1-9]\d*)$/;function tk(e,t){var n=typeof e;return t=t??$J,!!t&&(n=="number"||n!="symbol"&&DJ.test(e))&&e>-1&&e%1==0&&e<t}function BS(e,t,n){t=="__proto__"&&qb?qb(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ry(e,t){return e===t||e!==e&&t!==t}var LJ=Object.prototype,FJ=LJ.hasOwnProperty;function JL(e,t,n){var r=e[t];(!(FJ.call(e,t)&&ry(r,n))||n===void 0&&!(t in e))&&BS(e,t,n)}function gp(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?BS(n,s,l):JL(n,s,l)}return n}var x8=Math.max;function eF(e,t,n){return t=x8(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=x8(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),QL(e,this,s)}}function tF(e,t){return YL(eF(e,t,FS),e+"")}var BJ=9007199254740991;function nk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BJ}function mp(e){return e!=null&&nk(e.length)&&!ek(e)}function zS(e,t,n){if(!Ro(n))return!1;var r=typeof t;return(r=="number"?mp(n)&&tk(t,n.length):r=="string"&&t in n)?ry(n[t],e):!1}function nF(e){return tF(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&zS(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var zJ=Object.prototype;function rk(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zJ;return e===n}function jJ(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var UJ="[object Arguments]";function w8(e){return Io(e)&&fs(e)==UJ}var rF=Object.prototype,VJ=rF.hasOwnProperty,GJ=rF.propertyIsEnumerable,qJ=w8(function(){return arguments}())?w8:function(e){return Io(e)&&VJ.call(e,"callee")&&!GJ.call(e,"callee")};const Rm=qJ;function HJ(){return!1}var iF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,C8=iF&&typeof module=="object"&&module&&!module.nodeType&&module,WJ=C8&&C8.exports===iF,E8=WJ?tl.Buffer:void 0,KJ=E8?E8.isBuffer:void 0,QJ=KJ||HJ;const Om=QJ;var XJ="[object Arguments]",YJ="[object Array]",ZJ="[object Boolean]",JJ="[object Date]",eee="[object Error]",tee="[object Function]",nee="[object Map]",ree="[object Number]",iee="[object Object]",oee="[object RegExp]",aee="[object Set]",see="[object String]",lee="[object WeakMap]",uee="[object ArrayBuffer]",cee="[object DataView]",dee="[object Float32Array]",fee="[object Float64Array]",hee="[object Int8Array]",pee="[object Int16Array]",gee="[object Int32Array]",mee="[object Uint8Array]",yee="[object Uint8ClampedArray]",vee="[object Uint16Array]",bee="[object Uint32Array]",qn={};qn[dee]=qn[fee]=qn[hee]=qn[pee]=qn[gee]=qn[mee]=qn[yee]=qn[vee]=qn[bee]=!0;qn[XJ]=qn[YJ]=qn[uee]=qn[ZJ]=qn[cee]=qn[JJ]=qn[eee]=qn[tee]=qn[nee]=qn[ree]=qn[iee]=qn[oee]=qn[aee]=qn[see]=qn[lee]=!1;function _ee(e){return Io(e)&&nk(e.length)&&!!qn[fs(e)]}function jS(e){return function(t){return e(t)}}var oF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vg=oF&&typeof module=="object"&&module&&!module.nodeType&&module,See=Vg&&Vg.exports===oF,iC=See&&qL.process,xee=function(){try{var e=Vg&&Vg.require&&Vg.require("util").types;return e||iC&&iC.binding&&iC.binding("util")}catch{}}();const ic=xee;var T8=ic&&ic.isTypedArray,wee=T8?jS(T8):_ee;const ik=wee;var Cee=Object.prototype,Eee=Cee.hasOwnProperty;function aF(e,t){var n=Yr(e),r=!n&&Rm(e),i=!n&&!r&&Om(e),o=!n&&!r&&!i&&ik(e),a=n||r||i||o,s=a?jJ(e.length,String):[],l=s.length;for(var u in e)(t||Eee.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||tk(u,l)))&&s.push(u);return s}function sF(e,t){return function(n){return e(t(n))}}var Tee=sF(Object.keys,Object);const kee=Tee;var Aee=Object.prototype,Pee=Aee.hasOwnProperty;function lF(e){if(!rk(e))return kee(e);var t=[];for(var n in Object(e))Pee.call(e,n)&&n!="constructor"&&t.push(n);return t}function iy(e){return mp(e)?aF(e):lF(e)}function Iee(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ree=Object.prototype,Oee=Ree.hasOwnProperty;function Mee(e){if(!Ro(e))return Iee(e);var t=rk(e),n=[];for(var r in e)r=="constructor"&&(t||!Oee.call(e,r))||n.push(r);return n}function oy(e){return mp(e)?aF(e,!0):Mee(e)}var Nee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$ee=/^\w*$/;function ok(e,t){if(Yr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||LS(e)?!0:$ee.test(e)||!Nee.test(e)||t!=null&&e in Object(t)}var Dee=Ud(Object,"create");const Mm=Dee;function Lee(){this.__data__=Mm?Mm(null):{},this.size=0}function Fee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Bee="__lodash_hash_undefined__",zee=Object.prototype,jee=zee.hasOwnProperty;function Uee(e){var t=this.__data__;if(Mm){var n=t[e];return n===Bee?void 0:n}return jee.call(t,e)?t[e]:void 0}var Vee=Object.prototype,Gee=Vee.hasOwnProperty;function qee(e){var t=this.__data__;return Mm?t[e]!==void 0:Gee.call(t,e)}var Hee="__lodash_hash_undefined__";function Wee(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mm&&t===void 0?Hee:t,this}function kd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kd.prototype.clear=Lee;kd.prototype.delete=Fee;kd.prototype.get=Uee;kd.prototype.has=qee;kd.prototype.set=Wee;function Kee(){this.__data__=[],this.size=0}function US(e,t){for(var n=e.length;n--;)if(ry(e[n][0],t))return n;return-1}var Qee=Array.prototype,Xee=Qee.splice;function Yee(e){var t=this.__data__,n=US(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Xee.call(t,n,1),--this.size,!0}function Zee(e){var t=this.__data__,n=US(t,e);return n<0?void 0:t[n][1]}function Jee(e){return US(this.__data__,e)>-1}function ete(e,t){var n=this.__data__,r=US(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Zl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zl.prototype.clear=Kee;Zl.prototype.delete=Yee;Zl.prototype.get=Zee;Zl.prototype.has=Jee;Zl.prototype.set=ete;var tte=Ud(tl,"Map");const Nm=tte;function nte(){this.size=0,this.__data__={hash:new kd,map:new(Nm||Zl),string:new kd}}function rte(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function VS(e,t){var n=e.__data__;return rte(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ite(e){var t=VS(this,e).delete(e);return this.size-=t?1:0,t}function ote(e){return VS(this,e).get(e)}function ate(e){return VS(this,e).has(e)}function ste(e,t){var n=VS(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Jl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jl.prototype.clear=nte;Jl.prototype.delete=ite;Jl.prototype.get=ote;Jl.prototype.has=ate;Jl.prototype.set=ste;var lte="Expected a function";function ak(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(lte);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ak.Cache||Jl),n}ak.Cache=Jl;var ute=500;function cte(e){var t=ak(e,function(r){return n.size===ute&&n.clear(),r}),n=t.cache;return t}var dte=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fte=/\\(\\)?/g,hte=cte(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dte,function(n,r,i,o){t.push(i?o.replace(fte,"$1"):r||n)}),t});const pte=hte;function Vh(e){return e==null?"":Gb(e)}function GS(e,t){return Yr(e)?e:ok(e,t)?[e]:pte(Vh(e))}var gte=1/0;function ay(e){if(typeof e=="string"||LS(e))return e;var t=e+"";return t=="0"&&1/e==-gte?"-0":t}function sk(e,t){t=GS(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ay(t[n++])];return n&&n==r?e:void 0}function ch(e,t,n){var r=e==null?void 0:sk(e,t);return r===void 0?n:r}function lk(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var k8=Ca?Ca.isConcatSpreadable:void 0;function mte(e){return Yr(e)||Rm(e)||!!(k8&&e&&e[k8])}function uF(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=mte),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?uF(s,t-1,n,r,i):lk(i,s):r||(i[i.length]=s)}return i}function yte(e){var t=e==null?0:e.length;return t?uF(e,1):[]}function vte(e){return YL(eF(e,void 0,yte),e+"")}var bte=sF(Object.getPrototypeOf,Object);const uk=bte;var _te="[object Object]",Ste=Function.prototype,xte=Object.prototype,cF=Ste.toString,wte=xte.hasOwnProperty,Cte=cF.call(Object);function dF(e){if(!Io(e)||fs(e)!=_te)return!1;var t=uk(e);if(t===null)return!0;var n=wte.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&cF.call(n)==Cte}function fF(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function hF(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:fF(e,t,n)}var Ete="\\ud800-\\udfff",Tte="\\u0300-\\u036f",kte="\\ufe20-\\ufe2f",Ate="\\u20d0-\\u20ff",Pte=Tte+kte+Ate,Ite="\\ufe0e\\ufe0f",Rte="\\u200d",Ote=RegExp("["+Rte+Ete+Pte+Ite+"]");function qS(e){return Ote.test(e)}function Mte(e){return e.split("")}var pF="\\ud800-\\udfff",Nte="\\u0300-\\u036f",$te="\\ufe20-\\ufe2f",Dte="\\u20d0-\\u20ff",Lte=Nte+$te+Dte,Fte="\\ufe0e\\ufe0f",Bte="["+pF+"]",q3="["+Lte+"]",H3="\\ud83c[\\udffb-\\udfff]",zte="(?:"+q3+"|"+H3+")",gF="[^"+pF+"]",mF="(?:\\ud83c[\\udde6-\\uddff]){2}",yF="[\\ud800-\\udbff][\\udc00-\\udfff]",jte="\\u200d",vF=zte+"?",bF="["+Fte+"]?",Ute="(?:"+jte+"(?:"+[gF,mF,yF].join("|")+")"+bF+vF+")*",Vte=bF+vF+Ute,Gte="(?:"+[gF+q3+"?",q3,mF,yF,Bte].join("|")+")",qte=RegExp(H3+"(?="+H3+")|"+Gte+Vte,"g");function Hte(e){return e.match(qte)||[]}function _F(e){return qS(e)?Hte(e):Mte(e)}function Wte(e){return function(t){t=Vh(t);var n=qS(t)?_F(t):void 0,r=n?n[0]:t.charAt(0),i=n?hF(n,1).join(""):t.slice(1);return r[e]()+i}}var Kte=Wte("toUpperCase");const SF=Kte;function xF(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Qte(e){return function(t){return e==null?void 0:e[t]}}var Xte={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Yte=Qte(Xte);const Zte=Yte;var Jte=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ene="\\u0300-\\u036f",tne="\\ufe20-\\ufe2f",nne="\\u20d0-\\u20ff",rne=ene+tne+nne,ine="["+rne+"]",one=RegExp(ine,"g");function ane(e){return e=Vh(e),e&&e.replace(Jte,Zte).replace(one,"")}var sne=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function lne(e){return e.match(sne)||[]}var une=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cne(e){return une.test(e)}var wF="\\ud800-\\udfff",dne="\\u0300-\\u036f",fne="\\ufe20-\\ufe2f",hne="\\u20d0-\\u20ff",pne=dne+fne+hne,CF="\\u2700-\\u27bf",EF="a-z\\xdf-\\xf6\\xf8-\\xff",gne="\\xac\\xb1\\xd7\\xf7",mne="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yne="\\u2000-\\u206f",vne=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",TF="A-Z\\xc0-\\xd6\\xd8-\\xde",bne="\\ufe0e\\ufe0f",kF=gne+mne+yne+vne,AF="['’]",A8="["+kF+"]",_ne="["+pne+"]",PF="\\d+",Sne="["+CF+"]",IF="["+EF+"]",RF="[^"+wF+kF+PF+CF+EF+TF+"]",xne="\\ud83c[\\udffb-\\udfff]",wne="(?:"+_ne+"|"+xne+")",Cne="[^"+wF+"]",OF="(?:\\ud83c[\\udde6-\\uddff]){2}",MF="[\\ud800-\\udbff][\\udc00-\\udfff]",xf="["+TF+"]",Ene="\\u200d",P8="(?:"+IF+"|"+RF+")",Tne="(?:"+xf+"|"+RF+")",I8="(?:"+AF+"(?:d|ll|m|re|s|t|ve))?",R8="(?:"+AF+"(?:D|LL|M|RE|S|T|VE))?",NF=wne+"?",$F="["+bne+"]?",kne="(?:"+Ene+"(?:"+[Cne,OF,MF].join("|")+")"+$F+NF+")*",Ane="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pne="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ine=$F+NF+kne,Rne="(?:"+[Sne,OF,MF].join("|")+")"+Ine,One=RegExp([xf+"?"+IF+"+"+I8+"(?="+[A8,xf,"$"].join("|")+")",Tne+"+"+R8+"(?="+[A8,xf+P8,"$"].join("|")+")",xf+"?"+P8+"+"+I8,xf+"+"+R8,Pne,Ane,PF,Rne].join("|"),"g");function Mne(e){return e.match(One)||[]}function Nne(e,t,n){return e=Vh(e),t=n?void 0:t,t===void 0?cne(e)?Mne(e):lne(e):e.match(t)||[]}var $ne="['’]",Dne=RegExp($ne,"g");function Lne(e){return function(t){return xF(Nne(ane(t).replace(Dne,"")),e,"")}}function Fne(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Nu(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=M1(n),n=n===n?n:0),t!==void 0&&(t=M1(t),t=t===t?t:0),Fne(M1(e),t,n)}function Bne(){this.__data__=new Zl,this.size=0}function zne(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function jne(e){return this.__data__.get(e)}function Une(e){return this.__data__.has(e)}var Vne=200;function Gne(e,t){var n=this.__data__;if(n instanceof Zl){var r=n.__data__;if(!Nm||r.length<Vne-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jl(r)}return n.set(e,t),this.size=n.size,this}function ns(e){var t=this.__data__=new Zl(e);this.size=t.size}ns.prototype.clear=Bne;ns.prototype.delete=zne;ns.prototype.get=jne;ns.prototype.has=Une;ns.prototype.set=Gne;function qne(e,t){return e&&gp(t,iy(t),e)}function Hne(e,t){return e&&gp(t,oy(t),e)}var DF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,O8=DF&&typeof module=="object"&&module&&!module.nodeType&&module,Wne=O8&&O8.exports===DF,M8=Wne?tl.Buffer:void 0,N8=M8?M8.allocUnsafe:void 0;function LF(e,t){if(t)return e.slice();var n=e.length,r=N8?N8(n):new e.constructor(n);return e.copy(r),r}function FF(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function BF(){return[]}var Kne=Object.prototype,Qne=Kne.propertyIsEnumerable,$8=Object.getOwnPropertySymbols,Xne=$8?function(e){return e==null?[]:(e=Object(e),FF($8(e),function(t){return Qne.call(e,t)}))}:BF;const ck=Xne;function Yne(e,t){return gp(e,ck(e),t)}var Zne=Object.getOwnPropertySymbols,Jne=Zne?function(e){for(var t=[];e;)lk(t,ck(e)),e=uk(e);return t}:BF;const zF=Jne;function ere(e,t){return gp(e,zF(e),t)}function jF(e,t,n){var r=t(e);return Yr(e)?r:lk(r,n(e))}function W3(e){return jF(e,iy,ck)}function UF(e){return jF(e,oy,zF)}var tre=Ud(tl,"DataView");const K3=tre;var nre=Ud(tl,"Promise");const Q3=nre;var rre=Ud(tl,"Set");const dh=rre;var D8="[object Map]",ire="[object Object]",L8="[object Promise]",F8="[object Set]",B8="[object WeakMap]",z8="[object DataView]",ore=jd(K3),are=jd(Nm),sre=jd(Q3),lre=jd(dh),ure=jd(G3),Uc=fs;(K3&&Uc(new K3(new ArrayBuffer(1)))!=z8||Nm&&Uc(new Nm)!=D8||Q3&&Uc(Q3.resolve())!=L8||dh&&Uc(new dh)!=F8||G3&&Uc(new G3)!=B8)&&(Uc=function(e){var t=fs(e),n=t==ire?e.constructor:void 0,r=n?jd(n):"";if(r)switch(r){case ore:return z8;case are:return D8;case sre:return L8;case lre:return F8;case ure:return B8}return t});const Gh=Uc;var cre=Object.prototype,dre=cre.hasOwnProperty;function fre(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&dre.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var hre=tl.Uint8Array;const Hb=hre;function dk(e){var t=new e.constructor(e.byteLength);return new Hb(t).set(new Hb(e)),t}function pre(e,t){var n=t?dk(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var gre=/\w*$/;function mre(e){var t=new e.constructor(e.source,gre.exec(e));return t.lastIndex=e.lastIndex,t}var j8=Ca?Ca.prototype:void 0,U8=j8?j8.valueOf:void 0;function yre(e){return U8?Object(U8.call(e)):{}}function VF(e,t){var n=t?dk(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var vre="[object Boolean]",bre="[object Date]",_re="[object Map]",Sre="[object Number]",xre="[object RegExp]",wre="[object Set]",Cre="[object String]",Ere="[object Symbol]",Tre="[object ArrayBuffer]",kre="[object DataView]",Are="[object Float32Array]",Pre="[object Float64Array]",Ire="[object Int8Array]",Rre="[object Int16Array]",Ore="[object Int32Array]",Mre="[object Uint8Array]",Nre="[object Uint8ClampedArray]",$re="[object Uint16Array]",Dre="[object Uint32Array]";function Lre(e,t,n){var r=e.constructor;switch(t){case Tre:return dk(e);case vre:case bre:return new r(+e);case kre:return pre(e,n);case Are:case Pre:case Ire:case Rre:case Ore:case Mre:case Nre:case $re:case Dre:return VF(e,n);case _re:return new r;case Sre:case Cre:return new r(e);case xre:return mre(e);case wre:return new r;case Ere:return yre(e)}}function GF(e){return typeof e.constructor=="function"&&!rk(e)?bJ(uk(e)):{}}var Fre="[object Map]";function Bre(e){return Io(e)&&Gh(e)==Fre}var V8=ic&&ic.isMap,zre=V8?jS(V8):Bre;const jre=zre;var Ure="[object Set]";function Vre(e){return Io(e)&&Gh(e)==Ure}var G8=ic&&ic.isSet,Gre=G8?jS(G8):Vre;const qre=Gre;var Hre=1,Wre=2,Kre=4,qF="[object Arguments]",Qre="[object Array]",Xre="[object Boolean]",Yre="[object Date]",Zre="[object Error]",HF="[object Function]",Jre="[object GeneratorFunction]",eie="[object Map]",tie="[object Number]",WF="[object Object]",nie="[object RegExp]",rie="[object Set]",iie="[object String]",oie="[object Symbol]",aie="[object WeakMap]",sie="[object ArrayBuffer]",lie="[object DataView]",uie="[object Float32Array]",cie="[object Float64Array]",die="[object Int8Array]",fie="[object Int16Array]",hie="[object Int32Array]",pie="[object Uint8Array]",gie="[object Uint8ClampedArray]",mie="[object Uint16Array]",yie="[object Uint32Array]",On={};On[qF]=On[Qre]=On[sie]=On[lie]=On[Xre]=On[Yre]=On[uie]=On[cie]=On[die]=On[fie]=On[hie]=On[eie]=On[tie]=On[WF]=On[nie]=On[rie]=On[iie]=On[oie]=On[pie]=On[gie]=On[mie]=On[yie]=!0;On[Zre]=On[HF]=On[aie]=!1;function Gg(e,t,n,r,i,o){var a,s=t&Hre,l=t&Wre,u=t&Kre;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!Ro(e))return e;var c=Yr(e);if(c){if(a=fre(e),!s)return XL(e,a)}else{var d=Gh(e),f=d==HF||d==Jre;if(Om(e))return LF(e,s);if(d==WF||d==qF||f&&!i){if(a=l||f?{}:GF(e),!s)return l?ere(e,Hne(a,e)):Yne(e,qne(a,e))}else{if(!On[d])return i?e:{};a=Lre(e,d,s)}}o||(o=new ns);var h=o.get(e);if(h)return h;o.set(e,a),qre(e)?e.forEach(function(_){a.add(Gg(_,t,n,_,e,o))}):jre(e)&&e.forEach(function(_,b){a.set(b,Gg(_,t,n,b,e,o))});var p=u?l?UF:W3:l?oy:iy,m=c?void 0:p(e);return ZL(m||e,function(_,b){m&&(b=_,_=e[b]),JL(a,b,Gg(_,t,n,b,e,o))}),a}var vie=1,bie=4;function Cn(e){return Gg(e,vie|bie)}var _ie="__lodash_hash_undefined__";function Sie(e){return this.__data__.set(e,_ie),this}function xie(e){return this.__data__.has(e)}function $m(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Jl;++t<n;)this.add(e[t])}$m.prototype.add=$m.prototype.push=Sie;$m.prototype.has=xie;function KF(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function QF(e,t){return e.has(t)}var wie=1,Cie=2;function XF(e,t,n,r,i,o){var a=n&wie,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=n&Cie?new $m:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var p=e[d],m=t[d];if(r)var _=a?r(m,p,d,t,e,o):r(p,m,d,e,t,o);if(_!==void 0){if(_)continue;f=!1;break}if(h){if(!KF(t,function(b,y){if(!QF(h,y)&&(p===b||i(p,b,n,r,o)))return h.push(y)})){f=!1;break}}else if(!(p===m||i(p,m,n,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Eie(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function fk(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Tie=1,kie=2,Aie="[object Boolean]",Pie="[object Date]",Iie="[object Error]",Rie="[object Map]",Oie="[object Number]",Mie="[object RegExp]",Nie="[object Set]",$ie="[object String]",Die="[object Symbol]",Lie="[object ArrayBuffer]",Fie="[object DataView]",q8=Ca?Ca.prototype:void 0,oC=q8?q8.valueOf:void 0;function Bie(e,t,n,r,i,o,a){switch(n){case Fie:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Lie:return!(e.byteLength!=t.byteLength||!o(new Hb(e),new Hb(t)));case Aie:case Pie:case Oie:return ry(+e,+t);case Iie:return e.name==t.name&&e.message==t.message;case Mie:case $ie:return e==t+"";case Rie:var s=Eie;case Nie:var l=r&Tie;if(s||(s=fk),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=kie,a.set(e,t);var c=XF(s(e),s(t),r,i,o,a);return a.delete(e),c;case Die:if(oC)return oC.call(e)==oC.call(t)}return!1}var zie=1,jie=Object.prototype,Uie=jie.hasOwnProperty;function Vie(e,t,n,r,i,o){var a=n&zie,s=W3(e),l=s.length,u=W3(t),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in t:Uie.call(t,f)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var _=a;++d<l;){f=s[d];var b=e[f],y=t[f];if(r)var g=a?r(y,b,f,t,e,o):r(b,y,f,e,t,o);if(!(g===void 0?b===y||i(b,y,n,r,o):g)){m=!1;break}_||(_=f=="constructor")}if(m&&!_){var v=e.constructor,S=t.constructor;v!=S&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return o.delete(e),o.delete(t),m}var Gie=1,H8="[object Arguments]",W8="[object Array]",uv="[object Object]",qie=Object.prototype,K8=qie.hasOwnProperty;function Hie(e,t,n,r,i,o){var a=Yr(e),s=Yr(t),l=a?W8:Gh(e),u=s?W8:Gh(t);l=l==H8?uv:l,u=u==H8?uv:u;var c=l==uv,d=u==uv,f=l==u;if(f&&Om(e)){if(!Om(t))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new ns),a||ik(e)?XF(e,t,n,r,i,o):Bie(e,t,l,n,r,i,o);if(!(n&Gie)){var h=c&&K8.call(e,"__wrapped__"),p=d&&K8.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,_=p?t.value():t;return o||(o=new ns),i(m,_,n,r,o)}}return f?(o||(o=new ns),Vie(e,t,n,r,i,o)):!1}function HS(e,t,n,r,i){return e===t?!0:e==null||t==null||!Io(e)&&!Io(t)?e!==e&&t!==t:Hie(e,t,n,r,HS,i)}var Wie=1,Kie=2;function Qie(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],u=e[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in e))return!1}else{var d=new ns;if(r)var f=r(u,c,l,e,t,d);if(!(f===void 0?HS(c,u,Wie|Kie,r,d):f))return!1}}return!0}function YF(e){return e===e&&!Ro(e)}function Xie(e){for(var t=iy(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,YF(i)]}return t}function ZF(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Yie(e){var t=Xie(e);return t.length==1&&t[0][2]?ZF(t[0][0],t[0][1]):function(n){return n===e||Qie(n,e,t)}}function Zie(e,t){return e!=null&&t in Object(e)}function JF(e,t,n){t=GS(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=ay(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&nk(i)&&tk(a,i)&&(Yr(e)||Rm(e)))}function Jie(e,t){return e!=null&&JF(e,t,Zie)}var eoe=1,toe=2;function noe(e,t){return ok(e)&&YF(t)?ZF(ay(e),t):function(n){var r=ch(n,e);return r===void 0&&r===t?Jie(n,e):HS(t,r,eoe|toe)}}function eB(e){return function(t){return t==null?void 0:t[e]}}function roe(e){return function(t){return sk(t,e)}}function ioe(e){return ok(e)?eB(ay(e)):roe(e)}function sy(e){return typeof e=="function"?e:e==null?FS:typeof e=="object"?Yr(e)?noe(e[0],e[1]):Yie(e):ioe(e)}function ooe(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function aoe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(n(o[l],l,o)===!1)break}return t}}var soe=aoe();const tB=soe;function loe(e,t){return e&&tB(e,t,iy)}function uoe(e,t){return function(n,r){if(n==null)return n;if(!mp(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var coe=uoe(loe);const ly=coe;function doe(e,t,n,r){return ly(e,function(i,o,a){t(r,i,n(i),a)}),r}function foe(e,t){return function(n,r){var i=Yr(n)?ooe:doe,o=t?t():{};return i(n,e,sy(r),o)}}function X3(e,t,n){(n!==void 0&&!ry(e[t],n)||n===void 0&&!(t in e))&&BS(e,t,n)}function hoe(e){return Io(e)&&mp(e)}function Y3(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function poe(e){return gp(e,oy(e))}function goe(e,t,n,r,i,o,a){var s=Y3(e,n),l=Y3(t,n),u=a.get(l);if(u){X3(e,n,u);return}var c=o?o(s,l,n+"",e,t,a):void 0,d=c===void 0;if(d){var f=Yr(l),h=!f&&Om(l),p=!f&&!h&&ik(l);c=l,f||h||p?Yr(s)?c=s:hoe(s)?c=XL(s):h?(d=!1,c=LF(l,!0)):p?(d=!1,c=VF(l,!0)):c=[]:dF(l)||Rm(l)?(c=s,Rm(s)?c=poe(s):(!Ro(s)||ek(s))&&(c=GF(l))):d=!1}d&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),X3(e,n,c)}function WS(e,t,n,r,i){e!==t&&tB(t,function(o,a){if(i||(i=new ns),Ro(o))goe(e,t,a,n,WS,r,i);else{var s=r?r(Y3(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),X3(e,a,s)}},oy)}function nB(e,t,n,r,i,o){return Ro(e)&&Ro(t)&&(o.set(t,e),WS(e,t,void 0,nB,o),o.delete(t)),e}var moe=nF(function(e,t,n,r){WS(e,t,n,r)});const yoe=moe;var voe=tF(function(e){return e.push(void 0,nB),QL(yoe,void 0,e)});const boe=voe;function _oe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Soe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function xoe(e){return typeof e=="function"?e:FS}function Ea(e,t){var n=Yr(e)?ZL:ly;return n(e,xoe(t))}function woe(e,t){var n=[];return ly(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}function Coe(e,t){var n=Yr(e)?FF:woe;return n(e,sy(t))}var Eoe=Object.prototype,Toe=Eoe.hasOwnProperty;function koe(e,t){return e!=null&&Toe.call(e,t)}function Aoe(e,t){return e!=null&&JF(e,t,koe)}var Poe="[object String]";function hk(e){return typeof e=="string"||!Yr(e)&&Io(e)&&fs(e)==Poe}function Ioe(e,t){return t.length<2?e:sk(e,fF(t,0,-1))}var Roe="[object Boolean]";function Ooe(e){return e===!0||e===!1||Io(e)&&fs(e)==Roe}function pk(e,t){return HS(e,t)}function Moe(e){return typeof e=="number"&&e==KL(e)}var Noe="[object Number]";function rB(e){return typeof e=="number"||Io(e)&&fs(e)==Noe}var $oe="[object RegExp]";function Doe(e){return Io(e)&&fs(e)==$oe}var Q8=ic&&ic.isRegExp,Loe=Q8?jS(Q8):Doe;const Foe=Loe;var Boe=foe(function(e,t,n){BS(e,n,t)});const gk=Boe;var zoe=nF(function(e,t,n){WS(e,t,n)});const joe=zoe;function iB(e,t){return t=GS(t,e),e=Ioe(e,t),e==null||delete e[ay(Soe(t))]}function Uoe(e){return dF(e)?void 0:e}var Voe=1,Goe=2,qoe=4,Hoe=vte(function(e,t){var n={};if(e==null)return n;var r=!1;t=WL(t,function(o){return o=GS(o,e),r||(r=o.length>1),o}),gp(e,UF(e),n),r&&(n=Gg(n,Voe|Goe|qoe,Uoe));for(var i=t.length;i--;)iB(n,t[i]);return n});const KS=Hoe;var Woe=eB("length");const Koe=Woe;var oB="\\ud800-\\udfff",Qoe="\\u0300-\\u036f",Xoe="\\ufe20-\\ufe2f",Yoe="\\u20d0-\\u20ff",Zoe=Qoe+Xoe+Yoe,Joe="\\ufe0e\\ufe0f",eae="["+oB+"]",Z3="["+Zoe+"]",J3="\\ud83c[\\udffb-\\udfff]",tae="(?:"+Z3+"|"+J3+")",aB="[^"+oB+"]",sB="(?:\\ud83c[\\udde6-\\uddff]){2}",lB="[\\ud800-\\udbff][\\udc00-\\udfff]",nae="\\u200d",uB=tae+"?",cB="["+Joe+"]?",rae="(?:"+nae+"(?:"+[aB,sB,lB].join("|")+")"+cB+uB+")*",iae=cB+uB+rae,oae="(?:"+[aB+Z3+"?",Z3,sB,lB,eae].join("|")+")",X8=RegExp(J3+"(?="+J3+")|"+oae+iae,"g");function aae(e){for(var t=X8.lastIndex=0;X8.test(e);)++t;return t}function dB(e){return qS(e)?aae(e):Koe(e)}var sae=Math.floor,lae=Math.random;function uae(e,t){return e+sae(lae()*(t-e+1))}var cae=parseFloat,dae=Math.min,fae=Math.random;function hae(e,t,n){if(n&&typeof n!="boolean"&&zS(e,t,n)&&(t=n=void 0),n===void 0&&(typeof t=="boolean"?(n=t,t=void 0):typeof e=="boolean"&&(n=e,e=void 0)),e===void 0&&t===void 0?(e=0,t=1):(e=uh(e),t===void 0?(t=e,e=0):t=uh(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=fae();return dae(e+i*(t-e+cae("1e-"+((i+"").length-1))),t)}return uae(e,t)}var pae=Math.ceil,gae=Math.max;function mae(e,t,n,r){for(var i=-1,o=gae(pae((t-e)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=n;return a}function yae(e){return function(t,n,r){return r&&typeof r!="number"&&zS(t,n,r)&&(n=r=void 0),t=uh(t),n===void 0?(n=t,t=0):n=uh(n),r=r===void 0?t<n?1:-1:uh(r),mae(t,n,r,e)}}var vae=yae();const bae=vae;function _ae(e,t,n,r,i){return i(e,function(o,a,s){n=r?(r=!1,o):t(n,o,a,s)}),n}function eE(e,t,n){var r=Yr(e)?xF:_ae,i=arguments.length<3;return r(e,sy(t),n,i,ly)}var Sae="[object Map]",xae="[object Set]";function QS(e){if(e==null)return 0;if(mp(e))return hk(e)?dB(e):e.length;var t=Gh(e);return t==Sae||t==xae?e.size:lF(e).length}function wae(e,t){var n;return ly(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function zf(e,t,n){var r=Yr(e)?KF:wae;return n&&zS(e,t,n)&&(t=void 0),r(e,sy(t))}var Cae=Lne(function(e,t,n){return e+(n?" ":"")+SF(t)});const Eae=Cae;var Tae=30,kae="...",Aae=/\w*$/;function Y8(e,t){var n=Tae,r=kae;if(Ro(t)){var i="separator"in t?t.separator:i;n="length"in t?KL(t.length):n,r="omission"in t?Gb(t.omission):r}e=Vh(e);var o=e.length;if(qS(e)){var a=_F(e);o=a.length}if(n>=o)return e;var s=n-dB(r);if(s<1)return r;var l=a?hF(a,0,s).join(""):e.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),Foe(i)){if(e.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Vh(Aae.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(e.indexOf(Gb(i),s)!=s){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}var Pae=1/0,Iae=dh&&1/fk(new dh([,-0]))[1]==Pae?function(e){return new dh(e)}:_J;const Rae=Iae;var Oae=200;function Mae(e,t,n){var r=-1,i=NJ,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=_oe;else if(o>=Oae){var u=t?null:Rae(e);if(u)return fk(u);a=!1,i=QF,l=new $m}else l=t?[]:s;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}function tE(e,t){return e&&e.length?Mae(e,sy(t)):[]}function Z8(e,t){return e==null?!0:iB(e,t)}const fB={shouldUpdateImagesOnConnect:!1,shouldFetchMetadataFromApi:!1,disabledTabs:[],disabledFeatures:["lightbox","faceRestore","batches"],disabledSDFeatures:["variation","symmetry","hires","perlinNoise","noiseThreshold"],nodesAllowlist:void 0,nodesDenylist:void 0,canRestoreDeletedImagesFromBin:!0,sd:{disabledControlNetModels:[],disabledControlNetProcessors:[],iterations:{initial:1,min:1,sliderMax:1e3,inputMax:1e4,fineStep:1,coarseStep:1},width:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},height:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},steps:{initial:30,min:1,sliderMax:100,inputMax:500,fineStep:1,coarseStep:1},guidance:{initial:7,min:1,sliderMax:20,inputMax:200,fineStep:.1,coarseStep:.5},img2imgStrength:{initial:.7,min:0,sliderMax:1,inputMax:1,fineStep:.01,coarseStep:.05},dynamicPrompts:{maxPrompts:{initial:100,min:1,sliderMax:1e3,inputMax:1e4}}}},hB=rr({name:"config",initialState:fB,reducers:{configChanged:(e,t)=>{joe(e,t.payload)}}}),{configChanged:Nae}=hB.actions,$ae=hB.reducer,oUe={any:"Any","sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},aUe={any:"Any","sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},Dae={any:{maxClip:0,markers:[]},"sd-1":{maxClip:12,markers:[0,1,2,3,4,8,12]},"sd-2":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},sdxl:{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},"sdxl-refiner":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]}},sUe={lycoris:"LyCORIS",diffusers:"Diffusers"},Lae=0,qg=4294967295;var Yt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Yt||(Yt={}));var nE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(nE||(nE={}));const Re=Yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Tu=e=>{switch(typeof e){case"undefined":return Re.undefined;case"string":return Re.string;case"number":return isNaN(e)?Re.nan:Re.number;case"boolean":return Re.boolean;case"function":return Re.function;case"bigint":return Re.bigint;case"symbol":return Re.symbol;case"object":return Array.isArray(e)?Re.array:e===null?Re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Re.promise:typeof Map<"u"&&e instanceof Map?Re.map:typeof Set<"u"&&e instanceof Set?Re.set:typeof Date<"u"&&e instanceof Date?Re.date:Re.object;default:return Re.unknown}},he=Yt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Fae=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class rs extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}rs.create=e=>new rs(e);const Dm=(e,t)=>{let n;switch(e.code){case he.invalid_type:e.received===Re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case he.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Yt.jsonStringifyReplacer)}`;break;case he.unrecognized_keys:n=`Unrecognized key(s) in object: ${Yt.joinValues(e.keys,", ")}`;break;case he.invalid_union:n="Invalid input";break;case he.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Yt.joinValues(e.options)}`;break;case he.invalid_enum_value:n=`Invalid enum value. Expected ${Yt.joinValues(e.options)}, received '${e.received}'`;break;case he.invalid_arguments:n="Invalid function arguments";break;case he.invalid_return_type:n="Invalid function return type";break;case he.invalid_date:n="Invalid date";break;case he.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case he.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case he.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case he.custom:n="Invalid input";break;case he.invalid_intersection_types:n="Intersection results could not be merged";break;case he.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case he.not_finite:n="Number must be finite";break;default:n=t.defaultError,Yt.assertNever(e)}return{message:n}};let pB=Dm;function Bae(e){pB=e}function Wb(){return pB}const Kb=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}},zae=[];function Me(e,t){const n=Kb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Wb(),Dm].filter(r=>!!r)});e.common.issues.push(n)}class Ki{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return vt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Ki.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return vt;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const vt=Object.freeze({status:"aborted"}),gB=e=>({status:"dirty",value:e}),so=e=>({status:"valid",value:e}),rE=e=>e.status==="aborted",iE=e=>e.status==="dirty",Lm=e=>e.status==="valid",Qb=e=>typeof Promise<"u"&&e instanceof Promise;var rt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(rt||(rt={}));class Xs{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const J8=(e,t)=>{if(Lm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new rs(e.common.issues);return this._error=n,this._error}}};function xt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>a.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class Et{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Tu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Tu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ki,ctx:{common:t.parent.common,data:t.data,parsedType:Tu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Qb(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return J8(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Qb(i)?i:Promise.resolve(i));return J8(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:he.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new ls({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return $l.create(this,this._def)}nullable(){return Id.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return is.create(this,this._def)}promise(){return Hh.create(this,this._def)}or(t){return jm.create([this,t],this._def)}and(t){return Um.create(this,t,this._def)}transform(t){return new ls({...xt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Wm({...xt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new yB({typeName:lt.ZodBranded,type:this,...xt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Jb({...xt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return uy.create(this,t)}readonly(){return t_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jae=/^c[^\s-]{8,}$/i,Uae=/^[a-z][a-z0-9]*$/,Vae=/[0-9A-HJKMNP-TV-Z]{26}/,Gae=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qae=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hae=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,Wae=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Kae=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Qae=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Xae(e,t){return!!((t==="v4"||!t)&&Wae.test(e)||(t==="v6"||!t)&&Kae.test(e))}class Za extends Et{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:he.invalid_string,...rt.errToObj(r)}),this.nonempty=t=>this.min(1,rt.errToObj(t)),this.trim=()=>new Za({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Za({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Za({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Re.string){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.string,received:o.parsedType}),vt}const r=new Ki;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?Me(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&Me(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")qae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"email",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Hae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"emoji",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Gae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"uuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")jae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"cuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Uae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"cuid2",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Vae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"ulid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Me(i,{validation:"url",code:he.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"regex",code:he.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Qae(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Xae(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"ip",code:he.invalid_string,message:o.message}),r.dirty()):Yt.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Za({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...rt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...rt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...rt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...rt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...rt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...rt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...rt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...rt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...rt.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...rt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...rt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...rt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...rt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...rt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...rt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...rt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Za.create=e=>{var t;return new Za({checks:[],typeName:lt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xt(e)})};function Yae(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class oc extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Re.number){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.number,received:o.parsedType}),vt}let r;const i=new Ki;for(const o of this._def.checks)o.kind==="int"?Yt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Me(r,{code:he.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Yae(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Me(r,{code:he.not_finite,message:o.message}),i.dirty()):Yt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,rt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,rt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,rt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,rt.toString(n))}setLimit(t,n,r,i){return new oc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:rt.toString(i)}]})}_addCheck(t){return new oc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:rt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:rt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:rt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Yt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}oc.create=e=>new oc({checks:[],typeName:lt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...xt(e)});class ac extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Re.bigint){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.bigint,received:o.parsedType}),vt}let r;const i=new Ki;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Yt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,rt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,rt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,rt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,rt.toString(n))}setLimit(t,n,r,i){return new ac({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:rt.toString(i)}]})}_addCheck(t){return new ac({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:rt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ac.create=e=>{var t;return new ac({checks:[],typeName:lt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xt(e)})};class Fm extends Et{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Re.boolean){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.boolean,received:r.parsedType}),vt}return so(t.data)}}Fm.create=e=>new Fm({typeName:lt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...xt(e)});class Ad extends Et{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Re.date){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.date,received:o.parsedType}),vt}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_date}),vt}const r=new Ki;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Yt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ad({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:rt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:rt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Ad.create=e=>new Ad({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:lt.ZodDate,...xt(e)});class Xb extends Et{_parse(t){if(this._getType(t)!==Re.symbol){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.symbol,received:r.parsedType}),vt}return so(t.data)}}Xb.create=e=>new Xb({typeName:lt.ZodSymbol,...xt(e)});class Bm extends Et{_parse(t){if(this._getType(t)!==Re.undefined){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.undefined,received:r.parsedType}),vt}return so(t.data)}}Bm.create=e=>new Bm({typeName:lt.ZodUndefined,...xt(e)});class zm extends Et{_parse(t){if(this._getType(t)!==Re.null){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.null,received:r.parsedType}),vt}return so(t.data)}}zm.create=e=>new zm({typeName:lt.ZodNull,...xt(e)});class qh extends Et{constructor(){super(...arguments),this._any=!0}_parse(t){return so(t.data)}}qh.create=e=>new qh({typeName:lt.ZodAny,...xt(e)});class pd extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(t){return so(t.data)}}pd.create=e=>new pd({typeName:lt.ZodUnknown,...xt(e)});class Hl extends Et{_parse(t){const n=this._getOrReturnCtx(t);return Me(n,{code:he.invalid_type,expected:Re.never,received:n.parsedType}),vt}}Hl.create=e=>new Hl({typeName:lt.ZodNever,...xt(e)});class Yb extends Et{_parse(t){if(this._getType(t)!==Re.undefined){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.void,received:r.parsedType}),vt}return so(t.data)}}Yb.create=e=>new Yb({typeName:lt.ZodVoid,...xt(e)});class is extends Et{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Re.array)return Me(n,{code:he.invalid_type,expected:Re.array,received:n.parsedType}),vt;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(Me(n,{code:a?he.too_big:he.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Me(n,{code:he.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Me(n,{code:he.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new Xs(n,a,n.path,s)))).then(a=>Ki.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Xs(n,a,n.path,s)));return Ki.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new is({...this._def,minLength:{value:t,message:rt.toString(n)}})}max(t,n){return new is({...this._def,maxLength:{value:t,message:rt.toString(n)}})}length(t,n){return new is({...this._def,exactLength:{value:t,message:rt.toString(n)}})}nonempty(t){return this.min(1,t)}}is.create=(e,t)=>new is({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...xt(t)});function wf(e){if(e instanceof sr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$l.create(wf(r))}return new sr({...e._def,shape:()=>t})}else return e instanceof is?new is({...e._def,type:wf(e.element)}):e instanceof $l?$l.create(wf(e.unwrap())):e instanceof Id?Id.create(wf(e.unwrap())):e instanceof Ys?Ys.create(e.items.map(t=>wf(t))):e}class sr extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Yt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Re.object){const u=this._getOrReturnCtx(t);return Me(u,{code:he.invalid_type,expected:Re.object,received:u.parsedType}),vt}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Hl&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Xs(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Hl){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(Me(i,{code:he.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Xs(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key;u.push({key:d,value:await c.value,alwaysSet:c.alwaysSet})}return u}).then(u=>Ki.mergeObjectSync(r,u)):Ki.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return rt.errToObj,new sr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=rt.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new sr({...this._def,unknownKeys:"strip"})}passthrough(){return new sr({...this._def,unknownKeys:"passthrough"})}extend(t){return new sr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new sr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:lt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new sr({...this._def,catchall:t})}pick(t){const n={};return Yt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new sr({...this._def,shape:()=>n})}omit(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new sr({...this._def,shape:()=>n})}deepPartial(){return wf(this)}partial(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new sr({...this._def,shape:()=>n})}required(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof $l;)o=o._def.innerType;n[r]=o}}),new sr({...this._def,shape:()=>n})}keyof(){return mB(Yt.objectKeys(this.shape))}}sr.create=(e,t)=>new sr({shape:()=>e,unknownKeys:"strip",catchall:Hl.create(),typeName:lt.ZodObject,...xt(t)});sr.strictCreate=(e,t)=>new sr({shape:()=>e,unknownKeys:"strict",catchall:Hl.create(),typeName:lt.ZodObject,...xt(t)});sr.lazycreate=(e,t)=>new sr({shape:e,unknownKeys:"strip",catchall:Hl.create(),typeName:lt.ZodObject,...xt(t)});class jm extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new rs(s.ctx.common.issues));return Me(n,{code:he.invalid_union,unionErrors:a}),vt}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new rs(l));return Me(n,{code:he.invalid_union,unionErrors:s}),vt}}get options(){return this._def.options}}jm.create=(e,t)=>new jm({options:e,typeName:lt.ZodUnion,...xt(t)});const N1=e=>e instanceof Gm?N1(e.schema):e instanceof ls?N1(e.innerType()):e instanceof qm?[e.value]:e instanceof sc?e.options:e instanceof Hm?Object.keys(e.enum):e instanceof Wm?N1(e._def.innerType):e instanceof Bm?[void 0]:e instanceof zm?[null]:null;class XS extends Et{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.object)return Me(n,{code:he.invalid_type,expected:Re.object,received:n.parsedType}),vt;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Me(n,{code:he.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),vt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=N1(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new XS({typeName:lt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...xt(r)})}}function oE(e,t){const n=Tu(e),r=Tu(t);if(e===t)return{valid:!0,data:e};if(n===Re.object&&r===Re.object){const i=Yt.objectKeys(t),o=Yt.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=oE(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===Re.array&&r===Re.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=oE(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Re.date&&r===Re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Um extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(rE(o)||rE(a))return vt;const s=oE(o.value,a.value);return s.valid?((iE(o)||iE(a))&&n.dirty(),{status:n.value,value:s.data}):(Me(r,{code:he.invalid_intersection_types}),vt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Um.create=(e,t,n)=>new Um({left:e,right:t,typeName:lt.ZodIntersection,...xt(n)});class Ys extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.array)return Me(r,{code:he.invalid_type,expected:Re.array,received:r.parsedType}),vt;if(r.data.length<this._def.items.length)return Me(r,{code:he.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&r.data.length>this._def.items.length&&(Me(r,{code:he.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Xs(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ki.mergeArray(n,a)):Ki.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ys({...this._def,rest:t})}}Ys.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ys({items:e,typeName:lt.ZodTuple,rest:null,...xt(t)})};class Vm extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.object)return Me(r,{code:he.invalid_type,expected:Re.object,received:r.parsedType}),vt;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Xs(r,s,r.path,s)),value:a._parse(new Xs(r,r.data[s],r.path,s))});return r.common.async?Ki.mergeObjectAsync(n,i):Ki.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Et?new Vm({keyType:t,valueType:n,typeName:lt.ZodRecord,...xt(r)}):new Vm({keyType:Za.create(),valueType:t,typeName:lt.ZodRecord,...xt(n)})}}class Zb extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.map)return Me(r,{code:he.invalid_type,expected:Re.map,received:r.parsedType}),vt;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],u)=>({key:i._parse(new Xs(r,s,r.path,[u,"key"])),value:o._parse(new Xs(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return vt;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return vt;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}Zb.create=(e,t,n)=>new Zb({valueType:t,keyType:e,typeName:lt.ZodMap,...xt(n)});class Pd extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.set)return Me(r,{code:he.invalid_type,expected:Re.set,received:r.parsedType}),vt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Me(r,{code:he.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Me(r,{code:he.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return vt;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>o._parse(new Xs(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new Pd({...this._def,minSize:{value:t,message:rt.toString(n)}})}max(t,n){return new Pd({...this._def,maxSize:{value:t,message:rt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Pd.create=(e,t)=>new Pd({valueType:e,minSize:null,maxSize:null,typeName:lt.ZodSet,...xt(t)});class fh extends Et{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.function)return Me(n,{code:he.invalid_type,expected:Re.function,received:n.parsedType}),vt;function r(s,l){return Kb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Wb(),Dm].filter(u=>!!u),issueData:{code:he.invalid_arguments,argumentsError:l}})}function i(s,l){return Kb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Wb(),Dm].filter(u=>!!u),issueData:{code:he.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Hh){const s=this;return so(async function(...l){const u=new rs([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const s=this;return so(function(...l){const u=s._def.args.safeParse(l,o);if(!u.success)throw new rs([r(l,u.error)]);const c=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new rs([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new fh({...this._def,args:Ys.create(t).rest(pd.create())})}returns(t){return new fh({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new fh({args:t||Ys.create([]).rest(pd.create()),returns:n||pd.create(),typeName:lt.ZodFunction,...xt(r)})}}class Gm extends Et{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Gm.create=(e,t)=>new Gm({getter:e,typeName:lt.ZodLazy,...xt(t)});class qm extends Et{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Me(n,{received:n.data,code:he.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:t.data}}get value(){return this._def.value}}qm.create=(e,t)=>new qm({value:e,typeName:lt.ZodLiteral,...xt(t)});function mB(e,t){return new sc({values:e,typeName:lt.ZodEnum,...xt(t)})}class sc extends Et{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Me(n,{expected:Yt.joinValues(r),received:n.parsedType,code:he.invalid_type}),vt}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Me(n,{received:n.data,code:he.invalid_enum_value,options:r}),vt}return so(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return sc.create(t)}exclude(t){return sc.create(this.options.filter(n=>!t.includes(n)))}}sc.create=mB;class Hm extends Et{_parse(t){const n=Yt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Re.string&&r.parsedType!==Re.number){const i=Yt.objectValues(n);return Me(r,{expected:Yt.joinValues(i),received:r.parsedType,code:he.invalid_type}),vt}if(n.indexOf(t.data)===-1){const i=Yt.objectValues(n);return Me(r,{received:r.data,code:he.invalid_enum_value,options:i}),vt}return so(t.data)}get enum(){return this._def.values}}Hm.create=(e,t)=>new Hm({values:e,typeName:lt.ZodNativeEnum,...xt(t)});class Hh extends Et{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.promise&&n.common.async===!1)return Me(n,{code:he.invalid_type,expected:Re.promise,received:n.parsedType}),vt;const r=n.parsedType===Re.promise?n.data:Promise.resolve(n.data);return so(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Hh.create=(e,t)=>new Hh({type:e,typeName:lt.ZodPromise,...xt(t)});class ls extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{Me(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?vt:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?vt:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Lm(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Lm(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);Yt.assertNever(i)}}ls.create=(e,t,n)=>new ls({schema:e,typeName:lt.ZodEffects,effect:t,...xt(n)});ls.createWithPreprocess=(e,t,n)=>new ls({schema:t,effect:{type:"preprocess",transform:e},typeName:lt.ZodEffects,...xt(n)});class $l extends Et{_parse(t){return this._getType(t)===Re.undefined?so(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$l.create=(e,t)=>new $l({innerType:e,typeName:lt.ZodOptional,...xt(t)});class Id extends Et{_parse(t){return this._getType(t)===Re.null?so(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Id.create=(e,t)=>new Id({innerType:e,typeName:lt.ZodNullable,...xt(t)});class Wm extends Et{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Re.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Wm.create=(e,t)=>new Wm({innerType:e,typeName:lt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xt(t)});class Jb extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Qb(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new rs(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new rs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Jb.create=(e,t)=>new Jb({innerType:e,typeName:lt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xt(t)});class e_ extends Et{_parse(t){if(this._getType(t)!==Re.nan){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.nan,received:r.parsedType}),vt}return{status:"valid",value:t.data}}}e_.create=e=>new e_({typeName:lt.ZodNaN,...xt(e)});const Zae=Symbol("zod_brand");class yB extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class uy extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?vt:o.status==="dirty"?(n.dirty(),gB(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?vt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new uy({in:t,out:n,typeName:lt.ZodPipeline})}}class t_ extends Et{_parse(t){const n=this._def.innerType._parse(t);return Lm(n)&&(n.value=Object.freeze(n.value)),n}}t_.create=(e,t)=>new t_({innerType:e,typeName:lt.ZodReadonly,...xt(t)});const vB=(e,t={},n)=>e?qh.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):qh.create(),Jae={object:sr.lazycreate};var lt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(lt||(lt={}));const ese=(e,t={message:`Input not instance of ${e.name}`})=>vB(n=>n instanceof e,t),bB=Za.create,_B=oc.create,tse=e_.create,nse=ac.create,SB=Fm.create,rse=Ad.create,ise=Xb.create,ose=Bm.create,ase=zm.create,sse=qh.create,lse=pd.create,use=Hl.create,cse=Yb.create,dse=is.create,fse=sr.create,hse=sr.strictCreate,pse=jm.create,gse=XS.create,mse=Um.create,yse=Ys.create,vse=Vm.create,bse=Zb.create,_se=Pd.create,Sse=fh.create,xse=Gm.create,wse=qm.create,Cse=sc.create,Ese=Hm.create,Tse=Hh.create,eI=ls.create,kse=$l.create,Ase=Id.create,Pse=ls.createWithPreprocess,Ise=uy.create,Rse=()=>bB().optional(),Ose=()=>_B().optional(),Mse=()=>SB().optional(),Nse={string:e=>Za.create({...e,coerce:!0}),number:e=>oc.create({...e,coerce:!0}),boolean:e=>Fm.create({...e,coerce:!0}),bigint:e=>ac.create({...e,coerce:!0}),date:e=>Ad.create({...e,coerce:!0})},$se=vt;var z=Object.freeze({__proto__:null,defaultErrorMap:Dm,setErrorMap:Bae,getErrorMap:Wb,makeIssue:Kb,EMPTY_PATH:zae,addIssueToContext:Me,ParseStatus:Ki,INVALID:vt,DIRTY:gB,OK:so,isAborted:rE,isDirty:iE,isValid:Lm,isAsync:Qb,get util(){return Yt},get objectUtil(){return nE},ZodParsedType:Re,getParsedType:Tu,ZodType:Et,ZodString:Za,ZodNumber:oc,ZodBigInt:ac,ZodBoolean:Fm,ZodDate:Ad,ZodSymbol:Xb,ZodUndefined:Bm,ZodNull:zm,ZodAny:qh,ZodUnknown:pd,ZodNever:Hl,ZodVoid:Yb,ZodArray:is,ZodObject:sr,ZodUnion:jm,ZodDiscriminatedUnion:XS,ZodIntersection:Um,ZodTuple:Ys,ZodRecord:Vm,ZodMap:Zb,ZodSet:Pd,ZodFunction:fh,ZodLazy:Gm,ZodLiteral:qm,ZodEnum:sc,ZodNativeEnum:Hm,ZodPromise:Hh,ZodEffects:ls,ZodTransformer:ls,ZodOptional:$l,ZodNullable:Id,ZodDefault:Wm,ZodCatch:Jb,ZodNaN:e_,BRAND:Zae,ZodBranded:yB,ZodPipeline:uy,ZodReadonly:t_,custom:vB,Schema:Et,ZodSchema:Et,late:Jae,get ZodFirstPartyTypeKind(){return lt},coerce:Nse,any:sse,array:dse,bigint:nse,boolean:SB,date:rse,discriminatedUnion:gse,effect:eI,enum:Cse,function:Sse,instanceof:ese,intersection:mse,lazy:xse,literal:wse,map:bse,nan:tse,nativeEnum:Ese,never:use,null:ase,nullable:Ase,number:_B,object:fse,oboolean:Mse,onumber:Ose,optional:kse,ostring:Rse,pipeline:Ise,preprocess:Pse,promise:Tse,record:vse,set:_se,strictObject:hse,string:bB,symbol:ise,transformer:eI,tuple:yse,undefined:ose,union:pse,unknown:lse,void:cse,NEVER:$se,ZodIssueCode:he,quotelessJson:Fae,ZodError:rs});const Dse=z.string(),lUe=e=>Dse.safeParse(e).success,Lse=z.string(),uUe=e=>Lse.safeParse(e).success,Fse=z.string(),cUe=e=>Fse.safeParse(e).success,Bse=z.string(),dUe=e=>Bse.safeParse(e).success,zse=z.number().int().min(1),fUe=e=>zse.safeParse(e).success,jse=z.number().min(1),hUe=e=>jse.safeParse(e).success,xB=z.enum(["euler","deis","ddim","ddpm","dpmpp_2s","dpmpp_2m","dpmpp_2m_sde","dpmpp_sde","heun","kdpm_2","lms","pndm","unipc","euler_k","dpmpp_2s_k","dpmpp_2m_k","dpmpp_2m_sde_k","dpmpp_sde_k","heun_k","lms_k","euler_a","kdpm_2_a"]),pUe=e=>xB.safeParse(e).success,gUe={euler:"Euler",deis:"DEIS",ddim:"DDIM",ddpm:"DDPM",dpmpp_sde:"DPM++ SDE",dpmpp_2s:"DPM++ 2S",dpmpp_2m:"DPM++ 2M",dpmpp_2m_sde:"DPM++ 2M SDE",heun:"Heun",kdpm_2:"KDPM 2",lms:"LMS",pndm:"PNDM",unipc:"UniPC",euler_k:"Euler Karras",dpmpp_sde_k:"DPM++ SDE Karras",dpmpp_2s_k:"DPM++ 2S Karras",dpmpp_2m_k:"DPM++ 2M Karras",dpmpp_2m_sde_k:"DPM++ 2M SDE Karras",heun_k:"Heun Karras",lms_k:"LMS Karras",euler_a:"Euler Ancestral",kdpm_2_a:"KDPM 2 Ancestral"},Use=z.number().int().min(0).max(qg),mUe=e=>Use.safeParse(e).success,Vse=z.number().multipleOf(8).min(64),yUe=e=>Vse.safeParse(e).success,Gse=z.number().multipleOf(8).min(64),vUe=e=>Gse.safeParse(e).success,xc=z.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),YS=z.object({model_name:z.string().min(1),base_model:xc,model_type:z.literal("main")}),bUe=e=>YS.safeParse(e).success,mk=z.object({model_name:z.string().min(1),base_model:z.literal("sdxl-refiner"),model_type:z.literal("main")}),_Ue=e=>mk.safeParse(e).success,wB=z.object({model_name:z.string().min(1),base_model:xc,model_type:z.literal("onnx")}),cy=z.union([YS,wB]),qse=z.object({model_name:z.string().min(1),base_model:xc}),Hse=z.object({model_name:z.string().min(1),base_model:xc}),SUe=e=>Hse.safeParse(e).success,Wse=z.object({model_name:z.string().min(1),base_model:xc}),xUe=e=>Wse.safeParse(e).success,Kse=z.object({model_name:z.string().min(1),base_model:xc}),wUe=z.object({model_name:z.string().min(1),base_model:xc}),CUe=e=>Kse.safeParse(e).success,Qse=z.number().min(0).max(1),EUe=e=>Qse.safeParse(e).success;z.enum(["fp16","fp32"]);const Xse=z.number().min(1).max(10),TUe=e=>Xse.safeParse(e).success,Yse=z.number().min(1).max(10),kUe=e=>Yse.safeParse(e).success,Zse=z.number().min(0).max(1),AUe=e=>Zse.safeParse(e).success;z.enum(["box","gaussian"]);z.enum(["unmasked","mask","edge"]);const yk={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,perlin:0,positivePrompt:"",negativePrompt:"",scheduler:"euler",maskBlur:16,maskBlurMethod:"box",canvasCoherenceMode:"unmasked",canvasCoherenceSteps:20,canvasCoherenceStrength:.3,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,infillTileSize:32,infillPatchmatchDownscaleSize:1,variationAmount:.1,width:512,shouldUseSymmetry:!1,horizontalSymmetrySteps:0,verticalSymmetrySteps:0,model:null,vae:null,vaePrecision:"fp32",seamlessXAxis:!1,seamlessYAxis:!1,clipSkip:0,shouldUseCpuNoise:!0,shouldShowAdvancedOptions:!1,aspectRatio:null,shouldLockAspectRatio:!1},Jse=yk,CB=rr({name:"generation",initialState:Jse,reducers:{setPositivePrompt:(e,t)=>{e.positivePrompt=t.payload},setNegativePrompt:(e,t)=>{e.negativePrompt=t.payload},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},clampSymmetrySteps:e=>{e.horizontalSymmetrySteps=Nu(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=Nu(e.verticalSymmetrySteps,0,e.steps)},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},toggleSize:e=>{const[t,n]=[e.width,e.height];e.width=n,e.height=t},setScheduler:(e,t)=>{e.scheduler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setSeamlessXAxis:(e,t)=>{e.seamlessXAxis=t.payload},setSeamlessYAxis:(e,t)=>{e.seamlessYAxis=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},resetParametersState:e=>({...e,...yk}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setMaskBlur:(e,t)=>{e.maskBlur=t.payload},setMaskBlurMethod:(e,t)=>{e.maskBlurMethod=t.payload},setCanvasCoherenceMode:(e,t)=>{e.canvasCoherenceMode=t.payload},setCanvasCoherenceSteps:(e,t)=>{e.canvasCoherenceSteps=t.payload},setCanvasCoherenceStrength:(e,t)=>{e.canvasCoherenceStrength=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setInfillTileSize:(e,t)=>{e.infillTileSize=t.payload},setInfillPatchmatchDownscaleSize:(e,t)=>{e.infillPatchmatchDownscaleSize=t.payload},setShouldUseSymmetry:(e,t)=>{e.shouldUseSymmetry=t.payload},setHorizontalSymmetrySteps:(e,t)=>{e.horizontalSymmetrySteps=t.payload},setVerticalSymmetrySteps:(e,t)=>{e.verticalSymmetrySteps=t.payload},initialImageChanged:(e,t)=>{const{image_name:n,width:r,height:i}=t.payload;e.initialImage={imageName:n,width:r,height:i}},modelChanged:(e,t)=>{if(e.model=t.payload,e.model===null)return;const{maxClip:n}=Dae[e.model.base_model];e.clipSkip=Nu(e.clipSkip,0,n)},vaeSelected:(e,t)=>{e.vae=t.payload},vaePrecisionChanged:(e,t)=>{e.vaePrecision=t.payload},setClipSkip:(e,t)=>{e.clipSkip=t.payload},shouldUseCpuNoiseChanged:(e,t)=>{e.shouldUseCpuNoise=t.payload},setAspectRatio:(e,t)=>{const n=t.payload;e.aspectRatio=n,n&&(e.height=Wa(e.width/n,8))},setShouldLockAspectRatio:(e,t)=>{e.shouldLockAspectRatio=t.payload}},extraReducers:e=>{e.addCase(Nae,(t,n)=>{var i;const r=(i=n.payload.sd)==null?void 0:i.defaultModel;if(r&&!t.model){const[o,a,s]=r.split("/"),l=YS.safeParse({model_name:s,base_model:o,model_type:a});l.success&&(t.model=l.data)}})}}),{clampSymmetrySteps:PUe,clearInitialImage:vk,resetParametersState:IUe,resetSeed:RUe,setCfgScale:OUe,setWidth:tI,setHeight:nI,toggleSize:MUe,setImg2imgStrength:NUe,setInfillMethod:ele,setIterations:$Ue,setPerlin:DUe,setPositivePrompt:tle,setNegativePrompt:LUe,setScheduler:FUe,setMaskBlur:BUe,setMaskBlurMethod:zUe,setCanvasCoherenceMode:jUe,setCanvasCoherenceSteps:UUe,setCanvasCoherenceStrength:VUe,setSeed:GUe,setSeedWeights:qUe,setShouldFitToWidthHeight:HUe,setShouldGenerateVariations:WUe,setShouldRandomizeSeed:KUe,setSteps:QUe,setThreshold:XUe,setInfillTileSize:YUe,setInfillPatchmatchDownscaleSize:ZUe,setVariationAmount:JUe,setShouldUseSymmetry:eVe,setHorizontalSymmetrySteps:tVe,setVerticalSymmetrySteps:nVe,initialImageChanged:ZS,modelChanged:$u,vaeSelected:EB,setSeamlessXAxis:rVe,setSeamlessYAxis:iVe,setClipSkip:oVe,shouldUseCpuNoiseChanged:aVe,setAspectRatio:nle,setShouldLockAspectRatio:sVe,vaePrecisionChanged:lVe}=CB.actions,rle=CB.reducer,cv=(e,t,n,r,i,o,a)=>{const s=Math.floor(e/2-(n+i/2)*a),l=Math.floor(t/2-(r+o/2)*a);return{x:s,y:l}},dv=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r,s=Math.min(1,Math.min(o,a));return s||1},uVe=.999,cVe=.1,dVe=20,fv=.95,fVe=30,hVe=10,ile=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),af=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a<i;)if(s+=64,t===n){r.width=512,r.height=512;break}else o>1?(r.width=s,r.height=Wa(s/o,64)):o<1&&(r.height=s,r.width=Wa(s*o,64)),a=r.width*r.height;return r},ole=e=>({width:Wa(e.width,64),height:Wa(e.height,64)}),pVe=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],gVe=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],TB=e=>e.kind==="line"&&e.layer==="mask",mVe=e=>e.kind==="line"&&e.layer==="base",ale=e=>e.kind==="image"&&e.layer==="base",yVe=e=>e.kind==="fillRect"&&e.layer==="base",vVe=e=>e.kind==="eraseRect"&&e.layer==="base",sle=e=>e.kind==="line",vg={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},kB={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"none",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,futureLayerStates:[],isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:vg,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAntialias:!0,shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush",batchIds:[]},AB=rr({name:"canvas",initialState:kB,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(Cn(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!TB(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{width:r,height:i}=n,{stageDimensions:o}=e,a={width:lv(Nu(r,64,512),64),height:lv(Nu(i,64,512),64)},s={x:Wa(r/2-a.width/2,64),y:Wa(i/2-a.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const c=af(a);e.scaledBoundingBoxDimensions=c}e.boundingBoxDimensions=a,e.boundingBoxCoordinates=s,e.pastLayerStates.push(Cn(e.layerState)),e.layerState={...Cn(vg),objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[],e.batchIds=[];const l=dv(o.width,o.height,r,i,fv),u=cv(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=u},setBoundingBoxDimensions:(e,t)=>{const n=ole(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=af(n);e.scaledBoundingBoxDimensions=r}},flipBoundingBoxAxes:e=>{const[t,n]=[e.boundingBoxDimensions.width,e.boundingBoxDimensions.height],[r,i]=[e.scaledBoundingBoxDimensions.width,e.scaledBoundingBoxDimensions.height];e.boundingBoxDimensions={width:n,height:t},e.scaledBoundingBoxDimensions={width:i,height:r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=ile(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},canvasBatchIdAdded:(e,t)=>{e.batchIds.push(t.payload)},canvasBatchIdsReset:e=>{e.batchIds=[]},stagingAreaInitialized:(e,t)=>{const{boundingBox:n}=t.payload;e.layerState.stagingArea={boundingBox:n,images:[],selectedImageIndex:-1}},addImageToStagingArea:(e,t)=>{const n=t.payload;!n||!e.layerState.stagingArea.boundingBox||(e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...e.layerState.stagingArea.boundingBox,imageName:n.image_name}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea=Cn(Cn(vg)).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(sle);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Cn(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(Cn(e.layerState)),e.layerState=Cn(vg),e.futureLayerStates=[],e.batchIds=[]},canvasResized:(e,t)=>{const{width:n,height:r}=t.payload,i={width:Math.floor(n),height:Math.floor(r)};if(e.stageDimensions=i,!e.layerState.objects.find(ale)){const o=dv(i.width,i.height,512,512,fv),a=cv(i.width,i.height,0,0,512,512,o),s={width:512,height:512};if(e.stageScale=o,e.stageCoordinates=a,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=s,e.boundingBoxScaleMethod==="auto"){const l=af(s);e.scaledBoundingBoxDimensions=l}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const c=r?1:dv(i,o,l,u,fv),d=cv(i,o,a,s,l,u,c);e.stageScale=c,e.stageCoordinates=d}else{const c=dv(i,o,512,512,fv),d=cv(i,o,0,0,512,512,c),f={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=d,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,e.boundingBoxScaleMethod==="auto"){const h=af(f);e.scaledBoundingBoxDimensions=h}}},nextStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex+1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t>n?0:t},prevStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex-1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t<0?n:t},commitStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const r=t[n];r&&e.layerState.objects.push({...r}),e.layerState.stagingArea=Cn(vg).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:lv(Nu(o,64,512),64),height:lv(Nu(a,64,512),64)},l={x:Wa(o/2-s.width/2,64),y:Wa(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=af(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=af(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldAntialias:(e,t)=>{e.shouldAntialias=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(Cn(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}},extraReducers:e=>{e.addCase(nle,(t,n)=>{const r=n.payload;r&&(t.boundingBoxDimensions.height=Wa(t.boundingBoxDimensions.width/r,64),t.scaledBoundingBoxDimensions.height=Wa(t.scaledBoundingBoxDimensions.width/r,64))})}}),{addEraseRect:bVe,addFillRect:_Ve,addImageToStagingArea:lle,addLine:SVe,addPointToCurrentLine:xVe,clearCanvasHistory:wVe,clearMask:CVe,commitColorPickerColor:EVe,commitStagingAreaImage:ule,discardStagedImages:cle,fitBoundingBoxToStage:TVe,mouseLeftCanvas:kVe,nextStagingAreaImage:AVe,prevStagingAreaImage:PVe,redo:IVe,resetCanvas:bk,resetCanvasInteractionState:RVe,resetCanvasView:OVe,setBoundingBoxCoordinates:MVe,setBoundingBoxDimensions:rI,setBoundingBoxPreviewFill:NVe,setBoundingBoxScaleMethod:$Ve,flipBoundingBoxAxes:DVe,setBrushColor:LVe,setBrushSize:FVe,setColorPickerColor:BVe,setCursorPosition:zVe,setInitialCanvasImage:PB,setIsDrawing:jVe,setIsMaskEnabled:UVe,setIsMouseOverBoundingBox:VVe,setIsMoveBoundingBoxKeyHeld:GVe,setIsMoveStageKeyHeld:qVe,setIsMovingBoundingBox:HVe,setIsMovingStage:WVe,setIsTransformingBoundingBox:KVe,setLayer:QVe,setMaskColor:XVe,setMergedCanvas:dle,setShouldAutoSave:YVe,setShouldCropToBoundingBoxOnSave:ZVe,setShouldDarkenOutsideBoundingBox:JVe,setShouldLockBoundingBox:eGe,setShouldPreserveMaskedArea:tGe,setShouldShowBoundingBox:nGe,setShouldShowBrush:rGe,setShouldShowBrushPreview:iGe,setShouldShowCanvasDebugInfo:oGe,setShouldShowCheckboardTransparency:aGe,setShouldShowGrid:sGe,setShouldShowIntermediates:lGe,setShouldShowStagingImage:uGe,setShouldShowStagingOutline:cGe,setShouldSnapToGrid:dGe,setStageCoordinates:fGe,setStageScale:hGe,setTool:pGe,toggleShouldLockBoundingBox:gGe,toggleTool:mGe,undo:yGe,setScaledBoundingBoxDimensions:vGe,setShouldRestrictStrokesToBox:bGe,stagingAreaInitialized:fle,setShouldAntialias:_Ge,canvasResized:SGe,canvasBatchIdAdded:hle,canvasBatchIdsReset:ple}=AB.actions,gle=AB.reducer,mle={isModalOpen:!1,imagesToChange:[]},IB=rr({name:"changeBoardModal",initialState:mle,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:xGe,imagesToChangeSelected:wGe,changeBoardReset:CGe}=IB.actions,yle=IB.reducer;var RB={exports:{}},OB={};const Fo=hS(PZ),Gp=hS(OY),vle=hS(GY);(function(e){var t,n,r=yt&&yt.__generator||function(H,te){var re,de,oe,je,Ge={label:0,sent:function(){if(1&oe[0])throw oe[1];return oe[1]},trys:[],ops:[]};return je={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(je[Symbol.iterator]=function(){return this}),je;function ut($e){return function(qe){return function(Ie){if(re)throw new TypeError("Generator is already executing.");for(;Ge;)try{if(re=1,de&&(oe=2&Ie[0]?de.return:Ie[0]?de.throw||((oe=de.return)&&oe.call(de),0):de.next)&&!(oe=oe.call(de,Ie[1])).done)return oe;switch(de=0,oe&&(Ie=[2&Ie[0],oe.value]),Ie[0]){case 0:case 1:oe=Ie;break;case 4:return Ge.label++,{value:Ie[1],done:!1};case 5:Ge.label++,de=Ie[1],Ie=[0];continue;case 7:Ie=Ge.ops.pop(),Ge.trys.pop();continue;default:if(!((oe=(oe=Ge.trys).length>0&&oe[oe.length-1])||Ie[0]!==6&&Ie[0]!==2)){Ge=0;continue}if(Ie[0]===3&&(!oe||Ie[1]>oe[0]&&Ie[1]<oe[3])){Ge.label=Ie[1];break}if(Ie[0]===6&&Ge.label<oe[1]){Ge.label=oe[1],oe=Ie;break}if(oe&&Ge.label<oe[2]){Ge.label=oe[2],Ge.ops.push(Ie);break}oe[2]&&Ge.ops.pop(),Ge.trys.pop();continue}Ie=te.call(H,Ge)}catch(ie){Ie=[6,ie],de=0}finally{re=oe=0}if(5&Ie[0])throw Ie[1];return{value:Ie[0]?Ie[1]:void 0,done:!0}}([$e,qe])}}},i=yt&&yt.__spreadArray||function(H,te){for(var re=0,de=te.length,oe=H.length;re<de;re++,oe++)H[oe]=te[re];return H},o=Object.create,a=Object.defineProperty,s=Object.defineProperties,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=function(H,te,re){return te in H?a(H,te,{enumerable:!0,configurable:!0,writable:!0,value:re}):H[te]=re},_=function(H,te){for(var re in te||(te={}))h.call(te,re)&&m(H,re,te[re]);if(d)for(var de=0,oe=d(te);de<oe.length;de++)p.call(te,re=oe[de])&&m(H,re,te[re]);return H},b=function(H,te){return s(H,u(te))},y=function(H){return a(H,"__esModule",{value:!0})},g=function(H,te){var re={};for(var de in H)h.call(H,de)&&te.indexOf(de)<0&&(re[de]=H[de]);if(H!=null&&d)for(var oe=0,je=d(H);oe<je.length;oe++)te.indexOf(de=je[oe])<0&&p.call(H,de)&&(re[de]=H[de]);return re},v=function(H){return function(te,re,de){if(re&&typeof re=="object"||typeof re=="function")for(var oe=function(ut){h.call(te,ut)||ut==="default"||a(te,ut,{get:function(){return re[ut]},enumerable:!(de=l(re,ut))||de.enumerable})},je=0,Ge=c(re);je<Ge.length;je++)oe(Ge[je]);return te}(y(a(H!=null?o(f(H)):{},"default",H&&H.__esModule&&"default"in H?{get:function(){return H.default},enumerable:!0}:{value:H,enumerable:!0})),H)},S=function(H,te,re){return new Promise(function(de,oe){var je=function($e){try{ut(re.next($e))}catch(qe){oe(qe)}},Ge=function($e){try{ut(re.throw($e))}catch(qe){oe(qe)}},ut=function($e){return $e.done?de($e.value):Promise.resolve($e.value).then(je,Ge)};ut((re=re.apply(H,te)).next())})};y(e),function(H,te){for(var re in te)a(H,re,{get:te[re],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return po},copyWithStructuralSharing:function(){return C},coreModule:function(){return ri},createApi:function(){return ll},defaultSerializeQueryArgs:function(){return Qi},fakeBaseQuery:function(){return al},fetchBaseQuery:function(){return E},retry:function(){return M},setupListeners:function(){return ee},skipSelector:function(){return Br},skipToken:function(){return pr}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var w=function(H){return[].concat.apply([],H)},x=v(Fo).isPlainObject;function C(H,te){if(H===te||!(x(H)&&x(te)||Array.isArray(H)&&Array.isArray(te)))return te;for(var re=Object.keys(te),de=Object.keys(H),oe=re.length===de.length,je=Array.isArray(te)?[]:{},Ge=0,ut=re;Ge<ut.length;Ge++){var $e=ut[Ge];je[$e]=C(H[$e],te[$e]),oe&&(oe=H[$e]===je[$e])}return oe?H:je}var k=v(Fo),T=function(){for(var H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];return fetch.apply(void 0,H)},P=function(H){return H.status>=200&&H.status<=299},$=function(H){return/ion\/(vnd\.api\+)?json/.test(H.get("content-type")||"")};function O(H){if(!(0,k.isPlainObject)(H))return H;for(var te=_({},H),re=0,de=Object.entries(te);re<de.length;re++){var oe=de[re];oe[1]===void 0&&delete te[oe[0]]}return te}function E(H){var te=this;H===void 0&&(H={});var re=H.baseUrl,de=H.prepareHeaders,oe=de===void 0?function(wt){return wt}:de,je=H.fetchFn,Ge=je===void 0?T:je,ut=H.paramsSerializer,$e=H.isJsonContentType,qe=$e===void 0?$:$e,Ie=H.jsonContentType,ie=Ie===void 0?"application/json":Ie,Se=H.jsonReplacer,Ye=H.timeout,Ze=H.responseHandler,ct=H.validateStatus,dt=g(H,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&Ge===T&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(wt,Tt){return S(te,null,function(){var dn,fn,$i,Lo,Di,Sr,vi,Xn,mo,Fa,it,hn,rn,or,xr,bi,Sn,Nt,Wt,xn,on,mn,xe,Je,Ue,ke,He,ft,Ve,we,ue,Ee,fe,ge,Ce,et;return r(this,function(Qe){switch(Qe.label){case 0:return dn=Tt.signal,fn=Tt.getState,$i=Tt.extra,Lo=Tt.endpoint,Di=Tt.forced,Sr=Tt.type,mo=(Xn=typeof wt=="string"?{url:wt}:wt).url,it=(Fa=Xn.headers)===void 0?new Headers(dt.headers):Fa,rn=(hn=Xn.params)===void 0?void 0:hn,xr=(or=Xn.responseHandler)===void 0?Ze??"json":or,Sn=(bi=Xn.validateStatus)===void 0?ct??P:bi,Wt=(Nt=Xn.timeout)===void 0?Ye:Nt,xn=g(Xn,["url","headers","params","responseHandler","validateStatus","timeout"]),on=_(b(_({},dt),{signal:dn}),xn),it=new Headers(O(it)),mn=on,[4,oe(it,{getState:fn,extra:$i,endpoint:Lo,forced:Di,type:Sr})];case 1:mn.headers=Qe.sent()||it,xe=function(Ae){return typeof Ae=="object"&&((0,k.isPlainObject)(Ae)||Array.isArray(Ae)||typeof Ae.toJSON=="function")},!on.headers.has("content-type")&&xe(on.body)&&on.headers.set("content-type",ie),xe(on.body)&&qe(on.headers)&&(on.body=JSON.stringify(on.body,Se)),rn&&(Je=~mo.indexOf("?")?"&":"?",Ue=ut?ut(rn):new URLSearchParams(O(rn)),mo+=Je+Ue),mo=function(Ae,kt){if(!Ae)return kt;if(!kt)return Ae;if(function(Gt){return new RegExp("(^|:)//").test(Gt)}(kt))return kt;var Ut=Ae.endsWith("/")||!kt.startsWith("?")?"/":"";return Ae=function(Gt){return Gt.replace(/\/$/,"")}(Ae),""+Ae+Ut+function(Gt){return Gt.replace(/^\//,"")}(kt)}(re,mo),ke=new Request(mo,on),He=ke.clone(),vi={request:He},Ve=!1,we=Wt&&setTimeout(function(){Ve=!0,Tt.abort()},Wt),Qe.label=2;case 2:return Qe.trys.push([2,4,5,6]),[4,Ge(ke)];case 3:return ft=Qe.sent(),[3,6];case 4:return ue=Qe.sent(),[2,{error:{status:Ve?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:vi}];case 5:return we&&clearTimeout(we),[7];case 6:Ee=ft.clone(),vi.response=Ee,ge="",Qe.label=7;case 7:return Qe.trys.push([7,9,,10]),[4,Promise.all([_t(ft,xr).then(function(Ae){return fe=Ae},function(Ae){return Ce=Ae}),Ee.text().then(function(Ae){return ge=Ae},function(){})])];case 8:if(Qe.sent(),Ce)throw Ce;return[3,10];case 9:return et=Qe.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ft.status,data:ge,error:String(et)},meta:vi}];case 10:return[2,Sn(ft,fe)?{data:fe,meta:vi}:{error:{status:ft.status,data:fe},meta:vi}]}})})};function _t(wt,Tt){return S(this,null,function(){var dn;return r(this,function(fn){switch(fn.label){case 0:return typeof Tt=="function"?[2,Tt(wt)]:(Tt==="content-type"&&(Tt=qe(wt.headers)?"json":"text"),Tt!=="json"?[3,2]:[4,wt.text()]);case 1:return[2,(dn=fn.sent()).length?JSON.parse(dn):null];case 2:return[2,wt.text()]}})})}}var A=function(H,te){te===void 0&&(te=void 0),this.value=H,this.meta=te};function D(H,te){return H===void 0&&(H=0),te===void 0&&(te=5),S(this,null,function(){var re,de;return r(this,function(oe){switch(oe.label){case 0:return re=Math.min(H,te),de=~~((Math.random()+.4)*(300<<re)),[4,new Promise(function(je){return setTimeout(function(Ge){return je(Ge)},de)})];case 1:return oe.sent(),[2]}})})}var L={},M=Object.assign(function(H,te){return function(re,de,oe){return S(void 0,null,function(){var je,Ge,ut,$e,qe,Ie,ie;return r(this,function(Se){switch(Se.label){case 0:je=[5,(te||L).maxRetries,(oe||L).maxRetries].filter(function(Ye){return Ye!==void 0}),Ge=je.slice(-1)[0],ut=function(Ye,Ze,ct){return ct.attempt<=Ge},$e=_(_({maxRetries:Ge,backoff:D,retryCondition:ut},te),oe),qe=0,Se.label=1;case 1:Se.label=2;case 2:return Se.trys.push([2,4,,6]),[4,H(re,de,oe)];case 3:if((Ie=Se.sent()).error)throw new A(Ie);return[2,Ie];case 4:if(ie=Se.sent(),qe++,ie.throwImmediately){if(ie instanceof A)return[2,ie.value];throw ie}return ie instanceof A&&!$e.retryCondition(ie.value.error,re,{attempt:qe,baseQueryApi:de,extraOptions:oe})?[2,ie.value]:[4,$e.backoff(qe,$e.maxRetries)];case 5:return Se.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(H){throw Object.assign(new A({error:H}),{throwImmediately:!0})}}),R=v(Fo),N=(0,R.createAction)("__rtkq/focused"),B=(0,R.createAction)("__rtkq/unfocused"),U=(0,R.createAction)("__rtkq/online"),G=(0,R.createAction)("__rtkq/offline"),Z=!1;function ee(H,te){return te?te(H,{onFocus:N,onFocusLost:B,onOffline:G,onOnline:U}):(re=function(){return H(N())},de=function(){return H(U())},oe=function(){return H(G())},je=function(){window.document.visibilityState==="visible"?re():H(B())},Z||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",je,!1),window.addEventListener("focus",re,!1),window.addEventListener("online",de,!1),window.addEventListener("offline",oe,!1),Z=!0),function(){window.removeEventListener("focus",re),window.removeEventListener("visibilitychange",je),window.removeEventListener("online",de),window.removeEventListener("offline",oe),Z=!1});var re,de,oe,je}var J,j,Q=v(Fo);function ne(H){return H.type===J.query}function se(H,te,re,de,oe,je){return typeof H=="function"?H(te,re,de,oe).map(ye).map(je):Array.isArray(H)?H.map(ye).map(je):[]}function ye(H){return typeof H=="string"?{type:H}:H}(j=J||(J={})).query="query",j.mutation="mutation";var ce=v(Fo);function bt(H){return H!=null}var ot=Symbol("forceQueryFn"),ze=function(H){return typeof H[ot]=="function"},mt=v(Fo),Pe=v(Gp),en=v(Fo);function Pr(H){return H}function Ln(H,te,re,de){return se(re[H.meta.arg.endpointName][te],(0,mt.isFulfilled)(H)?H.payload:void 0,(0,mt.isRejectedWithValue)(H)?H.payload:void 0,H.meta.arg.originalArgs,"baseQueryMeta"in H.meta?H.meta.baseQueryMeta:void 0,de)}var An=v(Gp),tn=v(Gp);function Fn(H,te,re){var de=H[te];de&&re(de)}function Ir(H){var te;return(te="arg"in H?H.arg.fixedCacheKey:H.fixedCacheKey)!=null?te:H.requestId}function ho(H,te,re){var de=H[Ir(te)];de&&re(de)}var ei={},pr=Symbol.for("RTKQ/skipToken"),Br=pr,ti={status:t.uninitialized},Bn=(0,Q.createNextState)(ti,function(){}),_n=(0,Q.createNextState)(ti,function(){}),Mi=v(Fo),gi=WeakMap?new WeakMap:void 0,Qi=function(H){var te=H.endpointName,re=H.queryArgs,de="",oe=gi==null?void 0:gi.get(re);if(typeof oe=="string")de=oe;else{var je=JSON.stringify(re,function(Ge,ut){return(0,Mi.isPlainObject)(ut)?Object.keys(ut).sort().reduce(function($e,qe){return $e[qe]=ut[qe],$e},{}):ut});(0,Mi.isPlainObject)(re)&&(gi==null||gi.set(re,je)),de=je}return te+"("+de+")"},Da=v(Fo),Rr=v(vle);function po(){for(var H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];return function(re){var de=(0,Rr.defaultMemoize)(function($e){var qe,Ie;return(Ie=re.extractRehydrationInfo)==null?void 0:Ie.call(re,$e,{reducerPath:(qe=re.reducerPath)!=null?qe:"api"})}),oe=b(_({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},re),{extractRehydrationInfo:de,serializeQueryArgs:function($e){var qe=Qi;if("serializeQueryArgs"in $e.endpointDefinition){var Ie=$e.endpointDefinition.serializeQueryArgs;qe=function(ie){var Se=Ie(ie);return typeof Se=="string"?Se:Qi(b(_({},ie),{queryArgs:Se}))}}else re.serializeQueryArgs&&(qe=re.serializeQueryArgs);return qe($e)},tagTypes:i([],re.tagTypes||[])}),je={endpointDefinitions:{},batch:function($e){$e()},apiUid:(0,Da.nanoid)(),extractRehydrationInfo:de,hasRehydrationInfo:(0,Rr.defaultMemoize)(function($e){return de($e)!=null})},Ge={injectEndpoints:function($e){for(var qe=$e.endpoints({query:function(_t){return b(_({},_t),{type:J.query})},mutation:function(_t){return b(_({},_t),{type:J.mutation})}}),Ie=0,ie=Object.entries(qe);Ie<ie.length;Ie++){var Se=ie[Ie],Ye=Se[0],Ze=Se[1];if($e.overrideExisting||!(Ye in je.endpointDefinitions)){je.endpointDefinitions[Ye]=Ze;for(var ct=0,dt=ut;ct<dt.length;ct++)dt[ct].injectEndpoint(Ye,Ze)}}return Ge},enhanceEndpoints:function($e){var qe=$e.addTagTypes,Ie=$e.endpoints;if(qe)for(var ie=0,Se=qe;ie<Se.length;ie++){var Ye=Se[ie];oe.tagTypes.includes(Ye)||oe.tagTypes.push(Ye)}if(Ie)for(var Ze=0,ct=Object.entries(Ie);Ze<ct.length;Ze++){var dt=ct[Ze],_t=dt[0],wt=dt[1];typeof wt=="function"?wt(je.endpointDefinitions[_t]):Object.assign(je.endpointDefinitions[_t]||{},wt)}return Ge}},ut=H.map(function($e){return $e.init(Ge,oe,je)});return Ge.injectEndpoints({endpoints:re.endpoints})}}function al(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Do,sl=v(Fo),zn=function(H){var te=H.reducerPath,re=H.api,de=H.context,oe=H.internalState,je=re.internalActions,Ge=je.removeQueryResult,ut=je.unsubscribeQueryResult;function $e(ie){var Se=oe.currentSubscriptions[ie];return!!Se&&!function(Ye){for(var Ze in Ye)return!1;return!0}(Se)}var qe={};function Ie(ie,Se,Ye,Ze){var ct,dt=de.endpointDefinitions[Se],_t=(ct=dt==null?void 0:dt.keepUnusedDataFor)!=null?ct:Ze.keepUnusedDataFor;if(_t!==1/0){var wt=Math.max(0,Math.min(_t,2147482647e-3));if(!$e(ie)){var Tt=qe[ie];Tt&&clearTimeout(Tt),qe[ie]=setTimeout(function(){$e(ie)||Ye.dispatch(Ge({queryCacheKey:ie})),delete qe[ie]},1e3*wt)}}}return function(ie,Se,Ye){var Ze;if(ut.match(ie)){var ct=Se.getState()[te];Ie(Di=ie.payload.queryCacheKey,(Ze=ct.queries[Di])==null?void 0:Ze.endpointName,Se,ct.config)}if(re.util.resetApiState.match(ie))for(var dt=0,_t=Object.entries(qe);dt<_t.length;dt++){var wt=_t[dt],Tt=wt[0],dn=wt[1];dn&&clearTimeout(dn),delete qe[Tt]}if(de.hasRehydrationInfo(ie)){ct=Se.getState()[te];for(var fn=de.extractRehydrationInfo(ie).queries,$i=0,Lo=Object.entries(fn);$i<Lo.length;$i++){var Di,Sr=Lo[$i],vi=Sr[1];Ie(Di=Sr[0],vi==null?void 0:vi.endpointName,Se,ct.config)}}}},nn=v(Fo),zr=function(H){var te=H.reducerPath,re=H.context,de=H.context.endpointDefinitions,oe=H.mutationThunk,je=H.api,Ge=H.assertTagType,ut=H.refetchQuery,$e=je.internalActions.removeQueryResult,qe=(0,nn.isAnyOf)((0,nn.isFulfilled)(oe),(0,nn.isRejectedWithValue)(oe));function Ie(ie,Se){var Ye=Se.getState(),Ze=Ye[te],ct=je.util.selectInvalidatedBy(Ye,ie);re.batch(function(){for(var dt,_t=0,wt=Array.from(ct.values());_t<wt.length;_t++){var Tt=wt[_t].queryCacheKey,dn=Ze.queries[Tt],fn=(dt=Ze.subscriptions[Tt])!=null?dt:{};dn&&(Object.keys(fn).length===0?Se.dispatch($e({queryCacheKey:Tt})):dn.status!==t.uninitialized&&Se.dispatch(ut(dn,Tt)))}})}return function(ie,Se){qe(ie)&&Ie(Ln(ie,"invalidatesTags",de,Ge),Se),je.util.invalidateTags.match(ie)&&Ie(se(ie.payload,void 0,void 0,void 0,void 0,Ge),Se)}},Or=function(H){var te=H.reducerPath,re=H.queryThunk,de=H.api,oe=H.refetchQuery,je=H.internalState,Ge={};function ut(ie,Se){var Ye=ie.queryCacheKey,Ze=Se.getState()[te].queries[Ye];if(Ze&&Ze.status!==t.uninitialized){var ct=Ie(je.currentSubscriptions[Ye]);if(Number.isFinite(ct)){var dt=Ge[Ye];dt!=null&&dt.timeout&&(clearTimeout(dt.timeout),dt.timeout=void 0);var _t=Date.now()+ct,wt=Ge[Ye]={nextPollTimestamp:_t,pollingInterval:ct,timeout:setTimeout(function(){wt.timeout=void 0,Se.dispatch(oe(Ze,Ye))},ct)}}}}function $e(ie,Se){var Ye=ie.queryCacheKey,Ze=Se.getState()[te].queries[Ye];if(Ze&&Ze.status!==t.uninitialized){var ct=Ie(je.currentSubscriptions[Ye]);if(Number.isFinite(ct)){var dt=Ge[Ye],_t=Date.now()+ct;(!dt||_t<dt.nextPollTimestamp)&&ut({queryCacheKey:Ye},Se)}else qe(Ye)}}function qe(ie){var Se=Ge[ie];Se!=null&&Se.timeout&&clearTimeout(Se.timeout),delete Ge[ie]}function Ie(ie){ie===void 0&&(ie={});var Se=Number.POSITIVE_INFINITY;for(var Ye in ie)ie[Ye].pollingInterval&&(Se=Math.min(ie[Ye].pollingInterval,Se));return Se}return function(ie,Se){(de.internalActions.updateSubscriptionOptions.match(ie)||de.internalActions.unsubscribeQueryResult.match(ie))&&$e(ie.payload,Se),(re.pending.match(ie)||re.rejected.match(ie)&&ie.meta.condition)&&$e(ie.meta.arg,Se),(re.fulfilled.match(ie)||re.rejected.match(ie)&&!ie.meta.condition)&&ut(ie.meta.arg,Se),de.util.resetApiState.match(ie)&&function(){for(var Ye=0,Ze=Object.keys(Ge);Ye<Ze.length;Ye++)qe(Ze[Ye])}()}},Mr=v(Fo),ni=new Error("Promise never resolved before cacheEntryRemoved."),Ni=function(H){var te=H.api,re=H.reducerPath,de=H.context,oe=H.queryThunk,je=H.mutationThunk,Ge=(0,Mr.isAsyncThunkAction)(oe),ut=(0,Mr.isAsyncThunkAction)(je),$e=(0,Mr.isFulfilled)(oe,je),qe={};function Ie(ie,Se,Ye,Ze,ct){var dt=de.endpointDefinitions[ie],_t=dt==null?void 0:dt.onCacheEntryAdded;if(_t){var wt={},Tt=new Promise(function(Sr){wt.cacheEntryRemoved=Sr}),dn=Promise.race([new Promise(function(Sr){wt.valueResolved=Sr}),Tt.then(function(){throw ni})]);dn.catch(function(){}),qe[Ye]=wt;var fn=te.endpoints[ie].select(dt.type===J.query?Se:Ye),$i=Ze.dispatch(function(Sr,vi,Xn){return Xn}),Lo=b(_({},Ze),{getCacheEntry:function(){return fn(Ze.getState())},requestId:ct,extra:$i,updateCachedData:dt.type===J.query?function(Sr){return Ze.dispatch(te.util.updateQueryData(ie,Se,Sr))}:void 0,cacheDataLoaded:dn,cacheEntryRemoved:Tt}),Di=_t(Se,Lo);Promise.resolve(Di).catch(function(Sr){if(Sr!==ni)throw Sr})}}return function(ie,Se,Ye){var Ze=function(fn){return Ge(fn)?fn.meta.arg.queryCacheKey:ut(fn)?fn.meta.requestId:te.internalActions.removeQueryResult.match(fn)?fn.payload.queryCacheKey:te.internalActions.removeMutationResult.match(fn)?Ir(fn.payload):""}(ie);if(oe.pending.match(ie)){var ct=Ye[re].queries[Ze],dt=Se.getState()[re].queries[Ze];!ct&&dt&&Ie(ie.meta.arg.endpointName,ie.meta.arg.originalArgs,Ze,Se,ie.meta.requestId)}else if(je.pending.match(ie))(dt=Se.getState()[re].mutations[Ze])&&Ie(ie.meta.arg.endpointName,ie.meta.arg.originalArgs,Ze,Se,ie.meta.requestId);else if($e(ie))(dn=qe[Ze])!=null&&dn.valueResolved&&(dn.valueResolved({data:ie.payload,meta:ie.meta.baseQueryMeta}),delete dn.valueResolved);else if(te.internalActions.removeQueryResult.match(ie)||te.internalActions.removeMutationResult.match(ie))(dn=qe[Ze])&&(delete qe[Ze],dn.cacheEntryRemoved());else if(te.util.resetApiState.match(ie))for(var _t=0,wt=Object.entries(qe);_t<wt.length;_t++){var Tt=wt[_t],dn=Tt[1];delete qe[Tt[0]],dn.cacheEntryRemoved()}}},go=v(Fo),mi=function(H){var te=H.api,re=H.context,de=H.queryThunk,oe=H.mutationThunk,je=(0,go.isPending)(de,oe),Ge=(0,go.isRejected)(de,oe),ut=(0,go.isFulfilled)(de,oe),$e={};return function(qe,Ie){var ie,Se,Ye;if(je(qe)){var Ze=qe.meta,ct=Ze.requestId,dt=Ze.arg,_t=dt.endpointName,wt=dt.originalArgs,Tt=re.endpointDefinitions[_t],dn=Tt==null?void 0:Tt.onQueryStarted;if(dn){var fn={},$i=new Promise(function(Fa,it){fn.resolve=Fa,fn.reject=it});$i.catch(function(){}),$e[ct]=fn;var Lo=te.endpoints[_t].select(Tt.type===J.query?wt:ct),Di=Ie.dispatch(function(Fa,it,hn){return hn}),Sr=b(_({},Ie),{getCacheEntry:function(){return Lo(Ie.getState())},requestId:ct,extra:Di,updateCachedData:Tt.type===J.query?function(Fa){return Ie.dispatch(te.util.updateQueryData(_t,wt,Fa))}:void 0,queryFulfilled:$i});dn(wt,Sr)}}else if(ut(qe)){var vi=qe.meta,Xn=vi.baseQueryMeta;(ie=$e[ct=vi.requestId])==null||ie.resolve({data:qe.payload,meta:Xn}),delete $e[ct]}else if(Ge(qe)){var mo=qe.meta;Xn=mo.baseQueryMeta,(Ye=$e[ct=mo.requestId])==null||Ye.reject({error:(Se=qe.payload)!=null?Se:qe.error,isUnhandledError:!mo.rejectedWithValue,meta:Xn}),delete $e[ct]}}},jr=function(H){var te=H.api,re=H.context.apiUid;return function(de,oe){te.util.resetApiState.match(de)&&oe.dispatch(te.internalActions.middlewareRegistered(re))}},La=v(Gp),gs=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof yt<"u"?yt:globalThis):function(H){return(Do||(Do=Promise.resolve())).then(H).catch(function(te){return setTimeout(function(){throw te},0)})};function yi(H){for(var te=[],re=1;re<arguments.length;re++)te[re-1]=arguments[re];Object.assign.apply(Object,i([H],te))}var ou=v(Gp),oa=Symbol(),ri=function(){return{name:oa,init:function(H,te,re){var de=te.baseQuery,oe=te.reducerPath,je=te.serializeQueryArgs,Ge=te.keepUnusedDataFor,ut=te.refetchOnMountOrArgChange,$e=te.refetchOnFocus,qe=te.refetchOnReconnect;(0,ou.enablePatches)();var Ie=function(it){return it};Object.assign(H,{reducerPath:oe,endpoints:{},internalActions:{onOnline:U,onOffline:G,onFocus:N,onFocusLost:B},util:{}});var ie=function(it){var hn=this,rn=it.reducerPath,or=it.baseQuery,xr=it.context.endpointDefinitions,bi=it.serializeQueryArgs,Sn=it.api,Nt=function(xe,Je){return S(hn,[xe,Je],function(Ue,ke){var He,ft,Ve,we,ue,Ee,fe,ge,Ce,et,Qe,Ae,kt,Ut=ke.signal,Gt=ke.abort,ar=ke.rejectWithValue,gr=ke.fulfillWithValue,jn=ke.dispatch,Pn=ke.getState,Xi=ke.extra;return r(this,function(F){switch(F.label){case 0:He=xr[Ue.endpointName],F.label=1;case 1:return F.trys.push([1,8,,13]),ft=Pr,Ve=void 0,we={signal:Ut,abort:Gt,dispatch:jn,getState:Pn,extra:Xi,endpoint:Ue.endpointName,type:Ue.type,forced:Ue.type==="query"?Wt(Ue,Pn()):void 0},(ue=Ue.type==="query"?Ue[ot]:void 0)?(Ve=ue(),[3,6]):[3,2];case 2:return He.query?[4,or(He.query(Ue.originalArgs),we,He.extraOptions)]:[3,4];case 3:return Ve=F.sent(),He.transformResponse&&(ft=He.transformResponse),[3,6];case 4:return[4,He.queryFn(Ue.originalArgs,we,He.extraOptions,function(V){return or(V,we,He.extraOptions)})];case 5:Ve=F.sent(),F.label=6;case 6:if(Ve.error)throw new A(Ve.error,Ve.meta);return Ee=gr,[4,ft(Ve.data,Ve.meta,Ue.originalArgs)];case 7:return[2,Ee.apply(void 0,[F.sent(),(Ae={fulfilledTimeStamp:Date.now(),baseQueryMeta:Ve.meta},Ae[en.SHOULD_AUTOBATCH]=!0,Ae)])];case 8:if(fe=F.sent(),!((ge=fe)instanceof A))return[3,12];Ce=Pr,He.query&&He.transformErrorResponse&&(Ce=He.transformErrorResponse),F.label=9;case 9:return F.trys.push([9,11,,12]),et=ar,[4,Ce(ge.value,ge.meta,Ue.originalArgs)];case 10:return[2,et.apply(void 0,[F.sent(),(kt={baseQueryMeta:ge.meta},kt[en.SHOULD_AUTOBATCH]=!0,kt)])];case 11:return Qe=F.sent(),ge=Qe,[3,12];case 12:throw console.error(ge),ge;case 13:return[2]}})})};function Wt(xe,Je){var Ue,ke,He,ft,Ve=(ke=(Ue=Je[rn])==null?void 0:Ue.queries)==null?void 0:ke[xe.queryCacheKey],we=(He=Je[rn])==null?void 0:He.config.refetchOnMountOrArgChange,ue=Ve==null?void 0:Ve.fulfilledTimeStamp,Ee=(ft=xe.forceRefetch)!=null?ft:xe.subscribe&&we;return!!Ee&&(Ee===!0||(Number(new Date)-Number(ue))/1e3>=Ee)}var xn=(0,en.createAsyncThunk)(rn+"/executeQuery",Nt,{getPendingMeta:function(){var xe;return(xe={startedTimeStamp:Date.now()})[en.SHOULD_AUTOBATCH]=!0,xe},condition:function(xe,Je){var Ue,ke,He,ft=(0,Je.getState)(),Ve=(ke=(Ue=ft[rn])==null?void 0:Ue.queries)==null?void 0:ke[xe.queryCacheKey],we=Ve==null?void 0:Ve.fulfilledTimeStamp,ue=xe.originalArgs,Ee=Ve==null?void 0:Ve.originalArgs,fe=xr[xe.endpointName];return!(!ze(xe)&&((Ve==null?void 0:Ve.status)==="pending"||!Wt(xe,ft)&&(!ne(fe)||!((He=fe==null?void 0:fe.forceRefetch)!=null&&He.call(fe,{currentArg:ue,previousArg:Ee,endpointState:Ve,state:ft})))&&we))},dispatchConditionRejection:!0}),on=(0,en.createAsyncThunk)(rn+"/executeMutation",Nt,{getPendingMeta:function(){var xe;return(xe={startedTimeStamp:Date.now()})[en.SHOULD_AUTOBATCH]=!0,xe}});function mn(xe){return function(Je){var Ue,ke;return((ke=(Ue=Je==null?void 0:Je.meta)==null?void 0:Ue.arg)==null?void 0:ke.endpointName)===xe}}return{queryThunk:xn,mutationThunk:on,prefetch:function(xe,Je,Ue){return function(ke,He){var ft=function(fe){return"force"in fe}(Ue)&&Ue.force,Ve=function(fe){return"ifOlderThan"in fe}(Ue)&&Ue.ifOlderThan,we=function(fe){return fe===void 0&&(fe=!0),Sn.endpoints[xe].initiate(Je,{forceRefetch:fe})},ue=Sn.endpoints[xe].select(Je)(He());if(ft)ke(we());else if(Ve){var Ee=ue==null?void 0:ue.fulfilledTimeStamp;if(!Ee)return void ke(we());(Number(new Date)-Number(new Date(Ee)))/1e3>=Ve&&ke(we())}else ke(we(!1))}},updateQueryData:function(xe,Je,Ue){return function(ke,He){var ft,Ve,we=Sn.endpoints[xe].select(Je)(He()),ue={patches:[],inversePatches:[],undo:function(){return ke(Sn.util.patchQueryData(xe,Je,ue.inversePatches))}};if(we.status===t.uninitialized)return ue;if("data"in we)if((0,Pe.isDraftable)(we.data)){var Ee=(0,Pe.produceWithPatches)(we.data,Ue),fe=Ee[2];(ft=ue.patches).push.apply(ft,Ee[1]),(Ve=ue.inversePatches).push.apply(Ve,fe)}else{var ge=Ue(we.data);ue.patches.push({op:"replace",path:[],value:ge}),ue.inversePatches.push({op:"replace",path:[],value:we.data})}return ke(Sn.util.patchQueryData(xe,Je,ue.patches)),ue}},upsertQueryData:function(xe,Je,Ue){return function(ke){var He;return ke(Sn.endpoints[xe].initiate(Je,((He={subscribe:!1,forceRefetch:!0})[ot]=function(){return{data:Ue}},He)))}},patchQueryData:function(xe,Je,Ue){return function(ke){ke(Sn.internalActions.queryResultPatched({queryCacheKey:bi({queryArgs:Je,endpointDefinition:xr[xe],endpointName:xe}),patches:Ue}))}},buildMatchThunkActions:function(xe,Je){return{matchPending:(0,mt.isAllOf)((0,mt.isPending)(xe),mn(Je)),matchFulfilled:(0,mt.isAllOf)((0,mt.isFulfilled)(xe),mn(Je)),matchRejected:(0,mt.isAllOf)((0,mt.isRejected)(xe),mn(Je))}}}}({baseQuery:de,reducerPath:oe,context:re,api:H,serializeQueryArgs:je}),Se=ie.queryThunk,Ye=ie.mutationThunk,Ze=ie.patchQueryData,ct=ie.updateQueryData,dt=ie.upsertQueryData,_t=ie.prefetch,wt=ie.buildMatchThunkActions,Tt=function(it){var hn=it.reducerPath,rn=it.queryThunk,or=it.mutationThunk,xr=it.context,bi=xr.endpointDefinitions,Sn=xr.apiUid,Nt=xr.extractRehydrationInfo,Wt=xr.hasRehydrationInfo,xn=it.assertTagType,on=it.config,mn=(0,ce.createAction)(hn+"/resetApiState"),xe=(0,ce.createSlice)({name:hn+"/queries",initialState:ei,reducers:{removeQueryResult:{reducer:function(we,ue){delete we[ue.payload.queryCacheKey]},prepare:(0,ce.prepareAutoBatched)()},queryResultPatched:function(we,ue){var Ee=ue.payload,fe=Ee.patches;Fn(we,Ee.queryCacheKey,function(ge){ge.data=(0,tn.applyPatches)(ge.data,fe.concat())})}},extraReducers:function(we){we.addCase(rn.pending,function(ue,Ee){var fe,ge=Ee.meta,Ce=Ee.meta.arg,et=ze(Ce);(Ce.subscribe||et)&&(ue[fe=Ce.queryCacheKey]!=null||(ue[fe]={status:t.uninitialized,endpointName:Ce.endpointName})),Fn(ue,Ce.queryCacheKey,function(Qe){Qe.status=t.pending,Qe.requestId=et&&Qe.requestId?Qe.requestId:ge.requestId,Ce.originalArgs!==void 0&&(Qe.originalArgs=Ce.originalArgs),Qe.startedTimeStamp=ge.startedTimeStamp})}).addCase(rn.fulfilled,function(ue,Ee){var fe=Ee.meta,ge=Ee.payload;Fn(ue,fe.arg.queryCacheKey,function(Ce){var et;if(Ce.requestId===fe.requestId||ze(fe.arg)){var Qe=bi[fe.arg.endpointName].merge;if(Ce.status=t.fulfilled,Qe)if(Ce.data!==void 0){var Ae=fe.fulfilledTimeStamp,kt=fe.arg,Ut=fe.baseQueryMeta,Gt=fe.requestId,ar=(0,ce.createNextState)(Ce.data,function(gr){return Qe(gr,ge,{arg:kt.originalArgs,baseQueryMeta:Ut,fulfilledTimeStamp:Ae,requestId:Gt})});Ce.data=ar}else Ce.data=ge;else Ce.data=(et=bi[fe.arg.endpointName].structuralSharing)==null||et?C((0,An.isDraft)(Ce.data)?(0,tn.original)(Ce.data):Ce.data,ge):ge;delete Ce.error,Ce.fulfilledTimeStamp=fe.fulfilledTimeStamp}})}).addCase(rn.rejected,function(ue,Ee){var fe=Ee.meta,ge=fe.condition,Ce=fe.requestId,et=Ee.error,Qe=Ee.payload;Fn(ue,fe.arg.queryCacheKey,function(Ae){if(!ge){if(Ae.requestId!==Ce)return;Ae.status=t.rejected,Ae.error=Qe??et}})}).addMatcher(Wt,function(ue,Ee){for(var fe=Nt(Ee).queries,ge=0,Ce=Object.entries(fe);ge<Ce.length;ge++){var et=Ce[ge],Qe=et[1];(Qe==null?void 0:Qe.status)!==t.fulfilled&&(Qe==null?void 0:Qe.status)!==t.rejected||(ue[et[0]]=Qe)}})}}),Je=(0,ce.createSlice)({name:hn+"/mutations",initialState:ei,reducers:{removeMutationResult:{reducer:function(we,ue){var Ee=Ir(ue.payload);Ee in we&&delete we[Ee]},prepare:(0,ce.prepareAutoBatched)()}},extraReducers:function(we){we.addCase(or.pending,function(ue,Ee){var fe=Ee.meta,ge=fe.requestId,Ce=fe.arg,et=fe.startedTimeStamp;Ce.track&&(ue[Ir(Ee.meta)]={requestId:ge,status:t.pending,endpointName:Ce.endpointName,startedTimeStamp:et})}).addCase(or.fulfilled,function(ue,Ee){var fe=Ee.payload,ge=Ee.meta;ge.arg.track&&ho(ue,ge,function(Ce){Ce.requestId===ge.requestId&&(Ce.status=t.fulfilled,Ce.data=fe,Ce.fulfilledTimeStamp=ge.fulfilledTimeStamp)})}).addCase(or.rejected,function(ue,Ee){var fe=Ee.payload,ge=Ee.error,Ce=Ee.meta;Ce.arg.track&&ho(ue,Ce,function(et){et.requestId===Ce.requestId&&(et.status=t.rejected,et.error=fe??ge)})}).addMatcher(Wt,function(ue,Ee){for(var fe=Nt(Ee).mutations,ge=0,Ce=Object.entries(fe);ge<Ce.length;ge++){var et=Ce[ge],Qe=et[0],Ae=et[1];(Ae==null?void 0:Ae.status)!==t.fulfilled&&(Ae==null?void 0:Ae.status)!==t.rejected||Qe===(Ae==null?void 0:Ae.requestId)||(ue[Qe]=Ae)}})}}),Ue=(0,ce.createSlice)({name:hn+"/invalidation",initialState:ei,reducers:{},extraReducers:function(we){we.addCase(xe.actions.removeQueryResult,function(ue,Ee){for(var fe=Ee.payload.queryCacheKey,ge=0,Ce=Object.values(ue);ge<Ce.length;ge++)for(var et=0,Qe=Object.values(Ce[ge]);et<Qe.length;et++){var Ae=Qe[et],kt=Ae.indexOf(fe);kt!==-1&&Ae.splice(kt,1)}}).addMatcher(Wt,function(ue,Ee){for(var fe,ge,Ce,et,Qe=Nt(Ee).provided,Ae=0,kt=Object.entries(Qe);Ae<kt.length;Ae++)for(var Ut=kt[Ae],Gt=Ut[0],ar=0,gr=Object.entries(Ut[1]);ar<gr.length;ar++)for(var jn=gr[ar],Pn=jn[0],Xi=jn[1],F=(et=(ge=(fe=ue[Gt])!=null?fe:ue[Gt]={})[Ce=Pn||"__internal_without_id"])!=null?et:ge[Ce]=[],V=0,X=Xi;V<X.length;V++){var pe=X[V];F.includes(pe)||F.push(pe)}}).addMatcher((0,ce.isAnyOf)((0,ce.isFulfilled)(rn),(0,ce.isRejectedWithValue)(rn)),function(ue,Ee){for(var fe,ge,Ce,et,Qe=Ln(Ee,"providesTags",bi,xn),Ae=Ee.meta.arg.queryCacheKey,kt=0,Ut=Object.values(ue);kt<Ut.length;kt++)for(var Gt=0,ar=Object.values(Ut[kt]);Gt<ar.length;Gt++){var gr=ar[Gt],jn=gr.indexOf(Ae);jn!==-1&&gr.splice(jn,1)}for(var Pn=0,Xi=Qe;Pn<Xi.length;Pn++){var F=Xi[Pn],V=F.type,X=F.id,pe=(et=(ge=(fe=ue[V])!=null?fe:ue[V]={})[Ce=X||"__internal_without_id"])!=null?et:ge[Ce]=[];pe.includes(Ae)||pe.push(Ae)}})}}),ke=(0,ce.createSlice)({name:hn+"/subscriptions",initialState:ei,reducers:{updateSubscriptionOptions:function(we,ue){},unsubscribeQueryResult:function(we,ue){},internal_probeSubscription:function(we,ue){}}}),He=(0,ce.createSlice)({name:hn+"/internalSubscriptions",initialState:ei,reducers:{subscriptionsUpdated:{reducer:function(we,ue){return(0,tn.applyPatches)(we,ue.payload)},prepare:(0,ce.prepareAutoBatched)()}}}),ft=(0,ce.createSlice)({name:hn+"/config",initialState:_({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},on),reducers:{middlewareRegistered:function(we,ue){we.middlewareRegistered=we.middlewareRegistered!=="conflict"&&Sn===ue.payload||"conflict"}},extraReducers:function(we){we.addCase(U,function(ue){ue.online=!0}).addCase(G,function(ue){ue.online=!1}).addCase(N,function(ue){ue.focused=!0}).addCase(B,function(ue){ue.focused=!1}).addMatcher(Wt,function(ue){return _({},ue)})}}),Ve=(0,ce.combineReducers)({queries:xe.reducer,mutations:Je.reducer,provided:Ue.reducer,subscriptions:He.reducer,config:ft.reducer});return{reducer:function(we,ue){return Ve(mn.match(ue)?void 0:we,ue)},actions:b(_(_(_(_(_({},ft.actions),xe.actions),ke.actions),He.actions),Je.actions),{unsubscribeMutationResult:Je.actions.removeMutationResult,resetApiState:mn})}}({context:re,queryThunk:Se,mutationThunk:Ye,reducerPath:oe,assertTagType:Ie,config:{refetchOnFocus:$e,refetchOnReconnect:qe,refetchOnMountOrArgChange:ut,keepUnusedDataFor:Ge,reducerPath:oe}}),dn=Tt.reducer,fn=Tt.actions;yi(H.util,{patchQueryData:Ze,updateQueryData:ct,upsertQueryData:dt,prefetch:_t,resetApiState:fn.resetApiState}),yi(H.internalActions,fn);var $i=function(it){var hn=it.reducerPath,rn=it.queryThunk,or=it.api,xr=it.context,bi=xr.apiUid,Sn={invalidateTags:(0,sl.createAction)(hn+"/invalidateTags")},Nt=[jr,zn,zr,Or,Ni,mi];return{middleware:function(xn){var on=!1,mn=b(_({},it),{internalState:{currentSubscriptions:{}},refetchQuery:Wt}),xe=Nt.map(function(ke){return ke(mn)}),Je=function(ke){var He=ke.api,ft=ke.queryThunk,Ve=ke.internalState,we=He.reducerPath+"/subscriptions",ue=null,Ee=!1,fe=He.internalActions,ge=fe.updateSubscriptionOptions,Ce=fe.unsubscribeQueryResult;return function(et,Qe){var Ae,kt;if(ue||(ue=JSON.parse(JSON.stringify(Ve.currentSubscriptions))),He.util.resetApiState.match(et))return ue=Ve.currentSubscriptions={},[!0,!1];if(He.internalActions.internal_probeSubscription.match(et)){var Ut=et.payload;return[!1,!!((Ae=Ve.currentSubscriptions[Ut.queryCacheKey])!=null&&Ae[Ut.requestId])]}var Gt=function(jn,Pn){var Xi,F,V,X,pe,Ct,pn,In,It;if(ge.match(Pn)){var wn=Pn.payload,_i=wn.queryCacheKey,Yn=wn.requestId;return(Xi=jn==null?void 0:jn[_i])!=null&&Xi[Yn]&&(jn[_i][Yn]=wn.options),!0}if(Ce.match(Pn)){var au=Pn.payload;return Yn=au.requestId,jn[_i=au.queryCacheKey]&&delete jn[_i][Yn],!0}if(He.internalActions.removeQueryResult.match(Pn))return delete jn[Pn.payload.queryCacheKey],!0;if(ft.pending.match(Pn)){var tf=Pn.meta;if(Yn=tf.requestId,(rf=tf.arg).subscribe)return(su=(V=jn[F=rf.queryCacheKey])!=null?V:jn[F]={})[Yn]=(pe=(X=rf.subscriptionOptions)!=null?X:su[Yn])!=null?pe:{},!0}if(ft.rejected.match(Pn)){var su,nf=Pn.meta,rf=nf.arg;if(Yn=nf.requestId,nf.condition&&rf.subscribe)return(su=(pn=jn[Ct=rf.queryCacheKey])!=null?pn:jn[Ct]={})[Yn]=(It=(In=rf.subscriptionOptions)!=null?In:su[Yn])!=null?It:{},!0}return!1}(Ve.currentSubscriptions,et);if(Gt){Ee||(gs(function(){var jn=JSON.parse(JSON.stringify(Ve.currentSubscriptions)),Pn=(0,La.produceWithPatches)(ue,function(){return jn});Qe.next(He.internalActions.subscriptionsUpdated(Pn[1])),ue=jn,Ee=!1}),Ee=!0);var ar=!!((kt=et.type)!=null&&kt.startsWith(we)),gr=ft.rejected.match(et)&&et.meta.condition&&!!et.meta.arg.subscribe;return[!ar&&!gr,!1]}return[!0,!1]}}(mn),Ue=function(ke){var He=ke.reducerPath,ft=ke.context,Ve=ke.refetchQuery,we=ke.internalState,ue=ke.api.internalActions.removeQueryResult;function Ee(fe,ge){var Ce=fe.getState()[He],et=Ce.queries,Qe=we.currentSubscriptions;ft.batch(function(){for(var Ae=0,kt=Object.keys(Qe);Ae<kt.length;Ae++){var Ut=kt[Ae],Gt=et[Ut],ar=Qe[Ut];ar&&Gt&&(Object.values(ar).some(function(gr){return gr[ge]===!0})||Object.values(ar).every(function(gr){return gr[ge]===void 0})&&Ce.config[ge])&&(Object.keys(ar).length===0?fe.dispatch(ue({queryCacheKey:Ut})):Gt.status!==t.uninitialized&&fe.dispatch(Ve(Gt,Ut)))}})}return function(fe,ge){N.match(fe)&&Ee(ge,"refetchOnFocus"),U.match(fe)&&Ee(ge,"refetchOnReconnect")}}(mn);return function(ke){return function(He){on||(on=!0,xn.dispatch(or.internalActions.middlewareRegistered(bi)));var ft,Ve=b(_({},xn),{next:ke}),we=xn.getState(),ue=Je(He,Ve,we),Ee=ue[1];if(ft=ue[0]?ke(He):Ee,xn.getState()[hn]&&(Ue(He,Ve,we),function(Ce){return!!Ce&&typeof Ce.type=="string"&&Ce.type.startsWith(hn+"/")}(He)||xr.hasRehydrationInfo(He)))for(var fe=0,ge=xe;fe<ge.length;fe++)(0,ge[fe])(He,Ve,we);return ft}}},actions:Sn};function Wt(xn,on,mn){return mn===void 0&&(mn={}),rn(_({type:"query",endpointName:xn.endpointName,originalArgs:xn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:on},mn))}}({reducerPath:oe,context:re,queryThunk:Se,mutationThunk:Ye,api:H,assertTagType:Ie}),Lo=$i.middleware;yi(H.util,$i.actions),yi(H,{reducer:dn,middleware:Lo});var Di=function(it){var hn=it.serializeQueryArgs,rn=it.reducerPath,or=function(Nt){return Bn},xr=function(Nt){return _n};return{buildQuerySelector:function(Nt,Wt){return function(xn){var on=hn({queryArgs:xn,endpointDefinition:Wt,endpointName:Nt});return(0,Q.createSelector)(xn===pr?or:function(mn){var xe,Je,Ue;return(Ue=(Je=(xe=Sn(mn))==null?void 0:xe.queries)==null?void 0:Je[on])!=null?Ue:Bn},bi)}},buildMutationSelector:function(){return function(Nt){var Wt,xn;return xn=typeof Nt=="object"?(Wt=Ir(Nt))!=null?Wt:pr:Nt,(0,Q.createSelector)(xn===pr?xr:function(on){var mn,xe,Je;return(Je=(xe=(mn=Sn(on))==null?void 0:mn.mutations)==null?void 0:xe[xn])!=null?Je:_n},bi)}},selectInvalidatedBy:function(Nt,Wt){for(var xn,on=Nt[rn],mn=new Set,xe=0,Je=Wt.map(ye);xe<Je.length;xe++){var Ue=Je[xe],ke=on.provided[Ue.type];if(ke)for(var He=0,ft=(xn=Ue.id!==void 0?ke[Ue.id]:w(Object.values(ke)))!=null?xn:[];He<ft.length;He++)mn.add(ft[He])}return w(Array.from(mn.values()).map(function(Ve){var we=on.queries[Ve];return we?[{queryCacheKey:Ve,endpointName:we.endpointName,originalArgs:we.originalArgs}]:[]}))}};function bi(Nt){return _(_({},Nt),{status:Wt=Nt.status,isUninitialized:Wt===t.uninitialized,isLoading:Wt===t.pending,isSuccess:Wt===t.fulfilled,isError:Wt===t.rejected});var Wt}function Sn(Nt){return Nt[rn]}}({serializeQueryArgs:je,reducerPath:oe}),Sr=Di.buildQuerySelector,vi=Di.buildMutationSelector;yi(H.util,{selectInvalidatedBy:Di.selectInvalidatedBy});var Xn=function(it){var hn=it.serializeQueryArgs,rn=it.queryThunk,or=it.mutationThunk,xr=it.api,bi=it.context,Sn=new Map,Nt=new Map,Wt=xr.internalActions,xn=Wt.unsubscribeQueryResult,on=Wt.removeMutationResult,mn=Wt.updateSubscriptionOptions;return{buildInitiateQuery:function(xe,Je){var Ue=function(ke,He){var ft=He===void 0?{}:He,Ve=ft.subscribe,we=Ve===void 0||Ve,ue=ft.forceRefetch,Ee=ft.subscriptionOptions,fe=ft[ot];return function(ge,Ce){var et,Qe,Ae=hn({queryArgs:ke,endpointDefinition:Je,endpointName:xe}),kt=rn(((et={type:"query",subscribe:we,forceRefetch:ue,subscriptionOptions:Ee,endpointName:xe,originalArgs:ke,queryCacheKey:Ae})[ot]=fe,et)),Ut=xr.endpoints[xe].select(ke),Gt=ge(kt),ar=Ut(Ce()),gr=Gt.requestId,jn=Gt.abort,Pn=ar.requestId!==gr,Xi=(Qe=Sn.get(ge))==null?void 0:Qe[Ae],F=function(){return Ut(Ce())},V=Object.assign(fe?Gt.then(F):Pn&&!Xi?Promise.resolve(ar):Promise.all([Xi,Gt]).then(F),{arg:ke,requestId:gr,subscriptionOptions:Ee,queryCacheKey:Ae,abort:jn,unwrap:function(){return S(this,null,function(){var pe;return r(this,function(Ct){switch(Ct.label){case 0:return[4,V];case 1:if((pe=Ct.sent()).isError)throw pe.error;return[2,pe.data]}})})},refetch:function(){return ge(Ue(ke,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){we&&ge(xn({queryCacheKey:Ae,requestId:gr}))},updateSubscriptionOptions:function(pe){V.subscriptionOptions=pe,ge(mn({endpointName:xe,requestId:gr,queryCacheKey:Ae,options:pe}))}});if(!Xi&&!Pn&&!fe){var X=Sn.get(ge)||{};X[Ae]=V,Sn.set(ge,X),V.then(function(){delete X[Ae],Object.keys(X).length||Sn.delete(ge)})}return V}};return Ue},buildInitiateMutation:function(xe){return function(Je,Ue){var ke=Ue===void 0?{}:Ue,He=ke.track,ft=He===void 0||He,Ve=ke.fixedCacheKey;return function(we,ue){var Ee=or({type:"mutation",endpointName:xe,originalArgs:Je,track:ft,fixedCacheKey:Ve}),fe=we(Ee),ge=fe.requestId,Ce=fe.abort,et=fe.unwrap,Qe=fe.unwrap().then(function(Gt){return{data:Gt}}).catch(function(Gt){return{error:Gt}}),Ae=function(){we(on({requestId:ge,fixedCacheKey:Ve}))},kt=Object.assign(Qe,{arg:fe.arg,requestId:ge,abort:Ce,unwrap:et,unsubscribe:Ae,reset:Ae}),Ut=Nt.get(we)||{};return Nt.set(we,Ut),Ut[ge]=kt,kt.then(function(){delete Ut[ge],Object.keys(Ut).length||Nt.delete(we)}),Ve&&(Ut[Ve]=kt,kt.then(function(){Ut[Ve]===kt&&(delete Ut[Ve],Object.keys(Ut).length||Nt.delete(we))})),kt}}},getRunningQueryThunk:function(xe,Je){return function(Ue){var ke,He=hn({queryArgs:Je,endpointDefinition:bi.endpointDefinitions[xe],endpointName:xe});return(ke=Sn.get(Ue))==null?void 0:ke[He]}},getRunningMutationThunk:function(xe,Je){return function(Ue){var ke;return(ke=Nt.get(Ue))==null?void 0:ke[Je]}},getRunningQueriesThunk:function(){return function(xe){return Object.values(Sn.get(xe)||{}).filter(bt)}},getRunningMutationsThunk:function(){return function(xe){return Object.values(Nt.get(xe)||{}).filter(bt)}},getRunningOperationPromises:function(){var xe=function(Je){return Array.from(Je.values()).flatMap(function(Ue){return Ue?Object.values(Ue):[]})};return i(i([],xe(Sn)),xe(Nt)).filter(bt)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
-       Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
-       See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:Se,mutationThunk:Ye,api:H,serializeQueryArgs:je,context:re}),mo=Xn.buildInitiateQuery,Fa=Xn.buildInitiateMutation;return yi(H.util,{getRunningOperationPromises:Xn.getRunningOperationPromises,getRunningOperationPromise:Xn.removalWarning,getRunningMutationThunk:Xn.getRunningMutationThunk,getRunningMutationsThunk:Xn.getRunningMutationsThunk,getRunningQueryThunk:Xn.getRunningQueryThunk,getRunningQueriesThunk:Xn.getRunningQueriesThunk}),{name:oa,injectEndpoint:function(it,hn){var rn,or=H;(rn=or.endpoints)[it]!=null||(rn[it]={}),ne(hn)?yi(or.endpoints[it],{name:it,select:Sr(it,hn),initiate:mo(it,hn)},wt(Se,it)):hn.type===J.mutation&&yi(or.endpoints[it],{name:it,select:vi(),initiate:Fa(it)},wt(Ye,it))}}}}},ll=po(ri())})(OB);RB.exports=OB;var ble=RB.exports;const oi=["general"],Ji=["control","mask","user","other"],_le=100,hv=20;let Yi=[],nl=(e,t)=>{let n=[],r={get(){return r.lc||r.listen(()=>{})(),r.value},l:t||0,lc:0,listen(i,o){return r.lc=n.push(i,o||r.l)/2,()=>{let a=n.indexOf(i);~a&&(n.splice(a,2),r.lc--,r.lc||r.off())}},notify(i){let o=!Yi.length;for(let a=0;a<n.length;a+=2)Yi.push(n[a],r.value,i,n[a+1]);if(o){for(let a=0;a<Yi.length;a+=4){let s=!1;for(let l=a+7;l<Yi.length;l+=4)if(Yi[l]<Yi[a+3]){s=!0;break}s?Yi.push(Yi[a],Yi[a+1],Yi[a+2],Yi[a+3]):Yi[a](Yi[a+1],Yi[a+2])}Yi.length=0}},off(){},set(i){r.value!==i&&(r.value=i,r.notify())},subscribe(i,o){let a=r.listen(i,o);return i(r.value),a},value:e};return r};const Sle=5,pv=6,gv=10;let xle=(e,t,n,r)=>(e.events=e.events||{},e.events[n+gv]||(e.events[n+gv]=r(i=>{e.events[n].reduceRight((o,a)=>(a(o),o),{shared:{},...i})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let i=e.events[n],o=i.indexOf(t);i.splice(o,1),i.length||(delete e.events[n],e.events[n+gv](),delete e.events[n+gv])}),wle=1e3,Cle=(e,t)=>xle(e,r=>{let i=t(r);i&&e.events[pv].push(i)},Sle,r=>{let i=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...a));let o=e.off;return e.events[pv]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[pv])a();e.events[pv]=[]}},wle)},()=>{e.listen=i,e.off=o}}),Ele=(e,t)=>{Array.isArray(e)||(e=[e]);let n,r=()=>{let o=e.map(a=>a.get());(n===void 0||o.some((a,s)=>a!==n[s]))&&(n=o,i.set(t(...o)))},i=nl(void 0,Math.max(...e.map(o=>o.l))+1);return Cle(i,()=>{let o=e.map(a=>a.listen(r,i.l));return r(),()=>{for(let a of o)a()}}),i};const MB=nl(),Tle={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class n_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Tle,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new n_(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new n_(this.logger,t)}}var $s=new n_;class JS{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(a=>{a(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[t,...r])})}}function qp(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function iI(e){return e==null?"":""+e}function kle(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function _k(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function oI(e,t,n){const{obj:r,k:i}=_k(e,t,Object);r[i]=n}function Ale(e,t,n,r){const{obj:i,k:o}=_k(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function r_(e,t){const{obj:n,k:r}=_k(e,t);if(n)return n[r]}function Ple(e,t,n){const r=r_(e,n);return r!==void 0?r:r_(t,n)}function NB(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):NB(e[r],t[r],n):e[r]=t[r]);return e}function sf(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Ile={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Rle(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Ile[t]):e}const Ole=[" ",",","?","!",";"];function Mle(e,t,n){t=t||"",n=n||"";const r=Ole.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=new RegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function i_(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){let a=2,s=r.slice(o,o+a).join(n),l=i[s];for(;l===void 0&&r.length>o+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const u=r.slice(o+a).join(n);return u?i_(l,u,n):void 0}i=i[r[o]]}return i}function o_(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class aI extends JS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,n];r&&typeof r!="string"&&(s=s.concat(r)),r&&typeof r=="string"&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split("."));const l=r_(this.data,s);return l||!a||typeof r!="string"?l:i_(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),oI(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Object.prototype.toString.apply(r[o])==="[object Array]")&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=r_(this.data,s)||{};i?NB(l,r,o):l={...l,...r},oI(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var $B={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const sI={};class a_ extends JS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),kle(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$s.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Mle(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const v=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${v}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l}:`${l}${v}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l}:a}const d=this.resolve(t,n);let f=d&&d.res;const h=d&&d.usedKey||a,p=d&&d.exactUsedKey||a,m=Object.prototype.toString.apply(f),_=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&_.indexOf(m)<0&&!(typeof b=="string"&&m==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=v,d):v}if(o){const v=m==="[object Array]",S=v?[]:{},w=v?p:h;for(const x in f)if(Object.prototype.hasOwnProperty.call(f,x)){const C=`${w}${o}${x}`;S[x]=this.translate(C,{...n,joinArrays:!1,ns:s}),S[x]===C&&(S[x]=f[x])}f=S}}else if(y&&typeof b=="string"&&m==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let v=!1,S=!1;const w=n.count!==void 0&&typeof n.count!="string",x=a_.hasDefaultValue(n),C=w?this.pluralResolver.getSuffix(u,n.count,n):"",k=n.ordinal&&w?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",T=n[`defaultValue${C}`]||n[`defaultValue${k}`]||n.defaultValue;!this.isValidLookup(f)&&x&&(v=!0,f=T),this.isValidLookup(f)||(S=!0,f=a);const $=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:f,O=x&&T!==f&&this.options.updateMissing;if(S||v||O){if(this.logger.log(O?"updateKey":"missingKey",u,l,a,O?T:f),o){const L=this.resolve(a,{...n,keySeparator:!1});L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let E=[];const A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&A&&A[0])for(let L=0;L<A.length;L++)E.push(A[L]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(n.lng||this.language):E.push(n.lng||this.language);const D=(L,M,R)=>{const N=x&&R!==f?R:$;this.options.missingKeyHandler?this.options.missingKeyHandler(L,l,M,N,O,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(L,l,M,N,O,n),this.emit("missingKey",L,l,M,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?E.forEach(L=>{this.pluralResolver.getSuffixes(L,n).forEach(M=>{D([L],a+M,n[`defaultValue${M}`]||T)})}):D(E,a,T))}f=this.extendTranslation(f,t,n,d,r),S&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${a}`),(S||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,v?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d):f}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language,r),u){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;c<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,h=new Array(f),p=0;p<f;p++)h[p]=arguments[p];return o&&o[0]===h[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):a.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=$B.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:i,...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(_=>{this.isValidLookup(r)||(s=_,!sI[`${m[0]}-${_}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(sI[`${m[0]}-${_}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(b=>{if(this.isValidLookup(r))return;a=b;const y=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,c,b,_,n);else{let v;f&&(v=this.pluralResolver.getSuffix(b,n.count,n));const S=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(c+v),n.ordinal&&v.indexOf(w)===0&&y.push(c+v.replace(w,this.options.pluralSeparator)),h&&y.push(c+S)),p){const x=`${c}${this.options.contextSeparator}${n.context}`;y.push(x),f&&(y.push(x+v),n.ordinal&&v.indexOf(w)===0&&y.push(x+v.replace(w,this.options.pluralSeparator)),h&&y.push(x+S))}}let g;for(;g=y.pop();)this.isValidLookup(r)||(o=g,r=this.getResource(b,_,g,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function aC(e){return e.charAt(0).toUpperCase()+e.slice(1)}class lI{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$s.create("languageUtils")}getScriptPartFromCode(t){if(t=o_(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=o_(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=aC(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=aC(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=aC(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let Nle=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$le={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const Dle=["v1","v2","v3"],Lle=["v4"],uI={zero:0,one:1,two:2,few:3,many:4,other:5};function Fle(){const e={};return Nle.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:$le[t.fc]}})}),e}class Ble{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=$s.create("pluralResolver"),(!this.options.compatibilityJSON||Lle.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Fle()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(o_(t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>uI[i]-uI[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Dle.includes(this.options.compatibilityJSON)}}function cI(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Ple(e,t,n);return!o&&i&&typeof n=="string"&&(o=i_(e,n,r),o===void 0&&(o=i_(t,n,r))),o}class zle{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$s.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const n=t.interpolation;this.escape=n.escape!==void 0?n.escape:Rle,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?sf(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?sf(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?sf(n.nestingPrefix):n.nestingPrefixEscaped||sf("$t("),this.nestingSuffix=n.nestingSuffix?sf(n.nestingSuffix):n.nestingSuffixEscaped||sf(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(p){return p.replace(/\$/g,"$$$$")}const c=p=>{if(p.indexOf(this.formatSeparator)<0){const y=cI(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:p}):y}const m=p.split(this.formatSeparator),_=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(cI(n,l,_,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:_})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>u(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?u(this.escape(p)):u(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof d=="function"){const b=d(t,o,i);a=typeof b=="string"?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=iI(a));const _=p.safeValue(a);if(t=t.replace(o[0],_),f?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,a);const h=f.match(/'/g),p=f.match(/"/g);(h&&h.length%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),u&&(a={...u,...a})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${c}${f}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=iI(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function jle(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(!a)return;const[s,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,"");n[s.trim()]||(n[s.trim()]=u),u==="false"&&(n[s.trim()]=!1),u==="true"&&(n[s.trim()]=!0),isNaN(u)||(n[s.trim()]=parseInt(u,10))})}return{formatName:t,formatOptions:n}}function lf(e){const t={};return function(r,i,o){const a=i+JSON.stringify(o);let s=t[a];return s||(s=e(o_(i),o),t[a]=s),s(r)}}class Ule{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$s.create("formatter"),this.options=t,this.formats={number:lf((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:lf((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:lf((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:lf((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:lf((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=lf(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((s,l)=>{const{formatName:u,formatOptions:c}=jle(l);if(this.formats[u]){let d=s;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=f.locale||f.lng||i.locale||i.lng||r;d=this.formats[u](s,h,{...c,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return s},t)}}function Vle(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class Gle extends JS{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=$s.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,c=!1,a[f]===void 0&&(a[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),r&&this.store.addResourceBundle(o,a,r),this.state[t]=n?-1:2;const s={};this.queue.forEach(l=>{Ale(l.loaded,[o],a),Vle(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...a,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(t,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}else u(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}function dI(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(i=>{n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function fI(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function mv(){}function qle(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class Km extends JS{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=fI(t),this.services={},this.logger=$s,this.modules={external:[]},qle(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=dI();this.options={...i,...this.options,...fI(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function o(c){return c?typeof c=="function"?new c:c:null}if(!this.options.isClone){this.modules.logger?$s.init(o(this.modules.logger),this.options):$s.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Ule);const d=new lI(this.options);this.store=new aI(this.options.resources,this.options);const f=this.services;f.logger=$s,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new Ble(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new zle(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Gle(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new a_(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=mv),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const l=qp(),u=()=>{const c=(d,f)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),r(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mv;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return r();const o=[],a=s=>{if(!s)return;this.services.languageUtils.toResolveHierarchy(s).forEach(u=>{o.indexOf(u)<0&&o.push(u)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=qp();return t||(t=this.languages),n||(n=this.options.ns),r||(r=mv),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&$B.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=qp();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{a(c,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d<u;d++)c[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(c))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||r||o.keyPrefix;const f=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(a)?h=a.map(p=>`${l.keyPrefix}${f}${p}`):h=l.keyPrefix?`${l.keyPrefix}${f}${a}`:a,i.t(h,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=qp();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=qp();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new lI(dI());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Km(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mv;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Km(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new aI(this.store.data,i),o.services.resourceStore=o.store),o.translator=new a_(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];o.emit(s,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const be=Km.createInstance();be.createInstance=Km.createInstance;be.createInstance;be.dir;be.init;be.loadResources;be.reloadResources;be.use;be.changeLanguage;be.getFixedT;const Y=be.t;be.exists;be.setDefaultNamespace;be.hasLoadedNamespace;be.loadNamespaces;be.loadLanguages;const DB=z.enum(["BoardField","boolean","BooleanCollection","BooleanPolymorphic","ClipField","Collection","CollectionItem","ColorCollection","ColorField","ColorPolymorphic","ConditioningCollection","ConditioningField","ConditioningPolymorphic","ControlCollection","ControlField","ControlNetModelField","ControlPolymorphic","DenoiseMaskField","enum","float","FloatCollection","FloatPolymorphic","ImageCollection","ImageField","ImagePolymorphic","integer","IntegerCollection","IntegerPolymorphic","IPAdapterCollection","IPAdapterField","IPAdapterModelField","IPAdapterPolymorphic","LatentsCollection","LatentsField","LatentsPolymorphic","LoRAModelField","MainModelField","ONNXModelField","Scheduler","SDXLMainModelField","SDXLRefinerModelField","string","StringCollection","StringPolymorphic","T2IAdapterCollection","T2IAdapterField","T2IAdapterModelField","T2IAdapterPolymorphic","UNetField","VaeField","VaeModelField"]),Hle=z.enum(["WorkflowField","IsIntermediate","MetadataField"]),hI=e=>DB.safeParse(e).success||Hle.safeParse(e).success;z.enum(["connection","direct","any"]);const LB=z.object({id:z.string().trim().min(1),name:z.string().trim().min(1),type:DB}),Wle=LB.extend({fieldKind:z.literal("output")}),at=LB.extend({fieldKind:z.literal("input"),label:z.string()}),eu=z.object({model_name:z.string().trim().min(1),base_model:xc}),yp=z.object({image_name:z.string().trim().min(1)}),Kle=z.object({board_id:z.string().trim().min(1)}),s_=z.object({latents_name:z.string().trim().min(1),seed:z.number().int().optional()}),l_=z.object({conditioning_name:z.string().trim().min(1)}),Qle=z.object({mask_name:z.string().trim().min(1),masked_latents_name:z.string().trim().min(1).optional()}),Xle=at.extend({type:z.literal("integer"),value:z.number().int().optional()}),Yle=at.extend({type:z.literal("IntegerCollection"),value:z.array(z.number().int()).optional()}),Zle=at.extend({type:z.literal("IntegerPolymorphic"),value:z.number().int().optional()}),Jle=at.extend({type:z.literal("float"),value:z.number().optional()}),eue=at.extend({type:z.literal("FloatCollection"),value:z.array(z.number()).optional()}),tue=at.extend({type:z.literal("FloatPolymorphic"),value:z.number().optional()}),nue=at.extend({type:z.literal("string"),value:z.string().optional()}),rue=at.extend({type:z.literal("StringCollection"),value:z.array(z.string()).optional()}),iue=at.extend({type:z.literal("StringPolymorphic"),value:z.string().optional()}),oue=at.extend({type:z.literal("boolean"),value:z.boolean().optional()}),aue=at.extend({type:z.literal("BooleanCollection"),value:z.array(z.boolean()).optional()}),sue=at.extend({type:z.literal("BooleanPolymorphic"),value:z.boolean().optional()}),lue=at.extend({type:z.literal("enum"),value:z.string().optional()}),uue=at.extend({type:z.literal("LatentsField"),value:s_.optional()}),cue=at.extend({type:z.literal("LatentsCollection"),value:z.array(s_).optional()}),due=at.extend({type:z.literal("LatentsPolymorphic"),value:z.union([s_,z.array(s_)]).optional()}),fue=at.extend({type:z.literal("DenoiseMaskField"),value:Qle.optional()}),hue=at.extend({type:z.literal("ConditioningField"),value:l_.optional()}),pue=at.extend({type:z.literal("ConditioningCollection"),value:z.array(l_).optional()}),gue=at.extend({type:z.literal("ConditioningPolymorphic"),value:z.union([l_,z.array(l_)]).optional()}),mue=eu,Qm=z.object({image:yp,control_model:mue,control_weight:z.union([z.number(),z.array(z.number())]).optional(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional(),control_mode:z.enum(["balanced","more_prompt","more_control","unbalanced"]).optional(),resize_mode:z.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),yue=at.extend({type:z.literal("ControlField"),value:Qm.optional()}),vue=at.extend({type:z.literal("ControlPolymorphic"),value:z.union([Qm,z.array(Qm)]).optional()}),bue=at.extend({type:z.literal("ControlCollection"),value:z.array(Qm).optional()}),FB=eu,Xm=z.object({image:yp,ip_adapter_model:FB,weight:z.number(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional()}),_ue=at.extend({type:z.literal("IPAdapterField"),value:Xm.optional()}),Sue=at.extend({type:z.literal("IPAdapterPolymorphic"),value:z.union([Xm,z.array(Xm)]).optional()}),xue=at.extend({type:z.literal("IPAdapterCollection"),value:z.array(Xm).optional()}),wue=eu,u_=z.object({image:yp,t2i_adapter_model:wue,weight:z.union([z.number(),z.array(z.number())]).optional(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional(),resize_mode:z.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),Cue=at.extend({type:z.literal("T2IAdapterField"),value:u_.optional()}),Eue=at.extend({type:z.literal("T2IAdapterPolymorphic"),value:z.union([u_,z.array(u_)]).optional()}),Tue=at.extend({type:z.literal("T2IAdapterCollection"),value:z.array(u_).optional()}),kue=z.enum(["onnx","main","vae","lora","controlnet","embedding"]),Aue=z.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),Wh=eu.extend({model_type:kue,submodel:Aue.optional()}),BB=Wh.extend({weight:z.number().optional()}),Pue=z.object({unet:Wh,scheduler:Wh,loras:z.array(BB)}),Iue=at.extend({type:z.literal("UNetField"),value:Pue.optional()}),Rue=z.object({tokenizer:Wh,text_encoder:Wh,skipped_layers:z.number(),loras:z.array(BB)}),Oue=at.extend({type:z.literal("ClipField"),value:Rue.optional()}),Mue=z.object({vae:Wh}),Nue=at.extend({type:z.literal("VaeField"),value:Mue.optional()}),$ue=at.extend({type:z.literal("ImageField"),value:yp.optional()}),Due=at.extend({type:z.literal("BoardField"),value:Kle.optional()}),Lue=at.extend({type:z.literal("ImagePolymorphic"),value:yp.optional()}),Fue=at.extend({type:z.literal("ImageCollection"),value:z.array(yp).optional()}),Bue=at.extend({type:z.literal("MainModelField"),value:cy.optional()}),zue=at.extend({type:z.literal("SDXLMainModelField"),value:cy.optional()}),jue=at.extend({type:z.literal("SDXLRefinerModelField"),value:cy.optional()}),zB=eu,Uue=at.extend({type:z.literal("VaeModelField"),value:zB.optional()}),jB=eu,Vue=at.extend({type:z.literal("LoRAModelField"),value:jB.optional()}),Gue=eu,que=at.extend({type:z.literal("ControlNetModelField"),value:Gue.optional()}),Hue=eu,Wue=at.extend({type:z.literal("IPAdapterModelField"),value:Hue.optional()}),Kue=eu,Que=at.extend({type:z.literal("T2IAdapterModelField"),value:Kue.optional()}),Xue=at.extend({type:z.literal("Collection"),value:z.array(z.any()).optional()}),Yue=at.extend({type:z.literal("CollectionItem"),value:z.any().optional()}),c_=z.object({r:z.number().int().min(0).max(255),g:z.number().int().min(0).max(255),b:z.number().int().min(0).max(255),a:z.number().int().min(0).max(255)}),Zue=at.extend({type:z.literal("ColorField"),value:c_.optional()}),Jue=at.extend({type:z.literal("ColorCollection"),value:z.array(c_).optional()}),ece=at.extend({type:z.literal("ColorPolymorphic"),value:z.union([c_,z.array(c_)]).optional()}),tce=at.extend({type:z.literal("Scheduler"),value:xB.optional()}),nce=z.discriminatedUnion("type",[Due,aue,oue,sue,Oue,Xue,Yue,Zue,Jue,ece,hue,pue,gue,yue,que,bue,vue,fue,lue,eue,Jle,tue,Fue,Lue,$ue,Yle,Zle,Xle,_ue,Wue,xue,Sue,uue,cue,due,Vue,Bue,tce,zue,jue,rue,iue,nue,Cue,Que,Tue,Eue,Iue,Nue,Uue]),EGe=e=>!!(e&&e.fieldKind==="input"),TGe=e=>!!(e&&e.fieldKind==="input"),rce=e=>!!(e&&!("$ref"in e)),pI=e=>!!(e&&!("$ref"in e)&&e.type==="array"),yv=e=>!!(e&&!("$ref"in e)&&e.type!=="array"),Hp=e=>!!(e&&"$ref"in e),ice=e=>"class"in e&&e.class==="invocation",oce=e=>"class"in e&&e.class==="output",gI=e=>!("$ref"in e),ace=z.object({lora:jB.deepPartial(),weight:z.number()}),sce=Qm.deepPartial(),lce=Xm.deepPartial(),UB=z.object({app_version:z.string().nullish().catch(null),generation_mode:z.string().nullish().catch(null),created_by:z.string().nullish().catch(null),positive_prompt:z.string().nullish().catch(null),negative_prompt:z.string().nullish().catch(null),width:z.number().int().nullish().catch(null),height:z.number().int().nullish().catch(null),seed:z.number().int().nullish().catch(null),rand_device:z.string().nullish().catch(null),cfg_scale:z.number().nullish().catch(null),steps:z.number().int().nullish().catch(null),scheduler:z.string().nullish().catch(null),clip_skip:z.number().int().nullish().catch(null),model:z.union([YS.deepPartial(),wB.deepPartial()]).nullish().catch(null),controlnets:z.array(sce).nullish().catch(null),ipAdapters:z.array(lce).nullish().catch(null),loras:z.array(ace).nullish().catch(null),vae:zB.nullish().catch(null),strength:z.number().nullish().catch(null),init_image:z.string().nullish().catch(null),positive_style_prompt:z.string().nullish().catch(null),negative_style_prompt:z.string().nullish().catch(null),refiner_model:mk.deepPartial().nullish().catch(null),refiner_cfg_scale:z.number().nullish().catch(null),refiner_steps:z.number().int().nullish().catch(null),refiner_scheduler:z.string().nullish().catch(null),refiner_positive_aesthetic_score:z.number().nullish().catch(null),refiner_negative_aesthetic_score:z.number().nullish().catch(null),refiner_start:z.number().nullish().catch(null)}).passthrough(),Sk=z.string().refine(e=>{const[t,n,r]=e.split(".");return t!==void 0&&Number.isInteger(Number(t))&&n!==void 0&&Number.isInteger(Number(n))&&r!==void 0&&Number.isInteger(Number(r))});Sk.transform(e=>{const[t,n,r]=e.split(".");return{major:Number(t),minor:Number(n),patch:Number(r)}});const mI=z.object({id:z.string().trim().min(1),type:z.string().trim().min(1),inputs:z.record(nce),outputs:z.record(Wle),label:z.string(),isOpen:z.boolean(),notes:z.string(),embedWorkflow:z.boolean(),isIntermediate:z.boolean(),useCache:z.boolean().optional(),version:Sk.optional()}),uce=z.preprocess(e=>{var t;try{const n=mI.parse(e);if(!Aoe(n,"useCache")){const r=(t=MB.get())==null?void 0:t.getState().nodes.nodeTemplates,i=r==null?void 0:r[n.type];let o=!0;i&&(o=i.useCache),Object.assign(n,{useCache:o})}return n}catch{return e}},mI.extend({useCache:z.boolean()})),cce=z.object({id:z.string().trim().min(1),type:z.literal("notes"),label:z.string(),isOpen:z.boolean(),notes:z.string()}),VB=z.object({x:z.number(),y:z.number()}).default({x:0,y:0}),d_=z.number().gt(0).nullish(),GB=z.object({id:z.string().trim().min(1),type:z.literal("invocation"),data:uce,width:d_,height:d_,position:VB}),aE=e=>GB.safeParse(e).success,dce=z.object({id:z.string().trim().min(1),type:z.literal("notes"),data:cce,width:d_,height:d_,position:VB}),qB=z.discriminatedUnion("type",[GB,dce]),fce=z.object({source:z.string().trim().min(1),sourceHandle:z.string().trim().min(1),target:z.string().trim().min(1),targetHandle:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("default")}),hce=z.object({source:z.string().trim().min(1),target:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("collapsed")}),HB=z.union([fce,hce]),pce=z.object({nodeId:z.string().trim().min(1),fieldName:z.string().trim().min(1)}),gce="1.0.0",WB=z.object({name:z.string().default(""),author:z.string().default(""),description:z.string().default(""),version:z.string().default(""),contact:z.string().default(""),tags:z.string().default(""),notes:z.string().default(""),nodes:z.array(qB).default([]),edges:z.array(HB).default([]),exposedFields:z.array(pce).default([]),meta:z.object({version:Sk}).default({version:gce})});WB.transform(e=>{const{nodes:t,edges:n}=e,r=[],i=t.filter(aE),o=gk(i,"id");return n.forEach((a,s)=>{const l=o[a.source],u=o[a.target],c=[];if(l?a.type==="default"&&!(a.sourceHandle in l.data.outputs)&&c.push(`${be.t("nodes.outputField")}"${a.source}.${a.sourceHandle}" ${be.t("nodes.doesNotExist")}`):c.push(`${be.t("nodes.outputNode")} ${a.source} ${be.t("nodes.doesNotExist")}`),u?a.type==="default"&&!(a.targetHandle in u.data.inputs)&&c.push(`${be.t("nodes.inputField")} "${a.target}.${a.targetHandle}" ${be.t("nodes.doesNotExist")}`):c.push(`${be.t("nodes.inputNode")} ${a.target} ${be.t("nodes.doesNotExist")}`),c.length){delete n[s];const d=a.type==="default"?a.sourceHandle:a.source,f=a.type==="default"?a.targetHandle:a.target;r.push({message:`${be.t("nodes.edge")} "${d} -> ${f}" ${be.t("nodes.skipped")}`,issues:c,data:a})}}),{workflow:e,warnings:r}});const Ur=e=>!!(e&&e.type==="invocation"),kGe=e=>!!(e&&!["notes","current_image"].includes(e.type)),yI=e=>!!(e&&e.type==="notes");var Wc=(e=>(e[e.PENDING=0]="PENDING",e[e.IN_PROGRESS=1]="IN_PROGRESS",e[e.COMPLETED=2]="COMPLETED",e[e.FAILED=3]="FAILED",e))(Wc||{});/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const mce=4,vI=0,bI=1,yce=2;function vp(e){let t=e.length;for(;--t>=0;)e[t]=0}const vce=0,KB=1,bce=2,_ce=3,Sce=258,xk=29,dy=256,Ym=dy+1+xk,hh=30,wk=19,QB=2*Ym+1,nd=15,sC=16,xce=7,Ck=256,XB=16,YB=17,ZB=18,sE=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),$1=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wce=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),JB=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cce=512,_l=new Array((Ym+2)*2);vp(_l);const Hg=new Array(hh*2);vp(Hg);const Zm=new Array(Cce);vp(Zm);const Jm=new Array(Sce-_ce+1);vp(Jm);const Ek=new Array(xk);vp(Ek);const f_=new Array(hh);vp(f_);function lC(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let ez,tz,nz;function uC(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const rz=e=>e<256?Zm[e]:Zm[256+(e>>>7)],e0=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Co=(e,t,n)=>{e.bi_valid>sC-n?(e.bi_buf|=t<<e.bi_valid&65535,e0(e,e.bi_buf),e.bi_buf=t>>sC-e.bi_valid,e.bi_valid+=n-sC):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Rs=(e,t,n)=>{Co(e,n[t*2],n[t*2+1])},iz=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Ece=e=>{e.bi_valid===16?(e0(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Tce=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let u,c,d,f,h,p,m=0;for(f=0;f<=nd;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<QB;u++)c=e.heap[u],f=n[n[c*2+1]*2+1]+1,f>l&&(f=l,m++),n[c*2+1]=f,!(c>r)&&(e.bl_count[f]++,h=0,c>=s&&(h=a[c-s]),p=n[c*2],e.opt_len+=p*(f+h),o&&(e.static_len+=p*(i[c*2+1]+h)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(c=e.bl_count[f];c!==0;)d=e.heap[--u],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),c--)}},oz=(e,t,n)=>{const r=new Array(nd+1);let i=0,o,a;for(o=1;o<=nd;o++)i=i+n[o-1]<<1,r[o]=i;for(a=0;a<=t;a++){let s=e[a*2+1];s!==0&&(e[a*2]=iz(r[s]++,s))}},kce=()=>{let e,t,n,r,i;const o=new Array(nd+1);for(n=0,r=0;r<xk-1;r++)for(Ek[r]=n,e=0;e<1<<sE[r];e++)Jm[n++]=r;for(Jm[n-1]=r,i=0,r=0;r<16;r++)for(f_[r]=i,e=0;e<1<<$1[r];e++)Zm[i++]=r;for(i>>=7;r<hh;r++)for(f_[r]=i<<7,e=0;e<1<<$1[r]-7;e++)Zm[256+i++]=r;for(t=0;t<=nd;t++)o[t]=0;for(e=0;e<=143;)_l[e*2+1]=8,e++,o[8]++;for(;e<=255;)_l[e*2+1]=9,e++,o[9]++;for(;e<=279;)_l[e*2+1]=7,e++,o[7]++;for(;e<=287;)_l[e*2+1]=8,e++,o[8]++;for(oz(_l,Ym+1,o),e=0;e<hh;e++)Hg[e*2+1]=5,Hg[e*2]=iz(e,5);ez=new lC(_l,sE,dy+1,Ym,nd),tz=new lC(Hg,$1,0,hh,nd),nz=new lC(new Array(0),wce,0,wk,xce)},az=e=>{let t;for(t=0;t<Ym;t++)e.dyn_ltree[t*2]=0;for(t=0;t<hh;t++)e.dyn_dtree[t*2]=0;for(t=0;t<wk;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ck*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},sz=e=>{e.bi_valid>8?e0(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},_I=(e,t,n,r)=>{const i=t*2,o=n*2;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},cC=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&_I(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!_I(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},SI=(e,t,n)=>{let r,i,o=0,a,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],r===0?Rs(e,i,t):(a=Jm[i],Rs(e,a+dy+1,t),s=sE[a],s!==0&&(i-=Ek[a],Co(e,i,s)),r--,a=rz(r),Rs(e,a,n),s=$1[a],s!==0&&(r-=f_[a],Co(e,r,s)));while(o<e.sym_next);Rs(e,Ck,t)},lE=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,l=-1,u;for(e.heap_len=0,e.heap_max=QB,a=0;a<o;a++)n[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)cC(e,n,a);u=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],cC(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[u*2]=n[a*2]+n[s*2],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[a*2+1]=n[s*2+1]=u,e.heap[1]=u++,cC(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Tce(e,t),oz(n,l,e.bl_count)},xI=(e,t,n)=>{let r,i=-1,o,a=t[0*2+1],s=0,l=7,u=4;for(a===0&&(l=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=a,a=t[(r+1)*2+1],!(++s<l&&o===a)&&(s<u?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[XB*2]++):s<=10?e.bl_tree[YB*2]++:e.bl_tree[ZB*2]++,s=0,i=o,a===0?(l=138,u=3):o===a?(l=6,u=3):(l=7,u=4))},wI=(e,t,n)=>{let r,i=-1,o,a=t[0*2+1],s=0,l=7,u=4;for(a===0&&(l=138,u=3),r=0;r<=n;r++)if(o=a,a=t[(r+1)*2+1],!(++s<l&&o===a)){if(s<u)do Rs(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(Rs(e,o,e.bl_tree),s--),Rs(e,XB,e.bl_tree),Co(e,s-3,2)):s<=10?(Rs(e,YB,e.bl_tree),Co(e,s-3,3)):(Rs(e,ZB,e.bl_tree),Co(e,s-11,7));s=0,i=o,a===0?(l=138,u=3):o===a?(l=6,u=3):(l=7,u=4)}},Ace=e=>{let t;for(xI(e,e.dyn_ltree,e.l_desc.max_code),xI(e,e.dyn_dtree,e.d_desc.max_code),lE(e,e.bl_desc),t=wk-1;t>=3&&e.bl_tree[JB[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Pce=(e,t,n,r)=>{let i;for(Co(e,t-257,5),Co(e,n-1,5),Co(e,r-4,4),i=0;i<r;i++)Co(e,e.bl_tree[JB[i]*2+1],3);wI(e,e.dyn_ltree,t-1),wI(e,e.dyn_dtree,n-1)},Ice=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return vI;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return bI;for(n=32;n<dy;n++)if(e.dyn_ltree[n*2]!==0)return bI;return vI};let CI=!1;const Rce=e=>{CI||(kce(),CI=!0),e.l_desc=new uC(e.dyn_ltree,ez),e.d_desc=new uC(e.dyn_dtree,tz),e.bl_desc=new uC(e.bl_tree,nz),e.bi_buf=0,e.bi_valid=0,az(e)},lz=(e,t,n,r)=>{Co(e,(vce<<1)+(r?1:0),3),sz(e),e0(e,n),e0(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Oce=e=>{Co(e,KB<<1,3),Rs(e,Ck,_l),Ece(e)},Mce=(e,t,n,r)=>{let i,o,a=0;e.level>0?(e.strm.data_type===yce&&(e.strm.data_type=Ice(e)),lE(e,e.l_desc),lE(e,e.d_desc),a=Ace(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&t!==-1?lz(e,t,n,r):e.strategy===mce||o===i?(Co(e,(KB<<1)+(r?1:0),3),SI(e,_l,Hg)):(Co(e,(bce<<1)+(r?1:0),3),Pce(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),SI(e,e.dyn_ltree,e.dyn_dtree)),az(e),r&&sz(e)},Nce=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Jm[n]+dy+1)*2]++,e.dyn_dtree[rz(t)*2]++),e.sym_next===e.sym_end);var $ce=Rce,Dce=lz,Lce=Mce,Fce=Nce,Bce=Oce,zce={_tr_init:$ce,_tr_stored_block:Dce,_tr_flush_block:Lce,_tr_tally:Fce,_tr_align:Bce};const jce=(e,t,n,r)=>{let i=e&65535|0,o=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do i=i+t[r++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};var t0=jce;const Uce=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},Vce=new Uint32Array(Uce()),Gce=(e,t,n,r)=>{const i=Vce,o=r+n;e^=-1;for(let a=r;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1};var si=Gce,Kh={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},fy={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:qce,_tr_stored_block:uE,_tr_flush_block:Hce,_tr_tally:Wu,_tr_align:Wce}=zce,{Z_NO_FLUSH:Ku,Z_PARTIAL_FLUSH:Kce,Z_FULL_FLUSH:Qce,Z_FINISH:va,Z_BLOCK:EI,Z_OK:Ei,Z_STREAM_END:TI,Z_STREAM_ERROR:Us,Z_DATA_ERROR:Xce,Z_BUF_ERROR:dC,Z_DEFAULT_COMPRESSION:Yce,Z_FILTERED:Zce,Z_HUFFMAN_ONLY:vv,Z_RLE:Jce,Z_FIXED:ede,Z_DEFAULT_STRATEGY:tde,Z_UNKNOWN:nde,Z_DEFLATED:e2}=fy,rde=9,ide=15,ode=8,ade=29,sde=256,cE=sde+1+ade,lde=30,ude=19,cde=2*cE+1,dde=15,zt=3,Du=258,Vs=Du+zt+1,fde=32,Qh=42,Tk=57,dE=69,fE=73,hE=91,pE=103,rd=113,bg=666,no=1,bp=2,Rd=3,_p=4,hde=3,id=(e,t)=>(e.msg=Kh[t],t),kI=e=>e*2-(e>4?9:0),ku=e=>{let t=e.length;for(;--t>=0;)e[t]=0},pde=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let gde=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Qu=gde;const Bo=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Wo=(e,t)=>{Hce(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bo(e.strm)},an=(e,t)=>{e.pending_buf[e.pending++]=t},Wp=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},gE=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=t0(e.adler,t,i,n):e.state.wrap===2&&(e.adler=si(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},uz=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,o,a=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-Vs?e.strstart-(e.w_size-Vs):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+Du;let h=u[r+a-1],p=u[r+a];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(u[i+a]!==p||u[i+a-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<f);if(o=Du-(f-r),r=f-Du,o>a){if(e.match_start=t,a=o,o>=s)break;h=u[r+a-1],p=u[r+a]}}while((t=d[t&c])>l&&--n!==0);return a<=e.lookahead?a:e.lookahead},Xh=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Vs)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),pde(e),r+=t),e.strm.avail_in===0)break;if(n=gE(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=zt)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Qu(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Qu(e,e.ins_h,e.window[i+zt-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<zt)););}while(e.lookahead<Vs&&e.strm.avail_in!==0)},cz=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,o,a=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>o&&(r=o),r<n&&(r===0&&t!==va||t===Ku||r!==i+e.strm.avail_in)))break;a=t===va&&r===i+e.strm.avail_in?1:0,uE(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Bo(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(gE(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?_p:t!==Ku&&t!==va&&e.strm.avail_in===0&&e.strstart===e.block_start?bp:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(gE(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=n||(i||t===va)&&t!==Ku&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,a=t===va&&e.strm.avail_in===0&&r===i?1:0,uE(e,e.block_start,r,a),e.block_start+=r,Bo(e.strm)),a?Rd:no)},fC=(e,t)=>{let n,r;for(;;){if(e.lookahead<Vs){if(Xh(e),e.lookahead<Vs&&t===Ku)return no;if(e.lookahead===0)break}if(n=0,e.lookahead>=zt&&(e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Vs&&(e.match_length=uz(e,n)),e.match_length>=zt)if(r=Wu(e,e.strstart-e.match_start,e.match_length-zt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=zt){e.match_length--;do e.strstart++,e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+1]);else r=Wu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Wo(e,!1),e.strm.avail_out===0))return no}return e.insert=e.strstart<zt-1?e.strstart:zt-1,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp},uf=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Vs){if(Xh(e),e.lookahead<Vs&&t===Ku)return no;if(e.lookahead===0)break}if(n=0,e.lookahead>=zt&&(e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=zt-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Vs&&(e.match_length=uz(e,n),e.match_length<=5&&(e.strategy===Zce||e.match_length===zt&&e.strstart-e.match_start>4096)&&(e.match_length=zt-1)),e.prev_length>=zt&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-zt,r=Wu(e,e.strstart-1-e.prev_match,e.prev_length-zt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=zt-1,e.strstart++,r&&(Wo(e,!1),e.strm.avail_out===0))return no}else if(e.match_available){if(r=Wu(e,0,e.window[e.strstart-1]),r&&Wo(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return no}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Wu(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<zt-1?e.strstart:zt-1,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp},mde=(e,t)=>{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=Du){if(Xh(e),e.lookahead<=Du&&t===Ku)return no;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=zt&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+Du;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=Du-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=zt?(n=Wu(e,1,e.match_length-zt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Wu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Wo(e,!1),e.strm.avail_out===0))return no}return e.insert=0,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp},yde=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Xh(e),e.lookahead===0)){if(t===Ku)return no;break}if(e.match_length=0,n=Wu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Wo(e,!1),e.strm.avail_out===0))return no}return e.insert=0,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp};function vs(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const _g=[new vs(0,0,0,0,cz),new vs(4,4,8,4,fC),new vs(4,5,16,8,fC),new vs(4,6,32,32,fC),new vs(4,4,16,16,uf),new vs(8,16,32,32,uf),new vs(8,16,128,128,uf),new vs(8,32,128,256,uf),new vs(32,128,258,1024,uf),new vs(32,258,258,4096,uf)],vde=e=>{e.window_size=2*e.w_size,ku(e.head),e.max_lazy_match=_g[e.level].max_lazy,e.good_match=_g[e.level].good_length,e.nice_match=_g[e.level].nice_length,e.max_chain_length=_g[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=zt-1,e.match_available=0,e.ins_h=0};function bde(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=e2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(cde*2),this.dyn_dtree=new Uint16Array((2*lde+1)*2),this.bl_tree=new Uint16Array((2*ude+1)*2),ku(this.dyn_ltree),ku(this.dyn_dtree),ku(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(dde+1),this.heap=new Uint16Array(2*cE+1),ku(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*cE+1),ku(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const hy=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Qh&&t.status!==Tk&&t.status!==dE&&t.status!==fE&&t.status!==hE&&t.status!==pE&&t.status!==rd&&t.status!==bg?1:0},dz=e=>{if(hy(e))return id(e,Us);e.total_in=e.total_out=0,e.data_type=nde;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Tk:t.wrap?Qh:rd,e.adler=t.wrap===2?0:1,t.last_flush=-2,qce(t),Ei},fz=e=>{const t=dz(e);return t===Ei&&vde(e.state),t},_de=(e,t)=>hy(e)||e.state.wrap!==2?Us:(e.state.gzhead=t,Ei),hz=(e,t,n,r,i,o)=>{if(!e)return Us;let a=1;if(t===Yce&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>rde||n!==e2||r<8||r>15||t<0||t>9||o<0||o>ede||r===8&&a!==1)return id(e,Us);r===8&&(r=9);const s=new bde;return e.state=s,s.strm=e,s.status=Qh,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+zt-1)/zt),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=o,s.method=n,fz(e)},Sde=(e,t)=>hz(e,t,e2,ide,ode,tde),xde=(e,t)=>{if(hy(e)||t>EI||t<0)return e?id(e,Us):Us;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===bg&&t!==va)return id(e,e.avail_out===0?dC:Us);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Bo(e),e.avail_out===0)return n.last_flush=-1,Ei}else if(e.avail_in===0&&kI(t)<=kI(r)&&t!==va)return id(e,dC);if(n.status===bg&&e.avail_in!==0)return id(e,dC);if(n.status===Qh&&n.wrap===0&&(n.status=rd),n.status===Qh){let i=e2+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=vv||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=fde),i+=31-i%31,Wp(n,i),n.strstart!==0&&(Wp(n,e.adler>>>16),Wp(n,e.adler&65535)),e.adler=1,n.status=rd,Bo(e),n.pending!==0)return n.last_flush=-1,Ei}if(n.status===Tk){if(e.adler=0,an(n,31),an(n,139),an(n,8),n.gzhead)an(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),an(n,n.gzhead.time&255),an(n,n.gzhead.time>>8&255),an(n,n.gzhead.time>>16&255),an(n,n.gzhead.time>>24&255),an(n,n.level===9?2:n.strategy>=vv||n.level<2?4:0),an(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(an(n,n.gzhead.extra.length&255),an(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=si(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=dE;else if(an(n,0),an(n,0),an(n,0),an(n,0),an(n,0),an(n,n.level===9?2:n.strategy>=vv||n.level<2?4:0),an(n,hde),n.status=rd,Bo(e),n.pending!==0)return n.last_flush=-1,Ei}if(n.status===dE){if(n.gzhead.extra){let i=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,Bo(e),n.pending!==0)return n.last_flush=-1,Ei;i=0,o-=s}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=fE}if(n.status===fE){if(n.gzhead.name){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),Bo(e),n.pending!==0)return n.last_flush=-1,Ei;i=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,an(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=hE}if(n.status===hE){if(n.gzhead.comment){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),Bo(e),n.pending!==0)return n.last_flush=-1,Ei;i=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,an(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i))}n.status=pE}if(n.status===pE){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Bo(e),n.pending!==0))return n.last_flush=-1,Ei;an(n,e.adler&255),an(n,e.adler>>8&255),e.adler=0}if(n.status=rd,Bo(e),n.pending!==0)return n.last_flush=-1,Ei}if(e.avail_in!==0||n.lookahead!==0||t!==Ku&&n.status!==bg){let i=n.level===0?cz(n,t):n.strategy===vv?yde(n,t):n.strategy===Jce?mde(n,t):_g[n.level].func(n,t);if((i===Rd||i===_p)&&(n.status=bg),i===no||i===Rd)return e.avail_out===0&&(n.last_flush=-1),Ei;if(i===bp&&(t===Kce?Wce(n):t!==EI&&(uE(n,0,0,!1),t===Qce&&(ku(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Bo(e),e.avail_out===0))return n.last_flush=-1,Ei}return t!==va?Ei:n.wrap<=0?TI:(n.wrap===2?(an(n,e.adler&255),an(n,e.adler>>8&255),an(n,e.adler>>16&255),an(n,e.adler>>24&255),an(n,e.total_in&255),an(n,e.total_in>>8&255),an(n,e.total_in>>16&255),an(n,e.total_in>>24&255)):(Wp(n,e.adler>>>16),Wp(n,e.adler&65535)),Bo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ei:TI)},wde=e=>{if(hy(e))return Us;const t=e.state.status;return e.state=null,t===rd?id(e,Xce):Ei},Cde=(e,t)=>{let n=t.length;if(hy(e))return Us;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Qh||r.lookahead)return Us;if(i===1&&(e.adler=t0(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ku(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(t.subarray(n-r.w_size,n),0),t=l,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Xh(r);r.lookahead>=zt;){let l=r.strstart,u=r.lookahead-(zt-1);do r.ins_h=Qu(r,r.ins_h,r.window[l+zt-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=zt-1,Xh(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=zt-1,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,Ei};var Ede=Sde,Tde=hz,kde=fz,Ade=dz,Pde=_de,Ide=xde,Rde=wde,Ode=Cde,Mde="pako deflate (from Nodeca project)",Wg={deflateInit:Ede,deflateInit2:Tde,deflateReset:kde,deflateResetKeep:Ade,deflateSetHeader:Pde,deflate:Ide,deflateEnd:Rde,deflateSetDictionary:Ode,deflateInfo:Mde};const Nde=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var $de=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)Nde(n,r)&&(e[r]=n[r])}}return e},Dde=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,o=e.length;r<o;r++){let a=e[r];n.set(a,i),i+=a.length}return n},t2={assign:$de,flattenChunks:Dde};let pz=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{pz=!1}const n0=new Uint8Array(256);for(let e=0;e<256;e++)n0[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;n0[254]=n0[254]=1;var Lde=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const Fde=(e,t)=>{if(t<65534&&e.subarray&&pz)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var Bde=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const o=new Array(n*2);for(i=0,r=0;r<n;){let a=e[r++];if(a<128){o[i++]=a;continue}let s=n0[a];if(s>4){o[i++]=65533,r+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&r<n;)a=a<<6|e[r++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return Fde(o,i)},zde=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+n0[e[n]]>t?n:t},r0={string2buf:Lde,buf2string:Bde,utf8border:zde};function jde(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var gz=jde;const mz=Object.prototype.toString,{Z_NO_FLUSH:Ude,Z_SYNC_FLUSH:Vde,Z_FULL_FLUSH:Gde,Z_FINISH:qde,Z_OK:h_,Z_STREAM_END:Hde,Z_DEFAULT_COMPRESSION:Wde,Z_DEFAULT_STRATEGY:Kde,Z_DEFLATED:Qde}=fy;function kk(e){this.options=t2.assign({level:Wde,method:Qde,chunkSize:16384,windowBits:15,memLevel:8,strategy:Kde},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new gz,this.strm.avail_out=0;let n=Wg.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h_)throw new Error(Kh[n]);if(t.header&&Wg.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=r0.string2buf(t.dictionary):mz.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Wg.deflateSetDictionary(this.strm,r),n!==h_)throw new Error(Kh[n]);this._dict_set=!0}}kk.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?qde:Ude,typeof e=="string"?n.input=r0.string2buf(e):mz.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===Vde||o===Gde)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Wg.deflate(n,o),i===Hde)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Wg.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===h_;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};kk.prototype.onData=function(e){this.chunks.push(e)};kk.prototype.onEnd=function(e){e===h_&&(this.result=t2.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const bv=16209,Xde=16191;var Yde=function(t,n){let r,i,o,a,s,l,u,c,d,f,h,p,m,_,b,y,g,v,S,w,x,C,k,T;const P=t.state;r=t.next_in,k=t.input,i=r+(t.avail_in-5),o=t.next_out,T=t.output,a=o-(n-t.avail_out),s=o+(t.avail_out-257),l=P.dmax,u=P.wsize,c=P.whave,d=P.wnext,f=P.window,h=P.hold,p=P.bits,m=P.lencode,_=P.distcode,b=(1<<P.lenbits)-1,y=(1<<P.distbits)-1;e:do{p<15&&(h+=k[r++]<<p,p+=8,h+=k[r++]<<p,p+=8),g=m[h&b];t:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v===0)T[o++]=g&65535;else if(v&16){S=g&65535,v&=15,v&&(p<v&&(h+=k[r++]<<p,p+=8),S+=h&(1<<v)-1,h>>>=v,p-=v),p<15&&(h+=k[r++]<<p,p+=8,h+=k[r++]<<p,p+=8),g=_[h&y];n:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v&16){if(w=g&65535,v&=15,p<v&&(h+=k[r++]<<p,p+=8,p<v&&(h+=k[r++]<<p,p+=8)),w+=h&(1<<v)-1,w>l){t.msg="invalid distance too far back",P.mode=bv;break e}if(h>>>=v,p-=v,v=o-a,w>v){if(v=w-v,v>c&&P.sane){t.msg="invalid distance too far back",P.mode=bv;break e}if(x=0,C=f,d===0){if(x+=u-v,v<S){S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}}else if(d<v){if(x+=u+d-v,v-=d,v<S){S-=v;do T[o++]=f[x++];while(--v);if(x=0,d<S){v=d,S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}}}else if(x+=d-v,v<S){S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}for(;S>2;)T[o++]=C[x++],T[o++]=C[x++],T[o++]=C[x++],S-=3;S&&(T[o++]=C[x++],S>1&&(T[o++]=C[x++]))}else{x=o-w;do T[o++]=T[x++],T[o++]=T[x++],T[o++]=T[x++],S-=3;while(S>2);S&&(T[o++]=T[x++],S>1&&(T[o++]=T[x++]))}}else if(v&64){t.msg="invalid distance code",P.mode=bv;break e}else{g=_[(g&65535)+(h&(1<<v)-1)];continue n}break}}else if(v&64)if(v&32){P.mode=Xde;break e}else{t.msg="invalid literal/length code",P.mode=bv;break e}else{g=m[(g&65535)+(h&(1<<v)-1)];continue t}break}}while(r<i&&o<s);S=p>>3,r-=S,p-=S<<3,h&=(1<<p)-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=o<s?257+(s-o):257-(o-s),P.hold=h,P.bits=p};const cf=15,AI=852,PI=592,II=0,hC=1,RI=2,Zde=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Jde=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),efe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),tfe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),nfe=(e,t,n,r,i,o,a,s)=>{const l=s.bits;let u=0,c=0,d=0,f=0,h=0,p=0,m=0,_=0,b=0,y=0,g,v,S,w,x,C=null,k;const T=new Uint16Array(cf+1),P=new Uint16Array(cf+1);let $=null,O,E,A;for(u=0;u<=cf;u++)T[u]=0;for(c=0;c<r;c++)T[t[n+c]]++;for(h=l,f=cf;f>=1&&T[f]===0;f--);if(h>f&&(h=f),f===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&T[d]===0;d++);for(h<d&&(h=d),_=1,u=1;u<=cf;u++)if(_<<=1,_-=T[u],_<0)return-1;if(_>0&&(e===II||f!==1))return-1;for(P[1]=0,u=1;u<cf;u++)P[u+1]=P[u]+T[u];for(c=0;c<r;c++)t[n+c]!==0&&(a[P[t[n+c]]++]=c);if(e===II?(C=$=a,k=20):e===hC?(C=Zde,$=Jde,k=257):(C=efe,$=tfe,k=0),y=0,c=0,u=d,x=o,p=h,m=0,S=-1,b=1<<h,w=b-1,e===hC&&b>AI||e===RI&&b>PI)return 1;for(;;){O=u-m,a[c]+1<k?(E=0,A=a[c]):a[c]>=k?(E=$[a[c]-k],A=C[a[c]-k]):(E=32+64,A=0),g=1<<u-m,v=1<<p,d=v;do v-=g,i[x+(y>>m)+v]=O<<24|E<<16|A|0;while(v!==0);for(g=1<<u-1;y&g;)g>>=1;if(g!==0?(y&=g-1,y+=g):y=0,c++,--T[u]===0){if(u===f)break;u=t[n+a[c]]}if(u>h&&(y&w)!==S){for(m===0&&(m=h),x+=d,p=u-m,_=1<<p;p+m<f&&(_-=T[p+m],!(_<=0));)p++,_<<=1;if(b+=1<<p,e===hC&&b>AI||e===RI&&b>PI)return 1;S=y&w,i[S]=h<<24|p<<16|x-o|0}}return y!==0&&(i[x+y]=u-m<<24|64<<16|0),s.bits=h,0};var Kg=nfe;const rfe=0,yz=1,vz=2,{Z_FINISH:OI,Z_BLOCK:ife,Z_TREES:_v,Z_OK:Od,Z_STREAM_END:ofe,Z_NEED_DICT:afe,Z_STREAM_ERROR:Ta,Z_DATA_ERROR:bz,Z_MEM_ERROR:_z,Z_BUF_ERROR:sfe,Z_DEFLATED:MI}=fy,n2=16180,NI=16181,$I=16182,DI=16183,LI=16184,FI=16185,BI=16186,zI=16187,jI=16188,UI=16189,p_=16190,ul=16191,pC=16192,VI=16193,gC=16194,GI=16195,qI=16196,HI=16197,WI=16198,Sv=16199,xv=16200,KI=16201,QI=16202,XI=16203,YI=16204,ZI=16205,mC=16206,JI=16207,eR=16208,Jn=16209,Sz=16210,xz=16211,lfe=852,ufe=592,cfe=15,dfe=cfe,tR=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ffe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Vd=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<n2||t.mode>xz?1:0},wz=e=>{if(Vd(e))return Ta;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=n2,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(lfe),t.distcode=t.distdyn=new Int32Array(ufe),t.sane=1,t.back=-1,Od},Cz=e=>{if(Vd(e))return Ta;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,wz(e)},Ez=(e,t)=>{let n;if(Vd(e))return Ta;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Ta:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Cz(e))},Tz=(e,t)=>{if(!e)return Ta;const n=new ffe;e.state=n,n.strm=e,n.window=null,n.mode=n2;const r=Ez(e,t);return r!==Od&&(e.state=null),r},hfe=e=>Tz(e,dfe);let nR=!0,yC,vC;const pfe=e=>{if(nR){yC=new Int32Array(512),vC=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Kg(yz,e.lens,0,288,yC,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Kg(vz,e.lens,0,32,vC,0,e.work,{bits:5}),nR=!1}e.lencode=yC,e.lenbits=9,e.distcode=vC,e.distbits=5},kz=(e,t,n,r)=>{let i;const o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),r-=i,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},gfe=(e,t)=>{let n,r,i,o,a,s,l,u,c,d,f,h,p,m,_=0,b,y,g,v,S,w,x,C;const k=new Uint8Array(4);let T,P;const $=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Vd(e)||!e.output||!e.input&&e.avail_in!==0)return Ta;n=e.state,n.mode===ul&&(n.mode=pC),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,d=s,f=l,C=Od;e:for(;;)switch(n.mode){case n2:if(n.wrap===0){n.mode=pC;break}for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0),u=0,c=0,n.mode=NI;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Jn;break}if((u&15)!==MI){e.msg="unknown compression method",n.mode=Jn;break}if(u>>>=4,c-=4,x=(u&15)+8,n.wbits===0&&(n.wbits=x),x>15||x>n.wbits){e.msg="invalid window size",n.mode=Jn;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?UI:ul,u=0,c=0;break;case NI:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.flags=u,(n.flags&255)!==MI){e.msg="unknown compression method",n.mode=Jn;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Jn;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0)),u=0,c=0,n.mode=$I;case $I:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,k[2]=u>>>16&255,k[3]=u>>>24&255,n.check=si(n.check,k,4,0)),u=0,c=0,n.mode=DI;case DI:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0)),u=0,c=0,n.mode=LI;case LI:if(n.flags&1024){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=FI;case FI:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+h),x)),n.flags&512&&n.wrap&4&&(n.check=si(n.check,r,h,o)),s-=h,o+=h,n.length-=h),n.length))break e;n.length=0,n.mode=BI;case BI:if(n.flags&2048){if(s===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x));while(x&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=si(n.check,r,h,o)),s-=h,o+=h,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=zI;case zI:if(n.flags&4096){if(s===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x));while(x&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=si(n.check,r,h,o)),s-=h,o+=h,x)break e}else n.head&&(n.head.comment=null);n.mode=jI;case jI:if(n.flags&512){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Jn;break}u=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ul;break;case UI:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}e.adler=n.check=tR(u),u=0,c=0,n.mode=p_;case p_:if(n.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,afe;e.adler=n.check=1,n.mode=ul;case ul:if(t===ife||t===_v)break e;case pC:if(n.last){u>>>=c&7,c-=c&7,n.mode=mC;break}for(;c<3;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}switch(n.last=u&1,u>>>=1,c-=1,u&3){case 0:n.mode=VI;break;case 1:if(pfe(n),n.mode=Sv,t===_v){u>>>=2,c-=2;break e}break;case 2:n.mode=qI;break;case 3:e.msg="invalid block type",n.mode=Jn}u>>>=2,c-=2;break;case VI:for(u>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Jn;break}if(n.length=u&65535,u=0,c=0,n.mode=gC,t===_v)break e;case gC:n.mode=GI;case GI:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;i.set(r.subarray(o,o+h),a),s-=h,o+=h,l-=h,a+=h,n.length-=h;break}n.mode=ul;break;case qI:for(;c<14;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.nlen=(u&31)+257,u>>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Jn;break}n.have=0,n.mode=HI;case HI:for(;n.have<n.ncode;){for(;c<3;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.lens[$[n.have++]]=u&7,u>>>=3,c-=3}for(;n.have<19;)n.lens[$[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,T={bits:n.lenbits},C=Kg(rfe,n.lens,0,19,n.lencode,0,n.work,T),n.lenbits=T.bits,C){e.msg="invalid code lengths set",n.mode=Jn;break}n.have=0,n.mode=WI;case WI:for(;n.have<n.nlen+n.ndist;){for(;_=n.lencode[u&(1<<n.lenbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(g<16)u>>>=b,c-=b,n.lens[n.have++]=g;else{if(g===16){for(P=b+2;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(u>>>=b,c-=b,n.have===0){e.msg="invalid bit length repeat",n.mode=Jn;break}x=n.lens[n.have-1],h=3+(u&3),u>>>=2,c-=2}else if(g===17){for(P=b+3;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=b,c-=b,x=0,h=3+(u&7),u>>>=3,c-=3}else{for(P=b+7;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=b,c-=b,x=0,h=11+(u&127),u>>>=7,c-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Jn;break}for(;h--;)n.lens[n.have++]=x}}if(n.mode===Jn)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Jn;break}if(n.lenbits=9,T={bits:n.lenbits},C=Kg(yz,n.lens,0,n.nlen,n.lencode,0,n.work,T),n.lenbits=T.bits,C){e.msg="invalid literal/lengths set",n.mode=Jn;break}if(n.distbits=6,n.distcode=n.distdyn,T={bits:n.distbits},C=Kg(vz,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T),n.distbits=T.bits,C){e.msg="invalid distances set",n.mode=Jn;break}if(n.mode=Sv,t===_v)break e;case Sv:n.mode=xv;case xv:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,Yde(e,f),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,n.mode===ul&&(n.back=-1);break}for(n.back=0;_=n.lencode[u&(1<<n.lenbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(y&&!(y&240)){for(v=b,S=y,w=g;_=n.lencode[w+((u&(1<<v+S)-1)>>v)],b=_>>>24,y=_>>>16&255,g=_&65535,!(v+b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=b,c-=b,n.back+=b,n.length=g,y===0){n.mode=ZI;break}if(y&32){n.back=-1,n.mode=ul;break}if(y&64){e.msg="invalid literal/length code",n.mode=Jn;break}n.extra=y&15,n.mode=KI;case KI:if(n.extra){for(P=n.extra;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=QI;case QI:for(;_=n.distcode[u&(1<<n.distbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(!(y&240)){for(v=b,S=y,w=g;_=n.distcode[w+((u&(1<<v+S)-1)>>v)],b=_>>>24,y=_>>>16&255,g=_&65535,!(v+b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=b,c-=b,n.back+=b,y&64){e.msg="invalid distance code",n.mode=Jn;break}n.offset=g,n.extra=y&15,n.mode=XI;case XI:if(n.extra){for(P=n.extra;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Jn;break}n.mode=YI;case YI:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Jn;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=i,p=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[a++]=m[p++];while(--h);n.length===0&&(n.mode=xv);break;case ZI:if(l===0)break e;i[a++]=n.length,l--,n.mode=xv;break;case mC:if(n.wrap){for(;c<32;){if(s===0)break e;s--,u|=r[o++]<<c,c+=8}if(f-=l,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?si(n.check,i,f,a-f):t0(n.check,i,f,a-f)),f=l,n.wrap&4&&(n.flags?u:tR(u))!==n.check){e.msg="incorrect data check",n.mode=Jn;break}u=0,c=0}n.mode=JI;case JI:if(n.wrap&&n.flags){for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Jn;break}u=0,c=0}n.mode=eR;case eR:C=ofe;break e;case Jn:C=bz;break e;case Sz:return _z;case xz:default:return Ta}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,(n.wsize||f!==e.avail_out&&n.mode<Jn&&(n.mode<mC||t!==OI))&&kz(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?si(n.check,i,f,e.next_out-f):t0(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ul?128:0)+(n.mode===Sv||n.mode===gC?256:0),(d===0&&f===0||t===OI)&&C===Od&&(C=sfe),C},mfe=e=>{if(Vd(e))return Ta;let t=e.state;return t.window&&(t.window=null),e.state=null,Od},yfe=(e,t)=>{if(Vd(e))return Ta;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Od):Ta},vfe=(e,t)=>{const n=t.length;let r,i,o;return Vd(e)||(r=e.state,r.wrap!==0&&r.mode!==p_)?Ta:r.mode===p_&&(i=1,i=t0(i,t,n,0),i!==r.check)?bz:(o=kz(e,t,n,n),o?(r.mode=Sz,_z):(r.havedict=1,Od))};var bfe=Cz,_fe=Ez,Sfe=wz,xfe=hfe,wfe=Tz,Cfe=gfe,Efe=mfe,Tfe=yfe,kfe=vfe,Afe="pako inflate (from Nodeca project)",Sl={inflateReset:bfe,inflateReset2:_fe,inflateResetKeep:Sfe,inflateInit:xfe,inflateInit2:wfe,inflate:Cfe,inflateEnd:Efe,inflateGetHeader:Tfe,inflateSetDictionary:kfe,inflateInfo:Afe};function Pfe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Ife=Pfe;const Az=Object.prototype.toString,{Z_NO_FLUSH:Rfe,Z_FINISH:Ofe,Z_OK:i0,Z_STREAM_END:bC,Z_NEED_DICT:_C,Z_STREAM_ERROR:Mfe,Z_DATA_ERROR:rR,Z_MEM_ERROR:Nfe}=fy;function py(e){this.options=t2.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new gz,this.strm.avail_out=0;let n=Sl.inflateInit2(this.strm,t.windowBits);if(n!==i0)throw new Error(Kh[n]);if(this.header=new Ife,Sl.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=r0.string2buf(t.dictionary):Az.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Sl.inflateSetDictionary(this.strm,t.dictionary),n!==i0)))throw new Error(Kh[n])}py.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Ofe:Rfe,Az.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Sl.inflate(n,a),o===_C&&i&&(o=Sl.inflateSetDictionary(n,i),o===i0?o=Sl.inflate(n,a):o===rR&&(o=_C));n.avail_in>0&&o===bC&&n.state.wrap>0&&e[n.next_in]!==0;)Sl.inflateReset(n),o=Sl.inflate(n,a);switch(o){case Mfe:case rR:case _C:case Nfe:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===bC))if(this.options.to==="string"){let l=r0.utf8border(n.output,n.next_out),u=n.next_out-l,c=r0.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===i0&&s===0)){if(o===bC)return o=Sl.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};py.prototype.onData=function(e){this.chunks.push(e)};py.prototype.onEnd=function(e){e===i0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t2.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ak(e,t){const n=new py(t);if(n.push(e),n.err)throw n.msg||Kh[n.err];return n.result}function $fe(e,t){return t=t||{},t.raw=!0,Ak(e,t)}var Dfe=py,Lfe=Ak,Ffe=$fe,Bfe=Ak,zfe=fy,jfe={Inflate:Dfe,inflate:Lfe,inflateRaw:Ffe,ungzip:Bfe,constants:zfe};const{Inflate:AGe,inflate:Ufe,inflateRaw:PGe,ungzip:IGe}=jfe;var Pz=Ufe;const Iz=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;Iz[e]=t}function Vfe(e){let t=-1;for(let n=0;n<e.length;n++)t=Iz[(t^e[n])&255]^t>>>8;return t^-1}var er;(function(e){e[e.GRAYSCALE=0]="GRAYSCALE",e[e.TRUE_COLOR=2]="TRUE_COLOR",e[e.PALETTE=3]="PALETTE",e[e.GRAYSCALE_WITH_ALPHA=4]="GRAYSCALE_WITH_ALPHA",e[e.TRUE_COLOR_WITH_ALPHA=6]="TRUE_COLOR_WITH_ALPHA"})(er||(er={}));const Gfe={[er.GRAYSCALE]:1,[er.TRUE_COLOR]:3,[er.PALETTE]:1,[er.GRAYSCALE_WITH_ALPHA]:2,[er.TRUE_COLOR_WITH_ALPHA]:4},qfe=1;var Go;(function(e){e[e.NONE=0]="NONE",e[e.SUB=1]="SUB",e[e.UP=2]="UP",e[e.AVERAGE=3]="AVERAGE",e[e.PAETH=4]="PAETH"})(Go||(Go={}));const Hfe={[Go.NONE](e){return e},[Go.SUB](e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++){const i=n[r-t]||0;n[r]=e[r]+i}return n},[Go.UP](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=n[i]||0;r[i]=o+e[i]}return r},[Go.AVERAGE](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,a=n[i]||0,s=o+a>>1;r[i]=e[i]+s}return r},[Go.PAETH](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,a=n[i],s=n[i-t]||0,l=Rz(o,a,s);r[i]=e[i]+l}return r}};Go.NONE+"",Go.SUB+"",Go.UP+"",Go.AVERAGE+"",Go.PAETH+"";function Rz(e,t,n){const r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),a=Math.abs(r-n);return i<=o&&i<=a?e:o<=a?t:n}function li(e,t,n){if(t===n)return e;const r=2**t-1,i=2**n-1;return Math.round(e*i/r)}function Wfe(e,t){const n=[];let r=0;for(;r<e.length;)if(t===1){const i=e[r++];n.push(i>>7&1,i>>6&1,i>>5&1,i>>4&1,i>>3&1,i>>2&1,i>>1&1,i&1)}else if(t===2){const i=e[r++];n.push(i>>6&3,i>>4&3,i>>2&3,i&3)}else if(t===4){const i=e[r++];n.push(i>>4&15,i&15)}else if(t===8){const i=e[r++];n.push(i)}else if(t===16)n.push(e[r++]<<8|e[r++]);else throw new Error("Unsupported depth: "+t);return n}const Oz=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];function Kfe(e,t,n){if(!e)return[{passWidth:t,passHeight:n,passIndex:0}];const r=[];return Oz.forEach(function({x:i,y:o},a){const s=t%8,l=n%8,u=t-s>>3,c=n-l>>3;let d=u*i.length;for(let h=0;h<i.length&&i[h]<s;h++)d++;let f=c*o.length;for(let h=0;h<o.length&&o[h]<l;h++)f++;d&&f&&r.push({passWidth:d,passHeight:f,passIndex:a})}),r}function Qfe(e,t,n,r,i){if(!e)return t*i+r<<2;const o=Oz[n],a=r%o.x.length,s=i%o.y.length,l=(r-a)/o.x.length,u=(i-s)/o.y.length,c=o.x[a],d=o.y[s];return t*((u<<3)+d)+(l<<3)+c<<2}function Xfe(e,t,n,r,i,o,a,s){let l=[];const u=Pz(e),c=Kfe(t,r,i),f=Gfe[n]*o,h=f>>3||1;let p=0,m=new Uint8Array;for(let _=0;_<c.length;_++){const{passWidth:b,passHeight:y,passIndex:g}=c[_];for(let v=0;v<y;v++){let P=function(){if(n===er.GRAYSCALE){const $=li(T[k++],o,8);return[$,$,$,255]}if(n===er.TRUE_COLOR)return[li(T[k++],o,8),li(T[k++],o,8),li(T[k++],o,8),255];if(n===er.PALETTE){const $=T[k++];if(!a)throw new Error("Mising chunk: PLTE");return a[$]}if(n===er.GRAYSCALE_WITH_ALPHA){const $=li(T[k++],o,8);return[$,$,$,li(T[k++],o,8)]}if(n===er.TRUE_COLOR_WITH_ALPHA)return[li(T[k++],o,8),li(T[k++],o,8),li(T[k++],o,8),li(T[k++],o,8)];throw new Error("Unsupported color type: "+n)};const S=(b*f+7>>3)+qfe,w=u[p];if(!(w in Go))throw new Error("Unsupported filter type: "+w);const x=Hfe[w],C=x(u.slice(p+1,p+S),h,m);m=C;let k=0;const T=Wfe(C,o);for(let $=0;$<b;$++){const O=P();s&&O[0]===s[0]&&O[1]===s[1]&&O[2]===s[2]&&(O[3]=0);const E=Qfe(t,r,g,$,v);for(let A=0;A<O.length;A++)l[E+A]=O[A]}p+=S}}return l}const SC=[137,80,78,71,13,10,26,10],Yfe=1e5;function xC(e){let t=0,n="";for(;t<e.length;){let r=e[t++];if(r>127)if(r>191&&r<224){if(t>=e.length)throw new Error("UTF-8 decode: incomplete 2-byte sequence");r=(r&31)<<6|e[t++]&63}else if(r>223&&r<240){if(t+1>=e.length)throw new Error("UTF-8 decode: incomplete 3-byte sequence");r=(r&15)<<12|(e[t++]&63)<<6|e[t++]&63}else if(r>239&&r<248){if(t+2>=e.length)throw new Error("UTF-8 decode: incomplete 4-byte sequence");r=(r&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63}else throw new Error("UTF-8 decode: unknown multibyte start 0x"+r.toString(16)+" at index "+(t-1));if(r<=65535)n+=String.fromCharCode(r);else if(r<=1114111)r-=65536,n+=String.fromCharCode(r>>10|55296),n+=String.fromCharCode(r&1023|56320);else throw new Error("UTF-8 decode: code point 0x"+r.toString(16)+" exceeds UTF-16 reach")}return n}function Zfe(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}const uu=1e5;function Jfe(e){const t=new Uint8Array(e);let n=new Uint8Array;const r={width:0,height:0,depth:0,colorType:0,compression:0,interlace:0,filter:0,data:[]};let i=0;function o(){return t[i++]<<24|t[i++]<<16|t[i++]<<8|t[i++]}function a(){return t[i++]<<8|t[i++]}function s(){return t[i++]}function l(){const M=[];let R=0;for(;(R=t[i++])!==0;)M.push(R);return new Uint8Array(M)}function u(M){const R=i+M;let N="";for(;i<R;){const B=s();if(B===0)break;N+=String.fromCharCode(B)}return N}function c(M){let R="";for(;i<M;){const N=s();R+=String.fromCharCode(N)}return R}function d(M){const R=t.slice(i,M);return i=M,Pz(R)}function f(){let M="";for(const R=i+4;i<R;i++)M+=String.fromCharCode(t[i]);return M}for(;i<SC.length;i++)if(t[i]!==SC[i])throw new Error(`Invalid file signature, at position ${i}: ${t[i]} !== ${SC[i]}`);const h={IHDR:p,PLTE:m,IDAT:_,IEND:b,tRNS:y,cHRM:g,gAMA:v,iCCP:S,sBIT:w,sRGB:x,tEXt:C,zTXt:k,iTXt:T,bKGD:P,hIST:$,pHYs:O,sPLT:E,tIME:A};function p(){r.width=o(),r.height=o(),r.depth=s();const M=s();if(!(M in er))throw new Error("Unsupported color type: "+M);r.colorType=M,r.compression=s(),r.filter=s(),r.interlace=s()}function m(M){const R=[];for(let N=0;N<M;N+=3)R.push([t[i++],t[i++],t[i++],255]);r.palette=R}function _(M){n=Zfe(n,t.slice(i,i+M)),i+=M}function b(M){i+=M}function y(M){if(r.colorType===er.GRAYSCALE){const R=li(t[i++]<<8|t[i++],r.depth,8);r.transparent=[R,R,R,255]}else if(r.colorType===er.TRUE_COLOR)r.transparent=[li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===er.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");for(let R=0;R<M;R++)r.palette[R][3]=t[i++]}}function g(){r.chromaticities={white:{x:o()/uu,y:o()/uu},red:{x:o()/uu,y:o()/uu},green:{x:o()/uu,y:o()/uu},blue:{x:o()/uu,y:o()/uu}}}function v(){r.gamma=o()/Yfe}function S(M){const R=i+M,N=u(80);s();const B=d(R);r.icc={name:N,profile:Array.from(B)}}function w(){if(r.colorType===er.GRAYSCALE){const M=s();r.significantBits=[M,M,M,r.depth]}else if(r.colorType===er.TRUE_COLOR||r.colorType===er.PALETTE)r.significantBits=[s(),s(),s(),r.depth];else if(r.colorType===er.GRAYSCALE_WITH_ALPHA){const M=s();r.significantBits=[M,M,M,s()]}else r.colorType===er.TRUE_COLOR_WITH_ALPHA&&(r.significantBits=[s(),s(),s(),s()])}function x(){r.sRGB=s()}function C(M){const R=i+M,N=u(80),B=c(R);r.text||(r.text={}),r.text[N]=B}function k(M){const R=i+M,N=u(80);s();const B=d(R);let U="";for(let G=0;G<B.length;G++)U+=String.fromCharCode(B[G]);r.compressedText||(r.compressedText={}),r.compressedText[N]=U}function T(M){const R=i+M,N=u(80),B=s();s();const U=u(1/0),G=xC(l());let Z="";if(B===0)Z=xC(t.slice(i,R)),i=R;else{const ee=d(R);Z=xC(ee)}r.internationalText||(r.internationalText={}),r.internationalText[N]={languageTag:U,translatedKeyword:G,text:Z}}function P(){if((r.colorType&3)===er.GRAYSCALE){const M=li(t[i++]<<8|t[i++],r.depth,8);r.background=[M,M,M,255]}else if((r.colorType&3)===er.TRUE_COLOR)r.background=[li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===er.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");r.background=r.palette[t[i++]]}}function $(M){const R=i+M,N=[];for(;i<R;)N.push(a());r.histogram=N}function O(){const M=o(),R=o(),N=s();r.physicalDimensions={pixelPerUnitX:M,pixelPerUnitY:R,unit:N}}function E(M){const R=i+M,N=u(80),B=s(),U=[];if(B===8)for(;i<R;)U.push([s(),s(),s(),s(),a()]);else if(B===16)for(;i<R;)U.push([a(),a(),a(),a(),a()]);r.suggestedPalette={name:N,depth:B,palette:U}}function A(){const M=a(),R=s(),N=s(),B=s(),U=s(),G=s();r.lastModificationTime=Date.UTC(M,R-1,N,B,U,G)}function D(){const M=i,R=o(),N=f();h[N]?h[N](R):(N.charCodeAt(0)&32,i+=R),L(M,R)}function L(M,R){const N=o(),B=Vfe(t.slice(M+4,M+8+R));if(N!==B)throw new Error("Crc32 error: calculated "+B+", expected "+N);i<t.length&&D()}return D(),r.data=Xfe(n,r.interlace,r.colorType,r.width,r.height,r.depth,r.palette,r.transparent),r}var Mz={},r2={},i2={};Object.defineProperty(i2,"__esModule",{value:!0});i2.createLogMethods=void 0;var ehe=function(){return{debug:console.debug.bind(console),error:console.error.bind(console),fatal:console.error.bind(console),info:console.info.bind(console),trace:console.debug.bind(console),warn:console.warn.bind(console)}};i2.createLogMethods=ehe;var Pk={},o2={};Object.defineProperty(o2,"__esModule",{value:!0});o2.boolean=void 0;const the=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};o2.boolean=the;var a2={};Object.defineProperty(a2,"__esModule",{value:!0});a2.isBooleanable=void 0;const nhe=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};a2.isBooleanable=nhe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=o2;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=a2;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(Pk);var iR=Object.prototype.toString,Nz=function(t){var n=iR.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&iR.call(t.callee)==="[object Function]"),r},wC,oR;function rhe(){if(oR)return wC;oR=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Nz,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var h=f.constructor;return h&&h.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&t.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),d=function(f){if(typeof window>"u"||!c)return l(f);try{return l(f)}catch{return!1}};e=function(h){var p=h!==null&&typeof h=="object",m=n.call(h)==="[object Function]",_=r(h),b=p&&n.call(h)==="[object String]",y=[];if(!p&&!m&&!_)throw new TypeError("Object.keys called on a non-object");var g=a&&m;if(b&&h.length>0&&!t.call(h,0))for(var v=0;v<h.length;++v)y.push(String(v));if(_&&h.length>0)for(var S=0;S<h.length;++S)y.push(String(S));else for(var w in h)!(g&&w==="prototype")&&t.call(h,w)&&y.push(String(w));if(o)for(var x=d(h),C=0;C<s.length;++C)!(x&&s[C]==="constructor")&&t.call(h,s[C])&&y.push(s[C]);return y}}return wC=e,wC}var ihe=Array.prototype.slice,ohe=Nz,aR=Object.keys,D1=aR?function(t){return aR(t)}:rhe(),sR=Object.keys;D1.shim=function(){if(Object.keys){var t=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);t||(Object.keys=function(r){return ohe(r)?sR(ihe.call(r)):sR(r)})}else Object.keys=D1;return Object.keys||D1};var ahe=D1,she=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0},lR=typeof Symbol<"u"&&Symbol,lhe=she,uhe=function(){return typeof lR!="function"||typeof Symbol!="function"||typeof lR("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:lhe()},uR={foo:{}},che=Object,dhe=function(){return{__proto__:uR}.foo===uR.foo&&!({__proto__:null}instanceof che)},fhe="Function.prototype.bind called on incompatible ",CC=Array.prototype.slice,hhe=Object.prototype.toString,phe="[object Function]",ghe=function(t){var n=this;if(typeof n!="function"||hhe.call(n)!==phe)throw new TypeError(fhe+n);for(var r=CC.call(arguments,1),i,o=function(){if(this instanceof i){var c=n.apply(this,r.concat(CC.call(arguments)));return Object(c)===c?c:this}else return n.apply(t,r.concat(CC.call(arguments)))},a=Math.max(0,n.length-r.length),s=[],l=0;l<a;l++)s.push("$"+l);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i},mhe=ghe,$z=Function.prototype.bind||mhe,yhe=$z,vhe=yhe.call(Function.call,Object.prototype.hasOwnProperty),Dt,Yh=SyntaxError,Dz=Function,ph=TypeError,EC=function(e){try{return Dz('"use strict"; return ('+e+").constructor;")()}catch{}},gd=Object.getOwnPropertyDescriptor;if(gd)try{gd({},"")}catch{gd=null}var TC=function(){throw new ph},bhe=gd?function(){try{return arguments.callee,TC}catch{try{return gd(arguments,"callee").get}catch{return TC}}}():TC,df=uhe(),_he=dhe(),ai=Object.getPrototypeOf||(_he?function(e){return e.__proto__}:null),Cf={},She=typeof Uint8Array>"u"||!ai?Dt:ai(Uint8Array),md={"%AggregateError%":typeof AggregateError>"u"?Dt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Dt:ArrayBuffer,"%ArrayIteratorPrototype%":df&&ai?ai([][Symbol.iterator]()):Dt,"%AsyncFromSyncIteratorPrototype%":Dt,"%AsyncFunction%":Cf,"%AsyncGenerator%":Cf,"%AsyncGeneratorFunction%":Cf,"%AsyncIteratorPrototype%":Cf,"%Atomics%":typeof Atomics>"u"?Dt:Atomics,"%BigInt%":typeof BigInt>"u"?Dt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Dt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Dt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Dt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Dt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Dt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Dt:FinalizationRegistry,"%Function%":Dz,"%GeneratorFunction%":Cf,"%Int8Array%":typeof Int8Array>"u"?Dt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Dt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Dt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":df&&ai?ai(ai([][Symbol.iterator]())):Dt,"%JSON%":typeof JSON=="object"?JSON:Dt,"%Map%":typeof Map>"u"?Dt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!df||!ai?Dt:ai(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Dt:Promise,"%Proxy%":typeof Proxy>"u"?Dt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Dt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Dt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!df||!ai?Dt:ai(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Dt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":df&&ai?ai(""[Symbol.iterator]()):Dt,"%Symbol%":df?Symbol:Dt,"%SyntaxError%":Yh,"%ThrowTypeError%":bhe,"%TypedArray%":She,"%TypeError%":ph,"%Uint8Array%":typeof Uint8Array>"u"?Dt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Dt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Dt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Dt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Dt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Dt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Dt:WeakSet};if(ai)try{null.error}catch(e){var xhe=ai(ai(e));md["%Error.prototype%"]=xhe}var whe=function e(t){var n;if(t==="%AsyncFunction%")n=EC("async function () {}");else if(t==="%GeneratorFunction%")n=EC("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=EC("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ai&&(n=ai(i.prototype))}return md[t]=n,n},cR={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gy=$z,g_=vhe,Che=gy.call(Function.call,Array.prototype.concat),Ehe=gy.call(Function.apply,Array.prototype.splice),dR=gy.call(Function.call,String.prototype.replace),m_=gy.call(Function.call,String.prototype.slice),The=gy.call(Function.call,RegExp.prototype.exec),khe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ahe=/\\(\\)?/g,Phe=function(t){var n=m_(t,0,1),r=m_(t,-1);if(n==="%"&&r!=="%")throw new Yh("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Yh("invalid intrinsic syntax, expected opening `%`");var i=[];return dR(t,khe,function(o,a,s,l){i[i.length]=s?dR(l,Ahe,"$1"):a||o}),i},Ihe=function(t,n){var r=t,i;if(g_(cR,r)&&(i=cR[r],r="%"+i[0]+"%"),g_(md,r)){var o=md[r];if(o===Cf&&(o=whe(r)),typeof o>"u"&&!n)throw new ph("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Yh("intrinsic "+t+" does not exist!")},Rhe=function(t,n){if(typeof t!="string"||t.length===0)throw new ph("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new ph('"allowMissing" argument must be a boolean');if(The(/^%?[^%]*%?$/,t)===null)throw new Yh("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Phe(t),i=r.length>0?r[0]:"",o=Ihe("%"+i+"%",n),a=o.name,s=o.value,l=!1,u=o.alias;u&&(i=u[0],Ehe(r,Che([0,1],u)));for(var c=1,d=!0;c<r.length;c+=1){var f=r[c],h=m_(f,0,1),p=m_(f,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new Yh("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),i+="."+f,a="%"+i+"%",g_(md,a))s=md[a];else if(s!=null){if(!(f in s)){if(!n)throw new ph("base intrinsic for "+t+" exists, but the property is not available.");return}if(gd&&c+1>=r.length){var m=gd(s,f);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else d=g_(s,f),s=s[f];d&&!l&&(md[a]=s)}}return s},Ohe=Rhe,mE=Ohe("%Object.defineProperty%",!0),yE=function(){if(mE)try{return mE({},"a",{value:1}),!0}catch{return!1}return!1};yE.hasArrayLengthDefineBug=function(){if(!yE())return null;try{return mE([],"length",{value:1}).length!==1}catch{return!0}};var Mhe=yE,Nhe=ahe,$he=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Dhe=Object.prototype.toString,Lhe=Array.prototype.concat,Lz=Object.defineProperty,Fhe=function(e){return typeof e=="function"&&Dhe.call(e)==="[object Function]"},Bhe=Mhe(),Fz=Lz&&Bhe,zhe=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!Fhe(r)||!r())return}Fz?Lz(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},Bz=function(e,t){var n=arguments.length>2?arguments[2]:{},r=Nhe(t);$he&&(r=Lhe.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)zhe(e,r[i],t[r[i]],n[r[i]])};Bz.supportsDescriptors=!!Fz;var zz=Bz,L1={exports:{}};typeof self<"u"?L1.exports=self:typeof window<"u"?L1.exports=window:L1.exports=Function("return this")();var jz=L1.exports,jhe=jz,Uz=function(){return typeof yt!="object"||!yt||yt.Math!==Math||yt.Array!==Array?jhe:yt},Uhe=zz,Vhe=Uz,Ghe=function(){var t=Vhe();if(Uhe.supportsDescriptors){var n=Object.getOwnPropertyDescriptor(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},qhe=zz,Hhe=jz,Vz=Uz,Whe=Ghe,Khe=Vz(),Gz=function(){return Khe};qhe(Gz,{getPolyfill:Vz,implementation:Hhe,shim:Whe});var Ik=Gz,qz={},my={},Rk={},s2={},l2={};Object.defineProperty(l2,"__esModule",{value:!0});l2.convertWildcardToRegex=void 0;var Qhe=/\*+/g,Xhe=function(e){return new RegExp(e.replace(Qhe,"(.+?)"))};l2.convertWildcardToRegex=Xhe;var yy={};Object.defineProperty(yy,"__esModule",{value:!0});yy.escapeRegexString=void 0;var Yhe=/[$()*+.?[\\\]^{|}]/g,Zhe=/-/g,Jhe=function(e){return e.replace(Yhe,"\\$&").replace(Zhe,"\\x2d")};yy.escapeRegexString=Jhe;var u2={};Object.defineProperty(u2,"__esModule",{value:!0});u2.parseRegex=void 0;var epe=/(\/?)(.+)\1([a-z]*)/,tpe=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,npe=function(e){var t=epe.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!tpe.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};u2.parseRegex=npe;Object.defineProperty(s2,"__esModule",{value:!0});s2.createStringTest=void 0;var rpe=l2,ipe=yy,ope=u2,kC=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,ope.parseRegex)(t),function(r){var i,o;return(o=(i=r.match(n))===null||i===void 0?void 0:i[0])!==null&&o!==void 0?o:!1}},ape=function(e,t){if(t.type!=="Tag")throw new Error("Expected a tag expression.");var n=t.expression;if(n.type==="RangeExpression")throw new Error("Unexpected range expression.");if(n.type==="RegexExpression")return kC(e,n.value);if(n.type!=="LiteralExpression")throw new Error("Expected a literal expression.");var r=String(n.value);return r.includes("*")&&n.quoted===!1?kC(e,String((0,rpe.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):kC(e,"/("+(0,ipe.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};s2.createStringTest=ape;var c2={};Object.defineProperty(c2,"__esModule",{value:!0});c2.testComparisonRange=void 0;var spe=function(e,t,n){switch(n){case":=":return t===e;case":>":return t>e;case":<":return t<e;case":>=":return t>=e;case":<=":return t<=e;default:throw new Error("Unimplemented comparison operator: ".concat(n))}};c2.testComparisonRange=spe;var d2={};Object.defineProperty(d2,"__esModule",{value:!0});d2.testRange=void 0;var lpe=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};d2.testRange=lpe;(function(e){var t=yt&&yt.__assign||function(){return t=Object.assign||function(c){for(var d,f=1,h=arguments.length;f<h;f++){d=arguments[f];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},t.apply(this,arguments)},n=yt&&yt.__spreadArray||function(c,d,f){if(f||arguments.length===2)for(var h=0,p=d.length,m;h<p;h++)(m||!(h in d))&&(m||(m=Array.prototype.slice.call(d,0,h)),m[h]=d[h]);return c.concat(m||Array.prototype.slice.call(d))};Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var r=s2,i=c2,o=d2,a=function(c){if(c.type!=="Tag")throw new Error("Expected a tag expression.");var d=c.expression;if(d.type==="RangeExpression")return function(m){return(0,o.testRange)(m,d.range)};if(d.type==="EmptyExpression")return function(){return!1};var f=d.value;if(c.operator&&c.operator.operator!==":"){var h=c.operator;if(typeof f!="number")throw new TypeError("Expected a number.");return function(m){return typeof m!="number"?!1:(0,i.testComparisonRange)(f,m,h.operator)}}else{if(typeof f=="boolean")return function(m){return m===f};if(f===null)return function(m){return m===null};var p=(0,r.createStringTest)({},c);return function(m){return p(String(m))}}},s=function(c,d,f,h,p){if(Array.isArray(d)){for(var m=!1,_=0,b=0,y=d;b<y.length;b++){var g=y[b];if(s(c,g,f,n(n([],h,!0),[String(_++)],!1),p)){if(f)return!0;m=!0}}return m}else if(typeof d=="object"&&d!==null){var m=!1;for(var v in d)if(s(c,d[v],f,n(n([],h,!0),[v],!1),p)){if(f)return!0;m=!0}return m}if(c.type!=="Tag")throw new Error("Expected a tag expression.");if(!c.test)throw new Error("Expected test to be defined.");var S=c.test(d);return S?(p.push(t(t({},typeof S=="string"&&{keyword:S}),{path:h.join(".")})),!0):!!S},l=function(c,d,f,h,p){if(d.type!=="Tag")throw new Error("Expected a tag expression.");if(d.test||(d.test=a(d)),d.field.type==="ImplicitField"){var m=!1;for(var _ in c)if(s(t(t({},d),{field:{location:{end:-1,start:-1},name:_,quoted:!0,quotes:"double",type:"Field"}}),c[_],f,n(n([],h,!0),[_],!1),p)){if(f)return!0;m=!0}return m}if(d.field.name in c)return s(d,c[d.field.name],f,h,p);if(d.getValue&&d.field.path)return s(d,d.getValue(c),f,d.field.path,p);if(d.field.path){for(var b=c,y=0,g=d.field.path;y<g.length;y++){var v=g[y];if(typeof b!="object"||b===null)return!1;if(v in b)b=b[v];else return!1}return s(d,b,f,d.field.path,p)}else return!1},u=function(c,d,f,h,p){if(f===void 0&&(f=!0),h===void 0&&(h=[]),p===void 0&&(p=[]),c.type==="Tag")return d.filter(function(y){return l(y,c,f,c.field.type==="ImplicitField"?h:n(n([],h,!0),[c.field.name],!1),p)});if(c.type==="UnaryOperator"){var m=(0,e.internalFilter)(c.operand,d,f,h,[]);return d.filter(function(y){return!m.includes(y)})}if(!c.left)throw new Error("Expected left to be defined.");var _=(0,e.internalFilter)(c.left,d,f,h,p);if(!c.right)throw new Error("Expected right to be defined.");if(c.type!=="LogicalExpression")throw new Error("Expected a tag expression.");if(c.operator.operator==="OR"){var b=(0,e.internalFilter)(c.right,d,f,h,p);return Array.from(new Set(n(n([],_,!0),b,!0)))}else if(c.operator.operator==="AND")return(0,e.internalFilter)(c.right,_,f,h,p);throw new Error("Unexpected state.")};e.internalFilter=u})(Rk);Object.defineProperty(my,"__esModule",{value:!0});my.filter=void 0;var upe=Rk,cpe=function(e,t){return(0,upe.internalFilter)(e,t)};my.filter=cpe;var f2={};Object.defineProperty(f2,"__esModule",{value:!0});f2.highlight=void 0;var dpe=yy,fpe=Rk,hpe=function(e,t){var n=[];(0,fpe.internalFilter)(e,[t],!1,[],n);for(var r=[],i=function(l){var u=r.find(function(c){return c.path===l.path});u||(u={keywords:[],path:l.path},r.push(u)),l.keyword&&u.keywords.push(l.keyword)},o=0,a=n;o<a.length;o++){var s=a[o];i(s)}return r.map(function(l){return l.keywords.length>0?{path:l.path,query:new RegExp("("+l.keywords.map(function(u){return(0,dpe.escapeRegexString)(u.trim())}).join("|")+")")}:{path:l.path}})};f2.highlight=hpe;var h2={},Hz={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(yt,function(){function t(u,c,d){return this.id=++t.highestId,this.name=u,this.symbols=c,this.postprocess=d,this}t.highestId=0,t.prototype.toString=function(u){var c=typeof u>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,u).map(l).join(" ")+" ● "+this.symbols.slice(u).map(l).join(" ");return this.name+" → "+c};function n(u,c,d,f){this.rule=u,this.dot=c,this.reference=d,this.data=[],this.wantedBy=f,this.isComplete=this.dot===u.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(u){var c=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return c.left=this,c.right=u,c.isComplete&&(c.data=c.build(),c.right=void 0),c},n.prototype.build=function(){var u=[],c=this;do u.push(c.right.data),c=c.left;while(c.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,a.fail))};function r(u,c){this.grammar=u,this.index=c,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var c=this.states,d=this.wants,f=this.completed,h=0;h<c.length;h++){var p=c[h];if(p.isComplete){if(p.finish(),p.data!==a.fail){for(var m=p.wantedBy,_=m.length;_--;){var b=m[_];this.complete(b,p)}if(p.reference===this.index){var y=p.rule.name;(this.completed[y]=this.completed[y]||[]).push(p)}}}else{var y=p.rule.symbols[p.dot];if(typeof y!="string"){this.scannable.push(p);continue}if(d[y]){if(d[y].push(p),f.hasOwnProperty(y))for(var g=f[y],_=0;_<g.length;_++){var v=g[_];this.complete(p,v)}}else d[y]=[p],this.predict(y)}}},r.prototype.predict=function(u){for(var c=this.grammar.byName[u]||[],d=0;d<c.length;d++){var f=c[d],h=this.wants[u],p=new n(f,0,this.index,h);this.states.push(p)}},r.prototype.complete=function(u,c){var d=u.nextState(c);this.states.push(d)};function i(u,c){this.rules=u,this.start=c||this.rules[0].name;var d=this.byName={};this.rules.forEach(function(f){d.hasOwnProperty(f.name)||(d[f.name]=[]),d[f.name].push(f)})}i.fromCompiled=function(f,c){var d=f.Lexer;f.ParserStart&&(c=f.ParserStart,f=f.ParserRules);var f=f.map(function(p){return new t(p.name,p.symbols,p.postprocess)}),h=new i(f,c);return h.lexer=d,h};function o(){this.reset("")}o.prototype.reset=function(u,c){this.buffer=u,this.index=0,this.line=c?c.line:1,this.lastLineBreak=c?-c.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var u=this.buffer[this.index++];return u===`
-`&&(this.line+=1,this.lastLineBreak=this.index),{value:u}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(u,c){var d=this.buffer;if(typeof d=="string"){var f=d.split(`
-`).slice(Math.max(0,this.line-5),this.line),h=d.indexOf(`
-`,this.index);h===-1&&(h=d.length);var p=this.index-this.lastLineBreak,m=String(this.line).length;return c+=" at line "+this.line+" col "+p+`:
-
-`,c+=f.map(function(b,y){return _(this.line-f.length+y+1,m)+" "+b},this).join(`
-`),c+=`
-`+_("",m+p)+`^
-`,c}else return c+" at index "+(this.index-1);function _(b,y){var g=String(b);return Array(y-g.length+1).join(" ")+g}};function a(u,c,d){if(u instanceof i)var f=u,d=c;else var f=i.fromCompiled(u,c);this.grammar=f,this.options={keepHistory:!1,lexer:f.lexer||new o};for(var h in d||{})this.options[h]=d[h];this.lexer=this.options.lexer,this.lexerState=void 0;var p=new r(f,0);this.table=[p],p.wants[f.start]=[],p.predict(f.start),p.process(),this.current=0}a.fail={},a.prototype.feed=function(u){var c=this.lexer;c.reset(u,this.lexerState);for(var d;;){try{if(d=c.next(),!d)break}catch(x){var m=new r(this.grammar,this.current+1);this.table.push(m);var f=new Error(this.reportLexerError(x));throw f.offset=this.current,f.token=x.token,f}var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var p=this.current+1,m=new r(this.grammar,p);this.table.push(m);for(var _=d.text!==void 0?d.text:d.value,b=c.constructor===o?d.value:d,y=h.scannable,g=y.length;g--;){var v=y[g],S=v.rule.symbols[v.dot];if(S.test?S.test(b):S.type?S.type===d.type:S.literal===_){var w=v.nextState({data:b,token:d,isToken:!0,reference:p-1});m.states.push(w)}}if(m.process(),m.states.length===0){var f=new Error(this.reportError(d));throw f.offset=this.current,f.token=d,f}this.options.keepHistory&&(h.lexerState=c.save()),this.current++}return h&&(this.lexerState=c.save()),this.results=this.finish(),this},a.prototype.reportLexerError=function(u){var c,d,f=u.token;return f?(c="input "+JSON.stringify(f.text[0])+" (lexer error)",d=this.lexer.formatError(f,"Syntax error")):(c="input (lexer error)",d=u.message),this.reportErrorCommon(d,c)},a.prototype.reportError=function(u){var c=(u.type?u.type+" token: ":"")+JSON.stringify(u.value!==void 0?u.value:u),d=this.lexer.formatError(u,"Syntax error");return this.reportErrorCommon(d,c)},a.prototype.reportErrorCommon=function(u,c){var d=[];d.push(u);var f=this.table.length-2,h=this.table[f],p=h.states.filter(function(_){var b=_.rule.symbols[_.dot];return b&&typeof b!="string"});if(p.length===0)d.push("Unexpected "+c+`. I did not expect any more input. Here is the state of my parse table:
-`),this.displayStateStack(h.states,d);else{d.push("Unexpected "+c+`. Instead, I was expecting to see one of the following:
-`);var m=p.map(function(_){return this.buildFirstStateStack(_,[])||[_]},this);m.forEach(function(_){var b=_[0],y=b.rule.symbols[b.dot],g=this.getSymbolDisplay(y);d.push("A "+g+" based on:"),this.displayStateStack(_,d)},this)}return d.push(""),d.join(`
-`)},a.prototype.displayStateStack=function(u,c){for(var d,f=0,h=0;h<u.length;h++){var p=u[h],m=p.rule.toString(p.dot);m===d?f++:(f>0&&c.push("    ^ "+f+" more lines identical to this"),f=0,c.push("    "+m)),d=m}},a.prototype.getSymbolDisplay=function(u){return s(u)},a.prototype.buildFirstStateStack=function(u,c){if(c.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var d=u.wantedBy[0],f=[u].concat(c),h=this.buildFirstStateStack(d,f);return h===null?null:[u].concat(h)},a.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},a.prototype.restore=function(u){var c=u.index;this.current=c,this.table[c]=u,this.table.splice(c+1),this.lexerState=u.lexerState,this.results=this.finish()},a.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},a.prototype.finish=function(){var u=[],c=this.grammar.start,d=this.table[this.table.length-1];return d.states.forEach(function(f){f.rule.name===c&&f.dot===f.rule.symbols.length&&f.reference===0&&f.data!==a.fail&&u.push(f)}),u.map(function(f){return f.data})};function s(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return"character matching "+u;if(u.type)return u.type+" token";if(u.test)return"token matching "+String(u.test);throw new Error("Unknown symbol type: "+u)}}function l(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return u.toString();if(u.type)return"%"+u.type;if(u.test)return"<"+String(u.test)+">";throw new Error("Unknown symbol type: "+u)}}return{Parser:a,Grammar:i,Rule:t}})})(Hz);var ppe=Hz.exports,Md={},Wz={},wc={};wc.__esModule=void 0;wc.__esModule=!0;var gpe=typeof Object.setPrototypeOf=="function",mpe=typeof Object.getPrototypeOf=="function",ype=typeof Object.defineProperty=="function",vpe=typeof Object.create=="function",bpe=typeof Object.prototype.hasOwnProperty=="function",_pe=function(t,n){gpe?Object.setPrototypeOf(t,n):t.__proto__=n};wc.setPrototypeOf=_pe;var Spe=function(t){return mpe?Object.getPrototypeOf(t):t.__proto__||t.prototype};wc.getPrototypeOf=Spe;var fR=!1,xpe=function e(t,n,r){if(ype&&!fR)try{Object.defineProperty(t,n,r)}catch{fR=!0,e(t,n,r)}else t[n]=r.value};wc.defineProperty=xpe;var Kz=function(t,n){return bpe?t.hasOwnProperty(t,n):t[n]===void 0};wc.hasOwnProperty=Kz;var wpe=function(t,n){if(vpe)return Object.create(t,n);var r=function(){};r.prototype=t;var i=new r;if(typeof n>"u")return i;if(typeof n=="null")throw new Error("PropertyDescriptors must not be null.");if(typeof n=="object")for(var o in n)Kz(n,o)&&(i[o]=n[o].value);return i};wc.objectCreate=wpe;(function(e){e.__esModule=void 0,e.__esModule=!0;var t=wc,n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,o=t.objectCreate,a=new Error().toString()==="[object Error]",s="";function l(u){var c=this.constructor,d=c.name||function(){var _=c.toString().match(/^function\s*([^\s(]+)/);return _===null?s||"Error":_[1]}(),f=d==="Error",h=f?s:d,p=Error.apply(this,arguments);if(n(p,r(this)),!(p instanceof c)||!(p instanceof l)){var p=this;Error.apply(this,arguments),i(p,"message",{configurable:!0,enumerable:!1,value:u,writable:!0})}if(i(p,"name",{configurable:!0,enumerable:!1,value:h,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(p,f?l:c),p.stack===void 0){var m=new Error(u);m.name=p.name,p.stack=m.stack}return a&&i(p,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),p}s=l.name||"ExtendableError",l.prototype=o(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),e.ExtendableError=l,e.default=e.ExtendableError})(Wz);var Qz=yt&&yt.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Md,"__esModule",{value:!0});Md.SyntaxError=Md.LiqeError=void 0;var Cpe=Wz,Xz=function(e){Qz(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Cpe.ExtendableError);Md.LiqeError=Xz;var Epe=function(e){Qz(t,e);function t(n,r,i,o){var a=e.call(this,n)||this;return a.message=n,a.offset=r,a.line=i,a.column=o,a}return t}(Xz);Md.SyntaxError=Epe;var Ok={},y_=yt&&yt.__assign||function(){return y_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},y_.apply(this,arguments)};Object.defineProperty(Ok,"__esModule",{value:!0});function cl(e){return e[0]}var Tpe={Lexer:void 0,ParserRules:[{name:"main",symbols:["_","logical_expression","_"],postprocess:function(e){return e[1]}},{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"__$ebnf$1",symbols:["whitespace_character"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"whitespace_character",symbols:[/[ \t\n\v\f]/],postprocess:cl},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:cl},{name:"decimal$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"decimal$ebnf$2",symbols:[/[0-9]/]},{name:"decimal$ebnf$2",symbols:["decimal$ebnf$2",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:[/[0-9]/]},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:["decimal$ebnf$3$subexpression$1$ebnf$1",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1",symbols:[{literal:"."},"decimal$ebnf$3$subexpression$1$ebnf$1"]},{name:"decimal$ebnf$3",symbols:["decimal$ebnf$3$subexpression$1"],postprocess:cl},{name:"decimal$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"decimal",symbols:["decimal$ebnf$1","decimal$ebnf$2","decimal$ebnf$3"],postprocess:function(e){return parseFloat((e[0]||"")+e[1].join("")+(e[2]?"."+e[2][1].join(""):""))}},{name:"dqstring$ebnf$1",symbols:[]},{name:"dqstring$ebnf$1",symbols:["dqstring$ebnf$1","dstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"dqstring",symbols:[{literal:'"'},"dqstring$ebnf$1",{literal:'"'}],postprocess:function(e){return e[1].join("")}},{name:"sqstring$ebnf$1",symbols:[]},{name:"sqstring$ebnf$1",symbols:["sqstring$ebnf$1","sstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"sqstring",symbols:[{literal:"'"},"sqstring$ebnf$1",{literal:"'"}],postprocess:function(e){return e[1].join("")}},{name:"dstrchar",symbols:[/[^\\"\n]/],postprocess:cl},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:cl},{name:"sstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar$string$1",symbols:[{literal:"\\"},{literal:"'"}],postprocess:function(e){return e.join("")}},{name:"sstrchar",symbols:["sstrchar$string$1"],postprocess:function(){return"'"}},{name:"strescape",symbols:[/["\\/bfnrt]/],postprocess:cl},{name:"strescape",symbols:[{literal:"u"},/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/],postprocess:function(e){return e.join("")}},{name:"logical_expression",symbols:["two_op_logical_expression"],postprocess:cl},{name:"two_op_logical_expression",symbols:["pre_two_op_logical_expression","boolean_operator","post_one_op_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:e[1],left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["pre_two_op_implicit_logical_expression","__","post_one_op_implicit_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:{operator:"AND",type:"ImplicitBooleanOperator"},left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["two_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"post_one_op_implicit_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"post_one_op_implicit_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"pre_two_op_logical_expression",symbols:["two_op_logical_expression","__"],postprocess:function(e){return e[0]}},{name:"pre_two_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[2].location.start+1},type:"ParenthesizedExpression",expression:{type:"EmptyExpression",location:{start:e[0].location.start+1,end:e[0].location.start+1}}}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression$string$1",symbols:[{literal:"N"},{literal:"O"},{literal:"T"}],postprocess:function(e){return e.join("")}},{name:"one_op_logical_expression",symbols:["one_op_logical_expression$string$1","post_boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"NOT",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:[{literal:"-"},"boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"-",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:["boolean_primary"],postprocess:function(e){return e[0]}},{name:"post_one_op_logical_expression",symbols:["__","one_op_logical_expression"],postprocess:function(e){return e[1]}},{name:"post_one_op_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location,end:e[4].location+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"parentheses_open",symbols:[{literal:"("}],postprocess:function(e,t){return{location:{start:t}}}},{name:"parentheses_close",symbols:[{literal:")"}],postprocess:function(e,t){return{location:{start:t}}}},{name:"boolean_operator$string$1",symbols:[{literal:"O"},{literal:"R"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$1"],postprocess:function(e,t){return{location:{start:t,end:t+2},operator:"OR",type:"BooleanOperator"}}},{name:"boolean_operator$string$2",symbols:[{literal:"A"},{literal:"N"},{literal:"D"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$2"],postprocess:function(e,t){return{location:{start:t,end:t+3},operator:"AND",type:"BooleanOperator"}}},{name:"boolean_primary",symbols:["tag_expression"],postprocess:cl},{name:"post_boolean_primary",symbols:["__","parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[1].location.start,end:e[5].location.start+1},type:"ParenthesizedExpression",expression:e[3]}}},{name:"post_boolean_primary",symbols:["__","boolean_primary"],postprocess:function(e){return e[1]}},{name:"tag_expression",symbols:["field","comparison_operator","expression"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,y_({location:{start:t,end:e[2].expression.location.end},field:n,operator:e[1]},e[2])}},{name:"tag_expression",symbols:["field","comparison_operator"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,{type:"Tag",location:{start:t,end:e[1].location.end},field:n,operator:e[1],expression:{type:"EmptyExpression",location:{start:e[1].location.end,end:e[1].location.end}}}}},{name:"tag_expression",symbols:["expression"],postprocess:function(e,t){return y_({location:{start:t,end:e[0].expression.location.end},field:{type:"ImplicitField"}},e[0])}},{name:"field$ebnf$1",symbols:[]},{name:"field$ebnf$1",symbols:["field$ebnf$1",/[a-zA-Z\d_$.]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"field",symbols:[/[_a-zA-Z$]/,"field$ebnf$1"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0]+e[1].join(""),quoted:!1,location:{start:t,end:t+(e[0]+e[1].join("")).length}}}},{name:"field",symbols:["sqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"single",location:{start:t,end:t+e[0].length+2}}}},{name:"field",symbols:["dqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"double",location:{start:t,end:t+e[0].length+2}}}},{name:"expression",symbols:["decimal"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"LiteralExpression",quoted:!1,value:Number(e.join(""))}}}},{name:"expression",symbols:["regex"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"RegexExpression",value:e.join("")}}}},{name:"expression",symbols:["range"],postprocess:function(e){return e[0]}},{name:"expression",symbols:["unquoted_value"],postprocess:function(e,t,n){var r=e.join("");if(e[0]==="AND"||e[0]==="OR"||e[0]==="NOT")return n;var i;return r==="true"?i=!0:r==="false"?i=!1:r==="null"?i=null:i=r,{type:"Tag",expression:{location:{start:t,end:t+r.length},type:"LiteralExpression",quoted:!1,value:i}}}},{name:"expression",symbols:["sqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"single",value:e.join("")}}}},{name:"expression",symbols:["dqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"double",value:e.join("")}}}},{name:"range$string$1",symbols:[{literal:" "},{literal:"T"},{literal:"O"},{literal:" "}],postprocess:function(e){return e.join("")}},{name:"range",symbols:["range_open","decimal","range$string$1","decimal","range_close"],postprocess:function(e,t){return{location:{start:t},type:"Tag",expression:{location:{start:e[0].location.start,end:e[4].location.start+1},type:"RangeExpression",range:{min:e[1],minInclusive:e[0].inclusive,maxInclusive:e[4].inclusive,max:e[3]}}}}},{name:"range_open",symbols:[{literal:"["}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_open",symbols:[{literal:"{"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"range_close",symbols:[{literal:"]"}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_close",symbols:[{literal:"}"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"comparison_operator$subexpression$1",symbols:[{literal:":"}]},{name:"comparison_operator$subexpression$1$string$1",symbols:[{literal:":"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$1"]},{name:"comparison_operator$subexpression$1$string$2",symbols:[{literal:":"},{literal:">"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$2"]},{name:"comparison_operator$subexpression$1$string$3",symbols:[{literal:":"},{literal:"<"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$3"]},{name:"comparison_operator$subexpression$1$string$4",symbols:[{literal:":"},{literal:">"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$4"]},{name:"comparison_operator$subexpression$1$string$5",symbols:[{literal:":"},{literal:"<"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$5"]},{name:"comparison_operator",symbols:["comparison_operator$subexpression$1"],postprocess:function(e,t){return{location:{start:t,end:t+e[0][0].length},type:"ComparisonOperator",operator:e[0][0]}}},{name:"regex",symbols:["regex_body","regex_flags"],postprocess:function(e){return e.join("")}},{name:"regex_body$ebnf$1",symbols:[]},{name:"regex_body$ebnf$1",symbols:["regex_body$ebnf$1","regex_body_char"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_body",symbols:[{literal:"/"},"regex_body$ebnf$1",{literal:"/"}],postprocess:function(e){return"/"+e[1].join("")+"/"}},{name:"regex_body_char",symbols:[/[^\\]/],postprocess:cl},{name:"regex_body_char",symbols:[{literal:"\\"},/[^\\]/],postprocess:function(e){return"\\"+e[1]}},{name:"regex_flags",symbols:[]},{name:"regex_flags$ebnf$1",symbols:[/[gmiyusd]/]},{name:"regex_flags$ebnf$1",symbols:["regex_flags$ebnf$1",/[gmiyusd]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_flags",symbols:["regex_flags$ebnf$1"],postprocess:function(e){return e[0].join("")}},{name:"unquoted_value$ebnf$1",symbols:[]},{name:"unquoted_value$ebnf$1",symbols:["unquoted_value$ebnf$1",/[a-zA-Z\.\-_*@#$]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"unquoted_value",symbols:[/[a-zA-Z_*@#$]/,"unquoted_value$ebnf$1"],postprocess:function(e){return e[0]+e[1].join("")}}],ParserStart:"main"};Ok.default=Tpe;var Yz={},p2={},vy={};Object.defineProperty(vy,"__esModule",{value:!0});vy.isSafePath=void 0;var kpe=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,Ape=function(e){return kpe.test(e)};vy.isSafePath=Ape;Object.defineProperty(p2,"__esModule",{value:!0});p2.createGetValueFunctionBody=void 0;var Ppe=vy,Ipe=function(e){if(!(0,Ppe.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};p2.createGetValueFunctionBody=Ipe;(function(e){var t=yt&&yt.__assign||function(){return t=Object.assign||function(o){for(var a,s=1,l=arguments.length;s<l;s++){a=arguments[s];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])}return o},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var n=p2,r=vy,i=function(o){var a=t({},o);return o.type==="Tag"&&o.field.type==="Field"&&"field"in o&&(0,r.isSafePath)(o.field.name)&&(a.getValue=new Function("subject",(0,n.createGetValueFunctionBody)(o.field.name))),"left"in o&&(a.left=(0,e.hydrateAst)(o.left)),"right"in o&&(a.right=(0,e.hydrateAst)(o.right)),"operand"in o&&(a.operand=(0,e.hydrateAst)(o.operand)),a};e.hydrateAst=i})(Yz);var Zz=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h2,"__esModule",{value:!0});h2.parse=void 0;var Jz=Zz(ppe),Rpe=Md,Ope=Zz(Ok),Mpe=Yz,Npe=Jz.default.Grammar.fromCompiled(Ope.default),$pe=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,Dpe=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new Jz.default.Parser(Npe),n;try{n=t.feed(e).results}catch(o){if(typeof(o==null?void 0:o.message)=="string"&&typeof(o==null?void 0:o.offset)=="number"){var r=o.message.match($pe);throw r?new Rpe.SyntaxError("Syntax error at line ".concat(r.groups.line," column ").concat(r.groups.column),o.offset,Number(r.groups.line),Number(r.groups.column)):o}throw o}if(n.length===0)throw new Error("Found no parsings.");if(n.length>1)throw new Error("Ambiguous results.");var i=(0,Mpe.hydrateAst)(n[0]);return i};h2.parse=Dpe;var g2={};Object.defineProperty(g2,"__esModule",{value:!0});g2.test=void 0;var Lpe=my,Fpe=function(e,t){return(0,Lpe.filter)(e,[t]).length===1};g2.test=Fpe;var ej={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=function(o,a){return a==="double"?'"'.concat(o,'"'):a==="single"?"'".concat(o,"'"):o},n=function(o){if(o.type==="LiteralExpression")return o.quoted&&typeof o.value=="string"?t(o.value,o.quotes):String(o.value);if(o.type==="RegexExpression")return String(o.value);if(o.type==="RangeExpression"){var a=o.range,s=a.min,l=a.max,u=a.minInclusive,c=a.maxInclusive;return"".concat(u?"[":"{").concat(s," TO ").concat(l).concat(c?"]":"}")}if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")},r=function(o){if(o.type!=="Tag")throw new Error("Expected a tag expression.");var a=o.field,s=o.expression,l=o.operator;if(a.type==="ImplicitField")return n(s);var u=a.quoted?t(a.name,a.quotes):a.name,c=" ".repeat(s.location.start-l.location.end);return u+l.operator+c+n(s)},i=function(o){if(o.type==="ParenthesizedExpression"){if(!("location"in o.expression))throw new Error("Expected location in expression.");if(!o.location.end)throw new Error("Expected location end.");var a=" ".repeat(o.expression.location.start-(o.location.start+1)),s=" ".repeat(o.location.end-o.expression.location.end-1);return"(".concat(a).concat((0,e.serialize)(o.expression)).concat(s,")")}if(o.type==="Tag")return r(o);if(o.type==="LogicalExpression"){var l="";return o.operator.type==="BooleanOperator"?(l+=" ".repeat(o.operator.location.start-o.left.location.end),l+=o.operator.operator,l+=" ".repeat(o.right.location.start-o.operator.location.end)):l=" ".repeat(o.right.location.start-o.left.location.end),"".concat((0,e.serialize)(o.left)).concat(l).concat((0,e.serialize)(o.right))}if(o.type==="UnaryOperator")return(o.operator==="NOT"?"NOT ":o.operator)+(0,e.serialize)(o.operand);if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")};e.serialize=i})(ej);var m2={};Object.defineProperty(m2,"__esModule",{value:!0});m2.isSafeUnquotedExpression=void 0;var Bpe=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};m2.isSafeUnquotedExpression=Bpe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isSafeUnquotedExpression=e.serialize=e.SyntaxError=e.LiqeError=e.test=e.parse=e.highlight=e.filter=void 0;var t=my;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=f2;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=h2;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=g2;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=Md;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var a=ej;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return a.serialize}});var s=m2;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return s.isSafeUnquotedExpression}})})(qz);var by={},tj={},Nd={};Object.defineProperty(Nd,"__esModule",{value:!0});Nd.ROARR_LOG_FORMAT_VERSION=Nd.ROARR_VERSION=void 0;Nd.ROARR_VERSION="5.0.0";Nd.ROARR_LOG_FORMAT_VERSION="2.0.0";var _y={};Object.defineProperty(_y,"__esModule",{value:!0});_y.logLevels=void 0;_y.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var nj={},y2={};Object.defineProperty(y2,"__esModule",{value:!0});y2.hasOwnProperty=void 0;const zpe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);y2.hasOwnProperty=zpe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=y2;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(nj);var rj={},v2={},b2={};Object.defineProperty(b2,"__esModule",{value:!0});b2.tokenize=void 0;const jpe=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,Upe=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=jpe.exec(e))!==null;){t.index>i&&(o={literal:e.slice(i,t.index),type:"literal"},n.push(o));const a=t[0];i=t.index+a.length,a==="\\%"||a==="%%"?o&&o.type==="literal"?o.literal+="%":(o={literal:"%",type:"literal"},n.push(o)):t.groups&&(o={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:a,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:r++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},n.push(o))}return i<=e.length-1&&(o&&o.type==="literal"?o.literal+=e.slice(i):n.push({literal:e.slice(i),type:"literal"})),n};b2.tokenize=Upe;Object.defineProperty(v2,"__esModule",{value:!0});v2.createPrintf=void 0;const hR=Pk,Vpe=b2,Gpe=(e,t)=>t.placeholder,qpe=e=>{var t;const n=(o,a,s)=>s==="-"?o.padEnd(a," "):s==="-+"?((Number(o)>=0?"+":"")+o).padEnd(a," "):s==="+"?((Number(o)>=0?"+":"")+o).padStart(a," "):s==="0"?o.padStart(a,"0"):o.padStart(a," "),r=(t=e==null?void 0:e.formatUnboundExpression)!==null&&t!==void 0?t:Gpe,i={};return(o,...a)=>{let s=i[o];s||(s=i[o]=Vpe.tokenize(o));let l="";for(const u of s)if(u.type==="literal")l+=u.literal;else{let c=a[u.position];if(c===void 0)l+=r(o,u,a);else if(u.conversion==="b")l+=hR.boolean(c)?"true":"false";else if(u.conversion==="B")l+=hR.boolean(c)?"TRUE":"FALSE";else if(u.conversion==="c")l+=c;else if(u.conversion==="C")l+=String(c).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")c=String(Math.trunc(c)),u.width!==null&&(c=n(c,u.width,u.flag)),l+=c;else if(u.conversion==="e")l+=Number(c).toExponential();else if(u.conversion==="E")l+=Number(c).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(c=Number(c).toFixed(u.precision)),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="o")l+=(Number.parseInt(String(c),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="S")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=String(c).toUpperCase();else if(u.conversion==="u")l+=Number.parseInt(String(c),10)>>>0;else if(u.conversion==="x")c=(Number.parseInt(String(c),10)>>>0).toString(16),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else throw new Error("Unknown format specifier.")}return l}};v2.createPrintf=qpe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=v2;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(rj);var vE={exports:{}};(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,t.stringify=r,t.configure=_,e.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function o(b){return b.length<5e3&&!i.test(b)?`"${b}"`:JSON.stringify(b)}function a(b){if(b.length>200)return b.sort();for(let y=1;y<b.length;y++){const g=b[y];let v=y;for(;v!==0&&b[v-1]>g;)b[v]=b[v-1],v--;b[v]=g}return b}const s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(b){return s.call(b)!==void 0&&b.length!==0}function u(b,y,g){b.length<g&&(g=b.length);const v=y===","?"":" ";let S=`"0":${v}${b[0]}`;for(let w=1;w<g;w++)S+=`${y}"${w}":${v}${b[w]}`;return S}function c(b){if(n.call(b,"circularValue")){const y=b.circularValue;if(typeof y=="string")return`"${y}"`;if(y==null)return y;if(y===Error||y===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(b,y){let g;if(n.call(b,y)&&(g=b[y],typeof g!="boolean"))throw new TypeError(`The "${y}" argument must be of type boolean`);return g===void 0?!0:g}function f(b,y){let g;if(n.call(b,y)){if(g=b[y],typeof g!="number")throw new TypeError(`The "${y}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${y}" argument must be an integer`);if(g<1)throw new RangeError(`The "${y}" argument must be >= 1`)}return g===void 0?1/0:g}function h(b){return b===1?"1 item":`${b} items`}function p(b){const y=new Set;for(const g of b)(typeof g=="string"||typeof g=="number")&&y.add(String(g));return y}function m(b){if(n.call(b,"strict")){const y=b.strict;if(typeof y!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(y)return g=>{let v=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(v+=` (${g.toString()})`),new Error(v)}}}function _(b){b={...b};const y=m(b);y&&(b.bigint===void 0&&(b.bigint=!1),"circularValue"in b||(b.circularValue=Error));const g=c(b),v=d(b,"bigint"),S=d(b,"deterministic"),w=f(b,"maximumDepth"),x=f(b,"maximumBreadth");function C(O,E,A,D,L,M){let R=E[O];switch(typeof R=="object"&&R!==null&&typeof R.toJSON=="function"&&(R=R.toJSON(O)),R=D.call(E,O,R),typeof R){case"string":return o(R);case"object":{if(R===null)return"null";if(A.indexOf(R)!==-1)return g;let N="",B=",";const U=M;if(Array.isArray(R)){if(R.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(R),L!==""&&(M+=L,N+=`
-${M}`,B=`,
-${M}`);const Q=Math.min(R.length,x);let ne=0;for(;ne<Q-1;ne++){const ye=C(String(ne),R,A,D,L,M);N+=ye!==void 0?ye:"null",N+=B}const se=C(String(ne),R,A,D,L,M);if(N+=se!==void 0?se:"null",R.length-1>x){const ye=R.length-x-1;N+=`${B}"... ${h(ye)} not stringified"`}return L!==""&&(N+=`
-${U}`),A.pop(),`[${N}]`}let G=Object.keys(R);const Z=G.length;if(Z===0)return"{}";if(w<A.length+1)return'"[Object]"';let ee="",J="";L!==""&&(M+=L,B=`,
-${M}`,ee=" ");const j=Math.min(Z,x);S&&!l(R)&&(G=a(G)),A.push(R);for(let Q=0;Q<j;Q++){const ne=G[Q],se=C(ne,R,A,D,L,M);se!==void 0&&(N+=`${J}${o(ne)}:${ee}${se}`,J=B)}if(Z>x){const Q=Z-x;N+=`${J}"...":${ee}"${h(Q)} not stringified"`,J=B}return L!==""&&J.length>1&&(N=`
-${M}${N}
-${U}`),A.pop(),`{${N}}`}case"number":return isFinite(R)?String(R):y?y(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(R);default:return y?y(R):void 0}}function k(O,E,A,D,L,M){switch(typeof E=="object"&&E!==null&&typeof E.toJSON=="function"&&(E=E.toJSON(O)),typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(A.indexOf(E)!==-1)return g;const R=M;let N="",B=",";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(E),L!==""&&(M+=L,N+=`
-${M}`,B=`,
-${M}`);const Z=Math.min(E.length,x);let ee=0;for(;ee<Z-1;ee++){const j=k(String(ee),E[ee],A,D,L,M);N+=j!==void 0?j:"null",N+=B}const J=k(String(ee),E[ee],A,D,L,M);if(N+=J!==void 0?J:"null",E.length-1>x){const j=E.length-x-1;N+=`${B}"... ${h(j)} not stringified"`}return L!==""&&(N+=`
-${R}`),A.pop(),`[${N}]`}A.push(E);let U="";L!==""&&(M+=L,B=`,
-${M}`,U=" ");let G="";for(const Z of D){const ee=k(Z,E[Z],A,D,L,M);ee!==void 0&&(N+=`${G}${o(Z)}:${U}${ee}`,G=B)}return L!==""&&G.length>1&&(N=`
-${M}${N}
-${R}`),A.pop(),`{${N}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function T(O,E,A,D,L){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(O),typeof E!="object")return T(O,E,A,D,L);if(E===null)return"null"}if(A.indexOf(E)!==-1)return g;const M=L;if(Array.isArray(E)){if(E.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(E),L+=D;let ee=`
-${L}`;const J=`,
-${L}`,j=Math.min(E.length,x);let Q=0;for(;Q<j-1;Q++){const se=T(String(Q),E[Q],A,D,L);ee+=se!==void 0?se:"null",ee+=J}const ne=T(String(Q),E[Q],A,D,L);if(ee+=ne!==void 0?ne:"null",E.length-1>x){const se=E.length-x-1;ee+=`${J}"... ${h(se)} not stringified"`}return ee+=`
-${M}`,A.pop(),`[${ee}]`}let R=Object.keys(E);const N=R.length;if(N===0)return"{}";if(w<A.length+1)return'"[Object]"';L+=D;const B=`,
-${L}`;let U="",G="",Z=Math.min(N,x);l(E)&&(U+=u(E,B,x),R=R.slice(E.length),Z-=E.length,G=B),S&&(R=a(R)),A.push(E);for(let ee=0;ee<Z;ee++){const J=R[ee],j=T(J,E[J],A,D,L);j!==void 0&&(U+=`${G}${o(J)}: ${j}`,G=B)}if(N>x){const ee=N-x;U+=`${G}"...": "${h(ee)} not stringified"`,G=B}return G!==""&&(U=`
-${L}${U}
-${M}`),A.pop(),`{${U}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function P(O,E,A){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(O),typeof E!="object")return P(O,E,A);if(E===null)return"null"}if(A.indexOf(E)!==-1)return g;let D="";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(E);const B=Math.min(E.length,x);let U=0;for(;U<B-1;U++){const Z=P(String(U),E[U],A);D+=Z!==void 0?Z:"null",D+=","}const G=P(String(U),E[U],A);if(D+=G!==void 0?G:"null",E.length-1>x){const Z=E.length-x-1;D+=`,"... ${h(Z)} not stringified"`}return A.pop(),`[${D}]`}let L=Object.keys(E);const M=L.length;if(M===0)return"{}";if(w<A.length+1)return'"[Object]"';let R="",N=Math.min(M,x);l(E)&&(D+=u(E,",",x),L=L.slice(E.length),N-=E.length,R=","),S&&(L=a(L)),A.push(E);for(let B=0;B<N;B++){const U=L[B],G=P(U,E[U],A);G!==void 0&&(D+=`${R}${o(U)}:${G}`,R=",")}if(M>x){const B=M-x;D+=`${R}"...":"${h(B)} not stringified"`}return A.pop(),`{${D}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function $(O,E,A){if(arguments.length>1){let D="";if(typeof A=="number"?D=" ".repeat(Math.min(A,10)):typeof A=="string"&&(D=A.slice(0,10)),E!=null){if(typeof E=="function")return C("",{"":O},[],E,D,"");if(Array.isArray(E))return k("",O,[],p(E),D,"")}if(D.length!==0)return T("",O,[],D,"")}return P("",O,[])}return $}})(vE,vE.exports);var Hpe=vE.exports;(function(e){var t=yt&&yt.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=Nd,r=_y,i=nj,o=rj,a=t(Ik),s=t(Hpe);let l=!1;const u=(0,a.default)(),c=()=>u.ROARR,d=()=>({messageContext:{},transforms:[]}),f=()=>{const g=c().asyncLocalStorage;if(!g)throw new Error("AsyncLocalContext is unavailable.");const v=g.getStore();return v||d()},h=()=>!!c().asyncLocalStorage,p=()=>{if(h()){const g=f();return(0,i.hasOwnProperty)(g,"sequenceRoot")&&(0,i.hasOwnProperty)(g,"sequence")&&typeof g.sequence=="number"?String(g.sequenceRoot)+"."+String(g.sequence++):String(c().sequence++)}return String(c().sequence++)},m=(g,v)=>(S,w,x,C,k,T,P,$,O,E)=>{g.child({logLevel:v})(S,w,x,C,k,T,P,$,O,E)},_=1e3,b=(g,v)=>(S,w,x,C,k,T,P,$,O,E)=>{const A=(0,s.default)({a:S,b:w,c:x,d:C,e:k,f:T,g:P,h:$,i:O,j:E,logLevel:v});if(!A)throw new Error("Expected key to be a string");const D=c().onceLog;D.has(A)||(D.add(A),D.size>_&&D.clear(),g.child({logLevel:v})(S,w,x,C,k,T,P,$,O,E))},y=(g,v={},S=[])=>{const w=(x,C,k,T,P,$,O,E,A,D)=>{const L=Date.now(),M=p();let R;h()?R=f():R=d();let N,B;if(typeof x=="string"?N={...R.messageContext,...v}:N={...R.messageContext,...v,...x},typeof x=="string"&&C===void 0)B=x;else if(typeof x=="string"){if(!x.includes("%"))throw new Error("When a string parameter is followed by other arguments, then it is assumed that you are attempting to format a message using printf syntax. You either forgot to add printf bindings or if you meant to add context to the log message, pass them in an object as the first parameter.");B=(0,o.printf)(x,C,k,T,P,$,O,E,A,D)}else{let G=C;if(typeof C!="string")if(C===void 0)G="";else throw new TypeError("Message must be a string. Received "+typeof C+".");B=(0,o.printf)(G,k,T,P,$,O,E,A,D)}let U={context:N,message:B,sequence:M,time:L,version:n.ROARR_LOG_FORMAT_VERSION};for(const G of[...R.transforms,...S])if(U=G(U),typeof U!="object"||U===null)throw new Error("Message transform function must return a message object.");g(U)};return w.child=x=>{let C;return h()?C=f():C=d(),typeof x=="function"?(0,e.createLogger)(g,{...C.messageContext,...v,...x},[x,...S]):(0,e.createLogger)(g,{...C.messageContext,...v,...x},S)},w.getContext=()=>{let x;return h()?x=f():x=d(),{...x.messageContext,...v}},w.adopt=async(x,C)=>{if(!h())return l===!1&&(l=!0,g({context:{logLevel:r.logLevels.warn,package:"roarr"},message:"async_hooks are unavailable; Roarr.adopt will not function as expected",sequence:p(),time:Date.now(),version:n.ROARR_LOG_FORMAT_VERSION})),x();const k=f();let T;(0,i.hasOwnProperty)(k,"sequenceRoot")&&(0,i.hasOwnProperty)(k,"sequence")&&typeof k.sequence=="number"?T=k.sequenceRoot+"."+String(k.sequence++):T=String(c().sequence++);let P={...k.messageContext};const $=[...k.transforms];typeof C=="function"?$.push(C):P={...P,...C};const O=c().asyncLocalStorage;if(!O)throw new Error("Async local context unavailable.");return O.run({messageContext:P,sequence:0,sequenceRoot:T,transforms:$},()=>x())},w.debug=m(w,r.logLevels.debug),w.debugOnce=b(w,r.logLevels.debug),w.error=m(w,r.logLevels.error),w.errorOnce=b(w,r.logLevels.error),w.fatal=m(w,r.logLevels.fatal),w.fatalOnce=b(w,r.logLevels.fatal),w.info=m(w,r.logLevels.info),w.infoOnce=b(w,r.logLevels.info),w.trace=m(w,r.logLevels.trace),w.traceOnce=b(w,r.logLevels.trace),w.warn=m(w,r.logLevels.warn),w.warnOnce=b(w,r.logLevels.warn),w};e.createLogger=y})(tj);var _2={},Wpe=function(t,n){for(var r=t.split("."),i=n.split("."),o=0;o<3;o++){var a=Number(r[o]),s=Number(i[o]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0},Kpe=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_2,"__esModule",{value:!0});_2.createRoarrInitialGlobalStateBrowser=void 0;const pR=Nd,gR=Kpe(Wpe),Qpe=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(gR.default),t.includes(pR.ROARR_VERSION)||t.push(pR.ROARR_VERSION),t.sort(gR.default),{sequence:0,...e,versions:t}};_2.createRoarrInitialGlobalStateBrowser=Qpe;var S2={};Object.defineProperty(S2,"__esModule",{value:!0});S2.getLogLevelName=void 0;const Xpe=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";S2.getLogLevelName=Xpe;(function(e){var t=yt&&yt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLogLevelName=e.logLevels=e.Roarr=e.ROARR=void 0;const n=tj,r=_2,o=(0,t(Ik).default)(),a=(0,r.createRoarrInitialGlobalStateBrowser)(o.ROARR||{});e.ROARR=a,o.ROARR=a;const s=d=>JSON.stringify(d),l=(0,n.createLogger)(d=>{var f;a.write&&a.write(((f=a.serializeMessage)!==null&&f!==void 0?f:s)(d))});e.Roarr=l;var u=_y;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return u.logLevels}});var c=S2;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return c.getLogLevelName}})})(by);var Ype=yt&&yt.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Zpe=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r2,"__esModule",{value:!0});r2.createLogWriter=void 0;var Jpe=i2,ege=Pk,tge=Zpe(Ik),ij=qz,nge=by,mR=(0,tge.default)(),rge={debug:{backgroundColor:"#712bde",color:"#fff"},error:{backgroundColor:"#f05033",color:"#fff"},fatal:{backgroundColor:"#f05033",color:"#fff"},info:{backgroundColor:"#3174f1",color:"#fff"},trace:{backgroundColor:"#666",color:"#fff"},warn:{backgroundColor:"#f5a623",color:"#000"}},ige={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},oge=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,ij.parse)(t):null},age=function(e){var t,n;e===void 0&&(e={});var r=(t=e==null?void 0:e.storage)!==null&&t!==void 0?t:mR.localStorage,i=(n=e==null?void 0:e.logMethods)!==null&&n!==void 0?n:(0,Jpe.createLogMethods)();if(!r&&!mR.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,ege.boolean)(r.getItem("ROARR_LOG")))return function(){};var o=oge(r);return function(a){var s=JSON.parse(a),l=s.context,u=l.logLevel,c=l.namespace,d=Ype(l,["logLevel","namespace"]);if(!(o&&!(0,ij.test)(o,s))){var f=(0,nge.getLogLevelName)(Number(u)),h=i[f],p=rge[f],m=`
-      background-color: `.concat(p.backgroundColor,`;
-      color: `).concat(p.color,`;
-      font-weight: bold;
-    `),_=`
-      color: `.concat(ige[f].color,`;
-    `),b=`
-      color: inherit;
-    `;Object.keys(d).length>0?h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(s.message," %O"),m,_,b,d):h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(s.message),m,_,b)}}};r2.createLogWriter=age;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=r2;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(Mz);by.ROARR.write=Mz.createLogWriter();const oj={};by.Roarr.child(oj);const x2=nl(by.Roarr.child(oj)),_e=e=>x2.get().child({namespace:e}),RGe=["trace","debug","info","warn","error","fatal"],OGe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Xt=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return"Error parsing object"}},sge=async e=>{const t={},n=await e.arrayBuffer(),r=Jfe(n).text,i=ch(r,"invokeai_metadata");if(i){const a=UB.safeParse(JSON.parse(i));a.success?t.metadata=a.data:_e("system").error({error:Xt(a.error)},"Problem reading metadata from image")}const o=ch(r,"invokeai_workflow");if(o){const a=WB.safeParse(JSON.parse(o));a.success?t.workflow=a.data:_e("system").error({error:Xt(a.error)},"Problem reading workflow from image")}return t};var v_=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},b_=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},lge=Object.defineProperty,uge=Object.defineProperties,cge=Object.getOwnPropertyDescriptors,__=Object.getOwnPropertySymbols,aj=Object.prototype.hasOwnProperty,sj=Object.prototype.propertyIsEnumerable,yR=function(e,t,n){return t in e?lge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Cr=function(e,t){for(var n in t||(t={}))aj.call(t,n)&&yR(e,n,t[n]);if(__)for(var r=0,i=__(t);r<i.length;r++){var n=i[r];sj.call(t,n)&&yR(e,n,t[n])}return e},Ds=function(e,t){return uge(e,cge(t))},vR=function(e,t){var n={};for(var r in e)aj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&__)for(var i=0,o=__(e);i<o.length;i++){var r=o[i];t.indexOf(r)<0&&sj.call(e,r)&&(n[r]=e[r])}return n},S_=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},tr;(function(e){e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"})(tr||(tr={}));function dge(e){return{status:e,isUninitialized:e===tr.uninitialized,isLoading:e===tr.pending,isSuccess:e===tr.fulfilled,isError:e===tr.rejected}}function fge(e){return new RegExp("(^|:)//").test(e)}var hge=function(e){return e.replace(/\/$/,"")},pge=function(e){return e.replace(/^\//,"")};function gge(e,t){if(!e)return t;if(!t)return e;if(fge(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=hge(e),t=pge(t),""+e+n+t}var bR=function(e){return[].concat.apply([],e)};function mge(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function yge(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var _R=ss;function lj(e,t){if(e===t||!(_R(e)&&_R(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,o=Array.isArray(t)?[]:{},a=0,s=n;a<s.length;a++){var l=s[a];o[l]=lj(e[l],t[l]),i&&(i=e[l]===o[l])}return i?e:o}var SR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},vge=function(e){return e.status>=200&&e.status<=299},bge=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function xR(e){if(!ss(e))return e;for(var t=Cr({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],o=i[0],a=i[1];a===void 0&&delete t[o]}return t}function _ge(e){var t=this;e===void 0&&(e={});var n=e,r=n.baseUrl,i=n.prepareHeaders,o=i===void 0?function(g){return g}:i,a=n.fetchFn,s=a===void 0?SR:a,l=n.paramsSerializer,u=n.isJsonContentType,c=u===void 0?bge:u,d=n.jsonContentType,f=d===void 0?"application/json":d,h=n.jsonReplacer,p=n.timeout,m=n.responseHandler,_=n.validateStatus,b=vR(n,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&s===SR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(g,v){return S_(t,null,function(){var S,w,x,C,k,T,P,$,O,E,A,D,L,M,R,N,B,U,G,Z,ee,J,j,Q,ne,se,ye,ce,bt,ot,ze,mt,Pe,en,Pr,Ln;return v_(this,function(An){switch(An.label){case 0:return S=v.signal,w=v.getState,x=v.extra,C=v.endpoint,k=v.forced,T=v.type,$=typeof g=="string"?{url:g}:g,O=$.url,E=$.headers,A=E===void 0?new Headers(b.headers):E,D=$.params,L=D===void 0?void 0:D,M=$.responseHandler,R=M===void 0?m??"json":M,N=$.validateStatus,B=N===void 0?_??vge:N,U=$.timeout,G=U===void 0?p:U,Z=vR($,["url","headers","params","responseHandler","validateStatus","timeout"]),ee=Cr(Ds(Cr({},b),{signal:S}),Z),A=new Headers(xR(A)),J=ee,[4,o(A,{getState:w,extra:x,endpoint:C,forced:k,type:T})];case 1:J.headers=An.sent()||A,j=function(tn){return typeof tn=="object"&&(ss(tn)||Array.isArray(tn)||typeof tn.toJSON=="function")},!ee.headers.has("content-type")&&j(ee.body)&&ee.headers.set("content-type",f),j(ee.body)&&c(ee.headers)&&(ee.body=JSON.stringify(ee.body,h)),L&&(Q=~O.indexOf("?")?"&":"?",ne=l?l(L):new URLSearchParams(xR(L)),O+=Q+ne),O=gge(r,O),se=new Request(O,ee),ye=se.clone(),P={request:ye},bt=!1,ot=G&&setTimeout(function(){bt=!0,v.abort()},G),An.label=2;case 2:return An.trys.push([2,4,5,6]),[4,s(se)];case 3:return ce=An.sent(),[3,6];case 4:return ze=An.sent(),[2,{error:{status:bt?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ze)},meta:P}];case 5:return ot&&clearTimeout(ot),[7];case 6:mt=ce.clone(),P.response=mt,en="",An.label=7;case 7:return An.trys.push([7,9,,10]),[4,Promise.all([y(ce,R).then(function(tn){return Pe=tn},function(tn){return Pr=tn}),mt.text().then(function(tn){return en=tn},function(){})])];case 8:if(An.sent(),Pr)throw Pr;return[3,10];case 9:return Ln=An.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ce.status,data:en,error:String(Ln)},meta:P}];case 10:return[2,B(ce,Pe)?{data:Pe,meta:P}:{error:{status:ce.status,data:Pe},meta:P}]}})})};function y(g,v){return S_(this,null,function(){var S;return v_(this,function(w){switch(w.label){case 0:return typeof v=="function"?[2,v(g)]:(v==="content-type"&&(v=c(g.headers)?"json":"text"),v!=="json"?[3,2]:[4,g.text()]);case 1:return S=w.sent(),[2,S.length?JSON.parse(S):null];case 2:return[2,g.text()]}})})}}var wR=function(){function e(t,n){n===void 0&&(n=void 0),this.value=t,this.meta=n}return e}(),Mk=Ne("__rtkq/focused"),uj=Ne("__rtkq/unfocused"),Nk=Ne("__rtkq/online"),cj=Ne("__rtkq/offline"),Zs;(function(e){e.query="query",e.mutation="mutation"})(Zs||(Zs={}));function dj(e){return e.type===Zs.query}function Sge(e){return e.type===Zs.mutation}function fj(e,t,n,r,i,o){return xge(e)?e(t,n,r,i).map(bE).map(o):Array.isArray(e)?e.map(bE).map(o):[]}function xge(e){return typeof e=="function"}function bE(e){return typeof e=="string"?{type:e}:e}function AC(e){return e!=null}var o0=Symbol("forceQueryFn"),_E=function(e){return typeof e[o0]=="function"};function wge(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,o=e.context,a=new Map,s=new Map,l=i.internalActions,u=l.unsubscribeQueryResult,c=l.removeMutationResult,d=l.updateSubscriptionOptions;return{buildInitiateQuery:y,buildInitiateMutation:g,getRunningQueryThunk:p,getRunningMutationThunk:m,getRunningQueriesThunk:_,getRunningMutationsThunk:b,getRunningOperationPromises:h,removalWarning:f};function f(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
-       Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
-       See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}function h(){typeof process<"u";var v=function(S){return Array.from(S.values()).flatMap(function(w){return w?Object.values(w):[]})};return b_(b_([],v(a)),v(s)).filter(AC)}function p(v,S){return function(w){var x,C=o.endpointDefinitions[v],k=t({queryArgs:S,endpointDefinition:C,endpointName:v});return(x=a.get(w))==null?void 0:x[k]}}function m(v,S){return function(w){var x;return(x=s.get(w))==null?void 0:x[S]}}function _(){return function(v){return Object.values(a.get(v)||{}).filter(AC)}}function b(){return function(v){return Object.values(s.get(v)||{}).filter(AC)}}function y(v,S){var w=function(x,C){var k=C===void 0?{}:C,T=k.subscribe,P=T===void 0?!0:T,$=k.forceRefetch,O=k.subscriptionOptions,E=o0,A=k[E];return function(D,L){var M,R,N=t({queryArgs:x,endpointDefinition:S,endpointName:v}),B=n((M={type:"query",subscribe:P,forceRefetch:$,subscriptionOptions:O,endpointName:v,originalArgs:x,queryCacheKey:N},M[o0]=A,M)),U=i.endpoints[v].select(x),G=D(B),Z=U(L()),ee=G.requestId,J=G.abort,j=Z.requestId!==ee,Q=(R=a.get(D))==null?void 0:R[N],ne=function(){return U(L())},se=Object.assign(A?G.then(ne):j&&!Q?Promise.resolve(Z):Promise.all([Q,G]).then(ne),{arg:x,requestId:ee,subscriptionOptions:O,queryCacheKey:N,abort:J,unwrap:function(){return S_(this,null,function(){var ce;return v_(this,function(bt){switch(bt.label){case 0:return[4,se];case 1:if(ce=bt.sent(),ce.isError)throw ce.error;return[2,ce.data]}})})},refetch:function(){return D(w(x,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){P&&D(u({queryCacheKey:N,requestId:ee}))},updateSubscriptionOptions:function(ce){se.subscriptionOptions=ce,D(d({endpointName:v,requestId:ee,queryCacheKey:N,options:ce}))}});if(!Q&&!j&&!A){var ye=a.get(D)||{};ye[N]=se,a.set(D,ye),se.then(function(){delete ye[N],Object.keys(ye).length||a.delete(D)})}return se}};return w}function g(v){return function(S,w){var x=w===void 0?{}:w,C=x.track,k=C===void 0?!0:C,T=x.fixedCacheKey;return function(P,$){var O=r({type:"mutation",endpointName:v,originalArgs:S,track:k,fixedCacheKey:T}),E=P(O),A=E.requestId,D=E.abort,L=E.unwrap,M=E.unwrap().then(function(U){return{data:U}}).catch(function(U){return{error:U}}),R=function(){P(c({requestId:A,fixedCacheKey:T}))},N=Object.assign(M,{arg:E.arg,requestId:A,abort:D,unwrap:L,unsubscribe:R,reset:R}),B=s.get(P)||{};return s.set(P,B),B[A]=N,N.then(function(){delete B[A],Object.keys(B).length||s.delete(P)}),T&&(B[T]=N,N.then(function(){B[T]===N&&(delete B[T],Object.keys(B).length||s.delete(P))})),N}}}}function CR(e){return e}function Cge(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,o=e.serializeQueryArgs,a=e.api,s=function(g,v,S){return function(w){var x=i[g];w(a.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:v,endpointDefinition:x,endpointName:g}),patches:S}))}},l=function(g,v,S){return function(w,x){var C,k,T=a.endpoints[g].select(v)(x()),P={patches:[],inversePatches:[],undo:function(){return w(a.util.patchQueryData(g,v,P.inversePatches))}};if(T.status===tr.uninitialized)return P;if("data"in T)if(Po(T.data)){var $=Q4(T.data,S),O=$[1],E=$[2];(C=P.patches).push.apply(C,O),(k=P.inversePatches).push.apply(k,E)}else{var A=S(T.data);P.patches.push({op:"replace",path:[],value:A}),P.inversePatches.push({op:"replace",path:[],value:T.data})}return w(a.util.patchQueryData(g,v,P.patches)),P}},u=function(g,v,S){return function(w){var x;return w(a.endpoints[g].initiate(v,(x={subscribe:!1,forceRefetch:!0},x[o0]=function(){return{data:S}},x)))}},c=function(g,v){return S_(t,[g,v],function(S,w){var x,C,k,T,P,$,O,E,A,D,L,M,R,N,B,U,G,Z,ee=w.signal,J=w.abort,j=w.rejectWithValue,Q=w.fulfillWithValue,ne=w.dispatch,se=w.getState,ye=w.extra;return v_(this,function(ce){switch(ce.label){case 0:x=i[S.endpointName],ce.label=1;case 1:return ce.trys.push([1,8,,13]),C=CR,k=void 0,T={signal:ee,abort:J,dispatch:ne,getState:se,extra:ye,endpoint:S.endpointName,type:S.type,forced:S.type==="query"?d(S,se()):void 0},P=S.type==="query"?S[o0]:void 0,P?(k=P(),[3,6]):[3,2];case 2:return x.query?[4,r(x.query(S.originalArgs),T,x.extraOptions)]:[3,4];case 3:return k=ce.sent(),x.transformResponse&&(C=x.transformResponse),[3,6];case 4:return[4,x.queryFn(S.originalArgs,T,x.extraOptions,function(bt){return r(bt,T,x.extraOptions)})];case 5:k=ce.sent(),ce.label=6;case 6:if(typeof process<"u",k.error)throw new wR(k.error,k.meta);return L=Q,[4,C(k.data,k.meta,S.originalArgs)];case 7:return[2,L.apply(void 0,[ce.sent(),(G={fulfilledTimeStamp:Date.now(),baseQueryMeta:k.meta},G[td]=!0,G)])];case 8:if(M=ce.sent(),R=M,!(R instanceof wR))return[3,12];N=CR,x.query&&x.transformErrorResponse&&(N=x.transformErrorResponse),ce.label=9;case 9:return ce.trys.push([9,11,,12]),B=j,[4,N(R.value,R.meta,S.originalArgs)];case 10:return[2,B.apply(void 0,[ce.sent(),(Z={baseQueryMeta:R.meta},Z[td]=!0,Z)])];case 11:return U=ce.sent(),R=U,[3,12];case 12:throw typeof process<"u",console.error(R),R;case 13:return[2]}})})};function d(g,v){var S,w,x,C,k=(w=(S=v[n])==null?void 0:S.queries)==null?void 0:w[g.queryCacheKey],T=(x=v[n])==null?void 0:x.config.refetchOnMountOrArgChange,P=k==null?void 0:k.fulfilledTimeStamp,$=(C=g.forceRefetch)!=null?C:g.subscribe&&T;return $?$===!0||(Number(new Date)-Number(P))/1e3>=$:!1}var f=jb(n+"/executeQuery",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[td]=!0,g},condition:function(g,v){var S=v.getState,w,x,C,k=S(),T=(x=(w=k[n])==null?void 0:w.queries)==null?void 0:x[g.queryCacheKey],P=T==null?void 0:T.fulfilledTimeStamp,$=g.originalArgs,O=T==null?void 0:T.originalArgs,E=i[g.endpointName];return _E(g)?!0:(T==null?void 0:T.status)==="pending"?!1:d(g,k)||dj(E)&&((C=E==null?void 0:E.forceRefetch)!=null&&C.call(E,{currentArg:$,previousArg:O,endpointState:T,state:k}))?!0:!P},dispatchConditionRejection:!0}),h=jb(n+"/executeMutation",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[td]=!0,g}}),p=function(g){return"force"in g},m=function(g){return"ifOlderThan"in g},_=function(g,v,S){return function(w,x){var C=p(S)&&S.force,k=m(S)&&S.ifOlderThan,T=function(E){return E===void 0&&(E=!0),a.endpoints[g].initiate(v,{forceRefetch:E})},P=a.endpoints[g].select(v)(x());if(C)w(T());else if(k){var $=P==null?void 0:P.fulfilledTimeStamp;if(!$){w(T());return}var O=(Number(new Date)-Number(new Date($)))/1e3>=k;O&&w(T())}else w(T(!1))}};function b(g){return function(v){var S,w;return((w=(S=v==null?void 0:v.meta)==null?void 0:S.arg)==null?void 0:w.endpointName)===g}}function y(g,v){return{matchPending:ah(DS(g),b(v)),matchFulfilled:ah(Sc(g),b(v)),matchRejected:ah(Uh(g),b(v))}}return{queryThunk:f,mutationThunk:h,prefetch:_,updateQueryData:l,upsertQueryData:u,patchQueryData:s,buildMatchThunkActions:y}}function hj(e,t,n,r){return fj(n[e.meta.arg.endpointName][t],Sc(e)?e.payload:void 0,ey(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function wv(e,t,n){var r=e[t];r&&n(r)}function a0(e){var t;return(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)!=null?t:e.requestId}function ER(e,t,n){var r=e[a0(t)];r&&n(r)}var Kp={};function Ege(e){var t=e.reducerPath,n=e.queryThunk,r=e.mutationThunk,i=e.context,o=i.endpointDefinitions,a=i.apiUid,s=i.extractRehydrationInfo,l=i.hasRehydrationInfo,u=e.assertTagType,c=e.config,d=Ne(t+"/resetApiState"),f=rr({name:t+"/queries",initialState:Kp,reducers:{removeQueryResult:{reducer:function(S,w){var x=w.payload.queryCacheKey;delete S[x]},prepare:O1()},queryResultPatched:function(S,w){var x=w.payload,C=x.queryCacheKey,k=x.patches;wv(S,C,function(T){T.data=z3(T.data,k.concat())})}},extraReducers:function(S){S.addCase(n.pending,function(w,x){var C=x.meta,k=x.meta.arg,T,P,$=_E(k);(k.subscribe||$)&&((P=w[T=k.queryCacheKey])!=null||(w[T]={status:tr.uninitialized,endpointName:k.endpointName})),wv(w,k.queryCacheKey,function(O){O.status=tr.pending,O.requestId=$&&O.requestId?O.requestId:C.requestId,k.originalArgs!==void 0&&(O.originalArgs=k.originalArgs),O.startedTimeStamp=C.startedTimeStamp})}).addCase(n.fulfilled,function(w,x){var C=x.meta,k=x.payload;wv(w,C.arg.queryCacheKey,function(T){var P;if(!(T.requestId!==C.requestId&&!_E(C.arg))){var $=o[C.arg.endpointName].merge;if(T.status=tr.fulfilled,$)if(T.data!==void 0){var O=C.fulfilledTimeStamp,E=C.arg,A=C.baseQueryMeta,D=C.requestId,L=_c(T.data,function(M){return $(M,k,{arg:E.originalArgs,baseQueryMeta:A,fulfilledTimeStamp:O,requestId:D})});T.data=L}else T.data=k;else T.data=(P=o[C.arg.endpointName].structuralSharing)==null||P?lj(ao(T.data)?U4(T.data):T.data,k):k;delete T.error,T.fulfilledTimeStamp=C.fulfilledTimeStamp}})}).addCase(n.rejected,function(w,x){var C=x.meta,k=C.condition,T=C.arg,P=C.requestId,$=x.error,O=x.payload;wv(w,T.queryCacheKey,function(E){if(!k){if(E.requestId!==P)return;E.status=tr.rejected,E.error=O??$}})}).addMatcher(l,function(w,x){for(var C=s(x).queries,k=0,T=Object.entries(C);k<T.length;k++){var P=T[k],$=P[0],O=P[1];((O==null?void 0:O.status)===tr.fulfilled||(O==null?void 0:O.status)===tr.rejected)&&(w[$]=O)}})}}),h=rr({name:t+"/mutations",initialState:Kp,reducers:{removeMutationResult:{reducer:function(S,w){var x=w.payload,C=a0(x);C in S&&delete S[C]},prepare:O1()}},extraReducers:function(S){S.addCase(r.pending,function(w,x){var C=x.meta,k=x.meta,T=k.requestId,P=k.arg,$=k.startedTimeStamp;P.track&&(w[a0(C)]={requestId:T,status:tr.pending,endpointName:P.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,function(w,x){var C=x.payload,k=x.meta;k.arg.track&&ER(w,k,function(T){T.requestId===k.requestId&&(T.status=tr.fulfilled,T.data=C,T.fulfilledTimeStamp=k.fulfilledTimeStamp)})}).addCase(r.rejected,function(w,x){var C=x.payload,k=x.error,T=x.meta;T.arg.track&&ER(w,T,function(P){P.requestId===T.requestId&&(P.status=tr.rejected,P.error=C??k)})}).addMatcher(l,function(w,x){for(var C=s(x).mutations,k=0,T=Object.entries(C);k<T.length;k++){var P=T[k],$=P[0],O=P[1];((O==null?void 0:O.status)===tr.fulfilled||(O==null?void 0:O.status)===tr.rejected)&&$!==(O==null?void 0:O.requestId)&&(w[$]=O)}})}}),p=rr({name:t+"/invalidation",initialState:Kp,reducers:{},extraReducers:function(S){S.addCase(f.actions.removeQueryResult,function(w,x){for(var C=x.payload.queryCacheKey,k=0,T=Object.values(w);k<T.length;k++)for(var P=T[k],$=0,O=Object.values(P);$<O.length;$++){var E=O[$],A=E.indexOf(C);A!==-1&&E.splice(A,1)}}).addMatcher(l,function(w,x){for(var C,k,T,P,$=s(x).provided,O=0,E=Object.entries($);O<E.length;O++)for(var A=E[O],D=A[0],L=A[1],M=0,R=Object.entries(L);M<R.length;M++)for(var N=R[M],B=N[0],U=N[1],G=(P=(k=(C=w[D])!=null?C:w[D]={})[T=B||"__internal_without_id"])!=null?P:k[T]=[],Z=0,ee=U;Z<ee.length;Z++){var J=ee[Z],j=G.includes(J);j||G.push(J)}}).addMatcher($o(Sc(n),ey(n)),function(w,x){for(var C,k,T,P,$=hj(x,"providesTags",o,u),O=x.meta.arg.queryCacheKey,E=0,A=Object.values(w);E<A.length;E++)for(var D=A[E],L=0,M=Object.values(D);L<M.length;L++){var R=M[L],N=R.indexOf(O);N!==-1&&R.splice(N,1)}for(var B=0,U=$;B<U.length;B++){var G=U[B],Z=G.type,ee=G.id,J=(P=(k=(C=w[Z])!=null?C:w[Z]={})[T=ee||"__internal_without_id"])!=null?P:k[T]=[],j=J.includes(O);j||J.push(O)}})}}),m=rr({name:t+"/subscriptions",initialState:Kp,reducers:{updateSubscriptionOptions:function(S,w){},unsubscribeQueryResult:function(S,w){},internal_probeSubscription:function(S,w){}}}),_=rr({name:t+"/internalSubscriptions",initialState:Kp,reducers:{subscriptionsUpdated:{reducer:function(S,w){return z3(S,w.payload)},prepare:O1()}}}),b=rr({name:t+"/config",initialState:Cr({online:mge(),focused:yge(),middlewareRegistered:!1},c),reducers:{middlewareRegistered:function(S,w){var x=w.payload;S.middlewareRegistered=S.middlewareRegistered==="conflict"||a!==x?"conflict":!0}},extraReducers:function(S){S.addCase(Nk,function(w){w.online=!0}).addCase(cj,function(w){w.online=!1}).addCase(Mk,function(w){w.focused=!0}).addCase(uj,function(w){w.focused=!1}).addMatcher(l,function(w){return Cr({},w)})}}),y=pp({queries:f.reducer,mutations:h.reducer,provided:p.reducer,subscriptions:_.reducer,config:b.reducer}),g=function(S,w){return y(d.match(w)?void 0:S,w)},v=Ds(Cr(Cr(Cr(Cr(Cr({},b.actions),f.actions),m.actions),_.actions),h.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:d});return{reducer:g,actions:v}}var od=Symbol.for("RTKQ/skipToken"),pj={status:tr.uninitialized},TR=_c(pj,function(){}),kR=_c(pj,function(){});function Tge(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(c){return TR},i=function(c){return kR};return{buildQuerySelector:s,buildMutationSelector:l,selectInvalidatedBy:u};function o(c){return Cr(Cr({},c),dge(c.status))}function a(c){var d=c[n];return d}function s(c,d){return function(f){var h=t({queryArgs:f,endpointDefinition:d,endpointName:c}),p=function(_){var b,y,g;return(g=(y=(b=a(_))==null?void 0:b.queries)==null?void 0:y[h])!=null?g:TR},m=f===od?r:p;return Ii(m,o)}}function l(){return function(c){var d,f;typeof c=="object"?f=(d=a0(c))!=null?d:od:f=c;var h=function(m){var _,b,y;return(y=(b=(_=a(m))==null?void 0:_.mutations)==null?void 0:b[f])!=null?y:kR},p=f===od?i:h;return Ii(p,o)}}function u(c,d){for(var f,h=c[n],p=new Set,m=0,_=d.map(bE);m<_.length;m++){var b=_[m],y=h.provided[b.type];if(y)for(var g=(f=b.id!==void 0?y[b.id]:bR(Object.values(y)))!=null?f:[],v=0,S=g;v<S.length;v++){var w=S[v];p.add(w)}}return bR(Array.from(p.values()).map(function(x){var C=h.queries[x];return C?[{queryCacheKey:x,endpointName:C.endpointName,originalArgs:C.originalArgs}]:[]}))}}var Cv=WeakMap?new WeakMap:void 0,AR=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Cv==null?void 0:Cv.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return ss(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});ss(n)&&(Cv==null||Cv.set(n,o)),r=o}return t+"("+r+")"};function kge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var i=zb(function(c){var d,f;return(f=r.extractRehydrationInfo)==null?void 0:f.call(r,c,{reducerPath:(d=r.reducerPath)!=null?d:"api"})}),o=Ds(Cr({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},r),{extractRehydrationInfo:i,serializeQueryArgs:function(c){var d=AR;if("serializeQueryArgs"in c.endpointDefinition){var f=c.endpointDefinition.serializeQueryArgs;d=function(h){var p=f(h);return typeof p=="string"?p:AR(Ds(Cr({},h),{queryArgs:p}))}}else r.serializeQueryArgs&&(d=r.serializeQueryArgs);return d(c)},tagTypes:b_([],r.tagTypes||[])}),a={endpointDefinitions:{},batch:function(c){c()},apiUid:NS(),extractRehydrationInfo:i,hasRehydrationInfo:zb(function(c){return i(c)!=null})},s={injectEndpoints:u,enhanceEndpoints:function(c){var d=c.addTagTypes,f=c.endpoints;if(d)for(var h=0,p=d;h<p.length;h++){var m=p[h];o.tagTypes.includes(m)||o.tagTypes.push(m)}if(f)for(var _=0,b=Object.entries(f);_<b.length;_++){var y=b[_],g=y[0],v=y[1];typeof v=="function"?v(a.endpointDefinitions[g]):Object.assign(a.endpointDefinitions[g]||{},v)}return s}},l=e.map(function(c){return c.init(s,o,a)});function u(c){for(var d=c.endpoints({query:function(v){return Ds(Cr({},v),{type:Zs.query})},mutation:function(v){return Ds(Cr({},v),{type:Zs.mutation})}}),f=0,h=Object.entries(d);f<h.length;f++){var p=h[f],m=p[0],_=p[1];if(!c.overrideExisting&&m in a.endpointDefinitions){typeof process<"u";continue}a.endpointDefinitions[m]=_;for(var b=0,y=l;b<y.length;b++){var g=y[b];g.injectEndpoint(m,_)}}return s}return s.injectEndpoints({endpoints:r.endpoints})}}function Age(e){for(var t in e)return!1;return!0}var Pge=2147483647/1e3-1,Ige=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,o=n.internalActions,a=o.removeQueryResult,s=o.unsubscribeQueryResult;function l(f){var h=i.currentSubscriptions[f];return!!h&&!Age(h)}var u={},c=function(f,h,p){var m;if(s.match(f)){var _=h.getState()[t],b=f.payload.queryCacheKey;d(b,(m=_.queries[b])==null?void 0:m.endpointName,h,_.config)}if(n.util.resetApiState.match(f))for(var y=0,g=Object.entries(u);y<g.length;y++){var v=g[y],S=v[0],w=v[1];w&&clearTimeout(w),delete u[S]}if(r.hasRehydrationInfo(f))for(var _=h.getState()[t],x=r.extractRehydrationInfo(f).queries,C=0,k=Object.entries(x);C<k.length;C++){var T=k[C],b=T[0],P=T[1];d(b,P==null?void 0:P.endpointName,h,_.config)}};function d(f,h,p,m){var _,b=r.endpointDefinitions[h],y=(_=b==null?void 0:b.keepUnusedDataFor)!=null?_:m.keepUnusedDataFor;if(y!==1/0){var g=Math.max(0,Math.min(y,Pge));if(!l(f)){var v=u[f];v&&clearTimeout(v),u[f]=setTimeout(function(){l(f)||p.dispatch(a({queryCacheKey:f})),delete u[f]},g*1e3)}}}return c},Rge=function(e){var t=e.reducerPath,n=e.context,r=e.context.endpointDefinitions,i=e.mutationThunk,o=e.api,a=e.assertTagType,s=e.refetchQuery,l=o.internalActions.removeQueryResult,u=$o(Sc(i),ey(i)),c=function(f,h){u(f)&&d(hj(f,"invalidatesTags",r,a),h),o.util.invalidateTags.match(f)&&d(fj(f.payload,void 0,void 0,void 0,void 0,a),h)};function d(f,h){var p=h.getState(),m=p[t],_=o.util.selectInvalidatedBy(p,f);n.batch(function(){for(var b,y=Array.from(_.values()),g=0,v=y;g<v.length;g++){var S=v[g].queryCacheKey,w=m.queries[S],x=(b=m.subscriptions[S])!=null?b:{};w&&(Object.keys(x).length===0?h.dispatch(l({queryCacheKey:S})):w.status!==tr.uninitialized&&h.dispatch(s(w,S)))}})}return c},Oge=function(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.refetchQuery,o=e.internalState,a={},s=function(h,p){(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&u(h.payload,p),(n.pending.match(h)||n.rejected.match(h)&&h.meta.condition)&&u(h.meta.arg,p),(n.fulfilled.match(h)||n.rejected.match(h)&&!h.meta.condition)&&l(h.meta.arg,p),r.util.resetApiState.match(h)&&d()};function l(h,p){var m=h.queryCacheKey,_=p.getState()[t],b=_.queries[m],y=o.currentSubscriptions[m];if(!(!b||b.status===tr.uninitialized)){var g=f(y);if(Number.isFinite(g)){var v=a[m];v!=null&&v.timeout&&(clearTimeout(v.timeout),v.timeout=void 0);var S=Date.now()+g,w=a[m]={nextPollTimestamp:S,pollingInterval:g,timeout:setTimeout(function(){w.timeout=void 0,p.dispatch(i(b,m))},g)}}}}function u(h,p){var m=h.queryCacheKey,_=p.getState()[t],b=_.queries[m],y=o.currentSubscriptions[m];if(!(!b||b.status===tr.uninitialized)){var g=f(y);if(!Number.isFinite(g)){c(m);return}var v=a[m],S=Date.now()+g;(!v||S<v.nextPollTimestamp)&&l({queryCacheKey:m},p)}}function c(h){var p=a[h];p!=null&&p.timeout&&clearTimeout(p.timeout),delete a[h]}function d(){for(var h=0,p=Object.keys(a);h<p.length;h++){var m=p[h];c(m)}}function f(h){h===void 0&&(h={});var p=Number.POSITIVE_INFINITY;for(var m in h)h[m].pollingInterval&&(p=Math.min(h[m].pollingInterval,p));return p}return s},Mge=function(e){var t=e.reducerPath,n=e.context,r=e.api,i=e.refetchQuery,o=e.internalState,a=r.internalActions.removeQueryResult,s=function(u,c){Mk.match(u)&&l(c,"refetchOnFocus"),Nk.match(u)&&l(c,"refetchOnReconnect")};function l(u,c){var d=u.getState()[t],f=d.queries,h=o.currentSubscriptions;n.batch(function(){for(var p=0,m=Object.keys(h);p<m.length;p++){var _=m[p],b=f[_],y=h[_];if(!(!y||!b)){var g=Object.values(y).some(function(v){return v[c]===!0})||Object.values(y).every(function(v){return v[c]===void 0})&&d.config[c];g&&(Object.keys(y).length===0?u.dispatch(a({queryCacheKey:_})):b.status!==tr.uninitialized&&u.dispatch(i(b,_)))}}})}return s},PR=new Error("Promise never resolved before cacheEntryRemoved."),Nge=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,o=e.mutationThunk;e.internalState;var a=Ub(i),s=Ub(o),l=Sc(i,o),u={},c=function(h,p,m){var _=d(h);if(i.pending.match(h)){var b=m[n].queries[_],y=p.getState()[n].queries[_];!b&&y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(o.pending.match(h)){var y=p.getState()[n].mutations[_];y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(l(h)){var g=u[_];g!=null&&g.valueResolved&&(g.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete g.valueResolved)}else if(t.internalActions.removeQueryResult.match(h)||t.internalActions.removeMutationResult.match(h)){var g=u[_];g&&(delete u[_],g.cacheEntryRemoved())}else if(t.util.resetApiState.match(h))for(var v=0,S=Object.entries(u);v<S.length;v++){var w=S[v],x=w[0],g=w[1];delete u[x],g.cacheEntryRemoved()}};function d(h){return a(h)?h.meta.arg.queryCacheKey:s(h)?h.meta.requestId:t.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:t.internalActions.removeMutationResult.match(h)?a0(h.payload):""}function f(h,p,m,_,b){var y=r.endpointDefinitions[h],g=y==null?void 0:y.onCacheEntryAdded;if(g){var v={},S=new Promise(function(P){v.cacheEntryRemoved=P}),w=Promise.race([new Promise(function(P){v.valueResolved=P}),S.then(function(){throw PR})]);w.catch(function(){}),u[m]=v;var x=t.endpoints[h].select(y.type===Zs.query?p:m),C=_.dispatch(function(P,$,O){return O}),k=Ds(Cr({},_),{getCacheEntry:function(){return x(_.getState())},requestId:b,extra:C,updateCachedData:y.type===Zs.query?function(P){return _.dispatch(t.util.updateQueryData(h,p,P))}:void 0,cacheDataLoaded:w,cacheEntryRemoved:S}),T=g(p,k);Promise.resolve(T).catch(function(P){if(P!==PR)throw P})}}return c},$ge=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,o=DS(r,i),a=Uh(r,i),s=Sc(r,i),l={},u=function(c,d){var f,h,p;if(o(c)){var m=c.meta,_=m.requestId,b=m.arg,y=b.endpointName,g=b.originalArgs,v=n.endpointDefinitions[y],S=v==null?void 0:v.onQueryStarted;if(S){var w={},x=new Promise(function(A,D){w.resolve=A,w.reject=D});x.catch(function(){}),l[_]=w;var C=t.endpoints[y].select(v.type===Zs.query?g:_),k=d.dispatch(function(A,D,L){return L}),T=Ds(Cr({},d),{getCacheEntry:function(){return C(d.getState())},requestId:_,extra:k,updateCachedData:v.type===Zs.query?function(A){return d.dispatch(t.util.updateQueryData(y,g,A))}:void 0,queryFulfilled:x});S(g,T)}}else if(s(c)){var P=c.meta,_=P.requestId,$=P.baseQueryMeta;(f=l[_])==null||f.resolve({data:c.payload,meta:$}),delete l[_]}else if(a(c)){var O=c.meta,_=O.requestId,E=O.rejectedWithValue,$=O.baseQueryMeta;(p=l[_])==null||p.reject({error:(h=c.payload)!=null?h:c.error,isUnhandledError:!E,meta:$}),delete l[_]}};return u},Dge=function(e){var t=e.api,n=e.context.apiUid,r=e.reducerPath;return function(i,o){var a,s;t.util.resetApiState.match(i)&&o.dispatch(t.internalActions.middlewareRegistered(n)),typeof process<"u"}},IR,Lge=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(IR||(IR=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},Fge=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",o=null,a=!1,s=t.internalActions,l=s.updateSubscriptionOptions,u=s.unsubscribeQueryResult,c=function(d,f){var h,p,m,_,b,y,g,v,S;if(l.match(f)){var w=f.payload,x=w.queryCacheKey,C=w.requestId,k=w.options;return(h=d==null?void 0:d[x])!=null&&h[C]&&(d[x][C]=k),!0}if(u.match(f)){var T=f.payload,x=T.queryCacheKey,C=T.requestId;return d[x]&&delete d[x][C],!0}if(t.internalActions.removeQueryResult.match(f))return delete d[f.payload.queryCacheKey],!0;if(n.pending.match(f)){var P=f.meta,$=P.arg,C=P.requestId;if($.subscribe){var O=(m=d[p=$.queryCacheKey])!=null?m:d[p]={};return O[C]=(b=(_=$.subscriptionOptions)!=null?_:O[C])!=null?b:{},!0}}if(n.rejected.match(f)){var E=f.meta,A=E.condition,$=E.arg,C=E.requestId;if(A&&$.subscribe){var O=(g=d[y=$.queryCacheKey])!=null?g:d[y]={};return O[C]=(S=(v=$.subscriptionOptions)!=null?v:O[C])!=null?S:{},!0}}return!1};return function(d,f){var h,p;if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(d))return o=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(d)){var m=d.payload,_=m.queryCacheKey,b=m.requestId,y=!!((h=r.currentSubscriptions[_])!=null&&h[b]);return[!1,y]}var g=c(r.currentSubscriptions,d);if(g){a||(Lge(function(){var x=JSON.parse(JSON.stringify(r.currentSubscriptions)),C=Q4(o,function(){return x}),k=C[1];f.next(t.internalActions.subscriptionsUpdated(k)),o=x,a=!1}),a=!0);var v=!!((p=d.type)!=null&&p.startsWith(i)),S=n.rejected.match(d)&&d.meta.condition&&!!d.meta.arg.subscribe,w=!v&&!S;return[w,!1]}return[!0,!1]}};function Bge(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.context,o=i.apiUid,a={invalidateTags:Ne(t+"/invalidateTags")},s=function(d){return!!d&&typeof d.type=="string"&&d.type.startsWith(t+"/")},l=[Dge,Ige,Rge,Oge,Nge,$ge],u=function(d){var f=!1,h={currentSubscriptions:{}},p=Ds(Cr({},e),{internalState:h,refetchQuery:c}),m=l.map(function(y){return y(p)}),_=Fge(p),b=Mge(p);return function(y){return function(g){f||(f=!0,d.dispatch(r.internalActions.middlewareRegistered(o)));var v=Ds(Cr({},d),{next:y}),S=d.getState(),w=_(g,v,S),x=w[0],C=w[1],k;if(x?k=y(g):k=C,d.getState()[t]&&(b(g,v,S),s(g)||i.hasRehydrationInfo(g)))for(var T=0,P=m;T<P.length;T++){var $=P[T];$(g,v,S)}return k}}};return{middleware:u,actions:a};function c(d,f,h){return h===void 0&&(h={}),n(Cr({type:"query",endpointName:d.endpointName,originalArgs:d.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:f},h))}}function cu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,b_([e],t))}var RR=Symbol(),zge=function(){return{name:RR,init:function(e,t,n){var r=t.baseQuery,i=t.tagTypes,o=t.reducerPath,a=t.serializeQueryArgs,s=t.keepUnusedDataFor,l=t.refetchOnMountOrArgChange,u=t.refetchOnFocus,c=t.refetchOnReconnect;W4();var d=function(G){return typeof process<"u",G};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:Nk,onOffline:cj,onFocus:Mk,onFocusLost:uj},util:{}});var f=Cge({baseQuery:r,reducerPath:o,context:n,api:e,serializeQueryArgs:a}),h=f.queryThunk,p=f.mutationThunk,m=f.patchQueryData,_=f.updateQueryData,b=f.upsertQueryData,y=f.prefetch,g=f.buildMatchThunkActions,v=Ege({context:n,queryThunk:h,mutationThunk:p,reducerPath:o,assertTagType:d,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:l,keepUnusedDataFor:s,reducerPath:o}}),S=v.reducer,w=v.actions;cu(e.util,{patchQueryData:m,updateQueryData:_,upsertQueryData:b,prefetch:y,resetApiState:w.resetApiState}),cu(e.internalActions,w);var x=Bge({reducerPath:o,context:n,queryThunk:h,mutationThunk:p,api:e,assertTagType:d}),C=x.middleware,k=x.actions;cu(e.util,k),cu(e,{reducer:S,middleware:C});var T=Tge({serializeQueryArgs:a,reducerPath:o}),P=T.buildQuerySelector,$=T.buildMutationSelector,O=T.selectInvalidatedBy;cu(e.util,{selectInvalidatedBy:O});var E=wge({queryThunk:h,mutationThunk:p,api:e,serializeQueryArgs:a,context:n}),A=E.buildInitiateQuery,D=E.buildInitiateMutation,L=E.getRunningMutationThunk,M=E.getRunningMutationsThunk,R=E.getRunningQueriesThunk,N=E.getRunningQueryThunk,B=E.getRunningOperationPromises,U=E.removalWarning;return cu(e.util,{getRunningOperationPromises:B,getRunningOperationPromise:U,getRunningMutationThunk:L,getRunningMutationsThunk:M,getRunningQueryThunk:N,getRunningQueriesThunk:R}),{name:RR,injectEndpoint:function(G,Z){var ee,J,j=e;(J=(ee=j.endpoints)[G])!=null||(ee[G]={}),dj(Z)?cu(j.endpoints[G],{name:G,select:P(G,Z),initiate:A(G,Z)},g(h,G)):Sge(Z)&&cu(j.endpoints[G],{name:G,select:$(),initiate:D(G)},g(p,G))}}}}},gj={exports:{}},mj={};/**
- * @license React
- * use-sync-external-store-shim.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Zh=I;function jge(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Uge=typeof Object.is=="function"?Object.is:jge,Vge=Zh.useState,Gge=Zh.useEffect,qge=Zh.useLayoutEffect,Hge=Zh.useDebugValue;function Wge(e,t){var n=t(),r=Vge({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return qge(function(){i.value=n,i.getSnapshot=t,PC(i)&&o({inst:i})},[e,n,t]),Gge(function(){return PC(i)&&o({inst:i}),e(function(){PC(i)&&o({inst:i})})},[e]),Hge(n),n}function PC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Uge(e,n)}catch{return!0}}function Kge(e,t){return t()}var Qge=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Kge:Wge;mj.useSyncExternalStore=Zh.useSyncExternalStore!==void 0?Zh.useSyncExternalStore:Qge;gj.exports=mj;var Xge=gj.exports,yj={exports:{}},vj={};/**
- * @license React
- * use-sync-external-store-shim/with-selector.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var w2=I,Yge=Xge;function Zge(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jge=typeof Object.is=="function"?Object.is:Zge,eme=Yge.useSyncExternalStore,tme=w2.useRef,nme=w2.useEffect,rme=w2.useMemo,ime=w2.useDebugValue;vj.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=tme(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=rme(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&a.hasValue){var p=a.value;if(i(p,h))return d=p}return d=h}if(p=d,Jge(c,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(c=h,d=m)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var s=eme(e,o[0],o[1]);return nme(function(){a.hasValue=!0,a.value=s},[s]),ime(s),s};yj.exports=vj;var bj=yj.exports;const ome=mc(bj);function ame(e){e()}let _j=ame;const sme=e=>_j=e,lme=()=>_j,OR=Symbol.for("react-redux-context"),MR=typeof globalThis<"u"?globalThis:{};function ume(){var e;if(!I.createContext)return{};const t=(e=MR[OR])!=null?e:MR[OR]=new Map;let n=t.get(I.createContext);return n||(n=I.createContext(null),t.set(I.createContext,n)),n}const lc=ume();function $k(e=lc){return function(){return I.useContext(e)}}const Sj=$k(),cme=()=>{throw new Error("uSES not initialized!")};let xj=cme;const dme=e=>{xj=e},fme=(e,t)=>e===t;function hme(e=lc){const t=e===lc?Sj:$k(e);return function(r,i={}){const{equalityFn:o=fme,stabilityCheck:a=void 0,noopCheck:s=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:l,subscription:u,getServerState:c,stabilityCheck:d,noopCheck:f}=t();I.useRef(!0);const h=I.useCallback({[r.name](m){return r(m)}}[r.name],[r,d,a]),p=xj(u.addNestedSub,l.getState,c||l.getState,h,o);return I.useDebugValue(p),p}}const wj=hme();function x_(){return x_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x_.apply(this,arguments)}var Cj={exports:{}},vn={};/** @license React v16.13.1
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var hi=typeof Symbol=="function"&&Symbol.for,Dk=hi?Symbol.for("react.element"):60103,Lk=hi?Symbol.for("react.portal"):60106,C2=hi?Symbol.for("react.fragment"):60107,E2=hi?Symbol.for("react.strict_mode"):60108,T2=hi?Symbol.for("react.profiler"):60114,k2=hi?Symbol.for("react.provider"):60109,A2=hi?Symbol.for("react.context"):60110,Fk=hi?Symbol.for("react.async_mode"):60111,P2=hi?Symbol.for("react.concurrent_mode"):60111,I2=hi?Symbol.for("react.forward_ref"):60112,R2=hi?Symbol.for("react.suspense"):60113,pme=hi?Symbol.for("react.suspense_list"):60120,O2=hi?Symbol.for("react.memo"):60115,M2=hi?Symbol.for("react.lazy"):60116,gme=hi?Symbol.for("react.block"):60121,mme=hi?Symbol.for("react.fundamental"):60117,yme=hi?Symbol.for("react.responder"):60118,vme=hi?Symbol.for("react.scope"):60119;function ra(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Dk:switch(e=e.type,e){case Fk:case P2:case C2:case T2:case E2:case R2:return e;default:switch(e=e&&e.$$typeof,e){case A2:case I2:case M2:case O2:case k2:return e;default:return t}}case Lk:return t}}}function Ej(e){return ra(e)===P2}vn.AsyncMode=Fk;vn.ConcurrentMode=P2;vn.ContextConsumer=A2;vn.ContextProvider=k2;vn.Element=Dk;vn.ForwardRef=I2;vn.Fragment=C2;vn.Lazy=M2;vn.Memo=O2;vn.Portal=Lk;vn.Profiler=T2;vn.StrictMode=E2;vn.Suspense=R2;vn.isAsyncMode=function(e){return Ej(e)||ra(e)===Fk};vn.isConcurrentMode=Ej;vn.isContextConsumer=function(e){return ra(e)===A2};vn.isContextProvider=function(e){return ra(e)===k2};vn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Dk};vn.isForwardRef=function(e){return ra(e)===I2};vn.isFragment=function(e){return ra(e)===C2};vn.isLazy=function(e){return ra(e)===M2};vn.isMemo=function(e){return ra(e)===O2};vn.isPortal=function(e){return ra(e)===Lk};vn.isProfiler=function(e){return ra(e)===T2};vn.isStrictMode=function(e){return ra(e)===E2};vn.isSuspense=function(e){return ra(e)===R2};vn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===C2||e===P2||e===T2||e===E2||e===R2||e===pme||typeof e=="object"&&e!==null&&(e.$$typeof===M2||e.$$typeof===O2||e.$$typeof===k2||e.$$typeof===A2||e.$$typeof===I2||e.$$typeof===mme||e.$$typeof===yme||e.$$typeof===vme||e.$$typeof===gme)};vn.typeOf=ra;Cj.exports=vn;var bme=Cj.exports,Tj=bme,_me={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Sme={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},kj={};kj[Tj.ForwardRef]=_me;kj[Tj.Memo]=Sme;var kn={};/**
- * @license React
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Bk=Symbol.for("react.element"),zk=Symbol.for("react.portal"),N2=Symbol.for("react.fragment"),$2=Symbol.for("react.strict_mode"),D2=Symbol.for("react.profiler"),L2=Symbol.for("react.provider"),F2=Symbol.for("react.context"),xme=Symbol.for("react.server_context"),B2=Symbol.for("react.forward_ref"),z2=Symbol.for("react.suspense"),j2=Symbol.for("react.suspense_list"),U2=Symbol.for("react.memo"),V2=Symbol.for("react.lazy"),wme=Symbol.for("react.offscreen"),Aj;Aj=Symbol.for("react.module.reference");function ka(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Bk:switch(e=e.type,e){case N2:case D2:case $2:case z2:case j2:return e;default:switch(e=e&&e.$$typeof,e){case xme:case F2:case B2:case V2:case U2:case L2:return e;default:return t}}case zk:return t}}}kn.ContextConsumer=F2;kn.ContextProvider=L2;kn.Element=Bk;kn.ForwardRef=B2;kn.Fragment=N2;kn.Lazy=V2;kn.Memo=U2;kn.Portal=zk;kn.Profiler=D2;kn.StrictMode=$2;kn.Suspense=z2;kn.SuspenseList=j2;kn.isAsyncMode=function(){return!1};kn.isConcurrentMode=function(){return!1};kn.isContextConsumer=function(e){return ka(e)===F2};kn.isContextProvider=function(e){return ka(e)===L2};kn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bk};kn.isForwardRef=function(e){return ka(e)===B2};kn.isFragment=function(e){return ka(e)===N2};kn.isLazy=function(e){return ka(e)===V2};kn.isMemo=function(e){return ka(e)===U2};kn.isPortal=function(e){return ka(e)===zk};kn.isProfiler=function(e){return ka(e)===D2};kn.isStrictMode=function(e){return ka(e)===$2};kn.isSuspense=function(e){return ka(e)===z2};kn.isSuspenseList=function(e){return ka(e)===j2};kn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===N2||e===D2||e===$2||e===z2||e===j2||e===wme||typeof e=="object"&&e!==null&&(e.$$typeof===V2||e.$$typeof===U2||e.$$typeof===L2||e.$$typeof===F2||e.$$typeof===B2||e.$$typeof===Aj||e.getModuleId!==void 0)};kn.typeOf=ka;function Cme(){const e=lme();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const NR={notify(){},get:()=>[]};function Eme(e,t){let n,r=NR;function i(d){return l(),r.subscribe(d)}function o(){r.notify()}function a(){c.onStateChange&&c.onStateChange()}function s(){return!!n}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=Cme())}function u(){n&&(n(),n=void 0,r.clear(),r=NR)}const c={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}const Tme=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kme=Tme?I.useLayoutEffect:I.useEffect;function $R(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function w_(e,t){if($R(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!$R(e[n[i]],t[n[i]]))return!1;return!0}function Ame({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const a=I.useMemo(()=>{const u=Eme(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[e,r,i,o]),s=I.useMemo(()=>e.getState(),[e]);kme(()=>{const{subscription:u}=a;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),s!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[a,s]);const l=t||lc;return I.createElement(l.Provider,{value:a},n)}function Pj(e=lc){const t=e===lc?Sj:$k(e);return function(){const{store:r}=t();return r}}const Ij=Pj();function Pme(e=lc){const t=e===lc?Ij:Pj(e);return function(){return t().dispatch}}const Rj=Pme();dme(bj.useSyncExternalStoreWithSelector);sme(Vo.unstable_batchedUpdates);var Ime=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Rme=Object.defineProperty,Ome=Object.defineProperties,Mme=Object.getOwnPropertyDescriptors,DR=Object.getOwnPropertySymbols,Nme=Object.prototype.hasOwnProperty,$me=Object.prototype.propertyIsEnumerable,LR=function(e,t,n){return t in e?Rme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},gl=function(e,t){for(var n in t||(t={}))Nme.call(t,n)&&LR(e,n,t[n]);if(DR)for(var r=0,i=DR(t);r<i.length;r++){var n=i[r];$me.call(t,n)&&LR(e,n,t[n])}return e},F1=function(e,t){return Ome(e,Mme(t))};function FR(e,t,n,r){var i=I.useMemo(function(){return{queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}},[e,t,n,r]),o=I.useRef(i);return I.useEffect(function(){o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var IC=Symbol();function RC(e){var t=I.useRef(e);return I.useEffect(function(){w_(t.current,e)||(t.current=e)},[e]),w_(t.current,e)?t.current:e}var Ev=WeakMap?new WeakMap:void 0,Dme=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Ev==null?void 0:Ev.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return ss(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});ss(n)&&(Ev==null||Ev.set(n,o)),r=o}return t+"("+r+")"},Lme=typeof window<"u"&&window.document&&window.document.createElement?I.useLayoutEffect:I.useEffect,Fme=function(e){return e},Bme=function(e){return e.isUninitialized?F1(gl({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:tr.pending}):e};function zme(e){var t=e.api,n=e.moduleOptions,r=n.batch,i=n.useDispatch,o=n.useSelector,a=n.useStore,s=n.unstable__sideEffectsInRender,l=e.serializeQueryArgs,u=e.context,c=s?function(m){return m()}:I.useEffect;return{buildQueryHooks:h,buildMutationHook:p,usePrefetch:f};function d(m,_,b){if(_!=null&&_.endpointName&&m.isUninitialized){var y=_.endpointName,g=u.endpointDefinitions[y];l({queryArgs:_.originalArgs,endpointDefinition:g,endpointName:y})===l({queryArgs:b,endpointDefinition:g,endpointName:y})&&(_=void 0)}var v=m.isSuccess?m.data:_==null?void 0:_.data;v===void 0&&(v=m.data);var S=v!==void 0,w=m.isLoading,x=!S&&w,C=m.isSuccess||w&&S;return F1(gl({},m),{data:v,currentData:m.data,isFetching:w,isLoading:x,isSuccess:C})}function f(m,_){var b=i(),y=RC(_);return I.useCallback(function(g,v){return b(t.util.prefetch(m,g,gl(gl({},y),v)))},[m,b,y])}function h(m){var _=function(g,v){var S=v===void 0?{}:v,w=S.refetchOnReconnect,x=S.refetchOnFocus,C=S.refetchOnMountOrArgChange,k=S.skip,T=k===void 0?!1:k,P=S.pollingInterval,$=P===void 0?0:P,O=t.endpoints[m].initiate,E=i(),A=FR(T?od:g,Dme,u.endpointDefinitions[m],m),D=RC({refetchOnReconnect:w,refetchOnFocus:x,pollingInterval:$}),L=I.useRef(!1),M=I.useRef(),R=M.current||{},N=R.queryCacheKey,B=R.requestId,U=!1;if(N&&B){var G=E(t.internalActions.internal_probeSubscription({queryCacheKey:N,requestId:B}));U=!!G}var Z=!U&&L.current;return c(function(){L.current=U}),c(function(){Z&&(M.current=void 0)},[Z]),c(function(){var ee,J=M.current;if(typeof process<"u",A===od){J==null||J.unsubscribe(),M.current=void 0;return}var j=(ee=M.current)==null?void 0:ee.subscriptionOptions;if(!J||J.arg!==A){J==null||J.unsubscribe();var Q=E(O(A,{subscriptionOptions:D,forceRefetch:C}));M.current=Q}else D!==j&&J.updateSubscriptionOptions(D)},[E,O,C,A,D,Z]),I.useEffect(function(){return function(){var ee;(ee=M.current)==null||ee.unsubscribe(),M.current=void 0}},[]),I.useMemo(function(){return{refetch:function(){var ee;if(!M.current)throw new Error("Cannot refetch a query that has not been started yet.");return(ee=M.current)==null?void 0:ee.refetch()}}},[])},b=function(g){var v=g===void 0?{}:g,S=v.refetchOnReconnect,w=v.refetchOnFocus,x=v.pollingInterval,C=x===void 0?0:x,k=t.endpoints[m].initiate,T=i(),P=I.useState(IC),$=P[0],O=P[1],E=I.useRef(),A=RC({refetchOnReconnect:S,refetchOnFocus:w,pollingInterval:C});c(function(){var M,R,N=(M=E.current)==null?void 0:M.subscriptionOptions;A!==N&&((R=E.current)==null||R.updateSubscriptionOptions(A))},[A]);var D=I.useRef(A);c(function(){D.current=A},[A]);var L=I.useCallback(function(M,R){R===void 0&&(R=!1);var N;return r(function(){var B;(B=E.current)==null||B.unsubscribe(),E.current=N=T(k(M,{subscriptionOptions:D.current,forceRefetch:!R})),O(M)}),N},[T,k]);return I.useEffect(function(){return function(){var M;(M=E==null?void 0:E.current)==null||M.unsubscribe()}},[]),I.useEffect(function(){$!==IC&&!E.current&&L($,!0)},[$,L]),I.useMemo(function(){return[L,$]},[L,$])},y=function(g,v){var S=v===void 0?{}:v,w=S.skip,x=w===void 0?!1:w,C=S.selectFromResult,k=t.endpoints[m].select,T=FR(x?od:g,l,u.endpointDefinitions[m],m),P=I.useRef(),$=I.useMemo(function(){return Ii([k(T),function(L,M){return M},function(L){return T}],d)},[k,T]),O=I.useMemo(function(){return C?Ii([$],C):$},[$,C]),E=o(function(L){return O(L,P.current)},w_),A=a(),D=$(A.getState(),P.current);return Lme(function(){P.current=D},[D]),E};return{useQueryState:y,useQuerySubscription:_,useLazyQuerySubscription:b,useLazyQuery:function(g){var v=b(g),S=v[0],w=v[1],x=y(w,F1(gl({},g),{skip:w===IC})),C=I.useMemo(function(){return{lastArg:w}},[w]);return I.useMemo(function(){return[S,x,C]},[S,x,C])},useQuery:function(g,v){var S=_(g,v),w=y(g,gl({selectFromResult:g===od||v!=null&&v.skip?void 0:Bme},v)),x=w.data,C=w.status,k=w.isLoading,T=w.isSuccess,P=w.isError,$=w.error;return I.useDebugValue({data:x,status:C,isLoading:k,isSuccess:T,isError:P,error:$}),I.useMemo(function(){return gl(gl({},w),S)},[w,S])}}}function p(m){return function(_){var b=_===void 0?{}:_,y=b.selectFromResult,g=y===void 0?Fme:y,v=b.fixedCacheKey,S=t.endpoints[m],w=S.select,x=S.initiate,C=i(),k=I.useState(),T=k[0],P=k[1];I.useEffect(function(){return function(){T!=null&&T.arg.fixedCacheKey||T==null||T.reset()}},[T]);var $=I.useCallback(function(J){var j=C(x(J,{fixedCacheKey:v}));return P(j),j},[C,x,v]),O=(T||{}).requestId,E=I.useMemo(function(){return Ii([w({fixedCacheKey:v,requestId:T==null?void 0:T.requestId})],g)},[w,T,g,v]),A=o(E,w_),D=v==null?T==null?void 0:T.arg.originalArgs:void 0,L=I.useCallback(function(){r(function(){T&&P(void 0),v&&C(t.internalActions.removeMutationResult({requestId:O,fixedCacheKey:v}))})},[C,v,T,O]),M=A.endpointName,R=A.data,N=A.status,B=A.isLoading,U=A.isSuccess,G=A.isError,Z=A.error;I.useDebugValue({endpointName:M,data:R,status:N,isLoading:B,isSuccess:U,isError:G,error:Z});var ee=I.useMemo(function(){return F1(gl({},A),{originalArgs:D,reset:L})},[A,D,L]);return I.useMemo(function(){return[$,ee]},[$,ee])}}}var C_;(function(e){e.query="query",e.mutation="mutation"})(C_||(C_={}));function jme(e){return e.type===C_.query}function Ume(e){return e.type===C_.mutation}function OC(e){return e.replace(e[0],e[0].toUpperCase())}function Tv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,Ime([e],t))}var Vme=Symbol(),Gme=function(e){var t=e===void 0?{}:e,n=t.batch,r=n===void 0?Vo.unstable_batchedUpdates:n,i=t.useDispatch,o=i===void 0?Rj:i,a=t.useSelector,s=a===void 0?wj:a,l=t.useStore,u=l===void 0?Ij:l,c=t.unstable__sideEffectsInRender,d=c===void 0?!1:c;return{name:Vme,init:function(f,h,p){var m=h.serializeQueryArgs,_=f,b=zme({api:f,moduleOptions:{batch:r,useDispatch:o,useSelector:s,useStore:u,unstable__sideEffectsInRender:d},serializeQueryArgs:m,context:p}),y=b.buildQueryHooks,g=b.buildMutationHook,v=b.usePrefetch;return Tv(_,{usePrefetch:v}),Tv(p,{batch:r}),{injectEndpoint:function(S,w){if(jme(w)){var x=y(S),C=x.useQuery,k=x.useLazyQuery,T=x.useLazyQuerySubscription,P=x.useQueryState,$=x.useQuerySubscription;Tv(_.endpoints[S],{useQuery:C,useLazyQuery:k,useLazyQuerySubscription:T,useQueryState:P,useQuerySubscription:$}),f["use"+OC(S)+"Query"]=C,f["useLazy"+OC(S)+"Query"]=k}else if(Ume(w)){var O=g(S);Tv(_.endpoints[S],{useMutation:O}),f["use"+OC(S)+"Mutation"]=O}}}}}},qme=kge(zge(),Gme());const Hme={"Content-Type":"application/json"},Wme=/\/*$/;function Kme(e={}){const{fetch:t=globalThis.fetch,querySerializer:n,bodySerializer:r,...i}=e;async function o(a,s){const{headers:l,body:u,params:c={},parseAs:d="json",querySerializer:f=n??Qme,bodySerializer:h=r??Xme,...p}=s||{},m=Yme(a,{baseUrl:i.baseUrl,params:c,querySerializer:f}),_=Zme(Hme,e==null?void 0:e.headers,l,c.header),b={redirect:"follow",...i,...p,headers:_};u&&(b.body=h(u)),b.body instanceof FormData&&_.delete("Content-Type");const y=await t(m,b);if(y.status===204||y.headers.get("Content-Length")==="0")return y.ok?{data:{},response:y}:{error:{},response:y};if(y.ok){let v=y.body;if(d!=="stream"){const S=y.clone();v=typeof S[d]=="function"?await S[d]():await S.text()}return{data:v,response:y}}let g={};try{g=await y.clone().json()}catch{g=await y.clone().text()}return{error:g,response:y}}return{async GET(a,s){return o(a,{...s,method:"GET"})},async PUT(a,s){return o(a,{...s,method:"PUT"})},async POST(a,s){return o(a,{...s,method:"POST"})},async DELETE(a,s){return o(a,{...s,method:"DELETE"})},async OPTIONS(a,s){return o(a,{...s,method:"OPTIONS"})},async HEAD(a,s){return o(a,{...s,method:"HEAD"})},async PATCH(a,s){return o(a,{...s,method:"PATCH"})},async TRACE(a,s){return o(a,{...s,method:"TRACE"})}}}function Qme(e){const t=new URLSearchParams;if(e&&typeof e=="object")for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r);return t.toString()}function Xme(e){return JSON.stringify(e)}function Yme(e,t){let n=`${t.baseUrl?t.baseUrl.replace(Wme,""):""}${e}`;if(t.params.path)for(const[r,i]of Object.entries(t.params.path))n=n.replace(`{${r}}`,encodeURIComponent(String(i)));if(t.params.query){const r=t.querySerializer(t.params.query);r&&(n+=`?${r}`)}return n}function Zme(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,o]of r)o===null?t.delete(i):o!==void 0&&t.set(i,o)}return t}const Jh=nl(),s0=nl(),l0=nl();Ele([Jh,s0,l0],(e,t,n)=>Kme({headers:{...e?{Authorization:`Bearer ${e}`}:{},...n?{"project-id":n}:{}},baseUrl:`${t??""}`}));const Jme=["Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","ImageMetadataFromFile","Model","SessionQueueItem","SessionQueueItemDTO","SessionQueueItemDTOList","SessionQueueStatus","SessionProcessorStatus","BatchStatus","InvocationCacheStatus"],Mt="LIST",e0e=async(e,t,n)=>{const r=s0.get(),i=Jh.get(),o=l0.get();return _ge({baseUrl:`${r??""}/api/v1`,prepareHeaders:s=>(i&&s.set("Authorization",`Bearer ${i}`),o&&s.set("project-id",o),s)})(e,t,n)},us=qme({baseQuery:e0e,reducerPath:"api",tagTypes:Jme,endpoints:()=>({})}),t0e=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},Oj="%[a-f0-9]{2}",BR=new RegExp("("+Oj+")|([^%]+?)","gi"),zR=new RegExp("("+Oj+")+","gi");function SE(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],SE(n),SE(r))}function n0e(e){try{return decodeURIComponent(e)}catch{let t=e.match(BR)||[];for(let n=1;n<t.length;n++)e=SE(t,n).join(""),t=e.match(BR)||[];return e}}function r0e(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=zR.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=n0e(n[0]);i!==n[0]&&(t[n[0]]=i)}n=zR.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const i of r)e=e.replace(new RegExp(i,"g"),t[i]);return e}function i0e(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return r0e(e)}}function Mj(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}function o0e(e,t){const n={};if(Array.isArray(t))for(const r of t){const i=Object.getOwnPropertyDescriptor(e,r);i!=null&&i.enumerable&&Object.defineProperty(n,r,i)}else for(const r of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){const o=e[r];t(r,o,e)&&Object.defineProperty(n,r,i)}}return n}const a0e=e=>e==null,s0e=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),xE=Symbol("encodeFragmentIdentifier");function l0e(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),"[",i,"]"].join("")]:[...n,[Nr(t,e),"[",Nr(i,e),"]=",Nr(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),"[]"].join("")]:[...n,[Nr(t,e),"[]=",Nr(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),":list="].join("")]:[...n,[Nr(t,e),":list=",Nr(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?r:(i=i===null?"":i,r.length===0?[[Nr(n,e),t,Nr(i,e)].join("")]:[[r,Nr(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,Nr(t,e)]:[...n,[Nr(t,e),"=",Nr(r,e)].join("")]}}function u0e(e){let t;switch(e.arrayFormat){case"index":return(n,r,i)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){i[n]=r;return}i[n]===void 0&&(i[n]={}),i[n][t[1]]=r};case"bracket":return(n,r,i)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"colon-list-separator":return(n,r,i)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"comma":case"separator":return(n,r,i)=>{const o=typeof r=="string"&&r.includes(e.arrayFormatSeparator),a=typeof r=="string"&&!o&&xl(r,e).includes(e.arrayFormatSeparator);r=a?xl(r,e):r;const s=o||a?r.split(e.arrayFormatSeparator).map(l=>xl(l,e)):r===null?r:xl(r,e);i[n]=s};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&xl(r,e);return}const a=r===null?[]:r.split(e.arrayFormatSeparator).map(s=>xl(s,e));if(i[n]===void 0){i[n]=a;return}i[n]=[...i[n],...a]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function Nj(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Nr(e,t){return t.encode?t.strict?s0e(e):encodeURIComponent(e):e}function xl(e,t){return t.decode?i0e(e):e}function $j(e){return Array.isArray(e)?e.sort():typeof e=="object"?$j(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function Dj(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function c0e(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function jR(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function jk(e){e=Dj(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function Uk(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},Nj(t.arrayFormatSeparator);const n=u0e(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const i of e.split("&")){if(i==="")continue;const o=t.decode?i.replace(/\+/g," "):i;let[a,s]=Mj(o,"=");a===void 0&&(a=o),s=s===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:xl(s,t),n(xl(a,t),s,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[a,s]of Object.entries(o))o[a]=jR(s,t);else r[i]=jR(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const a=r[o];return a&&typeof a=="object"&&!Array.isArray(a)?i[o]=$j(a):i[o]=a,i},Object.create(null))}function Lj(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},Nj(t.arrayFormatSeparator);const n=a=>t.skipNull&&a0e(e[a])||t.skipEmptyString&&e[a]==="",r=l0e(t),i={};for(const[a,s]of Object.entries(e))n(a)||(i[a]=s);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(a=>{const s=e[a];return s===void 0?"":s===null?Nr(a,t):Array.isArray(s)?s.length===0&&t.arrayFormat==="bracket-separator"?Nr(a,t)+"[]":s.reduce(r(a),[]).join("&"):Nr(a,t)+"="+Nr(s,t)}).filter(a=>a.length>0).join("&")}function Fj(e,t){var i;t={decode:!0,...t};let[n,r]=Mj(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:Uk(jk(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:xl(r,t)}:{}}}function Bj(e,t){t={encode:!0,strict:!0,[xE]:!0,...t};const n=Dj(e.url).split("?")[0]||"",r=jk(e.url),i={...Uk(r,{sort:!1}),...e.query};let o=Lj(i,t);o&&(o=`?${o}`);let a=c0e(e.url);if(e.fragmentIdentifier){const s=new URL(n);s.hash=e.fragmentIdentifier,a=t[xE]?s.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${a}`}function zj(e,t,n){n={parseFragmentIdentifier:!0,[xE]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=Fj(e,n);return Bj({url:r,query:o0e(i,t),fragmentIdentifier:o},n)}function d0e(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return zj(e,r,n)}const Qg=Object.freeze(Object.defineProperty({__proto__:null,exclude:d0e,extract:jk,parse:Uk,parseUrl:Fj,pick:zj,stringify:Lj,stringifyUrl:Bj},Symbol.toStringTag,{value:"Module"})),Mc=(e,t)=>{if(!e)return!1;const n=u0.selectAll(e);if(n.length<=1)return!0;const r=[],i=[];for(let o=0;o<n.length;o++){const a=n[o];a!=null&&a.starred&&r.push(a),a!=null&&a.starred||i.push(a)}if(t.starred){const o=r[r.length-1];if(!o)return!0;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}else{const o=i[i.length-1];if(!o)return!1;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}},sa=e=>oi.includes(e.image_category)?oi:Ji,Gn=ds({selectId:e=>e.image_name,sortComparer:(e,t)=>e.starred&&!t.starred?-1:!e.starred&&t.starred?1:t0e(t.created_at,e.created_at)}),u0=Gn.getSelectors(),zo=e=>`images/?${Qg.stringify(e,{arrayFormat:"none"})}`,Ft=us.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:t=>{const n=[{type:"Board",id:Mt}];return t&&n.push(...t.items.map(({board_id:r})=>({type:"Board",id:r}))),n}}),listAllBoards:e.query({query:()=>({url:"boards/",params:{all:!0}}),providesTags:t=>{const n=[{type:"Board",id:Mt}];return t&&n.push(...t.map(({board_id:r})=>({type:"Board",id:r}))),n}}),listAllImageNamesForBoard:e.query({query:t=>({url:`boards/${t}/image_names`}),providesTags:(t,n,r)=>[{type:"ImageNameList",id:r}],keepUnusedDataFor:0}),getBoardImagesTotal:e.query({query:t=>({url:zo({board_id:t??"none",categories:oi,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardImagesTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),getBoardAssetsTotal:e.query({query:t=>({url:zo({board_id:t??"none",categories:Ji,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardAssetsTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),createBoard:e.mutation({query:t=>({url:"boards/",method:"POST",params:{board_name:t}}),invalidatesTags:[{type:"Board",id:Mt}]}),updateBoard:e.mutation({query:({board_id:t,changes:n})=>({url:`boards/${t}`,method:"PATCH",body:n}),invalidatesTags:(t,n,r)=>[{type:"Board",id:r.board_id}]})})}),{useListBoardsQuery:MGe,useListAllBoardsQuery:NGe,useGetBoardImagesTotalQuery:$Ge,useGetBoardAssetsTotalQuery:DGe,useCreateBoardMutation:LGe,useUpdateBoardMutation:FGe,useListAllImageNamesForBoardQuery:BGe}=Ft,ve=us.injectEndpoints({endpoints:e=>({listImages:e.query({query:t=>({url:zo(t),method:"GET"}),providesTags:(t,n,{board_id:r,categories:i})=>[{type:"ImageList",id:zo({board_id:r,categories:i})}],serializeQueryArgs:({queryArgs:t})=>{const{board_id:n,categories:r}=t;return zo({board_id:n,categories:r})},transformResponse(t){const{items:n}=t;return Gn.addMany(Gn.getInitialState(),n)},merge:(t,n)=>{Gn.addMany(t,u0.selectAll(n))},forceRefetch({currentArg:t,previousArg:n}){return(t==null?void 0:t.offset)!==(n==null?void 0:n.offset)},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;u0.selectAll(i).forEach(o=>{n(ve.util.upsertQueryData("getImageDTO",o.image_name,o))})}catch{}},keepUnusedDataFor:86400}),getIntermediatesCount:e.query({query:()=>({url:zo({is_intermediate:!0})}),providesTags:["IntermediatesCount"],transformResponse:t=>t.total}),getImageDTO:e.query({query:t=>({url:`images/i/${t}`}),providesTags:(t,n,r)=>[{type:"Image",id:r}],keepUnusedDataFor:86400}),getImageMetadata:e.query({query:t=>({url:`images/i/${t}/metadata`}),providesTags:(t,n,r)=>[{type:"ImageMetadata",id:r}],keepUnusedDataFor:86400}),getImageMetadataFromFile:e.query({queryFn:async(t,n,r,i)=>{var o;if(t.shouldFetchMetadataFromApi){let a;const s=await i(`images/i/${t.image.image_name}/metadata`);if(s.data){const l=UB.safeParse((o=s.data)==null?void 0:o.metadata);l.success&&(a=l.data)}return{data:{metadata:a}}}else{const a=Jh.get(),s=l0.get(),u=await ble.fetchBaseQuery({baseUrl:"",prepareHeaders:d=>(a&&d.set("Authorization",`Bearer ${a}`),s&&d.set("project-id",s),d),responseHandler:async d=>await d.blob()})(t.image.image_url,n,r);return{data:await sge(u.data)}}},providesTags:(t,n,{image:r})=>[{type:"ImageMetadataFromFile",id:r.image_name}],keepUnusedDataFor:86400}),clearIntermediates:e.mutation({query:()=>({url:"images/clear-intermediates",method:"POST"}),invalidatesTags:["IntermediatesCount"]}),deleteImage:e.mutation({query:({image_name:t})=>({url:`images/i/${t}`,method:"DELETE"}),async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){const{image_name:i,board_id:o}=t,a=Ji.includes(t.image_category),s={board_id:o??"none",categories:sa(t)},l=[];l.push(n(ve.util.updateQueryData("listImages",s,u=>{Gn.removeOne(u,i)}))),l.push(n(Ft.util.updateQueryData(a?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));try{await r}catch{l.forEach(u=>{u.undo()})}}}),deleteImages:e.mutation({query:({imageDTOs:t})=>({url:"images/delete",method:"POST",body:{image_names:t.map(r=>r.image_name)}}),async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,o=gk(t,"image_name");i.deleted_images.forEach(a=>{const s=o[a];if(s){const l={board_id:s.board_id??"none",categories:sa(s)};n(ve.util.updateQueryData("listImages",l,c=>{Gn.removeOne(c,a)}));const u=Ji.includes(s.image_category);n(Ft.util.updateQueryData(u?"getBoardAssetsTotal":"getBoardImagesTotal",s.board_id??"none",c=>{c.total=Math.max(c.total-1,0)}))}})}catch{}}}),changeImageIsIntermediate:e.mutation({query:({imageDTO:t,is_intermediate:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{is_intermediate:n}}),async onQueryStarted({imageDTO:t,is_intermediate:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[];a.push(r(ve.util.updateQueryData("getImageDTO",t.image_name,u=>{Object.assign(u,{is_intermediate:n})})));const s=sa(t),l=Ji.includes(t.image_category);if(n)a.push(r(ve.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:s},u=>{Gn.removeOne(u,t.image_name)}))),a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));else{a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",p=>{p.total+=1})));const u={board_id:t.board_id??"none",categories:s},c=ve.endpoints.listImages.select(u)(o()),{data:d}=oi.includes(t.image_category)?Ft.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):Ft.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=Mc(c.data,t);(f||h)&&a.push(r(ve.util.updateQueryData("listImages",u,p=>{Gn.upsertOne(p,t)})))}try{await i}catch{a.forEach(u=>u.undo())}}}),changeImageSessionId:e.mutation({query:({imageDTO:t,session_id:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{session_id:n}}),async onQueryStarted({imageDTO:t,session_id:n},{dispatch:r,queryFulfilled:i}){const o=[];o.push(r(ve.util.updateQueryData("getImageDTO",t.image_name,a=>{Object.assign(a,{session_id:n})})));try{await i}catch{o.forEach(a=>a.undo())}}}),starImages:e.mutation({query:({imageDTOs:t})=>({url:"images/star",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=sa(r[0]),o=r[0].board_id;return[{type:"ImageList",id:zo({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=sa(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(ve.util.updateQueryData("getImageDTO",c,_=>{_.starred=!0}));const d={board_id:l??"none",categories:s},f=ve.endpoints.listImages.select(d)(i()),{data:h}=oi.includes(u.image_category)?Ft.endpoints.getBoardImagesTotal.select(l??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=hv?Mc(f.data,u):!0;(p||m)&&n(ve.util.updateQueryData("listImages",d,_=>{Gn.upsertOne(_,{...u,starred:!0})}))})}catch{}}}),unstarImages:e.mutation({query:({imageDTOs:t})=>({url:"images/unstar",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=sa(r[0]),o=r[0].board_id;return[{type:"ImageList",id:zo({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=sa(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(ve.util.updateQueryData("getImageDTO",c,_=>{_.starred=!1}));const d={board_id:l??"none",categories:s},f=ve.endpoints.listImages.select(d)(i()),{data:h}=oi.includes(u.image_category)?Ft.endpoints.getBoardImagesTotal.select(l??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=hv?Mc(f.data,u):!0;(p||m)&&n(ve.util.updateQueryData("listImages",d,_=>{Gn.upsertOne(_,{...u,starred:!1})}))})}catch{}}}),uploadImage:e.mutation({query:({file:t,image_category:n,is_intermediate:r,session_id:i,board_id:o,crop_visible:a})=>{const s=new FormData;return s.append("file",t),{url:"images/upload",method:"POST",body:s,params:{image_category:n,is_intermediate:r,session_id:i,board_id:o==="none"?void 0:o,crop_visible:a}}},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;if(i.is_intermediate)return;n(ve.util.upsertQueryData("getImageDTO",i.image_name,i));const o=sa(i);n(ve.util.updateQueryData("listImages",{board_id:i.board_id??"none",categories:o},a=>{Gn.addOne(a,i)})),n(Ft.util.updateQueryData("getBoardAssetsTotal",i.board_id??"none",a=>{a.total+=1}))}catch{}}}),deleteBoard:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"Board",id:Mt},{type:"ImageList",id:zo({board_id:"none",categories:oi})},{type:"ImageList",id:zo({board_id:"none",categories:Ji})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_board_images:o}=i;o.forEach(l=>{n(ve.util.updateQueryData("getImageDTO",l,u=>{u.board_id=void 0}))}),n(Ft.util.updateQueryData("getBoardAssetsTotal",t,l=>{l.total=0})),n(Ft.util.updateQueryData("getBoardImagesTotal",t,l=>{l.total=0}));const a=[{categories:oi},{categories:Ji}],s=o.map(l=>({id:l,changes:{board_id:void 0}}));a.forEach(l=>{n(ve.util.updateQueryData("listImages",l,u=>{Gn.updateMany(u,s)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:()=>[{type:"Board",id:Mt},{type:"ImageList",id:zo({board_id:"none",categories:oi})},{type:"ImageList",id:zo({board_id:"none",categories:Ji})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_images:o}=i;[{categories:oi},{categories:Ji}].forEach(s=>{n(ve.util.updateQueryData("listImages",s,l=>{Gn.removeMany(l,o)}))}),n(Ft.util.updateQueryData("getBoardAssetsTotal",t,s=>{s.total=0})),n(Ft.util.updateQueryData("getBoardImagesTotal",t,s=>{s.total=0}))}catch{}}}),addImageToBoard:e.mutation({query:({board_id:t,imageDTO:n})=>{const{image_name:r}=n;return{url:"board_images/",method:"POST",body:{board_id:t,image_name:r}}},invalidatesTags:(t,n,{board_id:r})=>[{type:"Board",id:r}],async onQueryStarted({board_id:t,imageDTO:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[],s=sa(n),l=Ji.includes(n.image_category);if(a.push(r(ve.util.updateQueryData("getImageDTO",n.image_name,u=>{u.board_id=t}))),!n.is_intermediate){a.push(r(ve.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:s},p=>{Gn.removeOne(p,n.image_name)}))),a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",n.board_id??"none",p=>{p.total=Math.max(p.total-1,0)}))),a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",p=>{p.total+=1})));const u={board_id:t??"none",categories:s},c=ve.endpoints.listImages.select(u)(o()),{data:d}=oi.includes(n.image_category)?Ft.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):Ft.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=Mc(c.data,n);(f||h)&&a.push(r(ve.util.updateQueryData("listImages",u,p=>{Gn.addOne(p,n)})))}try{await i}catch{a.forEach(u=>u.undo())}}}),removeImageFromBoard:e.mutation({query:({imageDTO:t})=>{const{image_name:n}=t;return{url:"board_images/",method:"DELETE",body:{image_name:n}}},invalidatesTags:(t,n,{imageDTO:r})=>{const{board_id:i}=r;return[{type:"Board",id:i??"none"}]},async onQueryStarted({imageDTO:t},{dispatch:n,queryFulfilled:r,getState:i}){const o=sa(t),a=[],s=Ji.includes(t.image_category);a.push(n(ve.util.updateQueryData("getImageDTO",t.image_name,h=>{h.board_id=void 0}))),a.push(n(ve.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},h=>{Gn.removeOne(h,t.image_name)}))),a.push(n(Ft.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",h=>{h.total=Math.max(h.total-1,0)}))),a.push(n(Ft.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal","none",h=>{h.total+=1})));const l={board_id:"none",categories:o},u=ve.endpoints.listImages.select(l)(i()),{data:c}=oi.includes(t.image_category)?Ft.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),d=u.data&&u.data.ids.length>=((c==null?void 0:c.total)??0),f=Mc(u.data,t);(d||f)&&a.push(n(ve.util.updateQueryData("listImages",l,h=>{Gn.upsertOne(h,t)})));try{await r}catch{a.forEach(h=>h.undo())}}}),addImagesToBoard:e.mutation({query:({board_id:t,imageDTOs:n})=>({url:"board_images/batch",method:"POST",body:{image_names:n.map(r=>r.image_name),board_id:t}}),invalidatesTags:(t,n,{board_id:r})=>[{type:"Board",id:r??"none"}],async onQueryStarted({board_id:t,imageDTOs:n},{dispatch:r,queryFulfilled:i,getState:o}){try{const{data:a}=await i,{added_image_names:s}=a;s.forEach(l=>{r(ve.util.updateQueryData("getImageDTO",l,y=>{y.board_id=t==="none"?void 0:t}));const u=n.find(y=>y.image_name===l);if(!u)return;const c=sa(u),d=u.board_id,f=Ji.includes(u.image_category);r(ve.util.updateQueryData("listImages",{board_id:d??"none",categories:c},y=>{Gn.removeOne(y,u.image_name)})),r(Ft.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",d??"none",y=>{y.total=Math.max(y.total-1,0)})),r(Ft.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",y=>{y.total+=1}));const h={board_id:t,categories:c},p=ve.endpoints.listImages.select(h)(o()),{data:m}=oi.includes(u.image_category)?Ft.endpoints.getBoardImagesTotal.select(t??"none")(o()):Ft.endpoints.getBoardAssetsTotal.select(t??"none")(o()),_=p.data&&p.data.ids.length>=((m==null?void 0:m.total)??0),b=((m==null?void 0:m.total)??0)>=hv?Mc(p.data,u):!0;(_||b)&&r(ve.util.updateQueryData("listImages",h,y=>{Gn.upsertOne(y,{...u,board_id:t})}))})}catch{}}}),removeImagesFromBoard:e.mutation({query:({imageDTOs:t})=>({url:"board_images/batch/delete",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{const i=[],o=[];return t==null||t.removed_image_names.forEach(a=>{var l;const s=(l=r.find(u=>u.image_name===a))==null?void 0:l.board_id;!s||i.includes(s)||o.push({type:"Board",id:s})}),o},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{removed_image_names:a}=o;a.forEach(s=>{n(ve.util.updateQueryData("getImageDTO",s,_=>{_.board_id=void 0}));const l=t.find(_=>_.image_name===s);if(!l)return;const u=sa(l),c=Ji.includes(l.image_category);n(ve.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:u},_=>{Gn.removeOne(_,l.image_name)})),n(Ft.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal",l.board_id??"none",_=>{_.total=Math.max(_.total-1,0)})),n(Ft.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal","none",_=>{_.total+=1}));const d={board_id:"none",categories:u},f=ve.endpoints.listImages.select(d)(i()),{data:h}=oi.includes(l.image_category)?Ft.endpoints.getBoardImagesTotal.select(l.board_id??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(l.board_id??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=hv?Mc(f.data,l):!0;(p||m)&&n(ve.util.updateQueryData("listImages",d,_=>{Gn.upsertOne(_,{...l,board_id:"none"})}))})}catch{}}})})}),{useGetIntermediatesCountQuery:zGe,useListImagesQuery:jGe,useLazyListImagesQuery:UGe,useGetImageDTOQuery:VGe,useGetImageMetadataQuery:GGe,useDeleteImageMutation:qGe,useDeleteImagesMutation:HGe,useUploadImageMutation:WGe,useClearIntermediatesMutation:KGe,useAddImagesToBoardMutation:QGe,useRemoveImagesFromBoardMutation:XGe,useAddImageToBoardMutation:YGe,useRemoveImageFromBoardMutation:ZGe,useChangeImageIsIntermediateMutation:JGe,useChangeImageSessionIdMutation:eqe,useDeleteBoardAndImagesMutation:tqe,useDeleteBoardMutation:nqe,useStarImagesMutation:rqe,useUnstarImagesMutation:iqe,useGetImageMetadataFromFileQuery:oqe}=ve,jj=Ne("socket/socketConnected"),Vk=Ne("socket/appSocketConnected"),Uj=Ne("socket/socketDisconnected"),Vj=Ne("socket/appSocketDisconnected"),f0e=Ne("socket/socketSubscribedSession"),h0e=Ne("socket/appSocketSubscribedSession"),p0e=Ne("socket/socketUnsubscribedSession"),g0e=Ne("socket/appSocketUnsubscribedSession"),Gj=Ne("socket/socketInvocationStarted"),Gk=Ne("socket/appSocketInvocationStarted"),qk=Ne("socket/socketInvocationComplete"),Hk=Ne("socket/appSocketInvocationComplete"),qj=Ne("socket/socketInvocationError"),G2=Ne("socket/appSocketInvocationError"),Hj=Ne("socket/socketGraphExecutionStateComplete"),Wj=Ne("socket/appSocketGraphExecutionStateComplete"),Kj=Ne("socket/socketGeneratorProgress"),Wk=Ne("socket/appSocketGeneratorProgress"),Qj=Ne("socket/socketModelLoadStarted"),Xj=Ne("socket/appSocketModelLoadStarted"),Yj=Ne("socket/socketModelLoadCompleted"),Zj=Ne("socket/appSocketModelLoadCompleted"),Jj=Ne("socket/socketSessionRetrievalError"),eU=Ne("socket/appSocketSessionRetrievalError"),tU=Ne("socket/socketInvocationRetrievalError"),nU=Ne("socket/appSocketInvocationRetrievalError"),rU=Ne("socket/socketQueueItemStatusChanged"),Kk=Ne("socket/appSocketQueueItemStatusChanged"),Qk=Ne("controlNet/imageProcessed"),Ef={none:{type:"none",get label(){return be.t("controlnet.none")},get description(){return be.t("controlnet.noneDescription")},default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",get label(){return be.t("controlnet.canny")},get description(){return be.t("controlnet.cannyDescription")},default:{id:"canny_image_processor",type:"canny_image_processor",low_threshold:100,high_threshold:200}},color_map_image_processor:{type:"color_map_image_processor",get label(){return be.t("controlnet.colorMap")},get description(){return be.t("controlnet.colorMapDescription")},default:{id:"color_map_image_processor",type:"color_map_image_processor",color_map_tile_size:64}},content_shuffle_image_processor:{type:"content_shuffle_image_processor",get label(){return be.t("controlnet.contentShuffle")},get description(){return be.t("controlnet.contentShuffleDescription")},default:{id:"content_shuffle_image_processor",type:"content_shuffle_image_processor",detect_resolution:512,image_resolution:512,h:512,w:512,f:256}},hed_image_processor:{type:"hed_image_processor",get label(){return be.t("controlnet.hed")},get description(){return be.t("controlnet.hedDescription")},default:{id:"hed_image_processor",type:"hed_image_processor",detect_resolution:512,image_resolution:512,scribble:!1}},lineart_anime_image_processor:{type:"lineart_anime_image_processor",get label(){return be.t("controlnet.lineartAnime")},get description(){return be.t("controlnet.lineartAnimeDescription")},default:{id:"lineart_anime_image_processor",type:"lineart_anime_image_processor",detect_resolution:512,image_resolution:512}},lineart_image_processor:{type:"lineart_image_processor",get label(){return be.t("controlnet.lineart")},get description(){return be.t("controlnet.lineartDescription")},default:{id:"lineart_image_processor",type:"lineart_image_processor",detect_resolution:512,image_resolution:512,coarse:!1}},mediapipe_face_processor:{type:"mediapipe_face_processor",get label(){return be.t("controlnet.mediapipeFace")},get description(){return be.t("controlnet.mediapipeFaceDescription")},default:{id:"mediapipe_face_processor",type:"mediapipe_face_processor",max_faces:1,min_confidence:.5}},midas_depth_image_processor:{type:"midas_depth_image_processor",get label(){return be.t("controlnet.depthMidas")},get description(){return be.t("controlnet.depthMidasDescription")},default:{id:"midas_depth_image_processor",type:"midas_depth_image_processor",a_mult:2,bg_th:.1}},mlsd_image_processor:{type:"mlsd_image_processor",get label(){return be.t("controlnet.mlsd")},get description(){return be.t("controlnet.mlsdDescription")},default:{id:"mlsd_image_processor",type:"mlsd_image_processor",detect_resolution:512,image_resolution:512,thr_d:.1,thr_v:.1}},normalbae_image_processor:{type:"normalbae_image_processor",get label(){return be.t("controlnet.normalBae")},get description(){return be.t("controlnet.normalBaeDescription")},default:{id:"normalbae_image_processor",type:"normalbae_image_processor",detect_resolution:512,image_resolution:512}},openpose_image_processor:{type:"openpose_image_processor",get label(){return be.t("controlnet.openPose")},get description(){return be.t("controlnet.openPoseDescription")},default:{id:"openpose_image_processor",type:"openpose_image_processor",detect_resolution:512,image_resolution:512,hand_and_face:!1}},pidi_image_processor:{type:"pidi_image_processor",get label(){return be.t("controlnet.pidi")},get description(){return be.t("controlnet.pidiDescription")},default:{id:"pidi_image_processor",type:"pidi_image_processor",detect_resolution:512,image_resolution:512,scribble:!1,safe:!1}},zoe_depth_image_processor:{type:"zoe_depth_image_processor",get label(){return be.t("controlnet.depthZoe")},get description(){return be.t("controlnet.depthZoeDescription")},default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},kv={canny:"canny_image_processor",mlsd:"mlsd_image_processor",depth:"midas_depth_image_processor",bae:"normalbae_image_processor",lineart:"lineart_image_processor",lineart_anime:"lineart_anime_image_processor",softedge:"hed_image_processor",shuffle:"content_shuffle_image_processor",openpose:"openpose_image_processor",mediapipe:"mediapipe_face_processor",pidi:"pidi_image_processor",zoe:"zoe_depth_image_processor",color:"color_map_image_processor"},UR={isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,controlMode:"balanced",resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Ef.canny_image_processor.default,shouldAutoConfig:!0},iU={adapterImage:null,model:null,weight:1,beginStepPct:0,endStepPct:1},wE={controlNets:{},isEnabled:!1,pendingControlImages:[],isIPAdapterEnabled:!1,ipAdapterInfo:{...iU}},oU=rr({name:"controlNet",initialState:wE,reducers:{isControlNetEnabledToggled:e=>{e.isEnabled=!e.isEnabled},controlNetEnabled:e=>{e.isEnabled=!0},controlNetAdded:(e,t)=>{const{controlNetId:n,controlNet:r}=t.payload;e.controlNets[n]={...r??UR,controlNetId:n}},controlNetRecalled:(e,t)=>{const n=t.payload;e.controlNets[n.controlNetId]={...n}},controlNetDuplicated:(e,t)=>{const{sourceControlNetId:n,newControlNetId:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=Cn(i);o.controlNetId=r,e.controlNets[r]=o},controlNetAddedFromImage:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload;e.controlNets[n]={...UR,controlNetId:n,controlImage:r}},controlNetRemoved:(e,t)=>{const{controlNetId:n}=t.payload;delete e.controlNets[n]},controlNetIsEnabledChanged:(e,t)=>{const{controlNetId:n,isEnabled:r}=t.payload,i=e.controlNets[n];i&&(i.isEnabled=r)},controlNetImageChanged:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload,i=e.controlNets[n];i&&(i.controlImage=r,i.processedControlImage=null,r!==null&&i.processorType!=="none"&&e.pendingControlImages.push(n))},controlNetProcessedImageChanged:(e,t)=>{const{controlNetId:n,processedControlImage:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=r,e.pendingControlImages=e.pendingControlImages.filter(o=>o!==n))},controlNetModelChanged:(e,t)=>{const{controlNetId:n,model:r}=t.payload,i=e.controlNets[n];if(i&&(i.model=r,i.processedControlImage=null,i.shouldAutoConfig)){let o;for(const a in kv)if(r.model_name.includes(a)){o=kv[a];break}o?(i.processorType=o,i.processorNode=Ef[o].default):(i.processorType="none",i.processorNode=Ef.none.default)}},controlNetWeightChanged:(e,t)=>{const{controlNetId:n,weight:r}=t.payload,i=e.controlNets[n];i&&(i.weight=r)},controlNetBeginStepPctChanged:(e,t)=>{const{controlNetId:n,beginStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.beginStepPct=r)},controlNetEndStepPctChanged:(e,t)=>{const{controlNetId:n,endStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.endStepPct=r)},controlNetControlModeChanged:(e,t)=>{const{controlNetId:n,controlMode:r}=t.payload,i=e.controlNets[n];i&&(i.controlMode=r)},controlNetResizeModeChanged:(e,t)=>{const{controlNetId:n,resizeMode:r}=t.payload,i=e.controlNets[n];i&&(i.resizeMode=r)},controlNetProcessorParamsChanged:(e,t)=>{const{controlNetId:n,changes:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=i.processorNode;i.processorNode={...o,...r},i.shouldAutoConfig=!1},controlNetProcessorTypeChanged:(e,t)=>{const{controlNetId:n,processorType:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=null,i.processorType=r,i.processorNode=Ef[r].default,i.shouldAutoConfig=!1)},controlNetAutoConfigToggled:(e,t)=>{var o;const{controlNetId:n}=t.payload,r=e.controlNets[n];if(!r)return;const i=!r.shouldAutoConfig;if(i){let a;for(const s in kv)if((o=r.model)!=null&&o.model_name.includes(s)){a=kv[s];break}a?(r.processorType=a,r.processorNode=Ef[a].default):(r.processorType="none",r.processorNode=Ef.none.default)}r.shouldAutoConfig=i},controlNetReset:()=>({...wE}),isIPAdapterEnabledChanged:(e,t)=>{e.isIPAdapterEnabled=t.payload},ipAdapterRecalled:(e,t)=>{e.ipAdapterInfo=t.payload},ipAdapterImageChanged:(e,t)=>{e.ipAdapterInfo.adapterImage=t.payload},ipAdapterWeightChanged:(e,t)=>{e.ipAdapterInfo.weight=t.payload},ipAdapterModelChanged:(e,t)=>{e.ipAdapterInfo.model=t.payload},ipAdapterBeginStepPctChanged:(e,t)=>{e.ipAdapterInfo.beginStepPct=t.payload},ipAdapterEndStepPctChanged:(e,t)=>{e.ipAdapterInfo.endStepPct=t.payload},ipAdapterStateReset:e=>{e.isIPAdapterEnabled=!1,e.ipAdapterInfo={...iU}},clearPendingControlImages:e=>{e.pendingControlImages=[]}},extraReducers:e=>{e.addCase(Qk,(t,n)=>{const r=t.controlNets[n.payload.controlNetId];r&&r.controlImage!==null&&t.pendingControlImages.push(n.payload.controlNetId)}),e.addCase(G2,t=>{t.pendingControlImages=[]}),e.addMatcher(ve.endpoints.deleteImage.matchFulfilled,(t,n)=>{const{image_name:r}=n.meta.arg.originalArgs;Ea(t.controlNets,i=>{i.controlImage===r&&(i.controlImage=null,i.processedControlImage=null),i.processedControlImage===r&&(i.processedControlImage=null)})})}}),{isControlNetEnabledToggled:aqe,controlNetEnabled:sqe,controlNetAdded:lqe,controlNetRecalled:uqe,controlNetDuplicated:cqe,controlNetAddedFromImage:dqe,controlNetRemoved:aU,controlNetImageChanged:Cc,controlNetProcessedImageChanged:Xk,controlNetIsEnabledChanged:sU,controlNetModelChanged:VR,controlNetWeightChanged:fqe,controlNetBeginStepPctChanged:hqe,controlNetEndStepPctChanged:pqe,controlNetControlModeChanged:gqe,controlNetResizeModeChanged:mqe,controlNetProcessorParamsChanged:m0e,controlNetProcessorTypeChanged:y0e,controlNetReset:v0e,controlNetAutoConfigToggled:GR,isIPAdapterEnabledChanged:lU,ipAdapterRecalled:yqe,ipAdapterImageChanged:q2,ipAdapterWeightChanged:vqe,ipAdapterModelChanged:qR,ipAdapterBeginStepPctChanged:bqe,ipAdapterEndStepPctChanged:_qe,ipAdapterStateReset:uU,clearPendingControlImages:b0e}=oU.actions,_0e=oU.reducer,S0e={imagesToDelete:[],isModalOpen:!1},cU=rr({name:"deleteImageModal",initialState:S0e,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:Yk,imagesToDeleteSelected:x0e,imageDeletionCanceled:Sqe}=cU.actions,w0e=cU.reducer,Zk={maxPrompts:100,combinatorial:!0,prompts:[],parsingError:void 0,isError:!1,isLoading:!1,seedBehaviour:"PER_ITERATION"},C0e=Zk,dU=rr({name:"dynamicPrompts",initialState:C0e,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=Zk.maxPrompts},combinatorialToggled:e=>{e.combinatorial=!e.combinatorial},promptsChanged:(e,t)=>{e.prompts=t.payload},parsingErrorChanged:(e,t)=>{e.parsingError=t.payload},isErrorChanged:(e,t)=>{e.isError=t.payload},isLoadingChanged:(e,t)=>{e.isLoading=t.payload},seedBehaviourChanged:(e,t)=>{e.seedBehaviour=t.payload}}}),{maxPromptsChanged:E0e,maxPromptsReset:T0e,combinatorialToggled:k0e,promptsChanged:A0e,parsingErrorChanged:P0e,isErrorChanged:HR,isLoadingChanged:MC,seedBehaviourChanged:xqe}=dU.actions,I0e=dU.reducer,fU={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",boardSearchText:""},hU=rr({name:"gallery",initialState:fU,reducers:{imageSelected:(e,t)=>{e.selection=t.payload?[t.payload]:[]},selectionChanged:(e,t)=>{e.selection=tE(t.payload,n=>n.image_name)},shouldAutoSwitchChanged:(e,t)=>{e.shouldAutoSwitch=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},autoAssignBoardOnClickChanged:(e,t)=>{e.autoAssignBoardOnClick=t.payload},boardIdSelected:(e,t)=>{e.selectedBoardId=t.payload.boardId,e.galleryView="images"},autoAddBoardIdChanged:(e,t)=>{if(!t.payload){e.autoAddBoardId="none";return}e.autoAddBoardId=t.payload},galleryViewChanged:(e,t)=>{e.galleryView=t.payload},boardSearchTextChanged:(e,t)=>{e.boardSearchText=t.payload}},extraReducers:e=>{e.addMatcher(O0e,(t,n)=>{const r=n.meta.arg.originalArgs;r===t.selectedBoardId&&(t.selectedBoardId="none",t.galleryView="images"),r===t.autoAddBoardId&&(t.autoAddBoardId="none")}),e.addMatcher(Ft.endpoints.listAllBoards.matchFulfilled,(t,n)=>{const r=n.payload;t.autoAddBoardId&&(r.map(i=>i.board_id).includes(t.autoAddBoardId)||(t.autoAddBoardId="none"))})}}),{imageSelected:Gs,shouldAutoSwitchChanged:wqe,autoAssignBoardOnClickChanged:Cqe,setGalleryImageMinimumWidth:Eqe,boardIdSelected:E_,autoAddBoardIdChanged:Tqe,galleryViewChanged:CE,selectionChanged:pU,boardSearchTextChanged:kqe}=hU.actions,R0e=hU.reducer,O0e=$o(ve.endpoints.deleteBoard.matchFulfilled,ve.endpoints.deleteBoardAndImages.matchFulfilled),WR={weight:.75},M0e={loras:{}},gU=rr({name:"lora",initialState:M0e,reducers:{loraAdded:(e,t)=>{const{model_name:n,id:r,base_model:i}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,...WR}},loraRecalled:(e,t)=>{const{model_name:n,id:r,base_model:i,weight:o}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,weight:o}},loraRemoved:(e,t)=>{const n=t.payload;delete e.loras[n]},lorasCleared:e=>{e.loras={}},loraWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload,i=e.loras[n];i&&(i.weight=r)},loraWeightReset:(e,t)=>{const n=t.payload,r=e.loras[n];r&&(r.weight=WR.weight)}}}),{loraAdded:Aqe,loraRemoved:mU,loraWeightChanged:Pqe,loraWeightReset:Iqe,lorasCleared:Rqe,loraRecalled:Oqe}=gU.actions,N0e=gU.reducer;function Aa(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Aa(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const KR=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,s),s},$0e=e=>e?KR(e):KR,{useSyncExternalStoreWithSelector:D0e}=ome;function yU(e,t=e.getState,n){const r=D0e(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return I.useDebugValue(r),r}const QR=(e,t)=>{const n=$0e(e),r=(i,o=t)=>yU(n,i,o);return Object.assign(r,n),r},L0e=(e,t)=>e?QR(e,t):QR;function Oo(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var F0e={value:()=>{}};function H2(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new B1(n)}function B1(e){this._=e}function B0e(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}B1.prototype=H2.prototype={constructor:B1,on:function(e,t){var n=this._,r=B0e(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=z0e(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=XR(n[i],e.name,t);else if(t==null)for(i in n)n[i]=XR(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new B1(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function z0e(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function XR(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=F0e,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var EE="http://www.w3.org/1999/xhtml";const YR={svg:"http://www.w3.org/2000/svg",xhtml:EE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function W2(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),YR.hasOwnProperty(t)?{space:YR[t],local:e}:e}function j0e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===EE&&t.documentElement.namespaceURI===EE?t.createElement(e):t.createElementNS(n,e)}}function U0e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vU(e){var t=W2(e);return(t.local?U0e:j0e)(t)}function V0e(){}function Jk(e){return e==null?V0e:function(){return this.querySelector(e)}}function G0e(e){typeof e!="function"&&(e=Jk(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Jo(r,this._parents)}function q0e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function H0e(){return[]}function bU(e){return e==null?H0e:function(){return this.querySelectorAll(e)}}function W0e(e){return function(){return q0e(e.apply(this,arguments))}}function K0e(e){typeof e=="function"?e=W0e(e):e=bU(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new Jo(r,i)}function _U(e){return function(){return this.matches(e)}}function SU(e){return function(t){return t.matches(e)}}var Q0e=Array.prototype.find;function X0e(e){return function(){return Q0e.call(this.children,e)}}function Y0e(){return this.firstElementChild}function Z0e(e){return this.select(e==null?Y0e:X0e(typeof e=="function"?e:SU(e)))}var J0e=Array.prototype.filter;function eye(){return Array.from(this.children)}function tye(e){return function(){return J0e.call(this.children,e)}}function nye(e){return this.selectAll(e==null?eye:tye(typeof e=="function"?e:SU(e)))}function rye(e){typeof e!="function"&&(e=_U(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Jo(r,this._parents)}function xU(e){return new Array(e.length)}function iye(){return new Jo(this._enter||this._groups.map(xU),this._parents)}function T_(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}T_.prototype={constructor:T_,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function oye(e){return function(){return e}}function aye(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new T_(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function sye(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,d=o.length,f=new Array(c),h;for(s=0;s<c;++s)(l=t[s])&&(f[s]=h=a.call(l,l.__data__,s,t)+"",u.has(h)?i[s]=l:u.set(h,l));for(s=0;s<d;++s)h=a.call(e,o[s],s,o)+"",(l=u.get(h))?(r[s]=l,l.__data__=o[s],u.delete(h)):n[s]=new T_(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function lye(e){return e.__data__}function uye(e,t){if(!arguments.length)return Array.from(this,lye);var n=t?sye:aye,r=this._parents,i=this._groups;typeof e!="function"&&(e=oye(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],d=i[u],f=d.length,h=cye(e.call(c,c&&c.__data__,u,r)),p=h.length,m=s[u]=new Array(p),_=a[u]=new Array(p),b=l[u]=new Array(f);n(c,d,m,_,b,h,t);for(var y=0,g=0,v,S;y<p;++y)if(v=m[y]){for(y>=g&&(g=y+1);!(S=_[g])&&++g<p;);v._next=S||null}}return a=new Jo(a,r),a._enter=s,a._exit=l,a}function cye(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dye(){return new Jo(this._exit||this._groups.map(xU),this._parents)}function fye(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function hye(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],d=u.length,f=s[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<i;++l)s[l]=n[l];return new Jo(s,this._parents)}function pye(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function gye(e){e||(e=mye);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Jo(i,this._parents).order()}function mye(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yye(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function vye(){return Array.from(this)}function bye(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function _ye(){let e=0;for(const t of this)++e;return e}function Sye(){return!this.node()}function xye(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function wye(e){return function(){this.removeAttribute(e)}}function Cye(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Eye(e,t){return function(){this.setAttribute(e,t)}}function Tye(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kye(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Aye(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Pye(e,t){var n=W2(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Cye:wye:typeof t=="function"?n.local?Aye:kye:n.local?Tye:Eye)(n,t))}function wU(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Iye(e){return function(){this.style.removeProperty(e)}}function Rye(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Oye(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Mye(e,t,n){return arguments.length>1?this.each((t==null?Iye:typeof t=="function"?Oye:Rye)(e,t,n??"")):ep(this.node(),e)}function ep(e,t){return e.style.getPropertyValue(t)||wU(e).getComputedStyle(e,null).getPropertyValue(t)}function Nye(e){return function(){delete this[e]}}function $ye(e,t){return function(){this[e]=t}}function Dye(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Lye(e,t){return arguments.length>1?this.each((t==null?Nye:typeof t=="function"?Dye:$ye)(e,t)):this.node()[e]}function CU(e){return e.trim().split(/^|\s+/)}function eA(e){return e.classList||new EU(e)}function EU(e){this._node=e,this._names=CU(e.getAttribute("class")||"")}EU.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function TU(e,t){for(var n=eA(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function kU(e,t){for(var n=eA(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Fye(e){return function(){TU(this,e)}}function Bye(e){return function(){kU(this,e)}}function zye(e,t){return function(){(t.apply(this,arguments)?TU:kU)(this,e)}}function jye(e,t){var n=CU(e+"");if(arguments.length<2){for(var r=eA(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?zye:t?Fye:Bye)(n,t))}function Uye(){this.textContent=""}function Vye(e){return function(){this.textContent=e}}function Gye(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function qye(e){return arguments.length?this.each(e==null?Uye:(typeof e=="function"?Gye:Vye)(e)):this.node().textContent}function Hye(){this.innerHTML=""}function Wye(e){return function(){this.innerHTML=e}}function Kye(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qye(e){return arguments.length?this.each(e==null?Hye:(typeof e=="function"?Kye:Wye)(e)):this.node().innerHTML}function Xye(){this.nextSibling&&this.parentNode.appendChild(this)}function Yye(){return this.each(Xye)}function Zye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Jye(){return this.each(Zye)}function eve(e){var t=typeof e=="function"?e:vU(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function tve(){return null}function nve(e,t){var n=typeof e=="function"?e:vU(e),r=t==null?tve:typeof t=="function"?t:Jk(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function rve(){var e=this.parentNode;e&&e.removeChild(this)}function ive(){return this.each(rve)}function ove(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ave(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function sve(e){return this.select(e?ave:ove)}function lve(e){return arguments.length?this.property("__data__",e):this.node().__data__}function uve(e){return function(t){e.call(this,t,this.__data__)}}function cve(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function dve(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function fve(e,t,n){return function(){var r=this.__on,i,o=uve(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function hve(e,t,n){var r=cve(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?fve:dve,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function AU(e,t,n){var r=wU(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function pve(e,t){return function(){return AU(this,e,t)}}function gve(e,t){return function(){return AU(this,e,t.apply(this,arguments))}}function mve(e,t){return this.each((typeof t=="function"?gve:pve)(e,t))}function*yve(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var PU=[null];function Jo(e,t){this._groups=e,this._parents=t}function Sy(){return new Jo([[document.documentElement]],PU)}function vve(){return this}Jo.prototype=Sy.prototype={constructor:Jo,select:G0e,selectAll:K0e,selectChild:Z0e,selectChildren:nye,filter:rye,data:uye,enter:iye,exit:dye,join:fye,merge:hye,selection:vve,order:pye,sort:gye,call:yye,nodes:vye,node:bye,size:_ye,empty:Sye,each:xye,attr:Pye,style:Mye,property:Lye,classed:jye,text:qye,html:Qye,raise:Yye,lower:Jye,append:eve,insert:nve,remove:ive,clone:sve,datum:lve,on:hve,dispatch:mve,[Symbol.iterator]:yve};function Ka(e){return typeof e=="string"?new Jo([[document.querySelector(e)]],[document.documentElement]):new Jo([[e]],PU)}function bve(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Cs(e,t){if(e=bve(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const _ve={passive:!1},c0={capture:!0,passive:!1};function NC(e){e.stopImmediatePropagation()}function gh(e){e.preventDefault(),e.stopImmediatePropagation()}function IU(e){var t=e.document.documentElement,n=Ka(e).on("dragstart.drag",gh,c0);"onselectstart"in t?n.on("selectstart.drag",gh,c0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function RU(e,t){var n=e.document.documentElement,r=Ka(e).on("dragstart.drag",null);t&&(r.on("click.drag",gh,c0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Av=e=>()=>e;function TE(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}TE.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Sve(e){return!e.ctrlKey&&!e.button}function xve(){return this.parentNode}function wve(e,t){return t??{x:e.x,y:e.y}}function Cve(){return navigator.maxTouchPoints||"ontouchstart"in this}function Eve(){var e=Sve,t=xve,n=wve,r=Cve,i={},o=H2("start","drag","end"),a=0,s,l,u,c,d=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",_).on("touchmove.drag",b,_ve).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,S){if(!(c||!e.call(this,v,S))){var w=g(this,t.call(this,v,S),v,S,"mouse");w&&(Ka(v.view).on("mousemove.drag",p,c0).on("mouseup.drag",m,c0),IU(v.view),NC(v),u=!1,s=v.clientX,l=v.clientY,w("start",v))}}function p(v){if(gh(v),!u){var S=v.clientX-s,w=v.clientY-l;u=S*S+w*w>d}i.mouse("drag",v)}function m(v){Ka(v.view).on("mousemove.drag mouseup.drag",null),RU(v.view,u),gh(v),i.mouse("end",v)}function _(v,S){if(e.call(this,v,S)){var w=v.changedTouches,x=t.call(this,v,S),C=w.length,k,T;for(k=0;k<C;++k)(T=g(this,x,v,S,w[k].identifier,w[k]))&&(NC(v),T("start",v,w[k]))}}function b(v){var S=v.changedTouches,w=S.length,x,C;for(x=0;x<w;++x)(C=i[S[x].identifier])&&(gh(v),C("drag",v,S[x]))}function y(v){var S=v.changedTouches,w=S.length,x,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),x=0;x<w;++x)(C=i[S[x].identifier])&&(NC(v),C("end",v,S[x]))}function g(v,S,w,x,C,k){var T=o.copy(),P=Cs(k||w,S),$,O,E;if((E=n.call(v,new TE("beforestart",{sourceEvent:w,target:f,identifier:C,active:a,x:P[0],y:P[1],dx:0,dy:0,dispatch:T}),x))!=null)return $=E.x-P[0]||0,O=E.y-P[1]||0,function A(D,L,M){var R=P,N;switch(D){case"start":i[C]=A,N=a++;break;case"end":delete i[C],--a;case"drag":P=Cs(M||L,S),N=a;break}T.call(D,v,new TE(D,{sourceEvent:L,subject:E,target:f,identifier:C,active:N,x:P[0]+$,y:P[1]+O,dx:P[0]-R[0],dy:P[1]-R[1],dispatch:T}),x)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Av(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:Av(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:Av(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Av(!!v),f):r},f.on=function(){var v=o.on.apply(o,arguments);return v===o?f:v},f.clickDistance=function(v){return arguments.length?(d=(v=+v)*v,f):Math.sqrt(d)},f}function tA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function OU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xy(){}var d0=.7,k_=1/d0,mh="\\s*([+-]?\\d+)\\s*",f0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tve=/^#([0-9a-f]{3,8})$/,kve=new RegExp(`^rgb\\(${mh},${mh},${mh}\\)$`),Ave=new RegExp(`^rgb\\(${qs},${qs},${qs}\\)$`),Pve=new RegExp(`^rgba\\(${mh},${mh},${mh},${f0}\\)$`),Ive=new RegExp(`^rgba\\(${qs},${qs},${qs},${f0}\\)$`),Rve=new RegExp(`^hsl\\(${f0},${qs},${qs}\\)$`),Ove=new RegExp(`^hsla\\(${f0},${qs},${qs},${f0}\\)$`),ZR={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};tA(xy,h0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:JR,formatHex:JR,formatHex8:Mve,formatHsl:Nve,formatRgb:e9,toString:e9});function JR(){return this.rgb().formatHex()}function Mve(){return this.rgb().formatHex8()}function Nve(){return MU(this).formatHsl()}function e9(){return this.rgb().formatRgb()}function h0(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?t9(t):n===3?new Eo(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kve.exec(e))?new Eo(t[1],t[2],t[3],1):(t=Ave.exec(e))?new Eo(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Pve.exec(e))?Pv(t[1],t[2],t[3],t[4]):(t=Ive.exec(e))?Pv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Rve.exec(e))?i9(t[1],t[2]/100,t[3]/100,1):(t=Ove.exec(e))?i9(t[1],t[2]/100,t[3]/100,t[4]):ZR.hasOwnProperty(e)?t9(ZR[e]):e==="transparent"?new Eo(NaN,NaN,NaN,0):null}function t9(e){return new Eo(e>>16&255,e>>8&255,e&255,1)}function Pv(e,t,n,r){return r<=0&&(e=t=n=NaN),new Eo(e,t,n,r)}function $ve(e){return e instanceof xy||(e=h0(e)),e?(e=e.rgb(),new Eo(e.r,e.g,e.b,e.opacity)):new Eo}function kE(e,t,n,r){return arguments.length===1?$ve(e):new Eo(e,t,n,r??1)}function Eo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}tA(Eo,kE,OU(xy,{brighter(e){return e=e==null?k_:Math.pow(k_,e),new Eo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?d0:Math.pow(d0,e),new Eo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Eo(yd(this.r),yd(this.g),yd(this.b),A_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:n9,formatHex:n9,formatHex8:Dve,formatRgb:r9,toString:r9}));function n9(){return`#${ad(this.r)}${ad(this.g)}${ad(this.b)}`}function Dve(){return`#${ad(this.r)}${ad(this.g)}${ad(this.b)}${ad((isNaN(this.opacity)?1:this.opacity)*255)}`}function r9(){const e=A_(this.opacity);return`${e===1?"rgb(":"rgba("}${yd(this.r)}, ${yd(this.g)}, ${yd(this.b)}${e===1?")":`, ${e})`}`}function A_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ad(e){return e=yd(e),(e<16?"0":"")+e.toString(16)}function i9(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qa(e,t,n,r)}function MU(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof xy||(e=h0(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Qa(a,s,l,e.opacity)}function Lve(e,t,n,r){return arguments.length===1?MU(e):new Qa(e,t,n,r??1)}function Qa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tA(Qa,Lve,OU(xy,{brighter(e){return e=e==null?k_:Math.pow(k_,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?d0:Math.pow(d0,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Eo($C(e>=240?e-240:e+120,i,r),$C(e,i,r),$C(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qa(o9(this.h),Iv(this.s),Iv(this.l),A_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=A_(this.opacity);return`${e===1?"hsl(":"hsla("}${o9(this.h)}, ${Iv(this.s)*100}%, ${Iv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function o9(e){return e=(e||0)%360,e<0?e+360:e}function Iv(e){return Math.max(0,Math.min(1,e||0))}function $C(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const NU=e=>()=>e;function Fve(e,t){return function(n){return e+n*t}}function Bve(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function zve(e){return(e=+e)==1?$U:function(t,n){return n-t?Bve(t,n,e):NU(isNaN(t)?n:t)}}function $U(e,t){var n=t-e;return n?Fve(e,n):NU(isNaN(e)?t:e)}const a9=function e(t){var n=zve(t);function r(i,o){var a=n((i=kE(i)).r,(o=kE(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=$U(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function _u(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var AE=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,DC=new RegExp(AE.source,"g");function jve(e){return function(){return e}}function Uve(e){return function(t){return e(t)+""}}function Vve(e,t){var n=AE.lastIndex=DC.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=AE.exec(e))&&(i=DC.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:_u(r,i)})),n=DC.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?Uve(l[0].x):jve(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}var s9=180/Math.PI,PE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function DU(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*s9,skewX:Math.atan(l)*s9,scaleX:a,scaleY:s}}var Rv;function Gve(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?PE:DU(t.a,t.b,t.c,t.d,t.e,t.f)}function qve(e){return e==null||(Rv||(Rv=document.createElementNS("http://www.w3.org/2000/svg","g")),Rv.setAttribute("transform",e),!(e=Rv.transform.baseVal.consolidate()))?PE:(e=e.matrix,DU(e.a,e.b,e.c,e.d,e.e,e.f))}function LU(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:_u(u,d)},{i:m-2,x:_u(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function a(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:_u(u,c)})):c&&d.push(i(d)+"rotate("+c+r)}function s(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:_u(u,c)}):c&&d.push(i(d)+"skewX("+c+r)}function l(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:_u(u,d)},{i:m-2,x:_u(c,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,d,f),a(u.rotate,c.rotate,d,f),s(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var p=-1,m=f.length,_;++p<m;)d[(_=f[p]).i]=_.x(h);return d.join("")}}}var Hve=LU(Gve,"px, ","px)","deg)"),Wve=LU(qve,", ",")",")"),Kve=1e-12;function l9(e){return((e=Math.exp(e))+1/e)/2}function Qve(e){return((e=Math.exp(e))-1/e)/2}function Xve(e){return((e=Math.exp(2*e))-1)/(e+1)}const Yve=function e(t,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],d=a[1],f=a[2],h=c-s,p=d-l,m=h*h+p*p,_,b;if(m<Kve)b=Math.log(f/u)/t,_=function(x){return[s+x*h,l+x*p,u*Math.exp(t*x*b)]};else{var y=Math.sqrt(m),g=(f*f-u*u+r*m)/(2*u*n*y),v=(f*f-u*u-r*m)/(2*f*n*y),S=Math.log(Math.sqrt(g*g+1)-g),w=Math.log(Math.sqrt(v*v+1)-v);b=(w-S)/t,_=function(x){var C=x*b,k=l9(S),T=u/(n*y)*(k*Xve(t*C+S)-Qve(S));return[s+T*h,l+T*p,u*k/l9(t*C+S)]}}return _.duration=b*1e3*t/Math.SQRT2,_}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var tp=0,Sg=0,Qp=0,FU=1e3,P_,xg,I_=0,$d=0,K2=0,p0=typeof performance=="object"&&performance.now?performance:Date,BU=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function nA(){return $d||(BU(Zve),$d=p0.now()+K2)}function Zve(){$d=0}function R_(){this._call=this._time=this._next=null}R_.prototype=zU.prototype={constructor:R_,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?nA():+n)+(t==null?0:+t),!this._next&&xg!==this&&(xg?xg._next=this:P_=this,xg=this),this._call=e,this._time=n,IE()},stop:function(){this._call&&(this._call=null,this._time=1/0,IE())}};function zU(e,t,n){var r=new R_;return r.restart(e,t,n),r}function Jve(){nA(),++tp;for(var e=P_,t;e;)(t=$d-e._time)>=0&&e._call.call(void 0,t),e=e._next;--tp}function u9(){$d=(I_=p0.now())+K2,tp=Sg=0;try{Jve()}finally{tp=0,t1e(),$d=0}}function e1e(){var e=p0.now(),t=e-I_;t>FU&&(K2-=t,I_=e)}function t1e(){for(var e,t=P_,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:P_=n);xg=e,IE(r)}function IE(e){if(!tp){Sg&&(Sg=clearTimeout(Sg));var t=e-$d;t>24?(e<1/0&&(Sg=setTimeout(u9,e-p0.now()-K2)),Qp&&(Qp=clearInterval(Qp))):(Qp||(I_=p0.now(),Qp=setInterval(e1e,FU)),tp=1,BU(u9))}}function c9(e,t,n){var r=new R_;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var n1e=H2("start","end","cancel","interrupt"),r1e=[],jU=0,d9=1,RE=2,z1=3,f9=4,OE=5,j1=6;function Q2(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;i1e(e,n,{name:t,index:r,group:i,on:n1e,tween:r1e,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:jU})}function rA(e,t){var n=hs(e,t);if(n.state>jU)throw new Error("too late; already scheduled");return n}function rl(e,t){var n=hs(e,t);if(n.state>z1)throw new Error("too late; already running");return n}function hs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function i1e(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zU(o,0,n.time);function o(u){n.state=d9,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,f,h;if(n.state!==d9)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===z1)return c9(a);h.state===f9?(h.state=j1,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=j1,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(c9(function(){n.state===z1&&(n.state=f9,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=RE,n.on.call("start",e,e.__data__,n.index,n.group),n.state===RE){for(n.state=z1,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=OE,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===OE&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=j1,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function U1(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>RE&&r.state<OE,r.state=j1,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function o1e(e){return this.each(function(){U1(this,e)})}function a1e(e,t){var n,r;return function(){var i=rl(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function s1e(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=rl(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function l1e(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=hs(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?a1e:s1e)(n,e,t))}function iA(e,t,n){var r=e._id;return e.each(function(){var i=rl(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return hs(i,r).value[t]}}function UU(e,t){var n;return(typeof t=="number"?_u:t instanceof h0?a9:(n=h0(t))?(t=n,a9):Vve)(e,t)}function u1e(e){return function(){this.removeAttribute(e)}}function c1e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function d1e(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function f1e(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function h1e(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function p1e(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function g1e(e,t){var n=W2(e),r=n==="transform"?Wve:UU;return this.attrTween(e,typeof t=="function"?(n.local?p1e:h1e)(n,r,iA(this,"attr."+e,t)):t==null?(n.local?c1e:u1e)(n):(n.local?f1e:d1e)(n,r,t))}function m1e(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function y1e(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function v1e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&y1e(e,o)),n}return i._value=t,i}function b1e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&m1e(e,o)),n}return i._value=t,i}function _1e(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=W2(e);return this.tween(n,(r.local?v1e:b1e)(r,t))}function S1e(e,t){return function(){rA(this,e).delay=+t.apply(this,arguments)}}function x1e(e,t){return t=+t,function(){rA(this,e).delay=t}}function w1e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?S1e:x1e)(t,e)):hs(this.node(),t).delay}function C1e(e,t){return function(){rl(this,e).duration=+t.apply(this,arguments)}}function E1e(e,t){return t=+t,function(){rl(this,e).duration=t}}function T1e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?C1e:E1e)(t,e)):hs(this.node(),t).duration}function k1e(e,t){if(typeof t!="function")throw new Error;return function(){rl(this,e).ease=t}}function A1e(e){var t=this._id;return arguments.length?this.each(k1e(t,e)):hs(this.node(),t).ease}function P1e(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;rl(this,e).ease=n}}function I1e(e){if(typeof e!="function")throw new Error;return this.each(P1e(this._id,e))}function R1e(e){typeof e!="function"&&(e=_U(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Wl(r,this._parents,this._name,this._id)}function O1e(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;s<r;++s)a[s]=t[s];return new Wl(a,this._parents,this._name,this._id)}function M1e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function N1e(e,t,n){var r,i,o=M1e(t)?rA:rl;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function $1e(e,t){var n=this._id;return arguments.length<2?hs(this.node(),n).on.on(e):this.each(N1e(n,e,t))}function D1e(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function L1e(){return this.on("end.remove",D1e(this._id))}function F1e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jk(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,d,f=0;f<l;++f)(c=s[f])&&(d=e.call(c,c.__data__,f,s))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Q2(u[f],t,n,f,u,hs(c,n)));return new Wl(o,this._parents,t,n)}function B1e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bU(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,p=hs(c,n),m=0,_=f.length;m<_;++m)(h=f[m])&&Q2(h,t,n,m,f,p);o.push(f),a.push(c)}return new Wl(o,a,t,n)}var z1e=Sy.prototype.constructor;function j1e(){return new z1e(this._groups,this._parents)}function U1e(e,t){var n,r,i;return function(){var o=ep(this,e),a=(this.style.removeProperty(e),ep(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function VU(e){return function(){this.style.removeProperty(e)}}function V1e(e,t,n){var r,i=n+"",o;return function(){var a=ep(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function G1e(e,t,n){var r,i,o;return function(){var a=ep(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),ep(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function q1e(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=rl(this,e),u=l.on,c=l.value[o]==null?s||(s=VU(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function H1e(e,t,n){var r=(e+="")=="transform"?Hve:UU;return t==null?this.styleTween(e,U1e(e,r)).on("end.style."+e,VU(e)):typeof t=="function"?this.styleTween(e,G1e(e,r,iA(this,"style."+e,t))).each(q1e(this._id,e)):this.styleTween(e,V1e(e,r,t),n).on("end.style."+e,null)}function W1e(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function K1e(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&W1e(e,a,n)),r}return o._value=t,o}function Q1e(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,K1e(e,t,n??""))}function X1e(e){return function(){this.textContent=e}}function Y1e(e){return function(){var t=e(this);this.textContent=t??""}}function Z1e(e){return this.tween("text",typeof e=="function"?Y1e(iA(this,"text",e)):X1e(e==null?"":e+""))}function J1e(e){return function(t){this.textContent=e.call(this,t)}}function ebe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&J1e(i)),t}return r._value=e,r}function tbe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ebe(e))}function nbe(){for(var e=this._name,t=this._id,n=GU(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=hs(l,t);Q2(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Wl(r,this._parents,e,n)}function rbe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=rl(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var ibe=0;function Wl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function GU(){return++ibe}var dl=Sy.prototype;Wl.prototype={constructor:Wl,select:F1e,selectAll:B1e,selectChild:dl.selectChild,selectChildren:dl.selectChildren,filter:R1e,merge:O1e,selection:j1e,transition:nbe,call:dl.call,nodes:dl.nodes,node:dl.node,size:dl.size,empty:dl.empty,each:dl.each,on:$1e,attr:g1e,attrTween:_1e,style:H1e,styleTween:Q1e,text:Z1e,textTween:tbe,remove:L1e,tween:l1e,delay:w1e,duration:T1e,ease:A1e,easeVarying:I1e,end:rbe,[Symbol.iterator]:dl[Symbol.iterator]};function obe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var abe={time:null,delay:0,duration:250,ease:obe};function sbe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function lbe(e){var t,n;e instanceof Wl?(t=e._id,e=e._name):(t=GU(),(n=abe).time=nA(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Q2(l,e,t,u,a,n||sbe(l,t));return new Wl(r,this._parents,e,t)}Sy.prototype.interrupt=o1e;Sy.prototype.transition=lbe;const Ov=e=>()=>e;function ube(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Rl(e,t,n){this.k=e,this.x=t,this.y=n}Rl.prototype={constructor:Rl,scale:function(e){return e===1?this:new Rl(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Rl(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Xu=new Rl(1,0,0);Rl.prototype;function LC(e){e.stopImmediatePropagation()}function Xp(e){e.preventDefault(),e.stopImmediatePropagation()}function cbe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function dbe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function h9(){return this.__zoom||Xu}function fbe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hbe(){return navigator.maxTouchPoints||"ontouchstart"in this}function pbe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function gbe(){var e=cbe,t=dbe,n=pbe,r=fbe,i=hbe,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Yve,u=H2("start","zoom","end"),c,d,f,h=500,p=150,m=0,_=10;function b(E){E.property("__zoom",h9).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(i).on("touchstart.zoom",P).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(E,A,D,L){var M=E.selection?E.selection():E;M.property("__zoom",h9),E!==M?S(E,A,D,L):M.interrupt().each(function(){w(this,arguments).event(L).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},b.scaleBy=function(E,A,D,L){b.scaleTo(E,function(){var M=this.__zoom.k,R=typeof A=="function"?A.apply(this,arguments):A;return M*R},D,L)},b.scaleTo=function(E,A,D,L){b.transform(E,function(){var M=t.apply(this,arguments),R=this.__zoom,N=D==null?v(M):typeof D=="function"?D.apply(this,arguments):D,B=R.invert(N),U=typeof A=="function"?A.apply(this,arguments):A;return n(g(y(R,U),N,B),M,a)},D,L)},b.translateBy=function(E,A,D,L){b.transform(E,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),a)},null,L)},b.translateTo=function(E,A,D,L,M){b.transform(E,function(){var R=t.apply(this,arguments),N=this.__zoom,B=L==null?v(R):typeof L=="function"?L.apply(this,arguments):L;return n(Xu.translate(B[0],B[1]).scale(N.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof D=="function"?-D.apply(this,arguments):-D),R,a)},L,M)};function y(E,A){return A=Math.max(o[0],Math.min(o[1],A)),A===E.k?E:new Rl(A,E.x,E.y)}function g(E,A,D){var L=A[0]-D[0]*E.k,M=A[1]-D[1]*E.k;return L===E.x&&M===E.y?E:new Rl(E.k,L,M)}function v(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,A,D,L){E.on("start.zoom",function(){w(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,R=arguments,N=w(M,R).event(L),B=t.apply(M,R),U=D==null?v(B):typeof D=="function"?D.apply(M,R):D,G=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Z=M.__zoom,ee=typeof A=="function"?A.apply(M,R):A,J=l(Z.invert(U).concat(G/Z.k),ee.invert(U).concat(G/ee.k));return function(j){if(j===1)j=ee;else{var Q=J(j),ne=G/Q[2];j=new Rl(ne,U[0]-Q[0]*ne,U[1]-Q[1]*ne)}N.zoom(null,j)}})}function w(E,A,D){return!D&&E.__zooming||new x(E,A)}function x(E,A){this.that=E,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,A),this.taps=0}x.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,A){return this.mouse&&E!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var A=Ka(this.that).datum();u.call(E,this.that,new ube(E,{sourceEvent:this.sourceEvent,target:b,type:E,transform:this.that.__zoom,dispatch:u}),A)}};function C(E,...A){if(!e.apply(this,arguments))return;var D=w(this,A).event(E),L=this.__zoom,M=Math.max(o[0],Math.min(o[1],L.k*Math.pow(2,r.apply(this,arguments)))),R=Cs(E);if(D.wheel)(D.mouse[0][0]!==R[0]||D.mouse[0][1]!==R[1])&&(D.mouse[1]=L.invert(D.mouse[0]=R)),clearTimeout(D.wheel);else{if(L.k===M)return;D.mouse=[R,L.invert(R)],U1(this),D.start()}Xp(E),D.wheel=setTimeout(N,p),D.zoom("mouse",n(g(y(L,M),D.mouse[0],D.mouse[1]),D.extent,a));function N(){D.wheel=null,D.end()}}function k(E,...A){if(f||!e.apply(this,arguments))return;var D=E.currentTarget,L=w(this,A,!0).event(E),M=Ka(E.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),R=Cs(E,D),N=E.clientX,B=E.clientY;IU(E.view),LC(E),L.mouse=[R,this.__zoom.invert(R)],U1(this),L.start();function U(Z){if(Xp(Z),!L.moved){var ee=Z.clientX-N,J=Z.clientY-B;L.moved=ee*ee+J*J>m}L.event(Z).zoom("mouse",n(g(L.that.__zoom,L.mouse[0]=Cs(Z,D),L.mouse[1]),L.extent,a))}function G(Z){M.on("mousemove.zoom mouseup.zoom",null),RU(Z.view,L.moved),Xp(Z),L.event(Z).end()}}function T(E,...A){if(e.apply(this,arguments)){var D=this.__zoom,L=Cs(E.changedTouches?E.changedTouches[0]:E,this),M=D.invert(L),R=D.k*(E.shiftKey?.5:2),N=n(g(y(D,R),L,M),t.apply(this,A),a);Xp(E),s>0?Ka(this).transition().duration(s).call(S,N,L,E):Ka(this).call(b.transform,N,L,E)}}function P(E,...A){if(e.apply(this,arguments)){var D=E.touches,L=D.length,M=w(this,A,E.changedTouches.length===L).event(E),R,N,B,U;for(LC(E),N=0;N<L;++N)B=D[N],U=Cs(B,this),U=[U,this.__zoom.invert(U),B.identifier],M.touch0?!M.touch1&&M.touch0[2]!==U[2]&&(M.touch1=U,M.taps=0):(M.touch0=U,R=!0,M.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(M.taps<2&&(d=U[0],c=setTimeout(function(){c=null},h)),U1(this),M.start())}}function $(E,...A){if(this.__zooming){var D=w(this,A).event(E),L=E.changedTouches,M=L.length,R,N,B,U;for(Xp(E),R=0;R<M;++R)N=L[R],B=Cs(N,this),D.touch0&&D.touch0[2]===N.identifier?D.touch0[0]=B:D.touch1&&D.touch1[2]===N.identifier&&(D.touch1[0]=B);if(N=D.that.__zoom,D.touch1){var G=D.touch0[0],Z=D.touch0[1],ee=D.touch1[0],J=D.touch1[1],j=(j=ee[0]-G[0])*j+(j=ee[1]-G[1])*j,Q=(Q=J[0]-Z[0])*Q+(Q=J[1]-Z[1])*Q;N=y(N,Math.sqrt(j/Q)),B=[(G[0]+ee[0])/2,(G[1]+ee[1])/2],U=[(Z[0]+J[0])/2,(Z[1]+J[1])/2]}else if(D.touch0)B=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(g(N,B,U),D.extent,a))}}function O(E,...A){if(this.__zooming){var D=w(this,A).event(E),L=E.changedTouches,M=L.length,R,N;for(LC(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),R=0;R<M;++R)N=L[R],D.touch0&&D.touch0[2]===N.identifier?delete D.touch0:D.touch1&&D.touch1[2]===N.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(N=Cs(N,this),Math.hypot(d[0]-N[0],d[1]-N[1])<_)){var B=Ka(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return b.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ov(+E),b):r},b.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ov(!!E),b):e},b.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Ov(!!E),b):i},b.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ov([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),b):t},b.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],b):[o[0],o[1]]},b.translateExtent=function(E){return arguments.length?(a[0][0]=+E[0][0],a[1][0]=+E[1][0],a[0][1]=+E[0][1],a[1][1]=+E[1][1],b):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},b.constrain=function(E){return arguments.length?(n=E,b):n},b.duration=function(E){return arguments.length?(s=+E,b):s},b.interpolate=function(E){return arguments.length?(l=E,b):l},b.on=function(){var E=u.on.apply(u,arguments);return E===u?b:E},b.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,b):Math.sqrt(m)},b.tapDistance=function(E){return arguments.length?(_=+E,b):_},b}const X2=I.createContext(null),mbe=X2.Provider,Kl={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},qU=Kl.error001();function _r(e,t){const n=I.useContext(X2);if(n===null)throw new Error(qU);return yU(n,e,t)}const pi=()=>{const e=I.useContext(X2);if(e===null)throw new Error(qU);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},ybe=e=>e.userSelectionActive?"none":"all";function vbe({position:e,children:t,className:n,style:r,...i}){const o=_r(ybe),a=`${e}`.split("-");return W.jsx("div",{className:Aa(["react-flow__panel",n,...a]),style:{...r,pointerEvents:o},...i,children:t})}function bbe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:W.jsx(vbe,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:W.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const _be=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:a=[2,4],labelBgBorderRadius:s=2,children:l,className:u,...c})=>{const d=I.useRef(null),[f,h]=I.useState({x:0,y:0,width:0,height:0}),p=Aa(["react-flow__edge-textwrapper",u]);return I.useEffect(()=>{if(d.current){const m=d.current.getBBox();h({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),typeof n>"u"||!n?null:W.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c,children:[i&&W.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:s,ry:s}),W.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var Sbe=I.memo(_be);const oA=e=>({width:e.offsetWidth,height:e.offsetHeight}),np=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),aA=(e={x:0,y:0},t)=>({x:np(e.x,t[0][0],t[1][0]),y:np(e.y,t[0][1],t[1][1])}),p9=(e,t,n)=>e<t?np(Math.abs(e-t),1,50)/50:e>n?-np(Math.abs(e-n),1,50)/50:0,HU=(e,t)=>{const n=p9(e.x,35,t.width-35)*20,r=p9(e.y,35,t.height-35)*20;return[n,r]},WU=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},KU=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),g0=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),QU=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),g9=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Mqe=(e,t)=>QU(KU(g0(e),g0(t))),ME=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},xbe=e=>_a(e.width)&&_a(e.height)&&_a(e.x)&&_a(e.y),_a=e=>!isNaN(e)&&isFinite(e),Qr=Symbol.for("internals"),XU=["Enter"," ","Escape"],wbe=(e,t)=>{},Cbe=e=>"nativeEvent"in e;function NE(e){var i,o;const t=Cbe(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const YU=e=>"clientX"in e,Yu=(e,t)=>{var o,a;const n=YU(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},O_=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},wy=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h=20})=>W.jsxs(W.Fragment,{children:[W.jsx("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&W.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&_a(n)&&_a(r)?W.jsx(Sbe,{x:n,y:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null]});wy.displayName="BaseEdge";function Yp(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function ZU({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,a=Math.abs(r-t)/2,s=r<t?r+a:r-a;return[o,s,i,a]}function JU({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:s}){const l=e*.125+i*.375+a*.375+n*.125,u=t*.125+o*.375+s*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var Dd;(function(e){e.Strict="strict",e.Loose="loose"})(Dd||(Dd={}));var sd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(sd||(sd={}));var uc;(function(e){e.Partial="partial",e.Full="full"})(uc||(uc={}));var Au;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Au||(Au={}));var M_;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(M_||(M_={}));var tt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(tt||(tt={}));function m9({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===tt.Left||e===tt.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function eV({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top}){const[a,s]=m9({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=m9({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,d,f,h]=JU({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${s} ${l},${u} ${r},${i}`,c,d,f,h]}const sA=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=tt.Bottom,targetPosition:o=tt.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[_,b,y]=eV({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return W.jsx(wy,{path:_,labelX:b,labelY:y,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})});sA.displayName="SimpleBezierEdge";const y9={[tt.Left]:{x:-1,y:0},[tt.Right]:{x:1,y:0},[tt.Top]:{x:0,y:-1},[tt.Bottom]:{x:0,y:1}},Ebe=({source:e,sourcePosition:t=tt.Bottom,target:n})=>t===tt.Left||t===tt.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},v9=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Tbe({source:e,sourcePosition:t=tt.Bottom,target:n,targetPosition:r=tt.Top,center:i,offset:o}){const a=y9[t],s=y9[r],l={x:e.x+a.x*o,y:e.y+a.y*o},u={x:n.x+s.x*o,y:n.y+s.y*o},c=Ebe({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],p,m;const _={x:0,y:0},b={x:0,y:0},[y,g,v,S]=ZU({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){p=i.x||y,m=i.y||g;const x=[{x:p,y:l.y},{x:p,y:u.y}],C=[{x:l.x,y:m},{x:u.x,y:m}];a[d]===f?h=d==="x"?x:C:h=d==="x"?C:x}else{const x=[{x:l.x,y:u.y}],C=[{x:u.x,y:l.y}];if(d==="x"?h=a.x===f?C:x:h=a.y===f?x:C,t===r){const O=Math.abs(e[d]-n[d]);if(O<=o){const E=Math.min(o-1,o-O);a[d]===f?_[d]=(l[d]>e[d]?-1:1)*E:b[d]=(u[d]>n[d]?-1:1)*E}}if(t!==r){const O=d==="x"?"y":"x",E=a[d]===s[O],A=l[O]>u[O],D=l[O]<u[O];(a[d]===1&&(!E&&A||E&&D)||a[d]!==1&&(!E&&D||E&&A))&&(h=d==="x"?x:C)}const k={x:l.x+_.x,y:l.y+_.y},T={x:u.x+b.x,y:u.y+b.y},P=Math.max(Math.abs(k.x-h[0].x),Math.abs(T.x-h[0].x)),$=Math.max(Math.abs(k.y-h[0].y),Math.abs(T.y-h[0].y));P>=$?(p=(k.x+T.x)/2,m=h[0].y):(p=h[0].x,m=(k.y+T.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...h,{x:u.x+b.x,y:u.y+b.y},n],p,m,v,S]}function kbe(e,t,n,r){const i=Math.min(v9(e,t)/2,v9(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${o+i*u},${a}Q ${o},${a} ${o},${a+i*c}`}const s=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${a+i*l}Q ${o},${a} ${o+i*s},${a}`}function $E({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top,borderRadius:a=5,centerX:s,centerY:l,offset:u=20}){const[c,d,f,h,p]=Tbe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:s,y:l},offset:u});return[c.reduce((_,b,y)=>{let g="";return y>0&&y<c.length-1?g=kbe(c[y-1],b,c[y+1],a):g=`${y===0?"M":"L"}${b.x} ${b.y}`,_+=g,_},""),d,f,h,p]}const Y2=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=tt.Bottom,targetPosition:f=tt.Top,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[b,y,g]=$E({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset});return W.jsx(wy,{path:b,labelX:y,labelY:g,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:p,interactionWidth:_})});Y2.displayName="SmoothStepEdge";const lA=I.memo(e=>{var t;return W.jsx(Y2,{...e,pathOptions:I.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});lA.displayName="StepEdge";function Abe({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,a,s]=ZU({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,s]}const uA=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[p,m,_]=Abe({sourceX:e,sourceY:t,targetX:n,targetY:r});return W.jsx(wy,{path:p,labelX:m,labelY:_,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});uA.displayName="StraightEdge";function Mv(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function b9({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case tt.Left:return[t-Mv(t-r,o),n];case tt.Right:return[t+Mv(r-t,o),n];case tt.Top:return[t,n-Mv(n-i,o)];case tt.Bottom:return[t,n+Mv(i-n,o)]}}function tV({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top,curvature:a=.25}){const[s,l]=b9({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,c]=b9({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[d,f,h,p]=JU({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${l} ${u},${c} ${r},${i}`,d,f,h,p]}const N_=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=tt.Bottom,targetPosition:o=tt.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[b,y,g]=tV({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:m==null?void 0:m.curvature});return W.jsx(wy,{path:b,labelX:y,labelY:g,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:_})});N_.displayName="BezierEdge";const cA=I.createContext(null),Pbe=cA.Provider;cA.Consumer;const Ibe=()=>I.useContext(cA),Rbe=e=>"id"in e&&"source"in e&&"target"in e,nV=e=>"id"in e&&!("source"in e)&&!("target"in e),Obe=(e,t,n)=>{if(!nV(e))return[];const r=n.filter(i=>i.source===e.id).map(i=>i.target);return t.filter(i=>r.includes(i.id))},Mbe=(e,t,n)=>{if(!nV(e))return[];const r=n.filter(i=>i.target===e.id).map(i=>i.source);return t.filter(i=>r.includes(i.id))},rV=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,DE=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Nbe=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),wg=(e,t)=>{if(!e.source||!e.target)return t;let n;return Rbe(e)?n={...e}:n={...e,id:rV(e)},Nbe(n,t)?t:t.concat(n)},$be=(e,t,n,r={shouldReplaceId:!0})=>{const{id:i,...o}=e;if(!t.source||!t.target||!n.find(l=>l.id===i))return n;const s={...o,id:r.shouldReplaceId?rV(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==i).concat(s)},iV=({x:e,y:t},[n,r,i],o,[a,s])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},Dbe=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),yh=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},dA=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:a}=yh(i,t).positionAbsolute;return KU(r,g0({x:o,y:a,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return QU(n)},oV=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1,s=[0,0])=>{const l={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:h=!0,hidden:p=!1}=c;if(a&&!h||p)return!1;const{positionAbsolute:m}=yh(c,s),_={x:m.x,y:m.y,width:d||0,height:f||0},b=ME(l,_),y=typeof d>"u"||typeof f>"u"||d===null||f===null,g=o&&b>0,v=(d||0)*(f||0);(y||g||b>=v||c.dragging)&&u.push(c)}),u},fA=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},aV=(e,t,n,r,i,o=.1)=>{const a=t/(e.width*(1+o)),s=n/(e.height*(1+o)),l=Math.min(a,s),u=np(l,r,i),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},Vc=(e,t=0)=>e.transition().duration(t);function _9(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var a,s;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((a=e.positionAbsolute)==null?void 0:a.x)??0)+o.x+o.width/2,y:(((s=e.positionAbsolute)==null?void 0:s.y)??0)+o.y+o.height/2}),i},[])}function Lbe(e,t,n,r,i,o){const{x:a,y:s}=Yu(e),u=t.elementsFromPoint(a,s).find(p=>p.classList.contains("react-flow__handle"));if(u){const p=u.getAttribute("data-nodeid");if(p){const m=hA(void 0,u),_=u.getAttribute("data-handleid"),b=o({nodeId:p,id:_,type:m});if(b)return{handle:{id:_,type:m,nodeId:p,x:n.x,y:n.y},validHandleResult:b}}}let c=[],d=1/0;if(i.forEach(p=>{const m=Math.sqrt((p.x-n.x)**2+(p.y-n.y)**2);if(m<=r){const _=o(p);m<=d&&(m<d?c=[{handle:p,validHandleResult:_}]:m===d&&c.push({handle:p,validHandleResult:_}),d=m)}}),!c.length)return{handle:null,validHandleResult:sV()};if(c.length===1)return c[0];const f=c.some(({validHandleResult:p})=>p.isValid),h=c.some(({handle:p})=>p.type==="target");return c.find(({handle:p,validHandleResult:m})=>h?p.type==="target":f?m.isValid:!0)||c[0]}const Fbe={source:null,target:null,sourceHandle:null,targetHandle:null},sV=()=>({handleDomNode:null,isValid:!1,connection:Fbe,endHandle:null});function lV(e,t,n,r,i,o,a){const s=i==="target",l=a.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...sV(),handleDomNode:l};if(l){const c=hA(void 0,l),d=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),p=l.classList.contains("connectableend"),m={source:s?d:n,sourceHandle:s?f:r,target:s?n:d,targetHandle:s?r:f};u.connection=m,h&&p&&(t===Dd.Strict?s&&c==="source"||!s&&c==="target":d!==n||f!==r)&&(u.endHandle={nodeId:d,handleId:f,type:c},u.isValid=o(m))}return u}function Bbe({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[Qr]){const{handleBounds:a}=o[Qr];let s=[],l=[];a&&(s=_9(o,a,"source",`${t}-${n}-${r}`),l=_9(o,a,"target",`${t}-${n}-${r}`)),i.push(...s,...l)}return i},[])}function hA(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function FC(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function zbe(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function uV({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:a,isValidConnection:s,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=WU(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:p,onConnectStart:m,panBy:_,getNodes:b,cancelConnection:y}=o();let g=0,v;const{x:S,y:w}=Yu(e),x=c==null?void 0:c.elementFromPoint(S,w),C=hA(l,x),k=f==null?void 0:f.getBoundingClientRect();if(!k||!C)return;let T,P=Yu(e,k),$=!1,O=null,E=!1,A=null;const D=Bbe({nodes:b(),nodeId:n,handleId:t,handleType:C}),L=()=>{if(!h)return;const[N,B]=HU(P,k);_({x:N,y:B}),g=requestAnimationFrame(L)};a({connectionPosition:P,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:C,connectionStartHandle:{nodeId:n,handleId:t,type:C},connectionEndHandle:null}),m==null||m(e,{nodeId:n,handleId:t,handleType:C});function M(N){const{transform:B}=o();P=Yu(N,k);const{handle:U,validHandleResult:G}=Lbe(N,c,iV(P,B,!1,[1,1]),p,D,Z=>lV(Z,d,n,t,i?"target":"source",s,c));if(v=U,$||(L(),$=!0),A=G.handleDomNode,O=G.connection,E=G.isValid,a({connectionPosition:v&&E?Dbe({x:v.x,y:v.y},B):P,connectionStatus:zbe(!!v,E),connectionEndHandle:G.endHandle}),!v&&!E&&!A)return FC(T);O.source!==O.target&&A&&(FC(T),T=A,A.classList.add("connecting","react-flow__handle-connecting"),A.classList.toggle("valid",E),A.classList.toggle("react-flow__handle-valid",E))}function R(N){var B,U;(v||A)&&O&&E&&(r==null||r(O)),(U=(B=o()).onConnectEnd)==null||U.call(B,N),l&&(u==null||u(N)),FC(T),y(),cancelAnimationFrame(g),$=!1,E=!1,O=null,A=null,c.removeEventListener("mousemove",M),c.removeEventListener("mouseup",R),c.removeEventListener("touchmove",M),c.removeEventListener("touchend",R)}c.addEventListener("mousemove",M),c.addEventListener("mouseup",R),c.addEventListener("touchmove",M),c.addEventListener("touchend",R)}const S9=()=>!0,jbe=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Ube=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:a}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n}},cV=I.forwardRef(({type:e="source",position:t=tt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:s,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var k,T;const p=a||null,m=e==="target",_=pi(),b=Ibe(),{connectOnClick:y,noPanClassName:g}=_r(jbe,Oo),{connecting:v,clickConnecting:S}=_r(Ube(b,p,e),Oo);b||(T=(k=_.getState()).onError)==null||T.call(k,"010",Kl.error010());const w=P=>{const{defaultEdgeOptions:$,onConnect:O,hasDefaultEdges:E}=_.getState(),A={...$,...P};if(E){const{edges:D,setEdges:L}=_.getState();L(wg(A,D))}O==null||O(A),s==null||s(A)},x=P=>{if(!b)return;const $=YU(P);i&&($&&P.button===0||!$)&&uV({event:P,handleId:p,nodeId:b,onConnect:w,isTarget:m,getState:_.getState,setState:_.setState,isValidConnection:n||_.getState().isValidConnection||S9}),$?c==null||c(P):d==null||d(P)},C=P=>{const{onClickConnectStart:$,onClickConnectEnd:O,connectionClickStartHandle:E,connectionMode:A,isValidConnection:D}=_.getState();if(!b||!E&&!i)return;if(!E){$==null||$(P,{nodeId:b,handleId:p,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:p}});return}const L=WU(P.target),M=n||D||S9,{connection:R,isValid:N}=lV({nodeId:b,id:p,type:e},A,E.nodeId,E.handleId||null,E.type,M,L);N&&w(R),O==null||O(P),_.setState({connectionClickStartHandle:null})};return W.jsx("div",{"data-handleid":p,"data-nodeid":b,"data-handlepos":t,"data-id":`${b}-${p}-${e}`,className:Aa(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,connecting:S,connectionindicator:r&&(i&&!v||o&&v)}]),onMouseDown:x,onTouchStart:x,onClick:y?C:void 0,ref:h,...f,children:l})});cV.displayName="Handle";var $_=I.memo(cV);const dV=({data:e,isConnectable:t,targetPosition:n=tt.Top,sourcePosition:r=tt.Bottom})=>W.jsxs(W.Fragment,{children:[W.jsx($_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,W.jsx($_,{type:"source",position:r,isConnectable:t})]});dV.displayName="DefaultNode";var LE=I.memo(dV);const fV=({data:e,isConnectable:t,sourcePosition:n=tt.Bottom})=>W.jsxs(W.Fragment,{children:[e==null?void 0:e.label,W.jsx($_,{type:"source",position:n,isConnectable:t})]});fV.displayName="InputNode";var hV=I.memo(fV);const pV=({data:e,isConnectable:t,targetPosition:n=tt.Top})=>W.jsxs(W.Fragment,{children:[W.jsx($_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});pV.displayName="OutputNode";var gV=I.memo(pV);const pA=()=>null;pA.displayName="GroupNode";const Vbe=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Nv=e=>e.id;function Gbe(e,t){return Oo(e.selectedNodes.map(Nv),t.selectedNodes.map(Nv))&&Oo(e.selectedEdges.map(Nv),t.selectedEdges.map(Nv))}const mV=I.memo(({onSelectionChange:e})=>{const t=pi(),{selectedNodes:n,selectedEdges:r}=_r(Vbe,Gbe);return I.useEffect(()=>{var o,a;const i={nodes:n,edges:r};e==null||e(i),(a=(o=t.getState()).onSelectionChange)==null||a.call(o,i)},[n,r,e]),null});mV.displayName="SelectionListener";const qbe=e=>!!e.onSelectionChange;function Hbe({onSelectionChange:e}){const t=_r(qbe);return e||t?W.jsx(mV,{onSelectionChange:e}):null}const Wbe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function ff(e,t){I.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ot(e,t,n){I.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const Kbe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:a,onClickConnectStart:s,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:m,maxZoom:_,nodeExtent:b,onNodesChange:y,onEdgesChange:g,elementsSelectable:v,connectionMode:S,snapGrid:w,snapToGrid:x,translateExtent:C,connectOnClick:k,defaultEdgeOptions:T,fitView:P,fitViewOptions:$,onNodesDelete:O,onEdgesDelete:E,onNodeDrag:A,onNodeDragStart:D,onNodeDragStop:L,onSelectionDrag:M,onSelectionDragStart:R,onSelectionDragStop:N,noPanClassName:B,nodeOrigin:U,rfId:G,autoPanOnConnect:Z,autoPanOnNodeDrag:ee,onError:J,connectionRadius:j,isValidConnection:Q})=>{const{setNodes:ne,setEdges:se,setDefaultNodesAndEdges:ye,setMinZoom:ce,setMaxZoom:bt,setTranslateExtent:ot,setNodeExtent:ze,reset:mt}=_r(Wbe,Oo),Pe=pi();return I.useEffect(()=>{const en=r==null?void 0:r.map(Pr=>({...Pr,...T}));return ye(n,en),()=>{mt()}},[]),Ot("defaultEdgeOptions",T,Pe.setState),Ot("connectionMode",S,Pe.setState),Ot("onConnect",i,Pe.setState),Ot("onConnectStart",o,Pe.setState),Ot("onConnectEnd",a,Pe.setState),Ot("onClickConnectStart",s,Pe.setState),Ot("onClickConnectEnd",l,Pe.setState),Ot("nodesDraggable",u,Pe.setState),Ot("nodesConnectable",c,Pe.setState),Ot("nodesFocusable",d,Pe.setState),Ot("edgesFocusable",f,Pe.setState),Ot("edgesUpdatable",h,Pe.setState),Ot("elementsSelectable",v,Pe.setState),Ot("elevateNodesOnSelect",p,Pe.setState),Ot("snapToGrid",x,Pe.setState),Ot("snapGrid",w,Pe.setState),Ot("onNodesChange",y,Pe.setState),Ot("onEdgesChange",g,Pe.setState),Ot("connectOnClick",k,Pe.setState),Ot("fitViewOnInit",P,Pe.setState),Ot("fitViewOnInitOptions",$,Pe.setState),Ot("onNodesDelete",O,Pe.setState),Ot("onEdgesDelete",E,Pe.setState),Ot("onNodeDrag",A,Pe.setState),Ot("onNodeDragStart",D,Pe.setState),Ot("onNodeDragStop",L,Pe.setState),Ot("onSelectionDrag",M,Pe.setState),Ot("onSelectionDragStart",R,Pe.setState),Ot("onSelectionDragStop",N,Pe.setState),Ot("noPanClassName",B,Pe.setState),Ot("nodeOrigin",U,Pe.setState),Ot("rfId",G,Pe.setState),Ot("autoPanOnConnect",Z,Pe.setState),Ot("autoPanOnNodeDrag",ee,Pe.setState),Ot("onError",J,Pe.setState),Ot("connectionRadius",j,Pe.setState),Ot("isValidConnection",Q,Pe.setState),ff(e,ne),ff(t,se),ff(m,ce),ff(_,bt),ff(C,ot),ff(b,ze),null},x9={display:"none"},Qbe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},yV="react-flow__node-desc",vV="react-flow__edge-desc",Xbe="react-flow__aria-live",Ybe=e=>e.ariaLiveMessage;function Zbe({rfId:e}){const t=_r(Ybe);return W.jsx("div",{id:`${Xbe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Qbe,children:t})}function Jbe({rfId:e,disableKeyboardA11y:t}){return W.jsxs(W.Fragment,{children:[W.jsxs("div",{id:`${yV}-${e}`,style:x9,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),W.jsx("div",{id:`${vV}-${e}`,style:x9,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&W.jsx(Zbe,{rfId:e})]})}const e_e=typeof document<"u"?document:null;var m0=(e=null,t={target:e_e})=>{const[n,r]=I.useState(!1),i=I.useRef(!1),o=I.useRef(new Set([])),[a,s]=I.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return I.useEffect(()=>{var l,u;if(e!==null){const c=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,!i.current&&NE(h))return!1;const p=C9(h.code,s);o.current.add(h[p]),w9(a,o.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!i.current&&NE(h))return!1;const p=C9(h.code,s);w9(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[p]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var h,p;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",c),(p=t==null?void 0:t.target)==null||p.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function w9(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function C9(e,t){return t.includes(e)?"code":"key"}function bV(e,t,n,r){var a,s;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=yh(i,r);return bV(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((a=i[Qr])==null?void 0:a.z)??0)>(n.z??0)?((s=i[Qr])==null?void 0:s.z)??0:n.z??0},r)}function _V(e,t,n){e.forEach(r=>{var i;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:o,y:a,z:s}=bV(r,e,{...r.position,z:((i=r[Qr])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:a},r[Qr].z=s,n!=null&&n[r.id]&&(r[Qr].isParent=!0)}})}function BC(e,t,n,r){const i=new Map,o={},a=r?1e3:0;return e.forEach(s=>{var d;const l=(_a(s.zIndex)?s.zIndex:0)+(s.selected?a:0),u=t.get(s.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...s,positionAbsolute:{x:s.position.x,y:s.position.y}};s.parentNode&&(c.parentNode=s.parentNode,o[s.parentNode]=!0),Object.defineProperty(c,Qr,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[Qr])==null?void 0:d.handleBounds,z:l}}),i.set(s.id,c)}),_V(i,n,o),i}function SV(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:a,d3Zoom:s,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(s&&l&&(f||!t.initial)){const p=n().filter(_=>{var y;const b=t.includeHiddenNodes?_.width&&_.height:!_.hidden;return(y=t.nodes)!=null&&y.length?b&&t.nodes.some(g=>g.id===_.id):b}),m=p.every(_=>_.width&&_.height);if(p.length>0&&m){const _=dA(p,d),[b,y,g]=aV(_,r,i,t.minZoom??o,t.maxZoom??a,t.padding??.1),v=Xu.translate(b,y).scale(g);return typeof t.duration=="number"&&t.duration>0?s.transform(Vc(l,t.duration),v):s.transform(l,v),!0}}return!1}function t_e(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Qr]:r[Qr],selected:n.selected})}),new Map(t)}function n_e(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function $v({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:t_e(e,i)}),a==null||a(e)),t!=null&&t.length&&(u&&r({edges:n_e(t,o)}),s==null||s(t))}const hf=()=>{},r_e={zoomIn:hf,zoomOut:hf,zoomTo:hf,getZoom:()=>1,setViewport:hf,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:hf,fitBounds:hf,project:e=>e,viewportInitialized:!1},i_e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),o_e=()=>{const e=pi(),{d3Zoom:t,d3Selection:n}=_r(i_e,Oo);return I.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Vc(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Vc(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Vc(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[a,s,l]=e.getState().transform,u=Xu.translate(i.x??a,i.y??s).scale(i.zoom??l);t.transform(Vc(n,o==null?void 0:o.duration),u)},getViewport:()=>{const[i,o,a]=e.getState().transform;return{x:i,y:o,zoom:a}},fitView:i=>SV(e.getState,i),setCenter:(i,o,a)=>{const{width:s,height:l,maxZoom:u}=e.getState(),c=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:u,d=s/2-i*c,f=l/2-o*c,h=Xu.translate(d,f).scale(c);t.transform(Vc(n,a==null?void 0:a.duration),h)},fitBounds:(i,o)=>{const{width:a,height:s,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=aV(i,a,s,l,u,(o==null?void 0:o.padding)??.1),h=Xu.translate(c,d).scale(f);t.transform(Vc(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:a,snapGrid:s}=e.getState();return iV(i,o,a,s)},viewportInitialized:!0}:r_e,[t,n])};function xV(){const e=o_e(),t=pi(),n=I.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=I.useCallback(m=>t.getState().nodeInternals.get(m),[]),i=I.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(_=>({..._}))},[]),o=I.useCallback(m=>{const{edges:_=[]}=t.getState();return _.find(b=>b.id===m)},[]),a=I.useCallback(m=>{const{getNodes:_,setNodes:b,hasDefaultNodes:y,onNodesChange:g}=t.getState(),v=_(),S=typeof m=="function"?m(v):m;if(y)b(S);else if(g){const w=S.length===0?v.map(x=>({type:"remove",id:x.id})):S.map(x=>({item:x,type:"reset"}));g(w)}},[]),s=I.useCallback(m=>{const{edges:_=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:g}=t.getState(),v=typeof m=="function"?m(_):m;if(y)b(v);else if(g){const S=v.length===0?_.map(w=>({type:"remove",id:w.id})):v.map(w=>({item:w,type:"reset"}));g(S)}},[]),l=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{getNodes:b,setNodes:y,hasDefaultNodes:g,onNodesChange:v}=t.getState();if(g){const w=[...b(),..._];y(w)}else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),u=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{edges:b=[],setEdges:y,hasDefaultEdges:g,onEdgesChange:v}=t.getState();if(g)y([...b,..._]);else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),c=I.useCallback(()=>{const{getNodes:m,edges:_=[],transform:b}=t.getState(),[y,g,v]=b;return{nodes:m().map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:y,y:g,zoom:v}}},[]),d=I.useCallback(({nodes:m,edges:_})=>{const{nodeInternals:b,getNodes:y,edges:g,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:w,onEdgesDelete:x,onNodesChange:C,onEdgesChange:k}=t.getState(),T=(m||[]).map(A=>A.id),P=(_||[]).map(A=>A.id),$=y().reduce((A,D)=>{const L=!T.includes(D.id)&&D.parentNode&&A.find(R=>R.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(T.includes(D.id)||L)&&A.push(D),A},[]),O=g.filter(A=>typeof A.deletable=="boolean"?A.deletable:!0),E=O.filter(A=>P.includes(A.id));if($||E){const A=fA($,O),D=[...E,...A],L=D.reduce((M,R)=>(M.includes(R.id)||M.push(R.id),M),[]);if((S||v)&&(S&&t.setState({edges:g.filter(M=>!L.includes(M.id))}),v&&($.forEach(M=>{b.delete(M.id)}),t.setState({nodeInternals:new Map(b)}))),L.length>0&&(x==null||x(D),k&&k(L.map(M=>({id:M,type:"remove"})))),$.length>0&&(w==null||w($),C)){const M=$.map(R=>({id:R.id,type:"remove"}));C(M)}}},[]),f=I.useCallback(m=>{const _=xbe(m),b=_?null:t.getState().nodeInternals.get(m.id);return[_?m:g9(b),b,_]},[]),h=I.useCallback((m,_=!0,b)=>{const[y,g,v]=f(m);return y?(b||t.getState().getNodes()).filter(S=>{if(!v&&(S.id===g.id||!S.positionAbsolute))return!1;const w=g9(S),x=ME(w,y);return _&&x>0||x>=m.width*m.height}):[]},[]),p=I.useCallback((m,_,b=!0)=>{const[y]=f(m);if(!y)return!1;const g=ME(y,_);return b&&g>0||g>=m.width*m.height},[]);return I.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:a,setEdges:s,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,i,o,a,s,l,u,c,d,h,p])}var a_e=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=pi(),{deleteElements:r}=xV(),i=m0(e),o=m0(t);I.useEffect(()=>{if(i){const{edges:a,getNodes:s}=n.getState(),l=s().filter(c=>c.selected),u=a.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[i]),I.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function s_e(e){const t=pi();I.useEffect(()=>{let n;const r=()=>{var o,a;if(!e.current)return;const i=oA(e.current);(i.height===0||i.width===0)&&((a=(o=t.getState()).onError)==null||a.call(o,"004",Kl.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const gA={position:"absolute",width:"100%",height:"100%",top:0,left:0},l_e=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Dv=e=>({x:e.x,y:e.y,zoom:e.k}),pf=(e,t)=>e.target.closest(`.${t}`),E9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),T9=e=>{const t=e.ctrlKey&&O_()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},u_e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),c_e=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=sd.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:m,zoomActivationKeyCode:_,preventScrolling:b=!0,children:y,noWheelClassName:g,noPanClassName:v})=>{const S=I.useRef(),w=pi(),x=I.useRef(!1),C=I.useRef(!1),k=I.useRef(null),T=I.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:$,d3ZoomHandler:O,userSelectionActive:E}=_r(u_e,Oo),A=m0(_),D=I.useRef(0),L=I.useRef(!1),M=I.useRef();return s_e(k),I.useEffect(()=>{if(k.current){const R=k.current.getBoundingClientRect(),N=gbe().scaleExtent([p,m]).translateExtent(h),B=Ka(k.current).call(N),U=Xu.translate(f.x,f.y).scale(np(f.zoom,p,m)),G=[[0,0],[R.width,R.height]],Z=N.constrain()(U,G,h);N.transform(B,Z),N.wheelDelta(T9),w.setState({d3Zoom:N,d3Selection:B,d3ZoomHandler:B.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:k.current.closest(".react-flow")})}},[]),I.useEffect(()=>{$&&P&&(a&&!A&&!E?$.on("wheel.zoom",R=>{if(pf(R,g))return!1;R.preventDefault(),R.stopImmediatePropagation();const N=$.property("__zoom").k||1,B=O_();if(R.ctrlKey&&o&&B){const ne=Cs(R),se=T9(R),ye=N*Math.pow(2,se);P.scaleTo($,ye,ne,R);return}const U=R.deltaMode===1?20:1;let G=l===sd.Vertical?0:R.deltaX*U,Z=l===sd.Horizontal?0:R.deltaY*U;!B&&R.shiftKey&&l!==sd.Vertical&&(G=R.deltaY*U,Z=0),P.translateBy($,-(G/N)*s,-(Z/N)*s,{internal:!0});const ee=Dv($.property("__zoom")),{onViewportChangeStart:J,onViewportChange:j,onViewportChangeEnd:Q}=w.getState();clearTimeout(M.current),L.current||(L.current=!0,t==null||t(R,ee),J==null||J(ee)),L.current&&(e==null||e(R,ee),j==null||j(ee),M.current=setTimeout(()=>{n==null||n(R,ee),Q==null||Q(ee),L.current=!1},150))},{passive:!1}):typeof O<"u"&&$.on("wheel.zoom",function(R,N){if(!b||pf(R,g))return null;R.preventDefault(),O.call(this,R,N)},{passive:!1}))},[E,a,l,$,P,O,A,o,b,g,t,e,n]),I.useEffect(()=>{P&&P.on("start",R=>{var U,G;if(!R.sourceEvent||R.sourceEvent.internal)return null;D.current=(U=R.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:N}=w.getState(),B=Dv(R.transform);x.current=!0,T.current=B,((G=R.sourceEvent)==null?void 0:G.type)==="mousedown"&&w.setState({paneDragging:!0}),N==null||N(B),t==null||t(R.sourceEvent,B)})},[P,t]),I.useEffect(()=>{P&&(E&&!x.current?P.on("zoom",null):E||P.on("zoom",R=>{var B;const{onViewportChange:N}=w.getState();if(w.setState({transform:[R.transform.x,R.transform.y,R.transform.k]}),C.current=!!(r&&E9(d,D.current??0)),(e||N)&&!((B=R.sourceEvent)!=null&&B.internal)){const U=Dv(R.transform);N==null||N(U),e==null||e(R.sourceEvent,U)}}))},[E,P,e,d,r]),I.useEffect(()=>{P&&P.on("end",R=>{if(!R.sourceEvent||R.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=w.getState();if(x.current=!1,w.setState({paneDragging:!1}),r&&E9(d,D.current??0)&&!C.current&&r(R.sourceEvent),C.current=!1,(n||N)&&l_e(T.current,R.transform)){const B=Dv(R.transform);T.current=B,clearTimeout(S.current),S.current=setTimeout(()=>{N==null||N(B),n==null||n(R.sourceEvent,B)},a?150:0)}})},[P,a,d,n,r]),I.useEffect(()=>{P&&P.filter(R=>{const N=A||i,B=o&&R.ctrlKey;if(R.button===1&&R.type==="mousedown"&&(pf(R,"react-flow__node")||pf(R,"react-flow__edge")))return!0;if(!d&&!N&&!a&&!u&&!o||E||!u&&R.type==="dblclick"||pf(R,g)&&R.type==="wheel"||pf(R,v)&&R.type!=="wheel"||!o&&R.ctrlKey&&R.type==="wheel"||!N&&!a&&!B&&R.type==="wheel"||!d&&(R.type==="mousedown"||R.type==="touchstart")||Array.isArray(d)&&!d.includes(R.button)&&(R.type==="mousedown"||R.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(R.button)||!R.button||R.button<=1;return(!R.ctrlKey||R.type==="wheel")&&U})},[E,P,i,o,a,u,d,c,A]),W.jsx("div",{className:"react-flow__renderer",ref:k,style:gA,children:y})},d_e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function f_e(){const{userSelectionActive:e,userSelectionRect:t}=_r(d_e,Oo);return e&&t?W.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function k9(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(r>0||i>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),i>0&&(n.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);n.position.x=n.position.x-o,n.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);n.position.y=n.position.y-o,n.style.height+=o,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function wV(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(s=>s.id===i.id);if(o.length===0)return r.push(i),r;const a={...i};for(const s of o)if(s)switch(s.type){case"select":{a.selected=s.selected;break}case"position":{typeof s.position<"u"&&(a.position=s.position),typeof s.positionAbsolute<"u"&&(a.positionAbsolute=s.positionAbsolute),typeof s.dragging<"u"&&(a.dragging=s.dragging),a.expandParent&&k9(r,a);break}case"dimensions":{typeof s.dimensions<"u"&&(a.width=s.dimensions.width,a.height=s.dimensions.height),typeof s.updateStyle<"u"&&(a.style={...a.style||{},...s.dimensions}),typeof s.resizing=="boolean"&&(a.resizing=s.resizing),a.expandParent&&k9(r,a);break}case"remove":return r}return r.push(a),r},n)}function Gc(e,t){return wV(e,t)}function Nc(e,t){return wV(e,t)}const Su=(e,t)=>({id:e,type:"select",selected:t});function jf(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Su(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Su(r.id,!1))),n},[])}const zC=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},h_e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),CV=I.memo(({isSelecting:e,selectionMode:t=uc.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:a,onPaneScroll:s,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=I.useRef(null),h=pi(),p=I.useRef(0),m=I.useRef(0),_=I.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:g}=_r(h_e,Oo),v=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},S=O=>{o==null||o(O),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},w=O=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){O.preventDefault();return}a==null||a(O)},x=s?O=>s(O):void 0,C=O=>{const{resetSelectedElements:E,domNode:A}=h.getState();if(_.current=A==null?void 0:A.getBoundingClientRect(),!y||!e||O.button!==0||O.target!==f.current||!_.current)return;const{x:D,y:L}=Yu(O,_.current);E(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:L,x:D,y:L}}),r==null||r(O)},k=O=>{const{userSelectionRect:E,nodeInternals:A,edges:D,transform:L,onNodesChange:M,onEdgesChange:R,nodeOrigin:N,getNodes:B}=h.getState();if(!e||!_.current||!E)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=Yu(O,_.current),G=E.startX??0,Z=E.startY??0,ee={...E,x:U.x<G?U.x:G,y:U.y<Z?U.y:Z,width:Math.abs(U.x-G),height:Math.abs(U.y-Z)},J=B(),j=oV(A,ee,L,t===uc.Partial,!0,N),Q=fA(j,D).map(se=>se.id),ne=j.map(se=>se.id);if(p.current!==ne.length){p.current=ne.length;const se=jf(J,ne);se.length&&(M==null||M(se))}if(m.current!==Q.length){m.current=Q.length;const se=jf(D,Q);se.length&&(R==null||R(se))}h.setState({userSelectionRect:ee})},T=O=>{if(O.button!==0)return;const{userSelectionRect:E}=h.getState();!b&&E&&O.target===f.current&&(S==null||S(O)),h.setState({nodesSelectionActive:p.current>0}),v(),i==null||i(O)},P=O=>{b&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(O)),v()},$=y&&(e||b);return W.jsxs("div",{className:Aa(["react-flow__pane",{dragging:g,selection:e}]),onClick:$?void 0:zC(S,f),onContextMenu:zC(w,f),onWheel:zC(x,f),onMouseEnter:$?void 0:l,onMouseDown:$?C:void 0,onMouseMove:$?k:u,onMouseUp:$?T:void 0,onMouseLeave:$?P:c,ref:f,style:gA,children:[d,W.jsx(f_e,{})]})});CV.displayName="Pane";function EV(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:EV(n,t):!1}function A9(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function p_e(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!EV(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,a;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((a=i.positionAbsolute)==null?void 0:a.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height}})}function g_e(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function TV(e,t,n,r,i=[0,0],o){const a=g_e(e,e.extent||r);let s=a;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const c=n.get(e.parentNode),{x:d,y:f}=yh(c,i).positionAbsolute;s=c&&_a(d)&&_a(f)&&_a(c.width)&&_a(c.height)?[[d+e.width*i[0],f+e.height*i[1]],[d+c.width-e.width+e.width*i[0],f+c.height-e.height+e.height*i[1]]]:s}else o==null||o("005",Kl.error005()),s=a;else if(e.extent&&e.parentNode){const c=n.get(e.parentNode),{x:d,y:f}=yh(c,i).positionAbsolute;s=[[e.extent[0][0]+d,e.extent[0][1]+f],[e.extent[1][0]+d,e.extent[1][1]+f]]}let l={x:0,y:0};if(e.parentNode){const c=n.get(e.parentNode);l=yh(c,i).positionAbsolute}const u=s&&s!=="parent"?aA(t,s):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function jC({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const P9=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),a=t.getBoundingClientRect(),s={x:a.width*r[0],y:a.height*r[1]};return o.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-a.left-s.x)/n,y:(u.top-a.top-s.y)/n,...oA(l)}})};function Zp(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function FE({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),u=s.get(e);if(!u){l==null||l("012",Kl.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(o({nodes:[u]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function m_e(){const e=pi();return I.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),a=n.touches?n.touches[0].clientX:n.clientX,s=n.touches?n.touches[0].clientY:n.clientY,l={x:(a-r[0])/r[2],y:(s-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(l.x/i[0]):l.x,ySnapped:o?i[1]*Math.round(l.y/i[1]):l.y,...l}},[])}function UC(e){return(t,n,r)=>e==null?void 0:e(t,r)}function kV({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:a}){const s=pi(),[l,u]=I.useState(!1),c=I.useRef([]),d=I.useRef({x:null,y:null}),f=I.useRef(0),h=I.useRef(null),p=I.useRef({x:0,y:0}),m=I.useRef(null),_=I.useRef(!1),b=m_e();return I.useEffect(()=>{if(e!=null&&e.current){const y=Ka(e.current),g=({x:S,y:w})=>{const{nodeInternals:x,onNodeDrag:C,onSelectionDrag:k,updateNodePositions:T,nodeExtent:P,snapGrid:$,snapToGrid:O,nodeOrigin:E,onError:A}=s.getState();d.current={x:S,y:w};let D=!1,L={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&P){const R=dA(c.current,E);L=g0(R)}if(c.current=c.current.map(R=>{const N={x:S-R.distance.x,y:w-R.distance.y};O&&(N.x=$[0]*Math.round(N.x/$[0]),N.y=$[1]*Math.round(N.y/$[1]));const B=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];c.current.length>1&&P&&!R.extent&&(B[0][0]=R.positionAbsolute.x-L.x+P[0][0],B[1][0]=R.positionAbsolute.x+(R.width??0)-L.x2+P[1][0],B[0][1]=R.positionAbsolute.y-L.y+P[0][1],B[1][1]=R.positionAbsolute.y+(R.height??0)-L.y2+P[1][1]);const U=TV(R,N,x,B,E,A);return D=D||R.position.x!==U.position.x||R.position.y!==U.position.y,R.position=U.position,R.positionAbsolute=U.positionAbsolute,R}),!D)return;T(c.current,!0,!0),u(!0);const M=i?C:UC(k);if(M&&m.current){const[R,N]=jC({nodeId:i,dragItems:c.current,nodeInternals:x});M(m.current,R,N)}},v=()=>{if(!h.current)return;const[S,w]=HU(p.current,h.current);if(S!==0||w!==0){const{transform:x,panBy:C}=s.getState();d.current.x=(d.current.x??0)-S/x[2],d.current.y=(d.current.y??0)-w/x[2],C({x:S,y:w})&&g(d.current)}f.current=requestAnimationFrame(v)};if(t)y.on(".drag",null);else{const S=Eve().on("start",w=>{var D;const{nodeInternals:x,multiSelectionActive:C,domNode:k,nodesDraggable:T,unselectNodesAndEdges:P,onNodeDragStart:$,onSelectionDragStart:O}=s.getState(),E=i?$:UC(O);!a&&!C&&i&&((D=x.get(i))!=null&&D.selected||P()),i&&o&&a&&FE({id:i,store:s,nodeRef:e});const A=b(w);if(d.current=A,c.current=p_e(x,T,A,i),E&&c.current){const[L,M]=jC({nodeId:i,dragItems:c.current,nodeInternals:x});E(w.sourceEvent,L,M)}h.current=(k==null?void 0:k.getBoundingClientRect())||null,p.current=Yu(w.sourceEvent,h.current)}).on("drag",w=>{const x=b(w),{autoPanOnNodeDrag:C}=s.getState();!_.current&&C&&(_.current=!0,v()),(d.current.x!==x.xSnapped||d.current.y!==x.ySnapped)&&c.current&&(m.current=w.sourceEvent,p.current=Yu(w.sourceEvent,h.current),g(x))}).on("end",w=>{if(u(!1),_.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:x,nodeInternals:C,onNodeDragStop:k,onSelectionDragStop:T}=s.getState(),P=i?k:UC(T);if(x(c.current,!1,!1),P){const[$,O]=jC({nodeId:i,dragItems:c.current,nodeInternals:C});P(w.sourceEvent,$,O)}}}).filter(w=>{const x=w.target;return!w.button&&(!n||!A9(x,`.${n}`,e))&&(!r||A9(x,r,e))});return y.call(S),()=>{y.on(".drag",null)}}}},[e,t,n,r,o,s,i,a,b]),l}function AV(){const e=pi();return I.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:a,snapToGrid:s,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=a().filter(y=>y.selected&&(y.draggable||c&&typeof y.draggable>"u")),f=s?l[0]:5,h=s?l[1]:5,p=n.isShiftPressed?4:1,m=n.x*f*p,_=n.y*h*p,b=d.map(y=>{if(y.positionAbsolute){const g={x:y.positionAbsolute.x+m,y:y.positionAbsolute.y+_};s&&(g.x=l[0]*Math.round(g.x/l[0]),g.y=l[1]*Math.round(g.y/l[1]));const{positionAbsolute:v,position:S}=TV(y,g,r,i,void 0,u);y.position=S,y.positionAbsolute=v}return y});o(b,!0,!1)},[])}const vh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Jp=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:a,xPosOrigin:s,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:p,onDoubleClick:m,style:_,className:b,isDraggable:y,isSelectable:g,isConnectable:v,isFocusable:S,selectNodesOnDrag:w,sourcePosition:x,targetPosition:C,hidden:k,resizeObserver:T,dragHandle:P,zIndex:$,isParent:O,noDragClassName:E,noPanClassName:A,initialized:D,disableKeyboardA11y:L,ariaLabel:M,rfId:R})=>{const N=pi(),B=I.useRef(null),U=I.useRef(x),G=I.useRef(C),Z=I.useRef(r),ee=g||y||c||d||f||h,J=AV(),j=Zp(n,N.getState,d),Q=Zp(n,N.getState,f),ne=Zp(n,N.getState,h),se=Zp(n,N.getState,p),ye=Zp(n,N.getState,m),ce=ze=>{if(g&&(!w||!y)&&FE({id:n,store:N,nodeRef:B}),c){const mt=N.getState().nodeInternals.get(n);mt&&c(ze,{...mt})}},bt=ze=>{if(!NE(ze))if(XU.includes(ze.key)&&g){const mt=ze.key==="Escape";FE({id:n,store:N,unselect:mt,nodeRef:B})}else!L&&y&&u&&Object.prototype.hasOwnProperty.call(vh,ze.key)&&(N.setState({ariaLiveMessage:`Moved selected node ${ze.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~a}`}),J({x:vh[ze.key].x,y:vh[ze.key].y,isShiftPressed:ze.shiftKey}))};I.useEffect(()=>{if(B.current&&!k){const ze=B.current;return T==null||T.observe(ze),()=>T==null?void 0:T.unobserve(ze)}},[k]),I.useEffect(()=>{const ze=Z.current!==r,mt=U.current!==x,Pe=G.current!==C;B.current&&(ze||mt||Pe)&&(ze&&(Z.current=r),mt&&(U.current=x),Pe&&(G.current=C),N.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,r,x,C]);const ot=kV({nodeRef:B,disabled:k||!y,noDragClassName:E,handleSelector:P,nodeId:n,isSelectable:g,selectNodesOnDrag:w});return k?null:W.jsx("div",{className:Aa(["react-flow__node",`react-flow__node-${r}`,{[A]:y},b,{selected:u,selectable:g,parent:O,dragging:ot}]),ref:B,style:{zIndex:$,transform:`translate(${s}px,${l}px)`,pointerEvents:ee?"all":"none",visibility:D?"visible":"hidden",..._},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:j,onMouseMove:Q,onMouseLeave:ne,onContextMenu:se,onClick:ce,onDoubleClick:ye,onKeyDown:S?bt:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":L?void 0:`${yV}-${R}`,"aria-label":M,children:W.jsx(Pbe,{value:n,children:W.jsx(e,{id:n,data:i,type:r,xPos:o,yPos:a,selected:u,isConnectable:v,sourcePosition:x,targetPosition:C,dragging:ot,dragHandle:P,zIndex:$})})})};return t.displayName="NodeWrapper",I.memo(t)};const y_e=e=>{const t=e.getNodes().filter(n=>n.selected);return{...dA(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function v_e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=pi(),{width:i,height:o,x:a,y:s,transformString:l,userSelectionActive:u}=_r(y_e,Oo),c=AV(),d=I.useRef(null);if(I.useEffect(()=>{var p;n||(p=d.current)==null||p.focus({preventScroll:!0})},[n]),kV({nodeRef:d}),u||!i||!o)return null;const f=e?p=>{const m=r.getState().getNodes().filter(_=>_.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(vh,p.key)&&c({x:vh[p.key].x,y:vh[p.key].y,isShiftPressed:p.shiftKey})};return W.jsx("div",{className:Aa(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:W.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:o,top:s,left:a}})})}var b_e=I.memo(v_e);const __e=e=>e.nodesSelectionActive,PV=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,deleteKeyCode:s,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:_,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:T,defaultViewport:P,translateExtent:$,minZoom:O,maxZoom:E,preventScrolling:A,onSelectionContextMenu:D,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:R})=>{const N=_r(__e),B=m0(d),G=m0(b)||T,Z=B||f&&G!==!0;return a_e({deleteKeyCode:s,multiSelectionKeyCode:_}),W.jsx(c_e,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:!B&&G,defaultViewport:P,translateExtent:$,minZoom:O,maxZoom:E,zoomActivationKeyCode:y,preventScrolling:A,noWheelClassName:L,noPanClassName:M,children:W.jsxs(CV,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:G,isSelecting:!!Z,selectionMode:h,children:[e,N&&W.jsx(b_e,{onSelectionContextMenu:D,noPanClassName:M,disableKeyboardA11y:R})]})})};PV.displayName="FlowRenderer";var S_e=I.memo(PV);function x_e(e){return _r(I.useCallback(n=>e?oV(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function w_e(e){const t={input:Jp(e.input||hV),default:Jp(e.default||LE),output:Jp(e.output||gV),group:Jp(e.group||pA)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=Jp(e[o]||LE),i),n);return{...t,...r}}const C_e=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},E_e=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),IV=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:a}=_r(E_e,Oo),s=x_e(e.onlyRenderVisibleElements),l=I.useRef(),u=I.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(f)});return l.current=c,c},[]);return I.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),W.jsx("div",{className:"react-flow__nodes",style:gA,children:s.map(c=>{var S,w;let d=c.type||"default";e.nodeTypes[d]||(a==null||a("003",Kl.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),p=!!(c.selectable||i&&typeof c.selectable>"u"),m=!!(c.connectable||n&&typeof c.connectable>"u"),_=!!(c.focusable||r&&typeof c.focusable>"u"),b=e.nodeExtent?aA(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,y=(b==null?void 0:b.x)??0,g=(b==null?void 0:b.y)??0,v=C_e({x:y,y:g,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return W.jsx(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||tt.Bottom,targetPosition:c.targetPosition||tt.Top,hidden:c.hidden,xPos:y,yPos:g,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:p,isConnectable:m,isFocusable:_,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((S=c[Qr])==null?void 0:S.z)??0,isParent:!!((w=c[Qr])!=null&&w.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};IV.displayName="NodeRenderer";var T_e=I.memo(IV);const k_e=(e,t,n)=>n===tt.Left?e-t:n===tt.Right?e+t:e,A_e=(e,t,n)=>n===tt.Top?e-t:n===tt.Bottom?e+t:e,I9="react-flow__edgeupdater",R9=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:s})=>W.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:Aa([I9,`${I9}-${s}`]),cx:k_e(t,r,e),cy:A_e(n,r,e),r,stroke:"transparent",fill:"transparent"}),P_e=()=>!0;var gf=e=>{const t=({id:n,className:r,type:i,data:o,onClick:a,onEdgeDoubleClick:s,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:_,source:b,target:y,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,elementsSelectable:k,hidden:T,sourceHandleId:P,targetHandleId:$,onContextMenu:O,onMouseEnter:E,onMouseMove:A,onMouseLeave:D,edgeUpdaterRadius:L,onEdgeUpdate:M,onEdgeUpdateStart:R,onEdgeUpdateEnd:N,markerEnd:B,markerStart:U,rfId:G,ariaLabel:Z,isFocusable:ee,isUpdatable:J,pathOptions:j,interactionWidth:Q})=>{const ne=I.useRef(null),[se,ye]=I.useState(!1),[ce,bt]=I.useState(!1),ot=pi(),ze=I.useMemo(()=>`url(#${DE(U,G)})`,[U,G]),mt=I.useMemo(()=>`url(#${DE(B,G)})`,[B,G]);if(T)return null;const Pe=Bn=>{const{edges:_n,addSelectedEdges:Mi}=ot.getState();if(k&&(ot.setState({nodesSelectionActive:!1}),Mi([n])),a){const gi=_n.find(Qi=>Qi.id===n);a(Bn,gi)}},en=Yp(n,ot.getState,s),Pr=Yp(n,ot.getState,O),Ln=Yp(n,ot.getState,E),An=Yp(n,ot.getState,A),tn=Yp(n,ot.getState,D),Fn=(Bn,_n)=>{if(Bn.button!==0)return;const{edges:Mi,isValidConnection:gi}=ot.getState(),Qi=_n?y:b,Da=(_n?$:P)||null,Rr=_n?"target":"source",po=gi||P_e,al=_n,Do=Mi.find(nn=>nn.id===n);bt(!0),R==null||R(Bn,Do,Rr);const sl=nn=>{bt(!1),N==null||N(nn,Do,Rr)};uV({event:Bn,handleId:Da,nodeId:Qi,onConnect:nn=>M==null?void 0:M(Do,nn),isTarget:al,getState:ot.getState,setState:ot.setState,isValidConnection:po,edgeUpdaterType:Rr,onEdgeUpdateEnd:sl})},Ir=Bn=>Fn(Bn,!0),ho=Bn=>Fn(Bn,!1),ei=()=>ye(!0),pr=()=>ye(!1),Br=!k&&!a,ti=Bn=>{var _n;if(XU.includes(Bn.key)&&k){const{unselectNodesAndEdges:Mi,addSelectedEdges:gi,edges:Qi}=ot.getState();Bn.key==="Escape"?((_n=ne.current)==null||_n.blur(),Mi({edges:[Qi.find(Rr=>Rr.id===n)]})):gi([n])}};return W.jsxs("g",{className:Aa(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:u,inactive:Br,updating:se}]),onClick:Pe,onDoubleClick:en,onContextMenu:Pr,onMouseEnter:Ln,onMouseMove:An,onMouseLeave:tn,onKeyDown:ee?ti:void 0,tabIndex:ee?0:void 0,role:ee?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Z===null?void 0:Z||`Edge from ${b} to ${y}`,"aria-describedby":ee?`${vV}-${G}`:void 0,ref:ne,children:[!ce&&W.jsx(e,{id:n,source:b,target:y,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,data:o,style:_,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,sourceHandleId:P,targetHandleId:$,markerStart:ze,markerEnd:mt,pathOptions:j,interactionWidth:Q}),J&&W.jsxs(W.Fragment,{children:[(J==="source"||J===!0)&&W.jsx(R9,{position:x,centerX:g,centerY:v,radius:L,onMouseDown:Ir,onMouseEnter:ei,onMouseOut:pr,type:"source"}),(J==="target"||J===!0)&&W.jsx(R9,{position:C,centerX:S,centerY:w,radius:L,onMouseDown:ho,onMouseEnter:ei,onMouseOut:pr,type:"target"})]})]})};return t.displayName="EdgeWrapper",I.memo(t)};function I_e(e){const t={default:gf(e.default||N_),straight:gf(e.bezier||uA),step:gf(e.step||lA),smoothstep:gf(e.step||Y2),simplebezier:gf(e.simplebezier||sA)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=gf(e[o]||N_),i),n);return{...t,...r}}function O9(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,a=(n==null?void 0:n.height)||t.height;switch(e){case tt.Top:return{x:r+o/2,y:i};case tt.Right:return{x:r+o,y:i+a/2};case tt.Bottom:return{x:r+o/2,y:i+a};case tt.Left:return{x:r,y:i+a/2}}}function M9(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const R_e=(e,t,n,r,i,o)=>{const a=O9(n,e,t),s=O9(o,r,i);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}};function O_e({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:a,height:s,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=g0({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/l[2],height:s/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function N9(e){var r,i,o,a,s;const t=((r=e==null?void 0:e[Qr])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)||0,y:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const M_e=[{level:0,isMaxLevel:!0,edges:[]}];function N_e(e,t,n=!1){let r=-1;const i=e.reduce((a,s)=>{var c,d;const l=_a(s.zIndex);let u=l?s.zIndex:0;if(n){const f=t.get(s.target),h=t.get(s.source),p=s.selected||(f==null?void 0:f.selected)||(h==null?void 0:h.selected),m=Math.max(((c=h==null?void 0:h[Qr])==null?void 0:c.z)||0,((d=f==null?void 0:f[Qr])==null?void 0:d.z)||0,1e3);u=(l?s.zIndex:0)+(p?m:0)}return a[u]?a[u].push(s):a[u]=[s],r=u>r?u:r,a},{}),o=Object.entries(i).map(([a,s])=>{const l=+a;return{edges:s,level:l,isMaxLevel:l===r}});return o.length===0?M_e:o}function $_e(e,t,n){const r=_r(I.useCallback(i=>e?i.edges.filter(o=>{const a=t.get(o.source),s=t.get(o.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&O_e({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:s.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:s.width,targetHeight:s.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return N_e(r,t,n)}const D_e=({color:e="none",strokeWidth:t=1})=>W.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),L_e=({color:e="none",strokeWidth:t=1})=>W.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),$9={[M_.Arrow]:D_e,[M_.ArrowClosed]:L_e};function F_e(e){const t=pi();return I.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call($9,e)?$9[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Kl.error009(e)),null)},[e])}const B_e=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:s="auto-start-reverse"})=>{const l=F_e(t);return l?W.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:s,refX:"0",refY:"0",children:W.jsx(l,{color:n,strokeWidth:a})}):null},z_e=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const s=DE(a,t);r.includes(s)||(i.push({id:s,color:a.color||e,...a}),r.push(s))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},RV=({defaultColor:e,rfId:t})=>{const n=_r(I.useCallback(z_e({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,a)=>o.id!==i[a].id)));return W.jsx("defs",{children:n.map(r=>W.jsx(B_e,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};RV.displayName="MarkerDefinitions";var j_e=I.memo(RV);const U_e=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),OV=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,children:_})=>{const{edgesFocusable:b,edgesUpdatable:y,elementsSelectable:g,width:v,height:S,connectionMode:w,nodeInternals:x,onError:C}=_r(U_e,Oo),k=$_e(t,x,n);return v?W.jsxs(W.Fragment,{children:[k.map(({level:T,edges:P,isMaxLevel:$})=>W.jsxs("svg",{style:{zIndex:T},width:v,height:S,className:"react-flow__edges react-flow__container",children:[$&&W.jsx(j_e,{defaultColor:e,rfId:r}),W.jsx("g",{children:P.map(O=>{const[E,A,D]=N9(x.get(O.source)),[L,M,R]=N9(x.get(O.target));if(!D||!R)return null;let N=O.type||"default";i[N]||(C==null||C("011",Kl.error011(N)),N="default");const B=i[N]||i.default,U=w===Dd.Strict?M.target:(M.target??[]).concat(M.source??[]),G=M9(A.source,O.sourceHandle),Z=M9(U,O.targetHandle),ee=(G==null?void 0:G.position)||tt.Bottom,J=(Z==null?void 0:Z.position)||tt.Top,j=!!(O.focusable||b&&typeof O.focusable>"u"),Q=typeof a<"u"&&(O.updatable||y&&typeof O.updatable>"u");if(!G||!Z)return C==null||C("008",Kl.error008(G,O)),null;const{sourceX:ne,sourceY:se,targetX:ye,targetY:ce}=R_e(E,G,ee,L,Z,J);return W.jsx(B,{id:O.id,className:Aa([O.className,o]),type:N,data:O.data,selected:!!O.selected,animated:!!O.animated,hidden:!!O.hidden,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,style:O.style,source:O.source,target:O.target,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerEnd:O.markerEnd,markerStart:O.markerStart,sourceX:ne,sourceY:se,targetX:ye,targetY:ce,sourcePosition:ee,targetPosition:J,elementsSelectable:g,onEdgeUpdate:a,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,rfId:r,ariaLabel:O.ariaLabel,isFocusable:j,isUpdatable:Q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth},O.id)})})]},T)),_]}):null};OV.displayName="EdgeRenderer";var V_e=I.memo(OV);const G_e=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function q_e({children:e}){const t=_r(G_e);return W.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function H_e(e){const t=xV(),n=I.useRef(!1);I.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const W_e={[tt.Left]:tt.Right,[tt.Right]:tt.Left,[tt.Top]:tt.Bottom,[tt.Bottom]:tt.Top},MV=({nodeId:e,handleType:t,style:n,type:r=Au.Bezier,CustomComponent:i,connectionStatus:o})=>{var w,x,C;const{fromNode:a,handleId:s,toX:l,toY:u,connectionMode:c}=_r(I.useCallback(k=>({fromNode:k.nodeInternals.get(e),handleId:k.connectionHandleId,toX:(k.connectionPosition.x-k.transform[0])/k.transform[2],toY:(k.connectionPosition.y-k.transform[1])/k.transform[2],connectionMode:k.connectionMode}),[e]),Oo),d=(w=a==null?void 0:a[Qr])==null?void 0:w.handleBounds;let f=d==null?void 0:d[t];if(c===Dd.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!a||!f)return null;const h=s?f.find(k=>k.id===s):f[0],p=h?h.x+h.width/2:(a.width??0)/2,m=h?h.y+h.height/2:a.height??0,_=(((x=a.positionAbsolute)==null?void 0:x.x)??0)+p,b=(((C=a.positionAbsolute)==null?void 0:C.y)??0)+m,y=h==null?void 0:h.position,g=y?W_e[y]:null;if(!y||!g)return null;if(i)return W.jsx(i,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:h,fromX:_,fromY:b,toX:l,toY:u,fromPosition:y,toPosition:g,connectionStatus:o});let v="";const S={sourceX:_,sourceY:b,sourcePosition:y,targetX:l,targetY:u,targetPosition:g};return r===Au.Bezier?[v]=tV(S):r===Au.Step?[v]=$E({...S,borderRadius:0}):r===Au.SmoothStep?[v]=$E(S):r===Au.SimpleBezier?[v]=eV(S):v=`M${_},${b} ${l},${u}`,W.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};MV.displayName="ConnectionLine";const K_e=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Q_e({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:a,width:s,height:l,connectionStatus:u}=_r(K_e,Oo);return!(i&&o&&s&&a)?null:W.jsx("svg",{style:e,width:s,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:W.jsx("g",{className:Aa(["react-flow__connection",u]),children:W.jsx(MV,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}function D9(e,t){return I.useRef(null),pi(),I.useMemo(()=>t(e),[e])}const NV=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:_,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:g,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:$,elementsSelectable:O,selectNodesOnDrag:E,defaultViewport:A,translateExtent:D,minZoom:L,maxZoom:M,preventScrolling:R,defaultMarkerColor:N,zoomOnScroll:B,zoomOnPinch:U,panOnScroll:G,panOnScrollSpeed:Z,panOnScrollMode:ee,zoomOnDoubleClick:J,panOnDrag:j,onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ye,onPaneScroll:ce,onPaneContextMenu:bt,onEdgeUpdate:ot,onEdgeContextMenu:ze,onEdgeMouseEnter:mt,onEdgeMouseMove:Pe,onEdgeMouseLeave:en,edgeUpdaterRadius:Pr,onEdgeUpdateStart:Ln,onEdgeUpdateEnd:An,noDragClassName:tn,noWheelClassName:Fn,noPanClassName:Ir,elevateEdgesOnSelect:ho,disableKeyboardA11y:ei,nodeOrigin:pr,nodeExtent:Br,rfId:ti})=>{const Bn=D9(e,w_e),_n=D9(t,I_e);return H_e(o),W.jsx(S_e,{onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ye,onPaneContextMenu:bt,onPaneScroll:ce,deleteKeyCode:P,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,onSelectionStart:m,onSelectionEnd:_,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:T,elementsSelectable:O,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:B,zoomOnPinch:U,zoomOnDoubleClick:J,panOnScroll:G,panOnScrollSpeed:Z,panOnScrollMode:ee,panOnDrag:j,defaultViewport:A,translateExtent:D,minZoom:L,maxZoom:M,onSelectionContextMenu:p,preventScrolling:R,noDragClassName:tn,noWheelClassName:Fn,noPanClassName:Ir,disableKeyboardA11y:ei,children:W.jsxs(q_e,{children:[W.jsx(V_e,{edgeTypes:_n,onEdgeClick:s,onEdgeDoubleClick:u,onEdgeUpdate:ot,onlyRenderVisibleElements:$,onEdgeContextMenu:ze,onEdgeMouseEnter:mt,onEdgeMouseMove:Pe,onEdgeMouseLeave:en,onEdgeUpdateStart:Ln,onEdgeUpdateEnd:An,edgeUpdaterRadius:Pr,defaultMarkerColor:N,noPanClassName:Ir,elevateEdgesOnSelect:!!ho,disableKeyboardA11y:ei,rfId:ti,children:W.jsx(Q_e,{style:y,type:b,component:g,containerStyle:v})}),W.jsx("div",{className:"react-flow__edgelabel-renderer"}),W.jsx(T_e,{nodeTypes:Bn,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:E,onlyRenderVisibleElements:$,noPanClassName:Ir,noDragClassName:tn,disableKeyboardA11y:ei,nodeOrigin:pr,nodeExtent:Br,rfId:ti})]})})};NV.displayName="GraphView";var X_e=I.memo(NV);const BE=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],du={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:BE,nodeExtent:BE,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Dd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:wbe,isValidConnection:void 0},Y_e=()=>L0e((e,t)=>({...du,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:BC(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",a=i?BC(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:a,fitViewOnInitOptions:s,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((m,_)=>{const b=i.get(_.id);if(b){const y=oA(_.nodeElement);!!(y.width&&y.height&&(b.width!==y.width||b.height!==y.height||_.forceUpdate))&&(i.set(b.id,{...b,[Qr]:{...b[Qr],handleBounds:{source:P9(".source",_.nodeElement,f,u),target:P9(".target",_.nodeElement,f,u)}},...y}),m.push({id:b.id,type:"dimensions",dimensions:y}))}return m},[]);_V(i,u);const p=a||o&&!a&&SV(t,{initial:!0,...s});e({nodeInternals:new Map(i),fitViewOnInitDone:p}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),a=n.map(s=>{const l={id:s.id,type:"position",dragging:i};return r&&(l.positionAbsolute=s.positionAbsolute,l.position=s.position),l});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(o){const u=Gc(n,s()),c=BC(u,i,a,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Su(l,!0)):(a=jf(o(),n),s=jf(i,[])),$v({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Su(l,!0)):(a=jf(i,n),s=jf(o(),[])),$v({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),a=n||o(),s=r||i,l=a.map(c=>(c.selected=!1,Su(c.id,!1))),u=s.map(c=>Su(c.id,!1));$v({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(s=>s.selected).map(s=>Su(s.id,!1)),a=n.filter(s=>s.selected).map(s=>Su(s.id,!1));$v({changedNodes:o,changedEdges:a,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=aA(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:a,d3Selection:s,translateExtent:l}=t();if(!a||!s||!n.x&&!n.y)return!1;const u=Xu.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[i,o]],d=a==null?void 0:a.constrain()(u,c,l);return a.transform(s,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:du.connectionNodeId,connectionHandleId:du.connectionHandleId,connectionHandleType:du.connectionHandleType,connectionStatus:du.connectionStatus,connectionStartHandle:du.connectionStartHandle,connectionEndHandle:du.connectionEndHandle}),reset:()=>e({...du})}),Object.is),$V=({children:e})=>{const t=I.useRef(null);return t.current||(t.current=Y_e()),W.jsx(mbe,{value:t.current,children:e})};$V.displayName="ReactFlowProvider";const DV=({children:e})=>I.useContext(X2)?W.jsx(W.Fragment,{children:e}):W.jsx($V,{children:e});DV.displayName="ReactFlowWrapper";const Z_e={input:hV,default:LE,output:gV,group:pA},J_e={default:N_,straight:uA,step:lA,smoothstep:Y2,simplebezier:sA},eSe=[0,0],tSe=[15,15],nSe={x:0,y:0,zoom:1},rSe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},iSe=I.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=Z_e,edgeTypes:a=J_e,onNodeClick:s,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:k,onNodesDelete:T,onEdgesDelete:P,onSelectionChange:$,onSelectionDragStart:O,onSelectionDrag:E,onSelectionDragStop:A,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:M,connectionMode:R=Dd.Strict,connectionLineType:N=Au.Bezier,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,deleteKeyCode:Z="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:J=!1,selectionMode:j=uc.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:ne=O_()?"Meta":"Control",zoomActivationKeyCode:se=O_()?"Meta":"Control",snapToGrid:ye=!1,snapGrid:ce=tSe,onlyRenderVisibleElements:bt=!1,selectNodesOnDrag:ot=!0,nodesDraggable:ze,nodesConnectable:mt,nodesFocusable:Pe,nodeOrigin:en=eSe,edgesFocusable:Pr,edgesUpdatable:Ln,elementsSelectable:An,defaultViewport:tn=nSe,minZoom:Fn=.5,maxZoom:Ir=2,translateExtent:ho=BE,preventScrolling:ei=!0,nodeExtent:pr,defaultMarkerColor:Br="#b1b1b7",zoomOnScroll:ti=!0,zoomOnPinch:Bn=!0,panOnScroll:_n=!1,panOnScrollSpeed:Mi=.5,panOnScrollMode:gi=sd.Free,zoomOnDoubleClick:Qi=!0,panOnDrag:Da=!0,onPaneClick:Rr,onPaneMouseEnter:po,onPaneMouseMove:al,onPaneMouseLeave:Do,onPaneScroll:sl,onPaneContextMenu:zn,children:nn,onEdgeUpdate:zr,onEdgeContextMenu:Or,onEdgeDoubleClick:Mr,onEdgeMouseEnter:ni,onEdgeMouseMove:Ni,onEdgeMouseLeave:go,onEdgeUpdateStart:mi,onEdgeUpdateEnd:jr,edgeUpdaterRadius:La=10,onNodesChange:gs,onEdgesChange:yi,noDragClassName:ou="nodrag",noWheelClassName:oa="nowheel",noPanClassName:ri="nopan",fitView:ll=!1,fitViewOptions:H,connectOnClick:te=!0,attributionPosition:re,proOptions:de,defaultEdgeOptions:oe,elevateNodesOnSelect:je=!0,elevateEdgesOnSelect:Ge=!1,disableKeyboardA11y:ut=!1,autoPanOnConnect:$e=!0,autoPanOnNodeDrag:qe=!0,connectionRadius:Ie=20,isValidConnection:ie,onError:Se,style:Ye,id:Ze,...ct},dt)=>{const _t=Ze||"1";return W.jsx("div",{...ct,style:{...Ye,...rSe},ref:dt,className:Aa(["react-flow",i]),"data-testid":"rf__wrapper",id:Ze,children:W.jsxs(DV,{children:[W.jsx(X_e,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:s,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,nodeTypes:o,edgeTypes:a,connectionLineType:N,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,selectionKeyCode:ee,selectionOnDrag:J,selectionMode:j,deleteKeyCode:Z,multiSelectionKeyCode:ne,panActivationKeyCode:Q,zoomActivationKeyCode:se,onlyRenderVisibleElements:bt,selectNodesOnDrag:ot,defaultViewport:tn,translateExtent:ho,minZoom:Fn,maxZoom:Ir,preventScrolling:ei,zoomOnScroll:ti,zoomOnPinch:Bn,zoomOnDoubleClick:Qi,panOnScroll:_n,panOnScrollSpeed:Mi,panOnScrollMode:gi,panOnDrag:Da,onPaneClick:Rr,onPaneMouseEnter:po,onPaneMouseMove:al,onPaneMouseLeave:Do,onPaneScroll:sl,onPaneContextMenu:zn,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:M,onEdgeUpdate:zr,onEdgeContextMenu:Or,onEdgeDoubleClick:Mr,onEdgeMouseEnter:ni,onEdgeMouseMove:Ni,onEdgeMouseLeave:go,onEdgeUpdateStart:mi,onEdgeUpdateEnd:jr,edgeUpdaterRadius:La,defaultMarkerColor:Br,noDragClassName:ou,noWheelClassName:oa,noPanClassName:ri,elevateEdgesOnSelect:Ge,rfId:_t,disableKeyboardA11y:ut,nodeOrigin:en,nodeExtent:pr}),W.jsx(Kbe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:b,nodesDraggable:ze,nodesConnectable:mt,nodesFocusable:Pe,edgesFocusable:Pr,edgesUpdatable:Ln,elementsSelectable:An,elevateNodesOnSelect:je,minZoom:Fn,maxZoom:Ir,nodeExtent:pr,onNodesChange:gs,onEdgesChange:yi,snapToGrid:ye,snapGrid:ce,connectionMode:R,translateExtent:ho,connectOnClick:te,defaultEdgeOptions:oe,fitView:ll,fitViewOptions:H,onNodesDelete:T,onEdgesDelete:P,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:k,onSelectionDrag:E,onSelectionDragStart:O,onSelectionDragStop:A,noPanClassName:ri,nodeOrigin:en,rfId:_t,autoPanOnConnect:$e,autoPanOnNodeDrag:qe,onError:Se,connectionRadius:Ie,isValidConnection:ie}),W.jsx(Hbe,{onSelectionChange:$}),nn,W.jsx(bbe,{proOptions:de,position:re}),W.jsx(Jbe,{rfId:_t,disableKeyboardA11y:ut})]})})});iSe.displayName="ReactFlow";const oSe=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Nqe({children:e}){const t=_r(oSe);return t?Vo.createPortal(e,t):null}function $qe(){const e=pi();return I.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((a,s)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${s}"]`);return l&&a.push({id:s,nodeElement:l,forceUpdate:!0}),a},[]);requestAnimationFrame(()=>r(o))},[])}function aSe(){const e=[];return function(t,n){if(typeof n!="object"||n===null)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}const y0=jb("nodes/receivedOpenAPISchema",async(e,{rejectWithValue:t})=>{try{const n=[window.location.origin,"openapi.json"].join("/"),i=await(await fetch(n)).json();return JSON.parse(JSON.stringify(i,aSe()))}catch(n){return t({error:n})}});let Lv;const sSe=new Uint8Array(16);function lSe(){if(!Lv&&(Lv=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lv))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lv(sSe)}const xi=[];for(let e=0;e<256;++e)xi.push((e+256).toString(16).slice(1));function uSe(e,t=0){return(xi[e[t+0]]+xi[e[t+1]]+xi[e[t+2]]+xi[e[t+3]]+"-"+xi[e[t+4]]+xi[e[t+5]]+"-"+xi[e[t+6]]+xi[e[t+7]]+"-"+xi[e[t+8]]+xi[e[t+9]]+"-"+xi[e[t+10]]+xi[e[t+11]]+xi[e[t+12]]+xi[e[t+13]]+xi[e[t+14]]+xi[e[t+15]]).toLowerCase()}const cSe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),L9={randomUUID:cSe};function LV(e,t,n){if(L9.randomUUID&&!t&&!e)return L9.randomUUID();e=e||{};const r=e.random||(e.rng||lSe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return uSe(r)}const Dqe=500,Lqe=320,dSe="node-drag-handle",Fqe=["ImageField","ImageCollection"],Bqe={input:"inputs",output:"outputs"},Fv=["Collection","IntegerCollection","BooleanCollection","FloatCollection","StringCollection","ImageCollection","LatentsCollection","ConditioningCollection","ControlCollection","ColorCollection","T2IAdapterCollection","IPAdapterCollection"],Cg=["IntegerPolymorphic","BooleanPolymorphic","FloatPolymorphic","StringPolymorphic","ImagePolymorphic","LatentsPolymorphic","ConditioningPolymorphic","ControlPolymorphic","ColorPolymorphic","T2IAdapterPolymorphic","IPAdapterPolymorphic"],zqe=["IPAdapterModelField","ControlNetModelField","LoRAModelField","MainModelField","ONNXModelField","SDXLMainModelField","SDXLRefinerModelField","VaeModelField","UNetField","VaeField","ClipField","T2IAdapterModelField","IPAdapterModelField"],mA={integer:"IntegerCollection",boolean:"BooleanCollection",number:"FloatCollection",float:"FloatCollection",string:"StringCollection",ImageField:"ImageCollection",LatentsField:"LatentsCollection",ConditioningField:"ConditioningCollection",ControlField:"ControlCollection",ColorField:"ColorCollection",T2IAdapterField:"T2IAdapterCollection",IPAdapterField:"IPAdapterCollection"},fSe=e=>!!(e&&e in mA),FV={integer:"IntegerPolymorphic",boolean:"BooleanPolymorphic",number:"FloatPolymorphic",float:"FloatPolymorphic",string:"StringPolymorphic",ImageField:"ImagePolymorphic",LatentsField:"LatentsPolymorphic",ConditioningField:"ConditioningPolymorphic",ControlField:"ControlPolymorphic",ColorField:"ColorPolymorphic",T2IAdapterField:"T2IAdapterPolymorphic",IPAdapterField:"IPAdapterPolymorphic"},hSe={IntegerPolymorphic:"integer",BooleanPolymorphic:"boolean",FloatPolymorphic:"float",StringPolymorphic:"string",ImagePolymorphic:"ImageField",LatentsPolymorphic:"LatentsField",ConditioningPolymorphic:"ConditioningField",ControlPolymorphic:"ControlField",ColorPolymorphic:"ColorField",T2IAdapterPolymorphic:"T2IAdapterField",IPAdapterPolymorphic:"IPAdapterField"},jqe=["string","StringPolymorphic","boolean","BooleanPolymorphic","integer","float","FloatPolymorphic","IntegerPolymorphic","enum","ImageField","ImagePolymorphic","MainModelField","SDXLRefinerModelField","VaeModelField","LoRAModelField","ControlNetModelField","ColorField","SDXLMainModelField","Scheduler","IPAdapterModelField","BoardField","T2IAdapterModelField"],pSe=e=>!!(e&&e in FV),Uqe={boolean:{color:"green.500",description:Y("nodes.booleanDescription"),title:Y("nodes.boolean")},BooleanCollection:{color:"green.500",description:Y("nodes.booleanCollectionDescription"),title:Y("nodes.booleanCollection")},BooleanPolymorphic:{color:"green.500",description:Y("nodes.booleanPolymorphicDescription"),title:Y("nodes.booleanPolymorphic")},ClipField:{color:"green.500",description:Y("nodes.clipFieldDescription"),title:Y("nodes.clipField")},Collection:{color:"base.500",description:Y("nodes.collectionDescription"),title:Y("nodes.collection")},CollectionItem:{color:"base.500",description:Y("nodes.collectionItemDescription"),title:Y("nodes.collectionItem")},ColorCollection:{color:"pink.300",description:Y("nodes.colorCollectionDescription"),title:Y("nodes.colorCollection")},ColorField:{color:"pink.300",description:Y("nodes.colorFieldDescription"),title:Y("nodes.colorField")},ColorPolymorphic:{color:"pink.300",description:Y("nodes.colorPolymorphicDescription"),title:Y("nodes.colorPolymorphic")},ConditioningCollection:{color:"cyan.500",description:Y("nodes.conditioningCollectionDescription"),title:Y("nodes.conditioningCollection")},ConditioningField:{color:"cyan.500",description:Y("nodes.conditioningFieldDescription"),title:Y("nodes.conditioningField")},ConditioningPolymorphic:{color:"cyan.500",description:Y("nodes.conditioningPolymorphicDescription"),title:Y("nodes.conditioningPolymorphic")},ControlCollection:{color:"teal.500",description:Y("nodes.controlCollectionDescription"),title:Y("nodes.controlCollection")},ControlField:{color:"teal.500",description:Y("nodes.controlFieldDescription"),title:Y("nodes.controlField")},ControlNetModelField:{color:"teal.500",description:"TODO",title:"ControlNet"},ControlPolymorphic:{color:"teal.500",description:"Control info passed between nodes.",title:"Control Polymorphic"},DenoiseMaskField:{color:"blue.300",description:Y("nodes.denoiseMaskFieldDescription"),title:Y("nodes.denoiseMaskField")},enum:{color:"blue.500",description:Y("nodes.enumDescription"),title:Y("nodes.enum")},float:{color:"orange.500",description:Y("nodes.floatDescription"),title:Y("nodes.float")},FloatCollection:{color:"orange.500",description:Y("nodes.floatCollectionDescription"),title:Y("nodes.floatCollection")},FloatPolymorphic:{color:"orange.500",description:Y("nodes.floatPolymorphicDescription"),title:Y("nodes.floatPolymorphic")},ImageCollection:{color:"purple.500",description:Y("nodes.imageCollectionDescription"),title:Y("nodes.imageCollection")},ImageField:{color:"purple.500",description:Y("nodes.imageFieldDescription"),title:Y("nodes.imageField")},BoardField:{color:"purple.500",description:Y("nodes.imageFieldDescription"),title:Y("nodes.imageField")},ImagePolymorphic:{color:"purple.500",description:Y("nodes.imagePolymorphicDescription"),title:Y("nodes.imagePolymorphic")},integer:{color:"red.500",description:Y("nodes.integerDescription"),title:Y("nodes.integer")},IntegerCollection:{color:"red.500",description:Y("nodes.integerCollectionDescription"),title:Y("nodes.integerCollection")},IntegerPolymorphic:{color:"red.500",description:Y("nodes.integerPolymorphicDescription"),title:Y("nodes.integerPolymorphic")},IPAdapterCollection:{color:"teal.500",description:Y("nodes.ipAdapterCollectionDescription"),title:Y("nodes.ipAdapterCollection")},IPAdapterField:{color:"teal.500",description:Y("nodes.ipAdapterDescription"),title:Y("nodes.ipAdapter")},IPAdapterModelField:{color:"teal.500",description:Y("nodes.ipAdapterModelDescription"),title:Y("nodes.ipAdapterModel")},IPAdapterPolymorphic:{color:"teal.500",description:Y("nodes.ipAdapterPolymorphicDescription"),title:Y("nodes.ipAdapterPolymorphic")},LatentsCollection:{color:"pink.500",description:Y("nodes.latentsCollectionDescription"),title:Y("nodes.latentsCollection")},LatentsField:{color:"pink.500",description:Y("nodes.latentsFieldDescription"),title:Y("nodes.latentsField")},LatentsPolymorphic:{color:"pink.500",description:Y("nodes.latentsPolymorphicDescription"),title:Y("nodes.latentsPolymorphic")},LoRAModelField:{color:"teal.500",description:Y("nodes.loRAModelFieldDescription"),title:Y("nodes.loRAModelField")},MainModelField:{color:"teal.500",description:Y("nodes.mainModelFieldDescription"),title:Y("nodes.mainModelField")},ONNXModelField:{color:"teal.500",description:Y("nodes.oNNXModelFieldDescription"),title:Y("nodes.oNNXModelField")},Scheduler:{color:"base.500",description:Y("nodes.schedulerDescription"),title:Y("nodes.scheduler")},SDXLMainModelField:{color:"teal.500",description:Y("nodes.sDXLMainModelFieldDescription"),title:Y("nodes.sDXLMainModelField")},SDXLRefinerModelField:{color:"teal.500",description:Y("nodes.sDXLRefinerModelFieldDescription"),title:Y("nodes.sDXLRefinerModelField")},string:{color:"yellow.500",description:Y("nodes.stringDescription"),title:Y("nodes.string")},StringCollection:{color:"yellow.500",description:Y("nodes.stringCollectionDescription"),title:Y("nodes.stringCollection")},StringPolymorphic:{color:"yellow.500",description:Y("nodes.stringPolymorphicDescription"),title:Y("nodes.stringPolymorphic")},T2IAdapterCollection:{color:"teal.500",description:Y("nodes.t2iAdapterCollectionDescription"),title:Y("nodes.t2iAdapterCollection")},T2IAdapterField:{color:"teal.500",description:Y("nodes.t2iAdapterFieldDescription"),title:Y("nodes.t2iAdapterField")},T2IAdapterModelField:{color:"teal.500",description:"TODO",title:"T2I-Adapter"},T2IAdapterPolymorphic:{color:"teal.500",description:"T2I-Adapter info passed between nodes.",title:"T2I-Adapter Polymorphic"},UNetField:{color:"red.500",description:Y("nodes.uNetFieldDescription"),title:Y("nodes.uNetField")},VaeField:{color:"blue.500",description:Y("nodes.vaeFieldDescription"),title:Y("nodes.vaeField")},VaeModelField:{color:"teal.500",description:Y("nodes.vaeModelFieldDescription"),title:Y("nodes.vaeModelField")}},F9=(e,t,n)=>{let r=t,i=n;for(;e.find(o=>o.position.x===r&&o.position.y===i);)r=r+50,i=i+50;return{x:r,y:i}},gSe=(e,t)=>{if(e==="Collection"&&t==="Collection")return!1;if(e===t)return!0;const n=e==="CollectionItem"&&!Fv.includes(t),r=t==="CollectionItem"&&!Fv.includes(e)&&!Cg.includes(e),i=Cg.includes(t)&&(()=>{if(!Cg.includes(t))return!1;const u=hSe[t],c=mA[u];return e===u||e===c})(),o=e==="Collection"&&(Fv.includes(t)||Cg.includes(t)),a=t==="Collection"&&Fv.includes(e);return n||r||i||o||a||e==="integer"&&t==="float"||(e==="integer"||e==="float")&&t==="string"};var mSe="\0",$c="\0",B9="",vo,cd,jo,z0,Ah,Ph,ha,Ts,Iu,ks,Ru,wl,Cl,Ih,Rh,El,Va,j0,zE,zN;let ySe=(zN=class{constructor(t){Zn(this,j0);Zn(this,vo,!0);Zn(this,cd,!1);Zn(this,jo,!1);Zn(this,z0,void 0);Zn(this,Ah,()=>{});Zn(this,Ph,()=>{});Zn(this,ha,{});Zn(this,Ts,{});Zn(this,Iu,{});Zn(this,ks,{});Zn(this,Ru,{});Zn(this,wl,{});Zn(this,Cl,{});Zn(this,Ih,0);Zn(this,Rh,0);Zn(this,El,void 0);Zn(this,Va,void 0);t&&(aa(this,vo,t.hasOwnProperty("directed")?t.directed:!0),aa(this,cd,t.hasOwnProperty("multigraph")?t.multigraph:!1),aa(this,jo,t.hasOwnProperty("compound")?t.compound:!1)),ae(this,jo)&&(aa(this,El,{}),aa(this,Va,{}),ae(this,Va)[$c]={})}isDirected(){return ae(this,vo)}isMultigraph(){return ae(this,cd)}isCompound(){return ae(this,jo)}setGraph(t){return aa(this,z0,t),this}graph(){return ae(this,z0)}setDefaultNodeLabel(t){return aa(this,Ah,t),typeof t!="function"&&aa(this,Ah,()=>t),this}nodeCount(){return ae(this,Ih)}nodes(){return Object.keys(ae(this,ha))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(ae(t,Ts)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(ae(t,ks)[n]).length===0)}setNodes(t,n){var r=arguments,i=this;return t.forEach(function(o){r.length>1?i.setNode(o,n):i.setNode(o)}),this}setNode(t,n){return ae(this,ha).hasOwnProperty(t)?(arguments.length>1&&(ae(this,ha)[t]=n),this):(ae(this,ha)[t]=arguments.length>1?n:ae(this,Ah).call(this,t),ae(this,jo)&&(ae(this,El)[t]=$c,ae(this,Va)[t]={},ae(this,Va)[$c][t]=!0),ae(this,Ts)[t]={},ae(this,Iu)[t]={},ae(this,ks)[t]={},ae(this,Ru)[t]={},++Np(this,Ih)._,this)}node(t){return ae(this,ha)[t]}hasNode(t){return ae(this,ha).hasOwnProperty(t)}removeNode(t){var n=this;if(ae(this,ha).hasOwnProperty(t)){var r=i=>n.removeEdge(ae(n,wl)[i]);delete ae(this,ha)[t],ae(this,jo)&&(ms(this,j0,zE).call(this,t),delete ae(this,El)[t],this.children(t).forEach(function(i){n.setParent(i)}),delete ae(this,Va)[t]),Object.keys(ae(this,Ts)[t]).forEach(r),delete ae(this,Ts)[t],delete ae(this,Iu)[t],Object.keys(ae(this,ks)[t]).forEach(r),delete ae(this,ks)[t],delete ae(this,Ru)[t],--Np(this,Ih)._}return this}setParent(t,n){if(!ae(this,jo))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=$c;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),ms(this,j0,zE).call(this,t),ae(this,El)[t]=n,ae(this,Va)[n][t]=!0,this}parent(t){if(ae(this,jo)){var n=ae(this,El)[t];if(n!==$c)return n}}children(t=$c){if(ae(this,jo)){var n=ae(this,Va)[t];if(n)return Object.keys(n)}else{if(t===$c)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=ae(this,Iu)[t];if(n)return Object.keys(n)}successors(t){var n=ae(this,Ru)[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const i=new Set(n);for(var r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:ae(this,vo),multigraph:ae(this,cd),compound:ae(this,jo)});n.setGraph(this.graph());var r=this;Object.entries(ae(this,ha)).forEach(function([a,s]){t(a)&&n.setNode(a,s)}),Object.values(ae(this,wl)).forEach(function(a){n.hasNode(a.v)&&n.hasNode(a.w)&&n.setEdge(a,r.edge(a))});var i={};function o(a){var s=r.parent(a);return s===void 0||n.hasNode(s)?(i[a]=s,s):s in i?i[s]:o(s)}return ae(this,jo)&&n.nodes().forEach(a=>n.setParent(a,o(a))),n}setDefaultEdgeLabel(t){return aa(this,Ph,t),typeof t!="function"&&aa(this,Ph,()=>t),this}edgeCount(){return ae(this,Rh)}edges(){return Object.values(ae(this,wl))}setPath(t,n){var r=this,i=arguments;return t.reduce(function(o,a){return i.length>1?r.setEdge(o,a,n):r.setEdge(o,a),a}),this}setEdge(){var t,n,r,i,o=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,n=a.w,r=a.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=a,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var s=Eg(ae(this,vo),t,n,r);if(ae(this,Cl).hasOwnProperty(s))return o&&(ae(this,Cl)[s]=i),this;if(r!==void 0&&!ae(this,cd))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),ae(this,Cl)[s]=o?i:ae(this,Ph).call(this,t,n,r);var l=vSe(ae(this,vo),t,n,r);return t=l.v,n=l.w,Object.freeze(l),ae(this,wl)[s]=l,z9(ae(this,Iu)[n],t),z9(ae(this,Ru)[t],n),ae(this,Ts)[n][s]=l,ae(this,ks)[t][s]=l,Np(this,Rh)._++,this}edge(t,n,r){var i=arguments.length===1?VC(ae(this,vo),arguments[0]):Eg(ae(this,vo),t,n,r);return ae(this,Cl)[i]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var i=arguments.length===1?VC(ae(this,vo),arguments[0]):Eg(ae(this,vo),t,n,r);return ae(this,Cl).hasOwnProperty(i)}removeEdge(t,n,r){var i=arguments.length===1?VC(ae(this,vo),arguments[0]):Eg(ae(this,vo),t,n,r),o=ae(this,wl)[i];return o&&(t=o.v,n=o.w,delete ae(this,Cl)[i],delete ae(this,wl)[i],j9(ae(this,Iu)[n],t),j9(ae(this,Ru)[t],n),delete ae(this,Ts)[n][i],delete ae(this,ks)[t][i],Np(this,Rh)._--),this}inEdges(t,n){var r=ae(this,Ts)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.v===n):i}}outEdges(t,n){var r=ae(this,ks)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.w===n):i}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}},vo=new WeakMap,cd=new WeakMap,jo=new WeakMap,z0=new WeakMap,Ah=new WeakMap,Ph=new WeakMap,ha=new WeakMap,Ts=new WeakMap,Iu=new WeakMap,ks=new WeakMap,Ru=new WeakMap,wl=new WeakMap,Cl=new WeakMap,Ih=new WeakMap,Rh=new WeakMap,El=new WeakMap,Va=new WeakMap,j0=new WeakSet,zE=function(t){delete ae(this,Va)[ae(this,El)[t]][t]},zN);function z9(e,t){e[t]?e[t]++:e[t]=1}function j9(e,t){--e[t]||delete e[t]}function Eg(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}return i+B9+o+B9+(r===void 0?mSe:r)}function vSe(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function VC(e,t){return Eg(e,t.v,t.w,t.name)}var yA=ySe,bSe="2.1.13",_Se={Graph:yA,version:bSe},SSe=yA,xSe={write:wSe,read:TSe};function wSe(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:CSe(e),edges:ESe(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function CSe(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function ESe(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function TSe(e){var t=new SSe(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var kSe=ASe;function ASe(e){var t={},n=[],r;function i(o){t.hasOwnProperty(o)||(t[o]=!0,r.push(o),e.successors(o).forEach(i),e.predecessors(o).forEach(i))}return e.nodes().forEach(function(o){r=[],i(o),r.length&&n.push(r)}),n}var zi,Tl,U0,jE,V0,UE,Oh,V1,jN;let PSe=(jN=class{constructor(){Zn(this,U0);Zn(this,V0);Zn(this,Oh);Zn(this,zi,[]);Zn(this,Tl,{})}size(){return ae(this,zi).length}keys(){return ae(this,zi).map(function(t){return t.key})}has(t){return ae(this,Tl).hasOwnProperty(t)}priority(t){var n=ae(this,Tl)[t];if(n!==void 0)return ae(this,zi)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return ae(this,zi)[0].key}add(t,n){var r=ae(this,Tl);if(t=String(t),!r.hasOwnProperty(t)){var i=ae(this,zi),o=i.length;return r[t]=o,i.push({key:t,priority:n}),ms(this,V0,UE).call(this,o),!0}return!1}removeMin(){ms(this,Oh,V1).call(this,0,ae(this,zi).length-1);var t=ae(this,zi).pop();return delete ae(this,Tl)[t.key],ms(this,U0,jE).call(this,0),t.key}decrease(t,n){var r=ae(this,Tl)[t];if(n>ae(this,zi)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+ae(this,zi)[r].priority+" New: "+n);ae(this,zi)[r].priority=n,ms(this,V0,UE).call(this,r)}},zi=new WeakMap,Tl=new WeakMap,U0=new WeakSet,jE=function(t){var n=ae(this,zi),r=2*t,i=r+1,o=t;r<n.length&&(o=n[r].priority<n[o].priority?r:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(ms(this,Oh,V1).call(this,t,o),ms(this,U0,jE).call(this,o)))},V0=new WeakSet,UE=function(t){for(var n=ae(this,zi),r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)ms(this,Oh,V1).call(this,t,i),t=i},Oh=new WeakSet,V1=function(t,n){var r=ae(this,zi),i=ae(this,Tl),o=r[t],a=r[n];r[t]=a,r[n]=o,i[a.key]=t,i[o.key]=n},jN);var BV=PSe,ISe=BV,zV=OSe,RSe=()=>1;function OSe(e,t,n,r){return MSe(e,String(t),n||RSe,r||function(i){return e.outEdges(i)})}function MSe(e,t,n,r){var i={},o=new ISe,a,s,l=function(u){var c=u.v!==a?u.v:u.w,d=i[c],f=n(u),h=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=a,o.decrease(c,h))};for(e.nodes().forEach(function(u){var c=u===t?0:Number.POSITIVE_INFINITY;i[u]={distance:c},o.add(u,c)});o.size()>0&&(a=o.removeMin(),s=i[a],s.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(l);return i}var NSe=zV,$Se=DSe;function DSe(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=NSe(e,i,t,n),r},{})}var jV=LSe;function LSe(e){var t=0,n=[],r={},i=[];function o(a){var s=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){r.hasOwnProperty(c)?r[c].onStack&&(s.lowlink=Math.min(s.lowlink,r[c].index)):(o(c),s.lowlink=Math.min(s.lowlink,r[c].lowlink))}),s.lowlink===s.index){var l=[],u;do u=n.pop(),r[u].onStack=!1,l.push(u);while(a!==u);i.push(l)}}return e.nodes().forEach(function(a){r.hasOwnProperty(a)||o(a)}),i}var FSe=jV,BSe=zSe;function zSe(e){return FSe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var jSe=VSe,USe=()=>1;function VSe(e,t,n){return GSe(e,t||USe,n||function(r){return e.outEdges(r)})}function GSe(e,t,n){var r={},i=e.nodes();return i.forEach(function(o){r[o]={},r[o][o]={distance:0},i.forEach(function(a){o!==a&&(r[o][a]={distance:Number.POSITIVE_INFINITY})}),n(o).forEach(function(a){var s=a.v===o?a.w:a.v,l=t(a);r[o][s]={distance:l,predecessor:o}})}),i.forEach(function(o){var a=r[o];i.forEach(function(s){var l=r[s];i.forEach(function(u){var c=l[o],d=a[u],f=l[u],h=c.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),r}function UV(e){var t={},n={},r=[];function i(o){if(n.hasOwnProperty(o))throw new VE;t.hasOwnProperty(o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(i),delete n[o],r.push(o))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new VE;return r}class VE extends Error{constructor(){super(...arguments)}}var VV=UV;UV.CycleException=VE;var U9=VV,qSe=HSe;function HSe(e){try{U9(e)}catch(t){if(t instanceof U9.CycleException)return!1;throw t}return!0}var GV=WSe;function WSe(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?s=>e.successors(s):s=>e.neighbors(s),i=n==="post"?KSe:QSe,o=[],a={};return t.forEach(s=>{if(!e.hasNode(s))throw new Error("Graph does not have node: "+s);i(s,r,a,o)}),o}function KSe(e,t,n,r){for(var i=[[e,!1]];i.length>0;){var o=i.pop();o[1]?r.push(o[0]):n.hasOwnProperty(o[0])||(n[o[0]]=!0,i.push([o[0],!0]),qV(t(o[0]),a=>i.push([a,!1])))}}function QSe(e,t,n,r){for(var i=[e];i.length>0;){var o=i.pop();n.hasOwnProperty(o)||(n[o]=!0,r.push(o),qV(t(o),a=>i.push(a)))}}function qV(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var XSe=GV,YSe=ZSe;function ZSe(e,t){return XSe(e,t,"post")}var JSe=GV,e2e=t2e;function t2e(e,t){return JSe(e,t,"pre")}var n2e=yA,r2e=BV,i2e=o2e;function o2e(e,t){var n=new n2e,r={},i=new r2e,o;function a(l){var u=l.v===o?l.w:l.v,c=i.priority(u);if(c!==void 0){var d=t(l);d<c&&(r[u]=o,i.decrease(u,d))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(l){i.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),i.decrease(e.nodes()[0],0);for(var s=!1;i.size()>0;){if(o=i.removeMin(),r.hasOwnProperty(o))n.setEdge(o,r[o]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(o).forEach(a)}return n}var a2e={components:kSe,dijkstra:zV,dijkstraAll:$Se,findCycles:BSe,floydWarshall:jSe,isAcyclic:qSe,postorder:YSe,preorder:e2e,prim:i2e,tarjan:jV,topsort:VV},V9=_Se,s2e={Graph:V9.Graph,json:xSe,alg:a2e,version:V9.version};const G9=mc(s2e),q9=(e,t,n,r)=>{const i=new G9.Graph;return n.forEach(o=>{i.setNode(o.id)}),r.forEach(o=>{i.setEdge(o.source,o.target)}),i.setEdge(e,t),G9.alg.isAcyclic(i)},H9=(e,t,n,r,i)=>{let o=!0;return t==="source"?e.find(a=>a.target===r.id&&a.targetHandle===i.name)&&(o=!1):e.find(a=>a.source===r.id&&a.sourceHandle===i.name)&&(o=!1),gSe(n,i.type)||(o=!1),o},W9=(e,t,n,r,i,o,a)=>{if(e.id===r)return null;const s=o=="source"?e.data.inputs:e.data.outputs;if(s[i]){const l=s[i],u=o=="source"?r:e.id,c=o=="source"?e.id:r,d=o=="source"?i:l.name,f=o=="source"?l.name:i,h=q9(u,c,t,n),p=H9(n,o,a,e,l);if(h&&p)return{source:u,sourceHandle:d,target:c,targetHandle:f}}for(const l in s){const u=s[l],c=o=="source"?r:e.id,d=o=="source"?e.id:r,f=o=="source"?i:u.name,h=o=="source"?u.name:i,p=q9(c,d,t,n),m=H9(n,o,a,e,u);if(p&&m)return{source:c,sourceHandle:f,target:d,targetHandle:h}}return null},l2e="1.0.0",GC={status:Wc.PENDING,error:null,progress:null,progressImage:null,outputs:[]},GE={meta:{version:l2e},name:"",author:"",description:"",notes:"",tags:"",contact:"",version:"",exposedFields:[]},HV={nodes:[],edges:[],nodeTemplates:{},isReady:!1,connectionStartParams:null,currentConnectionFieldType:null,connectionMade:!1,modifyingEdge:!1,addNewNodePosition:null,shouldShowFieldTypeLegend:!1,shouldShowMinimapPanel:!0,shouldValidateGraph:!0,shouldAnimateEdges:!0,shouldSnapToGrid:!1,shouldColorEdges:!0,isAddNodePopoverOpen:!1,nodeOpacity:1,selectedNodes:[],selectedEdges:[],workflow:GE,nodeExecutionStates:{},viewport:{x:0,y:0,zoom:1},mouseOverField:null,mouseOverNode:null,nodesToCopy:[],edgesToCopy:[],selectionMode:uc.Partial},Zi=(e,t)=>{var l,u;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(c=>c.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!Ur(a))return;const s=(u=a.data)==null?void 0:u.inputs[r];s&&o>-1&&(s.value=i)},WV=rr({name:"nodes",initialState:HV,reducers:{nodesChanged:(e,t)=>{e.nodes=Gc(t.payload,e.nodes)},nodeAdded:(e,t)=>{var i,o;const n=t.payload,r=F9(e.nodes,((i=e.addNewNodePosition)==null?void 0:i.x)??n.position.x,((o=e.addNewNodePosition)==null?void 0:o.y)??n.position.y);if(n.position=r,n.selected=!0,e.nodes=Gc(e.nodes.map(a=>({id:a.id,type:"select",selected:!1})),e.nodes),e.edges=Nc(e.edges.map(a=>({id:a.id,type:"select",selected:!1})),e.edges),e.nodes.push(n),!!Ur(n)){if(e.nodeExecutionStates[n.id]={nodeId:n.id,...GC},e.connectionStartParams){const{nodeId:a,handleId:s,handleType:l}=e.connectionStartParams;if(a&&s&&l&&e.currentConnectionFieldType){const u=W9(n,e.nodes,e.edges,a,s,l,e.currentConnectionFieldType);u&&(e.edges=wg({...u,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}},edgeChangeStarted:e=>{e.modifyingEdge=!0},edgesChanged:(e,t)=>{e.edges=Nc(t.payload,e.edges)},edgeAdded:(e,t)=>{e.edges=wg(t.payload,e.edges)},edgeUpdated:(e,t)=>{const{oldEdge:n,newConnection:r}=t.payload;e.edges=$be(n,r,e.edges)},connectionStarted:(e,t)=>{var l;e.connectionStartParams=t.payload,e.connectionMade=e.modifyingEdge;const{nodeId:n,handleId:r,handleType:i}=t.payload;if(!n||!r)return;const o=e.nodes.findIndex(u=>u.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!Ur(a))return;const s=i==="source"?a.data.outputs[r]:a.data.inputs[r];e.currentConnectionFieldType=(s==null?void 0:s.type)??null},connectionMade:(e,t)=>{e.currentConnectionFieldType&&(e.edges=wg({...t.payload,type:"default"},e.edges),e.connectionMade=!0)},connectionEnded:(e,t)=>{var n;if(e.connectionMade)e.connectionStartParams=null,e.currentConnectionFieldType=null;else if(e.mouseOverNode){const r=e.nodes.findIndex(o=>o.id===e.mouseOverNode),i=(n=e.nodes)==null?void 0:n[r];if(i&&e.connectionStartParams){const{nodeId:o,handleId:a,handleType:s}=e.connectionStartParams;if(o&&a&&s&&e.currentConnectionFieldType){const l=W9(i,e.nodes,e.edges,o,a,s,e.currentConnectionFieldType);l&&(e.edges=wg({...l,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}else e.addNewNodePosition=t.payload.cursorPosition,e.isAddNodePopoverOpen=!0;e.modifyingEdge=!1},workflowExposedFieldAdded:(e,t)=>{e.workflow.exposedFields=tE(e.workflow.exposedFields.concat(t.payload),n=>`${n.nodeId}-${n.fieldName}`)},workflowExposedFieldRemoved:(e,t)=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(n=>!pk(n,t.payload))},fieldLabelChanged:(e,t)=>{const{nodeId:n,fieldName:r,label:i}=t.payload,o=e.nodes.find(s=>s.id===n);if(!Ur(o))return;const a=o.data.inputs[r];a&&(a.label=i)},nodeEmbedWorkflowChanged:(e,t)=>{var a;const{nodeId:n,embedWorkflow:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.embedWorkflow=r)},nodeUseCacheChanged:(e,t)=>{var a;const{nodeId:n,useCache:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.useCache=r)},nodeIsIntermediateChanged:(e,t)=>{var a;const{nodeId:n,isIntermediate:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.isIntermediate=r)},nodeIsOpenChanged:(e,t)=>{var s;const{nodeId:n,isOpen:r}=t.payload,i=e.nodes.findIndex(l=>l.id===n),o=(s=e.nodes)==null?void 0:s[i];if(!Ur(o)&&!yI(o)||(o.data.isOpen=r,!Ur(o)))return;const a=fA([o],e.edges);if(r)a.forEach(l=>{delete l.hidden}),a.forEach(l=>{l.type==="collapsed"&&(e.edges=e.edges.filter(u=>u.id!==l.id))});else{const l=Mbe(o,e.nodes,e.edges).filter(d=>Ur(d)&&d.data.isOpen===!1),u=Obe(o,e.nodes,e.edges).filter(d=>Ur(d)&&d.data.isOpen===!1),c=[];a.forEach(d=>{var f,h;if(d.target===n&&l.find(p=>p.id===d.source)){d.hidden=!0;const p=c.find(m=>m.source===d.source&&m.target===d.target);p?p.data={count:(((f=p.data)==null?void 0:f.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}if(d.source===n&&u.find(p=>p.id===d.target)){const p=c.find(m=>m.source===d.source&&m.target===d.target);d.hidden=!0,p?p.data={count:(((h=p.data)==null?void 0:h.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}}),c.length&&(e.edges=Nc(c.map(d=>({type:"add",item:d})),e.edges))}},edgeDeleted:(e,t)=>{e.edges=e.edges.filter(n=>n.id!==t.payload)},edgesDeleted:(e,t)=>{const r=t.payload.filter(i=>i.type==="collapsed");if(r.length){const i=[];r.forEach(o=>{e.edges.forEach(a=>{a.source===o.source&&a.target===o.target&&i.push({id:a.id,type:"remove"})})}),e.edges=Nc(i,e.edges)}},nodesDeleted:(e,t)=>{t.payload.forEach(n=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(r=>r.nodeId!==n.id),Ur(n)&&delete e.nodeExecutionStates[n.id]})},nodeLabelChanged:(e,t)=>{var a;const{nodeId:n,label:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.label=r)},nodeNotesChanged:(e,t)=>{var a;const{nodeId:n,notes:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.notes=r)},nodeExclusivelySelected:(e,t)=>{const n=t.payload;e.nodes=Gc(e.nodes.map(r=>({id:r.id,type:"select",selected:r.id===n})),e.nodes)},selectedNodesChanged:(e,t)=>{e.selectedNodes=t.payload},selectedEdgesChanged:(e,t)=>{e.selectedEdges=t.payload},fieldStringValueChanged:(e,t)=>{Zi(e,t)},fieldNumberValueChanged:(e,t)=>{Zi(e,t)},fieldBooleanValueChanged:(e,t)=>{Zi(e,t)},fieldBoardValueChanged:(e,t)=>{Zi(e,t)},fieldImageValueChanged:(e,t)=>{Zi(e,t)},fieldColorValueChanged:(e,t)=>{Zi(e,t)},fieldMainModelValueChanged:(e,t)=>{Zi(e,t)},fieldRefinerModelValueChanged:(e,t)=>{Zi(e,t)},fieldVaeModelValueChanged:(e,t)=>{Zi(e,t)},fieldLoRAModelValueChanged:(e,t)=>{Zi(e,t)},fieldControlNetModelValueChanged:(e,t)=>{Zi(e,t)},fieldIPAdapterModelValueChanged:(e,t)=>{Zi(e,t)},fieldT2IAdapterModelValueChanged:(e,t)=>{Zi(e,t)},fieldEnumModelValueChanged:(e,t)=>{Zi(e,t)},fieldSchedulerValueChanged:(e,t)=>{Zi(e,t)},imageCollectionFieldValueChanged:(e,t)=>{var u,c;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(d=>d.id===n);if(o===-1)return;const a=(u=e.nodes)==null?void 0:u[o];if(!Ur(a))return;const s=(c=a.data)==null?void 0:c.inputs[r];if(!s)return;const l=Cn(s.value);if(!l){s.value=i;return}s.value=tE(l.concat(i),"image_name")},notesNodeValueChanged:(e,t)=>{var a;const{nodeId:n,value:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];yI(o)&&(o.data.notes=r)},shouldShowFieldTypeLegendChanged:(e,t)=>{e.shouldShowFieldTypeLegend=t.payload},shouldShowMinimapPanelChanged:(e,t)=>{e.shouldShowMinimapPanel=t.payload},nodeTemplatesBuilt:(e,t)=>{e.nodeTemplates=t.payload,e.isReady=!0},nodeEditorReset:e=>{e.nodes=[],e.edges=[],e.workflow=Cn(GE)},shouldValidateGraphChanged:(e,t)=>{e.shouldValidateGraph=t.payload},shouldAnimateEdgesChanged:(e,t)=>{e.shouldAnimateEdges=t.payload},shouldSnapToGridChanged:(e,t)=>{e.shouldSnapToGrid=t.payload},shouldColorEdgesChanged:(e,t)=>{e.shouldColorEdges=t.payload},nodeOpacityChanged:(e,t)=>{e.nodeOpacity=t.payload},workflowNameChanged:(e,t)=>{e.workflow.name=t.payload},workflowDescriptionChanged:(e,t)=>{e.workflow.description=t.payload},workflowTagsChanged:(e,t)=>{e.workflow.tags=t.payload},workflowAuthorChanged:(e,t)=>{e.workflow.author=t.payload},workflowNotesChanged:(e,t)=>{e.workflow.notes=t.payload},workflowVersionChanged:(e,t)=>{e.workflow.version=t.payload},workflowContactChanged:(e,t)=>{e.workflow.contact=t.payload},workflowLoaded:(e,t)=>{const{nodes:n,edges:r,...i}=t.payload;e.workflow=i,e.nodes=Gc(n.map(o=>({item:{...o,dragHandle:`.${dSe}`},type:"add"})),[]),e.edges=Nc(r.map(o=>({item:o,type:"add"})),[]),e.nodeExecutionStates=n.reduce((o,a)=>(o[a.id]={nodeId:a.id,...GC},o),{})},workflowReset:e=>{e.workflow=Cn(GE)},viewportChanged:(e,t)=>{e.viewport=t.payload},mouseOverFieldChanged:(e,t)=>{e.mouseOverField=t.payload},mouseOverNodeChanged:(e,t)=>{e.mouseOverNode=t.payload},selectedAll:e=>{e.nodes=Gc(e.nodes.map(t=>({id:t.id,type:"select",selected:!0})),e.nodes),e.edges=Nc(e.edges.map(t=>({id:t.id,type:"select",selected:!0})),e.edges)},selectionCopied:e=>{if(e.nodesToCopy=e.nodes.filter(t=>t.selected).map(Cn),e.edgesToCopy=e.edges.filter(t=>t.selected).map(Cn),e.nodesToCopy.length>0){const t={x:0,y:0};e.nodesToCopy.forEach(n=>{const r=.15*(n.width??0),i=.5*(n.height??0);t.x+=n.position.x+r,t.y+=n.position.y+i}),t.x/=e.nodesToCopy.length,t.y/=e.nodesToCopy.length,e.nodesToCopy.forEach(n=>{n.position.x-=t.x,n.position.y-=t.y})}},selectionPasted:(e,t)=>{const{cursorPosition:n}=t.payload,r=e.nodesToCopy.map(Cn),i=r.map(c=>c.data.id),o=e.edgesToCopy.filter(c=>i.includes(c.source)&&i.includes(c.target)).map(Cn);o.forEach(c=>c.selected=!0),r.forEach(c=>{const d=LV();o.forEach(h=>{h.source===c.data.id&&(h.source=d,h.id=h.id.replace(c.data.id,d)),h.target===c.data.id&&(h.target=d,h.id=h.id.replace(c.data.id,d))}),c.selected=!0,c.id=d,c.data.id=d;const f=F9(e.nodes,c.position.x+((n==null?void 0:n.x)??0),c.position.y+((n==null?void 0:n.y)??0));c.position=f});const a=r.map(c=>({item:c,type:"add"})),s=e.nodes.map(c=>({id:c.data.id,type:"select",selected:!1})),l=o.map(c=>({item:c,type:"add"})),u=e.edges.map(c=>({id:c.id,type:"select",selected:!1}));e.nodes=Gc(a.concat(s),e.nodes),e.edges=Nc(l.concat(u),e.edges),r.forEach(c=>{e.nodeExecutionStates[c.id]={nodeId:c.id,...GC}})},addNodePopoverOpened:e=>{e.addNewNodePosition=null,e.isAddNodePopoverOpen=!0},addNodePopoverClosed:e=>{e.isAddNodePopoverOpen=!1,e.connectionStartParams=null,e.currentConnectionFieldType=null},addNodePopoverToggled:e=>{e.isAddNodePopoverOpen=!e.isAddNodePopoverOpen},selectionModeChanged:(e,t)=>{e.selectionMode=t.payload?uc.Full:uc.Partial}},extraReducers:e=>{e.addCase(y0.pending,t=>{t.isReady=!1}),e.addCase(Gk,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Wc.IN_PROGRESS)}),e.addCase(Hk,(t,n)=>{const{source_node_id:r,result:i}=n.payload.data,o=t.nodeExecutionStates[r];o&&(o.status=Wc.COMPLETED,o.progress!==null&&(o.progress=1),o.outputs.push(i))}),e.addCase(G2,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Wc.FAILED,i.error=n.payload.data.error,i.progress=null,i.progressImage=null)}),e.addCase(Wk,(t,n)=>{const{source_node_id:r,step:i,total_steps:o,progress_image:a}=n.payload.data,s=t.nodeExecutionStates[r];s&&(s.status=Wc.IN_PROGRESS,s.progress=(i+1)/o,s.progressImage=a??null)}),e.addCase(Kk,(t,n)=>{["in_progress"].includes(n.payload.data.status)&&Ea(t.nodeExecutionStates,r=>{r.status=Wc.PENDING,r.error=null,r.progress=null,r.progressImage=null,r.outputs=[]})})}}),{addNodePopoverClosed:qqe,addNodePopoverOpened:Hqe,addNodePopoverToggled:Wqe,connectionEnded:Kqe,connectionMade:Qqe,connectionStarted:Xqe,edgeDeleted:Yqe,edgeChangeStarted:Zqe,edgesChanged:Jqe,edgesDeleted:eHe,edgeUpdated:tHe,fieldBoardValueChanged:nHe,fieldBooleanValueChanged:rHe,fieldColorValueChanged:iHe,fieldControlNetModelValueChanged:oHe,fieldEnumModelValueChanged:aHe,fieldImageValueChanged:Z2,fieldIPAdapterModelValueChanged:sHe,fieldT2IAdapterModelValueChanged:lHe,fieldLabelChanged:uHe,fieldLoRAModelValueChanged:cHe,fieldMainModelValueChanged:dHe,fieldNumberValueChanged:fHe,fieldRefinerModelValueChanged:hHe,fieldSchedulerValueChanged:pHe,fieldStringValueChanged:gHe,fieldVaeModelValueChanged:mHe,imageCollectionFieldValueChanged:yHe,mouseOverFieldChanged:vHe,mouseOverNodeChanged:bHe,nodeAdded:_He,nodeEditorReset:u2e,nodeEmbedWorkflowChanged:SHe,nodeExclusivelySelected:xHe,nodeIsIntermediateChanged:wHe,nodeIsOpenChanged:CHe,nodeLabelChanged:EHe,nodeNotesChanged:THe,nodeOpacityChanged:kHe,nodesChanged:AHe,nodesDeleted:PHe,nodeTemplatesBuilt:KV,nodeUseCacheChanged:IHe,notesNodeValueChanged:RHe,selectedAll:OHe,selectedEdgesChanged:MHe,selectedNodesChanged:NHe,selectionCopied:$He,selectionModeChanged:DHe,selectionPasted:LHe,shouldAnimateEdgesChanged:FHe,shouldColorEdgesChanged:BHe,shouldShowFieldTypeLegendChanged:zHe,shouldShowMinimapPanelChanged:jHe,shouldSnapToGridChanged:UHe,shouldValidateGraphChanged:VHe,viewportChanged:GHe,workflowAuthorChanged:qHe,workflowContactChanged:HHe,workflowDescriptionChanged:WHe,workflowExposedFieldAdded:c2e,workflowExposedFieldRemoved:KHe,workflowLoaded:d2e,workflowNameChanged:QHe,workflowNotesChanged:XHe,workflowTagsChanged:YHe,workflowVersionChanged:ZHe,edgeAdded:JHe}=WV.actions,f2e=WV.reducer,QV={esrganModelName:"RealESRGAN_x4plus.pth"},XV=rr({name:"postprocessing",initialState:QV,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:eWe}=XV.actions,h2e=XV.reducer,YV={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.8},ZV=rr({name:"sdxl",initialState:YV,reducers:{setPositiveStylePromptSDXL:(e,t)=>{e.positiveStylePrompt=t.payload},setNegativeStylePromptSDXL:(e,t)=>{e.negativeStylePrompt=t.payload},setShouldConcatSDXLStylePrompt:(e,t)=>{e.shouldConcatSDXLStylePrompt=t.payload},setShouldUseSDXLRefiner:(e,t)=>{e.shouldUseSDXLRefiner=t.payload},setSDXLImg2ImgDenoisingStrength:(e,t)=>{e.sdxlImg2ImgDenoisingStrength=t.payload},refinerModelChanged:(e,t)=>{e.refinerModel=t.payload},setRefinerSteps:(e,t)=>{e.refinerSteps=t.payload},setRefinerCFGScale:(e,t)=>{e.refinerCFGScale=t.payload},setRefinerScheduler:(e,t)=>{e.refinerScheduler=t.payload},setRefinerPositiveAestheticScore:(e,t)=>{e.refinerPositiveAestheticScore=t.payload},setRefinerNegativeAestheticScore:(e,t)=>{e.refinerNegativeAestheticScore=t.payload},setRefinerStart:(e,t)=>{e.refinerStart=t.payload}}}),{setPositiveStylePromptSDXL:tWe,setNegativeStylePromptSDXL:nWe,setShouldConcatSDXLStylePrompt:rWe,setShouldUseSDXLRefiner:p2e,setSDXLImg2ImgDenoisingStrength:iWe,refinerModelChanged:K9,setRefinerSteps:oWe,setRefinerCFGScale:aWe,setRefinerScheduler:sWe,setRefinerPositiveAestheticScore:lWe,setRefinerNegativeAestheticScore:uWe,setRefinerStart:cWe}=ZV.actions,g2e=ZV.reducer,m2e=(e,t,n)=>t===0?0:n===2?Math.floor((e+1+1)/2)/Math.floor((t+1)/2):(e+1+1)/(t+1),Ld=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},JV={isInitialized:!1,isConnected:!1,shouldConfirmOnDelete:!0,enableImageDebugging:!1,toastQueue:[],denoiseProgress:null,shouldAntialiasProgressImage:!1,consoleLogLevel:"debug",shouldLogToConsole:!0,language:"en",shouldUseNSFWChecker:!1,shouldUseWatermarker:!1,shouldEnableInformationalPopovers:!1,status:"DISCONNECTED"},eG=rr({name:"system",initialState:JV,reducers:{setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},consoleLogLevelChanged:(e,t)=>{e.consoleLogLevel=t.payload},shouldLogToConsoleChanged:(e,t)=>{e.shouldLogToConsole=t.payload},shouldAntialiasProgressImageChanged:(e,t)=>{e.shouldAntialiasProgressImage=t.payload},languageChanged:(e,t)=>{e.language=t.payload},shouldUseNSFWCheckerChanged(e,t){e.shouldUseNSFWChecker=t.payload},shouldUseWatermarkerChanged(e,t){e.shouldUseWatermarker=t.payload},setShouldEnableInformationalPopovers(e,t){e.shouldEnableInformationalPopovers=t.payload},isInitializedChanged(e,t){e.isInitialized=t.payload}},extraReducers(e){e.addCase(Vk,t=>{t.isConnected=!0,t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Vj,t=>{t.isConnected=!1,t.denoiseProgress=null,t.status="DISCONNECTED"}),e.addCase(Gk,t=>{t.denoiseProgress=null,t.status="PROCESSING"}),e.addCase(Wk,(t,n)=>{const{step:r,total_steps:i,order:o,progress_image:a,graph_execution_state_id:s,queue_batch_id:l}=n.payload.data;t.denoiseProgress={step:r,total_steps:i,order:o,percentage:m2e(r,i,o),progress_image:a,session_id:s,batch_id:l},t.status="PROCESSING"}),e.addCase(Hk,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Wj,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Xj,t=>{t.status="LOADING_MODEL"}),e.addCase(Zj,t=>{t.status="CONNECTED"}),e.addCase(Kk,(t,n)=>{["completed","canceled","failed"].includes(n.payload.data.status)&&(t.status="CONNECTED",t.denoiseProgress=null)}),e.addMatcher(S2e,(t,n)=>{t.toastQueue.push(Ld({title:Y("toast.serverError"),status:"error",description:Eae(n.payload.data.error_type)}))})}}),{setShouldConfirmOnDelete:dWe,setEnableImageDebugging:fWe,addToast:qt,clearToastQueue:hWe,consoleLogLevelChanged:pWe,shouldLogToConsoleChanged:gWe,shouldAntialiasProgressImageChanged:mWe,languageChanged:yWe,shouldUseNSFWCheckerChanged:y2e,shouldUseWatermarkerChanged:v2e,setShouldEnableInformationalPopovers:vWe,isInitializedChanged:b2e}=eG.actions,_2e=eG.reducer,S2e=$o(G2,eU,nU),x2e={listCursor:void 0,listPriority:void 0,selectedQueueItem:void 0,resumeProcessorOnEnqueue:!0},w2e=x2e,tG=rr({name:"queue",initialState:w2e,reducers:{listCursorChanged:(e,t)=>{e.listCursor=t.payload},listPriorityChanged:(e,t)=>{e.listPriority=t.payload},listParamsReset:e=>{e.listCursor=void 0,e.listPriority=void 0},queueItemSelectionToggled:(e,t)=>{e.selectedQueueItem===t.payload?e.selectedQueueItem=void 0:e.selectedQueueItem=t.payload},resumeProcessorOnEnqueueChanged:(e,t)=>{e.resumeProcessorOnEnqueue=t.payload}}}),{listCursorChanged:bWe,listPriorityChanged:_We,listParamsReset:C2e,queueItemSelectionToggled:SWe,resumeProcessorOnEnqueueChanged:xWe}=tG.actions,E2e=tG.reducer,T2e={searchFolder:null,advancedAddScanModel:null},nG=rr({name:"modelmanager",initialState:T2e,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:wWe,setAdvancedAddScanModel:CWe}=nG.actions,k2e=nG.reducer,rG={shift:!1,ctrl:!1,meta:!1},iG=rr({name:"hotkeys",initialState:rG,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload},ctrlKeyPressed:(e,t)=>{e.ctrl=t.payload},metaKeyPressed:(e,t)=>{e.meta=t.payload}}}),{shiftKeyPressed:EWe,ctrlKeyPressed:TWe,metaKeyPressed:kWe}=iG.actions,A2e=iG.reducer,oG={activeTab:"txt2img",shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,shouldAutoChangeDimensions:!1,favoriteSchedulers:[],globalContextMenuCloseTrigger:0,panels:{}},aG=rr({name:"ui",initialState:oG,reducers:{setActiveTab:(e,t)=>{e.activeTab=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldHidePreview:(e,t)=>{e.shouldHidePreview=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setShouldUseSliders:(e,t)=>{e.shouldUseSliders=t.payload},setShouldShowProgressInViewer:(e,t)=>{e.shouldShowProgressInViewer=t.payload},favoriteSchedulersChanged:(e,t)=>{e.favoriteSchedulers=t.payload},toggleEmbeddingPicker:e=>{e.shouldShowEmbeddingPicker=!e.shouldShowEmbeddingPicker},setShouldAutoChangeDimensions:(e,t)=>{e.shouldAutoChangeDimensions=t.payload},contextMenusClosed:e=>{e.globalContextMenuCloseTrigger+=1},panelsChanged:(e,t)=>{e.panels[t.payload.name]=t.payload.value}},extraReducers(e){e.addCase(ZS,t=>{t.activeTab="img2img"})}}),{setActiveTab:sG,setShouldShowImageDetails:AWe,setShouldUseCanvasBetaLayout:PWe,setShouldShowExistingModelsInSearch:IWe,setShouldUseSliders:RWe,setShouldHidePreview:OWe,setShouldShowProgressInViewer:MWe,favoriteSchedulersChanged:NWe,toggleEmbeddingPicker:$We,setShouldAutoChangeDimensions:DWe,contextMenusClosed:LWe,panelsChanged:FWe}=aG.actions,P2e=aG.reducer,I2e=hS(FY);lG=qE=void 0;var R2e=I2e,O2e=function(){var t=[],n=[],r=void 0,i=function(u){return r=u,function(c){return function(d){return R2e.compose.apply(void 0,n)(c)(d)}}},o=function(){for(var u,c,d=arguments.length,f=Array(d),h=0;h<d;h++)f[h]=arguments[h];(u=n).push.apply(u,f.map(function(p){return p(r)})),(c=t).push.apply(c,f)},a=function(u){var c=t.findIndex(function(d){return d===u});if(c===-1){console.error("Middleware does not exist!",u);return}t=t.filter(function(d,f){return f!==c}),n=n.filter(function(d,f){return f!==c})},s=function(){n=[],t=[]};return{enhancer:i,addMiddleware:o,removeMiddleware:a,resetMiddlewares:s}},J2=O2e(),M2e=J2.enhancer,N2e=J2.addMiddleware;J2.removeMiddleware;var $2e=J2.resetMiddlewares,qE=N2e,lG=$2e,HE="@@REMEMBER_REHYDRATED",D2e="@@REMEMBER_PERSISTED";function WE(e){"@babel/helpers - typeof";return WE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WE(e)}var uG=function(t,n){if(t===null||WE(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];i[o]=t[o]}return i},L2e=function(t,n){var r=0,i;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=+new Date,u=(r||l)-l;if(u<=0&&!i){r=l+n,t.apply(void 0,a);return}i&&(clearTimeout(i),i=null),i=setTimeout(function(){r=+new Date+n,t.apply(void 0,a),clearTimeout(i),i=null},u)}},F2e=function(t,n){var r;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o),r=null},n)}};function Q9(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function vA(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){Q9(o,r,i,a,s,"next",l)}function s(l){Q9(o,r,i,a,s,"throw",l)}a(void 0)})}}var B2e=function(){var e=vA(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield r.getItem("".concat(i,"rootState"));return a==null?{}:uG(o(a,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),z2e=function(){var e=vA(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield Promise.all(n.map(function(s){return r.getItem("".concat(i).concat(s))}));return n.reduce(function(s,l,u){return a[u]!==null&&a[u]!==void 0&&(s[l]=o(a[u],l)),s},{})});return function(n){return e.apply(this,arguments)}}(),j2e=function(){var e=vA(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.persistWholeStore,s=r.unserialize,l={};try{var u=a?B2e:z2e;l=yield u({rememberedKeys:n,driver:o,prefix:i,unserialize:s})}catch(c){console.warn("redux-remember: rehydrate error",c)}t.dispatch({type:HE,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function qC(e,t){return G2e(e)||V2e(e,t)||cG(e,t)||U2e()}function U2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V2e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function G2e(e){if(Array.isArray(e))return e}function HC(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=cG(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function cG(e,t){if(e){if(typeof e=="string")return X9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X9(e,t)}}function X9(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D_(e){"@babel/helpers - typeof";return D_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D_(e)}var Y9=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},Z9=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},q2e=function e(t,n){if(t===n)return!0;if(D_(t)!=="object"||D_(n)!=="object"||t===null||t===void 0||n===null||n===void 0)return t!==t&&n!==n;if(t.constructor!==n.constructor)return!1;if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(Array.isArray(t)){if(t.length!==n.length)return!1;for(var r=t.length;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(Z9(t)&&Z9(n)){if(t.byteLength!==n.byteLength)return!1;for(var i=t.byteLength;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}var o=Y9(t),a=Y9(n);if(o==="DataView"&&a==="DataView")return t.byteLength!==n.byteLength||t.byteOffset!==n.byteOffset?!1:e(t.buffer,n.buffer);if(o==="ArrayBuffer"&&a==="ArrayBuffer")return t.byteLength!==n.byteLength?!1:e(new Uint8Array(t),new Uint8Array(n));if(o==="Map"&&a==="Map"){if(t.size!==n.size)return!1;var s=HC(t.entries()),l;try{for(s.s();!(l=s.n()).done;){var u=qC(l.value,1),c=u[0];if(!n.has(c))return!1}}catch(C){s.e(C)}finally{s.f()}var d=HC(t.entries()),f;try{for(d.s();!(f=d.n()).done;){var h=qC(f.value,2),p=h[0],m=h[1];if(!e(m,n.get(p)))return!1}}catch(C){d.e(C)}finally{d.f()}return!0}if(o==="Set"&&a==="Set"){if(t.size!==n.size)return!1;var _=HC(t.entries()),b;try{for(_.s();!(b=_.n()).done;){var y=qC(b.value,1),g=y[0];if(!n.has(g))return!1}}catch(C){_.e(C)}finally{_.f()}return!0}if(o==="Date"&&a==="Date")return+t==+n;var v=Object.keys(t);if(v.length!==Object.keys(n).length)return!1;for(var S=v.length;S--!==0;)if(!Object.prototype.hasOwnProperty.call(n,v[S]))return!1;for(var w=v.length;w--!==0;){var x=v[w];if(!e(t[x],n[x]))return!1}return o!=="Object"&&a!=="Object"?t===n:!0};const bA=q2e;function J9(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function dG(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){J9(o,r,i,a,s,"next",l)}function s(l){J9(o,r,i,a,s,"throw",l)}a(void 0)})}}var H2e=function(){var e=dG(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;if(!bA(t,n))return o.setItem("".concat(i,"rootState"),a(t,"rootState"))});return function(n,r,i){return e.apply(this,arguments)}}(),W2e=function(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;return Promise.all(Object.keys(t).map(function(s){return bA(t[s],n[s])?Promise.resolve():o.setItem("".concat(i).concat(s),a(t[s],s))}))},K2e=function(){var e=dG(function*(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=r.prefix,o=r.driver,a=r.persistWholeStore,s=r.serialize;try{var l=a?H2e:W2e;yield l(t,n,{prefix:i,driver:o,serialize:s})}catch(u){console.warn("redux-remember: persist error",u)}});return function(){return e.apply(this,arguments)}}();function eO(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function tO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){eO(o,r,i,a,s,"next",l)}function s(l){eO(o,r,i,a,s,"throw",l)}a(void 0)})}}var Q2e=function(){var e=tO(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize,s=r.unserialize,l=r.persistThrottle,u=r.persistDebounce,c=r.persistWholeStore;yield j2e(t,n,{prefix:i,driver:o,unserialize:s,persistWholeStore:c});var d={},f=function(){var h=tO(function*(){var p=uG(t.getState(),n);yield K2e(p,d,{prefix:i,driver:o,serialize:a,persistWholeStore:c}),bA(p,d)||t.dispatch({type:D2e,payload:p}),d=p});return function(){return h.apply(this,arguments)}}();u&&u>0?t.subscribe(F2e(f,u)):t.subscribe(L2e(f,l))});return function(n,r,i){return e.apply(this,arguments)}}();const X2e=Q2e;function v0(e){"@babel/helpers - typeof";return v0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v0(e)}function nO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nO(Object(n),!0).forEach(function(r){Y2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Y2e(e,t,n){return t=Z2e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z2e(e){var t=J2e(e,"string");return v0(t)==="symbol"?t:String(t)}function J2e(e,t){if(v0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(v0(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var exe=function(t){var n={state:{}};return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.state,i=arguments.length>1?arguments[1]:void 0;i.type&&(i.type==="@@INIT"||i.type.startsWith("@@redux/INIT"))&&(n.state=WC({},r));var o=typeof t=="function"?t:pp(t);switch(i.type){case HE:{var a=WC(WC({},n.state),i.payload||{});return n.state=o(a,{type:HE,payload:a}),n.state}default:return o(r,i)}}},txe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.prefix,o=i===void 0?"@@remember-":i,a=r.serialize,s=a===void 0?function(_,b){return JSON.stringify(_)}:a,l=r.unserialize,u=l===void 0?function(_,b){return JSON.parse(_)}:l,c=r.persistThrottle,d=c===void 0?100:c,f=r.persistDebounce,h=r.persistWholeStore,p=h===void 0?!1:h;if(!t)throw Error("redux-remember error: driver required");if(!Array.isArray(n))throw Error("redux-remember error: rememberedKeys needs to be an array");var m=function(b){return function(y,g,v){var S=b(y,g,v);return X2e(S,n,{driver:t,prefix:o,serialize:s,unserialize:u,persistThrottle:d,persistDebounce:f,persistWholeStore:p}),S}};return m};const BWe=["chakra-ui-color-mode","i18nextLng","ROARR_FILTER","ROARR_LOG"],nxe="@@invokeai-",rxe=["cursorPosition"],ixe=["pendingControlImages"],oxe=["prompts"],axe=["selection","selectedBoardId","galleryView"],sxe=["nodeTemplates","connectionStartParams","currentConnectionFieldType","selectedNodes","selectedEdges","isReady","nodesToCopy","edgesToCopy","connectionMade","modifyingEdge","addNewNodePosition"],lxe=[],uxe=[],cxe=["isInitialized","isConnected","denoiseProgress","status"],dxe=["shouldShowImageDetails","globalContextMenuCloseTrigger","panels"],fxe={canvas:rxe,gallery:axe,generation:lxe,nodes:sxe,postprocessing:uxe,system:cxe,ui:dxe,controlNet:ixe,dynamicPrompts:oxe},hxe=(e,t)=>{const n=KS(e,fxe[t]??[]);return JSON.stringify(n)},pxe={canvas:kB,gallery:fU,generation:yk,nodes:HV,postprocessing:QV,system:JV,config:fB,ui:oG,hotkeys:rG,controlNet:wE,dynamicPrompts:Zk,sdxl:YV},gxe=(e,t)=>boe(JSON.parse(e),pxe[t]),mxe=Ne("nodes/textToImageGraphBuilt"),yxe=Ne("nodes/imageToImageGraphBuilt"),fG=Ne("nodes/canvasGraphBuilt"),vxe=Ne("nodes/nodesGraphBuilt"),bxe=$o(mxe,yxe,fG,vxe),_xe=Ne("nodes/workflowLoadRequested"),Sxe=e=>{if(bxe(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return y0.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:KV.match(e)?{...e,payload:"<Node templates omitted>"}:e},xxe=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","@@REMEMBER_PERSISTED"],wxe=e=>e,hG="default",Vr=nl(hG),Cxe=e=>{const t=e?Qg.stringify(e,{arrayFormat:"none"}):void 0;return t?`queue/${Vr.get()}/list?${t}`:`queue/${Vr.get()}/list`},Kc=ds({selectId:e=>e.item_id,sortComparer:(e,t)=>e.priority>t.priority?-1:e.priority<t.priority?1:e.item_id<t.item_id?-1:e.item_id>t.item_id?1:0}),Xr=us.injectEndpoints({endpoints:e=>({enqueueBatch:e.mutation({query:t=>({url:`queue/${Vr.get()}/enqueue_batch`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),enqueueGraph:e.mutation({query:t=>({url:`queue/${Vr.get()}/enqueue_graph`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),resumeProcessor:e.mutation({query:()=>({url:`queue/${Vr.get()}/processor/resume`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pauseProcessor:e.mutation({query:()=>({url:`queue/${Vr.get()}/processor/pause`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pruneQueue:e.mutation({query:()=>({url:`queue/${Vr.get()}/prune`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","BatchStatus","SessionQueueItem","SessionQueueItemDTO"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),clearQueue:e.mutation({query:()=>({url:`queue/${Vr.get()}/clear`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","SessionProcessorStatus","BatchStatus","CurrentSessionQueueItem","NextSessionQueueItem","SessionQueueItem","SessionQueueItemDTO"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),getCurrentQueueItem:e.query({query:()=>({url:`queue/${Vr.get()}/current`,method:"GET"}),providesTags:t=>{const n=["CurrentSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getNextQueueItem:e.query({query:()=>({url:`queue/${Vr.get()}/next`,method:"GET"}),providesTags:t=>{const n=["NextSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getQueueStatus:e.query({query:()=>({url:`queue/${Vr.get()}/status`,method:"GET"}),providesTags:["SessionQueueStatus"]}),getBatchStatus:e.query({query:({batch_id:t})=>({url:`queue/${Vr.get()}/b/${t}/status`,method:"GET"}),providesTags:t=>t?[{type:"BatchStatus",id:t.batch_id}]:[]}),getQueueItem:e.query({query:t=>({url:`queue/${Vr.get()}/i/${t}`,method:"GET"}),providesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id}]:[]}),cancelQueueItem:e.mutation({query:t=>({url:`queue/${Vr.get()}/i/${t}/cancel`,method:"PUT"}),onQueryStarted:async(t,{dispatch:n,queryFulfilled:r})=>{try{const{data:i}=await r;n(Xr.util.updateQueryData("listQueueItems",void 0,o=>{Kc.updateOne(o,{id:t,changes:{status:i.status}})}))}catch{}},invalidatesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id},{type:"SessionQueueItemDTO",id:t.item_id},{type:"BatchStatus",id:t.batch_id}]:[]}),cancelByBatchIds:e.mutation({query:t=>({url:`queue/${Vr.get()}/cancel_by_batch_ids`,method:"PUT",body:t}),onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}},invalidatesTags:["SessionQueueItem","SessionQueueItemDTO","BatchStatus"]}),listQueueItems:e.query({query:t=>({url:Cxe(t),method:"GET"}),serializeQueryArgs:()=>`queue/${Vr.get()}/list`,transformResponse:t=>Kc.addMany(Kc.getInitialState({has_more:t.has_more}),t.items),merge:(t,n)=>{Kc.addMany(t,Kc.getSelectors().selectAll(n)),t.has_more=n.has_more},forceRefetch:({currentArg:t,previousArg:n})=>t!==n,keepUnusedDataFor:60*5})})}),{useCancelByBatchIdsMutation:zWe,useEnqueueGraphMutation:jWe,useEnqueueBatchMutation:UWe,usePauseProcessorMutation:VWe,useResumeProcessorMutation:GWe,useClearQueueMutation:qWe,usePruneQueueMutation:HWe,useGetCurrentQueueItemQuery:WWe,useGetQueueStatusQuery:KWe,useGetQueueItemQuery:QWe,useGetNextQueueItemQuery:XWe,useListQueueItemsQuery:YWe,useCancelQueueItemMutation:ZWe,useGetBatchStatusQuery:JWe}=Xr,eg=e=>{e(Xr.util.updateQueryData("listQueueItems",void 0,t=>{Kc.removeAll(t),t.has_more=!1})),e(C2e()),e(Xr.endpoints.listQueueItems.initiate(void 0))},Exe=$o(ule,cle),Txe=()=>{Fe({matcher:Exe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),{batchIds:o}=i.canvas;try{const a=t(Xr.endpoints.cancelByBatchIds.initiate({batch_ids:o},{fixedCacheKey:"cancelByBatchIds"})),{canceled:s}=await a.unwrap();a.reset(),s>0&&(r.debug(`Canceled ${s} canvas batches`),t(qt({title:Y("queue.cancelBatchSucceeded"),status:"success"}))),t(ple())}catch{r.error("Failed to cancel canvas batches"),t(qt({title:Y("queue.cancelBatchFailed"),status:"error"}))}}})};Ne("app/appStarted");const kxe=()=>{Fe({matcher:ve.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==zo({board_id:"none",categories:oi}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Gn.getSelectors().selectAll(i)[0];t(Gs(o??null))}}})},Axe=$o(Xr.endpoints.enqueueBatch.matchFulfilled,Xr.endpoints.enqueueGraph.matchFulfilled),Pxe=()=>{Fe({matcher:Axe,effect:async(e,{dispatch:t,getState:n})=>{const{data:r}=Xr.endpoints.getQueueStatus.select()(n());!r||r.processor.is_started||t(Xr.endpoints.resumeProcessor.initiate(void 0,{fixedCacheKey:"resumeProcessor"}))}})},pG=us.injectEndpoints({endpoints:e=>({getAppVersion:e.query({query:()=>({url:"app/version",method:"GET"}),providesTags:["AppVersion"],keepUnusedDataFor:864e5}),getAppConfig:e.query({query:()=>({url:"app/config",method:"GET"}),providesTags:["AppConfig"],keepUnusedDataFor:864e5}),getInvocationCacheStatus:e.query({query:()=>({url:"app/invocation_cache/status",method:"GET"}),providesTags:["InvocationCacheStatus"]}),clearInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache",method:"DELETE"}),invalidatesTags:["InvocationCacheStatus"]}),enableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/enable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]}),disableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/disable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]})})}),{useGetAppVersionQuery:eKe,useGetAppConfigQuery:tKe,useClearInvocationCacheMutation:nKe,useDisableInvocationCacheMutation:rKe,useEnableInvocationCacheMutation:iKe,useGetInvocationCacheStatusQuery:oKe}=pG,Ixe=()=>{Fe({matcher:pG.endpoints.getAppConfig.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const{infill_methods:r=[],nsfw_methods:i=[],watermarking_methods:o=[]}=e.payload,a=t().generation.infillMethod;r.includes(a)||n(ele(r[0])),i.includes("nsfw_checker")||n(y2e(!1)),o.includes("invisible_watermark")||n(v2e(!1))}})},Rxe=Ne("app/appStarted"),Oxe=()=>{Fe({actionCreator:Rxe,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})},ex={memoizeOptions:{resultEqualityCheck:pk}},gG=(e,t)=>{var f;const{generation:n,canvas:r,nodes:i,controlNet:o}=e,a=((f=n.initialImage)==null?void 0:f.imageName)===t,s=r.layerState.objects.some(h=>h.kind==="image"&&h.imageName===t),l=i.nodes.filter(Ur).some(h=>zf(h.data.inputs,p=>{var m;return p.type==="ImageField"&&((m=p.value)==null?void 0:m.image_name)===t})),u=zf(o.controlNets,h=>h.controlImage===t||h.processedControlImage===t),c=o.ipAdapterInfo.adapterImage===t;return{isInitialImage:a,isCanvasImage:s,isNodesImage:l,isControlNetImage:u,isIPAdapterImage:c}},Mxe=Ii([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>gG(e,r.image_name)):[]},ex),Nxe=()=>{Fe({matcher:ve.endpoints.deleteBoardAndImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{deleted_images:r}=e.payload;let i=!1,o=!1,a=!1,s=!1,l=!1;const u=n();r.forEach(c=>{const d=gG(u,c);d.isInitialImage&&!i&&(t(vk()),i=!0),d.isCanvasImage&&!o&&(t(bk()),o=!0),d.isNodesImage&&!a&&(t(u2e()),a=!0),d.isControlNetImage&&!s&&(t(v0e()),s=!0),d.isIPAdapterImage&&!l&&(t(uU()),l=!0)})}})},$xe=()=>{Fe({matcher:$o(E_,CE),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),a=E_.match(e)?e.payload.boardId:o.gallery.selectedBoardId,l=(CE.match(e)?e.payload:o.gallery.galleryView)==="images"?oi:Ji,u={board_id:a??"none",categories:l};if(await r(()=>ve.endpoints.listImages.select(u)(t()).isSuccess,5e3)){const{data:d}=ve.endpoints.listImages.select(u)(t());if(d){const f=u0.selectAll(d)[0],h=u0.selectById(d,e.payload.selectedImageName);n(Gs(h||f||null))}else n(Gs(null))}else n(Gs(null))}})},Dxe=Ne("canvas/canvasSavedToGallery"),Lxe=Ne("canvas/canvasMaskSavedToGallery"),Fxe=Ne("canvas/canvasCopiedToClipboard"),Bxe=Ne("canvas/canvasDownloadedAsImage"),zxe=Ne("canvas/canvasMerged"),jxe=Ne("canvas/stagingAreaImageSaved"),Uxe=Ne("canvas/canvasMaskToControlNet"),Vxe=Ne("canvas/canvasImageToControlNet");let mG=null,yG=null;const aKe=e=>{mG=e},tx=()=>mG,sKe=e=>{yG=e},Gxe=()=>yG,qxe=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),L_=async(e,t)=>await qxe(e.toCanvas(t)),nx=async(e,t=!1)=>{const n=tx();if(!n)throw new Error("Problem getting base layer blob");const{shouldCropToBoundingBoxOnSave:r,boundingBoxCoordinates:i,boundingBoxDimensions:o}=e.canvas,a=n.clone();a.scale({x:1,y:1});const s=a.getAbsolutePosition(),l=r||t?{x:i.x+s.x,y:i.y+s.y,width:o.width,height:o.height}:a.getClientRect();return L_(a,l)},Hxe=(e,t="image/png")=>{navigator.clipboard.write([new ClipboardItem({[t]:e})])},Wxe=()=>{Fe({actionCreator:Fxe,effect:async(e,{dispatch:t,getState:n})=>{const r=x2.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n();try{const o=nx(i);Hxe(o)}catch(o){r.error(String(o)),t(qt({title:Y("toast.problemCopyingCanvas"),description:Y("toast.problemCopyingCanvasDesc"),status:"error"}));return}t(qt({title:Y("toast.canvasCopiedClipboard"),status:"success"}))}})},Kxe=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),r.remove()},Qxe=()=>{Fe({actionCreator:Bxe,effect:async(e,{dispatch:t,getState:n})=>{const r=x2.get().child({namespace:"canvasSavedToGalleryListener"}),i=n();let o;try{o=await nx(i)}catch(a){r.error(String(a)),t(qt({title:Y("toast.problemDownloadingCanvas"),description:Y("toast.problemDownloadingCanvasDesc"),status:"error"}));return}Kxe(o,"canvas.png"),t(qt({title:Y("toast.canvasDownloaded"),status:"success"}))}})},Xxe=()=>{Fe({actionCreator:Vxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n();let o;try{o=await nx(i,!0)}catch(u){r.error(String(u)),t(qt({title:Y("toast.problemSavingCanvas"),description:Y("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery,s=await t(ve.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"control",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.canvasSentControlnetAssets")}}})).unwrap(),{image_name:l}=s;t(Cc({controlNetId:e.payload.controlNet.controlNetId,controlImage:l}))}})};var _A={exports:{}},rx={},vG={},Rt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;var t=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof yt<"u"?yt:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.2.0",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const r=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(Rt);var fr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Rt;class n{constructor(v=[1,0,0,1,0,0]){this.dirty=!1,this.m=v&&v.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(v){v.m[0]=this.m[0],v.m[1]=this.m[1],v.m[2]=this.m[2],v.m[3]=this.m[3],v.m[4]=this.m[4],v.m[5]=this.m[5]}point(v){var S=this.m;return{x:S[0]*v.x+S[2]*v.y+S[4],y:S[1]*v.x+S[3]*v.y+S[5]}}translate(v,S){return this.m[4]+=this.m[0]*v+this.m[2]*S,this.m[5]+=this.m[1]*v+this.m[3]*S,this}scale(v,S){return this.m[0]*=v,this.m[1]*=v,this.m[2]*=S,this.m[3]*=S,this}rotate(v){var S=Math.cos(v),w=Math.sin(v),x=this.m[0]*S+this.m[2]*w,C=this.m[1]*S+this.m[3]*w,k=this.m[0]*-w+this.m[2]*S,T=this.m[1]*-w+this.m[3]*S;return this.m[0]=x,this.m[1]=C,this.m[2]=k,this.m[3]=T,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(v,S){var w=this.m[0]+this.m[2]*S,x=this.m[1]+this.m[3]*S,C=this.m[2]+this.m[0]*v,k=this.m[3]+this.m[1]*v;return this.m[0]=w,this.m[1]=x,this.m[2]=C,this.m[3]=k,this}multiply(v){var S=this.m[0]*v.m[0]+this.m[2]*v.m[1],w=this.m[1]*v.m[0]+this.m[3]*v.m[1],x=this.m[0]*v.m[2]+this.m[2]*v.m[3],C=this.m[1]*v.m[2]+this.m[3]*v.m[3],k=this.m[0]*v.m[4]+this.m[2]*v.m[5]+this.m[4],T=this.m[1]*v.m[4]+this.m[3]*v.m[5]+this.m[5];return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=k,this.m[5]=T,this}invert(){var v=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),S=this.m[3]*v,w=-this.m[1]*v,x=-this.m[2]*v,C=this.m[0]*v,k=v*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=v*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=k,this.m[5]=T,this}getMatrix(){return this.m}decompose(){var v=this.m[0],S=this.m[1],w=this.m[2],x=this.m[3],C=this.m[4],k=this.m[5],T=v*x-S*w;let P={x:C,y:k,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(v!=0||S!=0){var $=Math.sqrt(v*v+S*S);P.rotation=S>0?Math.acos(v/$):-Math.acos(v/$),P.scaleX=$,P.scaleY=T/$,P.skewX=(v*w+S*x)/T,P.skewY=0}else if(w!=0||x!=0){var O=Math.sqrt(w*w+x*x);P.rotation=Math.PI/2-(x>0?Math.acos(-w/O):-Math.acos(w/O)),P.scaleX=T/O,P.scaleY=O,P.skewX=0,P.skewY=(v*w+S*x)/T}return P.rotation=e.Util._getRotation(P.rotation),P}}e.Transform=n;var r="[object Array]",i="[object Number]",o="[object String]",a="[object Boolean]",s=Math.PI/180,l=180/Math.PI,u="#",c="",d="0",f="Konva warning: ",h="Konva error: ",p="rgb(",m={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,b=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(g){setTimeout(g,60)};e.Util={_isElement(g){return!!(g&&g.nodeType==1)},_isFunction(g){return!!(g&&g.constructor&&g.call&&g.apply)},_isPlainObject(g){return!!g&&g.constructor===Object},_isArray(g){return Object.prototype.toString.call(g)===r},_isNumber(g){return Object.prototype.toString.call(g)===i&&!isNaN(g)&&isFinite(g)},_isString(g){return Object.prototype.toString.call(g)===o},_isBoolean(g){return Object.prototype.toString.call(g)===a},isObject(g){return g instanceof Object},isValidSelector(g){if(typeof g!="string")return!1;var v=g[0];return v==="#"||v==="."||v===v.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){b.push(g),b.length===1&&y(function(){const v=b;b=[],v.forEach(function(S){S()})})},createCanvasElement(){var g=document.createElement("canvas");try{g.style=g.style||{}}catch{}return g},createImageElement(){return document.createElement("img")},_isInDocument(g){for(;g=g.parentNode;)if(g==document)return!0;return!1},_urlToImage(g,v){var S=e.Util.createImageElement();S.onload=function(){v(S)},S.src=g},_rgbToHex(g,v,S){return((1<<24)+(g<<16)+(v<<8)+S).toString(16).slice(1)},_hexToRgb(g){g=g.replace(u,c);var v=parseInt(g,16);return{r:v>>16&255,g:v>>8&255,b:v&255}},getRandomColor(){for(var g=(Math.random()*16777215<<0).toString(16);g.length<6;)g=d+g;return u+g},getRGB(g){var v;return g in m?(v=m[g],{r:v[0],g:v[1],b:v[2]}):g[0]===u?this._hexToRgb(g.substring(1)):g.substr(0,4)===p?(v=_.exec(g.replace(/ /g,"")),{r:parseInt(v[1],10),g:parseInt(v[2],10),b:parseInt(v[3],10)}):{r:0,g:0,b:0}},colorToRGBA(g){return g=g||"black",e.Util._namedColorToRBA(g)||e.Util._hex3ColorToRGBA(g)||e.Util._hex4ColorToRGBA(g)||e.Util._hex6ColorToRGBA(g)||e.Util._hex8ColorToRGBA(g)||e.Util._rgbColorToRGBA(g)||e.Util._rgbaColorToRGBA(g)||e.Util._hslColorToRGBA(g)},_namedColorToRBA(g){var v=m[g.toLowerCase()];return v?{r:v[0],g:v[1],b:v[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];var v=g.split(/ *, */).map(Number);return{r:v[0],g:v[1],b:v[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];var v=g.split(/ *, */).map((S,w)=>S.slice(-1)==="%"?w===3?parseInt(S)/100:parseInt(S)/100*255:Number(S));return{r:v[0],g:v[1],b:v[2],a:v[3]}}},_hex8ColorToRGBA(g){if(g[0]==="#"&&g.length===9)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:parseInt(g.slice(7,9),16)/255}},_hex6ColorToRGBA(g){if(g[0]==="#"&&g.length===7)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:1}},_hex4ColorToRGBA(g){if(g[0]==="#"&&g.length===5)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:parseInt(g[4]+g[4],16)/255}},_hex3ColorToRGBA(g){if(g[0]==="#"&&g.length===4)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:1}},_hslColorToRGBA(g){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(g)){const[v,...S]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(g),w=Number(S[0])/360,x=Number(S[1])/100,C=Number(S[2])/100;let k,T,P;if(x===0)return P=C*255,{r:Math.round(P),g:Math.round(P),b:Math.round(P),a:1};C<.5?k=C*(1+x):k=C+x-C*x;const $=2*C-k,O=[0,0,0];for(let E=0;E<3;E++)T=w+1/3*-(E-1),T<0&&T++,T>1&&T--,6*T<1?P=$+(k-$)*6*T:2*T<1?P=k:3*T<2?P=$+(k-$)*(2/3-T)*6:P=$,O[E]=P*255;return{r:Math.round(O[0]),g:Math.round(O[1]),b:Math.round(O[2]),a:1}}},haveIntersection(g,v){return!(v.x>g.x+g.width||v.x+v.width<g.x||v.y>g.y+g.height||v.y+v.height<g.y)},cloneObject(g){var v={};for(var S in g)this._isPlainObject(g[S])?v[S]=this.cloneObject(g[S]):this._isArray(g[S])?v[S]=this.cloneArray(g[S]):v[S]=g[S];return v},cloneArray(g){return g.slice(0)},degToRad(g){return g*s},radToDeg(g){return g*l},_degToRad(g){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(g)},_radToDeg(g){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(g)},_getRotation(g){return t.Konva.angleDeg?e.Util.radToDeg(g):g},_capitalize(g){return g.charAt(0).toUpperCase()+g.slice(1)},throw(g){throw new Error(h+g)},error(g){console.error(h+g)},warn(g){t.Konva.showWarnings&&console.warn(f+g)},each(g,v){for(var S in g)v(S,g[S])},_inRange(g,v,S){return v<=g&&g<S},_getProjectionToSegment(g,v,S,w,x,C){var k,T,P,$=(g-S)*(g-S)+(v-w)*(v-w);if($==0)k=g,T=v,P=(x-S)*(x-S)+(C-w)*(C-w);else{var O=((x-g)*(S-g)+(C-v)*(w-v))/$;O<0?(k=g,T=v,P=(g-x)*(g-x)+(v-C)*(v-C)):O>1?(k=S,T=w,P=(S-x)*(S-x)+(w-C)*(w-C)):(k=g+O*(S-g),T=v+O*(w-v),P=(k-x)*(k-x)+(T-C)*(T-C))}return[k,T,P]},_getProjectionToLine(g,v,S){var w=e.Util.cloneObject(g),x=Number.MAX_VALUE;return v.forEach(function(C,k){if(!(!S&&k===v.length-1)){var T=v[(k+1)%v.length],P=e.Util._getProjectionToSegment(C.x,C.y,T.x,T.y,g.x,g.y),$=P[0],O=P[1],E=P[2];E<x&&(w.x=$,w.y=O,x=E)}}),w},_prepareArrayForTween(g,v,S){var w,x=[],C=[];if(g.length>v.length){var k=v;v=g,g=k}for(w=0;w<g.length;w+=2)x.push({x:g[w],y:g[w+1]});for(w=0;w<v.length;w+=2)C.push({x:v[w],y:v[w+1]});var T=[];return C.forEach(function(P){var $=e.Util._getProjectionToLine(P,x,S);T.push($.x),T.push($.y)}),T},_prepareToStringify(g){var v;g.visitedByCircularReferenceRemoval=!0;for(var S in g)if(g.hasOwnProperty(S)&&g[S]&&typeof g[S]=="object"){if(v=Object.getOwnPropertyDescriptor(g,S),g[S].visitedByCircularReferenceRemoval||e.Util._isElement(g[S]))if(v.configurable)delete g[S];else return null;else if(e.Util._prepareToStringify(g[S])===null)if(v.configurable)delete g[S];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,v){for(var S in v)g[S]=v[S];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){t.Konva.releaseCanvasOnDestroy&&g.forEach(v=>{v.width=0,v.height=0})},drawRoundedRectPath(g,v,S,w){let x=0,C=0,k=0,T=0;typeof w=="number"?x=C=k=T=Math.min(w,v/2,S/2):(x=Math.min(w[0]||0,v/2,S/2),C=Math.min(w[1]||0,v/2,S/2),T=Math.min(w[2]||0,v/2,S/2),k=Math.min(w[3]||0,v/2,S/2)),g.moveTo(x,0),g.lineTo(v-C,0),g.arc(v-C,C,C,Math.PI*3/2,0,!1),g.lineTo(v,S-T),g.arc(v-T,S-T,T,0,Math.PI/2,!1),g.lineTo(k,S),g.arc(k,S-k,k,Math.PI/2,Math.PI,!1),g.lineTo(0,x),g.arc(x,x,x,Math.PI,Math.PI*3/2,!1)}}})(fr);var ir={},At={},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.getComponentValidator=Xe.getBooleanValidator=Xe.getNumberArrayValidator=Xe.getFunctionValidator=Xe.getStringOrGradientValidator=Xe.getStringValidator=Xe.getNumberOrAutoValidator=Xe.getNumberOrArrayOfNumbersValidator=Xe.getNumberValidator=Xe.alphaComponent=Xe.RGBComponent=void 0;const tu=Rt,br=fr;function nu(e){return br.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||br.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function Yxe(e){return e>255?255:e<0?0:Math.round(e)}Xe.RGBComponent=Yxe;function Zxe(e){return e>1?1:e<1e-4?1e-4:e}Xe.alphaComponent=Zxe;function Jxe(){if(tu.Konva.isUnminified)return function(e,t){return br.Util._isNumber(e)||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Xe.getNumberValidator=Jxe;function ewe(e){if(tu.Konva.isUnminified)return function(t,n){let r=br.Util._isNumber(t),i=br.Util._isArray(t)&&t.length==e;return!r&&!i&&br.Util.warn(nu(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Xe.getNumberOrArrayOfNumbersValidator=ewe;function twe(){if(tu.Konva.isUnminified)return function(e,t){var n=br.Util._isNumber(e),r=e==="auto";return n||r||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Xe.getNumberOrAutoValidator=twe;function nwe(){if(tu.Konva.isUnminified)return function(e,t){return br.Util._isString(e)||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Xe.getStringValidator=nwe;function rwe(){if(tu.Konva.isUnminified)return function(e,t){const n=br.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Xe.getStringOrGradientValidator=rwe;function iwe(){if(tu.Konva.isUnminified)return function(e,t){return br.Util._isFunction(e)||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Xe.getFunctionValidator=iwe;function owe(){if(tu.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(br.Util._isArray(e)?e.forEach(function(r){br.Util._isNumber(r)||br.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Xe.getNumberArrayValidator=owe;function awe(){if(tu.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Xe.getBooleanValidator=awe;function swe(e){if(tu.Konva.isUnminified)return function(t,n){return t==null||br.Util.isObject(t)||br.Util.warn(nu(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Xe.getComponentValidator=swe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=fr,n=Xe;var r="get",i="set";e.Factory={addGetterSetter(o,a,s,l,u){e.Factory.addGetter(o,a,s),e.Factory.addSetter(o,a,l,u),e.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,s){var l=r+t.Util._capitalize(a);o.prototype[l]=o.prototype[l]||function(){var u=this.attrs[a];return u===void 0?s:u}},addSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]||e.Factory.overWriteSetter(o,a,s,l)},overWriteSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]=function(c){return s&&c!==void 0&&c!==null&&(c=s.call(this,c,a)),this._setAttr(a,c),l&&l.call(this),this}},addComponentsGetterSetter(o,a,s,l,u){var c=s.length,d=t.Util._capitalize,f=r+d(a),h=i+d(a),p,m;o.prototype[f]=function(){var b={};for(p=0;p<c;p++)m=s[p],b[m]=this.getAttr(a+d(m));return b};var _=(0,n.getComponentValidator)(s);o.prototype[h]=function(b){var y=this.attrs[a],g;l&&(b=l.call(this,b)),_&&_.call(this,b,a);for(g in b)b.hasOwnProperty(g)&&this._setAttr(a+d(g),b[g]);return b||s.forEach(v=>{this._setAttr(a+d(v),void 0)}),this._fireChangeEvent(a,y,b),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){var s=t.Util._capitalize(a),l=i+s,u=r+s;o.prototype[a]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,a,s,l){t.Util.error("Adding deprecated "+a);var u=r+t.Util._capitalize(a),c=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(c);var d=this.attrs[a];return d===void 0?s:d},e.Factory.addSetter(o,a,l,function(){t.Util.error(c)}),e.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){t.Util.each(a,function(s,l){var u=o.prototype[l],c=r+t.Util._capitalize(s),d=i+t.Util._capitalize(s);function f(){u.apply(this,arguments),t.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[s]=f,o.prototype[c]=f,o.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}})(At);var os={},Dl={};Object.defineProperty(Dl,"__esModule",{value:!0});Dl.HitContext=Dl.SceneContext=Dl.Context=void 0;const bG=fr,lwe=Rt;function uwe(e){var t=[],n=e.length,r=bG.Util,i,o;for(i=0;i<n;i++)o=e[i],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),t.push(o);return t}var rO=",",cwe="(",dwe=")",fwe="([",hwe="])",pwe=";",gwe="()",mwe="=",iO=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],ywe=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const vwe=100;class ix{constructor(t){this.canvas=t,lwe.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,i=r.length,o="",a,s,l,u;for(a=0;a<i;a++)s=r[a],l=s.method,l?(u=s.args,o+=l,t?o+=gwe:bG.Util._isArray(u[0])?o+=fwe+u.join(rO)+hwe:(n&&(u=u.map(c=>typeof c=="number"?Math.floor(c):c)),o+=cwe+u.join(rO)+dwe)):(o+=s.property,t||(o+=mwe+s.val)),o+=pwe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=vwe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var c=arguments,d=this._context;c.length===3?d.drawImage(t,n,r):c.length===5?d.drawImage(t,n,r,i,o):c.length===9&&d.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=iO.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=uwe(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i<n;i++)a(iO[i]);t.setAttr=function(){r.apply(t,arguments);var s=arguments[0],l=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:s,val:l})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}Dl.Context=ix;ywe.forEach(function(e){Object.defineProperty(ix.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class bwe extends ix{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):o?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(var a=0;a<i.length;a+=2)o.addColorStop(i[a],i[a+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,i,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,s=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},l=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),c=l.x*u,d=l.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",s.x*c),this.setAttr("shadowOffsetY",s.y*d)}}Dl.SceneContext=bwe;class _we extends ix{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const o=t.getStrokeScaleEnabled();if(!o){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),i=r==="auto"?t.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),o||this.restore()}}}Dl.HitContext=_we;Object.defineProperty(os,"__esModule",{value:!0});os.HitCanvas=os.SceneCanvas=os.Canvas=void 0;const F_=fr,_G=Dl,SG=Rt,Swe=At,xwe=Xe;var Bv;function wwe(){if(Bv)return Bv;var e=F_.Util.createCanvasElement(),t=e.getContext("2d");return Bv=function(){var n=SG.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),F_.Util.releaseCanvas(e),Bv}class ox{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||SG.Konva.pixelRatio||wwe();this.pixelRatio=r,this._canvas=F_.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var n=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,n){this.setWidth(t||0),this.setHeight(n||0)}toDataURL(t,n){try{return this._canvas.toDataURL(t,n)}catch{try{return this._canvas.toDataURL()}catch(i){return F_.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}os.Canvas=ox;Swe.Factory.addGetterSetter(ox,"pixelRatio",void 0,(0,xwe.getNumberValidator)());class Cwe extends ox{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new _G.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}os.SceneCanvas=Cwe;class Ewe extends ox{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new _G.HitContext(this),this.setSize(t.width,t.height)}}os.HitCanvas=Ewe;var ax={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Rt,n=fr;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];e.DD._dragElements.forEach((o,a)=>{const{node:s}=o,l=s.getStage();l.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(f=>f.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var c=s.dragDistance(),d=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(d<c||(s.startDrag({evt:r}),!s.isDragging()))return}s._setDragPosition(r,o),i.push(s)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];e.DD._dragElements.forEach(o=>{const{node:a}=o,s=a.getStage();if(r&&s.setPointersPositions(r),!s._changedPointerPositions.find(c=>c.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,o.dragStatus="stopped");const u=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;u&&i.indexOf(u)===-1&&i.push(u)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(ax);Object.defineProperty(ir,"__esModule",{value:!0});ir.Node=void 0;const $t=fr,Cy=At,zv=os,Dc=Rt,la=ax,kr=Xe;var G1="absoluteOpacity",jv="allEventListeners",ml="absoluteTransform",oO="absoluteScale",Lc="canvas",Twe="Change",kwe="children",Awe="konva",KE="listening",aO="mouseenter",sO="mouseleave",lO="set",uO="Shape",q1=" ",cO="stage",mu="transform",Pwe="Stage",QE="visible",Iwe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(q1);let Rwe=1;class ht{constructor(t){this._id=Rwe++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===mu||t===ml)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===mu||t===ml,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(q1);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Lc)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===ml&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Lc)){const{scene:t,filter:n,hit:r}=this._cache.get(Lc);$t.Util.releaseCanvas(t,n,r),this._cache.delete(Lc)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,c=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!i||!o){$t.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var f=new zv.SceneCanvas({pixelRatio:a,width:i,height:o}),h=new zv.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),p=new zv.HitCanvas({pixelRatio:d,width:i,height:o}),m=f.getContext(),_=p.getContext();return p.isCache=!0,f.isCache=!0,this._cache.delete(Lc),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),m.save(),_.save(),m.translate(-s,-l),_.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(G1),this._clearSelfAndDescendantCache(oO),this.drawScene(f,this),this.drawHit(p,this),this._isUnderCache=!1,m.restore(),_.restore(),c&&(m.save(),m.beginPath(),m.rect(0,0,i,o),m.closePath(),m.setAttr("strokeStyle","red"),m.setAttr("lineWidth",5),m.stroke(),m.restore()),this._cache.set(Lc,{scene:f,filter:h,hit:p,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Lc)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var c=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/c,r.getHeight()/c),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l<a;l++){if(u=t[l],typeof u!="function"){$t.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,s),o.putImageData(s,0,0)}}catch(d){$t.Util.error("Unable to apply filter. "+d.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(t,n){if(this._cache&&this._cache.delete(jv),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(q1),i=r.length,o,a,s,l,u;for(o=0;o<i;o++)a=r[o],s=a.split("."),l=s[0],u=s[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(q1),i=r.length,o,a,s,l,u,c;if(this._cache&&this._cache.delete(jv),!t)for(a in this.eventListeners)this._off(a);for(o=0;o<i;o++)if(s=r[o],l=s.split("."),u=l[0],c=l[1],u)this.eventListeners[u]&&this._off(u,c,n);else for(a in this.eventListeners)this._off(a,c,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var i=this;this.on(t,function(o){for(var a=o.target.findAncestors(n,!0,i),s=0;s<a.length;s++)o=$t.Util.cloneObject(o),o.currentTarget=a[s],r.call(a[s],o)})}remove(){return this.isDragging()&&this.stopDrag(),la.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ml),this._clearSelfAndDescendantCache(G1),this._clearSelfAndDescendantCache(oO),this._clearSelfAndDescendantCache(cO),this._clearSelfAndDescendantCache(QE),this._clearSelfAndDescendantCache(KE)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var n="get"+$t.Util._capitalize(t);return $t.Util._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),n=[];t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var n,r;if(!t)return this;for(n in t)n!==kwe&&(r=lO+$t.Util._capitalize(n),$t.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(KE,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(QE,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;la.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!Dc.Konva.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a<o;a++)s=u[a],r++,s.nodeType!==uO&&(i=i.concat(s.getChildren().slice())),s._id===n._id&&(a=o);i.length>0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==Pwe&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(mu),this._clearSelfAndDescendantCache(ml)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new $t.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(mu);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(mu),this._clearSelfAndDescendantCache(ml),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a<o;a++)t(r[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return $t.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return $t.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return $t.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return $t.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return $t.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&$t.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(G1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=$t.Util.isObject(i)&&!$t.Util._isPlainObject(i)&&!$t.Util._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),$t.Util._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],$t.Util.isValidSelector(o)||($t.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),$t.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),$t.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(cO,this._getStage)}_getStage(){var t=this.getParent();if(t)return t.getStage()}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(ml,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new $t.Transform,this._eachAncestorReverse(function(i){var o=i.transformsEnabled();o==="all"?n.multiply(i.getTransform()):o==="position"&&n.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),n;n=this._cache.get(ml)||new $t.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,a=this.attrs.offsetX||0,s=this.attrs.offsetY||0;n.translate(i-a,o-s)}return n.dirty=!1,n}getAbsoluteScale(t){for(var n=this;n;)n._isUnderCache&&(t=n),n=n.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(mu,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(mu)||new $t.Transform;r.reset();var i=this.x(),o=this.y(),a=Dc.Konva.getAngle(this.rotation()),s=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,u=this.attrs.skewX||0,c=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),a!==0&&r.rotate(a),(u!==0||c!==0)&&r.skew(u,c),(s!==1||l!==1)&&r.scale(s,l),(d!==0||f!==0)&&r.translate(-1*d,-1*f),r.dirty=!1,r}clone(t){var n=$t.Util.cloneObject(this.attrs),r,i,o,a,s;for(r in t)n[r]=t[r];var l=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,a=0;a<o;a++)s=i[a],s.name.indexOf(Awe)<0&&(l.eventListeners[r]||(l.eventListeners[r]=[]),l.eventListeners[r].push(s));return l}_toKonvaCanvas(t){t=t||{};var n=this.getClientRect(),r=this.getStage(),i=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),a=t.pixelRatio||1,s=new zv.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),l=s.getContext();return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(i||o)&&l.translate(-1*i,-1*o),this.drawScene(s),l.restore(),s}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var n=t.mimeType||null,r=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(i),i}toImage(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,$t.Util._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Dc.Konva.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o<i.length;o++)if(a=i[o].name,s=i[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===s)){if(i.splice(o,1),i.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+Twe,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){var n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();if(!n)return!1;var r=(n||"").split(/\s/g);return r.indexOf(t)!==-1}removeName(t){var n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){var r=this[lO+$t.Util._capitalize(t)];return $t.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(Dc.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!$t.Util.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){var i;r!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,i,r))}_fireAndBubble(t,n,r){n&&this.nodeType===uO&&(n.target=this);var i=(t===aO||t===sO)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===aO||t===sO)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r,i;const o=(n=this._cache.get(jv))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[t];if(a===void 0){a=[];let s=Object.getPrototypeOf(this);for(;s;){const l=(i=(r=s.eventListeners)===null||r===void 0?void 0:r[t])!==null&&i!==void 0?i:[];a.push(...l),s=Object.getPrototypeOf(s)}o[t]=a,this._cache.set(jv,o)}return a}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition(),o=r._getPointerById(n)||r._changedPointerPositions[0]||i;la.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(t,n=!0){la.DD._dragElements.has(this._id)||this._createDragElement(t);const r=la.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(r){var i={x:r.x-n.offset.x,y:r.y-n.offset.y},o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,i,t);a?i=a:$t.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const n=la.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),la.DD._endDragBefore(t),la.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=la.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var n=t.evt.button!==void 0,r=!n||Dc.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;la.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=la.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&la.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return $t.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return $t.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=ht.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),Dc.Konva[r]||($t.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=Dc.Konva[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s<a;s++)o.add(ht._createNode(i[s]));return o}}ir.Node=ht;ht.prototype.nodeType="Node";ht.prototype._attrsAffectingSize=[];ht.prototype.eventListeners={};ht.prototype.on.call(ht.prototype,Iwe,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(mu),this._clearSelfAndDescendantCache(ml)});ht.prototype.on.call(ht.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(QE)});ht.prototype.on.call(ht.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(KE)});ht.prototype.on.call(ht.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(G1)});const Rn=Cy.Factory.addGetterSetter;Rn(ht,"zIndex");Rn(ht,"absolutePosition");Rn(ht,"position");Rn(ht,"x",0,(0,kr.getNumberValidator)());Rn(ht,"y",0,(0,kr.getNumberValidator)());Rn(ht,"globalCompositeOperation","source-over",(0,kr.getStringValidator)());Rn(ht,"opacity",1,(0,kr.getNumberValidator)());Rn(ht,"name","",(0,kr.getStringValidator)());Rn(ht,"id","",(0,kr.getStringValidator)());Rn(ht,"rotation",0,(0,kr.getNumberValidator)());Cy.Factory.addComponentsGetterSetter(ht,"scale",["x","y"]);Rn(ht,"scaleX",1,(0,kr.getNumberValidator)());Rn(ht,"scaleY",1,(0,kr.getNumberValidator)());Cy.Factory.addComponentsGetterSetter(ht,"skew",["x","y"]);Rn(ht,"skewX",0,(0,kr.getNumberValidator)());Rn(ht,"skewY",0,(0,kr.getNumberValidator)());Cy.Factory.addComponentsGetterSetter(ht,"offset",["x","y"]);Rn(ht,"offsetX",0,(0,kr.getNumberValidator)());Rn(ht,"offsetY",0,(0,kr.getNumberValidator)());Rn(ht,"dragDistance",null,(0,kr.getNumberValidator)());Rn(ht,"width",0,(0,kr.getNumberValidator)());Rn(ht,"height",0,(0,kr.getNumberValidator)());Rn(ht,"listening",!0,(0,kr.getBooleanValidator)());Rn(ht,"preventDefault",!0,(0,kr.getBooleanValidator)());Rn(ht,"filters",null,function(e){return this._filterUpToDate=!1,e});Rn(ht,"visible",!0,(0,kr.getBooleanValidator)());Rn(ht,"transformsEnabled","all",(0,kr.getStringValidator)());Rn(ht,"size");Rn(ht,"dragBoundFunc");Rn(ht,"draggable",!1,(0,kr.getBooleanValidator)());Cy.Factory.backCompat(ht,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Gd={};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.Container=void 0;const Sp=At,KC=ir,sx=Xe;let qd=class extends KC.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const n=this.children||[];var r=[];return n.forEach(function(i){t(i)&&r.push(i)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var n=0;n<t.length;n++)this.add(t[n]);return this}const r=t[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var n=this._generalFind(t,!0);return n.length>0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=KC.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=KC.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const c=r===this;if(u){o.save();var d=this.getAbsoluteTransform(r),f=d.getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath();let _;if(l)_=l.call(this,o,this);else{var h=this.clipX(),p=this.clipY();o.rect(h,p,a,s)}o.clip.apply(o,_),f=d.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var m=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(_){_[t](n,r)}),m&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(m){if(m.visible()){var _=m.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,s=_.x+_.width,l=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),s=Math.max(s,_.x+_.width),l=Math.max(l,_.y+_.height)))}});for(var d=this.find("Shape"),f=!1,h=0;h<d.length;h++){var p=d[h];if(p._isVisible(this)){f=!0;break}}return f&&o!==void 0?u={x:o,y:a,width:s-o,height:l-a}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,i)}};Gd.Container=qd;Sp.Factory.addComponentsGetterSetter(qd,"clip",["x","y","width","height"]);Sp.Factory.addGetterSetter(qd,"clipX",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipY",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipWidth",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipHeight",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipFunc");var xG={},qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.releaseCapture=qo.setPointerCapture=qo.hasPointerCapture=qo.createEvent=qo.getCapturedShape=void 0;const Owe=Rt,b0=new Map,wG=Owe.Konva._global.PointerEvent!==void 0;function Mwe(e){return b0.get(e)}qo.getCapturedShape=Mwe;function SA(e){return{evt:e,pointerId:e.pointerId}}qo.createEvent=SA;function Nwe(e,t){return b0.get(e)===t}qo.hasPointerCapture=Nwe;function $we(e,t){CG(e),t.getStage()&&(b0.set(e,t),wG&&t._fire("gotpointercapture",SA(new PointerEvent("gotpointercapture"))))}qo.setPointerCapture=$we;function CG(e,t){const n=b0.get(e);if(!n)return;const r=n.getStage();r&&r.content,b0.delete(e),wG&&n._fire("lostpointercapture",SA(new PointerEvent("lostpointercapture")))}qo.releaseCapture=CG;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=fr,n=At,r=Gd,i=Rt,o=os,a=ax,s=Rt,l=qo;var u="Stage",c="string",d="px",f="mouseout",h="mouseleave",p="mouseover",m="mouseenter",_="mousemove",b="mousedown",y="mouseup",g="pointermove",v="pointerdown",S="pointerup",w="pointercancel",x="lostpointercapture",C="pointerout",k="pointerleave",T="pointerover",P="pointerenter",$="contextmenu",O="touchstart",E="touchend",A="touchmove",D="touchcancel",L="wheel",M=5,R=[[m,"_pointerenter"],[b,"_pointerdown"],[_,"_pointermove"],[y,"_pointerup"],[h,"_pointerleave"],[O,"_pointerdown"],[A,"_pointermove"],[E,"_pointerup"],[D,"_pointercancel"],[p,"_pointerover"],[L,"_wheel"],[$,"_contextmenu"],[v,"_pointerdown"],[g,"_pointermove"],[S,"_pointerup"],[w,"_pointercancel"],[x,"_lostpointercapture"]];const N={mouse:{[C]:f,[k]:h,[T]:p,[P]:m,[g]:_,[v]:b,[S]:y,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C]:"touchout",[k]:"touchleave",[T]:"touchover",[P]:"touchenter",[g]:A,[v]:O,[S]:E,[w]:D,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[C]:C,[k]:k,[T]:T,[P]:P,[g]:g,[v]:v,[S]:S,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},B=J=>J.indexOf("pointer")>=0?"pointer":J.indexOf("touch")>=0?"touch":"mouse",U=J=>{const j=B(J);if(j==="pointer")return i.Konva.pointerEventsEnabled&&N.pointer;if(j==="touch")return N.touch;if(j==="mouse")return N.mouse};function G(J={}){return(J.clipFunc||J.clipWidth||J.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),J}const Z="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class ee extends r.Container{constructor(j){super(G(j)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{G(this.attrs)}),this._checkVisibility()}_validateAdd(j){const Q=j.getType()==="Layer",ne=j.getType()==="FastLayer";Q||ne||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const j=this.visible()?"":"none";this.content.style.display=j}setContainer(j){if(typeof j===c){if(j.charAt(0)==="."){var Q=j.slice(1);j=document.getElementsByClassName(Q)[0]}else{var ne;j.charAt(0)!=="#"?ne=j:ne=j.slice(1),j=document.getElementById(ne)}if(!j)throw"Can not find container in document with id "+ne}return this._setAttr("container",j),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),j.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var j=this.children,Q=j.length,ne;for(ne=0;ne<Q;ne++)j[ne].clear();return this}clone(j){return j||(j={}),j.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,j)}destroy(){super.destroy();var j=this.content;j&&t.Util._isInDocument(j)&&this.container().removeChild(j);var Q=e.stages.indexOf(this);return Q>-1&&e.stages.splice(Q,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const j=this._pointerPositions[0]||this._changedPointerPositions[0];return j?{x:j.x,y:j.y}:(t.Util.warn(Z),null)}_getPointerById(j){return this._pointerPositions.find(Q=>Q.id===j)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(j){j=j||{},j.x=j.x||0,j.y=j.y||0,j.width=j.width||this.width(),j.height=j.height||this.height();var Q=new o.SceneCanvas({width:j.width,height:j.height,pixelRatio:j.pixelRatio||1}),ne=Q.getContext()._context,se=this.children;return(j.x||j.y)&&ne.translate(-1*j.x,-1*j.y),se.forEach(function(ye){if(ye.isVisible()){var ce=ye._toKonvaCanvas(j);ne.drawImage(ce._canvas,j.x,j.y,ce.getWidth()/ce.getPixelRatio(),ce.getHeight()/ce.getPixelRatio())}}),Q}getIntersection(j){if(!j)return null;var Q=this.children,ne=Q.length,se=ne-1,ye;for(ye=se;ye>=0;ye--){const ce=Q[ye].getIntersection(j);if(ce)return ce}return null}_resizeDOM(){var j=this.width(),Q=this.height();this.content&&(this.content.style.width=j+d,this.content.style.height=Q+d),this.bufferCanvas.setSize(j,Q),this.bufferHitCanvas.setSize(j,Q),this.children.forEach(ne=>{ne.setSize({width:j,height:Q}),ne.draw()})}add(j,...Q){if(arguments.length>1){for(var ne=0;ne<arguments.length;ne++)this.add(arguments[ne]);return this}super.add(j);var se=this.children.length;return se>M&&t.Util.warn("The stage has "+se+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),j.setSize({width:this.width(),height:this.height()}),j.draw(),i.Konva.isBrowser&&this.content.appendChild(j.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(j){return l.hasPointerCapture(j,this)}setPointerCapture(j){l.setPointerCapture(j,this)}releaseCapture(j){l.releaseCapture(j,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&R.forEach(([j,Q])=>{this.content.addEventListener(j,ne=>{this[Q](ne)},{passive:!1})})}_pointerenter(j){this.setPointersPositions(j);const Q=U(j.type);this._fire(Q.pointerenter,{evt:j,target:this,currentTarget:this})}_pointerover(j){this.setPointersPositions(j);const Q=U(j.type);this._fire(Q.pointerover,{evt:j,target:this,currentTarget:this})}_getTargetShape(j){let Q=this[j+"targetShape"];return Q&&!Q.getStage()&&(Q=null),Q}_pointerleave(j){const Q=U(j.type),ne=B(j.type);if(Q){this.setPointersPositions(j);var se=this._getTargetShape(ne),ye=!a.DD.isDragging||i.Konva.hitOnDragEnabled;se&&ye?(se._fireAndBubble(Q.pointerout,{evt:j}),se._fireAndBubble(Q.pointerleave,{evt:j}),this._fire(Q.pointerleave,{evt:j,target:this,currentTarget:this}),this[ne+"targetShape"]=null):ye&&(this._fire(Q.pointerleave,{evt:j,target:this,currentTarget:this}),this._fire(Q.pointerout,{evt:j,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(j){const Q=U(j.type),ne=B(j.type);if(Q){this.setPointersPositions(j);var se=!1;this._changedPointerPositions.forEach(ye=>{var ce=this.getIntersection(ye);if(a.DD.justDragged=!1,i.Konva["_"+ne+"ListenClick"]=!0,!(ce&&ce.isListening()))return;i.Konva.capturePointerEventsEnabled&&ce.setPointerCapture(ye.id),this[ne+"ClickStartShape"]=ce,ce._fireAndBubble(Q.pointerdown,{evt:j,pointerId:ye.id}),se=!0;const ot=j.type.indexOf("touch")>=0;ce.preventDefault()&&j.cancelable&&ot&&j.preventDefault()}),se||this._fire(Q.pointerdown,{evt:j,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(j){const Q=U(j.type),ne=B(j.type);if(!Q)return;a.DD.isDragging&&a.DD.node.preventDefault()&&j.cancelable&&j.preventDefault(),this.setPointersPositions(j);var se=!a.DD.isDragging||i.Konva.hitOnDragEnabled;if(!se)return;var ye={};let ce=!1;var bt=this._getTargetShape(ne);this._changedPointerPositions.forEach(ot=>{const ze=l.getCapturedShape(ot.id)||this.getIntersection(ot),mt=ot.id,Pe={evt:j,pointerId:mt};var en=bt!==ze;if(en&&bt&&(bt._fireAndBubble(Q.pointerout,Object.assign({},Pe),ze),bt._fireAndBubble(Q.pointerleave,Object.assign({},Pe),ze)),ze){if(ye[ze._id])return;ye[ze._id]=!0}ze&&ze.isListening()?(ce=!0,en&&(ze._fireAndBubble(Q.pointerover,Object.assign({},Pe),bt),ze._fireAndBubble(Q.pointerenter,Object.assign({},Pe),bt),this[ne+"targetShape"]=ze),ze._fireAndBubble(Q.pointermove,Object.assign({},Pe))):bt&&(this._fire(Q.pointerover,{evt:j,target:this,currentTarget:this,pointerId:mt}),this[ne+"targetShape"]=null)}),ce||this._fire(Q.pointermove,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(j){const Q=U(j.type),ne=B(j.type);if(!Q)return;this.setPointersPositions(j);const se=this[ne+"ClickStartShape"],ye=this[ne+"ClickEndShape"];var ce={};let bt=!1;this._changedPointerPositions.forEach(ot=>{const ze=l.getCapturedShape(ot.id)||this.getIntersection(ot);if(ze){if(ze.releaseCapture(ot.id),ce[ze._id])return;ce[ze._id]=!0}const mt=ot.id,Pe={evt:j,pointerId:mt};let en=!1;i.Konva["_"+ne+"InDblClickWindow"]?(en=!0,clearTimeout(this[ne+"DblTimeout"])):a.DD.justDragged||(i.Konva["_"+ne+"InDblClickWindow"]=!0,clearTimeout(this[ne+"DblTimeout"])),this[ne+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ne+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),ze&&ze.isListening()?(bt=!0,this[ne+"ClickEndShape"]=ze,ze._fireAndBubble(Q.pointerup,Object.assign({},Pe)),i.Konva["_"+ne+"ListenClick"]&&se&&se===ze&&(ze._fireAndBubble(Q.pointerclick,Object.assign({},Pe)),en&&ye&&ye===ze&&ze._fireAndBubble(Q.pointerdblclick,Object.assign({},Pe)))):(this[ne+"ClickEndShape"]=null,i.Konva["_"+ne+"ListenClick"]&&this._fire(Q.pointerclick,{evt:j,target:this,currentTarget:this,pointerId:mt}),en&&this._fire(Q.pointerdblclick,{evt:j,target:this,currentTarget:this,pointerId:mt}))}),bt||this._fire(Q.pointerup,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ne+"ListenClick"]=!1,j.cancelable&&ne!=="touch"&&j.preventDefault()}_contextmenu(j){this.setPointersPositions(j);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble($,{evt:j}):this._fire($,{evt:j,target:this,currentTarget:this})}_wheel(j){this.setPointersPositions(j);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(L,{evt:j}):this._fire(L,{evt:j,target:this,currentTarget:this})}_pointercancel(j){this.setPointersPositions(j);const Q=l.getCapturedShape(j.pointerId)||this.getIntersection(this.getPointerPosition());Q&&Q._fireAndBubble(S,l.createEvent(j)),l.releaseCapture(j.pointerId)}_lostpointercapture(j){l.releaseCapture(j.pointerId)}setPointersPositions(j){var Q=this._getContentPosition(),ne=null,se=null;j=j||window.event,j.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(j.touches,ye=>{this._pointerPositions.push({id:ye.identifier,x:(ye.clientX-Q.left)/Q.scaleX,y:(ye.clientY-Q.top)/Q.scaleY})}),Array.prototype.forEach.call(j.changedTouches||j.touches,ye=>{this._changedPointerPositions.push({id:ye.identifier,x:(ye.clientX-Q.left)/Q.scaleX,y:(ye.clientY-Q.top)/Q.scaleY})})):(ne=(j.clientX-Q.left)/Q.scaleX,se=(j.clientY-Q.top)/Q.scaleY,this.pointerPos={x:ne,y:se},this._pointerPositions=[{x:ne,y:se,id:t.Util._getFirstPointerId(j)}],this._changedPointerPositions=[{x:ne,y:se,id:t.Util._getFirstPointerId(j)}])}_setPointerPosition(j){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(j)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var j=this.content.getBoundingClientRect();return{top:j.top,left:j.left,scaleX:j.width/this.content.clientWidth||1,scaleY:j.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var j=this.container();if(!j)throw"Stage has no container. A container is required.";j.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),j.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(j){j.batchDraw()}),this}}e.Stage=ee,ee.prototype.nodeType=u,(0,s._registerNode)(ee),n.Factory.addGetterSetter(ee,"container")})(xG);var Ey={},Zr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Rt,n=fr,r=At,i=ir,o=Xe,a=Rt,s=qo;var l="hasShadow",u="shadowRGBA",c="patternImage",d="linearGradient",f="radialGradient";let h;function p(){return h||(h=n.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function m(k){const T=this.attrs.fillRule;T?k.fill(T):k.fill()}function _(k){k.stroke()}function b(k){k.fill()}function y(k){k.stroke()}function g(){this._clearCache(l)}function v(){this._clearCache(u)}function S(){this._clearCache(c)}function w(){this._clearCache(d)}function x(){this._clearCache(f)}class C extends i.Node{constructor(T){super(T);let P;for(;P=n.Util.getRandomColor(),!(P&&!(P in e.shapes)););this.colorKey=P,e.shapes[P]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(l,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var T=p();const P=T.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(P&&P.setTransform){const $=new n.Transform;$.translate(this.fillPatternX(),this.fillPatternY()),$.rotate(t.Konva.getAngle(this.fillPatternRotation())),$.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),$.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const O=$.getMatrix(),E=typeof DOMMatrix>"u"?{a:O[0],b:O[1],c:O[2],d:O[3],e:O[4],f:O[5]}:new DOMMatrix(O);P.setTransform(E)}return P}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var T=this.fillLinearGradientColorStops();if(T){for(var P=p(),$=this.fillLinearGradientStartPoint(),O=this.fillLinearGradientEndPoint(),E=P.createLinearGradient($.x,$.y,O.x,O.y),A=0;A<T.length;A+=2)E.addColorStop(T[A],T[A+1]);return E}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var T=this.fillRadialGradientColorStops();if(T){for(var P=p(),$=this.fillRadialGradientStartPoint(),O=this.fillRadialGradientEndPoint(),E=P.createRadialGradient($.x,$.y,this.fillRadialGradientStartRadius(),O.x,O.y,this.fillRadialGradientEndRadius()),A=0;A<T.length;A+=2)E.addColorStop(T[A],T[A+1]);return E}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var T=n.Util.colorToRGBA(this.shadowColor());if(T)return"rgba("+T.r+","+T.g+","+T.b+","+T.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const T=this.hitStrokeWidth();return T==="auto"?this.hasStroke():this.strokeEnabled()&&!!T}intersects(T){var P=this.getStage(),$=P.bufferHitCanvas,O;return $.getContext().clear(),this.drawHit($,null,!0),O=$.context.getImageData(Math.round(T.x),Math.round(T.y),1,1).data,O[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(T){var P;if(!this.getStage()||!((P=this.attrs.perfectDrawEnabled)!==null&&P!==void 0?P:!0))return!1;const O=T||this.hasFill(),E=this.hasStroke(),A=this.getAbsoluteOpacity()!==1;if(O&&E&&A)return!0;const D=this.hasShadow(),L=this.shadowForStrokeEnabled();return!!(O&&E&&D&&L)}setStrokeHitEnabled(T){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),T?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var T=this.size();return{x:this._centroid?-T.width/2:0,y:this._centroid?-T.height/2:0,width:T.width,height:T.height}}getClientRect(T={}){const P=T.skipTransform,$=T.relativeTo,O=this.getSelfRect(),A=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=O.width+A,L=O.height+A,M=!T.skipShadow&&this.hasShadow(),R=M?this.shadowOffsetX():0,N=M?this.shadowOffsetY():0,B=D+Math.abs(R),U=L+Math.abs(N),G=M&&this.shadowBlur()||0,Z=B+G*2,ee=U+G*2,J={width:Z,height:ee,x:-(A/2+G)+Math.min(R,0)+O.x,y:-(A/2+G)+Math.min(N,0)+O.y};return P?J:this._transformedRect(J,$)}drawScene(T,P){var $=this.getLayer(),O=T||$.getCanvas(),E=O.getContext(),A=this._getCanvasCache(),D=this.getSceneFunc(),L=this.hasShadow(),M,R,N,B=O.isCache,U=P===this;if(!this.isVisible()&&!U)return this;if(A){E.save();var G=this.getAbsoluteTransform(P).getMatrix();return E.transform(G[0],G[1],G[2],G[3],G[4],G[5]),this._drawCachedSceneCanvas(E),E.restore(),this}if(!D)return this;if(E.save(),this._useBufferCanvas()&&!B){M=this.getStage(),R=M.bufferCanvas,N=R.getContext(),N.clear(),N.save(),N._applyLineJoin(this);var Z=this.getAbsoluteTransform(P).getMatrix();N.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),D.call(this,N,this),N.restore();var ee=R.pixelRatio;L&&E._applyShadow(this),E._applyOpacity(this),E._applyGlobalCompositeOperation(this),E.drawImage(R._canvas,0,0,R.width/ee,R.height/ee)}else{if(E._applyLineJoin(this),!U){var Z=this.getAbsoluteTransform(P).getMatrix();E.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),E._applyOpacity(this),E._applyGlobalCompositeOperation(this)}L&&E._applyShadow(this),D.call(this,E,this)}return E.restore(),this}drawHit(T,P,$=!1){if(!this.shouldDrawHit(P,$))return this;var O=this.getLayer(),E=T||O.hitCanvas,A=E&&E.getContext(),D=this.hitFunc()||this.sceneFunc(),L=this._getCanvasCache(),M=L&&L.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),M){A.save();var R=this.getAbsoluteTransform(P).getMatrix();return A.transform(R[0],R[1],R[2],R[3],R[4],R[5]),this._drawCachedHitCanvas(A),A.restore(),this}if(!D)return this;if(A.save(),A._applyLineJoin(this),!(this===P)){var B=this.getAbsoluteTransform(P).getMatrix();A.transform(B[0],B[1],B[2],B[3],B[4],B[5])}return D.call(this,A,this),A.restore(),this}drawHitFromCache(T=0){var P=this._getCanvasCache(),$=this._getCachedSceneCanvas(),O=P.hit,E=O.getContext(),A=O.getWidth(),D=O.getHeight(),L,M,R,N,B,U;E.clear(),E.drawImage($._canvas,0,0,A,D);try{for(L=E.getImageData(0,0,A,D),M=L.data,R=M.length,N=n.Util._hexToRgb(this.colorKey),B=0;B<R;B+=4)U=M[B+3],U>T?(M[B]=N.r,M[B+1]=N.g,M[B+2]=N.b,M[B+3]=255):M[B+3]=0;E.putImageData(L,0,0)}catch(G){n.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(T){return s.hasPointerCapture(T,this)}setPointerCapture(T){s.setPointerCapture(T,this)}releaseCapture(T){s.releaseCapture(T,this)}}e.Shape=C,C.prototype._fillFunc=m,C.prototype._strokeFunc=_,C.prototype._fillFuncHit=b,C.prototype._strokeFuncHit=y,C.prototype._centroid=!1,C.prototype.nodeType="Shape",(0,a._registerNode)(C),C.prototype.eventListeners={},C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",S),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",w),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",x),r.Factory.addGetterSetter(C,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(C,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(C,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"lineJoin"),r.Factory.addGetterSetter(C,"lineCap"),r.Factory.addGetterSetter(C,"sceneFunc"),r.Factory.addGetterSetter(C,"hitFunc"),r.Factory.addGetterSetter(C,"dash"),r.Factory.addGetterSetter(C,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(C,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(C,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternImage"),r.Factory.addGetterSetter(C,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(C,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(C,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(C,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(C,"fillEnabled",!0),r.Factory.addGetterSetter(C,"strokeEnabled",!0),r.Factory.addGetterSetter(C,"shadowEnabled",!0),r.Factory.addGetterSetter(C,"dashEnabled",!0),r.Factory.addGetterSetter(C,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(C,"fillPriority","color"),r.Factory.addComponentsGetterSetter(C,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(C,"fillPatternRotation",0),r.Factory.addGetterSetter(C,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(C,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Zr);Object.defineProperty(Ey,"__esModule",{value:!0});Ey.Layer=void 0;const fl=fr,QC=Gd,mf=ir,xA=At,dO=os,Dwe=Xe,Lwe=Zr,Fwe=Rt;var Bwe="#",zwe="beforeDraw",jwe="draw",EG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Uwe=EG.length;class xp extends QC.Container{constructor(t){super(t),this.canvas=new dO.SceneCanvas,this.hitCanvas=new dO.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[t+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){mf.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=mf.Node.prototype.moveUp.call(this);if(!t)return!1;var n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(mf.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(mf.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return mf.Node.prototype.remove.call(this),t&&t.parentNode&&fl.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:n}){return this.canvas.setSize(t,n),this.hitCanvas.setSize(t,n),this._setSmoothEnabled(),this}_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&fl.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),mf.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){fl.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){fl.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,fl.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<Uwe;i++){const o=EG[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=fl.Util._rgbToHex(r[0],r[1],r[2]),a=Lwe.shapes[Bwe+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(zwe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),QC.Container.prototype.drawScene.call(this,i,n),this._fire(jwe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),QC.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){fl.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return fl.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return fl.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Ey.Layer=xp;xp.prototype.nodeType="Layer";(0,Fwe._registerNode)(xp);xA.Factory.addGetterSetter(xp,"imageSmoothingEnabled",!0);xA.Factory.addGetterSetter(xp,"clearBeforeDraw",!0);xA.Factory.addGetterSetter(xp,"hitGraphEnabled",!0,(0,Dwe.getBooleanValidator)());var lx={};Object.defineProperty(lx,"__esModule",{value:!0});lx.FastLayer=void 0;const Vwe=fr,Gwe=Ey,qwe=Rt;class wA extends Gwe.Layer{constructor(t){super(t),this.listening(!1),Vwe.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}lx.FastLayer=wA;wA.prototype.nodeType="FastLayer";(0,qwe._registerNode)(wA);var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Group=void 0;const Hwe=fr,Wwe=Gd,Kwe=Rt;class CA extends Wwe.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&Hwe.Util.throw("You may only add groups and shapes to groups.")}}wp.Group=CA;CA.prototype.nodeType="Group";(0,Kwe._registerNode)(CA);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Animation=void 0;const XC=Rt,fO=fr;var YC=function(){return XC.glob.performance&&XC.glob.performance.now?function(){return XC.glob.performance.now()}:function(){return new Date().getTime()}}();class Os{constructor(t,n){this.id=Os.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:YC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){var t=Os,n=t.animations,r=n.length,i;for(i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=YC(),Os._addAnimation(this),this}stop(){return Os._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){var n=t.id,r=this.animations,i=r.length,o;for(o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){var t={},n=this.animations,r,i,o,a,s,l,u,c,d;for(a=0;a<n.length;a++)if(r=n[a],i=r.layers,o=r.func,r._updateFrameObject(YC()),l=i.length,o?d=o.call(r,r.frame)!==!1:d=!0,!!d)for(s=0;s<l;s++)u=i[s],u._id!==void 0&&(t[u._id]=u);for(c in t)t.hasOwnProperty(c)&&t[c].batchDraw()}static _animationLoop(){var t=Os;t.animations.length?(t._runFrames(),fO.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,fO.Util.requestAnimFrame(this._animationLoop))}}Cp.Animation=Os;Os.animations=[];Os.animIdCounter=0;Os.animRunning=!1;var TG={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=fr,n=Cp,r=ir,i=Rt;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,s=2,l=3,u=0,c=["fill","stroke","shadowColor"];class d{constructor(p,m,_,b,y,g,v){this.prop=p,this.propFunc=m,this.begin=b,this._pos=b,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=v,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=y-this.begin,this.pause()}fire(p){var m=this[p];m&&m()}setTime(p){p>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():p<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=p,this.update())}getTime(){return this._time}setPosition(p){this.prevPos=this._pos,this.propFunc(p),this._pos=p}getPosition(p){return p===void 0&&(p=this._time),this.func(p,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=l,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(p){this.pause(),this._time=p,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var p=this.getTimer()-this._startTime;this.state===s?this.setTime(p):this.state===l&&this.setTime(this.duration-p)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class f{constructor(p){var m=this,_=p.node,b=_._id,y,g=p.easing||e.Easings.Linear,v=!!p.yoyo,S;typeof p.duration>"u"?y=.3:p.duration===0?y=.001:y=p.duration,this.node=_,this._id=u++;var w=_.getLayer()||(_ instanceof i.Konva.Stage?_.getLayers():null);w||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){m.tween.onEnterFrame()},w),this.tween=new d(S,function(x){m._tweenFunc(x)},g,0,1,y*1e3,v),this._addListeners(),f.attrs[b]||(f.attrs[b]={}),f.attrs[b][this._id]||(f.attrs[b][this._id]={}),f.tweens[b]||(f.tweens[b]={});for(S in p)o[S]===void 0&&this._addAttr(S,p[S]);this.reset(),this.onFinish=p.onFinish,this.onReset=p.onReset,this.onUpdate=p.onUpdate}_addAttr(p,m){var _=this.node,b=_._id,y,g,v,S,w,x,C,k;if(v=f.tweens[b][p],v&&delete f.attrs[b][v][p],y=_.getAttr(p),t.Util._isArray(m))if(g=[],w=Math.max(m.length,y.length),p==="points"&&m.length!==y.length&&(m.length>y.length?(C=y,y=t.Util._prepareArrayForTween(y,m,_.closed())):(x=m,m=t.Util._prepareArrayForTween(m,y,_.closed()))),p.indexOf("fill")===0)for(S=0;S<w;S++)if(S%2===0)g.push(m[S]-y[S]);else{var T=t.Util.colorToRGBA(y[S]);k=t.Util.colorToRGBA(m[S]),y[S]=T,g.push({r:k.r-T.r,g:k.g-T.g,b:k.b-T.b,a:k.a-T.a})}else for(S=0;S<w;S++)g.push(m[S]-y[S]);else c.indexOf(p)!==-1?(y=t.Util.colorToRGBA(y),k=t.Util.colorToRGBA(m),g={r:k.r-y.r,g:k.g-y.g,b:k.b-y.b,a:k.a-y.a}):g=m-y;f.attrs[b][this._id][p]={start:y,diff:g,end:m,trueEnd:x,trueStart:C},f.tweens[b][p]=this._id}_tweenFunc(p){var m=this.node,_=f.attrs[m._id][this._id],b,y,g,v,S,w,x,C;for(b in _){if(y=_[b],g=y.start,v=y.diff,C=y.end,t.Util._isArray(g))if(S=[],x=Math.max(g.length,C.length),b.indexOf("fill")===0)for(w=0;w<x;w++)w%2===0?S.push((g[w]||0)+v[w]*p):S.push("rgba("+Math.round(g[w].r+v[w].r*p)+","+Math.round(g[w].g+v[w].g*p)+","+Math.round(g[w].b+v[w].b*p)+","+(g[w].a+v[w].a*p)+")");else for(w=0;w<x;w++)S.push((g[w]||0)+v[w]*p);else c.indexOf(b)!==-1?S="rgba("+Math.round(g.r+v.r*p)+","+Math.round(g.g+v.g*p)+","+Math.round(g.b+v.b*p)+","+(g.a+v.a*p)+")":S=g+v*p;m.setAttr(b,S)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var p=this.node,m=f.attrs[p._id][this._id];m.points&&m.points.trueEnd&&p.setAttr("points",m.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var p=this.node,m=f.attrs[p._id][this._id];m.points&&m.points.trueStart&&p.points(m.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(p){return this.tween.seek(p*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var p=this.node._id,m=this._id,_=f.tweens[p],b;this.pause();for(b in _)delete f.tweens[p][b];delete f.attrs[p][m]}}e.Tween=f,f.attrs={},f.tweens={},r.Node.prototype.to=function(h){var p=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),p&&p()};var m=new f(h);m.play()},e.Easings={BackEaseIn(h,p,m,_){var b=1.70158;return m*(h/=_)*h*((b+1)*h-b)+p},BackEaseOut(h,p,m,_){var b=1.70158;return m*((h=h/_-1)*h*((b+1)*h+b)+1)+p},BackEaseInOut(h,p,m,_){var b=1.70158;return(h/=_/2)<1?m/2*(h*h*(((b*=1.525)+1)*h-b))+p:m/2*((h-=2)*h*(((b*=1.525)+1)*h+b)+2)+p},ElasticEaseIn(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),-(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p)},ElasticEaseOut(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),b*Math.pow(2,-10*h)*Math.sin((h*_-g)*(2*Math.PI)/y)+m+p)},ElasticEaseInOut(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_/2)===2?p+m:(y||(y=_*(.3*1.5)),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),h<1?-.5*(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p:b*Math.pow(2,-10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y)*.5+m+p)},BounceEaseOut(h,p,m,_){return(h/=_)<1/2.75?m*(7.5625*h*h)+p:h<2/2.75?m*(7.5625*(h-=1.5/2.75)*h+.75)+p:h<2.5/2.75?m*(7.5625*(h-=2.25/2.75)*h+.9375)+p:m*(7.5625*(h-=2.625/2.75)*h+.984375)+p},BounceEaseIn(h,p,m,_){return m-e.Easings.BounceEaseOut(_-h,0,m,_)+p},BounceEaseInOut(h,p,m,_){return h<_/2?e.Easings.BounceEaseIn(h*2,0,m,_)*.5+p:e.Easings.BounceEaseOut(h*2-_,0,m,_)*.5+m*.5+p},EaseIn(h,p,m,_){return m*(h/=_)*h+p},EaseOut(h,p,m,_){return-m*(h/=_)*(h-2)+p},EaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h+p:-m/2*(--h*(h-2)-1)+p},StrongEaseIn(h,p,m,_){return m*(h/=_)*h*h*h*h+p},StrongEaseOut(h,p,m,_){return m*((h=h/_-1)*h*h*h*h+1)+p},StrongEaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h*h*h*h+p:m/2*((h-=2)*h*h*h*h+2)+p},Linear(h,p,m,_){return m*h/_+p}}})(TG);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Rt,n=fr,r=ir,i=Gd,o=xG,a=Ey,s=lx,l=wp,u=ax,c=Zr,d=Cp,f=TG,h=Dl,p=os;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:s.FastLayer,Group:l.Group,DD:u.DD,Shape:c.Shape,shapes:c.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:h.Context,Canvas:p.Canvas}),e.default=e.Konva})(vG);var ux={};Object.defineProperty(ux,"__esModule",{value:!0});ux.Arc=void 0;const cx=At,Qwe=Zr,hO=Rt,dx=Xe,Xwe=Rt;class ru extends Qwe.Shape{_sceneFunc(t){var n=hO.Konva.getAngle(this.angle()),r=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,n,r),t.arc(0,0,this.innerRadius(),n,0,!r),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=hO.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),a=1,s=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),l=Math.sin(Math.min(i,Math.PI/2)),u=o*(o>0?t:n),c=a*n,d=s*(s>0?t:n),f=l*(l>0?n:t);return{x:u,y:r?-1*f:d,width:c-u,height:f-d}}}ux.Arc=ru;ru.prototype._centroid=!0;ru.prototype.className="Arc";ru.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Xwe._registerNode)(ru);cx.Factory.addGetterSetter(ru,"innerRadius",0,(0,dx.getNumberValidator)());cx.Factory.addGetterSetter(ru,"outerRadius",0,(0,dx.getNumberValidator)());cx.Factory.addGetterSetter(ru,"angle",0,(0,dx.getNumberValidator)());cx.Factory.addGetterSetter(ru,"clockwise",!1,(0,dx.getBooleanValidator)());var fx={},Ty={};Object.defineProperty(Ty,"__esModule",{value:!0});Ty.Line=void 0;const hx=At,Ywe=Zr,kG=Xe,Zwe=Rt;function XE(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),c=a*l/(s+l),d=n-u*(i-e),f=r-u*(o-t),h=n+c*(i-e),p=r+c*(o-t);return[d,f,h,p]}function pO(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=XE(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(o[0])&&(r.push(o[0]),r.push(o[1]),r.push(e[i]),r.push(e[i+1]),r.push(o[2]),r.push(o[3]));return r}class Ec extends Ywe.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var n=this.points(),r=n.length,i=this.tension(),o=this.closed(),a=this.bezier(),s,l,u;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);u<l-2;)t.bezierCurveTo(s[u++],s[u++],s[u++],s[u++],s[u++],s[u++]);o||t.quadraticCurveTo(s[l-2],s[l-1],n[r-2],n[r-1])}else if(a)for(u=2;u<r;)t.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)t.lineTo(n[u],n[u+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():pO(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=XE(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=XE(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),a=pO(t,r),s=[i[2],i[3]].concat(a).concat([o[0],o[1],t[n-2],t[n-1],o[2],o[3],i[0],i[1],t[0],t[1]]);return s}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var n=t[0],r=t[0],i=t[1],o=t[1],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);return{x:n,y:i,width:r-n,height:o-i}}}Ty.Line=Ec;Ec.prototype.className="Line";Ec.prototype._attrsAffectingSize=["points","bezier","tension"];(0,Zwe._registerNode)(Ec);hx.Factory.addGetterSetter(Ec,"closed",!1);hx.Factory.addGetterSetter(Ec,"bezier",!1);hx.Factory.addGetterSetter(Ec,"tension",0,(0,kG.getNumberValidator)());hx.Factory.addGetterSetter(Ec,"points",[],(0,kG.getNumberArrayValidator)());var Ep={},AG={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(a,s,l)=>{let u,c,d;u=l/2,c=0;for(let h=0;h<20;h++)d=u*e.tValues[20][h]+u,c+=e.cValues[20][h]*r(a,s,d);return u*c};e.getCubicArcLength=t;const n=(a,s,l)=>{l===void 0&&(l=1);const u=a[0]-2*a[1]+a[2],c=s[0]-2*s[1]+s[2],d=2*a[1]-2*a[0],f=2*s[1]-2*s[0],h=4*(u*u+c*c),p=4*(u*d+c*f),m=d*d+f*f;if(h===0)return l*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(s[2]-s[0],2));const _=p/(2*h),b=m/h,y=l+_,g=b-_*_,v=y*y+g>0?Math.sqrt(y*y+g):0,S=_*_+g>0?Math.sqrt(_*_+g):0,w=_+Math.sqrt(_*_+g)!==0?g*Math.log(Math.abs((y+v)/(_+S))):0;return Math.sqrt(h)/2*(y*v-_*S+w)};e.getQuadraticArcLength=n;function r(a,s,l){const u=i(1,l,a),c=i(1,l,s),d=u*u+c*c;return Math.sqrt(d)}const i=(a,s,l)=>{const u=l.length-1;let c,d;if(u===0)return 0;if(a===0){d=0;for(let f=0;f<=u;f++)d+=e.binomialCoefficients[u][f]*Math.pow(1-s,u-f)*Math.pow(s,f)*l[f];return d}else{c=new Array(u);for(let f=0;f<u;f++)c[f]=u*(l[f+1]-l[f]);return i(a-1,s,c)}},o=(a,s,l)=>{let u=1,c=a/s,d=(a-l(c))/s,f=0;for(;u>.001;){const h=l(c+d),p=Math.abs(a-h)/s;if(p<u)u=p,c+=d;else{const m=l(c-d),_=Math.abs(a-m)/s;_<u?(u=_,c-=d):d/=2}if(f++,f>500)break}return c};e.t2length=o})(AG);Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Path=void 0;const Jwe=At,eCe=Zr,tCe=Rt,yf=AG;class Gr extends eCe.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Gr.parsePathData(this.data()),this.pathLength=Gr.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,i=0;i<n.length;i++){var o=n[i].command,a=n[i].points;switch(o){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var s=a[0],l=a[1],u=a[2],c=a[3],d=a[4],f=a[5],h=a[6],p=a[7],m=u>c?u:c,_=u>c?1:u/c,b=u>c?c/u:1;t.translate(s,l),t.rotate(h),t.scale(_,b),t.arc(0,0,m,d,d+f,1-p),t.scale(1/_,1/b),t.rotate(-h),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var c=u.points[4],d=u.points[5],f=u.points[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),d<0)for(let p=c-h;p>f;p-=h){const m=Gr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}else for(let p=c+h;p<f;p+=h){const m=Gr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}}else if(u.command==="C")for(let p=0;p<=1;p+=.01){const m=Gr.getPointOnCubicBezier(p,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(m.x,m.y)}else t=t.concat(u.points)});for(var n=t[0],r=t[0],i=t[1],o=t[1],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(s)||(i=Math.min(i,s),o=Math.max(o,s));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return Gr.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPathLength(t){let n=0;for(var r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){var r,i=0,o=n.length;if(!o)return null;for(;i<o&&t>n[i].pathLength;)t-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};var a=n[i],s=a.points;switch(a.command){case"L":return Gr.getPointOnLine(t,a.start.x,a.start.y,s[0],s[1]);case"C":return Gr.getPointOnCubicBezier((0,yf.t2length)(t,Gr.getPathLength(n),m=>(0,yf.getCubicArcLength)([a.start.x,s[0],s[2],s[4]],[a.start.y,s[1],s[3],s[5]],m)),a.start.x,a.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Gr.getPointOnQuadraticBezier((0,yf.t2length)(t,Gr.getPathLength(n),m=>(0,yf.getQuadraticArcLength)([a.start.x,s[0],s[2]],[a.start.y,s[1],s[3]],m)),a.start.x,a.start.y,s[0],s[1],s[2],s[3]);case"A":var l=s[0],u=s[1],c=s[2],d=s[3],f=s[4],h=s[5],p=s[6];return f+=h*t/a.pathLength,Gr.getPointOnEllipticalArc(l,u,c,d,f,p)}return null}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i<n&&(u*=-1);var c=l*u,d;if(i===n)d={x:a,y:s+c};else if((s-r)/(a-n+1e-8)===l)d={x:a+u,y:s+c};else{var f,h,p=this.getLineLength(n,r,i,o),m=(a-n)*(i-n)+(s-r)*(o-r);m=m/(p*p),f=n+m*(i-n),h=r+m*(o-r);var _=this.getLineLength(a,s,f,h),b=Math.sqrt(t*t-_*_);u=Math.sqrt(b*b/(1+l*l)),i<n&&(u*=-1),c=l*u,d={x:f+u,y:h+c}}return d}static getPointOnCubicBezier(t,n,r,i,o,a,s,l,u){function c(_){return _*_*_}function d(_){return 3*_*_*(1-_)}function f(_){return 3*_*(1-_)*(1-_)}function h(_){return(1-_)*(1-_)*(1-_)}var p=l*c(t)+a*d(t)+i*f(t)+n*h(t),m=u*c(t)+s*d(t)+o*f(t)+r*h(t);return{x:p,y:m}}static getPointOnQuadraticBezier(t,n,r,i,o,a,s){function l(h){return h*h}function u(h){return 2*h*(1-h)}function c(h){return(1-h)*(1-h)}var d=a*l(t)+i*u(t)+n*c(t),f=s*l(t)+o*u(t)+r*c(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,n,r,i,o,a){var s=Math.cos(a),l=Math.sin(a),u={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(u.x*s-u.y*l),y:n+(u.x*l+u.y*s)}}static parsePathData(t){if(!t)return[];var n=t,r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);var o=n.split("|"),a=[],s=[],l=0,u=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(i=1;i<o.length;i++){var f=o[i],h=f.charAt(0);for(f=f.slice(1),s.length=0;d=c.exec(f);)s.push(d[0]);for(var p=[],m=0,_=s.length;m<_;m++){if(s[m]==="00"){p.push(0,0);continue}var b=parseFloat(s[m]);isNaN(b)?p.push(0):p.push(b)}for(;p.length>0&&!isNaN(p[0]);){var y=null,g=[],v=l,S=u,w,x,C,k,T,P,$,O,E,A;switch(h){case"l":l+=p.shift(),u+=p.shift(),y="L",g.push(l,u);break;case"L":l=p.shift(),u=p.shift(),g.push(l,u);break;case"m":var D=p.shift(),L=p.shift();if(l+=D,u+=L,y="M",a.length>2&&a[a.length-1].command==="z"){for(var M=a.length-2;M>=0;M--)if(a[M].command==="M"){l=a[M].points[0]+D,u=a[M].points[1]+L;break}}g.push(l,u),h="l";break;case"M":l=p.shift(),u=p.shift(),y="M",g.push(l,u),h="L";break;case"h":l+=p.shift(),y="L",g.push(l,u);break;case"H":l=p.shift(),y="L",g.push(l,u);break;case"v":u+=p.shift(),y="L",g.push(l,u);break;case"V":u=p.shift(),y="L",g.push(l,u);break;case"C":g.push(p.shift(),p.shift(),p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"c":g.push(l+p.shift(),u+p.shift(),l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"S":x=l,C=u,w=a[a.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,p.shift(),p.shift()),l=p.shift(),u=p.shift(),y="C",g.push(l,u);break;case"s":x=l,C=u,w=a[a.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"Q":g.push(p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"q":g.push(l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="Q",g.push(l,u);break;case"T":x=l,C=u,w=a[a.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l=p.shift(),u=p.shift(),y="Q",g.push(x,C,l,u);break;case"t":x=l,C=u,w=a[a.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l+=p.shift(),u+=p.shift(),y="Q",g.push(x,C,l,u);break;case"A":k=p.shift(),T=p.shift(),P=p.shift(),$=p.shift(),O=p.shift(),E=l,A=u,l=p.shift(),u=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,A,l,u,$,O,k,T,P);break;case"a":k=p.shift(),T=p.shift(),P=p.shift(),$=p.shift(),O=p.shift(),E=l,A=u,l+=p.shift(),u+=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,A,l,u,$,O,k,T,P);break}a.push({command:y||h,points:g,start:{x:v,y:S},pathLength:this.calcLength(v,S,y||h,g)})}(h==="z"||h==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=Gr;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":return(0,yf.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,yf.getQuadraticArcLength)([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var c=i[4],d=i[5],f=i[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),d<0)for(l=c-h;l>f;l-=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=c+h;l<f;l+=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,a,s,l,u){var c=u*(Math.PI/180),d=Math.cos(c)*(t-r)/2+Math.sin(c)*(n-i)/2,f=-1*Math.sin(c)*(t-r)/2+Math.cos(c)*(n-i)/2,h=d*d/(s*s)+f*f/(l*l);h>1&&(s*=Math.sqrt(h),l*=Math.sqrt(h));var p=Math.sqrt((s*s*(l*l)-s*s*(f*f)-l*l*(d*d))/(s*s*(f*f)+l*l*(d*d)));o===a&&(p*=-1),isNaN(p)&&(p=0);var m=p*s*f/l,_=p*-l*d/s,b=(t+r)/2+Math.cos(c)*m-Math.sin(c)*_,y=(n+i)/2+Math.sin(c)*m+Math.cos(c)*_,g=function(T){return Math.sqrt(T[0]*T[0]+T[1]*T[1])},v=function(T,P){return(T[0]*P[0]+T[1]*P[1])/(g(T)*g(P))},S=function(T,P){return(T[0]*P[1]<T[1]*P[0]?-1:1)*Math.acos(v(T,P))},w=S([1,0],[(d-m)/s,(f-_)/l]),x=[(d-m)/s,(f-_)/l],C=[(-1*d-m)/s,(-1*f-_)/l],k=S(x,C);return v(x,C)<=-1&&(k=Math.PI),v(x,C)>=1&&(k=0),a===0&&k>0&&(k=k-2*Math.PI),a===1&&k<0&&(k=k+2*Math.PI),[b,y,s,l,w,k,c,a]}}Ep.Path=Gr;Gr.prototype.className="Path";Gr.prototype._attrsAffectingSize=["data"];(0,tCe._registerNode)(Gr);Jwe.Factory.addGetterSetter(Gr,"data");Object.defineProperty(fx,"__esModule",{value:!0});fx.Arrow=void 0;const px=At,nCe=Ty,PG=Xe,rCe=Rt,gO=Ep;class Hd extends nCe.Line{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const f=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],h=gO.Path.calcLength(i[i.length-4],i[i.length-3],"C",f),p=gO.Path.getPointOnQuadraticBezier(Math.min(1,1-a/h),f[0],f[1],f[2],f[3],f[4],f[5]);l=r[s-2]-p.x,u=r[s-1]-p.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var c=(Math.atan2(u,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}fx.Arrow=Hd;Hd.prototype.className="Arrow";(0,rCe._registerNode)(Hd);px.Factory.addGetterSetter(Hd,"pointerLength",10,(0,PG.getNumberValidator)());px.Factory.addGetterSetter(Hd,"pointerWidth",10,(0,PG.getNumberValidator)());px.Factory.addGetterSetter(Hd,"pointerAtBeginning",!1);px.Factory.addGetterSetter(Hd,"pointerAtEnding",!0);var gx={};Object.defineProperty(gx,"__esModule",{value:!0});gx.Circle=void 0;const iCe=At,oCe=Zr,aCe=Xe,sCe=Rt;let Tp=class extends oCe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};gx.Circle=Tp;Tp.prototype._centroid=!0;Tp.prototype.className="Circle";Tp.prototype._attrsAffectingSize=["radius"];(0,sCe._registerNode)(Tp);iCe.Factory.addGetterSetter(Tp,"radius",0,(0,aCe.getNumberValidator)());var mx={};Object.defineProperty(mx,"__esModule",{value:!0});mx.Ellipse=void 0;const EA=At,lCe=Zr,IG=Xe,uCe=Rt;class Tc extends lCe.Shape{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}mx.Ellipse=Tc;Tc.prototype.className="Ellipse";Tc.prototype._centroid=!0;Tc.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,uCe._registerNode)(Tc);EA.Factory.addComponentsGetterSetter(Tc,"radius",["x","y"]);EA.Factory.addGetterSetter(Tc,"radiusX",0,(0,IG.getNumberValidator)());EA.Factory.addGetterSetter(Tc,"radiusY",0,(0,IG.getNumberValidator)());var yx={};Object.defineProperty(yx,"__esModule",{value:!0});yx.Image=void 0;const ZC=fr,Wd=At,cCe=Zr,dCe=Rt,ky=Xe;let il=class RG extends cCe.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?a=[o,this.cropX(),this.cropY(),s,l,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?ZC.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?ZC.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=ZC.Util.createImageElement();i.onload=function(){var o=new RG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};yx.Image=il;il.prototype.className="Image";(0,dCe._registerNode)(il);Wd.Factory.addGetterSetter(il,"cornerRadius",0,(0,ky.getNumberOrArrayOfNumbersValidator)(4));Wd.Factory.addGetterSetter(il,"image");Wd.Factory.addComponentsGetterSetter(il,"crop",["x","y","width","height"]);Wd.Factory.addGetterSetter(il,"cropX",0,(0,ky.getNumberValidator)());Wd.Factory.addGetterSetter(il,"cropY",0,(0,ky.getNumberValidator)());Wd.Factory.addGetterSetter(il,"cropWidth",0,(0,ky.getNumberValidator)());Wd.Factory.addGetterSetter(il,"cropHeight",0,(0,ky.getNumberValidator)());var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.Tag=rp.Label=void 0;const vx=At,fCe=Zr,hCe=wp,TA=Xe,OG=Rt;var MG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],pCe="Change.konva",gCe="none",YE="up",ZE="right",JE="down",eT="left",mCe=MG.length;class kA extends hCe.Group{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r<mCe;r++)t.on(MG[r]+pCe,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),n=this.getTag(),r,i,o,a,s,l,u;if(t&&n){switch(r=t.width(),i=t.height(),o=n.pointerDirection(),a=n.pointerWidth(),u=n.pointerHeight(),s=0,l=0,o){case YE:s=r/2,l=-1*u;break;case ZE:s=r+a,l=i/2;break;case JE:s=r/2,l=i+u;break;case eT:s=-1*a,l=i/2;break}n.setAttrs({x:-1*s,y:-1*l,width:r,height:i}),t.setAttrs({x:-1*s,y:-1*l})}}}rp.Label=kA;kA.prototype.className="Label";(0,OG._registerNode)(kA);class Kd extends fCe.Shape{_sceneFunc(t){var n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),a=this.pointerHeight(),s=this.cornerRadius();let l=0,u=0,c=0,d=0;typeof s=="number"?l=u=c=d=Math.min(s,n/2,r/2):(l=Math.min(s[0]||0,n/2,r/2),u=Math.min(s[1]||0,n/2,r/2),d=Math.min(s[2]||0,n/2,r/2),c=Math.min(s[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(l,0),i===YE&&(t.lineTo((n-o)/2,0),t.lineTo(n/2,-1*a),t.lineTo((n+o)/2,0)),t.lineTo(n-u,0),t.arc(n-u,u,u,Math.PI*3/2,0,!1),i===ZE&&(t.lineTo(n,(r-a)/2),t.lineTo(n+o,r/2),t.lineTo(n,(r+a)/2)),t.lineTo(n,r-d),t.arc(n-d,r-d,d,0,Math.PI/2,!1),i===JE&&(t.lineTo((n+o)/2,r),t.lineTo(n/2,r+a),t.lineTo((n-o)/2,r)),t.lineTo(c,r),t.arc(c,r-c,c,Math.PI/2,Math.PI,!1),i===eT&&(t.lineTo(0,(r+a)/2),t.lineTo(-1*o,r/2),t.lineTo(0,(r-a)/2)),t.lineTo(0,l),t.arc(l,l,l,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),a=this.width(),s=this.height();return o===YE?(n-=i,s+=i):o===JE?s+=i:o===eT?(t-=r*1.5,a+=r):o===ZE&&(a+=r*1.5),{x:t,y:n,width:a,height:s}}}rp.Tag=Kd;Kd.prototype.className="Tag";(0,OG._registerNode)(Kd);vx.Factory.addGetterSetter(Kd,"pointerDirection",gCe);vx.Factory.addGetterSetter(Kd,"pointerWidth",0,(0,TA.getNumberValidator)());vx.Factory.addGetterSetter(Kd,"pointerHeight",0,(0,TA.getNumberValidator)());vx.Factory.addGetterSetter(Kd,"cornerRadius",0,(0,TA.getNumberOrArrayOfNumbersValidator)(4));var Ay={};Object.defineProperty(Ay,"__esModule",{value:!0});Ay.Rect=void 0;const yCe=At,vCe=Zr,bCe=Rt,_Ce=fr,SCe=Xe;let bx=class extends vCe.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?_Ce.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};Ay.Rect=bx;bx.prototype.className="Rect";(0,bCe._registerNode)(bx);yCe.Factory.addGetterSetter(bx,"cornerRadius",0,(0,SCe.getNumberOrArrayOfNumbersValidator)(4));var _x={};Object.defineProperty(_x,"__esModule",{value:!0});_x.RegularPolygon=void 0;const NG=At,xCe=Zr,$G=Xe,wCe=Rt;class Qd extends xCe.Shape{_sceneFunc(t){const n=this._getPoints();t.beginPath(),t.moveTo(n[0].x,n[0].y);for(var r=1;r<n.length;r++)t.lineTo(n[r].x,n[r].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,n=this.attrs.radius||0,r=[];for(var i=0;i<t;i++)r.push({x:n*Math.sin(i*2*Math.PI/t),y:-1*n*Math.cos(i*2*Math.PI/t)});return r}getSelfRect(){const t=this._getPoints();var n=t[0].x,r=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}_x.RegularPolygon=Qd;Qd.prototype.className="RegularPolygon";Qd.prototype._centroid=!0;Qd.prototype._attrsAffectingSize=["radius"];(0,wCe._registerNode)(Qd);NG.Factory.addGetterSetter(Qd,"radius",0,(0,$G.getNumberValidator)());NG.Factory.addGetterSetter(Qd,"sides",0,(0,$G.getNumberValidator)());var Sx={};Object.defineProperty(Sx,"__esModule",{value:!0});Sx.Ring=void 0;const DG=At,CCe=Zr,LG=Xe,ECe=Rt;var mO=Math.PI*2;class Xd extends CCe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,mO,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),mO,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Sx.Ring=Xd;Xd.prototype.className="Ring";Xd.prototype._centroid=!0;Xd.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ECe._registerNode)(Xd);DG.Factory.addGetterSetter(Xd,"innerRadius",0,(0,LG.getNumberValidator)());DG.Factory.addGetterSetter(Xd,"outerRadius",0,(0,LG.getNumberValidator)());var xx={};Object.defineProperty(xx,"__esModule",{value:!0});xx.Sprite=void 0;const Yd=At,TCe=Zr,kCe=Cp,FG=Xe,ACe=Rt;class ol extends TCe.Shape{constructor(t){super(t),this._updated=!0,this.anim=new kCe.Animation(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],c=o[i+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,c),t.closePath(),t.fillStrokeShape(this)),d)if(a){var f=a[n],h=r*2;t.drawImage(d,s,l,u,c,f[h+0],f[h+1],u,c)}else t.drawImage(d,s,l,u,c,0,0,u,c)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],c=r*2;t.rect(u[c+0],u[c+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t<o-1?this.frameIndex(t+1):this.frameIndex(0)}}xx.Sprite=ol;ol.prototype.className="Sprite";(0,ACe._registerNode)(ol);Yd.Factory.addGetterSetter(ol,"animation");Yd.Factory.addGetterSetter(ol,"animations");Yd.Factory.addGetterSetter(ol,"frameOffsets");Yd.Factory.addGetterSetter(ol,"image");Yd.Factory.addGetterSetter(ol,"frameIndex",0,(0,FG.getNumberValidator)());Yd.Factory.addGetterSetter(ol,"frameRate",17,(0,FG.getNumberValidator)());Yd.Factory.backCompat(ol,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var wx={};Object.defineProperty(wx,"__esModule",{value:!0});wx.Star=void 0;const AA=At,PCe=Zr,PA=Xe,ICe=Rt;class kc extends PCe.Shape{_sceneFunc(t){var n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-r);for(var o=1;o<i*2;o++){var a=o%2===0?r:n,s=a*Math.sin(o*Math.PI/i),l=-1*a*Math.cos(o*Math.PI/i);t.lineTo(s,l)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}wx.Star=kc;kc.prototype.className="Star";kc.prototype._centroid=!0;kc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ICe._registerNode)(kc);AA.Factory.addGetterSetter(kc,"numPoints",5,(0,PA.getNumberValidator)());AA.Factory.addGetterSetter(kc,"innerRadius",0,(0,PA.getNumberValidator)());AA.Factory.addGetterSetter(kc,"outerRadius",0,(0,PA.getNumberValidator)());var Fd={};Object.defineProperty(Fd,"__esModule",{value:!0});Fd.Text=Fd.stringToArray=void 0;const tT=fr,co=At,RCe=Zr,Ac=Xe,OCe=Rt;function BG(e){return Array.from(e)}Fd.stringToArray=BG;var vf="auto",MCe="center",tg="justify",NCe="Change.konva",$Ce="2d",yO="-",zG="left",DCe="text",LCe="Text",FCe="top",BCe="bottom",vO="middle",jG="normal",zCe="px ",Uv=" ",jCe="right",UCe="word",VCe="char",bO="none",JC="…",UG=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],GCe=UG.length;function qCe(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Vv;function e5(){return Vv||(Vv=tT.Util.createCanvasElement().getContext($Ce),Vv)}function HCe(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function WCe(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function KCe(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let Ar=class extends RCe.Shape{constructor(t){super(KCe(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<GCe;n++)this.on(UG[n]+NCe,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,s=this.verticalAlign(),l=0,u=this.align(),c=this.getWidth(),d=this.letterSpacing(),f=this.fill(),h=this.textDecoration(),p=h.indexOf("underline")!==-1,m=h.indexOf("line-through")!==-1,_,b=0,b=a/2,y=0,g=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",vO),t.setAttr("textAlign",zG),s===vO?l=(this.getHeight()-r*a-i*2)/2:s===BCe&&(l=this.getHeight()-r*a-i*2),t.translate(i,l+i),_=0;_<r;_++){var y=0,g=0,v=n[_],S=v.text,w=v.width,x=v.lastInParagraph,C,k,T;if(t.save(),u===jCe?y+=c-w-i*2:u===MCe&&(y+=(c-w-i*2)/2),p){t.save(),t.beginPath(),t.moveTo(y,b+g+Math.round(o/2)),C=S.split(" ").length-1,k=C===0,T=u===tg&&!x?c-i*2:w,t.lineTo(y+Math.round(T),b+g+Math.round(o/2)),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(m){t.save(),t.beginPath(),t.moveTo(y,b+g),C=S.split(" ").length-1,k=C===0,T=u===tg&&x&&!k?c-i*2:w,t.lineTo(y+Math.round(T),b+g),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(d!==0||u===tg){C=S.split(" ").length-1;for(var P=BG(S),$=0;$<P.length;$++){var O=P[$];O===" "&&!x&&u===tg&&(y+=(c-i*2-w)/C),this._partialTextX=y,this._partialTextY=b+g,this._partialText=O,t.fillStrokeShape(this),y+=this.measureSize(O).width+d}}else this._partialTextX=y,this._partialTextY=b+g,this._partialText=S,t.fillStrokeShape(this);t.restore(),r>1&&(b+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=tT.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(DCe,n),this}getWidth(){var t=this.attrs.width===vf||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===vf||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return tT.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=e5(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Uv+this.fontVariant()+Uv+(this.fontSize()+zCe)+qCe(this.fontFamily())}_addTextLine(t){this.align()===tg&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return e5().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(`
-`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==vf&&o!==void 0,l=a!==vf&&a!==void 0,u=this.padding(),c=o-u*2,d=a-u*2,f=0,h=this.wrap(),p=h!==bO,m=h!==VCe&&p,_=this.ellipsis();this.textArr=[],e5().font=this._getContextFont();for(var b=_?this._getTextWidth(JC):0,y=0,g=t.length;y<g;++y){var v=t[y],S=this._getTextWidth(v);if(s&&S>c)for(;v.length>0;){for(var w=0,x=v.length,C="",k=0;w<x;){var T=w+x>>>1,P=v.slice(0,T+1),$=this._getTextWidth(P)+b;$<=c?(w=T+1,C=P,k=$):x=T}if(C){if(m){var O,E=v[C.length],A=E===Uv||E===yO;A&&k<=c?O=C.length:O=Math.max(C.lastIndexOf(Uv),C.lastIndexOf(yO))+1,O>0&&(w=O,C=C.slice(0,w),k=this._getTextWidth(C))}C=C.trimRight(),this._addTextLine(C),r=Math.max(r,k),f+=i;var D=this._shouldHandleEllipsis(f);if(D){this._tryToAddEllipsisToLastLine();break}if(v=v.slice(w),v=v.trimLeft(),v.length>0&&(S=this._getTextWidth(v),S<=c)){this._addTextLine(v),f+=i,r=Math.max(r,S);break}}else break}else this._addTextLine(v),f+=i,r=Math.max(r,S),this._shouldHandleEllipsis(f)&&y<g-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&f+i>d)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==vf&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==bO;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==vf&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+JC)<i;s||(a.text=a.text.slice(0,a.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+JC)}}getStrokeScaleEnabled(){return!0}};Fd.Text=Ar;Ar.prototype._fillFunc=HCe;Ar.prototype._strokeFunc=WCe;Ar.prototype.className=LCe;Ar.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,OCe._registerNode)(Ar);co.Factory.overWriteSetter(Ar,"width",(0,Ac.getNumberOrAutoValidator)());co.Factory.overWriteSetter(Ar,"height",(0,Ac.getNumberOrAutoValidator)());co.Factory.addGetterSetter(Ar,"fontFamily","Arial");co.Factory.addGetterSetter(Ar,"fontSize",12,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"fontStyle",jG);co.Factory.addGetterSetter(Ar,"fontVariant",jG);co.Factory.addGetterSetter(Ar,"padding",0,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"align",zG);co.Factory.addGetterSetter(Ar,"verticalAlign",FCe);co.Factory.addGetterSetter(Ar,"lineHeight",1,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"wrap",UCe);co.Factory.addGetterSetter(Ar,"ellipsis",!1,(0,Ac.getBooleanValidator)());co.Factory.addGetterSetter(Ar,"letterSpacing",0,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"text","",(0,Ac.getStringValidator)());co.Factory.addGetterSetter(Ar,"textDecoration","");var Cx={};Object.defineProperty(Cx,"__esModule",{value:!0});Cx.TextPath=void 0;const t5=fr,ps=At,QCe=Zr,ng=Ep,n5=Fd,VG=Xe,XCe=Rt;var YCe="",GG="normal";function qG(e){e.fillText(this.partialText,0,0)}function HG(e){e.strokeText(this.partialText,0,0)}class Jr extends QCe.Shape{constructor(t){super(t),this.dummyCanvas=t5.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return ng.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:ng.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=ng.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&t.beginPath();for(var a=0;a<o.length;a++){t.save();var s=o[a].p0;t.translate(s.x,s.y),t.rotate(o[a].rotation),this.partialText=o[a].text,t.fillStrokeShape(this),n==="underline"&&(a===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}n==="underline"&&(t.strokeStyle=r,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var n=this.glyphInfo;if(n.length>=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i<n.length;i++){var o=n[i].p1;t.lineTo(o.x,o.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return t5.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return n5.Text.prototype.setText.call(this,t)}_getContextFont(){return n5.Text.prototype._getContextFont.call(this)}_getTextSize(t){var n=this.dummyCanvas,r=n.getContext("2d");r.save(),r.font=this._getContextFont();var i=r.measureText(t);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let s=0;i==="center"&&(s=Math.max(0,this.pathLength/2-a/2)),i==="right"&&(s=Math.max(0,this.pathLength-a));const l=(0,n5.stringToArray)(this.text());let u=s;for(var c=0;c<l.length;c++){const d=this._getPointAtLength(u);if(!d)return;let f=this._getTextSize(l[c]).width+r;if(l[c]===" "&&i==="justify"){const y=this.text().split(" ").length-1;f+=(this.pathLength-a)/y}const h=this._getPointAtLength(u+f);if(!h)return;const p=ng.Path.getLineLength(d.x,d.y,h.x,h.y);let m=0;if(o)try{m=o(l[c-1],l[c])*this.fontSize()}catch{m=0}d.x+=m,h.x+=m,this.textWidth+=m;const _=ng.Path.getPointOnLine(m+p/2,d.x,d.y,h.x,h.y),b=Math.atan2(h.y-d.y,h.x-d.x);this.glyphInfo.push({transposeX:_.x,transposeY:_.y,text:l[c],rotation:b,p0:d,p1:h}),u+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});for(var n=t[0]||0,r=t[0]||0,i=t[1]||0,o=t[1]||0,a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);var u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:o-i+u}}destroy(){return t5.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}Cx.TextPath=Jr;Jr.prototype._fillFunc=qG;Jr.prototype._strokeFunc=HG;Jr.prototype._fillFuncHit=qG;Jr.prototype._strokeFuncHit=HG;Jr.prototype.className="TextPath";Jr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,XCe._registerNode)(Jr);ps.Factory.addGetterSetter(Jr,"data");ps.Factory.addGetterSetter(Jr,"fontFamily","Arial");ps.Factory.addGetterSetter(Jr,"fontSize",12,(0,VG.getNumberValidator)());ps.Factory.addGetterSetter(Jr,"fontStyle",GG);ps.Factory.addGetterSetter(Jr,"align","left");ps.Factory.addGetterSetter(Jr,"letterSpacing",0,(0,VG.getNumberValidator)());ps.Factory.addGetterSetter(Jr,"textBaseline","middle");ps.Factory.addGetterSetter(Jr,"fontVariant",GG);ps.Factory.addGetterSetter(Jr,"text",YCe);ps.Factory.addGetterSetter(Jr,"textDecoration",null);ps.Factory.addGetterSetter(Jr,"kerningFunc",null);var Ex={};Object.defineProperty(Ex,"__esModule",{value:!0});Ex.Transformer=void 0;const En=fr,bn=At,_O=ir,ZCe=Zr,JCe=Ay,SO=wp,ja=Rt,Pc=Xe,e5e=Rt;var WG="tr-konva",t5e=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${WG}`).join(" "),xO="nodesRect",n5e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],r5e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const i5e="ontouchstart"in ja.Konva._global;function o5e(e,t){if(e==="rotater")return"crosshair";t+=En.Util.degToRad(r5e[e]||0);var n=(En.Util.radToDeg(t)%360+360)%360;return En.Util._inRange(n,315+22.5,360)||En.Util._inRange(n,0,22.5)?"ns-resize":En.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":En.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":En.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":En.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":En.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":En.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":En.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(En.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var B_=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],wO=1e8;function a5e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function KG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function s5e(e,t){const n=a5e(e);return KG(e,t,n)}function l5e(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=ja.Konva.getAngle(e[i]),a=Math.abs(o-t)%(Math.PI*2);Math.min(a,Math.PI*2-a)<n&&(r=o)}return r}class Jt extends SO.Group{constructor(t){super(t),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(t5e,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return En.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return WG+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(En.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=n,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(a,o),i.on(n5e.map(s=>s+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache();var r=!!this.findOne(".top-left");return r&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(xO),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(xO,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(ja.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return KG(c,-ja.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-wO,y:-wO,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const c=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],f=u.getAbsoluteTransform();d.forEach(function(h){var p=f.point(h);n.push(p)})});const r=new En.Transform;r.rotate(-ja.Konva.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var c=r.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:ja.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),B_.forEach((function(t){this._createAnchor(t)}).bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new JCe.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:i5e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=ja.Konva.getAngle(this.rotation()),o=o5e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new ZCe.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*En.Util._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const c=o.getAbsolutePosition();if(!(u.x===c.x&&u.y===c.y)){if(this._movingAnchorName==="rotater"){var d=this._getNodeRect();n=o.x()-d.width/2,r=-o.y()+d.height/2;let O=Math.atan2(-r,n)+Math.PI/2;d.height<0&&(O-=Math.PI);var f=ja.Konva.getAngle(this.rotation());const E=f+O,A=ja.Konva.getAngle(this.rotationSnapTolerance()),L=l5e(this.rotationSnaps(),E,A)-d.rotation,M=s5e(d,L);this._fitNodesInto(M,t);return}var h=this.shiftBehavior(),p;h==="inverted"?p=this.keepRatio()&&!t.shiftKey:h==="none"?p=this.keepRatio():p=this.keepRatio()||t.shiftKey;var g=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(m.x-o.x(),2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-left").x()>m.x?-1:1,b=this.findOne(".top-left").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-left").x(m.x-n),this.findOne(".top-left").y(m.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-m.x,2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-right").x()<m.x?-1:1,b=this.findOne(".top-right").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-right").x(m.x+n),this.findOne(".top-right").y(m.y-r)}var y=o.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(m.x-o.x(),2)+Math.pow(o.y()-m.y,2));var _=m.x<o.x()?-1:1,b=o.y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,o.x(m.x-n),o.y(m.y+r)}y=o.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-m.x,2)+Math.pow(o.y()-m.y,2));var _=this.findOne(".bottom-right").x()<m.x?-1:1,b=this.findOne(".bottom-right").y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".bottom-right").x(m.x+n),this.findOne(".bottom-right").y(m.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var g=this.centeredScaling()||t.altKey;if(g){var v=this.findOne(".top-left"),S=this.findOne(".bottom-right"),w=v.x(),x=v.y(),C=this.getWidth()-S.x(),k=this.getHeight()-S.y();S.move({x:-w,y:-x}),v.move({x:C,y:k})}var T=this.findOne(".top-left").getAbsolutePosition();n=T.x,r=T.y;var P=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),$=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:P,height:$,rotation:ja.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();this._fire("transformend",{evt:t,target:n}),n&&this._nodes.forEach(r=>{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(En.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(En.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new En.Transform;if(a.rotate(ja.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=a.point({x:-this.padding()*2,y:0});if(t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=a.point({x:0,y:-this.padding()*2});if(t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(r,t);d?t=d:En.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new En.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new En.Transform;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const c=u.multiply(l.invert());this._nodes.forEach(d=>{var f;const h=d.getParent().getAbsoluteTransform(),p=d.getTransform().copy();p.translate(d.offsetX(),d.offsetY());const m=new En.Transform;m.multiply(h.copy().invert()).multiply(c).multiply(h).multiply(p);const _=m.decompose();d.setAttrs(_),this._fire("transform",{evt:n,target:d}),d._fire("transform",{evt:n,target:d}),(f=d.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(En.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(En.Util._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();const u=this.find("._anchor");u.forEach(d=>{d.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*En.Util._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const c=this.anchorStyleFunc();c&&u.forEach(d=>{c(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),SO.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return _O.Node.prototype.toObject.call(this)}clone(t){var n=_O.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Ex.Transformer=Jt;function u5e(e){return e instanceof Array||En.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){B_.indexOf(t)===-1&&En.Util.warn("Unknown anchor name: "+t+". Available names are: "+B_.join(", "))}),e||[]}Jt.prototype.className="Transformer";(0,e5e._registerNode)(Jt);bn.Factory.addGetterSetter(Jt,"enabledAnchors",B_,u5e);bn.Factory.addGetterSetter(Jt,"flipEnabled",!0,(0,Pc.getBooleanValidator)());bn.Factory.addGetterSetter(Jt,"resizeEnabled",!0);bn.Factory.addGetterSetter(Jt,"anchorSize",10,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"rotateEnabled",!0);bn.Factory.addGetterSetter(Jt,"rotationSnaps",[]);bn.Factory.addGetterSetter(Jt,"rotateAnchorOffset",50,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"rotationSnapTolerance",5,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderEnabled",!0);bn.Factory.addGetterSetter(Jt,"anchorStroke","rgb(0, 161, 255)");bn.Factory.addGetterSetter(Jt,"anchorStrokeWidth",1,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"anchorFill","white");bn.Factory.addGetterSetter(Jt,"anchorCornerRadius",0,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderStroke","rgb(0, 161, 255)");bn.Factory.addGetterSetter(Jt,"borderStrokeWidth",1,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderDash");bn.Factory.addGetterSetter(Jt,"keepRatio",!0);bn.Factory.addGetterSetter(Jt,"shiftBehavior","default");bn.Factory.addGetterSetter(Jt,"centeredScaling",!1);bn.Factory.addGetterSetter(Jt,"ignoreStroke",!1);bn.Factory.addGetterSetter(Jt,"padding",0,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"node");bn.Factory.addGetterSetter(Jt,"nodes");bn.Factory.addGetterSetter(Jt,"boundBoxFunc");bn.Factory.addGetterSetter(Jt,"anchorDragBoundFunc");bn.Factory.addGetterSetter(Jt,"anchorStyleFunc");bn.Factory.addGetterSetter(Jt,"shouldOverdrawWholeArea",!1);bn.Factory.addGetterSetter(Jt,"useSingleNodeRotation",!0);bn.Factory.backCompat(Jt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Tx={};Object.defineProperty(Tx,"__esModule",{value:!0});Tx.Wedge=void 0;const kx=At,c5e=Zr,d5e=Rt,QG=Xe,f5e=Rt;class iu extends c5e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,d5e.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Tx.Wedge=iu;iu.prototype.className="Wedge";iu.prototype._centroid=!0;iu.prototype._attrsAffectingSize=["radius"];(0,f5e._registerNode)(iu);kx.Factory.addGetterSetter(iu,"radius",0,(0,QG.getNumberValidator)());kx.Factory.addGetterSetter(iu,"angle",0,(0,QG.getNumberValidator)());kx.Factory.addGetterSetter(iu,"clockwise",!1);kx.Factory.backCompat(iu,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Ax={};Object.defineProperty(Ax,"__esModule",{value:!0});Ax.Blur=void 0;const CO=At,h5e=ir,p5e=Xe;function EO(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var g5e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],m5e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function y5e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,c,d,f,h,p,m,_,b,y,g,v,S,w,x,C,k,T,P,$,O=t+t+1,E=r-1,A=i-1,D=t+1,L=D*(D+1)/2,M=new EO,R=null,N=M,B=null,U=null,G=g5e[t],Z=m5e[t];for(s=1;s<O;s++)N=N.next=new EO,s===D&&(R=N);for(N.next=M,d=c=0,a=0;a<i;a++){for(v=S=w=x=f=h=p=m=0,_=D*(C=n[c]),b=D*(k=n[c+1]),y=D*(T=n[c+2]),g=D*(P=n[c+3]),f+=L*C,h+=L*k,p+=L*T,m+=L*P,N=M,s=0;s<D;s++)N.r=C,N.g=k,N.b=T,N.a=P,N=N.next;for(s=1;s<D;s++)l=c+((E<s?E:s)<<2),f+=(N.r=C=n[l])*($=D-s),h+=(N.g=k=n[l+1])*$,p+=(N.b=T=n[l+2])*$,m+=(N.a=P=n[l+3])*$,v+=C,S+=k,w+=T,x+=P,N=N.next;for(B=M,U=R,o=0;o<r;o++)n[c+3]=P=m*G>>Z,P!==0?(P=255/P,n[c]=(f*G>>Z)*P,n[c+1]=(h*G>>Z)*P,n[c+2]=(p*G>>Z)*P):n[c]=n[c+1]=n[c+2]=0,f-=_,h-=b,p-=y,m-=g,_-=B.r,b-=B.g,y-=B.b,g-=B.a,l=d+((l=o+t+1)<E?l:E)<<2,v+=B.r=n[l],S+=B.g=n[l+1],w+=B.b=n[l+2],x+=B.a=n[l+3],f+=v,h+=S,p+=w,m+=x,B=B.next,_+=C=U.r,b+=k=U.g,y+=T=U.b,g+=P=U.a,v-=C,S-=k,w-=T,x-=P,U=U.next,c+=4;d+=r}for(o=0;o<r;o++){for(S=w=x=v=h=p=m=f=0,c=o<<2,_=D*(C=n[c]),b=D*(k=n[c+1]),y=D*(T=n[c+2]),g=D*(P=n[c+3]),f+=L*C,h+=L*k,p+=L*T,m+=L*P,N=M,s=0;s<D;s++)N.r=C,N.g=k,N.b=T,N.a=P,N=N.next;for(u=r,s=1;s<=t;s++)c=u+o<<2,f+=(N.r=C=n[c])*($=D-s),h+=(N.g=k=n[c+1])*$,p+=(N.b=T=n[c+2])*$,m+=(N.a=P=n[c+3])*$,v+=C,S+=k,w+=T,x+=P,N=N.next,s<A&&(u+=r);for(c=o,B=M,U=R,a=0;a<i;a++)l=c<<2,n[l+3]=P=m*G>>Z,P>0?(P=255/P,n[l]=(f*G>>Z)*P,n[l+1]=(h*G>>Z)*P,n[l+2]=(p*G>>Z)*P):n[l]=n[l+1]=n[l+2]=0,f-=_,h-=b,p-=y,m-=g,_-=B.r,b-=B.g,y-=B.b,g-=B.a,l=o+((l=a+D)<A?l:A)*r<<2,f+=v+=B.r=n[l],h+=S+=B.g=n[l+1],p+=w+=B.b=n[l+2],m+=x+=B.a=n[l+3],B=B.next,_+=C=U.r,b+=k=U.g,y+=T=U.b,g+=P=U.a,v-=C,S-=k,w-=T,x-=P,U=U.next,c+=r}}const v5e=function(t){var n=Math.round(this.blurRadius());n>0&&y5e(t,n)};Ax.Blur=v5e;CO.Factory.addGetterSetter(h5e.Node,"blurRadius",0,(0,p5e.getNumberValidator)(),CO.Factory.afterSetFilter);var Px={};Object.defineProperty(Px,"__esModule",{value:!0});Px.Brighten=void 0;const TO=At,b5e=ir,_5e=Xe,S5e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=4)n[i]+=t,n[i+1]+=t,n[i+2]+=t};Px.Brighten=S5e;TO.Factory.addGetterSetter(b5e.Node,"brightness",0,(0,_5e.getNumberValidator)(),TO.Factory.afterSetFilter);var Ix={};Object.defineProperty(Ix,"__esModule",{value:!0});Ix.Contrast=void 0;const kO=At,x5e=ir,w5e=Xe,C5e=function(e){var t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,o=150,a=150,s;for(s=0;s<r;s+=4)i=n[s],o=n[s+1],a=n[s+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};Ix.Contrast=C5e;kO.Factory.addGetterSetter(x5e.Node,"contrast",0,(0,w5e.getNumberValidator)(),kO.Factory.afterSetFilter);var Rx={};Object.defineProperty(Rx,"__esModule",{value:!0});Rx.Emboss=void 0;const cc=At,Ox=ir,E5e=fr,XG=Xe,T5e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,c=l*4,d=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:E5e.Util.error("Unknown emboss direction: "+r)}do{var f=(d-1)*c,h=o;d+h<1&&(h=0),d+h>u&&(h=0);var p=(d-1+h)*l*4,m=l;do{var _=f+(m-1)*4,b=a;m+b<1&&(b=0),m+b>l&&(b=0);var y=p+(m-1+b)*4,g=s[_]-s[y],v=s[_+1]-s[y+1],S=s[_+2]-s[y+2],w=g,x=w>0?w:-w,C=v>0?v:-v,k=S>0?S:-S;if(C>x&&(w=v),k>x&&(w=S),w*=t,i){var T=s[_]+w,P=s[_+1]+w,$=s[_+2]+w;s[_]=T>255?255:T<0?0:T,s[_+1]=P>255?255:P<0?0:P,s[_+2]=$>255?255:$<0?0:$}else{var O=n-w;O<0?O=0:O>255&&(O=255),s[_]=s[_+1]=s[_+2]=O}}while(--m)}while(--d)};Rx.Emboss=T5e;cc.Factory.addGetterSetter(Ox.Node,"embossStrength",.5,(0,XG.getNumberValidator)(),cc.Factory.afterSetFilter);cc.Factory.addGetterSetter(Ox.Node,"embossWhiteLevel",.5,(0,XG.getNumberValidator)(),cc.Factory.afterSetFilter);cc.Factory.addGetterSetter(Ox.Node,"embossDirection","top-left",null,cc.Factory.afterSetFilter);cc.Factory.addGetterSetter(Ox.Node,"embossBlend",!1,null,cc.Factory.afterSetFilter);var Mx={};Object.defineProperty(Mx,"__esModule",{value:!0});Mx.Enhance=void 0;const AO=At,k5e=ir,A5e=Xe;function r5(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const P5e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],c=u,d,f,h=this.enhance();if(h!==0){for(f=0;f<n;f+=4)o=t[f+0],o<r?r=o:o>i&&(i=o),l=t[f+1],l<a?a=l:l>s&&(s=l),d=t[f+2],d<u?u=d:d>c&&(c=d);i===r&&(i=255,r=0),s===a&&(s=255,a=0),c===u&&(c=255,u=0);var p,m,_,b,y,g,v,S,w;for(h>0?(m=i+h*(255-i),_=r-h*(r-0),y=s+h*(255-s),g=a-h*(a-0),S=c+h*(255-c),w=u-h*(u-0)):(p=(i+r)*.5,m=i+h*(i-p),_=r+h*(r-p),b=(s+a)*.5,y=s+h*(s-b),g=a+h*(a-b),v=(c+u)*.5,S=c+h*(c-v),w=u+h*(u-v)),f=0;f<n;f+=4)t[f+0]=r5(t[f+0],r,i,_,m),t[f+1]=r5(t[f+1],a,s,g,y),t[f+2]=r5(t[f+2],u,c,w,S)}};Mx.Enhance=P5e;AO.Factory.addGetterSetter(k5e.Node,"enhance",0,(0,A5e.getNumberValidator)(),AO.Factory.afterSetFilter);var Nx={};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.Grayscale=void 0;const I5e=function(e){var t=e.data,n=t.length,r,i;for(r=0;r<n;r+=4)i=.34*t[r]+.5*t[r+1]+.16*t[r+2],t[r]=i,t[r+1]=i,t[r+2]=i};Nx.Grayscale=I5e;var $x={};Object.defineProperty($x,"__esModule",{value:!0});$x.HSL=void 0;const ip=At,IA=ir,RA=Xe;ip.Factory.addGetterSetter(IA.Node,"hue",0,(0,RA.getNumberValidator)(),ip.Factory.afterSetFilter);ip.Factory.addGetterSetter(IA.Node,"saturation",0,(0,RA.getNumberValidator)(),ip.Factory.afterSetFilter);ip.Factory.addGetterSetter(IA.Node,"luminance",0,(0,RA.getNumberValidator)(),ip.Factory.afterSetFilter);const R5e=function(e){var t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=this.luminance()*127,s,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),c=.299*r+.701*l+.167*u,d=.587*r-.587*l+.33*u,f=.114*r-.114*l-.497*u,h=.299*r-.299*l-.328*u,p=.587*r+.413*l+.035*u,m=.114*r-.114*l+.293*u,_=.299*r-.3*l+1.25*u,b=.587*r-.586*l-1.05*u,y=.114*r+.886*l-.2*u,g,v,S,w;for(s=0;s<n;s+=4)g=t[s+0],v=t[s+1],S=t[s+2],w=t[s+3],t[s+0]=c*g+d*v+f*S+a,t[s+1]=h*g+p*v+m*S+a,t[s+2]=_*g+b*v+y*S+a,t[s+3]=w};$x.HSL=R5e;var Dx={};Object.defineProperty(Dx,"__esModule",{value:!0});Dx.HSV=void 0;const op=At,OA=ir,MA=Xe,O5e=function(e){var t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a,s=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*s+.167*l,c=.587*r-.587*s+.33*l,d=.114*r-.114*s-.497*l,f=.299*r-.299*s-.328*l,h=.587*r+.413*s+.035*l,p=.114*r-.114*s+.293*l,m=.299*r-.3*s+1.25*l,_=.587*r-.586*s-1.05*l,b=.114*r+.886*s-.2*l,y,g,v,S;for(a=0;a<n;a+=4)y=t[a+0],g=t[a+1],v=t[a+2],S=t[a+3],t[a+0]=u*y+c*g+d*v,t[a+1]=f*y+h*g+p*v,t[a+2]=m*y+_*g+b*v,t[a+3]=S};Dx.HSV=O5e;op.Factory.addGetterSetter(OA.Node,"hue",0,(0,MA.getNumberValidator)(),op.Factory.afterSetFilter);op.Factory.addGetterSetter(OA.Node,"saturation",0,(0,MA.getNumberValidator)(),op.Factory.afterSetFilter);op.Factory.addGetterSetter(OA.Node,"value",0,(0,MA.getNumberValidator)(),op.Factory.afterSetFilter);var Lx={};Object.defineProperty(Lx,"__esModule",{value:!0});Lx.Invert=void 0;const M5e=function(e){var t=e.data,n=t.length,r;for(r=0;r<n;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]};Lx.Invert=M5e;var Fx={};Object.defineProperty(Fx,"__esModule",{value:!0});Fx.Kaleidoscope=void 0;const z_=At,YG=ir,PO=fr,ZG=Xe;var N5e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f=0,h=0,p=0,m=0,_,b=Math.sqrt(s*s+l*l);c=o-s,d=a-l,_=Math.sqrt(c*c+d*d),b=_>b?_:b;var y=a,g=o,v,S,w=360/g*Math.PI/180,x,C;for(S=0;S<g;S+=1)for(x=Math.sin(S*w),C=Math.cos(S*w),v=0;v<y;v+=1)c=Math.floor(s+b*v/y*C),d=Math.floor(l+b*v/y*x),u=(d*o+c)*4,f=r[u+0],h=r[u+1],p=r[u+2],m=r[u+3],u=(S+v*o)*4,i[u+0]=f,i[u+1]=h,i[u+2]=p,i[u+3]=m},$5e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f,h,p=0,m=0,_=0,b=0,y,g=Math.sqrt(s*s+l*l);c=o-s,d=a-l,y=Math.sqrt(c*c+d*d),g=y>g?y:g;var v=a,S=o,w,x,C=n.polarRotation||0,k,T;for(c=0;c<o;c+=1)for(d=0;d<a;d+=1)f=c-s,h=d-l,w=Math.sqrt(f*f+h*h)*v/g,x=(Math.atan2(h,f)*180/Math.PI+360+C)%360,x=x*S/360,k=Math.floor(x),T=Math.floor(w),u=(T*o+k)*4,p=r[u+0],m=r[u+1],_=r[u+2],b=r[u+3],u=(d*o+c)*4,i[u+0]=p,i[u+1]=m,i[u+2]=_,i[u+3]=b};const D5e=function(e){var t=e.width,n=e.height,r,i,o,a,s,l,u,c,d,f,h=Math.round(this.kaleidoscopePower()),p=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(p%360)/360);if(!(h<1)){var _=PO.Util.createCanvasElement();_.width=t,_.height=n;var b=_.getContext("2d").getImageData(0,0,t,n);PO.Util.releaseCanvas(_),N5e(e,b,{polarCenterX:t/2,polarCenterY:n/2});for(var y=t/Math.pow(2,h);y<=8;)y=y*2,h-=1;y=Math.ceil(y);var g=y,v=0,S=g,w=1;for(m+y>t&&(v=g,S=0,w=-1),i=0;i<n;i+=1)for(r=v;r!==S;r+=w)o=Math.round(r+m)%t,d=(t*i+o)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+r)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;for(i=0;i<n;i+=1)for(g=Math.floor(y),a=0;a<h;a+=1){for(r=0;r<g+1;r+=1)d=(t*i+r)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+g*2-r-1)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;g*=2}$5e(b,e,{polarRotation:0})}};Fx.Kaleidoscope=D5e;z_.Factory.addGetterSetter(YG.Node,"kaleidoscopePower",2,(0,ZG.getNumberValidator)(),z_.Factory.afterSetFilter);z_.Factory.addGetterSetter(YG.Node,"kaleidoscopeAngle",0,(0,ZG.getNumberValidator)(),z_.Factory.afterSetFilter);var Bx={};Object.defineProperty(Bx,"__esModule",{value:!0});Bx.Mask=void 0;const IO=At,L5e=ir,F5e=Xe;function Gv(e,t,n){var r=(n*e.width+t)*4,i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function rg(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function B5e(e){for(var t=[0,0,0],n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function z5e(e,t){var n=Gv(e,0,0),r=Gv(e,e.width-1,0),i=Gv(e,0,e.height-1),o=Gv(e,e.width-1,e.height-1),a=t||10;if(rg(n,r)<a&&rg(r,o)<a&&rg(o,i)<a&&rg(i,n)<a){for(var s=B5e([r,n,o,i]),l=[],u=0;u<e.width*e.height;u++){var c=rg(s,[e.data[u*4],e.data[u*4+1],e.data[u*4+2]]);l[u]=c<a?0:255}return l}}function j5e(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function U5e(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c===255*8?255:0}return a}function V5e(e,t,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c>=255*4?255:0}return a}function G5e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c}return a}const q5e=function(e){var t=this.threshold(),n=z5e(e,t);return n&&(n=U5e(n,e.width,e.height),n=V5e(n,e.width,e.height),n=G5e(n,e.width,e.height),j5e(e,n)),e};Bx.Mask=q5e;IO.Factory.addGetterSetter(L5e.Node,"threshold",0,(0,F5e.getNumberValidator)(),IO.Factory.afterSetFilter);var zx={};Object.defineProperty(zx,"__esModule",{value:!0});zx.Noise=void 0;const RO=At,H5e=ir,W5e=Xe,K5e=function(e){var t=this.noise()*255,n=e.data,r=n.length,i=t/2,o;for(o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};zx.Noise=K5e;RO.Factory.addGetterSetter(H5e.Node,"noise",.2,(0,W5e.getNumberValidator)(),RO.Factory.afterSetFilter);var jx={};Object.defineProperty(jx,"__esModule",{value:!0});jx.Pixelate=void 0;const OO=At,Q5e=fr,X5e=ir,Y5e=Xe,Z5e=function(e){var t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i,o,a,s,l,u,c,d=Math.ceil(n/t),f=Math.ceil(r/t),h,p,m,_,b,y,g,v=e.data;if(t<=0){Q5e.Util.error("pixelSize value can not be <= 0");return}for(b=0;b<d;b+=1)for(y=0;y<f;y+=1){for(s=0,l=0,u=0,c=0,h=b*t,p=h+t,m=y*t,_=m+t,g=0,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(a=(n*o+i)*4,s+=v[a+0],l+=v[a+1],u+=v[a+2],c+=v[a+3],g+=1);for(s=s/g,l=l/g,u=u/g,c=c/g,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(a=(n*o+i)*4,v[a+0]=s,v[a+1]=l,v[a+2]=u,v[a+3]=c)}};jx.Pixelate=Z5e;OO.Factory.addGetterSetter(X5e.Node,"pixelSize",8,(0,Y5e.getNumberValidator)(),OO.Factory.afterSetFilter);var Ux={};Object.defineProperty(Ux,"__esModule",{value:!0});Ux.Posterize=void 0;const MO=At,J5e=ir,e3e=Xe,t3e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};Ux.Posterize=t3e;MO.Factory.addGetterSetter(J5e.Node,"levels",.5,(0,e3e.getNumberValidator)(),MO.Factory.afterSetFilter);var Vx={};Object.defineProperty(Vx,"__esModule",{value:!0});Vx.RGB=void 0;const j_=At,NA=ir,n3e=Xe,r3e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a,s;for(a=0;a<n;a+=4)s=(.34*t[a]+.5*t[a+1]+.16*t[a+2])/255,t[a]=s*r,t[a+1]=s*i,t[a+2]=s*o,t[a+3]=t[a+3]};Vx.RGB=r3e;j_.Factory.addGetterSetter(NA.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});j_.Factory.addGetterSetter(NA.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});j_.Factory.addGetterSetter(NA.Node,"blue",0,n3e.RGBComponent,j_.Factory.afterSetFilter);var Gx={};Object.defineProperty(Gx,"__esModule",{value:!0});Gx.RGBA=void 0;const _0=At,qx=ir,i3e=Xe,o3e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s<n;s+=4)l=1-a,t[s]=r*a+t[s]*l,t[s+1]=i*a+t[s+1]*l,t[s+2]=o*a+t[s+2]*l};Gx.RGBA=o3e;_0.Factory.addGetterSetter(qx.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_0.Factory.addGetterSetter(qx.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_0.Factory.addGetterSetter(qx.Node,"blue",0,i3e.RGBComponent,_0.Factory.afterSetFilter);_0.Factory.addGetterSetter(qx.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var Hx={};Object.defineProperty(Hx,"__esModule",{value:!0});Hx.Sepia=void 0;const a3e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r<n;r+=4)i=t[r+0],o=t[r+1],a=t[r+2],t[r+0]=Math.min(255,i*.393+o*.769+a*.189),t[r+1]=Math.min(255,i*.349+o*.686+a*.168),t[r+2]=Math.min(255,i*.272+o*.534+a*.131)};Hx.Sepia=a3e;var Wx={};Object.defineProperty(Wx,"__esModule",{value:!0});Wx.Solarize=void 0;const s3e=function(e){var t=e.data,n=e.width,r=e.height,i=n*4,o=r;do{var a=(o-1)*i,s=n;do{var l=a+(s-1)*4,u=t[l],c=t[l+1],d=t[l+2];u>127&&(u=255-u),c>127&&(c=255-c),d>127&&(d=255-d),t[l]=u,t[l+1]=c,t[l+2]=d}while(--s)}while(--o)};Wx.Solarize=s3e;var Kx={};Object.defineProperty(Kx,"__esModule",{value:!0});Kx.Threshold=void 0;const NO=At,l3e=ir,u3e=Xe,c3e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=1)n[i]=n[i]<t?0:255};Kx.Threshold=c3e;NO.Factory.addGetterSetter(l3e.Node,"threshold",.5,(0,u3e.getNumberValidator)(),NO.Factory.afterSetFilter);Object.defineProperty(rx,"__esModule",{value:!0});rx.Konva=void 0;const $O=vG,d3e=ux,f3e=fx,h3e=gx,p3e=mx,g3e=yx,DO=rp,m3e=Ty,y3e=Ep,v3e=Ay,b3e=_x,_3e=Sx,S3e=xx,x3e=wx,w3e=Fd,C3e=Cx,E3e=Ex,T3e=Tx,k3e=Ax,A3e=Px,P3e=Ix,I3e=Rx,R3e=Mx,O3e=Nx,M3e=$x,N3e=Dx,$3e=Lx,D3e=Fx,L3e=Bx,F3e=zx,B3e=jx,z3e=Ux,j3e=Vx,U3e=Gx,V3e=Hx,G3e=Wx,q3e=Kx;rx.Konva=$O.Konva.Util._assign($O.Konva,{Arc:d3e.Arc,Arrow:f3e.Arrow,Circle:h3e.Circle,Ellipse:p3e.Ellipse,Image:g3e.Image,Label:DO.Label,Tag:DO.Tag,Line:m3e.Line,Path:y3e.Path,Rect:v3e.Rect,RegularPolygon:b3e.RegularPolygon,Ring:_3e.Ring,Sprite:S3e.Sprite,Star:x3e.Star,Text:w3e.Text,TextPath:C3e.TextPath,Transformer:E3e.Transformer,Wedge:T3e.Wedge,Filters:{Blur:k3e.Blur,Brighten:A3e.Brighten,Contrast:P3e.Contrast,Emboss:I3e.Emboss,Enhance:R3e.Enhance,Grayscale:O3e.Grayscale,HSL:M3e.HSL,HSV:N3e.HSV,Invert:$3e.Invert,Kaleidoscope:D3e.Kaleidoscope,Mask:L3e.Mask,Noise:F3e.Noise,Pixelate:B3e.Pixelate,Posterize:z3e.Posterize,RGB:j3e.RGB,RGBA:U3e.RGBA,Sepia:V3e.Sepia,Solarize:G3e.Solarize,Threshold:q3e.Threshold}});var H3e=_A.exports;Object.defineProperty(H3e,"__esModule",{value:!0});const W3e=rx;_A.exports=W3e.Konva;var K3e=_A.exports;const ig=mc(K3e),Q3e=async(e,t,n)=>{const{width:r,height:i}=t,o=document.createElement("div"),a=new ig.Stage({container:o,width:r,height:i}),s=new ig.Layer,l=new ig.Layer;return s.add(new ig.Rect({...t,fill:n?"black":"white"})),e.forEach(u=>l.add(new ig.Line({points:u.points,stroke:n?"white":"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),a.add(s),a.add(l),o.remove(),a},X3e=async(e,t,n)=>new Promise((r,i)=>{const o=document.createElement("canvas");o.width=t,o.height=n;const a=o.getContext("2d"),s=new Image;if(!a){o.remove(),i("Unable to get context");return}s.onload=function(){a.drawImage(s,0,0),o.remove(),r(a.getImageData(0,0,t,n))},s.src=e}),LO=async(e,t)=>{const n=e.toDataURL(t);return await X3e(n,t.width,t.height)},$A=async(e,t,n,r,i)=>{const o=_e("canvas"),a=tx(),s=Gxe();if(!a||!s){o.error("Unable to find canvas / stage");return}const l={...t,...n},u=a.clone();u.scale({x:1,y:1});const c=u.getAbsolutePosition(),d={x:l.x+c.x,y:l.y+c.y,width:l.width,height:l.height},f=await L_(u,d),h=await LO(u,d),p=await Q3e(r?e.objects.filter(TB):[],l,i),m=await L_(p,l),_=await LO(p,l);return{baseBlob:f,baseImageData:h,maskBlob:m,maskImageData:_}},Y3e=()=>{Fe({actionCreator:Lxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),o=await $A(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!o)return;const{maskBlob:a}=o;if(!a){r.error("Problem getting mask layer blob"),t(qt({title:Y("toast.problemSavingMask"),description:Y("toast.problemSavingMaskDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(ve.endpoints.uploadImage.initiate({file:new File([a],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.maskSavedAssets")}}}))}})},Z3e=()=>{Fe({actionCreator:Uxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),o=await $A(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!o)return;const{maskBlob:a}=o;if(!a){r.error("Problem getting mask layer blob"),t(qt({title:Y("toast.problemImportingMask"),description:Y("toast.problemImportingMaskDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery,l=await t(ve.endpoints.uploadImage.initiate({file:new File([a],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.maskSentControlnetAssets")}}})).unwrap(),{image_name:u}=l;t(Cc({controlNetId:e.payload.controlNet.controlNetId,controlImage:u}))}})},J3e=async()=>{const e=tx();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),L_(t,t.getClientRect())},eEe=()=>{Fe({actionCreator:zxe,effect:async(e,{dispatch:t})=>{const n=x2.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await J3e();if(!r){n.error("Problem getting base layer blob"),t(qt({title:Y("toast.problemMergingCanvas"),description:Y("toast.problemMergingCanvasDesc"),status:"error"}));return}const i=tx();if(!i){n.error("Problem getting canvas base layer"),t(qt({title:Y("toast.problemMergingCanvas"),description:Y("toast.problemMergingCanvasDesc"),status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()}),a=await t(ve.endpoints.uploadImage.initiate({file:new File([r],"mergedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.canvasMerged")}}})).unwrap(),{image_name:s}=a;t(dle({kind:"image",layer:"base",imageName:s,...o}))}})},tEe=()=>{Fe({actionCreator:Dxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n();let o;try{o=await nx(i)}catch(s){r.error(String(s)),t(qt({title:Y("toast.problemSavingCanvas"),description:Y("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery;t(ve.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.canvasSavedGallery")}}}))}})},nEe=(e,t,n)=>{var c;if(!(m0e.match(e)||VR.match(e)||Cc.match(e)||y0e.match(e)||GR.match(e))||GR.match(e)&&((c=n.controlNet.controlNets[e.payload.controlNetId])==null?void 0:c.shouldAutoConfig)===!0)return!1;const i=t.controlNet.controlNets[e.payload.controlNetId];if(!i)return!1;const{controlImage:o,processorType:a,shouldAutoConfig:s}=i;return VR.match(e)&&!s?!1:a!=="none"&&!!o},rEe=()=>{Fe({predicate:nEe,effect:async(e,{dispatch:t,cancelActiveListeners:n,delay:r})=>{const i=_e("session"),{controlNetId:o}=e.payload;n(),i.trace("ControlNet auto-process triggered"),await r(300),t(Qk({controlNetId:o}))}})},Be="positive_conditioning",We="negative_conditioning",Oe="denoise_latents",Ke="latents_to_image",Ja="save_image",vd="nsfw_checker",Qc="invisible_watermark",Le="noise",Ic="main_model_loader",Qx="onnx_model_loader",bs="vae_loader",JG="lora_loader",Zt="clip_skip",Hn="image_to_latents",Ms="resize_image",bh="img2img_resize",me="canvas_output",Kn="inpaint_image",Ai="inpaint_image_resize_up",qi="inpaint_image_resize_down",Kt="inpaint_infill",Lu="inpaint_infill_resize_down",Wn="inpaint_create_mask",gt="canvas_coherence_denoise_latents",Vt="canvas_coherence_noise",dc="canvas_coherence_noise_increment",yr="canvas_coherence_mask_edge",jt="canvas_coherence_inpaint_create_mask",_h="tomask",Ui="mask_blur",Ti="mask_combine",Nn="mask_resize_up",Hi="mask_resize_down",qv="control_net_collect",iEe="ip_adapter",pt="metadata_accumulator",i5="esrgan",Vi="sdxl_model_loader",Te="sdxl_denoise_latents",Fc="sdxl_refiner_model_loader",Hv="sdxl_refiner_positive_conditioning",Wv="sdxl_refiner_negative_conditioning",_s="sdxl_refiner_denoise_latents",da="refiner_inpaint_create_mask",Wr="seamless",Xa="refiner_seamless",eq="text_to_image_graph",nT="image_to_image_graph",tq="canvas_text_to_image_graph",rT="canvas_image_to_image_graph",Xx="canvas_inpaint_graph",Yx="canvas_outpaint_graph",DA="sdxl_text_to_image_graph",U_="sxdl_image_to_image_graph",Zx="sdxl_canvas_text_to_image_graph",S0="sdxl_canvas_image_to_image_graph",fc="sdxl_canvas_inpaint_graph",hc="sdxl_canvas_outpaint_graph",nq=e=>(e==null?void 0:e.type)==="image_output",oEe=()=>{Fe({actionCreator:Qk,effect:async(e,{dispatch:t,getState:n,take:r})=>{var l;const i=_e("session"),{controlNetId:o}=e.payload,a=n().controlNet.controlNets[o];if(!(a!=null&&a.controlImage)){i.error("Unable to process ControlNet image");return}const s={nodes:{[a.processorNode.id]:{...a.processorNode,is_intermediate:!0,image:{image_name:a.controlImage}},[Ja]:{id:Ja,type:"save_image",is_intermediate:!0,use_cache:!1}},edges:[{source:{node_id:a.processorNode.id,field:"image"},destination:{node_id:Ja,field:"image"}}]};try{const u=t(Xr.endpoints.enqueueGraph.initiate({graph:s,prepend:!0},{fixedCacheKey:"enqueueGraph"})),c=await u.unwrap();u.reset(),i.debug({enqueueResult:Xt(c)},Y("queue.graphQueued"));const[d]=await r(f=>qk.match(f)&&f.payload.data.graph_execution_state_id===c.queue_item.session_id&&f.payload.data.source_node_id===Ja);if(nq(d.payload.data.result)){const{image_name:f}=d.payload.data.result.image,[{payload:h}]=await r(m=>ve.endpoints.getImageDTO.matchFulfilled(m)&&m.payload.image_name===f),p=h;i.debug({controlNetId:e.payload,processedControlImage:p},"ControlNet image processed"),t(Xk({controlNetId:o,processedControlImage:p.image_name}))}}catch(u){if(i.error({graph:Xt(s)},Y("queue.graphFailedToQueue")),u instanceof Object&&"data"in u&&"status"in u&&u.status===403){const c=((l=u.data)==null?void 0:l.detail)||"Unknown Error";t(qt({title:Y("queue.graphFailedToQueue"),status:"error",description:c,duration:15e3})),t(b0e()),t(Cc({controlNetId:o,controlImage:null}));return}t(qt({title:Y("queue.graphFailedToQueue"),status:"error"}))}}})},LA=Ne("app/enqueueRequested");Ne("app/batchEnqueued");const aEe=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("</br>"),t.document.write(r.outerHTML),t.document.write("</br></br>")})},FO=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>t(r.result),r.onerror=i=>n(r.error),r.onabort=i=>n(new Error("Read aborted")),r.readAsDataURL(e)}),sEe=e=>{let t=!0,n=!1;const r=e.length;let i=3;for(i;i<r;i+=4)if(e[i]===255?t=!1:n=!0,!t&&n)return{isFullyTransparent:t,isPartiallyTransparent:n};return{isFullyTransparent:t,isPartiallyTransparent:n}},lEe=e=>{const t=e.length;let n=0;for(n;n<t;)if(e[n++]===0&&e[n++]===0&&e[n++]===0&&e[n++]===255)return!0;return!1},uEe=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=sEe(e.data),i=lEe(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},cEe=e=>Coe(e,n=>n.isEnabled&&(!!n.processedControlImage||n.processorType==="none"&&!!n.controlImage)),Pa=(e,t,n)=>{const{isEnabled:r,controlNets:i}=e.controlNet,o=cEe(i),a=t.nodes[pt];if(r&&o.length&&o.length){const s={id:qv,type:"collect",is_intermediate:!0};t.nodes[qv]=s,t.edges.push({source:{node_id:qv,field:"collection"},destination:{node_id:n,field:"control"}}),o.forEach(l=>{const{controlNetId:u,controlImage:c,processedControlImage:d,beginStepPct:f,endStepPct:h,controlMode:p,resizeMode:m,model:_,processorType:b,weight:y}=l,g={id:`control_net_${u}`,type:"controlnet",is_intermediate:!0,begin_step_percent:f,end_step_percent:h,control_mode:p,resize_mode:m,control_model:_,control_weight:y};if(d&&b!=="none")g.image={image_name:d};else if(c)g.image={image_name:c};else return;if(t.nodes[g.id]=g,a!=null&&a.controlnets){const v=KS(g,["id","type"]);a.controlnets.push(v)}t.edges.push({source:{node_id:g.id,field:"control"},destination:{node_id:qv,field:"item"}}),gt in t.nodes&&t.edges.push({source:{node_id:g.id,field:"control"},destination:{node_id:gt,field:"control"}})})}},Ia=(e,t,n)=>{var a,s,l,u;const{isIPAdapterEnabled:r,ipAdapterInfo:i}=e.controlNet,o=t.nodes[pt];if(r&&i.model){const c={id:iEe,type:"ip_adapter",is_intermediate:!0,weight:i.weight,ip_adapter_model:{base_model:(a=i.model)==null?void 0:a.base_model,model_name:(s=i.model)==null?void 0:s.model_name},begin_step_percent:i.beginStepPct,end_step_percent:i.endStepPct};if(i.adapterImage)c.image={image_name:i.adapterImage};else return;if(t.nodes[c.id]=c,o!=null&&o.ipAdapters){const d={image:{image_name:i.adapterImage},ip_adapter_model:{base_model:(l=i.model)==null?void 0:l.base_model,model_name:(u=i.model)==null?void 0:u.model_name},weight:i.weight,begin_step_percent:i.beginStepPct,end_step_percent:i.endStepPct};o.ipAdapters.push(d)}t.edges.push({source:{node_id:c.id,field:"ip_adapter"},destination:{node_id:n,field:"ip_adapter"}}),gt in t.nodes&&t.edges.push({source:{node_id:c.id,field:"ip_adapter"},destination:{node_id:gt,field:"ip_adapter"}})}},kp=(e,t,n,r=Ic)=>{const{loras:i}=e.lora,o=QS(i),a=t.nodes[pt];o>0&&(t.edges=t.edges.filter(u=>!(u.source.node_id===r&&["unet"].includes(u.source.field))),t.edges=t.edges.filter(u=>!(u.source.node_id===Zt&&["clip"].includes(u.source.field))));let s="",l=0;Ea(i,u=>{const{model_name:c,base_model:d,weight:f}=u,h=`${JG}_${c.replace(".","_")}`,p={type:"lora_loader",id:h,is_intermediate:!0,lora:{model_name:c,base_model:d},weight:f};a!=null&&a.loras&&a.loras.push({lora:{model_name:c,base_model:d},weight:f}),t.nodes[h]=p,l===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:Zt,field:"clip"},destination:{node_id:h,field:"clip"}})):(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:s,field:"clip"},destination:{node_id:h,field:"clip"}})),l===o-1&&(t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[Xx,Yx].includes(t.id)&&t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:gt,field:"unet"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:We,field:"clip"}})),s=h,l+=1})},Ra=(e,t,n=Ke)=>{const r=t.nodes[n];if(!r)return;r.is_intermediate=!0,r.use_cache=!0;const i={id:vd,type:"img_nsfw",is_intermediate:!0};t.nodes[vd]=i,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:vd,field:"image"}})},dEe=["txt2img","img2img","unifiedCanvas","nodes","modelManager","queue"],FA=Ii(e=>e,({ui:e})=>hk(e.activeTab)?e.activeTab:"txt2img"),fKe=Ii(e=>e,({ui:e,config:t})=>{const r=dEe.filter(i=>!t.disabledTabs.includes(i)).indexOf(e.activeTab);return r===-1?0:r}),hKe=Ii(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:pk}}),Oa=(e,t)=>{const r=FA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,{autoAddBoardId:i}=e.gallery,o={id:Ja,type:"save_image",is_intermediate:r,use_cache:!1,board:i==="none"?void 0:{board_id:i}};t.nodes[Ja]=o,t.nodes[pt]&&t.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ja,field:"metadata"}});const s={node_id:Ja,field:"image"};Qc in t.nodes?t.edges.push({source:{node_id:Qc,field:"image"},destination:s}):vd in t.nodes?t.edges.push({source:{node_id:vd,field:"image"},destination:s}):me in t.nodes?t.edges.push({source:{node_id:me,field:"image"},destination:s}):Ke in t.nodes&&t.edges.push({source:{node_id:Ke,field:"image"},destination:s})},Ma=(e,t,n)=>{const{seamlessXAxis:r,seamlessYAxis:i}=e.generation;t.nodes[Wr]={id:Wr,type:"seamless",seamless_x:r,seamless_y:i};let o=Oe;(t.id===DA||t.id===U_||t.id===Zx||t.id===S0||t.id===fc||t.id===hc)&&(o=Te),t.edges=t.edges.filter(a=>!(a.source.node_id===n&&["unet"].includes(a.source.field))&&!(a.source.node_id===n&&["vae"].includes(a.source.field))),t.edges.push({source:{node_id:n,field:"unet"},destination:{node_id:Wr,field:"unet"}},{source:{node_id:n,field:"vae"},destination:{node_id:Wr,field:"vae"}},{source:{node_id:Wr,field:"unet"},destination:{node_id:o,field:"unet"}}),(t.id==Xx||t.id===Yx||t.id===fc||t.id===hc)&&t.edges.push({source:{node_id:Wr,field:"unet"},destination:{node_id:gt,field:"unet"}})},Na=(e,t,n=Ic)=>{const{vae:r,canvasCoherenceMode:i}=e.generation,{boundingBoxScaleMethod:o}=e.canvas,{shouldUseSDXLRefiner:a}=e.sdxl,s=["auto","manual"].includes(o),l=!r,u=t.nodes[pt];l||(t.nodes[bs]={type:"vae_loader",id:bs,is_intermediate:!0,vae_model:r});const c=n==Qx;(t.id===eq||t.id===nT||t.id===DA||t.id===U_)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ke,field:"vae"}}),(t.id===tq||t.id===rT||t.id===Zx||t.id==S0)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:s?Ke:me,field:"vae"}}),(t.id===nT||t.id===U_||t.id===rT||t.id===S0)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Hn,field:"vae"}}),(t.id===Xx||t.id===Yx||t.id===fc||t.id===hc)&&(t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Kn,field:"vae"}},{source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Wn,field:"vae"}},{source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ke,field:"vae"}}),i!=="unmasked"&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:jt,field:"vae"}})),a&&(t.id===fc||t.id===hc)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:da,field:"vae"}}),r&&u&&(u.vae=r)},$a=(e,t,n=Ke)=>{const i=FA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],a=t.nodes[vd],s=t.nodes[pt];if(!o)return;const l={id:Qc,type:"img_watermark",is_intermediate:i};t.nodes[Qc]=l,o.is_intermediate=!0,o.use_cache=!0,a?(a.is_intermediate=!0,t.edges.push({source:{node_id:vd,field:"image"},destination:{node_id:Qc,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Qc,field:"image"}}),s&&t.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Qc,field:"metadata"}})},fEe=(e,t)=>{const n=_e("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,img2imgStrength:c,vaePrecision:d,clipSkip:f,shouldUseCpuNoise:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{width:_,height:b}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:y,boundingBoxScaleMethod:g}=e.canvas,v=d==="fp32",S=!0,w=["auto","manual"].includes(g);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let x=Ic;const C=h,k={id:rT,nodes:{[x]:{type:"main_model_loader",id:x,is_intermediate:S,model:o},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:S,skipped_layers:f},[Be]:{type:"compel",id:Be,is_intermediate:S,prompt:r},[We]:{type:"compel",id:We,is_intermediate:S,prompt:i},[Le]:{type:"noise",id:Le,is_intermediate:S,use_cpu:C,seed:l,width:w?y.width:_,height:w?y.height:b},[Hn]:{type:"i2l",id:Hn,is_intermediate:S},[Oe]:{type:"denoise_latents",id:Oe,is_intermediate:S,cfg_scale:a,scheduler:s,steps:u,denoising_start:1-c,denoising_end:1},[me]:{type:"l2i",id:me,is_intermediate:S}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Oe,field:"latents"}}]};return w?(k.nodes[bh]={id:bh,type:"img_resize",is_intermediate:S,image:t,width:y.width,height:y.height},k.nodes[Ke]={id:Ke,type:"l2i",is_intermediate:S,fp32:v},k.nodes[me]={id:me,type:"img_resize",is_intermediate:S,width:_,height:b},k.edges.push({source:{node_id:bh,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):(k.nodes[me]={type:"l2i",id:me,is_intermediate:S,fp32:v},k.nodes[Hn].image=t,k.edges.push({source:{node_id:Oe,field:"latents"},destination:{node_id:me,field:"latents"}})),k.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:a,width:w?y.width:_,height:w?y.height:b,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:C?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:f,strength:c,init_image:t.image_name},(p||m)&&(Ma(e,k,x),x=Wr),kp(e,k,Oe),Na(e,k,x),Pa(e,k,Oe),Ia(e,k,Oe),e.system.shouldUseNSFWChecker&&Ra(e,k,me),e.system.shouldUseWatermarker&&$a(e,k,me),Oa(e,k),k},hEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,maskBlurMethod:m,canvasCoherenceMode:_,canvasCoherenceSteps:b,canvasCoherenceStrength:y,clipSkip:g,seamlessXAxis:v,seamlessYAxis:S}=e.generation;if(!a)throw r.error("No Image found in state"),new Error("No Image found in state");const{width:w,height:x}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:C,boundingBoxScaleMethod:k}=e.canvas,T=!0,P=f==="fp32",$=["auto","manual"].includes(k);let O=Ic;const E=h,A={id:Xx,nodes:{[O]:{type:"main_model_loader",id:O,is_intermediate:T,model:a},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:T,skipped_layers:g},[Be]:{type:"compel",id:Be,is_intermediate:T,prompt:i},[We]:{type:"compel",id:We,is_intermediate:T,prompt:o},[Ui]:{type:"img_blur",id:Ui,is_intermediate:T,radius:p,blur_type:m},[Kn]:{type:"i2l",id:Kn,is_intermediate:T,fp32:P},[Le]:{type:"noise",id:Le,use_cpu:E,seed:d,is_intermediate:T},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:T,fp32:P},[Oe]:{type:"denoise_latents",id:Oe,is_intermediate:T,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[Vt]:{type:"noise",id:Vt,use_cpu:E,seed:d+1,is_intermediate:T},[dc]:{type:"add",id:dc,b:1,is_intermediate:T},[gt]:{type:"denoise_latents",id:gt,is_intermediate:T,steps:b,cfg_scale:s,scheduler:l,denoising_start:1-y,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:T,fp32:P},[me]:{type:"color_correct",id:me,is_intermediate:T,reference:t}},edges:[{source:{node_id:O,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:O,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Oe,field:"latents"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Oe,field:"denoise_mask"}},{source:{node_id:O,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if($){const D=C.width,L=C.height;A.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:T,width:D,height:L,image:t},A.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:T,width:D,height:L,image:n},A.nodes[qi]={type:"img_resize",id:qi,is_intermediate:T,width:w,height:x},A.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:T,width:w,height:x},A.nodes[Le].width=D,A.nodes[Le].height=L,A.nodes[Vt].width=D,A.nodes[Vt].height=L,A.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ui,field:"image"}},{source:{node_id:Ai,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else A.nodes[Le].width=w,A.nodes[Le].height=x,A.nodes[Vt].width=w,A.nodes[Vt].height=x,A.nodes[Kn]={...A.nodes[Kn],image:t},A.nodes[Ui]={...A.nodes[Ui],image:n},A.nodes[Wn]={...A.nodes[Wn],image:t},A.edges.push({source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:me,field:"mask"}});return _!=="unmasked"&&(A.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:T,fp32:P},$?A.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:jt,field:"image"}}):A.nodes[jt]={...A.nodes[jt],image:t},_==="mask"&&($?A.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):A.nodes[jt]={...A.nodes[jt],mask:n}),_==="edge"&&(A.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:T,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},$?A.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):A.nodes[yr]={...A.nodes[yr],image:n},A.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),A.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(v||S)&&(Ma(e,A,O),O=Wr),Na(e,A,O),kp(e,A,Oe,O),Pa(e,A,Oe),Ia(e,A,Oe),e.system.shouldUseNSFWChecker&&Ra(e,A,me),e.system.shouldUseWatermarker&&$a(e,A,me),Oa(e,A),A},pEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:b,infillTileSize:y,infillPatchmatchDownscaleSize:g,infillMethod:v,clipSkip:S,seamlessXAxis:w,seamlessYAxis:x}=e.generation;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:C,height:k}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:T,boundingBoxScaleMethod:P}=e.canvas,$=f==="fp32",O=!0,E=["auto","manual"].includes(P);let A=Ic;const D=h,L={id:Yx,nodes:{[A]:{type:"main_model_loader",id:A,is_intermediate:O,model:a},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:O,skipped_layers:S},[Be]:{type:"compel",id:Be,is_intermediate:O,prompt:i},[We]:{type:"compel",id:We,is_intermediate:O,prompt:o},[_h]:{type:"tomask",id:_h,is_intermediate:O,image:t},[Ti]:{type:"mask_combine",id:Ti,is_intermediate:O,mask2:n},[Kn]:{type:"i2l",id:Kn,is_intermediate:O,fp32:$},[Le]:{type:"noise",id:Le,use_cpu:D,seed:d,is_intermediate:O},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:O,fp32:$},[Oe]:{type:"denoise_latents",id:Oe,is_intermediate:O,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[Vt]:{type:"noise",id:Vt,use_cpu:D,seed:d+1,is_intermediate:O},[dc]:{type:"add",id:dc,b:1,is_intermediate:O},[gt]:{type:"denoise_latents",id:gt,is_intermediate:O,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:O,fp32:$},[me]:{type:"color_correct",id:me,is_intermediate:O}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:_h,field:"image"},destination:{node_id:Ti,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Oe,field:"latents"}},{source:{node_id:E?Nn:Ti,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Oe,field:"denoise_mask"}},{source:{node_id:A,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(v==="patchmatch"&&(L.nodes[Kt]={type:"infill_patchmatch",id:Kt,is_intermediate:O,downscale:g}),v==="lama"&&(L.nodes[Kt]={type:"infill_lama",id:Kt,is_intermediate:O}),v==="cv2"&&(L.nodes[Kt]={type:"infill_cv2",id:Kt,is_intermediate:O}),v==="tile"&&(L.nodes[Kt]={type:"infill_tile",id:Kt,is_intermediate:O,tile_size:y}),E){const M=T.width,R=T.height;L.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:O,width:M,height:R,image:t},L.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:O,width:M,height:R},L.nodes[qi]={type:"img_resize",id:qi,is_intermediate:O,width:C,height:k},L.nodes[Lu]={type:"img_resize",id:Lu,is_intermediate:O,width:C,height:k},L.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:O,width:C,height:k},L.nodes[Le].width=M,L.nodes[Le].height=R,L.nodes[Vt].width=M,L.nodes[Vt].height=R,L.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kt,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:Nn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Lu,field:"image"}},{source:{node_id:Lu,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else L.nodes[Kt]={...L.nodes[Kt],image:t},L.nodes[Le].width=C,L.nodes[Le].height=k,L.nodes[Vt].width=C,L.nodes[Vt].height=k,L.nodes[Kn]={...L.nodes[Kn],image:t},L.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:me,field:"mask"}});return m!=="unmasked"&&(L.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:O,fp32:$},L.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:jt,field:"image"}}),m==="mask"&&(E?L.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):L.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:jt,field:"mask"}})),m==="edge"&&(L.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:O,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},E?L.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):L.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:yr,field:"image"}}),L.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),L.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(w||x)&&(Ma(e,L,A),A=Wr),Na(e,L,A),kp(e,L,Oe,A),Pa(e,L,Oe),Ia(e,L,Oe),e.system.shouldUseNSFWChecker&&Ra(e,L,me),e.system.shouldUseWatermarker&&$a(e,L,me),Oa(e,L),L},Ap=(e,t,n,r=Vi)=>{const{loras:i}=e.lora,o=QS(i),a=t.nodes[pt],s=r;let l=r;[Wr,da].includes(r)&&(l=Vi),o>0&&(t.edges=t.edges.filter(d=>!(d.source.node_id===s&&["unet"].includes(d.source.field))&&!(d.source.node_id===l&&["clip"].includes(d.source.field))&&!(d.source.node_id===l&&["clip2"].includes(d.source.field))));let u="",c=0;Ea(i,d=>{const{model_name:f,base_model:h,weight:p}=d,m=`${JG}_${f.replace(".","_")}`,_={type:"sdxl_lora_loader",id:m,is_intermediate:!0,lora:{model_name:f,base_model:h},weight:p};a&&(a.loras||(a.loras=[]),a.loras.push({lora:{model_name:f,base_model:h},weight:p})),t.nodes[m]=_,c===0?(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:l,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:l,field:"clip2"},destination:{node_id:m,field:"clip2"}})):(t.edges.push({source:{node_id:u,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:u,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:u,field:"clip2"},destination:{node_id:m,field:"clip2"}})),c===o-1&&(t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[fc,hc].includes(t.id)&&t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:gt,field:"unet"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:We,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:Be,field:"clip2"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:We,field:"clip2"}})),u=m,c+=1})},Zd=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o,shouldConcatSDXLStylePrompt:a}=e.sdxl,s=a||t?[n,i].join(" "):i,l=a||t?[r,o].join(" "):o;return{joinedPositiveStylePrompt:s,joinedNegativeStylePrompt:l}},Pp=(e,t,n,r,i,o)=>{const{refinerModel:a,refinerPositiveAestheticScore:s,refinerNegativeAestheticScore:l,refinerSteps:u,refinerScheduler:c,refinerCFGScale:d,refinerStart:f}=e.sdxl,{seamlessXAxis:h,seamlessYAxis:p,vaePrecision:m}=e.generation,{boundingBoxScaleMethod:_}=e.canvas,b=m==="fp32",y=["auto","manual"].includes(_);if(!a)return;const g=t.nodes[pt];g&&(g.refiner_model=a,g.refiner_positive_aesthetic_score=s,g.refiner_negative_aesthetic_score=l,g.refiner_cfg_scale=d,g.refiner_scheduler=c,g.refiner_start=f,g.refiner_steps=u);const v=r||Vi,{joinedPositiveStylePrompt:S,joinedNegativeStylePrompt:w}=Zd(e,!0);t.edges=t.edges.filter(x=>!(x.source.node_id===n&&["latents"].includes(x.source.field))),t.edges=t.edges.filter(x=>!(x.source.node_id===v&&["vae"].includes(x.source.field))),t.nodes[Fc]={type:"sdxl_refiner_model_loader",id:Fc,model:a},t.nodes[Hv]={type:"sdxl_refiner_compel_prompt",id:Hv,style:S,aesthetic_score:s},t.nodes[Wv]={type:"sdxl_refiner_compel_prompt",id:Wv,style:w,aesthetic_score:l},t.nodes[_s]={type:"denoise_latents",id:_s,cfg_scale:d,steps:u,scheduler:c,denoising_start:f,denoising_end:1},h||p?(t.nodes[Xa]={id:Xa,type:"seamless",seamless_x:h,seamless_y:p},t.edges.push({source:{node_id:Fc,field:"unet"},destination:{node_id:Xa,field:"unet"}},{source:{node_id:Fc,field:"vae"},destination:{node_id:Xa,field:"vae"}},{source:{node_id:Xa,field:"unet"},destination:{node_id:_s,field:"unet"}})):t.edges.push({source:{node_id:Fc,field:"unet"},destination:{node_id:_s,field:"unet"}}),t.edges.push({source:{node_id:Fc,field:"clip2"},destination:{node_id:Hv,field:"clip2"}},{source:{node_id:Fc,field:"clip2"},destination:{node_id:Wv,field:"clip2"}},{source:{node_id:Hv,field:"conditioning"},destination:{node_id:_s,field:"positive_conditioning"}},{source:{node_id:Wv,field:"conditioning"},destination:{node_id:_s,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:_s,field:"latents"}}),(t.id===fc||t.id===hc)&&(t.nodes[da]={type:"create_denoise_mask",id:da,is_intermediate:!0,fp32:b},y?t.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:da,field:"image"}}):t.nodes[da]={...t.nodes[da],image:i},t.id===fc&&(y?t.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:da,field:"mask"}}):t.nodes[da]={...t.nodes[da],mask:o}),t.id===hc&&t.edges.push({source:{node_id:y?Nn:Ti,field:"image"},destination:{node_id:da,field:"mask"}}),t.edges.push({source:{node_id:da,field:"denoise_mask"},destination:{node_id:_s,field:"denoise_mask"}})),t.id===Zx||t.id===S0?t.edges.push({source:{node_id:_s,field:"latents"},destination:{node_id:y?Ke:me,field:"latents"}}):t.edges.push({source:{node_id:_s,field:"latents"},destination:{node_id:Ke,field:"latents"}})},gEe=(e,t)=>{const n=_e("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,vaePrecision:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{shouldUseSDXLRefiner:p,refinerStart:m,sdxlImg2ImgDenoisingStrength:_}=e.sdxl,{width:b,height:y}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:g,boundingBoxScaleMethod:v}=e.canvas,S=c==="fp32",w=!0,x=["auto","manual"].includes(v);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let C=Vi;const k=d,{joinedPositiveStylePrompt:T,joinedNegativeStylePrompt:P}=Zd(e),$={id:S0,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:o},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:r,style:T},[We]:{type:"sdxl_compel_prompt",id:We,prompt:i,style:P},[Le]:{type:"noise",id:Le,is_intermediate:w,use_cpu:k,seed:l,width:x?g.width:b,height:x?g.height:y},[Hn]:{type:"i2l",id:Hn,is_intermediate:w,fp32:S},[Te]:{type:"denoise_latents",id:Te,is_intermediate:w,cfg_scale:a,scheduler:s,steps:u,denoising_start:p?Math.min(m,1-_):1-_,denoising_end:p?m:1}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Te,field:"latents"}}]};return x?($.nodes[bh]={id:bh,type:"img_resize",is_intermediate:w,image:t,width:g.width,height:g.height},$.nodes[Ke]={id:Ke,type:"l2i",is_intermediate:w,fp32:S},$.nodes[me]={id:me,type:"img_resize",is_intermediate:w,width:b,height:y},$.edges.push({source:{node_id:bh,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):($.nodes[me]={type:"l2i",id:me,is_intermediate:w,fp32:S},$.nodes[Hn].image=t,$.edges.push({source:{node_id:Te,field:"latents"},destination:{node_id:me,field:"latents"}})),$.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:a,width:x?g.width:b,height:x?g.height:y,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:k?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],ipAdapters:[],strength:_,init_image:t.image_name},$.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(Ma(e,$,C),C=Wr),p&&(Pp(e,$,Te,C),(f||h)&&(C=Xa)),Na(e,$,C),Ap(e,$,Te,C),Pa(e,$,Te),Ia(e,$,Te),e.system.shouldUseNSFWChecker&&Ra(e,$,me),e.system.shouldUseWatermarker&&$a(e,$,me),Oa(e,$),$},mEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,maskBlurMethod:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:b,seamlessXAxis:y,seamlessYAxis:g}=e.generation,{sdxlImg2ImgDenoisingStrength:v,shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:x,height:C}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:k,boundingBoxScaleMethod:T}=e.canvas,P=d==="fp32",$=!0,O=["auto","manual"].includes(T);let E=Vi;const A=f,{joinedPositiveStylePrompt:D,joinedNegativeStylePrompt:L}=Zd(e),M={id:fc,nodes:{[E]:{type:"sdxl_model_loader",id:E,model:a},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:D},[We]:{type:"sdxl_compel_prompt",id:We,prompt:o,style:L},[Ui]:{type:"img_blur",id:Ui,is_intermediate:$,radius:h,blur_type:p},[Kn]:{type:"i2l",id:Kn,is_intermediate:$,fp32:P},[Le]:{type:"noise",id:Le,use_cpu:A,seed:c,is_intermediate:$},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:$,fp32:P},[Te]:{type:"denoise_latents",id:Te,is_intermediate:$,steps:u,cfg_scale:s,scheduler:l,denoising_start:S?Math.min(w,1-v):1-v,denoising_end:S?w:1},[Vt]:{type:"noise",id:Vt,use_cpu:A,seed:c+1,is_intermediate:$},[dc]:{type:"add",id:dc,b:1,is_intermediate:$},[gt]:{type:"denoise_latents",id:gt,is_intermediate:$,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:$,fp32:P},[me]:{type:"color_correct",id:me,is_intermediate:$,reference:t}},edges:[{source:{node_id:E,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:E,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:E,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Te,field:"latents"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Te,field:"denoise_mask"}},{source:{node_id:E,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Te,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(O){const R=k.width,N=k.height;M.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:$,width:R,height:N,image:t},M.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:$,width:R,height:N,image:n},M.nodes[qi]={type:"img_resize",id:qi,is_intermediate:$,width:x,height:C},M.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:$,width:x,height:C},M.nodes[Le].width=R,M.nodes[Le].height=N,M.nodes[Vt].width=R,M.nodes[Vt].height=N,M.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ui,field:"image"}},{source:{node_id:Ai,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else M.nodes[Le].width=x,M.nodes[Le].height=C,M.nodes[Vt].width=x,M.nodes[Vt].height=C,M.nodes[Kn]={...M.nodes[Kn],image:t},M.nodes[Ui]={...M.nodes[Ui],image:n},M.nodes[Wn]={...M.nodes[Wn],image:t},M.edges.push({source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:me,field:"mask"}});return m!=="unmasked"&&(M.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:$,fp32:P},O?M.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:jt,field:"image"}}):M.nodes[jt]={...M.nodes[jt],image:t},m==="mask"&&(O?M.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):M.nodes[jt]={...M.nodes[jt],mask:n}),m==="edge"&&(M.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:$,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},O?M.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):M.nodes[yr]={...M.nodes[yr],image:n},M.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),M.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(y||g)&&(Ma(e,M,E),E=Wr),S&&(Pp(e,M,gt,E,t,n),(y||g)&&(E=Xa)),Na(e,M,E),Ap(e,M,Te,E),Pa(e,M,Te),Ia(e,M,Te),e.system.shouldUseNSFWChecker&&Ra(e,M,me),e.system.shouldUseWatermarker&&$a(e,M,me),Oa(e,M),M},yEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,canvasCoherenceMode:p,canvasCoherenceSteps:m,canvasCoherenceStrength:_,infillTileSize:b,infillPatchmatchDownscaleSize:y,infillMethod:g,seamlessXAxis:v,seamlessYAxis:S}=e.generation,{sdxlImg2ImgDenoisingStrength:w,shouldUseSDXLRefiner:x,refinerStart:C}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:k,height:T}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:P,boundingBoxScaleMethod:$}=e.canvas,O=d==="fp32",E=!0,A=["auto","manual"].includes($);let D=Vi;const L=f,{joinedPositiveStylePrompt:M,joinedNegativeStylePrompt:R}=Zd(e),N={id:hc,nodes:{[Vi]:{type:"sdxl_model_loader",id:Vi,model:a},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:M},[We]:{type:"sdxl_compel_prompt",id:We,prompt:o,style:R},[_h]:{type:"tomask",id:_h,is_intermediate:E,image:t},[Ti]:{type:"mask_combine",id:Ti,is_intermediate:E,mask2:n},[Kn]:{type:"i2l",id:Kn,is_intermediate:E,fp32:O},[Le]:{type:"noise",id:Le,use_cpu:L,seed:c,is_intermediate:E},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:E,fp32:O},[Te]:{type:"denoise_latents",id:Te,is_intermediate:E,steps:u,cfg_scale:s,scheduler:l,denoising_start:x?Math.min(C,1-w):1-w,denoising_end:x?C:1},[Vt]:{type:"noise",id:Vt,use_cpu:L,seed:c+1,is_intermediate:E},[dc]:{type:"add",id:dc,b:1,is_intermediate:E},[gt]:{type:"denoise_latents",id:gt,is_intermediate:E,steps:m,cfg_scale:s,scheduler:l,denoising_start:1-_,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:E,fp32:O},[me]:{type:"color_correct",id:me,is_intermediate:E}},edges:[{source:{node_id:Vi,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:Vi,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vi,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:Vi,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Vi,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:_h,field:"image"},destination:{node_id:Ti,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Te,field:"latents"}},{source:{node_id:A?Nn:Ti,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Te,field:"denoise_mask"}},{source:{node_id:D,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Te,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(g==="patchmatch"&&(N.nodes[Kt]={type:"infill_patchmatch",id:Kt,is_intermediate:E,downscale:y}),g==="lama"&&(N.nodes[Kt]={type:"infill_lama",id:Kt,is_intermediate:E}),g==="cv2"&&(N.nodes[Kt]={type:"infill_cv2",id:Kt,is_intermediate:E}),g==="tile"&&(N.nodes[Kt]={type:"infill_tile",id:Kt,is_intermediate:E,tile_size:b}),A){const B=P.width,U=P.height;N.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:E,width:B,height:U,image:t},N.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:E,width:B,height:U},N.nodes[qi]={type:"img_resize",id:qi,is_intermediate:E,width:k,height:T},N.nodes[Lu]={type:"img_resize",id:Lu,is_intermediate:E,width:k,height:T},N.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:E,width:k,height:T},N.nodes[Le].width=B,N.nodes[Le].height=U,N.nodes[Vt].width=B,N.nodes[Vt].height=U,N.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kt,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:Nn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Lu,field:"image"}},{source:{node_id:Lu,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else N.nodes[Kt]={...N.nodes[Kt],image:t},N.nodes[Le].width=k,N.nodes[Le].height=T,N.nodes[Vt].width=k,N.nodes[Vt].height=T,N.nodes[Kn]={...N.nodes[Kn],image:t},N.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:me,field:"mask"}});return p!=="unmasked"&&(N.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:E,fp32:O},N.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:jt,field:"image"}}),p==="mask"&&(A?N.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):N.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:jt,field:"mask"}})),p==="edge"&&(N.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:E,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},A?N.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):N.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:yr,field:"image"}}),N.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),N.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(v||S)&&(Ma(e,N,D),D=Wr),x&&(Pp(e,N,gt,D,t),(v||S)&&(D=Xa)),Na(e,N,D),Ap(e,N,Te,D),Pa(e,N,Te),Ia(e,N,Te),e.system.shouldUseNSFWChecker&&Ra(e,N,me),e.system.shouldUseWatermarker&&$a(e,N,me),Oa(e,N),N},vEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,shouldUseCpuNoise:c,seamlessXAxis:d,seamlessYAxis:f}=e.generation,{width:h,height:p}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:m,boundingBoxScaleMethod:_}=e.canvas,b=u==="fp32",y=!0,g=["auto","manual"].includes(_),{shouldUseSDXLRefiner:v,refinerStart:S}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=c,x=i.model_type==="onnx";let C=x?Qx:Vi;const k=x?"onnx_model_loader":"sdxl_model_loader",T=x?{type:"t2l_onnx",id:Te,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:Te,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:v?S:1},{joinedPositiveStylePrompt:P,joinedNegativeStylePrompt:$}=Zd(e),O={id:Zx,nodes:{[C]:{type:k,id:C,is_intermediate:y,model:i},[Be]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:Be,is_intermediate:y,prompt:n,style:P},[We]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:We,is_intermediate:y,prompt:r,style:$},[Le]:{type:"noise",id:Le,is_intermediate:y,seed:s,width:g?m.width:h,height:g?m.height:p,use_cpu:w},[T.id]:T},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}}]};return g?(O.nodes[Ke]={id:Ke,type:x?"l2i_onnx":"l2i",is_intermediate:y,fp32:b},O.nodes[me]={id:me,type:"img_resize",is_intermediate:y,width:h,height:p},O.edges.push({source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):(O.nodes[me]={type:x?"l2i_onnx":"l2i",id:me,is_intermediate:y,fp32:b},O.edges.push({source:{node_id:Te,field:"latents"},destination:{node_id:me,field:"latents"}})),O.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:g?m.width:h,height:g?m.height:p,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[]},O.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(d||f)&&(Ma(e,O,C),C=Wr),v&&(Pp(e,O,Te,C),(d||f)&&(C=Xa)),Ap(e,O,Te,C),Na(e,O,C),Pa(e,O,Te),Ia(e,O,Te),e.system.shouldUseNSFWChecker&&Ra(e,O,me),e.system.shouldUseWatermarker&&$a(e,O,me),Oa(e,O),O},bEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,clipSkip:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:_,boundingBoxScaleMethod:b}=e.canvas,y=u==="fp32",g=!0,v=["auto","manual"].includes(b);if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=d,w=i.model_type==="onnx";let x=w?Qx:Ic;const C=w?"onnx_model_loader":"main_model_loader",k=w?{type:"t2l_onnx",id:Oe,is_intermediate:g,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:Oe,is_intermediate:g,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:1},T={id:tq,nodes:{[x]:{type:C,id:x,is_intermediate:g,model:i},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:g,skipped_layers:c},[Be]:{type:w?"prompt_onnx":"compel",id:Be,is_intermediate:g,prompt:n},[We]:{type:w?"prompt_onnx":"compel",id:We,is_intermediate:g,prompt:r},[Le]:{type:"noise",id:Le,is_intermediate:g,seed:s,width:v?_.width:p,height:v?_.height:m,use_cpu:S},[k.id]:k},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}}]};return v?(T.nodes[Ke]={id:Ke,type:w?"l2i_onnx":"l2i",is_intermediate:g,fp32:y},T.nodes[me]={id:me,type:"img_resize",is_intermediate:g,width:p,height:m},T.edges.push({source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):(T.nodes[me]={type:w?"l2i_onnx":"l2i",id:me,is_intermediate:g,fp32:y},T.edges.push({source:{node_id:Oe,field:"latents"},destination:{node_id:me,field:"latents"}})),T.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:v?_.width:p,height:v?_.height:m,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:S?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:c},T.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(Ma(e,T,x),x=Wr),Na(e,T,x),kp(e,T,Oe,x),Pa(e,T,Oe),Ia(e,T,Oe),e.system.shouldUseNSFWChecker&&Ra(e,T,me),e.system.shouldUseWatermarker&&$a(e,T,me),Oa(e,T),T},_Ee=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=vEe(e):i=bEe(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=gEe(e,n):i=fEe(e,n)}else if(t==="inpaint"){if(!n||!r)throw new Error("Missing canvas init and mask images");e.generation.model&&e.generation.model.base_model==="sdxl"?i=mEe(e,n,r):i=hEe(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=yEe(e,n,r):i=pEe(e,n,r)}return i},o5=({count:e,start:t,min:n=Lae,max:r=qg})=>{const i=t??hae(n,r),o=[];for(let a=i;a<i+e;a++)o.push(a%r);return o},rq=(e,t,n)=>{const{iterations:r,model:i,shouldRandomizeSeed:o,seed:a}=e.generation,{shouldConcatSDXLStylePrompt:s,positiveStylePrompt:l}=e.sdxl,{prompts:u,seedBehaviour:c}=e.dynamicPrompts,d=[];if(u.length===1){Z8(t.nodes[pt],"seed");const h=o5({count:r,start:o?void 0:a}),p=[];t.nodes[Le]&&p.push({node_path:Le,field_name:"seed",items:h}),t.nodes[pt]&&p.push({node_path:pt,field_name:"seed",items:h}),t.nodes[Vt]&&p.push({node_path:Vt,field_name:"seed",items:h.map(m=>(m+1)%qg)}),d.push(p)}else{const h=[],p=[];if(c==="PER_PROMPT"){const _=o5({count:u.length*r,start:o?void 0:a});t.nodes[Le]&&h.push({node_path:Le,field_name:"seed",items:_}),t.nodes[pt]&&h.push({node_path:pt,field_name:"seed",items:_}),t.nodes[Vt]&&h.push({node_path:Vt,field_name:"seed",items:_.map(b=>(b+1)%qg)})}else{const _=o5({count:r,start:o?void 0:a});t.nodes[Le]&&p.push({node_path:Le,field_name:"seed",items:_}),t.nodes[pt]&&p.push({node_path:pt,field_name:"seed",items:_}),t.nodes[Vt]&&p.push({node_path:Vt,field_name:"seed",items:_.map(b=>(b+1)%qg)}),d.push(p)}const m=c==="PER_PROMPT"?bae(r).flatMap(()=>u):u;if(t.nodes[Be]&&h.push({node_path:Be,field_name:"prompt",items:m}),t.nodes[pt]&&h.push({node_path:pt,field_name:"positive_prompt",items:m}),s&&(i==null?void 0:i.base_model)==="sdxl"){Z8(t.nodes[pt],"positive_style_prompt");const _=m.map(b=>[b,l].join(" "));t.nodes[Be]&&h.push({node_path:Be,field_name:"style",items:_}),t.nodes[pt]&&h.push({node_path:pt,field_name:"positive_style_prompt",items:_})}d.push(h)}return{prepend:n,batch:{graph:t,runs:1,data:d}}},SEe=()=>{Fe({predicate:e=>LA.match(e)&&e.payload.tabName==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n})=>{const r=_e("queue"),{prepend:i}=e.payload,o=t(),{layerState:a,boundingBoxCoordinates:s,boundingBoxDimensions:l,isMaskEnabled:u,shouldPreserveMaskedArea:c}=o.canvas,d=await $A(a,s,l,u,c);if(!d){r.error("Unable to create canvas data");return}const{baseBlob:f,baseImageData:h,maskBlob:p,maskImageData:m}=d,_=uEe(h,m);if(o.system.enableImageDebugging){const S=await FO(f),w=await FO(p);aEe([{base64:w,caption:"mask b64"},{base64:S,caption:"image b64"}])}r.debug(`Generation mode: ${_}`);let b,y;["img2img","inpaint","outpaint"].includes(_)&&(b=await n(ve.endpoints.uploadImage.initiate({file:new File([f],"canvasInitImage.png",{type:"image/png"}),image_category:"general",is_intermediate:!0})).unwrap()),["inpaint","outpaint"].includes(_)&&(y=await n(ve.endpoints.uploadImage.initiate({file:new File([p],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!0})).unwrap());const g=_Ee(o,_,b,y);r.debug({graph:Xt(g)},"Canvas graph built"),n(fG(g));const v=rq(o,g,i);try{const S=n(Xr.endpoints.enqueueBatch.initiate(v,{fixedCacheKey:"enqueueBatch"})),w=await S.unwrap();S.reset();const x=w.batch.batch_id;o.canvas.layerState.stagingArea.boundingBox||n(fle({boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(hle(x))}catch{}}})},xEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,img2imgStrength:c,shouldFitToWidthHeight:d,width:f,height:h,clipSkip:p,shouldUseCpuNoise:m,vaePrecision:_,seamlessXAxis:b,seamlessYAxis:y}=e.generation;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const g=_==="fp32",v=!0;let S=Ic;const w=m,x={id:nT,nodes:{[S]:{type:"main_model_loader",id:S,model:i,is_intermediate:v},[Zt]:{type:"clip_skip",id:Zt,skipped_layers:p,is_intermediate:v},[Be]:{type:"compel",id:Be,prompt:n,is_intermediate:v},[We]:{type:"compel",id:We,prompt:r,is_intermediate:v},[Le]:{type:"noise",id:Le,use_cpu:w,seed:s,is_intermediate:v},[Ke]:{type:"l2i",id:Ke,fp32:g,is_intermediate:v},[Oe]:{type:"denoise_latents",id:Oe,cfg_scale:o,scheduler:a,steps:l,denoising_start:1-c,denoising_end:1,is_intermediate:v},[Hn]:{type:"i2l",id:Hn,fp32:g,is_intermediate:v}},edges:[{source:{node_id:S,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:S,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Oe,field:"latents"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(d&&(u.width!==f||u.height!==h)){const C={id:Ms,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:f,height:h};x.nodes[Ms]=C,x.edges.push({source:{node_id:Ms,field:"image"},destination:{node_id:Hn,field:"image"}}),x.edges.push({source:{node_id:Ms,field:"width"},destination:{node_id:Le,field:"width"}}),x.edges.push({source:{node_id:Ms,field:"height"},destination:{node_id:Le,field:"height"}})}else x.nodes[Hn].image={image_name:u.imageName},x.edges.push({source:{node_id:Hn,field:"width"},destination:{node_id:Le,field:"width"}}),x.edges.push({source:{node_id:Hn,field:"height"},destination:{node_id:Le,field:"height"}});return x.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:o,height:h,width:f,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:p,strength:c,init_image:u.imageName},x.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(b||y)&&(Ma(e,x,S),S=Wr),Na(e,x,S),kp(e,x,Oe,S),Pa(e,x,Oe),Ia(e,x,Oe),e.system.shouldUseNSFWChecker&&Ra(e,x),e.system.shouldUseWatermarker&&$a(e,x),Oa(e,x),x},wEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,shouldFitToWidthHeight:c,width:d,height:f,shouldUseCpuNoise:h,vaePrecision:p,seamlessXAxis:m,seamlessYAxis:_}=e.generation,{positiveStylePrompt:b,negativeStylePrompt:y,shouldUseSDXLRefiner:g,refinerStart:v,sdxlImg2ImgDenoisingStrength:S}=e.sdxl;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=p==="fp32",x=!0;let C=Vi;const k=h,{joinedPositiveStylePrompt:T,joinedNegativeStylePrompt:P}=Zd(e),$={id:U_,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:i,is_intermediate:x},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:T,is_intermediate:x},[We]:{type:"sdxl_compel_prompt",id:We,prompt:r,style:P,is_intermediate:x},[Le]:{type:"noise",id:Le,use_cpu:k,seed:s,is_intermediate:x},[Ke]:{type:"l2i",id:Ke,fp32:w,is_intermediate:x},[Te]:{type:"denoise_latents",id:Te,cfg_scale:o,scheduler:a,steps:l,denoising_start:g?Math.min(v,1-S):1-S,denoising_end:g?v:1,is_intermediate:x},[Hn]:{type:"i2l",id:Hn,fp32:w,is_intermediate:x}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Te,field:"latents"}},{source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(c&&(u.width!==d||u.height!==f)){const O={id:Ms,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:d,height:f};$.nodes[Ms]=O,$.edges.push({source:{node_id:Ms,field:"image"},destination:{node_id:Hn,field:"image"}}),$.edges.push({source:{node_id:Ms,field:"width"},destination:{node_id:Le,field:"width"}}),$.edges.push({source:{node_id:Ms,field:"height"},destination:{node_id:Le,field:"height"}})}else $.nodes[Hn].image={image_name:u.imageName},$.edges.push({source:{node_id:Hn,field:"width"},destination:{node_id:Le,field:"width"}}),$.edges.push({source:{node_id:Hn,field:"height"},destination:{node_id:Le,field:"height"}});return $.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"sdxl_img2img",cfg_scale:o,height:f,width:d,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:k?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],strength:S,init_image:u.imageName,positive_style_prompt:b,negative_style_prompt:y},$.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(m||_)&&(Ma(e,$,C),C=Wr),g&&(Pp(e,$,Te),(m||_)&&(C=Xa)),Na(e,$,C),Ap(e,$,Te,C),Pa(e,$,Te),Ia(e,$,Te),e.system.shouldUseNSFWChecker&&Ra(e,$),e.system.shouldUseWatermarker&&$a(e,$),Oa(e,$),$},CEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,width:u,height:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{positiveStylePrompt:m,negativeStylePrompt:_,shouldUseSDXLRefiner:b,refinerStart:y}=e.sdxl,g=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const v=f==="fp32",S=!0,{joinedPositiveStylePrompt:w,joinedNegativeStylePrompt:x}=Zd(e);let C=Vi;const k={id:DA,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:i,is_intermediate:S},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:w,is_intermediate:S},[We]:{type:"sdxl_compel_prompt",id:We,prompt:r,style:x,is_intermediate:S},[Le]:{type:"noise",id:Le,seed:s,width:u,height:c,use_cpu:g,is_intermediate:S},[Te]:{type:"denoise_latents",id:Te,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:b?y:1,is_intermediate:S},[Ke]:{type:"l2i",id:Ke,fp32:v,is_intermediate:S}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};return k.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"sdxl_txt2img",cfg_scale:o,height:c,width:u,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:g?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],positive_style_prompt:m,negative_style_prompt:_},k.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(h||p)&&(Ma(e,k,C),C=Wr),b&&(Pp(e,k,Te),(h||p)&&(C=Xa)),Na(e,k,C),Ap(e,k,Te,C),Pa(e,k,Te),Ia(e,k,Te),e.system.shouldUseNSFWChecker&&Ra(e,k),e.system.shouldUseWatermarker&&$a(e,k),Oa(e,k),k},EEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,steps:s,width:l,height:u,clipSkip:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p,seed:m}=e.generation,_=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const b=f==="fp32",y=!0,g=i.model_type==="onnx";let v=g?Qx:Ic;const S=g?"onnx_model_loader":"main_model_loader",w=g?{type:"t2l_onnx",id:Oe,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s}:{type:"denoise_latents",id:Oe,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s,denoising_start:0,denoising_end:1},x={id:eq,nodes:{[v]:{type:S,id:v,is_intermediate:y,model:i},[Zt]:{type:"clip_skip",id:Zt,skipped_layers:c,is_intermediate:y},[Be]:{type:g?"prompt_onnx":"compel",id:Be,prompt:n,is_intermediate:y},[We]:{type:g?"prompt_onnx":"compel",id:We,prompt:r,is_intermediate:y},[Le]:{type:"noise",id:Le,seed:m,width:l,height:u,use_cpu:_,is_intermediate:y},[w.id]:w,[Ke]:{type:g?"l2i_onnx":"l2i",id:Ke,fp32:b,is_intermediate:y}},edges:[{source:{node_id:v,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:v,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};return x.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:u,width:l,positive_prompt:n,negative_prompt:r,model:i,seed:m,steps:s,rand_device:_?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:c},x.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(h||p)&&(Ma(e,x,v),v=Wr),Na(e,x,v),kp(e,x,Oe,v),Pa(e,x,Oe),Ia(e,x,Oe),e.system.shouldUseNSFWChecker&&Ra(e,x),e.system.shouldUseWatermarker&&$a(e,x),Oa(e,x),x},TEe=()=>{Fe({predicate:e=>LA.match(e)&&(e.payload.tabName==="txt2img"||e.payload.tabName==="img2img"),effect:async(e,{getState:t,dispatch:n})=>{const r=t(),i=r.generation.model,{prepend:o}=e.payload;let a;i&&i.base_model==="sdxl"?e.payload.tabName==="txt2img"?a=CEe(r):a=wEe(r):e.payload.tabName==="txt2img"?a=EEe(r):a=xEe(r);const s=rq(r,a,o);n(Xr.endpoints.enqueueBatch.initiate(s,{fixedCacheKey:"enqueueBatch"})).reset()}})},kEe=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function AEe(e){return e.length===1?e[0].toString():e.reduce((t,n)=>{if(typeof n=="number")return t+"["+n.toString()+"]";if(n.includes('"'))return t+'["'+PEe(n)+'"]';if(!kEe.test(n))return t+'["'+n+'"]';const r=t.length===0?"":".";return t+r+n},"")}function PEe(e){return e.replace(/"/g,'\\"')}function IEe(e){return e.length!==0}const REe=99,iq="; ",oq=", or ",BA="Validation error",aq=": ";class sq extends Error{constructor(n,r=[]){super(n);xw(this,"details");xw(this,"name");this.details=r,this.name="ZodValidationError"}toString(){return this.message}}function zA(e,t,n){if(e.code==="invalid_union")return e.unionErrors.reduce((r,i)=>{const o=i.issues.map(a=>zA(a,t,n)).join(t);return r.includes(o)||r.push(o),r},[]).join(n);if(IEe(e.path)){if(e.path.length===1){const r=e.path[0];if(typeof r=="number")return`${e.message} at index ${r}`}return`${e.message} at "${AEe(e.path)}"`}return e.message}function lq(e,t,n){return t!==null?e.length>0?[t,e].join(n):t:e.length>0?e:BA}function pKe(e,t={}){const{issueSeparator:n=iq,unionSeparator:r=oq,prefixSeparator:i=aq,prefix:o=BA}=t,a=zA(e,n,r),s=lq(a,o,i);return new sq(s,[e])}function BO(e,t={}){const{maxIssuesInMessage:n=REe,issueSeparator:r=iq,unionSeparator:i=oq,prefixSeparator:o=aq,prefix:a=BA}=t,s=e.errors.slice(0,n).map(u=>zA(u,r,i)).join(r),l=lq(s,a,o);return new sq(l,e.errors)}const OEe=e=>{const{workflow:t,nodes:n,edges:r}=e,i={...t,nodes:[],edges:[]};return n.filter(o=>["invocation","notes"].includes(o.type??"__UNKNOWN_NODE_TYPE__")).forEach(o=>{const a=qB.safeParse(o);if(!a.success){const{message:s}=BO(a.error,{prefix:be.t("nodes.unableToParseNode")});_e("nodes").warn({node:Xt(o)},s);return}i.nodes.push(a.data)}),r.forEach(o=>{const a=HB.safeParse(o);if(!a.success){const{message:s}=BO(a.error,{prefix:be.t("nodes.unableToParseEdge")});_e("nodes").warn({edge:Xt(o)},s);return}i.edges.push(a.data)}),i},MEe=e=>{if(e.type==="ColorField"&&e.value){const t=Cn(e.value),{r:n,g:r,b:i,a:o}=e.value,a=Math.max(0,Math.min(o*255,255));return Object.assign(t,{r:n,g:r,b:i,a}),t}return e.value},NEe=e=>{const{nodes:t,edges:n}=e,r=t.filter(Ur),i=JSON.stringify(OEe(e)),o=r.reduce((u,c)=>{const{id:d,data:f}=c,{type:h,inputs:p,isIntermediate:m,embedWorkflow:_}=f,b=eE(p,(g,v,S)=>{const w=MEe(v);return g[S]=w,g},{});b.use_cache=c.data.useCache;const y={type:h,id:d,...b,is_intermediate:m};return _&&Object.assign(y,{workflow:i}),Object.assign(u,{[d]:y}),u},{}),s=n.filter(u=>u.type!=="collapsed").reduce((u,c)=>{const{source:d,target:f,sourceHandle:h,targetHandle:p}=c;return u.push({source:{node_id:d,field:h},destination:{node_id:f,field:p}}),u},[]);return s.forEach(u=>{const c=o[u.destination.node_id],d=u.destination.field;o[u.destination.node_id]=KS(c,d)}),{id:LV(),nodes:o,edges:s}},$Ee=()=>{Fe({predicate:e=>LA.match(e)&&e.payload.tabName==="nodes",effect:async(e,{getState:t,dispatch:n})=>{const r=t(),o={batch:{graph:NEe(r.nodes),runs:r.generation.iterations},prepend:e.payload.prepend};n(Xr.endpoints.enqueueBatch.initiate(o,{fixedCacheKey:"enqueueBatch"})).reset()}})},DEe=()=>{Fe({matcher:ve.endpoints.addImageToBoard.matchFulfilled,effect:e=>{const t=_e("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Image added to board")}})},LEe=()=>{Fe({matcher:ve.endpoints.addImageToBoard.matchRejected,effect:e=>{const t=_e("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Problem adding image to board")}})},jA=Ne("deleteImageModal/imageDeletionConfirmed"),gKe=Ii(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1],ex),uq=Ii([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?oi:Ji,offset:0,limit:_le,is_intermediate:!1}},ex),FEe=()=>{Fe({actionCreator:jA,effect:async(e,{dispatch:t,getState:n,condition:r})=>{var f;const{imageDTOs:i,imagesUsage:o}=e.payload;if(i.length!==1||o.length!==1)return;const a=i[0],s=o[0];if(!a||!s)return;t(Yk(!1));const l=n(),u=(f=l.gallery.selection[l.gallery.selection.length-1])==null?void 0:f.image_name;if(a&&(a==null?void 0:a.image_name)===u){const{image_name:h}=a,p=uq(l),{data:m}=ve.endpoints.listImages.select(p)(l),_=m?Gn.getSelectors().selectAll(m):[],b=_.findIndex(S=>S.image_name===h),y=_.filter(S=>S.image_name!==h),g=Nu(b,0,y.length-1),v=y[g];t(Gs(v||null))}s.isCanvasImage&&t(bk()),i.forEach(h=>{var p;((p=n().generation.initialImage)==null?void 0:p.imageName)===h.image_name&&t(vk()),Ea(n().controlNet.controlNets,m=>{(m.controlImage===h.image_name||m.processedControlImage===h.image_name)&&(t(Cc({controlNetId:m.controlNetId,controlImage:null})),t(Xk({controlNetId:m.controlNetId,processedControlImage:null})))}),n().controlNet.ipAdapterInfo.adapterImage===h.image_name&&t(q2(null)),n().nodes.nodes.forEach(m=>{Ur(m)&&Ea(m.data.inputs,_=>{var b;_.type==="ImageField"&&((b=_.value)==null?void 0:b.image_name)===h.image_name&&t(Z2({nodeId:m.data.id,fieldName:_.name,value:void 0}))})})});const{requestId:c}=t(ve.endpoints.deleteImage.initiate(a));await r(h=>ve.endpoints.deleteImage.matchFulfilled(h)&&h.meta.requestId===c,3e4)&&t(us.util.invalidateTags([{type:"Board",id:a.board_id}]))}})},BEe=()=>{Fe({actionCreator:jA,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTOs:r,imagesUsage:i}=e.payload;if(!(r.length<=1||i.length<=1))try{await t(ve.endpoints.deleteImages.initiate({imageDTOs:r})).unwrap();const o=n(),a=uq(o),{data:s}=ve.endpoints.listImages.select(a)(o),l=s?Gn.getSelectors().selectAll(s)[0]:void 0;t(Gs(l||null)),t(Yk(!1)),i.some(u=>u.isCanvasImage)&&t(bk()),r.forEach(u=>{var c;((c=n().generation.initialImage)==null?void 0:c.imageName)===u.image_name&&t(vk()),Ea(n().controlNet.controlNets,d=>{(d.controlImage===u.image_name||d.processedControlImage===u.image_name)&&(t(Cc({controlNetId:d.controlNetId,controlImage:null})),t(Xk({controlNetId:d.controlNetId,processedControlImage:null})))}),n().controlNet.ipAdapterInfo.adapterImage===u.image_name&&t(q2(null)),n().nodes.nodes.forEach(d=>{Ur(d)&&Ea(d.data.inputs,f=>{var h;f.type==="ImageField"&&((h=f.value)==null?void 0:h.image_name)===u.image_name&&t(Z2({nodeId:d.data.id,fieldName:f.name,value:void 0}))})})})}catch{}}})},zEe=()=>{Fe({matcher:ve.endpoints.deleteImage.matchPending,effect:()=>{}})},jEe=()=>{Fe({matcher:ve.endpoints.deleteImage.matchFulfilled,effect:e=>{_e("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},UEe=()=>{Fe({matcher:ve.endpoints.deleteImage.matchRejected,effect:e=>{_e("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},cq=Ne("dnd/dndDropped"),VEe=()=>{Fe({actionCreator:cq,effect:async(e,{dispatch:t})=>{const n=_e("dnd"),{activeData:r,overData:i}=e.payload;if(r.payloadType==="IMAGE_DTO"?n.debug({activeData:r,overData:i},"Image dropped"):r.payloadType==="IMAGE_DTOS"?n.debug({activeData:r,overData:i},`Images (${r.payload.imageDTOs.length}) dropped`):r.payloadType==="NODE_FIELD"?n.debug({activeData:Xt(r),overData:Xt(i)},"Node field dropped"):n.debug({activeData:r,overData:i},"Unknown payload dropped"),i.actionType==="ADD_FIELD_TO_LINEAR"&&r.payloadType==="NODE_FIELD"){const{nodeId:o,field:a}=r.payload;t(c2e({nodeId:o,fieldName:a.name}))}if(i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(Gs(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(ZS(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROLNET_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{controlNetId:o}=i.context;t(Cc({controlImage:r.payload.imageDTO.image_name,controlNetId:o})),t(sU({controlNetId:o,isEnabled:!0}));return}if(i.actionType==="SET_IP_ADAPTER_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(q2(r.payload.imageDTO.image_name)),t(lU(!0));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(PB(r.payload.imageDTO));return}if(i.actionType==="SET_NODES_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{fieldName:o,nodeId:a}=i.context;t(Z2({nodeId:a,fieldName:o,value:r.payload.imageDTO}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload,{boardId:a}=i.context;t(ve.endpoints.addImageToBoard.initiate({imageDTO:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload;t(ve.endpoints.removeImageFromBoard.initiate({imageDTO:o}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload,{boardId:a}=i.context;t(ve.endpoints.addImagesToBoard.initiate({imageDTOs:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload;t(ve.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},GEe=()=>{Fe({matcher:ve.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=_e("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},qEe=()=>{Fe({matcher:ve.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=_e("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},HEe=()=>{Fe({actionCreator:x0e,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,a=Mxe(n()),s=a.some(l=>l.isCanvasImage)||a.some(l=>l.isInitialImage)||a.some(l=>l.isControlNetImage)||a.some(l=>l.isIPAdapterImage)||a.some(l=>l.isNodesImage);if(o||s){t(Yk(!0));return}t(jA({imageDTOs:r,imagesUsage:a}))}})},WEe=()=>{Fe({matcher:ve.endpoints.uploadImage.matchFulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=_e("images"),i=e.payload,o=n(),{autoAddBoardId:a}=o.gallery;r.debug({imageDTO:i},"Image uploaded");const{postUploadAction:s}=e.meta.arg.originalArgs;if(e.payload.is_intermediate&&!s)return;const l={title:Y("toast.imageUploaded"),status:"success"};if((s==null?void 0:s.type)==="TOAST"){const{toastOptions:u}=s;if(!a||a==="none")t(qt({...l,...u}));else{t(ve.endpoints.addImageToBoard.initiate({board_id:a,imageDTO:i}));const{data:c}=Ft.endpoints.listAllBoards.select()(o),d=c==null?void 0:c.find(h=>h.board_id===a),f=d?`${Y("toast.addedToBoard")} ${d.board_name}`:`${Y("toast.addedToBoard")} ${a}`;t(qt({...l,description:f}))}return}if((s==null?void 0:s.type)==="SET_CANVAS_INITIAL_IMAGE"){t(PB(i)),t(qt({...l,description:Y("toast.setCanvasInitialImage")}));return}if((s==null?void 0:s.type)==="SET_CONTROLNET_IMAGE"){const{controlNetId:u}=s;t(sU({controlNetId:u,isEnabled:!0})),t(Cc({controlNetId:u,controlImage:i.image_name})),t(qt({...l,description:Y("toast.setControlImage")}));return}if((s==null?void 0:s.type)==="SET_IP_ADAPTER_IMAGE"){t(q2(i.image_name)),t(lU(!0)),t(qt({...l,description:Y("toast.setIPAdapterImage")}));return}if((s==null?void 0:s.type)==="SET_INITIAL_IMAGE"){t(ZS(i)),t(qt({...l,description:Y("toast.setInitialImage")}));return}if((s==null?void 0:s.type)==="SET_NODES_IMAGE"){const{nodeId:u,fieldName:c}=s;t(Z2({nodeId:u,fieldName:c,value:i})),t(qt({...l,description:`${Y("toast.setNodeField")} ${c}`}));return}}})},KEe=()=>{Fe({matcher:ve.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=_e("images"),r={arg:{...KS(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(qt({title:Y("toast.imageUploadFailed"),description:e.error.message,status:"error"}))}})},QEe=()=>{Fe({matcher:ve.endpoints.starImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!0}):a.push(s)}),t(pU(a))}})},XEe=()=>{Fe({matcher:ve.endpoints.unstarImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!1}):a.push(s)}),t(pU(a))}})},YEe=Ne("generation/initialImageSelected"),ZEe=Ne("generation/modelSelected"),JEe=()=>{Fe({actionCreator:YEe,effect:(e,{dispatch:t})=>{if(!e.payload){t(qt(Ld({title:Y("toast.imageNotLoadedDesc"),status:"error"})));return}t(ZS(e.payload)),t(qt(Ld(Y("toast.sentToImageToImage"))))}})},eTe=()=>{Fe({actionCreator:ZEe,effect:(e,{getState:t,dispatch:n})=>{var l,u;const r=_e("models"),i=t(),o=cy.safeParse(e.payload);if(!o.success){r.error({error:o.error.format()},"Failed to parse main model");return}const a=o.data,{base_model:s}=a;if(((l=i.generation.model)==null?void 0:l.base_model)!==s){let c=0;Ea(i.lora.loras,(p,m)=>{p.base_model!==s&&(n(mU(m)),c+=1)});const{vae:d}=i.generation;d&&d.base_model!==s&&(n(EB(null)),c+=1);const{controlNets:f}=i.controlNet;Ea(f,(p,m)=>{var _;((_=p.model)==null?void 0:_.base_model)!==s&&(n(aU({controlNetId:m})),c+=1)});const{ipAdapterInfo:h}=i.controlNet;h.model&&h.model.base_model!==s&&(n(uU()),c+=1),c>0&&n(qt(Ld({title:`${Y("toast.baseModelChangedCleared")} ${c} ${Y("toast.incompatibleSubmodel")}${c===1?"":"s"}`,status:"warning"})))}((u=i.generation.model)==null?void 0:u.base_model)!==a.base_model&&i.ui.shouldAutoChangeDimensions&&(["sdxl","sdxl-refiner"].includes(a.base_model)?(n(tI(1024)),n(nI(1024)),n(rI({width:1024,height:1024}))):(n(tI(512)),n(nI(512)),n(rI({width:512,height:512})))),n($u(a))}})},x0=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),zO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),jO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),UO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),iT=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),VO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),GO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),oT=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),tTe=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,fu=e=>{const t=[];return e.forEach(n=>{const r={...Cn(n),id:tTe(n)};t.push(r)}),t},vl=us.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${Qg.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"OnnxModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"OnnxModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return zO.setAll(zO.getInitialState(),n)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${Qg.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"MainModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"MainModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return x0.setAll(x0.getInitialState(),n)}}),updateMainModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/main/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),importMainModels:e.mutation({query:({body:t})=>({url:"models/import",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),addMainModels:e.mutation({query:({body:t})=>({url:"models/add",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),deleteMainModels:e.mutation({query:({base_model:t,model_name:n,model_type:r})=>({url:`models/${t}/${r}/${n}`,method:"DELETE"}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),convertMainModels:e.mutation({query:({base_model:t,model_name:n,convert_dest_directory:r})=>({url:`models/convert/${t}/main/${n}`,method:"PUT",params:{convert_dest_directory:r}}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),mergeMainModels:e.mutation({query:({base_model:t,body:n})=>({url:`models/merge/${t}`,method:"PUT",body:n}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),syncModels:e.mutation({query:()=>({url:"models/sync",method:"POST"}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:t=>{const n=[{type:"LoRAModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"LoRAModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return jO.setAll(jO.getInitialState(),n)}}),updateLoRAModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/lora/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"LoRAModel",id:Mt}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:Mt}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:t=>{const n=[{type:"ControlNetModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"ControlNetModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return UO.setAll(UO.getInitialState(),n)}}),getIPAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"ip_adapter"}}),providesTags:t=>{const n=[{type:"IPAdapterModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"IPAdapterModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return iT.setAll(iT.getInitialState(),n)}}),getT2IAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"t2i_adapter"}}),providesTags:t=>{const n=[{type:"T2IAdapterModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"T2IAdapterModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return VO.setAll(VO.getInitialState(),n)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:t=>{const n=[{type:"VaeModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"VaeModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return oT.setAll(oT.getInitialState(),n)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:t=>{const n=[{type:"TextualInversionModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"TextualInversionModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return GO.setAll(GO.getInitialState(),n)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${Qg.stringify(t,{})}`}),providesTags:t=>{const n=[{type:"ScannedModels",id:Mt}];return t&&n.push(...t.map(r=>({type:"ScannedModels",id:r}))),n}}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:mKe,useGetOnnxModelsQuery:yKe,useGetControlNetModelsQuery:vKe,useGetIPAdapterModelsQuery:bKe,useGetT2IAdapterModelsQuery:_Ke,useGetLoRAModelsQuery:SKe,useGetTextualInversionModelsQuery:xKe,useGetVaeModelsQuery:wKe,useUpdateMainModelsMutation:CKe,useDeleteMainModelsMutation:EKe,useImportMainModelsMutation:TKe,useAddMainModelsMutation:kKe,useConvertMainModelsMutation:AKe,useMergeMainModelsMutation:PKe,useDeleteLoRAModelsMutation:IKe,useUpdateLoRAModelsMutation:RKe,useSyncModelsMutation:OKe,useGetModelsInFolderQuery:MKe,useGetCheckpointConfigsQuery:NKe}=vl,nTe=()=>{Fe({predicate:e=>vl.endpoints.getMainModels.matchFulfilled(e)&&!e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`Main models loaded (${e.payload.ids.length})`);const i=t().generation.model,o=x0.getSelectors().selectAll(e.payload);if(o.length===0){n($u(null));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=cy.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse main model");return}n($u(s.data))}}),Fe({predicate:e=>vl.endpoints.getMainModels.matchFulfilled(e)&&e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`SDXL Refiner models loaded (${e.payload.ids.length})`);const i=t().sdxl.refinerModel,o=x0.getSelectors().selectAll(e.payload);if(o.length===0){n(K9(null)),n(p2e(!1));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=mk.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse SDXL Refiner Model");return}n(K9(s.data))}}),Fe({matcher:vl.endpoints.getVaeModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`VAEs loaded (${e.payload.ids.length})`);const i=t().generation.vae;if(i===null||zf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(i==null?void 0:i.model_name)&&(l==null?void 0:l.base_model)===(i==null?void 0:i.base_model)))return;const a=oT.getSelectors().selectAll(e.payload)[0];if(!a){n($u(null));return}const s=qse.safeParse(a);if(!s.success){r.error({error:s.error.format()},"Failed to parse VAE model");return}n(EB(s.data))}}),Fe({matcher:vl.endpoints.getLoRAModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`LoRAs loaded (${e.payload.ids.length})`);const i=t().lora.loras;Ea(i,(o,a)=>{zf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(o==null?void 0:o.model_name)&&(l==null?void 0:l.base_model)===(o==null?void 0:o.base_model))||n(mU(a))})}}),Fe({matcher:vl.endpoints.getControlNetModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`);const i=t().controlNet.controlNets;Ea(i,(o,a)=>{zf(e.payload.entities,l=>{var u,c;return(l==null?void 0:l.model_name)===((u=o==null?void 0:o.model)==null?void 0:u.model_name)&&(l==null?void 0:l.base_model)===((c=o==null?void 0:o.model)==null?void 0:c.base_model)})||n(aU({controlNetId:a}))})}}),Fe({matcher:vl.endpoints.getIPAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`IP Adapter models loaded (${e.payload.ids.length})`);const{model:i}=t().controlNet.ipAdapterInfo;if(zf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(i==null?void 0:i.model_name)&&(l==null?void 0:l.base_model)===(i==null?void 0:i.base_model)))return;const a=iT.getSelectors().selectAll(e.payload)[0];a||n(qR(null));const s=FB.safeParse(a);if(!s.success){r.error({error:s.error.format()},"Failed to parse IP Adapter model");return}n(qR(s.data))}}),Fe({matcher:vl.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{_e("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},rTe=us.injectEndpoints({endpoints:e=>({dynamicPrompts:e.query({query:t=>({url:"utilities/dynamicprompts",body:t,method:"POST"}),keepUnusedDataFor:86400})})}),iTe=$o(tle,k0e,E0e,T0e,Vk),oTe=()=>{Fe({matcher:iTe,effect:async(e,{dispatch:t,getState:n,cancelActiveListeners:r,delay:i})=>{r(),await i(1e3);const o=n();if(o.config.disabledFeatures.includes("dynamicPrompting"))return;const{positivePrompt:a}=o.generation,{maxPrompts:s}=o.dynamicPrompts;t(MC(!0));try{const l=t(rTe.endpoints.dynamicPrompts.initiate({prompt:a,max_prompts:s})),u=await l.unwrap();l.unsubscribe(),t(A0e(u.prompts)),t(P0e(u.error)),t(HR(!1)),t(MC(!1))}catch{t(HR(!0)),t(MC(!1))}}})},bf=e=>e.$ref.split("/").slice(-1)[0],aTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"integer",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},sTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"IntegerPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},lTe=({schemaObject:e,baseField:t})=>{const n=rB(e.item_default)&&Moe(e.item_default)?e.item_default:0;return{...t,type:"IntegerCollection",default:e.default??[],item_default:n}},uTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"float",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},cTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"FloatPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},dTe=({schemaObject:e,baseField:t})=>{const n=rB(e.item_default)?e.item_default:0;return{...t,type:"FloatCollection",default:e.default??[],item_default:n}},fTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"string",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},hTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"StringPolymorphic",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},pTe=({schemaObject:e,baseField:t})=>{const n=hk(e.item_default)?e.item_default:"";return{...t,type:"StringCollection",default:e.default??[],item_default:n}},gTe=({schemaObject:e,baseField:t})=>({...t,type:"boolean",default:e.default??!1}),mTe=({schemaObject:e,baseField:t})=>({...t,type:"BooleanPolymorphic",default:e.default??!1}),yTe=({schemaObject:e,baseField:t})=>{const n=e.item_default&&Ooe(e.item_default)?e.item_default:!1;return{...t,type:"BooleanCollection",default:e.default??[],item_default:n}},vTe=({schemaObject:e,baseField:t})=>({...t,type:"MainModelField",default:e.default??void 0}),bTe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLMainModelField",default:e.default??void 0}),_Te=({schemaObject:e,baseField:t})=>({...t,type:"SDXLRefinerModelField",default:e.default??void 0}),STe=({schemaObject:e,baseField:t})=>({...t,type:"VaeModelField",default:e.default??void 0}),xTe=({schemaObject:e,baseField:t})=>({...t,type:"LoRAModelField",default:e.default??void 0}),wTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlNetModelField",default:e.default??void 0}),CTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterModelField",default:e.default??void 0}),ETe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterModelField",default:e.default??void 0}),TTe=({schemaObject:e,baseField:t})=>({...t,type:"BoardField",default:e.default??void 0}),kTe=({schemaObject:e,baseField:t})=>({...t,type:"ImageField",default:e.default??void 0}),ATe=({schemaObject:e,baseField:t})=>({...t,type:"ImagePolymorphic",default:e.default??void 0}),PTe=({schemaObject:e,baseField:t})=>({...t,type:"ImageCollection",default:e.default??[],item_default:e.item_default??void 0}),ITe=({schemaObject:e,baseField:t})=>({...t,type:"DenoiseMaskField",default:e.default??void 0}),RTe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsField",default:e.default??void 0}),OTe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsPolymorphic",default:e.default??void 0}),MTe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsCollection",default:e.default??[],item_default:e.item_default??void 0}),NTe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningField",default:e.default??void 0}),$Te=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningPolymorphic",default:e.default??void 0}),DTe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningCollection",default:e.default??[],item_default:e.item_default??void 0}),LTe=({schemaObject:e,baseField:t})=>({...t,type:"UNetField",default:e.default??void 0}),FTe=({schemaObject:e,baseField:t})=>({...t,type:"ClipField",default:e.default??void 0}),BTe=({schemaObject:e,baseField:t})=>({...t,type:"VaeField",default:e.default??void 0}),zTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlField",default:e.default??void 0}),jTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlPolymorphic",default:e.default??void 0}),UTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlCollection",default:e.default??[],item_default:e.item_default??void 0}),VTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterField",default:e.default??void 0}),GTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterPolymorphic",default:e.default??void 0}),qTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),HTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterField",default:e.default??void 0}),WTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterPolymorphic",default:e.default??void 0}),KTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),QTe=({schemaObject:e,baseField:t})=>{const n=e.enum??[];return{...t,type:"enum",options:n,ui_choice_labels:e.ui_choice_labels,default:e.default??n[0]}},XTe=({baseField:e})=>({...e,type:"Collection",default:[]}),YTe=({baseField:e})=>({...e,type:"CollectionItem",default:void 0}),ZTe=({schemaObject:e,baseField:t})=>({...t,type:"ColorField",default:e.default??{r:127,g:127,b:127,a:255}}),JTe=({schemaObject:e,baseField:t})=>({...t,type:"ColorPolymorphic",default:e.default??{r:127,g:127,b:127,a:255}}),e4e=({schemaObject:e,baseField:t})=>({...t,type:"ColorCollection",default:e.default??[]}),t4e=({schemaObject:e,baseField:t})=>({...t,type:"Scheduler",default:e.default??"euler"}),qO=e=>{if(e!=null&&e.ui_type)return e.ui_type;if(e.type){if(e.enum)return"enum";if(e.type){if(e.type==="number")return"float";if(e.type==="array"){const t=rce(e.items)?e.items.type:bf(e.items);return fSe(t)?mA[t]:void 0}else return e.type}}else if(e.allOf){const t=e.allOf;if(t&&t[0]&&Hp(t[0]))return bf(t[0])}else if(e.anyOf){const t=e.anyOf;let n,r;if(pI(t[0])){const i=t[0].items,o=t[1];Hp(i)&&Hp(o)?(n=bf(i),r=bf(o)):yv(i)&&yv(o)&&(n=i.type,r=o.type)}else if(pI(t[1])){const i=t[0],o=t[1].items;Hp(i)&&Hp(o)?(n=bf(i),r=bf(o)):yv(i)&&yv(o)&&(n=i.type,r=o.type)}if(n===r&&pSe(n))return FV[n]}},dq={BoardField:TTe,boolean:gTe,BooleanCollection:yTe,BooleanPolymorphic:mTe,ClipField:FTe,Collection:XTe,CollectionItem:YTe,ColorCollection:e4e,ColorField:ZTe,ColorPolymorphic:JTe,ConditioningCollection:DTe,ConditioningField:NTe,ConditioningPolymorphic:$Te,ControlCollection:UTe,ControlField:zTe,ControlNetModelField:wTe,ControlPolymorphic:jTe,DenoiseMaskField:ITe,enum:QTe,float:uTe,FloatCollection:dTe,FloatPolymorphic:cTe,ImageCollection:PTe,ImageField:kTe,ImagePolymorphic:ATe,integer:aTe,IntegerCollection:lTe,IntegerPolymorphic:sTe,IPAdapterCollection:qTe,IPAdapterField:VTe,IPAdapterModelField:CTe,IPAdapterPolymorphic:GTe,LatentsCollection:MTe,LatentsField:RTe,LatentsPolymorphic:OTe,LoRAModelField:xTe,MainModelField:vTe,Scheduler:t4e,SDXLMainModelField:bTe,SDXLRefinerModelField:_Te,string:fTe,StringCollection:pTe,StringPolymorphic:hTe,T2IAdapterCollection:KTe,T2IAdapterField:HTe,T2IAdapterModelField:ETe,T2IAdapterPolymorphic:WTe,UNetField:LTe,VaeField:BTe,VaeModelField:STe},n4e=e=>!!(e&&e in dq),r4e=(e,t,n,r)=>{var f;const{input:i,ui_hidden:o,ui_component:a,ui_type:s,ui_order:l}=t,u={input:Cg.includes(r)?"connection":i,ui_hidden:o,ui_component:a,ui_type:s,required:((f=e.required)==null?void 0:f.includes(n))??!1,ui_order:l},c={name:n,title:t.title??"",description:t.description??"",fieldKind:"input",...u};if(!n4e(r))return;const d=dq[r];if(d)return d({schemaObject:t,baseField:c})},i4e=["id","type","metadata","use_cache"],o4e=["type"],a4e=["WorkflowField","MetadataField","IsIntermediate"],s4e=["graph","metadata_accumulator"],l4e=(e,t)=>!!(i4e.includes(t)||e==="collect"&&t==="collection"||e==="iterate"&&t==="index"),u4e=e=>!!a4e.includes(e),c4e=(e,t)=>!o4e.includes(t),d4e=e=>!s4e.includes(e.properties.type.default),f4e=(e,t=void 0,n=void 0)=>{var o;return Object.values(((o=e.components)==null?void 0:o.schemas)??{}).filter(ice).filter(d4e).filter(a=>t?t.includes(a.properties.type.default):!0).filter(a=>n?!n.includes(a.properties.type.default):!0).reduce((a,s)=>{var v,S;const l=s.properties.type.default,u=s.title.replace("Invocation",""),c=s.tags??[],d=s.description??"",f=s.version,h=eE(s.properties,(w,x,C)=>{if(l4e(l,C))return _e("nodes").trace({node:l,fieldName:C,field:Xt(x)},"Skipped reserved input field"),w;if(!gI(x))return _e("nodes").warn({node:l,propertyName:C,property:Xt(x)},"Unhandled input property"),w;const k=qO(x);if(!hI(k))return _e("nodes").warn({node:l,fieldName:C,fieldType:k,field:Xt(x)},"Skipping unknown input field type"),w;if(u4e(k))return _e("nodes").trace({node:l,fieldName:C,fieldType:k,field:Xt(x)},"Skipping reserved field type"),w;const T=r4e(s,x,C,k);return T?(w[C]=T,w):(_e("nodes").debug({node:l,fieldName:C,fieldType:k,field:Xt(x)},"Skipping input field with no template"),w)},{}),p=s.output.$ref.split("/").pop();if(!p)return _e("nodes").warn({outputRefObject:Xt(s.output)},"No output schema name found in ref object"),a;const m=(S=(v=e.components)==null?void 0:v.schemas)==null?void 0:S[p];if(!m)return _e("nodes").warn({outputSchemaName:p},"Output schema not found"),a;if(!oce(m))return _e("nodes").error({outputSchema:Xt(m)},"Invalid output schema"),a;const _=m.properties.type.default,b=eE(m.properties,(w,x,C)=>{if(!c4e(l,C))return _e("nodes").trace({type:l,propertyName:C,property:Xt(x)},"Skipped reserved output field"),w;if(!gI(x))return _e("nodes").warn({type:l,propertyName:C,property:Xt(x)},"Unhandled output property"),w;const k=qO(x);return hI(k)?(w[C]={fieldKind:"output",name:C,title:x.title??"",description:x.description??"",type:k,ui_hidden:x.ui_hidden??!1,ui_type:x.ui_type,ui_order:x.ui_order},w):(_e("nodes").warn({fieldName:C,fieldType:k,field:Xt(x)},"Skipping unknown output field type"),w)},{}),y=s.properties.use_cache.default,g={title:u,type:l,version:f,tags:c,description:d,outputType:_,inputs:h,outputs:b,useCache:y};return Object.assign(a,{[l]:g}),a},{})},h4e=()=>{Fe({actionCreator:y0.fulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=_e("system"),i=e.payload;r.debug({schemaJSON:i},"Received OpenAPI schema");const{nodesAllowlist:o,nodesDenylist:a}=n().config,s=f4e(i,o,a);r.debug({nodeTemplates:Xt(s)},`Built ${QS(s)} node templates`),t(KV(s))}}),Fe({actionCreator:y0.rejected,effect:e=>{_e("system").error({error:Xt(e.error)},"Problem retrieving OpenAPI Schema")}})},p4e=()=>{Fe({actionCreator:jj,effect:(e,{dispatch:t,getState:n})=>{_e("socketio").debug("Connected");const{nodes:i,config:o,system:a}=n(),{disabledTabs:s}=o;!QS(i.nodeTemplates)&&!s.includes("nodes")&&t(y0()),a.isInitialized?t(us.util.resetApiState()):t(b2e(!0)),t(Vk(e.payload))}})},g4e=()=>{Fe({actionCreator:Uj,effect:(e,{dispatch:t})=>{_e("socketio").debug("Disconnected"),t(Vj(e.payload))}})},m4e=()=>{Fe({actionCreator:Kj,effect:(e,{dispatch:t})=>{_e("socketio").trace(e.payload,"Generator progress"),t(Wk(e.payload))}})},y4e=()=>{Fe({actionCreator:Hj,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Session complete"),t(Wj(e.payload))}})},v4e=["load_image","image"],b4e=()=>{Fe({actionCreator:qk,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("socketio"),{data:i}=e.payload;r.debug({data:Xt(i)},`Invocation complete (${e.payload.data.node.type})`);const{result:o,node:a,queue_batch_id:s}=i;if(nq(o)&&!v4e.includes(a.type)){const{image_name:l}=o.image,{canvas:u,gallery:c}=n(),d=await t(ve.endpoints.getImageDTO.initiate(l)).unwrap();if(u.batchIds.includes(s)&&[me].includes(i.source_node_id)&&t(lle(d)),!d.is_intermediate){t(ve.util.updateQueryData("listImages",{board_id:d.board_id??"none",categories:oi},h=>{Gn.addOne(h,d)})),t(Ft.util.updateQueryData("getBoardImagesTotal",d.board_id??"none",h=>{h.total+=1})),t(ve.util.invalidateTags([{type:"Board",id:d.board_id??"none"}]));const{shouldAutoSwitch:f}=c;f&&(c.galleryView!=="images"&&t(CE("images")),d.board_id&&d.board_id!==c.selectedBoardId&&t(E_({boardId:d.board_id,selectedImageName:d.image_name})),!d.board_id&&c.selectedBoardId!=="none"&&t(E_({boardId:"none",selectedImageName:d.image_name})),t(Gs(d)))}}t(Hk(e.payload))}})},_4e=()=>{Fe({actionCreator:qj,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(G2(e.payload))}})},S4e=()=>{Fe({actionCreator:tU,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(nU(e.payload))}})},x4e=()=>{Fe({actionCreator:Gj,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(Gk(e.payload))}})},w4e=()=>{Fe({actionCreator:Qj,effect:(e,{dispatch:t})=>{const n=_e("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load started: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(Xj(e.payload))}}),Fe({actionCreator:Yj,effect:(e,{dispatch:t})=>{const n=_e("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load complete: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(Zj(e.payload))}})},C4e=()=>{Fe({actionCreator:rU,effect:async(e,{dispatch:t})=>{const n=_e("socketio"),{queue_item_id:r,queue_batch_id:i,status:o}=e.payload.data;n.debug(e.payload,`Queue item ${r} status updated: ${o}`),t(Kk(e.payload)),t(Xr.util.updateQueryData("listQueueItems",void 0,s=>{Kc.updateOne(s,{id:r,changes:e.payload.data})})),t(Xr.util.invalidateTags(["CurrentSessionQueueItem","NextSessionQueueItem","InvocationCacheStatus",{type:"SessionQueueItem",id:r},{type:"SessionQueueItemDTO",id:r},{type:"BatchStatus",id:i}]));const a=t(Xr.endpoints.getQueueStatus.initiate(void 0,{forceRefetch:!0}));await a.unwrap(),a.unsubscribe()}})},E4e=()=>{Fe({actionCreator:Jj,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(eU(e.payload))}})},T4e=()=>{Fe({actionCreator:f0e,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Subscribed"),t(h0e(e.payload))}})},k4e=()=>{Fe({actionCreator:p0e,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Unsubscribed"),t(g0e(e.payload))}})},A4e=()=>{Fe({actionCreator:jxe,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTO:r}=e.payload;try{const i=await t(ve.endpoints.changeImageIsIntermediate.initiate({imageDTO:r,is_intermediate:!1})).unwrap(),{autoAddBoardId:o}=n().gallery;o&&o!=="none"&&await t(ve.endpoints.addImageToBoard.initiate({imageDTO:i,board_id:o})),t(qt({title:Y("toast.imageSaved"),status:"success"}))}catch(i){t(qt({title:Y("toast.imageSavingFailed"),description:i==null?void 0:i.message,status:"error"}))}}})},$Ke=["sd-1","sd-2","sdxl","sdxl-refiner"],P4e=["sd-1","sd-2","sdxl"],DKe=["sdxl"],LKe=["sd-1","sd-2"],FKe=["sdxl-refiner"],I4e=()=>{Fe({actionCreator:sG,effect:async(e,{getState:t,dispatch:n})=>{var i;if(e.payload==="unifiedCanvas"){const o=(i=t().generation.model)==null?void 0:i.base_model;if(o&&["sd-1","sd-2","sdxl"].includes(o))return;try{const a=n(vl.endpoints.getMainModels.initiate(P4e)),s=await a.unwrap();if(a.unsubscribe(),!s.ids.length){n($u(null));return}const u=x0.getSelectors().selectAll(s).filter(h=>["sd-1","sd-2","sxdl"].includes(h.base_model))[0];if(!u){n($u(null));return}const{base_model:c,model_name:d,model_type:f}=u;n($u({base_model:c,model_name:d,model_type:f}))}catch{n($u(null))}}}})},R4e=({image_name:e,esrganModelName:t,autoAddBoardId:n})=>{const r={id:i5,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!0},i={id:Ja,type:"save_image",use_cache:!1,is_intermediate:!1,board:n==="none"?void 0:{board_id:n}};return{id:"adhoc-esrgan-graph",nodes:{[i5]:r,[Ja]:i},edges:[{source:{node_id:i5,field:"image"},destination:{node_id:Ja,field:"image"}}]}},O4e=()=>Rj(),fq=wj;function M4e(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const HO={};function aT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&HO[t[0]]||(typeof t[0]=="string"&&(HO[t[0]]=new Date),M4e(...t))}const hq=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function WO(e,t,n){e.loadNamespaces(t,hq(e,n))}function KO(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,hq(e,r))}function N4e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=t.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function $4e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(aT("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}):N4e(e,t,n)}const D4e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,L4e={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},F4e=e=>L4e[e],B4e=e=>e.replace(D4e,F4e);let sT={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:B4e};function z4e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sT={...sT,...e}}function j4e(){return sT}let pq;function U4e(e){pq=e}function V4e(){return pq}const G4e={type:"3rdParty",init(e){z4e(e.options.react),U4e(e)}},q4e=I.createContext();class H4e{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const W4e=(e,t)=>{const n=I.useRef();return I.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current};function K4e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=I.useContext(q4e)||{},o=n||r||V4e();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new H4e),!o){aT("You will need to pass in an i18next instance by using initReactI18next");const g=(S,w)=>typeof w=="string"?w:w&&typeof w=="object"&&typeof w.defaultValue=="string"?w.defaultValue:Array.isArray(S)?S[S.length-1]:S,v=[g,{},!1];return v.t=g,v.i18n={},v.ready=!1,v}o.options.react&&o.options.react.wait!==void 0&&aT("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...j4e(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let u=e||i||o.options&&o.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(g=>$4e(g,o,a));function d(){return o.getFixedT(t.lng||null,a.nsMode==="fallback"?u:u[0],l)}const[f,h]=I.useState(d);let p=u.join();t.lng&&(p=`${t.lng}${p}`);const m=W4e(p),_=I.useRef(!0);I.useEffect(()=>{const{bindI18n:g,bindI18nStore:v}=a;_.current=!0,!c&&!s&&(t.lng?KO(o,t.lng,u,()=>{_.current&&h(d)}):WO(o,u,()=>{_.current&&h(d)})),c&&m&&m!==p&&_.current&&h(d);function S(){_.current&&h(d)}return g&&o&&o.on(g,S),v&&o&&o.store.on(v,S),()=>{_.current=!1,g&&o&&g.split(" ").forEach(w=>o.off(w,S)),v&&o&&v.split(" ").forEach(w=>o.store.off(w,S))}},[o,p]);const b=I.useRef(!0);I.useEffect(()=>{_.current&&!b.current&&h(d),b.current=!1},[o,l]);const y=[f,o,c];if(y.t=f,y.i18n=o,y.ready=c,c||!c&&!s)return y;throw new Promise(g=>{t.lng?KO(o,t.lng,u,()=>g()):WO(o,u,()=>g())})}const Q4e=(e,t)=>{if(!e||!t)return;const{width:n,height:r}=e,i=r*4*n*4,o=r*2*n*2;return{x4:i,x2:o}},X4e=(e,t)=>{if(!e||!t)return{x4:!0,x2:!0};const n={x4:!1,x2:!1};return e.x4<=t&&(n.x4=!0),e.x2<=t&&(n.x2=!0),n},Y4e=(e,t)=>{if(!(!e||!t)&&!(e.x4&&e.x2)){if(!e.x2&&!e.x4)return"parameters.isAllowedToUpscale.tooLarge";if(!e.x4&&e.x2&&t===4)return"parameters.isAllowedToUpscale.useX2Model"}},gq=e=>Ii(iK,({postprocessing:t,config:n})=>{const{esrganModelName:r}=t,{maxUpscalePixels:i}=n,o=Q4e(e,i),a=X4e(o,i),s=r.includes("x2")?2:4,l=Y4e(a,s);return{isAllowedToUpscale:s===2?a.x2:a.x4,detailTKey:l}},ex),BKe=e=>{const{t}=K4e(),n=I.useMemo(()=>gq(e),[e]),{isAllowedToUpscale:r,detailTKey:i}=fq(n);return{isAllowedToUpscale:r,detail:i?t(i):void 0}},Z4e=Ne("upscale/upscaleRequested"),J4e=()=>{Fe({actionCreator:Z4e,effect:async(e,{dispatch:t,getState:n})=>{var f;const r=_e("session"),{imageDTO:i}=e.payload,{image_name:o}=i,a=n(),{isAllowedToUpscale:s,detailTKey:l}=gq(i)(a);if(!s){r.error({imageDTO:i},Y(l??"parameters.isAllowedToUpscale.tooLarge")),t(qt({title:Y(l??"parameters.isAllowedToUpscale.tooLarge"),status:"error"}));return}const{esrganModelName:u}=a.postprocessing,{autoAddBoardId:c}=a.gallery,d=R4e({image_name:o,esrganModelName:u,autoAddBoardId:c});try{const h=t(Xr.endpoints.enqueueGraph.initiate({graph:d,prepend:!0},{fixedCacheKey:"enqueueGraph"})),p=await h.unwrap();h.reset(),r.debug({enqueueResult:Xt(p)},Y("queue.graphQueued"))}catch(h){if(r.error({graph:Xt(d)},Y("queue.graphFailedToQueue")),h instanceof Object&&"data"in h&&"status"in h&&h.status===403){const p=((f=h.data)==null?void 0:f.detail)||"Unknown Error";t(qt({title:Y("queue.graphFailedToQueue"),status:"error",description:p,duration:15e3}));return}t(qt({title:Y("queue.graphFailedToQueue"),status:"error"}))}}})},eke=nl(null),tke=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,QO=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(tke);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},XO=e=>e==="*"||e==="x"||e==="X",YO=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},nke=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],rke=(e,t)=>{if(XO(e)||XO(t))return 0;const[n,r]=nke(YO(e),YO(t));return n>r?1:n<r?-1:0},ZO=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=rke(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0},ike=(e,t)=>{const n=QO(e),r=QO(t),i=n.pop(),o=r.pop(),a=ZO(n,r);return a!==0?a:i&&o?ZO(i.split("."),o.split(".")):i||o?i?-1:1:0},oke=(e,t)=>{const n=Cn(e),{nodes:r,edges:i}=n,o=[],a=r.filter(aE),s=gk(a,"id");return r.forEach(l=>{if(!aE(l))return;const u=t[l.data.type];if(!u){o.push({message:`${be.t("nodes.node")} "${l.data.type}" ${be.t("nodes.skipped")}`,issues:[`${be.t("nodes.nodeType")}"${l.data.type}" ${be.t("nodes.doesNotExist")}`],data:l});return}if(u.version&&l.data.version&&ike(u.version,l.data.version)!==0){o.push({message:`${be.t("nodes.node")} "${l.data.type}" ${be.t("nodes.mismatchedVersion")}`,issues:[`${be.t("nodes.node")} "${l.data.type}" v${l.data.version} ${be.t("nodes.maybeIncompatible")} v${u.version}`],data:{node:l,nodeTemplate:Xt(u)}});return}}),i.forEach((l,u)=>{const c=s[l.source],d=s[l.target],f=[];if(c?l.type==="default"&&!(l.sourceHandle in c.data.outputs)&&f.push(`${be.t("nodes.outputNode")} "${l.source}.${l.sourceHandle}" ${be.t("nodes.doesNotExist")}`):f.push(`${be.t("nodes.outputNode")} ${l.source} ${be.t("nodes.doesNotExist")}`),d?l.type==="default"&&!(l.targetHandle in d.data.inputs)&&f.push(`${be.t("nodes.inputField")} "${l.target}.${l.targetHandle}" ${be.t("nodes.doesNotExist")}`):f.push(`${be.t("nodes.inputNode")} ${l.target} ${be.t("nodes.doesNotExist")}`),t[(c==null?void 0:c.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${be.t("nodes.sourceNode")} "${l.source}" ${be.t("nodes.missingTemplate")} "${c==null?void 0:c.data.type}"`),t[(d==null?void 0:d.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${be.t("nodes.sourceNode")}"${l.target}" ${be.t("nodes.missingTemplate")} "${d==null?void 0:d.data.type}"`),f.length){delete i[u];const h=l.type==="default"?l.sourceHandle:l.source,p=l.type==="default"?l.targetHandle:l.target;o.push({message:`Edge "${h} -> ${p}" skipped`,issues:f,data:l})}}),{workflow:n,errors:o}},ake=()=>{Fe({actionCreator:_xe,effect:(e,{dispatch:t,getState:n})=>{const r=_e("nodes"),i=e.payload,o=n().nodes.nodeTemplates,{workflow:a,errors:s}=oke(i,o);t(d2e(a)),s.length?(t(qt(Ld({title:Y("toast.loadedWithWarnings"),status:"warning"}))),s.forEach(({message:l,...u})=>{r.warn(u,l)})):t(qt(Ld({title:Y("toast.workflowLoaded"),status:"success"}))),t(sG("nodes")),requestAnimationFrame(()=>{var l;(l=eke.get())==null||l.fitView()})}})};function ske(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function lke(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var uke=function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(lke(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=ske(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Bi="-ms-",V_="-moz-",ln="-webkit-",mq="comm",UA="rule",VA="decl",cke="@import",yq="@keyframes",dke="@layer",fke=Math.abs,Jx=String.fromCharCode,hke=Object.assign;function pke(e,t){return ki(e,0)^45?(((t<<2^ki(e,0))<<2^ki(e,1))<<2^ki(e,2))<<2^ki(e,3):0}function vq(e){return e.trim()}function gke(e,t){return(e=t.exec(e))?e[0]:e}function un(e,t,n){return e.replace(t,n)}function lT(e,t){return e.indexOf(t)}function ki(e,t){return e.charCodeAt(t)|0}function w0(e,t,n){return e.slice(t,n)}function As(e){return e.length}function GA(e){return e.length}function Kv(e,t){return t.push(e),e}function mke(e,t){return e.map(t).join("")}var ew=1,ap=1,bq=0,Mo=0,Dr=0,Ip="";function tw(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:ew,column:ap,length:a,return:""}}function og(e,t){return hke(tw("",null,null,"",null,null,0),e,{length:-e.length},t)}function yke(){return Dr}function vke(){return Dr=Mo>0?ki(Ip,--Mo):0,ap--,Dr===10&&(ap=1,ew--),Dr}function Qo(){return Dr=Mo<bq?ki(Ip,Mo++):0,ap++,Dr===10&&(ap=1,ew++),Dr}function Hs(){return ki(Ip,Mo)}function H1(){return Mo}function Py(e,t){return w0(Ip,e,t)}function C0(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _q(e){return ew=ap=1,bq=As(Ip=e),Mo=0,[]}function Sq(e){return Ip="",e}function W1(e){return vq(Py(Mo-1,uT(e===91?e+2:e===40?e+1:e)))}function bke(e){for(;(Dr=Hs())&&Dr<33;)Qo();return C0(e)>2||C0(Dr)>3?"":" "}function _ke(e,t){for(;--t&&Qo()&&!(Dr<48||Dr>102||Dr>57&&Dr<65||Dr>70&&Dr<97););return Py(e,H1()+(t<6&&Hs()==32&&Qo()==32))}function uT(e){for(;Qo();)switch(Dr){case e:return Mo;case 34:case 39:e!==34&&e!==39&&uT(Dr);break;case 40:e===41&&uT(e);break;case 92:Qo();break}return Mo}function Ske(e,t){for(;Qo()&&e+Dr!==47+10;)if(e+Dr===42+42&&Hs()===47)break;return"/*"+Py(t,Mo-1)+"*"+Jx(e===47?e:Qo())}function xke(e){for(;!C0(Hs());)Qo();return Py(e,Mo)}function wke(e){return Sq(K1("",null,null,null,[""],e=_q(e),0,[0],e))}function K1(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,d=a,f=0,h=0,p=0,m=1,_=1,b=1,y=0,g="",v=i,S=o,w=r,x=g;_;)switch(p=y,y=Qo()){case 40:if(p!=108&&ki(x,d-1)==58){lT(x+=un(W1(y),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=W1(y);break;case 9:case 10:case 13:case 32:x+=bke(p);break;case 92:x+=_ke(H1()-1,7);continue;case 47:switch(Hs()){case 42:case 47:Kv(Cke(Ske(Qo(),H1()),t,n),l);break;default:x+="/"}break;case 123*m:s[u++]=As(x)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+c:b==-1&&(x=un(x,/\f/g,"")),h>0&&As(x)-d&&Kv(h>32?eM(x+";",r,n,d-1):eM(un(x," ","")+";",r,n,d-2),l);break;case 59:x+=";";default:if(Kv(w=JO(x,t,n,u,c,i,s,g,v=[],S=[],d),o),y===123)if(c===0)K1(x,t,w,w,v,o,d,s,S);else switch(f===99&&ki(x,3)===110?100:f){case 100:case 108:case 109:case 115:K1(e,w,w,r&&Kv(JO(e,w,w,0,0,i,s,g,i,v=[],d),S),i,S,d,s,r?v:S);break;default:K1(x,w,w,w,[""],S,0,s,S)}}u=c=h=0,m=b=1,g=x="",d=a;break;case 58:d=1+As(x),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&vke()==125)continue}switch(x+=Jx(y),y*m){case 38:b=c>0?1:(x+="\f",-1);break;case 44:s[u++]=(As(x)-1)*b,b=1;break;case 64:Hs()===45&&(x+=W1(Qo())),f=Hs(),c=d=As(g=x+=xke(H1())),y++;break;case 45:p===45&&As(x)==2&&(m=0)}}return o}function JO(e,t,n,r,i,o,a,s,l,u,c){for(var d=i-1,f=i===0?o:[""],h=GA(f),p=0,m=0,_=0;p<r;++p)for(var b=0,y=w0(e,d+1,d=fke(m=a[p])),g=e;b<h;++b)(g=vq(m>0?f[b]+" "+y:un(y,/&\f/g,f[b])))&&(l[_++]=g);return tw(e,t,n,i===0?UA:s,l,u,c)}function Cke(e,t,n){return tw(e,t,n,mq,Jx(yke()),w0(e,2,-2),0)}function eM(e,t,n,r){return tw(e,t,n,VA,w0(e,0,r),w0(e,r+1,-1),r)}function Sh(e,t){for(var n="",r=GA(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Eke(e,t,n,r){switch(e.type){case dke:if(e.children.length)break;case cke:case VA:return e.return=e.return||e.value;case mq:return"";case yq:return e.return=e.value+"{"+Sh(e.children,r)+"}";case UA:e.value=e.props.join(",")}return As(n=Sh(e.children,r))?e.return=e.value+"{"+n+"}":""}function Tke(e){var t=GA(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function kke(e){return function(t){t.root||(t=t.return)&&e(t)}}var tM=function(t){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var i=t(r);return n.set(r,i),i}};function xq(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Ake=function(t,n,r){for(var i=0,o=0;i=o,o=Hs(),i===38&&o===12&&(n[r]=1),!C0(o);)Qo();return Py(t,Mo)},Pke=function(t,n){var r=-1,i=44;do switch(C0(i)){case 0:i===38&&Hs()===12&&(n[r]=1),t[r]+=Ake(Mo-1,n,r);break;case 2:t[r]+=W1(i);break;case 4:if(i===44){t[++r]=Hs()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Jx(i)}while(i=Qo());return t},Ike=function(t,n){return Sq(Pke(_q(t),n))},nM=new WeakMap,Rke=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!nM.get(r))&&!i){nM.set(t,!0);for(var o=[],a=Ike(n,o),s=r.props,l=0,u=0;l<a.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=o[l]?a[l].replace(/&\f/g,s[c]):s[c]+" "+a[l]}}},Oke=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function wq(e,t){switch(pke(e,t)){case 5103:return ln+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ln+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ln+e+V_+e+Bi+e+e;case 6828:case 4268:return ln+e+Bi+e+e;case 6165:return ln+e+Bi+"flex-"+e+e;case 5187:return ln+e+un(e,/(\w+).+(:[^]+)/,ln+"box-$1$2"+Bi+"flex-$1$2")+e;case 5443:return ln+e+Bi+"flex-item-"+un(e,/flex-|-self/,"")+e;case 4675:return ln+e+Bi+"flex-line-pack"+un(e,/align-content|flex-|-self/,"")+e;case 5548:return ln+e+Bi+un(e,"shrink","negative")+e;case 5292:return ln+e+Bi+un(e,"basis","preferred-size")+e;case 6060:return ln+"box-"+un(e,"-grow","")+ln+e+Bi+un(e,"grow","positive")+e;case 4554:return ln+un(e,/([^-])(transform)/g,"$1"+ln+"$2")+e;case 6187:return un(un(un(e,/(zoom-|grab)/,ln+"$1"),/(image-set)/,ln+"$1"),e,"")+e;case 5495:case 3959:return un(e,/(image-set\([^]*)/,ln+"$1$`$1");case 4968:return un(un(e,/(.+:)(flex-)?(.*)/,ln+"box-pack:$3"+Bi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ln+e+e;case 4095:case 3583:case 4068:case 2532:return un(e,/(.+)-inline(.+)/,ln+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(As(e)-1-t>6)switch(ki(e,t+1)){case 109:if(ki(e,t+4)!==45)break;case 102:return un(e,/(.+:)(.+)-([^]+)/,"$1"+ln+"$2-$3$1"+V_+(ki(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~lT(e,"stretch")?wq(un(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ki(e,t+1)!==115)break;case 6444:switch(ki(e,As(e)-3-(~lT(e,"!important")&&10))){case 107:return un(e,":",":"+ln)+e;case 101:return un(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ln+(ki(e,14)===45?"inline-":"")+"box$3$1"+ln+"$2$3$1"+Bi+"$2box$3")+e}break;case 5936:switch(ki(e,t+11)){case 114:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ln+e+Bi+e+e}return e}var Mke=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case VA:t.return=wq(t.value,t.length);break;case yq:return Sh([og(t,{value:un(t.value,"@","@"+ln)})],i);case UA:if(t.length)return mke(t.props,function(o){switch(gke(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Sh([og(t,{props:[un(o,/:(read-\w+)/,":"+V_+"$1")]})],i);case"::placeholder":return Sh([og(t,{props:[un(o,/:(plac\w+)/,":"+ln+"input-$1")]}),og(t,{props:[un(o,/:(plac\w+)/,":"+V_+"$1")]}),og(t,{props:[un(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},Nke=[Mke],$ke=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||Nke,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),b=1;b<_.length;b++)o[_[b]]=!0;s.push(m)});var l,u=[Rke,Oke];{var c,d=[Eke,kke(function(m){c.insert(m)})],f=Tke(u.concat(i,d)),h=function(_){return Sh(wke(_),f)};l=function(_,b,y,g){c=y,h(_?_+"{"+b.styles+"}":b.styles),g&&(p.inserted[b.name]=!0)}}var p={key:n,sheet:new uke({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(s),p},Dke=!0;function Lke(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Cq=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||Dke===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Eq=function(t,n,r){Cq(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function Fke(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Bke={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},zke=/[A-Z]|^ms/g,jke=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Tq=function(t){return t.charCodeAt(1)===45},rM=function(t){return t!=null&&typeof t!="boolean"},a5=xq(function(e){return Tq(e)?e:e.replace(zke,"-$&").toLowerCase()}),iM=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(jke,function(r,i,o){return Ps={name:i,styles:o,next:Ps},i})}return Bke[t]!==1&&!Tq(t)&&typeof n=="number"&&n!==0?n+"px":n};function E0(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Ps={name:n.name,styles:n.styles,next:Ps},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Ps={name:r.name,styles:r.styles,next:Ps},r=r.next;var i=n.styles+";";return i}return Uke(e,t,n)}case"function":{if(e!==void 0){var o=Ps,a=n(e);return Ps=o,E0(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function Uke(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=E0(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object")t!=null&&t[a]!==void 0?r+=o+"{"+t[a]+"}":rM(a)&&(r+=a5(o)+":"+iM(o,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var s=0;s<a.length;s++)rM(a[s])&&(r+=a5(o)+":"+iM(o,a[s])+";");else{var l=E0(e,t,a);switch(o){case"animation":case"animationName":{r+=a5(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var oM=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Ps,qA=function(t,n,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,o="";Ps=void 0;var a=t[0];a==null||a.raw===void 0?(i=!1,o+=E0(r,n,a)):o+=a[0];for(var s=1;s<t.length;s++)o+=E0(r,n,t[s]),i&&(o+=a[s]);oM.lastIndex=0;for(var l="",u;(u=oM.exec(o))!==null;)l+="-"+u[1];var c=Fke(o)+l;return{name:c,styles:o,next:Ps}},Vke=function(t){return t()},kq=GP["useInsertionEffect"]?GP["useInsertionEffect"]:!1,Gke=kq||Vke,aM=kq||I.useLayoutEffect,Aq=I.createContext(typeof HTMLElement<"u"?$ke({key:"css"}):null);Aq.Provider;var Pq=function(t){return I.forwardRef(function(n,r){var i=I.useContext(Aq);return t(n,i,r)})},T0=I.createContext({}),qke=function(t,n){if(typeof n=="function"){var r=n(t);return r}return x_({},t,n)},Hke=tM(function(e){return tM(function(t){return qke(e,t)})}),Wke=function(t){var n=I.useContext(T0);return t.theme!==n&&(n=Hke(n)(t.theme)),I.createElement(T0.Provider,{value:n},t.children)},Iq=Pq(function(e,t){var n=e.styles,r=qA([n],void 0,I.useContext(T0)),i=I.useRef();return aM(function(){var o=t.key+"-global",a=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[t]),aM(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(r.next!==void 0&&Eq(t,r.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}t.insert("",r,a,!1)},[t,r.name]),null});function Kke(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return qA(t)}var Qke=function(){var t=Kke.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function Xke(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Iy(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:a}=e,s=I.createContext(a);s.displayName=t;function l(){var u;const c=I.useContext(s);if(!c&&n){const d=new Error(o??Xke(r,i));throw d.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,d,l),d}return c}return[s.Provider,l,s]}var[Yke,Zke]=Iy({strict:!1,name:"PortalManagerContext"});function Jke(e){const{children:t,zIndex:n}=e;return W.jsx(Yke,{value:{zIndex:n},children:t})}Jke.displayName="PortalManager";var G_=globalThis!=null&&globalThis.document?I.useLayoutEffect:I.useEffect,[Rq,eAe]=Iy({strict:!1,name:"PortalContext"}),HA="chakra-portal",tAe=".chakra-portal",nAe=e=>W.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),rAe=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=I.useState(null),o=I.useRef(null),[,a]=I.useState({});I.useEffect(()=>a({}),[]);const s=eAe(),l=Zke();G_(()=>{if(!r)return;const c=r.ownerDocument,d=t?s??c.body:c.body;if(!d)return;o.current=c.createElement("div"),o.current.className=HA,d.appendChild(o.current),a({});const f=o.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?W.jsx(nAe,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?Vo.createPortal(W.jsx(Rq,{value:o.current,children:u}),o.current):W.jsx("span",{ref:c=>{c&&i(c)}})},iAe=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=I.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=HA),l},[i]),[,s]=I.useState({});return G_(()=>s({}),[]),G_(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Vo.createPortal(W.jsx(Rq,{value:r?a:null,children:t}),a):null};function nw(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?W.jsx(iAe,{containerRef:n,...r}):W.jsx(rAe,{...r})}nw.className=HA;nw.selector=tAe;nw.displayName="Portal";function Oq(){const e=I.useContext(T0);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}var WA=I.createContext({});WA.displayName="ColorModeContext";function rw(){const e=I.useContext(WA);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function zKe(e,t){const{colorMode:n}=rw();return n==="dark"?t:e}function oAe(){const e=rw(),t=Oq();return{...e,theme:t}}function aAe(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function sAe(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function jKe(e,t,n){const r=Oq();return lAe(e,t,n)(r)}function lAe(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{var c,d;if(e==="breakpoints")return aAe(o,l,(c=a[u])!=null?c:l);const f=`${e}.${l}`;return sAe(o,f,(d=a[u])!=null?d:l)});return Array.isArray(t)?s:s[0]}}var Rc=(...e)=>e.filter(Boolean).join(" ");function uAe(){return!1}function Ws(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var UKe=e=>{const{condition:t,message:n}=e;t&&uAe()&&console.warn(n)};function Ls(e,...t){return cAe(e)?e(...t):e}var cAe=e=>typeof e=="function",VKe=e=>e?"":void 0,GKe=e=>e?!0:void 0;function qKe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function HKe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var q_={exports:{}};q_.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",b="[object Null]",y="[object Object]",g="[object Proxy]",v="[object RegExp]",S="[object Set]",w="[object String]",x="[object Undefined]",C="[object WeakMap]",k="[object ArrayBuffer]",T="[object DataView]",P="[object Float32Array]",$="[object Float64Array]",O="[object Int8Array]",E="[object Int16Array]",A="[object Int32Array]",D="[object Uint8Array]",L="[object Uint8ClampedArray]",M="[object Uint16Array]",R="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,G={};G[P]=G[$]=G[O]=G[E]=G[A]=G[D]=G[L]=G[M]=G[R]=!0,G[s]=G[l]=G[k]=G[c]=G[T]=G[d]=G[f]=G[h]=G[m]=G[_]=G[y]=G[v]=G[S]=G[w]=G[C]=!1;var Z=typeof yt=="object"&&yt&&yt.Object===Object&&yt,ee=typeof self=="object"&&self&&self.Object===Object&&self,J=Z||ee||Function("return this")(),j=t&&!t.nodeType&&t,Q=j&&!0&&e&&!e.nodeType&&e,ne=Q&&Q.exports===j,se=ne&&Z.process,ye=function(){try{var F=Q&&Q.require&&Q.require("util").types;return F||se&&se.binding&&se.binding("util")}catch{}}(),ce=ye&&ye.isTypedArray;function bt(F,V,X){switch(X.length){case 0:return F.call(V);case 1:return F.call(V,X[0]);case 2:return F.call(V,X[0],X[1]);case 3:return F.call(V,X[0],X[1],X[2])}return F.apply(V,X)}function ot(F,V){for(var X=-1,pe=Array(F);++X<F;)pe[X]=V(X);return pe}function ze(F){return function(V){return F(V)}}function mt(F,V){return F==null?void 0:F[V]}function Pe(F,V){return function(X){return F(V(X))}}var en=Array.prototype,Pr=Function.prototype,Ln=Object.prototype,An=J["__core-js_shared__"],tn=Pr.toString,Fn=Ln.hasOwnProperty,Ir=function(){var F=/[^.]+$/.exec(An&&An.keys&&An.keys.IE_PROTO||"");return F?"Symbol(src)_1."+F:""}(),ho=Ln.toString,ei=tn.call(Object),pr=RegExp("^"+tn.call(Fn).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Br=ne?J.Buffer:void 0,ti=J.Symbol,Bn=J.Uint8Array,_n=Br?Br.allocUnsafe:void 0,Mi=Pe(Object.getPrototypeOf,Object),gi=Object.create,Qi=Ln.propertyIsEnumerable,Da=en.splice,Rr=ti?ti.toStringTag:void 0,po=function(){try{var F=or(Object,"defineProperty");return F({},"",{}),F}catch{}}(),al=Br?Br.isBuffer:void 0,Do=Math.max,sl=Date.now,zn=or(J,"Map"),nn=or(Object,"create"),zr=function(){function F(){}return function(V){if(!Qe(V))return{};if(gi)return gi(V);F.prototype=V;var X=new F;return F.prototype=void 0,X}}();function Or(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function Mr(){this.__data__=nn?nn(null):{},this.size=0}function ni(F){var V=this.has(F)&&delete this.__data__[F];return this.size-=V?1:0,V}function Ni(F){var V=this.__data__;if(nn){var X=V[F];return X===r?void 0:X}return Fn.call(V,F)?V[F]:void 0}function go(F){var V=this.__data__;return nn?V[F]!==void 0:Fn.call(V,F)}function mi(F,V){var X=this.__data__;return this.size+=this.has(F)?0:1,X[F]=nn&&V===void 0?r:V,this}Or.prototype.clear=Mr,Or.prototype.delete=ni,Or.prototype.get=Ni,Or.prototype.has=go,Or.prototype.set=mi;function jr(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function La(){this.__data__=[],this.size=0}function gs(F){var V=this.__data__,X=Ye(V,F);if(X<0)return!1;var pe=V.length-1;return X==pe?V.pop():Da.call(V,X,1),--this.size,!0}function yi(F){var V=this.__data__,X=Ye(V,F);return X<0?void 0:V[X][1]}function ou(F){return Ye(this.__data__,F)>-1}function oa(F,V){var X=this.__data__,pe=Ye(X,F);return pe<0?(++this.size,X.push([F,V])):X[pe][1]=V,this}jr.prototype.clear=La,jr.prototype.delete=gs,jr.prototype.get=yi,jr.prototype.has=ou,jr.prototype.set=oa;function ri(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function ll(){this.size=0,this.__data__={hash:new Or,map:new(zn||jr),string:new Or}}function H(F){var V=rn(this,F).delete(F);return this.size-=V?1:0,V}function te(F){return rn(this,F).get(F)}function re(F){return rn(this,F).has(F)}function de(F,V){var X=rn(this,F),pe=X.size;return X.set(F,V),this.size+=X.size==pe?0:1,this}ri.prototype.clear=ll,ri.prototype.delete=H,ri.prototype.get=te,ri.prototype.has=re,ri.prototype.set=de;function oe(F){var V=this.__data__=new jr(F);this.size=V.size}function je(){this.__data__=new jr,this.size=0}function Ge(F){var V=this.__data__,X=V.delete(F);return this.size=V.size,X}function ut(F){return this.__data__.get(F)}function $e(F){return this.__data__.has(F)}function qe(F,V){var X=this.__data__;if(X instanceof jr){var pe=X.__data__;if(!zn||pe.length<n-1)return pe.push([F,V]),this.size=++X.size,this;X=this.__data__=new ri(pe)}return X.set(F,V),this.size=X.size,this}oe.prototype.clear=je,oe.prototype.delete=Ge,oe.prototype.get=ut,oe.prototype.has=$e,oe.prototype.set=qe;function Ie(F,V){var X=ue(F),pe=!X&&we(F),Ct=!X&&!pe&&ge(F),pn=!X&&!pe&&!Ct&&Ut(F),In=X||pe||Ct||pn,It=In?ot(F.length,String):[],wn=It.length;for(var _i in F)(V||Fn.call(F,_i))&&!(In&&(_i=="length"||Ct&&(_i=="offset"||_i=="parent")||pn&&(_i=="buffer"||_i=="byteLength"||_i=="byteOffset")||Sn(_i,wn)))&&It.push(_i);return It}function ie(F,V,X){(X!==void 0&&!Ve(F[V],X)||X===void 0&&!(V in F))&&Ze(F,V,X)}function Se(F,V,X){var pe=F[V];(!(Fn.call(F,V)&&Ve(pe,X))||X===void 0&&!(V in F))&&Ze(F,V,X)}function Ye(F,V){for(var X=F.length;X--;)if(Ve(F[X][0],V))return X;return-1}function Ze(F,V,X){V=="__proto__"&&po?po(F,V,{configurable:!0,enumerable:!0,value:X,writable:!0}):F[V]=X}var ct=hn();function dt(F){return F==null?F===void 0?x:b:Rr&&Rr in Object(F)?xr(F):xe(F)}function _t(F){return Ae(F)&&dt(F)==s}function wt(F){if(!Qe(F)||xn(F))return!1;var V=Ce(F)?pr:B;return V.test(ft(F))}function Tt(F){return Ae(F)&&et(F.length)&&!!G[dt(F)]}function dn(F){if(!Qe(F))return mn(F);var V=on(F),X=[];for(var pe in F)pe=="constructor"&&(V||!Fn.call(F,pe))||X.push(pe);return X}function fn(F,V,X,pe,Ct){F!==V&&ct(V,function(pn,In){if(Ct||(Ct=new oe),Qe(pn))$i(F,V,In,X,fn,pe,Ct);else{var It=pe?pe(Ue(F,In),pn,In+"",F,V,Ct):void 0;It===void 0&&(It=pn),ie(F,In,It)}},ar)}function $i(F,V,X,pe,Ct,pn,In){var It=Ue(F,X),wn=Ue(V,X),_i=In.get(wn);if(_i){ie(F,X,_i);return}var Yn=pn?pn(It,wn,X+"",F,V,In):void 0,au=Yn===void 0;if(au){var tf=ue(wn),su=!tf&&ge(wn),nf=!tf&&!su&&Ut(wn);Yn=wn,tf||su||nf?ue(It)?Yn=It:fe(It)?Yn=mo(It):su?(au=!1,Yn=Sr(wn,!0)):nf?(au=!1,Yn=Xn(wn,!0)):Yn=[]:kt(wn)||we(wn)?(Yn=It,we(It)?Yn=Gt(It):(!Qe(It)||Ce(It))&&(Yn=bi(wn))):au=!1}au&&(In.set(wn,Yn),Ct(Yn,wn,pe,pn,In),In.delete(wn)),ie(F,X,Yn)}function Lo(F,V){return ke(Je(F,V,Pn),F+"")}var Di=po?function(F,V){return po(F,"toString",{configurable:!0,enumerable:!1,value:jn(V),writable:!0})}:Pn;function Sr(F,V){if(V)return F.slice();var X=F.length,pe=_n?_n(X):new F.constructor(X);return F.copy(pe),pe}function vi(F){var V=new F.constructor(F.byteLength);return new Bn(V).set(new Bn(F)),V}function Xn(F,V){var X=V?vi(F.buffer):F.buffer;return new F.constructor(X,F.byteOffset,F.length)}function mo(F,V){var X=-1,pe=F.length;for(V||(V=Array(pe));++X<pe;)V[X]=F[X];return V}function Fa(F,V,X,pe){var Ct=!X;X||(X={});for(var pn=-1,In=V.length;++pn<In;){var It=V[pn],wn=pe?pe(X[It],F[It],It,X,F):void 0;wn===void 0&&(wn=F[It]),Ct?Ze(X,It,wn):Se(X,It,wn)}return X}function it(F){return Lo(function(V,X){var pe=-1,Ct=X.length,pn=Ct>1?X[Ct-1]:void 0,In=Ct>2?X[2]:void 0;for(pn=F.length>3&&typeof pn=="function"?(Ct--,pn):void 0,In&&Nt(X[0],X[1],In)&&(pn=Ct<3?void 0:pn,Ct=1),V=Object(V);++pe<Ct;){var It=X[pe];It&&F(V,It,pe,pn)}return V})}function hn(F){return function(V,X,pe){for(var Ct=-1,pn=Object(V),In=pe(V),It=In.length;It--;){var wn=In[F?It:++Ct];if(X(pn[wn],wn,pn)===!1)break}return V}}function rn(F,V){var X=F.__data__;return Wt(V)?X[typeof V=="string"?"string":"hash"]:X.map}function or(F,V){var X=mt(F,V);return wt(X)?X:void 0}function xr(F){var V=Fn.call(F,Rr),X=F[Rr];try{F[Rr]=void 0;var pe=!0}catch{}var Ct=ho.call(F);return pe&&(V?F[Rr]=X:delete F[Rr]),Ct}function bi(F){return typeof F.constructor=="function"&&!on(F)?zr(Mi(F)):{}}function Sn(F,V){var X=typeof F;return V=V??a,!!V&&(X=="number"||X!="symbol"&&U.test(F))&&F>-1&&F%1==0&&F<V}function Nt(F,V,X){if(!Qe(X))return!1;var pe=typeof V;return(pe=="number"?Ee(X)&&Sn(V,X.length):pe=="string"&&V in X)?Ve(X[V],F):!1}function Wt(F){var V=typeof F;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?F!=="__proto__":F===null}function xn(F){return!!Ir&&Ir in F}function on(F){var V=F&&F.constructor,X=typeof V=="function"&&V.prototype||Ln;return F===X}function mn(F){var V=[];if(F!=null)for(var X in Object(F))V.push(X);return V}function xe(F){return ho.call(F)}function Je(F,V,X){return V=Do(V===void 0?F.length-1:V,0),function(){for(var pe=arguments,Ct=-1,pn=Do(pe.length-V,0),In=Array(pn);++Ct<pn;)In[Ct]=pe[V+Ct];Ct=-1;for(var It=Array(V+1);++Ct<V;)It[Ct]=pe[Ct];return It[V]=X(In),bt(F,this,It)}}function Ue(F,V){if(!(V==="constructor"&&typeof F[V]=="function")&&V!="__proto__")return F[V]}var ke=He(Di);function He(F){var V=0,X=0;return function(){var pe=sl(),Ct=o-(pe-X);if(X=pe,Ct>0){if(++V>=i)return arguments[0]}else V=0;return F.apply(void 0,arguments)}}function ft(F){if(F!=null){try{return tn.call(F)}catch{}try{return F+""}catch{}}return""}function Ve(F,V){return F===V||F!==F&&V!==V}var we=_t(function(){return arguments}())?_t:function(F){return Ae(F)&&Fn.call(F,"callee")&&!Qi.call(F,"callee")},ue=Array.isArray;function Ee(F){return F!=null&&et(F.length)&&!Ce(F)}function fe(F){return Ae(F)&&Ee(F)}var ge=al||Xi;function Ce(F){if(!Qe(F))return!1;var V=dt(F);return V==h||V==p||V==u||V==g}function et(F){return typeof F=="number"&&F>-1&&F%1==0&&F<=a}function Qe(F){var V=typeof F;return F!=null&&(V=="object"||V=="function")}function Ae(F){return F!=null&&typeof F=="object"}function kt(F){if(!Ae(F)||dt(F)!=y)return!1;var V=Mi(F);if(V===null)return!0;var X=Fn.call(V,"constructor")&&V.constructor;return typeof X=="function"&&X instanceof X&&tn.call(X)==ei}var Ut=ce?ze(ce):Tt;function Gt(F){return Fa(F,ar(F))}function ar(F){return Ee(F)?Ie(F,!0):dn(F)}var gr=it(function(F,V,X,pe){fn(F,V,X,pe)});function jn(F){return function(){return F}}function Pn(F){return F}function Xi(){return!1}e.exports=gr})(q_,q_.exports);var dAe=q_.exports;const Fs=mc(dAe);var fAe=e=>/!(important)?$/.test(e),sM=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,hAe=(e,t)=>n=>{const r=String(t),i=fAe(r),o=sM(r),a=e?`${e}.${o}`:o;let s=Ws(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=sM(s),i?`${s} !important`:s};function KA(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var s;const l=hAe(t,o)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var Qv=(...e)=>t=>e.reduce((n,r)=>r(n),t);function ua(e,t){return n=>{const r={property:n,scale:e};return r.transform=KA({scale:e,transform:t}),r}}var pAe=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function gAe(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:pAe(t),transform:n?KA({scale:n,compose:r}):r}}var Mq=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function mAe(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Mq].join(" ")}function yAe(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Mq].join(" ")}var vAe={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},bAe={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function _Ae(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var SAe={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},cT={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},xAe=new Set(Object.values(cT)),dT=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),wAe=e=>e.trim();function CAe(e,t){if(e==null||dT.has(e))return e;if(!(fT(e)||dT.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],a=i==null?void 0:i[2];if(!o||!a)return e;const s=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=a.split(",").map(wAe).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in cT?cT[l]:l;u.unshift(c);const d=u.map(f=>{if(xAe.has(f))return f;const h=f.indexOf(" "),[p,m]=h!==-1?[f.substr(0,h),f.substr(h+1)]:[f],_=fT(m)?m:m&&m.split(" "),b=`colors.${p}`,y=b in t.__cssMap?t.__cssMap[b].varRef:p;return _?[y,...Array.isArray(_)?_:[_]].join(" "):y});return`${s}(${d.join(", ")})`}var fT=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),EAe=(e,t)=>CAe(e,t??{});function TAe(e){return/^var\(--.+\)$/.test(e)}var kAe=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Ss=e=>t=>`${e}(${t})`,Qt={filter(e){return e!=="auto"?e:vAe},backdropFilter(e){return e!=="auto"?e:bAe},ring(e){return _Ae(Qt.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?mAe():e==="auto-gpu"?yAe():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=kAe(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(TAe(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:EAe,blur:Ss("blur"),opacity:Ss("opacity"),brightness:Ss("brightness"),contrast:Ss("contrast"),dropShadow:Ss("drop-shadow"),grayscale:Ss("grayscale"),hueRotate:Ss("hue-rotate"),invert:Ss("invert"),saturate:Ss("saturate"),sepia:Ss("sepia"),bgImage(e){return e==null||fT(e)||dT.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=SAe[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},q={borderWidths:ua("borderWidths"),borderStyles:ua("borderStyles"),colors:ua("colors"),borders:ua("borders"),gradients:ua("gradients",Qt.gradient),radii:ua("radii",Qt.px),space:ua("space",Qv(Qt.vh,Qt.px)),spaceT:ua("space",Qv(Qt.vh,Qt.px)),degreeT(e){return{property:e,transform:Qt.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:KA({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:ua("sizes",Qv(Qt.vh,Qt.px)),sizesT:ua("sizes",Qv(Qt.vh,Qt.fraction)),shadows:ua("shadows"),logical:gAe,blur:ua("blur",Qt.blur)},Q1={background:q.colors("background"),backgroundColor:q.colors("backgroundColor"),backgroundImage:q.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Qt.bgClip},bgSize:q.prop("backgroundSize"),bgPosition:q.prop("backgroundPosition"),bg:q.colors("background"),bgColor:q.colors("backgroundColor"),bgPos:q.prop("backgroundPosition"),bgRepeat:q.prop("backgroundRepeat"),bgAttachment:q.prop("backgroundAttachment"),bgGradient:q.gradients("backgroundImage"),bgClip:{transform:Qt.bgClip}};Object.assign(Q1,{bgImage:Q1.backgroundImage,bgImg:Q1.backgroundImage});var sn={border:q.borders("border"),borderWidth:q.borderWidths("borderWidth"),borderStyle:q.borderStyles("borderStyle"),borderColor:q.colors("borderColor"),borderRadius:q.radii("borderRadius"),borderTop:q.borders("borderTop"),borderBlockStart:q.borders("borderBlockStart"),borderTopLeftRadius:q.radii("borderTopLeftRadius"),borderStartStartRadius:q.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:q.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:q.radii("borderTopRightRadius"),borderStartEndRadius:q.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:q.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:q.borders("borderRight"),borderInlineEnd:q.borders("borderInlineEnd"),borderBottom:q.borders("borderBottom"),borderBlockEnd:q.borders("borderBlockEnd"),borderBottomLeftRadius:q.radii("borderBottomLeftRadius"),borderBottomRightRadius:q.radii("borderBottomRightRadius"),borderLeft:q.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:q.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:q.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:q.borders(["borderLeft","borderRight"]),borderInline:q.borders("borderInline"),borderY:q.borders(["borderTop","borderBottom"]),borderBlock:q.borders("borderBlock"),borderTopWidth:q.borderWidths("borderTopWidth"),borderBlockStartWidth:q.borderWidths("borderBlockStartWidth"),borderTopColor:q.colors("borderTopColor"),borderBlockStartColor:q.colors("borderBlockStartColor"),borderTopStyle:q.borderStyles("borderTopStyle"),borderBlockStartStyle:q.borderStyles("borderBlockStartStyle"),borderBottomWidth:q.borderWidths("borderBottomWidth"),borderBlockEndWidth:q.borderWidths("borderBlockEndWidth"),borderBottomColor:q.colors("borderBottomColor"),borderBlockEndColor:q.colors("borderBlockEndColor"),borderBottomStyle:q.borderStyles("borderBottomStyle"),borderBlockEndStyle:q.borderStyles("borderBlockEndStyle"),borderLeftWidth:q.borderWidths("borderLeftWidth"),borderInlineStartWidth:q.borderWidths("borderInlineStartWidth"),borderLeftColor:q.colors("borderLeftColor"),borderInlineStartColor:q.colors("borderInlineStartColor"),borderLeftStyle:q.borderStyles("borderLeftStyle"),borderInlineStartStyle:q.borderStyles("borderInlineStartStyle"),borderRightWidth:q.borderWidths("borderRightWidth"),borderInlineEndWidth:q.borderWidths("borderInlineEndWidth"),borderRightColor:q.colors("borderRightColor"),borderInlineEndColor:q.colors("borderInlineEndColor"),borderRightStyle:q.borderStyles("borderRightStyle"),borderInlineEndStyle:q.borderStyles("borderInlineEndStyle"),borderTopRadius:q.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:q.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:q.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:q.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(sn,{rounded:sn.borderRadius,roundedTop:sn.borderTopRadius,roundedTopLeft:sn.borderTopLeftRadius,roundedTopRight:sn.borderTopRightRadius,roundedTopStart:sn.borderStartStartRadius,roundedTopEnd:sn.borderStartEndRadius,roundedBottom:sn.borderBottomRadius,roundedBottomLeft:sn.borderBottomLeftRadius,roundedBottomRight:sn.borderBottomRightRadius,roundedBottomStart:sn.borderEndStartRadius,roundedBottomEnd:sn.borderEndEndRadius,roundedLeft:sn.borderLeftRadius,roundedRight:sn.borderRightRadius,roundedStart:sn.borderInlineStartRadius,roundedEnd:sn.borderInlineEndRadius,borderStart:sn.borderInlineStart,borderEnd:sn.borderInlineEnd,borderTopStartRadius:sn.borderStartStartRadius,borderTopEndRadius:sn.borderStartEndRadius,borderBottomStartRadius:sn.borderEndStartRadius,borderBottomEndRadius:sn.borderEndEndRadius,borderStartRadius:sn.borderInlineStartRadius,borderEndRadius:sn.borderInlineEndRadius,borderStartWidth:sn.borderInlineStartWidth,borderEndWidth:sn.borderInlineEndWidth,borderStartColor:sn.borderInlineStartColor,borderEndColor:sn.borderInlineEndColor,borderStartStyle:sn.borderInlineStartStyle,borderEndStyle:sn.borderInlineEndStyle});var AAe={color:q.colors("color"),textColor:q.colors("color"),fill:q.colors("fill"),stroke:q.colors("stroke")},hT={boxShadow:q.shadows("boxShadow"),mixBlendMode:!0,blendMode:q.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:q.prop("backgroundBlendMode"),opacity:!0};Object.assign(hT,{shadow:hT.boxShadow});var PAe={filter:{transform:Qt.filter},blur:q.blur("--chakra-blur"),brightness:q.propT("--chakra-brightness",Qt.brightness),contrast:q.propT("--chakra-contrast",Qt.contrast),hueRotate:q.degreeT("--chakra-hue-rotate"),invert:q.propT("--chakra-invert",Qt.invert),saturate:q.propT("--chakra-saturate",Qt.saturate),dropShadow:q.propT("--chakra-drop-shadow",Qt.dropShadow),backdropFilter:{transform:Qt.backdropFilter},backdropBlur:q.blur("--chakra-backdrop-blur"),backdropBrightness:q.propT("--chakra-backdrop-brightness",Qt.brightness),backdropContrast:q.propT("--chakra-backdrop-contrast",Qt.contrast),backdropHueRotate:q.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:q.propT("--chakra-backdrop-invert",Qt.invert),backdropSaturate:q.propT("--chakra-backdrop-saturate",Qt.saturate)},H_={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Qt.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:q.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:q.space("gap"),rowGap:q.space("rowGap"),columnGap:q.space("columnGap")};Object.assign(H_,{flexDir:H_.flexDirection});var Nq={gridGap:q.space("gridGap"),gridColumnGap:q.space("gridColumnGap"),gridRowGap:q.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},IAe={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Qt.outline},outlineOffset:!0,outlineColor:q.colors("outlineColor")},fa={width:q.sizesT("width"),inlineSize:q.sizesT("inlineSize"),height:q.sizes("height"),blockSize:q.sizes("blockSize"),boxSize:q.sizes(["width","height"]),minWidth:q.sizes("minWidth"),minInlineSize:q.sizes("minInlineSize"),minHeight:q.sizes("minHeight"),minBlockSize:q.sizes("minBlockSize"),maxWidth:q.sizes("maxWidth"),maxInlineSize:q.sizes("maxInlineSize"),maxHeight:q.sizes("maxHeight"),maxBlockSize:q.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (min-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?i:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (max-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?i:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:q.propT("float",Qt.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(fa,{w:fa.width,h:fa.height,minW:fa.minWidth,maxW:fa.maxWidth,minH:fa.minHeight,maxH:fa.maxHeight,overscroll:fa.overscrollBehavior,overscrollX:fa.overscrollBehaviorX,overscrollY:fa.overscrollBehaviorY});var RAe={listStyleType:!0,listStylePosition:!0,listStylePos:q.prop("listStylePosition"),listStyleImage:!0,listStyleImg:q.prop("listStyleImage")};function OAe(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var MAe=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},NAe=MAe(OAe),$Ae={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},DAe={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},s5=(e,t,n)=>{const r={},i=NAe(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},LAe={srOnly:{transform(e){return e===!0?$Ae:e==="focusable"?DAe:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>s5(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>s5(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>s5(t,e,n)}},Xg={position:!0,pos:q.prop("position"),zIndex:q.prop("zIndex","zIndices"),inset:q.spaceT("inset"),insetX:q.spaceT(["left","right"]),insetInline:q.spaceT("insetInline"),insetY:q.spaceT(["top","bottom"]),insetBlock:q.spaceT("insetBlock"),top:q.spaceT("top"),insetBlockStart:q.spaceT("insetBlockStart"),bottom:q.spaceT("bottom"),insetBlockEnd:q.spaceT("insetBlockEnd"),left:q.spaceT("left"),insetInlineStart:q.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:q.spaceT("right"),insetInlineEnd:q.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Xg,{insetStart:Xg.insetInlineStart,insetEnd:Xg.insetInlineEnd});var FAe={ring:{transform:Qt.ring},ringColor:q.colors("--chakra-ring-color"),ringOffset:q.prop("--chakra-ring-offset-width"),ringOffsetColor:q.colors("--chakra-ring-offset-color"),ringInset:q.prop("--chakra-ring-inset")},Vn={margin:q.spaceT("margin"),marginTop:q.spaceT("marginTop"),marginBlockStart:q.spaceT("marginBlockStart"),marginRight:q.spaceT("marginRight"),marginInlineEnd:q.spaceT("marginInlineEnd"),marginBottom:q.spaceT("marginBottom"),marginBlockEnd:q.spaceT("marginBlockEnd"),marginLeft:q.spaceT("marginLeft"),marginInlineStart:q.spaceT("marginInlineStart"),marginX:q.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:q.spaceT("marginInline"),marginY:q.spaceT(["marginTop","marginBottom"]),marginBlock:q.spaceT("marginBlock"),padding:q.space("padding"),paddingTop:q.space("paddingTop"),paddingBlockStart:q.space("paddingBlockStart"),paddingRight:q.space("paddingRight"),paddingBottom:q.space("paddingBottom"),paddingBlockEnd:q.space("paddingBlockEnd"),paddingLeft:q.space("paddingLeft"),paddingInlineStart:q.space("paddingInlineStart"),paddingInlineEnd:q.space("paddingInlineEnd"),paddingX:q.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:q.space("paddingInline"),paddingY:q.space(["paddingTop","paddingBottom"]),paddingBlock:q.space("paddingBlock")};Object.assign(Vn,{m:Vn.margin,mt:Vn.marginTop,mr:Vn.marginRight,me:Vn.marginInlineEnd,marginEnd:Vn.marginInlineEnd,mb:Vn.marginBottom,ml:Vn.marginLeft,ms:Vn.marginInlineStart,marginStart:Vn.marginInlineStart,mx:Vn.marginX,my:Vn.marginY,p:Vn.padding,pt:Vn.paddingTop,py:Vn.paddingY,px:Vn.paddingX,pb:Vn.paddingBottom,pl:Vn.paddingLeft,ps:Vn.paddingInlineStart,paddingStart:Vn.paddingInlineStart,pr:Vn.paddingRight,pe:Vn.paddingInlineEnd,paddingEnd:Vn.paddingInlineEnd});var BAe={textDecorationColor:q.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:q.shadows("textShadow")},zAe={clipPath:!0,transform:q.propT("transform",Qt.transform),transformOrigin:!0,translateX:q.spaceT("--chakra-translate-x"),translateY:q.spaceT("--chakra-translate-y"),skewX:q.degreeT("--chakra-skew-x"),skewY:q.degreeT("--chakra-skew-y"),scaleX:q.prop("--chakra-scale-x"),scaleY:q.prop("--chakra-scale-y"),scale:q.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:q.degreeT("--chakra-rotate")},jAe={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:q.prop("transitionDuration","transition.duration"),transitionProperty:q.prop("transitionProperty","transition.property"),transitionTimingFunction:q.prop("transitionTimingFunction","transition.easing")},UAe={fontFamily:q.prop("fontFamily","fonts"),fontSize:q.prop("fontSize","fontSizes",Qt.px),fontWeight:q.prop("fontWeight","fontWeights"),lineHeight:q.prop("lineHeight","lineHeights"),letterSpacing:q.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},VAe={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:q.spaceT("scrollMargin"),scrollMarginTop:q.spaceT("scrollMarginTop"),scrollMarginBottom:q.spaceT("scrollMarginBottom"),scrollMarginLeft:q.spaceT("scrollMarginLeft"),scrollMarginRight:q.spaceT("scrollMarginRight"),scrollMarginX:q.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:q.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:q.spaceT("scrollPadding"),scrollPaddingTop:q.spaceT("scrollPaddingTop"),scrollPaddingBottom:q.spaceT("scrollPaddingBottom"),scrollPaddingLeft:q.spaceT("scrollPaddingLeft"),scrollPaddingRight:q.spaceT("scrollPaddingRight"),scrollPaddingX:q.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:q.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function $q(e){return Ws(e)&&e.reference?e.reference:String(e)}var iw=(e,...t)=>t.map($q).join(` ${e} `).replace(/calc/g,""),lM=(...e)=>`calc(${iw("+",...e)})`,uM=(...e)=>`calc(${iw("-",...e)})`,pT=(...e)=>`calc(${iw("*",...e)})`,cM=(...e)=>`calc(${iw("/",...e)})`,dM=e=>{const t=$q(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:pT(t,-1)},Xc=Object.assign(e=>({add:(...t)=>Xc(lM(e,...t)),subtract:(...t)=>Xc(uM(e,...t)),multiply:(...t)=>Xc(pT(e,...t)),divide:(...t)=>Xc(cM(e,...t)),negate:()=>Xc(dM(e)),toString:()=>e.toString()}),{add:lM,subtract:uM,multiply:pT,divide:cM,negate:dM});function GAe(e,t="-"){return e.replace(/\s+/g,t)}function qAe(e){const t=GAe(e.toString());return WAe(HAe(t))}function HAe(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function WAe(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function KAe(e,t=""){return[t,e].filter(Boolean).join("-")}function QAe(e,t){return`var(${e}${t?`, ${t}`:""})`}function XAe(e,t=""){return qAe(`--${KAe(e,t)}`)}function nt(e,t,n){const r=XAe(e,n);return{variable:r,reference:QAe(r,t)}}function YAe(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=nt(`${e}-${i}`,o);continue}n[r]=nt(`${e}-${r}`)}return n}function ZAe(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function JAe(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function gT(e){if(e==null)return e;const{unitless:t}=JAe(e);return t||typeof e=="number"?`${e}px`:e}var Dq=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,QA=e=>Object.fromEntries(Object.entries(e).sort(Dq));function fM(e){const t=QA(e);return Object.assign(Object.values(t),t)}function ePe(e){const t=Object.keys(QA(e));return new Set(t)}function hM(e){var t;if(!e)return e;e=(t=gT(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function Tg(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${gT(e)})`),t&&n.push("and",`(max-width: ${gT(t)})`),n.join(" ")}function tPe(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=fM(e),r=Object.entries(e).sort(Dq).map(([a,s],l,u)=>{var c;let[,d]=(c=u[l+1])!=null?c:[];return d=parseFloat(d)>0?hM(d):void 0,{_minW:hM(s),breakpoint:a,minW:s,maxW:d,maxWQuery:Tg(null,d),minWQuery:Tg(s),minMaxQuery:Tg(s,d)}}),i=ePe(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>i.has(l))},asObject:QA(e),asArray:fM(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>Tg(a)).slice(1)],toArrayValue(a){if(!Ws(a))throw new Error("toArrayValue: value must be an object");const s=o.map(l=>{var u;return(u=a[l])!=null?u:null});for(;ZAe(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=o[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var Si={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},hu=e=>Lq(t=>e(t,"&"),"[role=group]","[data-group]",".group"),hl=e=>Lq(t=>e(t,"~ &"),"[data-peer]",".peer"),Lq=(e,...t)=>t.map(e).join(", "),ow={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:hu(Si.hover),_peerHover:hl(Si.hover),_groupFocus:hu(Si.focus),_peerFocus:hl(Si.focus),_groupFocusVisible:hu(Si.focusVisible),_peerFocusVisible:hl(Si.focusVisible),_groupActive:hu(Si.active),_peerActive:hl(Si.active),_groupDisabled:hu(Si.disabled),_peerDisabled:hl(Si.disabled),_groupInvalid:hu(Si.invalid),_peerInvalid:hl(Si.invalid),_groupChecked:hu(Si.checked),_peerChecked:hl(Si.checked),_groupFocusWithin:hu(Si.focusWithin),_peerFocusWithin:hl(Si.focusWithin),_peerPlaceholderShown:hl(Si.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},Fq=Object.keys(ow);function pM(e,t){return nt(String(e).replace(/\./g,"-"),void 0,t)}function nPe(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=pM(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const f=i.split("."),[h,...p]=f,m=`${h}.-${p.join(".")}`,_=Xc.negate(s),b=Xc.negate(u);r[m]={value:_,var:l,varRef:b}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const c=f=>{const p=[String(i).split(".")[0],f].join(".");if(!e[p])return f;const{reference:_}=pM(p,t==null?void 0:t.cssVarPrefix);return _},d=Ws(s)?s:{default:s};n=Fs(n,Object.entries(d).reduce((f,[h,p])=>{var m,_;if(!p)return f;const b=c(`${p}`);if(h==="default")return f[l]=b,f;const y=(_=(m=ow)==null?void 0:m[h])!=null?_:h;return f[y]={[l]:b},f},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function rPe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function iPe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function oPe(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function gM(e,t,n={}){const{stop:r,getKey:i}=n;function o(a,s=[]){var l;if(oPe(a)||Array.isArray(a)){const u={};for(const[c,d]of Object.entries(a)){const f=(l=i==null?void 0:i(c))!=null?l:c,h=[...s,f];if(r!=null&&r(a,h))return t(a,s);u[f]=o(d,h)}return u}return t(a,s)}return o(e)}var aPe=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function sPe(e){return iPe(e,aPe)}function lPe(e){return e.semanticTokens}function uPe(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var cPe=e=>Fq.includes(e)||e==="default";function dPe({tokens:e,semanticTokens:t}){const n={};return gM(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),gM(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(cPe)}),n}function fPe(e){var t;const n=uPe(e),r=sPe(n),i=lPe(n),o=dPe({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=nPe(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:tPe(n.breakpoints)}),n}var XA=Fs({},Q1,sn,AAe,H_,fa,PAe,FAe,IAe,Nq,LAe,Xg,hT,Vn,VAe,UAe,BAe,zAe,RAe,jAe),hPe=Object.assign({},Vn,fa,H_,Nq,Xg),WKe=Object.keys(hPe),pPe=[...Object.keys(XA),...Fq],gPe={...XA,...ow},mPe=e=>e in gPe,yPe=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=Ls(e[a],t);if(s==null)continue;if(s=Ws(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;u<l;u+=1){const c=i==null?void 0:i[u];if(!c){o[a]=s[u];continue}o[c]=o[c]||{},s[u]!=null&&(o[c][a]=s[u])}}return o};function vPe(e){const t=[];let n="",r=!1;for(let i=0;i<e.length;i++){const o=e[i];o==="("?(r=!0,n+=o):o===")"?(r=!1,n+=o):o===","&&!r?(t.push(n),n=""):n+=o}return n=n.trim(),n&&t.push(n),t}function bPe(e){return/^var\(--.+\)$/.test(e)}var _Pe=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!bPe(t),SPe=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[a,s]=vPe(t);return t=(r=(n=i(a))!=null?n:o(s))!=null?r:o(t),t};function xPe(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s,l,u;const c=Ls(o,r),d=yPe(c)(r);let f={};for(let h in d){const p=d[h];let m=Ls(p,r);h in n&&(h=n[h]),_Pe(h,m)&&(m=SPe(r,m));let _=t[h];if(_===!0&&(_={property:h}),Ws(m)){f[h]=(s=f[h])!=null?s:{},f[h]=Fs({},f[h],i(m,!0));continue}let b=(u=(l=_==null?void 0:_.transform)==null?void 0:l.call(_,m,r,c))!=null?u:m;b=_!=null&&_.processResult?i(b,!0):b;const y=Ls(_==null?void 0:_.property,r);if(!a&&(_!=null&&_.static)){const g=Ls(_.static,r);f=Fs({},f,g)}if(y&&Array.isArray(y)){for(const g of y)f[g]=b;continue}if(y){y==="&"&&Ws(b)?f=Fs({},f,b):f[y]=b;continue}if(Ws(b)){f=Fs({},f,b);continue}f[h]=b}return f};return i}var Bq=e=>t=>xPe({theme:t,pseudos:ow,configs:XA})(e);function Pt(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function wPe(e,t){if(Array.isArray(e))return e;if(Ws(e))return t(e);if(e!=null)return[e]}function CPe(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function EPe(e){const t=e.__breakpoints;return function(r,i,o,a){var s,l;if(!t)return;const u={},c=wPe(o,t.toArrayValue);if(!c)return u;const d=c.length,f=d===1,h=!!r.parts;for(let p=0;p<d;p++){const m=t.details[p],_=t.details[CPe(c,p)],b=Tg(m.minW,_==null?void 0:_._minW),y=Ls((s=r[i])==null?void 0:s[c[p]],a);if(y){if(h){(l=r.parts)==null||l.forEach(g=>{Fs(u,{[g]:f?y[g]:{[b]:y[g]}})});continue}if(!h){f?Fs(u,y):u[b]=y;continue}u[b]=y}}return u}}function TPe(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,a=EPe(o);return Fs({},Ls((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",i,t),a(e,"variants",r,t))}}function KKe(e,t,n){var r,i,o;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function Ry(e){return rPe(e,["styleConfig","size","variant","colorScheme"])}var kPe={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},APe={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},PPe={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},IPe={property:kPe,easing:APe,duration:PPe},RPe=IPe,OPe={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},MPe=OPe,NPe={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},$Pe=NPe,DPe={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},LPe=DPe,FPe={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},BPe=FPe,zPe={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},jPe=zPe,UPe={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},VPe=UPe,GPe={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},qPe=GPe,HPe={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},zq=HPe,jq={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},WPe={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},KPe={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},QPe={...jq,...WPe,container:KPe},Uq=QPe,XPe={breakpoints:LPe,zIndices:MPe,radii:jPe,blur:qPe,colors:BPe,...zq,sizes:Uq,shadows:VPe,space:jq,borders:$Pe,transition:RPe},{defineMultiStyleConfig:YPe,definePartsStyle:kg}=Pt(["stepper","step","title","description","indicator","separator","icon","number"]),kl=nt("stepper-indicator-size"),Uf=nt("stepper-icon-size"),Vf=nt("stepper-title-font-size"),Ag=nt("stepper-description-font-size"),ag=nt("stepper-accent-color"),ZPe=kg(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[ag.variable]:`colors.${e}.500`,_dark:{[ag.variable]:`colors.${e}.200`}},title:{fontSize:Vf.reference,fontWeight:"medium"},description:{fontSize:Ag.reference,color:"chakra-subtle-text"},number:{fontSize:Vf.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Uf.reference,height:Uf.reference},indicator:{flexShrink:0,borderRadius:"full",width:kl.reference,height:kl.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:ag.reference},"&[data-status=complete]":{bg:ag.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:ag.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${kl.reference} - 8px)`,top:`calc(${kl.reference} + 4px)`,insetStart:`calc(${kl.reference} / 2 - 1px)`}}})),JPe=YPe({baseStyle:ZPe,sizes:{xs:kg({stepper:{[kl.variable]:"sizes.4",[Uf.variable]:"sizes.3",[Vf.variable]:"fontSizes.xs",[Ag.variable]:"fontSizes.xs"}}),sm:kg({stepper:{[kl.variable]:"sizes.6",[Uf.variable]:"sizes.4",[Vf.variable]:"fontSizes.sm",[Ag.variable]:"fontSizes.xs"}}),md:kg({stepper:{[kl.variable]:"sizes.8",[Uf.variable]:"sizes.5",[Vf.variable]:"fontSizes.md",[Ag.variable]:"fontSizes.sm"}}),lg:kg({stepper:{[kl.variable]:"sizes.10",[Uf.variable]:"sizes.6",[Vf.variable]:"fontSizes.lg",[Ag.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function gn(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)t[d]=l(d);return gn(e,t)}function o(...c){for(const d of c)d in t||(t[d]=l(d));return gn(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(c){const h=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>c}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Vq=gn("accordion").parts("root","container","button","panel").extend("icon"),e6e=gn("alert").parts("title","description","container").extend("icon","spinner"),t6e=gn("avatar").parts("label","badge","container").extend("excessLabel","group"),n6e=gn("breadcrumb").parts("link","item","container").extend("separator");gn("button").parts();var Gq=gn("checkbox").parts("control","icon","container").extend("label");gn("progress").parts("track","filledTrack").extend("label");var r6e=gn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),qq=gn("editable").parts("preview","input","textarea"),i6e=gn("form").parts("container","requiredIndicator","helperText"),o6e=gn("formError").parts("text","icon"),Hq=gn("input").parts("addon","field","element","group"),a6e=gn("list").parts("container","item","icon"),Wq=gn("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),Kq=gn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Qq=gn("numberinput").parts("root","field","stepperGroup","stepper");gn("pininput").parts("field");var Xq=gn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Yq=gn("progress").parts("label","filledTrack","track"),s6e=gn("radio").parts("container","control","label"),Zq=gn("select").parts("field","icon"),Jq=gn("slider").parts("container","track","thumb","filledTrack","mark"),l6e=gn("stat").parts("container","label","helpText","number","icon"),eH=gn("switch").parts("container","track","thumb"),u6e=gn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tH=gn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),c6e=gn("tag").parts("container","label","closeButton"),d6e=gn("card").parts("container","header","body","footer");function ld(e,t,n){return Math.min(Math.max(e,n),t)}class f6e extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Pg=f6e;function YA(e){if(typeof e!="string")throw new Pg(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=_6e.test(e)?g6e(e):e;const n=m6e.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(k0(s,2),16)),parseInt(k0(a[3]||"f",2),16)/255]}const r=y6e.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const i=v6e.exec(t);if(i){const a=Array.from(i).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const o=b6e.exec(t);if(o){const[a,s,l,u]=Array.from(o).slice(1).map(parseFloat);if(ld(0,100,s)!==s)throw new Pg(e);if(ld(0,100,l)!==l)throw new Pg(e);return[...S6e(a,s,l),Number.isNaN(u)?1:u]}throw new Pg(e)}function h6e(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const mM=e=>parseInt(e.replace(/_/g,""),36),p6e="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=mM(t.substring(0,3)),r=mM(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function g6e(e){const t=e.toLowerCase().trim(),n=p6e[h6e(t)];if(!n)throw new Pg(e);return`#${n}`}const k0=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),m6e=new RegExp(`^#${k0("([a-f0-9])",3)}([a-f0-9])?$`,"i"),y6e=new RegExp(`^#${k0("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),v6e=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${k0(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),b6e=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,_6e=/^[a-z]+$/i,yM=e=>Math.round(e*255),S6e=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(yM);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),a=o*(1-Math.abs(i%2-1));let s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);const c=r-o/2,d=s+c,f=l+c,h=u+c;return[d,f,h].map(yM)};function x6e(e,t,n,r){return`rgba(${ld(0,255,e).toFixed()}, ${ld(0,255,t).toFixed()}, ${ld(0,255,n).toFixed()}, ${parseFloat(ld(0,1,r).toFixed(3))})`}function w6e(e,t){const[n,r,i,o]=YA(e);return x6e(n,r,i,o-t)}function C6e(e){const[t,n,r,i]=YA(e);let o=a=>{const s=ld(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}function E6e(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var T6e=e=>Object.keys(e).length===0,ro=(e,t,n)=>{const r=E6e(e,`colors.${t}`,t);try{return C6e(r),r}catch{return n??"#000000"}},k6e=e=>{const[t,n,r]=YA(e);return(t*299+n*587+r*114)/1e3},A6e=e=>t=>{const n=ro(t,e);return k6e(n)<128?"dark":"light"},P6e=e=>t=>A6e(e)(t)==="dark",sp=(e,t)=>n=>{const r=ro(n,e);return w6e(r,1-t)};function vM(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient(
-    45deg,
-    ${t} 25%,
-    transparent 25%,
-    transparent 50%,
-    ${t} 50%,
-    ${t} 75%,
-    transparent 75%,
-    transparent
-  )`,backgroundSize:`${e} ${e}`}}var I6e=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function R6e(e){const t=I6e();return!e||T6e(e)?t:e.string&&e.colors?M6e(e.string,e.colors):e.string&&!e.colors?O6e(e.string):e.colors&&!e.string?N6e(e.colors):t}function O6e(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t),t=t&t;let n="#";for(let r=0;r<3;r+=1){const i=t>>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function M6e(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;r<e.length;r+=1)n=e.charCodeAt(r)+((n<<5)-n),n=n&n;return n=(n%t.length+t.length)%t.length,t[n]}function N6e(e){return e[Math.floor(Math.random()*e.length)]}function K(e,t){return n=>n.colorMode==="dark"?t:e}function ZA(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function nH(e){return Ws(e)&&e.reference?e.reference:String(e)}var aw=(e,...t)=>t.map(nH).join(` ${e} `).replace(/calc/g,""),bM=(...e)=>`calc(${aw("+",...e)})`,_M=(...e)=>`calc(${aw("-",...e)})`,mT=(...e)=>`calc(${aw("*",...e)})`,SM=(...e)=>`calc(${aw("/",...e)})`,xM=e=>{const t=nH(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:mT(t,-1)},Al=Object.assign(e=>({add:(...t)=>Al(bM(e,...t)),subtract:(...t)=>Al(_M(e,...t)),multiply:(...t)=>Al(mT(e,...t)),divide:(...t)=>Al(SM(e,...t)),negate:()=>Al(xM(e)),toString:()=>e.toString()}),{add:bM,subtract:_M,multiply:mT,divide:SM,negate:xM});function $6e(e){return!Number.isInteger(parseFloat(e.toString()))}function D6e(e,t="-"){return e.replace(/\s+/g,t)}function rH(e){const t=D6e(e.toString());return t.includes("\\.")?e:$6e(e)?t.replace(".","\\."):e}function L6e(e,t=""){return[t,rH(e)].filter(Boolean).join("-")}function F6e(e,t){return`var(${rH(e)}${t?`, ${t}`:""})`}function B6e(e,t=""){return`--${L6e(e,t)}`}function hr(e,t){const n=B6e(e,t==null?void 0:t.prefix);return{variable:n,reference:F6e(n,z6e(t==null?void 0:t.fallback))}}function z6e(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:j6e,definePartsStyle:X1}=Pt(eH.keys),Yg=hr("switch-track-width"),bd=hr("switch-track-height"),l5=hr("switch-track-diff"),U6e=Al.subtract(Yg,bd),yT=hr("switch-thumb-x"),sg=hr("switch-bg"),V6e=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Yg.reference],height:[bd.reference],transitionProperty:"common",transitionDuration:"fast",[sg.variable]:"colors.gray.300",_dark:{[sg.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[sg.variable]:`colors.${t}.500`,_dark:{[sg.variable]:`colors.${t}.200`}},bg:sg.reference}},G6e={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[bd.reference],height:[bd.reference],_checked:{transform:`translateX(${yT.reference})`}},q6e=X1(e=>({container:{[l5.variable]:U6e,[yT.variable]:l5.reference,_rtl:{[yT.variable]:Al(l5).negate().toString()}},track:V6e(e),thumb:G6e})),H6e={sm:X1({container:{[Yg.variable]:"1.375rem",[bd.variable]:"sizes.3"}}),md:X1({container:{[Yg.variable]:"1.875rem",[bd.variable]:"sizes.4"}}),lg:X1({container:{[Yg.variable]:"2.875rem",[bd.variable]:"sizes.6"}})},W6e=j6e({baseStyle:q6e,sizes:H6e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:K6e,definePartsStyle:xh}=Pt(u6e.keys),Q6e=xh({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),W_={"&[data-is-numeric=true]":{textAlign:"end"}},X6e=xh(e=>{const{colorScheme:t}=e;return{th:{color:K("gray.600","gray.400")(e),borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},td:{borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},caption:{color:K("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Y6e=xh(e=>{const{colorScheme:t}=e;return{th:{color:K("gray.600","gray.400")(e),borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},td:{borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},caption:{color:K("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e)},td:{background:K(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Z6e={simple:X6e,striped:Y6e,unstyled:{}},J6e={sm:xh({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:xh({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:xh({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},e8e=K6e({baseStyle:Q6e,variants:Z6e,sizes:J6e,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),So=nt("tabs-color"),Ya=nt("tabs-bg"),Xv=nt("tabs-border-color"),{defineMultiStyleConfig:t8e,definePartsStyle:Ks}=Pt(tH.keys),n8e=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},r8e=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},i8e=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},o8e={p:4},a8e=Ks(e=>({root:n8e(e),tab:r8e(e),tablist:i8e(e),tabpanel:o8e})),s8e={sm:Ks({tab:{py:1,px:4,fontSize:"sm"}}),md:Ks({tab:{fontSize:"md",py:2,px:4}}),lg:Ks({tab:{fontSize:"lg",py:3,px:4}})},l8e=Ks(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=r?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[So.variable]:`colors.${t}.600`,_dark:{[So.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Ya.variable]:"colors.gray.200",_dark:{[Ya.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:So.reference,bg:Ya.reference}}}),u8e=Ks(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Xv.variable]:"transparent",_selected:{[So.variable]:`colors.${t}.600`,[Xv.variable]:"colors.white",_dark:{[So.variable]:`colors.${t}.300`,[Xv.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Xv.reference},color:So.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),c8e=Ks(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Ya.variable]:"colors.gray.50",_dark:{[Ya.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Ya.variable]:"colors.white",[So.variable]:`colors.${t}.600`,_dark:{[Ya.variable]:"colors.gray.800",[So.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:So.reference,bg:Ya.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),d8e=Ks(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ro(n,`${t}.700`),bg:ro(n,`${t}.100`)}}}}),f8e=Ks(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[So.variable]:"colors.gray.600",_dark:{[So.variable]:"inherit"},_selected:{[So.variable]:"colors.white",[Ya.variable]:`colors.${t}.600`,_dark:{[So.variable]:"colors.gray.800",[Ya.variable]:`colors.${t}.300`}},color:So.reference,bg:Ya.reference}}}),h8e=Ks({}),p8e={line:l8e,enclosed:u8e,"enclosed-colored":c8e,"soft-rounded":d8e,"solid-rounded":f8e,unstyled:h8e},g8e=t8e({baseStyle:a8e,sizes:s8e,variants:p8e,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Tr=YAe("badge",["bg","color","shadow"]),m8e={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Tr.bg.reference,color:Tr.color.reference,boxShadow:Tr.shadow.reference},y8e=e=>{const{colorScheme:t,theme:n}=e,r=sp(`${t}.500`,.6)(n);return{[Tr.bg.variable]:`colors.${t}.500`,[Tr.color.variable]:"colors.white",_dark:{[Tr.bg.variable]:r,[Tr.color.variable]:"colors.whiteAlpha.800"}}},v8e=e=>{const{colorScheme:t,theme:n}=e,r=sp(`${t}.200`,.16)(n);return{[Tr.bg.variable]:`colors.${t}.100`,[Tr.color.variable]:`colors.${t}.800`,_dark:{[Tr.bg.variable]:r,[Tr.color.variable]:`colors.${t}.200`}}},b8e=e=>{const{colorScheme:t,theme:n}=e,r=sp(`${t}.200`,.8)(n);return{[Tr.color.variable]:`colors.${t}.500`,_dark:{[Tr.color.variable]:r},[Tr.shadow.variable]:`inset 0 0 0px 1px ${Tr.color.reference}`}},_8e={solid:y8e,subtle:v8e,outline:b8e},Zg={baseStyle:m8e,variants:_8e,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:S8e,definePartsStyle:_d}=Pt(c6e.keys),wM=nt("tag-bg"),CM=nt("tag-color"),u5=nt("tag-shadow"),Y1=nt("tag-min-height"),Z1=nt("tag-min-width"),J1=nt("tag-font-size"),eb=nt("tag-padding-inline"),x8e={fontWeight:"medium",lineHeight:1.2,outline:0,[CM.variable]:Tr.color.reference,[wM.variable]:Tr.bg.reference,[u5.variable]:Tr.shadow.reference,color:CM.reference,bg:wM.reference,boxShadow:u5.reference,borderRadius:"md",minH:Y1.reference,minW:Z1.reference,fontSize:J1.reference,px:eb.reference,_focusVisible:{[u5.variable]:"shadows.outline"}},w8e={lineHeight:1.2,overflow:"visible"},C8e={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},E8e=_d({container:x8e,label:w8e,closeButton:C8e}),T8e={sm:_d({container:{[Y1.variable]:"sizes.5",[Z1.variable]:"sizes.5",[J1.variable]:"fontSizes.xs",[eb.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:_d({container:{[Y1.variable]:"sizes.6",[Z1.variable]:"sizes.6",[J1.variable]:"fontSizes.sm",[eb.variable]:"space.2"}}),lg:_d({container:{[Y1.variable]:"sizes.8",[Z1.variable]:"sizes.8",[J1.variable]:"fontSizes.md",[eb.variable]:"space.3"}})},k8e={subtle:_d(e=>{var t;return{container:(t=Zg.variants)==null?void 0:t.subtle(e)}}),solid:_d(e=>{var t;return{container:(t=Zg.variants)==null?void 0:t.solid(e)}}),outline:_d(e=>{var t;return{container:(t=Zg.variants)==null?void 0:t.outline(e)}})},A8e=S8e({variants:k8e,baseStyle:E8e,sizes:T8e,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Ol,defineMultiStyleConfig:P8e}=Pt(Hq.keys),Gf=nt("input-height"),qf=nt("input-font-size"),Hf=nt("input-padding"),Wf=nt("input-border-radius"),I8e=Ol({addon:{height:Gf.reference,fontSize:qf.reference,px:Hf.reference,borderRadius:Wf.reference},field:{width:"100%",height:Gf.reference,fontSize:qf.reference,px:Hf.reference,borderRadius:Wf.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),pu={lg:{[qf.variable]:"fontSizes.lg",[Hf.variable]:"space.4",[Wf.variable]:"radii.md",[Gf.variable]:"sizes.12"},md:{[qf.variable]:"fontSizes.md",[Hf.variable]:"space.4",[Wf.variable]:"radii.md",[Gf.variable]:"sizes.10"},sm:{[qf.variable]:"fontSizes.sm",[Hf.variable]:"space.3",[Wf.variable]:"radii.sm",[Gf.variable]:"sizes.8"},xs:{[qf.variable]:"fontSizes.xs",[Hf.variable]:"space.2",[Wf.variable]:"radii.sm",[Gf.variable]:"sizes.6"}},R8e={lg:Ol({field:pu.lg,group:pu.lg}),md:Ol({field:pu.md,group:pu.md}),sm:Ol({field:pu.sm,group:pu.sm}),xs:Ol({field:pu.xs,group:pu.xs})};function JA(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||K("blue.500","blue.300")(e),errorBorderColor:n||K("red.500","red.300")(e)}}var O8e=Ol(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=JA(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:K("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ro(t,r),boxShadow:`0 0 0 1px ${ro(t,r)}`},_focusVisible:{zIndex:1,borderColor:ro(t,n),boxShadow:`0 0 0 1px ${ro(t,n)}`}},addon:{border:"1px solid",borderColor:K("inherit","whiteAlpha.50")(e),bg:K("gray.100","whiteAlpha.300")(e)}}}),M8e=Ol(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=JA(e);return{field:{border:"2px solid",borderColor:"transparent",bg:K("gray.100","whiteAlpha.50")(e),_hover:{bg:K("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ro(t,r)},_focusVisible:{bg:"transparent",borderColor:ro(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:K("gray.100","whiteAlpha.50")(e)}}}),N8e=Ol(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=JA(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ro(t,r),boxShadow:`0px 1px 0px 0px ${ro(t,r)}`},_focusVisible:{borderColor:ro(t,n),boxShadow:`0px 1px 0px 0px ${ro(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),$8e=Ol({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),D8e={outline:O8e,filled:M8e,flushed:N8e,unstyled:$8e},cn=P8e({baseStyle:I8e,sizes:R8e,variants:D8e,defaultProps:{size:"md",variant:"outline"}}),EM,L8e={...(EM=cn.baseStyle)==null?void 0:EM.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},TM,kM,F8e={outline:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(kM=(TM=cn.variants)==null?void 0:TM.unstyled.field)!=null?kM:{}},AM,PM,IM,RM,OM,MM,NM,$M,B8e={xs:(PM=(AM=cn.sizes)==null?void 0:AM.xs.field)!=null?PM:{},sm:(RM=(IM=cn.sizes)==null?void 0:IM.sm.field)!=null?RM:{},md:(MM=(OM=cn.sizes)==null?void 0:OM.md.field)!=null?MM:{},lg:($M=(NM=cn.sizes)==null?void 0:NM.lg.field)!=null?$M:{}},z8e={baseStyle:L8e,sizes:B8e,variants:F8e,defaultProps:{size:"md",variant:"outline"}},Yv=hr("tooltip-bg"),c5=hr("tooltip-fg"),j8e=hr("popper-arrow-bg"),U8e={bg:Yv.reference,color:c5.reference,[Yv.variable]:"colors.gray.700",[c5.variable]:"colors.whiteAlpha.900",_dark:{[Yv.variable]:"colors.gray.300",[c5.variable]:"colors.gray.900"},[j8e.variable]:Yv.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},V8e={baseStyle:U8e},{defineMultiStyleConfig:G8e,definePartsStyle:Ig}=Pt(Yq.keys),q8e=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=K(vM(),vM("1rem","rgba(0,0,0,0.1)"))(e),a=K(`${t}.500`,`${t}.200`)(e),s=`linear-gradient(
-    to right,
-    transparent 0%,
-    ${ro(n,a)} 50%,
-    transparent 100%
-  )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},H8e={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},W8e=e=>({bg:K("gray.100","whiteAlpha.300")(e)}),K8e=e=>({transitionProperty:"common",transitionDuration:"slow",...q8e(e)}),Q8e=Ig(e=>({label:H8e,filledTrack:K8e(e),track:W8e(e)})),X8e={xs:Ig({track:{h:"1"}}),sm:Ig({track:{h:"2"}}),md:Ig({track:{h:"3"}}),lg:Ig({track:{h:"4"}})},Y8e=G8e({sizes:X8e,baseStyle:Q8e,defaultProps:{size:"md",colorScheme:"blue"}}),Z8e=e=>typeof e=="function";function oo(e,...t){return Z8e(e)?e(...t):e}var{definePartsStyle:tb,defineMultiStyleConfig:J8e}=Pt(Gq.keys),Jg=nt("checkbox-size"),eIe=e=>{const{colorScheme:t}=e;return{w:Jg.reference,h:Jg.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:K(`${t}.500`,`${t}.200`)(e),borderColor:K(`${t}.500`,`${t}.200`)(e),color:K("white","gray.900")(e),_hover:{bg:K(`${t}.600`,`${t}.300`)(e),borderColor:K(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:K("gray.200","transparent")(e),bg:K("gray.200","whiteAlpha.300")(e),color:K("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:K(`${t}.500`,`${t}.200`)(e),borderColor:K(`${t}.500`,`${t}.200`)(e),color:K("white","gray.900")(e)},_disabled:{bg:K("gray.100","whiteAlpha.100")(e),borderColor:K("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:K("red.500","red.300")(e)}}},tIe={_disabled:{cursor:"not-allowed"}},nIe={userSelect:"none",_disabled:{opacity:.4}},rIe={transitionProperty:"transform",transitionDuration:"normal"},iIe=tb(e=>({icon:rIe,container:tIe,control:oo(eIe,e),label:nIe})),oIe={sm:tb({control:{[Jg.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:tb({control:{[Jg.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:tb({control:{[Jg.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},K_=J8e({baseStyle:iIe,sizes:oIe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:aIe,definePartsStyle:nb}=Pt(s6e.keys),sIe=e=>{var t;const n=(t=oo(K_.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},lIe=nb(e=>{var t,n,r,i;return{label:(n=(t=K_).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=K_).baseStyle)==null?void 0:i.call(r,e).container,control:sIe(e)}}),uIe={md:nb({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:nb({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:nb({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},cIe=aIe({baseStyle:lIe,sizes:uIe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:dIe,definePartsStyle:fIe}=Pt(Zq.keys),Zv=nt("select-bg"),DM,hIe={...(DM=cn.baseStyle)==null?void 0:DM.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Zv.reference,[Zv.variable]:"colors.white",_dark:{[Zv.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Zv.reference}},pIe={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},gIe=fIe({field:hIe,icon:pIe}),Jv={paddingInlineEnd:"8"},LM,FM,BM,zM,jM,UM,VM,GM,mIe={lg:{...(LM=cn.sizes)==null?void 0:LM.lg,field:{...(FM=cn.sizes)==null?void 0:FM.lg.field,...Jv}},md:{...(BM=cn.sizes)==null?void 0:BM.md,field:{...(zM=cn.sizes)==null?void 0:zM.md.field,...Jv}},sm:{...(jM=cn.sizes)==null?void 0:jM.sm,field:{...(UM=cn.sizes)==null?void 0:UM.sm.field,...Jv}},xs:{...(VM=cn.sizes)==null?void 0:VM.xs,field:{...(GM=cn.sizes)==null?void 0:GM.xs.field,...Jv},icon:{insetEnd:"1"}}},yIe=dIe({baseStyle:gIe,sizes:mIe,variants:cn.variants,defaultProps:cn.defaultProps}),d5=nt("skeleton-start-color"),f5=nt("skeleton-end-color"),vIe={[d5.variable]:"colors.gray.100",[f5.variable]:"colors.gray.400",_dark:{[d5.variable]:"colors.gray.800",[f5.variable]:"colors.gray.600"},background:d5.reference,borderColor:f5.reference,opacity:.7,borderRadius:"sm"},bIe={baseStyle:vIe},h5=nt("skip-link-bg"),_Ie={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[h5.variable]:"colors.white",_dark:{[h5.variable]:"colors.gray.700"},bg:h5.reference}},SIe={baseStyle:_Ie},{defineMultiStyleConfig:xIe,definePartsStyle:sw}=Pt(Jq.keys),A0=nt("slider-thumb-size"),P0=nt("slider-track-size"),Pu=nt("slider-bg"),wIe=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...ZA({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},CIe=e=>({...ZA({orientation:e.orientation,horizontal:{h:P0.reference},vertical:{w:P0.reference}}),overflow:"hidden",borderRadius:"sm",[Pu.variable]:"colors.gray.200",_dark:{[Pu.variable]:"colors.whiteAlpha.200"},_disabled:{[Pu.variable]:"colors.gray.300",_dark:{[Pu.variable]:"colors.whiteAlpha.300"}},bg:Pu.reference}),EIe=e=>{const{orientation:t}=e;return{...ZA({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:A0.reference,h:A0.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},TIe=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[Pu.variable]:`colors.${t}.500`,_dark:{[Pu.variable]:`colors.${t}.200`},bg:Pu.reference}},kIe=sw(e=>({container:wIe(e),track:CIe(e),thumb:EIe(e),filledTrack:TIe(e)})),AIe=sw({container:{[A0.variable]:"sizes.4",[P0.variable]:"sizes.1"}}),PIe=sw({container:{[A0.variable]:"sizes.3.5",[P0.variable]:"sizes.1"}}),IIe=sw({container:{[A0.variable]:"sizes.2.5",[P0.variable]:"sizes.0.5"}}),RIe={lg:AIe,md:PIe,sm:IIe},OIe=xIe({baseStyle:kIe,sizes:RIe,defaultProps:{size:"md",colorScheme:"blue"}}),Yc=hr("spinner-size"),MIe={width:[Yc.reference],height:[Yc.reference]},NIe={xs:{[Yc.variable]:"sizes.3"},sm:{[Yc.variable]:"sizes.4"},md:{[Yc.variable]:"sizes.6"},lg:{[Yc.variable]:"sizes.8"},xl:{[Yc.variable]:"sizes.12"}},$Ie={baseStyle:MIe,sizes:NIe,defaultProps:{size:"md"}},{defineMultiStyleConfig:DIe,definePartsStyle:iH}=Pt(l6e.keys),LIe={fontWeight:"medium"},FIe={opacity:.8,marginBottom:"2"},BIe={verticalAlign:"baseline",fontWeight:"semibold"},zIe={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},jIe=iH({container:{},label:LIe,helpText:FIe,number:BIe,icon:zIe}),UIe={md:iH({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},VIe=DIe({baseStyle:jIe,sizes:UIe,defaultProps:{size:"md"}}),p5=nt("kbd-bg"),GIe={[p5.variable]:"colors.gray.100",_dark:{[p5.variable]:"colors.whiteAlpha.100"},bg:p5.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},qIe={baseStyle:GIe},HIe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},WIe={baseStyle:HIe},{defineMultiStyleConfig:KIe,definePartsStyle:QIe}=Pt(a6e.keys),XIe={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},YIe=QIe({icon:XIe}),ZIe=KIe({baseStyle:YIe}),{defineMultiStyleConfig:JIe,definePartsStyle:eRe}=Pt(Wq.keys),Es=nt("menu-bg"),g5=nt("menu-shadow"),tRe={[Es.variable]:"#fff",[g5.variable]:"shadows.sm",_dark:{[Es.variable]:"colors.gray.700",[g5.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Es.reference,boxShadow:g5.reference},nRe={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Es.variable]:"colors.gray.100",_dark:{[Es.variable]:"colors.whiteAlpha.100"}},_active:{[Es.variable]:"colors.gray.200",_dark:{[Es.variable]:"colors.whiteAlpha.200"}},_expanded:{[Es.variable]:"colors.gray.100",_dark:{[Es.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Es.reference},rRe={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},iRe={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},oRe={opacity:.6},aRe={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},sRe={transitionProperty:"common",transitionDuration:"normal"},lRe=eRe({button:sRe,list:tRe,item:nRe,groupTitle:rRe,icon:iRe,command:oRe,divider:aRe}),uRe=JIe({baseStyle:lRe}),{defineMultiStyleConfig:cRe,definePartsStyle:vT}=Pt(Kq.keys),m5=nt("modal-bg"),y5=nt("modal-shadow"),dRe={bg:"blackAlpha.600",zIndex:"modal"},fRe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},hRe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[m5.variable]:"colors.white",[y5.variable]:"shadows.lg",_dark:{[m5.variable]:"colors.gray.700",[y5.variable]:"shadows.dark-lg"},bg:m5.reference,boxShadow:y5.reference}},pRe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},gRe={position:"absolute",top:"2",insetEnd:"3"},mRe=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},yRe={px:"6",py:"4"},vRe=vT(e=>({overlay:dRe,dialogContainer:oo(fRe,e),dialog:oo(hRe,e),header:pRe,closeButton:gRe,body:oo(mRe,e),footer:yRe}));function za(e){return vT(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var bRe={xs:za("xs"),sm:za("sm"),md:za("md"),lg:za("lg"),xl:za("xl"),"2xl":za("2xl"),"3xl":za("3xl"),"4xl":za("4xl"),"5xl":za("5xl"),"6xl":za("6xl"),full:za("full")},_Re=cRe({baseStyle:vRe,sizes:bRe,defaultProps:{size:"md"}}),{defineMultiStyleConfig:SRe,definePartsStyle:oH}=Pt(Qq.keys),eP=hr("number-input-stepper-width"),aH=hr("number-input-input-padding"),xRe=Al(eP).add("0.5rem").toString(),v5=hr("number-input-bg"),b5=hr("number-input-color"),_5=hr("number-input-border-color"),wRe={[eP.variable]:"sizes.6",[aH.variable]:xRe},CRe=e=>{var t,n;return(n=(t=oo(cn.baseStyle,e))==null?void 0:t.field)!=null?n:{}},ERe={width:eP.reference},TRe={borderStart:"1px solid",borderStartColor:_5.reference,color:b5.reference,bg:v5.reference,[b5.variable]:"colors.chakra-body-text",[_5.variable]:"colors.chakra-border-color",_dark:{[b5.variable]:"colors.whiteAlpha.800",[_5.variable]:"colors.whiteAlpha.300"},_active:{[v5.variable]:"colors.gray.200",_dark:{[v5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},kRe=oH(e=>{var t;return{root:wRe,field:(t=oo(CRe,e))!=null?t:{},stepperGroup:ERe,stepper:TRe}});function e1(e){var t,n,r;const i=(t=cn.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=i.field)==null?void 0:n.fontSize)!=null?r:"md",s=zq.fontSizes[a];return oH({field:{...i.field,paddingInlineEnd:aH.reference,verticalAlign:"top"},stepper:{fontSize:Al(s).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var ARe={xs:e1("xs"),sm:e1("sm"),md:e1("md"),lg:e1("lg")},PRe=SRe({baseStyle:kRe,sizes:ARe,variants:cn.variants,defaultProps:cn.defaultProps}),qM,IRe={...(qM=cn.baseStyle)==null?void 0:qM.field,textAlign:"center"},RRe={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},HM,WM,ORe={outline:e=>{var t,n,r;return(r=(n=oo((t=cn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=oo((t=cn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=oo((t=cn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(WM=(HM=cn.variants)==null?void 0:HM.unstyled.field)!=null?WM:{}},MRe={baseStyle:IRe,sizes:RRe,variants:ORe,defaultProps:cn.defaultProps},{defineMultiStyleConfig:NRe,definePartsStyle:$Re}=Pt(Xq.keys),t1=hr("popper-bg"),DRe=hr("popper-arrow-bg"),KM=hr("popper-arrow-shadow-color"),LRe={zIndex:10},FRe={[t1.variable]:"colors.white",bg:t1.reference,[DRe.variable]:t1.reference,[KM.variable]:"colors.gray.200",_dark:{[t1.variable]:"colors.gray.700",[KM.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},BRe={px:3,py:2,borderBottomWidth:"1px"},zRe={px:3,py:2},jRe={px:3,py:2,borderTopWidth:"1px"},URe={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},VRe=$Re({popper:LRe,content:FRe,header:BRe,body:zRe,footer:jRe,closeButton:URe}),GRe=NRe({baseStyle:VRe}),{definePartsStyle:bT,defineMultiStyleConfig:qRe}=Pt(r6e.keys),S5=nt("drawer-bg"),x5=nt("drawer-box-shadow");function _f(e){return bT(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var HRe={bg:"blackAlpha.600",zIndex:"overlay"},WRe={display:"flex",zIndex:"modal",justifyContent:"center"},KRe=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[S5.variable]:"colors.white",[x5.variable]:"shadows.lg",_dark:{[S5.variable]:"colors.gray.700",[x5.variable]:"shadows.dark-lg"},bg:S5.reference,boxShadow:x5.reference}},QRe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},XRe={position:"absolute",top:"2",insetEnd:"3"},YRe={px:"6",py:"2",flex:"1",overflow:"auto"},ZRe={px:"6",py:"4"},JRe=bT(e=>({overlay:HRe,dialogContainer:WRe,dialog:oo(KRe,e),header:QRe,closeButton:XRe,body:YRe,footer:ZRe})),e9e={xs:_f("xs"),sm:_f("md"),md:_f("lg"),lg:_f("2xl"),xl:_f("4xl"),full:_f("full")},t9e=qRe({baseStyle:JRe,sizes:e9e,defaultProps:{size:"xs"}}),{definePartsStyle:n9e,defineMultiStyleConfig:r9e}=Pt(qq.keys),i9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},o9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},a9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},s9e=n9e({preview:i9e,input:o9e,textarea:a9e}),l9e=r9e({baseStyle:s9e}),{definePartsStyle:u9e,defineMultiStyleConfig:c9e}=Pt(i6e.keys),wh=nt("form-control-color"),d9e={marginStart:"1",[wh.variable]:"colors.red.500",_dark:{[wh.variable]:"colors.red.300"},color:wh.reference},f9e={mt:"2",[wh.variable]:"colors.gray.600",_dark:{[wh.variable]:"colors.whiteAlpha.600"},color:wh.reference,lineHeight:"normal",fontSize:"sm"},h9e=u9e({container:{width:"100%",position:"relative"},requiredIndicator:d9e,helperText:f9e}),p9e=c9e({baseStyle:h9e}),{definePartsStyle:g9e,defineMultiStyleConfig:m9e}=Pt(o6e.keys),Ch=nt("form-error-color"),y9e={[Ch.variable]:"colors.red.500",_dark:{[Ch.variable]:"colors.red.300"},color:Ch.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},v9e={marginEnd:"0.5em",[Ch.variable]:"colors.red.500",_dark:{[Ch.variable]:"colors.red.300"},color:Ch.reference},b9e=g9e({text:y9e,icon:v9e}),_9e=m9e({baseStyle:b9e}),S9e={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},x9e={baseStyle:S9e},w9e={fontFamily:"heading",fontWeight:"bold"},C9e={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},E9e={baseStyle:w9e,sizes:C9e,defaultProps:{size:"xl"}},{defineMultiStyleConfig:T9e,definePartsStyle:k9e}=Pt(n6e.keys),w5=nt("breadcrumb-link-decor"),A9e={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:w5.reference,[w5.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[w5.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},P9e=k9e({link:A9e}),I9e=T9e({baseStyle:P9e}),R9e={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},sH=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:K("gray.800","whiteAlpha.900")(e),_hover:{bg:K("gray.100","whiteAlpha.200")(e)},_active:{bg:K("gray.200","whiteAlpha.300")(e)}};const r=sp(`${t}.200`,.12)(n),i=sp(`${t}.200`,.24)(n);return{color:K(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:K(`${t}.50`,r)(e)},_active:{bg:K(`${t}.100`,i)(e)}}},O9e=e=>{const{colorScheme:t}=e,n=K("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...oo(sH,e)}},M9e={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},N9e=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=K("gray.100","whiteAlpha.200")(e);return{bg:l,color:K("gray.800","whiteAlpha.900")(e),_hover:{bg:K("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:K("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:i="white",hoverBg:o=`${n}.600`,activeBg:a=`${n}.700`}=(t=M9e[n])!=null?t:{},s=K(r,`${n}.200`)(e);return{bg:s,color:K(i,"gray.800")(e),_hover:{bg:K(o,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:K(a,`${n}.400`)(e)}}},$9e=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:K(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:K(`${t}.700`,`${t}.500`)(e)}}},D9e={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},L9e={ghost:sH,outline:O9e,solid:N9e,link:$9e,unstyled:D9e},F9e={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},B9e={baseStyle:R9e,variants:L9e,sizes:F9e,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Sd,defineMultiStyleConfig:z9e}=Pt(d6e.keys),Q_=nt("card-bg"),Ll=nt("card-padding"),lH=nt("card-shadow"),rb=nt("card-radius"),uH=nt("card-border-width","0"),cH=nt("card-border-color"),j9e=Sd({container:{[Q_.variable]:"colors.chakra-body-bg",backgroundColor:Q_.reference,boxShadow:lH.reference,borderRadius:rb.reference,color:"chakra-body-text",borderWidth:uH.reference,borderColor:cH.reference},body:{padding:Ll.reference,flex:"1 1 0%"},header:{padding:Ll.reference},footer:{padding:Ll.reference}}),U9e={sm:Sd({container:{[rb.variable]:"radii.base",[Ll.variable]:"space.3"}}),md:Sd({container:{[rb.variable]:"radii.md",[Ll.variable]:"space.5"}}),lg:Sd({container:{[rb.variable]:"radii.xl",[Ll.variable]:"space.7"}})},V9e={elevated:Sd({container:{[lH.variable]:"shadows.base",_dark:{[Q_.variable]:"colors.gray.700"}}}),outline:Sd({container:{[uH.variable]:"1px",[cH.variable]:"colors.chakra-border-color"}}),filled:Sd({container:{[Q_.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Ll.variable]:0},header:{[Ll.variable]:0},footer:{[Ll.variable]:0}}},G9e=z9e({baseStyle:j9e,variants:V9e,sizes:U9e,defaultProps:{variant:"elevated",size:"md"}}),em=hr("close-button-size"),lg=hr("close-button-bg"),q9e={w:[em.reference],h:[em.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[lg.variable]:"colors.blackAlpha.100",_dark:{[lg.variable]:"colors.whiteAlpha.100"}},_active:{[lg.variable]:"colors.blackAlpha.200",_dark:{[lg.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:lg.reference},H9e={lg:{[em.variable]:"sizes.10",fontSize:"md"},md:{[em.variable]:"sizes.8",fontSize:"xs"},sm:{[em.variable]:"sizes.6",fontSize:"2xs"}},W9e={baseStyle:q9e,sizes:H9e,defaultProps:{size:"md"}},{variants:K9e,defaultProps:Q9e}=Zg,X9e={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Tr.bg.reference,color:Tr.color.reference,boxShadow:Tr.shadow.reference},Y9e={baseStyle:X9e,variants:K9e,defaultProps:Q9e},Z9e={w:"100%",mx:"auto",maxW:"prose",px:"4"},J9e={baseStyle:Z9e},eOe={opacity:.6,borderColor:"inherit"},tOe={borderStyle:"solid"},nOe={borderStyle:"dashed"},rOe={solid:tOe,dashed:nOe},iOe={baseStyle:eOe,variants:rOe,defaultProps:{variant:"solid"}},{definePartsStyle:oOe,defineMultiStyleConfig:aOe}=Pt(Vq.keys),sOe={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},lOe={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},uOe={pt:"2",px:"4",pb:"5"},cOe={fontSize:"1.25em"},dOe=oOe({container:sOe,button:lOe,panel:uOe,icon:cOe}),fOe=aOe({baseStyle:dOe}),{definePartsStyle:Oy,defineMultiStyleConfig:hOe}=Pt(e6e.keys),Xo=nt("alert-fg"),Ql=nt("alert-bg"),pOe=Oy({container:{bg:Ql.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Xo.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Xo.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function tP(e){const{theme:t,colorScheme:n}=e,r=sp(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var gOe=Oy(e=>{const{colorScheme:t}=e,n=tP(e);return{container:{[Xo.variable]:`colors.${t}.500`,[Ql.variable]:n.light,_dark:{[Xo.variable]:`colors.${t}.200`,[Ql.variable]:n.dark}}}}),mOe=Oy(e=>{const{colorScheme:t}=e,n=tP(e);return{container:{[Xo.variable]:`colors.${t}.500`,[Ql.variable]:n.light,_dark:{[Xo.variable]:`colors.${t}.200`,[Ql.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Xo.reference}}}),yOe=Oy(e=>{const{colorScheme:t}=e,n=tP(e);return{container:{[Xo.variable]:`colors.${t}.500`,[Ql.variable]:n.light,_dark:{[Xo.variable]:`colors.${t}.200`,[Ql.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Xo.reference}}}),vOe=Oy(e=>{const{colorScheme:t}=e;return{container:{[Xo.variable]:"colors.white",[Ql.variable]:`colors.${t}.500`,_dark:{[Xo.variable]:"colors.gray.900",[Ql.variable]:`colors.${t}.200`},color:Xo.reference}}}),bOe={subtle:gOe,"left-accent":mOe,"top-accent":yOe,solid:vOe},_Oe=hOe({baseStyle:pOe,variants:bOe,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:dH,defineMultiStyleConfig:SOe}=Pt(t6e.keys),Eh=nt("avatar-border-color"),tm=nt("avatar-bg"),I0=nt("avatar-font-size"),lp=nt("avatar-size"),xOe={borderRadius:"full",border:"0.2em solid",borderColor:Eh.reference,[Eh.variable]:"white",_dark:{[Eh.variable]:"colors.gray.800"}},wOe={bg:tm.reference,fontSize:I0.reference,width:lp.reference,height:lp.reference,lineHeight:"1",[tm.variable]:"colors.gray.200",_dark:{[tm.variable]:"colors.whiteAlpha.400"}},COe=e=>{const{name:t,theme:n}=e,r=t?R6e({string:t}):"colors.gray.400",i=P6e(r)(n);let o="white";return i||(o="gray.800"),{bg:tm.reference,fontSize:I0.reference,color:o,borderColor:Eh.reference,verticalAlign:"top",width:lp.reference,height:lp.reference,"&:not([data-loaded])":{[tm.variable]:r},[Eh.variable]:"colors.white",_dark:{[Eh.variable]:"colors.gray.800"}}},EOe={fontSize:I0.reference,lineHeight:"1"},TOe=dH(e=>({badge:oo(xOe,e),excessLabel:oo(wOe,e),container:oo(COe,e),label:EOe}));function gu(e){const t=e!=="100%"?Uq[e]:void 0;return dH({container:{[lp.variable]:t??e,[I0.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[lp.variable]:t??e,[I0.variable]:`calc(${t??e} / 2.5)`}})}var kOe={"2xs":gu(4),xs:gu(6),sm:gu(8),md:gu(12),lg:gu(16),xl:gu(24),"2xl":gu(32),full:gu("100%")},AOe=SOe({baseStyle:TOe,sizes:kOe,defaultProps:{size:"md"}}),POe={Accordion:fOe,Alert:_Oe,Avatar:AOe,Badge:Zg,Breadcrumb:I9e,Button:B9e,Checkbox:K_,CloseButton:W9e,Code:Y9e,Container:J9e,Divider:iOe,Drawer:t9e,Editable:l9e,Form:p9e,FormError:_9e,FormLabel:x9e,Heading:E9e,Input:cn,Kbd:qIe,Link:WIe,List:ZIe,Menu:uRe,Modal:_Re,NumberInput:PRe,PinInput:MRe,Popover:GRe,Progress:Y8e,Radio:cIe,Select:yIe,Skeleton:bIe,SkipLink:SIe,Slider:OIe,Spinner:$Ie,Stat:VIe,Switch:W6e,Table:e8e,Tabs:g8e,Tag:A8e,Textarea:z8e,Tooltip:V8e,Card:G9e,Stepper:JPe},IOe={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},ROe={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},OOe="ltr",MOe={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},NOe={semanticTokens:IOe,direction:OOe,...XPe,components:POe,styles:ROe,config:MOe},$Oe=NOe;function DOe(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function LOe(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var FOe=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},fH=FOe(LOe);function hH(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var pH=e=>hH(e,t=>t!=null);function BOe(e){return typeof e=="function"}function gH(e,...t){return BOe(e)?e(...t):e}function QKe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var zOe=typeof Element<"u",jOe=typeof Map=="function",UOe=typeof Set=="function",VOe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ib(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ib(e[r],t[r]))return!1;return!0}var o;if(jOe&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!ib(r.value[1],t.get(r.value[0])))return!1;return!0}if(UOe&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(VOe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(zOe&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!ib(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var GOe=function(t,n){try{return ib(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const qOe=mc(GOe);function mH(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:a}=oAe(),s=e?fH(o,`components.${e}`):void 0,l=r||s,u=Fs({theme:o,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},pH(DOe(i,["children"]))),c=I.useRef({});if(l){const f=TPe(l)(u);qOe(c.current,f)||(c.current=f)}return c.current}function My(e,t={}){return mH(e,t)}function HOe(e,t={}){return mH(e,t)}var WOe=new Set([...pPe,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),KOe=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function QOe(e){return KOe.has(e)||!WOe.has(e)}function XOe(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i in n&&delete n[i],n[i]=r[i]);return n}function YOe(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var ZOe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,JOe=xq(function(e){return ZOe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),eMe=JOe,tMe=function(t){return t!=="theme"},QM=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?eMe:tMe},XM=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},nMe=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Cq(n,r,i),Gke(function(){return Eq(n,r,i)}),null},rMe=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=XM(t,n,r),l=s||QM(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var p=Pq(function(m,_,b){var y=u&&m.as||i,g="",v=[],S=m;if(m.theme==null){S={};for(var w in m)S[w]=m[w];S.theme=I.useContext(T0)}typeof m.className=="string"?g=Lke(_.registered,v,m.className):m.className!=null&&(g=m.className+" ");var x=qA(d.concat(v),_.registered,S);g+=_.key+"-"+x.name,a!==void 0&&(g+=" "+a);var C=u&&s===void 0?QM(y):l,k={};for(var T in m)u&&T==="as"||C(T)&&(k[T]=m[T]);return k.className=g,k.ref=b,I.createElement(I.Fragment,null,I.createElement(nMe,{cache:_,serialized:x,isStringTag:typeof y=="string"}),I.createElement(y,k))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=d,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return"."+a}}),p.withComponent=function(m,_){return e(m,x_({},n,_,{shouldForwardProp:XM(p,_,!0)})).apply(void 0,d)},p}},iMe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],X_=rMe.bind();iMe.forEach(function(e){X_[e]=X_(e)});var YM,oMe=(YM=X_.default)!=null?YM:X_,aMe=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=hH(a,(d,f)=>mPe(f)),l=gH(e,t),u=XOe({},i,l,pH(s),o),c=Bq(u)(t.theme);return r?[c,r]:c};function C5(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=QOe);const i=aMe({baseStyle:n}),o=oMe(e,r)(i);return Tn.forwardRef(function(l,u){const{colorMode:c,forced:d}=rw();return Tn.createElement(o,{ref:u,"data-theme":d?c:void 0,...l})})}function sMe(){const e=new Map;return new Proxy(C5,{apply(t,n,r){return C5(...r)},get(t,n){return e.has(n)||e.set(n,C5(n)),e.get(n)}})}var Oi=sMe();function ia(e){return I.forwardRef(e)}function lMe(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=I.createContext(void 0);i.displayName=r;function o(){var a;const s=I.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}function uMe(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=I.useMemo(()=>fPe(n),[n]);return W.jsxs(Wke,{theme:i,children:[W.jsx(cMe,{root:t}),r]})}function cMe({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return W.jsx(Iq,{styles:n=>({[t]:n.__cssVars})})}lMe({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` "});function XKe(){const{colorMode:e}=rw();return W.jsx(Iq,{styles:t=>{const n=fH(t,"styles.global"),r=gH(n,{theme:t,colorMode:e});return r?Bq(r)(t):void 0}})}var dMe=(e,t)=>e.find(n=>n.id===t);function ZM(e,t){const n=yH(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function yH(e,t){for(const[n,r]of Object.entries(e))if(dMe(r,t))return n}function fMe(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function hMe(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}function pMe(e,t=[]){const n=I.useRef(e);return I.useEffect(()=>{n.current=e}),I.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function gMe(e,t){const n=pMe(e);I.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function JM(e,t){const n=I.useRef(!1),r=I.useRef(!1);I.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),I.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const vH=I.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),lw=I.createContext({}),Ny=I.createContext(null),uw=typeof document<"u",nP=uw?I.useLayoutEffect:I.useEffect,bH=I.createContext({strict:!1});function mMe(e,t,n,r){const{visualElement:i}=I.useContext(lw),o=I.useContext(bH),a=I.useContext(Ny),s=I.useContext(vH).reducedMotion,l=I.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;I.useInsertionEffect(()=>{u&&u.update(n,a)});const c=I.useRef(!!window.HandoffAppearAnimations);return nP(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),I.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function Kf(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function yMe(e,t,n){return I.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Kf(n)&&(n.current=r))},[t])}function R0(e){return typeof e=="string"||Array.isArray(e)}function cw(e){return typeof e=="object"&&typeof e.start=="function"}const rP=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],iP=["initial",...rP];function dw(e){return cw(e.animate)||iP.some(t=>R0(e[t]))}function _H(e){return!!(dw(e)||e.variants)}function vMe(e,t){if(dw(e)){const{initial:n,animate:r}=e;return{initial:n===!1||R0(n)?n:void 0,animate:R0(r)?r:void 0}}return e.inherit!==!1?t:{}}function bMe(e){const{initial:t,animate:n}=vMe(e,I.useContext(lw));return I.useMemo(()=>({initial:t,animate:n}),[e7(t),e7(n)])}function e7(e){return Array.isArray(e)?e.join(" "):e}const t7={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},O0={};for(const e in t7)O0[e]={isEnabled:t=>t7[e].some(n=>!!t[n])};function _Me(e){for(const t in e)O0[t]={...O0[t],...e[t]}}const oP=I.createContext({}),SH=I.createContext({}),SMe=Symbol.for("motionComponentSymbol");function xMe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&_Me(e);function o(s,l){let u;const c={...I.useContext(vH),...s,layoutId:wMe(s)},{isStatic:d}=c,f=bMe(s),h=r(s,d);if(!d&&uw){f.visualElement=mMe(i,h,c,t);const p=I.useContext(SH),m=I.useContext(bH).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,m,e,p))}return I.createElement(lw.Provider,{value:f},u&&f.visualElement?I.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,s,yMe(h,f.visualElement,l),h,d,f.visualElement))}const a=I.forwardRef(o);return a[SMe]=i,a}function wMe({layoutId:e}){const t=I.useContext(oP).id;return t&&e!==void 0?t+"-"+e:e}function CMe(e){function t(r,i={}){return xMe(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const EMe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function aP(e){return typeof e!="string"||e.includes("-")?!1:!!(EMe.indexOf(e)>-1||/[A-Z]/.test(e))}const Y_={};function TMe(e){Object.assign(Y_,e)}const $y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jd=new Set($y);function xH(e,{layout:t,layoutId:n}){return Jd.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Y_[e]||e==="opacity")}const No=e=>!!(e&&e.getVelocity),kMe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},AMe=$y.length;function PMe(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;a<AMe;a++){const s=$y[a];if(e[s]!==void 0){const l=kMe[s]||s;o+=`${l}(${e[s]}) `}}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}const wH=e=>t=>typeof t=="string"&&t.startsWith(e),CH=wH("--"),_T=wH("var(--"),IMe=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,RMe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,pc=(e,t,n)=>Math.min(Math.max(n,e),t),ef={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},nm={...ef,transform:e=>pc(0,1,e)},n1={...ef,default:1},rm=e=>Math.round(e*1e5)/1e5,fw=/(-)?([\d]*\.?[\d])+/g,EH=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,OMe=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Dy(e){return typeof e=="string"}const Ly=e=>({test:t=>Dy(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),yu=Ly("deg"),Qs=Ly("%"),st=Ly("px"),MMe=Ly("vh"),NMe=Ly("vw"),n7={...Qs,parse:e=>Qs.parse(e)/100,transform:e=>Qs.transform(e*100)},r7={...ef,transform:Math.round},TH={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:yu,rotateX:yu,rotateY:yu,rotateZ:yu,scale:n1,scaleX:n1,scaleY:n1,scaleZ:n1,skew:yu,skewX:yu,skewY:yu,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:nm,originX:n7,originY:n7,originZ:st,zIndex:r7,fillOpacity:nm,strokeOpacity:nm,numOctaves:r7};function sP(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const d in t){const f=t[d];if(CH(d)){o[d]=f;continue}const h=TH[d],p=RMe(f,h);if(Jd.has(d)){if(l=!0,a[d]=p,!c)continue;f!==(h.default||0)&&(c=!1)}else d.startsWith("origin")?(u=!0,s[d]=p):i[d]=p}if(t.transform||(l||r?i.transform=PMe(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:h=0}=s;i.transformOrigin=`${d} ${f} ${h}`}}const lP=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function kH(e,t,n){for(const r in t)!No(t[r])&&!xH(r,n)&&(e[r]=t[r])}function $Me({transformTemplate:e},t,n){return I.useMemo(()=>{const r=lP();return sP(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function DMe(e,t,n){const r=e.style||{},i={};return kH(i,r,e),Object.assign(i,$Me(e,t,n)),e.transformValues?e.transformValues(i):i}function LMe(e,t,n){const r={},i=DMe(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const FMe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Z_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||FMe.has(e)}let AH=e=>!Z_(e);function BMe(e){e&&(AH=t=>t.startsWith("on")?!Z_(t):e(t))}try{BMe(require("@emotion/is-prop-valid").default)}catch{}function zMe(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(AH(i)||n===!0&&Z_(i)||!t&&!Z_(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function i7(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function jMe(e,t,n){const r=i7(t,e.x,e.width),i=i7(n,e.y,e.height);return`${r} ${i}`}const UMe={offset:"stroke-dashoffset",array:"stroke-dasharray"},VMe={offset:"strokeDashoffset",array:"strokeDasharray"};function GMe(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?UMe:VMe;e[o.offset]=st.transform(-r);const a=st.transform(t),s=st.transform(n);e[o.array]=`${a} ${s}`}function uP(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,d,f){if(sP(e,u,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=jMe(m,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&GMe(h,a,s,l,!1)}const PH=()=>({...lP(),attrs:{}}),cP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qMe(e,t,n,r){const i=I.useMemo(()=>{const o=PH();return uP(o,t,{enableHardwareAcceleration:!1},cP(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};kH(o,e.style,e),i.style={...o,...i.style}}return i}function HMe(e=!1){return(n,r,i,{latestValues:o},a)=>{const l=(aP(n)?qMe:LMe)(r,o,a,n),c={...zMe(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=I.useMemo(()=>No(d)?d.get():d,[d]);return I.createElement(n,{...c,children:f})}}const dP=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function IH(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const RH=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function OH(e,t,n,r){IH(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(RH.has(i)?i:dP(i),t.attrs[i])}function fP(e,t){const{style:n}=e,r={};for(const i in n)(No(n[i])||t.style&&No(t.style[i])||xH(i,e))&&(r[i]=n[i]);return r}function MH(e,t){const n=fP(e,t);for(const r in e)if(No(e[r])||No(t[r])){const i=$y.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function hP(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function NH(e){const t=I.useRef(null);return t.current===null&&(t.current=e()),t.current}const J_=e=>Array.isArray(e),WMe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),KMe=e=>J_(e)?e[e.length-1]||0:e;function ob(e){const t=No(e)?e.get():e;return WMe(t)?t.toValue():t}function QMe({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:XMe(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const $H=e=>(t,n)=>{const r=I.useContext(lw),i=I.useContext(Ny),o=()=>QMe(e,t,r,i);return n?o():NH(o)};function XMe(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=ob(o[f]);let{initial:a,animate:s}=e;const l=dw(e),u=_H(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const d=c?s:a;return d&&typeof d!="boolean"&&!cw(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const p=hP(e,h);if(!p)return;const{transitionEnd:m,transition:_,...b}=p;for(const y in b){let g=b[y];if(Array.isArray(g)){const v=c?g.length-1:0;g=g[v]}g!==null&&(i[y]=g)}for(const y in m)i[y]=m[y]}),i}const vr=e=>e;function YMe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const d=c&&i,f=d?t:n;return u&&a.add(l),f.indexOf(l)===-1&&(f.push(l),d&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u<r;u++){const c=t[u];c(l),a.has(c)&&(s.schedule(c),e())}i=!1,o&&(o=!1,s.process(l))}};return s}const r1=["prepare","read","update","preRender","render","postRender"],ZMe=40;function JMe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=r1.reduce((d,f)=>(d[f]=YMe(()=>n=!0),d),{}),a=d=>o[d].process(i),s=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,ZMe),1),i.timestamp=d,i.isProcessing=!0,r1.forEach(a),i.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,i.isProcessing||e(s)};return{schedule:r1.reduce((d,f)=>{const h=o[f];return d[f]=(p,m=!1,_=!1)=>(n||l(),h.schedule(p,m,_)),d},{}),cancel:d=>r1.forEach(f=>o[f].cancel(d)),state:i,steps:o}}const{schedule:Dn,cancel:Xl,state:ji,steps:E5}=JMe(typeof requestAnimationFrame<"u"?requestAnimationFrame:vr,!0),e7e={useVisualState:$H({scrapeMotionValuesFromProps:MH,createRenderState:PH,onMount:(e,t,{renderState:n,latestValues:r})=>{Dn.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Dn.render(()=>{uP(n,r,{enableHardwareAcceleration:!1},cP(t.tagName),e.transformTemplate),OH(t,n)})}})},t7e={useVisualState:$H({scrapeMotionValuesFromProps:fP,createRenderState:lP})};function n7e(e,{forwardMotionProps:t=!1},n,r){return{...aP(e)?e7e:t7e,preloadedFeatures:n,useRender:HMe(t),createVisualElement:r,Component:e}}function Ml(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const DH=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function hw(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const r7e=e=>t=>DH(t)&&e(t,hw(t));function Fl(e,t,n,r){return Ml(e,t,r7e(n),r)}const i7e=(e,t)=>n=>t(e(n)),Zu=(...e)=>e.reduce(i7e);function LH(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const o7=LH("dragHorizontal"),a7=LH("dragVertical");function FH(e){let t=!1;if(e==="y")t=a7();else if(e==="x")t=o7();else{const n=o7(),r=a7();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function BH(){const e=FH(!0);return e?(e(),!1):!0}class Oc{constructor(t){this.isMounted=!1,this.node=t}update(){}}function s7(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,a)=>{if(o.type==="touch"||BH())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&Dn.update(()=>s[r](o,a))};return Fl(e.current,n,i,{passive:!e.getProps()[r]})}class o7e extends Oc{mount(){this.unmount=Zu(s7(this.node,!0),s7(this.node,!1))}unmount(){}}class a7e extends Oc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Zu(Ml(this.node.current,"focus",()=>this.onFocus()),Ml(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const zH=(e,t)=>t?e===t?!0:zH(e,t.parentElement):!1;function T5(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,hw(n))}class s7e extends Oc{constructor(){super(...arguments),this.removeStartListeners=vr,this.removeEndListeners=vr,this.removeAccessibleListeners=vr,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Fl(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Dn.update(()=>{zH(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=Fl(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Zu(o,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||T5("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Dn.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Ml(this.node.current,"keyup",a),T5("down",(s,l)=>{this.startPress(s,l)})},n=Ml(this.node.current,"keydown",t),r=()=>{this.isPressing&&T5("cancel",(o,a)=>this.cancelPress(o,a))},i=Ml(this.node.current,"blur",r);this.removeAccessibleListeners=Zu(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Dn.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!BH()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Dn.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Fl(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ml(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Zu(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const ST=new WeakMap,k5=new WeakMap,l7e=e=>{const t=ST.get(e.target);t&&t(e)},u7e=e=>{e.forEach(l7e)};function c7e({root:e,...t}){const n=e||document;k5.has(n)||k5.set(n,{});const r=k5.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(u7e,{root:e,...t})),r[i]}function d7e(e,t,n){const r=c7e(t);return ST.set(e,n),r.observe(e),()=>{ST.delete(e),r.unobserve(e)}}const f7e={some:0,all:1};class h7e extends Oc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:f7e[i]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return d7e(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(p7e(t,n))&&this.startObserver()}unmount(){}}function p7e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const g7e={inView:{Feature:h7e},tap:{Feature:s7e},focus:{Feature:a7e},hover:{Feature:o7e}};function jH(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function m7e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function y7e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function pw(e,t,n){const r=e.getProps();return hP(r,t,n!==void 0?n:r.custom,m7e(e),y7e(e))}const v7e="framerAppearId",b7e="data-"+dP(v7e);let _7e=vr,pP=vr;const Ju=e=>e*1e3,Bl=e=>e/1e3,S7e={current:!1},UH=e=>Array.isArray(e)&&typeof e[0]=="number";function VH(e){return!!(!e||typeof e=="string"&&GH[e]||UH(e)||Array.isArray(e)&&e.every(VH))}const Rg=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,GH={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Rg([0,.65,.55,1]),circOut:Rg([.55,0,1,.45]),backIn:Rg([.31,.01,.66,-.59]),backOut:Rg([.33,1.53,.69,.99])};function qH(e){if(e)return UH(e)?Rg(e):Array.isArray(e)?e.map(qH):GH[e]}function x7e(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=qH(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}function w7e(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const HH=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,C7e=1e-7,E7e=12;function T7e(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=HH(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>C7e&&++s<E7e);return a}function Fy(e,t,n,r){if(e===t&&n===r)return vr;const i=o=>T7e(o,0,1,e,n);return o=>o===0||o===1?o:HH(i(o),t,r)}const k7e=Fy(.42,0,1,1),A7e=Fy(0,0,.58,1),WH=Fy(.42,0,.58,1),P7e=e=>Array.isArray(e)&&typeof e[0]!="number",KH=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,QH=e=>t=>1-e(1-t),XH=e=>1-Math.sin(Math.acos(e)),gP=QH(XH),I7e=KH(gP),YH=Fy(.33,1.53,.69,.99),mP=QH(YH),R7e=KH(mP),O7e=e=>(e*=2)<1?.5*mP(e):.5*(2-Math.pow(2,-10*(e-1))),M7e={linear:vr,easeIn:k7e,easeInOut:WH,easeOut:A7e,circIn:XH,circInOut:I7e,circOut:gP,backIn:mP,backInOut:R7e,backOut:YH,anticipate:O7e},l7=e=>{if(Array.isArray(e)){pP(e.length===4);const[t,n,r,i]=e;return Fy(t,n,r,i)}else if(typeof e=="string")return M7e[e];return e},yP=(e,t)=>n=>!!(Dy(n)&&OMe.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),ZH=(e,t,n)=>r=>{if(!Dy(r))return r;const[i,o,a,s]=r.match(fw);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},N7e=e=>pc(0,255,e),A5={...ef,transform:e=>Math.round(N7e(e))},ud={test:yP("rgb","red"),parse:ZH("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+A5.transform(e)+", "+A5.transform(t)+", "+A5.transform(n)+", "+rm(nm.transform(r))+")"};function $7e(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const xT={test:yP("#"),parse:$7e,transform:ud.transform},Qf={test:yP("hsl","hue"),parse:ZH("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Qs.transform(rm(t))+", "+Qs.transform(rm(n))+", "+rm(nm.transform(r))+")"},eo={test:e=>ud.test(e)||xT.test(e)||Qf.test(e),parse:e=>ud.test(e)?ud.parse(e):Qf.test(e)?Qf.parse(e):xT.parse(e),transform:e=>Dy(e)?e:e.hasOwnProperty("red")?ud.transform(e):Qf.transform(e)},ur=(e,t,n)=>-n*e+n*t+e;function P5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function D7e({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=P5(l,s,e+1/3),o=P5(l,s,e),a=P5(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const I5=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},L7e=[xT,ud,Qf],F7e=e=>L7e.find(t=>t.test(e));function u7(e){const t=F7e(e);let n=t.parse(e);return t===Qf&&(n=D7e(n)),n}const JH=(e,t)=>{const n=u7(e),r=u7(t),i={...n};return o=>(i.red=I5(n.red,r.red,o),i.green=I5(n.green,r.green,o),i.blue=I5(n.blue,r.blue,o),i.alpha=ur(n.alpha,r.alpha,o),ud.transform(i))};function B7e(e){var t,n;return isNaN(e)&&Dy(e)&&(((t=e.match(fw))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(EH))===null||n===void 0?void 0:n.length)||0)>0}const eW={regex:IMe,countKey:"Vars",token:"${v}",parse:vr},tW={regex:EH,countKey:"Colors",token:"${c}",parse:eo.parse},nW={regex:fw,countKey:"Numbers",token:"${n}",parse:ef.parse};function R5(e,{regex:t,countKey:n,token:r,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+n]=o.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...o.map(i)))}function eS(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&R5(n,eW),R5(n,tW),R5(n,nW),n}function rW(e){return eS(e).values}function iW(e){const{values:t,numColors:n,numVars:r,tokenised:i}=eS(e),o=t.length;return a=>{let s=i;for(let l=0;l<o;l++)l<r?s=s.replace(eW.token,a[l]):l<r+n?s=s.replace(tW.token,eo.transform(a[l])):s=s.replace(nW.token,rm(a[l]));return s}}const z7e=e=>typeof e=="number"?0:e;function j7e(e){const t=rW(e);return iW(e)(t.map(z7e))}const gc={test:B7e,parse:rW,createTransformer:iW,getAnimatableNone:j7e},oW=(e,t)=>n=>`${n>0?t:e}`;function aW(e,t){return typeof e=="number"?n=>ur(e,t,n):eo.test(e)?JH(e,t):e.startsWith("var(")?oW(e,t):lW(e,t)}const sW=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>aW(o,t[a]));return o=>{for(let a=0;a<r;a++)n[a]=i[a](o);return n}},U7e=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=aW(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},lW=(e,t)=>{const n=gc.createTransformer(t),r=eS(e),i=eS(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?Zu(sW(r.values,i.values),n):oW(e,t)},M0=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},c7=(e,t)=>n=>ur(e,t,n);function V7e(e){return typeof e=="number"?c7:typeof e=="string"?eo.test(e)?JH:lW:Array.isArray(e)?sW:typeof e=="object"?U7e:c7}function G7e(e,t,n){const r=[],i=n||V7e(e[0]),o=e.length-1;for(let a=0;a<o;a++){let s=i(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||vr:t;s=Zu(l,s)}r.push(s)}return r}function uW(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(pP(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=G7e(t,r,i),s=a.length,l=u=>{let c=0;if(s>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=M0(e[c],e[c+1],u);return a[c](d)};return n?u=>l(pc(e[0],e[o-1],u)):l}function q7e(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=M0(0,t,r);e.push(ur(n,1,i))}}function H7e(e){const t=[0];return q7e(t,e.length-1),t}function W7e(e,t){return e.map(n=>n*t)}function K7e(e,t){return e.map(()=>t||WH).splice(0,e.length-1)}function tS({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=P7e(r)?r.map(l7):l7(r),o={done:!1,value:t[0]},a=W7e(n&&n.length===t.length?n:H7e(t),e),s=uW(a,t,{ease:Array.isArray(i)?i:K7e(t,i)});return{calculatedDuration:e,next:l=>(o.value=s(l),o.done=l>=e,o)}}function cW(e,t){return t?e*(1e3/t):0}const Q7e=5;function dW(e,t,n){const r=Math.max(t-Q7e,0);return cW(n-e(r),t-r)}const O5=.001,X7e=.01,d7=10,Y7e=.05,Z7e=1;function J7e({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;_7e(e<=Ju(d7));let a=1-t;a=pc(Y7e,Z7e,a),e=pc(X7e,d7,Bl(e)),a<1?(i=u=>{const c=u*a,d=c*e,f=c-n,h=wT(u,a),p=Math.exp(-d);return O5-f/h*p},o=u=>{const d=u*a*e,f=d*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-d),m=wT(Math.pow(u,2),a);return(-i(u)+O5>0?-1:1)*((f-h)*p)/m}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-O5+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const s=5/e,l=tNe(i,o,s);if(e=Ju(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const eNe=12;function tNe(e,t,n){let r=n;for(let i=1;i<eNe;i++)r=r-e(r)/t(r);return r}function wT(e,t){return e*Math.sqrt(1-t*t)}const nNe=["duration","bounce"],rNe=["stiffness","damping","mass"];function f7(e,t){return t.some(n=>e[n]!==void 0)}function iNe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!f7(e,rNe)&&f7(e,nNe)){const n=J7e(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function fW({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:f}=iNe(r),h=c?-Bl(c):0,p=l/(2*Math.sqrt(s*u)),m=o-i,_=Bl(Math.sqrt(s/u)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let y;if(p<1){const g=wT(_,p);y=v=>{const S=Math.exp(-p*_*v);return o-S*((h+p*_*m)/g*Math.sin(g*v)+m*Math.cos(g*v))}}else if(p===1)y=g=>o-Math.exp(-_*g)*(m+(h+_*m)*g);else{const g=_*Math.sqrt(p*p-1);y=v=>{const S=Math.exp(-p*_*v),w=Math.min(g*v,300);return o-S*((h+p*_*m)*Math.sinh(w)+g*m*Math.cosh(w))/g}}return{calculatedDuration:f&&d||null,next:g=>{const v=y(g);if(f)a.done=g>=d;else{let S=h;g!==0&&(p<1?S=dW(y,g,v):S=0);const w=Math.abs(S)<=n,x=Math.abs(o-v)<=t;a.done=w&&x}return a.value=a.done?o:v,a}}}function h7({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=C=>s!==void 0&&C<s||l!==void 0&&C>l,p=C=>s===void 0?l:l===void 0||Math.abs(s-C)<Math.abs(l-C)?s:l;let m=n*t;const _=d+m,b=a===void 0?_:a(_);b!==_&&(m=b-d);const y=C=>-m*Math.exp(-C/r),g=C=>b+y(C),v=C=>{const k=y(C),T=g(C);f.done=Math.abs(k)<=u,f.value=f.done?b:T};let S,w;const x=C=>{h(f.value)&&(S=C,w=fW({keyframes:[f.value,p(f.value)],velocity:dW(g,C,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:C=>{let k=!1;return!w&&S===void 0&&(k=!0,v(C),x(C)),S!==void 0&&C>S?w.next(C-S):(!k&&v(C),f)}}}const oNe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Dn.update(t,!0),stop:()=>Xl(t),now:()=>ji.isProcessing?ji.timestamp:performance.now()}},p7=2e4;function g7(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<p7;)t+=n,r=e.next(t);return t>=p7?1/0:t}const aNe={decay:h7,inertia:h7,tween:tS,keyframes:tS,spring:fW};function nS({autoplay:e=!0,delay:t=0,driver:n=oNe,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...f}){let h=1,p=!1,m,_;const b=()=>{_=new Promise(B=>{m=B})};b();let y;const g=aNe[i]||tS;let v;g!==tS&&typeof r[0]!="number"&&(v=uW([0,100],r,{clamp:!1}),r=[0,100]);const S=g({...f,keyframes:r});let w;s==="mirror"&&(w=g({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let x="idle",C=null,k=null,T=null;S.calculatedDuration===null&&o&&(S.calculatedDuration=g7(S));const{calculatedDuration:P}=S;let $=1/0,O=1/0;P!==null&&($=P+a,O=$*(o+1)-a);let E=0;const A=B=>{if(k===null)return;h>0&&(k=Math.min(k,B)),h<0&&(k=Math.min(B-O/h,k)),C!==null?E=C:E=Math.round(B-k)*h;const U=E-t*(h>=0?1:-1),G=h>=0?U<0:U>O;E=Math.max(U,0),x==="finished"&&C===null&&(E=O);let Z=E,ee=S;if(o){const ne=E/$;let se=Math.floor(ne),ye=ne%1;!ye&&ne>=1&&(ye=1),ye===1&&se--,se=Math.min(se,o+1);const ce=!!(se%2);ce&&(s==="reverse"?(ye=1-ye,a&&(ye-=a/$)):s==="mirror"&&(ee=w));let bt=pc(0,1,ye);E>O&&(bt=s==="reverse"&&ce?1:0),Z=bt*$}const J=G?{done:!1,value:r[0]}:ee.next(Z);v&&(J.value=v(J.value));let{done:j}=J;!G&&P!==null&&(j=h>=0?E>=O:E<=0);const Q=C===null&&(x==="finished"||x==="running"&&j);return d&&d(J.value),Q&&M(),J},D=()=>{y&&y.stop(),y=void 0},L=()=>{x="idle",D(),m(),b(),k=T=null},M=()=>{x="finished",c&&c(),D(),m()},R=()=>{if(p)return;y||(y=n(A));const B=y.now();l&&l(),C!==null?k=B-C:(!k||x==="finished")&&(k=B),x==="finished"&&b(),T=k,C=null,x="running",y.start()};e&&R();const N={then(B,U){return _.then(B,U)},get time(){return Bl(E)},set time(B){B=Ju(B),E=B,C!==null||!y||h===0?C=B:k=y.now()-B/h},get duration(){const B=S.calculatedDuration===null?g7(S):S.calculatedDuration;return Bl(B)},get speed(){return h},set speed(B){B===h||!y||(h=B,N.time=Bl(E))},get state(){return x},play:R,pause:()=>{x="paused",C=E},stop:()=>{p=!0,x!=="idle"&&(x="idle",u&&u(),L())},cancel:()=>{T!==null&&A(T),L()},complete:()=>{x="finished"},sample:B=>(k=0,A(B))};return N}function sNe(e){let t;return()=>(t===void 0&&(t=e()),t)}const lNe=sNe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),uNe=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),i1=10,cNe=2e4,dNe=(e,t)=>t.type==="spring"||e==="backgroundColor"||!VH(t.ease);function fNe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(lNe()&&uNe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(y=>{s=y})};u();let{keyframes:c,duration:d=300,ease:f,times:h}=i;if(dNe(t,i)){const y=nS({...i,repeat:0,delay:0});let g={done:!1,value:c[0]};const v=[];let S=0;for(;!g.done&&S<cNe;)g=y.sample(S),v.push(g.value),S+=i1;h=void 0,c=v,d=S-i1,f="linear"}const p=x7e(e.owner.current,t,c,{...i,duration:d,ease:f,times:h}),m=()=>p.cancel(),_=()=>{Dn.update(m),s(),u()};return p.onfinish=()=>{e.set(w7e(c,i)),r&&r(),_()},{then(y,g){return l.then(y,g)},attachTimeline(y){return p.timeline=y,p.onfinish=null,vr},get time(){return Bl(p.currentTime||0)},set time(y){p.currentTime=Ju(y)},get speed(){return p.playbackRate},set speed(y){p.playbackRate=y},get duration(){return Bl(d)},play:()=>{a||(p.play(),Xl(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,p.playState==="idle")return;const{currentTime:y}=p;if(y){const g=nS({...i,autoplay:!1});e.setWithVelocity(g.sample(y-i1).value,g.sample(y).value,i1)}_()},complete:()=>p.finish(),cancel:_}}function hNe({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:vr,pause:vr,stop:vr,then:o=>(o(),Promise.resolve()),cancel:vr,complete:vr});return t?nS({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const pNe={type:"spring",stiffness:500,damping:25,restSpeed:10},gNe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),mNe={type:"keyframes",duration:.8},yNe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vNe=(e,{keyframes:t})=>t.length>2?mNe:Jd.has(e)?e.startsWith("scale")?gNe(t[1]):pNe:yNe,CT=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gc.test(t)||t==="0")&&!t.startsWith("url(")),bNe=new Set(["brightness","contrast","saturate","opacity"]);function _Ne(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(fw)||[];if(!r)return e;const i=n.replace(r,"");let o=bNe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const SNe=/([a-z-]*)\(.*?\)/g,ET={...gc,getAnimatableNone:e=>{const t=e.match(SNe);return t?t.map(_Ne).join(" "):e}},xNe={...TH,color:eo,backgroundColor:eo,outlineColor:eo,fill:eo,stroke:eo,borderColor:eo,borderTopColor:eo,borderRightColor:eo,borderBottomColor:eo,borderLeftColor:eo,filter:ET,WebkitFilter:ET},vP=e=>xNe[e];function hW(e,t){let n=vP(e);return n!==ET&&(n=gc),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const pW=e=>/^0[^.\s]+$/.test(e);function wNe(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||pW(e)}function CNe(e,t,n,r){const i=CT(t,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;u<o.length;u++)o[u]===null&&(o[u]=u===0?a:o[u-1]),wNe(o[u])&&l.push(u),typeof o[u]=="string"&&o[u]!=="none"&&o[u]!=="0"&&(s=o[u]);if(i&&l.length&&s)for(let u=0;u<l.length;u++){const c=l[u];o[c]=hW(t,s)}return o}function ENe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function gW(e,t){return e[t]||e.default||e}const bP=(e,t,n,r={})=>i=>{const o=gW(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s=s-Ju(a);const l=CNe(t,e,n,o),u=l[0],c=l[l.length-1],d=CT(e,u),f=CT(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:p=>{t.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(ENe(o)||(h={...h,...vNe(e,h)}),h.duration&&(h.duration=Ju(h.duration)),h.repeatDelay&&(h.repeatDelay=Ju(h.repeatDelay)),!d||!f||S7e.current||o.type===!1)return hNe(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=fNe(t,e,h);if(p)return p}return nS(h)};function rS(e){return!!(No(e)&&e.add)}const mW=e=>/^\-?\d*\.?\d+$/.test(e);function _P(e,t){e.indexOf(t)===-1&&e.push(t)}function SP(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class xP{constructor(){this.subscriptions=[]}add(t){return _P(this.subscriptions,t),()=>SP(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const a=this.subscriptions[o];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const TNe=e=>!isNaN(parseFloat(e));class kNe{constructor(t,n={}){this.version="10.16.1",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:o,timestamp:a}=ji;this.lastUpdated!==a&&(this.timeDelta=o,this.lastUpdated=a,Dn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Dn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=TNe(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new xP);const r=this.events[t].add(n);return t==="change"?()=>{r(),Dn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?cW(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function up(e,t){return new kNe(e,t)}const yW=e=>t=>t.test(e),ANe={test:e=>e==="auto",parse:e=>e},vW=[ef,st,Qs,yu,NMe,MMe,ANe],ug=e=>vW.find(yW(e)),PNe=[...vW,eo,gc],INe=e=>PNe.find(yW(e));function RNe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,up(n))}function ONe(e,t){const n=pw(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=KMe(o[a]);RNe(e,a,s)}}function MNe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;s<a;s++){const l=o[s],u=t[l];let c=null;Array.isArray(u)&&(c=u[0]),c===null&&(c=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),c!=null&&(typeof c=="string"&&(mW(c)||pW(c))?c=parseFloat(c):!INe(c)&&gc.test(u)&&(c=hW(l,u)),e.addValue(l,up(c,{owner:e})),n[l]===void 0&&(n[l]=c),c!==null&&e.setBaseTarget(l,c))}}function NNe(e,t){return t?(t[e]||t.default||t).from:void 0}function $Ne(e,t,n){const r={};for(const i in e){const o=NNe(i,t);if(o!==void 0)r[i]=o;else{const a=n.getValue(i);a&&(r[i]=a.get())}}return r}function DNe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bW(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const f=e.getValue(d),h=s[d];if(!f||h===void 0||c&&DNe(c,d))continue;const p={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!f.hasAnimated){const _=e.getProps()[b7e];_&&(p.elapsed=window.HandoffAppearAnimations(_,d,f,Dn))}f.start(bP(d,f,h,e.shouldReduceMotion&&Jd.has(d)?{type:!1}:p));const m=f.animation;rS(l)&&(l.add(d),m.then(()=>l.remove(d))),u.push(m)}return a&&Promise.all(u).then(()=>{a&&ONe(e,a)}),u}function TT(e,t,n={}){const r=pw(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(bW(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return LNe(e,t,u+l,c,d,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[l,u]=s==="beforeChildren"?[o,a]:[a,o];return l().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function LNe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(FNe).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(TT(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function FNe(e,t){return e.sortNodePosition(t)}function BNe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>TT(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=TT(e,t,n);else{const i=typeof t=="function"?pw(e,t,n.custom):t;r=Promise.all(bW(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const zNe=[...rP].reverse(),jNe=rP.length;function UNe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>BNe(e,n,r)))}function VNe(e){let t=UNe(e);const n=qNe();let r=!0;const i=(l,u)=>{const c=pw(e,u);if(c){const{transition:d,transitionEnd:f,...h}=c;l={...l,...h,...f}}return l};function o(l){t=l(e)}function a(l,u){const c=e.getProps(),d=e.getVariantContext(!0)||{},f=[],h=new Set;let p={},m=1/0;for(let b=0;b<jNe;b++){const y=zNe[b],g=n[y],v=c[y]!==void 0?c[y]:d[y],S=R0(v),w=y===u?g.isActive:null;w===!1&&(m=b);let x=v===d[y]&&v!==c[y]&&S;if(x&&r&&e.manuallyAnimateOnMount&&(x=!1),g.protectedKeys={...p},!g.isActive&&w===null||!v&&!g.prevProp||cw(v)||typeof v=="boolean")continue;const C=GNe(g.prevProp,v);let k=C||y===u&&g.isActive&&!x&&S||b>m&&S;const T=Array.isArray(v)?v:[v];let P=T.reduce(i,{});w===!1&&(P={});const{prevResolvedValues:$={}}=g,O={...$,...P},E=A=>{k=!0,h.delete(A),g.needsAnimating[A]=!0};for(const A in O){const D=P[A],L=$[A];p.hasOwnProperty(A)||(D!==L?J_(D)&&J_(L)?!jH(D,L)||C?E(A):g.protectedKeys[A]=!0:D!==void 0?E(A):h.add(A):D!==void 0&&h.has(A)?E(A):g.protectedKeys[A]=!0)}g.prevProp=v,g.prevResolvedValues=P,g.isActive&&(p={...p,...P}),r&&e.blockInitialAnimation&&(k=!1),k&&!x&&f.push(...T.map(A=>({animation:A,options:{type:y,...l}})))}if(h.size){const b={};h.forEach(y=>{const g=e.getBaseTarget(y);g!==void 0&&(b[y]=g)}),f.push({animation:b})}let _=!!f.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(f):Promise.resolve()}function s(l,u,c){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(c,l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function GNe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jH(t,e):!1}function Bc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qNe(){return{animate:Bc(!0),whileInView:Bc(),whileHover:Bc(),whileTap:Bc(),whileDrag:Bc(),whileFocus:Bc(),exit:Bc()}}class HNe extends Oc{constructor(t){super(t),t.animationState||(t.animationState=VNe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),cw(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let WNe=0;class KNe extends Oc{constructor(){super(...arguments),this.id=WNe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const o=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&o.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const QNe={animation:{Feature:HNe},exit:{Feature:KNe}},m7=(e,t)=>Math.abs(e-t);function XNe(e,t){const n=m7(e.x,t.x),r=m7(e.y,t.y);return Math.sqrt(n**2+r**2)}class _W{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=N5(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,d=XNe(u.offset,{x:0,y:0})>=3;if(!c&&!d)return;const{point:f}=u,{timestamp:h}=ji;this.history.push({...f,timestamp:h});const{onStart:p,onMove:m}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=M5(c,this.transformPagePoint),Dn.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,h=N5(u.type==="pointercancel"?this.lastMoveEventInfo:M5(c,this.transformPagePoint),this.history);this.startEvent&&d&&d(u,h),f&&f(u,h)},!DH(t))return;this.handlers=n,this.transformPagePoint=r;const i=hw(t),o=M5(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=ji;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,N5(o,this.history)),this.removeListeners=Zu(Fl(window,"pointermove",this.handlePointerMove),Fl(window,"pointerup",this.handlePointerUp),Fl(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Xl(this.updatePoint)}}function M5(e,t){return t?{point:t(e.point)}:e}function y7(e,t){return{x:e.x-t.x,y:e.y-t.y}}function N5({point:e},t){return{point:e,delta:y7(e,SW(t)),offset:y7(e,YNe(t)),velocity:ZNe(t,.1)}}function YNe(e){return e[0]}function SW(e){return e[e.length-1]}function ZNe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=SW(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ju(t)));)n--;if(!r)return{x:0,y:0};const o=Bl(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ea(e){return e.max-e.min}function kT(e,t=0,n=.01){return Math.abs(e-t)<=n}function v7(e,t,n,r=.5){e.origin=r,e.originPoint=ur(t.min,t.max,e.origin),e.scale=ea(n)/ea(t),(kT(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ur(n.min,n.max,e.origin)-e.originPoint,(kT(e.translate)||isNaN(e.translate))&&(e.translate=0)}function im(e,t,n,r){v7(e.x,t.x,n.x,r?r.originX:void 0),v7(e.y,t.y,n.y,r?r.originY:void 0)}function b7(e,t,n){e.min=n.min+t.min,e.max=e.min+ea(t)}function JNe(e,t,n){b7(e.x,t.x,n.x),b7(e.y,t.y,n.y)}function _7(e,t,n){e.min=t.min-n.min,e.max=e.min+ea(t)}function om(e,t,n){_7(e.x,t.x,n.x),_7(e.y,t.y,n.y)}function e$e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ur(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ur(n,e,r.max):Math.min(e,n)),e}function S7(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function t$e(e,{top:t,left:n,bottom:r,right:i}){return{x:S7(e.x,n,i),y:S7(e.y,t,r)}}function x7(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function n$e(e,t){return{x:x7(e.x,t.x),y:x7(e.y,t.y)}}function r$e(e,t){let n=.5;const r=ea(e),i=ea(t);return i>r?n=M0(t.min,t.max-r,e.min):r>i&&(n=M0(e.min,e.max-i,t.min)),pc(0,1,n)}function i$e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const AT=.35;function o$e(e=AT){return e===!1?e=0:e===!0&&(e=AT),{x:w7(e,"left","right"),y:w7(e,"top","bottom")}}function w7(e,t,n){return{min:C7(e,t),max:C7(e,n)}}function C7(e,t){return typeof e=="number"?e:e[t]||0}const E7=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xf=()=>({x:E7(),y:E7()}),T7=()=>({min:0,max:0}),$r=()=>({x:T7(),y:T7()});function ws(e){return[e("x"),e("y")]}function xW({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function a$e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function s$e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function $5(e){return e===void 0||e===1}function PT({scale:e,scaleX:t,scaleY:n}){return!$5(e)||!$5(t)||!$5(n)}function qc(e){return PT(e)||wW(e)||e.z||e.rotate||e.rotateX||e.rotateY}function wW(e){return k7(e.x)||k7(e.y)}function k7(e){return e&&e!=="0%"}function iS(e,t,n){const r=e-n,i=t*r;return n+i}function A7(e,t,n,r,i){return i!==void 0&&(e=iS(e,i,r)),iS(e,n,r)+t}function IT(e,t=0,n=1,r,i){e.min=A7(e.min,t,n,r,i),e.max=A7(e.max,t,n,r,i)}function CW(e,{x:t,y:n}){IT(e.x,t.translate,t.scale,t.originPoint),IT(e.y,n.translate,n.scale,n.originPoint)}function l$e(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;s<i;s++){o=n[s],a=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Yf(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,CW(e,a)),r&&qc(o.latestValues)&&Yf(e,o.latestValues))}t.x=P7(t.x),t.y=P7(t.y)}function P7(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function xu(e,t){e.min=e.min+t,e.max=e.max+t}function I7(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,a=ur(e.min,e.max,o);IT(e,t[n],t[r],a,t.scale)}const u$e=["x","scaleX","originX"],c$e=["y","scaleY","originY"];function Yf(e,t){I7(e.x,t,u$e),I7(e.y,t,c$e)}function EW(e,t){return xW(s$e(e.getBoundingClientRect(),t))}function d$e(e,t,n){const r=EW(e,n),{scroll:i}=t;return i&&(xu(r.x,i.offset.x),xu(r.y,i.offset.y)),r}const f$e=new WeakMap;class h$e{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$r(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(hw(l,"page").point)},o=(l,u)=>{const{drag:c,dragPropagation:d,onDragStart:f}=this.getProps();if(c&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=FH(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ws(p=>{let m=this.getAxisMotionValue(p).get()||0;if(Qs.test(m)){const{projection:_}=this.visualElement;if(_&&_.layout){const b=_.layout.layoutBox[p];b&&(m=ea(b)*(parseFloat(m)/100))}}this.originPoint[p]=m}),f&&Dn.update(()=>f(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:d,onDirectionLock:f,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(d&&this.currentDirection===null){this.currentDirection=p$e(p),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new _W(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Dn.update(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!o1(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=e$e(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Kf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=t$e(r.layoutBox,t):this.constraints=!1,this.elastic=o$e(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ws(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=i$e(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Kf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=d$e(r,i.root,this.visualElement.getTransformPagePoint());let a=n$e(i.layout.layoutBox,o);if(n){const s=n(a$e(a));this.hasMutatedConstraints=!!s,s&&(a=xW(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=ws(c=>{if(!o1(c,n,this.currentDirection))return;let d=l&&l[c]||{};a&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(bP(t,r,0,n))}stopAnimation(){ws(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ws(n=>{const{drag:r}=this.getProps();if(!o1(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-ur(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Kf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ws(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();i[a]=r$e({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ws(a=>{if(!o1(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(ur(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;f$e.set(this.visualElement,this);const t=this.visualElement.current,n=Fl(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Kf(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const a=Ml(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(ws(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=AT,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function o1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function p$e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class g$e extends Oc{constructor(t){super(t),this.removeGroupControls=vr,this.removeListeners=vr,this.controls=new h$e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vr}unmount(){this.removeGroupControls(),this.removeListeners()}}const R7=e=>(t,n)=>{e&&Dn.update(()=>e(t,n))};class m$e extends Oc{constructor(){super(...arguments),this.removePointerDownListener=vr}onPointerDown(t){this.session=new _W(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:R7(t),onStart:R7(n),onMove:r,onEnd:(o,a)=>{delete this.session,i&&Dn.update(()=>i(o,a))}}}mount(){this.removePointerDownListener=Fl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function y$e(){const e=I.useContext(Ny);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=I.useId();return I.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function v$e(){return b$e(I.useContext(Ny))}function b$e(e){return e===null?!0:e.isPresent}const ab={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function O7(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const cg={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=O7(e,t.target.x),r=O7(e,t.target.y);return`${n}% ${r}%`}},_$e={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=gc.parse(e);if(i.length>5)return r;const o=gc.createTransformer(e),a=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;const u=ur(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),o(i)}};class S$e extends Tn.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;TMe(x$e),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ab.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Dn.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function TW(e){const[t,n]=y$e(),r=I.useContext(oP);return Tn.createElement(S$e,{...e,layoutGroup:r,switchLayoutGroup:I.useContext(SH),isPresent:t,safeToRemove:n})}const x$e={borderRadius:{...cg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:cg,borderTopRightRadius:cg,borderBottomLeftRadius:cg,borderBottomRightRadius:cg,boxShadow:_$e},kW=["TopLeft","TopRight","BottomLeft","BottomRight"],w$e=kW.length,M7=e=>typeof e=="string"?parseFloat(e):e,N7=e=>typeof e=="number"||st.test(e);function C$e(e,t,n,r,i,o){i?(e.opacity=ur(0,n.opacity!==void 0?n.opacity:1,E$e(r)),e.opacityExit=ur(t.opacity!==void 0?t.opacity:1,0,T$e(r))):o&&(e.opacity=ur(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;a<w$e;a++){const s=`border${kW[a]}Radius`;let l=$7(t,s),u=$7(n,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||N7(l)===N7(u)?(e[s]=Math.max(ur(M7(l),M7(u),r),0),(Qs.test(u)||Qs.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||n.rotate)&&(e.rotate=ur(t.rotate||0,n.rotate||0,r))}function $7(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const E$e=AW(0,.5,gP),T$e=AW(.5,.95,vr);function AW(e,t,n){return r=>r<e?0:r>t?1:n(M0(e,t,r))}function D7(e,t){e.min=t.min,e.max=t.max}function ca(e,t){D7(e.x,t.x),D7(e.y,t.y)}function L7(e,t,n,r,i){return e-=t,e=iS(e,1/n,r),i!==void 0&&(e=iS(e,1/i,r)),e}function k$e(e,t=0,n=1,r=.5,i,o=e,a=e){if(Qs.test(t)&&(t=parseFloat(t),t=ur(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=ur(o.min,o.max,r);e===o&&(s-=t),e.min=L7(e.min,t,n,s,i),e.max=L7(e.max,t,n,s,i)}function F7(e,t,[n,r,i],o,a){k$e(e,t[n],t[r],t[i],t.scale,o,a)}const A$e=["x","scaleX","originX"],P$e=["y","scaleY","originY"];function B7(e,t,n,r){F7(e.x,t,A$e,n?n.x:void 0,r?r.x:void 0),F7(e.y,t,P$e,n?n.y:void 0,r?r.y:void 0)}function z7(e){return e.translate===0&&e.scale===1}function PW(e){return z7(e.x)&&z7(e.y)}function I$e(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function IW(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function j7(e){return ea(e.x)/ea(e.y)}class R$e{constructor(){this.members=[]}add(t){_P(this.members,t),t.scheduleRender()}remove(t){if(SP(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function U7(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const O$e=(e,t)=>e.depth-t.depth;class M$e{constructor(){this.children=[],this.isDirty=!1}add(t){_P(this.children,t),this.isDirty=!0}remove(t){SP(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(O$e),this.isDirty=!1,this.children.forEach(t)}}function N$e(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Xl(r),e(o-t))};return Dn.read(r,!0),()=>Xl(r)}function $$e(e){window.MotionDebug&&window.MotionDebug.record(e)}function D$e(e){return e instanceof SVGElement&&e.tagName!=="svg"}function L$e(e,t,n){const r=No(e)?e:up(e);return r.start(bP("",r,t,n)),r.animation}const V7=["","X","Y","Z"],G7=1e3;let F$e=0;const Hc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function RW({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},s=t==null?void 0:t()){this.id=F$e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Hc.totalNodes=Hc.resolvedTargetDeltas=Hc.recalculatedProjection=0,this.nodes.forEach(j$e),this.nodes.forEach(H$e),this.nodes.forEach(W$e),this.nodes.forEach(U$e),$$e(Hc)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new M$e)}addEventListener(a,s){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new xP),this.eventHandlers.get(a).add(s)}notifyListeners(a,...s){const l=this.eventHandlers.get(a);l&&l.notify(...s)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=D$e(a),this.instance=a;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=N$e(f,250),ab.hasAnimatedSinceResize&&(ab.hasAnimatedSinceResize=!1,this.nodes.forEach(H7))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Z$e,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!IW(this.targetLayout,p)||h,g=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const v={...gW(m,"layout"),onPlay:_,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v)}else f||H7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Xl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(K$e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(q7);return}this.isUpdating||this.nodes.forEach(G$e),this.isUpdating=!1,this.nodes.forEach(q$e),this.nodes.forEach(B$e),this.nodes.forEach(z$e),this.clearAllSnapshots();const s=performance.now();ji.delta=pc(0,1e3/60,s-ji.timestamp),ji.timestamp=s,ji.isProcessing=!0,E5.update.process(ji),E5.preRender.process(ji),E5.render.process(ji),ji.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(V$e),this.sharedNodes.forEach(Q$e)}scheduleUpdateProjection(){Dn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=$r(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let s=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(s=!1),s&&(this.scroll={animationId:this.root.animationId,phase:a,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform,s=this.projectionDelta&&!PW(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;a&&(s||qc(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return a&&(l=this.removeTransform(l)),J$e(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return $r();const s=a.measureViewportBox(),{scroll:l}=this.root;return l&&(xu(s.x,l.offset.x),xu(s.y,l.offset.y)),s}removeElementScroll(a){const s=$r();ca(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:d}=u;if(u!==this.root&&c&&d.layoutScroll){if(c.isRoot){ca(s,a);const{scroll:f}=this.root;f&&(xu(s.x,-f.offset.x),xu(s.y,-f.offset.y))}xu(s.x,c.offset.x),xu(s.y,c.offset.y)}}return s}applyTransform(a,s=!1){const l=$r();ca(l,a);for(let u=0;u<this.path.length;u++){const c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Yf(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),qc(c.latestValues)&&Yf(l,c.latestValues)}return qc(this.latestValues)&&Yf(l,this.latestValues),l}removeTransform(a){const s=$r();ca(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!qc(u.latestValues))continue;PT(u.latestValues)&&u.updateSnapshot();const c=$r(),d=u.measurePageBox();ca(c,d),B7(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return qc(this.latestValues)&&B7(s,this.latestValues),s}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ji.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var s;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=ji.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$r(),this.relativeTargetOrigin=$r(),om(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),ca(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=$r(),this.targetWithTransforms=$r()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),JNe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ca(this.target,this.layout.layoutBox),CW(this.target,this.targetDelta)):ca(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$r(),this.relativeTargetOrigin=$r(),om(this.relativeTargetOrigin,this.target,h.target),ca(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Hc.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||PT(this.parent.latestValues)||wW(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var a;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ji.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;ca(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;l$e(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox);const{target:p}=s;if(!p){this.projectionTransform&&(this.projectionDelta=Xf(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Xf(),this.projectionDeltaWithTransform=Xf());const m=this.projectionTransform;im(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=U7(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==f||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Hc.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),a){const s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(a,s=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Xf();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=$r(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,_=this.getStack(),b=!_||_.members.length<=1,y=!!(m&&!b&&this.options.crossfade===!0&&!this.path.some(Y$e));this.animationProgress=0;let g;this.mixTargetDelta=v=>{const S=v/1e3;W7(d.x,a.x,S),W7(d.y,a.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(om(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),X$e(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&I$e(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=$r()),ca(g,this.relativeTarget)),m&&(this.animationValues=c,C$e(c,u,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Xl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dn.update(()=>{ab.hasAnimatedSinceResize=!0,this.currentAnimation=L$e(0,G7,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(G7),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&OW(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||$r();const d=ea(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+d;const f=ea(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}ca(s,l),Yf(s,c),im(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new R$e),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c<V7.length;c++){const d="rotate"+V7[c];l[d]&&(u[d]=l[d],a.setStaticValue(d,0))}a.render();for(const c in u)a.setStaticValue(c,u[c]);a.scheduleRender()}getProjectionStyles(a={}){var s,l;const u={};if(!this.instance||this.isSVG)return u;if(this.isVisible)u.visibility="";else return{visibility:"hidden"};const c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=ob(a.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=ob(a.pointerEvents)||""),this.hasProjected&&!qc(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=U7(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const m in Y_){if(f[m]===void 0)continue;const{correct:_,applyTo:b}=Y_[m],y=u.transform==="none"?f[m]:_(f[m],d);if(b){const g=b.length;for(let v=0;v<g;v++)u[b[v]]=y}else u[m]=y}return this.options.layoutId&&(u.pointerEvents=d===this?ob(a.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(q7),this.root.sharedNodes.clear()}}}function B$e(e){e.updateLayout()}function z$e(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;o==="size"?ws(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=ea(f);f.min=r[d].min,f.max=f.min+h}):OW(o,n.layoutBox,r)&&ws(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=ea(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const s=Xf();im(s,r,n.layoutBox);const l=Xf();a?im(l,e.applyTransform(i,!0),n.measuredBox):im(l,r,n.layoutBox);const u=!PW(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const p=$r();om(p,n.layoutBox,f.layoutBox);const m=$r();om(m,r,h.layoutBox),IW(p,m)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function j$e(e){Hc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function U$e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function V$e(e){e.clearSnapshot()}function q7(e){e.clearMeasurements()}function G$e(e){e.isLayoutDirty=!1}function q$e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function H7(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function H$e(e){e.resolveTargetDelta()}function W$e(e){e.calcProjection()}function K$e(e){e.resetRotation()}function Q$e(e){e.removeLeadSnapshot()}function W7(e,t,n){e.translate=ur(t.translate,0,n),e.scale=ur(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function K7(e,t,n,r){e.min=ur(t.min,n.min,r),e.max=ur(t.max,n.max,r)}function X$e(e,t,n,r){K7(e.x,t.x,n.x,r),K7(e.y,t.y,n.y,r)}function Y$e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Z$e={duration:.45,ease:[.4,0,.1,1]},Q7=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),X7=Q7("applewebkit/")&&!Q7("chrome/")?Math.round:vr;function Y7(e){e.min=X7(e.min),e.max=X7(e.max)}function J$e(e){Y7(e.x),Y7(e.y)}function OW(e,t,n){return e==="position"||e==="preserve-aspect"&&!kT(j7(t),j7(n),.2)}const eDe=RW({attachResizeListener:(e,t)=>Ml(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),D5={current:void 0},MW=RW({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!D5.current){const e=new eDe({});e.mount(window),e.setOptions({layoutScroll:!0}),D5.current=e}return D5.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),tDe={pan:{Feature:m$e},drag:{Feature:g$e,ProjectionNode:MW,MeasureLayout:TW}},nDe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function rDe(e){const t=nDe.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function RT(e,t,n=1){const[r,i]=rDe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return mW(a)?parseFloat(a):a}else return _T(i)?RT(i,t,n+1):i}function iDe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!_T(o))return;const a=RT(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!_T(o))continue;const a=RT(o,r);a&&(t[i]=a,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const oDe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),NW=e=>oDe.has(e),aDe=e=>Object.keys(e).some(NW),Z7=e=>e===ef||e===st,J7=(e,t)=>parseFloat(e.split(", ")[t]),eN=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return J7(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?J7(o[1],e):0}},sDe=new Set(["x","y","z"]),lDe=$y.filter(e=>!sDe.has(e));function uDe(e){const t=[];return lDe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const cp={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:eN(4,13),y:eN(5,14)};cp.translateX=cp.x;cp.translateY=cp.y;const cDe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=cp[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=cp[u](l,o)}),e},dDe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(NW);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],d=ug(c);const f=t[l];let h;if(J_(f)){const p=f.length,m=f[0]===null?1:0;c=f[m],d=ug(c);for(let _=m;_<p&&f[_]!==null;_++)h?pP(ug(f[_])===h):h=ug(f[_])}else h=ug(f);if(d!==h)if(Z7(d)&&Z7(h)){const p=u.get();typeof p=="string"&&u.set(parseFloat(p)),typeof f=="string"?t[l]=parseFloat(f):Array.isArray(f)&&h===st&&(t[l]=f.map(parseFloat))}else d!=null&&d.transform&&(h!=null&&h.transform)&&(c===0||f===0)?c===0?u.set(h.transform(c)):t[l]=d.transform(f):(a||(o=uDe(e),a=!0),s.push(l),r[l]=r[l]!==void 0?r[l]:t[l],u.jump(f))}),s.length){const l=s.indexOf("height")>=0?window.pageYOffset:null,u=cDe(t,e,s);return o.length&&o.forEach(([c,d])=>{e.getValue(c).set(d)}),e.render(),uw&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function fDe(e,t,n,r){return aDe(t)?dDe(e,t,n,r):{target:t,transitionEnd:r}}const hDe=(e,t,n,r)=>{const i=iDe(e,t,r);return t=i.target,r=i.transitionEnd,fDe(e,t,n,r)},OT={current:null},$W={current:!1};function pDe(){if($W.current=!0,!!uw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>OT.current=e.matches;e.addListener(t),t()}else OT.current=!1}function gDe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(No(o))e.addValue(i,o),rS(r)&&r.add(i);else if(No(a))e.addValue(i,up(o,{owner:e})),rS(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,up(s!==void 0?s:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const tN=new WeakMap,DW=Object.keys(O0),mDe=DW.length,nN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],yDe=iP.length;class vDe{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Dn.render(this.render,!1,!0);const{latestValues:s,renderState:l}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.isControllingVariants=dw(n),this.isVariantNode=_H(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const d in c){const f=c[d];s[d]!==void 0&&No(f)&&(f.set(s[d],!1),rS(u)&&u.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,tN.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),$W.current||pDe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:OT.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){tN.delete(this.current),this.projection&&this.projection.unmount(),Xl(this.notifyUpdate),Xl(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Jd.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Dn.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,o){let a,s;for(let l=0;l<mDe;l++){const u=DW[l],{isEnabled:c,Feature:d,ProjectionNode:f,MeasureLayout:h}=O0[u];f&&(a=f),c(n)&&(!this.features[u]&&d&&(this.features[u]=new d(this)),h&&(s=h))}if(!this.projection&&a){this.projection=new a(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:u,drag:c,dragConstraints:d,layoutScroll:f,layoutRoot:h}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||d&&Kf(d),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:h})}return s}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$r()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<nN.length;r++){const i=nN[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o=t["on"+i];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=gDe(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<yDe;r++){const i=iP[r],o=this.props[i];(R0(o)||o===!1)&&(n[i]=o)}return n}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=up(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=hP(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!No(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new xP),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class LW extends vDe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=$Ne(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){MNe(this,r,a);const s=hDe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function bDe(e){return window.getComputedStyle(e)}class _De extends LW{readValueFromInstance(t,n){if(Jd.has(n)){const r=vP(n);return r&&r.default||0}else{const r=bDe(t),i=(CH(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return EW(t,n)}build(t,n,r,i){sP(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return fP(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;No(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){IH(t,n,r,i)}}class SDe extends LW{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Jd.has(n)){const r=vP(n);return r&&r.default||0}return n=RH.has(n)?n:dP(n),t.getAttribute(n)}measureInstanceViewportBox(){return $r()}scrapeMotionValuesFromProps(t,n){return MH(t,n)}build(t,n,r,i){uP(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){OH(t,n,r,i)}mount(t){this.isSVGTag=cP(t.tagName),super.mount(t)}}const xDe=(e,t)=>aP(e)?new SDe(t,{enableHardwareAcceleration:!1}):new _De(t,{enableHardwareAcceleration:!0}),wDe={layout:{ProjectionNode:MW,MeasureLayout:TW}},CDe={...QNe,...g7e,...tDe,...wDe},FW=CMe((e,t)=>n7e(e,t,CDe,xDe));function BW(){const e=I.useRef(!1);return nP(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function EDe(){const e=BW(),[t,n]=I.useState(0),r=I.useCallback(()=>{e.current&&n(t+1)},[t]);return[I.useCallback(()=>Dn.postRender(r),[r]),t]}class TDe extends I.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function kDe({children:e,isPresent:t}){const n=I.useId(),r=I.useRef(null),i=I.useRef({width:0,height:0,top:0,left:0});return I.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
-          [data-motion-pop-id="${n}"] {
-            position: absolute !important;
-            width: ${o}px !important;
-            height: ${a}px !important;
-            top: ${s}px !important;
-            left: ${l}px !important;
-          }
-        `),()=>{document.head.removeChild(u)}},[t]),I.createElement(TDe,{isPresent:t,childRef:r,sizeRef:i},I.cloneElement(e,{ref:r}))}const L5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=NH(ADe),l=I.useId(),u=I.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c=>{s.set(c,!0);for(const d of s.values())if(!d)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),o?void 0:[n]);return I.useMemo(()=>{s.forEach((c,d)=>s.set(d,!1))},[n]),I.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=I.createElement(kDe,{isPresent:n},e)),I.createElement(Ny.Provider,{value:u},e)};function ADe(){return new Map}function PDe(e){return I.useEffect(()=>()=>e(),[])}const Tf=e=>e.key||"";function IDe(e,t){e.forEach(n=>{const r=Tf(n);t.set(r,n)})}function RDe(e){const t=[];return I.Children.forEach(e,n=>{I.isValidElement(n)&&t.push(n)}),t}const zW=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{const s=I.useContext(oP).forceRender||EDe()[0],l=BW(),u=RDe(e);let c=u;const d=I.useRef(new Map).current,f=I.useRef(c),h=I.useRef(new Map).current,p=I.useRef(!0);if(nP(()=>{p.current=!1,IDe(u,h),f.current=c}),PDe(()=>{p.current=!0,h.clear(),d.clear()}),p.current)return I.createElement(I.Fragment,null,c.map(y=>I.createElement(L5,{key:Tf(y),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},y)));c=[...c];const m=f.current.map(Tf),_=u.map(Tf),b=m.length;for(let y=0;y<b;y++){const g=m[y];_.indexOf(g)===-1&&!d.has(g)&&d.set(g,void 0)}return a==="wait"&&d.size&&(c=[]),d.forEach((y,g)=>{if(_.indexOf(g)!==-1)return;const v=h.get(g);if(!v)return;const S=m.indexOf(g);let w=y;if(!w){const x=()=>{h.delete(g),d.delete(g);const C=f.current.findIndex(k=>k.key===g);if(f.current.splice(C,1),!d.size){if(f.current=u,l.current===!1)return;s(),r&&r()}};w=I.createElement(L5,{key:Tf(v),isPresent:!1,onExitComplete:x,custom:t,presenceAffectsLayout:o,mode:a},v),d.set(g,w)}c.splice(S,0,w)}),c=c.map(y=>{const g=y.key;return d.has(g)?y:I.createElement(L5,{key:Tf(y),isPresent:!0,presenceAffectsLayout:o,mode:a},y)}),I.createElement(I.Fragment,null,d.size?c:c.map(y=>I.cloneElement(y)))};var ODe={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},jW=I.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=ODe,toastSpacing:c="0.5rem"}=e,[d,f]=I.useState(s),h=v$e();JM(()=>{h||r==null||r()},[h]),JM(()=>{f(s)},[s]);const p=()=>f(null),m=()=>f(s),_=()=>{h&&i()};I.useEffect(()=>{h&&o&&i()},[h,o,i]),gMe(_,d);const b=I.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),y=I.useMemo(()=>fMe(a),[a]);return W.jsx(FW.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:m,custom:{position:a},style:y,children:W.jsx(Oi.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Ls(n,{id:t,onClose:_})})})});jW.displayName="ToastComponent";function MDe(e,t){var n;const r=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=o==null?void 0:o[t])!=null?n:r}var rN={path:W.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[W.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),W.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),W.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},By=ia((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,c=Rc("chakra-icon",s),d=My("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},h={ref:t,focusable:o,className:c,__css:f},p=r??rN.viewBox;if(n&&typeof n!="string")return W.jsx(Oi.svg,{as:n,...h,...u});const m=a??rN.path;return W.jsx(Oi.svg,{verticalAlign:"middle",viewBox:p,...h,...u,children:m})});By.displayName="Icon";function NDe(e){return W.jsx(By,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function $De(e){return W.jsx(By,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function iN(e){return W.jsx(By,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var DDe=Qke({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),wP=ia((e,t)=>{const n=My("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Ry(e),u=Rc("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${DDe} ${o} linear infinite`,...n};return W.jsx(Oi.div,{ref:t,__css:c,className:u,...l,children:r&&W.jsx(Oi.span,{srOnly:!0,children:r})})});wP.displayName="Spinner";var[LDe,CP]=Iy({name:"AlertContext",hookName:"useAlertContext",providerName:"<Alert />"}),[FDe,EP]=Iy({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:"<Alert />"}),UW={info:{icon:$De,colorScheme:"blue"},warning:{icon:iN,colorScheme:"orange"},success:{icon:NDe,colorScheme:"green"},error:{icon:iN,colorScheme:"red"},loading:{icon:wP,colorScheme:"blue"}};function BDe(e){return UW[e].colorScheme}function zDe(e){return UW[e].icon}var VW=ia(function(t,n){const r=EP(),{status:i}=CP(),o={display:"inline",...r.description};return W.jsx(Oi.div,{ref:n,"data-status":i,...t,className:Rc("chakra-alert__desc",t.className),__css:o})});VW.displayName="AlertDescription";function GW(e){const{status:t}=CP(),n=zDe(t),r=EP(),i=t==="loading"?r.spinner:r.icon;return W.jsx(Oi.span,{display:"inherit","data-status":t,...e,className:Rc("chakra-alert__icon",e.className),__css:i,children:e.children||W.jsx(n,{h:"100%",w:"100%"})})}GW.displayName="AlertIcon";var qW=ia(function(t,n){const r=EP(),{status:i}=CP();return W.jsx(Oi.div,{ref:n,"data-status":i,...t,className:Rc("chakra-alert__title",t.className),__css:r.title})});qW.displayName="AlertTitle";var HW=ia(function(t,n){var r;const{status:i="info",addRole:o=!0,...a}=Ry(t),s=(r=t.colorScheme)!=null?r:BDe(i),l=HOe("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return W.jsx(LDe,{value:{status:i},children:W.jsx(FDe,{value:l,children:W.jsx(Oi.div,{"data-status":i,role:o?"alert":void 0,ref:n,...a,className:Rc("chakra-alert",t.className),__css:u})})})});HW.displayName="Alert";function jDe(e){return W.jsx(By,{focusable:"false","aria-hidden":!0,...e,children:W.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var WW=ia(function(t,n){const r=My("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Ry(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return W.jsx(Oi.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s,children:i||W.jsx(jDe,{width:"1em",height:"1em"})})});WW.displayName="CloseButton";var UDe={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Ns=VDe(UDe);function VDe(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=GDe(i,o),{position:s,id:l}=a;return r(u=>{var c,d;const h=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(d=u[s])!=null?d:[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=ZM(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:KW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(c=>({...c,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=yH(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>!!ZM(Ns.getState(),i).position}}var oN=0;function GDe(e,t={}){var n,r;oN+=1;const i=(n=t.id)!=null?n:oN,o=(r=t.position)!=null?r:"bottom";return{id:i,message:e,position:o,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Ns.removeToast(String(i),o),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var qDe=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return W.jsxs(HW,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[W.jsx(GW,{children:u}),W.jsxs(Oi.div,{flex:"1",maxWidth:"100%",children:[i&&W.jsx(qW,{id:c==null?void 0:c.title,children:i}),s&&W.jsx(VW,{id:c==null?void 0:c.description,display:"block",children:s})]}),o&&W.jsx(WW,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function KW(e={}){const{render:t,toastComponent:n=qDe}=e;return i=>typeof t=="function"?t({...i,...e}):W.jsx(n,{...i,...e})}function HDe(e,t){const n=i=>{var o;return{...t,...i,position:MDe((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=KW(o);return Ns.notify(a,o)};return r.update=(i,o)=>{Ns.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...Ls(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...Ls(o.error,s)}))},r.closeAll=Ns.closeAll,r.close=Ns.close,r.isActive=Ns.isActive,r}var[ZKe,JKe]=Iy({name:"ToastOptionsContext",strict:!1}),WDe=e=>{const t=I.useSyncExternalStore(Ns.subscribe,Ns.getState,Ns.getState),{motionVariants:n,component:r=jW,portalProps:i}=e,a=Object.keys(t).map(s=>{const l=t[s];return W.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${s}`,style:hMe(s),children:W.jsx(zW,{initial:!1,children:l.map(u=>W.jsx(r,{motionVariants:n,...u},u.id))})},s)});return W.jsx(nw,{...i,children:a})},KDe={duration:5e3,variant:"solid"},Sf={theme:$Oe,colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{},defaultOptions:KDe,forced:!1};function QDe({theme:e=Sf.theme,colorMode:t=Sf.colorMode,toggleColorMode:n=Sf.toggleColorMode,setColorMode:r=Sf.setColorMode,defaultOptions:i=Sf.defaultOptions,motionVariants:o,toastSpacing:a,component:s,forced:l}=Sf){const u={colorMode:t,setColorMode:r,toggleColorMode:n,forced:l};return{ToastContainer:()=>W.jsx(uMe,{theme:e,children:W.jsx(WA.Provider,{value:u,children:W.jsx(WDe,{defaultOptions:i,motionVariants:o,toastSpacing:a,component:s})})}),toast:HDe(e.direction,i)}}var MT=ia(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return W.jsx("img",{width:r,height:i,ref:n,alt:o,...a})});MT.displayName="NativeImage";function XDe(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=I.useState("pending");I.useEffect(()=>{c(n?"loading":"pending")},[n]);const d=I.useRef(),f=I.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,a&&(p.crossOrigin=a),r&&(p.srcset=r),s&&(p.sizes=s),t&&(p.loading=t),p.onload=m=>{h(),c("loaded"),i==null||i(m)},p.onerror=m=>{h(),c("failed"),o==null||o(m)},d.current=p},[n,a,r,s,i,o,t]),h=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return G_(()=>{if(!l)return u==="loading"&&f(),()=>{h()}},[u,f,l]),l?"loaded":u}var YDe=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function ZDe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var TP=ia(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||i!==void 0,_=u!=null||c||!m,b=XDe({...t,crossOrigin:d,ignoreFallback:_}),y=YDe(b,f),g={ref:n,objectFit:l,objectPosition:s,..._?p:ZDe(p,["onError","onLoad"])};return y?i||W.jsx(Oi.img,{as:MT,className:"chakra-image__placeholder",src:r,...g}):W.jsx(Oi.img,{as:MT,src:o,srcSet:a,crossOrigin:d,loading:u,referrerPolicy:h,className:"chakra-image",...g})});TP.displayName="Image";var QW=ia(function(t,n){const r=My("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Ry(t),u=YOe({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return W.jsx(Oi.p,{ref:n,className:Rc("chakra-text",t.className),...u,...l,__css:r})});QW.displayName="Text";var NT=ia(function(t,n){const r=My("Heading",t),{className:i,...o}=Ry(t);return W.jsx(Oi.h2,{ref:n,className:Rc("chakra-heading",t.className),...o,__css:r})});NT.displayName="Heading";var oS=Oi("div");oS.displayName="Box";var XW=ia(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return W.jsx(oS,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});XW.displayName="Square";var JDe=ia(function(t,n){const{size:r,...i}=t;return W.jsx(XW,{size:r,ref:n,borderRadius:"9999px",...i})});JDe.displayName="Circle";var kP=ia(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...c}=t,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return W.jsx(Oi.div,{ref:n,__css:d,...c})});kP.displayName="Flex";const eLe=z.object({status:z.literal(422),data:z.object({detail:z.array(z.object({loc:z.array(z.string()),msg:z.string(),type:z.string()}))})});function yo(e,t,n=!1){e=String(e),t=String(t);const r=Array.from({length:21},(a,s)=>s*50),i=[0,5,10,15,20,25,30,35,40,45,50,55,59,64,68,73,77,82,86,95,100];return r.reduce((a,s,l)=>{const u=n?i[l]/100:1,c=n?50:i[r.length-1-l];return a[s]=`hsl(${e} ${t}% ${c}% / ${u})`,a},{})}const a1={H:220,S:16},s1={H:250,S:42},l1={H:47,S:42},u1={H:40,S:70},c1={H:28,S:42},d1={H:113,S:42},f1={H:0,S:42},tLe={base:yo(a1.H,a1.S),baseAlpha:yo(a1.H,a1.S,!0),accent:yo(s1.H,s1.S),accentAlpha:yo(s1.H,s1.S,!0),working:yo(l1.H,l1.S),workingAlpha:yo(l1.H,l1.S,!0),gold:yo(u1.H,u1.S),goldAlpha:yo(u1.H,u1.S,!0),warning:yo(c1.H,c1.S),warningAlpha:yo(c1.H,c1.S,!0),ok:yo(d1.H,d1.S),okAlpha:yo(d1.H,d1.S,!0),error:yo(f1.H,f1.S),errorAlpha:yo(f1.H,f1.S,!0)},{definePartsStyle:nLe,defineMultiStyleConfig:rLe}=Pt(Vq.keys),iLe={border:"none"},oLe=e=>{const{colorScheme:t}=e;return{fontWeight:"600",fontSize:"sm",border:"none",borderRadius:"base",bg:K(`${t}.200`,`${t}.700`)(e),color:K(`${t}.900`,`${t}.100`)(e),_hover:{bg:K(`${t}.250`,`${t}.650`)(e)},_expanded:{bg:K(`${t}.250`,`${t}.650`)(e),borderBottomRadius:"none",_hover:{bg:K(`${t}.300`,`${t}.600`)(e)}}}},aLe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.100`,`${t}.800`)(e),borderRadius:"base",borderTopRadius:"none"}},sLe={},lLe=nLe(e=>({container:iLe,button:oLe(e),panel:aLe(e),icon:sLe})),uLe=rLe({variants:{invokeAI:lLe},defaultProps:{variant:"invokeAI",colorScheme:"base"}}),cLe=e=>{const{colorScheme:t}=e;if(t==="base"){const r={bg:K("base.150","base.700")(e),color:K("base.300","base.500")(e),svg:{fill:K("base.300","base.500")(e)},opacity:1},i={bg:"none",color:K("base.300","base.500")(e),svg:{fill:K("base.500","base.500")(e)},opacity:1};return{bg:K("base.250","base.600")(e),color:K("base.850","base.100")(e),borderRadius:"base",svg:{fill:K("base.850","base.100")(e)},_hover:{bg:K("base.300","base.500")(e),color:K("base.900","base.50")(e),svg:{fill:K("base.900","base.50")(e)},_disabled:r},_disabled:r,'&[data-progress="true"]':{...i,_hover:i}}}const n={bg:K(`${t}.400`,`${t}.700`)(e),color:K(`${t}.600`,`${t}.500`)(e),svg:{fill:K(`${t}.600`,`${t}.500`)(e),filter:"unset"},opacity:.7,filter:"saturate(65%)"};return{bg:K(`${t}.400`,`${t}.600`)(e),color:K("base.50","base.100")(e),borderRadius:"base",svg:{fill:K("base.50","base.100")(e)},_disabled:n,_hover:{bg:K(`${t}.500`,`${t}.500`)(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)},_disabled:n}}},dLe=e=>{const{colorScheme:t}=e,n=K("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",_hover:{bg:K(`${t}.500`,`${t}.500`)(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)}},".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"}}},fLe={variants:{invokeAI:cLe,invokeAIOutline:dLe},defaultProps:{variant:"invokeAI",colorScheme:"base"}},{definePartsStyle:hLe,defineMultiStyleConfig:pLe}=Pt(Gq.keys),gLe=e=>{const{colorScheme:t}=e;return{bg:K("base.200","base.700")(e),borderColor:K("base.300","base.600")(e),color:K("base.900","base.100")(e),_checked:{bg:K(`${t}.300`,`${t}.500`)(e),borderColor:K(`${t}.300`,`${t}.500`)(e),color:K(`${t}.900`,`${t}.100`)(e),_hover:{bg:K(`${t}.400`,`${t}.500`)(e),borderColor:K(`${t}.400`,`${t}.500`)(e)},_disabled:{borderColor:"transparent",bg:"whiteAlpha.300",color:"whiteAlpha.500"}},_indeterminate:{bg:K(`${t}.300`,`${t}.600`)(e),borderColor:K(`${t}.300`,`${t}.600`)(e),color:K(`${t}.900`,`${t}.100`)(e)},_disabled:{bg:"whiteAlpha.100",borderColor:"transparent"},_focusVisible:{boxShadow:"none",outline:"none"},_invalid:{borderColor:K("error.600","error.300")(e)}}},mLe=hLe(e=>({control:gLe(e)})),yLe=pLe({variants:{invokeAI:mLe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{definePartsStyle:vLe,defineMultiStyleConfig:bLe}=Pt(qq.keys),_Le={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},SLe=e=>({borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6},"::selection":{color:K("accent.900","accent.50")(e),bg:K("accent.200","accent.400")(e)}}),xLe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},wLe=vLe(e=>({preview:_Le,input:SLe(e),textarea:xLe})),CLe=bLe({variants:{invokeAI:wLe},defaultProps:{size:"sm",variant:"invokeAI"}}),ELe=e=>({fontSize:"sm",marginEnd:0,mb:1,fontWeight:"400",transitionProperty:"common",transitionDuration:"normal",whiteSpace:"nowrap",_disabled:{opacity:.4},color:K("base.700","base.300")(e),_invalid:{color:K("error.500","error.300")(e)}}),TLe={variants:{invokeAI:ELe},defaultProps:{variant:"invokeAI"}},gw=e=>({outline:"none",borderWidth:2,borderStyle:"solid",borderColor:K("base.200","base.800")(e),bg:K("base.50","base.900")(e),borderRadius:"base",color:K("base.900","base.100")(e),boxShadow:"none",_hover:{borderColor:K("base.300","base.600")(e)},_focus:{borderColor:K("accent.200","accent.600")(e),boxShadow:"none",_hover:{borderColor:K("accent.300","accent.500")(e)}},_invalid:{borderColor:K("error.300","error.600")(e),boxShadow:"none",_hover:{borderColor:K("error.400","error.500")(e)}},_disabled:{borderColor:K("base.300","base.700")(e),bg:K("base.300","base.700")(e),color:K("base.600","base.400")(e),_hover:{borderColor:K("base.300","base.700")(e)}},_placeholder:{color:K("base.700","base.400")(e)},"::selection":{bg:K("accent.200","accent.400")(e)}}),{definePartsStyle:kLe,defineMultiStyleConfig:ALe}=Pt(Hq.keys),PLe=kLe(e=>({field:gw(e)})),ILe=ALe({variants:{invokeAI:PLe},defaultProps:{size:"sm",variant:"invokeAI"}}),{definePartsStyle:RLe,defineMultiStyleConfig:OLe}=Pt(Wq.keys),MLe=RLe(e=>({button:{fontWeight:500,bg:K("base.300","base.500")(e),color:K("base.900","base.100")(e),_hover:{bg:K("base.400","base.600")(e),color:K("base.900","base.50")(e),fontWeight:600}},list:{zIndex:9999,color:K("base.900","base.150")(e),bg:K("base.200","base.800")(e),shadow:"dark-lg",border:"none"},item:{fontSize:"sm",bg:K("base.200","base.800")(e),_hover:{bg:K("base.300","base.700")(e),svg:{opacity:1}},_focus:{bg:K("base.400","base.600")(e)},svg:{opacity:.7,fontSize:14}}})),NLe=OLe({variants:{invokeAI:MLe},defaultProps:{variant:"invokeAI"}}),eQe={variants:{enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.07,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.07,easings:"easeOut"}}}},{defineMultiStyleConfig:$Le,definePartsStyle:DLe}=Pt(Kq.keys),LLe=e=>({bg:K("blackAlpha.700","blackAlpha.700")(e)}),FLe={},BLe=()=>({layerStyle:"first",maxH:"80vh"}),zLe=()=>({fontWeight:"600",fontSize:"lg",layerStyle:"first",borderTopRadius:"base",borderInlineEndRadius:"base"}),jLe={},ULe={overflowY:"scroll"},VLe={},GLe=DLe(e=>({overlay:LLe(e),dialogContainer:FLe,dialog:BLe(),header:zLe(),closeButton:jLe,body:ULe,footer:VLe})),qLe=$Le({variants:{invokeAI:GLe},defaultProps:{variant:"invokeAI",size:"lg"}}),{defineMultiStyleConfig:HLe,definePartsStyle:WLe}=Pt(Qq.keys),KLe=e=>({height:8}),QLe=e=>({border:"none",fontWeight:"600",height:"auto",py:1,ps:2,pe:6,...gw(e)}),XLe=e=>({display:"flex"}),YLe=e=>({border:"none",px:2,py:0,mx:-2,my:0,svg:{color:K("base.700","base.300")(e),width:2.5,height:2.5,_hover:{color:K("base.900","base.100")(e)}}}),ZLe=WLe(e=>({root:KLe(e),field:QLe(e),stepperGroup:XLe(e),stepper:YLe(e)})),JLe=HLe({variants:{invokeAI:ZLe},defaultProps:{size:"sm",variant:"invokeAI"}}),{defineMultiStyleConfig:eFe,definePartsStyle:YW}=Pt(Xq.keys),ZW=hr("popper-bg"),JW=hr("popper-arrow-bg"),eK=hr("popper-arrow-shadow-color"),tFe=e=>({[JW.variable]:K("colors.base.100","colors.base.800")(e),[ZW.variable]:K("colors.base.100","colors.base.800")(e),[eK.variable]:K("colors.base.400","colors.base.600")(e),minW:"unset",width:"unset",p:4,bg:K("base.100","base.800")(e),border:"none",shadow:"dark-lg"}),nFe=e=>({[JW.variable]:K("colors.base.100","colors.base.700")(e),[ZW.variable]:K("colors.base.100","colors.base.700")(e),[eK.variable]:K("colors.base.400","colors.base.400")(e),p:4,bg:K("base.100","base.700")(e),border:"none",shadow:"dark-lg"}),rFe=YW(e=>({content:tFe(e),body:{padding:0}})),iFe=YW(e=>({content:nFe(e),body:{padding:0}})),oFe=eFe({variants:{invokeAI:rFe,informational:iFe},defaultProps:{variant:"invokeAI"}}),{defineMultiStyleConfig:aFe,definePartsStyle:sFe}=Pt(Yq.keys),lFe=e=>({bg:"accentAlpha.700"}),uFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.200`,`${t}.700`)(e)}},cFe=sFe(e=>({filledTrack:lFe(e),track:uFe(e)})),dFe=aFe({variants:{invokeAI:cFe},defaultProps:{variant:"invokeAI"}}),fFe={"::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},{definePartsStyle:hFe,defineMultiStyleConfig:pFe}=Pt(Zq.keys),gFe=e=>({color:K("base.200","base.300")(e)}),mFe=e=>({fontWeight:"600",...gw(e)}),yFe=hFe(e=>({field:mFe(e),icon:gFe(e)})),vFe=pFe({variants:{invokeAI:yFe},defaultProps:{size:"sm",variant:"invokeAI"}}),aN=nt("skeleton-start-color"),sN=nt("skeleton-end-color"),bFe={borderRadius:"base",maxW:"full",maxH:"full",_light:{[aN.variable]:"colors.base.250",[sN.variable]:"colors.base.450"},_dark:{[aN.variable]:"colors.base.700",[sN.variable]:"colors.base.500"}},_Fe={variants:{invokeAI:bFe},defaultProps:{variant:"invokeAI"}},{definePartsStyle:SFe,defineMultiStyleConfig:xFe}=Pt(Jq.keys),wFe=e=>({bg:K("base.400","base.600")(e),h:1.5}),CFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.400`,`${t}.600`)(e),h:1.5}},EFe=e=>({w:e.orientation==="horizontal"?2:4,h:e.orientation==="horizontal"?4:2,bg:K("base.50","base.100")(e)}),TFe=e=>({fontSize:"2xs",fontWeight:"500",color:K("base.700","base.400")(e),mt:2,insetInlineStart:"unset"}),kFe=SFe(e=>({container:{_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},track:wFe(e),filledTrack:CFe(e),thumb:EFe(e),mark:TFe(e)})),AFe=xFe({variants:{invokeAI:kFe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:PFe,definePartsStyle:IFe}=Pt(eH.keys),RFe=e=>{const{colorScheme:t}=e;return{bg:K("base.300","base.600")(e),_focusVisible:{boxShadow:"none"},_checked:{bg:K(`${t}.400`,`${t}.500`)(e)}}},OFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.50`,`${t}.50`)(e)}},MFe=IFe(e=>({container:{},track:RFe(e),thumb:OFe(e)})),NFe=PFe({variants:{invokeAI:MFe},defaultProps:{size:"md",variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:$Fe,definePartsStyle:tK}=Pt(tH.keys),DFe=e=>({display:"flex",columnGap:4}),LFe=e=>({}),FFe=e=>{const{colorScheme:t}=e;return{display:"flex",flexDirection:"column",gap:1,color:K("base.700","base.400")(e),button:{fontSize:"sm",padding:2,borderRadius:"base",textShadow:K("0 0 0.3rem var(--invokeai-colors-accent-100)","0 0 0.3rem var(--invokeai-colors-accent-900)")(e),svg:{fill:K("base.700","base.300")(e)},_selected:{bg:K("accent.400","accent.600")(e),color:K("base.50","base.100")(e),svg:{fill:K("base.50","base.100")(e),filter:K(`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-600))`,`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-800))`)(e)},_hover:{bg:K("accent.500","accent.500")(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)}}},_hover:{bg:K("base.100","base.800")(e),color:K("base.900","base.50")(e),svg:{fill:K("base.800","base.100")(e)}}}}},BFe=e=>({padding:0,height:"100%"}),zFe=tK(e=>({root:DFe(e),tab:LFe(e),tablist:FFe(e),tabpanel:BFe(e)})),jFe=tK(e=>({tab:{borderTopRadius:"base",px:4,py:1,fontSize:"sm",color:K("base.600","base.400")(e),fontWeight:500,_selected:{color:K("accent.600","accent.400")(e)}},tabpanel:{p:0,pt:4,w:"full",h:"full"},tabpanels:{w:"full",h:"full"}})),UFe=$Fe({variants:{line:jFe,appTabs:zFe},defaultProps:{variant:"appTabs",colorScheme:"accent"}}),VFe=e=>({color:K("base.500","base.400")(e)}),GFe={variants:{subtext:VFe}},qFe=e=>({...gw(e),"::-webkit-scrollbar":{display:"initial"},"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
-      var(--invokeai-colors-base-50) 0%,
-      var(--invokeai-colors-base-50) 70%,
-      var(--invokeai-colors-base-200) 70%,
-      var(--invokeai-colors-base-200) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
-        var(--invokeai-colors-base-50) 0%,
-        var(--invokeai-colors-base-50) 70%,
-        var(--invokeai-colors-base-200) 70%,
-        var(--invokeai-colors-base-200) 100%)`}},_dark:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
-        var(--invokeai-colors-base-900) 0%,
-        var(--invokeai-colors-base-900) 70%,
-        var(--invokeai-colors-base-800) 70%,
-        var(--invokeai-colors-base-800) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
-          var(--invokeai-colors-base-900) 0%,
-          var(--invokeai-colors-base-900) 70%,
-          var(--invokeai-colors-base-800) 70%,
-          var(--invokeai-colors-base-800) 100%)`}}},p:2}),HFe={variants:{invokeAI:qFe},defaultProps:{size:"md",variant:"invokeAI"}},WFe=hr("popper-arrow-bg"),KFe=e=>({borderRadius:"base",shadow:"dark-lg",bg:K("base.700","base.200")(e),[WFe.variable]:K("colors.base.700","colors.base.200")(e),pb:1.5}),QFe={baseStyle:KFe},lN={backgroundColor:"accentAlpha.150 !important",borderColor:"accentAlpha.700 !important",borderRadius:"base !important",borderStyle:"dashed !important",_dark:{borderColor:"accent.400 !important"}},XFe={".react-flow__nodesselection-rect":{...lN,padding:"1rem !important",boxSizing:"content-box !important",transform:"translate(-1rem, -1rem) !important"},".react-flow__selection":lN},YFe={config:{cssVarPrefix:"invokeai",initialColorMode:"dark",useSystemColorMode:!1},layerStyles:{body:{bg:"base.50",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.50"}},first:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.850",color:"base.100"}},second:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},third:{bg:"base.300",color:"base.900",".chakra-ui-dark &":{bg:"base.750",color:"base.100"}},nodeBody:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},nodeHeader:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}},nodeFooter:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}}},styles:{global:()=>({layerStyle:"body","*":{...fFe},...XFe})},direction:"ltr",fonts:{body:"'Inter Variable', sans-serif",heading:"'Inter Variable', sans-serif"},shadows:{light:{accent:"0 0 10px 0 var(--invokeai-colors-accent-300)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-400)",ok:"0 0 7px var(--invokeai-colors-ok-600)",working:"0 0 7px var(--invokeai-colors-working-600)",error:"0 0 7px var(--invokeai-colors-error-600)"},dark:{accent:"0 0 10px 0 var(--invokeai-colors-accent-600)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-500)",ok:"0 0 7px var(--invokeai-colors-ok-400)",working:"0 0 7px var(--invokeai-colors-working-400)",error:"0 0 7px var(--invokeai-colors-error-400)"},selected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-400)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-500)"},hoverSelected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-400)"},hoverUnselected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 3px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 3px var(--invokeai-colors-accent-400)"},nodeSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-400)",dark:"0 0 0 3px var(--invokeai-colors-accent-500)"},nodeHovered:{light:"0 0 0 2px var(--invokeai-colors-accent-500)",dark:"0 0 0 2px var(--invokeai-colors-accent-400)"},nodeHoveredSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-500)",dark:"0 0 0 3px var(--invokeai-colors-accent-400)"},nodeInProgress:{light:"0 0 0 2px var(--invokeai-colors-accent-500), 0 0 10px 2px var(--invokeai-colors-accent-600)",dark:"0 0 0 2px var(--invokeai-colors-yellow-400), 0 0 20px 2px var(--invokeai-colors-orange-700)"}},colors:tLe,components:{Button:fLe,Input:ILe,Editable:CLe,Textarea:HFe,Tabs:UFe,Progress:dFe,Accordion:uLe,FormLabel:TLe,Switch:NFe,NumberInput:JLe,Select:vFe,Skeleton:_Fe,Slider:AFe,Popover:oFe,Modal:qLe,Checkbox:yLe,Menu:NLe,Text:GFe,Tooltip:QFe}},ZFe={defaultOptions:{isClosable:!0}},{toast:dg}=QDe({theme:YFe,defaultOptions:ZFe.defaultOptions}),JFe=()=>{Fe({matcher:Xr.endpoints.enqueueBatch.matchFulfilled,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;_e("queue").debug({enqueueResult:Xt(t)},"Batch enqueued"),dg.isActive("batch-queued")||dg({id:"batch-queued",title:Y("queue.batchQueued"),description:Y("queue.batchQueuedDesc",{item_count:t.enqueued,direction:n.prepend?Y("queue.front"):Y("queue.back")}),duration:1e3,status:"success"})}}),Fe({matcher:Xr.endpoints.enqueueBatch.matchRejected,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;if(!t){dg({title:Y("queue.batchFailedToQueue"),status:"error",description:"Unknown Error"}),_e("queue").error({batchConfig:Xt(n),error:Xt(t)},Y("queue.batchFailedToQueue"));return}const r=eLe.safeParse(t);if(r.success)r.data.data.detail.map(i=>{dg({id:"batch-failed-to-queue",title:Y8(SF(i.msg),{length:128}),status:"error",description:Y8(`Path:
-              ${i.loc.join(".")}`,{length:128})})});else{let i="Unknown Error",o;t.status===403&&"body"in t?i=ch(t,"body.detail","Unknown Error"):t.status===403&&"error"in t?i=ch(t,"error.detail","Unknown Error"):t.status===403&&"data"in t&&(i=ch(t,"data.detail","Unknown Error"),o=15e3),dg({title:Y("queue.batchFailedToQueue"),status:"error",description:i,...o?{duration:o}:{}})}_e("queue").error({batchConfig:Xt(n),error:Xt(t)},Y("queue.batchFailedToQueue"))}})},nK=UL(),Fe=nK.startListening;WEe();KEe();JEe();FEe();BEe();zEe();jEe();UEe();Nxe();HEe();QEe();XEe();SEe();$Ee();TEe();Pxe();JFe();tEe();Y3e();Xxe();Z3e();Qxe();Wxe();eEe();A4e();Txe();m4e();y4e();b4e();_4e();x4e();p4e();g4e();T4e();k4e();w4e();E4e();S4e();C4e();oEe();rEe();DEe();LEe();GEe();qEe();$xe();h4e();ake();VEe();eTe();Oxe();nTe();Ixe();kxe();J4e();I4e();oTe();const eBe={canvas:gle,gallery:R0e,generation:rle,nodes:f2e,postprocessing:h2e,system:_2e,config:$ae,ui:P2e,hotkeys:A2e,controlNet:_0e,dynamicPrompts:I0e,deleteImageModal:w0e,changeBoardModal:yle,lora:N0e,modelmanager:k2e,sdxl:g2e,queue:E2e,[us.reducerPath]:us.reducer},tBe=pp(eBe),nBe=exe(tBe),rBe=["canvas","gallery","generation","sdxl","nodes","postprocessing","system","ui","controlNet","dynamicPrompts","lora","modelmanager"],rK=xL({reducer:nBe,enhancers:e=>e.concat(txe(window.localStorage,rBe,{persistDebounce:300,serialize:hxe,unserialize:gxe,prefix:nxe})).concat(GL()),middleware:e=>e({serializableCheck:!1,immutableCheck:!1}).concat(us.middleware).concat(M2e).prepend(nK.middleware),devTools:{actionSanitizer:Sxe,stateSanitizer:wxe,trace:!0,predicate:(e,t)=>!xxe.includes(t.type)}}),iK=e=>e;MB.set(rK);const iBe=e=>{const{socket:t,storeApi:n}=e,{dispatch:r}=n;t.on("connect",()=>{_e("socketio").debug("Connected"),r(jj());const o=Vr.get();t.emit("subscribe_queue",{queue_id:o})}),t.on("connect_error",i=>{i&&i.message&&i.data==="ERR_UNAUTHENTICATED"&&r(qt(Ld({title:i.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{r(Uj())}),t.on("invocation_started",i=>{r(Gj({data:i}))}),t.on("generator_progress",i=>{r(Kj({data:i}))}),t.on("invocation_error",i=>{r(qj({data:i}))}),t.on("invocation_complete",i=>{r(qk({data:i}))}),t.on("graph_execution_state_complete",i=>{r(Hj({data:i}))}),t.on("model_load_started",i=>{r(Qj({data:i}))}),t.on("model_load_completed",i=>{r(Yj({data:i}))}),t.on("session_retrieval_error",i=>{r(Jj({data:i}))}),t.on("invocation_retrieval_error",i=>{r(tU({data:i}))}),t.on("queue_item_status_changed",i=>{r(rU({data:i}))})},Js=Object.create(null);Js.open="0";Js.close="1";Js.ping="2";Js.pong="3";Js.message="4";Js.upgrade="5";Js.noop="6";const sb=Object.create(null);Object.keys(Js).forEach(e=>{sb[Js[e]]=e});const $T={type:"error",data:"parser error"},oK=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",aK=typeof ArrayBuffer=="function",sK=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,AP=({type:e,data:t},n,r)=>oK&&t instanceof Blob?n?r(t):uN(t,r):aK&&(t instanceof ArrayBuffer||sK(t))?n?r(t):uN(new Blob([t]),r):r(Js[e]+(t||"")),uN=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function cN(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let F5;function oBe(e,t){if(oK&&e.data instanceof Blob)return e.data.arrayBuffer().then(cN).then(t);if(aK&&(e.data instanceof ArrayBuffer||sK(e.data)))return t(cN(e.data));AP(e,!1,n=>{F5||(F5=new TextEncoder),t(F5.encode(n))})}const dN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Og=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<dN.length;e++)Og[dN.charCodeAt(e)]=e;const aBe=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=Og[e.charCodeAt(r)],a=Og[e.charCodeAt(r+1)],s=Og[e.charCodeAt(r+2)],l=Og[e.charCodeAt(r+3)],c[i++]=o<<2|a>>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},sBe=typeof ArrayBuffer=="function",PP=(e,t)=>{if(typeof e!="string")return{type:"message",data:lK(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:lBe(e.substring(1),t)}:sb[n]?e.length>1?{type:sb[n],data:e.substring(1)}:{type:sb[n]}:$T},lBe=(e,t)=>{if(sBe){const n=aBe(e);return lK(n,t)}else return{base64:!0,data:e}},lK=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},uK=String.fromCharCode(30),uBe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{AP(o,!1,s=>{r[a]=s,++i===n&&t(r.join(uK))})})},cBe=(e,t)=>{const n=e.split(uK),r=[];for(let i=0;i<n.length;i++){const o=PP(n[i],t);if(r.push(o),o.type==="error")break}return r};function dBe(){return new TransformStream({transform(e,t){oBe(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let B5;function h1(e){return e.reduce((t,n)=>t+n.length,0)}function p1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function fBe(e,t){B5||(B5=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(r===0){if(h1(n)<1)break;const l=p1(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(h1(n)<2)break;const l=p1(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(h1(n)<8)break;const l=p1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue($T);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(h1(n)<i)break;const l=p1(n,i);s.enqueue(PP(o?l:B5.decode(l),t)),r=0}if(i===0||i>e){s.enqueue($T);break}}}})}const cK=4;function Fr(e){if(e)return hBe(e)}function hBe(e){for(var t in Fr.prototype)e[t]=Fr.prototype[t];return e}Fr.prototype.on=Fr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Fr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Fr.prototype.off=Fr.prototype.removeListener=Fr.prototype.removeAllListeners=Fr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Fr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Fr.prototype.emitReserved=Fr.prototype.emit;Fr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Fr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ya=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function dK(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const pBe=ya.setTimeout,gBe=ya.clearTimeout;function mw(e,t){t.useNativeTimers?(e.setTimeoutFn=pBe.bind(ya),e.clearTimeoutFn=gBe.bind(ya)):(e.setTimeoutFn=ya.setTimeout.bind(ya),e.clearTimeoutFn=ya.clearTimeout.bind(ya))}const mBe=1.33;function yBe(e){return typeof e=="string"?vBe(e):Math.ceil((e.byteLength||e.size)*mBe)}function vBe(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function bBe(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function _Be(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class SBe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class IP extends Fr{constructor(t){super(),this.writable=!1,mw(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new SBe(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=PP(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=bBe(t);return n.length?"?"+n:""}}const fK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),DT=64,xBe={};let fN=0,g1=0,hN;function pN(e){let t="";do t=fK[e%DT]+t,e=Math.floor(e/DT);while(e>0);return t}function hK(){const e=pN(+new Date);return e!==hN?(fN=0,hN=e):e+"."+pN(fN++)}for(;g1<DT;g1++)xBe[fK[g1]]=g1;let pK=!1;try{pK=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const wBe=pK;function gK(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||wBe))return new XMLHttpRequest}catch{}if(!t)try{return new ya[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function CBe(){}const EBe=function(){return new gK({xdomain:!1}).responseType!=null}();class TBe extends IP{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=EBe&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};cBe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,uBe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=hK()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Th(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let Th=class lb extends Fr{constructor(t,n){super(),mw(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=dK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new gK(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=lb.requestsCount++,lb.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=CBe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete lb.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Th.requestsCount=0;Th.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",gN);else if(typeof addEventListener=="function"){const e="onpagehide"in ya?"pagehide":"unload";addEventListener(e,gN,!1)}}function gN(){for(let e in Th.requests)Th.requests.hasOwnProperty(e)&&Th.requests[e].abort()}const RP=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),m1=ya.WebSocket||ya.MozWebSocket,mN=!0,kBe="arraybuffer",yN=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ABe extends IP{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=yN?{}:dK(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=mN&&!yN?n?new m1(t,n):new m1(t):new m1(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;AP(r,this.supportsBinary,o=>{const a={};try{mN&&this.ws.send(o)}catch{}i&&RP(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=hK()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!m1}}class PBe extends IP{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=fBe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=dBe();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),o())}).catch(s=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&RP(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const IBe={websocket:ABe,webtransport:PBe,polling:TBe},RBe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,OBe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function LT(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=RBe.exec(e||""),o={},a=14;for(;a--;)o[OBe[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=MBe(o,o.path),o.queryKey=NBe(o,o.query),o}function MBe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function NBe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let mK=class kf extends Fr{constructor(t,n={}){super(),this.binaryType=kBe,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=LT(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=LT(n.host).host),mw(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=_Be(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=cK,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new IBe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&kf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;kf.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;kf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const a=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function s(){a("transport closed")}function l(){a("socket closed")}function u(d){n&&d.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",kf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=yBe(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){kf.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};mK.protocol=cK;function $Be(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=LT(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const DBe=typeof ArrayBuffer=="function",LBe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,yK=Object.prototype.toString,FBe=typeof Blob=="function"||typeof Blob<"u"&&yK.call(Blob)==="[object BlobConstructor]",BBe=typeof File=="function"||typeof File<"u"&&yK.call(File)==="[object FileConstructor]";function OP(e){return DBe&&(e instanceof ArrayBuffer||LBe(e))||FBe&&e instanceof Blob||BBe&&e instanceof File}function ub(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ub(e[n]))return!0;return!1}if(OP(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ub(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ub(e[n]))return!0;return!1}function zBe(e){const t=[],n=e.data,r=e;return r.data=FT(n,t),r.attachments=t.length,{packet:r,buffers:t}}function FT(e,t){if(!e)return e;if(OP(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=FT(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=FT(e[r],t));return n}return e}function jBe(e,t){return e.data=BT(e.data,t),delete e.attachments,e}function BT(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=BT(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=BT(e[n],t));return e}const UBe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],VBe=5;var Bt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Bt||(Bt={}));class GBe{constructor(t){this.replacer=t}encode(t){return(t.type===Bt.EVENT||t.type===Bt.ACK)&&ub(t)?this.encodeAsBinary({type:t.type===Bt.EVENT?Bt.BINARY_EVENT:Bt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Bt.BINARY_EVENT||t.type===Bt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=zBe(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function vN(e){return Object.prototype.toString.call(e)==="[object Object]"}class MP extends Fr{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Bt.BINARY_EVENT;r||n.type===Bt.BINARY_ACK?(n.type=r?Bt.EVENT:Bt.ACK,this.reconstructor=new qBe(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(OP(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Bt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Bt.BINARY_EVENT||r.type===Bt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(MP.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Bt.CONNECT:return vN(n);case Bt.DISCONNECT:return n===void 0;case Bt.CONNECT_ERROR:return typeof n=="string"||vN(n);case Bt.EVENT:case Bt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&UBe.indexOf(n[0])===-1);case Bt.ACK:case Bt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class qBe{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=jBe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const HBe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:MP,Encoder:GBe,get PacketType(){return Bt},protocol:VBe},Symbol.toStringTag,{value:"Module"}));function qa(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const WBe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vK extends Fr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[qa(t,"open",this.onopen.bind(this)),qa(t,"packet",this.onpacket.bind(this)),qa(t,"error",this.onerror.bind(this)),qa(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(WBe.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Bt.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Bt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Bt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Bt.EVENT:case Bt.BINARY_EVENT:this.onevent(t);break;case Bt.ACK:case Bt.BINARY_ACK:this.onack(t);break;case Bt.DISCONNECT:this.ondisconnect();break;case Bt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Bt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Bt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Rp(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Rp.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Rp.prototype.reset=function(){this.attempts=0};Rp.prototype.setMin=function(e){this.ms=e};Rp.prototype.setMax=function(e){this.max=e};Rp.prototype.setJitter=function(e){this.jitter=e};class zT extends Fr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,mw(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Rp({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||HBe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new mK(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=qa(n,"open",function(){r.onopen(),t&&t()}),o=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},a=qa(n,"error",o);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(qa(t,"ping",this.onping.bind(this)),qa(t,"data",this.ondata.bind(this)),qa(t,"error",this.onerror.bind(this)),qa(t,"close",this.onclose.bind(this)),qa(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){RP(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new vK(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fg={};function cb(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=$Be(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=fg[i]&&o in fg[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new zT(r,t):(fg[i]||(fg[i]=new zT(r,t)),l=fg[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(cb,{Manager:zT,Socket:vK,io:cb,connect:cb});const bN=()=>{let e=!1,n=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`;const r={timeout:6e4,path:"/ws/socket.io",autoConnect:!1};if(["nodes","package"].includes("production")){const a=s0.get();a&&(n=a.replace(/^https?\:\/\//i,""));const s=Jh.get();s&&(r.auth={token:s}),r.transports=["websocket","polling"]}const i=cb(n,r);return a=>s=>l=>{e||(iBe({storeApi:a,socket:i}),e=!0,i.connect()),s(l)}},KBe=""+new URL("logo-13003d72.png",import.meta.url).href,QBe=()=>W.jsxs(kP,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[W.jsx(TP,{src:KBe,w:"8rem",h:"8rem"}),W.jsx(wP,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),XBe=I.memo(QBe);function jT(e){"@babel/helpers - typeof";return jT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jT(e)}var bK=[],YBe=bK.forEach,ZBe=bK.slice;function UT(e){return YBe.call(ZBe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function _K(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":jT(XMLHttpRequest))==="object"}function JBe(e){return!!e&&typeof e.then=="function"}function eze(e){return JBe(e)?e:Promise.resolve(e)}function tze(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var VT={exports:{}},y1={exports:{}},_N;function nze(){return _N||(_N=1,function(e,t){var n=typeof self<"u"?self:yt,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(E){return E&&DataView.prototype.isPrototypeOf(E)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function d(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}function f(E){return typeof E!="string"&&(E=String(E)),E}function h(E){var A={next:function(){var D=E.shift();return{done:D===void 0,value:D}}};return s.iterable&&(A[Symbol.iterator]=function(){return A}),A}function p(E){this.map={},E instanceof p?E.forEach(function(A,D){this.append(D,A)},this):Array.isArray(E)?E.forEach(function(A){this.append(A[0],A[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(A){this.append(A,E[A])},this)}p.prototype.append=function(E,A){E=d(E),A=f(A);var D=this.map[E];this.map[E]=D?D+", "+A:A},p.prototype.delete=function(E){delete this.map[d(E)]},p.prototype.get=function(E){return E=d(E),this.has(E)?this.map[E]:null},p.prototype.has=function(E){return this.map.hasOwnProperty(d(E))},p.prototype.set=function(E,A){this.map[d(E)]=f(A)},p.prototype.forEach=function(E,A){for(var D in this.map)this.map.hasOwnProperty(D)&&E.call(A,this.map[D],D,this)},p.prototype.keys=function(){var E=[];return this.forEach(function(A,D){E.push(D)}),h(E)},p.prototype.values=function(){var E=[];return this.forEach(function(A){E.push(A)}),h(E)},p.prototype.entries=function(){var E=[];return this.forEach(function(A,D){E.push([D,A])}),h(E)},s.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function _(E){return new Promise(function(A,D){E.onload=function(){A(E.result)},E.onerror=function(){D(E.error)}})}function b(E){var A=new FileReader,D=_(A);return A.readAsArrayBuffer(E),D}function y(E){var A=new FileReader,D=_(A);return A.readAsText(E),D}function g(E){for(var A=new Uint8Array(E),D=new Array(A.length),L=0;L<A.length;L++)D[L]=String.fromCharCode(A[L]);return D.join("")}function v(E){if(E.slice)return E.slice(0);var A=new Uint8Array(E.byteLength);return A.set(new Uint8Array(E)),A.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(E){this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:s.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:s.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():s.arrayBuffer&&s.blob&&l(E)?(this._bodyArrayBuffer=v(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||c(E))?this._bodyArrayBuffer=v(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var E=m(this);if(E)return E;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var E=m(this);if(E)return E;if(this._bodyBlob)return y(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(g(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(E){var A=E.toUpperCase();return w.indexOf(A)>-1?A:E}function C(E,A){A=A||{};var D=A.body;if(E instanceof C){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,A.headers||(this.headers=new p(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!D&&E._bodyInit!=null&&(D=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=A.credentials||this.credentials||"same-origin",(A.headers||!this.headers)&&(this.headers=new p(A.headers)),this.method=x(A.method||this.method||"GET"),this.mode=A.mode||this.mode||null,this.signal=A.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function k(E){var A=new FormData;return E.trim().split("&").forEach(function(D){if(D){var L=D.split("="),M=L.shift().replace(/\+/g," "),R=L.join("=").replace(/\+/g," ");A.append(decodeURIComponent(M),decodeURIComponent(R))}}),A}function T(E){var A=new p,D=E.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(L){var M=L.split(":"),R=M.shift().trim();if(R){var N=M.join(":").trim();A.append(R,N)}}),A}S.call(C.prototype);function P(E,A){A||(A={}),this.type="default",this.status=A.status===void 0?200:A.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in A?A.statusText:"OK",this.headers=new p(A.headers),this.url=A.url||"",this._initBody(E)}S.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},P.error=function(){var E=new P(null,{status:0,statusText:""});return E.type="error",E};var $=[301,302,303,307,308];P.redirect=function(E,A){if($.indexOf(A)===-1)throw new RangeError("Invalid status code");return new P(null,{status:A,headers:{location:E}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(A,D){this.message=A,this.name=D;var L=Error(A);this.stack=L.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function O(E,A){return new Promise(function(D,L){var M=new C(E,A);if(M.signal&&M.signal.aborted)return L(new a.DOMException("Aborted","AbortError"));var R=new XMLHttpRequest;function N(){R.abort()}R.onload=function(){var B={status:R.status,statusText:R.statusText,headers:T(R.getAllResponseHeaders()||"")};B.url="responseURL"in R?R.responseURL:B.headers.get("X-Request-URL");var U="response"in R?R.response:R.responseText;D(new P(U,B))},R.onerror=function(){L(new TypeError("Network request failed"))},R.ontimeout=function(){L(new TypeError("Network request failed"))},R.onabort=function(){L(new a.DOMException("Aborted","AbortError"))},R.open(M.method,M.url,!0),M.credentials==="include"?R.withCredentials=!0:M.credentials==="omit"&&(R.withCredentials=!1),"responseType"in R&&s.blob&&(R.responseType="blob"),M.headers.forEach(function(B,U){R.setRequestHeader(U,B)}),M.signal&&(M.signal.addEventListener("abort",N),R.onreadystatechange=function(){R.readyState===4&&M.signal.removeEventListener("abort",N)}),R.send(typeof M._bodyInit>"u"?null:M._bodyInit)})}return O.polyfill=!0,o.fetch||(o.fetch=O,o.Headers=p,o.Request=C,o.Response=P),a.Headers=p,a.Request=C,a.Response=P,a.fetch=O,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(y1,y1.exports)),y1.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof yt<"u"&&yt.fetch?n=yt.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof tze<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||nze();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(VT,VT.exports);var SK=VT.exports;const xK=mc(SK),SN=UN({__proto__:null,default:xK},[SK]);function aS(e){"@babel/helpers - typeof";return aS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aS(e)}var zl;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?zl=global.fetch:typeof window<"u"&&window.fetch?zl=window.fetch:zl=fetch);var N0;_K()&&(typeof global<"u"&&global.XMLHttpRequest?N0=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(N0=window.XMLHttpRequest));var sS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?sS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(sS=window.ActiveXObject));!zl&&SN&&!N0&&!sS&&(zl=xK||SN);typeof zl!="function"&&(zl=void 0);var GT=function(t,n){if(n&&aS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},xN=function(t,n,r){zl(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},wN=!1,rze=function(t,n,r,i){t.queryStringParams&&(n=GT(n,t.queryStringParams));var o=UT({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=UT({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},wN?{}:a);try{xN(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),xN(n,s,i),wN=!0}catch(u){i(u)}}},ize=function(t,n,r,i){r&&aS(r)==="object"&&(r=GT("",r).slice(1)),t.queryStringParams&&(n=GT(n,t.queryStringParams));try{var o;N0?o=new N0:o=new sS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},oze=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},zl&&n.indexOf("file:")!==0)return rze(t,n,r,i);if(_K()||typeof ActiveXObject=="function")return ize(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function $0(e){"@babel/helpers - typeof";return $0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$0(e)}function aze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wK(r.key),r)}}function sze(e,t,n){return t&&CN(e.prototype,t),n&&CN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lze(e,t,n){return t=wK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wK(e){var t=uze(e,"string");return $0(t)==="symbol"?t:String(t)}function uze(e,t){if($0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($0(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cze=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return lze({},r,i||"")},parseLoadPayload:function(n,r){},request:oze,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},CK=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};aze(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return sze(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=UT(i,this.options||{},cze()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=eze(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(c,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+c.message,!0);if(c)return r(c,!1);var f,h;try{typeof d.data=="string"?f=a.options.parse(d.data,i,o):f=d.data}catch{h="failed parsing "+n+" to json"}if(h)return r(h,!1);r(null,f)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(f,r));var p=s.services.interpolator.interpolate(h,{lng:f,ns:r});s.options.request(s.options,p,l,function(m,_){u+=1,c.push(m),d.push(_),u===n.length&&typeof a=="function"&&a(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,h){f&&a.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&h&&a.log("loaded namespace ".concat(d," for language ").concat(c),h),i.loaded("".concat(c,"|").concat(d),f,h)})})})}}}]),e}();CK.type="backend";be.use(CK).use(G4e).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const yw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Op(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function NP(e){return"nodeType"in e}function fo(e){var t,n;return e?Op(e)?e:NP(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function $P(e){const{Document:t}=fo(e);return e instanceof t}function zy(e){return Op(e)?!1:e instanceof fo(e).HTMLElement}function dze(e){return e instanceof fo(e).SVGElement}function Mp(e){return e?Op(e)?e.document:NP(e)?$P(e)?e:zy(e)?e.ownerDocument:document:document:document}const el=yw?I.useLayoutEffect:I.useEffect;function vw(e){const t=I.useRef(e);return el(()=>{t.current=e}),I.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function fze(){const e=I.useRef(null),t=I.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=I.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function D0(e,t){t===void 0&&(t=[e]);const n=I.useRef(e);return el(()=>{n.current!==e&&(n.current=e)},t),n}function jy(e,t){const n=I.useRef();return I.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function lS(e){const t=vw(e),n=I.useRef(null),r=I.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function uS(e){const t=I.useRef();return I.useEffect(()=>{t.current=e},[e]),t.current}let z5={};function bw(e,t){return I.useMemo(()=>{if(t)return t;const n=z5[e]==null?0:z5[e]+1;return z5[e]=n,e+"-"+n},[e,t])}function EK(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const s=Object.entries(a);for(const[l,u]of s){const c=o[l];c!=null&&(o[l]=c+e*u)}return o},{...t})}}const kh=EK(1),cS=EK(-1);function hze(e){return"clientX"in e&&"clientY"in e}function DP(e){if(!e)return!1;const{KeyboardEvent:t}=fo(e.target);return t&&e instanceof t}function pze(e){if(!e)return!1;const{TouchEvent:t}=fo(e.target);return t&&e instanceof t}function L0(e){if(pze(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return hze(e)?{x:e.clientX,y:e.clientY}:null}const F0=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[F0.Translate.toString(e),F0.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),EN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function gze(e){return e.matches(EN)?e:e.querySelector(EN)}const mze={display:"none"};function yze(e){let{id:t,value:n}=e;return Tn.createElement("div",{id:t,style:mze},n)}const vze={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function bze(e){let{id:t,announcement:n}=e;return Tn.createElement("div",{id:t,style:vze,role:"status","aria-live":"assertive","aria-atomic":!0},n)}function _ze(){const[e,t]=I.useState("");return{announce:I.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const TK=I.createContext(null);function Sze(e){const t=I.useContext(TK);I.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xze(){const[e]=I.useState(()=>new Set),t=I.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[I.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const wze={draggable:`
-    To pick up a draggable item, press the space bar.
-    While dragging, use the arrow keys to move the item.
-    Press space again to drop the item in its new position, or press escape to cancel.
-  `},Cze={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Eze(e){let{announcements:t=Cze,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=wze}=e;const{announce:o,announcement:a}=_ze(),s=bw("DndLiveRegion"),[l,u]=I.useState(!1);if(I.useEffect(()=>{u(!0)},[]),Sze(I.useMemo(()=>({onDragStart(d){let{active:f}=d;o(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&o(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;o(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;o(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;o(t.onDragCancel({active:f,over:h}))}}),[o,t])),!l)return null;const c=Tn.createElement(Tn.Fragment,null,Tn.createElement(yze,{id:r,value:i.draggable}),Tn.createElement(bze,{id:s,announcement:a}));return n?Vo.createPortal(c,n):c}var Hr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Hr||(Hr={}));function dS(){}function TN(e,t){return I.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Tze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return I.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const cs=Object.freeze({x:0,y:0});function kze(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Aze(e,t){const n=L0(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Pze(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ize(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Rze(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Oze(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function Mze(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,c=a*s,d=c/(l+u-c);return Number(d.toFixed(4))}return 0}const Nze=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const l=Mze(s,t);l>0&&i.push({id:a,data:{droppableContainer:o,value:l}})}}return i.sort(Ize)};function $ze(e,t){const{top:n,left:r,bottom:i,right:o}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=o}const Dze=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const o of t){const{id:a}=o,s=n.get(a);if(s&&$ze(r,s)){const u=Rze(s).reduce((d,f)=>d+kze(r,f),0),c=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(Pze)};function Lze(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function kK(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:cs}function Fze(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,s)=>({...a,top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),{...n})}}const Bze=Fze(1);function AK(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function zze(e,t,n){const r=AK(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l}}const jze={ignoreTransform:!1};function Uy(e,t){t===void 0&&(t=jze);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=fo(e).getComputedStyle(e);u&&(n=zze(n,u,c))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function kN(e){return Uy(e,{ignoreTransform:!0})}function Uze(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Vze(e,t){return t===void 0&&(t=fo(e).getComputedStyle(e)),t.position==="fixed"}function Gze(e,t){t===void 0&&(t=fo(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function LP(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if($P(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!zy(i)||dze(i)||n.includes(i))return n;const o=fo(e).getComputedStyle(i);return i!==e&&Gze(i,o)&&n.push(i),Vze(i,o)?n:r(i.parentNode)}return e?r(e):n}function PK(e){const[t]=LP(e,1);return t??null}function j5(e){return!yw||!e?null:Op(e)?e:NP(e)?$P(e)||e===Mp(e).scrollingElement?window:zy(e)?e:null:null}function IK(e){return Op(e)?e.scrollX:e.scrollLeft}function RK(e){return Op(e)?e.scrollY:e.scrollTop}function qT(e){return{x:IK(e),y:RK(e)}}var ci;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ci||(ci={}));function OK(e){return!yw||!e?!1:e===document.scrollingElement}function MK(e){const t={x:0,y:0},n=OK(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const qze={x:.2,y:.2};function Hze(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=qze);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=MK(e),h={x:0,y:0},p={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(h.y=ci.Backward,p.y=r*Math.abs((t.top+m.height-o)/m.height)):!c&&l>=t.bottom-m.height&&(h.y=ci.Forward,p.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!f&&s>=t.right-m.width?(h.x=ci.Forward,p.x=r*Math.abs((t.right-m.width-s)/m.width)):!d&&a<=t.left+m.width&&(h.x=ci.Backward,p.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:h,speed:p}}function Wze(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function NK(e){return e.reduce((t,n)=>kh(t,qT(n)),cs)}function Kze(e){return e.reduce((t,n)=>t+IK(n),0)}function Qze(e){return e.reduce((t,n)=>t+RK(n),0)}function $K(e,t){if(t===void 0&&(t=Uy),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);PK(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xze=[["x",["left","right"],Kze],["y",["top","bottom"],Qze]];class FP{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=LP(n),i=NK(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,s]of Xze)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=s(r),c=i[o]-u;return this.rect[l]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class am{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Yze(e){const{EventTarget:t}=fo(e);return e instanceof t?e:Mp(e)}function U5(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var pa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pa||(pa={}));function AN(e){e.preventDefault()}function Zze(e){e.stopPropagation()}var Mn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Mn||(Mn={}));const DK={start:[Mn.Space,Mn.Enter],cancel:[Mn.Esc],end:[Mn.Space,Mn.Enter]},Jze=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Mn.Right:return{...n,x:n.x+25};case Mn.Left:return{...n,x:n.x-25};case Mn.Down:return{...n,y:n.y+25};case Mn.Up:return{...n,y:n.y-25}}};class LK{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new am(Mp(n)),this.windowListeners=new am(fo(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&$K(r),n(cs)}handleKeyDown(t){if(DP(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=DK,coordinateGetter:a=Jze,scrollBehavior:s="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:cs;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=cS(d,c),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const m of p){const _=t.code,{isTop:b,isRight:y,isLeft:g,isBottom:v,maxScroll:S,minScroll:w}=MK(m),x=Wze(m),C={x:Math.min(_===Mn.Right?x.right-x.width/2:x.right,Math.max(_===Mn.Right?x.left:x.left+x.width/2,d.x)),y:Math.min(_===Mn.Down?x.bottom-x.height/2:x.bottom,Math.max(_===Mn.Down?x.top:x.top+x.height/2,d.y))},k=_===Mn.Right&&!y||_===Mn.Left&&!g,T=_===Mn.Down&&!v||_===Mn.Up&&!b;if(k&&C.x!==d.x){const P=m.scrollLeft+f.x,$=_===Mn.Right&&P<=S.x||_===Mn.Left&&P>=w.x;if($&&!f.y){m.scrollTo({left:P,behavior:s});return}$?h.x=m.scrollLeft-P:h.x=_===Mn.Right?m.scrollLeft-S.x:m.scrollLeft-w.x,h.x&&m.scrollBy({left:-h.x,behavior:s});break}else if(T&&C.y!==d.y){const P=m.scrollTop+f.y,$=_===Mn.Down&&P<=S.y||_===Mn.Up&&P>=w.y;if($&&!f.x){m.scrollTo({top:P,behavior:s});return}$?h.y=m.scrollTop-P:h.y=_===Mn.Down?m.scrollTop-S.y:m.scrollTop-w.y,h.y&&m.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,kh(cS(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}LK.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=DK,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function PN(e){return!!(e&&"distance"in e)}function IN(e){return!!(e&&"delay"in e)}class BP{constructor(t,n,r){var i;r===void 0&&(r=Yze(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Mp(a),this.documentListeners=new am(this.document),this.listeners=new am(r),this.windowListeners=new am(fo(a)),this.initialCoordinates=(i=L0(o))!=null?i:cs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.DragStart,AN),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),this.windowListeners.add(pa.ContextMenu,AN),this.documentListeners.add(pa.Keydown,this.handleKeydown),n){if(PN(n))return;if(IN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(pa.Click,Zze,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pa.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const l=(n=L0(t))!=null?n:cs,u=cS(i,l);if(!r&&s){if(IN(s))return U5(u,s.tolerance)?this.handleCancel():void 0;if(PN(s))return s.tolerance!=null&&U5(u,s.tolerance)?this.handleCancel():U5(u,s.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Mn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const eje={move:{name:"pointermove"},end:{name:"pointerup"}};class FK extends BP{constructor(t){const{event:n}=t,r=Mp(n.target);super(t,eje,r)}}FK.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const tje={move:{name:"mousemove"},end:{name:"mouseup"}};var HT;(function(e){e[e.RightClick=2]="RightClick"})(HT||(HT={}));class BK extends BP{constructor(t){super(t,tje,Mp(t.event.target))}}BK.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===HT.RightClick?!1:(r==null||r({event:n}),!0)}}];const V5={move:{name:"touchmove"},end:{name:"touchend"}};class zK extends BP{constructor(t){super(t,V5)}static setup(){return window.addEventListener(V5.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(V5.move.name,t)};function t(){}}}zK.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var sm;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(sm||(sm={}));var fS;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(fS||(fS={}));function nje(e){let{acceleration:t,activator:n=sm.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=fS.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const h=ije({delta:d,disabled:!o}),[p,m]=fze(),_=I.useRef({x:0,y:0}),b=I.useRef({x:0,y:0}),y=I.useMemo(()=>{switch(n){case sm.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case sm.DraggableRect:return i}},[n,i,l]),g=I.useRef(null),v=I.useCallback(()=>{const w=g.current;if(!w)return;const x=_.current.x*b.current.x,C=_.current.y*b.current.y;w.scrollBy(x,C)},[]),S=I.useMemo(()=>s===fS.TreeOrder?[...u].reverse():u,[s,u]);I.useEffect(()=>{if(!o||!u.length||!y){m();return}for(const w of S){if((r==null?void 0:r(w))===!1)continue;const x=u.indexOf(w),C=c[x];if(!C)continue;const{direction:k,speed:T}=Hze(w,C,y,t,f);for(const P of["x","y"])h[P][k[P]]||(T[P]=0,k[P]=0);if(T.x>0||T.y>0){m(),g.current=w,p(v,a),_.current=T,b.current=k;return}}_.current={x:0,y:0},b.current={x:0,y:0},m()},[t,v,r,m,o,a,JSON.stringify(y),JSON.stringify(h),p,u,S,c,JSON.stringify(f)])}const rje={x:{[ci.Backward]:!1,[ci.Forward]:!1},y:{[ci.Backward]:!1,[ci.Forward]:!1}};function ije(e){let{delta:t,disabled:n}=e;const r=uS(t);return jy(i=>{if(n||!r||!i)return rje;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ci.Backward]:i.x[ci.Backward]||o.x===-1,[ci.Forward]:i.x[ci.Forward]||o.x===1},y:{[ci.Backward]:i.y[ci.Backward]||o.y===-1,[ci.Forward]:i.y[ci.Forward]||o.y===1}}},[n,t,r])}function oje(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return jy(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function aje(e,t){return I.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var B0;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(B0||(B0={}));var WT;(function(e){e.Optimized="optimized"})(WT||(WT={}));const RN=new Map;function sje(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=I.useState(null),{frequency:s,measure:l,strategy:u}=i,c=I.useRef(e),d=_(),f=D0(d),h=I.useCallback(function(b){b===void 0&&(b=[]),!f.current&&a(y=>y===null?b:y.concat(b.filter(g=>!y.includes(g))))},[f]),p=I.useRef(null),m=jy(b=>{if(d&&!n)return RN;if(!b||b===RN||c.current!==e||o!=null){const y=new Map;for(let g of e){if(!g)continue;if(o&&o.length>0&&!o.includes(g.id)&&g.rect.current){y.set(g.id,g.rect.current);continue}const v=g.node.current,S=v?new FP(l(v),v):null;g.rect.current=S,S&&y.set(g.id,S)}return y}return b},[e,o,n,d,l]);return I.useEffect(()=>{c.current=e},[e]),I.useEffect(()=>{d||h()},[n,d]),I.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),I.useEffect(()=>{d||typeof s!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},s))},[s,d,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:o!=null};function _(){switch(u){case B0.Always:return!1;case B0.BeforeDragging:return n;default:return!n}}}function zP(e,t){return jy(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function lje(e,t){return zP(e,t)}function uje(e){let{callback:t,disabled:n}=e;const r=vw(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function _w(e){let{callback:t,disabled:n}=e;const r=vw(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function cje(e){return new FP(Uy(e),e)}function ON(e,t,n){t===void 0&&(t=cje);const[r,i]=I.useReducer(s,null),o=uje({callback(l){if(e)for(const u of l){const{type:c,target:d}=u;if(c==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=_w({callback:i});return el(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r;function s(l){if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const c=t(e);return JSON.stringify(l)===JSON.stringify(c)?l:c}}function dje(e){const t=zP(e);return kK(e,t)}const MN=[];function fje(e){const t=I.useRef(e),n=jy(r=>e?r&&r!==MN&&e&&t.current&&e.parentNode===t.current.parentNode?r:LP(e):MN,[e]);return I.useEffect(()=>{t.current=e},[e]),n}function hje(e){const[t,n]=I.useState(null),r=I.useRef(e),i=I.useCallback(o=>{const a=j5(o.target);a&&n(s=>s?(s.set(a,qT(a)),new Map(s)):null)},[]);return I.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(l=>{const u=j5(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,qT(u)]):null}).filter(l=>l!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(l=>{const u=j5(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),I.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>kh(o,a),cs):NK(e):cs,[e,t])}function NN(e,t){t===void 0&&(t=[]);const n=I.useRef(null);return I.useEffect(()=>{n.current=null},t),I.useEffect(()=>{const r=e!==cs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?cS(e,n.current):cs}function pje(e){I.useEffect(()=>{if(!yw)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function gje(e,t){return I.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function jK(e){return I.useMemo(()=>e?Uze(e):null,[e])}const G5=[];function mje(e,t){t===void 0&&(t=Uy);const[n]=e,r=jK(n?fo(n):null),[i,o]=I.useReducer(s,G5),a=_w({callback:o});return e.length>0&&i===G5&&o(),el(()=>{e.length?e.forEach(l=>a==null?void 0:a.observe(l)):(a==null||a.disconnect(),o())},[e]),i;function s(){return e.length?e.map(l=>OK(l)?r:new FP(t(l),l)):G5}}function UK(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return zy(t)?t:e}function yje(e){let{measure:t}=e;const[n,r]=I.useState(null),i=I.useCallback(u=>{for(const{target:c}of u)if(zy(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=_w({callback:i}),a=I.useCallback(u=>{const c=UK(u);o==null||o.disconnect(),c&&(o==null||o.observe(c)),r(c?t(c):null)},[t,o]),[s,l]=lS(a);return I.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}const vje=[{sensor:FK,options:{}},{sensor:LK,options:{}}],bje={current:{}},db={draggable:{measure:kN},droppable:{measure:kN,strategy:B0.WhileDragging,frequency:WT.Optimized},dragOverlay:{measure:Uy}};class lm extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const _je={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new lm,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:dS},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:db,measureDroppableContainers:dS,windowRect:null,measuringScheduled:!1},VK={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:dS,draggableNodes:new Map,over:null,measureDroppableContainers:dS},Vy=I.createContext(VK),GK=I.createContext(_je);function Sje(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new lm}}}function xje(e,t){switch(t.type){case Hr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Hr.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Hr.DragEnd:case Hr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Hr.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new lm(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Hr.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new lm(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case Hr.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new lm(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function wje(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=I.useContext(Vy),o=uS(r),a=uS(n==null?void 0:n.id);return I.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!DP(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[l.current,u.current]){if(!c)continue;const d=gze(c);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function qK(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function Cje(e){return I.useMemo(()=>({draggable:{...db.draggable,...e==null?void 0:e.draggable},droppable:{...db.droppable,...e==null?void 0:e.droppable},dragOverlay:{...db.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Eje(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=I.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;el(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),d=kK(c,r);if(a||(d.x=0),s||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=PK(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,a,s,r,n])}const Sw=I.createContext({...cs,scaleX:1,scaleY:1});var wu;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(wu||(wu={}));const Tje=I.memo(function(t){var n,r,i,o;let{id:a,accessibility:s,autoScroll:l=!0,children:u,sensors:c=vje,collisionDetection:d=Nze,measuring:f,modifiers:h,...p}=t;const m=I.useReducer(xje,void 0,Sje),[_,b]=m,[y,g]=xze(),[v,S]=I.useState(wu.Uninitialized),w=v===wu.Initialized,{draggable:{active:x,nodes:C,translate:k},droppable:{containers:T}}=_,P=x?C.get(x):null,$=I.useRef({initial:null,translated:null}),O=I.useMemo(()=>{var zn;return x!=null?{id:x,data:(zn=P==null?void 0:P.data)!=null?zn:bje,rect:$}:null},[x,P]),E=I.useRef(null),[A,D]=I.useState(null),[L,M]=I.useState(null),R=D0(p,Object.values(p)),N=bw("DndDescribedBy",a),B=I.useMemo(()=>T.getEnabled(),[T]),U=Cje(f),{droppableRects:G,measureDroppableContainers:Z,measuringScheduled:ee}=sje(B,{dragging:w,dependencies:[k.x,k.y],config:U.droppable}),J=oje(C,x),j=I.useMemo(()=>L?L0(L):null,[L]),Q=sl(),ne=lje(J,U.draggable.measure);Eje({activeNode:x?C.get(x):null,config:Q.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const se=ON(J,U.draggable.measure,ne),ye=ON(J?J.parentElement:null),ce=I.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),bt=T.getNodeFor((n=ce.current.over)==null?void 0:n.id),ot=yje({measure:U.dragOverlay.measure}),ze=(r=ot.nodeRef.current)!=null?r:J,mt=w?(i=ot.rect)!=null?i:se:null,Pe=!!(ot.nodeRef.current&&ot.rect),en=dje(Pe?null:se),Pr=jK(ze?fo(ze):null),Ln=fje(w?bt??J:null),An=mje(Ln),tn=qK(h,{transform:{x:k.x-en.x,y:k.y-en.y,scaleX:1,scaleY:1},activatorEvent:L,active:O,activeNodeRect:se,containerNodeRect:ye,draggingNodeRect:mt,over:ce.current.over,overlayNodeRect:ot.rect,scrollableAncestors:Ln,scrollableAncestorRects:An,windowRect:Pr}),Fn=j?kh(j,k):null,Ir=hje(Ln),ho=NN(Ir),ei=NN(Ir,[se]),pr=kh(tn,ho),Br=mt?Bze(mt,tn):null,ti=O&&Br?d({active:O,collisionRect:Br,droppableRects:G,droppableContainers:B,pointerCoordinates:Fn}):null,Bn=Oze(ti,"id"),[_n,Mi]=I.useState(null),gi=Pe?tn:kh(tn,ei),Qi=Lze(gi,(o=_n==null?void 0:_n.rect)!=null?o:null,se),Da=I.useCallback((zn,nn)=>{let{sensor:zr,options:Or}=nn;if(E.current==null)return;const Mr=C.get(E.current);if(!Mr)return;const ni=zn.nativeEvent,Ni=new zr({active:E.current,activeNode:Mr,event:ni,options:Or,context:ce,onStart(mi){const jr=E.current;if(jr==null)return;const La=C.get(jr);if(!La)return;const{onDragStart:gs}=R.current,yi={active:{id:jr,data:La.data,rect:$}};Vo.unstable_batchedUpdates(()=>{gs==null||gs(yi),S(wu.Initializing),b({type:Hr.DragStart,initialCoordinates:mi,active:jr}),y({type:"onDragStart",event:yi})})},onMove(mi){b({type:Hr.DragMove,coordinates:mi})},onEnd:go(Hr.DragEnd),onCancel:go(Hr.DragCancel)});Vo.unstable_batchedUpdates(()=>{D(Ni),M(zn.nativeEvent)});function go(mi){return async function(){const{active:La,collisions:gs,over:yi,scrollAdjustedTranslate:ou}=ce.current;let oa=null;if(La&&ou){const{cancelDrop:ri}=R.current;oa={activatorEvent:ni,active:La,collisions:gs,delta:ou,over:yi},mi===Hr.DragEnd&&typeof ri=="function"&&await Promise.resolve(ri(oa))&&(mi=Hr.DragCancel)}E.current=null,Vo.unstable_batchedUpdates(()=>{b({type:mi}),S(wu.Uninitialized),Mi(null),D(null),M(null);const ri=mi===Hr.DragEnd?"onDragEnd":"onDragCancel";if(oa){const ll=R.current[ri];ll==null||ll(oa),y({type:ri,event:oa})}})}}},[C]),Rr=I.useCallback((zn,nn)=>(zr,Or)=>{const Mr=zr.nativeEvent,ni=C.get(Or);if(E.current!==null||!ni||Mr.dndKit||Mr.defaultPrevented)return;const Ni={active:ni};zn(zr,nn.options,Ni)===!0&&(Mr.dndKit={capturedBy:nn.sensor},E.current=Or,Da(zr,nn))},[C,Da]),po=aje(c,Rr);pje(c),el(()=>{se&&v===wu.Initializing&&S(wu.Initialized)},[se,v]),I.useEffect(()=>{const{onDragMove:zn}=R.current,{active:nn,activatorEvent:zr,collisions:Or,over:Mr}=ce.current;if(!nn||!zr)return;const ni={active:nn,activatorEvent:zr,collisions:Or,delta:{x:pr.x,y:pr.y},over:Mr};Vo.unstable_batchedUpdates(()=>{zn==null||zn(ni),y({type:"onDragMove",event:ni})})},[pr.x,pr.y]),I.useEffect(()=>{const{active:zn,activatorEvent:nn,collisions:zr,droppableContainers:Or,scrollAdjustedTranslate:Mr}=ce.current;if(!zn||E.current==null||!nn||!Mr)return;const{onDragOver:ni}=R.current,Ni=Or.get(Bn),go=Ni&&Ni.rect.current?{id:Ni.id,rect:Ni.rect.current,data:Ni.data,disabled:Ni.disabled}:null,mi={active:zn,activatorEvent:nn,collisions:zr,delta:{x:Mr.x,y:Mr.y},over:go};Vo.unstable_batchedUpdates(()=>{Mi(go),ni==null||ni(mi),y({type:"onDragOver",event:mi})})},[Bn]),el(()=>{ce.current={activatorEvent:L,active:O,activeNode:J,collisionRect:Br,collisions:ti,droppableRects:G,draggableNodes:C,draggingNode:ze,draggingNodeRect:mt,droppableContainers:T,over:_n,scrollableAncestors:Ln,scrollAdjustedTranslate:pr},$.current={initial:mt,translated:Br}},[O,J,ti,Br,C,ze,mt,G,T,_n,Ln,pr]),nje({...Q,delta:k,draggingRect:Br,pointerCoordinates:Fn,scrollableAncestors:Ln,scrollableAncestorRects:An});const al=I.useMemo(()=>({active:O,activeNode:J,activeNodeRect:se,activatorEvent:L,collisions:ti,containerNodeRect:ye,dragOverlay:ot,draggableNodes:C,droppableContainers:T,droppableRects:G,over:_n,measureDroppableContainers:Z,scrollableAncestors:Ln,scrollableAncestorRects:An,measuringConfiguration:U,measuringScheduled:ee,windowRect:Pr}),[O,J,se,L,ti,ye,ot,C,T,G,_n,Z,Ln,An,U,ee,Pr]),Do=I.useMemo(()=>({activatorEvent:L,activators:po,active:O,activeNodeRect:se,ariaDescribedById:{draggable:N},dispatch:b,draggableNodes:C,over:_n,measureDroppableContainers:Z}),[L,po,O,se,b,N,C,_n,Z]);return Tn.createElement(TK.Provider,{value:g},Tn.createElement(Vy.Provider,{value:Do},Tn.createElement(GK.Provider,{value:al},Tn.createElement(Sw.Provider,{value:Qi},u)),Tn.createElement(wje,{disabled:(s==null?void 0:s.restoreFocus)===!1})),Tn.createElement(Eze,{...s,hiddenTextDescribedById:N}));function sl(){const zn=(A==null?void 0:A.autoScrollEnabled)===!1,nn=typeof l=="object"?l.enabled===!1:l===!1,zr=w&&!zn&&!nn;return typeof l=="object"?{...l,enabled:zr}:{enabled:zr}}}),kje=I.createContext(null),$N="button",Aje="Droppable";function tQe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=bw(Aje),{activators:a,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=I.useContext(Vy),{role:h=$N,roleDescription:p="draggable",tabIndex:m=0}=i??{},_=(l==null?void 0:l.id)===t,b=I.useContext(_?Sw:kje),[y,g]=lS(),[v,S]=lS(),w=gje(a,t),x=D0(n);el(()=>(d.set(t,{id:t,key:o,node:y,activatorNode:v,data:x}),()=>{const k=d.get(t);k&&k.key===o&&d.delete(t)}),[d,t]);const C=I.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":_&&h===$N?!0:void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[r,h,m,_,p,c.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:C,isDragging:_,listeners:r?void 0:w,node:y,over:f,setNodeRef:g,setActivatorNodeRef:S,transform:b}}function Pje(){return I.useContext(GK)}const Ije="Droppable",Rje={timeout:25};function nQe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=bw(Ije),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=I.useContext(Vy),c=I.useRef({disabled:n}),d=I.useRef(!1),f=I.useRef(null),h=I.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:_}={...Rje,...i},b=D0(m??r),y=I.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},_)},[_]),g=_w({callback:y,disabled:p||!a}),v=I.useCallback((C,k)=>{g&&(k&&(g.unobserve(k),d.current=!1),C&&g.observe(C))},[g]),[S,w]=lS(v),x=D0(t);return I.useEffect(()=>{!g||!S.current||(g.disconnect(),d.current=!1,g.observe(S.current))},[S,g]),el(()=>(s({type:Hr.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:x}}),()=>s({type:Hr.UnregisterDroppable,key:o,id:r})),[r]),I.useEffect(()=>{n!==c.current.disabled&&(s({type:Hr.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:w}}function Oje(e){let{animation:t,children:n}=e;const[r,i]=I.useState(null),[o,a]=I.useState(null),s=uS(n);return!n&&!r&&s&&i(s),el(()=>{if(!o)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),Tn.createElement(Tn.Fragment,null,n,r?I.cloneElement(r,{ref:a}):null)}const Mje={x:0,y:0,scaleX:1,scaleY:1};function Nje(e){let{children:t}=e;return Tn.createElement(Vy.Provider,{value:VK},Tn.createElement(Sw.Provider,{value:Mje},t))}const $je={position:"fixed",touchAction:"none"},Dje=e=>DP(e)?"transform 250ms ease":void 0,Lje=I.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:s,style:l,transform:u,transition:c=Dje}=e;if(!s)return null;const d=i?u:{...u,scaleX:1,scaleY:1},f={...$je,width:s.width,height:s.height,top:s.top,left:s.left,transform:F0.Transform.toString(d),transformOrigin:i&&r?Aze(r,s):void 0,transition:typeof c=="function"?c(r):c,...l};return Tn.createElement(n,{className:a,style:f,ref:t},o)}),Fje=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[s,l]of Object.entries(o.active))l!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,l));if(o!=null&&o.dragOverlay)for(const[s,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(s,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},Bje=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:F0.Transform.toString(t)},{transform:F0.Transform.toString(n)}]},zje={duration:250,easing:"ease",keyframes:Bje,sideEffects:Fje({styles:{active:{opacity:"0"}}})};function jje(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return vw((o,a)=>{if(t===null)return;const s=n.get(o);if(!s)return;const l=s.node.current;if(!l)return;const u=UK(a);if(!u)return;const{transform:c}=fo(a).getComputedStyle(a),d=AK(c);if(!d)return;const f=typeof t=="function"?t:Uje(t);return $K(l,i.draggable.measure),f({active:{id:o,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function Uje(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...zje,...e};return o=>{let{active:a,dragOverlay:s,transform:l,...u}=o;if(!t)return;const c={x:s.rect.left-a.rect.left,y:s.rect.top-a.rect.top},d={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/s.rect.height:1},f={x:l.x-c.x,y:l.y-c.y,...d},h=i({...u,active:a,dragOverlay:s,transform:{initial:l,final:f}}),[p]=h,m=h[h.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;const _=r==null?void 0:r({active:a,dragOverlay:s,...u}),b=s.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{_==null||_(),y()}})}}let DN=0;function Vje(e){return I.useMemo(()=>{if(e!=null)return DN++,DN},[e])}const Gje=Tn.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:s="div",className:l,zIndex:u=999}=e;const{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:m,dragOverlay:_,over:b,measuringConfiguration:y,scrollableAncestors:g,scrollableAncestorRects:v,windowRect:S}=Pje(),w=I.useContext(Sw),x=Vje(d==null?void 0:d.id),C=qK(a,{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:_.rect,over:b,overlayNodeRect:_.rect,scrollableAncestors:g,scrollableAncestorRects:v,transform:w,windowRect:S}),k=zP(f),T=jje({config:r,draggableNodes:p,droppableContainers:m,measuringConfiguration:y}),P=k?_.setRef:void 0;return Tn.createElement(Nje,null,Tn.createElement(Oje,{animation:T},d&&x?Tn.createElement(Lje,{key:x,id:d.id,ref:P,as:s,activatorEvent:c,adjustScale:t,className:l,transition:o,rect:k,style:{zIndex:u,...i},transform:C},n):null))}),qje=Ii([iK,FA],({nodes:e},t)=>t==="nodes"?e.viewport.zoom:1),Hje=()=>{const e=fq(qje);return I.useCallback(({activatorEvent:n,draggingNodeRect:r,transform:i})=>{if(r&&n){const o=L0(n);if(!o)return i;const a=o.x-r.left,s=o.y-r.top,l=i.x+a-r.width/2,u=i.y+s-r.height/2,c=i.scaleX*e,d=i.scaleY*e;return{x:l,y:u,scaleX:c,scaleY:d}}return i},[e])},Wje=e=>{if(!e.pointerCoordinates)return[];const t=document.elementsFromPoint(e.pointerCoordinates.x,e.pointerCoordinates.y),n=e.droppableContainers.filter(r=>r.node.current?t.includes(r.node.current):!1);return Dze({...e,droppableContainers:n})};function Kje(e){return W.jsx(Tje,{...e})}const v1=28,LN={w:v1,h:v1,maxW:v1,maxH:v1,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},Qje=e=>{if(!e.dragData)return null;if(e.dragData.payloadType==="NODE_FIELD"){const{field:t,fieldTemplate:n}=e.dragData.payload;return W.jsx(oS,{sx:{position:"relative",p:2,px:3,opacity:.7,bg:"base.300",borderRadius:"base",boxShadow:"dark-lg",whiteSpace:"nowrap",fontSize:"sm"},children:W.jsx(QW,{children:t.label||n.title})})}if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:t,width:n,height:r}=e.dragData.payload.imageDTO;return W.jsx(oS,{sx:{position:"relative",width:"full",height:"full",display:"flex",alignItems:"center",justifyContent:"center"},children:W.jsx(TP,{sx:{...LN},objectFit:"contain",src:t,width:n,height:r})})}return e.dragData.payloadType==="IMAGE_DTOS"?W.jsxs(kP,{sx:{position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...LN},children:[W.jsx(NT,{children:e.dragData.payload.imageDTOs.length}),W.jsx(NT,{size:"sm",children:"Images"})]}):null},Xje=I.memo(Qje),Yje=e=>{const[t,n]=I.useState(null),r=_e("images"),i=O4e(),o=I.useCallback(d=>{r.trace({dragData:Xt(d.active.data.current)},"Drag started");const f=d.active.data.current;f&&n(f)},[r]),a=I.useCallback(d=>{var h;r.trace({dragData:Xt(d.active.data.current)},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(cq({overData:f,activeData:t})),n(null))},[t,i,r]),s=TN(BK,{activationConstraint:{distance:10}}),l=TN(zK,{activationConstraint:{distance:10}}),u=Tze(s,l),c=Hje();return W.jsxs(Kje,{onDragStart:o,onDragEnd:a,sensors:u,collisionDetection:Wje,autoScroll:!1,children:[e.children,W.jsx(Gje,{dropAnimation:null,modifiers:[c],style:{width:"min-content",height:"min-content",cursor:"grabbing",userSelect:"none",padding:"10rem"},children:W.jsx(zW,{children:t&&W.jsx(FW.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:W.jsx(Xje,{dragData:t})},"overlay-drag-image")})})]})},Zje=I.memo(Yje),FN=nl(void 0),BN=nl(void 0),Jje=I.lazy(()=>nL(()=>import("./App-6a1ad010.js"),["./App-6a1ad010.js","./MantineProvider-2b56c833.js","./App-6125620a.css"],import.meta.url)),eUe=I.lazy(()=>nL(()=>import("./ThemeLocaleProvider-6be4f995.js"),["./ThemeLocaleProvider-6be4f995.js","./MantineProvider-2b56c833.js","./ThemeLocaleProvider-90f0fcd3.css"],import.meta.url)),tUe=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o,queueId:a,selectedImage:s,customStarUi:l})=>(I.useEffect(()=>(t&&Jh.set(t),e&&s0.set(e),o&&l0.set(o),a&&Vr.set(a),lG(),i&&i.length>0?qE(bN(),...i):qE(bN()),()=>{s0.set(void 0),Jh.set(void 0),l0.set(void 0),Vr.set(hG)}),[e,t,i,o,a]),I.useEffect(()=>(l&&FN.set(l),()=>{FN.set(void 0)}),[l]),I.useEffect(()=>(r&&BN.set(r),()=>{BN.set(void 0)}),[r]),W.jsx(Tn.StrictMode,{children:W.jsx(Ame,{store:rK,children:W.jsx(Tn.Suspense,{fallback:W.jsx(XBe,{}),children:W.jsx(eUe,{children:W.jsx(Zje,{children:W.jsx(Jje,{config:n,selectedImage:s})})})})})})),nUe=I.memo(tUe);q5.createRoot(document.getElementById("root")).render(W.jsx(nUe,{}));export{VKe as $,Ka as A,gbe as B,Oo as C,Xu as D,Cs as E,Mqe as F,dA as G,ike as H,ia as I,By as J,oAe as K,JKe as L,HDe as M,Iy as N,Oi as O,vbe as P,Rc as Q,pMe as R,$m as S,qKe as T,UKe as U,zW as V,FW as W,HOe as X,Ry as Y,wP as Z,My as _,WL as a,jA as a$,GKe as a0,G_ as a1,JM as a2,Qke as a3,HKe as a4,Ls as a5,mc as a6,x_ as a7,$Y as a8,Tn as a9,oS as aA,kP as aB,NT as aC,FA as aD,ex as aE,K4e as aF,WGe as aG,$ke as aH,qA as aI,Eq as aJ,Lke as aK,Vo as aL,GP as aM,rw as aN,EWe as aO,NGe as aP,QGe as aQ,XGe as aR,CGe as aS,xGe as aT,QW as aU,zf as aV,Mxe as aW,gG as aX,dWe as aY,Sqe as aZ,Yk as a_,gH as aa,QKe as ab,YOe as ac,Ws as ad,Oq as ae,nw as af,y$e as ag,WW as ah,WKe as ai,nt as aj,jKe as ak,KKe as al,Ii as am,iK as an,pk as ao,fq as ap,OGe as aq,by as ar,Mz as as,oj as at,x2 as au,_e as av,O4e as aw,hWe as ax,qt as ay,Ld as az,jS as b,FUe as b$,eKe as b0,TP as b1,KBe as b2,be as b3,zGe as b4,KGe as b5,v0e as b6,bk as b7,gUe as b8,NWe as b9,Tqe as bA,$Ge as bB,DGe as bC,VGe as bD,E_ as bE,FGe as bF,Nu as bG,lv as bH,Eqe as bI,wqe as bJ,Cqe as bK,iUe as bL,lUe as bM,uUe as bN,cUe as bO,dUe as bP,tle as bQ,LUe as bR,tWe as bS,nWe as bT,mUe as bU,GUe as bV,hUe as bW,OUe as bX,bUe as bY,ZEe as bZ,pUe as b_,gWe as ba,tKe as bb,BWe as bc,nxe as bd,pWe as be,yWe as bf,y2e as bg,v2e as bh,RWe as bi,MWe as bj,mWe as bk,DWe as bl,vWe as bm,RGe as bn,fWe as bo,KWe as bp,eQe as bq,BGe as br,ble as bs,nqe as bt,tqe as bu,LGe as bv,kqe as bw,nQe as bx,tQe as by,LV as bz,NJ as c,Ur as c$,fUe as c0,QUe as c1,yUe as c2,tI as c3,vUe as c4,nI as c5,EUe as c6,NUe as c7,SKe as c8,jO as c9,cWe as cA,Rqe as cB,sqe as cC,Hxe as cD,Ne as cE,FN as cF,oqe as cG,rqe as cH,iqe as cI,x0e as cJ,_xe as cK,sG as cL,PB as cM,wGe as cN,uq as cO,jGe as cP,u0 as cQ,pU as cR,zKe as cS,UGe as cT,hv as cU,CE as cV,ZWe as cW,qWe as cX,bWe as cY,_We as cZ,VWe as c_,SUe as ca,Oqe as cb,vKe as cc,UO as cd,xUe as ce,kv as cf,Ef as cg,UR as ch,uqe as ci,bKe as cj,iT as ck,CUe as cl,iU as cm,yqe as cn,lU as co,YEe as cp,_Ue as cq,K9 as cr,oWe as cs,aWe as ct,sWe as cu,TUe as cv,lWe as cw,kUe as cx,uWe as cy,AUe as cz,_oe as d,Iqe as d$,fA as d0,Ea as d1,UWe as d2,PUe as d3,LA as d4,GWe as d5,FWe as d6,hk as d7,QHe as d8,qHe as d9,yKe as dA,LKe as dB,mKe as dC,dHe as dD,fHe as dE,FKe as dF,hHe as dG,DKe as dH,pHe as dI,gHe as dJ,qse as dK,wKe as dL,mHe as dM,Kse as dN,sHe as dO,wUe as dP,_Ke as dQ,lHe as dR,nHe as dS,KHe as dT,joe as dU,KS as dV,$Ue as dW,E0e as dX,T0e as dY,xqe as dZ,Pqe as d_,HHe as da,ZHe as db,WHe as dc,YHe as dd,XHe as de,OEe as df,bHe as dg,Bqe as dh,TGe as di,EGe as dj,Uqe as dk,Eae as dl,uHe as dm,Dqe as dn,rHe as dp,iHe as dq,Wse as dr,oHe as ds,oUe as dt,aHe as du,Z2 as dv,Hse as dw,cHe as dx,cy as dy,OKe as dz,QF as e,DVe as e$,mU as e0,Aqe as e1,QS as e2,aVe as e3,rVe as e4,iVe as e5,oVe as e6,Dae as e7,VR as e8,fqe as e9,rWe as eA,mk as eB,p2e as eC,P4e as eD,EB as eE,hKe as eF,lVe as eG,nle as eH,sVe as eI,Wa as eJ,MUe as eK,HUe as eL,Lae as eM,qg as eN,KUe as eO,iWe as eP,jUe as eQ,UUe as eR,VUe as eS,BUe as eT,zUe as eU,ele as eV,ZUe as eW,YUe as eX,gVe as eY,$Ve as eZ,vGe as e_,JGe as ea,YGe as eb,ZGe as ec,Cc as ed,rI as ee,m0e as ef,GR as eg,Vxe as eh,Uxe as ei,hqe as ej,pqe as ek,gqe as el,y0e as em,mqe as en,aU as eo,cqe as ep,sU as eq,bqe as er,_qe as es,q2 as et,qR as eu,vqe as ev,aqe as ew,cEe as ex,lqe as ey,xKe as ez,tF as f,RHe as f$,tVe as f0,nVe as f1,eVe as f2,vk as f3,jWe as f4,HWe as f5,eWe as f6,BKe as f7,Z4e as f8,AWe as f9,qqe as fA,Hqe as fB,gSe as fC,q9 as fD,tV as fE,wy as fF,Nqe as fG,Wc as fH,xHe as fI,LWe as fJ,wj as fK,Cg as fL,jqe as fM,Fqe as fN,SHe as fO,wHe as fP,IHe as fQ,$qe as fR,CHe as fS,EHe as fT,kGe as fU,$_ as fV,tt as fW,THe as fX,c2e as fY,Fv as fZ,zqe as f_,ve as fa,Ft as fb,Gn as fc,Gs as fd,gKe as fe,NKe as ff,kKe as fg,CWe as fh,TKe as fi,$Ke as fj,MKe as fk,wWe as fl,PKe as fm,AKe as fn,CKe as fo,RKe as fp,sUe as fq,EKe as fr,IKe as fs,aUe as ft,xV as fu,Lqe as fv,eE as fw,dSe as fx,Coe as fy,_He as fz,uF as g,dVe as g$,AHe as g0,Jqe as g1,Xqe as g2,Qqe as g3,Kqe as g4,eHe as g5,PHe as g6,NHe as g7,MHe as g8,GHe as g9,iKe as gA,JWe as gB,zWe as gC,QWe as gD,YWe as gE,Kc as gF,vG as gG,gQ as gH,Rt as gI,WVe as gJ,fGe as gK,dGe as gL,RVe as gM,nGe as gN,pGe as gO,Gxe as gP,CVe as gQ,UVe as gR,ig as gS,BVe as gT,EVe as gU,tx as gV,jVe as gW,SVe as gX,zVe as gY,xVe as gZ,kVe as g_,eke as ga,Yqe as gb,Zqe as gc,JHe as gd,$He as ge,OHe as gf,LHe as gg,iSe as gh,pKe as gi,WB as gj,BO as gk,Xt as gl,u2e as gm,y0 as gn,uc as go,VHe as gp,FHe as gq,UHe as gr,BHe as gs,DHe as gt,kHe as gu,jHe as gv,$V as gw,oKe as gx,nKe as gy,rKe as gz,mp as h,WA as h$,cVe as h0,uVe as h1,hGe as h2,bae as h3,rB as h4,TB as h5,Jh as h6,ale as h7,mVe as h8,yVe as h9,sGe as hA,JVe as hB,YVe as hC,ZVe as hD,bGe as hE,oGe as hF,_Ge as hG,FVe as hH,LVe as hI,_Ve as hJ,bVe as hK,yGe as hL,pVe as hM,OVe as hN,zxe as hO,Dxe as hP,Fxe as hQ,Bxe as hR,fKe as hS,TWe as hT,kWe as hU,GGe as hV,Y as hW,Nae as hX,Rxe as hY,BN as hZ,Iq as h_,vVe as ha,cGe as hb,PVe as hc,AVe as hd,ule as he,uGe as hf,jxe as hg,cle as hh,$A as hi,uEe as hj,MVe as hk,KVe as hl,HVe as hm,VVe as hn,fVe as ho,hVe as hp,SGe as hq,sKe as hr,aKe as hs,tGe as ht,XVe as hu,QVe as hv,Lxe as hw,IVe as hx,wVe as hy,lGe as hz,hoe as i,Fs as i0,NOe as i1,uMe as i2,XKe as i3,Jke as i4,ZKe as i5,WDe as i6,YFe as i7,ZFe as i8,Wke as i9,ly as j,Yr as k,sy as l,iy as m,Ro as n,GS as o,tk as p,JL as q,sk as r,UF as s,ay as t,I as u,W as v,Aa as w,_r as x,yh as y,pi as z};
diff --git a/invokeai/frontend/web/dist/index.html b/invokeai/frontend/web/dist/index.html
index 3a1e246f49..c70d7283b4 100644
--- a/invokeai/frontend/web/dist/index.html
+++ b/invokeai/frontend/web/dist/index.html
@@ -15,7 +15,7 @@
         margin: 0;
       }
     </style>
-    <script type="module" crossorigin src="./assets/index-a24a7159.js"></script>
+    <script type="module" crossorigin src="./assets/index-27e8922c.js"></script>
   </head>
 
   <body dir="ltr">
diff --git a/invokeai/frontend/web/dist/locales/ar.json b/invokeai/frontend/web/dist/locales/ar.json
index e5168da4a8..7354b21ea0 100644
--- a/invokeai/frontend/web/dist/locales/ar.json
+++ b/invokeai/frontend/web/dist/locales/ar.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "مفاتيح الأختصار",
-        "themeLabel": "الموضوع",
         "languagePickerLabel": "منتقي اللغة",
         "reportBugLabel": "بلغ عن خطأ",
         "settingsLabel": "إعدادات",
-        "darkTheme": "داكن",
-        "lightTheme": "فاتح",
-        "greenTheme": "أخضر",
         "img2img": "صورة إلى صورة",
         "unifiedCanvas": "لوحة موحدة",
         "nodes": "عقد",
@@ -57,7 +53,6 @@
         "maintainAspectRatio": "الحفاظ على نسبة الأبعاد",
         "autoSwitchNewImages": "التبديل التلقائي إلى الصور الجديدة",
         "singleColumnLayout": "تخطيط عمود واحد",
-        "pinGallery": "تثبيت المعرض",
         "allImagesLoaded": "تم تحميل جميع الصور",
         "loadMore": "تحميل المزيد",
         "noImagesInGallery": "لا توجد صور في المعرض"
@@ -342,7 +337,6 @@
         "cfgScale": "مقياس الإعداد الذاتي للجملة",
         "width": "عرض",
         "height": "ارتفاع",
-        "sampler": "مزج",
         "seed": "بذرة",
         "randomizeSeed": "تبديل بذرة",
         "shuffle": "تشغيل",
@@ -364,10 +358,6 @@
         "hiresOptim": "تحسين الدقة العالية",
         "imageFit": "ملائمة الصورة الأولية لحجم الخرج",
         "codeformerFidelity": "الوثوقية",
-        "seamSize": "حجم التشقق",
-        "seamBlur": "ضباب التشقق",
-        "seamStrength": "قوة التشقق",
-        "seamSteps": "خطوات التشقق",
         "scaleBeforeProcessing": "تحجيم قبل المعالجة",
         "scaledWidth": "العرض المحجوب",
         "scaledHeight": "الارتفاع المحجوب",
@@ -378,8 +368,6 @@
         "infillScalingHeader": "التعبئة والتحجيم",
         "img2imgStrength": "قوة صورة إلى صورة",
         "toggleLoopback": "تبديل الإعادة",
-        "invoke": "إطلاق",
-        "promptPlaceholder": "اكتب المحث هنا. [العلامات السلبية], (زيادة الوزن) ++, (نقص الوزن)--, التبديل و الخلط متاحة (انظر الوثائق)",
         "sendTo": "أرسل إلى",
         "sendToImg2Img": "أرسل إلى صورة إلى صورة",
         "sendToUnifiedCanvas": "أرسل إلى الخطوط الموحدة",
@@ -393,7 +381,6 @@
         "useAll": "استخدام الكل",
         "useInitImg": "استخدام الصورة الأولية",
         "info": "معلومات",
-        "deleteImage": "حذف الصورة",
         "initialImage": "الصورة الأولية",
         "showOptionsPanel": "إظهار لوحة الخيارات"
     },
@@ -403,7 +390,6 @@
         "saveSteps": "حفظ الصور كل n خطوات",
         "confirmOnDelete": "تأكيد عند الحذف",
         "displayHelpIcons": "عرض أيقونات المساعدة",
-        "useCanvasBeta": "استخدام مخطط الأزرار بيتا",
         "enableImageDebugging": "تمكين التصحيح عند التصوير",
         "resetWebUI": "إعادة تعيين واجهة الويب",
         "resetWebUIDesc1": "إعادة تعيين واجهة الويب يعيد فقط ذاكرة التخزين المؤقت للمتصفح لصورك وإعداداتك المذكورة. لا يحذف أي صور من القرص.",
@@ -413,7 +399,6 @@
     "toast": {
         "tempFoldersEmptied": "تم تفريغ مجلد المؤقت",
         "uploadFailed": "فشل التحميل",
-        "uploadFailedMultipleImagesDesc": "تم الصق صور متعددة، قد يتم تحميل صورة واحدة فقط في الوقت الحالي",
         "uploadFailedUnableToLoadDesc": "تعذر تحميل الملف",
         "downloadImageStarted": "بدأ تنزيل الصورة",
         "imageCopied": "تم نسخ الصورة",
diff --git a/invokeai/frontend/web/dist/locales/de.json b/invokeai/frontend/web/dist/locales/de.json
index cff09d46bb..9baa6eb6a2 100644
--- a/invokeai/frontend/web/dist/locales/de.json
+++ b/invokeai/frontend/web/dist/locales/de.json
@@ -1,12 +1,8 @@
 {
     "common": {
-        "themeLabel": "Thema",
         "languagePickerLabel": "Sprachauswahl",
         "reportBugLabel": "Fehler melden",
         "settingsLabel": "Einstellungen",
-        "darkTheme": "Dunkel",
-        "lightTheme": "Hell",
-        "greenTheme": "Grün",
         "img2img": "Bild zu Bild",
         "nodes": "Knoten",
         "langGerman": "Deutsch",
@@ -48,7 +44,6 @@
         "langEnglish": "Englisch",
         "langDutch": "Niederländisch",
         "langFrench": "Französisch",
-        "oceanTheme": "Ozean",
         "langItalian": "Italienisch",
         "langPortuguese": "Portogisisch",
         "langRussian": "Russisch",
@@ -76,7 +71,6 @@
         "maintainAspectRatio": "Seitenverhältnis beibehalten",
         "autoSwitchNewImages": "Automatisch zu neuen Bildern wechseln",
         "singleColumnLayout": "Einspaltiges Layout",
-        "pinGallery": "Galerie anpinnen",
         "allImagesLoaded": "Alle Bilder geladen",
         "loadMore": "Mehr laden",
         "noImagesInGallery": "Keine Bilder in der Galerie"
@@ -346,7 +340,6 @@
         "cfgScale": "CFG-Skala",
         "width": "Breite",
         "height": "Höhe",
-        "sampler": "Sampler",
         "randomizeSeed": "Zufälliger Seed",
         "shuffle": "Mischen",
         "noiseThreshold": "Rausch-Schwellenwert",
@@ -367,10 +360,6 @@
         "hiresOptim": "High-Res-Optimierung",
         "imageFit": "Ausgangsbild an Ausgabegröße anpassen",
         "codeformerFidelity": "Glaubwürdigkeit",
-        "seamSize": "Nahtgröße",
-        "seamBlur": "Nahtunschärfe",
-        "seamStrength": "Stärke der Naht",
-        "seamSteps": "Nahtstufen",
         "scaleBeforeProcessing": "Skalieren vor der Verarbeitung",
         "scaledWidth": "Skaliert W",
         "scaledHeight": "Skaliert H",
@@ -381,8 +370,6 @@
         "infillScalingHeader": "Infill und Skalierung",
         "img2imgStrength": "Bild-zu-Bild-Stärke",
         "toggleLoopback": "Toggle Loopback",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Prompt hier eingeben. [negative Token], (mehr Gewicht)++, (geringeres Gewicht)--, Tausch und Überblendung sind verfügbar (siehe Dokumente)",
         "sendTo": "Senden an",
         "sendToImg2Img": "Senden an Bild zu Bild",
         "sendToUnifiedCanvas": "Senden an Unified Canvas",
@@ -394,7 +381,6 @@
         "useSeed": "Seed verwenden",
         "useAll": "Alle verwenden",
         "useInitImg": "Ausgangsbild verwenden",
-        "deleteImage": "Bild löschen",
         "initialImage": "Ursprüngliches Bild",
         "showOptionsPanel": "Optionsleiste zeigen",
         "cancel": {
@@ -406,7 +392,6 @@
         "saveSteps": "Speichern der Bilder alle n Schritte",
         "confirmOnDelete": "Bestätigen beim Löschen",
         "displayHelpIcons": "Hilfesymbole anzeigen",
-        "useCanvasBeta": "Canvas Beta Layout verwenden",
         "enableImageDebugging": "Bild-Debugging aktivieren",
         "resetWebUI": "Web-Oberfläche zurücksetzen",
         "resetWebUIDesc1": "Das Zurücksetzen der Web-Oberfläche setzt nur den lokalen Cache des Browsers mit Ihren Bildern und gespeicherten Einstellungen zurück. Es werden keine Bilder von der Festplatte gelöscht.",
@@ -416,7 +401,6 @@
     "toast": {
         "tempFoldersEmptied": "Temp-Ordner geleert",
         "uploadFailed": "Hochladen fehlgeschlagen",
-        "uploadFailedMultipleImagesDesc": "Mehrere Bilder eingefügt, es kann nur ein Bild auf einmal hochgeladen werden",
         "uploadFailedUnableToLoadDesc": "Datei kann nicht geladen werden",
         "downloadImageStarted": "Bild wird heruntergeladen",
         "imageCopied": "Bild kopiert",
@@ -532,7 +516,6 @@
         "modifyConfig": "Optionen einstellen",
         "toggleAutoscroll": "Auroscroll ein/ausschalten",
         "toggleLogViewer": "Log Betrachter ein/ausschalten",
-        "showGallery": "Zeige Galerie",
         "showOptionsPanel": "Zeige Optionen",
         "reset": "Zurücksetzen",
         "nextImage": "Nächstes Bild",
diff --git a/invokeai/frontend/web/dist/locales/en.json b/invokeai/frontend/web/dist/locales/en.json
index 7f4ff3e37c..e0baefcf9e 100644
--- a/invokeai/frontend/web/dist/locales/en.json
+++ b/invokeai/frontend/web/dist/locales/en.json
@@ -38,19 +38,24 @@
         "searchBoard": "Search Boards...",
         "selectBoard": "Select a Board",
         "topMessage": "This board contains images used in the following features:",
-        "uncategorized": "Uncategorized"
+        "uncategorized": "Uncategorized",
+        "downloadBoard": "Download Board"
     },
     "common": {
         "accept": "Accept",
         "advanced": "Advanced",
         "areYouSure": "Are you sure?",
+        "auto": "Auto",
         "back": "Back",
         "batch": "Batch Manager",
         "cancel": "Cancel",
         "close": "Close",
+        "on": "On",
         "communityLabel": "Community",
-        "controlNet": "Controlnet",
+        "controlNet": "ControlNet",
+        "controlAdapter": "Control Adapter",
         "ipAdapter": "IP Adapter",
+        "t2iAdapter": "T2I Adapter",
         "darkMode": "Dark Mode",
         "discordLabel": "Discord",
         "dontAskMeAgain": "Don't ask me again",
@@ -130,6 +135,17 @@
         "upload": "Upload"
     },
     "controlnet": {
+        "controlAdapter_one": "Control Adapter",
+        "controlAdapter_other": "Control Adapters",
+        "controlnet": "$t(controlnet.controlAdapter) #{{number}} ($t(common.controlNet))",
+        "ip_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.ipAdapter))",
+        "t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.t2iAdapter))",
+        "addControlNet": "Add $t(common.controlNet)",
+        "addIPAdapter": "Add $t(common.ipAdapter)",
+        "addT2IAdapter": "Add $t(common.t2iAdapter)",
+        "controlNetEnabledT2IDisabled": "$t(common.controlNet) enabled, $t(common.t2iAdapter)s disabled",
+        "t2iEnabledControlNetDisabled": "$t(common.t2iAdapter) enabled, $t(common.controlNet)s disabled",
+        "controlNetT2IMutexDesc": "$t(common.controlNet) and $t(common.t2iAdapter) at same time is currently unsupported.",
         "amult": "a_mult",
         "autoConfigure": "Auto configure processor",
         "balanced": "Balanced",
@@ -262,7 +278,8 @@
         "batchValues": "Batch Values",
         "notReady": "Unable to Queue",
         "batchQueued": "Batch Queued",
-        "batchQueuedDesc": "Added {{item_count}} sessions to {{direction}} of queue",
+        "batchQueuedDesc_one": "Added {{count}} sessions to {{direction}} of queue",
+        "batchQueuedDesc_other": "Added {{count}} sessions to {{direction}} of queue",
         "front": "front",
         "back": "back",
         "batchFailedToQueue": "Failed to Queue Batch",
@@ -311,7 +328,10 @@
         "showUploads": "Show Uploads",
         "singleColumnLayout": "Single Column Layout",
         "unableToLoad": "Unable to load Gallery",
-        "uploads": "Uploads"
+        "uploads": "Uploads",
+        "downloadSelection": "Download Selection",
+        "preparingDownload": "Preparing Download",
+        "preparingDownloadFailed": "Problem Preparing Download"
     },
     "hotkeys": {
         "acceptStagingImage": {
@@ -685,6 +705,7 @@
         "vae": "VAE",
         "vaeLocation": "VAE Location",
         "vaeLocationValidationMsg": "Path to where your VAE is located.",
+        "vaePrecision": "VAE Precision",
         "vaeRepoID": "VAE Repo ID",
         "vaeRepoIDValidationMsg": "Online repository of your VAE",
         "variant": "Variant",
@@ -905,6 +926,7 @@
     },
     "parameters": {
         "aspectRatio": "Aspect Ratio",
+        "aspectRatioFree": "Free",
         "boundingBoxHeader": "Bounding Box",
         "boundingBoxHeight": "Bounding Box Height",
         "boundingBoxWidth": "Bounding Box Width",
@@ -952,9 +974,10 @@
             "missingFieldTemplate": "Missing field template",
             "missingInputForField": "{{nodeLabel}} -> {{fieldLabel}} missing input",
             "missingNodeTemplate": "Missing node template",
-            "noControlImageForControlNet": "ControlNet {{index}} has no control image",
+            "noControlImageForControlAdapter": "Control Adapter #{{number}} has no control image",
             "noInitialImageSelected": "No initial image selected",
-            "noModelForControlNet": "ControlNet {{index}} has no model selected.",
+            "noModelForControlAdapter": "Control Adapter #{{number}} has no model selected.",
+            "incompatibleBaseModelForControlAdapter": "Control Adapter #{{number}} model is invalid with main model.",
             "noModelSelected": "No model selected",
             "noPrompts": "No prompts generated",
             "noNodesInGraph": "No nodes in graph",
@@ -1089,11 +1112,22 @@
         "showAdvancedOptions": "Show Advanced Options",
         "showProgressInViewer": "Show Progress Images in Viewer",
         "ui": "User Interface",
-        "useSlidersForAll": "Use Sliders For All Options"
+        "useSlidersForAll": "Use Sliders For All Options",
+        "clearIntermediatesDesc1": "Clearing intermediates will reset your Canvas and ControlNet state.",
+        "clearIntermediatesDesc2": "Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space.",
+        "clearIntermediatesDesc3": "Your gallery images will not be deleted.",
+        "clearIntermediates": "Clear Intermediates",
+        "clearIntermediatesWithCount_one": "Clear {{count}} Intermediate",
+        "clearIntermediatesWithCount_other": "Clear {{count}} Intermediates",
+        "clearIntermediatesWithCount_zero": "No Intermediates to Clear",
+        "intermediatesCleared_one": "Cleared {{count}} Intermediate",
+        "intermediatesCleared_other": "Cleared {{count}} Intermediates",
+        "intermediatesClearedFailed": "Problem Clearing Intermediates"
     },
     "toast": {
         "addedToBoard": "Added to board",
-        "baseModelChangedCleared": "Base model changed, cleared",
+        "baseModelChangedCleared_one": "Base model changed, cleared or disabled {{count}} incompatible submodel",
+        "baseModelChangedCleared_other": "Base model changed, cleared or disabled {{count}} incompatible submodels",
         "canceled": "Processing Canceled",
         "canvasCopiedClipboard": "Canvas Copied to Clipboard",
         "canvasDownloaded": "Canvas Downloaded",
@@ -1113,7 +1147,6 @@
         "imageSavingFailed": "Image Saving Failed",
         "imageUploaded": "Image Uploaded",
         "imageUploadFailed": "Image Upload Failed",
-        "incompatibleSubmodel": "incompatible submodel",
         "initialImageNotSet": "Initial Image Not Set",
         "initialImageNotSetDesc": "Could not load initial image",
         "initialImageSet": "Initial Image Set",
diff --git a/invokeai/frontend/web/dist/locales/es.json b/invokeai/frontend/web/dist/locales/es.json
index d17cefaad2..8ff4c53165 100644
--- a/invokeai/frontend/web/dist/locales/es.json
+++ b/invokeai/frontend/web/dist/locales/es.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Atajos de teclado",
-        "themeLabel": "Tema",
         "languagePickerLabel": "Selector de idioma",
         "reportBugLabel": "Reportar errores",
         "settingsLabel": "Ajustes",
-        "darkTheme": "Oscuro",
-        "lightTheme": "Claro",
-        "greenTheme": "Verde",
         "img2img": "Imagen a Imagen",
         "unifiedCanvas": "Lienzo Unificado",
-        "nodes": "Nodos",
+        "nodes": "Editor del flujo de trabajo",
         "langSpanish": "Español",
         "nodesDesc": "Un sistema de generación de imágenes basado en nodos, actualmente se encuentra en desarrollo. Mantente pendiente a nuestras actualizaciones acerca de esta fabulosa funcionalidad.",
         "postProcessing": "Post-procesamiento",
@@ -19,7 +15,7 @@
         "postProcessDesc3": "La Interfaz de Línea de Comandos de Invoke AI ofrece muchas otras características, incluyendo -Embiggen-.",
         "training": "Entrenamiento",
         "trainingDesc1": "Un flujo de trabajo dedicado para el entrenamiento de sus propios -embeddings- y puntos de control utilizando Inversión Textual y Dreambooth desde la interfaz web.",
-        "trainingDesc2": "InvokeAI ya soporta el entrenamiento de -embeddings- personalizados utilizando la Inversión Textual mediante el script principal.",
+        "trainingDesc2": "InvokeAI ya admite el entrenamiento de incrustaciones personalizadas mediante la inversión textual mediante el script principal.",
         "upload": "Subir imagen",
         "close": "Cerrar",
         "load": "Cargar",
@@ -63,18 +59,27 @@
         "statusConvertingModel": "Convertir el modelo",
         "statusModelConverted": "Modelo adaptado",
         "statusMergingModels": "Fusionar modelos",
-        "oceanTheme": "Océano",
         "langPortuguese": "Portugués",
         "langKorean": "Coreano",
         "langHebrew": "Hebreo",
-        "pinOptionsPanel": "Pin del panel de opciones",
         "loading": "Cargando",
         "loadingInvokeAI": "Cargando invocar a la IA",
         "postprocessing": "Tratamiento posterior",
         "txt2img": "De texto a imagen",
         "accept": "Aceptar",
         "cancel": "Cancelar",
-        "linear": "Lineal"
+        "linear": "Lineal",
+        "random": "Aleatorio",
+        "generate": "Generar",
+        "openInNewTab": "Abrir en una nueva pestaña",
+        "dontAskMeAgain": "No me preguntes de nuevo",
+        "areYouSure": "¿Estas seguro?",
+        "imagePrompt": "Indicación de imagen",
+        "batch": "Administrador de lotes",
+        "darkMode": "Modo oscuro",
+        "lightMode": "Modo claro",
+        "modelManager": "Administrador de modelos",
+        "communityLabel": "Comunidad"
     },
     "gallery": {
         "generations": "Generaciones",
@@ -87,10 +92,15 @@
         "maintainAspectRatio": "Mantener relación de aspecto",
         "autoSwitchNewImages": "Auto seleccionar Imágenes nuevas",
         "singleColumnLayout": "Diseño de una columna",
-        "pinGallery": "Fijar galería",
         "allImagesLoaded": "Todas las imágenes cargadas",
         "loadMore": "Cargar más",
-        "noImagesInGallery": "Sin imágenes en la galería"
+        "noImagesInGallery": "No hay imágenes para mostrar",
+        "deleteImage": "Eliminar Imagen",
+        "deleteImageBin": "Las imágenes eliminadas se enviarán a la papelera de tu sistema operativo.",
+        "deleteImagePermanent": "Las imágenes eliminadas no se pueden restaurar.",
+        "images": "Imágenes",
+        "assets": "Activos",
+        "autoAssignBoardOnClick": "Asignación automática de tableros al hacer clic"
     },
     "hotkeys": {
         "keyboardShortcuts": "Atajos de teclado",
@@ -297,7 +307,12 @@
         "acceptStagingImage": {
             "title": "Aceptar imagen",
             "desc": "Aceptar la imagen actual en el área de preparación"
-        }
+        },
+        "addNodes": {
+            "title": "Añadir Nodos",
+            "desc": "Abre el menú para añadir nodos"
+        },
+        "nodesHotkeys": "Teclas de acceso rápido a los nodos"
     },
     "modelManager": {
         "modelManager": "Gestor de Modelos",
@@ -349,8 +364,8 @@
         "delete": "Eliminar",
         "deleteModel": "Eliminar Modelo",
         "deleteConfig": "Eliminar Configuración",
-        "deleteMsg1": "¿Estás seguro de querer eliminar esta entrada de modelo de InvokeAI?",
-        "deleteMsg2": "El checkpoint del modelo no se eliminará de tu disco. Puedes volver a añadirlo si lo deseas.",
+        "deleteMsg1": "¿Estás seguro de que deseas eliminar este modelo de InvokeAI?",
+        "deleteMsg2": "Esto eliminará el modelo del disco si está en la carpeta raíz de InvokeAI. Si está utilizando una ubicación personalizada, el modelo NO se eliminará del disco.",
         "safetensorModels": "SafeTensors",
         "addDiffuserModel": "Añadir difusores",
         "inpainting": "v1 Repintado",
@@ -369,8 +384,8 @@
         "convertToDiffusers": "Convertir en difusores",
         "convertToDiffusersHelpText1": "Este modelo se convertirá al formato 🧨 Difusores.",
         "convertToDiffusersHelpText2": "Este proceso sustituirá su entrada del Gestor de Modelos por la versión de Difusores del mismo modelo.",
-        "convertToDiffusersHelpText3": "Su archivo de puntos de control en el disco NO será borrado ni modificado de ninguna manera. Puede volver a añadir su punto de control al Gestor de Modelos si lo desea.",
-        "convertToDiffusersHelpText5": "Asegúrese de que dispone de suficiente espacio en disco. Los modelos suelen variar entre 4 GB y 7 GB de tamaño.",
+        "convertToDiffusersHelpText3": "Tu archivo del punto de control en el disco se eliminará si está en la carpeta raíz de InvokeAI. Si está en una ubicación personalizada, NO se eliminará.",
+        "convertToDiffusersHelpText5": "Por favor, asegúrate de tener suficiente espacio en el disco. Los modelos generalmente varían entre 2 GB y 7 GB de tamaño.",
         "convertToDiffusersHelpText6": "¿Desea transformar este modelo?",
         "convertToDiffusersSaveLocation": "Guardar ubicación",
         "v1": "v1",
@@ -409,7 +424,27 @@
         "pickModelType": "Elige el tipo de modelo",
         "v2_768": "v2 (768px)",
         "addDifference": "Añadir una diferencia",
-        "scanForModels": "Buscar modelos"
+        "scanForModels": "Buscar modelos",
+        "vae": "VAE",
+        "variant": "Variante",
+        "baseModel": "Modelo básico",
+        "modelConversionFailed": "Conversión al modelo fallida",
+        "selectModel": "Seleccionar un modelo",
+        "modelUpdateFailed": "Error al actualizar el modelo",
+        "modelsMergeFailed": "Fusión del modelo fallida",
+        "convertingModelBegin": "Convirtiendo el modelo. Por favor, espere.",
+        "modelDeleted": "Modelo eliminado",
+        "modelDeleteFailed": "Error al borrar el modelo",
+        "noCustomLocationProvided": "‐No se proporcionó una ubicación personalizada",
+        "importModels": "Importar los modelos",
+        "settings": "Ajustes",
+        "syncModels": "Sincronizar las plantillas",
+        "syncModelsDesc": "Si tus plantillas no están sincronizados con el backend, puedes actualizarlas usando esta opción. Esto suele ser útil en los casos en los que actualizas manualmente tu archivo models.yaml o añades plantillas a la carpeta raíz de InvokeAI después de que la aplicación haya arrancado.",
+        "modelsSynced": "Plantillas sincronizadas",
+        "modelSyncFailed": "La sincronización de la plantilla falló",
+        "loraModels": "LoRA",
+        "onnxModels": "Onnx",
+        "oliveModels": "Olives"
     },
     "parameters": {
         "images": "Imágenes",
@@ -417,10 +452,9 @@
         "cfgScale": "Escala CFG",
         "width": "Ancho",
         "height": "Alto",
-        "sampler": "Muestreo",
         "seed": "Semilla",
         "randomizeSeed": "Semilla aleatoria",
-        "shuffle": "Aleatorizar",
+        "shuffle": "Semilla aleatoria",
         "noiseThreshold": "Umbral de Ruido",
         "perlinNoise": "Ruido Perlin",
         "variations": "Variaciones",
@@ -439,10 +473,6 @@
         "hiresOptim": "Optimización de Alta Resolución",
         "imageFit": "Ajuste tamaño de imagen inicial al tamaño objetivo",
         "codeformerFidelity": "Fidelidad",
-        "seamSize": "Tamaño del parche",
-        "seamBlur": "Desenfoque del parche",
-        "seamStrength": "Fuerza del parche",
-        "seamSteps": "Pasos del parche",
         "scaleBeforeProcessing": "Redimensionar antes de procesar",
         "scaledWidth": "Ancho escalado",
         "scaledHeight": "Alto escalado",
@@ -453,8 +483,6 @@
         "infillScalingHeader": "Remplazo y escalado",
         "img2imgStrength": "Peso de Imagen a Imagen",
         "toggleLoopback": "Alternar Retroalimentación",
-        "invoke": "Invocar",
-        "promptPlaceholder": "Ingrese la entrada aquí. [símbolos negativos], (subir peso)++, (bajar peso)--, también disponible alternado y mezclado (ver documentación)",
         "sendTo": "Enviar a",
         "sendToImg2Img": "Enviar a Imagen a Imagen",
         "sendToUnifiedCanvas": "Enviar a Lienzo Unificado",
@@ -467,7 +495,6 @@
         "useAll": "Usar Todo",
         "useInitImg": "Usar Imagen Inicial",
         "info": "Información",
-        "deleteImage": "Eliminar Imagen",
         "initialImage": "Imagen Inicial",
         "showOptionsPanel": "Mostrar panel de opciones",
         "symmetry": "Simetría",
@@ -481,37 +508,72 @@
         },
         "copyImage": "Copiar la imagen",
         "general": "General",
-        "negativePrompts": "Preguntas negativas",
         "imageToImage": "Imagen a imagen",
         "denoisingStrength": "Intensidad de la eliminación del ruido",
         "hiresStrength": "Alta resistencia",
         "showPreview": "Mostrar la vista previa",
-        "hidePreview": "Ocultar la vista previa"
+        "hidePreview": "Ocultar la vista previa",
+        "noiseSettings": "Ruido",
+        "seamlessXAxis": "Eje x",
+        "seamlessYAxis": "Eje y",
+        "scheduler": "Programador",
+        "boundingBoxWidth": "Anchura del recuadro",
+        "boundingBoxHeight": "Altura del recuadro",
+        "positivePromptPlaceholder": "Prompt Positivo",
+        "negativePromptPlaceholder": "Prompt Negativo",
+        "controlNetControlMode": "Modo de control",
+        "clipSkip": "Omitir el CLIP",
+        "aspectRatio": "Relación",
+        "maskAdjustmentsHeader": "Ajustes de la máscara",
+        "maskBlur": "Difuminar",
+        "maskBlurMethod": "Método del desenfoque",
+        "seamHighThreshold": "Alto",
+        "seamLowThreshold": "Bajo",
+        "coherencePassHeader": "Parámetros de la coherencia",
+        "compositingSettingsHeader": "Ajustes de la composición",
+        "coherenceSteps": "Pasos",
+        "coherenceStrength": "Fuerza",
+        "patchmatchDownScaleSize": "Reducir a escala",
+        "coherenceMode": "Modo"
     },
     "settings": {
         "models": "Modelos",
-        "displayInProgress": "Mostrar imágenes en progreso",
+        "displayInProgress": "Mostrar las imágenes del progreso",
         "saveSteps": "Guardar imágenes cada n pasos",
         "confirmOnDelete": "Confirmar antes de eliminar",
         "displayHelpIcons": "Mostrar iconos de ayuda",
-        "useCanvasBeta": "Usar versión beta del Lienzo",
         "enableImageDebugging": "Habilitar depuración de imágenes",
         "resetWebUI": "Restablecer interfaz web",
         "resetWebUIDesc1": "Al restablecer la interfaz web, solo se restablece la caché local del navegador de sus imágenes y la configuración guardada. No se elimina ninguna imagen de su disco duro.",
         "resetWebUIDesc2": "Si las imágenes no se muestran en la galería o algo más no funciona, intente restablecer antes de reportar un incidente en GitHub.",
-        "resetComplete": "La interfaz web se ha restablecido. Actualice la página para recargarla.",
-        "useSlidersForAll": "Utilice controles deslizantes para todas las opciones"
+        "resetComplete": "Se ha restablecido la interfaz web.",
+        "useSlidersForAll": "Utilice controles deslizantes para todas las opciones",
+        "general": "General",
+        "consoleLogLevel": "Nivel del registro",
+        "shouldLogToConsole": "Registro de la consola",
+        "developer": "Desarrollador",
+        "antialiasProgressImages": "Imágenes del progreso de Antialias",
+        "showProgressInViewer": "Mostrar las imágenes del progreso en el visor",
+        "ui": "Interfaz del usuario",
+        "generation": "Generación",
+        "favoriteSchedulers": "Programadores favoritos",
+        "favoriteSchedulersPlaceholder": "No hay programadores favoritos",
+        "showAdvancedOptions": "Mostrar las opciones avanzadas",
+        "alternateCanvasLayout": "Diseño alternativo del lienzo",
+        "beta": "Beta",
+        "enableNodesEditor": "Activar el editor de nodos",
+        "experimental": "Experimental",
+        "autoChangeDimensions": "Actualiza W/H a los valores predeterminados del modelo cuando se modifica"
     },
     "toast": {
         "tempFoldersEmptied": "Directorio temporal vaciado",
         "uploadFailed": "Error al subir archivo",
-        "uploadFailedMultipleImagesDesc": "Únicamente se puede subir una imágen a la vez",
         "uploadFailedUnableToLoadDesc": "No se pudo cargar la imágen",
         "downloadImageStarted": "Descargando imágen",
         "imageCopied": "Imágen copiada",
         "imageLinkCopied": "Enlace de imágen copiado",
         "imageNotLoaded": "No se cargó la imágen",
-        "imageNotLoadedDesc": "No se encontró imagen para enviar al módulo Imagen a Imagen",
+        "imageNotLoadedDesc": "No se pudo encontrar la imagen",
         "imageSavedToGallery": "Imágen guardada en la galería",
         "canvasMerged": "Lienzo consolidado",
         "sentToImageToImage": "Enviar hacia Imagen a Imagen",
@@ -536,7 +598,21 @@
         "serverError": "Error en el servidor",
         "disconnected": "Desconectado del servidor",
         "canceled": "Procesando la cancelación",
-        "connected": "Conectado al servidor"
+        "connected": "Conectado al servidor",
+        "problemCopyingImageLink": "No se puede copiar el enlace de la imagen",
+        "uploadFailedInvalidUploadDesc": "Debe ser una sola imagen PNG o JPEG",
+        "parameterSet": "Conjunto de parámetros",
+        "parameterNotSet": "Parámetro no configurado",
+        "nodesSaved": "Nodos guardados",
+        "nodesLoadedFailed": "Error al cargar los nodos",
+        "nodesLoaded": "Nodos cargados",
+        "nodesCleared": "Nodos borrados",
+        "problemCopyingImage": "No se puede copiar la imagen",
+        "nodesNotValidJSON": "JSON no válido",
+        "nodesCorruptedGraph": "No se puede cargar. El gráfico parece estar dañado.",
+        "nodesUnrecognizedTypes": "No se puede cargar. El gráfico tiene tipos no reconocidos",
+        "nodesNotValidGraph": "Gráfico del nodo InvokeAI no válido",
+        "nodesBrokenConnections": "No se puede cargar. Algunas conexiones están rotas."
     },
     "tooltip": {
         "feature": {
@@ -610,7 +686,8 @@
         "betaClear": "Limpiar",
         "betaDarkenOutside": "Oscurecer fuera",
         "betaLimitToBox": "Limitar a caja",
-        "betaPreserveMasked": "Preservar área enmascarada"
+        "betaPreserveMasked": "Preservar área enmascarada",
+        "antialiasing": "Suavizado"
     },
     "accessibility": {
         "invokeProgressBar": "Activar la barra de progreso",
@@ -631,8 +708,30 @@
         "modifyConfig": "Modificar la configuración",
         "toggleAutoscroll": "Activar el autodesplazamiento",
         "toggleLogViewer": "Alternar el visor de registros",
-        "showGallery": "Mostrar galería",
-        "showOptionsPanel": "Mostrar el panel de opciones",
+        "showOptionsPanel": "Mostrar el panel lateral",
         "menu": "Menú"
+    },
+    "ui": {
+        "hideProgressImages": "Ocultar el progreso de la imagen",
+        "showProgressImages": "Mostrar el progreso de la imagen",
+        "swapSizes": "Cambiar los tamaños",
+        "lockRatio": "Proporción del bloqueo"
+    },
+    "nodes": {
+        "showGraphNodes": "Mostrar la superposición de los gráficos",
+        "zoomInNodes": "Acercar",
+        "hideMinimapnodes": "Ocultar el minimapa",
+        "fitViewportNodes": "Ajustar la vista",
+        "zoomOutNodes": "Alejar",
+        "hideGraphNodes": "Ocultar la superposición de los gráficos",
+        "hideLegendNodes": "Ocultar la leyenda del tipo de campo",
+        "showLegendNodes": "Mostrar la leyenda del tipo de campo",
+        "showMinimapnodes": "Mostrar el minimapa",
+        "reloadNodeTemplates": "Recargar las plantillas de nodos",
+        "loadWorkflow": "Cargar el flujo de trabajo",
+        "resetWorkflow": "Reiniciar e flujo de trabajo",
+        "resetWorkflowDesc": "¿Está seguro de que deseas restablecer este flujo de trabajo?",
+        "resetWorkflowDesc2": "Al reiniciar el flujo de trabajo se borrarán todos los nodos, aristas y detalles del flujo de trabajo.",
+        "downloadWorkflow": "Descargar el flujo de trabajo en un archivo JSON"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/fi.json b/invokeai/frontend/web/dist/locales/fi.json
index a6edd6d8b8..cf7fc6701b 100644
--- a/invokeai/frontend/web/dist/locales/fi.json
+++ b/invokeai/frontend/web/dist/locales/fi.json
@@ -15,7 +15,6 @@
         "rotateCounterClockwise": "Kierrä vastapäivään",
         "rotateClockwise": "Kierrä myötäpäivään",
         "flipVertically": "Käännä pystysuoraan",
-        "showGallery": "Näytä galleria",
         "modifyConfig": "Muokkaa konfiguraatiota",
         "toggleAutoscroll": "Kytke automaattinen vieritys",
         "toggleLogViewer": "Kytke lokin katselutila",
@@ -34,18 +33,13 @@
         "hotkeysLabel": "Pikanäppäimet",
         "reportBugLabel": "Raportoi Bugista",
         "langPolish": "Puola",
-        "themeLabel": "Teema",
         "langDutch": "Hollanti",
         "settingsLabel": "Asetukset",
         "githubLabel": "Github",
-        "darkTheme": "Tumma",
-        "lightTheme": "Vaalea",
-        "greenTheme": "Vihreä",
         "langGerman": "Saksa",
         "langPortuguese": "Portugali",
         "discordLabel": "Discord",
         "langEnglish": "Englanti",
-        "oceanTheme": "Meren sininen",
         "langRussian": "Venäjä",
         "langUkranian": "Ukraina",
         "langSpanish": "Espanja",
@@ -79,7 +73,6 @@
         "statusGeneratingInpainting": "Generoidaan sisällemaalausta",
         "statusGeneratingOutpainting": "Generoidaan ulosmaalausta",
         "statusRestoringFaces": "Korjataan kasvoja",
-        "pinOptionsPanel": "Kiinnitä asetukset -paneeli",
         "loadingInvokeAI": "Ladataan Invoke AI:ta",
         "loading": "Ladataan",
         "statusGenerating": "Generoidaan",
@@ -95,7 +88,6 @@
         "galleryImageResetSize": "Resetoi koko",
         "maintainAspectRatio": "Säilytä kuvasuhde",
         "galleryImageSize": "Kuvan koko",
-        "pinGallery": "Kiinnitä galleria",
         "showGenerations": "Näytä generaatiot",
         "singleColumnLayout": "Yhden sarakkeen asettelu",
         "generations": "Generoinnit",
diff --git a/invokeai/frontend/web/dist/locales/fr.json b/invokeai/frontend/web/dist/locales/fr.json
index cf215d7d06..b7ab932fcc 100644
--- a/invokeai/frontend/web/dist/locales/fr.json
+++ b/invokeai/frontend/web/dist/locales/fr.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Raccourcis clavier",
-        "themeLabel": "Thème",
         "languagePickerLabel": "Sélecteur de langue",
         "reportBugLabel": "Signaler un bug",
         "settingsLabel": "Paramètres",
-        "darkTheme": "Sombre",
-        "lightTheme": "Clair",
-        "greenTheme": "Vert",
         "img2img": "Image en image",
         "unifiedCanvas": "Canvas unifié",
         "nodes": "Nœuds",
@@ -55,7 +51,6 @@
         "statusConvertingModel": "Conversion du modèle",
         "statusModelConverted": "Modèle converti",
         "loading": "Chargement",
-        "pinOptionsPanel": "Épingler la page d'options",
         "statusMergedModels": "Modèles mélangés",
         "txt2img": "Texte vers image",
         "postprocessing": "Post-Traitement"
@@ -71,7 +66,6 @@
         "maintainAspectRatio": "Maintenir le rapport d'aspect",
         "autoSwitchNewImages": "Basculer automatiquement vers de nouvelles images",
         "singleColumnLayout": "Mise en page en colonne unique",
-        "pinGallery": "Épingler la galerie",
         "allImagesLoaded": "Toutes les images chargées",
         "loadMore": "Charger plus",
         "noImagesInGallery": "Aucune image dans la galerie"
@@ -356,7 +350,6 @@
         "cfgScale": "CFG Echelle",
         "width": "Largeur",
         "height": "Hauteur",
-        "sampler": "Echantillonneur",
         "seed": "Graine",
         "randomizeSeed": "Graine Aléatoire",
         "shuffle": "Mélanger",
@@ -378,10 +371,6 @@
         "hiresOptim": "Optimisation Haute Résolution",
         "imageFit": "Ajuster Image Initiale à la Taille de Sortie",
         "codeformerFidelity": "Fidélité",
-        "seamSize": "Taille des Joints",
-        "seamBlur": "Flou des Joints",
-        "seamStrength": "Force des Joints",
-        "seamSteps": "Etapes des Joints",
         "scaleBeforeProcessing": "Echelle Avant Traitement",
         "scaledWidth": "Larg. Échelle",
         "scaledHeight": "Haut. Échelle",
@@ -392,8 +381,6 @@
         "infillScalingHeader": "Remplissage et Mise à l'Échelle",
         "img2imgStrength": "Force de l'Image à l'Image",
         "toggleLoopback": "Activer/Désactiver la Boucle",
-        "invoke": "Invoker",
-        "promptPlaceholder": "Tapez le prompt ici. [tokens négatifs], (poids positif)++, (poids négatif)--, swap et blend sont disponibles (voir les docs)",
         "sendTo": "Envoyer à",
         "sendToImg2Img": "Envoyer à Image à Image",
         "sendToUnifiedCanvas": "Envoyer au Canvas Unifié",
@@ -407,7 +394,6 @@
         "useAll": "Tout utiliser",
         "useInitImg": "Utiliser l'image initiale",
         "info": "Info",
-        "deleteImage": "Supprimer l'image",
         "initialImage": "Image initiale",
         "showOptionsPanel": "Afficher le panneau d'options"
     },
@@ -417,7 +403,6 @@
         "saveSteps": "Enregistrer les images tous les n étapes",
         "confirmOnDelete": "Confirmer la suppression",
         "displayHelpIcons": "Afficher les icônes d'aide",
-        "useCanvasBeta": "Utiliser la mise en page bêta de Canvas",
         "enableImageDebugging": "Activer le débogage d'image",
         "resetWebUI": "Réinitialiser l'interface Web",
         "resetWebUIDesc1": "Réinitialiser l'interface Web ne réinitialise que le cache local du navigateur de vos images et de vos paramètres enregistrés. Cela n'efface pas les images du disque.",
@@ -427,7 +412,6 @@
     "toast": {
         "tempFoldersEmptied": "Dossiers temporaires vidés",
         "uploadFailed": "Téléchargement échoué",
-        "uploadFailedMultipleImagesDesc": "Plusieurs images collées, peut uniquement télécharger une image à la fois",
         "uploadFailedUnableToLoadDesc": "Impossible de charger le fichier",
         "downloadImageStarted": "Téléchargement de l'image démarré",
         "imageCopied": "Image copiée",
@@ -538,6 +522,10 @@
         "useThisParameter": "Utiliser ce paramètre",
         "zoomIn": "Zoom avant",
         "zoomOut": "Zoom arrière",
-        "showOptionsPanel": "Montrer la page d'options"
+        "showOptionsPanel": "Montrer la page d'options",
+        "modelSelect": "Choix du modèle",
+        "invokeProgressBar": "Barre de Progression Invoke",
+        "copyMetadataJson": "Copie des métadonnées JSON",
+        "menu": "Menu"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/he.json b/invokeai/frontend/web/dist/locales/he.json
index c9b4ff3b17..dfb5ea0360 100644
--- a/invokeai/frontend/web/dist/locales/he.json
+++ b/invokeai/frontend/web/dist/locales/he.json
@@ -107,13 +107,10 @@
     },
     "common": {
         "nodesDesc": "מערכת מבוססת צמתים עבור יצירת תמונות עדיין תחת פיתוח. השארו קשובים לעדכונים עבור הפיצ׳ר המדהים הזה.",
-        "themeLabel": "ערכת נושא",
         "languagePickerLabel": "בחירת שפה",
         "githubLabel": "גיטהאב",
         "discordLabel": "דיסקורד",
         "settingsLabel": "הגדרות",
-        "darkTheme": "חשוך",
-        "lightTheme": "מואר",
         "langEnglish": "אנגלית",
         "langDutch": "הולנדית",
         "langArabic": "ערבית",
@@ -155,7 +152,6 @@
         "statusMergedModels": "מודלים מוזגו",
         "hotkeysLabel": "מקשים חמים",
         "reportBugLabel": "דווח באג",
-        "greenTheme": "ירוק",
         "langItalian": "איטלקית",
         "upload": "העלאה",
         "langPolish": "פולנית",
@@ -384,7 +380,6 @@
         "maintainAspectRatio": "שמור על יחס רוחב-גובה",
         "autoSwitchNewImages": "החלף אוטומטית לתמונות חדשות",
         "singleColumnLayout": "תצוגת עמודה אחת",
-        "pinGallery": "הצמד גלריה",
         "allImagesLoaded": "כל התמונות נטענו",
         "loadMore": "טען עוד",
         "noImagesInGallery": "אין תמונות בגלריה",
@@ -399,7 +394,6 @@
         "cfgScale": "סולם CFG",
         "width": "רוחב",
         "height": "גובה",
-        "sampler": "דוגם",
         "seed": "זרע",
         "imageToImage": "תמונה לתמונה",
         "randomizeSeed": "זרע אקראי",
@@ -416,10 +410,6 @@
         "hiresOptim": "אופטימיזצית רזולוציה גבוהה",
         "hiresStrength": "חוזק רזולוציה גבוהה",
         "codeformerFidelity": "דבקות",
-        "seamSize": "גודל תפר",
-        "seamBlur": "טשטוש תפר",
-        "seamStrength": "חוזק תפר",
-        "seamSteps": "שלבי תפר",
         "scaleBeforeProcessing": "שנה קנה מידה לפני עיבוד",
         "scaledWidth": "קנה מידה לאחר שינוי W",
         "scaledHeight": "קנה מידה לאחר שינוי H",
@@ -432,14 +422,12 @@
         "symmetry": "סימטריה",
         "vSymmetryStep": "צעד סימטריה V",
         "hSymmetryStep": "צעד סימטריה H",
-        "invoke": "הפעלה",
         "cancel": {
             "schedule": "ביטול לאחר האיטרציה הנוכחית",
             "isScheduled": "מבטל",
             "immediate": "ביטול מיידי",
             "setType": "הגדר סוג ביטול"
         },
-        "negativePrompts": "בקשות שליליות",
         "sendTo": "שליחה אל",
         "copyImage": "העתקת תמונה",
         "downloadImage": "הורדת תמונה",
@@ -464,15 +452,12 @@
         "seamlessTiling": "ריצוף חלק",
         "img2imgStrength": "חוזק תמונה לתמונה",
         "initialImage": "תמונה ראשונית",
-        "copyImageToLink": "העתקת תמונה לקישור",
-        "deleteImage": "מחיקת תמונה",
-        "promptPlaceholder": "הקלד בקשה כאן. [אסימונים שליליים], (העלאת משקל)++ , (הורדת משקל)--, החלפה ומיזוג זמינים (ראה מסמכים)"
+        "copyImageToLink": "העתקת תמונה לקישור"
     },
     "settings": {
         "models": "מודלים",
         "displayInProgress": "הצגת תמונות בתהליך",
         "confirmOnDelete": "אישור בעת המחיקה",
-        "useCanvasBeta": "שימוש בגרסת ביתא של תצוגת הקנבס",
         "useSlidersForAll": "שימוש במחוונים לכל האפשרויות",
         "resetWebUI": "איפוס ממשק משתמש",
         "resetWebUIDesc1": "איפוס ממשק המשתמש האינטרנטי מאפס רק את המטמון המקומי של הדפדפן של התמונות וההגדרות שנשמרו. זה לא מוחק תמונות מהדיסק.",
@@ -484,7 +469,6 @@
     },
     "toast": {
         "uploadFailed": "העלאה נכשלה",
-        "uploadFailedMultipleImagesDesc": "תמונות מרובות הודבקו, ניתן להעלות תמונה אחת בלבד בכל פעם",
         "imageCopied": "התמונה הועתקה",
         "imageLinkCopied": "קישור תמונה הועתק",
         "imageNotLoadedDesc": "לא נמצאה תמונה לשליחה למודול תמונה לתמונה",
diff --git a/invokeai/frontend/web/dist/locales/it.json b/invokeai/frontend/web/dist/locales/it.json
index 4ac5b6831d..42836e4d0f 100644
--- a/invokeai/frontend/web/dist/locales/it.json
+++ b/invokeai/frontend/web/dist/locales/it.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Tasti di scelta rapida",
-        "themeLabel": "Tema",
-        "languagePickerLabel": "Seleziona lingua",
+        "languagePickerLabel": "Lingua",
         "reportBugLabel": "Segnala un errore",
         "settingsLabel": "Impostazioni",
-        "darkTheme": "Scuro",
-        "lightTheme": "Chiaro",
-        "greenTheme": "Verde",
         "img2img": "Immagine a Immagine",
         "unifiedCanvas": "Tela unificata",
-        "nodes": "Nodi",
+        "nodes": "Editor del flusso di lavoro",
         "langItalian": "Italiano",
         "nodesDesc": "Attualmente è in fase di sviluppo un sistema basato su nodi per la generazione di immagini. Resta sintonizzato per gli aggiornamenti su questa fantastica funzionalità.",
         "postProcessing": "Post-elaborazione",
@@ -19,7 +15,7 @@
         "postProcessDesc3": "L'interfaccia da riga di comando di 'Invoke AI' offre varie altre funzionalità tra cui Embiggen.",
         "training": "Addestramento",
         "trainingDesc1": "Un flusso di lavoro dedicato per addestrare i tuoi Incorporamenti e Checkpoint utilizzando Inversione Testuale e Dreambooth dall'interfaccia web.",
-        "trainingDesc2": "InvokeAI supporta già l'addestramento di incorporamenti personalizzati utilizzando l'inversione testuale utilizzando lo script principale.",
+        "trainingDesc2": "InvokeAI supporta già l'addestramento di incorporamenti personalizzati utilizzando l'inversione testuale tramite lo script principale.",
         "upload": "Caricamento",
         "close": "Chiudi",
         "load": "Carica",
@@ -31,14 +27,14 @@
         "statusProcessingCanceled": "Elaborazione annullata",
         "statusProcessingComplete": "Elaborazione completata",
         "statusGenerating": "Generazione in corso",
-        "statusGeneratingTextToImage": "Generazione da Testo a Immagine",
+        "statusGeneratingTextToImage": "Generazione Testo a Immagine",
         "statusGeneratingImageToImage": "Generazione da Immagine a Immagine",
         "statusGeneratingInpainting": "Generazione Inpainting",
         "statusGeneratingOutpainting": "Generazione Outpainting",
         "statusGenerationComplete": "Generazione completata",
         "statusIterationComplete": "Iterazione completata",
         "statusSavingImage": "Salvataggio dell'immagine",
-        "statusRestoringFaces": "Restaura i volti",
+        "statusRestoringFaces": "Restaura volti",
         "statusRestoringFacesGFPGAN": "Restaura volti (GFPGAN)",
         "statusRestoringFacesCodeFormer": "Restaura volti (CodeFormer)",
         "statusUpscaling": "Ampliamento",
@@ -65,16 +61,33 @@
         "statusConvertingModel": "Conversione Modello",
         "langKorean": "Coreano",
         "langPortuguese": "Portoghese",
-        "pinOptionsPanel": "Blocca il pannello Opzioni",
         "loading": "Caricamento in corso",
-        "oceanTheme": "Oceano",
         "langHebrew": "Ebraico",
         "loadingInvokeAI": "Caricamento Invoke AI",
         "postprocessing": "Post Elaborazione",
         "txt2img": "Testo a Immagine",
         "accept": "Accetta",
         "cancel": "Annulla",
-        "linear": "Lineare"
+        "linear": "Lineare",
+        "generate": "Genera",
+        "random": "Casuale",
+        "openInNewTab": "Apri in una nuova scheda",
+        "areYouSure": "Sei sicuro?",
+        "dontAskMeAgain": "Non chiedermelo più",
+        "imagePrompt": "Prompt Immagine",
+        "darkMode": "Modalità scura",
+        "lightMode": "Modalità chiara",
+        "batch": "Gestione Lotto",
+        "modelManager": "Gestore modello",
+        "communityLabel": "Comunità",
+        "nodeEditor": "Editor dei nodi",
+        "statusProcessing": "Elaborazione in corso",
+        "advanced": "Avanzate",
+        "imageFailedToLoad": "Impossibile caricare l'immagine",
+        "learnMore": "Per saperne di più",
+        "ipAdapter": "Adattatore IP",
+        "t2iAdapter": "Adattatore T2I",
+        "controlAdapter": "Adattatore di Controllo"
     },
     "gallery": {
         "generations": "Generazioni",
@@ -87,10 +100,22 @@
         "maintainAspectRatio": "Mantenere le proporzioni",
         "autoSwitchNewImages": "Passaggio automatico a nuove immagini",
         "singleColumnLayout": "Layout a colonna singola",
-        "pinGallery": "Blocca la galleria",
         "allImagesLoaded": "Tutte le immagini caricate",
-        "loadMore": "Carica di più",
-        "noImagesInGallery": "Nessuna immagine nella galleria"
+        "loadMore": "Carica altro",
+        "noImagesInGallery": "Nessuna immagine da visualizzare",
+        "deleteImage": "Elimina l'immagine",
+        "deleteImagePermanent": "Le immagini eliminate non possono essere ripristinate.",
+        "deleteImageBin": "Le immagini eliminate verranno spostate nel Cestino del tuo sistema operativo.",
+        "images": "Immagini",
+        "assets": "Risorse",
+        "autoAssignBoardOnClick": "Assegna automaticamente la bacheca al clic",
+        "featuresWillReset": "Se elimini questa immagine, quelle funzionalità verranno immediatamente ripristinate.",
+        "loading": "Caricamento in corso",
+        "unableToLoad": "Impossibile caricare la Galleria",
+        "currentlyInUse": "Questa immagine è attualmente utilizzata nelle seguenti funzionalità:",
+        "copy": "Copia",
+        "download": "Scarica",
+        "setCurrentImage": "Imposta come immagine corrente"
     },
     "hotkeys": {
         "keyboardShortcuts": "Tasti rapidi",
@@ -163,7 +188,7 @@
             "desc": "Mostra le informazioni sui metadati dell'immagine corrente"
         },
         "sendToImageToImage": {
-            "title": "Invia a da Immagine a Immagine",
+            "title": "Invia a Immagine a Immagine",
             "desc": "Invia l'immagine corrente a da Immagine a Immagine"
         },
         "deleteImage": {
@@ -297,6 +322,11 @@
         "acceptStagingImage": {
             "title": "Accetta l'immagine della sessione",
             "desc": "Accetta l'immagine dell'area della sessione corrente"
+        },
+        "nodesHotkeys": "Tasti di scelta rapida dei Nodi",
+        "addNodes": {
+            "title": "Aggiungi Nodi",
+            "desc": "Apre il menu Aggiungi Nodi"
         }
     },
     "modelManager": {
@@ -308,7 +338,7 @@
         "safetensorModels": "SafeTensor",
         "modelAdded": "Modello Aggiunto",
         "modelUpdated": "Modello Aggiornato",
-        "modelEntryDeleted": "Modello Rimosso",
+        "modelEntryDeleted": "Voce del modello eliminata",
         "cannotUseSpaces": "Impossibile utilizzare gli spazi",
         "addNew": "Aggiungi nuovo",
         "addNewModel": "Aggiungi nuovo Modello",
@@ -323,7 +353,7 @@
         "config": "Configurazione",
         "configValidationMsg": "Percorso del file di configurazione del modello.",
         "modelLocation": "Posizione del modello",
-        "modelLocationValidationMsg": "Percorso dove si trova il modello.",
+        "modelLocationValidationMsg": "Fornisci il percorso di una cartella locale in cui è archiviato il tuo modello di diffusori",
         "repo_id": "Repo ID",
         "repoIDValidationMsg": "Repository online del modello",
         "vaeLocation": "Posizione file VAE",
@@ -360,7 +390,7 @@
         "deleteModel": "Elimina modello",
         "deleteConfig": "Elimina configurazione",
         "deleteMsg1": "Sei sicuro di voler eliminare questo modello da InvokeAI?",
-        "deleteMsg2": "Questo non eliminerà il file Checkpoint del modello dal tuo disco. Puoi aggiungerlo nuovamente se lo desideri.",
+        "deleteMsg2": "Questo eliminerà il modello dal disco se si trova nella cartella principale di InvokeAI. Se utilizzi una cartella personalizzata, il modello NON verrà eliminato dal disco.",
         "formMessageDiffusersModelLocation": "Ubicazione modelli diffusori",
         "formMessageDiffusersModelLocationDesc": "Inseriscine almeno uno.",
         "formMessageDiffusersVAELocation": "Ubicazione file VAE",
@@ -369,7 +399,7 @@
         "convertToDiffusers": "Converti in Diffusori",
         "convertToDiffusersHelpText2": "Questo processo sostituirà la voce in Gestione Modelli con la versione Diffusori dello stesso modello.",
         "convertToDiffusersHelpText4": "Questo è un processo una tantum. Potrebbero essere necessari circa 30-60 secondi a seconda delle specifiche del tuo computer.",
-        "convertToDiffusersHelpText5": "Assicurati di avere spazio su disco sufficiente. I modelli generalmente variano tra 4 GB e 7 GB di dimensioni.",
+        "convertToDiffusersHelpText5": "Assicurati di avere spazio su disco sufficiente. I modelli generalmente variano tra 2 GB e 7 GB di dimensioni.",
         "convertToDiffusersHelpText6": "Vuoi convertire questo modello?",
         "convertToDiffusersSaveLocation": "Ubicazione salvataggio",
         "inpainting": "v1 Inpainting",
@@ -378,12 +408,12 @@
         "modelConverted": "Modello convertito",
         "sameFolder": "Stessa cartella",
         "invokeRoot": "Cartella InvokeAI",
-        "merge": "Fondere",
-        "modelsMerged": "Modelli fusi",
-        "mergeModels": "Fondi Modelli",
+        "merge": "Unisci",
+        "modelsMerged": "Modelli uniti",
+        "mergeModels": "Unisci Modelli",
         "modelOne": "Modello 1",
         "modelTwo": "Modello 2",
-        "mergedModelName": "Nome del modello fuso",
+        "mergedModelName": "Nome del modello unito",
         "alpha": "Alpha",
         "interpolationType": "Tipo di interpolazione",
         "mergedModelCustomSaveLocation": "Percorso personalizzato",
@@ -394,7 +424,7 @@
         "mergedModelSaveLocation": "Ubicazione salvataggio",
         "convertToDiffusersHelpText1": "Questo modello verrà convertito nel formato 🧨 Diffusore.",
         "custom": "Personalizzata",
-        "convertToDiffusersHelpText3": "Il tuo file checkpoint sul disco NON verrà comunque cancellato o modificato. Se lo desideri, puoi aggiungerlo di nuovo in Gestione Modelli.",
+        "convertToDiffusersHelpText3": "Il file checkpoint su disco SARÀ eliminato se si trova nella cartella principale di InvokeAI. Se si trova in una posizione personalizzata, NON verrà eliminato.",
         "v1": "v1",
         "pathToCustomConfig": "Percorso alla configurazione personalizzata",
         "modelThree": "Modello 3",
@@ -406,10 +436,39 @@
         "inverseSigmoid": "Sigmoide inverso",
         "v2_base": "v2 (512px)",
         "v2_768": "v2 (768px)",
-        "none": "niente",
+        "none": "nessuno",
         "addDifference": "Aggiungi differenza",
         "pickModelType": "Scegli il tipo di modello",
-        "scanForModels": "Cerca modelli"
+        "scanForModels": "Cerca modelli",
+        "variant": "Variante",
+        "baseModel": "Modello Base",
+        "vae": "VAE",
+        "modelUpdateFailed": "Aggiornamento del modello non riuscito",
+        "modelConversionFailed": "Conversione del modello non riuscita",
+        "modelsMergeFailed": "Unione modelli non riuscita",
+        "selectModel": "Seleziona Modello",
+        "modelDeleted": "Modello eliminato",
+        "modelDeleteFailed": "Impossibile eliminare il modello",
+        "noCustomLocationProvided": "Nessuna posizione personalizzata fornita",
+        "convertingModelBegin": "Conversione del modello. Attendere prego.",
+        "importModels": "Importa modelli",
+        "modelsSynced": "Modelli sincronizzati",
+        "modelSyncFailed": "Sincronizzazione modello non riuscita",
+        "settings": "Impostazioni",
+        "syncModels": "Sincronizza Modelli",
+        "syncModelsDesc": "Se i tuoi modelli non sono sincronizzati con il back-end, puoi aggiornarli utilizzando questa opzione. Questo è generalmente utile nei casi in cui aggiorni manualmente il tuo file models.yaml o aggiungi modelli alla cartella principale di InvokeAI dopo l'avvio dell'applicazione.",
+        "loraModels": "LoRA",
+        "oliveModels": "Olive",
+        "onnxModels": "ONNX",
+        "noModels": "Nessun modello trovato",
+        "predictionType": "Tipo di previsione (per modelli Stable Diffusion 2.x ed alcuni modelli Stable Diffusion 1.x)",
+        "quickAdd": "Aggiunta rapida",
+        "simpleModelDesc": "Fornire un percorso a un modello diffusori locale, un modello checkpoint/safetensor locale, un ID repository HuggingFace o un URL del modello checkpoint/diffusori.",
+        "advanced": "Avanzate",
+        "useCustomConfig": "Utilizza configurazione personalizzata",
+        "closeAdvanced": "Chiudi Avanzate",
+        "modelType": "Tipo di modello",
+        "customConfigFileLocation": "Posizione del file di configurazione personalizzato"
     },
     "parameters": {
         "images": "Immagini",
@@ -417,10 +476,9 @@
         "cfgScale": "Scala CFG",
         "width": "Larghezza",
         "height": "Altezza",
-        "sampler": "Campionatore",
         "seed": "Seme",
         "randomizeSeed": "Seme randomizzato",
-        "shuffle": "Casuale",
+        "shuffle": "Mescola il seme",
         "noiseThreshold": "Soglia del rumore",
         "perlinNoise": "Rumore Perlin",
         "variations": "Variazioni",
@@ -431,7 +489,7 @@
         "type": "Tipo",
         "strength": "Forza",
         "upscaling": "Ampliamento",
-        "upscale": "Amplia",
+        "upscale": "Amplia (Shift + U)",
         "upscaleImage": "Amplia Immagine",
         "scale": "Scala",
         "otherOptions": "Altre opzioni",
@@ -439,10 +497,6 @@
         "hiresOptim": "Ottimizzazione alta risoluzione",
         "imageFit": "Adatta l'immagine iniziale alle dimensioni di output",
         "codeformerFidelity": "Fedeltà",
-        "seamSize": "Dimensione della cucitura",
-        "seamBlur": "Sfocatura cucitura",
-        "seamStrength": "Forza della cucitura",
-        "seamSteps": "Passaggi di cucitura",
         "scaleBeforeProcessing": "Scala prima dell'elaborazione",
         "scaledWidth": "Larghezza ridimensionata",
         "scaledHeight": "Altezza ridimensionata",
@@ -453,10 +507,8 @@
         "infillScalingHeader": "Riempimento e ridimensionamento",
         "img2imgStrength": "Forza da Immagine a Immagine",
         "toggleLoopback": "Attiva/disattiva elaborazione ricorsiva",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Digita qui il prompt usando termini in lingua inglese. [token negativi], (aumenta il peso)++, (diminuisci il peso)--, scambia e fondi sono disponibili (consulta la documentazione)",
         "sendTo": "Invia a",
-        "sendToImg2Img": "Invia a da Immagine a Immagine",
+        "sendToImg2Img": "Invia a Immagine a Immagine",
         "sendToUnifiedCanvas": "Invia a Tela Unificata",
         "copyImageToLink": "Copia l'immagine nel collegamento",
         "downloadImage": "Scarica l'immagine",
@@ -467,54 +519,121 @@
         "useAll": "Usa Tutto",
         "useInitImg": "Usa l'immagine iniziale",
         "info": "Informazioni",
-        "deleteImage": "Elimina immagine",
         "initialImage": "Immagine iniziale",
-        "showOptionsPanel": "Mostra pannello opzioni",
+        "showOptionsPanel": "Mostra il pannello laterale (O o T)",
         "general": "Generale",
-        "denoisingStrength": "Forza riduzione rumore",
+        "denoisingStrength": "Forza di riduzione del rumore",
         "copyImage": "Copia immagine",
         "hiresStrength": "Forza Alta Risoluzione",
-        "negativePrompts": "Prompt Negativi",
         "imageToImage": "Immagine a Immagine",
         "cancel": {
             "schedule": "Annulla dopo l'iterazione corrente",
             "isScheduled": "Annullamento",
             "setType": "Imposta il tipo di annullamento",
-            "immediate": "Annulla immediatamente"
+            "immediate": "Annulla immediatamente",
+            "cancel": "Annulla"
         },
         "hSymmetryStep": "Passi Simmetria Orizzontale",
         "vSymmetryStep": "Passi Simmetria Verticale",
         "symmetry": "Simmetria",
         "hidePreview": "Nascondi l'anteprima",
-        "showPreview": "Mostra l'anteprima"
+        "showPreview": "Mostra l'anteprima",
+        "noiseSettings": "Rumore",
+        "seamlessXAxis": "Asse X",
+        "seamlessYAxis": "Asse Y",
+        "scheduler": "Campionatore",
+        "boundingBoxWidth": "Larghezza riquadro di delimitazione",
+        "boundingBoxHeight": "Altezza riquadro di delimitazione",
+        "positivePromptPlaceholder": "Prompt Positivo",
+        "negativePromptPlaceholder": "Prompt Negativo",
+        "controlNetControlMode": "Modalità di controllo",
+        "clipSkip": "CLIP Skip",
+        "aspectRatio": "Proporzioni",
+        "maskAdjustmentsHeader": "Regolazioni della maschera",
+        "maskBlur": "Sfocatura",
+        "maskBlurMethod": "Metodo di sfocatura",
+        "seamLowThreshold": "Basso",
+        "seamHighThreshold": "Alto",
+        "coherencePassHeader": "Passaggio di coerenza",
+        "coherenceSteps": "Passi",
+        "coherenceStrength": "Forza",
+        "compositingSettingsHeader": "Impostazioni di composizione",
+        "patchmatchDownScaleSize": "Ridimensiona",
+        "coherenceMode": "Modalità",
+        "invoke": {
+            "noNodesInGraph": "Nessun nodo nel grafico",
+            "noModelSelected": "Nessun modello selezionato",
+            "noPrompts": "Nessun prompt generato",
+            "noInitialImageSelected": "Nessuna immagine iniziale selezionata",
+            "readyToInvoke": "Pronto per invocare",
+            "addingImagesTo": "Aggiungi immagini a",
+            "systemBusy": "Sistema occupato",
+            "unableToInvoke": "Impossibile invocare",
+            "systemDisconnected": "Sistema disconnesso",
+            "noControlImageForControlAdapter": "L'adattatore di controllo {{number}} non ha un'immagine di controllo",
+            "noModelForControlAdapter": "Nessun modello selezionato per l'adattatore di controllo {{number}}.",
+            "incompatibleBaseModelForControlAdapter": "Il modello dell'adattatore di controllo {{number}} non è compatibile con il modello principale."
+        },
+        "enableNoiseSettings": "Abilita le impostazioni del rumore",
+        "cpuNoise": "Rumore CPU",
+        "gpuNoise": "Rumore GPU",
+        "useCpuNoise": "Usa la CPU per generare rumore",
+        "manualSeed": "Seme manuale",
+        "randomSeed": "Seme casuale",
+        "iterations": "Iterazioni",
+        "iterationsWithCount_one": "{{count}} Iterazione",
+        "iterationsWithCount_many": "{{count}} Iterazioni",
+        "iterationsWithCount_other": "",
+        "seamlessX&Y": "Senza cuciture X & Y",
+        "isAllowedToUpscale": {
+            "useX2Model": "L'immagine è troppo grande per l'ampliamento con il modello x4, utilizza il modello x2",
+            "tooLarge": "L'immagine è troppo grande per l'ampliamento, seleziona un'immagine più piccola"
+        },
+        "seamlessX": "Senza cuciture X",
+        "seamlessY": "Senza cuciture Y",
+        "imageActions": "Azioni Immagine"
     },
     "settings": {
         "models": "Modelli",
-        "displayInProgress": "Visualizza immagini in corso",
+        "displayInProgress": "Visualizza le immagini di avanzamento",
         "saveSteps": "Salva le immagini ogni n passaggi",
         "confirmOnDelete": "Conferma l'eliminazione",
         "displayHelpIcons": "Visualizza le icone della Guida",
-        "useCanvasBeta": "Utilizza il layout beta di Canvas",
         "enableImageDebugging": "Abilita il debug dell'immagine",
         "resetWebUI": "Reimposta l'interfaccia utente Web",
         "resetWebUIDesc1": "Il ripristino dell'interfaccia utente Web reimposta solo la cache locale del browser delle immagini e le impostazioni memorizzate. Non cancella alcuna immagine dal disco.",
         "resetWebUIDesc2": "Se le immagini non vengono visualizzate nella galleria o qualcos'altro non funziona, prova a reimpostare prima di segnalare un problema su GitHub.",
-        "resetComplete": "L'interfaccia utente Web è stata reimpostata. Aggiorna la pagina per ricaricarla.",
-        "useSlidersForAll": "Usa i cursori per tutte le opzioni"
+        "resetComplete": "L'interfaccia utente Web è stata reimpostata.",
+        "useSlidersForAll": "Usa i cursori per tutte le opzioni",
+        "general": "Generale",
+        "consoleLogLevel": "Livello del registro",
+        "shouldLogToConsole": "Registrazione della console",
+        "developer": "Sviluppatore",
+        "antialiasProgressImages": "Anti aliasing delle immagini di avanzamento",
+        "showProgressInViewer": "Mostra le immagini di avanzamento nel visualizzatore",
+        "generation": "Generazione",
+        "ui": "Interfaccia Utente",
+        "favoriteSchedulersPlaceholder": "Nessun campionatore preferito",
+        "favoriteSchedulers": "Campionatori preferiti",
+        "showAdvancedOptions": "Mostra Opzioni Avanzate",
+        "alternateCanvasLayout": "Layout alternativo della tela",
+        "beta": "Beta",
+        "enableNodesEditor": "Abilita l'editor dei nodi",
+        "experimental": "Sperimentale",
+        "autoChangeDimensions": "Aggiorna L/A alle impostazioni predefinite del modello in caso di modifica"
     },
     "toast": {
         "tempFoldersEmptied": "Cartella temporanea svuotata",
         "uploadFailed": "Caricamento fallito",
-        "uploadFailedMultipleImagesDesc": "Più immagini incollate, si può caricare solo un'immagine alla volta",
         "uploadFailedUnableToLoadDesc": "Impossibile caricare il file",
         "downloadImageStarted": "Download dell'immagine avviato",
         "imageCopied": "Immagine copiata",
         "imageLinkCopied": "Collegamento immagine copiato",
         "imageNotLoaded": "Nessuna immagine caricata",
-        "imageNotLoadedDesc": "Nessuna immagine trovata da inviare al modulo da Immagine a Immagine",
+        "imageNotLoadedDesc": "Impossibile trovare l'immagine",
         "imageSavedToGallery": "Immagine salvata nella Galleria",
         "canvasMerged": "Tela unita",
-        "sentToImageToImage": "Inviato a da Immagine a Immagine",
+        "sentToImageToImage": "Inviato a Immagine a Immagine",
         "sentToUnifiedCanvas": "Inviato a Tela Unificata",
         "parametersSet": "Parametri impostati",
         "parametersNotSet": "Parametri non impostati",
@@ -536,7 +655,57 @@
         "serverError": "Errore del Server",
         "disconnected": "Disconnesso dal Server",
         "connected": "Connesso al Server",
-        "canceled": "Elaborazione annullata"
+        "canceled": "Elaborazione annullata",
+        "problemCopyingImageLink": "Impossibile copiare il collegamento dell'immagine",
+        "uploadFailedInvalidUploadDesc": "Deve essere una singola immagine PNG o JPEG",
+        "parameterSet": "Parametro impostato",
+        "parameterNotSet": "Parametro non impostato",
+        "nodesLoadedFailed": "Impossibile caricare i nodi",
+        "nodesSaved": "Nodi salvati",
+        "nodesLoaded": "Nodi caricati",
+        "nodesCleared": "Nodi cancellati",
+        "problemCopyingImage": "Impossibile copiare l'immagine",
+        "nodesNotValidGraph": "Grafico del nodo InvokeAI non valido",
+        "nodesCorruptedGraph": "Impossibile caricare. Il grafico sembra essere danneggiato.",
+        "nodesUnrecognizedTypes": "Impossibile caricare. Il grafico ha tipi di dati non riconosciuti",
+        "nodesNotValidJSON": "JSON non valido",
+        "nodesBrokenConnections": "Impossibile caricare. Alcune connessioni sono interrotte.",
+        "baseModelChangedCleared_one": "Il modello base è stato modificato, cancellato o disabilitato {{number}} sotto-modello incompatibile",
+        "baseModelChangedCleared_many": "",
+        "baseModelChangedCleared_other": "",
+        "imageSavingFailed": "Salvataggio dell'immagine non riuscito",
+        "canvasSentControlnetAssets": "Tela inviata a ControlNet & Risorse",
+        "problemCopyingCanvasDesc": "Impossibile copiare la tela",
+        "loadedWithWarnings": "Flusso di lavoro caricato con avvisi",
+        "canvasCopiedClipboard": "Tela copiata negli appunti",
+        "maskSavedAssets": "Maschera salvata nelle risorse",
+        "modelAddFailed": "Aggiunta del modello non riuscita",
+        "problemDownloadingCanvas": "Problema durante il download della tela",
+        "problemMergingCanvas": "Problema nell'unione delle tele",
+        "imageUploaded": "Immagine caricata",
+        "addedToBoard": "Aggiunto alla bacheca",
+        "modelAddedSimple": "Modello aggiunto",
+        "problemImportingMaskDesc": "Impossibile importare la maschera",
+        "problemCopyingCanvas": "Problema durante la copia della tela",
+        "problemSavingCanvas": "Problema nel salvataggio della tela",
+        "canvasDownloaded": "Tela scaricata",
+        "problemMergingCanvasDesc": "Impossibile unire le tele",
+        "problemDownloadingCanvasDesc": "Impossibile scaricare la tela",
+        "imageSaved": "Immagine salvata",
+        "maskSentControlnetAssets": "Maschera inviata a ControlNet & Risorse",
+        "canvasSavedGallery": "Tela salvata nella Galleria",
+        "imageUploadFailed": "Caricamento immagine non riuscito",
+        "modelAdded": "Modello aggiunto: {{modelName}}",
+        "problemImportingMask": "Problema durante l'importazione della maschera",
+        "setInitialImage": "Imposta come immagine iniziale",
+        "setControlImage": "Imposta come immagine di controllo",
+        "setNodeField": "Imposta come campo nodo",
+        "problemSavingMask": "Problema nel salvataggio della maschera",
+        "problemSavingCanvasDesc": "Impossibile salvare la tela",
+        "setCanvasInitialImage": "Imposta come immagine iniziale della tela",
+        "workflowLoaded": "Flusso di lavoro caricato",
+        "setIPAdapterImage": "Imposta come immagine per l'Adattatore IP",
+        "problemSavingMaskDesc": "Impossibile salvare la maschera"
     },
     "tooltip": {
         "feature": {
@@ -610,7 +779,10 @@
         "betaClear": "Svuota",
         "betaDarkenOutside": "Oscura all'esterno",
         "betaLimitToBox": "Limita al rettangolo",
-        "betaPreserveMasked": "Conserva quanto mascherato"
+        "betaPreserveMasked": "Conserva quanto mascherato",
+        "antialiasing": "Anti aliasing",
+        "showResultsOn": "Mostra i risultati (attivato)",
+        "showResultsOff": "Mostra i risultati (disattivato)"
     },
     "accessibility": {
         "modelSelect": "Seleziona modello",
@@ -628,11 +800,519 @@
         "rotateClockwise": "Ruotare in senso orario",
         "flipHorizontally": "Capovolgi orizzontalmente",
         "toggleLogViewer": "Attiva/disattiva visualizzatore registro",
-        "showGallery": "Mostra la galleria immagini",
-        "showOptionsPanel": "Mostra il pannello opzioni",
+        "showOptionsPanel": "Mostra il pannello laterale",
         "flipVertically": "Capovolgi verticalmente",
         "toggleAutoscroll": "Attiva/disattiva lo scorrimento automatico",
         "modifyConfig": "Modifica configurazione",
-        "menu": "Menu"
+        "menu": "Menu",
+        "showGalleryPanel": "Mostra il pannello Galleria",
+        "loadMore": "Carica altro"
+    },
+    "ui": {
+        "hideProgressImages": "Nascondi avanzamento immagini",
+        "showProgressImages": "Mostra avanzamento immagini",
+        "swapSizes": "Scambia dimensioni",
+        "lockRatio": "Blocca le proporzioni"
+    },
+    "nodes": {
+        "zoomOutNodes": "Rimpicciolire",
+        "hideGraphNodes": "Nascondi sovrapposizione grafico",
+        "hideLegendNodes": "Nascondi la legenda del tipo di campo",
+        "showLegendNodes": "Mostra legenda del tipo di campo",
+        "hideMinimapnodes": "Nascondi minimappa",
+        "showMinimapnodes": "Mostra minimappa",
+        "zoomInNodes": "Ingrandire",
+        "fitViewportNodes": "Adatta vista",
+        "showGraphNodes": "Mostra sovrapposizione grafico",
+        "resetWorkflowDesc2": "Reimpostare il flusso di lavoro cancellerà tutti i nodi, i bordi e i dettagli del flusso di lavoro.",
+        "reloadNodeTemplates": "Ricarica i modelli di nodo",
+        "loadWorkflow": "Importa flusso di lavoro JSON",
+        "resetWorkflow": "Reimposta flusso di lavoro",
+        "resetWorkflowDesc": "Sei sicuro di voler reimpostare questo flusso di lavoro?",
+        "downloadWorkflow": "Esporta flusso di lavoro JSON",
+        "scheduler": "Campionatore",
+        "addNode": "Aggiungi nodo",
+        "sDXLMainModelFieldDescription": "Campo del modello SDXL.",
+        "boardField": "Bacheca",
+        "animatedEdgesHelp": "Anima i bordi selezionati e i bordi collegati ai nodi selezionati",
+        "sDXLMainModelField": "Modello SDXL",
+        "executionStateInProgress": "In corso",
+        "executionStateError": "Errore",
+        "executionStateCompleted": "Completato",
+        "boardFieldDescription": "Una bacheca della galleria",
+        "addNodeToolTip": "Aggiungi nodo (Shift+A, Space)",
+        "sDXLRefinerModelField": "Modello Refiner",
+        "problemReadingMetadata": "Problema durante la lettura dei metadati dall'immagine",
+        "colorCodeEdgesHelp": "Bordi con codice colore in base ai campi collegati",
+        "animatedEdges": "Bordi animati",
+        "snapToGrid": "Aggancia alla griglia",
+        "validateConnections": "Convalida connessioni e grafico",
+        "validateConnectionsHelp": "Impedisce che vengano effettuate connessioni non valide e che vengano \"invocati\" grafici non validi",
+        "fullyContainNodesHelp": "I nodi devono essere completamente all'interno della casella di selezione per essere selezionati",
+        "fullyContainNodes": "Contenere completamente i nodi da selezionare",
+        "snapToGridHelp": "Aggancia i nodi alla griglia quando vengono spostati",
+        "workflowSettings": "Impostazioni Editor del flusso di lavoro",
+        "colorCodeEdges": "Bordi con codice colore",
+        "mainModelField": "Modello",
+        "noOutputRecorded": "Nessun output registrato",
+        "noFieldsLinearview": "Nessun campo aggiunto alla vista lineare",
+        "removeLinearView": "Rimuovi dalla vista lineare",
+        "workflowDescription": "Breve descrizione",
+        "workflowContact": "Contatto",
+        "workflowVersion": "Versione",
+        "workflow": "Flusso di lavoro",
+        "noWorkflow": "Nessun flusso di lavoro",
+        "workflowTags": "Tag",
+        "workflowValidation": "Errore di convalida del flusso di lavoro",
+        "workflowAuthor": "Autore",
+        "workflowName": "Nome",
+        "workflowNotes": "Note"
+    },
+    "boards": {
+        "autoAddBoard": "Aggiungi automaticamente bacheca",
+        "menuItemAutoAdd": "Aggiungi automaticamente a questa Bacheca",
+        "cancel": "Annulla",
+        "addBoard": "Aggiungi Bacheca",
+        "bottomMessage": "L'eliminazione di questa bacheca e delle sue immagini ripristinerà tutte le funzionalità che le stanno attualmente utilizzando.",
+        "changeBoard": "Cambia Bacheca",
+        "loading": "Caricamento in corso ...",
+        "clearSearch": "Cancella Ricerca",
+        "topMessage": "Questa bacheca contiene immagini utilizzate nelle seguenti funzionalità:",
+        "move": "Sposta",
+        "myBoard": "Bacheca",
+        "searchBoard": "Cerca bacheche ...",
+        "noMatching": "Nessuna bacheca corrispondente",
+        "selectBoard": "Seleziona una Bacheca",
+        "uncategorized": "Non categorizzato"
+    },
+    "controlnet": {
+        "contentShuffleDescription": "Rimescola il contenuto di un'immagine",
+        "contentShuffle": "Rimescola contenuto",
+        "beginEndStepPercent": "Percentuale passi Inizio / Fine",
+        "duplicate": "Duplica",
+        "balanced": "Bilanciato",
+        "depthMidasDescription": "Generazione di mappe di profondità usando Midas",
+        "control": "ControlNet",
+        "crop": "Ritaglia",
+        "depthMidas": "Profondità (Midas)",
+        "enableControlnet": "Abilita ControlNet",
+        "detectResolution": "Rileva risoluzione",
+        "controlMode": "Modalità Controllo",
+        "cannyDescription": "Canny rilevamento bordi",
+        "depthZoe": "Profondità (Zoe)",
+        "autoConfigure": "Configura automaticamente il processore",
+        "delete": "Elimina",
+        "depthZoeDescription": "Generazione di mappe di profondità usando Zoe",
+        "resize": "Ridimensiona",
+        "showAdvanced": "Mostra opzioni Avanzate",
+        "bgth": "Soglia rimozione sfondo",
+        "importImageFromCanvas": "Importa immagine dalla Tela",
+        "lineartDescription": "Converte l'immagine in lineart",
+        "importMaskFromCanvas": "Importa maschera dalla Tela",
+        "hideAdvanced": "Nascondi opzioni avanzate",
+        "ipAdapterModel": "Modello Adattatore",
+        "resetControlImage": "Reimposta immagine di controllo",
+        "f": "F",
+        "h": "H",
+        "prompt": "Prompt",
+        "openPoseDescription": "Stima della posa umana utilizzando Openpose",
+        "resizeMode": "Modalità ridimensionamento",
+        "weight": "Peso",
+        "selectModel": "Seleziona un modello",
+        "w": "W",
+        "processor": "Processore",
+        "none": "Nessuno",
+        "incompatibleBaseModel": "Modello base incompatibile:",
+        "pidiDescription": "Elaborazione immagini PIDI",
+        "fill": "Riempire",
+        "colorMapDescription": "Genera una mappa dei colori dall'immagine",
+        "lineartAnimeDescription": "Elaborazione lineart in stile anime",
+        "imageResolution": "Risoluzione dell'immagine",
+        "colorMap": "Colore",
+        "lowThreshold": "Soglia inferiore",
+        "highThreshold": "Soglia superiore",
+        "normalBaeDescription": "Elaborazione BAE normale",
+        "noneDescription": "Nessuna elaborazione applicata",
+        "saveControlImage": "Salva immagine di controllo",
+        "toggleControlNet": "Attiva/disattiva questo ControlNet",
+        "safe": "Sicuro",
+        "colorMapTileSize": "Dimensione piastrella",
+        "ipAdapterImageFallback": "Nessuna immagine dell'Adattatore IP selezionata",
+        "mediapipeFaceDescription": "Rilevamento dei volti tramite Mediapipe",
+        "hedDescription": "Rilevamento dei bordi nidificati olisticamente",
+        "setControlImageDimensions": "Imposta le dimensioni dell'immagine di controllo su L/A",
+        "resetIPAdapterImage": "Reimposta immagine Adattatore IP",
+        "handAndFace": "Mano e faccia",
+        "enableIPAdapter": "Abilita Adattatore IP",
+        "maxFaces": "Numero massimo di volti",
+        "addT2IAdapter": "Aggiungi $t(common.t2iAdapter)",
+        "controlNetEnabledT2IDisabled": "$t(common.controlNet) abilitato, $t(common.t2iAdapter) disabilitati",
+        "t2iEnabledControlNetDisabled": "$t(common.t2iAdapter) abilitato, $t(common.controlNet) disabilitati",
+        "addControlNet": "Aggiungi $t(common.controlNet)",
+        "controlNetT2IMutexDesc": "$t(common.controlNet) e $t(common.t2iAdapter) contemporaneamente non sono attualmente supportati.",
+        "addIPAdapter": "Aggiungi $t(common.ipAdapter)",
+        "controlAdapter": "Adattatore di Controllo",
+        "megaControl": "Mega ControlNet"
+    },
+    "queue": {
+        "queueFront": "Aggiungi all'inizio della coda",
+        "queueBack": "Aggiungi alla coda",
+        "queueCountPrediction": "Aggiungi {{predicted}} alla coda",
+        "queue": "Coda",
+        "status": "Stato",
+        "pruneSucceeded": "Rimossi {{item_count}} elementi completati dalla coda",
+        "cancelTooltip": "Annulla l'elemento corrente",
+        "queueEmpty": "Coda vuota",
+        "pauseSucceeded": "Elaborazione sospesa",
+        "in_progress": "In corso",
+        "notReady": "Impossibile mettere in coda",
+        "batchFailedToQueue": "Impossibile mettere in coda il lotto",
+        "completed": "Completati",
+        "batchValues": "Valori del lotto",
+        "cancelFailed": "Problema durante l'annullamento dell'elemento",
+        "batchQueued": "Lotto aggiunto alla coda",
+        "pauseFailed": "Problema durante la sospensione dell'elaborazione",
+        "clearFailed": "Problema nella cancellazione della coda",
+        "queuedCount": "{{pending}} In attesa",
+        "front": "inizio",
+        "clearSucceeded": "Coda cancellata",
+        "pause": "Sospendi",
+        "pruneTooltip": "Rimuovi {{item_count}} elementi completati",
+        "cancelSucceeded": "Elemento annullato",
+        "batchQueuedDesc": "Aggiunte {{item_count}} sessioni a {{direction}} della coda",
+        "graphQueued": "Grafico in coda",
+        "batch": "Lotto",
+        "clearQueueAlertDialog": "Lo svuotamento della coda annulla immediatamente tutti gli elementi in elaborazione e cancella completamente la coda.",
+        "pending": "In attesa",
+        "completedIn": "Completato in",
+        "resumeFailed": "Problema nel riavvio dell'elaborazione",
+        "clear": "Cancella",
+        "prune": "Rimuovi",
+        "total": "Totale",
+        "canceled": "Annullati",
+        "pruneFailed": "Problema nel rimuovere la coda",
+        "cancelBatchSucceeded": "Lotto annullato",
+        "clearTooltip": "Annulla e cancella tutti gli elementi",
+        "current": "Attuale",
+        "pauseTooltip": "Sospende l'elaborazione",
+        "failed": "Falliti",
+        "cancelItem": "Annulla l'elemento",
+        "next": "Prossimo",
+        "cancelBatch": "Annulla lotto",
+        "back": "fine",
+        "cancel": "Annulla",
+        "session": "Sessione",
+        "queueTotal": "{{total}} Totale",
+        "resumeSucceeded": "Elaborazione ripresa",
+        "enqueueing": "Lotto in coda",
+        "resumeTooltip": "Riprendi l'elaborazione",
+        "resume": "Riprendi",
+        "cancelBatchFailed": "Problema durante l'annullamento del lotto",
+        "clearQueueAlertDialog2": "Sei sicuro di voler cancellare la coda?",
+        "item": "Elemento",
+        "graphFailedToQueue": "Impossibile mettere in coda il grafico",
+        "queueMaxExceeded": "È stato superato il limite massimo di {{max_queue_size}} e {{skip}} elementi verrebbero saltati"
+    },
+    "embedding": {
+        "noMatchingEmbedding": "Nessun Incorporamento corrispondente",
+        "addEmbedding": "Aggiungi Incorporamento",
+        "incompatibleModel": "Modello base incompatibile:"
+    },
+    "models": {
+        "noMatchingModels": "Nessun modello corrispondente",
+        "loading": "caricamento",
+        "noMatchingLoRAs": "Nessun LoRA corrispondente",
+        "noLoRAsAvailable": "Nessun LoRA disponibile",
+        "noModelsAvailable": "Nessun modello disponibile",
+        "selectModel": "Seleziona un modello",
+        "selectLoRA": "Seleziona un LoRA"
+    },
+    "invocationCache": {
+        "disable": "Disabilita",
+        "misses": "Non trovati in cache",
+        "enableFailed": "Problema nell'abilitazione della cache delle invocazioni",
+        "invocationCache": "Cache delle invocazioni",
+        "clearSucceeded": "Cache delle invocazioni svuotata",
+        "enableSucceeded": "Cache delle invocazioni abilitata",
+        "clearFailed": "Problema durante lo svuotamento della cache delle invocazioni",
+        "hits": "Trovati in cache",
+        "disableSucceeded": "Cache delle invocazioni disabilitata",
+        "disableFailed": "Problema durante la disabilitazione della cache delle invocazioni",
+        "enable": "Abilita",
+        "clear": "Svuota",
+        "maxCacheSize": "Dimensione max cache",
+        "cacheSize": "Dimensione cache"
+    },
+    "dynamicPrompts": {
+        "seedBehaviour": {
+            "perPromptDesc": "Utilizza un seme diverso per ogni immagine",
+            "perIterationLabel": "Per iterazione",
+            "perIterationDesc": "Utilizza un seme diverso per ogni iterazione",
+            "perPromptLabel": "Per immagine",
+            "label": "Comportamento del seme"
+        },
+        "enableDynamicPrompts": "Abilita prompt dinamici",
+        "combinatorial": "Generazione combinatoria",
+        "maxPrompts": "Numero massimo di prompt",
+        "promptsWithCount_one": "{{count}} Prompt",
+        "promptsWithCount_many": "{{count}} Prompt",
+        "promptsWithCount_other": "",
+        "dynamicPrompts": "Prompt dinamici"
+    },
+    "popovers": {
+        "paramScheduler": {
+            "paragraphs": [
+                "Il campionatore definisce come aggiungere in modo iterativo il rumore a un'immagine o come aggiornare un campione in base all'output di un modello."
+            ],
+            "heading": "Campionatore"
+        },
+        "compositingMaskAdjustments": {
+            "heading": "Regolazioni della maschera",
+            "paragraphs": [
+                "Regola la maschera."
+            ]
+        },
+        "compositingCoherenceSteps": {
+            "heading": "Passi",
+            "paragraphs": [
+                "Numero di passi di riduzione del rumore utilizzati nel Passaggio di Coerenza.",
+                "Uguale al parametro principale Passi."
+            ]
+        },
+        "compositingBlur": {
+            "heading": "Sfocatura",
+            "paragraphs": [
+                "Il raggio di sfocatura della maschera."
+            ]
+        },
+        "compositingCoherenceMode": {
+            "heading": "Modalità",
+            "paragraphs": [
+                "La modalità del Passaggio di Coerenza."
+            ]
+        },
+        "clipSkip": {
+            "paragraphs": [
+                "Scegli quanti livelli del modello CLIP saltare.",
+                "Alcuni modelli funzionano meglio con determinate impostazioni di CLIP Skip.",
+                "Un valore più alto in genere produce un'immagine meno dettagliata."
+            ]
+        },
+        "compositingCoherencePass": {
+            "heading": "Passaggio di Coerenza",
+            "paragraphs": [
+                "Un secondo ciclo di riduzione del rumore aiuta a comporre l'immagine Inpaint/Outpaint."
+            ]
+        },
+        "compositingStrength": {
+            "heading": "Forza",
+            "paragraphs": [
+                "Intensità di riduzione del rumore per il passaggio di coerenza.",
+                "Uguale al parametro intensità di riduzione del rumore da immagine a immagine."
+            ]
+        },
+        "paramNegativeConditioning": {
+            "paragraphs": [
+                "Il processo di generazione evita i concetti nel prompt negativo. Utilizzatelo per escludere qualità o oggetti dall'output.",
+                "Supporta la sintassi e gli incorporamenti di Compel."
+            ],
+            "heading": "Prompt negativo"
+        },
+        "compositingBlurMethod": {
+            "heading": "Metodo di sfocatura",
+            "paragraphs": [
+                "Il metodo di sfocatura applicato all'area mascherata."
+            ]
+        },
+        "paramPositiveConditioning": {
+            "heading": "Prompt positivo",
+            "paragraphs": [
+                "Guida il processo di generazione. Puoi usare qualsiasi parola o frase.",
+                "Supporta sintassi e incorporamenti di Compel e Prompt Dinamici."
+            ]
+        },
+        "controlNetBeginEnd": {
+            "heading": "Percentuale passi Inizio / Fine",
+            "paragraphs": [
+                "A quali passi del processo di rimozione del rumore verrà applicato ControlNet.",
+                "I ControlNet applicati all'inizio del processo guidano la composizione, mentre i ControlNet applicati alla fine guidano i dettagli."
+            ]
+        },
+        "noiseUseCPU": {
+            "paragraphs": [
+                "Controlla se viene generato rumore sulla CPU o sulla GPU.",
+                "Con il rumore della CPU abilitato, un seme particolare produrrà la stessa immagine su qualsiasi macchina.",
+                "Non vi è alcun impatto sulle prestazioni nell'abilitare il rumore della CPU."
+            ],
+            "heading": "Usa la CPU per generare rumore"
+        },
+        "scaleBeforeProcessing": {
+            "paragraphs": [
+                "Ridimensiona l'area selezionata alla dimensione più adatta al modello prima del processo di generazione dell'immagine."
+            ],
+            "heading": "Scala prima dell'elaborazione"
+        },
+        "paramRatio": {
+            "heading": "Proporzioni",
+            "paragraphs": [
+                "Le proporzioni delle dimensioni dell'immagine generata.",
+                "Per i modelli SD1.5 si consiglia una dimensione dell'immagine (in numero di pixel) equivalente a 512x512 mentre per i modelli SDXL si consiglia una dimensione equivalente a 1024x1024."
+            ]
+        },
+        "dynamicPrompts": {
+            "paragraphs": [
+                "Prompt Dinamici crea molte variazioni a partire da un singolo prompt.",
+                "La sintassi di base è \"a {red|green|blue} ball\". Ciò produrrà tre prompt: \"a red ball\", \"a green ball\" e \"a blue ball\".",
+                "Puoi utilizzare la sintassi quante volte vuoi in un singolo prompt, ma assicurati di tenere sotto controllo il numero di prompt generati con l'impostazione \"Numero massimo di prompt\"."
+            ],
+            "heading": "Prompt Dinamici"
+        },
+        "paramVAE": {
+            "paragraphs": [
+                "Modello utilizzato per tradurre l'output dell'intelligenza artificiale nell'immagine finale."
+            ],
+            "heading": "VAE"
+        },
+        "paramIterations": {
+            "paragraphs": [
+                "Il numero di immagini da generare.",
+                "Se i prompt dinamici sono abilitati, ciascuno dei prompt verrà generato questo numero di volte."
+            ],
+            "heading": "Iterazioni"
+        },
+        "paramVAEPrecision": {
+            "heading": "Precisione VAE",
+            "paragraphs": [
+                "La precisione utilizzata durante la codifica e decodifica VAE. FP16/mezza precisione è più efficiente, a scapito di minori variazioni dell'immagine."
+            ]
+        },
+        "paramSeed": {
+            "paragraphs": [
+                "Controlla il rumore iniziale utilizzato per la generazione.",
+                "Disabilita seme \"Casuale\" per produrre risultati identici con le stesse impostazioni di generazione."
+            ],
+            "heading": "Seme"
+        },
+        "controlNetResizeMode": {
+            "heading": "Modalità ridimensionamento",
+            "paragraphs": [
+                "Come l'immagine ControlNet verrà adattata alle dimensioni di output dell'immagine."
+            ]
+        },
+        "dynamicPromptsSeedBehaviour": {
+            "paragraphs": [
+                "Controlla il modo in cui viene utilizzato il seme durante la generazione dei prompt.",
+                "Per iterazione utilizzerà un seme univoco per ogni iterazione. Usalo per esplorare variazioni del prompt su un singolo seme.",
+                "Ad esempio, se hai 5 prompt, ogni immagine utilizzerà lo stesso seme.",
+                "Per immagine utilizzerà un seme univoco per ogni immagine. Ciò fornisce più variazione."
+            ],
+            "heading": "Comportamento del seme"
+        },
+        "paramModel": {
+            "heading": "Modello",
+            "paragraphs": [
+                "Modello utilizzato per i passaggi di riduzione del rumore.",
+                "Diversi modelli sono generalmente addestrati per specializzarsi nella produzione di particolari risultati e contenuti estetici."
+            ]
+        },
+        "paramDenoisingStrength": {
+            "paragraphs": [
+                "Quanto rumore viene aggiunto all'immagine in ingresso.",
+                "0 risulterà in un'immagine identica, mentre 1 risulterà in un'immagine completamente nuova."
+            ],
+            "heading": "Forza di riduzione del rumore"
+        },
+        "dynamicPromptsMaxPrompts": {
+            "heading": "Numero massimo di prompt",
+            "paragraphs": [
+                "Limita il numero di prompt che possono essere generati da Prompt Dinamici."
+            ]
+        },
+        "infillMethod": {
+            "paragraphs": [
+                "Metodo per riempire l'area selezionata."
+            ],
+            "heading": "Metodo di riempimento"
+        },
+        "controlNetWeight": {
+            "heading": "Peso",
+            "paragraphs": [
+                "Quanto forte sarà l'impatto di ControlNet sull'immagine generata."
+            ]
+        },
+        "paramCFGScale": {
+            "heading": "Scala CFG",
+            "paragraphs": [
+                "Controlla quanto il tuo prompt influenza il processo di generazione."
+            ]
+        },
+        "controlNetControlMode": {
+            "paragraphs": [
+                "Attribuisce più peso al prompt o a ControlNet."
+            ],
+            "heading": "Modalità di controllo"
+        },
+        "paramSteps": {
+            "heading": "Passi",
+            "paragraphs": [
+                "Numero di passi che verranno eseguiti in ogni generazione.",
+                "Un numero di passi più elevato generalmente creerà immagini migliori ma richiederà più tempo di generazione."
+            ]
+        },
+        "lora": {
+            "heading": "Peso LoRA",
+            "paragraphs": [
+                "Un peso LoRA più elevato porterà a impatti maggiori sull'immagine finale."
+            ]
+        },
+        "controlNet": {
+            "paragraphs": [
+                "ControlNet fornisce una guida al processo di generazione, aiutando a creare immagini con composizione, struttura o stile controllati, a seconda del modello selezionato."
+            ]
+        }
+    },
+    "sdxl": {
+        "selectAModel": "Seleziona un modello",
+        "scheduler": "Campionatore",
+        "noModelsAvailable": "Nessun modello disponibile",
+        "denoisingStrength": "Forza di riduzione del rumore",
+        "concatPromptStyle": "Concatena Prompt & Stile",
+        "loading": "Caricamento...",
+        "steps": "Passi",
+        "refinerStart": "Inizio Affinamento",
+        "cfgScale": "Scala CFG",
+        "negStylePrompt": "Prompt Stile negativo",
+        "refiner": "Affinatore",
+        "negAestheticScore": "Punteggio estetico negativo",
+        "useRefiner": "Utilizza l'affinatore",
+        "refinermodel": "Modello Affinatore",
+        "posAestheticScore": "Punteggio estetico positivo",
+        "posStylePrompt": "Prompt Stile positivo"
+    },
+    "metadata": {
+        "initImage": "Immagine iniziale",
+        "seamless": "Senza giunture",
+        "positivePrompt": "Prompt positivo",
+        "negativePrompt": "Prompt negativo",
+        "generationMode": "Modalità generazione",
+        "Threshold": "Livello di soglia del rumore",
+        "metadata": "Metadati",
+        "strength": "Forza Immagine a Immagine",
+        "seed": "Seme",
+        "imageDetails": "Dettagli dell'immagine",
+        "perlin": "Rumore Perlin",
+        "model": "Modello",
+        "noImageDetails": "Nessun dettaglio dell'immagine trovato",
+        "hiresFix": "Ottimizzazione Alta Risoluzione",
+        "cfgScale": "Scala CFG",
+        "fit": "Adatta Immagine a Immagine",
+        "height": "Altezza",
+        "variations": "Coppie Peso-Seme",
+        "noMetaData": "Nessun metadato trovato",
+        "width": "Larghezza",
+        "createdBy": "Creato da",
+        "workflow": "Flusso di lavoro",
+        "steps": "Passi",
+        "scheduler": "Campionatore"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/ja.json b/invokeai/frontend/web/dist/locales/ja.json
index 007aa9b491..a53ea50b46 100644
--- a/invokeai/frontend/web/dist/locales/ja.json
+++ b/invokeai/frontend/web/dist/locales/ja.json
@@ -1,12 +1,8 @@
 {
     "common": {
-        "themeLabel": "テーマ",
         "languagePickerLabel": "言語選択",
         "reportBugLabel": "バグ報告",
         "settingsLabel": "設定",
-        "darkTheme": "ダーク",
-        "lightTheme": "ライト",
-        "greenTheme": "緑",
         "langJapanese": "日本語",
         "nodesDesc": "現在、画像生成のためのノードベースシステムを開発中です。機能についてのアップデートにご期待ください。",
         "postProcessing": "後処理",
@@ -56,14 +52,12 @@
         "loadingInvokeAI": "Invoke AIをロード中",
         "statusConvertingModel": "モデルの変換",
         "statusMergedModels": "マージ済モデル",
-        "pinOptionsPanel": "オプションパネルを固定",
         "githubLabel": "Github",
         "hotkeysLabel": "ホットキー",
         "langHebrew": "עברית",
         "discordLabel": "Discord",
         "langItalian": "Italiano",
         "langEnglish": "English",
-        "oceanTheme": "オーシャン",
         "langArabic": "アラビア語",
         "langDutch": "Nederlands",
         "langFrench": "Français",
@@ -83,7 +77,6 @@
         "gallerySettings": "ギャラリーの設定",
         "maintainAspectRatio": "アスペクト比を維持",
         "singleColumnLayout": "1カラムレイアウト",
-        "pinGallery": "ギャラリーにピン留め",
         "allImagesLoaded": "すべての画像を読み込む",
         "loadMore": "さらに読み込む",
         "noImagesInGallery": "ギャラリーに画像がありません",
@@ -355,7 +348,6 @@
         "useSeed": "シード値を使用",
         "useAll": "すべてを使用",
         "info": "情報",
-        "deleteImage": "画像を削除",
         "showOptionsPanel": "オプションパネルを表示"
     },
     "settings": {
@@ -364,7 +356,6 @@
         "saveSteps": "nステップごとに画像を保存",
         "confirmOnDelete": "削除時に確認",
         "displayHelpIcons": "ヘルプアイコンを表示",
-        "useCanvasBeta": "キャンバスレイアウト(Beta)を使用する",
         "enableImageDebugging": "画像のデバッグを有効化",
         "resetWebUI": "WebUIをリセット",
         "resetWebUIDesc1": "WebUIのリセットは、画像と保存された設定のキャッシュをリセットするだけです。画像を削除するわけではありません。",
@@ -373,7 +364,6 @@
     },
     "toast": {
         "uploadFailed": "アップロード失敗",
-        "uploadFailedMultipleImagesDesc": "一度にアップロードできる画像は1枚のみです。",
         "uploadFailedUnableToLoadDesc": "ファイルを読み込むことができません。",
         "downloadImageStarted": "画像ダウンロード開始",
         "imageCopied": "画像をコピー",
@@ -471,7 +461,6 @@
         "toggleAutoscroll": "自動スクロールの切替",
         "modifyConfig": "Modify Config",
         "toggleLogViewer": "Log Viewerの切替",
-        "showGallery": "ギャラリーを表示",
         "showOptionsPanel": "オプションパネルを表示"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/ko.json b/invokeai/frontend/web/dist/locales/ko.json
index 47cde5fec3..8baab54ac9 100644
--- a/invokeai/frontend/web/dist/locales/ko.json
+++ b/invokeai/frontend/web/dist/locales/ko.json
@@ -1,13 +1,9 @@
 {
     "common": {
-        "themeLabel": "테마 설정",
         "languagePickerLabel": "언어 설정",
         "reportBugLabel": "버그 리포트",
         "githubLabel": "Github",
         "settingsLabel": "설정",
-        "darkTheme": "다크 모드",
-        "lightTheme": "라이트 모드",
-        "greenTheme": "그린 모드",
         "langArabic": "العربية",
         "langEnglish": "English",
         "langDutch": "Nederlands",
diff --git a/invokeai/frontend/web/dist/locales/nl.json b/invokeai/frontend/web/dist/locales/nl.json
index 230e3b5b64..f682886dae 100644
--- a/invokeai/frontend/web/dist/locales/nl.json
+++ b/invokeai/frontend/web/dist/locales/nl.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Sneltoetsen",
-        "themeLabel": "Thema",
-        "languagePickerLabel": "Taalkeuze",
+        "languagePickerLabel": "Taal",
         "reportBugLabel": "Meld bug",
         "settingsLabel": "Instellingen",
-        "darkTheme": "Donker",
-        "lightTheme": "Licht",
-        "greenTheme": "Groen",
         "img2img": "Afbeelding naar afbeelding",
         "unifiedCanvas": "Centraal canvas",
-        "nodes": "Knooppunten",
+        "nodes": "Werkstroom-editor",
         "langDutch": "Nederlands",
         "nodesDesc": "Een op knooppunten gebaseerd systeem voor het genereren van afbeeldingen is momenteel in ontwikkeling. Blijf op de hoogte voor nieuws over deze verbluffende functie.",
         "postProcessing": "Naverwerking",
@@ -65,15 +61,25 @@
         "statusMergedModels": "Modellen samengevoegd",
         "cancel": "Annuleer",
         "accept": "Akkoord",
-        "langPortuguese": "Português",
-        "pinOptionsPanel": "Zet deelscherm Opties vast",
+        "langPortuguese": "Portugees",
         "loading": "Bezig met laden",
         "loadingInvokeAI": "Bezig met laden van Invoke AI",
-        "oceanTheme": "Oceaan",
         "langHebrew": "עברית",
         "langKorean": "한국어",
         "txt2img": "Tekst naar afbeelding",
-        "postprocessing": "Nabewerking"
+        "postprocessing": "Naverwerking",
+        "dontAskMeAgain": "Vraag niet opnieuw",
+        "imagePrompt": "Afbeeldingsprompt",
+        "random": "Willekeurig",
+        "generate": "Genereer",
+        "openInNewTab": "Open in nieuw tabblad",
+        "areYouSure": "Weet je het zeker?",
+        "linear": "Lineair",
+        "batch": "Seriebeheer",
+        "modelManager": "Modelbeheer",
+        "darkMode": "Donkere modus",
+        "lightMode": "Lichte modus",
+        "communityLabel": "Gemeenschap"
     },
     "gallery": {
         "generations": "Gegenereerde afbeeldingen",
@@ -86,10 +92,15 @@
         "maintainAspectRatio": "Behoud beeldverhoiding",
         "autoSwitchNewImages": "Wissel autom. naar nieuwe afbeeldingen",
         "singleColumnLayout": "Eenkolomsindeling",
-        "pinGallery": "Zet galerij vast",
         "allImagesLoaded": "Alle afbeeldingen geladen",
         "loadMore": "Laad meer",
-        "noImagesInGallery": "Geen afbeeldingen in galerij"
+        "noImagesInGallery": "Geen afbeeldingen om te tonen",
+        "deleteImage": "Wis afbeelding",
+        "deleteImageBin": "Gewiste afbeeldingen worden naar de prullenbak van je besturingssysteem gestuurd.",
+        "deleteImagePermanent": "Gewiste afbeeldingen kunnen niet worden hersteld.",
+        "assets": "Eigen onderdelen",
+        "images": "Afbeeldingen",
+        "autoAssignBoardOnClick": "Ken automatisch bord toe bij klikken"
     },
     "hotkeys": {
         "keyboardShortcuts": "Sneltoetsen",
@@ -296,7 +307,12 @@
         "acceptStagingImage": {
             "title": "Accepteer sessie-afbeelding",
             "desc": "Accepteert de huidige sessie-afbeelding"
-        }
+        },
+        "addNodes": {
+            "title": "Voeg knooppunten toe",
+            "desc": "Opent het menu Voeg knooppunt toe"
+        },
+        "nodesHotkeys": "Sneltoetsen knooppunten"
     },
     "modelManager": {
         "modelManager": "Modelonderhoud",
@@ -348,12 +364,12 @@
         "delete": "Verwijder",
         "deleteModel": "Verwijder model",
         "deleteConfig": "Verwijder configuratie",
-        "deleteMsg1": "Weet je zeker dat je deze modelregel wilt verwijderen uit InvokeAI?",
-        "deleteMsg2": "Hiermee wordt het checkpointbestand niet van je schijf verwijderd. Je kunt deze opnieuw toevoegen als je dat wilt.",
+        "deleteMsg1": "Weet je zeker dat je dit model wilt verwijderen uit InvokeAI?",
+        "deleteMsg2": "Hiermee ZAL het model van schijf worden verwijderd als het zich bevindt in de InvokeAI-beginmap. Als je het model vanaf een eigen locatie gebruikt, dan ZAL het model NIET van schijf worden verwijderd.",
         "formMessageDiffusersVAELocationDesc": "Indien niet opgegeven, dan zal InvokeAI kijken naar het VAE-bestand in de hierboven gegeven modellocatie.",
         "repoIDValidationMsg": "Online repository van je model",
         "formMessageDiffusersModelLocation": "Locatie Diffusers-model",
-        "convertToDiffusersHelpText3": "Je Checkpoint-bestand op schijf zal NIET worden verwijderd of gewijzigd. Je kunt je Checkpoint opnieuw toevoegen aan Modelonderhoud als je dat wilt.",
+        "convertToDiffusersHelpText3": "Je checkpoint-bestand op schijf ZAL worden verwijderd als het zich in de InvokeAI root map bevindt. Het zal NIET worden verwijderd als het zich in een andere locatie bevindt.",
         "convertToDiffusersHelpText6": "Wil je dit model omzetten?",
         "allModels": "Alle modellen",
         "checkpointModels": "Checkpoints",
@@ -371,7 +387,7 @@
         "convertToDiffusersHelpText1": "Dit model wordt omgezet naar de🧨 Diffusers-indeling.",
         "convertToDiffusersHelpText2": "Dit proces vervangt het onderdeel in Modelonderhoud met de Diffusers-versie van hetzelfde model.",
         "convertToDiffusersHelpText4": "Dit is een eenmalig proces. Dit neemt ongeveer 30 tot 60 sec. in beslag, afhankelijk van de specificaties van je computer.",
-        "convertToDiffusersHelpText5": "Zorg ervoor dat je genoeg schijfruimte hebt. Modellen nemen gewoonlijk ongeveer 4 - 7 GB ruimte in beslag.",
+        "convertToDiffusersHelpText5": "Zorg ervoor dat je genoeg schijfruimte hebt. Modellen nemen gewoonlijk ongeveer 2 tot 7 GB ruimte in beslag.",
         "convertToDiffusersSaveLocation": "Bewaarlocatie",
         "v1": "v1",
         "inpainting": "v1-inpainting",
@@ -408,7 +424,27 @@
         "none": "geen",
         "addDifference": "Voeg verschil toe",
         "scanForModels": "Scan naar modellen",
-        "pickModelType": "Kies modelsoort"
+        "pickModelType": "Kies modelsoort",
+        "baseModel": "Basismodel",
+        "vae": "VAE",
+        "variant": "Variant",
+        "modelConversionFailed": "Omzetten model mislukt",
+        "modelUpdateFailed": "Bijwerken model mislukt",
+        "modelsMergeFailed": "Samenvoegen model mislukt",
+        "selectModel": "Kies model",
+        "settings": "Instellingen",
+        "modelDeleted": "Model verwijderd",
+        "noCustomLocationProvided": "Geen Aangepaste Locatie Opgegeven",
+        "syncModels": "Synchroniseer Modellen",
+        "modelsSynced": "Modellen Gesynchroniseerd",
+        "modelSyncFailed": "Synchronisatie Modellen Gefaald",
+        "modelDeleteFailed": "Model kon niet verwijderd worden",
+        "convertingModelBegin": "Model aan het converteren. Even geduld.",
+        "importModels": "Importeer Modellen",
+        "syncModelsDesc": "Als je modellen niet meer synchroon zijn met de backend, kan je ze met deze optie verversen. Dit wordt typisch gebruikt in het geval je het models.yaml bestand met de hand bewerkt of als je modellen aan de InvokeAI root map toevoegt nadat de applicatie gestart werd.",
+        "loraModels": "LoRA's",
+        "onnxModels": "Onnx",
+        "oliveModels": "Olives"
     },
     "parameters": {
         "images": "Afbeeldingen",
@@ -416,10 +452,9 @@
         "cfgScale": "CFG-schaal",
         "width": "Breedte",
         "height": "Hoogte",
-        "sampler": "Sampler",
         "seed": "Seed",
         "randomizeSeed": "Willekeurige seed",
-        "shuffle": "Meng",
+        "shuffle": "Mengseed",
         "noiseThreshold": "Drempelwaarde ruis",
         "perlinNoise": "Perlinruis",
         "variations": "Variaties",
@@ -438,10 +473,6 @@
         "hiresOptim": "Hogeresolutie-optimalisatie",
         "imageFit": "Pas initiële afbeelding in uitvoergrootte",
         "codeformerFidelity": "Getrouwheid",
-        "seamSize": "Grootte naad",
-        "seamBlur": "Vervaging naad",
-        "seamStrength": "Sterkte naad",
-        "seamSteps": "Stappen naad",
         "scaleBeforeProcessing": "Schalen voor verwerking",
         "scaledWidth": "Geschaalde B",
         "scaledHeight": "Geschaalde H",
@@ -452,8 +483,6 @@
         "infillScalingHeader": "Infill en schaling",
         "img2imgStrength": "Sterkte Afbeelding naar afbeelding",
         "toggleLoopback": "Zet recursieve verwerking aan/uit",
-        "invoke": "Genereer",
-        "promptPlaceholder": "Voer invoertekst hier in. [negatieve trefwoorden], (verhoogdgewicht)++, (verlaagdgewicht)--, swap (wisselen) en blend (mengen) zijn beschikbaar (zie documentatie)",
         "sendTo": "Stuur naar",
         "sendToImg2Img": "Stuur naar Afbeelding naar afbeelding",
         "sendToUnifiedCanvas": "Stuur naar Centraal canvas",
@@ -466,7 +495,6 @@
         "useAll": "Hergebruik alles",
         "useInitImg": "Gebruik initiële afbeelding",
         "info": "Info",
-        "deleteImage": "Verwijder afbeelding",
         "initialImage": "Initiële afbeelding",
         "showOptionsPanel": "Toon deelscherm Opties",
         "symmetry": "Symmetrie",
@@ -478,37 +506,72 @@
             "setType": "Stel annuleervorm in",
             "schedule": "Annuleer na huidige iteratie"
         },
-        "negativePrompts": "Negatieve invoer",
         "general": "Algemeen",
         "copyImage": "Kopieer afbeelding",
         "imageToImage": "Afbeelding naar afbeelding",
         "denoisingStrength": "Sterkte ontruisen",
-        "hiresStrength": "Sterkte hogere resolutie"
+        "hiresStrength": "Sterkte hogere resolutie",
+        "scheduler": "Planner",
+        "noiseSettings": "Ruis",
+        "seamlessXAxis": "X-as",
+        "seamlessYAxis": "Y-as",
+        "hidePreview": "Verberg voorvertoning",
+        "showPreview": "Toon voorvertoning",
+        "boundingBoxWidth": "Tekenvak breedte",
+        "boundingBoxHeight": "Tekenvak hoogte",
+        "clipSkip": "Overslaan CLIP",
+        "aspectRatio": "Verhouding",
+        "negativePromptPlaceholder": "Negatieve prompt",
+        "controlNetControlMode": "Aansturingsmodus",
+        "positivePromptPlaceholder": "Positieve prompt",
+        "maskAdjustmentsHeader": "Maskeraanpassingen",
+        "compositingSettingsHeader": "Instellingen afbeeldingsopbouw",
+        "coherencePassHeader": "Coherentiestap",
+        "maskBlur": "Vervaag",
+        "maskBlurMethod": "Vervagingsmethode",
+        "coherenceSteps": "Stappen",
+        "coherenceStrength": "Sterkte",
+        "seamHighThreshold": "Hoog",
+        "seamLowThreshold": "Laag"
     },
     "settings": {
         "models": "Modellen",
-        "displayInProgress": "Toon afbeeldingen gedurende verwerking",
+        "displayInProgress": "Toon voortgangsafbeeldingen",
         "saveSteps": "Bewaar afbeeldingen elke n stappen",
         "confirmOnDelete": "Bevestig bij verwijderen",
         "displayHelpIcons": "Toon hulppictogrammen",
-        "useCanvasBeta": "Gebruik bètavormgeving van canvas",
         "enableImageDebugging": "Schakel foutopsporing afbeelding in",
         "resetWebUI": "Herstel web-UI",
         "resetWebUIDesc1": "Herstel web-UI herstelt alleen de lokale afbeeldingscache en de onthouden instellingen van je browser. Het verwijdert geen afbeeldingen van schijf.",
         "resetWebUIDesc2": "Als afbeeldingen niet getoond worden in de galerij of iets anders werkt niet, probeer dan eerst deze herstelfunctie voordat je een fout aanmeldt op GitHub.",
-        "resetComplete": "Webgebruikersinterface is hersteld. Vernieuw de pasgina om opnieuw te laden.",
-        "useSlidersForAll": "Gebruik schuifbalken voor alle opties"
+        "resetComplete": "Webgebruikersinterface is hersteld.",
+        "useSlidersForAll": "Gebruik schuifbalken voor alle opties",
+        "consoleLogLevel": "Logboekniveau",
+        "shouldLogToConsole": "Schrijf logboek naar console",
+        "developer": "Ontwikkelaar",
+        "general": "Algemeen",
+        "showProgressInViewer": "Toon voortgangsafbeeldingen in viewer",
+        "generation": "Generatie",
+        "ui": "Gebruikersinterface",
+        "antialiasProgressImages": "Voer anti-aliasing uit op voortgangsafbeeldingen",
+        "showAdvancedOptions": "Toon uitgebreide opties",
+        "favoriteSchedulers": "Favoriete planners",
+        "favoriteSchedulersPlaceholder": "Geen favoriete planners ingesteld",
+        "beta": "Bèta",
+        "experimental": "Experimenteel",
+        "alternateCanvasLayout": "Omwisselen Canvas Layout",
+        "enableNodesEditor": "Knopen Editor Inschakelen",
+        "autoChangeDimensions": "Werk bij wijziging afmetingen bij naar modelstandaard"
     },
     "toast": {
         "tempFoldersEmptied": "Tijdelijke map geleegd",
         "uploadFailed": "Upload mislukt",
-        "uploadFailedMultipleImagesDesc": "Meerdere afbeeldingen geplakt, slechts een afbeelding per keer toegestaan",
         "uploadFailedUnableToLoadDesc": "Kan bestand niet laden",
         "downloadImageStarted": "Afbeeldingsdownload gestart",
         "imageCopied": "Afbeelding gekopieerd",
         "imageLinkCopied": "Afbeeldingskoppeling gekopieerd",
         "imageNotLoaded": "Geen afbeelding geladen",
-        "imageNotLoadedDesc": "Geen afbeelding gevonden om te sturen naar de module Afbeelding naar afbeelding",
+        "imageNotLoadedDesc": "Geen afbeeldingen gevonden",
         "imageSavedToGallery": "Afbeelding opgeslagen naar galerij",
         "canvasMerged": "Canvas samengevoegd",
         "sentToImageToImage": "Gestuurd naar Afbeelding naar afbeelding",
@@ -529,7 +592,25 @@
         "metadataLoadFailed": "Fout bij laden metagegevens",
         "initialImageSet": "Initiële afbeelding ingesteld",
         "initialImageNotSet": "Initiële afbeelding niet ingesteld",
-        "initialImageNotSetDesc": "Kan initiële afbeelding niet laden"
+        "initialImageNotSetDesc": "Kan initiële afbeelding niet laden",
+        "serverError": "Serverfout",
+        "disconnected": "Verbinding met server verbroken",
+        "connected": "Verbonden met server",
+        "canceled": "Verwerking geannuleerd",
+        "uploadFailedInvalidUploadDesc": "Moet een enkele PNG- of JPEG-afbeelding zijn",
+        "problemCopyingImageLink": "Kan afbeeldingslink niet kopiëren",
+        "parameterNotSet": "Parameter niet ingesteld",
+        "parameterSet": "Instellen parameters",
+        "nodesSaved": "Knooppunten bewaard",
+        "nodesLoaded": "Knooppunten geladen",
+        "nodesCleared": "Knooppunten weggehaald",
+        "nodesLoadedFailed": "Laden knooppunten mislukt",
+        "problemCopyingImage": "Kan Afbeelding Niet Kopiëren",
+        "nodesNotValidJSON": "Ongeldige JSON",
+        "nodesCorruptedGraph": "Kan niet laden. Graph lijkt corrupt.",
+        "nodesUnrecognizedTypes": "Laden mislukt. Graph heeft onherkenbare types",
+        "nodesBrokenConnections": "Laden mislukt. Sommige verbindingen zijn verbroken.",
+        "nodesNotValidGraph": "Geen geldige knooppunten graph"
     },
     "tooltip": {
         "feature": {
@@ -603,7 +684,8 @@
         "betaClear": "Wis",
         "betaDarkenOutside": "Verduister buiten tekenvak",
         "betaLimitToBox": "Beperk tot tekenvak",
-        "betaPreserveMasked": "Behoud masker"
+        "betaPreserveMasked": "Behoud masker",
+        "antialiasing": "Anti-aliasing"
     },
     "accessibility": {
         "exitViewer": "Stop viewer",
@@ -624,7 +706,30 @@
         "modifyConfig": "Wijzig configuratie",
         "toggleAutoscroll": "Autom. scrollen aan/uit",
         "toggleLogViewer": "Logboekviewer aan/uit",
-        "showGallery": "Toon galerij",
-        "showOptionsPanel": "Toon deelscherm Opties"
+        "showOptionsPanel": "Toon zijscherm",
+        "menu": "Menu"
+    },
+    "ui": {
+        "showProgressImages": "Toon voortgangsafbeeldingen",
+        "hideProgressImages": "Verberg voortgangsafbeeldingen",
+        "swapSizes": "Wissel afmetingen om",
+        "lockRatio": "Zet verhouding vast"
+    },
+    "nodes": {
+        "zoomOutNodes": "Uitzoomen",
+        "fitViewportNodes": "Aanpassen aan beeld",
+        "hideMinimapnodes": "Minimap verbergen",
+        "showLegendNodes": "Typelegende veld tonen",
+        "zoomInNodes": "Inzoomen",
+        "hideGraphNodes": "Graph overlay verbergen",
+        "showGraphNodes": "Graph overlay tonen",
+        "showMinimapnodes": "Minimap tonen",
+        "hideLegendNodes": "Typelegende veld verbergen",
+        "reloadNodeTemplates": "Herlaad knooppuntsjablonen",
+        "loadWorkflow": "Laad werkstroom",
+        "resetWorkflow": "Herstel werkstroom",
+        "resetWorkflowDesc": "Weet je zeker dat je deze werkstroom wilt herstellen?",
+        "resetWorkflowDesc2": "Herstel van een werkstroom haalt alle knooppunten, randen en werkstroomdetails weg.",
+        "downloadWorkflow": "Download JSON van werkstroom"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/pl.json b/invokeai/frontend/web/dist/locales/pl.json
index 246271658a..f77c0c4710 100644
--- a/invokeai/frontend/web/dist/locales/pl.json
+++ b/invokeai/frontend/web/dist/locales/pl.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Skróty klawiszowe",
-        "themeLabel": "Motyw",
         "languagePickerLabel": "Wybór języka",
         "reportBugLabel": "Zgłoś błąd",
         "settingsLabel": "Ustawienia",
-        "darkTheme": "Ciemny",
-        "lightTheme": "Jasny",
-        "greenTheme": "Zielony",
         "img2img": "Obraz na obraz",
         "unifiedCanvas": "Tryb uniwersalny",
         "nodes": "Węzły",
@@ -43,7 +39,11 @@
         "statusUpscaling": "Powiększanie obrazu",
         "statusUpscalingESRGAN": "Powiększanie (ESRGAN)",
         "statusLoadingModel": "Wczytywanie modelu",
-        "statusModelChanged": "Zmieniono model"
+        "statusModelChanged": "Zmieniono model",
+        "githubLabel": "GitHub",
+        "discordLabel": "Discord",
+        "darkMode": "Tryb ciemny",
+        "lightMode": "Tryb jasny"
     },
     "gallery": {
         "generations": "Wygenerowane",
@@ -56,7 +56,6 @@
         "maintainAspectRatio": "Zachowaj proporcje",
         "autoSwitchNewImages": "Przełączaj na nowe obrazy",
         "singleColumnLayout": "Układ jednokolumnowy",
-        "pinGallery": "Przypnij galerię",
         "allImagesLoaded": "Koniec listy",
         "loadMore": "Wczytaj więcej",
         "noImagesInGallery": "Brak obrazów w galerii"
@@ -274,7 +273,6 @@
         "cfgScale": "Skala CFG",
         "width": "Szerokość",
         "height": "Wysokość",
-        "sampler": "Próbkowanie",
         "seed": "Inicjator",
         "randomizeSeed": "Losowy inicjator",
         "shuffle": "Losuj",
@@ -296,10 +294,6 @@
         "hiresOptim": "Optymalizacja wys. rozdzielczości",
         "imageFit": "Przeskaluj oryginalny obraz",
         "codeformerFidelity": "Dokładność",
-        "seamSize": "Rozmiar",
-        "seamBlur": "Rozmycie",
-        "seamStrength": "Siła",
-        "seamSteps": "Kroki",
         "scaleBeforeProcessing": "Tryb skalowania",
         "scaledWidth": "Sk. do szer.",
         "scaledHeight": "Sk. do wys.",
@@ -310,8 +304,6 @@
         "infillScalingHeader": "Wypełnienie i skalowanie",
         "img2imgStrength": "Wpływ sugestii na obraz",
         "toggleLoopback": "Wł/wył sprzężenie zwrotne",
-        "invoke": "Wywołaj",
-        "promptPlaceholder": "W tym miejscu wprowadź swoje sugestie. [negatywne sugestie], (wzmocnienie), (osłabienie)--, po więcej opcji (np. swap lub blend) zajrzyj do dokumentacji",
         "sendTo": "Wyślij do",
         "sendToImg2Img": "Użyj w trybie \"Obraz na obraz\"",
         "sendToUnifiedCanvas": "Użyj w trybie uniwersalnym",
@@ -324,7 +316,6 @@
         "useAll": "Skopiuj wszystko",
         "useInitImg": "Użyj oryginalnego obrazu",
         "info": "Informacje",
-        "deleteImage": "Usuń obraz",
         "initialImage": "Oryginalny obraz",
         "showOptionsPanel": "Pokaż panel ustawień"
     },
@@ -334,7 +325,6 @@
         "saveSteps": "Zapisuj obrazy co X kroków",
         "confirmOnDelete": "Potwierdzaj usuwanie",
         "displayHelpIcons": "Wyświetlaj ikony pomocy",
-        "useCanvasBeta": "Nowy układ trybu uniwersalnego",
         "enableImageDebugging": "Włącz debugowanie obrazu",
         "resetWebUI": "Zresetuj interfejs",
         "resetWebUIDesc1": "Resetowanie interfejsu wyczyści jedynie dane i ustawienia zapisane w pamięci przeglądarki. Nie usunie żadnych obrazów z dysku.",
@@ -344,7 +334,6 @@
     "toast": {
         "tempFoldersEmptied": "Wyczyszczono folder tymczasowy",
         "uploadFailed": "Błąd przesyłania obrazu",
-        "uploadFailedMultipleImagesDesc": "Możliwe jest przesłanie tylko jednego obrazu na raz",
         "uploadFailedUnableToLoadDesc": "Błąd wczytywania obrazu",
         "downloadImageStarted": "Rozpoczęto pobieranie",
         "imageCopied": "Skopiowano obraz",
@@ -446,5 +435,27 @@
         "betaDarkenOutside": "Przyciemnienie",
         "betaLimitToBox": "Ogranicz do zaznaczenia",
         "betaPreserveMasked": "Zachowaj obszar"
+    },
+    "accessibility": {
+        "zoomIn": "Przybliż",
+        "exitViewer": "Wyjdź z podglądu",
+        "modelSelect": "Wybór modelu",
+        "invokeProgressBar": "Pasek postępu",
+        "reset": "Zerowanie",
+        "useThisParameter": "Użyj tego parametru",
+        "copyMetadataJson": "Kopiuj metadane JSON",
+        "uploadImage": "Wgrywanie obrazu",
+        "previousImage": "Poprzedni obraz",
+        "nextImage": "Następny obraz",
+        "zoomOut": "Oddal",
+        "rotateClockwise": "Obróć zgodnie ze wskazówkami zegara",
+        "rotateCounterClockwise": "Obróć przeciwnie do wskazówek zegara",
+        "flipHorizontally": "Odwróć horyzontalnie",
+        "flipVertically": "Odwróć wertykalnie",
+        "modifyConfig": "Modyfikuj ustawienia",
+        "toggleAutoscroll": "Przełącz autoprzewijanie",
+        "toggleLogViewer": "Przełącz podgląd logów",
+        "showOptionsPanel": "Pokaż panel opcji",
+        "menu": "Menu"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/pt.json b/invokeai/frontend/web/dist/locales/pt.json
index 6d19e3ad92..ac9dd50b4d 100644
--- a/invokeai/frontend/web/dist/locales/pt.json
+++ b/invokeai/frontend/web/dist/locales/pt.json
@@ -1,11 +1,8 @@
 {
     "common": {
-        "greenTheme": "Verde",
         "langArabic": "العربية",
-        "themeLabel": "Tema",
         "reportBugLabel": "Reportar Bug",
         "settingsLabel": "Configurações",
-        "lightTheme": "Claro",
         "langBrPortuguese": "Português do Brasil",
         "languagePickerLabel": "Seletor de Idioma",
         "langDutch": "Nederlands",
@@ -57,14 +54,11 @@
         "statusModelChanged": "Modelo Alterado",
         "githubLabel": "Github",
         "discordLabel": "Discord",
-        "darkTheme": "Escuro",
         "training": "Treinando",
         "statusGeneratingOutpainting": "Geração de Ampliação",
         "statusGenerationComplete": "Geração Completa",
         "statusMergingModels": "Mesclando Modelos",
         "statusMergedModels": "Modelos Mesclados",
-        "oceanTheme": "Oceano",
-        "pinOptionsPanel": "Fixar painel de opções",
         "loading": "A carregar",
         "loadingInvokeAI": "A carregar Invoke AI",
         "langPortuguese": "Português"
@@ -74,7 +68,6 @@
         "gallerySettings": "Configurações de Galeria",
         "maintainAspectRatio": "Mater Proporções",
         "autoSwitchNewImages": "Trocar para Novas Imagens Automaticamente",
-        "pinGallery": "Fixar Galeria",
         "singleColumnLayout": "Disposição em Coluna Única",
         "allImagesLoaded": "Todas as Imagens Carregadas",
         "loadMore": "Carregar Mais",
@@ -407,7 +400,6 @@
         "width": "Largura",
         "seed": "Seed",
         "hiresStrength": "Força da Alta Resolução",
-        "negativePrompts": "Indicações negativas",
         "general": "Geral",
         "randomizeSeed": "Seed Aleatório",
         "shuffle": "Embaralhar",
@@ -425,10 +417,6 @@
         "hiresOptim": "Otimização de Alta Res",
         "imageFit": "Caber Imagem Inicial No Tamanho de Saída",
         "codeformerFidelity": "Fidelidade",
-        "seamSize": "Tamanho da Fronteira",
-        "seamBlur": "Desfoque da Fronteira",
-        "seamStrength": "Força da Fronteira",
-        "seamSteps": "Passos da Fronteira",
         "tileSize": "Tamanho do Ladrilho",
         "boundingBoxHeader": "Caixa Delimitadora",
         "seamCorrectionHeader": "Correção de Fronteira",
@@ -436,12 +424,10 @@
         "img2imgStrength": "Força de Imagem Para Imagem",
         "toggleLoopback": "Ativar Loopback",
         "symmetry": "Simetria",
-        "promptPlaceholder": "Digite o prompt aqui. [tokens negativos], (upweight)++, (downweight)--, trocar e misturar estão disponíveis (veja docs)",
         "sendTo": "Mandar para",
         "openInViewer": "Abrir No Visualizador",
         "closeViewer": "Fechar Visualizador",
         "usePrompt": "Usar Prompt",
-        "deleteImage": "Apagar Imagem",
         "initialImage": "Imagem inicial",
         "showOptionsPanel": "Mostrar Painel de Opções",
         "strength": "Força",
@@ -449,12 +435,10 @@
         "upscale": "Redimensionar",
         "upscaleImage": "Redimensionar Imagem",
         "scaleBeforeProcessing": "Escala Antes do Processamento",
-        "invoke": "Invocar",
         "images": "Imagems",
         "steps": "Passos",
         "cfgScale": "Escala CFG",
         "height": "Altura",
-        "sampler": "Amostrador",
         "imageToImage": "Imagem para Imagem",
         "variationAmount": "Quntidade de Variatções",
         "scaledWidth": "L Escalada",
@@ -481,7 +465,6 @@
     "settings": {
         "confirmOnDelete": "Confirmar Antes de Apagar",
         "displayHelpIcons": "Mostrar Ícones de Ajuda",
-        "useCanvasBeta": "Usar Layout de Telas Beta",
         "enableImageDebugging": "Ativar Depuração de Imagem",
         "useSlidersForAll": "Usar deslizadores para todas as opções",
         "resetWebUIDesc1": "Reiniciar a interface apenas reinicia o cache local do broswer para imagens e configurações lembradas. Não apaga nenhuma imagem do disco.",
@@ -494,7 +477,6 @@
     },
     "toast": {
         "uploadFailed": "Envio Falhou",
-        "uploadFailedMultipleImagesDesc": "Várias imagens copiadas, só é permitido uma imagem de cada vez",
         "uploadFailedUnableToLoadDesc": "Não foj possível carregar o ficheiro",
         "downloadImageStarted": "Download de Imagem Começou",
         "imageNotLoadedDesc": "Nenhuma imagem encontrada a enviar para o módulo de imagem para imagem",
@@ -611,7 +593,6 @@
         "flipVertically": "Espelhar verticalmente",
         "modifyConfig": "Modificar config",
         "toggleAutoscroll": "Alternar rolagem automática",
-        "showGallery": "Mostrar galeria",
         "showOptionsPanel": "Mostrar painel de opções",
         "uploadImage": "Enviar imagem",
         "previousImage": "Imagem anterior",
diff --git a/invokeai/frontend/web/dist/locales/pt_BR.json b/invokeai/frontend/web/dist/locales/pt_BR.json
index e77ef14719..3b45dbbbf3 100644
--- a/invokeai/frontend/web/dist/locales/pt_BR.json
+++ b/invokeai/frontend/web/dist/locales/pt_BR.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Teclas de atalho",
-        "themeLabel": "Tema",
         "languagePickerLabel": "Seletor de Idioma",
         "reportBugLabel": "Relatar Bug",
         "settingsLabel": "Configurações",
-        "darkTheme": "Noite",
-        "lightTheme": "Dia",
-        "greenTheme": "Verde",
         "img2img": "Imagem Para Imagem",
         "unifiedCanvas": "Tela Unificada",
         "nodes": "Nódulos",
@@ -63,7 +59,6 @@
         "statusMergedModels": "Modelos Mesclados",
         "langRussian": "Russo",
         "langSpanish": "Espanhol",
-        "pinOptionsPanel": "Fixar painel de opções",
         "loadingInvokeAI": "Carregando Invoke AI",
         "loading": "Carregando"
     },
@@ -78,7 +73,6 @@
         "maintainAspectRatio": "Mater Proporções",
         "autoSwitchNewImages": "Trocar para Novas Imagens Automaticamente",
         "singleColumnLayout": "Disposição em Coluna Única",
-        "pinGallery": "Fixar Galeria",
         "allImagesLoaded": "Todas as Imagens Carregadas",
         "loadMore": "Carregar Mais",
         "noImagesInGallery": "Sem Imagens na Galeria"
@@ -402,7 +396,6 @@
         "cfgScale": "Escala CFG",
         "width": "Largura",
         "height": "Altura",
-        "sampler": "Amostrador",
         "seed": "Seed",
         "randomizeSeed": "Seed Aleatório",
         "shuffle": "Embaralhar",
@@ -424,10 +417,6 @@
         "hiresOptim": "Otimização de Alta Res",
         "imageFit": "Caber Imagem Inicial No Tamanho de Saída",
         "codeformerFidelity": "Fidelidade",
-        "seamSize": "Tamanho da Fronteira",
-        "seamBlur": "Desfoque da Fronteira",
-        "seamStrength": "Força da Fronteira",
-        "seamSteps": "Passos da Fronteira",
         "scaleBeforeProcessing": "Escala Antes do Processamento",
         "scaledWidth": "L Escalada",
         "scaledHeight": "A Escalada",
@@ -438,8 +427,6 @@
         "infillScalingHeader": "Preencimento e Escala",
         "img2imgStrength": "Força de Imagem Para Imagem",
         "toggleLoopback": "Ativar Loopback",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Digite o prompt aqui. [tokens negativos], (upweight)++, (downweight)--, trocar e misturar estão disponíveis (veja docs)",
         "sendTo": "Mandar para",
         "sendToImg2Img": "Mandar para Imagem Para Imagem",
         "sendToUnifiedCanvas": "Mandar para Tela Unificada",
@@ -452,14 +439,12 @@
         "useAll": "Usar Todos",
         "useInitImg": "Usar Imagem Inicial",
         "info": "Informações",
-        "deleteImage": "Apagar Imagem",
         "initialImage": "Imagem inicial",
         "showOptionsPanel": "Mostrar Painel de Opções",
         "vSymmetryStep": "V Passo de Simetria",
         "hSymmetryStep": "H Passo de Simetria",
         "symmetry": "Simetria",
         "copyImage": "Copiar imagem",
-        "negativePrompts": "Indicações negativas",
         "hiresStrength": "Força da Alta Resolução",
         "denoisingStrength": "A força de remoção de ruído",
         "imageToImage": "Imagem para Imagem",
@@ -477,7 +462,6 @@
         "saveSteps": "Salvar imagens a cada n passos",
         "confirmOnDelete": "Confirmar Antes de Apagar",
         "displayHelpIcons": "Mostrar Ícones de Ajuda",
-        "useCanvasBeta": "Usar Layout de Telas Beta",
         "enableImageDebugging": "Ativar Depuração de Imagem",
         "resetWebUI": "Reiniciar Interface",
         "resetWebUIDesc1": "Reiniciar a interface apenas reinicia o cache local do broswer para imagens e configurações lembradas. Não apaga nenhuma imagem do disco.",
@@ -488,7 +472,6 @@
     "toast": {
         "tempFoldersEmptied": "Pasta de Arquivos Temporários Esvaziada",
         "uploadFailed": "Envio Falhou",
-        "uploadFailedMultipleImagesDesc": "Várias imagens copiadas, só é permitido uma imagem de cada vez",
         "uploadFailedUnableToLoadDesc": "Não foj possível carregar o arquivo",
         "downloadImageStarted": "Download de Imagem Começou",
         "imageCopied": "Imagem Copiada",
diff --git a/invokeai/frontend/web/dist/locales/ru.json b/invokeai/frontend/web/dist/locales/ru.json
index 822389d78a..808db9e803 100644
--- a/invokeai/frontend/web/dist/locales/ru.json
+++ b/invokeai/frontend/web/dist/locales/ru.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Горячие клавиши",
-        "themeLabel": "Тема",
         "languagePickerLabel": "Язык",
         "reportBugLabel": "Сообщить об ошибке",
         "settingsLabel": "Настройки",
-        "darkTheme": "Темная",
-        "lightTheme": "Светлая",
-        "greenTheme": "Зеленая",
         "img2img": "Изображение в изображение (img2img)",
         "unifiedCanvas": "Единый холст",
-        "nodes": "Ноды",
+        "nodes": "Редактор рабочего процесса",
         "langRussian": "Русский",
         "nodesDesc": "Cистема генерации изображений на основе нодов (узлов) уже разрабатывается. Следите за новостями об этой замечательной функции.",
         "postProcessing": "Постобработка",
@@ -49,14 +45,12 @@
         "statusMergingModels": "Слияние моделей",
         "statusModelConverted": "Модель сконвертирована",
         "statusMergedModels": "Модели объединены",
-        "pinOptionsPanel": "Закрепить панель настроек",
         "loading": "Загрузка",
         "loadingInvokeAI": "Загрузка Invoke AI",
         "back": "Назад",
         "statusConvertingModel": "Конвертация модели",
         "cancel": "Отменить",
         "accept": "Принять",
-        "oceanTheme": "Океан",
         "langUkranian": "Украинский",
         "langEnglish": "Английский",
         "postprocessing": "Постобработка",
@@ -74,7 +68,21 @@
         "langPortuguese": "Португальский",
         "txt2img": "Текст в изображение (txt2img)",
         "langBrPortuguese": "Португальский (Бразилия)",
-        "linear": "Линейная обработка"
+        "linear": "Линейная обработка",
+        "dontAskMeAgain": "Больше не спрашивать",
+        "areYouSure": "Вы уверены?",
+        "random": "Случайное",
+        "generate": "Сгенерировать",
+        "openInNewTab": "Открыть в новой вкладке",
+        "imagePrompt": "Запрос",
+        "communityLabel": "Сообщество",
+        "lightMode": "Светлая тема",
+        "batch": "Пакетный менеджер",
+        "modelManager": "Менеджер моделей",
+        "darkMode": "Темная тема",
+        "nodeEditor": "Редактор Нодов (Узлов)",
+        "controlNet": "Controlnet",
+        "advanced": "Расширенные"
     },
     "gallery": {
         "generations": "Генерации",
@@ -87,10 +95,15 @@
         "maintainAspectRatio": "Сохранять пропорции",
         "autoSwitchNewImages": "Автоматически выбирать новые",
         "singleColumnLayout": "Одна колонка",
-        "pinGallery": "Закрепить галерею",
         "allImagesLoaded": "Все изображения загружены",
         "loadMore": "Показать больше",
-        "noImagesInGallery": "Изображений нет"
+        "noImagesInGallery": "Изображений нет",
+        "deleteImagePermanent": "Удаленные изображения невозможно восстановить.",
+        "deleteImageBin": "Удаленные изображения будут отправлены в корзину вашей операционной системы.",
+        "deleteImage": "Удалить изображение",
+        "images": "Изображения",
+        "assets": "Ресурсы",
+        "autoAssignBoardOnClick": "Авто-назначение доски по клику"
     },
     "hotkeys": {
         "keyboardShortcuts": "Горячие клавиши",
@@ -297,7 +310,12 @@
         "acceptStagingImage": {
             "title": "Принять изображение",
             "desc": "Принять текущее изображение"
-        }
+        },
+        "addNodes": {
+            "desc": "Открывает меню добавления узла",
+            "title": "Добавление узлов"
+        },
+        "nodesHotkeys": "Горячие клавиши узлов"
     },
     "modelManager": {
         "modelManager": "Менеджер моделей",
@@ -350,14 +368,14 @@
         "deleteModel": "Удалить модель",
         "deleteConfig": "Удалить конфигурацию",
         "deleteMsg1": "Вы точно хотите удалить модель из InvokeAI?",
-        "deleteMsg2": "Это не удалит файл модели с диска. Позже вы можете добавить его снова.",
+        "deleteMsg2": "Это приведет К УДАЛЕНИЮ модели С ДИСКА, если она находится в корневой папке Invoke. Если вы используете пользовательское расположение, то модель НЕ будет удалена с диска.",
         "repoIDValidationMsg": "Онлайн-репозиторий модели",
-        "convertToDiffusersHelpText5": "Пожалуйста, убедитесь, что у вас достаточно места на диске. Модели обычно занимают 4 – 7 Гб.",
+        "convertToDiffusersHelpText5": "Пожалуйста, убедитесь, что у вас достаточно места на диске. Модели обычно занимают 2–7 Гб.",
         "invokeAIFolder": "Каталог InvokeAI",
         "ignoreMismatch": "Игнорировать несоответствия между выбранными моделями",
         "addCheckpointModel": "Добавить модель Checkpoint/Safetensor",
         "formMessageDiffusersModelLocationDesc": "Укажите хотя бы одно.",
-        "convertToDiffusersHelpText3": "Файл модели на диске НЕ будет удалён или изменён. Вы сможете заново добавить его в Model Manager при необходимости.",
+        "convertToDiffusersHelpText3": "Ваш файл контрольной точки НА ДИСКЕ будет УДАЛЕН, если он находится в корневой папке InvokeAI. Если он находится в пользовательском расположении, то он НЕ будет удален.",
         "vaeRepoID": "ID репозитория VAE",
         "mergedModelName": "Название объединенной модели",
         "checkpointModels": "Checkpoints",
@@ -409,7 +427,27 @@
         "weightedSum": "Взвешенная сумма",
         "safetensorModels": "SafeTensors",
         "v2_768": "v2 (768px)",
-        "v2_base": "v2 (512px)"
+        "v2_base": "v2 (512px)",
+        "modelDeleted": "Модель удалена",
+        "importModels": "Импорт Моделей",
+        "variant": "Вариант",
+        "baseModel": "Базовая модель",
+        "modelsSynced": "Модели синхронизированы",
+        "modelSyncFailed": "Не удалось синхронизировать модели",
+        "vae": "VAE",
+        "modelDeleteFailed": "Не удалось удалить модель",
+        "noCustomLocationProvided": "Пользовательское местоположение не указано",
+        "convertingModelBegin": "Конвертация модели. Пожалуйста, подождите.",
+        "settings": "Настройки",
+        "selectModel": "Выберите модель",
+        "syncModels": "Синхронизация моделей",
+        "syncModelsDesc": "Если ваши модели не синхронизированы с серверной частью, вы можете обновить их, используя эту опцию. Обычно это удобно в тех случаях, когда вы вручную обновляете свой файл \"models.yaml\" или добавляете модели в корневую папку InvokeAI после загрузки приложения.",
+        "modelUpdateFailed": "Не удалось обновить модель",
+        "modelConversionFailed": "Не удалось сконвертировать модель",
+        "modelsMergeFailed": "Не удалось выполнить слияние моделей",
+        "loraModels": "LoRAs",
+        "onnxModels": "Onnx",
+        "oliveModels": "Olives"
     },
     "parameters": {
         "images": "Изображения",
@@ -417,10 +455,9 @@
         "cfgScale": "Уровень CFG",
         "width": "Ширина",
         "height": "Высота",
-        "sampler": "Семплер",
         "seed": "Сид",
         "randomizeSeed": "Случайный сид",
-        "shuffle": "Обновить",
+        "shuffle": "Обновить сид",
         "noiseThreshold": "Порог шума",
         "perlinNoise": "Шум Перлина",
         "variations": "Вариации",
@@ -439,10 +476,6 @@
         "hiresOptim": "Оптимизация High Res",
         "imageFit": "Уместить изображение",
         "codeformerFidelity": "Точность",
-        "seamSize": "Размер шва",
-        "seamBlur": "Размытие шва",
-        "seamStrength": "Сила шва",
-        "seamSteps": "Шаги шва",
         "scaleBeforeProcessing": "Масштабировать",
         "scaledWidth": "Масштаб Ш",
         "scaledHeight": "Масштаб В",
@@ -453,8 +486,6 @@
         "infillScalingHeader": "Заполнение и масштабирование",
         "img2imgStrength": "Сила обработки img2img",
         "toggleLoopback": "Зациклить обработку",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Введите запрос здесь (на английском). [исключенные токены], (более значимые)++, (менее значимые)--, swap и blend тоже доступны (смотрите Github)",
         "sendTo": "Отправить",
         "sendToImg2Img": "Отправить в img2img",
         "sendToUnifiedCanvas": "Отправить на Единый холст",
@@ -467,7 +498,6 @@
         "useAll": "Использовать все",
         "useInitImg": "Использовать как исходное",
         "info": "Метаданные",
-        "deleteImage": "Удалить изображение",
         "initialImage": "Исходное изображение",
         "showOptionsPanel": "Показать панель настроек",
         "vSymmetryStep": "Шаг верт. симметрии",
@@ -485,8 +515,27 @@
         "imageToImage": "Изображение в изображение",
         "denoisingStrength": "Сила шумоподавления",
         "copyImage": "Скопировать изображение",
-        "negativePrompts": "Исключающий запрос",
-        "showPreview": "Показать предпросмотр"
+        "showPreview": "Показать предпросмотр",
+        "noiseSettings": "Шум",
+        "seamlessXAxis": "Ось X",
+        "seamlessYAxis": "Ось Y",
+        "scheduler": "Планировщик",
+        "boundingBoxWidth": "Ширина ограничивающей рамки",
+        "boundingBoxHeight": "Высота ограничивающей рамки",
+        "positivePromptPlaceholder": "Запрос",
+        "negativePromptPlaceholder": "Исключающий запрос",
+        "controlNetControlMode": "Режим управления",
+        "clipSkip": "CLIP Пропуск",
+        "aspectRatio": "Соотношение",
+        "maskAdjustmentsHeader": "Настройка маски",
+        "maskBlur": "Размытие",
+        "maskBlurMethod": "Метод размытия",
+        "seamLowThreshold": "Низкий",
+        "seamHighThreshold": "Высокий",
+        "coherenceSteps": "Шагов",
+        "coherencePassHeader": "Порог Coherence",
+        "coherenceStrength": "Сила",
+        "compositingSettingsHeader": "Настройки компоновки"
     },
     "settings": {
         "models": "Модели",
@@ -494,24 +543,38 @@
         "saveSteps": "Сохранять каждые n щагов",
         "confirmOnDelete": "Подтверждать удаление",
         "displayHelpIcons": "Показывать значки подсказок",
-        "useCanvasBeta": "Показывать инструменты слева (Beta UI)",
         "enableImageDebugging": "Включить отладку",
         "resetWebUI": "Сброс настроек Web UI",
         "resetWebUIDesc1": "Сброс настроек веб-интерфейса удаляет только локальный кэш браузера с вашими изображениями и настройками. Он не удаляет изображения с диска.",
         "resetWebUIDesc2": "Если изображения не отображаются в галерее или не работает что-то еще, пожалуйста, попробуйте сбросить настройки, прежде чем сообщать о проблеме на GitHub.",
-        "resetComplete": "Интерфейс сброшен. Обновите эту страницу.",
-        "useSlidersForAll": "Использовать ползунки для всех параметров"
+        "resetComplete": "Настройки веб-интерфейса были сброшены.",
+        "useSlidersForAll": "Использовать ползунки для всех параметров",
+        "consoleLogLevel": "Уровень логирования",
+        "shouldLogToConsole": "Логи в консоль",
+        "developer": "Разработчик",
+        "general": "Основное",
+        "showProgressInViewer": "Показывать процесс генерации в Просмотрщике",
+        "antialiasProgressImages": "Сглаживать предпоказ процесса генерации",
+        "generation": "Поколение",
+        "ui": "Пользовательский интерфейс",
+        "favoriteSchedulers": "Избранные планировщики",
+        "favoriteSchedulersPlaceholder": "Нет избранных планировщиков",
+        "enableNodesEditor": "Включить редактор узлов",
+        "experimental": "Экспериментальные",
+        "beta": "Бета",
+        "alternateCanvasLayout": "Альтернативный слой холста",
+        "showAdvancedOptions": "Показать доп. параметры",
+        "autoChangeDimensions": "Обновить Ш/В на стандартные для модели при изменении"
     },
     "toast": {
         "tempFoldersEmptied": "Временная папка очищена",
         "uploadFailed": "Загрузка не удалась",
-        "uploadFailedMultipleImagesDesc": "Можно вставить только одно изображение (вы попробовали вставить несколько)",
         "uploadFailedUnableToLoadDesc": "Невозможно загрузить файл",
         "downloadImageStarted": "Скачивание изображения началось",
         "imageCopied": "Изображение скопировано",
         "imageLinkCopied": "Ссылка на изображение скопирована",
         "imageNotLoaded": "Изображение не загружено",
-        "imageNotLoadedDesc": "Не найдены изображения для отправки в img2img",
+        "imageNotLoadedDesc": "Не удалось найти изображение",
         "imageSavedToGallery": "Изображение сохранено в галерею",
         "canvasMerged": "Холст объединен",
         "sentToImageToImage": "Отправить в img2img",
@@ -536,7 +599,21 @@
         "serverError": "Ошибка сервера",
         "disconnected": "Отключено от сервера",
         "connected": "Подключено к серверу",
-        "canceled": "Обработка отменена"
+        "canceled": "Обработка отменена",
+        "problemCopyingImageLink": "Не удалось скопировать ссылку на изображение",
+        "uploadFailedInvalidUploadDesc": "Должно быть одно изображение в формате PNG или JPEG",
+        "parameterNotSet": "Параметр не задан",
+        "parameterSet": "Параметр задан",
+        "nodesLoaded": "Узлы загружены",
+        "problemCopyingImage": "Не удается скопировать изображение",
+        "nodesLoadedFailed": "Не удалось загрузить Узлы",
+        "nodesCleared": "Узлы очищены",
+        "nodesBrokenConnections": "Не удается загрузить. Некоторые соединения повреждены.",
+        "nodesUnrecognizedTypes": "Не удается загрузить. Граф имеет нераспознанные типы",
+        "nodesNotValidJSON": "Недопустимый JSON",
+        "nodesCorruptedGraph": "Не удается загрузить. Граф, похоже, поврежден.",
+        "nodesSaved": "Узлы сохранены",
+        "nodesNotValidGraph": "Недопустимый граф узлов InvokeAI"
     },
     "tooltip": {
         "feature": {
@@ -610,7 +687,8 @@
         "betaClear": "Очистить",
         "betaDarkenOutside": "Затемнить снаружи",
         "betaLimitToBox": "Ограничить выделением",
-        "betaPreserveMasked": "Сохранять маскируемую область"
+        "betaPreserveMasked": "Сохранять маскируемую область",
+        "antialiasing": "Не удалось скопировать ссылку на изображение"
     },
     "accessibility": {
         "modelSelect": "Выбор модели",
@@ -625,8 +703,7 @@
         "flipHorizontally": "Отразить горизонтально",
         "toggleAutoscroll": "Включить автопрокрутку",
         "toggleLogViewer": "Показать или скрыть просмотрщик логов",
-        "showOptionsPanel": "Показать опции",
-        "showGallery": "Показать галерею",
+        "showOptionsPanel": "Показать боковую панель",
         "invokeProgressBar": "Индикатор выполнения",
         "reset": "Сброс",
         "modifyConfig": "Изменить конфиг",
@@ -634,5 +711,69 @@
         "copyMetadataJson": "Скопировать метаданные JSON",
         "exitViewer": "Закрыть просмотрщик",
         "menu": "Меню"
+    },
+    "ui": {
+        "showProgressImages": "Показывать промежуточный итог",
+        "hideProgressImages": "Не показывать промежуточный итог",
+        "swapSizes": "Поменять местами размеры",
+        "lockRatio": "Зафиксировать пропорции"
+    },
+    "nodes": {
+        "zoomInNodes": "Увеличьте масштаб",
+        "zoomOutNodes": "Уменьшите масштаб",
+        "fitViewportNodes": "Уместить вид",
+        "hideGraphNodes": "Скрыть оверлей графа",
+        "showGraphNodes": "Показать оверлей графа",
+        "showLegendNodes": "Показать тип поля",
+        "hideMinimapnodes": "Скрыть миникарту",
+        "hideLegendNodes": "Скрыть тип поля",
+        "showMinimapnodes": "Показать миникарту",
+        "loadWorkflow": "Загрузить рабочий процесс",
+        "resetWorkflowDesc2": "Сброс рабочего процесса очистит все узлы, ребра и детали рабочего процесса.",
+        "resetWorkflow": "Сбросить рабочий процесс",
+        "resetWorkflowDesc": "Вы уверены, что хотите сбросить этот рабочий процесс?",
+        "reloadNodeTemplates": "Перезагрузить шаблоны узлов",
+        "downloadWorkflow": "Скачать JSON рабочего процесса"
+    },
+    "controlnet": {
+        "amult": "a_mult",
+        "contentShuffleDescription": "Перетасовывает содержимое изображения",
+        "bgth": "bg_th",
+        "contentShuffle": "Перетасовка содержимого",
+        "beginEndStepPercent": "Процент начала/конца шага",
+        "duplicate": "Дублировать",
+        "balanced": "Сбалансированный",
+        "f": "F",
+        "depthMidasDescription": "Генерация карты глубины с использованием Midas",
+        "control": "Контроль",
+        "coarse": "Грубость обработки",
+        "crop": "Обрезка",
+        "depthMidas": "Глубина (Midas)",
+        "enableControlnet": "Включить ControlNet",
+        "detectResolution": "Определить разрешение",
+        "controlMode": "Режим контроля",
+        "cannyDescription": "Детектор границ Canny",
+        "depthZoe": "Глубина (Zoe)",
+        "autoConfigure": "Автонастройка процессора",
+        "delete": "Удалить",
+        "canny": "Canny",
+        "depthZoeDescription": "Генерация карты глубины с использованием Zoe"
+    },
+    "boards": {
+        "autoAddBoard": "Авто добавление Доски",
+        "topMessage": "Эта доска содержит изображения, используемые в следующих функциях:",
+        "move": "Перемещение",
+        "menuItemAutoAdd": "Авто добавление на эту доску",
+        "myBoard": "Моя Доска",
+        "searchBoard": "Поиск Доски...",
+        "noMatching": "Нет подходящих Досок",
+        "selectBoard": "Выбрать Доску",
+        "cancel": "Отменить",
+        "addBoard": "Добавить Доску",
+        "bottomMessage": "Удаление этой доски и ее изображений приведет к сбросу всех функций, использующихся их в данный момент.",
+        "uncategorized": "Без категории",
+        "changeBoard": "Изменить Доску",
+        "loading": "Загрузка...",
+        "clearSearch": "Очистить поиск"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/sv.json b/invokeai/frontend/web/dist/locales/sv.json
index da2266135d..eef46c4513 100644
--- a/invokeai/frontend/web/dist/locales/sv.json
+++ b/invokeai/frontend/web/dist/locales/sv.json
@@ -15,7 +15,6 @@
         "reset": "Starta om",
         "previousImage": "Föregående bild",
         "useThisParameter": "Använd denna parametern",
-        "showGallery": "Visa galleri",
         "rotateCounterClockwise": "Rotera moturs",
         "rotateClockwise": "Rotera medurs",
         "modifyConfig": "Ändra konfiguration",
@@ -27,10 +26,6 @@
         "githubLabel": "Github",
         "discordLabel": "Discord",
         "settingsLabel": "Inställningar",
-        "darkTheme": "Mörk",
-        "lightTheme": "Ljus",
-        "greenTheme": "Grön",
-        "oceanTheme": "Hav",
         "langEnglish": "Engelska",
         "langDutch": "Nederländska",
         "langFrench": "Franska",
@@ -63,12 +58,10 @@
         "statusGenerationComplete": "Generering klar",
         "statusModelConverted": "Modell konverterad",
         "statusMergingModels": "Sammanfogar modeller",
-        "pinOptionsPanel": "Nåla fast inställningspanelen",
         "loading": "Laddar",
         "loadingInvokeAI": "Laddar Invoke AI",
         "statusRestoringFaces": "Återskapar ansikten",
         "languagePickerLabel": "Språkväljare",
-        "themeLabel": "Tema",
         "txt2img": "Text till bild",
         "nodes": "Noder",
         "img2img": "Bild till bild",
@@ -108,7 +101,6 @@
         "galleryImageResetSize": "Återställ storlek",
         "gallerySettings": "Galleriinställningar",
         "maintainAspectRatio": "Behåll bildförhållande",
-        "pinGallery": "Nåla fast galleri",
         "noImagesInGallery": "Inga bilder i galleriet",
         "autoSwitchNewImages": "Ändra automatiskt till nya bilder",
         "singleColumnLayout": "Enkolumnslayout"
diff --git a/invokeai/frontend/web/dist/locales/tr.json b/invokeai/frontend/web/dist/locales/tr.json
index 316908b4a9..0c222eecf7 100644
--- a/invokeai/frontend/web/dist/locales/tr.json
+++ b/invokeai/frontend/web/dist/locales/tr.json
@@ -19,21 +19,15 @@
         "reset": "Sıfırla",
         "uploadImage": "Resim Yükle",
         "previousImage": "Önceki Resim",
-        "menu": "Menü",
-        "showGallery": "Galeriyi Göster"
+        "menu": "Menü"
     },
     "common": {
         "hotkeysLabel": "Kısayol Tuşları",
-        "themeLabel": "Tema",
         "languagePickerLabel": "Dil Seçimi",
         "reportBugLabel": "Hata Bildir",
         "githubLabel": "Github",
         "discordLabel": "Discord",
         "settingsLabel": "Ayarlar",
-        "darkTheme": "Karanlık Tema",
-        "lightTheme": "Aydınlık Tema",
-        "greenTheme": "Yeşil Tema",
-        "oceanTheme": "Okyanus Tema",
         "langArabic": "Arapça",
         "langEnglish": "İngilizce",
         "langDutch": "Hollandaca",
diff --git a/invokeai/frontend/web/dist/locales/uk.json b/invokeai/frontend/web/dist/locales/uk.json
index 8261aa82e0..a85faee727 100644
--- a/invokeai/frontend/web/dist/locales/uk.json
+++ b/invokeai/frontend/web/dist/locales/uk.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Гарячi клавіші",
-        "themeLabel": "Тема",
         "languagePickerLabel": "Мова",
         "reportBugLabel": "Повідомити про помилку",
         "settingsLabel": "Налаштування",
-        "darkTheme": "Темна",
-        "lightTheme": "Світла",
-        "greenTheme": "Зелена",
         "img2img": "Зображення із зображення (img2img)",
         "unifiedCanvas": "Універсальне полотно",
         "nodes": "Вузли",
@@ -55,8 +51,6 @@
         "langHebrew": "Іврит",
         "langKorean": "Корейська",
         "langPortuguese": "Португальська",
-        "pinOptionsPanel": "Закріпити панель налаштувань",
-        "oceanTheme": "Океан",
         "langArabic": "Арабська",
         "langSimplifiedChinese": "Китайська (спрощена)",
         "langSpanish": "Іспанська",
@@ -87,7 +81,6 @@
         "maintainAspectRatio": "Зберігати пропорції",
         "autoSwitchNewImages": "Автоматично вибирати нові",
         "singleColumnLayout": "Одна колонка",
-        "pinGallery": "Закріпити галерею",
         "allImagesLoaded": "Всі зображення завантажені",
         "loadMore": "Завантажити більше",
         "noImagesInGallery": "Зображень немає"
@@ -417,7 +410,6 @@
         "cfgScale": "Рівень CFG",
         "width": "Ширина",
         "height": "Висота",
-        "sampler": "Семплер",
         "seed": "Сід",
         "randomizeSeed": "Випадковий сид",
         "shuffle": "Оновити",
@@ -439,10 +431,6 @@
         "hiresOptim": "Оптимізація High Res",
         "imageFit": "Вмістити зображення",
         "codeformerFidelity": "Точність",
-        "seamSize": "Размір шву",
-        "seamBlur": "Розмиття шву",
-        "seamStrength": "Сила шву",
-        "seamSteps": "Кроки шву",
         "scaleBeforeProcessing": "Масштабувати",
         "scaledWidth": "Масштаб Ш",
         "scaledHeight": "Масштаб В",
@@ -453,8 +441,6 @@
         "infillScalingHeader": "Заповнення і масштабування",
         "img2imgStrength": "Сила обробки img2img",
         "toggleLoopback": "Зациклити обробку",
-        "invoke": "Викликати",
-        "promptPlaceholder": "Введіть запит тут (англійською). [видалені токени], (більш вагомі)++, (менш вагомі)--, swap и blend також доступні (дивіться Github)",
         "sendTo": "Надіслати",
         "sendToImg2Img": "Надіслати у img2img",
         "sendToUnifiedCanvas": "Надіслати на полотно",
@@ -467,7 +453,6 @@
         "useAll": "Використати все",
         "useInitImg": "Використати як початкове",
         "info": "Метадані",
-        "deleteImage": "Видалити зображення",
         "initialImage": "Початкове зображення",
         "showOptionsPanel": "Показати панель налаштувань",
         "general": "Основне",
@@ -485,8 +470,7 @@
         "denoisingStrength": "Сила шумоподавлення",
         "copyImage": "Копіювати зображення",
         "symmetry": "Симетрія",
-        "hSymmetryStep": "Крок гор. симетрії",
-        "negativePrompts": "Виключний запит"
+        "hSymmetryStep": "Крок гор. симетрії"
     },
     "settings": {
         "models": "Моделі",
@@ -494,7 +478,6 @@
         "saveSteps": "Зберігати кожні n кроків",
         "confirmOnDelete": "Підтверджувати видалення",
         "displayHelpIcons": "Показувати значки підказок",
-        "useCanvasBeta": "Показувати інструменты зліва (Beta UI)",
         "enableImageDebugging": "Увімкнути налагодження",
         "resetWebUI": "Повернути початкові",
         "resetWebUIDesc1": "Скидання настройок веб-інтерфейсу видаляє лише локальний кеш браузера з вашими зображеннями та налаштуваннями. Це не призводить до видалення зображень з диску.",
@@ -505,7 +488,6 @@
     "toast": {
         "tempFoldersEmptied": "Тимчасова папка очищена",
         "uploadFailed": "Не вдалося завантажити",
-        "uploadFailedMultipleImagesDesc": "Можна вставити лише одне зображення (ви спробували вставити декілька)",
         "uploadFailedUnableToLoadDesc": "Неможливо завантажити файл",
         "downloadImageStarted": "Завантаження зображення почалося",
         "imageCopied": "Зображення скопійоване",
@@ -626,7 +608,6 @@
         "rotateClockwise": "Обертати за годинниковою стрілкою",
         "toggleAutoscroll": "Увімкнути автопрокручування",
         "toggleLogViewer": "Показати або приховати переглядач журналів",
-        "showGallery": "Показати галерею",
         "previousImage": "Попереднє зображення",
         "copyMetadataJson": "Скопіювати метадані JSON",
         "flipVertically": "Перевернути по вертикалі",
diff --git a/invokeai/frontend/web/dist/locales/zh_CN.json b/invokeai/frontend/web/dist/locales/zh_CN.json
index d4d7746926..d91bf0b4bb 100644
--- a/invokeai/frontend/web/dist/locales/zh_CN.json
+++ b/invokeai/frontend/web/dist/locales/zh_CN.json
@@ -1,25 +1,21 @@
 {
     "common": {
         "hotkeysLabel": "快捷键",
-        "themeLabel": "主题",
         "languagePickerLabel": "语言",
-        "reportBugLabel": "提交错误报告",
+        "reportBugLabel": "反馈错误",
         "settingsLabel": "设置",
-        "darkTheme": "暗色",
-        "lightTheme": "亮色",
-        "greenTheme": "绿色",
-        "img2img": "图像到图像",
+        "img2img": "图生图",
         "unifiedCanvas": "统一画布",
-        "nodes": "节点",
+        "nodes": "工作流编辑器",
         "langSimplifiedChinese": "简体中文",
         "nodesDesc": "一个基于节点的图像生成系统目前正在开发中。请持续关注关于这一功能的更新。",
         "postProcessing": "后期处理",
-        "postProcessDesc1": "Invoke AI 提供各种各样的后期处理功能。图像放大和面部修复在网页界面中已经可用。你可以从文本到图像和图像到图像页面的高级选项菜单中访问它们。你也可以直接使用图像显示上方或查看器中的图像操作按钮处理图像。",
+        "postProcessDesc1": "Invoke AI 提供各种各样的后期处理功能。图像放大和面部修复在网页界面中已经可用。你可以从文生图和图生图页面的高级选项菜单中访问它们。你也可以直接使用图像显示上方或查看器中的图像操作按钮处理图像。",
         "postProcessDesc2": "一个专门的界面将很快发布,新的界面能够处理更复杂的后期处理流程。",
-        "postProcessDesc3": "Invoke AI 命令行界面提供例如Embiggen的各种其他功能。",
+        "postProcessDesc3": "Invoke AI 命令行界面提供例如 Embiggen 的各种其他功能。",
         "training": "训练",
-        "trainingDesc1": "一个专门用于从网络UI使用Textual Inversion和Dreambooth训练自己的嵌入模型和检查点的工作流程。",
-        "trainingDesc2": "InvokeAI已经支持使用主脚本中的Textual Inversion来训练自定义的嵌入模型。",
+        "trainingDesc1": "一个专门用于从 Web UI 使用 Textual Inversion 和 Dreambooth 训练自己的 Embedding 和 checkpoint 的工作流。",
+        "trainingDesc2": "InvokeAI 已经支持使用主脚本中的 Textual Inversion 来训练自定义 embeddouring。",
         "upload": "上传",
         "close": "关闭",
         "load": "加载",
@@ -27,23 +23,72 @@
         "statusDisconnected": "未连接",
         "statusError": "错误",
         "statusPreparing": "准备中",
-        "statusProcessingCanceled": "处理取消",
+        "statusProcessingCanceled": "处理已取消",
         "statusProcessingComplete": "处理完成",
         "statusGenerating": "生成中",
-        "statusGeneratingTextToImage": "文字到图像生成中",
-        "statusGeneratingImageToImage": "图像到图像生成中",
-        "statusGeneratingInpainting": "生成内画中",
-        "statusGeneratingOutpainting": "生成外画中",
+        "statusGeneratingTextToImage": "文生图生成中",
+        "statusGeneratingImageToImage": "图生图生成中",
+        "statusGeneratingInpainting": "(Inpainting) 内补生成中",
+        "statusGeneratingOutpainting": "(Outpainting) 外扩生成中",
         "statusGenerationComplete": "生成完成",
         "statusIterationComplete": "迭代完成",
         "statusSavingImage": "图像保存中",
-        "statusRestoringFaces": "脸部修复中",
-        "statusRestoringFacesGFPGAN": "脸部修复中 (GFPGAN)",
-        "statusRestoringFacesCodeFormer": "脸部修复中 (CodeFormer)",
+        "statusRestoringFaces": "面部修复中",
+        "statusRestoringFacesGFPGAN": "面部修复中 (GFPGAN)",
+        "statusRestoringFacesCodeFormer": "面部修复中 (CodeFormer)",
         "statusUpscaling": "放大中",
         "statusUpscalingESRGAN": "放大中 (ESRGAN)",
         "statusLoadingModel": "模型加载中",
-        "statusModelChanged": "模型已切换"
+        "statusModelChanged": "模型已切换",
+        "accept": "同意",
+        "cancel": "取消",
+        "dontAskMeAgain": "不要再次询问",
+        "areYouSure": "你确认吗?",
+        "imagePrompt": "图片提示词",
+        "langKorean": "朝鲜语",
+        "langPortuguese": "葡萄牙语",
+        "random": "随机",
+        "generate": "生成",
+        "openInNewTab": "在新的标签页打开",
+        "langUkranian": "乌克兰语",
+        "back": "返回",
+        "statusMergedModels": "模型已合并",
+        "statusConvertingModel": "转换模型中",
+        "statusModelConverted": "模型转换完成",
+        "statusMergingModels": "合并模型",
+        "githubLabel": "GitHub",
+        "discordLabel": "Discord",
+        "langPolish": "波兰语",
+        "langBrPortuguese": "葡萄牙语(巴西)",
+        "langDutch": "荷兰语",
+        "langFrench": "法语",
+        "langRussian": "俄语",
+        "langGerman": "德语",
+        "langHebrew": "希伯来语",
+        "langItalian": "意大利语",
+        "langJapanese": "日语",
+        "langSpanish": "西班牙语",
+        "langEnglish": "英语",
+        "langArabic": "阿拉伯语",
+        "txt2img": "文生图",
+        "postprocessing": "后期处理",
+        "loading": "加载中",
+        "loadingInvokeAI": "Invoke AI 加载中",
+        "linear": "线性的",
+        "batch": "批次管理器",
+        "communityLabel": "社区",
+        "modelManager": "模型管理器",
+        "nodeEditor": "节点编辑器",
+        "statusProcessing": "处理中",
+        "imageFailedToLoad": "无法加载图像",
+        "lightMode": "浅色模式",
+        "learnMore": "了解更多",
+        "darkMode": "深色模式",
+        "advanced": "高级",
+        "t2iAdapter": "T2I Adapter",
+        "ipAdapter": "IP Adapter",
+        "controlAdapter": "Control Adapter",
+        "controlNet": "ControlNet"
     },
     "gallery": {
         "generations": "生成的图像",
@@ -53,20 +98,35 @@
         "galleryImageSize": "预览大小",
         "galleryImageResetSize": "重置预览大小",
         "gallerySettings": "预览设置",
-        "maintainAspectRatio": "保持比例",
+        "maintainAspectRatio": "保持纵横比",
         "autoSwitchNewImages": "自动切换到新图像",
         "singleColumnLayout": "单列布局",
-        "pinGallery": "保持图库常开",
-        "allImagesLoaded": "所有图像加载完成",
+        "allImagesLoaded": "所有图像已加载",
         "loadMore": "加载更多",
-        "noImagesInGallery": "图库中无图像"
+        "noImagesInGallery": "无图像可用于显示",
+        "deleteImage": "删除图片",
+        "deleteImageBin": "被删除的图片会发送到你操作系统的回收站。",
+        "deleteImagePermanent": "删除的图片无法被恢复。",
+        "images": "图片",
+        "assets": "素材",
+        "autoAssignBoardOnClick": "点击后自动分配面板",
+        "featuresWillReset": "如果您删除该图像,这些功能会立即被重置。",
+        "loading": "加载中",
+        "unableToLoad": "无法加载图库",
+        "currentlyInUse": "该图像目前在以下功能中使用:",
+        "copy": "复制",
+        "download": "下载",
+        "setCurrentImage": "设为当前图像",
+        "preparingDownload": "准备下载",
+        "preparingDownloadFailed": "准备下载时出现问题",
+        "downloadSelection": "下载所选内容"
     },
     "hotkeys": {
-        "keyboardShortcuts": "快捷方式",
-        "appHotkeys": "应用快捷方式",
-        "generalHotkeys": "一般快捷方式",
-        "galleryHotkeys": "图库快捷方式",
-        "unifiedCanvasHotkeys": "统一画布快捷方式",
+        "keyboardShortcuts": "键盘快捷键",
+        "appHotkeys": "应用快捷键",
+        "generalHotkeys": "一般快捷键",
+        "galleryHotkeys": "图库快捷键",
+        "unifiedCanvasHotkeys": "统一画布快捷键",
         "invoke": {
             "title": "Invoke",
             "desc": "生成图像"
@@ -76,31 +136,31 @@
             "desc": "取消图像生成"
         },
         "focusPrompt": {
-            "title": "打开提示框",
-            "desc": "打开提示文本框"
+            "title": "打开提示词框",
+            "desc": "打开提示词文本框"
         },
         "toggleOptions": {
             "title": "切换选项卡",
-            "desc": "打开或关闭选项卡"
+            "desc": "打开或关闭选项浮窗"
         },
         "pinOptions": {
             "title": "常开选项卡",
-            "desc": "保持选项卡常开"
+            "desc": "保持选项浮窗常开"
         },
         "toggleViewer": {
-            "title": "切换图像视图",
-            "desc": "打开或关闭图像视图"
+            "title": "切换图像查看器",
+            "desc": "打开或关闭图像查看器"
         },
         "toggleGallery": {
             "title": "切换图库",
             "desc": "打开或关闭图库"
         },
         "maximizeWorkSpace": {
-            "title": "工作台最大化",
+            "title": "工作区最大化",
             "desc": "关闭所有浮窗,将工作区域最大化"
         },
         "changeTabs": {
-            "title": "切换卡片",
+            "title": "切换选项卡",
             "desc": "切换到另一个工作区"
         },
         "consoleToggle": {
@@ -108,7 +168,7 @@
             "desc": "打开或关闭命令行"
         },
         "setPrompt": {
-            "title": "使用提示",
+            "title": "使用当前提示词",
             "desc": "使用当前图像的提示词"
         },
         "setSeed": {
@@ -116,12 +176,12 @@
             "desc": "使用当前图像的种子"
         },
         "setParameters": {
-            "title": "使用所有参数",
+            "title": "使用当前参数",
             "desc": "使用当前图像的所有参数"
         },
         "restoreFaces": {
-            "title": "脸部修复",
-            "desc": "对当前图像进行脸部修复"
+            "title": "面部修复",
+            "desc": "对当前图像进行面部修复"
         },
         "upscale": {
             "title": "放大",
@@ -132,8 +192,8 @@
             "desc": "显示当前图像的元数据"
         },
         "sendToImageToImage": {
-            "title": "送往图像到图像",
-            "desc": "将当前图像送往图像到图像"
+            "title": "发送到图生图",
+            "desc": "发送当前图像到图生图"
         },
         "deleteImage": {
             "title": "删除图像",
@@ -145,23 +205,23 @@
         },
         "previousImage": {
             "title": "上一张图像",
-            "desc": "显示相册中的上一张图像"
+            "desc": "显示图库中的上一张图像"
         },
         "nextImage": {
             "title": "下一张图像",
-            "desc": "显示相册中的下一张图像"
+            "desc": "显示图库中的下一张图像"
         },
         "toggleGalleryPin": {
             "title": "切换图库常开",
             "desc": "开关图库在界面中的常开模式"
         },
         "increaseGalleryThumbSize": {
-            "title": "增大预览大小",
-            "desc": "增大图库中预览的大小"
+            "title": "增大预览尺寸",
+            "desc": "增大图库中预览的尺寸"
         },
         "decreaseGalleryThumbSize": {
-            "title": "减小预览大小",
-            "desc": "减小图库中预览的大小"
+            "title": "缩小预览尺寸",
+            "desc": "缩小图库中预览的尺寸"
         },
         "selectBrush": {
             "title": "选择刷子",
@@ -189,19 +249,19 @@
         },
         "moveTool": {
             "title": "移动工具",
-            "desc": "在画布上移动"
+            "desc": "画布允许导航"
         },
         "fillBoundingBox": {
             "title": "填充选择区域",
             "desc": "在选择区域中填充刷子颜色"
         },
         "eraseBoundingBox": {
-            "title": "取消选择区域",
-            "desc": "将选择区域抹除"
+            "title": "擦除选择框",
+            "desc": "将选择区域擦除"
         },
         "colorPicker": {
-            "title": "颜色提取工具",
-            "desc": "选择颜色提取工具"
+            "title": "选择颜色拾取工具",
+            "desc": "选择画布颜色拾取工具"
         },
         "toggleSnap": {
             "title": "切换网格对齐",
@@ -217,7 +277,7 @@
         },
         "clearMask": {
             "title": "清除遮罩",
-            "desc": "清除整个遮罩层"
+            "desc": "清除整个遮罩"
         },
         "hideMask": {
             "title": "隐藏遮罩",
@@ -233,7 +293,7 @@
         },
         "saveToGallery": {
             "title": "保存至图库",
-            "desc": "将画板当前内容保存至图库"
+            "desc": "将画布当前内容保存至图库"
         },
         "copyToClipboard": {
             "title": "复制到剪贴板",
@@ -253,7 +313,7 @@
         },
         "resetView": {
             "title": "重置视图",
-            "desc": "重置画板视图"
+            "desc": "重置画布视图"
         },
         "previousStagingImage": {
             "title": "上一张暂存图像",
@@ -266,12 +326,17 @@
         "acceptStagingImage": {
             "title": "接受暂存图像",
             "desc": "接受当前暂存区中的图像"
+        },
+        "nodesHotkeys": "节点快捷键",
+        "addNodes": {
+            "title": "添加节点",
+            "desc": "打开添加节点菜单"
         }
     },
     "modelManager": {
         "modelManager": "模型管理器",
         "model": "模型",
-        "modelAdded": "模型已添加",
+        "modelAdded": "已添加模型",
         "modelUpdated": "模型已更新",
         "modelEntryDeleted": "模型已删除",
         "cannotUseSpaces": "不能使用空格",
@@ -284,30 +349,30 @@
         "description": "描述",
         "descriptionValidationMsg": "添加模型的描述",
         "config": "配置",
-        "configValidationMsg": "模型配置文件的路径",
+        "configValidationMsg": "模型配置文件的路径。",
         "modelLocation": "模型位置",
-        "modelLocationValidationMsg": "模型文件的路径",
+        "modelLocationValidationMsg": "提供 Diffusers 模型文件的本地存储路径",
         "vaeLocation": "VAE 位置",
-        "vaeLocationValidationMsg": "VAE 文件的路径",
+        "vaeLocationValidationMsg": "VAE 文件的路径。",
         "width": "宽度",
-        "widthValidationMsg": "模型的默认宽度",
+        "widthValidationMsg": "模型的默认宽度。",
         "height": "高度",
-        "heightValidationMsg": "模型的默认高度",
+        "heightValidationMsg": "模型的默认高度。",
         "addModel": "添加模型",
         "updateModel": "更新模型",
         "availableModels": "可用模型",
-        "search": "搜索",
+        "search": "检索",
         "load": "加载",
         "active": "活跃",
         "notLoaded": "未加载",
         "cached": "缓存",
         "checkpointFolder": "模型检查点文件夹",
-        "clearCheckpointFolder": "清除模型检查点文件夹",
+        "clearCheckpointFolder": "清除 Checkpoint 模型文件夹",
         "findModels": "寻找模型",
         "modelsFound": "找到的模型",
         "selectFolder": "选择文件夹",
         "selected": "已选择",
-        "selectAll": "选择所有",
+        "selectAll": "全选",
         "deselectAll": "取消选择所有",
         "showExisting": "显示已存在",
         "addSelected": "添加选择",
@@ -315,8 +380,99 @@
         "delete": "删除",
         "deleteModel": "删除模型",
         "deleteConfig": "删除配置",
-        "deleteMsg1": "您确定要将这个模型从 InvokeAI 删除吗?",
-        "deleteMsg2": "这不会从磁盘中删除模型检查点文件。如果您愿意,可以重新添加它们。"
+        "deleteMsg1": "您确定要将该模型从 InvokeAI 删除吗?",
+        "deleteMsg2": "磁盘中放置在 InvokeAI 根文件夹的 checkpoint 文件会被删除。若你正在使用自定义目录,则不会从磁盘中删除他们。",
+        "convertToDiffusersHelpText1": "模型会被转换成 🧨 Diffusers 格式。",
+        "convertToDiffusersHelpText2": "这个过程会替换你的模型管理器的入口中相同 Diffusers 版本的模型。",
+        "mergedModelSaveLocation": "保存路径",
+        "mergedModelCustomSaveLocation": "自定义路径",
+        "checkpointModels": "Checkpoints",
+        "formMessageDiffusersVAELocation": "VAE 路径",
+        "convertToDiffusersHelpText4": "这是一次性的处理过程。根据你电脑的配置不同耗时 30 - 60 秒。",
+        "convertToDiffusersHelpText6": "你希望转换这个模型吗?",
+        "interpolationType": "插值类型",
+        "modelTwo": "模型 2",
+        "modelThree": "模型 3",
+        "v2_768": "v2 (768px)",
+        "mergedModelName": "合并的模型名称",
+        "allModels": "全部模型",
+        "convertToDiffusers": "转换为 Diffusers",
+        "formMessageDiffusersModelLocation": "Diffusers 模型路径",
+        "custom": "自定义",
+        "formMessageDiffusersVAELocationDesc": "如果没有特别指定,InvokeAI 会从上面指定的模型路径中寻找 VAE 文件。",
+        "safetensorModels": "SafeTensors",
+        "modelsMerged": "模型合并完成",
+        "mergeModels": "合并模型",
+        "modelOne": "模型 1",
+        "diffusersModels": "Diffusers",
+        "scanForModels": "扫描模型",
+        "repo_id": "项目 ID",
+        "repoIDValidationMsg": "你的模型的在线项目地址",
+        "v1": "v1",
+        "invokeRoot": "InvokeAI 文件夹",
+        "inpainting": "v1 Inpainting",
+        "customSaveLocation": "自定义保存路径",
+        "scanAgain": "重新扫描",
+        "customConfig": "个性化配置",
+        "pathToCustomConfig": "个性化配置路径",
+        "modelConverted": "模型已转换",
+        "statusConverting": "转换中",
+        "sameFolder": "相同文件夹",
+        "invokeAIFolder": "Invoke AI 文件夹",
+        "ignoreMismatch": "忽略所选模型之间的不匹配",
+        "modelMergeHeaderHelp1": "您可以合并最多三种不同的模型,以创建符合您需求的混合模型。",
+        "modelMergeHeaderHelp2": "只有扩散器(Diffusers)可以用于模型合并。如果您想要合并一个检查点模型,请先将其转换为扩散器。",
+        "addCheckpointModel": "添加 Checkpoint / Safetensor 模型",
+        "addDiffuserModel": "添加 Diffusers 模型",
+        "vaeRepoID": "VAE 项目 ID",
+        "vaeRepoIDValidationMsg": "VAE 模型在线仓库地址",
+        "selectAndAdd": "选择下表中的模型并添加",
+        "noModelsFound": "未有找到模型",
+        "formMessageDiffusersModelLocationDesc": "请至少输入一个。",
+        "convertToDiffusersSaveLocation": "保存路径",
+        "convertToDiffusersHelpText3": "磁盘中放置在 InvokeAI 根文件夹的 checkpoint 文件会被删除. 若位于自定义目录, 则不会受影响.",
+        "v2_base": "v2 (512px)",
+        "convertToDiffusersHelpText5": "请确认你有足够的磁盘空间,模型大小通常在 2 GB - 7 GB 之间。",
+        "convert": "转换",
+        "merge": "合并",
+        "pickModelType": "选择模型类型",
+        "addDifference": "增加差异",
+        "none": "无",
+        "inverseSigmoid": "反 Sigmoid 函数",
+        "weightedSum": "加权求和",
+        "modelMergeAlphaHelp": "Alpha 参数控制模型的混合强度。较低的 Alpha 值会导致第二个模型的影响减弱。",
+        "sigmoid": "Sigmoid 函数",
+        "modelMergeInterpAddDifferenceHelp": "在这种模式下,首先从模型 2 中减去模型 3,得到的版本再用上述的 Alpha 值与模型1进行混合。",
+        "modelsSynced": "模型已同步",
+        "modelSyncFailed": "模型同步失败",
+        "modelDeleteFailed": "模型删除失败",
+        "syncModelsDesc": "如果您的模型与后端不同步,您可以使用此选项刷新它们。便于您在应用程序启动的情况下手动更新 models.yaml 文件或将模型添加到 InvokeAI 根文件夹。",
+        "selectModel": "选择模型",
+        "importModels": "导入模型",
+        "settings": "设置",
+        "syncModels": "同步模型",
+        "noCustomLocationProvided": "未提供自定义路径",
+        "modelDeleted": "模型已删除",
+        "modelUpdateFailed": "模型更新失败",
+        "modelConversionFailed": "模型转换失败",
+        "modelsMergeFailed": "模型融合失败",
+        "baseModel": "基底模型",
+        "convertingModelBegin": "模型转换中. 请稍候.",
+        "noModels": "未找到模型",
+        "predictionType": "预测类型(适用于 Stable Diffusion 2.x 模型和部分 Stable Diffusion 1.x 模型)",
+        "quickAdd": "快速添加",
+        "simpleModelDesc": "提供一个指向本地 Diffusers 模型的路径,本地 checkpoint / safetensors 模型或一个HuggingFace 项目 ID,又或者一个 checkpoint/diffusers 模型链接。",
+        "advanced": "高级",
+        "useCustomConfig": "使用自定义配置",
+        "closeAdvanced": "关闭高级",
+        "modelType": "模型类别",
+        "customConfigFileLocation": "自定义配置文件目录",
+        "variant": "变体",
+        "onnxModels": "Onnx",
+        "vae": "VAE",
+        "oliveModels": "Olive",
+        "loraModels": "LoRA",
+        "alpha": "Alpha"
     },
     "parameters": {
         "images": "图像",
@@ -324,113 +480,250 @@
         "cfgScale": "CFG 等级",
         "width": "宽度",
         "height": "高度",
-        "sampler": "采样算法",
         "seed": "种子",
         "randomizeSeed": "随机化种子",
-        "shuffle": "随机化",
+        "shuffle": "随机生成种子",
         "noiseThreshold": "噪声阈值",
         "perlinNoise": "Perlin 噪声",
         "variations": "变种",
         "variationAmount": "变种数量",
         "seedWeights": "种子权重",
-        "faceRestoration": "脸部修复",
-        "restoreFaces": "修复脸部",
+        "faceRestoration": "面部修复",
+        "restoreFaces": "修复面部",
         "type": "种类",
         "strength": "强度",
         "upscaling": "放大",
-        "upscale": "放大",
+        "upscale": "放大 (Shift + U)",
         "upscaleImage": "放大图像",
         "scale": "等级",
         "otherOptions": "其他选项",
         "seamlessTiling": "无缝拼贴",
-        "hiresOptim": "高清优化",
-        "imageFit": "使生成图像长宽适配原图像",
-        "codeformerFidelity": "保真",
-        "seamSize": "接缝尺寸",
-        "seamBlur": "接缝模糊",
-        "seamStrength": "接缝强度",
-        "seamSteps": "接缝步数",
+        "hiresOptim": "高分辨率优化",
+        "imageFit": "使生成图像长宽适配初始图像",
+        "codeformerFidelity": "保真度",
         "scaleBeforeProcessing": "处理前缩放",
         "scaledWidth": "缩放宽度",
         "scaledHeight": "缩放长度",
-        "infillMethod": "填充法",
+        "infillMethod": "填充方法",
         "tileSize": "方格尺寸",
         "boundingBoxHeader": "选择区域",
         "seamCorrectionHeader": "接缝修正",
         "infillScalingHeader": "内填充和缩放",
-        "img2imgStrength": "图像到图像强度",
+        "img2imgStrength": "图生图强度",
         "toggleLoopback": "切换环回",
-        "invoke": "Invoke",
-        "promptPlaceholder": "在这里输入提示。可以使用[反提示]、(加权)++、(减权)--、交换和混合(见文档)",
         "sendTo": "发送到",
-        "sendToImg2Img": "发送到图像到图像",
+        "sendToImg2Img": "发送到图生图",
         "sendToUnifiedCanvas": "发送到统一画布",
         "copyImageToLink": "复制图像链接",
         "downloadImage": "下载图像",
-        "openInViewer": "在视图中打开",
-        "closeViewer": "关闭视图",
+        "openInViewer": "在查看器中打开",
+        "closeViewer": "关闭查看器",
         "usePrompt": "使用提示",
         "useSeed": "使用种子",
         "useAll": "使用所有参数",
-        "useInitImg": "使用原图像",
+        "useInitImg": "使用初始图像",
         "info": "信息",
-        "deleteImage": "删除图像",
-        "initialImage": "原图像",
-        "showOptionsPanel": "显示选项浮窗"
+        "initialImage": "初始图像",
+        "showOptionsPanel": "显示侧栏浮窗 (O 或 T)",
+        "seamlessYAxis": "Y 轴",
+        "seamlessXAxis": "X 轴",
+        "boundingBoxWidth": "边界框宽度",
+        "boundingBoxHeight": "边界框高度",
+        "denoisingStrength": "去噪强度",
+        "vSymmetryStep": "纵向对称步数",
+        "cancel": {
+            "immediate": "立即取消",
+            "isScheduled": "取消中",
+            "schedule": "当前迭代后取消",
+            "setType": "设定取消类型",
+            "cancel": "取消"
+        },
+        "copyImage": "复制图片",
+        "showPreview": "显示预览",
+        "symmetry": "对称性",
+        "positivePromptPlaceholder": "正向提示词",
+        "negativePromptPlaceholder": "负向提示词",
+        "scheduler": "调度器",
+        "general": "通用",
+        "hiresStrength": "高分辨强度",
+        "hidePreview": "隐藏预览",
+        "hSymmetryStep": "横向对称步数",
+        "imageToImage": "图生图",
+        "noiseSettings": "噪音",
+        "controlNetControlMode": "控制模式",
+        "maskAdjustmentsHeader": "遮罩调整",
+        "maskBlur": "模糊",
+        "maskBlurMethod": "模糊方式",
+        "aspectRatio": "纵横比",
+        "seamLowThreshold": "降低",
+        "seamHighThreshold": "提升",
+        "invoke": {
+            "noNodesInGraph": "节点图中无节点",
+            "noModelSelected": "无已选中的模型",
+            "invoke": "调用",
+            "systemBusy": "系统繁忙",
+            "noInitialImageSelected": "无选中的初始图像",
+            "missingInputForField": "{{nodeLabel}} -> {{fieldLabel}} 缺失输入",
+            "unableToInvoke": "无法调用",
+            "systemDisconnected": "系统已断开连接",
+            "missingNodeTemplate": "缺失节点模板",
+            "missingFieldTemplate": "缺失模板",
+            "addingImagesTo": "添加图像到",
+            "noPrompts": "没有已生成的提示词",
+            "readyToInvoke": "准备调用",
+            "noControlImageForControlAdapter": "有 #{{number}} 个 Control Adapter 缺失控制图像",
+            "noModelForControlAdapter": "有 #{{number}} 个 Control Adapter 没有选择模型。",
+            "incompatibleBaseModelForControlAdapter": "有 #{{number}} 个 Control Adapter 模型与主模型不匹配。"
+        },
+        "patchmatchDownScaleSize": "缩小",
+        "coherenceSteps": "步数",
+        "clipSkip": "CLIP 跳过层",
+        "compositingSettingsHeader": "合成设置",
+        "useCpuNoise": "使用 CPU 噪声",
+        "coherenceStrength": "强度",
+        "enableNoiseSettings": "启用噪声设置",
+        "coherenceMode": "模式",
+        "cpuNoise": "CPU 噪声",
+        "gpuNoise": "GPU 噪声",
+        "clipSkipWithLayerCount": "CLIP 跳过 {{layerCount}} 层",
+        "coherencePassHeader": "一致性层",
+        "manualSeed": "手动设定种子",
+        "imageActions": "图像操作",
+        "randomSeed": "随机种子",
+        "iterations": "迭代数",
+        "isAllowedToUpscale": {
+            "useX2Model": "图像太大,无法使用 x4 模型,使用 x2 模型作为替代",
+            "tooLarge": "图像太大无法进行放大,请选择更小的图像"
+        },
+        "iterationsWithCount_other": "{{count}} 次迭代生成"
     },
     "settings": {
         "models": "模型",
-        "displayInProgress": "显示进行中的图像",
+        "displayInProgress": "显示处理中的图像",
         "saveSteps": "每n步保存图像",
         "confirmOnDelete": "删除时确认",
         "displayHelpIcons": "显示帮助按钮",
-        "useCanvasBeta": "使用测试版画布视图",
         "enableImageDebugging": "开启图像调试",
         "resetWebUI": "重置网页界面",
         "resetWebUIDesc1": "重置网页只会重置浏览器中缓存的图像和设置,不会删除任何图像。",
         "resetWebUIDesc2": "如果图像没有显示在图库中,或者其他东西不工作,请在GitHub上提交问题之前尝试重置。",
-        "resetComplete": "网页界面已重置。刷新页面以重新加载。"
+        "resetComplete": "网页界面已重置。",
+        "showProgressInViewer": "在查看器中展示过程图片",
+        "antialiasProgressImages": "对过程图像应用抗锯齿",
+        "generation": "生成",
+        "ui": "用户界面",
+        "useSlidersForAll": "对所有参数使用滑动条设置",
+        "general": "通用",
+        "consoleLogLevel": "日志等级",
+        "shouldLogToConsole": "终端日志",
+        "developer": "开发者",
+        "alternateCanvasLayout": "切换统一画布布局",
+        "enableNodesEditor": "启用节点编辑器",
+        "favoriteSchedulersPlaceholder": "没有偏好的采样算法",
+        "showAdvancedOptions": "显示进阶选项",
+        "favoriteSchedulers": "采样算法偏好",
+        "autoChangeDimensions": "更改时将宽/高更新为模型默认值",
+        "experimental": "实验性",
+        "beta": "Beta",
+        "clearIntermediates": "清除中间产物",
+        "clearIntermediatesDesc3": "您图库中的图像不会被删除。",
+        "clearIntermediatesDesc2": "中间产物图像是生成过程中产生的副产品,与图库中的结果图像不同。清除中间产物可释放磁盘空间。",
+        "intermediatesCleared_other": "已清除 {{number}} 个中间产物",
+        "clearIntermediatesDesc1": "清除中间产物会重置您的画布和 ControlNet 状态。",
+        "intermediatesClearedFailed": "清除中间产物时出现问题",
+        "noIntermediates": "没有可清除的中间产物"
     },
     "toast": {
         "tempFoldersEmptied": "临时文件夹已清空",
         "uploadFailed": "上传失败",
-        "uploadFailedMultipleImagesDesc": "多张图像被粘贴,同时只能上传一张图像",
         "uploadFailedUnableToLoadDesc": "无法加载文件",
-        "downloadImageStarted": "图像下载已开始",
+        "downloadImageStarted": "图像已开始下载",
         "imageCopied": "图像已复制",
         "imageLinkCopied": "图像链接已复制",
         "imageNotLoaded": "没有加载图像",
-        "imageNotLoadedDesc": "没有图像可供送往图像到图像界面",
+        "imageNotLoadedDesc": "找不到图片",
         "imageSavedToGallery": "图像已保存到图库",
         "canvasMerged": "画布已合并",
-        "sentToImageToImage": "已送往图像到图像",
-        "sentToUnifiedCanvas": "已送往统一画布",
+        "sentToImageToImage": "已发送到图生图",
+        "sentToUnifiedCanvas": "已发送到统一画布",
         "parametersSet": "参数已设定",
         "parametersNotSet": "参数未设定",
-        "parametersNotSetDesc": "此图像不存在元数据",
+        "parametersNotSetDesc": "此图像不存在元数据。",
         "parametersFailed": "加载参数失败",
-        "parametersFailedDesc": "加载初始图像失败",
+        "parametersFailedDesc": "加载初始图像失败。",
         "seedSet": "种子已设定",
         "seedNotSet": "种子未设定",
-        "seedNotSetDesc": "无法找到该图像的种子",
-        "promptSet": "提示已设定",
-        "promptNotSet": "提示未设定",
-        "promptNotSetDesc": "无法找到该图像的提示",
+        "seedNotSetDesc": "无法找到该图像的种子。",
+        "promptSet": "提示词已设定",
+        "promptNotSet": "提示词未设定",
+        "promptNotSetDesc": "无法找到该图像的提示词。",
         "upscalingFailed": "放大失败",
-        "faceRestoreFailed": "脸部修复失败",
+        "faceRestoreFailed": "面部修复失败",
         "metadataLoadFailed": "加载元数据失败",
         "initialImageSet": "初始图像已设定",
         "initialImageNotSet": "初始图像未设定",
-        "initialImageNotSetDesc": "无法加载初始图像"
+        "initialImageNotSetDesc": "无法加载初始图像",
+        "problemCopyingImageLink": "无法复制图片链接",
+        "uploadFailedInvalidUploadDesc": "必须是单张的 PNG 或 JPEG 图片",
+        "disconnected": "服务器断开",
+        "connected": "服务器连接",
+        "parameterSet": "参数已设定",
+        "parameterNotSet": "参数未设定",
+        "serverError": "服务器错误",
+        "canceled": "处理取消",
+        "nodesLoaded": "节点已加载",
+        "nodesSaved": "节点已保存",
+        "problemCopyingImage": "无法复制图像",
+        "nodesCorruptedGraph": "无法加载。节点图似乎已损坏。",
+        "nodesBrokenConnections": "无法加载。部分连接已断开。",
+        "nodesUnrecognizedTypes": "无法加载。节点图有无法识别的节点类型",
+        "nodesNotValidJSON": "无效的 JSON",
+        "nodesNotValidGraph": "无效的 InvokeAi 节点图",
+        "nodesCleared": "节点已清空",
+        "nodesLoadedFailed": "节点图加载失败",
+        "modelAddedSimple": "已添加模型",
+        "modelAdded": "已添加模型: {{modelName}}",
+        "imageSavingFailed": "图像保存失败",
+        "canvasSentControlnetAssets": "画布已发送到 ControlNet & 素材",
+        "problemCopyingCanvasDesc": "无法导出基础层",
+        "loadedWithWarnings": "已加载带有警告的工作流",
+        "setInitialImage": "设为初始图像",
+        "canvasCopiedClipboard": "画布已复制到剪贴板",
+        "setControlImage": "设为控制图像",
+        "setNodeField": "设为节点字段",
+        "problemSavingMask": "保存遮罩时出现问题",
+        "problemSavingCanvasDesc": "无法导出基础层",
+        "maskSavedAssets": "遮罩已保存到素材",
+        "modelAddFailed": "模型添加失败",
+        "problemDownloadingCanvas": "下载画布时出现问题",
+        "problemMergingCanvas": "合并画布时出现问题",
+        "setCanvasInitialImage": "设为画布初始图像",
+        "imageUploaded": "图像已上传",
+        "addedToBoard": "已添加到面板",
+        "workflowLoaded": "工作流已加载",
+        "problemImportingMaskDesc": "无法导出遮罩",
+        "problemCopyingCanvas": "复制画布时出现问题",
+        "problemSavingCanvas": "保存画布时出现问题",
+        "canvasDownloaded": "画布已下载",
+        "setIPAdapterImage": "设为 IP Adapter 图像",
+        "problemMergingCanvasDesc": "无法导出基础层",
+        "problemDownloadingCanvasDesc": "无法导出基础层",
+        "problemSavingMaskDesc": "无法导出遮罩",
+        "imageSaved": "图像已保存",
+        "maskSentControlnetAssets": "遮罩已发送到 ControlNet & 素材",
+        "canvasSavedGallery": "画布已保存到图库",
+        "imageUploadFailed": "图像上传失败",
+        "problemImportingMask": "导入遮罩时出现问题",
+        "baseModelChangedCleared_other": "基础模型已更改, 已清除或禁用 {{number}} 个不兼容的子模型"
     },
     "unifiedCanvas": {
         "layer": "图层",
         "base": "基础层",
-        "mask": "遮罩层层",
-        "maskingOptions": "遮罩层选项",
-        "enableMask": "启用遮罩层",
-        "preserveMaskedArea": "保留遮罩层区域",
-        "clearMask": "清除遮罩层",
+        "mask": "遮罩",
+        "maskingOptions": "遮罩选项",
+        "enableMask": "启用遮罩",
+        "preserveMaskedArea": "保留遮罩区域",
+        "clearMask": "清除遮罩",
         "brush": "刷子",
         "eraser": "橡皮擦",
         "fillBoundingBox": "填充选择区域",
@@ -455,10 +748,10 @@
         "autoSaveToGallery": "自动保存至图库",
         "saveBoxRegionOnly": "只保存框内区域",
         "limitStrokesToBox": "限制画笔在框内",
-        "showCanvasDebugInfo": "显示画布调试信息",
+        "showCanvasDebugInfo": "显示附加画布信息",
         "clearCanvasHistory": "清除画布历史",
         "clearHistory": "清除历史",
-        "clearCanvasHistoryMessage": "清除画布历史不会影响当前画布,但会不可撤销地清除所有撤销/重做历史!",
+        "clearCanvasHistoryMessage": "清除画布历史不会影响当前画布,但会不可撤销地清除所有撤销/重做历史。",
         "clearCanvasHistoryConfirm": "确认清除所有画布历史?",
         "emptyTempImageFolder": "清除临时文件夹",
         "emptyFolder": "清除文件夹",
@@ -480,7 +773,10 @@
         "betaClear": "清除",
         "betaDarkenOutside": "暗化外部区域",
         "betaLimitToBox": "限制在框内",
-        "betaPreserveMasked": "保留遮罩层"
+        "betaPreserveMasked": "保留遮罩层",
+        "antialiasing": "抗锯齿",
+        "showResultsOn": "显示结果 (开)",
+        "showResultsOff": "显示结果 (关)"
     },
     "accessibility": {
         "modelSelect": "模型选择",
@@ -490,13 +786,688 @@
         "useThisParameter": "使用此参数",
         "uploadImage": "上传图片",
         "previousImage": "上一张图片",
-        "copyMetadataJson": "复制JSON元数据",
-        "exitViewer": "退出视口(ExitViewer)",
+        "copyMetadataJson": "复制 JSON 元数据",
+        "exitViewer": "退出查看器",
         "zoomIn": "放大",
         "zoomOut": "缩小",
         "rotateCounterClockwise": "逆时针旋转",
         "rotateClockwise": "顺时针旋转",
         "flipHorizontally": "水平翻转",
-        "flipVertically": "垂直翻转"
+        "flipVertically": "垂直翻转",
+        "showOptionsPanel": "显示侧栏浮窗",
+        "toggleLogViewer": "切换日志查看器",
+        "modifyConfig": "修改配置",
+        "toggleAutoscroll": "切换自动缩放",
+        "menu": "菜单",
+        "showGalleryPanel": "显示图库浮窗",
+        "loadMore": "加载更多"
+    },
+    "ui": {
+        "showProgressImages": "显示处理中的图片",
+        "hideProgressImages": "隐藏处理中的图片",
+        "swapSizes": "XY 尺寸互换",
+        "lockRatio": "锁定纵横比"
+    },
+    "tooltip": {
+        "feature": {
+            "prompt": "这是提示词区域。提示词包括生成对象和风格术语。您也可以在提示词中添加权重(Token 的重要性),但命令行命令和参数不起作用。",
+            "imageToImage": "图生图模式加载任何图像作为初始图像,然后与提示词一起用于生成新图像。值越高,结果图像的变化就越大。可能的值为 0.0 到 1.0,建议的范围是 0.25 到 0.75",
+            "upscale": "使用 ESRGAN 可以在图片生成后立即放大图片。",
+            "variations": "尝试将变化值设置在 0.1 到 1.0 之间,以更改给定种子的结果。种子的变化在 0.1 到 0.3 之间会很有趣。",
+            "boundingBox": "边界框的高和宽的设定对文生图和图生图模式是一样的,只有边界框中的区域会被处理。",
+            "other": "这些选项将为 Invoke 启用替代处理模式。 \"无缝拼贴\" 将在输出中创建重复图案。\"高分辨率\" 是通过图生图进行两步生成:当您想要更大、更连贯且不带伪影的图像时,请使用此设置。这将比通常的文生图需要更长的时间。",
+            "faceCorrection": "使用 GFPGAN 或 Codeformer 进行人脸校正:该算法会检测图像中的人脸并纠正任何缺陷。较高的值将更改图像,并产生更有吸引力的人脸。在保留较高保真度的情况下使用 Codeformer 将导致更强的人脸校正,同时也会保留原始图像。",
+            "gallery": "图片库展示输出文件夹中的图片,设置和文件一起储存,可以通过内容菜单访问。",
+            "seed": "种子值影响形成图像的初始噪声。您可以使用以前图像中已存在的种子。 “噪声阈值”用于减轻在高 CFG 等级(尝试 0 - 10 范围)下的伪像,并使用 Perlin 在生成过程中添加 Perlin 噪声:这两者都可以为您的输出添加变化。",
+            "seamCorrection": "控制在画布上生成的图像之间出现的可见接缝的处理方式。",
+            "infillAndScaling": "管理填充方法(用于画布的遮罩或擦除区域)和缩放(对于较小的边界框大小非常有用)。"
+        }
+    },
+    "nodes": {
+        "zoomInNodes": "放大",
+        "resetWorkflowDesc": "是否确定要清空节点图?",
+        "resetWorkflow": "清空节点图",
+        "loadWorkflow": "读取节点图",
+        "zoomOutNodes": "缩小",
+        "resetWorkflowDesc2": "重置节点图将清除所有节点、边际和节点图详情.",
+        "reloadNodeTemplates": "重载节点模板",
+        "hideGraphNodes": "隐藏节点图信息",
+        "fitViewportNodes": "自适应视图",
+        "showMinimapnodes": "显示缩略图",
+        "hideMinimapnodes": "隐藏缩略图",
+        "showLegendNodes": "显示字段类型图例",
+        "hideLegendNodes": "隐藏字段类型图例",
+        "showGraphNodes": "显示节点图信息",
+        "downloadWorkflow": "下载节点图 JSON",
+        "workflowDescription": "简述",
+        "versionUnknown": " 未知版本",
+        "noNodeSelected": "无选中的节点",
+        "addNode": "添加节点",
+        "unableToValidateWorkflow": "无法验证工作流",
+        "noOutputRecorded": "无已记录输出",
+        "updateApp": "升级 App",
+        "colorCodeEdgesHelp": "根据连接区域对边缘编码颜色",
+        "workflowContact": "联系",
+        "animatedEdges": "边缘动效",
+        "nodeTemplate": "节点模板",
+        "pickOne": "选择一个",
+        "unableToLoadWorkflow": "无法验证工作流",
+        "snapToGrid": "对齐网格",
+        "noFieldsLinearview": "线性视图中未添加任何字段",
+        "nodeSearch": "检索节点",
+        "version": "版本",
+        "validateConnections": "验证连接和节点图",
+        "inputMayOnlyHaveOneConnection": "输入仅能有一个连接",
+        "notes": "节点",
+        "nodeOutputs": "节点输出",
+        "currentImageDescription": "在节点编辑器中显示当前图像",
+        "validateConnectionsHelp": "防止建立无效连接和调用无效节点图",
+        "problemSettingTitle": "设定标题时出现问题",
+        "noConnectionInProgress": "没有正在进行的连接",
+        "workflowVersion": "版本",
+        "noConnectionData": "无连接数据",
+        "fieldTypesMustMatch": "类型必须匹配",
+        "workflow": "工作流",
+        "unkownInvocation": "未知调用类型",
+        "animatedEdgesHelp": "为选中边缘和其连接的选中节点的边缘添加动画",
+        "unknownTemplate": "未知模板",
+        "removeLinearView": "从线性视图中移除",
+        "workflowTags": "标签",
+        "fullyContainNodesHelp": "节点必须完全位于选择框中才能被选中",
+        "workflowValidation": "工作流验证错误",
+        "noMatchingNodes": "无相匹配的节点",
+        "executionStateInProgress": "处理中",
+        "noFieldType": "无字段类型",
+        "executionStateError": "错误",
+        "executionStateCompleted": "已完成",
+        "workflowAuthor": "作者",
+        "currentImage": "当前图像",
+        "workflowName": "名称",
+        "cannotConnectInputToInput": "无法将输入连接到输入",
+        "workflowNotes": "节点",
+        "cannotConnectOutputToOutput": "无法将输出连接到输出",
+        "connectionWouldCreateCycle": "连接将创建一个循环",
+        "cannotConnectToSelf": "无法连接自己",
+        "notesDescription": "添加有关您的工作流的节点",
+        "unknownField": "未知",
+        "colorCodeEdges": "边缘颜色编码",
+        "unknownNode": "未知节点",
+        "addNodeToolTip": "添加节点 (Shift+A, Space)",
+        "loadingNodes": "加载节点中...",
+        "snapToGridHelp": "移动时将节点与网格对齐",
+        "workflowSettings": "工作流编辑器设置",
+        "booleanPolymorphicDescription": "一个布尔值合集。",
+        "scheduler": "调度器",
+        "inputField": "输入",
+        "controlFieldDescription": "节点间传递的控制信息。",
+        "skippingUnknownOutputType": "跳过未知类型的输出",
+        "latentsFieldDescription": "Latents 可以在节点间传递。",
+        "denoiseMaskFieldDescription": "去噪遮罩可以在节点间传递",
+        "missingTemplate": "缺失模板",
+        "outputSchemaNotFound": "未找到输出模式",
+        "latentsPolymorphicDescription": "Latents 可以在节点间传递。",
+        "colorFieldDescription": "一种 RGBA 颜色。",
+        "mainModelField": "模型",
+        "unhandledInputProperty": "未处理的输入属性",
+        "maybeIncompatible": "可能与已安装的不兼容",
+        "collectionDescription": "待办事项",
+        "skippingReservedFieldType": "跳过保留类型",
+        "booleanCollectionDescription": "一个布尔值合集。",
+        "sDXLMainModelFieldDescription": "SDXL 模型。",
+        "boardField": "面板",
+        "problemReadingWorkflow": "从图像读取工作流时出现问题",
+        "sourceNode": "源节点",
+        "nodeOpacity": "节点不透明度",
+        "collectionItemDescription": "待办事项",
+        "integerDescription": "整数是没有与小数点的数字。",
+        "outputField": "输出",
+        "skipped": "跳过",
+        "updateNode": "更新节点",
+        "sDXLRefinerModelFieldDescription": "待办事项",
+        "imagePolymorphicDescription": "一个图像合集。",
+        "doesNotExist": "不存在",
+        "unableToParseNode": "无法解析节点",
+        "controlCollection": "控制合集",
+        "collectionItem": "项目合集",
+        "controlCollectionDescription": "节点间传递的控制信息。",
+        "skippedReservedInput": "跳过保留的输入",
+        "outputFields": "输出",
+        "edge": "边缘",
+        "inputNode": "输入节点",
+        "enumDescription": "枚举 (Enums) 可能是多个选项的一个数值。",
+        "loRAModelFieldDescription": "待办事项",
+        "imageField": "图像",
+        "skippedReservedOutput": "跳过保留的输出",
+        "noWorkflow": "无工作流",
+        "colorCollectionDescription": "待办事项",
+        "colorPolymorphicDescription": "一个颜色合集。",
+        "sDXLMainModelField": "SDXL 模型",
+        "denoiseMaskField": "去噪遮罩",
+        "schedulerDescription": "待办事项",
+        "missingCanvaInitImage": "缺失画布初始图像",
+        "clipFieldDescription": "词元分析器和文本编码器的子模型。",
+        "noImageFoundState": "状态中未发现初始图像",
+        "nodeType": "节点类型",
+        "fullyContainNodes": "完全包含节点来进行选择",
+        "noOutputSchemaName": "在 ref 对象中找不到输出模式名称",
+        "vaeModelFieldDescription": "待办事项",
+        "skippingInputNoTemplate": "跳过无模板的输入",
+        "missingCanvaInitMaskImages": "缺失初始化画布和遮罩图像",
+        "problemReadingMetadata": "从图像读取元数据时出现问题",
+        "oNNXModelField": "ONNX 模型",
+        "node": "节点",
+        "skippingUnknownInputType": "跳过未知类型的输入",
+        "booleanDescription": "布尔值为真或为假。",
+        "collection": "合集",
+        "invalidOutputSchema": "无效的输出模式",
+        "boardFieldDescription": "图库面板",
+        "floatDescription": "浮点数是带小数点的数字。",
+        "unhandledOutputProperty": "未处理的输出属性",
+        "string": "字符串",
+        "inputFields": "输入",
+        "uNetFieldDescription": "UNet 子模型。",
+        "mismatchedVersion": "不匹配的版本",
+        "vaeFieldDescription": "Vae 子模型。",
+        "imageFieldDescription": "图像可以在节点间传递。",
+        "outputNode": "输出节点",
+        "mainModelFieldDescription": "待办事项",
+        "sDXLRefinerModelField": "Refiner 模型",
+        "unableToParseEdge": "无法解析边缘",
+        "latentsCollectionDescription": "Latents 可以在节点间传递。",
+        "oNNXModelFieldDescription": "ONNX 模型。",
+        "cannotDuplicateConnection": "无法创建重复的连接",
+        "ipAdapterModel": "IP-Adapter 模型",
+        "ipAdapterDescription": "图像提示词自适应 (IP-Adapter)。",
+        "ipAdapterModelDescription": "IP-Adapter 模型",
+        "floatCollectionDescription": "一个浮点数合集。",
+        "enum": "Enum (枚举)",
+        "integerPolymorphicDescription": "一个整数值合集。",
+        "float": "浮点",
+        "integer": "整数",
+        "colorField": "颜色",
+        "stringCollectionDescription": "一个字符串合集。",
+        "stringCollection": "字符串合集",
+        "uNetField": "UNet",
+        "integerCollection": "整数合集",
+        "vaeModelField": "VAE",
+        "integerCollectionDescription": "一个整数值合集。",
+        "clipField": "Clip",
+        "stringDescription": "字符串是指文本。",
+        "colorCollection": "一个颜色合集。",
+        "boolean": "布尔值",
+        "stringPolymorphicDescription": "一个字符串合集。",
+        "controlField": "控制信息",
+        "floatPolymorphicDescription": "一个浮点数合集。",
+        "vaeField": "Vae",
+        "floatCollection": "浮点合集",
+        "booleanCollection": "布尔值合集",
+        "imageCollectionDescription": "一个图像合集。",
+        "loRAModelField": "LoRA",
+        "imageCollection": "图像合集"
+    },
+    "controlnet": {
+        "resize": "直接缩放",
+        "showAdvanced": "显示高级",
+        "contentShuffleDescription": "随机打乱图像内容",
+        "importImageFromCanvas": "从画布导入图像",
+        "lineartDescription": "将图像转换为线稿",
+        "importMaskFromCanvas": "从画布导入遮罩",
+        "hideAdvanced": "隐藏高级",
+        "ipAdapterModel": "Adapter 模型",
+        "resetControlImage": "重置控制图像",
+        "beginEndStepPercent": "开始 / 结束步数百分比",
+        "mlsdDescription": "简洁的分割线段(直线)检测器",
+        "duplicate": "复制",
+        "balanced": "平衡",
+        "prompt": "Prompt (提示词控制)",
+        "depthMidasDescription": "使用 Midas 生成深度图",
+        "openPoseDescription": "使用 Openpose 进行人体姿态估计",
+        "resizeMode": "缩放模式",
+        "weight": "权重",
+        "selectModel": "选择一个模型",
+        "crop": "裁剪",
+        "processor": "处理器",
+        "none": "无",
+        "incompatibleBaseModel": "不兼容的基础模型:",
+        "enableControlnet": "启用 ControlNet",
+        "detectResolution": "检测分辨率",
+        "pidiDescription": "像素差分 (PIDI) 图像处理",
+        "controlMode": "控制模式",
+        "fill": "填充",
+        "cannyDescription": "Canny 边缘检测",
+        "colorMapDescription": "从图像生成一张颜色图",
+        "imageResolution": "图像分辨率",
+        "autoConfigure": "自动配置处理器",
+        "normalBaeDescription": "法线 BAE 处理",
+        "noneDescription": "不应用任何处理",
+        "saveControlImage": "保存控制图像",
+        "toggleControlNet": "开关此 ControlNet",
+        "delete": "删除",
+        "colorMapTileSize": "分块大小",
+        "ipAdapterImageFallback": "无已选择的 IP Adapter 图像",
+        "mediapipeFaceDescription": "使用 Mediapipe 检测面部",
+        "depthZoeDescription": "使用 Zoe 生成深度图",
+        "hedDescription": "整体嵌套边缘检测",
+        "setControlImageDimensions": "设定控制图像尺寸宽/高为",
+        "resetIPAdapterImage": "重置 IP Adapter 图像",
+        "handAndFace": "手部和面部",
+        "enableIPAdapter": "启用 IP Adapter",
+        "amult": "角度倍率 (a_mult)",
+        "bgth": "背景移除阈值 (bg_th)",
+        "lineartAnimeDescription": "动漫风格线稿处理",
+        "minConfidence": "最小置信度",
+        "lowThreshold": "弱判断阈值",
+        "highThreshold": "强判断阈值",
+        "addT2IAdapter": "添加 $t(common.t2iAdapter)",
+        "controlNetEnabledT2IDisabled": "$t(common.controlNet) 已启用, $t(common.t2iAdapter) 已禁用",
+        "t2iEnabledControlNetDisabled": "$t(common.t2iAdapter) 已启用, $t(common.controlNet) 已禁用",
+        "addControlNet": "添加 $t(common.controlNet)",
+        "controlNetT2IMutexDesc": "$t(common.controlNet) 和 $t(common.t2iAdapter) 目前不支持同时启用。",
+        "addIPAdapter": "添加 $t(common.ipAdapter)",
+        "safe": "保守模式",
+        "scribble": "草绘 (scribble)",
+        "maxFaces": "最大面部数",
+        "pidi": "PIDI",
+        "normalBae": "Normal BAE",
+        "hed": "HED",
+        "contentShuffle": "Content Shuffle",
+        "f": "F",
+        "h": "H",
+        "controlnet": "$t(controlnet.controlAdapter) #{{number}} ($t(common.controlNet))",
+        "control": "Control (普通控制)",
+        "coarse": "Coarse",
+        "depthMidas": "Depth (Midas)",
+        "w": "W",
+        "ip_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.ipAdapter))",
+        "mediapipeFace": "Mediapipe Face",
+        "mlsd": "M-LSD",
+        "lineart": "Lineart",
+        "t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.t2iAdapter))",
+        "megaControl": "Mega Control (超级控制)",
+        "depthZoe": "Depth (Zoe)",
+        "colorMap": "Color",
+        "openPose": "Openpose",
+        "controlAdapter": "Control Adapter",
+        "lineartAnime": "Lineart Anime",
+        "canny": "Canny"
+    },
+    "queue": {
+        "status": "状态",
+        "cancelTooltip": "取消当前项目",
+        "queueEmpty": "队列为空",
+        "pauseSucceeded": "处理器已暂停",
+        "in_progress": "处理中",
+        "queueFront": "添加到队列前",
+        "completed": "已完成",
+        "queueBack": "添加到队列",
+        "cancelFailed": "取消项目时出现问题",
+        "pauseFailed": "暂停处理器时出现问题",
+        "clearFailed": "清除队列时出现问题",
+        "clearSucceeded": "队列已清除",
+        "pause": "暂停",
+        "cancelSucceeded": "项目已取消",
+        "queue": "队列",
+        "batch": "批处理",
+        "clearQueueAlertDialog": "清除队列时会立即取消所有处理中的项目并且会完全清除队列。",
+        "pending": "待定",
+        "completedIn": "完成于",
+        "resumeFailed": "恢复处理器时出现问题",
+        "clear": "清除",
+        "prune": "修剪",
+        "total": "总计",
+        "canceled": "已取消",
+        "pruneFailed": "修剪队列时出现问题",
+        "cancelBatchSucceeded": "批处理已取消",
+        "clearTooltip": "取消并清除所有项目",
+        "current": "当前",
+        "pauseTooltip": "暂停处理器",
+        "failed": "已失败",
+        "cancelItem": "取消项目",
+        "next": "下一个",
+        "cancelBatch": "取消批处理",
+        "cancel": "取消",
+        "resumeSucceeded": "处理器已恢复",
+        "resumeTooltip": "恢复处理器",
+        "resume": "恢复",
+        "cancelBatchFailed": "取消批处理时出现问题",
+        "clearQueueAlertDialog2": "您确定要清除队列吗?",
+        "item": "项目",
+        "pruneSucceeded": "从队列修剪 {{item_count}} 个已完成的项目",
+        "notReady": "无法排队",
+        "batchFailedToQueue": "批次加入队列失败",
+        "batchValues": "批次数",
+        "queueCountPrediction": "添加 {{predicted}} 到队列",
+        "batchQueued": "加入队列的批次",
+        "queuedCount": "{{pending}} 待处理",
+        "front": "前",
+        "pruneTooltip": "修剪 {{item_count}} 个已完成的项目",
+        "batchQueuedDesc": "在队列的 {{direction}} 中添加了 {{item_count}} 个会话",
+        "graphQueued": "节点图已加入队列",
+        "back": "后",
+        "session": "会话",
+        "queueTotal": "总计 {{total}}",
+        "enqueueing": "队列中的批次",
+        "queueMaxExceeded": "超出最大值 {{max_queue_size}},将跳过 {{skip}}",
+        "graphFailedToQueue": "节点图加入队列失败"
+    },
+    "sdxl": {
+        "refinerStart": "Refiner 开始作用时机",
+        "selectAModel": "选择一个模型",
+        "scheduler": "调度器",
+        "cfgScale": "CFG 等级",
+        "negStylePrompt": "负向样式提示词",
+        "noModelsAvailable": "无可用模型",
+        "negAestheticScore": "负向美学评分",
+        "useRefiner": "启用 Refiner",
+        "denoisingStrength": "去噪强度",
+        "refinermodel": "Refiner 模型",
+        "posAestheticScore": "正向美学评分",
+        "concatPromptStyle": "连接提示词 & 样式",
+        "loading": "加载中...",
+        "steps": "步数",
+        "posStylePrompt": "正向样式提示词",
+        "refiner": "Refiner"
+    },
+    "metadata": {
+        "positivePrompt": "正向提示词",
+        "negativePrompt": "负向提示词",
+        "generationMode": "生成模式",
+        "Threshold": "噪声阈值",
+        "metadata": "元数据",
+        "strength": "图生图强度",
+        "seed": "种子",
+        "imageDetails": "图像详细信息",
+        "perlin": "Perlin 噪声",
+        "model": "模型",
+        "noImageDetails": "未找到图像详细信息",
+        "hiresFix": "高分辨率优化",
+        "cfgScale": "CFG 等级",
+        "initImage": "初始图像",
+        "height": "高度",
+        "variations": "(成对/第二)种子权重",
+        "noMetaData": "未找到元数据",
+        "width": "宽度",
+        "createdBy": "创建者是",
+        "workflow": "工作流",
+        "steps": "步数",
+        "scheduler": "调度器",
+        "seamless": "无缝",
+        "fit": "图生图适应"
+    },
+    "models": {
+        "noMatchingModels": "无相匹配的模型",
+        "loading": "加载中",
+        "noMatchingLoRAs": "无相匹配的 LoRA",
+        "noLoRAsAvailable": "无可用 LoRA",
+        "noModelsAvailable": "无可用模型",
+        "selectModel": "选择一个模型",
+        "selectLoRA": "选择一个 LoRA"
+    },
+    "boards": {
+        "autoAddBoard": "自动添加面板",
+        "topMessage": "该面板包含的图像正使用以下功能:",
+        "move": "移动",
+        "menuItemAutoAdd": "自动添加到该面板",
+        "myBoard": "我的面板",
+        "searchBoard": "检索面板...",
+        "noMatching": "没有相匹配的面板",
+        "selectBoard": "选择一个面板",
+        "cancel": "取消",
+        "addBoard": "添加面板",
+        "bottomMessage": "删除该面板并且将其对应的图像将重置当前使用该面板的所有功能。",
+        "uncategorized": "未分类",
+        "changeBoard": "更改面板",
+        "loading": "加载中...",
+        "clearSearch": "清除检索",
+        "downloadBoard": "下载面板"
+    },
+    "embedding": {
+        "noMatchingEmbedding": "不匹配的 Embedding",
+        "addEmbedding": "添加 Embedding",
+        "incompatibleModel": "不兼容的基础模型:"
+    },
+    "dynamicPrompts": {
+        "seedBehaviour": {
+            "perPromptDesc": "每次生成图像使用不同的种子",
+            "perIterationLabel": "每次迭代的种子",
+            "perIterationDesc": "每次迭代使用不同的种子",
+            "perPromptLabel": "每张图像的种子",
+            "label": "种子行为"
+        },
+        "enableDynamicPrompts": "启用动态提示词",
+        "combinatorial": "组合生成",
+        "maxPrompts": "最大提示词数",
+        "dynamicPrompts": "动态提示词",
+        "promptsWithCount_other": "{{count}} 个提示词"
+    },
+    "popovers": {
+        "compositingMaskAdjustments": {
+            "heading": "遮罩调整",
+            "paragraphs": [
+                "调整遮罩。"
+            ]
+        },
+        "paramRatio": {
+            "heading": "纵横比",
+            "paragraphs": [
+                "生成图像的尺寸纵横比。",
+                "图像尺寸(单位:像素)建议 SD 1.5 模型使用等效 512x512 的尺寸,SDXL 模型使用等效 1024x1024 的尺寸。"
+            ]
+        },
+        "compositingCoherenceSteps": {
+            "heading": "步数",
+            "paragraphs": [
+                "一致性层中使用的去噪步数。",
+                "与主参数中的步数相同。"
+            ]
+        },
+        "compositingBlur": {
+            "heading": "模糊",
+            "paragraphs": [
+                "遮罩模糊半径。"
+            ]
+        },
+        "noiseUseCPU": {
+            "heading": "使用 CPU 噪声",
+            "paragraphs": [
+                "选择由 CPU 或 GPU 生成噪声。",
+                "启用 CPU 噪声后,特定的种子将会在不同的设备上产生下相同的图像。",
+                "启用 CPU 噪声不会对性能造成影响。"
+            ]
+        },
+        "paramVAEPrecision": {
+            "heading": "VAE 精度",
+            "paragraphs": [
+                "VAE 编解码过程种使用的精度。FP16/半精度以微小的图像变化为代价提高效率。"
+            ]
+        },
+        "compositingCoherenceMode": {
+            "heading": "模式",
+            "paragraphs": [
+                "一致性层模式。"
+            ]
+        },
+        "controlNetResizeMode": {
+            "heading": "缩放模式",
+            "paragraphs": [
+                "ControlNet 输入图像适应输出图像大小的方法。"
+            ]
+        },
+        "clipSkip": {
+            "paragraphs": [
+                "选择要跳过 CLIP 模型多少层。",
+                "部分模型跳过特定数值的层时效果会更好。",
+                "较高的数值通常会导致图像细节更少。"
+            ],
+            "heading": "CLIP 跳过层"
+        },
+        "paramModel": {
+            "heading": "模型",
+            "paragraphs": [
+                "用于去噪过程的模型。",
+                "不同的模型一般会通过接受训练来专门产生特定的美学内容和结果。"
+            ]
+        },
+        "paramIterations": {
+            "heading": "迭代数",
+            "paragraphs": [
+                "生成图像的数量。",
+                "若启用动态提示词,每种提示词都会生成这么多次。"
+            ]
+        },
+        "compositingCoherencePass": {
+            "heading": "一致性层",
+            "paragraphs": [
+                "第二轮去噪有助于合成内补/外扩图像。"
+            ]
+        },
+        "compositingStrength": {
+            "heading": "强度",
+            "paragraphs": [
+                "一致性层使用的去噪强度。",
+                "去噪强度与图生图的参数相同。"
+            ]
+        },
+        "paramNegativeConditioning": {
+            "paragraphs": [
+                "生成过程会避免生成负向提示词中的概念。使用此选项来使输出排除部分质量或对象。",
+                "支持 Compel 语法 和 embeddings。"
+            ],
+            "heading": "负向提示词"
+        },
+        "compositingBlurMethod": {
+            "heading": "模糊方式",
+            "paragraphs": [
+                "应用于遮罩区域的模糊方法。"
+            ]
+        },
+        "paramScheduler": {
+            "heading": "调度器",
+            "paragraphs": [
+                "调度器 (采样器) 定义如何在图像迭代过程中添加噪声,或者定义如何根据一个模型的输出来更新采样。"
+            ]
+        },
+        "controlNetWeight": {
+            "heading": "权重",
+            "paragraphs": [
+                "ControlNet 对生成图像的影响强度。"
+            ]
+        },
+        "paramCFGScale": {
+            "heading": "CFG 等级",
+            "paragraphs": [
+                "控制提示词对生成过程的影响程度。"
+            ]
+        },
+        "paramSteps": {
+            "heading": "步数",
+            "paragraphs": [
+                "每次生成迭代执行的步数。",
+                "通常情况下步数越多结果越好,但需要更多生成时间。"
+            ]
+        },
+        "paramPositiveConditioning": {
+            "heading": "正向提示词",
+            "paragraphs": [
+                "引导生成过程。您可以使用任何单词或短语。",
+                "Compel 语法、动态提示词语法和 embeddings。"
+            ]
+        },
+        "lora": {
+            "heading": "LoRA 权重",
+            "paragraphs": [
+                "更高的 LoRA 权重会对最终图像产生更大的影响。"
+            ]
+        },
+        "infillMethod": {
+            "heading": "填充方法",
+            "paragraphs": [
+                "填充选定区域的方式。"
+            ]
+        },
+        "controlNetBeginEnd": {
+            "heading": "开始 / 结束步数百分比",
+            "paragraphs": [
+                "去噪过程中在哪部分步数应用 ControlNet。",
+                "在组合处理开始阶段应用 ControlNet,且在引导细节生成的结束阶段应用 ControlNet。"
+            ]
+        },
+        "scaleBeforeProcessing": {
+            "heading": "处理前缩放",
+            "paragraphs": [
+                "生成图像前将所选区域缩放为最适合模型的大小。"
+            ]
+        },
+        "paramDenoisingStrength": {
+            "heading": "去噪强度",
+            "paragraphs": [
+                "为输入图像添加的噪声量。",
+                "输入 0 会导致结果图像和输入完全相同,输入 1 则会生成全新的图像。"
+            ]
+        },
+        "paramSeed": {
+            "heading": "种子",
+            "paragraphs": [
+                "控制用于生成的起始噪声。",
+                "禁用 “随机种子” 来以相同设置生成相同的结果。"
+            ]
+        },
+        "controlNetControlMode": {
+            "heading": "控制模式",
+            "paragraphs": [
+                "给提示词或 ControlNet 增加更大的权重。"
+            ]
+        },
+        "dynamicPrompts": {
+            "paragraphs": [
+                "动态提示词可将单个提示词解析为多个。",
+                "基本语法示例:\"a {red|green|blue} ball\"。这会产生三种提示词:\"a red ball\", \"a green ball\" 和 \"a blue ball\"。",
+                "可以在单个提示词中多次使用该语法,但务必请使用最大提示词设置来控制生成的提示词数量。"
+            ],
+            "heading": "动态提示词"
+        },
+        "paramVAE": {
+            "paragraphs": [
+                "用于将 AI 输出转换成最终图像的模型。"
+            ],
+            "heading": "VAE"
+        },
+        "dynamicPromptsSeedBehaviour": {
+            "paragraphs": [
+                "控制生成提示词时种子的使用方式。",
+                "每次迭代过程都会使用一个唯一的种子。使用本选项来探索单个种子的提示词变化。",
+                "例如,如果你有 5 种提示词,则生成的每个图像都会使用相同种子。",
+                "为每张图像使用独立的唯一种子。这可以提供更多变化。"
+            ],
+            "heading": "种子行为"
+        },
+        "dynamicPromptsMaxPrompts": {
+            "heading": "最大提示词数量",
+            "paragraphs": [
+                "限制动态提示词可生成的提示词数量。"
+            ]
+        },
+        "controlNet": {
+            "paragraphs": [
+                "ControlNet 为生成过程提供引导,为生成具有受控构图、结构、样式的图像提供帮助,具体的功能由所选的模型决定。"
+            ],
+            "heading": "ControlNet"
+        }
+    },
+    "invocationCache": {
+        "disable": "禁用",
+        "misses": "缓存未中",
+        "enableFailed": "启用调用缓存时出现问题",
+        "invocationCache": "调用缓存",
+        "clearSucceeded": "调用缓存已清除",
+        "enableSucceeded": "调用缓存已启用",
+        "clearFailed": "清除调用缓存时出现问题",
+        "hits": "缓存命中",
+        "disableSucceeded": "调用缓存已禁用",
+        "disableFailed": "禁用调用缓存时出现问题",
+        "enable": "启用",
+        "clear": "清除",
+        "maxCacheSize": "最大缓存大小",
+        "cacheSize": "缓存大小"
     }
 }
diff --git a/invokeai/frontend/web/dist/locales/zh_Hant.json b/invokeai/frontend/web/dist/locales/zh_Hant.json
index 98b4882018..fe51856117 100644
--- a/invokeai/frontend/web/dist/locales/zh_Hant.json
+++ b/invokeai/frontend/web/dist/locales/zh_Hant.json
@@ -13,9 +13,6 @@
         "settingsLabel": "設定",
         "upload": "上傳",
         "langArabic": "阿拉伯語",
-        "greenTheme": "綠色",
-        "lightTheme": "淺色",
-        "darkTheme": "深色",
         "discordLabel": "Discord",
         "nodesDesc": "使用Node生成圖像的系統正在開發中。敬請期待有關於這項功能的更新。",
         "reportBugLabel": "回報錯誤",
@@ -33,6 +30,24 @@
         "langBrPortuguese": "巴西葡萄牙語",
         "langRussian": "俄語",
         "langSpanish": "西班牙語",
-        "unifiedCanvas": "統一畫布"
+        "unifiedCanvas": "統一畫布",
+        "cancel": "取消",
+        "langHebrew": "希伯來語",
+        "txt2img": "文字轉圖片"
+    },
+    "accessibility": {
+        "modelSelect": "選擇模型",
+        "invokeProgressBar": "Invoke 進度條",
+        "uploadImage": "上傳圖片",
+        "reset": "重設",
+        "nextImage": "下一張圖片",
+        "previousImage": "上一張圖片",
+        "flipHorizontally": "水平翻轉",
+        "useThisParameter": "使用此參數",
+        "zoomIn": "放大",
+        "zoomOut": "縮小",
+        "flipVertically": "垂直翻轉",
+        "modifyConfig": "修改配置",
+        "menu": "選單"
     }
 }
diff --git a/invokeai/frontend/web/package.json b/invokeai/frontend/web/package.json
index e5f1513c89..59e672544a 100644
--- a/invokeai/frontend/web/package.json
+++ b/invokeai/frontend/web/package.json
@@ -54,42 +54,42 @@
     ]
   },
   "dependencies": {
-    "@chakra-ui/anatomy": "^2.2.0",
-    "@chakra-ui/icons": "^2.1.0",
-    "@chakra-ui/react": "^2.8.0",
+    "@chakra-ui/anatomy": "^2.2.1",
+    "@chakra-ui/icons": "^2.1.1",
+    "@chakra-ui/react": "^2.8.1",
     "@chakra-ui/styled-system": "^2.9.1",
-    "@chakra-ui/theme-tools": "^2.1.0",
+    "@chakra-ui/theme-tools": "^2.1.1",
     "@dagrejs/graphlib": "^2.1.13",
     "@dnd-kit/core": "^6.0.8",
     "@dnd-kit/modifiers": "^6.0.1",
     "@dnd-kit/utilities": "^3.2.1",
     "@emotion/react": "^11.11.1",
     "@emotion/styled": "^11.11.0",
-    "@floating-ui/react-dom": "^2.0.1",
-    "@fontsource-variable/inter": "^5.0.8",
-    "@fontsource/inter": "^5.0.8",
+    "@floating-ui/react-dom": "^2.0.2",
+    "@fontsource-variable/inter": "^5.0.13",
+    "@fontsource/inter": "^5.0.13",
     "@mantine/core": "^6.0.19",
     "@mantine/form": "^6.0.19",
     "@mantine/hooks": "^6.0.19",
     "@nanostores/react": "^0.7.1",
-    "@reduxjs/toolkit": "^1.9.5",
-    "@roarr/browser-log-writer": "^1.1.5",
+    "@reduxjs/toolkit": "^1.9.7",
+    "@roarr/browser-log-writer": "^1.3.0",
     "@stevebel/png": "^1.5.1",
     "compare-versions": "^6.1.0",
     "dateformat": "^5.0.3",
-    "formik": "^2.4.3",
-    "framer-motion": "^10.16.1",
+    "formik": "^2.4.5",
+    "framer-motion": "^10.16.4",
     "fuse.js": "^6.6.2",
-    "i18next": "^23.4.4",
+    "i18next": "^23.5.1",
     "i18next-browser-languagedetector": "^7.0.2",
-    "i18next-http-backend": "^2.2.1",
-    "konva": "^9.2.0",
+    "i18next-http-backend": "^2.2.2",
+    "konva": "^9.2.2",
     "lodash-es": "^4.17.21",
     "nanostores": "^0.9.2",
     "new-github-issue-url": "^1.0.0",
-    "openapi-fetch": "^0.7.4",
-    "overlayscrollbars": "^2.2.0",
-    "overlayscrollbars-react": "^0.5.0",
+    "openapi-fetch": "^0.7.10",
+    "overlayscrollbars": "^2.3.2",
+    "overlayscrollbars-react": "^0.5.2",
     "patch-package": "^8.0.0",
     "query-string": "^8.1.0",
     "react": "^18.2.0",
@@ -98,25 +98,25 @@
     "react-dropzone": "^14.2.3",
     "react-error-boundary": "^4.0.11",
     "react-hotkeys-hook": "4.4.1",
-    "react-i18next": "^13.1.2",
-    "react-icons": "^4.10.1",
+    "react-i18next": "^13.3.0",
+    "react-icons": "^4.11.0",
     "react-konva": "^18.2.10",
-    "react-redux": "^8.1.2",
+    "react-redux": "^8.1.3",
     "react-resizable-panels": "^0.0.55",
     "react-use": "^17.4.0",
-    "react-virtuoso": "^4.5.0",
-    "react-zoom-pan-pinch": "^3.0.8",
-    "reactflow": "^11.8.3",
+    "react-virtuoso": "^4.6.1",
+    "react-zoom-pan-pinch": "^3.2.0",
+    "reactflow": "^11.9.3",
     "redux-dynamic-middlewares": "^2.2.0",
-    "redux-remember": "^4.0.1",
+    "redux-remember": "^4.0.4",
     "roarr": "^7.15.1",
-    "serialize-error": "^11.0.1",
+    "serialize-error": "^11.0.2",
     "socket.io-client": "^4.7.2",
-    "type-fest": "^4.2.0",
+    "type-fest": "^4.4.0",
     "use-debounce": "^9.0.4",
     "use-image": "^1.1.1",
-    "uuid": "^9.0.0",
-    "zod": "^3.22.2",
+    "uuid": "^9.0.1",
+    "zod": "^3.22.4",
     "zod-validation-error": "^1.5.0"
   },
   "peerDependencies": {
@@ -129,40 +129,40 @@
   "devDependencies": {
     "@chakra-ui/cli": "^2.4.1",
     "@types/dateformat": "^5.0.0",
-    "@types/lodash-es": "^4.14.194",
-    "@types/node": "^20.5.1",
-    "@types/react": "^18.2.20",
-    "@types/react-dom": "^18.2.6",
-    "@types/react-redux": "^7.1.25",
-    "@types/react-transition-group": "^4.4.6",
-    "@types/uuid": "^9.0.2",
-    "@typescript-eslint/eslint-plugin": "^6.4.1",
-    "@typescript-eslint/parser": "^6.4.1",
-    "@vitejs/plugin-react-swc": "^3.3.2",
-    "axios": "^1.4.0",
+    "@types/lodash-es": "^4.17.9",
+    "@types/node": "^20.8.6",
+    "@types/react": "^18.2.28",
+    "@types/react-dom": "^18.2.13",
+    "@types/react-redux": "^7.1.27",
+    "@types/react-transition-group": "^4.4.7",
+    "@types/uuid": "^9.0.5",
+    "@typescript-eslint/eslint-plugin": "^6.7.5",
+    "@typescript-eslint/parser": "^6.7.5",
+    "@vitejs/plugin-react-swc": "^3.4.0",
+    "axios": "^1.5.1",
     "babel-plugin-transform-imports": "^2.0.0",
-    "concurrently": "^8.2.0",
-    "eslint": "^8.47.0",
+    "concurrently": "^8.2.1",
+    "eslint": "^8.51.0",
     "eslint-config-prettier": "^9.0.0",
-    "eslint-plugin-prettier": "^5.0.0",
+    "eslint-plugin-prettier": "^5.0.1",
     "eslint-plugin-react": "^7.33.2",
     "eslint-plugin-react-hooks": "^4.6.0",
     "form-data": "^4.0.0",
     "husky": "^8.0.3",
-    "lint-staged": "^14.0.1",
+    "lint-staged": "^15.0.1",
     "madge": "^6.1.0",
     "openapi-types": "^12.1.3",
-    "openapi-typescript": "^6.5.2",
+    "openapi-typescript": "^6.7.0",
     "postinstall-postinstall": "^2.1.0",
-    "prettier": "^3.0.2",
+    "prettier": "^3.0.3",
     "rollup-plugin-visualizer": "^5.9.2",
     "ts-toolbelt": "^9.6.0",
     "typescript": "^5.2.2",
-    "vite": "^4.4.9",
+    "vite": "^4.4.11",
     "vite-plugin-css-injected-by-js": "^3.3.0",
-    "vite-plugin-dts": "^3.5.2",
+    "vite-plugin-dts": "^3.6.0",
     "vite-plugin-eslint": "^1.8.1",
-    "vite-tsconfig-paths": "^4.2.0",
+    "vite-tsconfig-paths": "^4.2.1",
     "yarn": "^1.22.19"
   }
 }
diff --git a/invokeai/frontend/web/public/locales/ar.json b/invokeai/frontend/web/public/locales/ar.json
index e5168da4a8..7354b21ea0 100644
--- a/invokeai/frontend/web/public/locales/ar.json
+++ b/invokeai/frontend/web/public/locales/ar.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "مفاتيح الأختصار",
-        "themeLabel": "الموضوع",
         "languagePickerLabel": "منتقي اللغة",
         "reportBugLabel": "بلغ عن خطأ",
         "settingsLabel": "إعدادات",
-        "darkTheme": "داكن",
-        "lightTheme": "فاتح",
-        "greenTheme": "أخضر",
         "img2img": "صورة إلى صورة",
         "unifiedCanvas": "لوحة موحدة",
         "nodes": "عقد",
@@ -57,7 +53,6 @@
         "maintainAspectRatio": "الحفاظ على نسبة الأبعاد",
         "autoSwitchNewImages": "التبديل التلقائي إلى الصور الجديدة",
         "singleColumnLayout": "تخطيط عمود واحد",
-        "pinGallery": "تثبيت المعرض",
         "allImagesLoaded": "تم تحميل جميع الصور",
         "loadMore": "تحميل المزيد",
         "noImagesInGallery": "لا توجد صور في المعرض"
@@ -342,7 +337,6 @@
         "cfgScale": "مقياس الإعداد الذاتي للجملة",
         "width": "عرض",
         "height": "ارتفاع",
-        "sampler": "مزج",
         "seed": "بذرة",
         "randomizeSeed": "تبديل بذرة",
         "shuffle": "تشغيل",
@@ -364,10 +358,6 @@
         "hiresOptim": "تحسين الدقة العالية",
         "imageFit": "ملائمة الصورة الأولية لحجم الخرج",
         "codeformerFidelity": "الوثوقية",
-        "seamSize": "حجم التشقق",
-        "seamBlur": "ضباب التشقق",
-        "seamStrength": "قوة التشقق",
-        "seamSteps": "خطوات التشقق",
         "scaleBeforeProcessing": "تحجيم قبل المعالجة",
         "scaledWidth": "العرض المحجوب",
         "scaledHeight": "الارتفاع المحجوب",
@@ -378,8 +368,6 @@
         "infillScalingHeader": "التعبئة والتحجيم",
         "img2imgStrength": "قوة صورة إلى صورة",
         "toggleLoopback": "تبديل الإعادة",
-        "invoke": "إطلاق",
-        "promptPlaceholder": "اكتب المحث هنا. [العلامات السلبية], (زيادة الوزن) ++, (نقص الوزن)--, التبديل و الخلط متاحة (انظر الوثائق)",
         "sendTo": "أرسل إلى",
         "sendToImg2Img": "أرسل إلى صورة إلى صورة",
         "sendToUnifiedCanvas": "أرسل إلى الخطوط الموحدة",
@@ -393,7 +381,6 @@
         "useAll": "استخدام الكل",
         "useInitImg": "استخدام الصورة الأولية",
         "info": "معلومات",
-        "deleteImage": "حذف الصورة",
         "initialImage": "الصورة الأولية",
         "showOptionsPanel": "إظهار لوحة الخيارات"
     },
@@ -403,7 +390,6 @@
         "saveSteps": "حفظ الصور كل n خطوات",
         "confirmOnDelete": "تأكيد عند الحذف",
         "displayHelpIcons": "عرض أيقونات المساعدة",
-        "useCanvasBeta": "استخدام مخطط الأزرار بيتا",
         "enableImageDebugging": "تمكين التصحيح عند التصوير",
         "resetWebUI": "إعادة تعيين واجهة الويب",
         "resetWebUIDesc1": "إعادة تعيين واجهة الويب يعيد فقط ذاكرة التخزين المؤقت للمتصفح لصورك وإعداداتك المذكورة. لا يحذف أي صور من القرص.",
@@ -413,7 +399,6 @@
     "toast": {
         "tempFoldersEmptied": "تم تفريغ مجلد المؤقت",
         "uploadFailed": "فشل التحميل",
-        "uploadFailedMultipleImagesDesc": "تم الصق صور متعددة، قد يتم تحميل صورة واحدة فقط في الوقت الحالي",
         "uploadFailedUnableToLoadDesc": "تعذر تحميل الملف",
         "downloadImageStarted": "بدأ تنزيل الصورة",
         "imageCopied": "تم نسخ الصورة",
diff --git a/invokeai/frontend/web/public/locales/de.json b/invokeai/frontend/web/public/locales/de.json
index cff09d46bb..9baa6eb6a2 100644
--- a/invokeai/frontend/web/public/locales/de.json
+++ b/invokeai/frontend/web/public/locales/de.json
@@ -1,12 +1,8 @@
 {
     "common": {
-        "themeLabel": "Thema",
         "languagePickerLabel": "Sprachauswahl",
         "reportBugLabel": "Fehler melden",
         "settingsLabel": "Einstellungen",
-        "darkTheme": "Dunkel",
-        "lightTheme": "Hell",
-        "greenTheme": "Grün",
         "img2img": "Bild zu Bild",
         "nodes": "Knoten",
         "langGerman": "Deutsch",
@@ -48,7 +44,6 @@
         "langEnglish": "Englisch",
         "langDutch": "Niederländisch",
         "langFrench": "Französisch",
-        "oceanTheme": "Ozean",
         "langItalian": "Italienisch",
         "langPortuguese": "Portogisisch",
         "langRussian": "Russisch",
@@ -76,7 +71,6 @@
         "maintainAspectRatio": "Seitenverhältnis beibehalten",
         "autoSwitchNewImages": "Automatisch zu neuen Bildern wechseln",
         "singleColumnLayout": "Einspaltiges Layout",
-        "pinGallery": "Galerie anpinnen",
         "allImagesLoaded": "Alle Bilder geladen",
         "loadMore": "Mehr laden",
         "noImagesInGallery": "Keine Bilder in der Galerie"
@@ -346,7 +340,6 @@
         "cfgScale": "CFG-Skala",
         "width": "Breite",
         "height": "Höhe",
-        "sampler": "Sampler",
         "randomizeSeed": "Zufälliger Seed",
         "shuffle": "Mischen",
         "noiseThreshold": "Rausch-Schwellenwert",
@@ -367,10 +360,6 @@
         "hiresOptim": "High-Res-Optimierung",
         "imageFit": "Ausgangsbild an Ausgabegröße anpassen",
         "codeformerFidelity": "Glaubwürdigkeit",
-        "seamSize": "Nahtgröße",
-        "seamBlur": "Nahtunschärfe",
-        "seamStrength": "Stärke der Naht",
-        "seamSteps": "Nahtstufen",
         "scaleBeforeProcessing": "Skalieren vor der Verarbeitung",
         "scaledWidth": "Skaliert W",
         "scaledHeight": "Skaliert H",
@@ -381,8 +370,6 @@
         "infillScalingHeader": "Infill und Skalierung",
         "img2imgStrength": "Bild-zu-Bild-Stärke",
         "toggleLoopback": "Toggle Loopback",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Prompt hier eingeben. [negative Token], (mehr Gewicht)++, (geringeres Gewicht)--, Tausch und Überblendung sind verfügbar (siehe Dokumente)",
         "sendTo": "Senden an",
         "sendToImg2Img": "Senden an Bild zu Bild",
         "sendToUnifiedCanvas": "Senden an Unified Canvas",
@@ -394,7 +381,6 @@
         "useSeed": "Seed verwenden",
         "useAll": "Alle verwenden",
         "useInitImg": "Ausgangsbild verwenden",
-        "deleteImage": "Bild löschen",
         "initialImage": "Ursprüngliches Bild",
         "showOptionsPanel": "Optionsleiste zeigen",
         "cancel": {
@@ -406,7 +392,6 @@
         "saveSteps": "Speichern der Bilder alle n Schritte",
         "confirmOnDelete": "Bestätigen beim Löschen",
         "displayHelpIcons": "Hilfesymbole anzeigen",
-        "useCanvasBeta": "Canvas Beta Layout verwenden",
         "enableImageDebugging": "Bild-Debugging aktivieren",
         "resetWebUI": "Web-Oberfläche zurücksetzen",
         "resetWebUIDesc1": "Das Zurücksetzen der Web-Oberfläche setzt nur den lokalen Cache des Browsers mit Ihren Bildern und gespeicherten Einstellungen zurück. Es werden keine Bilder von der Festplatte gelöscht.",
@@ -416,7 +401,6 @@
     "toast": {
         "tempFoldersEmptied": "Temp-Ordner geleert",
         "uploadFailed": "Hochladen fehlgeschlagen",
-        "uploadFailedMultipleImagesDesc": "Mehrere Bilder eingefügt, es kann nur ein Bild auf einmal hochgeladen werden",
         "uploadFailedUnableToLoadDesc": "Datei kann nicht geladen werden",
         "downloadImageStarted": "Bild wird heruntergeladen",
         "imageCopied": "Bild kopiert",
@@ -532,7 +516,6 @@
         "modifyConfig": "Optionen einstellen",
         "toggleAutoscroll": "Auroscroll ein/ausschalten",
         "toggleLogViewer": "Log Betrachter ein/ausschalten",
-        "showGallery": "Zeige Galerie",
         "showOptionsPanel": "Zeige Optionen",
         "reset": "Zurücksetzen",
         "nextImage": "Nächstes Bild",
diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json
index 0ccb332978..818f9f4fa9 100644
--- a/invokeai/frontend/web/public/locales/en.json
+++ b/invokeai/frontend/web/public/locales/en.json
@@ -38,16 +38,19 @@
         "searchBoard": "Search Boards...",
         "selectBoard": "Select a Board",
         "topMessage": "This board contains images used in the following features:",
-        "uncategorized": "Uncategorized"
+        "uncategorized": "Uncategorized",
+        "downloadBoard": "Download Board"
     },
     "common": {
         "accept": "Accept",
         "advanced": "Advanced",
         "areYouSure": "Are you sure?",
+        "auto": "Auto",
         "back": "Back",
         "batch": "Batch Manager",
         "cancel": "Cancel",
         "close": "Close",
+        "on": "On",
         "communityLabel": "Community",
         "controlNet": "ControlNet",
         "controlAdapter": "Control Adapter",
@@ -132,10 +135,11 @@
         "upload": "Upload"
     },
     "controlnet": {
-        "controlAdapter": "Control Adapter",
-        "controlnet": "$t(controlnet.controlAdapter) #{{number}} ($t(common.controlNet))",
-        "ip_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.ipAdapter))",
-        "t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.t2iAdapter))",
+        "controlAdapter_one": "Control Adapter",
+        "controlAdapter_other": "Control Adapters",
+        "controlnet": "$t(controlnet.controlAdapter_one) #{{number}} ($t(common.controlNet))",
+        "ip_adapter": "$t(controlnet.controlAdapter_one) #{{number}} ($t(common.ipAdapter))",
+        "t2i_adapter": "$t(controlnet.controlAdapter_one) #{{number}} ($t(common.t2iAdapter))",
         "addControlNet": "Add $t(common.controlNet)",
         "addIPAdapter": "Add $t(common.ipAdapter)",
         "addT2IAdapter": "Add $t(common.t2iAdapter)",
@@ -274,7 +278,8 @@
         "batchValues": "Batch Values",
         "notReady": "Unable to Queue",
         "batchQueued": "Batch Queued",
-        "batchQueuedDesc": "Added {{item_count}} sessions to {{direction}} of queue",
+        "batchQueuedDesc_one": "Added {{count}} sessions to {{direction}} of queue",
+        "batchQueuedDesc_other": "Added {{count}} sessions to {{direction}} of queue",
         "front": "front",
         "back": "back",
         "batchFailedToQueue": "Failed to Queue Batch",
@@ -323,7 +328,10 @@
         "showUploads": "Show Uploads",
         "singleColumnLayout": "Single Column Layout",
         "unableToLoad": "Unable to load Gallery",
-        "uploads": "Uploads"
+        "uploads": "Uploads",
+        "downloadSelection": "Download Selection",
+        "preparingDownload": "Preparing Download",
+        "preparingDownloadFailed": "Problem Preparing Download"
     },
     "hotkeys": {
         "acceptStagingImage": {
@@ -551,8 +559,10 @@
         "negativePrompt": "Negative Prompt",
         "noImageDetails": "No image details found",
         "noMetaData": "No metadata found",
+        "noRecallParameters": "No parameters to recall found",
         "perlin": "Perlin Noise",
         "positivePrompt": "Positive Prompt",
+        "recallParameters": "Recall Parameters",
         "scheduler": "Scheduler",
         "seamless": "Seamless",
         "seed": "Seed",
@@ -697,6 +707,7 @@
         "vae": "VAE",
         "vaeLocation": "VAE Location",
         "vaeLocationValidationMsg": "Path to where your VAE is located.",
+        "vaePrecision": "VAE Precision",
         "vaeRepoID": "VAE Repo ID",
         "vaeRepoIDValidationMsg": "Online repository of your VAE",
         "variant": "Variant",
@@ -917,6 +928,7 @@
     },
     "parameters": {
         "aspectRatio": "Aspect Ratio",
+        "aspectRatioFree": "Free",
         "boundingBoxHeader": "Bounding Box",
         "boundingBoxHeight": "Bounding Box Height",
         "boundingBoxWidth": "Bounding Box Width",
@@ -964,10 +976,10 @@
             "missingFieldTemplate": "Missing field template",
             "missingInputForField": "{{nodeLabel}} -> {{fieldLabel}} missing input",
             "missingNodeTemplate": "Missing node template",
-            "noControlImageForControlAdapter": "Control Adapter {{number}} has no control image",
+            "noControlImageForControlAdapter": "Control Adapter #{{number}} has no control image",
             "noInitialImageSelected": "No initial image selected",
-            "noModelForControlAdapter": "Control Adapter {{number}} has no model selected.",
-            "incompatibleBaseModelForControlAdapter": "Control Adapter {{number}} model is invalid with main model.",
+            "noModelForControlAdapter": "Control Adapter #{{number}} has no model selected.",
+            "incompatibleBaseModelForControlAdapter": "Control Adapter #{{number}} model is invalid with main model.",
             "noModelSelected": "No model selected",
             "noPrompts": "No prompts generated",
             "noNodesInGraph": "No nodes in graph",
@@ -1102,12 +1114,23 @@
         "showAdvancedOptions": "Show Advanced Options",
         "showProgressInViewer": "Show Progress Images in Viewer",
         "ui": "User Interface",
-        "useSlidersForAll": "Use Sliders For All Options"
+        "useSlidersForAll": "Use Sliders For All Options",
+        "clearIntermediatesDisabled": "Queue must be empty to clear intermediates",
+        "clearIntermediatesDesc1": "Clearing intermediates will reset your Canvas and ControlNet state.",
+        "clearIntermediatesDesc2": "Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space.",
+        "clearIntermediatesDesc3": "Your gallery images will not be deleted.",
+        "clearIntermediates": "Clear Intermediates",
+        "clearIntermediatesWithCount_one": "Clear {{count}} Intermediate",
+        "clearIntermediatesWithCount_other": "Clear {{count}} Intermediates",
+        "clearIntermediatesWithCount_zero": "No Intermediates to Clear",
+        "intermediatesCleared_one": "Cleared {{count}} Intermediate",
+        "intermediatesCleared_other": "Cleared {{count}} Intermediates",
+        "intermediatesClearedFailed": "Problem Clearing Intermediates"
     },
     "toast": {
         "addedToBoard": "Added to board",
-        "baseModelChangedCleared_one": "Base model changed, cleared or disabled {{number}} incompatible submodel",
-        "baseModelChangedCleared_many": "$t(toast.baseModelChangedCleared_one)s",
+        "baseModelChangedCleared_one": "Base model changed, cleared or disabled {{count}} incompatible submodel",
+        "baseModelChangedCleared_other": "Base model changed, cleared or disabled {{count}} incompatible submodels",
         "canceled": "Processing Canceled",
         "canvasCopiedClipboard": "Canvas Copied to Clipboard",
         "canvasDownloaded": "Canvas Downloaded",
diff --git a/invokeai/frontend/web/public/locales/es.json b/invokeai/frontend/web/public/locales/es.json
index d17cefaad2..8ff4c53165 100644
--- a/invokeai/frontend/web/public/locales/es.json
+++ b/invokeai/frontend/web/public/locales/es.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Atajos de teclado",
-        "themeLabel": "Tema",
         "languagePickerLabel": "Selector de idioma",
         "reportBugLabel": "Reportar errores",
         "settingsLabel": "Ajustes",
-        "darkTheme": "Oscuro",
-        "lightTheme": "Claro",
-        "greenTheme": "Verde",
         "img2img": "Imagen a Imagen",
         "unifiedCanvas": "Lienzo Unificado",
-        "nodes": "Nodos",
+        "nodes": "Editor del flujo de trabajo",
         "langSpanish": "Español",
         "nodesDesc": "Un sistema de generación de imágenes basado en nodos, actualmente se encuentra en desarrollo. Mantente pendiente a nuestras actualizaciones acerca de esta fabulosa funcionalidad.",
         "postProcessing": "Post-procesamiento",
@@ -19,7 +15,7 @@
         "postProcessDesc3": "La Interfaz de Línea de Comandos de Invoke AI ofrece muchas otras características, incluyendo -Embiggen-.",
         "training": "Entrenamiento",
         "trainingDesc1": "Un flujo de trabajo dedicado para el entrenamiento de sus propios -embeddings- y puntos de control utilizando Inversión Textual y Dreambooth desde la interfaz web.",
-        "trainingDesc2": "InvokeAI ya soporta el entrenamiento de -embeddings- personalizados utilizando la Inversión Textual mediante el script principal.",
+        "trainingDesc2": "InvokeAI ya admite el entrenamiento de incrustaciones personalizadas mediante la inversión textual mediante el script principal.",
         "upload": "Subir imagen",
         "close": "Cerrar",
         "load": "Cargar",
@@ -63,18 +59,27 @@
         "statusConvertingModel": "Convertir el modelo",
         "statusModelConverted": "Modelo adaptado",
         "statusMergingModels": "Fusionar modelos",
-        "oceanTheme": "Océano",
         "langPortuguese": "Portugués",
         "langKorean": "Coreano",
         "langHebrew": "Hebreo",
-        "pinOptionsPanel": "Pin del panel de opciones",
         "loading": "Cargando",
         "loadingInvokeAI": "Cargando invocar a la IA",
         "postprocessing": "Tratamiento posterior",
         "txt2img": "De texto a imagen",
         "accept": "Aceptar",
         "cancel": "Cancelar",
-        "linear": "Lineal"
+        "linear": "Lineal",
+        "random": "Aleatorio",
+        "generate": "Generar",
+        "openInNewTab": "Abrir en una nueva pestaña",
+        "dontAskMeAgain": "No me preguntes de nuevo",
+        "areYouSure": "¿Estas seguro?",
+        "imagePrompt": "Indicación de imagen",
+        "batch": "Administrador de lotes",
+        "darkMode": "Modo oscuro",
+        "lightMode": "Modo claro",
+        "modelManager": "Administrador de modelos",
+        "communityLabel": "Comunidad"
     },
     "gallery": {
         "generations": "Generaciones",
@@ -87,10 +92,15 @@
         "maintainAspectRatio": "Mantener relación de aspecto",
         "autoSwitchNewImages": "Auto seleccionar Imágenes nuevas",
         "singleColumnLayout": "Diseño de una columna",
-        "pinGallery": "Fijar galería",
         "allImagesLoaded": "Todas las imágenes cargadas",
         "loadMore": "Cargar más",
-        "noImagesInGallery": "Sin imágenes en la galería"
+        "noImagesInGallery": "No hay imágenes para mostrar",
+        "deleteImage": "Eliminar Imagen",
+        "deleteImageBin": "Las imágenes eliminadas se enviarán a la papelera de tu sistema operativo.",
+        "deleteImagePermanent": "Las imágenes eliminadas no se pueden restaurar.",
+        "images": "Imágenes",
+        "assets": "Activos",
+        "autoAssignBoardOnClick": "Asignación automática de tableros al hacer clic"
     },
     "hotkeys": {
         "keyboardShortcuts": "Atajos de teclado",
@@ -297,7 +307,12 @@
         "acceptStagingImage": {
             "title": "Aceptar imagen",
             "desc": "Aceptar la imagen actual en el área de preparación"
-        }
+        },
+        "addNodes": {
+            "title": "Añadir Nodos",
+            "desc": "Abre el menú para añadir nodos"
+        },
+        "nodesHotkeys": "Teclas de acceso rápido a los nodos"
     },
     "modelManager": {
         "modelManager": "Gestor de Modelos",
@@ -349,8 +364,8 @@
         "delete": "Eliminar",
         "deleteModel": "Eliminar Modelo",
         "deleteConfig": "Eliminar Configuración",
-        "deleteMsg1": "¿Estás seguro de querer eliminar esta entrada de modelo de InvokeAI?",
-        "deleteMsg2": "El checkpoint del modelo no se eliminará de tu disco. Puedes volver a añadirlo si lo deseas.",
+        "deleteMsg1": "¿Estás seguro de que deseas eliminar este modelo de InvokeAI?",
+        "deleteMsg2": "Esto eliminará el modelo del disco si está en la carpeta raíz de InvokeAI. Si está utilizando una ubicación personalizada, el modelo NO se eliminará del disco.",
         "safetensorModels": "SafeTensors",
         "addDiffuserModel": "Añadir difusores",
         "inpainting": "v1 Repintado",
@@ -369,8 +384,8 @@
         "convertToDiffusers": "Convertir en difusores",
         "convertToDiffusersHelpText1": "Este modelo se convertirá al formato 🧨 Difusores.",
         "convertToDiffusersHelpText2": "Este proceso sustituirá su entrada del Gestor de Modelos por la versión de Difusores del mismo modelo.",
-        "convertToDiffusersHelpText3": "Su archivo de puntos de control en el disco NO será borrado ni modificado de ninguna manera. Puede volver a añadir su punto de control al Gestor de Modelos si lo desea.",
-        "convertToDiffusersHelpText5": "Asegúrese de que dispone de suficiente espacio en disco. Los modelos suelen variar entre 4 GB y 7 GB de tamaño.",
+        "convertToDiffusersHelpText3": "Tu archivo del punto de control en el disco se eliminará si está en la carpeta raíz de InvokeAI. Si está en una ubicación personalizada, NO se eliminará.",
+        "convertToDiffusersHelpText5": "Por favor, asegúrate de tener suficiente espacio en el disco. Los modelos generalmente varían entre 2 GB y 7 GB de tamaño.",
         "convertToDiffusersHelpText6": "¿Desea transformar este modelo?",
         "convertToDiffusersSaveLocation": "Guardar ubicación",
         "v1": "v1",
@@ -409,7 +424,27 @@
         "pickModelType": "Elige el tipo de modelo",
         "v2_768": "v2 (768px)",
         "addDifference": "Añadir una diferencia",
-        "scanForModels": "Buscar modelos"
+        "scanForModels": "Buscar modelos",
+        "vae": "VAE",
+        "variant": "Variante",
+        "baseModel": "Modelo básico",
+        "modelConversionFailed": "Conversión al modelo fallida",
+        "selectModel": "Seleccionar un modelo",
+        "modelUpdateFailed": "Error al actualizar el modelo",
+        "modelsMergeFailed": "Fusión del modelo fallida",
+        "convertingModelBegin": "Convirtiendo el modelo. Por favor, espere.",
+        "modelDeleted": "Modelo eliminado",
+        "modelDeleteFailed": "Error al borrar el modelo",
+        "noCustomLocationProvided": "‐No se proporcionó una ubicación personalizada",
+        "importModels": "Importar los modelos",
+        "settings": "Ajustes",
+        "syncModels": "Sincronizar las plantillas",
+        "syncModelsDesc": "Si tus plantillas no están sincronizados con el backend, puedes actualizarlas usando esta opción. Esto suele ser útil en los casos en los que actualizas manualmente tu archivo models.yaml o añades plantillas a la carpeta raíz de InvokeAI después de que la aplicación haya arrancado.",
+        "modelsSynced": "Plantillas sincronizadas",
+        "modelSyncFailed": "La sincronización de la plantilla falló",
+        "loraModels": "LoRA",
+        "onnxModels": "Onnx",
+        "oliveModels": "Olives"
     },
     "parameters": {
         "images": "Imágenes",
@@ -417,10 +452,9 @@
         "cfgScale": "Escala CFG",
         "width": "Ancho",
         "height": "Alto",
-        "sampler": "Muestreo",
         "seed": "Semilla",
         "randomizeSeed": "Semilla aleatoria",
-        "shuffle": "Aleatorizar",
+        "shuffle": "Semilla aleatoria",
         "noiseThreshold": "Umbral de Ruido",
         "perlinNoise": "Ruido Perlin",
         "variations": "Variaciones",
@@ -439,10 +473,6 @@
         "hiresOptim": "Optimización de Alta Resolución",
         "imageFit": "Ajuste tamaño de imagen inicial al tamaño objetivo",
         "codeformerFidelity": "Fidelidad",
-        "seamSize": "Tamaño del parche",
-        "seamBlur": "Desenfoque del parche",
-        "seamStrength": "Fuerza del parche",
-        "seamSteps": "Pasos del parche",
         "scaleBeforeProcessing": "Redimensionar antes de procesar",
         "scaledWidth": "Ancho escalado",
         "scaledHeight": "Alto escalado",
@@ -453,8 +483,6 @@
         "infillScalingHeader": "Remplazo y escalado",
         "img2imgStrength": "Peso de Imagen a Imagen",
         "toggleLoopback": "Alternar Retroalimentación",
-        "invoke": "Invocar",
-        "promptPlaceholder": "Ingrese la entrada aquí. [símbolos negativos], (subir peso)++, (bajar peso)--, también disponible alternado y mezclado (ver documentación)",
         "sendTo": "Enviar a",
         "sendToImg2Img": "Enviar a Imagen a Imagen",
         "sendToUnifiedCanvas": "Enviar a Lienzo Unificado",
@@ -467,7 +495,6 @@
         "useAll": "Usar Todo",
         "useInitImg": "Usar Imagen Inicial",
         "info": "Información",
-        "deleteImage": "Eliminar Imagen",
         "initialImage": "Imagen Inicial",
         "showOptionsPanel": "Mostrar panel de opciones",
         "symmetry": "Simetría",
@@ -481,37 +508,72 @@
         },
         "copyImage": "Copiar la imagen",
         "general": "General",
-        "negativePrompts": "Preguntas negativas",
         "imageToImage": "Imagen a imagen",
         "denoisingStrength": "Intensidad de la eliminación del ruido",
         "hiresStrength": "Alta resistencia",
         "showPreview": "Mostrar la vista previa",
-        "hidePreview": "Ocultar la vista previa"
+        "hidePreview": "Ocultar la vista previa",
+        "noiseSettings": "Ruido",
+        "seamlessXAxis": "Eje x",
+        "seamlessYAxis": "Eje y",
+        "scheduler": "Programador",
+        "boundingBoxWidth": "Anchura del recuadro",
+        "boundingBoxHeight": "Altura del recuadro",
+        "positivePromptPlaceholder": "Prompt Positivo",
+        "negativePromptPlaceholder": "Prompt Negativo",
+        "controlNetControlMode": "Modo de control",
+        "clipSkip": "Omitir el CLIP",
+        "aspectRatio": "Relación",
+        "maskAdjustmentsHeader": "Ajustes de la máscara",
+        "maskBlur": "Difuminar",
+        "maskBlurMethod": "Método del desenfoque",
+        "seamHighThreshold": "Alto",
+        "seamLowThreshold": "Bajo",
+        "coherencePassHeader": "Parámetros de la coherencia",
+        "compositingSettingsHeader": "Ajustes de la composición",
+        "coherenceSteps": "Pasos",
+        "coherenceStrength": "Fuerza",
+        "patchmatchDownScaleSize": "Reducir a escala",
+        "coherenceMode": "Modo"
     },
     "settings": {
         "models": "Modelos",
-        "displayInProgress": "Mostrar imágenes en progreso",
+        "displayInProgress": "Mostrar las imágenes del progreso",
         "saveSteps": "Guardar imágenes cada n pasos",
         "confirmOnDelete": "Confirmar antes de eliminar",
         "displayHelpIcons": "Mostrar iconos de ayuda",
-        "useCanvasBeta": "Usar versión beta del Lienzo",
         "enableImageDebugging": "Habilitar depuración de imágenes",
         "resetWebUI": "Restablecer interfaz web",
         "resetWebUIDesc1": "Al restablecer la interfaz web, solo se restablece la caché local del navegador de sus imágenes y la configuración guardada. No se elimina ninguna imagen de su disco duro.",
         "resetWebUIDesc2": "Si las imágenes no se muestran en la galería o algo más no funciona, intente restablecer antes de reportar un incidente en GitHub.",
-        "resetComplete": "La interfaz web se ha restablecido. Actualice la página para recargarla.",
-        "useSlidersForAll": "Utilice controles deslizantes para todas las opciones"
+        "resetComplete": "Se ha restablecido la interfaz web.",
+        "useSlidersForAll": "Utilice controles deslizantes para todas las opciones",
+        "general": "General",
+        "consoleLogLevel": "Nivel del registro",
+        "shouldLogToConsole": "Registro de la consola",
+        "developer": "Desarrollador",
+        "antialiasProgressImages": "Imágenes del progreso de Antialias",
+        "showProgressInViewer": "Mostrar las imágenes del progreso en el visor",
+        "ui": "Interfaz del usuario",
+        "generation": "Generación",
+        "favoriteSchedulers": "Programadores favoritos",
+        "favoriteSchedulersPlaceholder": "No hay programadores favoritos",
+        "showAdvancedOptions": "Mostrar las opciones avanzadas",
+        "alternateCanvasLayout": "Diseño alternativo del lienzo",
+        "beta": "Beta",
+        "enableNodesEditor": "Activar el editor de nodos",
+        "experimental": "Experimental",
+        "autoChangeDimensions": "Actualiza W/H a los valores predeterminados del modelo cuando se modifica"
     },
     "toast": {
         "tempFoldersEmptied": "Directorio temporal vaciado",
         "uploadFailed": "Error al subir archivo",
-        "uploadFailedMultipleImagesDesc": "Únicamente se puede subir una imágen a la vez",
         "uploadFailedUnableToLoadDesc": "No se pudo cargar la imágen",
         "downloadImageStarted": "Descargando imágen",
         "imageCopied": "Imágen copiada",
         "imageLinkCopied": "Enlace de imágen copiado",
         "imageNotLoaded": "No se cargó la imágen",
-        "imageNotLoadedDesc": "No se encontró imagen para enviar al módulo Imagen a Imagen",
+        "imageNotLoadedDesc": "No se pudo encontrar la imagen",
         "imageSavedToGallery": "Imágen guardada en la galería",
         "canvasMerged": "Lienzo consolidado",
         "sentToImageToImage": "Enviar hacia Imagen a Imagen",
@@ -536,7 +598,21 @@
         "serverError": "Error en el servidor",
         "disconnected": "Desconectado del servidor",
         "canceled": "Procesando la cancelación",
-        "connected": "Conectado al servidor"
+        "connected": "Conectado al servidor",
+        "problemCopyingImageLink": "No se puede copiar el enlace de la imagen",
+        "uploadFailedInvalidUploadDesc": "Debe ser una sola imagen PNG o JPEG",
+        "parameterSet": "Conjunto de parámetros",
+        "parameterNotSet": "Parámetro no configurado",
+        "nodesSaved": "Nodos guardados",
+        "nodesLoadedFailed": "Error al cargar los nodos",
+        "nodesLoaded": "Nodos cargados",
+        "nodesCleared": "Nodos borrados",
+        "problemCopyingImage": "No se puede copiar la imagen",
+        "nodesNotValidJSON": "JSON no válido",
+        "nodesCorruptedGraph": "No se puede cargar. El gráfico parece estar dañado.",
+        "nodesUnrecognizedTypes": "No se puede cargar. El gráfico tiene tipos no reconocidos",
+        "nodesNotValidGraph": "Gráfico del nodo InvokeAI no válido",
+        "nodesBrokenConnections": "No se puede cargar. Algunas conexiones están rotas."
     },
     "tooltip": {
         "feature": {
@@ -610,7 +686,8 @@
         "betaClear": "Limpiar",
         "betaDarkenOutside": "Oscurecer fuera",
         "betaLimitToBox": "Limitar a caja",
-        "betaPreserveMasked": "Preservar área enmascarada"
+        "betaPreserveMasked": "Preservar área enmascarada",
+        "antialiasing": "Suavizado"
     },
     "accessibility": {
         "invokeProgressBar": "Activar la barra de progreso",
@@ -631,8 +708,30 @@
         "modifyConfig": "Modificar la configuración",
         "toggleAutoscroll": "Activar el autodesplazamiento",
         "toggleLogViewer": "Alternar el visor de registros",
-        "showGallery": "Mostrar galería",
-        "showOptionsPanel": "Mostrar el panel de opciones",
+        "showOptionsPanel": "Mostrar el panel lateral",
         "menu": "Menú"
+    },
+    "ui": {
+        "hideProgressImages": "Ocultar el progreso de la imagen",
+        "showProgressImages": "Mostrar el progreso de la imagen",
+        "swapSizes": "Cambiar los tamaños",
+        "lockRatio": "Proporción del bloqueo"
+    },
+    "nodes": {
+        "showGraphNodes": "Mostrar la superposición de los gráficos",
+        "zoomInNodes": "Acercar",
+        "hideMinimapnodes": "Ocultar el minimapa",
+        "fitViewportNodes": "Ajustar la vista",
+        "zoomOutNodes": "Alejar",
+        "hideGraphNodes": "Ocultar la superposición de los gráficos",
+        "hideLegendNodes": "Ocultar la leyenda del tipo de campo",
+        "showLegendNodes": "Mostrar la leyenda del tipo de campo",
+        "showMinimapnodes": "Mostrar el minimapa",
+        "reloadNodeTemplates": "Recargar las plantillas de nodos",
+        "loadWorkflow": "Cargar el flujo de trabajo",
+        "resetWorkflow": "Reiniciar e flujo de trabajo",
+        "resetWorkflowDesc": "¿Está seguro de que deseas restablecer este flujo de trabajo?",
+        "resetWorkflowDesc2": "Al reiniciar el flujo de trabajo se borrarán todos los nodos, aristas y detalles del flujo de trabajo.",
+        "downloadWorkflow": "Descargar el flujo de trabajo en un archivo JSON"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/fi.json b/invokeai/frontend/web/public/locales/fi.json
index a6edd6d8b8..cf7fc6701b 100644
--- a/invokeai/frontend/web/public/locales/fi.json
+++ b/invokeai/frontend/web/public/locales/fi.json
@@ -15,7 +15,6 @@
         "rotateCounterClockwise": "Kierrä vastapäivään",
         "rotateClockwise": "Kierrä myötäpäivään",
         "flipVertically": "Käännä pystysuoraan",
-        "showGallery": "Näytä galleria",
         "modifyConfig": "Muokkaa konfiguraatiota",
         "toggleAutoscroll": "Kytke automaattinen vieritys",
         "toggleLogViewer": "Kytke lokin katselutila",
@@ -34,18 +33,13 @@
         "hotkeysLabel": "Pikanäppäimet",
         "reportBugLabel": "Raportoi Bugista",
         "langPolish": "Puola",
-        "themeLabel": "Teema",
         "langDutch": "Hollanti",
         "settingsLabel": "Asetukset",
         "githubLabel": "Github",
-        "darkTheme": "Tumma",
-        "lightTheme": "Vaalea",
-        "greenTheme": "Vihreä",
         "langGerman": "Saksa",
         "langPortuguese": "Portugali",
         "discordLabel": "Discord",
         "langEnglish": "Englanti",
-        "oceanTheme": "Meren sininen",
         "langRussian": "Venäjä",
         "langUkranian": "Ukraina",
         "langSpanish": "Espanja",
@@ -79,7 +73,6 @@
         "statusGeneratingInpainting": "Generoidaan sisällemaalausta",
         "statusGeneratingOutpainting": "Generoidaan ulosmaalausta",
         "statusRestoringFaces": "Korjataan kasvoja",
-        "pinOptionsPanel": "Kiinnitä asetukset -paneeli",
         "loadingInvokeAI": "Ladataan Invoke AI:ta",
         "loading": "Ladataan",
         "statusGenerating": "Generoidaan",
@@ -95,7 +88,6 @@
         "galleryImageResetSize": "Resetoi koko",
         "maintainAspectRatio": "Säilytä kuvasuhde",
         "galleryImageSize": "Kuvan koko",
-        "pinGallery": "Kiinnitä galleria",
         "showGenerations": "Näytä generaatiot",
         "singleColumnLayout": "Yhden sarakkeen asettelu",
         "generations": "Generoinnit",
diff --git a/invokeai/frontend/web/public/locales/fr.json b/invokeai/frontend/web/public/locales/fr.json
index cf215d7d06..b7ab932fcc 100644
--- a/invokeai/frontend/web/public/locales/fr.json
+++ b/invokeai/frontend/web/public/locales/fr.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Raccourcis clavier",
-        "themeLabel": "Thème",
         "languagePickerLabel": "Sélecteur de langue",
         "reportBugLabel": "Signaler un bug",
         "settingsLabel": "Paramètres",
-        "darkTheme": "Sombre",
-        "lightTheme": "Clair",
-        "greenTheme": "Vert",
         "img2img": "Image en image",
         "unifiedCanvas": "Canvas unifié",
         "nodes": "Nœuds",
@@ -55,7 +51,6 @@
         "statusConvertingModel": "Conversion du modèle",
         "statusModelConverted": "Modèle converti",
         "loading": "Chargement",
-        "pinOptionsPanel": "Épingler la page d'options",
         "statusMergedModels": "Modèles mélangés",
         "txt2img": "Texte vers image",
         "postprocessing": "Post-Traitement"
@@ -71,7 +66,6 @@
         "maintainAspectRatio": "Maintenir le rapport d'aspect",
         "autoSwitchNewImages": "Basculer automatiquement vers de nouvelles images",
         "singleColumnLayout": "Mise en page en colonne unique",
-        "pinGallery": "Épingler la galerie",
         "allImagesLoaded": "Toutes les images chargées",
         "loadMore": "Charger plus",
         "noImagesInGallery": "Aucune image dans la galerie"
@@ -356,7 +350,6 @@
         "cfgScale": "CFG Echelle",
         "width": "Largeur",
         "height": "Hauteur",
-        "sampler": "Echantillonneur",
         "seed": "Graine",
         "randomizeSeed": "Graine Aléatoire",
         "shuffle": "Mélanger",
@@ -378,10 +371,6 @@
         "hiresOptim": "Optimisation Haute Résolution",
         "imageFit": "Ajuster Image Initiale à la Taille de Sortie",
         "codeformerFidelity": "Fidélité",
-        "seamSize": "Taille des Joints",
-        "seamBlur": "Flou des Joints",
-        "seamStrength": "Force des Joints",
-        "seamSteps": "Etapes des Joints",
         "scaleBeforeProcessing": "Echelle Avant Traitement",
         "scaledWidth": "Larg. Échelle",
         "scaledHeight": "Haut. Échelle",
@@ -392,8 +381,6 @@
         "infillScalingHeader": "Remplissage et Mise à l'Échelle",
         "img2imgStrength": "Force de l'Image à l'Image",
         "toggleLoopback": "Activer/Désactiver la Boucle",
-        "invoke": "Invoker",
-        "promptPlaceholder": "Tapez le prompt ici. [tokens négatifs], (poids positif)++, (poids négatif)--, swap et blend sont disponibles (voir les docs)",
         "sendTo": "Envoyer à",
         "sendToImg2Img": "Envoyer à Image à Image",
         "sendToUnifiedCanvas": "Envoyer au Canvas Unifié",
@@ -407,7 +394,6 @@
         "useAll": "Tout utiliser",
         "useInitImg": "Utiliser l'image initiale",
         "info": "Info",
-        "deleteImage": "Supprimer l'image",
         "initialImage": "Image initiale",
         "showOptionsPanel": "Afficher le panneau d'options"
     },
@@ -417,7 +403,6 @@
         "saveSteps": "Enregistrer les images tous les n étapes",
         "confirmOnDelete": "Confirmer la suppression",
         "displayHelpIcons": "Afficher les icônes d'aide",
-        "useCanvasBeta": "Utiliser la mise en page bêta de Canvas",
         "enableImageDebugging": "Activer le débogage d'image",
         "resetWebUI": "Réinitialiser l'interface Web",
         "resetWebUIDesc1": "Réinitialiser l'interface Web ne réinitialise que le cache local du navigateur de vos images et de vos paramètres enregistrés. Cela n'efface pas les images du disque.",
@@ -427,7 +412,6 @@
     "toast": {
         "tempFoldersEmptied": "Dossiers temporaires vidés",
         "uploadFailed": "Téléchargement échoué",
-        "uploadFailedMultipleImagesDesc": "Plusieurs images collées, peut uniquement télécharger une image à la fois",
         "uploadFailedUnableToLoadDesc": "Impossible de charger le fichier",
         "downloadImageStarted": "Téléchargement de l'image démarré",
         "imageCopied": "Image copiée",
@@ -538,6 +522,10 @@
         "useThisParameter": "Utiliser ce paramètre",
         "zoomIn": "Zoom avant",
         "zoomOut": "Zoom arrière",
-        "showOptionsPanel": "Montrer la page d'options"
+        "showOptionsPanel": "Montrer la page d'options",
+        "modelSelect": "Choix du modèle",
+        "invokeProgressBar": "Barre de Progression Invoke",
+        "copyMetadataJson": "Copie des métadonnées JSON",
+        "menu": "Menu"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/he.json b/invokeai/frontend/web/public/locales/he.json
index c9b4ff3b17..dfb5ea0360 100644
--- a/invokeai/frontend/web/public/locales/he.json
+++ b/invokeai/frontend/web/public/locales/he.json
@@ -107,13 +107,10 @@
     },
     "common": {
         "nodesDesc": "מערכת מבוססת צמתים עבור יצירת תמונות עדיין תחת פיתוח. השארו קשובים לעדכונים עבור הפיצ׳ר המדהים הזה.",
-        "themeLabel": "ערכת נושא",
         "languagePickerLabel": "בחירת שפה",
         "githubLabel": "גיטהאב",
         "discordLabel": "דיסקורד",
         "settingsLabel": "הגדרות",
-        "darkTheme": "חשוך",
-        "lightTheme": "מואר",
         "langEnglish": "אנגלית",
         "langDutch": "הולנדית",
         "langArabic": "ערבית",
@@ -155,7 +152,6 @@
         "statusMergedModels": "מודלים מוזגו",
         "hotkeysLabel": "מקשים חמים",
         "reportBugLabel": "דווח באג",
-        "greenTheme": "ירוק",
         "langItalian": "איטלקית",
         "upload": "העלאה",
         "langPolish": "פולנית",
@@ -384,7 +380,6 @@
         "maintainAspectRatio": "שמור על יחס רוחב-גובה",
         "autoSwitchNewImages": "החלף אוטומטית לתמונות חדשות",
         "singleColumnLayout": "תצוגת עמודה אחת",
-        "pinGallery": "הצמד גלריה",
         "allImagesLoaded": "כל התמונות נטענו",
         "loadMore": "טען עוד",
         "noImagesInGallery": "אין תמונות בגלריה",
@@ -399,7 +394,6 @@
         "cfgScale": "סולם CFG",
         "width": "רוחב",
         "height": "גובה",
-        "sampler": "דוגם",
         "seed": "זרע",
         "imageToImage": "תמונה לתמונה",
         "randomizeSeed": "זרע אקראי",
@@ -416,10 +410,6 @@
         "hiresOptim": "אופטימיזצית רזולוציה גבוהה",
         "hiresStrength": "חוזק רזולוציה גבוהה",
         "codeformerFidelity": "דבקות",
-        "seamSize": "גודל תפר",
-        "seamBlur": "טשטוש תפר",
-        "seamStrength": "חוזק תפר",
-        "seamSteps": "שלבי תפר",
         "scaleBeforeProcessing": "שנה קנה מידה לפני עיבוד",
         "scaledWidth": "קנה מידה לאחר שינוי W",
         "scaledHeight": "קנה מידה לאחר שינוי H",
@@ -432,14 +422,12 @@
         "symmetry": "סימטריה",
         "vSymmetryStep": "צעד סימטריה V",
         "hSymmetryStep": "צעד סימטריה H",
-        "invoke": "הפעלה",
         "cancel": {
             "schedule": "ביטול לאחר האיטרציה הנוכחית",
             "isScheduled": "מבטל",
             "immediate": "ביטול מיידי",
             "setType": "הגדר סוג ביטול"
         },
-        "negativePrompts": "בקשות שליליות",
         "sendTo": "שליחה אל",
         "copyImage": "העתקת תמונה",
         "downloadImage": "הורדת תמונה",
@@ -464,15 +452,12 @@
         "seamlessTiling": "ריצוף חלק",
         "img2imgStrength": "חוזק תמונה לתמונה",
         "initialImage": "תמונה ראשונית",
-        "copyImageToLink": "העתקת תמונה לקישור",
-        "deleteImage": "מחיקת תמונה",
-        "promptPlaceholder": "הקלד בקשה כאן. [אסימונים שליליים], (העלאת משקל)++ , (הורדת משקל)--, החלפה ומיזוג זמינים (ראה מסמכים)"
+        "copyImageToLink": "העתקת תמונה לקישור"
     },
     "settings": {
         "models": "מודלים",
         "displayInProgress": "הצגת תמונות בתהליך",
         "confirmOnDelete": "אישור בעת המחיקה",
-        "useCanvasBeta": "שימוש בגרסת ביתא של תצוגת הקנבס",
         "useSlidersForAll": "שימוש במחוונים לכל האפשרויות",
         "resetWebUI": "איפוס ממשק משתמש",
         "resetWebUIDesc1": "איפוס ממשק המשתמש האינטרנטי מאפס רק את המטמון המקומי של הדפדפן של התמונות וההגדרות שנשמרו. זה לא מוחק תמונות מהדיסק.",
@@ -484,7 +469,6 @@
     },
     "toast": {
         "uploadFailed": "העלאה נכשלה",
-        "uploadFailedMultipleImagesDesc": "תמונות מרובות הודבקו, ניתן להעלות תמונה אחת בלבד בכל פעם",
         "imageCopied": "התמונה הועתקה",
         "imageLinkCopied": "קישור תמונה הועתק",
         "imageNotLoadedDesc": "לא נמצאה תמונה לשליחה למודול תמונה לתמונה",
diff --git a/invokeai/frontend/web/public/locales/it.json b/invokeai/frontend/web/public/locales/it.json
index 4ac5b6831d..c69879cfcf 100644
--- a/invokeai/frontend/web/public/locales/it.json
+++ b/invokeai/frontend/web/public/locales/it.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Tasti di scelta rapida",
-        "themeLabel": "Tema",
-        "languagePickerLabel": "Seleziona lingua",
+        "languagePickerLabel": "Lingua",
         "reportBugLabel": "Segnala un errore",
         "settingsLabel": "Impostazioni",
-        "darkTheme": "Scuro",
-        "lightTheme": "Chiaro",
-        "greenTheme": "Verde",
         "img2img": "Immagine a Immagine",
         "unifiedCanvas": "Tela unificata",
-        "nodes": "Nodi",
+        "nodes": "Editor del flusso di lavoro",
         "langItalian": "Italiano",
         "nodesDesc": "Attualmente è in fase di sviluppo un sistema basato su nodi per la generazione di immagini. Resta sintonizzato per gli aggiornamenti su questa fantastica funzionalità.",
         "postProcessing": "Post-elaborazione",
@@ -19,7 +15,7 @@
         "postProcessDesc3": "L'interfaccia da riga di comando di 'Invoke AI' offre varie altre funzionalità tra cui Embiggen.",
         "training": "Addestramento",
         "trainingDesc1": "Un flusso di lavoro dedicato per addestrare i tuoi Incorporamenti e Checkpoint utilizzando Inversione Testuale e Dreambooth dall'interfaccia web.",
-        "trainingDesc2": "InvokeAI supporta già l'addestramento di incorporamenti personalizzati utilizzando l'inversione testuale utilizzando lo script principale.",
+        "trainingDesc2": "InvokeAI supporta già l'addestramento di incorporamenti personalizzati utilizzando l'inversione testuale tramite lo script principale.",
         "upload": "Caricamento",
         "close": "Chiudi",
         "load": "Carica",
@@ -31,14 +27,14 @@
         "statusProcessingCanceled": "Elaborazione annullata",
         "statusProcessingComplete": "Elaborazione completata",
         "statusGenerating": "Generazione in corso",
-        "statusGeneratingTextToImage": "Generazione da Testo a Immagine",
+        "statusGeneratingTextToImage": "Generazione Testo a Immagine",
         "statusGeneratingImageToImage": "Generazione da Immagine a Immagine",
         "statusGeneratingInpainting": "Generazione Inpainting",
         "statusGeneratingOutpainting": "Generazione Outpainting",
         "statusGenerationComplete": "Generazione completata",
         "statusIterationComplete": "Iterazione completata",
         "statusSavingImage": "Salvataggio dell'immagine",
-        "statusRestoringFaces": "Restaura i volti",
+        "statusRestoringFaces": "Restaura volti",
         "statusRestoringFacesGFPGAN": "Restaura volti (GFPGAN)",
         "statusRestoringFacesCodeFormer": "Restaura volti (CodeFormer)",
         "statusUpscaling": "Ampliamento",
@@ -65,16 +61,35 @@
         "statusConvertingModel": "Conversione Modello",
         "langKorean": "Coreano",
         "langPortuguese": "Portoghese",
-        "pinOptionsPanel": "Blocca il pannello Opzioni",
         "loading": "Caricamento in corso",
-        "oceanTheme": "Oceano",
         "langHebrew": "Ebraico",
         "loadingInvokeAI": "Caricamento Invoke AI",
         "postprocessing": "Post Elaborazione",
         "txt2img": "Testo a Immagine",
         "accept": "Accetta",
         "cancel": "Annulla",
-        "linear": "Lineare"
+        "linear": "Lineare",
+        "generate": "Genera",
+        "random": "Casuale",
+        "openInNewTab": "Apri in una nuova scheda",
+        "areYouSure": "Sei sicuro?",
+        "dontAskMeAgain": "Non chiedermelo più",
+        "imagePrompt": "Prompt Immagine",
+        "darkMode": "Modalità scura",
+        "lightMode": "Modalità chiara",
+        "batch": "Gestione Lotto",
+        "modelManager": "Gestore modello",
+        "communityLabel": "Comunità",
+        "nodeEditor": "Editor dei nodi",
+        "statusProcessing": "Elaborazione in corso",
+        "advanced": "Avanzate",
+        "imageFailedToLoad": "Impossibile caricare l'immagine",
+        "learnMore": "Per saperne di più",
+        "ipAdapter": "Adattatore IP",
+        "t2iAdapter": "Adattatore T2I",
+        "controlAdapter": "Adattatore di Controllo",
+        "controlNet": "ControlNet",
+        "auto": "Automatico"
     },
     "gallery": {
         "generations": "Generazioni",
@@ -87,10 +102,25 @@
         "maintainAspectRatio": "Mantenere le proporzioni",
         "autoSwitchNewImages": "Passaggio automatico a nuove immagini",
         "singleColumnLayout": "Layout a colonna singola",
-        "pinGallery": "Blocca la galleria",
         "allImagesLoaded": "Tutte le immagini caricate",
-        "loadMore": "Carica di più",
-        "noImagesInGallery": "Nessuna immagine nella galleria"
+        "loadMore": "Carica altro",
+        "noImagesInGallery": "Nessuna immagine da visualizzare",
+        "deleteImage": "Elimina l'immagine",
+        "deleteImagePermanent": "Le immagini eliminate non possono essere ripristinate.",
+        "deleteImageBin": "Le immagini eliminate verranno spostate nel Cestino del tuo sistema operativo.",
+        "images": "Immagini",
+        "assets": "Risorse",
+        "autoAssignBoardOnClick": "Assegna automaticamente la bacheca al clic",
+        "featuresWillReset": "Se elimini questa immagine, quelle funzionalità verranno immediatamente ripristinate.",
+        "loading": "Caricamento in corso",
+        "unableToLoad": "Impossibile caricare la Galleria",
+        "currentlyInUse": "Questa immagine è attualmente utilizzata nelle seguenti funzionalità:",
+        "copy": "Copia",
+        "download": "Scarica",
+        "setCurrentImage": "Imposta come immagine corrente",
+        "preparingDownload": "Preparazione del download",
+        "preparingDownloadFailed": "Problema durante la preparazione del download",
+        "downloadSelection": "Scarica gli elementi selezionati"
     },
     "hotkeys": {
         "keyboardShortcuts": "Tasti rapidi",
@@ -163,7 +193,7 @@
             "desc": "Mostra le informazioni sui metadati dell'immagine corrente"
         },
         "sendToImageToImage": {
-            "title": "Invia a da Immagine a Immagine",
+            "title": "Invia a Immagine a Immagine",
             "desc": "Invia l'immagine corrente a da Immagine a Immagine"
         },
         "deleteImage": {
@@ -297,6 +327,11 @@
         "acceptStagingImage": {
             "title": "Accetta l'immagine della sessione",
             "desc": "Accetta l'immagine dell'area della sessione corrente"
+        },
+        "nodesHotkeys": "Tasti di scelta rapida dei Nodi",
+        "addNodes": {
+            "title": "Aggiungi Nodi",
+            "desc": "Apre il menu Aggiungi Nodi"
         }
     },
     "modelManager": {
@@ -308,7 +343,7 @@
         "safetensorModels": "SafeTensor",
         "modelAdded": "Modello Aggiunto",
         "modelUpdated": "Modello Aggiornato",
-        "modelEntryDeleted": "Modello Rimosso",
+        "modelEntryDeleted": "Voce del modello eliminata",
         "cannotUseSpaces": "Impossibile utilizzare gli spazi",
         "addNew": "Aggiungi nuovo",
         "addNewModel": "Aggiungi nuovo Modello",
@@ -323,7 +358,7 @@
         "config": "Configurazione",
         "configValidationMsg": "Percorso del file di configurazione del modello.",
         "modelLocation": "Posizione del modello",
-        "modelLocationValidationMsg": "Percorso dove si trova il modello.",
+        "modelLocationValidationMsg": "Fornisci il percorso di una cartella locale in cui è archiviato il tuo modello di diffusori",
         "repo_id": "Repo ID",
         "repoIDValidationMsg": "Repository online del modello",
         "vaeLocation": "Posizione file VAE",
@@ -360,7 +395,7 @@
         "deleteModel": "Elimina modello",
         "deleteConfig": "Elimina configurazione",
         "deleteMsg1": "Sei sicuro di voler eliminare questo modello da InvokeAI?",
-        "deleteMsg2": "Questo non eliminerà il file Checkpoint del modello dal tuo disco. Puoi aggiungerlo nuovamente se lo desideri.",
+        "deleteMsg2": "Questo eliminerà il modello dal disco se si trova nella cartella principale di InvokeAI. Se utilizzi una cartella personalizzata, il modello NON verrà eliminato dal disco.",
         "formMessageDiffusersModelLocation": "Ubicazione modelli diffusori",
         "formMessageDiffusersModelLocationDesc": "Inseriscine almeno uno.",
         "formMessageDiffusersVAELocation": "Ubicazione file VAE",
@@ -369,7 +404,7 @@
         "convertToDiffusers": "Converti in Diffusori",
         "convertToDiffusersHelpText2": "Questo processo sostituirà la voce in Gestione Modelli con la versione Diffusori dello stesso modello.",
         "convertToDiffusersHelpText4": "Questo è un processo una tantum. Potrebbero essere necessari circa 30-60 secondi a seconda delle specifiche del tuo computer.",
-        "convertToDiffusersHelpText5": "Assicurati di avere spazio su disco sufficiente. I modelli generalmente variano tra 4 GB e 7 GB di dimensioni.",
+        "convertToDiffusersHelpText5": "Assicurati di avere spazio su disco sufficiente. I modelli generalmente variano tra 2 GB e 7 GB di dimensioni.",
         "convertToDiffusersHelpText6": "Vuoi convertire questo modello?",
         "convertToDiffusersSaveLocation": "Ubicazione salvataggio",
         "inpainting": "v1 Inpainting",
@@ -378,12 +413,12 @@
         "modelConverted": "Modello convertito",
         "sameFolder": "Stessa cartella",
         "invokeRoot": "Cartella InvokeAI",
-        "merge": "Fondere",
-        "modelsMerged": "Modelli fusi",
-        "mergeModels": "Fondi Modelli",
+        "merge": "Unisci",
+        "modelsMerged": "Modelli uniti",
+        "mergeModels": "Unisci Modelli",
         "modelOne": "Modello 1",
         "modelTwo": "Modello 2",
-        "mergedModelName": "Nome del modello fuso",
+        "mergedModelName": "Nome del modello unito",
         "alpha": "Alpha",
         "interpolationType": "Tipo di interpolazione",
         "mergedModelCustomSaveLocation": "Percorso personalizzato",
@@ -394,7 +429,7 @@
         "mergedModelSaveLocation": "Ubicazione salvataggio",
         "convertToDiffusersHelpText1": "Questo modello verrà convertito nel formato 🧨 Diffusore.",
         "custom": "Personalizzata",
-        "convertToDiffusersHelpText3": "Il tuo file checkpoint sul disco NON verrà comunque cancellato o modificato. Se lo desideri, puoi aggiungerlo di nuovo in Gestione Modelli.",
+        "convertToDiffusersHelpText3": "Il file checkpoint su disco SARÀ eliminato se si trova nella cartella principale di InvokeAI. Se si trova in una posizione personalizzata, NON verrà eliminato.",
         "v1": "v1",
         "pathToCustomConfig": "Percorso alla configurazione personalizzata",
         "modelThree": "Modello 3",
@@ -406,10 +441,40 @@
         "inverseSigmoid": "Sigmoide inverso",
         "v2_base": "v2 (512px)",
         "v2_768": "v2 (768px)",
-        "none": "niente",
+        "none": "nessuno",
         "addDifference": "Aggiungi differenza",
         "pickModelType": "Scegli il tipo di modello",
-        "scanForModels": "Cerca modelli"
+        "scanForModels": "Cerca modelli",
+        "variant": "Variante",
+        "baseModel": "Modello Base",
+        "vae": "VAE",
+        "modelUpdateFailed": "Aggiornamento del modello non riuscito",
+        "modelConversionFailed": "Conversione del modello non riuscita",
+        "modelsMergeFailed": "Unione modelli non riuscita",
+        "selectModel": "Seleziona Modello",
+        "modelDeleted": "Modello eliminato",
+        "modelDeleteFailed": "Impossibile eliminare il modello",
+        "noCustomLocationProvided": "Nessuna posizione personalizzata fornita",
+        "convertingModelBegin": "Conversione del modello. Attendere prego.",
+        "importModels": "Importa modelli",
+        "modelsSynced": "Modelli sincronizzati",
+        "modelSyncFailed": "Sincronizzazione modello non riuscita",
+        "settings": "Impostazioni",
+        "syncModels": "Sincronizza Modelli",
+        "syncModelsDesc": "Se i tuoi modelli non sono sincronizzati con il back-end, puoi aggiornarli utilizzando questa opzione. Questo è generalmente utile nei casi in cui aggiorni manualmente il tuo file models.yaml o aggiungi modelli alla cartella principale di InvokeAI dopo l'avvio dell'applicazione.",
+        "loraModels": "LoRA",
+        "oliveModels": "Olive",
+        "onnxModels": "ONNX",
+        "noModels": "Nessun modello trovato",
+        "predictionType": "Tipo di previsione (per modelli Stable Diffusion 2.x ed alcuni modelli Stable Diffusion 1.x)",
+        "quickAdd": "Aggiunta rapida",
+        "simpleModelDesc": "Fornire un percorso a un modello diffusori locale, un modello checkpoint/safetensor locale, un ID repository HuggingFace o un URL del modello checkpoint/diffusori.",
+        "advanced": "Avanzate",
+        "useCustomConfig": "Utilizza configurazione personalizzata",
+        "closeAdvanced": "Chiudi Avanzate",
+        "modelType": "Tipo di modello",
+        "customConfigFileLocation": "Posizione del file di configurazione personalizzato",
+        "vaePrecision": "Precisione VAE"
     },
     "parameters": {
         "images": "Immagini",
@@ -417,10 +482,9 @@
         "cfgScale": "Scala CFG",
         "width": "Larghezza",
         "height": "Altezza",
-        "sampler": "Campionatore",
         "seed": "Seme",
         "randomizeSeed": "Seme randomizzato",
-        "shuffle": "Casuale",
+        "shuffle": "Mescola il seme",
         "noiseThreshold": "Soglia del rumore",
         "perlinNoise": "Rumore Perlin",
         "variations": "Variazioni",
@@ -431,7 +495,7 @@
         "type": "Tipo",
         "strength": "Forza",
         "upscaling": "Ampliamento",
-        "upscale": "Amplia",
+        "upscale": "Amplia (Shift + U)",
         "upscaleImage": "Amplia Immagine",
         "scale": "Scala",
         "otherOptions": "Altre opzioni",
@@ -439,10 +503,6 @@
         "hiresOptim": "Ottimizzazione alta risoluzione",
         "imageFit": "Adatta l'immagine iniziale alle dimensioni di output",
         "codeformerFidelity": "Fedeltà",
-        "seamSize": "Dimensione della cucitura",
-        "seamBlur": "Sfocatura cucitura",
-        "seamStrength": "Forza della cucitura",
-        "seamSteps": "Passaggi di cucitura",
         "scaleBeforeProcessing": "Scala prima dell'elaborazione",
         "scaledWidth": "Larghezza ridimensionata",
         "scaledHeight": "Altezza ridimensionata",
@@ -453,10 +513,8 @@
         "infillScalingHeader": "Riempimento e ridimensionamento",
         "img2imgStrength": "Forza da Immagine a Immagine",
         "toggleLoopback": "Attiva/disattiva elaborazione ricorsiva",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Digita qui il prompt usando termini in lingua inglese. [token negativi], (aumenta il peso)++, (diminuisci il peso)--, scambia e fondi sono disponibili (consulta la documentazione)",
         "sendTo": "Invia a",
-        "sendToImg2Img": "Invia a da Immagine a Immagine",
+        "sendToImg2Img": "Invia a Immagine a Immagine",
         "sendToUnifiedCanvas": "Invia a Tela Unificata",
         "copyImageToLink": "Copia l'immagine nel collegamento",
         "downloadImage": "Scarica l'immagine",
@@ -467,54 +525,137 @@
         "useAll": "Usa Tutto",
         "useInitImg": "Usa l'immagine iniziale",
         "info": "Informazioni",
-        "deleteImage": "Elimina immagine",
         "initialImage": "Immagine iniziale",
-        "showOptionsPanel": "Mostra pannello opzioni",
+        "showOptionsPanel": "Mostra il pannello laterale (O o T)",
         "general": "Generale",
-        "denoisingStrength": "Forza riduzione rumore",
+        "denoisingStrength": "Forza di riduzione del rumore",
         "copyImage": "Copia immagine",
         "hiresStrength": "Forza Alta Risoluzione",
-        "negativePrompts": "Prompt Negativi",
         "imageToImage": "Immagine a Immagine",
         "cancel": {
             "schedule": "Annulla dopo l'iterazione corrente",
             "isScheduled": "Annullamento",
             "setType": "Imposta il tipo di annullamento",
-            "immediate": "Annulla immediatamente"
+            "immediate": "Annulla immediatamente",
+            "cancel": "Annulla"
         },
         "hSymmetryStep": "Passi Simmetria Orizzontale",
         "vSymmetryStep": "Passi Simmetria Verticale",
         "symmetry": "Simmetria",
         "hidePreview": "Nascondi l'anteprima",
-        "showPreview": "Mostra l'anteprima"
+        "showPreview": "Mostra l'anteprima",
+        "noiseSettings": "Rumore",
+        "seamlessXAxis": "Asse X",
+        "seamlessYAxis": "Asse Y",
+        "scheduler": "Campionatore",
+        "boundingBoxWidth": "Larghezza riquadro di delimitazione",
+        "boundingBoxHeight": "Altezza riquadro di delimitazione",
+        "positivePromptPlaceholder": "Prompt Positivo",
+        "negativePromptPlaceholder": "Prompt Negativo",
+        "controlNetControlMode": "Modalità di controllo",
+        "clipSkip": "CLIP Skip",
+        "aspectRatio": "Proporzioni",
+        "maskAdjustmentsHeader": "Regolazioni della maschera",
+        "maskBlur": "Sfocatura",
+        "maskBlurMethod": "Metodo di sfocatura",
+        "seamLowThreshold": "Basso",
+        "seamHighThreshold": "Alto",
+        "coherencePassHeader": "Passaggio di coerenza",
+        "coherenceSteps": "Passi",
+        "coherenceStrength": "Forza",
+        "compositingSettingsHeader": "Impostazioni di composizione",
+        "patchmatchDownScaleSize": "Ridimensiona",
+        "coherenceMode": "Modalità",
+        "invoke": {
+            "noNodesInGraph": "Nessun nodo nel grafico",
+            "noModelSelected": "Nessun modello selezionato",
+            "noPrompts": "Nessun prompt generato",
+            "noInitialImageSelected": "Nessuna immagine iniziale selezionata",
+            "readyToInvoke": "Pronto per invocare",
+            "addingImagesTo": "Aggiungi immagini a",
+            "systemBusy": "Sistema occupato",
+            "unableToInvoke": "Impossibile invocare",
+            "systemDisconnected": "Sistema disconnesso",
+            "noControlImageForControlAdapter": "L'adattatore di controllo #{{number}} non ha un'immagine di controllo",
+            "noModelForControlAdapter": "Nessun modello selezionato per l'adattatore di controllo #{{number}}.",
+            "incompatibleBaseModelForControlAdapter": "Il modello dell'adattatore di controllo #{{number}} non è compatibile con il modello principale.",
+            "missingNodeTemplate": "Modello di nodo mancante",
+            "missingInputForField": "{{nodeLabel}} -> {{fieldLabel}} ingresso mancante",
+            "missingFieldTemplate": "Modello di campo mancante"
+        },
+        "enableNoiseSettings": "Abilita le impostazioni del rumore",
+        "cpuNoise": "Rumore CPU",
+        "gpuNoise": "Rumore GPU",
+        "useCpuNoise": "Usa la CPU per generare rumore",
+        "manualSeed": "Seme manuale",
+        "randomSeed": "Seme casuale",
+        "iterations": "Iterazioni",
+        "iterationsWithCount_one": "{{count}} Iterazione",
+        "iterationsWithCount_many": "{{count}} Iterazioni",
+        "iterationsWithCount_other": "{{count}} Iterazioni",
+        "seamlessX&Y": "Senza cuciture X & Y",
+        "isAllowedToUpscale": {
+            "useX2Model": "L'immagine è troppo grande per l'ampliamento con il modello x4, utilizza il modello x2",
+            "tooLarge": "L'immagine è troppo grande per l'ampliamento, seleziona un'immagine più piccola"
+        },
+        "seamlessX": "Senza cuciture X",
+        "seamlessY": "Senza cuciture Y",
+        "imageActions": "Azioni Immagine",
+        "aspectRatioFree": "Libere"
     },
     "settings": {
         "models": "Modelli",
-        "displayInProgress": "Visualizza immagini in corso",
+        "displayInProgress": "Visualizza le immagini di avanzamento",
         "saveSteps": "Salva le immagini ogni n passaggi",
         "confirmOnDelete": "Conferma l'eliminazione",
         "displayHelpIcons": "Visualizza le icone della Guida",
-        "useCanvasBeta": "Utilizza il layout beta di Canvas",
         "enableImageDebugging": "Abilita il debug dell'immagine",
         "resetWebUI": "Reimposta l'interfaccia utente Web",
         "resetWebUIDesc1": "Il ripristino dell'interfaccia utente Web reimposta solo la cache locale del browser delle immagini e le impostazioni memorizzate. Non cancella alcuna immagine dal disco.",
         "resetWebUIDesc2": "Se le immagini non vengono visualizzate nella galleria o qualcos'altro non funziona, prova a reimpostare prima di segnalare un problema su GitHub.",
-        "resetComplete": "L'interfaccia utente Web è stata reimpostata. Aggiorna la pagina per ricaricarla.",
-        "useSlidersForAll": "Usa i cursori per tutte le opzioni"
+        "resetComplete": "L'interfaccia utente Web è stata reimpostata.",
+        "useSlidersForAll": "Usa i cursori per tutte le opzioni",
+        "general": "Generale",
+        "consoleLogLevel": "Livello del registro",
+        "shouldLogToConsole": "Registrazione della console",
+        "developer": "Sviluppatore",
+        "antialiasProgressImages": "Anti aliasing delle immagini di avanzamento",
+        "showProgressInViewer": "Mostra le immagini di avanzamento nel visualizzatore",
+        "generation": "Generazione",
+        "ui": "Interfaccia Utente",
+        "favoriteSchedulersPlaceholder": "Nessun campionatore preferito",
+        "favoriteSchedulers": "Campionatori preferiti",
+        "showAdvancedOptions": "Mostra Opzioni Avanzate",
+        "alternateCanvasLayout": "Layout alternativo della tela",
+        "beta": "Beta",
+        "enableNodesEditor": "Abilita l'editor dei nodi",
+        "experimental": "Sperimentale",
+        "autoChangeDimensions": "Aggiorna L/A alle impostazioni predefinite del modello in caso di modifica",
+        "clearIntermediates": "Cancella le immagini intermedie",
+        "clearIntermediatesDesc3": "Le immagini della galleria non verranno eliminate.",
+        "clearIntermediatesDesc2": "Le immagini intermedie sono sottoprodotti della generazione, diversi dalle immagini risultanti nella galleria. La cancellazione degli intermedi libererà spazio su disco.",
+        "intermediatesCleared_one": "Cancellata {{count}} immagine intermedia",
+        "intermediatesCleared_many": "Cancellate {{count}} immagini intermedie",
+        "intermediatesCleared_other": "Cancellate {{count}} immagini intermedie",
+        "clearIntermediatesDesc1": "La cancellazione delle immagini intermedie ripristinerà lo stato di Tela Unificata e ControlNet.",
+        "intermediatesClearedFailed": "Problema con la cancellazione delle immagini intermedie",
+        "clearIntermediatesWithCount_one": "Cancella {{count}} immagine intermedia",
+        "clearIntermediatesWithCount_many": "Cancella {{count}} immagini intermedie",
+        "clearIntermediatesWithCount_other": "Cancella {{count}} immagini intermedie",
+        "clearIntermediatesDisabled": "La coda deve essere vuota per cancellare le immagini intermedie"
     },
     "toast": {
         "tempFoldersEmptied": "Cartella temporanea svuotata",
         "uploadFailed": "Caricamento fallito",
-        "uploadFailedMultipleImagesDesc": "Più immagini incollate, si può caricare solo un'immagine alla volta",
         "uploadFailedUnableToLoadDesc": "Impossibile caricare il file",
         "downloadImageStarted": "Download dell'immagine avviato",
         "imageCopied": "Immagine copiata",
         "imageLinkCopied": "Collegamento immagine copiato",
         "imageNotLoaded": "Nessuna immagine caricata",
-        "imageNotLoadedDesc": "Nessuna immagine trovata da inviare al modulo da Immagine a Immagine",
+        "imageNotLoadedDesc": "Impossibile trovare l'immagine",
         "imageSavedToGallery": "Immagine salvata nella Galleria",
         "canvasMerged": "Tela unita",
-        "sentToImageToImage": "Inviato a da Immagine a Immagine",
+        "sentToImageToImage": "Inviato a Immagine a Immagine",
         "sentToUnifiedCanvas": "Inviato a Tela Unificata",
         "parametersSet": "Parametri impostati",
         "parametersNotSet": "Parametri non impostati",
@@ -536,7 +677,57 @@
         "serverError": "Errore del Server",
         "disconnected": "Disconnesso dal Server",
         "connected": "Connesso al Server",
-        "canceled": "Elaborazione annullata"
+        "canceled": "Elaborazione annullata",
+        "problemCopyingImageLink": "Impossibile copiare il collegamento dell'immagine",
+        "uploadFailedInvalidUploadDesc": "Deve essere una singola immagine PNG o JPEG",
+        "parameterSet": "Parametro impostato",
+        "parameterNotSet": "Parametro non impostato",
+        "nodesLoadedFailed": "Impossibile caricare i nodi",
+        "nodesSaved": "Nodi salvati",
+        "nodesLoaded": "Nodi caricati",
+        "nodesCleared": "Nodi cancellati",
+        "problemCopyingImage": "Impossibile copiare l'immagine",
+        "nodesNotValidGraph": "Grafico del nodo InvokeAI non valido",
+        "nodesCorruptedGraph": "Impossibile caricare. Il grafico sembra essere danneggiato.",
+        "nodesUnrecognizedTypes": "Impossibile caricare. Il grafico ha tipi di dati non riconosciuti",
+        "nodesNotValidJSON": "JSON non valido",
+        "nodesBrokenConnections": "Impossibile caricare. Alcune connessioni sono interrotte.",
+        "baseModelChangedCleared_one": "Il modello base è stato modificato, cancellato o disabilitato {{count}} sotto-modello incompatibile",
+        "baseModelChangedCleared_many": "Il modello base è stato modificato, cancellato o disabilitato {{count}} sotto-modelli incompatibili",
+        "baseModelChangedCleared_other": "Il modello base è stato modificato, cancellato o disabilitato {{count}} sotto-modelli incompatibili",
+        "imageSavingFailed": "Salvataggio dell'immagine non riuscito",
+        "canvasSentControlnetAssets": "Tela inviata a ControlNet & Risorse",
+        "problemCopyingCanvasDesc": "Impossibile copiare la tela",
+        "loadedWithWarnings": "Flusso di lavoro caricato con avvisi",
+        "canvasCopiedClipboard": "Tela copiata negli appunti",
+        "maskSavedAssets": "Maschera salvata nelle risorse",
+        "modelAddFailed": "Aggiunta del modello non riuscita",
+        "problemDownloadingCanvas": "Problema durante il download della tela",
+        "problemMergingCanvas": "Problema nell'unione delle tele",
+        "imageUploaded": "Immagine caricata",
+        "addedToBoard": "Aggiunto alla bacheca",
+        "modelAddedSimple": "Modello aggiunto",
+        "problemImportingMaskDesc": "Impossibile importare la maschera",
+        "problemCopyingCanvas": "Problema durante la copia della tela",
+        "problemSavingCanvas": "Problema nel salvataggio della tela",
+        "canvasDownloaded": "Tela scaricata",
+        "problemMergingCanvasDesc": "Impossibile unire le tele",
+        "problemDownloadingCanvasDesc": "Impossibile scaricare la tela",
+        "imageSaved": "Immagine salvata",
+        "maskSentControlnetAssets": "Maschera inviata a ControlNet & Risorse",
+        "canvasSavedGallery": "Tela salvata nella Galleria",
+        "imageUploadFailed": "Caricamento immagine non riuscito",
+        "modelAdded": "Modello aggiunto: {{modelName}}",
+        "problemImportingMask": "Problema durante l'importazione della maschera",
+        "setInitialImage": "Imposta come immagine iniziale",
+        "setControlImage": "Imposta come immagine di controllo",
+        "setNodeField": "Imposta come campo nodo",
+        "problemSavingMask": "Problema nel salvataggio della maschera",
+        "problemSavingCanvasDesc": "Impossibile salvare la tela",
+        "setCanvasInitialImage": "Imposta come immagine iniziale della tela",
+        "workflowLoaded": "Flusso di lavoro caricato",
+        "setIPAdapterImage": "Imposta come immagine per l'Adattatore IP",
+        "problemSavingMaskDesc": "Impossibile salvare la maschera"
     },
     "tooltip": {
         "feature": {
@@ -610,7 +801,10 @@
         "betaClear": "Svuota",
         "betaDarkenOutside": "Oscura all'esterno",
         "betaLimitToBox": "Limita al rettangolo",
-        "betaPreserveMasked": "Conserva quanto mascherato"
+        "betaPreserveMasked": "Conserva quanto mascherato",
+        "antialiasing": "Anti aliasing",
+        "showResultsOn": "Mostra i risultati (attivato)",
+        "showResultsOff": "Mostra i risultati (disattivato)"
     },
     "accessibility": {
         "modelSelect": "Seleziona modello",
@@ -628,11 +822,666 @@
         "rotateClockwise": "Ruotare in senso orario",
         "flipHorizontally": "Capovolgi orizzontalmente",
         "toggleLogViewer": "Attiva/disattiva visualizzatore registro",
-        "showGallery": "Mostra la galleria immagini",
-        "showOptionsPanel": "Mostra il pannello opzioni",
+        "showOptionsPanel": "Mostra il pannello laterale",
         "flipVertically": "Capovolgi verticalmente",
         "toggleAutoscroll": "Attiva/disattiva lo scorrimento automatico",
         "modifyConfig": "Modifica configurazione",
-        "menu": "Menu"
+        "menu": "Menu",
+        "showGalleryPanel": "Mostra il pannello Galleria",
+        "loadMore": "Carica altro"
+    },
+    "ui": {
+        "hideProgressImages": "Nascondi avanzamento immagini",
+        "showProgressImages": "Mostra avanzamento immagini",
+        "swapSizes": "Scambia dimensioni",
+        "lockRatio": "Blocca le proporzioni"
+    },
+    "nodes": {
+        "zoomOutNodes": "Rimpicciolire",
+        "hideGraphNodes": "Nascondi sovrapposizione grafico",
+        "hideLegendNodes": "Nascondi la legenda del tipo di campo",
+        "showLegendNodes": "Mostra legenda del tipo di campo",
+        "hideMinimapnodes": "Nascondi minimappa",
+        "showMinimapnodes": "Mostra minimappa",
+        "zoomInNodes": "Ingrandire",
+        "fitViewportNodes": "Adatta vista",
+        "showGraphNodes": "Mostra sovrapposizione grafico",
+        "resetWorkflowDesc2": "Reimpostare il flusso di lavoro cancellerà tutti i nodi, i bordi e i dettagli del flusso di lavoro.",
+        "reloadNodeTemplates": "Ricarica i modelli di nodo",
+        "loadWorkflow": "Importa flusso di lavoro JSON",
+        "resetWorkflow": "Reimposta flusso di lavoro",
+        "resetWorkflowDesc": "Sei sicuro di voler reimpostare questo flusso di lavoro?",
+        "downloadWorkflow": "Esporta flusso di lavoro JSON",
+        "scheduler": "Campionatore",
+        "addNode": "Aggiungi nodo",
+        "sDXLMainModelFieldDescription": "Campo del modello SDXL.",
+        "boardField": "Bacheca",
+        "animatedEdgesHelp": "Anima i bordi selezionati e i bordi collegati ai nodi selezionati",
+        "sDXLMainModelField": "Modello SDXL",
+        "executionStateInProgress": "In corso",
+        "executionStateError": "Errore",
+        "executionStateCompleted": "Completato",
+        "boardFieldDescription": "Una bacheca della galleria",
+        "addNodeToolTip": "Aggiungi nodo (Shift+A, Space)",
+        "sDXLRefinerModelField": "Modello Refiner",
+        "problemReadingMetadata": "Problema durante la lettura dei metadati dall'immagine",
+        "colorCodeEdgesHelp": "Bordi con codice colore in base ai campi collegati",
+        "animatedEdges": "Bordi animati",
+        "snapToGrid": "Aggancia alla griglia",
+        "validateConnections": "Convalida connessioni e grafico",
+        "validateConnectionsHelp": "Impedisce che vengano effettuate connessioni non valide e che vengano \"invocati\" grafici non validi",
+        "fullyContainNodesHelp": "I nodi devono essere completamente all'interno della casella di selezione per essere selezionati",
+        "fullyContainNodes": "Contenere completamente i nodi da selezionare",
+        "snapToGridHelp": "Aggancia i nodi alla griglia quando vengono spostati",
+        "workflowSettings": "Impostazioni Editor del flusso di lavoro",
+        "colorCodeEdges": "Bordi con codice colore",
+        "mainModelField": "Modello",
+        "noOutputRecorded": "Nessun output registrato",
+        "noFieldsLinearview": "Nessun campo aggiunto alla vista lineare",
+        "removeLinearView": "Rimuovi dalla vista lineare",
+        "workflowDescription": "Breve descrizione",
+        "workflowContact": "Contatto",
+        "workflowVersion": "Versione",
+        "workflow": "Flusso di lavoro",
+        "noWorkflow": "Nessun flusso di lavoro",
+        "workflowTags": "Tag",
+        "workflowValidation": "Errore di convalida del flusso di lavoro",
+        "workflowAuthor": "Autore",
+        "workflowName": "Nome",
+        "workflowNotes": "Note",
+        "unhandledInputProperty": "Proprietà di input non gestita",
+        "versionUnknown": " Versione sconosciuta",
+        "unableToValidateWorkflow": "Impossibile convalidare il flusso di lavoro",
+        "updateApp": "Aggiorna App",
+        "problemReadingWorkflow": "Problema durante la lettura del flusso di lavoro dall'immagine",
+        "unableToLoadWorkflow": "Impossibile caricare il flusso di lavoro",
+        "updateNode": "Aggiorna nodo",
+        "version": "Versione",
+        "notes": "Note",
+        "problemSettingTitle": "Problema nell'impostazione del titolo",
+        "unkownInvocation": "Tipo di invocazione sconosciuta",
+        "unknownTemplate": "Modello sconosciuto",
+        "nodeType": "Tipo di nodo",
+        "vaeField": "VAE",
+        "unhandledOutputProperty": "Proprietà di output non gestita",
+        "notesDescription": "Aggiunge note sul tuo flusso di lavoro",
+        "unknownField": "Campo sconosciuto",
+        "unknownNode": "Nodo sconosciuto",
+        "vaeFieldDescription": "Sotto modello VAE.",
+        "booleanPolymorphicDescription": "Una raccolta di booleani.",
+        "missingTemplate": "Modello mancante",
+        "outputSchemaNotFound": "Schema di output non trovato",
+        "colorFieldDescription": "Un colore RGBA.",
+        "maybeIncompatible": "Potrebbe essere incompatibile con quello installato",
+        "noNodeSelected": "Nessun nodo selezionato",
+        "colorPolymorphic": "Colore polimorfico",
+        "booleanCollectionDescription": "Una raccolta di booleani.",
+        "colorField": "Colore",
+        "nodeTemplate": "Modello di nodo",
+        "nodeOpacity": "Opacità del nodo",
+        "pickOne": "Sceglierne uno",
+        "outputField": "Campo di output",
+        "nodeSearch": "Cerca nodi",
+        "nodeOutputs": "Uscite del nodo",
+        "collectionItem": "Oggetto della raccolta",
+        "noConnectionInProgress": "Nessuna connessione in corso",
+        "noConnectionData": "Nessun dato di connessione",
+        "outputFields": "Campi di output",
+        "cannotDuplicateConnection": "Impossibile creare connessioni duplicate",
+        "booleanPolymorphic": "Polimorfico booleano",
+        "colorPolymorphicDescription": "Una collezione di colori polimorfici.",
+        "missingCanvaInitImage": "Immagine iniziale della tela mancante",
+        "clipFieldDescription": "Sottomodelli di tokenizzatore e codificatore di testo.",
+        "noImageFoundState": "Nessuna immagine iniziale trovata nello stato",
+        "clipField": "CLIP",
+        "noMatchingNodes": "Nessun nodo corrispondente",
+        "noFieldType": "Nessun tipo di campo",
+        "colorCollection": "Una collezione di colori.",
+        "noOutputSchemaName": "Nessun nome dello schema di output trovato nell'oggetto di riferimento",
+        "boolean": "Booleani",
+        "missingCanvaInitMaskImages": "Immagini di inizializzazione e maschera della tela mancanti",
+        "oNNXModelField": "Modello ONNX",
+        "node": "Nodo",
+        "booleanDescription": "I booleani sono veri o falsi.",
+        "collection": "Raccolta",
+        "cannotConnectInputToInput": "Impossibile collegare Input a Input",
+        "cannotConnectOutputToOutput": "Impossibile collegare Output ad Output",
+        "booleanCollection": "Raccolta booleana",
+        "cannotConnectToSelf": "Impossibile connettersi a se stesso",
+        "mismatchedVersion": "Ha una versione non corrispondente",
+        "outputNode": "Nodo di Output",
+        "loadingNodes": "Caricamento nodi...",
+        "oNNXModelFieldDescription": "Campo del modello ONNX.",
+        "denoiseMaskFieldDescription": "La maschera di riduzione del rumore può essere passata tra i nodi",
+        "floatCollectionDescription": "Una raccolta di numeri virgola mobile.",
+        "enum": "Enumeratore",
+        "float": "In virgola mobile",
+        "doesNotExist": "non esiste",
+        "currentImageDescription": "Visualizza l'immagine corrente nell'editor dei nodi",
+        "fieldTypesMustMatch": "I tipi di campo devono corrispondere",
+        "edge": "Bordo",
+        "enumDescription": "Gli enumeratori sono valori che possono essere una delle diverse opzioni.",
+        "denoiseMaskField": "Maschera riduzione rumore",
+        "currentImage": "Immagine corrente",
+        "floatCollection": "Raccolta in virgola mobile",
+        "inputField": "Campo di Input",
+        "controlFieldDescription": "Informazioni di controllo passate tra i nodi.",
+        "skippingUnknownOutputType": "Tipo di campo di output sconosciuto saltato",
+        "latentsFieldDescription": "Le immagini latenti possono essere passate tra i nodi.",
+        "ipAdapterPolymorphicDescription": "Una raccolta di adattatori IP.",
+        "latentsPolymorphicDescription": "Le immagini latenti possono essere passate tra i nodi.",
+        "ipAdapterCollection": "Raccolta Adattatori IP",
+        "conditioningCollection": "Raccolta condizionamenti",
+        "ipAdapterPolymorphic": "Adattatore IP Polimorfico",
+        "integerPolymorphicDescription": "Una raccolta di numeri interi.",
+        "conditioningCollectionDescription": "Il condizionamento può essere passato tra i nodi.",
+        "skippingReservedFieldType": "Tipo di campo riservato saltato",
+        "conditioningPolymorphic": "Condizionamento Polimorfico",
+        "integer": "Numero Intero",
+        "latentsCollection": "Raccolta Latenti",
+        "sourceNode": "Nodo di origine",
+        "integerDescription": "Gli interi sono numeri senza punto decimale.",
+        "stringPolymorphic": "Stringa polimorfica",
+        "conditioningPolymorphicDescription": "Il condizionamento può essere passato tra i nodi.",
+        "skipped": "Saltato",
+        "imagePolymorphic": "Immagine Polimorfica",
+        "imagePolymorphicDescription": "Una raccolta di immagini.",
+        "floatPolymorphic": "Numeri in virgola mobile Polimorfici",
+        "ipAdapterCollectionDescription": "Una raccolta di adattatori IP.",
+        "stringCollectionDescription": "Una raccolta di stringhe.",
+        "unableToParseNode": "Impossibile analizzare il nodo",
+        "controlCollection": "Raccolta di Controllo",
+        "stringCollection": "Raccolta di stringhe",
+        "inputMayOnlyHaveOneConnection": "L'ingresso può avere solo una connessione",
+        "ipAdapter": "Adattatore IP",
+        "integerCollection": "Raccolta di numeri interi",
+        "controlCollectionDescription": "Informazioni di controllo passate tra i nodi.",
+        "skippedReservedInput": "Campo di input riservato saltato",
+        "inputNode": "Nodo di Input",
+        "imageField": "Immagine",
+        "skippedReservedOutput": "Campo di output riservato saltato",
+        "integerCollectionDescription": "Una raccolta di numeri interi.",
+        "conditioningFieldDescription": "Il condizionamento può essere passato tra i nodi.",
+        "stringDescription": "Le stringhe sono testo.",
+        "integerPolymorphic": "Numero intero Polimorfico",
+        "ipAdapterModel": "Modello Adattatore IP",
+        "latentsPolymorphic": "Latenti polimorfici",
+        "skippingInputNoTemplate": "Campo di input senza modello saltato",
+        "ipAdapterDescription": "Un adattatore di prompt di immagini (Adattatore IP).",
+        "stringPolymorphicDescription": "Una raccolta di stringhe.",
+        "skippingUnknownInputType": "Tipo di campo di input sconosciuto saltato",
+        "controlField": "Controllo",
+        "ipAdapterModelDescription": "Campo Modello adattatore IP",
+        "invalidOutputSchema": "Schema di output non valido",
+        "floatDescription": "I numeri in virgola mobile sono numeri con un punto decimale.",
+        "floatPolymorphicDescription": "Una raccolta di numeri in virgola mobile.",
+        "conditioningField": "Condizionamento",
+        "string": "Stringa",
+        "latentsField": "Latenti",
+        "connectionWouldCreateCycle": "La connessione creerebbe un ciclo",
+        "inputFields": "Campi di Input",
+        "uNetFieldDescription": "Sub-modello UNet.",
+        "imageCollectionDescription": "Una raccolta di immagini.",
+        "imageFieldDescription": "Le immagini possono essere passate tra i nodi.",
+        "unableToParseEdge": "Impossibile analizzare il bordo",
+        "latentsCollectionDescription": "Le immagini latenti possono essere passate tra i nodi.",
+        "imageCollection": "Raccolta Immagini"
+    },
+    "boards": {
+        "autoAddBoard": "Aggiungi automaticamente bacheca",
+        "menuItemAutoAdd": "Aggiungi automaticamente a questa Bacheca",
+        "cancel": "Annulla",
+        "addBoard": "Aggiungi Bacheca",
+        "bottomMessage": "L'eliminazione di questa bacheca e delle sue immagini ripristinerà tutte le funzionalità che le stanno attualmente utilizzando.",
+        "changeBoard": "Cambia Bacheca",
+        "loading": "Caricamento in corso ...",
+        "clearSearch": "Cancella Ricerca",
+        "topMessage": "Questa bacheca contiene immagini utilizzate nelle seguenti funzionalità:",
+        "move": "Sposta",
+        "myBoard": "Bacheca",
+        "searchBoard": "Cerca bacheche ...",
+        "noMatching": "Nessuna bacheca corrispondente",
+        "selectBoard": "Seleziona una Bacheca",
+        "uncategorized": "Non categorizzato",
+        "downloadBoard": "Scarica la bacheca"
+    },
+    "controlnet": {
+        "contentShuffleDescription": "Rimescola il contenuto di un'immagine",
+        "contentShuffle": "Rimescola contenuto",
+        "beginEndStepPercent": "Percentuale passi Inizio / Fine",
+        "duplicate": "Duplica",
+        "balanced": "Bilanciato",
+        "depthMidasDescription": "Generazione di mappe di profondità usando Midas",
+        "control": "ControlNet",
+        "crop": "Ritaglia",
+        "depthMidas": "Profondità (Midas)",
+        "enableControlnet": "Abilita ControlNet",
+        "detectResolution": "Rileva risoluzione",
+        "controlMode": "Modalità Controllo",
+        "cannyDescription": "Canny rilevamento bordi",
+        "depthZoe": "Profondità (Zoe)",
+        "autoConfigure": "Configura automaticamente il processore",
+        "delete": "Elimina",
+        "depthZoeDescription": "Generazione di mappe di profondità usando Zoe",
+        "resize": "Ridimensiona",
+        "showAdvanced": "Mostra opzioni Avanzate",
+        "bgth": "Soglia rimozione sfondo",
+        "importImageFromCanvas": "Importa immagine dalla Tela",
+        "lineartDescription": "Converte l'immagine in lineart",
+        "importMaskFromCanvas": "Importa maschera dalla Tela",
+        "hideAdvanced": "Nascondi opzioni avanzate",
+        "ipAdapterModel": "Modello Adattatore",
+        "resetControlImage": "Reimposta immagine di controllo",
+        "f": "F",
+        "h": "H",
+        "prompt": "Prompt",
+        "openPoseDescription": "Stima della posa umana utilizzando Openpose",
+        "resizeMode": "Modalità ridimensionamento",
+        "weight": "Peso",
+        "selectModel": "Seleziona un modello",
+        "w": "W",
+        "processor": "Processore",
+        "none": "Nessuno",
+        "incompatibleBaseModel": "Modello base incompatibile:",
+        "pidiDescription": "Elaborazione immagini PIDI",
+        "fill": "Riempire",
+        "colorMapDescription": "Genera una mappa dei colori dall'immagine",
+        "lineartAnimeDescription": "Elaborazione lineart in stile anime",
+        "imageResolution": "Risoluzione dell'immagine",
+        "colorMap": "Colore",
+        "lowThreshold": "Soglia inferiore",
+        "highThreshold": "Soglia superiore",
+        "normalBaeDescription": "Elaborazione BAE normale",
+        "noneDescription": "Nessuna elaborazione applicata",
+        "saveControlImage": "Salva immagine di controllo",
+        "toggleControlNet": "Attiva/disattiva questo ControlNet",
+        "safe": "Sicuro",
+        "colorMapTileSize": "Dimensione piastrella",
+        "ipAdapterImageFallback": "Nessuna immagine dell'Adattatore IP selezionata",
+        "mediapipeFaceDescription": "Rilevamento dei volti tramite Mediapipe",
+        "hedDescription": "Rilevamento dei bordi nidificati olisticamente",
+        "setControlImageDimensions": "Imposta le dimensioni dell'immagine di controllo su L/A",
+        "resetIPAdapterImage": "Reimposta immagine Adattatore IP",
+        "handAndFace": "Mano e faccia",
+        "enableIPAdapter": "Abilita Adattatore IP",
+        "maxFaces": "Numero massimo di volti",
+        "addT2IAdapter": "Aggiungi $t(common.t2iAdapter)",
+        "controlNetEnabledT2IDisabled": "$t(common.controlNet) abilitato, $t(common.t2iAdapter) disabilitati",
+        "t2iEnabledControlNetDisabled": "$t(common.t2iAdapter) abilitato, $t(common.controlNet) disabilitati",
+        "addControlNet": "Aggiungi $t(common.controlNet)",
+        "controlNetT2IMutexDesc": "$t(common.controlNet) e $t(common.t2iAdapter) contemporaneamente non sono attualmente supportati.",
+        "addIPAdapter": "Aggiungi $t(common.ipAdapter)",
+        "controlAdapter_one": "Adattatore di Controllo",
+        "controlAdapter_many": "Adattatori di Controllo",
+        "controlAdapter_other": "Adattatori di Controllo",
+        "megaControl": "Mega ControlNet",
+        "minConfidence": "Confidenza minima",
+        "scribble": "Scribble"
+    },
+    "queue": {
+        "queueFront": "Aggiungi all'inizio della coda",
+        "queueBack": "Aggiungi alla coda",
+        "queueCountPrediction": "Aggiungi {{predicted}} alla coda",
+        "queue": "Coda",
+        "status": "Stato",
+        "pruneSucceeded": "Rimossi {{item_count}} elementi completati dalla coda",
+        "cancelTooltip": "Annulla l'elemento corrente",
+        "queueEmpty": "Coda vuota",
+        "pauseSucceeded": "Elaborazione sospesa",
+        "in_progress": "In corso",
+        "notReady": "Impossibile mettere in coda",
+        "batchFailedToQueue": "Impossibile mettere in coda il lotto",
+        "completed": "Completati",
+        "batchValues": "Valori del lotto",
+        "cancelFailed": "Problema durante l'annullamento dell'elemento",
+        "batchQueued": "Lotto aggiunto alla coda",
+        "pauseFailed": "Problema durante la sospensione dell'elaborazione",
+        "clearFailed": "Problema nella cancellazione della coda",
+        "queuedCount": "{{pending}} In attesa",
+        "front": "inizio",
+        "clearSucceeded": "Coda cancellata",
+        "pause": "Sospendi",
+        "pruneTooltip": "Rimuovi {{item_count}} elementi completati",
+        "cancelSucceeded": "Elemento annullato",
+        "batchQueuedDesc_one": "Aggiunta {{count}} sessione a {{direction}} della coda",
+        "batchQueuedDesc_many": "Aggiunte {{count}} sessioni a {{direction}} della coda",
+        "batchQueuedDesc_other": "Aggiunte {{count}} sessioni a {{direction}} della coda",
+        "graphQueued": "Grafico in coda",
+        "batch": "Lotto",
+        "clearQueueAlertDialog": "Lo svuotamento della coda annulla immediatamente tutti gli elementi in elaborazione e cancella completamente la coda.",
+        "pending": "In attesa",
+        "completedIn": "Completato in",
+        "resumeFailed": "Problema nel riavvio dell'elaborazione",
+        "clear": "Cancella",
+        "prune": "Rimuovi",
+        "total": "Totale",
+        "canceled": "Annullati",
+        "pruneFailed": "Problema nel rimuovere la coda",
+        "cancelBatchSucceeded": "Lotto annullato",
+        "clearTooltip": "Annulla e cancella tutti gli elementi",
+        "current": "Attuale",
+        "pauseTooltip": "Sospende l'elaborazione",
+        "failed": "Falliti",
+        "cancelItem": "Annulla l'elemento",
+        "next": "Prossimo",
+        "cancelBatch": "Annulla lotto",
+        "back": "fine",
+        "cancel": "Annulla",
+        "session": "Sessione",
+        "queueTotal": "{{total}} Totale",
+        "resumeSucceeded": "Elaborazione ripresa",
+        "enqueueing": "Lotto in coda",
+        "resumeTooltip": "Riprendi l'elaborazione",
+        "resume": "Riprendi",
+        "cancelBatchFailed": "Problema durante l'annullamento del lotto",
+        "clearQueueAlertDialog2": "Sei sicuro di voler cancellare la coda?",
+        "item": "Elemento",
+        "graphFailedToQueue": "Impossibile mettere in coda il grafico",
+        "queueMaxExceeded": "È stato superato il limite massimo di {{max_queue_size}} e {{skip}} elementi verrebbero saltati"
+    },
+    "embedding": {
+        "noMatchingEmbedding": "Nessun Incorporamento corrispondente",
+        "addEmbedding": "Aggiungi Incorporamento",
+        "incompatibleModel": "Modello base incompatibile:"
+    },
+    "models": {
+        "noMatchingModels": "Nessun modello corrispondente",
+        "loading": "caricamento",
+        "noMatchingLoRAs": "Nessun LoRA corrispondente",
+        "noLoRAsAvailable": "Nessun LoRA disponibile",
+        "noModelsAvailable": "Nessun modello disponibile",
+        "selectModel": "Seleziona un modello",
+        "selectLoRA": "Seleziona un LoRA"
+    },
+    "invocationCache": {
+        "disable": "Disabilita",
+        "misses": "Non trovati in cache",
+        "enableFailed": "Problema nell'abilitazione della cache delle invocazioni",
+        "invocationCache": "Cache delle invocazioni",
+        "clearSucceeded": "Cache delle invocazioni svuotata",
+        "enableSucceeded": "Cache delle invocazioni abilitata",
+        "clearFailed": "Problema durante lo svuotamento della cache delle invocazioni",
+        "hits": "Trovati in cache",
+        "disableSucceeded": "Cache delle invocazioni disabilitata",
+        "disableFailed": "Problema durante la disabilitazione della cache delle invocazioni",
+        "enable": "Abilita",
+        "clear": "Svuota",
+        "maxCacheSize": "Dimensione max cache",
+        "cacheSize": "Dimensione cache"
+    },
+    "dynamicPrompts": {
+        "seedBehaviour": {
+            "perPromptDesc": "Utilizza un seme diverso per ogni immagine",
+            "perIterationLabel": "Per iterazione",
+            "perIterationDesc": "Utilizza un seme diverso per ogni iterazione",
+            "perPromptLabel": "Per immagine",
+            "label": "Comportamento del seme"
+        },
+        "enableDynamicPrompts": "Abilita prompt dinamici",
+        "combinatorial": "Generazione combinatoria",
+        "maxPrompts": "Numero massimo di prompt",
+        "promptsWithCount_one": "{{count}} Prompt",
+        "promptsWithCount_many": "{{count}} Prompt",
+        "promptsWithCount_other": "{{count}} Prompt",
+        "dynamicPrompts": "Prompt dinamici"
+    },
+    "popovers": {
+        "paramScheduler": {
+            "paragraphs": [
+                "Il campionatore definisce come aggiungere in modo iterativo il rumore a un'immagine o come aggiornare un campione in base all'output di un modello."
+            ],
+            "heading": "Campionatore"
+        },
+        "compositingMaskAdjustments": {
+            "heading": "Regolazioni della maschera",
+            "paragraphs": [
+                "Regola la maschera."
+            ]
+        },
+        "compositingCoherenceSteps": {
+            "heading": "Passi",
+            "paragraphs": [
+                "Numero di passi di riduzione del rumore utilizzati nel Passaggio di Coerenza.",
+                "Uguale al parametro principale Passi."
+            ]
+        },
+        "compositingBlur": {
+            "heading": "Sfocatura",
+            "paragraphs": [
+                "Il raggio di sfocatura della maschera."
+            ]
+        },
+        "compositingCoherenceMode": {
+            "heading": "Modalità",
+            "paragraphs": [
+                "La modalità del Passaggio di Coerenza."
+            ]
+        },
+        "clipSkip": {
+            "paragraphs": [
+                "Scegli quanti livelli del modello CLIP saltare.",
+                "Alcuni modelli funzionano meglio con determinate impostazioni di CLIP Skip.",
+                "Un valore più alto in genere produce un'immagine meno dettagliata."
+            ]
+        },
+        "compositingCoherencePass": {
+            "heading": "Passaggio di Coerenza",
+            "paragraphs": [
+                "Un secondo ciclo di riduzione del rumore aiuta a comporre l'immagine Inpaint/Outpaint."
+            ]
+        },
+        "compositingStrength": {
+            "heading": "Forza",
+            "paragraphs": [
+                "Intensità di riduzione del rumore per il passaggio di coerenza.",
+                "Uguale al parametro intensità di riduzione del rumore da immagine a immagine."
+            ]
+        },
+        "paramNegativeConditioning": {
+            "paragraphs": [
+                "Il processo di generazione evita i concetti nel prompt negativo. Utilizzatelo per escludere qualità o oggetti dall'output.",
+                "Supporta la sintassi e gli incorporamenti di Compel."
+            ],
+            "heading": "Prompt negativo"
+        },
+        "compositingBlurMethod": {
+            "heading": "Metodo di sfocatura",
+            "paragraphs": [
+                "Il metodo di sfocatura applicato all'area mascherata."
+            ]
+        },
+        "paramPositiveConditioning": {
+            "heading": "Prompt positivo",
+            "paragraphs": [
+                "Guida il processo di generazione. Puoi usare qualsiasi parola o frase.",
+                "Supporta sintassi e incorporamenti di Compel e Prompt Dinamici."
+            ]
+        },
+        "controlNetBeginEnd": {
+            "heading": "Percentuale passi Inizio / Fine",
+            "paragraphs": [
+                "A quali passi del processo di rimozione del rumore verrà applicato ControlNet.",
+                "I ControlNet applicati all'inizio del processo guidano la composizione, mentre i ControlNet applicati alla fine guidano i dettagli."
+            ]
+        },
+        "noiseUseCPU": {
+            "paragraphs": [
+                "Controlla se viene generato rumore sulla CPU o sulla GPU.",
+                "Con il rumore della CPU abilitato, un seme particolare produrrà la stessa immagine su qualsiasi macchina.",
+                "Non vi è alcun impatto sulle prestazioni nell'abilitare il rumore della CPU."
+            ],
+            "heading": "Usa la CPU per generare rumore"
+        },
+        "scaleBeforeProcessing": {
+            "paragraphs": [
+                "Ridimensiona l'area selezionata alla dimensione più adatta al modello prima del processo di generazione dell'immagine."
+            ],
+            "heading": "Scala prima dell'elaborazione"
+        },
+        "paramRatio": {
+            "heading": "Proporzioni",
+            "paragraphs": [
+                "Le proporzioni delle dimensioni dell'immagine generata.",
+                "Per i modelli SD1.5 si consiglia una dimensione dell'immagine (in numero di pixel) equivalente a 512x512 mentre per i modelli SDXL si consiglia una dimensione equivalente a 1024x1024."
+            ]
+        },
+        "dynamicPrompts": {
+            "paragraphs": [
+                "Prompt Dinamici crea molte variazioni a partire da un singolo prompt.",
+                "La sintassi di base è \"a {red|green|blue} ball\". Ciò produrrà tre prompt: \"a red ball\", \"a green ball\" e \"a blue ball\".",
+                "Puoi utilizzare la sintassi quante volte vuoi in un singolo prompt, ma assicurati di tenere sotto controllo il numero di prompt generati con l'impostazione \"Numero massimo di prompt\"."
+            ],
+            "heading": "Prompt Dinamici"
+        },
+        "paramVAE": {
+            "paragraphs": [
+                "Modello utilizzato per tradurre l'output dell'intelligenza artificiale nell'immagine finale."
+            ],
+            "heading": "VAE"
+        },
+        "paramIterations": {
+            "paragraphs": [
+                "Il numero di immagini da generare.",
+                "Se i prompt dinamici sono abilitati, ciascuno dei prompt verrà generato questo numero di volte."
+            ],
+            "heading": "Iterazioni"
+        },
+        "paramVAEPrecision": {
+            "heading": "Precisione VAE",
+            "paragraphs": [
+                "La precisione utilizzata durante la codifica e decodifica VAE. FP16/mezza precisione è più efficiente, a scapito di minori variazioni dell'immagine."
+            ]
+        },
+        "paramSeed": {
+            "paragraphs": [
+                "Controlla il rumore iniziale utilizzato per la generazione.",
+                "Disabilita seme \"Casuale\" per produrre risultati identici con le stesse impostazioni di generazione."
+            ],
+            "heading": "Seme"
+        },
+        "controlNetResizeMode": {
+            "heading": "Modalità ridimensionamento",
+            "paragraphs": [
+                "Come l'immagine ControlNet verrà adattata alle dimensioni di output dell'immagine."
+            ]
+        },
+        "dynamicPromptsSeedBehaviour": {
+            "paragraphs": [
+                "Controlla il modo in cui viene utilizzato il seme durante la generazione dei prompt.",
+                "Per iterazione utilizzerà un seme univoco per ogni iterazione. Usalo per esplorare variazioni del prompt su un singolo seme.",
+                "Ad esempio, se hai 5 prompt, ogni immagine utilizzerà lo stesso seme.",
+                "Per immagine utilizzerà un seme univoco per ogni immagine. Ciò fornisce più variazione."
+            ],
+            "heading": "Comportamento del seme"
+        },
+        "paramModel": {
+            "heading": "Modello",
+            "paragraphs": [
+                "Modello utilizzato per i passaggi di riduzione del rumore.",
+                "Diversi modelli sono generalmente addestrati per specializzarsi nella produzione di particolari risultati e contenuti estetici."
+            ]
+        },
+        "paramDenoisingStrength": {
+            "paragraphs": [
+                "Quanto rumore viene aggiunto all'immagine in ingresso.",
+                "0 risulterà in un'immagine identica, mentre 1 risulterà in un'immagine completamente nuova."
+            ],
+            "heading": "Forza di riduzione del rumore"
+        },
+        "dynamicPromptsMaxPrompts": {
+            "heading": "Numero massimo di prompt",
+            "paragraphs": [
+                "Limita il numero di prompt che possono essere generati da Prompt Dinamici."
+            ]
+        },
+        "infillMethod": {
+            "paragraphs": [
+                "Metodo per riempire l'area selezionata."
+            ],
+            "heading": "Metodo di riempimento"
+        },
+        "controlNetWeight": {
+            "heading": "Peso",
+            "paragraphs": [
+                "Quanto forte sarà l'impatto di ControlNet sull'immagine generata."
+            ]
+        },
+        "paramCFGScale": {
+            "heading": "Scala CFG",
+            "paragraphs": [
+                "Controlla quanto il tuo prompt influenza il processo di generazione."
+            ]
+        },
+        "controlNetControlMode": {
+            "paragraphs": [
+                "Attribuisce più peso al prompt o a ControlNet."
+            ],
+            "heading": "Modalità di controllo"
+        },
+        "paramSteps": {
+            "heading": "Passi",
+            "paragraphs": [
+                "Numero di passi che verranno eseguiti in ogni generazione.",
+                "Un numero di passi più elevato generalmente creerà immagini migliori ma richiederà più tempo di generazione."
+            ]
+        },
+        "lora": {
+            "heading": "Peso LoRA",
+            "paragraphs": [
+                "Un peso LoRA più elevato porterà a impatti maggiori sull'immagine finale."
+            ]
+        },
+        "controlNet": {
+            "paragraphs": [
+                "ControlNet fornisce una guida al processo di generazione, aiutando a creare immagini con composizione, struttura o stile controllati, a seconda del modello selezionato."
+            ],
+            "heading": "ControlNet"
+        }
+    },
+    "sdxl": {
+        "selectAModel": "Seleziona un modello",
+        "scheduler": "Campionatore",
+        "noModelsAvailable": "Nessun modello disponibile",
+        "denoisingStrength": "Forza di riduzione del rumore",
+        "concatPromptStyle": "Concatena Prompt & Stile",
+        "loading": "Caricamento...",
+        "steps": "Passi",
+        "refinerStart": "Inizio Affinamento",
+        "cfgScale": "Scala CFG",
+        "negStylePrompt": "Prompt Stile negativo",
+        "refiner": "Affinatore",
+        "negAestheticScore": "Punteggio estetico negativo",
+        "useRefiner": "Utilizza l'affinatore",
+        "refinermodel": "Modello Affinatore",
+        "posAestheticScore": "Punteggio estetico positivo",
+        "posStylePrompt": "Prompt Stile positivo"
+    },
+    "metadata": {
+        "initImage": "Immagine iniziale",
+        "seamless": "Senza giunture",
+        "positivePrompt": "Prompt positivo",
+        "negativePrompt": "Prompt negativo",
+        "generationMode": "Modalità generazione",
+        "Threshold": "Livello di soglia del rumore",
+        "metadata": "Metadati",
+        "strength": "Forza Immagine a Immagine",
+        "seed": "Seme",
+        "imageDetails": "Dettagli dell'immagine",
+        "perlin": "Rumore Perlin",
+        "model": "Modello",
+        "noImageDetails": "Nessun dettaglio dell'immagine trovato",
+        "hiresFix": "Ottimizzazione Alta Risoluzione",
+        "cfgScale": "Scala CFG",
+        "fit": "Adatta Immagine a Immagine",
+        "height": "Altezza",
+        "variations": "Coppie Peso-Seme",
+        "noMetaData": "Nessun metadato trovato",
+        "width": "Larghezza",
+        "createdBy": "Creato da",
+        "workflow": "Flusso di lavoro",
+        "steps": "Passi",
+        "scheduler": "Campionatore",
+        "recallParameters": "Richiama i parametri",
+        "noRecallParameters": "Nessun parametro da richiamare trovato"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/ja.json b/invokeai/frontend/web/public/locales/ja.json
index 007aa9b491..a53ea50b46 100644
--- a/invokeai/frontend/web/public/locales/ja.json
+++ b/invokeai/frontend/web/public/locales/ja.json
@@ -1,12 +1,8 @@
 {
     "common": {
-        "themeLabel": "テーマ",
         "languagePickerLabel": "言語選択",
         "reportBugLabel": "バグ報告",
         "settingsLabel": "設定",
-        "darkTheme": "ダーク",
-        "lightTheme": "ライト",
-        "greenTheme": "緑",
         "langJapanese": "日本語",
         "nodesDesc": "現在、画像生成のためのノードベースシステムを開発中です。機能についてのアップデートにご期待ください。",
         "postProcessing": "後処理",
@@ -56,14 +52,12 @@
         "loadingInvokeAI": "Invoke AIをロード中",
         "statusConvertingModel": "モデルの変換",
         "statusMergedModels": "マージ済モデル",
-        "pinOptionsPanel": "オプションパネルを固定",
         "githubLabel": "Github",
         "hotkeysLabel": "ホットキー",
         "langHebrew": "עברית",
         "discordLabel": "Discord",
         "langItalian": "Italiano",
         "langEnglish": "English",
-        "oceanTheme": "オーシャン",
         "langArabic": "アラビア語",
         "langDutch": "Nederlands",
         "langFrench": "Français",
@@ -83,7 +77,6 @@
         "gallerySettings": "ギャラリーの設定",
         "maintainAspectRatio": "アスペクト比を維持",
         "singleColumnLayout": "1カラムレイアウト",
-        "pinGallery": "ギャラリーにピン留め",
         "allImagesLoaded": "すべての画像を読み込む",
         "loadMore": "さらに読み込む",
         "noImagesInGallery": "ギャラリーに画像がありません",
@@ -355,7 +348,6 @@
         "useSeed": "シード値を使用",
         "useAll": "すべてを使用",
         "info": "情報",
-        "deleteImage": "画像を削除",
         "showOptionsPanel": "オプションパネルを表示"
     },
     "settings": {
@@ -364,7 +356,6 @@
         "saveSteps": "nステップごとに画像を保存",
         "confirmOnDelete": "削除時に確認",
         "displayHelpIcons": "ヘルプアイコンを表示",
-        "useCanvasBeta": "キャンバスレイアウト(Beta)を使用する",
         "enableImageDebugging": "画像のデバッグを有効化",
         "resetWebUI": "WebUIをリセット",
         "resetWebUIDesc1": "WebUIのリセットは、画像と保存された設定のキャッシュをリセットするだけです。画像を削除するわけではありません。",
@@ -373,7 +364,6 @@
     },
     "toast": {
         "uploadFailed": "アップロード失敗",
-        "uploadFailedMultipleImagesDesc": "一度にアップロードできる画像は1枚のみです。",
         "uploadFailedUnableToLoadDesc": "ファイルを読み込むことができません。",
         "downloadImageStarted": "画像ダウンロード開始",
         "imageCopied": "画像をコピー",
@@ -471,7 +461,6 @@
         "toggleAutoscroll": "自動スクロールの切替",
         "modifyConfig": "Modify Config",
         "toggleLogViewer": "Log Viewerの切替",
-        "showGallery": "ギャラリーを表示",
         "showOptionsPanel": "オプションパネルを表示"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/ko.json b/invokeai/frontend/web/public/locales/ko.json
index 47cde5fec3..8baab54ac9 100644
--- a/invokeai/frontend/web/public/locales/ko.json
+++ b/invokeai/frontend/web/public/locales/ko.json
@@ -1,13 +1,9 @@
 {
     "common": {
-        "themeLabel": "테마 설정",
         "languagePickerLabel": "언어 설정",
         "reportBugLabel": "버그 리포트",
         "githubLabel": "Github",
         "settingsLabel": "설정",
-        "darkTheme": "다크 모드",
-        "lightTheme": "라이트 모드",
-        "greenTheme": "그린 모드",
         "langArabic": "العربية",
         "langEnglish": "English",
         "langDutch": "Nederlands",
diff --git a/invokeai/frontend/web/public/locales/nl.json b/invokeai/frontend/web/public/locales/nl.json
index 230e3b5b64..5c08f65d21 100644
--- a/invokeai/frontend/web/public/locales/nl.json
+++ b/invokeai/frontend/web/public/locales/nl.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Sneltoetsen",
-        "themeLabel": "Thema",
-        "languagePickerLabel": "Taalkeuze",
+        "languagePickerLabel": "Taal",
         "reportBugLabel": "Meld bug",
         "settingsLabel": "Instellingen",
-        "darkTheme": "Donker",
-        "lightTheme": "Licht",
-        "greenTheme": "Groen",
         "img2img": "Afbeelding naar afbeelding",
         "unifiedCanvas": "Centraal canvas",
-        "nodes": "Knooppunten",
+        "nodes": "Werkstroom-editor",
         "langDutch": "Nederlands",
         "nodesDesc": "Een op knooppunten gebaseerd systeem voor het genereren van afbeeldingen is momenteel in ontwikkeling. Blijf op de hoogte voor nieuws over deze verbluffende functie.",
         "postProcessing": "Naverwerking",
@@ -65,15 +61,36 @@
         "statusMergedModels": "Modellen samengevoegd",
         "cancel": "Annuleer",
         "accept": "Akkoord",
-        "langPortuguese": "Português",
-        "pinOptionsPanel": "Zet deelscherm Opties vast",
+        "langPortuguese": "Portugees",
         "loading": "Bezig met laden",
         "loadingInvokeAI": "Bezig met laden van Invoke AI",
-        "oceanTheme": "Oceaan",
         "langHebrew": "עברית",
         "langKorean": "한국어",
         "txt2img": "Tekst naar afbeelding",
-        "postprocessing": "Nabewerking"
+        "postprocessing": "Naverwerking",
+        "dontAskMeAgain": "Vraag niet opnieuw",
+        "imagePrompt": "Afbeeldingsprompt",
+        "random": "Willekeurig",
+        "generate": "Genereer",
+        "openInNewTab": "Open in nieuw tabblad",
+        "areYouSure": "Weet je het zeker?",
+        "linear": "Lineair",
+        "batch": "Seriebeheer",
+        "modelManager": "Modelbeheer",
+        "darkMode": "Donkere modus",
+        "lightMode": "Lichte modus",
+        "communityLabel": "Gemeenschap",
+        "t2iAdapter": "T2I-adapter",
+        "on": "Aan",
+        "nodeEditor": "Knooppunteditor",
+        "ipAdapter": "IP-adapter",
+        "controlAdapter": "Control-adapter",
+        "auto": "Autom.",
+        "controlNet": "ControlNet",
+        "statusProcessing": "Bezig met verwerken",
+        "imageFailedToLoad": "Kan afbeelding niet laden",
+        "learnMore": "Meer informatie",
+        "advanced": "Uitgebreid"
     },
     "gallery": {
         "generations": "Gegenereerde afbeeldingen",
@@ -86,10 +103,25 @@
         "maintainAspectRatio": "Behoud beeldverhoiding",
         "autoSwitchNewImages": "Wissel autom. naar nieuwe afbeeldingen",
         "singleColumnLayout": "Eenkolomsindeling",
-        "pinGallery": "Zet galerij vast",
         "allImagesLoaded": "Alle afbeeldingen geladen",
         "loadMore": "Laad meer",
-        "noImagesInGallery": "Geen afbeeldingen in galerij"
+        "noImagesInGallery": "Geen afbeeldingen om te tonen",
+        "deleteImage": "Wis afbeelding",
+        "deleteImageBin": "Gewiste afbeeldingen worden naar de prullenbak van je besturingssysteem gestuurd.",
+        "deleteImagePermanent": "Gewiste afbeeldingen kunnen niet worden hersteld.",
+        "assets": "Eigen onderdelen",
+        "images": "Afbeeldingen",
+        "autoAssignBoardOnClick": "Ken automatisch bord toe bij klikken",
+        "featuresWillReset": "Als je deze afbeelding verwijdert, dan worden deze functies onmiddellijk teruggezet.",
+        "loading": "Bezig met laden",
+        "unableToLoad": "Kan galerij niet laden",
+        "preparingDownload": "Bezig met voorbereiden van download",
+        "preparingDownloadFailed": "Fout bij voorbereiden van download",
+        "downloadSelection": "Download selectie",
+        "currentlyInUse": "Deze afbeelding is momenteel in gebruik door de volgende functies:",
+        "copy": "Kopieer",
+        "download": "Download",
+        "setCurrentImage": "Stel in als huidige afbeelding"
     },
     "hotkeys": {
         "keyboardShortcuts": "Sneltoetsen",
@@ -296,7 +328,12 @@
         "acceptStagingImage": {
             "title": "Accepteer sessie-afbeelding",
             "desc": "Accepteert de huidige sessie-afbeelding"
-        }
+        },
+        "addNodes": {
+            "title": "Voeg knooppunten toe",
+            "desc": "Opent het menu Voeg knooppunt toe"
+        },
+        "nodesHotkeys": "Sneltoetsen knooppunten"
     },
     "modelManager": {
         "modelManager": "Modelonderhoud",
@@ -316,7 +353,7 @@
         "config": "Configuratie",
         "configValidationMsg": "Pad naar het configuratiebestand van je model.",
         "modelLocation": "Locatie model",
-        "modelLocationValidationMsg": "Pad naar waar je model zich bevindt.",
+        "modelLocationValidationMsg": "Geef het pad naar een lokale map waar je Diffusers-model wordt bewaard",
         "vaeLocation": "Locatie VAE",
         "vaeLocationValidationMsg": "Pad naar waar je VAE zich bevindt.",
         "width": "Breedte",
@@ -348,12 +385,12 @@
         "delete": "Verwijder",
         "deleteModel": "Verwijder model",
         "deleteConfig": "Verwijder configuratie",
-        "deleteMsg1": "Weet je zeker dat je deze modelregel wilt verwijderen uit InvokeAI?",
-        "deleteMsg2": "Hiermee wordt het checkpointbestand niet van je schijf verwijderd. Je kunt deze opnieuw toevoegen als je dat wilt.",
+        "deleteMsg1": "Weet je zeker dat je dit model wilt verwijderen uit InvokeAI?",
+        "deleteMsg2": "Hiermee ZAL het model van schijf worden verwijderd als het zich bevindt in de InvokeAI-beginmap. Als je het model vanaf een eigen locatie gebruikt, dan ZAL het model NIET van schijf worden verwijderd.",
         "formMessageDiffusersVAELocationDesc": "Indien niet opgegeven, dan zal InvokeAI kijken naar het VAE-bestand in de hierboven gegeven modellocatie.",
         "repoIDValidationMsg": "Online repository van je model",
         "formMessageDiffusersModelLocation": "Locatie Diffusers-model",
-        "convertToDiffusersHelpText3": "Je Checkpoint-bestand op schijf zal NIET worden verwijderd of gewijzigd. Je kunt je Checkpoint opnieuw toevoegen aan Modelonderhoud als je dat wilt.",
+        "convertToDiffusersHelpText3": "Je checkpoint-bestand op schijf ZAL worden verwijderd als het zich in de InvokeAI root map bevindt. Het zal NIET worden verwijderd als het zich in een andere locatie bevindt.",
         "convertToDiffusersHelpText6": "Wil je dit model omzetten?",
         "allModels": "Alle modellen",
         "checkpointModels": "Checkpoints",
@@ -371,7 +408,7 @@
         "convertToDiffusersHelpText1": "Dit model wordt omgezet naar de🧨 Diffusers-indeling.",
         "convertToDiffusersHelpText2": "Dit proces vervangt het onderdeel in Modelonderhoud met de Diffusers-versie van hetzelfde model.",
         "convertToDiffusersHelpText4": "Dit is een eenmalig proces. Dit neemt ongeveer 30 tot 60 sec. in beslag, afhankelijk van de specificaties van je computer.",
-        "convertToDiffusersHelpText5": "Zorg ervoor dat je genoeg schijfruimte hebt. Modellen nemen gewoonlijk ongeveer 4 - 7 GB ruimte in beslag.",
+        "convertToDiffusersHelpText5": "Zorg ervoor dat je genoeg schijfruimte hebt. Modellen nemen gewoonlijk ongeveer 2 tot 7 GB ruimte in beslag.",
         "convertToDiffusersSaveLocation": "Bewaarlocatie",
         "v1": "v1",
         "inpainting": "v1-inpainting",
@@ -408,7 +445,37 @@
         "none": "geen",
         "addDifference": "Voeg verschil toe",
         "scanForModels": "Scan naar modellen",
-        "pickModelType": "Kies modelsoort"
+        "pickModelType": "Kies modelsoort",
+        "baseModel": "Basismodel",
+        "vae": "VAE",
+        "variant": "Variant",
+        "modelConversionFailed": "Omzetten model mislukt",
+        "modelUpdateFailed": "Bijwerken model mislukt",
+        "modelsMergeFailed": "Samenvoegen model mislukt",
+        "selectModel": "Kies model",
+        "settings": "Instellingen",
+        "modelDeleted": "Model verwijderd",
+        "noCustomLocationProvided": "Geen Aangepaste Locatie Opgegeven",
+        "syncModels": "Synchroniseer Modellen",
+        "modelsSynced": "Modellen Gesynchroniseerd",
+        "modelSyncFailed": "Synchronisatie Modellen Gefaald",
+        "modelDeleteFailed": "Model kon niet verwijderd worden",
+        "convertingModelBegin": "Model aan het converteren. Even geduld.",
+        "importModels": "Importeer Modellen",
+        "syncModelsDesc": "Als je modellen niet meer synchroon zijn met de backend, kan je ze met deze optie verversen. Dit wordt typisch gebruikt in het geval je het models.yaml bestand met de hand bewerkt of als je modellen aan de InvokeAI root map toevoegt nadat de applicatie gestart werd.",
+        "loraModels": "LoRA's",
+        "onnxModels": "Onnx",
+        "oliveModels": "Olives",
+        "noModels": "Geen modellen gevonden",
+        "predictionType": "Soort voorspelling (voor Stable Diffusion 2.x-modellen en incidentele Stable Diffusion 1.x-modellen)",
+        "quickAdd": "Voeg snel toe",
+        "simpleModelDesc": "Geef een pad naar een lokaal Diffusers-model, lokale-checkpoint- / safetensors-model, een HuggingFace-repo-ID of een url naar een checkpoint- / Diffusers-model.",
+        "advanced": "Uitgebreid",
+        "useCustomConfig": "Gebruik eigen configuratie",
+        "closeAdvanced": "Sluit uitgebreid",
+        "modelType": "Soort model",
+        "customConfigFileLocation": "Locatie eigen configuratiebestand",
+        "vaePrecision": "Nauwkeurigheid VAE"
     },
     "parameters": {
         "images": "Afbeeldingen",
@@ -416,10 +483,9 @@
         "cfgScale": "CFG-schaal",
         "width": "Breedte",
         "height": "Hoogte",
-        "sampler": "Sampler",
         "seed": "Seed",
         "randomizeSeed": "Willekeurige seed",
-        "shuffle": "Meng",
+        "shuffle": "Mengseed",
         "noiseThreshold": "Drempelwaarde ruis",
         "perlinNoise": "Perlinruis",
         "variations": "Variaties",
@@ -430,7 +496,7 @@
         "type": "Soort",
         "strength": "Sterkte",
         "upscaling": "Opschalen",
-        "upscale": "Schaal op",
+        "upscale": "Vergroot (Shift + U)",
         "upscaleImage": "Schaal afbeelding op",
         "scale": "Schaal",
         "otherOptions": "Andere opties",
@@ -438,10 +504,6 @@
         "hiresOptim": "Hogeresolutie-optimalisatie",
         "imageFit": "Pas initiële afbeelding in uitvoergrootte",
         "codeformerFidelity": "Getrouwheid",
-        "seamSize": "Grootte naad",
-        "seamBlur": "Vervaging naad",
-        "seamStrength": "Sterkte naad",
-        "seamSteps": "Stappen naad",
         "scaleBeforeProcessing": "Schalen voor verwerking",
         "scaledWidth": "Geschaalde B",
         "scaledHeight": "Geschaalde H",
@@ -452,8 +514,6 @@
         "infillScalingHeader": "Infill en schaling",
         "img2imgStrength": "Sterkte Afbeelding naar afbeelding",
         "toggleLoopback": "Zet recursieve verwerking aan/uit",
-        "invoke": "Genereer",
-        "promptPlaceholder": "Voer invoertekst hier in. [negatieve trefwoorden], (verhoogdgewicht)++, (verlaagdgewicht)--, swap (wisselen) en blend (mengen) zijn beschikbaar (zie documentatie)",
         "sendTo": "Stuur naar",
         "sendToImg2Img": "Stuur naar Afbeelding naar afbeelding",
         "sendToUnifiedCanvas": "Stuur naar Centraal canvas",
@@ -466,9 +526,8 @@
         "useAll": "Hergebruik alles",
         "useInitImg": "Gebruik initiële afbeelding",
         "info": "Info",
-        "deleteImage": "Verwijder afbeelding",
         "initialImage": "Initiële afbeelding",
-        "showOptionsPanel": "Toon deelscherm Opties",
+        "showOptionsPanel": "Toon deelscherm Opties (O of T)",
         "symmetry": "Symmetrie",
         "hSymmetryStep": "Stap horiz. symmetrie",
         "vSymmetryStep": "Stap vert. symmetrie",
@@ -476,39 +535,123 @@
             "immediate": "Annuleer direct",
             "isScheduled": "Annuleren",
             "setType": "Stel annuleervorm in",
-            "schedule": "Annuleer na huidige iteratie"
+            "schedule": "Annuleer na huidige iteratie",
+            "cancel": "Annuleer"
         },
-        "negativePrompts": "Negatieve invoer",
         "general": "Algemeen",
         "copyImage": "Kopieer afbeelding",
         "imageToImage": "Afbeelding naar afbeelding",
         "denoisingStrength": "Sterkte ontruisen",
-        "hiresStrength": "Sterkte hogere resolutie"
+        "hiresStrength": "Sterkte hogere resolutie",
+        "scheduler": "Planner",
+        "noiseSettings": "Ruis",
+        "seamlessXAxis": "X-as",
+        "seamlessYAxis": "Y-as",
+        "hidePreview": "Verberg voorvertoning",
+        "showPreview": "Toon voorvertoning",
+        "boundingBoxWidth": "Tekenvak breedte",
+        "boundingBoxHeight": "Tekenvak hoogte",
+        "clipSkip": "Overslaan CLIP",
+        "aspectRatio": "Beeldverhouding",
+        "negativePromptPlaceholder": "Negatieve prompt",
+        "controlNetControlMode": "Aansturingsmodus",
+        "positivePromptPlaceholder": "Positieve prompt",
+        "maskAdjustmentsHeader": "Maskeraanpassingen",
+        "compositingSettingsHeader": "Instellingen afbeeldingsopbouw",
+        "coherencePassHeader": "Coherentiestap",
+        "maskBlur": "Vervaag",
+        "maskBlurMethod": "Vervagingsmethode",
+        "coherenceSteps": "Stappen",
+        "coherenceStrength": "Sterkte",
+        "seamHighThreshold": "Hoog",
+        "seamLowThreshold": "Laag",
+        "invoke": {
+            "noNodesInGraph": "Geen knooppunten in graaf",
+            "noModelSelected": "Geen model ingesteld",
+            "invoke": "Start",
+            "noPrompts": "Geen prompts gegenereerd",
+            "systemBusy": "Systeem is bezig",
+            "noInitialImageSelected": "Geen initiële afbeelding gekozen",
+            "missingInputForField": "{{nodeLabel}} -> {{fieldLabel}} invoer ontbreekt",
+            "noControlImageForControlAdapter": "Controle-adapter #{{number}} heeft geen controle-afbeelding",
+            "noModelForControlAdapter": "Control-adapter #{{number}} heeft geen model ingesteld staan.",
+            "unableToInvoke": "Kan niet starten",
+            "incompatibleBaseModelForControlAdapter": "Model van controle-adapter #{{number}} is ongeldig in combinatie met het hoofdmodel.",
+            "systemDisconnected": "Systeem is niet verbonden",
+            "missingNodeTemplate": "Knooppuntsjabloon ontbreekt",
+            "readyToInvoke": "Klaar om te starten",
+            "missingFieldTemplate": "Veldsjabloon ontbreekt",
+            "addingImagesTo": "Bezig met toevoegen van afbeeldingen aan"
+        },
+        "seamlessX&Y": "Naadloos X en Y",
+        "isAllowedToUpscale": {
+            "useX2Model": "Afbeelding is te groot om te vergroten met het x4-model. Gebruik hiervoor het x2-model",
+            "tooLarge": "Afbeelding is te groot om te vergoten. Kies een kleinere afbeelding"
+        },
+        "aspectRatioFree": "Vrij",
+        "cpuNoise": "CPU-ruis",
+        "patchmatchDownScaleSize": "Verklein",
+        "gpuNoise": "GPU-ruis",
+        "seamlessX": "Naadloos X",
+        "useCpuNoise": "Gebruik CPU-ruis",
+        "clipSkipWithLayerCount": "Overslaan CLIP {{layerCount}}",
+        "seamlessY": "Naadloos Y",
+        "manualSeed": "Handmatige seedwaarde",
+        "imageActions": "Afbeeldingshandeling",
+        "randomSeed": "Willekeurige seedwaarde",
+        "iterations": "Iteraties",
+        "iterationsWithCount_one": "{{count}} iteratie",
+        "iterationsWithCount_other": "{{count}} iteraties",
+        "enableNoiseSettings": "Schakel ruisinstellingen in",
+        "coherenceMode": "Modus"
     },
     "settings": {
         "models": "Modellen",
-        "displayInProgress": "Toon afbeeldingen gedurende verwerking",
+        "displayInProgress": "Toon voortgangsafbeeldingen",
         "saveSteps": "Bewaar afbeeldingen elke n stappen",
         "confirmOnDelete": "Bevestig bij verwijderen",
         "displayHelpIcons": "Toon hulppictogrammen",
-        "useCanvasBeta": "Gebruik bètavormgeving van canvas",
         "enableImageDebugging": "Schakel foutopsporing afbeelding in",
         "resetWebUI": "Herstel web-UI",
         "resetWebUIDesc1": "Herstel web-UI herstelt alleen de lokale afbeeldingscache en de onthouden instellingen van je browser. Het verwijdert geen afbeeldingen van schijf.",
         "resetWebUIDesc2": "Als afbeeldingen niet getoond worden in de galerij of iets anders werkt niet, probeer dan eerst deze herstelfunctie voordat je een fout aanmeldt op GitHub.",
-        "resetComplete": "Webgebruikersinterface is hersteld. Vernieuw de pasgina om opnieuw te laden.",
-        "useSlidersForAll": "Gebruik schuifbalken voor alle opties"
+        "resetComplete": "Webgebruikersinterface is hersteld.",
+        "useSlidersForAll": "Gebruik schuifbalken voor alle opties",
+        "consoleLogLevel": "Logboekniveau",
+        "shouldLogToConsole": "Schrijf logboek naar console",
+        "developer": "Ontwikkelaar",
+        "general": "Algemeen",
+        "showProgressInViewer": "Toon voortgangsafbeeldingen in viewer",
+        "generation": "Generatie",
+        "ui": "Gebruikersinterface",
+        "antialiasProgressImages": "Voer anti-aliasing uit op voortgangsafbeeldingen",
+        "showAdvancedOptions": "Toon uitgebreide opties",
+        "favoriteSchedulers": "Favoriete planners",
+        "favoriteSchedulersPlaceholder": "Geen favoriete planners ingesteld",
+        "beta": "Bèta",
+        "experimental": "Experimenteel",
+        "alternateCanvasLayout": "Omwisselen Canvas Layout",
+        "enableNodesEditor": "Knopen Editor Inschakelen",
+        "autoChangeDimensions": "Werk bij wijziging afmetingen bij naar modelstandaard",
+        "clearIntermediates": "Wis tussentijdse afbeeldingen",
+        "clearIntermediatesDesc3": "Je galerijafbeeldingen zullen niet worden verwijderd.",
+        "clearIntermediatesWithCount_one": "Wis {{count}} tussentijdse afbeelding",
+        "clearIntermediatesWithCount_other": "Wis {{count}} tussentijdse afbeeldingen",
+        "clearIntermediatesDesc2": "Tussentijdse afbeeldingen zijn nevenproducten bij een generatie, die afwijken van de uitvoerafbeeldingen in de galerij. Het wissen van tussentijdse afbeeldingen zal schijfruimte vrijmaken.",
+        "intermediatesCleared_one": "{{count}} tussentijdse afbeelding gewist",
+        "intermediatesCleared_other": "{{count}} tussentijdse afbeeldingen gewist",
+        "clearIntermediatesDesc1": "Het wissen van tussentijdse onderdelen zet de staat van je canvas en ControlNet terug.",
+        "intermediatesClearedFailed": "Fout bij wissen van tussentijdse afbeeldingen"
     },
     "toast": {
         "tempFoldersEmptied": "Tijdelijke map geleegd",
         "uploadFailed": "Upload mislukt",
-        "uploadFailedMultipleImagesDesc": "Meerdere afbeeldingen geplakt, slechts een afbeelding per keer toegestaan",
         "uploadFailedUnableToLoadDesc": "Kan bestand niet laden",
         "downloadImageStarted": "Afbeeldingsdownload gestart",
         "imageCopied": "Afbeelding gekopieerd",
         "imageLinkCopied": "Afbeeldingskoppeling gekopieerd",
         "imageNotLoaded": "Geen afbeelding geladen",
-        "imageNotLoadedDesc": "Geen afbeelding gevonden om te sturen naar de module Afbeelding naar afbeelding",
+        "imageNotLoadedDesc": "Geen afbeeldingen gevonden",
         "imageSavedToGallery": "Afbeelding opgeslagen naar galerij",
         "canvasMerged": "Canvas samengevoegd",
         "sentToImageToImage": "Gestuurd naar Afbeelding naar afbeelding",
@@ -529,7 +672,60 @@
         "metadataLoadFailed": "Fout bij laden metagegevens",
         "initialImageSet": "Initiële afbeelding ingesteld",
         "initialImageNotSet": "Initiële afbeelding niet ingesteld",
-        "initialImageNotSetDesc": "Kan initiële afbeelding niet laden"
+        "initialImageNotSetDesc": "Kan initiële afbeelding niet laden",
+        "serverError": "Serverfout",
+        "disconnected": "Verbinding met server verbroken",
+        "connected": "Verbonden met server",
+        "canceled": "Verwerking geannuleerd",
+        "uploadFailedInvalidUploadDesc": "Moet een enkele PNG- of JPEG-afbeelding zijn",
+        "problemCopyingImageLink": "Kan afbeeldingslink niet kopiëren",
+        "parameterNotSet": "Parameter niet ingesteld",
+        "parameterSet": "Instellen parameters",
+        "nodesSaved": "Knooppunten bewaard",
+        "nodesLoaded": "Knooppunten geladen",
+        "nodesCleared": "Knooppunten weggehaald",
+        "nodesLoadedFailed": "Laden knooppunten mislukt",
+        "problemCopyingImage": "Kan Afbeelding Niet Kopiëren",
+        "nodesNotValidJSON": "Ongeldige JSON",
+        "nodesCorruptedGraph": "Kan niet laden. Graph lijkt corrupt.",
+        "nodesUnrecognizedTypes": "Laden mislukt. Graph heeft onherkenbare types",
+        "nodesBrokenConnections": "Laden mislukt. Sommige verbindingen zijn verbroken.",
+        "nodesNotValidGraph": "Geen geldige knooppunten graph",
+        "baseModelChangedCleared_one": "Basismodel is gewijzigd: {{count}} niet-compatibel submodel weggehaald of uitgeschakeld",
+        "baseModelChangedCleared_other": "Basismodel is gewijzigd: {{count}} niet-compatibele submodellen weggehaald of uitgeschakeld",
+        "imageSavingFailed": "Fout bij bewaren afbeelding",
+        "canvasSentControlnetAssets": "Canvas gestuurd naar ControlNet en Assets",
+        "problemCopyingCanvasDesc": "Kan basislaag niet exporteren",
+        "loadedWithWarnings": "Werkstroom geladen met waarschuwingen",
+        "setInitialImage": "Ingesteld als initiële afbeelding",
+        "canvasCopiedClipboard": "Canvas gekopieerd naar klembord",
+        "setControlImage": "Ingesteld als controle-afbeelding",
+        "setNodeField": "Ingesteld als knooppuntveld",
+        "problemSavingMask": "Fout bij bewaren masker",
+        "problemSavingCanvasDesc": "Kan basislaag niet exporteren",
+        "maskSavedAssets": "Masker bewaard in Assets",
+        "modelAddFailed": "Fout bij toevoegen model",
+        "problemDownloadingCanvas": "Fout bij downloaden van canvas",
+        "problemMergingCanvas": "Fout bij samenvoegen canvas",
+        "setCanvasInitialImage": "Ingesteld als initiële canvasafbeelding",
+        "imageUploaded": "Afbeelding geüpload",
+        "addedToBoard": "Toegevoegd aan bord",
+        "workflowLoaded": "Werkstroom geladen",
+        "modelAddedSimple": "Model toegevoegd",
+        "problemImportingMaskDesc": "Kan masker niet exporteren",
+        "problemCopyingCanvas": "Fout bij kopiëren canvas",
+        "problemSavingCanvas": "Fout bij bewaren canvas",
+        "canvasDownloaded": "Canvas gedownload",
+        "setIPAdapterImage": "Ingesteld als IP-adapterafbeelding",
+        "problemMergingCanvasDesc": "Kan basislaag niet exporteren",
+        "problemDownloadingCanvasDesc": "Kan basislaag niet exporteren",
+        "problemSavingMaskDesc": "Kan masker niet exporteren",
+        "imageSaved": "Afbeelding bewaard",
+        "maskSentControlnetAssets": "Masker gestuurd naar ControlNet en Assets",
+        "canvasSavedGallery": "Canvas bewaard in galerij",
+        "imageUploadFailed": "Fout bij uploaden afbeelding",
+        "modelAdded": "Model toegevoegd: {{modelName}}",
+        "problemImportingMask": "Fout bij importeren masker"
     },
     "tooltip": {
         "feature": {
@@ -603,7 +799,10 @@
         "betaClear": "Wis",
         "betaDarkenOutside": "Verduister buiten tekenvak",
         "betaLimitToBox": "Beperk tot tekenvak",
-        "betaPreserveMasked": "Behoud masker"
+        "betaPreserveMasked": "Behoud masker",
+        "antialiasing": "Anti-aliasing",
+        "showResultsOn": "Toon resultaten (aan)",
+        "showResultsOff": "Toon resultaten (uit)"
     },
     "accessibility": {
         "exitViewer": "Stop viewer",
@@ -624,7 +823,687 @@
         "modifyConfig": "Wijzig configuratie",
         "toggleAutoscroll": "Autom. scrollen aan/uit",
         "toggleLogViewer": "Logboekviewer aan/uit",
-        "showGallery": "Toon galerij",
-        "showOptionsPanel": "Toon deelscherm Opties"
+        "showOptionsPanel": "Toon zijscherm",
+        "menu": "Menu",
+        "showGalleryPanel": "Toon deelscherm Galerij",
+        "loadMore": "Laad meer"
+    },
+    "ui": {
+        "showProgressImages": "Toon voortgangsafbeeldingen",
+        "hideProgressImages": "Verberg voortgangsafbeeldingen",
+        "swapSizes": "Wissel afmetingen om",
+        "lockRatio": "Zet verhouding vast"
+    },
+    "nodes": {
+        "zoomOutNodes": "Uitzoomen",
+        "fitViewportNodes": "Aanpassen aan beeld",
+        "hideMinimapnodes": "Minimap verbergen",
+        "showLegendNodes": "Typelegende veld tonen",
+        "zoomInNodes": "Inzoomen",
+        "hideGraphNodes": "Graph overlay verbergen",
+        "showGraphNodes": "Graph overlay tonen",
+        "showMinimapnodes": "Minimap tonen",
+        "hideLegendNodes": "Typelegende veld verbergen",
+        "reloadNodeTemplates": "Herlaad knooppuntsjablonen",
+        "loadWorkflow": "Laad werkstroom",
+        "resetWorkflow": "Herstel werkstroom",
+        "resetWorkflowDesc": "Weet je zeker dat je deze werkstroom wilt herstellen?",
+        "resetWorkflowDesc2": "Herstel van een werkstroom haalt alle knooppunten, randen en werkstroomdetails weg.",
+        "downloadWorkflow": "Download JSON van werkstroom",
+        "booleanPolymorphicDescription": "Een verzameling Booleanse waarden.",
+        "scheduler": "Planner",
+        "inputField": "Invoerveld",
+        "controlFieldDescription": "Controlegegevens doorgegeven tussen knooppunten.",
+        "skippingUnknownOutputType": "Overslaan van onbekend soort uitvoerveld",
+        "latentsFieldDescription": "Latents kunnen worden doorgegeven tussen knooppunten.",
+        "denoiseMaskFieldDescription": "Ontruisingsmasker kan worden doorgegeven tussen knooppunten",
+        "floatCollectionDescription": "Een verzameling zwevende-kommagetallen.",
+        "missingTemplate": "Ontbrekende sjabloon",
+        "outputSchemaNotFound": "Uitvoerschema niet gevonden",
+        "ipAdapterPolymorphicDescription": "Een verzameling IP-adapters.",
+        "workflowDescription": "Korte beschrijving",
+        "latentsPolymorphicDescription": "Latents kunnen worden doorgegeven tussen knooppunten.",
+        "colorFieldDescription": "Een RGBA-kleur.",
+        "mainModelField": "Model",
+        "unhandledInputProperty": "Onverwerkt invoerkenmerk",
+        "versionUnknown": " Versie onbekend",
+        "ipAdapterCollection": "Verzameling IP-adapters",
+        "conditioningCollection": "Verzameling conditionering",
+        "maybeIncompatible": "Is mogelijk niet compatibel met geïnstalleerde knooppunten",
+        "ipAdapterPolymorphic": "Polymorfisme IP-adapter",
+        "noNodeSelected": "Geen knooppunt gekozen",
+        "addNode": "Voeg knooppunt toe",
+        "unableToValidateWorkflow": "Kan werkstroom niet valideren",
+        "enum": "Enumeratie",
+        "integerPolymorphicDescription": "Een verzameling gehele getallen.",
+        "noOutputRecorded": "Geen uitvoer opgenomen",
+        "updateApp": "Werk app bij",
+        "conditioningCollectionDescription": "Conditionering kan worden doorgegeven tussen knooppunten.",
+        "colorPolymorphic": "Polymorfisme kleur",
+        "colorCodeEdgesHelp": "Kleurgecodeerde randen op basis van hun verbonden velden",
+        "collectionDescription": "Beschrijving",
+        "float": "Zwevende-kommagetal",
+        "workflowContact": "Contactpersoon",
+        "skippingReservedFieldType": "Overslaan van gereserveerd veldsoort",
+        "animatedEdges": "Geanimeerde randen",
+        "booleanCollectionDescription": "Een verzameling van Booleanse waarden.",
+        "sDXLMainModelFieldDescription": "SDXL-modelveld.",
+        "conditioningPolymorphic": "Polymorfisme conditionering",
+        "integer": "Geheel getal",
+        "colorField": "Kleur",
+        "boardField": "Bord",
+        "nodeTemplate": "Sjabloon knooppunt",
+        "latentsCollection": "Verzameling latents",
+        "problemReadingWorkflow": "Fout bij lezen van werkstroom uit afbeelding",
+        "sourceNode": "Bronknooppunt",
+        "nodeOpacity": "Dekking knooppunt",
+        "pickOne": "Kies er een",
+        "collectionItemDescription": "Beschrijving",
+        "integerDescription": "Gehele getallen zijn getallen zonder een decimaalteken.",
+        "outputField": "Uitvoerveld",
+        "unableToLoadWorkflow": "Kan werkstroom niet valideren",
+        "snapToGrid": "Lijn uit op raster",
+        "stringPolymorphic": "Polymorfisme tekenreeks",
+        "conditioningPolymorphicDescription": "Conditionering kan worden doorgegeven tussen knooppunten.",
+        "noFieldsLinearview": "Geen velden toegevoegd aan lineaire weergave",
+        "skipped": "Overgeslagen",
+        "imagePolymorphic": "Polymorfisme afbeelding",
+        "nodeSearch": "Zoek naar knooppunten",
+        "updateNode": "Werk knooppunt bij",
+        "sDXLRefinerModelFieldDescription": "Beschrijving",
+        "imagePolymorphicDescription": "Een verzameling afbeeldingen.",
+        "floatPolymorphic": "Polymorfisme zwevende-kommagetal",
+        "version": "Versie",
+        "doesNotExist": "bestaat niet",
+        "ipAdapterCollectionDescription": "Een verzameling van IP-adapters.",
+        "stringCollectionDescription": "Een verzameling tekenreeksen.",
+        "unableToParseNode": "Kan knooppunt niet inlezen",
+        "controlCollection": "Controle-verzameling",
+        "validateConnections": "Valideer verbindingen en graaf",
+        "stringCollection": "Verzameling tekenreeksen",
+        "inputMayOnlyHaveOneConnection": "Invoer mag slechts een enkele verbinding hebben",
+        "notes": "Opmerkingen",
+        "uNetField": "UNet",
+        "nodeOutputs": "Uitvoer knooppunt",
+        "currentImageDescription": "Toont de huidige afbeelding in de knooppunteditor",
+        "validateConnectionsHelp": "Voorkom dat er ongeldige verbindingen worden gelegd en dat er ongeldige grafen worden aangeroepen",
+        "problemSettingTitle": "Fout bij instellen titel",
+        "ipAdapter": "IP-adapter",
+        "integerCollection": "Verzameling gehele getallen",
+        "collectionItem": "Verzamelingsonderdeel",
+        "noConnectionInProgress": "Geen verbinding bezig te maken",
+        "vaeModelField": "VAE",
+        "controlCollectionDescription": "Controlegegevens doorgegeven tussen knooppunten.",
+        "skippedReservedInput": "Overgeslagen gereserveerd invoerveld",
+        "workflowVersion": "Versie",
+        "noConnectionData": "Geen verbindingsgegevens",
+        "outputFields": "Uitvoervelden",
+        "fieldTypesMustMatch": "Veldsoorten moeten overeenkomen",
+        "workflow": "Werkstroom",
+        "edge": "Rand",
+        "inputNode": "Invoerknooppunt",
+        "enumDescription": "Enumeraties zijn waarden die uit een aantal opties moeten worden gekozen.",
+        "unkownInvocation": "Onbekende aanroepsoort",
+        "loRAModelFieldDescription": "Beschrijving",
+        "imageField": "Afbeelding",
+        "skippedReservedOutput": "Overgeslagen gereserveerd uitvoerveld",
+        "animatedEdgesHelp": "Animeer gekozen randen en randen verbonden met de gekozen knooppunten",
+        "cannotDuplicateConnection": "Kan geen dubbele verbindingen maken",
+        "booleanPolymorphic": "Polymorfisme Booleaanse waarden",
+        "unknownTemplate": "Onbekend sjabloon",
+        "noWorkflow": "Geen werkstroom",
+        "removeLinearView": "Verwijder uit lineaire weergave",
+        "colorCollectionDescription": "Beschrijving",
+        "integerCollectionDescription": "Een verzameling gehele getallen.",
+        "colorPolymorphicDescription": "Een verzameling kleuren.",
+        "sDXLMainModelField": "SDXL-model",
+        "workflowTags": "Labels",
+        "denoiseMaskField": "Ontruisingsmasker",
+        "schedulerDescription": "Beschrijving",
+        "missingCanvaInitImage": "Ontbrekende initialisatie-afbeelding voor canvas",
+        "conditioningFieldDescription": "Conditionering kan worden doorgegeven tussen knooppunten.",
+        "clipFieldDescription": "Submodellen voor tokenizer en text_encoder.",
+        "fullyContainNodesHelp": "Knooppunten moeten zich volledig binnen het keuzevak bevinden om te worden gekozen",
+        "noImageFoundState": "Geen initiële afbeelding gevonden in de staat",
+        "workflowValidation": "Validatiefout werkstroom",
+        "clipField": "Clip",
+        "stringDescription": "Tekenreeksen zijn tekst.",
+        "nodeType": "Soort knooppunt",
+        "noMatchingNodes": "Geen overeenkomende knooppunten",
+        "fullyContainNodes": "Omvat knooppunten volledig om ze te kiezen",
+        "integerPolymorphic": "Polymorfisme geheel getal",
+        "executionStateInProgress": "Bezig",
+        "noFieldType": "Geen soort veld",
+        "colorCollection": "Een verzameling kleuren.",
+        "executionStateError": "Fout",
+        "noOutputSchemaName": "Geen naam voor uitvoerschema gevonden in referentieobject",
+        "ipAdapterModel": "Model IP-adapter",
+        "latentsPolymorphic": "Polymorfisme latents",
+        "vaeModelFieldDescription": "Beschrijving",
+        "skippingInputNoTemplate": "Overslaan van invoerveld zonder sjabloon",
+        "ipAdapterDescription": "Een Afbeeldingsprompt-adapter (IP-adapter).",
+        "boolean": "Booleaanse waarden",
+        "missingCanvaInitMaskImages": "Ontbrekende initialisatie- en maskerafbeeldingen voor canvas",
+        "problemReadingMetadata": "Fout bij lezen van metagegevens uit afbeelding",
+        "stringPolymorphicDescription": "Een verzameling tekenreeksen.",
+        "oNNXModelField": "ONNX-model",
+        "executionStateCompleted": "Voltooid",
+        "node": "Knooppunt",
+        "skippingUnknownInputType": "Overslaan van onbekend soort invoerveld",
+        "workflowAuthor": "Auteur",
+        "currentImage": "Huidige afbeelding",
+        "controlField": "Controle",
+        "workflowName": "Naam",
+        "booleanDescription": "Booleanse waarden zijn waar en onwaar.",
+        "collection": "Verzameling",
+        "ipAdapterModelDescription": "Modelveld IP-adapter",
+        "cannotConnectInputToInput": "Kan invoer niet aan invoer verbinden",
+        "invalidOutputSchema": "Ongeldig uitvoerschema",
+        "boardFieldDescription": "Een galerijbord",
+        "floatDescription": "Zwevende-kommagetallen zijn getallen met een decimaalteken.",
+        "floatPolymorphicDescription": "Een verzameling zwevende-kommagetallen.",
+        "vaeField": "Vae",
+        "conditioningField": "Conditionering",
+        "unhandledOutputProperty": "Onverwerkt uitvoerkenmerk",
+        "workflowNotes": "Opmerkingen",
+        "string": "Tekenreeks",
+        "floatCollection": "Verzameling zwevende-kommagetallen",
+        "latentsField": "Latents",
+        "cannotConnectOutputToOutput": "Kan uitvoer niet aan uitvoer verbinden",
+        "booleanCollection": "Verzameling Booleaanse waarden",
+        "connectionWouldCreateCycle": "Verbinding zou cyclisch worden",
+        "cannotConnectToSelf": "Kan niet aan zichzelf verbinden",
+        "notesDescription": "Voeg opmerkingen toe aan je werkstroom",
+        "unknownField": "Onbekend veld",
+        "inputFields": "Invoervelden",
+        "colorCodeEdges": "Kleurgecodeerde randen",
+        "uNetFieldDescription": "UNet-submodel.",
+        "unknownNode": "Onbekend knooppunt",
+        "imageCollectionDescription": "Een verzameling afbeeldingen.",
+        "mismatchedVersion": "Heeft niet-overeenkomende versie",
+        "vaeFieldDescription": "Vae-submodel.",
+        "imageFieldDescription": "Afbeeldingen kunnen worden doorgegeven tussen knooppunten.",
+        "outputNode": "Uitvoerknooppunt",
+        "addNodeToolTip": "Voeg knooppunt toe (Shift+A, spatie)",
+        "loadingNodes": "Bezig met laden van knooppunten...",
+        "snapToGridHelp": "Lijn knooppunten uit op raster bij verplaatsing",
+        "workflowSettings": "Instellingen werkstroomeditor",
+        "mainModelFieldDescription": "Beschrijving",
+        "sDXLRefinerModelField": "Verfijningsmodel",
+        "loRAModelField": "LoRA",
+        "unableToParseEdge": "Kan rand niet inlezen",
+        "latentsCollectionDescription": "Latents kunnen worden doorgegeven tussen knooppunten.",
+        "oNNXModelFieldDescription": "ONNX-modelveld.",
+        "imageCollection": "Afbeeldingsverzameling"
+    },
+    "controlnet": {
+        "amult": "a_mult",
+        "resize": "Schaal",
+        "showAdvanced": "Toon uitgebreid",
+        "contentShuffleDescription": "Verschuift het materiaal in de afbeelding",
+        "bgth": "bg_th",
+        "addT2IAdapter": "Voeg $t(common.t2iAdapter) toe",
+        "pidi": "PIDI",
+        "importImageFromCanvas": "Importeer afbeelding uit canvas",
+        "lineartDescription": "Zet afbeelding om naar lineart",
+        "normalBae": "Normale BAE",
+        "importMaskFromCanvas": "Importeer masker uit canvas",
+        "hed": "HED",
+        "hideAdvanced": "Verberg uitgebreid",
+        "contentShuffle": "Verschuif materiaal",
+        "controlNetEnabledT2IDisabled": "$t(common.controlNet) ingeschakeld, $t(common.t2iAdapter)s uitgeschakeld",
+        "ipAdapterModel": "Adaptermodel",
+        "resetControlImage": "Zet controle-afbeelding terug",
+        "beginEndStepPercent": "Percentage begin-/eindstap",
+        "mlsdDescription": "Minimalistische herkenning lijnsegmenten",
+        "duplicate": "Maak kopie",
+        "balanced": "Gebalanceerd",
+        "f": "F",
+        "h": "H",
+        "prompt": "Prompt",
+        "depthMidasDescription": "Generatie van diepteblad via Midas",
+        "controlnet": "$t(controlnet.controlAdapter) #{{number}} ($t(common.controlNet))",
+        "openPoseDescription": "Menselijke pose-benadering via Openpose",
+        "control": "Controle",
+        "resizeMode": "Modus schaling",
+        "t2iEnabledControlNetDisabled": "$t(common.t2iAdapter) ingeschakeld, $t(common.controlNet)s uitgeschakeld",
+        "coarse": "Grof",
+        "weight": "Gewicht",
+        "selectModel": "Kies een model",
+        "crop": "Snij bij",
+        "depthMidas": "Diepte (Midas)",
+        "w": "B",
+        "processor": "Verwerker",
+        "addControlNet": "Voeg $t(common.controlNet) toe",
+        "none": "Geen",
+        "incompatibleBaseModel": "Niet-compatibel basismodel:",
+        "enableControlnet": "Schakel ControlNet in",
+        "detectResolution": "Herken resolutie",
+        "controlNetT2IMutexDesc": "Gelijktijdig gebruik van $t(common.controlNet) en $t(common.t2iAdapter) wordt op dit moment niet ondersteund.",
+        "ip_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.ipAdapter))",
+        "pidiDescription": "PIDI-afbeeldingsverwerking",
+        "mediapipeFace": "Mediapipe - Gezicht",
+        "mlsd": "M-LSD",
+        "controlMode": "Controlemodus",
+        "fill": "Vul",
+        "cannyDescription": "Herkenning Canny-rand",
+        "addIPAdapter": "Voeg $t(common.ipAdapter) toe",
+        "lineart": "Lineart",
+        "colorMapDescription": "Genereert een kleurenblad van de afbeelding",
+        "lineartAnimeDescription": "Lineartverwerking in anime-stijl",
+        "t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.t2iAdapter))",
+        "minConfidence": "Min. vertrouwensniveau",
+        "imageResolution": "Resolutie afbeelding",
+        "megaControl": "Zeer veel controle",
+        "depthZoe": "Diepte (Zoe)",
+        "colorMap": "Kleur",
+        "lowThreshold": "Lage drempelwaarde",
+        "autoConfigure": "Configureer verwerker automatisch",
+        "highThreshold": "Hoge drempelwaarde",
+        "normalBaeDescription": "Normale BAE-verwerking",
+        "noneDescription": "Geen verwerking toegepast",
+        "saveControlImage": "Bewaar controle-afbeelding",
+        "openPose": "Openpose",
+        "toggleControlNet": "Zet deze ControlNet aan/uit",
+        "delete": "Verwijder",
+        "controlAdapter_one": "Control-adapter",
+        "controlAdapter_other": "Control-adapters",
+        "safe": "Veilig",
+        "colorMapTileSize": "Grootte tegel",
+        "lineartAnime": "Lineart-anime",
+        "ipAdapterImageFallback": "Geen IP-adapterafbeelding gekozen",
+        "mediapipeFaceDescription": "Gezichtsherkenning met Mediapipe",
+        "canny": "Canny",
+        "depthZoeDescription": "Generatie van diepteblad via Zoe",
+        "hedDescription": "Herkenning van holistisch-geneste randen",
+        "setControlImageDimensions": "Stel afmetingen controle-afbeelding in op B/H",
+        "scribble": "Krabbel",
+        "resetIPAdapterImage": "Zet IP-adapterafbeelding terug",
+        "handAndFace": "Hand en gezicht",
+        "enableIPAdapter": "Schakel IP-adapter in",
+        "maxFaces": "Max. gezichten"
+    },
+    "dynamicPrompts": {
+        "seedBehaviour": {
+            "perPromptDesc": "Gebruik een verschillende seedwaarde per afbeelding",
+            "perIterationLabel": "Seedwaarde per iteratie",
+            "perIterationDesc": "Gebruik een verschillende seedwaarde per iteratie",
+            "perPromptLabel": "Seedwaarde per afbeelding",
+            "label": "Gedrag seedwaarde"
+        },
+        "enableDynamicPrompts": "Schakel dynamische prompts in",
+        "combinatorial": "Combinatorische generatie",
+        "maxPrompts": "Max. prompts",
+        "promptsWithCount_one": "{{count}} prompt",
+        "promptsWithCount_other": "{{count}} prompts",
+        "dynamicPrompts": "Dynamische prompts"
+    },
+    "popovers": {
+        "noiseUseCPU": {
+            "paragraphs": [
+                "Bestuurt of ruis wordt gegenereerd op de CPU of de GPU.",
+                "Met CPU-ruis ingeschakeld zal een bepaalde seedwaarde dezelfde afbeelding opleveren op welke machine dan ook.",
+                "Er is geen prestatieverschil bij het inschakelen van CPU-ruis."
+            ],
+            "heading": "Gebruik CPU-ruis"
+        },
+        "paramScheduler": {
+            "paragraphs": [
+                "De planner bepaalt hoe per keer ruis wordt toegevoegd aan een afbeelding of hoe een monster wordt bijgewerkt op basis van de uitvoer van een model."
+            ],
+            "heading": "Planner"
+        },
+        "scaleBeforeProcessing": {
+            "paragraphs": [
+                "Schaalt het gekozen gebied naar de grootte die het meest geschikt is voor het model, vooraf aan het proces van het afbeeldingen genereren."
+            ],
+            "heading": "Schaal vooraf aan verwerking"
+        },
+        "compositingMaskAdjustments": {
+            "heading": "Aanpassingen masker",
+            "paragraphs": [
+                "Pas het masker aan."
+            ]
+        },
+        "paramRatio": {
+            "heading": "Beeldverhouding",
+            "paragraphs": [
+                "De beeldverhouding van de afmetingen van de afbeelding die wordt gegenereerd.",
+                "Een afbeeldingsgrootte (in aantal pixels) equivalent aan 512x512 wordt aanbevolen voor SD1.5-modellen. Een grootte-equivalent van 1024x1024 wordt aanbevolen voor SDXL-modellen."
+            ]
+        },
+        "compositingCoherenceSteps": {
+            "heading": "Stappen",
+            "paragraphs": [
+                "Het aantal te gebruiken ontruisingsstappen in de coherentiefase.",
+                "Gelijk aan de hoofdparameter Stappen."
+            ]
+        },
+        "dynamicPrompts": {
+            "paragraphs": [
+                "Dynamische prompts vormt een enkele prompt om in vele.",
+                "De basissyntax is \"a {red|green|blue} ball\". Dit zal de volgende drie prompts geven: \"a red ball\", \"a green ball\" en \"a blue ball\".",
+                "Gebruik de syntax zo vaak als je wilt in een enkele prompt, maar zorg ervoor dat het aantal gegenereerde prompts in lijn ligt met de instelling Max. prompts."
+            ],
+            "heading": "Dynamische prompts"
+        },
+        "paramVAE": {
+            "paragraphs": [
+                "Het model gebruikt voor het vertalen van AI-uitvoer naar de uiteindelijke afbeelding."
+            ],
+            "heading": "VAE"
+        },
+        "compositingBlur": {
+            "heading": "Vervaging",
+            "paragraphs": [
+                "De vervagingsstraal van het masker."
+            ]
+        },
+        "paramIterations": {
+            "paragraphs": [
+                "Het aantal te genereren afbeeldingen.",
+                "Als dynamische prompts is ingeschakeld, dan zal elke prompt dit aantal keer gegenereerd worden."
+            ],
+            "heading": "Iteraties"
+        },
+        "paramVAEPrecision": {
+            "heading": "Nauwkeurigheid VAE",
+            "paragraphs": [
+                "De nauwkeurigheid gebruikt tijdens de VAE-codering en -decodering. FP16/halve nauwkeurig is efficiënter, ten koste van kleine afbeeldingsvariaties."
+            ]
+        },
+        "compositingCoherenceMode": {
+            "heading": "Modus",
+            "paragraphs": [
+                "De modus van de coherentiefase."
+            ]
+        },
+        "paramSeed": {
+            "paragraphs": [
+                "Bestuurt de startruis die gebruikt wordt bij het genereren.",
+                "Schakel \"Willekeurige seedwaarde\" uit om identieke resultaten te krijgen met dezelfde generatie-instellingen."
+            ],
+            "heading": "Seedwaarde"
+        },
+        "controlNetResizeMode": {
+            "heading": "Schaalmodus",
+            "paragraphs": [
+                "Hoe de ControlNet-afbeelding zal worden geschaald aan de uitvoergrootte van de afbeelding."
+            ]
+        },
+        "controlNetBeginEnd": {
+            "paragraphs": [
+                "Op welke stappen van het ontruisingsproces ControlNet worden toegepast.",
+                "ControlNets die worden toegepast aan het begin begeleiden het compositieproces. ControlNets die worden toegepast aan het eind zorgen voor details."
+            ],
+            "heading": "Percentage begin- / eindstap"
+        },
+        "dynamicPromptsSeedBehaviour": {
+            "paragraphs": [
+                "Bestuurt hoe de seedwaarde wordt gebruikt bij het genereren van prompts.",
+                "Per iteratie zal een unieke seedwaarde worden gebruikt voor elke iteratie. Gebruik dit om de promptvariaties binnen een enkele seedwaarde te verkennen.",
+                "Bijvoorbeeld: als je vijf prompts heb, dan zal voor elke afbeelding dezelfde seedwaarde gebruikt worden.",
+                "De optie Per afbeelding zal een unieke seedwaarde voor elke afbeelding gebruiken. Dit biedt meer variatie."
+            ],
+            "heading": "Gedrag seedwaarde"
+        },
+        "clipSkip": {
+            "paragraphs": [
+                "Kies hoeveel CLIP-modellagen je wilt overslaan.",
+                "Bepaalde modellen werken beter met bepaalde Overslaan CLIP-instellingen.",
+                "Een hogere waarde geeft meestal een minder gedetailleerde afbeelding."
+            ],
+            "heading": "Overslaan CLIP"
+        },
+        "paramModel": {
+            "heading": "Model",
+            "paragraphs": [
+                "Model gebruikt voor de ontruisingsstappen.",
+                "Verschillende modellen zijn meestal getraind zich te specialiseren in het maken van bepaalde esthetische resultaten en materiaal."
+            ]
+        },
+        "compositingCoherencePass": {
+            "heading": "Coherentiefase",
+            "paragraphs": [
+                "Een tweede ronde ontruising helpt bij het samenstellen van de erin- of eruitgetekende afbeelding."
+            ]
+        },
+        "paramDenoisingStrength": {
+            "paragraphs": [
+                "Hoeveel ruis wordt toegevoegd aan de invoerafbeelding.",
+                "0 geeft een identieke afbeelding, waarbij 1 een volledig nieuwe afbeelding geeft."
+            ],
+            "heading": "Ontruisingssterkte"
+        },
+        "compositingStrength": {
+            "heading": "Sterkte",
+            "paragraphs": [
+                "Ontruisingssterkte voor de coherentiefase.",
+                "Gelijk aan de parameter Ontruisingssterkte Afbeelding naar afbeelding."
+            ]
+        },
+        "paramNegativeConditioning": {
+            "paragraphs": [
+                "Het generatieproces voorkomt de gegeven begrippen in de negatieve prompt. Gebruik dit om bepaalde zaken of voorwerpen uit te sluiten van de uitvoerafbeelding.",
+                "Ondersteunt Compel-syntax en -embeddingen."
+            ],
+            "heading": "Negatieve prompt"
+        },
+        "compositingBlurMethod": {
+            "heading": "Vervagingsmethode",
+            "paragraphs": [
+                "De methode van de vervaging die wordt toegepast op het gemaskeerd gebied."
+            ]
+        },
+        "dynamicPromptsMaxPrompts": {
+            "heading": "Max. prompts",
+            "paragraphs": [
+                "Beperkt het aantal prompts die kunnen worden gegenereerd door dynamische prompts."
+            ]
+        },
+        "infillMethod": {
+            "paragraphs": [
+                "Methode om een gekozen gebied in te vullen."
+            ],
+            "heading": "Invulmethode"
+        },
+        "controlNetWeight": {
+            "heading": "Gewicht",
+            "paragraphs": [
+                "Hoe sterk ControlNet effect heeft op de gegeneerde afbeelding."
+            ]
+        },
+        "controlNet": {
+            "heading": "ControlNet",
+            "paragraphs": [
+                "ControlNets biedt begeleiding aan het generatieproces, waarbij hulp wordt geboden bij het maken van afbeelding met aangestuurde compositie, structuur of stijl, afhankelijk van het gekozen model."
+            ]
+        },
+        "paramCFGScale": {
+            "heading": "CFG-schaal",
+            "paragraphs": [
+                "Bestuurt hoeveel je prompt invloed heeft op het generatieproces."
+            ]
+        },
+        "controlNetControlMode": {
+            "paragraphs": [
+                "Geeft meer gewicht aan ofwel de prompt danwel ControlNet."
+            ],
+            "heading": "Controlemodus"
+        },
+        "paramSteps": {
+            "heading": "Stappen",
+            "paragraphs": [
+                "Het aantal uit te voeren stappen tijdens elke generatie.",
+                "Hogere stappenaantallen geven meestal betere afbeeldingen ten koste van een grotere benodigde generatietijd."
+            ]
+        },
+        "paramPositiveConditioning": {
+            "heading": "Positieve prompt",
+            "paragraphs": [
+                "Begeleidt het generartieproces. Gebruik een woord of frase naar keuze.",
+                "Syntaxes en embeddings voor Compel en dynamische prompts."
+            ]
+        },
+        "lora": {
+            "heading": "Gewicht LoRA",
+            "paragraphs": [
+                "Een hogere LoRA-gewicht zal leiden tot een groter effect op de uiteindelijke afbeelding."
+            ]
+        }
+    },
+    "metadata": {
+        "seamless": "Naadloos",
+        "positivePrompt": "Positieve prompt",
+        "negativePrompt": "Negatieve prompt",
+        "generationMode": "Generatiemodus",
+        "Threshold": "Drempelwaarde ruis",
+        "metadata": "Metagegevens",
+        "strength": "Sterkte Afbeelding naar afbeelding",
+        "seed": "Seedwaarde",
+        "imageDetails": "Afbeeldingsdetails",
+        "perlin": "Perlin-ruis",
+        "model": "Model",
+        "noImageDetails": "Geen afbeeldingsdetails gevonden",
+        "hiresFix": "Optimalisatie voor hoge resolutie",
+        "cfgScale": "CFG-schaal",
+        "fit": "Schaal aanpassen in Afbeelding naar afbeelding",
+        "initImage": "Initiële afbeelding",
+        "recallParameters": "Opnieuw aan te roepen parameters",
+        "height": "Hoogte",
+        "variations": "Paren seedwaarde-gewicht",
+        "noMetaData": "Geen metagegevens gevonden",
+        "width": "Breedte",
+        "createdBy": "Gemaakt door",
+        "workflow": "Werkstroom",
+        "steps": "Stappen",
+        "scheduler": "Planner",
+        "noRecallParameters": "Geen opnieuw uit te voeren parameters gevonden"
+    },
+    "queue": {
+        "status": "Status",
+        "pruneSucceeded": "{{item_count}} voltooide onderdelen uit wachtrij gesnoeid",
+        "cancelTooltip": "Annuleer huidig onderdeel",
+        "queueEmpty": "Wachtrij leeg",
+        "pauseSucceeded": "Verwerker onderbroken",
+        "in_progress": "Bezig",
+        "queueFront": "Voeg toe aan voorkant van wachtrij",
+        "notReady": "Kan niet in wachtrij plaatsen",
+        "batchFailedToQueue": "Fout bij reeks in wachtrij plaatsen",
+        "completed": "Voltooid",
+        "queueBack": "Voeg toe aan wachtrij",
+        "batchValues": "Reekswaarden",
+        "cancelFailed": "Fout bij annuleren onderdeel",
+        "queueCountPrediction": "Voeg {{predicted}} toe aan wachtrij",
+        "batchQueued": "Reeks in wachtrij geplaatst",
+        "pauseFailed": "Fout bij onderbreken verwerker",
+        "clearFailed": "Fout bij wissen van wachtrij",
+        "queuedCount": "{{pending}} wachtend",
+        "front": "begin",
+        "clearSucceeded": "Wachtrij gewist",
+        "pause": "Onderbreek",
+        "pruneTooltip": "Snoei {{item_count}} voltooide onderdelen",
+        "cancelSucceeded": "Onderdeel geannuleerd",
+        "batchQueuedDesc_one": "Voeg {{count}} sessie toe aan het {{direction}} van de wachtrij",
+        "batchQueuedDesc_other": "Voeg {{count}} sessies toe aan het {{direction}} van de wachtrij",
+        "graphQueued": "Graaf in wachtrij geplaatst",
+        "queue": "Wachtrij",
+        "batch": "Reeks",
+        "clearQueueAlertDialog": "Als je de wachtrij onmiddellijk wist, dan worden alle onderdelen die bezig zijn geannuleerd en wordt de gehele wachtrij gewist.",
+        "pending": "Wachtend",
+        "completedIn": "Voltooid na",
+        "resumeFailed": "Fout bij hervatten verwerker",
+        "clear": "Wis",
+        "prune": "Snoei",
+        "total": "Totaal",
+        "canceled": "Geannuleerd",
+        "pruneFailed": "Fout bij snoeien van wachtrij",
+        "cancelBatchSucceeded": "Reeks geannuleerd",
+        "clearTooltip": "Annuleer en wis alle onderdelen",
+        "current": "Huidig",
+        "pauseTooltip": "Onderbreek verwerker",
+        "failed": "Mislukt",
+        "cancelItem": "Annuleer onderdeel",
+        "next": "Volgende",
+        "cancelBatch": "Annuleer reeks",
+        "back": "eind",
+        "cancel": "Annuleer",
+        "session": "Sessie",
+        "queueTotal": "Totaal {{total}}",
+        "resumeSucceeded": "Verwerker hervat",
+        "enqueueing": "Toevoegen van reeks aan wachtrij",
+        "resumeTooltip": "Hervat verwerker",
+        "queueMaxExceeded": "Max. aantal van {{max_queue_size}} overschreden, {{skip}} worden overgeslagen",
+        "resume": "Hervat",
+        "cancelBatchFailed": "Fout bij annuleren van reeks",
+        "clearQueueAlertDialog2": "Weet je zeker dat je de wachtrij wilt wissen?",
+        "item": "Onderdeel",
+        "graphFailedToQueue": "Fout bij toevoegen graaf aan wachtrij"
+    },
+    "sdxl": {
+        "refinerStart": "Startwaarde verfijner",
+        "selectAModel": "Kies een model",
+        "scheduler": "Planner",
+        "cfgScale": "CFG-schaal",
+        "negStylePrompt": "Negatieve-stijlprompt",
+        "noModelsAvailable": "Geen modellen beschikbaar",
+        "refiner": "Verfijner",
+        "negAestheticScore": "Negatieve aantrekkelijkheidsscore",
+        "useRefiner": "Gebruik verfijner",
+        "denoisingStrength": "Sterkte ontruising",
+        "refinermodel": "Verfijnermodel",
+        "posAestheticScore": "Positieve aantrekkelijkheidsscore",
+        "concatPromptStyle": "Plak prompt- en stijltekst aan elkaar",
+        "loading": "Bezig met laden...",
+        "steps": "Stappen",
+        "posStylePrompt": "Positieve-stijlprompt"
+    },
+    "models": {
+        "noMatchingModels": "Geen overeenkomend modellen",
+        "loading": "bezig met laden",
+        "noMatchingLoRAs": "Geen overeenkomende LoRA's",
+        "noLoRAsAvailable": "Geen LoRA's beschikbaar",
+        "noModelsAvailable": "Geen modellen beschikbaar",
+        "selectModel": "Kies een model",
+        "selectLoRA": "Kies een LoRA"
+    },
+    "boards": {
+        "autoAddBoard": "Voeg automatisch bord toe",
+        "topMessage": "Dit bord bevat afbeeldingen die in gebruik zijn door de volgende functies:",
+        "move": "Verplaats",
+        "menuItemAutoAdd": "Voeg dit automatisch toe aan bord",
+        "myBoard": "Mijn bord",
+        "searchBoard": "Zoek borden...",
+        "noMatching": "Geen overeenkomende borden",
+        "selectBoard": "Kies een bord",
+        "cancel": "Annuleer",
+        "addBoard": "Voeg bord toe",
+        "bottomMessage": "Als je dit bord en alle afbeeldingen erop verwijdert, dan worden alle functies teruggezet die ervan gebruik maken.",
+        "uncategorized": "Zonder categorie",
+        "downloadBoard": "Download bord",
+        "changeBoard": "Wijzig bord",
+        "loading": "Bezig met laden...",
+        "clearSearch": "Maak zoekopdracht leeg"
+    },
+    "invocationCache": {
+        "disable": "Schakel uit",
+        "misses": "Mislukt cacheverzoek",
+        "enableFailed": "Fout bij inschakelen aanroepcache",
+        "invocationCache": "Aanroepcache",
+        "clearSucceeded": "Aanroepcache gewist",
+        "enableSucceeded": "Aanroepcache ingeschakeld",
+        "clearFailed": "Fout bij wissen aanroepcache",
+        "hits": "Gelukt cacheverzoek",
+        "disableSucceeded": "Aanroepcache uitgeschakeld",
+        "disableFailed": "Fout bij uitschakelen aanroepcache",
+        "enable": "Schakel in",
+        "clear": "Wis",
+        "maxCacheSize": "Max. grootte cache",
+        "cacheSize": "Grootte cache"
+    },
+    "embedding": {
+        "noMatchingEmbedding": "Geen overeenkomende embeddings",
+        "addEmbedding": "Voeg embedding toe",
+        "incompatibleModel": "Niet-compatibel basismodel:"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/pl.json b/invokeai/frontend/web/public/locales/pl.json
index 246271658a..f77c0c4710 100644
--- a/invokeai/frontend/web/public/locales/pl.json
+++ b/invokeai/frontend/web/public/locales/pl.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Skróty klawiszowe",
-        "themeLabel": "Motyw",
         "languagePickerLabel": "Wybór języka",
         "reportBugLabel": "Zgłoś błąd",
         "settingsLabel": "Ustawienia",
-        "darkTheme": "Ciemny",
-        "lightTheme": "Jasny",
-        "greenTheme": "Zielony",
         "img2img": "Obraz na obraz",
         "unifiedCanvas": "Tryb uniwersalny",
         "nodes": "Węzły",
@@ -43,7 +39,11 @@
         "statusUpscaling": "Powiększanie obrazu",
         "statusUpscalingESRGAN": "Powiększanie (ESRGAN)",
         "statusLoadingModel": "Wczytywanie modelu",
-        "statusModelChanged": "Zmieniono model"
+        "statusModelChanged": "Zmieniono model",
+        "githubLabel": "GitHub",
+        "discordLabel": "Discord",
+        "darkMode": "Tryb ciemny",
+        "lightMode": "Tryb jasny"
     },
     "gallery": {
         "generations": "Wygenerowane",
@@ -56,7 +56,6 @@
         "maintainAspectRatio": "Zachowaj proporcje",
         "autoSwitchNewImages": "Przełączaj na nowe obrazy",
         "singleColumnLayout": "Układ jednokolumnowy",
-        "pinGallery": "Przypnij galerię",
         "allImagesLoaded": "Koniec listy",
         "loadMore": "Wczytaj więcej",
         "noImagesInGallery": "Brak obrazów w galerii"
@@ -274,7 +273,6 @@
         "cfgScale": "Skala CFG",
         "width": "Szerokość",
         "height": "Wysokość",
-        "sampler": "Próbkowanie",
         "seed": "Inicjator",
         "randomizeSeed": "Losowy inicjator",
         "shuffle": "Losuj",
@@ -296,10 +294,6 @@
         "hiresOptim": "Optymalizacja wys. rozdzielczości",
         "imageFit": "Przeskaluj oryginalny obraz",
         "codeformerFidelity": "Dokładność",
-        "seamSize": "Rozmiar",
-        "seamBlur": "Rozmycie",
-        "seamStrength": "Siła",
-        "seamSteps": "Kroki",
         "scaleBeforeProcessing": "Tryb skalowania",
         "scaledWidth": "Sk. do szer.",
         "scaledHeight": "Sk. do wys.",
@@ -310,8 +304,6 @@
         "infillScalingHeader": "Wypełnienie i skalowanie",
         "img2imgStrength": "Wpływ sugestii na obraz",
         "toggleLoopback": "Wł/wył sprzężenie zwrotne",
-        "invoke": "Wywołaj",
-        "promptPlaceholder": "W tym miejscu wprowadź swoje sugestie. [negatywne sugestie], (wzmocnienie), (osłabienie)--, po więcej opcji (np. swap lub blend) zajrzyj do dokumentacji",
         "sendTo": "Wyślij do",
         "sendToImg2Img": "Użyj w trybie \"Obraz na obraz\"",
         "sendToUnifiedCanvas": "Użyj w trybie uniwersalnym",
@@ -324,7 +316,6 @@
         "useAll": "Skopiuj wszystko",
         "useInitImg": "Użyj oryginalnego obrazu",
         "info": "Informacje",
-        "deleteImage": "Usuń obraz",
         "initialImage": "Oryginalny obraz",
         "showOptionsPanel": "Pokaż panel ustawień"
     },
@@ -334,7 +325,6 @@
         "saveSteps": "Zapisuj obrazy co X kroków",
         "confirmOnDelete": "Potwierdzaj usuwanie",
         "displayHelpIcons": "Wyświetlaj ikony pomocy",
-        "useCanvasBeta": "Nowy układ trybu uniwersalnego",
         "enableImageDebugging": "Włącz debugowanie obrazu",
         "resetWebUI": "Zresetuj interfejs",
         "resetWebUIDesc1": "Resetowanie interfejsu wyczyści jedynie dane i ustawienia zapisane w pamięci przeglądarki. Nie usunie żadnych obrazów z dysku.",
@@ -344,7 +334,6 @@
     "toast": {
         "tempFoldersEmptied": "Wyczyszczono folder tymczasowy",
         "uploadFailed": "Błąd przesyłania obrazu",
-        "uploadFailedMultipleImagesDesc": "Możliwe jest przesłanie tylko jednego obrazu na raz",
         "uploadFailedUnableToLoadDesc": "Błąd wczytywania obrazu",
         "downloadImageStarted": "Rozpoczęto pobieranie",
         "imageCopied": "Skopiowano obraz",
@@ -446,5 +435,27 @@
         "betaDarkenOutside": "Przyciemnienie",
         "betaLimitToBox": "Ogranicz do zaznaczenia",
         "betaPreserveMasked": "Zachowaj obszar"
+    },
+    "accessibility": {
+        "zoomIn": "Przybliż",
+        "exitViewer": "Wyjdź z podglądu",
+        "modelSelect": "Wybór modelu",
+        "invokeProgressBar": "Pasek postępu",
+        "reset": "Zerowanie",
+        "useThisParameter": "Użyj tego parametru",
+        "copyMetadataJson": "Kopiuj metadane JSON",
+        "uploadImage": "Wgrywanie obrazu",
+        "previousImage": "Poprzedni obraz",
+        "nextImage": "Następny obraz",
+        "zoomOut": "Oddal",
+        "rotateClockwise": "Obróć zgodnie ze wskazówkami zegara",
+        "rotateCounterClockwise": "Obróć przeciwnie do wskazówek zegara",
+        "flipHorizontally": "Odwróć horyzontalnie",
+        "flipVertically": "Odwróć wertykalnie",
+        "modifyConfig": "Modyfikuj ustawienia",
+        "toggleAutoscroll": "Przełącz autoprzewijanie",
+        "toggleLogViewer": "Przełącz podgląd logów",
+        "showOptionsPanel": "Pokaż panel opcji",
+        "menu": "Menu"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/pt.json b/invokeai/frontend/web/public/locales/pt.json
index 6d19e3ad92..ac9dd50b4d 100644
--- a/invokeai/frontend/web/public/locales/pt.json
+++ b/invokeai/frontend/web/public/locales/pt.json
@@ -1,11 +1,8 @@
 {
     "common": {
-        "greenTheme": "Verde",
         "langArabic": "العربية",
-        "themeLabel": "Tema",
         "reportBugLabel": "Reportar Bug",
         "settingsLabel": "Configurações",
-        "lightTheme": "Claro",
         "langBrPortuguese": "Português do Brasil",
         "languagePickerLabel": "Seletor de Idioma",
         "langDutch": "Nederlands",
@@ -57,14 +54,11 @@
         "statusModelChanged": "Modelo Alterado",
         "githubLabel": "Github",
         "discordLabel": "Discord",
-        "darkTheme": "Escuro",
         "training": "Treinando",
         "statusGeneratingOutpainting": "Geração de Ampliação",
         "statusGenerationComplete": "Geração Completa",
         "statusMergingModels": "Mesclando Modelos",
         "statusMergedModels": "Modelos Mesclados",
-        "oceanTheme": "Oceano",
-        "pinOptionsPanel": "Fixar painel de opções",
         "loading": "A carregar",
         "loadingInvokeAI": "A carregar Invoke AI",
         "langPortuguese": "Português"
@@ -74,7 +68,6 @@
         "gallerySettings": "Configurações de Galeria",
         "maintainAspectRatio": "Mater Proporções",
         "autoSwitchNewImages": "Trocar para Novas Imagens Automaticamente",
-        "pinGallery": "Fixar Galeria",
         "singleColumnLayout": "Disposição em Coluna Única",
         "allImagesLoaded": "Todas as Imagens Carregadas",
         "loadMore": "Carregar Mais",
@@ -407,7 +400,6 @@
         "width": "Largura",
         "seed": "Seed",
         "hiresStrength": "Força da Alta Resolução",
-        "negativePrompts": "Indicações negativas",
         "general": "Geral",
         "randomizeSeed": "Seed Aleatório",
         "shuffle": "Embaralhar",
@@ -425,10 +417,6 @@
         "hiresOptim": "Otimização de Alta Res",
         "imageFit": "Caber Imagem Inicial No Tamanho de Saída",
         "codeformerFidelity": "Fidelidade",
-        "seamSize": "Tamanho da Fronteira",
-        "seamBlur": "Desfoque da Fronteira",
-        "seamStrength": "Força da Fronteira",
-        "seamSteps": "Passos da Fronteira",
         "tileSize": "Tamanho do Ladrilho",
         "boundingBoxHeader": "Caixa Delimitadora",
         "seamCorrectionHeader": "Correção de Fronteira",
@@ -436,12 +424,10 @@
         "img2imgStrength": "Força de Imagem Para Imagem",
         "toggleLoopback": "Ativar Loopback",
         "symmetry": "Simetria",
-        "promptPlaceholder": "Digite o prompt aqui. [tokens negativos], (upweight)++, (downweight)--, trocar e misturar estão disponíveis (veja docs)",
         "sendTo": "Mandar para",
         "openInViewer": "Abrir No Visualizador",
         "closeViewer": "Fechar Visualizador",
         "usePrompt": "Usar Prompt",
-        "deleteImage": "Apagar Imagem",
         "initialImage": "Imagem inicial",
         "showOptionsPanel": "Mostrar Painel de Opções",
         "strength": "Força",
@@ -449,12 +435,10 @@
         "upscale": "Redimensionar",
         "upscaleImage": "Redimensionar Imagem",
         "scaleBeforeProcessing": "Escala Antes do Processamento",
-        "invoke": "Invocar",
         "images": "Imagems",
         "steps": "Passos",
         "cfgScale": "Escala CFG",
         "height": "Altura",
-        "sampler": "Amostrador",
         "imageToImage": "Imagem para Imagem",
         "variationAmount": "Quntidade de Variatções",
         "scaledWidth": "L Escalada",
@@ -481,7 +465,6 @@
     "settings": {
         "confirmOnDelete": "Confirmar Antes de Apagar",
         "displayHelpIcons": "Mostrar Ícones de Ajuda",
-        "useCanvasBeta": "Usar Layout de Telas Beta",
         "enableImageDebugging": "Ativar Depuração de Imagem",
         "useSlidersForAll": "Usar deslizadores para todas as opções",
         "resetWebUIDesc1": "Reiniciar a interface apenas reinicia o cache local do broswer para imagens e configurações lembradas. Não apaga nenhuma imagem do disco.",
@@ -494,7 +477,6 @@
     },
     "toast": {
         "uploadFailed": "Envio Falhou",
-        "uploadFailedMultipleImagesDesc": "Várias imagens copiadas, só é permitido uma imagem de cada vez",
         "uploadFailedUnableToLoadDesc": "Não foj possível carregar o ficheiro",
         "downloadImageStarted": "Download de Imagem Começou",
         "imageNotLoadedDesc": "Nenhuma imagem encontrada a enviar para o módulo de imagem para imagem",
@@ -611,7 +593,6 @@
         "flipVertically": "Espelhar verticalmente",
         "modifyConfig": "Modificar config",
         "toggleAutoscroll": "Alternar rolagem automática",
-        "showGallery": "Mostrar galeria",
         "showOptionsPanel": "Mostrar painel de opções",
         "uploadImage": "Enviar imagem",
         "previousImage": "Imagem anterior",
diff --git a/invokeai/frontend/web/public/locales/pt_BR.json b/invokeai/frontend/web/public/locales/pt_BR.json
index e77ef14719..3b45dbbbf3 100644
--- a/invokeai/frontend/web/public/locales/pt_BR.json
+++ b/invokeai/frontend/web/public/locales/pt_BR.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Teclas de atalho",
-        "themeLabel": "Tema",
         "languagePickerLabel": "Seletor de Idioma",
         "reportBugLabel": "Relatar Bug",
         "settingsLabel": "Configurações",
-        "darkTheme": "Noite",
-        "lightTheme": "Dia",
-        "greenTheme": "Verde",
         "img2img": "Imagem Para Imagem",
         "unifiedCanvas": "Tela Unificada",
         "nodes": "Nódulos",
@@ -63,7 +59,6 @@
         "statusMergedModels": "Modelos Mesclados",
         "langRussian": "Russo",
         "langSpanish": "Espanhol",
-        "pinOptionsPanel": "Fixar painel de opções",
         "loadingInvokeAI": "Carregando Invoke AI",
         "loading": "Carregando"
     },
@@ -78,7 +73,6 @@
         "maintainAspectRatio": "Mater Proporções",
         "autoSwitchNewImages": "Trocar para Novas Imagens Automaticamente",
         "singleColumnLayout": "Disposição em Coluna Única",
-        "pinGallery": "Fixar Galeria",
         "allImagesLoaded": "Todas as Imagens Carregadas",
         "loadMore": "Carregar Mais",
         "noImagesInGallery": "Sem Imagens na Galeria"
@@ -402,7 +396,6 @@
         "cfgScale": "Escala CFG",
         "width": "Largura",
         "height": "Altura",
-        "sampler": "Amostrador",
         "seed": "Seed",
         "randomizeSeed": "Seed Aleatório",
         "shuffle": "Embaralhar",
@@ -424,10 +417,6 @@
         "hiresOptim": "Otimização de Alta Res",
         "imageFit": "Caber Imagem Inicial No Tamanho de Saída",
         "codeformerFidelity": "Fidelidade",
-        "seamSize": "Tamanho da Fronteira",
-        "seamBlur": "Desfoque da Fronteira",
-        "seamStrength": "Força da Fronteira",
-        "seamSteps": "Passos da Fronteira",
         "scaleBeforeProcessing": "Escala Antes do Processamento",
         "scaledWidth": "L Escalada",
         "scaledHeight": "A Escalada",
@@ -438,8 +427,6 @@
         "infillScalingHeader": "Preencimento e Escala",
         "img2imgStrength": "Força de Imagem Para Imagem",
         "toggleLoopback": "Ativar Loopback",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Digite o prompt aqui. [tokens negativos], (upweight)++, (downweight)--, trocar e misturar estão disponíveis (veja docs)",
         "sendTo": "Mandar para",
         "sendToImg2Img": "Mandar para Imagem Para Imagem",
         "sendToUnifiedCanvas": "Mandar para Tela Unificada",
@@ -452,14 +439,12 @@
         "useAll": "Usar Todos",
         "useInitImg": "Usar Imagem Inicial",
         "info": "Informações",
-        "deleteImage": "Apagar Imagem",
         "initialImage": "Imagem inicial",
         "showOptionsPanel": "Mostrar Painel de Opções",
         "vSymmetryStep": "V Passo de Simetria",
         "hSymmetryStep": "H Passo de Simetria",
         "symmetry": "Simetria",
         "copyImage": "Copiar imagem",
-        "negativePrompts": "Indicações negativas",
         "hiresStrength": "Força da Alta Resolução",
         "denoisingStrength": "A força de remoção de ruído",
         "imageToImage": "Imagem para Imagem",
@@ -477,7 +462,6 @@
         "saveSteps": "Salvar imagens a cada n passos",
         "confirmOnDelete": "Confirmar Antes de Apagar",
         "displayHelpIcons": "Mostrar Ícones de Ajuda",
-        "useCanvasBeta": "Usar Layout de Telas Beta",
         "enableImageDebugging": "Ativar Depuração de Imagem",
         "resetWebUI": "Reiniciar Interface",
         "resetWebUIDesc1": "Reiniciar a interface apenas reinicia o cache local do broswer para imagens e configurações lembradas. Não apaga nenhuma imagem do disco.",
@@ -488,7 +472,6 @@
     "toast": {
         "tempFoldersEmptied": "Pasta de Arquivos Temporários Esvaziada",
         "uploadFailed": "Envio Falhou",
-        "uploadFailedMultipleImagesDesc": "Várias imagens copiadas, só é permitido uma imagem de cada vez",
         "uploadFailedUnableToLoadDesc": "Não foj possível carregar o arquivo",
         "downloadImageStarted": "Download de Imagem Começou",
         "imageCopied": "Imagem Copiada",
diff --git a/invokeai/frontend/web/public/locales/ru.json b/invokeai/frontend/web/public/locales/ru.json
index 822389d78a..808db9e803 100644
--- a/invokeai/frontend/web/public/locales/ru.json
+++ b/invokeai/frontend/web/public/locales/ru.json
@@ -1,16 +1,12 @@
 {
     "common": {
         "hotkeysLabel": "Горячие клавиши",
-        "themeLabel": "Тема",
         "languagePickerLabel": "Язык",
         "reportBugLabel": "Сообщить об ошибке",
         "settingsLabel": "Настройки",
-        "darkTheme": "Темная",
-        "lightTheme": "Светлая",
-        "greenTheme": "Зеленая",
         "img2img": "Изображение в изображение (img2img)",
         "unifiedCanvas": "Единый холст",
-        "nodes": "Ноды",
+        "nodes": "Редактор рабочего процесса",
         "langRussian": "Русский",
         "nodesDesc": "Cистема генерации изображений на основе нодов (узлов) уже разрабатывается. Следите за новостями об этой замечательной функции.",
         "postProcessing": "Постобработка",
@@ -49,14 +45,12 @@
         "statusMergingModels": "Слияние моделей",
         "statusModelConverted": "Модель сконвертирована",
         "statusMergedModels": "Модели объединены",
-        "pinOptionsPanel": "Закрепить панель настроек",
         "loading": "Загрузка",
         "loadingInvokeAI": "Загрузка Invoke AI",
         "back": "Назад",
         "statusConvertingModel": "Конвертация модели",
         "cancel": "Отменить",
         "accept": "Принять",
-        "oceanTheme": "Океан",
         "langUkranian": "Украинский",
         "langEnglish": "Английский",
         "postprocessing": "Постобработка",
@@ -74,7 +68,21 @@
         "langPortuguese": "Португальский",
         "txt2img": "Текст в изображение (txt2img)",
         "langBrPortuguese": "Португальский (Бразилия)",
-        "linear": "Линейная обработка"
+        "linear": "Линейная обработка",
+        "dontAskMeAgain": "Больше не спрашивать",
+        "areYouSure": "Вы уверены?",
+        "random": "Случайное",
+        "generate": "Сгенерировать",
+        "openInNewTab": "Открыть в новой вкладке",
+        "imagePrompt": "Запрос",
+        "communityLabel": "Сообщество",
+        "lightMode": "Светлая тема",
+        "batch": "Пакетный менеджер",
+        "modelManager": "Менеджер моделей",
+        "darkMode": "Темная тема",
+        "nodeEditor": "Редактор Нодов (Узлов)",
+        "controlNet": "Controlnet",
+        "advanced": "Расширенные"
     },
     "gallery": {
         "generations": "Генерации",
@@ -87,10 +95,15 @@
         "maintainAspectRatio": "Сохранять пропорции",
         "autoSwitchNewImages": "Автоматически выбирать новые",
         "singleColumnLayout": "Одна колонка",
-        "pinGallery": "Закрепить галерею",
         "allImagesLoaded": "Все изображения загружены",
         "loadMore": "Показать больше",
-        "noImagesInGallery": "Изображений нет"
+        "noImagesInGallery": "Изображений нет",
+        "deleteImagePermanent": "Удаленные изображения невозможно восстановить.",
+        "deleteImageBin": "Удаленные изображения будут отправлены в корзину вашей операционной системы.",
+        "deleteImage": "Удалить изображение",
+        "images": "Изображения",
+        "assets": "Ресурсы",
+        "autoAssignBoardOnClick": "Авто-назначение доски по клику"
     },
     "hotkeys": {
         "keyboardShortcuts": "Горячие клавиши",
@@ -297,7 +310,12 @@
         "acceptStagingImage": {
             "title": "Принять изображение",
             "desc": "Принять текущее изображение"
-        }
+        },
+        "addNodes": {
+            "desc": "Открывает меню добавления узла",
+            "title": "Добавление узлов"
+        },
+        "nodesHotkeys": "Горячие клавиши узлов"
     },
     "modelManager": {
         "modelManager": "Менеджер моделей",
@@ -350,14 +368,14 @@
         "deleteModel": "Удалить модель",
         "deleteConfig": "Удалить конфигурацию",
         "deleteMsg1": "Вы точно хотите удалить модель из InvokeAI?",
-        "deleteMsg2": "Это не удалит файл модели с диска. Позже вы можете добавить его снова.",
+        "deleteMsg2": "Это приведет К УДАЛЕНИЮ модели С ДИСКА, если она находится в корневой папке Invoke. Если вы используете пользовательское расположение, то модель НЕ будет удалена с диска.",
         "repoIDValidationMsg": "Онлайн-репозиторий модели",
-        "convertToDiffusersHelpText5": "Пожалуйста, убедитесь, что у вас достаточно места на диске. Модели обычно занимают 4 – 7 Гб.",
+        "convertToDiffusersHelpText5": "Пожалуйста, убедитесь, что у вас достаточно места на диске. Модели обычно занимают 2–7 Гб.",
         "invokeAIFolder": "Каталог InvokeAI",
         "ignoreMismatch": "Игнорировать несоответствия между выбранными моделями",
         "addCheckpointModel": "Добавить модель Checkpoint/Safetensor",
         "formMessageDiffusersModelLocationDesc": "Укажите хотя бы одно.",
-        "convertToDiffusersHelpText3": "Файл модели на диске НЕ будет удалён или изменён. Вы сможете заново добавить его в Model Manager при необходимости.",
+        "convertToDiffusersHelpText3": "Ваш файл контрольной точки НА ДИСКЕ будет УДАЛЕН, если он находится в корневой папке InvokeAI. Если он находится в пользовательском расположении, то он НЕ будет удален.",
         "vaeRepoID": "ID репозитория VAE",
         "mergedModelName": "Название объединенной модели",
         "checkpointModels": "Checkpoints",
@@ -409,7 +427,27 @@
         "weightedSum": "Взвешенная сумма",
         "safetensorModels": "SafeTensors",
         "v2_768": "v2 (768px)",
-        "v2_base": "v2 (512px)"
+        "v2_base": "v2 (512px)",
+        "modelDeleted": "Модель удалена",
+        "importModels": "Импорт Моделей",
+        "variant": "Вариант",
+        "baseModel": "Базовая модель",
+        "modelsSynced": "Модели синхронизированы",
+        "modelSyncFailed": "Не удалось синхронизировать модели",
+        "vae": "VAE",
+        "modelDeleteFailed": "Не удалось удалить модель",
+        "noCustomLocationProvided": "Пользовательское местоположение не указано",
+        "convertingModelBegin": "Конвертация модели. Пожалуйста, подождите.",
+        "settings": "Настройки",
+        "selectModel": "Выберите модель",
+        "syncModels": "Синхронизация моделей",
+        "syncModelsDesc": "Если ваши модели не синхронизированы с серверной частью, вы можете обновить их, используя эту опцию. Обычно это удобно в тех случаях, когда вы вручную обновляете свой файл \"models.yaml\" или добавляете модели в корневую папку InvokeAI после загрузки приложения.",
+        "modelUpdateFailed": "Не удалось обновить модель",
+        "modelConversionFailed": "Не удалось сконвертировать модель",
+        "modelsMergeFailed": "Не удалось выполнить слияние моделей",
+        "loraModels": "LoRAs",
+        "onnxModels": "Onnx",
+        "oliveModels": "Olives"
     },
     "parameters": {
         "images": "Изображения",
@@ -417,10 +455,9 @@
         "cfgScale": "Уровень CFG",
         "width": "Ширина",
         "height": "Высота",
-        "sampler": "Семплер",
         "seed": "Сид",
         "randomizeSeed": "Случайный сид",
-        "shuffle": "Обновить",
+        "shuffle": "Обновить сид",
         "noiseThreshold": "Порог шума",
         "perlinNoise": "Шум Перлина",
         "variations": "Вариации",
@@ -439,10 +476,6 @@
         "hiresOptim": "Оптимизация High Res",
         "imageFit": "Уместить изображение",
         "codeformerFidelity": "Точность",
-        "seamSize": "Размер шва",
-        "seamBlur": "Размытие шва",
-        "seamStrength": "Сила шва",
-        "seamSteps": "Шаги шва",
         "scaleBeforeProcessing": "Масштабировать",
         "scaledWidth": "Масштаб Ш",
         "scaledHeight": "Масштаб В",
@@ -453,8 +486,6 @@
         "infillScalingHeader": "Заполнение и масштабирование",
         "img2imgStrength": "Сила обработки img2img",
         "toggleLoopback": "Зациклить обработку",
-        "invoke": "Invoke",
-        "promptPlaceholder": "Введите запрос здесь (на английском). [исключенные токены], (более значимые)++, (менее значимые)--, swap и blend тоже доступны (смотрите Github)",
         "sendTo": "Отправить",
         "sendToImg2Img": "Отправить в img2img",
         "sendToUnifiedCanvas": "Отправить на Единый холст",
@@ -467,7 +498,6 @@
         "useAll": "Использовать все",
         "useInitImg": "Использовать как исходное",
         "info": "Метаданные",
-        "deleteImage": "Удалить изображение",
         "initialImage": "Исходное изображение",
         "showOptionsPanel": "Показать панель настроек",
         "vSymmetryStep": "Шаг верт. симметрии",
@@ -485,8 +515,27 @@
         "imageToImage": "Изображение в изображение",
         "denoisingStrength": "Сила шумоподавления",
         "copyImage": "Скопировать изображение",
-        "negativePrompts": "Исключающий запрос",
-        "showPreview": "Показать предпросмотр"
+        "showPreview": "Показать предпросмотр",
+        "noiseSettings": "Шум",
+        "seamlessXAxis": "Ось X",
+        "seamlessYAxis": "Ось Y",
+        "scheduler": "Планировщик",
+        "boundingBoxWidth": "Ширина ограничивающей рамки",
+        "boundingBoxHeight": "Высота ограничивающей рамки",
+        "positivePromptPlaceholder": "Запрос",
+        "negativePromptPlaceholder": "Исключающий запрос",
+        "controlNetControlMode": "Режим управления",
+        "clipSkip": "CLIP Пропуск",
+        "aspectRatio": "Соотношение",
+        "maskAdjustmentsHeader": "Настройка маски",
+        "maskBlur": "Размытие",
+        "maskBlurMethod": "Метод размытия",
+        "seamLowThreshold": "Низкий",
+        "seamHighThreshold": "Высокий",
+        "coherenceSteps": "Шагов",
+        "coherencePassHeader": "Порог Coherence",
+        "coherenceStrength": "Сила",
+        "compositingSettingsHeader": "Настройки компоновки"
     },
     "settings": {
         "models": "Модели",
@@ -494,24 +543,38 @@
         "saveSteps": "Сохранять каждые n щагов",
         "confirmOnDelete": "Подтверждать удаление",
         "displayHelpIcons": "Показывать значки подсказок",
-        "useCanvasBeta": "Показывать инструменты слева (Beta UI)",
         "enableImageDebugging": "Включить отладку",
         "resetWebUI": "Сброс настроек Web UI",
         "resetWebUIDesc1": "Сброс настроек веб-интерфейса удаляет только локальный кэш браузера с вашими изображениями и настройками. Он не удаляет изображения с диска.",
         "resetWebUIDesc2": "Если изображения не отображаются в галерее или не работает что-то еще, пожалуйста, попробуйте сбросить настройки, прежде чем сообщать о проблеме на GitHub.",
-        "resetComplete": "Интерфейс сброшен. Обновите эту страницу.",
-        "useSlidersForAll": "Использовать ползунки для всех параметров"
+        "resetComplete": "Настройки веб-интерфейса были сброшены.",
+        "useSlidersForAll": "Использовать ползунки для всех параметров",
+        "consoleLogLevel": "Уровень логирования",
+        "shouldLogToConsole": "Логи в консоль",
+        "developer": "Разработчик",
+        "general": "Основное",
+        "showProgressInViewer": "Показывать процесс генерации в Просмотрщике",
+        "antialiasProgressImages": "Сглаживать предпоказ процесса генерации",
+        "generation": "Поколение",
+        "ui": "Пользовательский интерфейс",
+        "favoriteSchedulers": "Избранные планировщики",
+        "favoriteSchedulersPlaceholder": "Нет избранных планировщиков",
+        "enableNodesEditor": "Включить редактор узлов",
+        "experimental": "Экспериментальные",
+        "beta": "Бета",
+        "alternateCanvasLayout": "Альтернативный слой холста",
+        "showAdvancedOptions": "Показать доп. параметры",
+        "autoChangeDimensions": "Обновить Ш/В на стандартные для модели при изменении"
     },
     "toast": {
         "tempFoldersEmptied": "Временная папка очищена",
         "uploadFailed": "Загрузка не удалась",
-        "uploadFailedMultipleImagesDesc": "Можно вставить только одно изображение (вы попробовали вставить несколько)",
         "uploadFailedUnableToLoadDesc": "Невозможно загрузить файл",
         "downloadImageStarted": "Скачивание изображения началось",
         "imageCopied": "Изображение скопировано",
         "imageLinkCopied": "Ссылка на изображение скопирована",
         "imageNotLoaded": "Изображение не загружено",
-        "imageNotLoadedDesc": "Не найдены изображения для отправки в img2img",
+        "imageNotLoadedDesc": "Не удалось найти изображение",
         "imageSavedToGallery": "Изображение сохранено в галерею",
         "canvasMerged": "Холст объединен",
         "sentToImageToImage": "Отправить в img2img",
@@ -536,7 +599,21 @@
         "serverError": "Ошибка сервера",
         "disconnected": "Отключено от сервера",
         "connected": "Подключено к серверу",
-        "canceled": "Обработка отменена"
+        "canceled": "Обработка отменена",
+        "problemCopyingImageLink": "Не удалось скопировать ссылку на изображение",
+        "uploadFailedInvalidUploadDesc": "Должно быть одно изображение в формате PNG или JPEG",
+        "parameterNotSet": "Параметр не задан",
+        "parameterSet": "Параметр задан",
+        "nodesLoaded": "Узлы загружены",
+        "problemCopyingImage": "Не удается скопировать изображение",
+        "nodesLoadedFailed": "Не удалось загрузить Узлы",
+        "nodesCleared": "Узлы очищены",
+        "nodesBrokenConnections": "Не удается загрузить. Некоторые соединения повреждены.",
+        "nodesUnrecognizedTypes": "Не удается загрузить. Граф имеет нераспознанные типы",
+        "nodesNotValidJSON": "Недопустимый JSON",
+        "nodesCorruptedGraph": "Не удается загрузить. Граф, похоже, поврежден.",
+        "nodesSaved": "Узлы сохранены",
+        "nodesNotValidGraph": "Недопустимый граф узлов InvokeAI"
     },
     "tooltip": {
         "feature": {
@@ -610,7 +687,8 @@
         "betaClear": "Очистить",
         "betaDarkenOutside": "Затемнить снаружи",
         "betaLimitToBox": "Ограничить выделением",
-        "betaPreserveMasked": "Сохранять маскируемую область"
+        "betaPreserveMasked": "Сохранять маскируемую область",
+        "antialiasing": "Не удалось скопировать ссылку на изображение"
     },
     "accessibility": {
         "modelSelect": "Выбор модели",
@@ -625,8 +703,7 @@
         "flipHorizontally": "Отразить горизонтально",
         "toggleAutoscroll": "Включить автопрокрутку",
         "toggleLogViewer": "Показать или скрыть просмотрщик логов",
-        "showOptionsPanel": "Показать опции",
-        "showGallery": "Показать галерею",
+        "showOptionsPanel": "Показать боковую панель",
         "invokeProgressBar": "Индикатор выполнения",
         "reset": "Сброс",
         "modifyConfig": "Изменить конфиг",
@@ -634,5 +711,69 @@
         "copyMetadataJson": "Скопировать метаданные JSON",
         "exitViewer": "Закрыть просмотрщик",
         "menu": "Меню"
+    },
+    "ui": {
+        "showProgressImages": "Показывать промежуточный итог",
+        "hideProgressImages": "Не показывать промежуточный итог",
+        "swapSizes": "Поменять местами размеры",
+        "lockRatio": "Зафиксировать пропорции"
+    },
+    "nodes": {
+        "zoomInNodes": "Увеличьте масштаб",
+        "zoomOutNodes": "Уменьшите масштаб",
+        "fitViewportNodes": "Уместить вид",
+        "hideGraphNodes": "Скрыть оверлей графа",
+        "showGraphNodes": "Показать оверлей графа",
+        "showLegendNodes": "Показать тип поля",
+        "hideMinimapnodes": "Скрыть миникарту",
+        "hideLegendNodes": "Скрыть тип поля",
+        "showMinimapnodes": "Показать миникарту",
+        "loadWorkflow": "Загрузить рабочий процесс",
+        "resetWorkflowDesc2": "Сброс рабочего процесса очистит все узлы, ребра и детали рабочего процесса.",
+        "resetWorkflow": "Сбросить рабочий процесс",
+        "resetWorkflowDesc": "Вы уверены, что хотите сбросить этот рабочий процесс?",
+        "reloadNodeTemplates": "Перезагрузить шаблоны узлов",
+        "downloadWorkflow": "Скачать JSON рабочего процесса"
+    },
+    "controlnet": {
+        "amult": "a_mult",
+        "contentShuffleDescription": "Перетасовывает содержимое изображения",
+        "bgth": "bg_th",
+        "contentShuffle": "Перетасовка содержимого",
+        "beginEndStepPercent": "Процент начала/конца шага",
+        "duplicate": "Дублировать",
+        "balanced": "Сбалансированный",
+        "f": "F",
+        "depthMidasDescription": "Генерация карты глубины с использованием Midas",
+        "control": "Контроль",
+        "coarse": "Грубость обработки",
+        "crop": "Обрезка",
+        "depthMidas": "Глубина (Midas)",
+        "enableControlnet": "Включить ControlNet",
+        "detectResolution": "Определить разрешение",
+        "controlMode": "Режим контроля",
+        "cannyDescription": "Детектор границ Canny",
+        "depthZoe": "Глубина (Zoe)",
+        "autoConfigure": "Автонастройка процессора",
+        "delete": "Удалить",
+        "canny": "Canny",
+        "depthZoeDescription": "Генерация карты глубины с использованием Zoe"
+    },
+    "boards": {
+        "autoAddBoard": "Авто добавление Доски",
+        "topMessage": "Эта доска содержит изображения, используемые в следующих функциях:",
+        "move": "Перемещение",
+        "menuItemAutoAdd": "Авто добавление на эту доску",
+        "myBoard": "Моя Доска",
+        "searchBoard": "Поиск Доски...",
+        "noMatching": "Нет подходящих Досок",
+        "selectBoard": "Выбрать Доску",
+        "cancel": "Отменить",
+        "addBoard": "Добавить Доску",
+        "bottomMessage": "Удаление этой доски и ее изображений приведет к сбросу всех функций, использующихся их в данный момент.",
+        "uncategorized": "Без категории",
+        "changeBoard": "Изменить Доску",
+        "loading": "Загрузка...",
+        "clearSearch": "Очистить поиск"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/sv.json b/invokeai/frontend/web/public/locales/sv.json
index da2266135d..eef46c4513 100644
--- a/invokeai/frontend/web/public/locales/sv.json
+++ b/invokeai/frontend/web/public/locales/sv.json
@@ -15,7 +15,6 @@
         "reset": "Starta om",
         "previousImage": "Föregående bild",
         "useThisParameter": "Använd denna parametern",
-        "showGallery": "Visa galleri",
         "rotateCounterClockwise": "Rotera moturs",
         "rotateClockwise": "Rotera medurs",
         "modifyConfig": "Ändra konfiguration",
@@ -27,10 +26,6 @@
         "githubLabel": "Github",
         "discordLabel": "Discord",
         "settingsLabel": "Inställningar",
-        "darkTheme": "Mörk",
-        "lightTheme": "Ljus",
-        "greenTheme": "Grön",
-        "oceanTheme": "Hav",
         "langEnglish": "Engelska",
         "langDutch": "Nederländska",
         "langFrench": "Franska",
@@ -63,12 +58,10 @@
         "statusGenerationComplete": "Generering klar",
         "statusModelConverted": "Modell konverterad",
         "statusMergingModels": "Sammanfogar modeller",
-        "pinOptionsPanel": "Nåla fast inställningspanelen",
         "loading": "Laddar",
         "loadingInvokeAI": "Laddar Invoke AI",
         "statusRestoringFaces": "Återskapar ansikten",
         "languagePickerLabel": "Språkväljare",
-        "themeLabel": "Tema",
         "txt2img": "Text till bild",
         "nodes": "Noder",
         "img2img": "Bild till bild",
@@ -108,7 +101,6 @@
         "galleryImageResetSize": "Återställ storlek",
         "gallerySettings": "Galleriinställningar",
         "maintainAspectRatio": "Behåll bildförhållande",
-        "pinGallery": "Nåla fast galleri",
         "noImagesInGallery": "Inga bilder i galleriet",
         "autoSwitchNewImages": "Ändra automatiskt till nya bilder",
         "singleColumnLayout": "Enkolumnslayout"
diff --git a/invokeai/frontend/web/public/locales/tr.json b/invokeai/frontend/web/public/locales/tr.json
index 316908b4a9..0c222eecf7 100644
--- a/invokeai/frontend/web/public/locales/tr.json
+++ b/invokeai/frontend/web/public/locales/tr.json
@@ -19,21 +19,15 @@
         "reset": "Sıfırla",
         "uploadImage": "Resim Yükle",
         "previousImage": "Önceki Resim",
-        "menu": "Menü",
-        "showGallery": "Galeriyi Göster"
+        "menu": "Menü"
     },
     "common": {
         "hotkeysLabel": "Kısayol Tuşları",
-        "themeLabel": "Tema",
         "languagePickerLabel": "Dil Seçimi",
         "reportBugLabel": "Hata Bildir",
         "githubLabel": "Github",
         "discordLabel": "Discord",
         "settingsLabel": "Ayarlar",
-        "darkTheme": "Karanlık Tema",
-        "lightTheme": "Aydınlık Tema",
-        "greenTheme": "Yeşil Tema",
-        "oceanTheme": "Okyanus Tema",
         "langArabic": "Arapça",
         "langEnglish": "İngilizce",
         "langDutch": "Hollandaca",
diff --git a/invokeai/frontend/web/public/locales/uk.json b/invokeai/frontend/web/public/locales/uk.json
index 8261aa82e0..a85faee727 100644
--- a/invokeai/frontend/web/public/locales/uk.json
+++ b/invokeai/frontend/web/public/locales/uk.json
@@ -1,13 +1,9 @@
 {
     "common": {
         "hotkeysLabel": "Гарячi клавіші",
-        "themeLabel": "Тема",
         "languagePickerLabel": "Мова",
         "reportBugLabel": "Повідомити про помилку",
         "settingsLabel": "Налаштування",
-        "darkTheme": "Темна",
-        "lightTheme": "Світла",
-        "greenTheme": "Зелена",
         "img2img": "Зображення із зображення (img2img)",
         "unifiedCanvas": "Універсальне полотно",
         "nodes": "Вузли",
@@ -55,8 +51,6 @@
         "langHebrew": "Іврит",
         "langKorean": "Корейська",
         "langPortuguese": "Португальська",
-        "pinOptionsPanel": "Закріпити панель налаштувань",
-        "oceanTheme": "Океан",
         "langArabic": "Арабська",
         "langSimplifiedChinese": "Китайська (спрощена)",
         "langSpanish": "Іспанська",
@@ -87,7 +81,6 @@
         "maintainAspectRatio": "Зберігати пропорції",
         "autoSwitchNewImages": "Автоматично вибирати нові",
         "singleColumnLayout": "Одна колонка",
-        "pinGallery": "Закріпити галерею",
         "allImagesLoaded": "Всі зображення завантажені",
         "loadMore": "Завантажити більше",
         "noImagesInGallery": "Зображень немає"
@@ -417,7 +410,6 @@
         "cfgScale": "Рівень CFG",
         "width": "Ширина",
         "height": "Висота",
-        "sampler": "Семплер",
         "seed": "Сід",
         "randomizeSeed": "Випадковий сид",
         "shuffle": "Оновити",
@@ -439,10 +431,6 @@
         "hiresOptim": "Оптимізація High Res",
         "imageFit": "Вмістити зображення",
         "codeformerFidelity": "Точність",
-        "seamSize": "Размір шву",
-        "seamBlur": "Розмиття шву",
-        "seamStrength": "Сила шву",
-        "seamSteps": "Кроки шву",
         "scaleBeforeProcessing": "Масштабувати",
         "scaledWidth": "Масштаб Ш",
         "scaledHeight": "Масштаб В",
@@ -453,8 +441,6 @@
         "infillScalingHeader": "Заповнення і масштабування",
         "img2imgStrength": "Сила обробки img2img",
         "toggleLoopback": "Зациклити обробку",
-        "invoke": "Викликати",
-        "promptPlaceholder": "Введіть запит тут (англійською). [видалені токени], (більш вагомі)++, (менш вагомі)--, swap и blend також доступні (дивіться Github)",
         "sendTo": "Надіслати",
         "sendToImg2Img": "Надіслати у img2img",
         "sendToUnifiedCanvas": "Надіслати на полотно",
@@ -467,7 +453,6 @@
         "useAll": "Використати все",
         "useInitImg": "Використати як початкове",
         "info": "Метадані",
-        "deleteImage": "Видалити зображення",
         "initialImage": "Початкове зображення",
         "showOptionsPanel": "Показати панель налаштувань",
         "general": "Основне",
@@ -485,8 +470,7 @@
         "denoisingStrength": "Сила шумоподавлення",
         "copyImage": "Копіювати зображення",
         "symmetry": "Симетрія",
-        "hSymmetryStep": "Крок гор. симетрії",
-        "negativePrompts": "Виключний запит"
+        "hSymmetryStep": "Крок гор. симетрії"
     },
     "settings": {
         "models": "Моделі",
@@ -494,7 +478,6 @@
         "saveSteps": "Зберігати кожні n кроків",
         "confirmOnDelete": "Підтверджувати видалення",
         "displayHelpIcons": "Показувати значки підказок",
-        "useCanvasBeta": "Показувати інструменты зліва (Beta UI)",
         "enableImageDebugging": "Увімкнути налагодження",
         "resetWebUI": "Повернути початкові",
         "resetWebUIDesc1": "Скидання настройок веб-інтерфейсу видаляє лише локальний кеш браузера з вашими зображеннями та налаштуваннями. Це не призводить до видалення зображень з диску.",
@@ -505,7 +488,6 @@
     "toast": {
         "tempFoldersEmptied": "Тимчасова папка очищена",
         "uploadFailed": "Не вдалося завантажити",
-        "uploadFailedMultipleImagesDesc": "Можна вставити лише одне зображення (ви спробували вставити декілька)",
         "uploadFailedUnableToLoadDesc": "Неможливо завантажити файл",
         "downloadImageStarted": "Завантаження зображення почалося",
         "imageCopied": "Зображення скопійоване",
@@ -626,7 +608,6 @@
         "rotateClockwise": "Обертати за годинниковою стрілкою",
         "toggleAutoscroll": "Увімкнути автопрокручування",
         "toggleLogViewer": "Показати або приховати переглядач журналів",
-        "showGallery": "Показати галерею",
         "previousImage": "Попереднє зображення",
         "copyMetadataJson": "Скопіювати метадані JSON",
         "flipVertically": "Перевернути по вертикалі",
diff --git a/invokeai/frontend/web/public/locales/zh_CN.json b/invokeai/frontend/web/public/locales/zh_CN.json
index d4d7746926..23940542a9 100644
--- a/invokeai/frontend/web/public/locales/zh_CN.json
+++ b/invokeai/frontend/web/public/locales/zh_CN.json
@@ -1,25 +1,21 @@
 {
     "common": {
         "hotkeysLabel": "快捷键",
-        "themeLabel": "主题",
         "languagePickerLabel": "语言",
-        "reportBugLabel": "提交错误报告",
+        "reportBugLabel": "反馈错误",
         "settingsLabel": "设置",
-        "darkTheme": "暗色",
-        "lightTheme": "亮色",
-        "greenTheme": "绿色",
-        "img2img": "图像到图像",
+        "img2img": "图生图",
         "unifiedCanvas": "统一画布",
-        "nodes": "节点",
+        "nodes": "工作流编辑器",
         "langSimplifiedChinese": "简体中文",
         "nodesDesc": "一个基于节点的图像生成系统目前正在开发中。请持续关注关于这一功能的更新。",
         "postProcessing": "后期处理",
-        "postProcessDesc1": "Invoke AI 提供各种各样的后期处理功能。图像放大和面部修复在网页界面中已经可用。你可以从文本到图像和图像到图像页面的高级选项菜单中访问它们。你也可以直接使用图像显示上方或查看器中的图像操作按钮处理图像。",
+        "postProcessDesc1": "Invoke AI 提供各种各样的后期处理功能。图像放大和面部修复在网页界面中已经可用。你可以从文生图和图生图页面的高级选项菜单中访问它们。你也可以直接使用图像显示上方或查看器中的图像操作按钮处理图像。",
         "postProcessDesc2": "一个专门的界面将很快发布,新的界面能够处理更复杂的后期处理流程。",
-        "postProcessDesc3": "Invoke AI 命令行界面提供例如Embiggen的各种其他功能。",
+        "postProcessDesc3": "Invoke AI 命令行界面提供例如 Embiggen 的各种其他功能。",
         "training": "训练",
-        "trainingDesc1": "一个专门用于从网络UI使用Textual Inversion和Dreambooth训练自己的嵌入模型和检查点的工作流程。",
-        "trainingDesc2": "InvokeAI已经支持使用主脚本中的Textual Inversion来训练自定义的嵌入模型。",
+        "trainingDesc1": "一个专门用于从 Web UI 使用 Textual Inversion 和 Dreambooth 训练自己的 Embedding 和 checkpoint 的工作流。",
+        "trainingDesc2": "InvokeAI 已经支持使用主脚本中的 Textual Inversion 来训练自定义 embeddouring。",
         "upload": "上传",
         "close": "关闭",
         "load": "加载",
@@ -27,23 +23,74 @@
         "statusDisconnected": "未连接",
         "statusError": "错误",
         "statusPreparing": "准备中",
-        "statusProcessingCanceled": "处理取消",
+        "statusProcessingCanceled": "处理已取消",
         "statusProcessingComplete": "处理完成",
         "statusGenerating": "生成中",
-        "statusGeneratingTextToImage": "文字到图像生成中",
-        "statusGeneratingImageToImage": "图像到图像生成中",
-        "statusGeneratingInpainting": "生成内画中",
-        "statusGeneratingOutpainting": "生成外画中",
+        "statusGeneratingTextToImage": "文生图生成中",
+        "statusGeneratingImageToImage": "图生图生成中",
+        "statusGeneratingInpainting": "(Inpainting) 内补生成中",
+        "statusGeneratingOutpainting": "(Outpainting) 外扩生成中",
         "statusGenerationComplete": "生成完成",
         "statusIterationComplete": "迭代完成",
         "statusSavingImage": "图像保存中",
-        "statusRestoringFaces": "脸部修复中",
-        "statusRestoringFacesGFPGAN": "脸部修复中 (GFPGAN)",
-        "statusRestoringFacesCodeFormer": "脸部修复中 (CodeFormer)",
+        "statusRestoringFaces": "面部修复中",
+        "statusRestoringFacesGFPGAN": "面部修复中 (GFPGAN)",
+        "statusRestoringFacesCodeFormer": "面部修复中 (CodeFormer)",
         "statusUpscaling": "放大中",
         "statusUpscalingESRGAN": "放大中 (ESRGAN)",
         "statusLoadingModel": "模型加载中",
-        "statusModelChanged": "模型已切换"
+        "statusModelChanged": "模型已切换",
+        "accept": "同意",
+        "cancel": "取消",
+        "dontAskMeAgain": "不要再次询问",
+        "areYouSure": "你确认吗?",
+        "imagePrompt": "图片提示词",
+        "langKorean": "朝鲜语",
+        "langPortuguese": "葡萄牙语",
+        "random": "随机",
+        "generate": "生成",
+        "openInNewTab": "在新的标签页打开",
+        "langUkranian": "乌克兰语",
+        "back": "返回",
+        "statusMergedModels": "模型已合并",
+        "statusConvertingModel": "转换模型中",
+        "statusModelConverted": "模型转换完成",
+        "statusMergingModels": "合并模型",
+        "githubLabel": "GitHub",
+        "discordLabel": "Discord",
+        "langPolish": "波兰语",
+        "langBrPortuguese": "葡萄牙语(巴西)",
+        "langDutch": "荷兰语",
+        "langFrench": "法语",
+        "langRussian": "俄语",
+        "langGerman": "德语",
+        "langHebrew": "希伯来语",
+        "langItalian": "意大利语",
+        "langJapanese": "日语",
+        "langSpanish": "西班牙语",
+        "langEnglish": "英语",
+        "langArabic": "阿拉伯语",
+        "txt2img": "文生图",
+        "postprocessing": "后期处理",
+        "loading": "加载中",
+        "loadingInvokeAI": "Invoke AI 加载中",
+        "linear": "线性的",
+        "batch": "批次管理器",
+        "communityLabel": "社区",
+        "modelManager": "模型管理器",
+        "nodeEditor": "节点编辑器",
+        "statusProcessing": "处理中",
+        "imageFailedToLoad": "无法加载图像",
+        "lightMode": "浅色模式",
+        "learnMore": "了解更多",
+        "darkMode": "深色模式",
+        "advanced": "高级",
+        "t2iAdapter": "T2I Adapter",
+        "ipAdapter": "IP Adapter",
+        "controlAdapter": "Control Adapter",
+        "controlNet": "ControlNet",
+        "on": "开",
+        "auto": "自动"
     },
     "gallery": {
         "generations": "生成的图像",
@@ -53,20 +100,35 @@
         "galleryImageSize": "预览大小",
         "galleryImageResetSize": "重置预览大小",
         "gallerySettings": "预览设置",
-        "maintainAspectRatio": "保持比例",
+        "maintainAspectRatio": "保持纵横比",
         "autoSwitchNewImages": "自动切换到新图像",
         "singleColumnLayout": "单列布局",
-        "pinGallery": "保持图库常开",
-        "allImagesLoaded": "所有图像加载完成",
+        "allImagesLoaded": "所有图像已加载",
         "loadMore": "加载更多",
-        "noImagesInGallery": "图库中无图像"
+        "noImagesInGallery": "无图像可用于显示",
+        "deleteImage": "删除图片",
+        "deleteImageBin": "被删除的图片会发送到你操作系统的回收站。",
+        "deleteImagePermanent": "删除的图片无法被恢复。",
+        "images": "图片",
+        "assets": "素材",
+        "autoAssignBoardOnClick": "点击后自动分配面板",
+        "featuresWillReset": "如果您删除该图像,这些功能会立即被重置。",
+        "loading": "加载中",
+        "unableToLoad": "无法加载图库",
+        "currentlyInUse": "该图像目前在以下功能中使用:",
+        "copy": "复制",
+        "download": "下载",
+        "setCurrentImage": "设为当前图像",
+        "preparingDownload": "准备下载",
+        "preparingDownloadFailed": "准备下载时出现问题",
+        "downloadSelection": "下载所选内容"
     },
     "hotkeys": {
-        "keyboardShortcuts": "快捷方式",
-        "appHotkeys": "应用快捷方式",
-        "generalHotkeys": "一般快捷方式",
-        "galleryHotkeys": "图库快捷方式",
-        "unifiedCanvasHotkeys": "统一画布快捷方式",
+        "keyboardShortcuts": "键盘快捷键",
+        "appHotkeys": "应用快捷键",
+        "generalHotkeys": "一般快捷键",
+        "galleryHotkeys": "图库快捷键",
+        "unifiedCanvasHotkeys": "统一画布快捷键",
         "invoke": {
             "title": "Invoke",
             "desc": "生成图像"
@@ -76,31 +138,31 @@
             "desc": "取消图像生成"
         },
         "focusPrompt": {
-            "title": "打开提示框",
-            "desc": "打开提示文本框"
+            "title": "打开提示词框",
+            "desc": "打开提示词文本框"
         },
         "toggleOptions": {
             "title": "切换选项卡",
-            "desc": "打开或关闭选项卡"
+            "desc": "打开或关闭选项浮窗"
         },
         "pinOptions": {
             "title": "常开选项卡",
-            "desc": "保持选项卡常开"
+            "desc": "保持选项浮窗常开"
         },
         "toggleViewer": {
-            "title": "切换图像视图",
-            "desc": "打开或关闭图像视图"
+            "title": "切换图像查看器",
+            "desc": "打开或关闭图像查看器"
         },
         "toggleGallery": {
             "title": "切换图库",
             "desc": "打开或关闭图库"
         },
         "maximizeWorkSpace": {
-            "title": "工作台最大化",
+            "title": "工作区最大化",
             "desc": "关闭所有浮窗,将工作区域最大化"
         },
         "changeTabs": {
-            "title": "切换卡片",
+            "title": "切换选项卡",
             "desc": "切换到另一个工作区"
         },
         "consoleToggle": {
@@ -108,7 +170,7 @@
             "desc": "打开或关闭命令行"
         },
         "setPrompt": {
-            "title": "使用提示",
+            "title": "使用当前提示词",
             "desc": "使用当前图像的提示词"
         },
         "setSeed": {
@@ -116,12 +178,12 @@
             "desc": "使用当前图像的种子"
         },
         "setParameters": {
-            "title": "使用所有参数",
+            "title": "使用当前参数",
             "desc": "使用当前图像的所有参数"
         },
         "restoreFaces": {
-            "title": "脸部修复",
-            "desc": "对当前图像进行脸部修复"
+            "title": "面部修复",
+            "desc": "对当前图像进行面部修复"
         },
         "upscale": {
             "title": "放大",
@@ -132,8 +194,8 @@
             "desc": "显示当前图像的元数据"
         },
         "sendToImageToImage": {
-            "title": "送往图像到图像",
-            "desc": "将当前图像送往图像到图像"
+            "title": "发送到图生图",
+            "desc": "发送当前图像到图生图"
         },
         "deleteImage": {
             "title": "删除图像",
@@ -145,23 +207,23 @@
         },
         "previousImage": {
             "title": "上一张图像",
-            "desc": "显示相册中的上一张图像"
+            "desc": "显示图库中的上一张图像"
         },
         "nextImage": {
             "title": "下一张图像",
-            "desc": "显示相册中的下一张图像"
+            "desc": "显示图库中的下一张图像"
         },
         "toggleGalleryPin": {
             "title": "切换图库常开",
             "desc": "开关图库在界面中的常开模式"
         },
         "increaseGalleryThumbSize": {
-            "title": "增大预览大小",
-            "desc": "增大图库中预览的大小"
+            "title": "增大预览尺寸",
+            "desc": "增大图库中预览的尺寸"
         },
         "decreaseGalleryThumbSize": {
-            "title": "减小预览大小",
-            "desc": "减小图库中预览的大小"
+            "title": "缩小预览尺寸",
+            "desc": "缩小图库中预览的尺寸"
         },
         "selectBrush": {
             "title": "选择刷子",
@@ -189,19 +251,19 @@
         },
         "moveTool": {
             "title": "移动工具",
-            "desc": "在画布上移动"
+            "desc": "画布允许导航"
         },
         "fillBoundingBox": {
             "title": "填充选择区域",
             "desc": "在选择区域中填充刷子颜色"
         },
         "eraseBoundingBox": {
-            "title": "取消选择区域",
-            "desc": "将选择区域抹除"
+            "title": "擦除选择框",
+            "desc": "将选择区域擦除"
         },
         "colorPicker": {
-            "title": "颜色提取工具",
-            "desc": "选择颜色提取工具"
+            "title": "选择颜色拾取工具",
+            "desc": "选择画布颜色拾取工具"
         },
         "toggleSnap": {
             "title": "切换网格对齐",
@@ -217,7 +279,7 @@
         },
         "clearMask": {
             "title": "清除遮罩",
-            "desc": "清除整个遮罩层"
+            "desc": "清除整个遮罩"
         },
         "hideMask": {
             "title": "隐藏遮罩",
@@ -233,7 +295,7 @@
         },
         "saveToGallery": {
             "title": "保存至图库",
-            "desc": "将画板当前内容保存至图库"
+            "desc": "将画布当前内容保存至图库"
         },
         "copyToClipboard": {
             "title": "复制到剪贴板",
@@ -253,7 +315,7 @@
         },
         "resetView": {
             "title": "重置视图",
-            "desc": "重置画板视图"
+            "desc": "重置画布视图"
         },
         "previousStagingImage": {
             "title": "上一张暂存图像",
@@ -266,12 +328,17 @@
         "acceptStagingImage": {
             "title": "接受暂存图像",
             "desc": "接受当前暂存区中的图像"
+        },
+        "nodesHotkeys": "节点快捷键",
+        "addNodes": {
+            "title": "添加节点",
+            "desc": "打开添加节点菜单"
         }
     },
     "modelManager": {
         "modelManager": "模型管理器",
         "model": "模型",
-        "modelAdded": "模型已添加",
+        "modelAdded": "已添加模型",
         "modelUpdated": "模型已更新",
         "modelEntryDeleted": "模型已删除",
         "cannotUseSpaces": "不能使用空格",
@@ -284,30 +351,30 @@
         "description": "描述",
         "descriptionValidationMsg": "添加模型的描述",
         "config": "配置",
-        "configValidationMsg": "模型配置文件的路径",
+        "configValidationMsg": "模型配置文件的路径。",
         "modelLocation": "模型位置",
-        "modelLocationValidationMsg": "模型文件的路径",
+        "modelLocationValidationMsg": "提供 Diffusers 模型文件的本地存储路径",
         "vaeLocation": "VAE 位置",
-        "vaeLocationValidationMsg": "VAE 文件的路径",
+        "vaeLocationValidationMsg": "VAE 文件的路径。",
         "width": "宽度",
-        "widthValidationMsg": "模型的默认宽度",
+        "widthValidationMsg": "模型的默认宽度。",
         "height": "高度",
-        "heightValidationMsg": "模型的默认高度",
+        "heightValidationMsg": "模型的默认高度。",
         "addModel": "添加模型",
         "updateModel": "更新模型",
         "availableModels": "可用模型",
-        "search": "搜索",
+        "search": "检索",
         "load": "加载",
         "active": "活跃",
         "notLoaded": "未加载",
         "cached": "缓存",
         "checkpointFolder": "模型检查点文件夹",
-        "clearCheckpointFolder": "清除模型检查点文件夹",
+        "clearCheckpointFolder": "清除 Checkpoint 模型文件夹",
         "findModels": "寻找模型",
         "modelsFound": "找到的模型",
         "selectFolder": "选择文件夹",
         "selected": "已选择",
-        "selectAll": "选择所有",
+        "selectAll": "全选",
         "deselectAll": "取消选择所有",
         "showExisting": "显示已存在",
         "addSelected": "添加选择",
@@ -315,8 +382,100 @@
         "delete": "删除",
         "deleteModel": "删除模型",
         "deleteConfig": "删除配置",
-        "deleteMsg1": "您确定要将这个模型从 InvokeAI 删除吗?",
-        "deleteMsg2": "这不会从磁盘中删除模型检查点文件。如果您愿意,可以重新添加它们。"
+        "deleteMsg1": "您确定要将该模型从 InvokeAI 删除吗?",
+        "deleteMsg2": "磁盘中放置在 InvokeAI 根文件夹的 checkpoint 文件会被删除。若你正在使用自定义目录,则不会从磁盘中删除他们。",
+        "convertToDiffusersHelpText1": "模型会被转换成 🧨 Diffusers 格式。",
+        "convertToDiffusersHelpText2": "这个过程会替换你的模型管理器的入口中相同 Diffusers 版本的模型。",
+        "mergedModelSaveLocation": "保存路径",
+        "mergedModelCustomSaveLocation": "自定义路径",
+        "checkpointModels": "Checkpoints",
+        "formMessageDiffusersVAELocation": "VAE 路径",
+        "convertToDiffusersHelpText4": "这是一次性的处理过程。根据你电脑的配置不同耗时 30 - 60 秒。",
+        "convertToDiffusersHelpText6": "你希望转换这个模型吗?",
+        "interpolationType": "插值类型",
+        "modelTwo": "模型 2",
+        "modelThree": "模型 3",
+        "v2_768": "v2 (768px)",
+        "mergedModelName": "合并的模型名称",
+        "allModels": "全部模型",
+        "convertToDiffusers": "转换为 Diffusers",
+        "formMessageDiffusersModelLocation": "Diffusers 模型路径",
+        "custom": "自定义",
+        "formMessageDiffusersVAELocationDesc": "如果没有特别指定,InvokeAI 会从上面指定的模型路径中寻找 VAE 文件。",
+        "safetensorModels": "SafeTensors",
+        "modelsMerged": "模型合并完成",
+        "mergeModels": "合并模型",
+        "modelOne": "模型 1",
+        "diffusersModels": "Diffusers",
+        "scanForModels": "扫描模型",
+        "repo_id": "项目 ID",
+        "repoIDValidationMsg": "你的模型的在线项目地址",
+        "v1": "v1",
+        "invokeRoot": "InvokeAI 文件夹",
+        "inpainting": "v1 Inpainting",
+        "customSaveLocation": "自定义保存路径",
+        "scanAgain": "重新扫描",
+        "customConfig": "个性化配置",
+        "pathToCustomConfig": "个性化配置路径",
+        "modelConverted": "模型已转换",
+        "statusConverting": "转换中",
+        "sameFolder": "相同文件夹",
+        "invokeAIFolder": "Invoke AI 文件夹",
+        "ignoreMismatch": "忽略所选模型之间的不匹配",
+        "modelMergeHeaderHelp1": "您可以合并最多三种不同的模型,以创建符合您需求的混合模型。",
+        "modelMergeHeaderHelp2": "只有扩散器(Diffusers)可以用于模型合并。如果您想要合并一个检查点模型,请先将其转换为扩散器。",
+        "addCheckpointModel": "添加 Checkpoint / Safetensor 模型",
+        "addDiffuserModel": "添加 Diffusers 模型",
+        "vaeRepoID": "VAE 项目 ID",
+        "vaeRepoIDValidationMsg": "VAE 模型在线仓库地址",
+        "selectAndAdd": "选择下表中的模型并添加",
+        "noModelsFound": "未有找到模型",
+        "formMessageDiffusersModelLocationDesc": "请至少输入一个。",
+        "convertToDiffusersSaveLocation": "保存路径",
+        "convertToDiffusersHelpText3": "磁盘中放置在 InvokeAI 根文件夹的 checkpoint 文件会被删除. 若位于自定义目录, 则不会受影响.",
+        "v2_base": "v2 (512px)",
+        "convertToDiffusersHelpText5": "请确认你有足够的磁盘空间,模型大小通常在 2 GB - 7 GB 之间。",
+        "convert": "转换",
+        "merge": "合并",
+        "pickModelType": "选择模型类型",
+        "addDifference": "增加差异",
+        "none": "无",
+        "inverseSigmoid": "反 Sigmoid 函数",
+        "weightedSum": "加权求和",
+        "modelMergeAlphaHelp": "Alpha 参数控制模型的混合强度。较低的 Alpha 值会导致第二个模型的影响减弱。",
+        "sigmoid": "Sigmoid 函数",
+        "modelMergeInterpAddDifferenceHelp": "在这种模式下,首先从模型 2 中减去模型 3,得到的版本再用上述的 Alpha 值与模型1进行混合。",
+        "modelsSynced": "模型已同步",
+        "modelSyncFailed": "模型同步失败",
+        "modelDeleteFailed": "模型删除失败",
+        "syncModelsDesc": "如果您的模型与后端不同步,您可以使用此选项刷新它们。便于您在应用程序启动的情况下手动更新 models.yaml 文件或将模型添加到 InvokeAI 根文件夹。",
+        "selectModel": "选择模型",
+        "importModels": "导入模型",
+        "settings": "设置",
+        "syncModels": "同步模型",
+        "noCustomLocationProvided": "未提供自定义路径",
+        "modelDeleted": "模型已删除",
+        "modelUpdateFailed": "模型更新失败",
+        "modelConversionFailed": "模型转换失败",
+        "modelsMergeFailed": "模型融合失败",
+        "baseModel": "基底模型",
+        "convertingModelBegin": "模型转换中. 请稍候.",
+        "noModels": "未找到模型",
+        "predictionType": "预测类型(适用于 Stable Diffusion 2.x 模型和部分 Stable Diffusion 1.x 模型)",
+        "quickAdd": "快速添加",
+        "simpleModelDesc": "提供一个指向本地 Diffusers 模型的路径,本地 checkpoint / safetensors 模型或一个HuggingFace 项目 ID,又或者一个 checkpoint/diffusers 模型链接。",
+        "advanced": "高级",
+        "useCustomConfig": "使用自定义配置",
+        "closeAdvanced": "关闭高级",
+        "modelType": "模型类别",
+        "customConfigFileLocation": "自定义配置文件目录",
+        "variant": "变体",
+        "onnxModels": "Onnx",
+        "vae": "VAE",
+        "oliveModels": "Olive",
+        "loraModels": "LoRA",
+        "alpha": "Alpha",
+        "vaePrecision": "VAE 精度"
     },
     "parameters": {
         "images": "图像",
@@ -324,113 +483,255 @@
         "cfgScale": "CFG 等级",
         "width": "宽度",
         "height": "高度",
-        "sampler": "采样算法",
         "seed": "种子",
         "randomizeSeed": "随机化种子",
-        "shuffle": "随机化",
+        "shuffle": "随机生成种子",
         "noiseThreshold": "噪声阈值",
         "perlinNoise": "Perlin 噪声",
         "variations": "变种",
         "variationAmount": "变种数量",
         "seedWeights": "种子权重",
-        "faceRestoration": "脸部修复",
-        "restoreFaces": "修复脸部",
+        "faceRestoration": "面部修复",
+        "restoreFaces": "修复面部",
         "type": "种类",
         "strength": "强度",
         "upscaling": "放大",
-        "upscale": "放大",
+        "upscale": "放大 (Shift + U)",
         "upscaleImage": "放大图像",
         "scale": "等级",
         "otherOptions": "其他选项",
         "seamlessTiling": "无缝拼贴",
-        "hiresOptim": "高清优化",
-        "imageFit": "使生成图像长宽适配原图像",
-        "codeformerFidelity": "保真",
-        "seamSize": "接缝尺寸",
-        "seamBlur": "接缝模糊",
-        "seamStrength": "接缝强度",
-        "seamSteps": "接缝步数",
+        "hiresOptim": "高分辨率优化",
+        "imageFit": "使生成图像长宽适配初始图像",
+        "codeformerFidelity": "保真度",
         "scaleBeforeProcessing": "处理前缩放",
         "scaledWidth": "缩放宽度",
         "scaledHeight": "缩放长度",
-        "infillMethod": "填充法",
+        "infillMethod": "填充方法",
         "tileSize": "方格尺寸",
         "boundingBoxHeader": "选择区域",
         "seamCorrectionHeader": "接缝修正",
         "infillScalingHeader": "内填充和缩放",
-        "img2imgStrength": "图像到图像强度",
+        "img2imgStrength": "图生图强度",
         "toggleLoopback": "切换环回",
-        "invoke": "Invoke",
-        "promptPlaceholder": "在这里输入提示。可以使用[反提示]、(加权)++、(减权)--、交换和混合(见文档)",
         "sendTo": "发送到",
-        "sendToImg2Img": "发送到图像到图像",
+        "sendToImg2Img": "发送到图生图",
         "sendToUnifiedCanvas": "发送到统一画布",
         "copyImageToLink": "复制图像链接",
         "downloadImage": "下载图像",
-        "openInViewer": "在视图中打开",
-        "closeViewer": "关闭视图",
+        "openInViewer": "在查看器中打开",
+        "closeViewer": "关闭查看器",
         "usePrompt": "使用提示",
         "useSeed": "使用种子",
         "useAll": "使用所有参数",
-        "useInitImg": "使用原图像",
+        "useInitImg": "使用初始图像",
         "info": "信息",
-        "deleteImage": "删除图像",
-        "initialImage": "原图像",
-        "showOptionsPanel": "显示选项浮窗"
+        "initialImage": "初始图像",
+        "showOptionsPanel": "显示侧栏浮窗 (O 或 T)",
+        "seamlessYAxis": "Y 轴",
+        "seamlessXAxis": "X 轴",
+        "boundingBoxWidth": "边界框宽度",
+        "boundingBoxHeight": "边界框高度",
+        "denoisingStrength": "去噪强度",
+        "vSymmetryStep": "纵向对称步数",
+        "cancel": {
+            "immediate": "立即取消",
+            "isScheduled": "取消中",
+            "schedule": "当前迭代后取消",
+            "setType": "设定取消类型",
+            "cancel": "取消"
+        },
+        "copyImage": "复制图片",
+        "showPreview": "显示预览",
+        "symmetry": "对称性",
+        "positivePromptPlaceholder": "正向提示词",
+        "negativePromptPlaceholder": "负向提示词",
+        "scheduler": "调度器",
+        "general": "通用",
+        "hiresStrength": "高分辨强度",
+        "hidePreview": "隐藏预览",
+        "hSymmetryStep": "横向对称步数",
+        "imageToImage": "图生图",
+        "noiseSettings": "噪音",
+        "controlNetControlMode": "控制模式",
+        "maskAdjustmentsHeader": "遮罩调整",
+        "maskBlur": "模糊",
+        "maskBlurMethod": "模糊方式",
+        "aspectRatio": "纵横比",
+        "seamLowThreshold": "降低",
+        "seamHighThreshold": "提升",
+        "invoke": {
+            "noNodesInGraph": "节点图中无节点",
+            "noModelSelected": "无已选中的模型",
+            "invoke": "调用",
+            "systemBusy": "系统繁忙",
+            "noInitialImageSelected": "无选中的初始图像",
+            "missingInputForField": "{{nodeLabel}} -> {{fieldLabel}} 缺失输入",
+            "unableToInvoke": "无法调用",
+            "systemDisconnected": "系统已断开连接",
+            "missingNodeTemplate": "缺失节点模板",
+            "missingFieldTemplate": "缺失模板",
+            "addingImagesTo": "添加图像到",
+            "noPrompts": "没有已生成的提示词",
+            "readyToInvoke": "准备调用",
+            "noControlImageForControlAdapter": "有 #{{number}} 个 Control Adapter 缺失控制图像",
+            "noModelForControlAdapter": "有 #{{number}} 个 Control Adapter 没有选择模型。",
+            "incompatibleBaseModelForControlAdapter": "有 #{{number}} 个 Control Adapter 模型与主模型不匹配。"
+        },
+        "patchmatchDownScaleSize": "缩小",
+        "coherenceSteps": "步数",
+        "clipSkip": "CLIP 跳过层",
+        "compositingSettingsHeader": "合成设置",
+        "useCpuNoise": "使用 CPU 噪声",
+        "coherenceStrength": "强度",
+        "enableNoiseSettings": "启用噪声设置",
+        "coherenceMode": "模式",
+        "cpuNoise": "CPU 噪声",
+        "gpuNoise": "GPU 噪声",
+        "clipSkipWithLayerCount": "CLIP 跳过 {{layerCount}} 层",
+        "coherencePassHeader": "一致性层",
+        "manualSeed": "手动设定种子",
+        "imageActions": "图像操作",
+        "randomSeed": "随机种子",
+        "iterations": "迭代数",
+        "isAllowedToUpscale": {
+            "useX2Model": "图像太大,无法使用 x4 模型,使用 x2 模型作为替代",
+            "tooLarge": "图像太大无法进行放大,请选择更小的图像"
+        },
+        "iterationsWithCount_other": "{{count}} 次迭代生成",
+        "seamlessX&Y": "无缝 X & Y",
+        "aspectRatioFree": "自由",
+        "seamlessX": "无缝 X",
+        "seamlessY": "无缝 Y"
     },
     "settings": {
         "models": "模型",
-        "displayInProgress": "显示进行中的图像",
+        "displayInProgress": "显示处理中的图像",
         "saveSteps": "每n步保存图像",
         "confirmOnDelete": "删除时确认",
         "displayHelpIcons": "显示帮助按钮",
-        "useCanvasBeta": "使用测试版画布视图",
         "enableImageDebugging": "开启图像调试",
         "resetWebUI": "重置网页界面",
         "resetWebUIDesc1": "重置网页只会重置浏览器中缓存的图像和设置,不会删除任何图像。",
         "resetWebUIDesc2": "如果图像没有显示在图库中,或者其他东西不工作,请在GitHub上提交问题之前尝试重置。",
-        "resetComplete": "网页界面已重置。刷新页面以重新加载。"
+        "resetComplete": "网页界面已重置。",
+        "showProgressInViewer": "在查看器中展示过程图片",
+        "antialiasProgressImages": "对过程图像应用抗锯齿",
+        "generation": "生成",
+        "ui": "用户界面",
+        "useSlidersForAll": "对所有参数使用滑动条设置",
+        "general": "通用",
+        "consoleLogLevel": "日志等级",
+        "shouldLogToConsole": "终端日志",
+        "developer": "开发者",
+        "alternateCanvasLayout": "切换统一画布布局",
+        "enableNodesEditor": "启用节点编辑器",
+        "favoriteSchedulersPlaceholder": "没有偏好的采样算法",
+        "showAdvancedOptions": "显示进阶选项",
+        "favoriteSchedulers": "采样算法偏好",
+        "autoChangeDimensions": "更改时将宽/高更新为模型默认值",
+        "experimental": "实验性",
+        "beta": "Beta",
+        "clearIntermediates": "清除中间产物",
+        "clearIntermediatesDesc3": "您图库中的图像不会被删除。",
+        "clearIntermediatesDesc2": "中间产物图像是生成过程中产生的副产品,与图库中的结果图像不同。清除中间产物可释放磁盘空间。",
+        "intermediatesCleared_other": "已清除 {{count}} 个中间产物",
+        "clearIntermediatesDesc1": "清除中间产物会重置您的画布和 ControlNet 状态。",
+        "intermediatesClearedFailed": "清除中间产物时出现问题",
+        "clearIntermediatesWithCount_other": "清除 {{count}} 个中间产物",
+        "clearIntermediatesDisabled": "队列为空才能清理中间产物"
     },
     "toast": {
         "tempFoldersEmptied": "临时文件夹已清空",
         "uploadFailed": "上传失败",
-        "uploadFailedMultipleImagesDesc": "多张图像被粘贴,同时只能上传一张图像",
         "uploadFailedUnableToLoadDesc": "无法加载文件",
-        "downloadImageStarted": "图像下载已开始",
+        "downloadImageStarted": "图像已开始下载",
         "imageCopied": "图像已复制",
         "imageLinkCopied": "图像链接已复制",
         "imageNotLoaded": "没有加载图像",
-        "imageNotLoadedDesc": "没有图像可供送往图像到图像界面",
+        "imageNotLoadedDesc": "找不到图片",
         "imageSavedToGallery": "图像已保存到图库",
         "canvasMerged": "画布已合并",
-        "sentToImageToImage": "已送往图像到图像",
-        "sentToUnifiedCanvas": "已送往统一画布",
+        "sentToImageToImage": "已发送到图生图",
+        "sentToUnifiedCanvas": "已发送到统一画布",
         "parametersSet": "参数已设定",
         "parametersNotSet": "参数未设定",
-        "parametersNotSetDesc": "此图像不存在元数据",
+        "parametersNotSetDesc": "此图像不存在元数据。",
         "parametersFailed": "加载参数失败",
-        "parametersFailedDesc": "加载初始图像失败",
+        "parametersFailedDesc": "加载初始图像失败。",
         "seedSet": "种子已设定",
         "seedNotSet": "种子未设定",
-        "seedNotSetDesc": "无法找到该图像的种子",
-        "promptSet": "提示已设定",
-        "promptNotSet": "提示未设定",
-        "promptNotSetDesc": "无法找到该图像的提示",
+        "seedNotSetDesc": "无法找到该图像的种子。",
+        "promptSet": "提示词已设定",
+        "promptNotSet": "提示词未设定",
+        "promptNotSetDesc": "无法找到该图像的提示词。",
         "upscalingFailed": "放大失败",
-        "faceRestoreFailed": "脸部修复失败",
+        "faceRestoreFailed": "面部修复失败",
         "metadataLoadFailed": "加载元数据失败",
         "initialImageSet": "初始图像已设定",
         "initialImageNotSet": "初始图像未设定",
-        "initialImageNotSetDesc": "无法加载初始图像"
+        "initialImageNotSetDesc": "无法加载初始图像",
+        "problemCopyingImageLink": "无法复制图片链接",
+        "uploadFailedInvalidUploadDesc": "必须是单张的 PNG 或 JPEG 图片",
+        "disconnected": "服务器断开",
+        "connected": "服务器连接",
+        "parameterSet": "参数已设定",
+        "parameterNotSet": "参数未设定",
+        "serverError": "服务器错误",
+        "canceled": "处理取消",
+        "nodesLoaded": "节点已加载",
+        "nodesSaved": "节点已保存",
+        "problemCopyingImage": "无法复制图像",
+        "nodesCorruptedGraph": "无法加载。节点图似乎已损坏。",
+        "nodesBrokenConnections": "无法加载。部分连接已断开。",
+        "nodesUnrecognizedTypes": "无法加载。节点图有无法识别的节点类型",
+        "nodesNotValidJSON": "无效的 JSON",
+        "nodesNotValidGraph": "无效的 InvokeAi 节点图",
+        "nodesCleared": "节点已清空",
+        "nodesLoadedFailed": "节点图加载失败",
+        "modelAddedSimple": "已添加模型",
+        "modelAdded": "已添加模型: {{modelName}}",
+        "imageSavingFailed": "图像保存失败",
+        "canvasSentControlnetAssets": "画布已发送到 ControlNet & 素材",
+        "problemCopyingCanvasDesc": "无法导出基础层",
+        "loadedWithWarnings": "已加载带有警告的工作流",
+        "setInitialImage": "设为初始图像",
+        "canvasCopiedClipboard": "画布已复制到剪贴板",
+        "setControlImage": "设为控制图像",
+        "setNodeField": "设为节点字段",
+        "problemSavingMask": "保存遮罩时出现问题",
+        "problemSavingCanvasDesc": "无法导出基础层",
+        "maskSavedAssets": "遮罩已保存到素材",
+        "modelAddFailed": "模型添加失败",
+        "problemDownloadingCanvas": "下载画布时出现问题",
+        "problemMergingCanvas": "合并画布时出现问题",
+        "setCanvasInitialImage": "设为画布初始图像",
+        "imageUploaded": "图像已上传",
+        "addedToBoard": "已添加到面板",
+        "workflowLoaded": "工作流已加载",
+        "problemImportingMaskDesc": "无法导出遮罩",
+        "problemCopyingCanvas": "复制画布时出现问题",
+        "problemSavingCanvas": "保存画布时出现问题",
+        "canvasDownloaded": "画布已下载",
+        "setIPAdapterImage": "设为 IP Adapter 图像",
+        "problemMergingCanvasDesc": "无法导出基础层",
+        "problemDownloadingCanvasDesc": "无法导出基础层",
+        "problemSavingMaskDesc": "无法导出遮罩",
+        "imageSaved": "图像已保存",
+        "maskSentControlnetAssets": "遮罩已发送到 ControlNet & 素材",
+        "canvasSavedGallery": "画布已保存到图库",
+        "imageUploadFailed": "图像上传失败",
+        "problemImportingMask": "导入遮罩时出现问题",
+        "baseModelChangedCleared_other": "基础模型已更改, 已清除或禁用 {{count}} 个不兼容的子模型"
     },
     "unifiedCanvas": {
         "layer": "图层",
         "base": "基础层",
-        "mask": "遮罩层层",
-        "maskingOptions": "遮罩层选项",
-        "enableMask": "启用遮罩层",
-        "preserveMaskedArea": "保留遮罩层区域",
-        "clearMask": "清除遮罩层",
+        "mask": "遮罩",
+        "maskingOptions": "遮罩选项",
+        "enableMask": "启用遮罩",
+        "preserveMaskedArea": "保留遮罩区域",
+        "clearMask": "清除遮罩",
         "brush": "刷子",
         "eraser": "橡皮擦",
         "fillBoundingBox": "填充选择区域",
@@ -455,10 +756,10 @@
         "autoSaveToGallery": "自动保存至图库",
         "saveBoxRegionOnly": "只保存框内区域",
         "limitStrokesToBox": "限制画笔在框内",
-        "showCanvasDebugInfo": "显示画布调试信息",
+        "showCanvasDebugInfo": "显示附加画布信息",
         "clearCanvasHistory": "清除画布历史",
         "clearHistory": "清除历史",
-        "clearCanvasHistoryMessage": "清除画布历史不会影响当前画布,但会不可撤销地清除所有撤销/重做历史!",
+        "clearCanvasHistoryMessage": "清除画布历史不会影响当前画布,但会不可撤销地清除所有撤销/重做历史。",
         "clearCanvasHistoryConfirm": "确认清除所有画布历史?",
         "emptyTempImageFolder": "清除临时文件夹",
         "emptyFolder": "清除文件夹",
@@ -480,7 +781,10 @@
         "betaClear": "清除",
         "betaDarkenOutside": "暗化外部区域",
         "betaLimitToBox": "限制在框内",
-        "betaPreserveMasked": "保留遮罩层"
+        "betaPreserveMasked": "保留遮罩层",
+        "antialiasing": "抗锯齿",
+        "showResultsOn": "显示结果 (开)",
+        "showResultsOff": "显示结果 (关)"
     },
     "accessibility": {
         "modelSelect": "模型选择",
@@ -490,13 +794,710 @@
         "useThisParameter": "使用此参数",
         "uploadImage": "上传图片",
         "previousImage": "上一张图片",
-        "copyMetadataJson": "复制JSON元数据",
-        "exitViewer": "退出视口(ExitViewer)",
+        "copyMetadataJson": "复制 JSON 元数据",
+        "exitViewer": "退出查看器",
         "zoomIn": "放大",
         "zoomOut": "缩小",
         "rotateCounterClockwise": "逆时针旋转",
         "rotateClockwise": "顺时针旋转",
         "flipHorizontally": "水平翻转",
-        "flipVertically": "垂直翻转"
+        "flipVertically": "垂直翻转",
+        "showOptionsPanel": "显示侧栏浮窗",
+        "toggleLogViewer": "切换日志查看器",
+        "modifyConfig": "修改配置",
+        "toggleAutoscroll": "切换自动缩放",
+        "menu": "菜单",
+        "showGalleryPanel": "显示图库浮窗",
+        "loadMore": "加载更多"
+    },
+    "ui": {
+        "showProgressImages": "显示处理中的图片",
+        "hideProgressImages": "隐藏处理中的图片",
+        "swapSizes": "XY 尺寸互换",
+        "lockRatio": "锁定纵横比"
+    },
+    "tooltip": {
+        "feature": {
+            "prompt": "这是提示词区域。提示词包括生成对象和风格术语。您也可以在提示词中添加权重(Token 的重要性),但命令行命令和参数不起作用。",
+            "imageToImage": "图生图模式加载任何图像作为初始图像,然后与提示词一起用于生成新图像。值越高,结果图像的变化就越大。可能的值为 0.0 到 1.0,建议的范围是 0.25 到 0.75",
+            "upscale": "使用 ESRGAN 可以在图片生成后立即放大图片。",
+            "variations": "尝试将变化值设置在 0.1 到 1.0 之间,以更改给定种子的结果。种子的变化在 0.1 到 0.3 之间会很有趣。",
+            "boundingBox": "边界框的高和宽的设定对文生图和图生图模式是一样的,只有边界框中的区域会被处理。",
+            "other": "这些选项将为 Invoke 启用替代处理模式。 \"无缝拼贴\" 将在输出中创建重复图案。\"高分辨率\" 是通过图生图进行两步生成:当您想要更大、更连贯且不带伪影的图像时,请使用此设置。这将比通常的文生图需要更长的时间。",
+            "faceCorrection": "使用 GFPGAN 或 Codeformer 进行人脸校正:该算法会检测图像中的人脸并纠正任何缺陷。较高的值将更改图像,并产生更有吸引力的人脸。在保留较高保真度的情况下使用 Codeformer 将导致更强的人脸校正,同时也会保留原始图像。",
+            "gallery": "图片库展示输出文件夹中的图片,设置和文件一起储存,可以通过内容菜单访问。",
+            "seed": "种子值影响形成图像的初始噪声。您可以使用以前图像中已存在的种子。 “噪声阈值”用于减轻在高 CFG 等级(尝试 0 - 10 范围)下的伪像,并使用 Perlin 在生成过程中添加 Perlin 噪声:这两者都可以为您的输出添加变化。",
+            "seamCorrection": "控制在画布上生成的图像之间出现的可见接缝的处理方式。",
+            "infillAndScaling": "管理填充方法(用于画布的遮罩或擦除区域)和缩放(对于较小的边界框大小非常有用)。"
+        }
+    },
+    "nodes": {
+        "zoomInNodes": "放大",
+        "resetWorkflowDesc": "是否确定要清空节点图?",
+        "resetWorkflow": "清空节点图",
+        "loadWorkflow": "读取节点图",
+        "zoomOutNodes": "缩小",
+        "resetWorkflowDesc2": "重置节点图将清除所有节点、边际和节点图详情.",
+        "reloadNodeTemplates": "重载节点模板",
+        "hideGraphNodes": "隐藏节点图信息",
+        "fitViewportNodes": "自适应视图",
+        "showMinimapnodes": "显示缩略图",
+        "hideMinimapnodes": "隐藏缩略图",
+        "showLegendNodes": "显示字段类型图例",
+        "hideLegendNodes": "隐藏字段类型图例",
+        "showGraphNodes": "显示节点图信息",
+        "downloadWorkflow": "下载节点图 JSON",
+        "workflowDescription": "简述",
+        "versionUnknown": " 未知版本",
+        "noNodeSelected": "无选中的节点",
+        "addNode": "添加节点",
+        "unableToValidateWorkflow": "无法验证工作流",
+        "noOutputRecorded": "无已记录输出",
+        "updateApp": "升级 App",
+        "colorCodeEdgesHelp": "根据连接区域对边缘编码颜色",
+        "workflowContact": "联系",
+        "animatedEdges": "边缘动效",
+        "nodeTemplate": "节点模板",
+        "pickOne": "选择一个",
+        "unableToLoadWorkflow": "无法验证工作流",
+        "snapToGrid": "对齐网格",
+        "noFieldsLinearview": "线性视图中未添加任何字段",
+        "nodeSearch": "检索节点",
+        "version": "版本",
+        "validateConnections": "验证连接和节点图",
+        "inputMayOnlyHaveOneConnection": "输入仅能有一个连接",
+        "notes": "节点",
+        "nodeOutputs": "节点输出",
+        "currentImageDescription": "在节点编辑器中显示当前图像",
+        "validateConnectionsHelp": "防止建立无效连接和调用无效节点图",
+        "problemSettingTitle": "设定标题时出现问题",
+        "noConnectionInProgress": "没有正在进行的连接",
+        "workflowVersion": "版本",
+        "noConnectionData": "无连接数据",
+        "fieldTypesMustMatch": "类型必须匹配",
+        "workflow": "工作流",
+        "unkownInvocation": "未知调用类型",
+        "animatedEdgesHelp": "为选中边缘和其连接的选中节点的边缘添加动画",
+        "unknownTemplate": "未知模板",
+        "removeLinearView": "从线性视图中移除",
+        "workflowTags": "标签",
+        "fullyContainNodesHelp": "节点必须完全位于选择框中才能被选中",
+        "workflowValidation": "工作流验证错误",
+        "noMatchingNodes": "无相匹配的节点",
+        "executionStateInProgress": "处理中",
+        "noFieldType": "无字段类型",
+        "executionStateError": "错误",
+        "executionStateCompleted": "已完成",
+        "workflowAuthor": "作者",
+        "currentImage": "当前图像",
+        "workflowName": "名称",
+        "cannotConnectInputToInput": "无法将输入连接到输入",
+        "workflowNotes": "节点",
+        "cannotConnectOutputToOutput": "无法将输出连接到输出",
+        "connectionWouldCreateCycle": "连接将创建一个循环",
+        "cannotConnectToSelf": "无法连接自己",
+        "notesDescription": "添加有关您的工作流的节点",
+        "unknownField": "未知",
+        "colorCodeEdges": "边缘颜色编码",
+        "unknownNode": "未知节点",
+        "addNodeToolTip": "添加节点 (Shift+A, Space)",
+        "loadingNodes": "加载节点中...",
+        "snapToGridHelp": "移动时将节点与网格对齐",
+        "workflowSettings": "工作流编辑器设置",
+        "booleanPolymorphicDescription": "一个布尔值合集。",
+        "scheduler": "调度器",
+        "inputField": "输入",
+        "controlFieldDescription": "节点间传递的控制信息。",
+        "skippingUnknownOutputType": "跳过未知类型的输出",
+        "latentsFieldDescription": "Latents 可以在节点间传递。",
+        "denoiseMaskFieldDescription": "去噪遮罩可以在节点间传递",
+        "missingTemplate": "缺失模板",
+        "outputSchemaNotFound": "未找到输出模式",
+        "latentsPolymorphicDescription": "Latents 可以在节点间传递。",
+        "colorFieldDescription": "一种 RGBA 颜色。",
+        "mainModelField": "模型",
+        "unhandledInputProperty": "未处理的输入属性",
+        "maybeIncompatible": "可能与已安装的不兼容",
+        "collectionDescription": "待办事项",
+        "skippingReservedFieldType": "跳过保留类型",
+        "booleanCollectionDescription": "一个布尔值合集。",
+        "sDXLMainModelFieldDescription": "SDXL 模型。",
+        "boardField": "面板",
+        "problemReadingWorkflow": "从图像读取工作流时出现问题",
+        "sourceNode": "源节点",
+        "nodeOpacity": "节点不透明度",
+        "collectionItemDescription": "待办事项",
+        "integerDescription": "整数是没有与小数点的数字。",
+        "outputField": "输出",
+        "skipped": "跳过",
+        "updateNode": "更新节点",
+        "sDXLRefinerModelFieldDescription": "待办事项",
+        "imagePolymorphicDescription": "一个图像合集。",
+        "doesNotExist": "不存在",
+        "unableToParseNode": "无法解析节点",
+        "controlCollection": "控制合集",
+        "collectionItem": "项目合集",
+        "controlCollectionDescription": "节点间传递的控制信息。",
+        "skippedReservedInput": "跳过保留的输入",
+        "outputFields": "输出",
+        "edge": "边缘",
+        "inputNode": "输入节点",
+        "enumDescription": "枚举 (Enums) 可能是多个选项的一个数值。",
+        "loRAModelFieldDescription": "待办事项",
+        "imageField": "图像",
+        "skippedReservedOutput": "跳过保留的输出",
+        "noWorkflow": "无工作流",
+        "colorCollectionDescription": "待办事项",
+        "colorPolymorphicDescription": "一个颜色合集。",
+        "sDXLMainModelField": "SDXL 模型",
+        "denoiseMaskField": "去噪遮罩",
+        "schedulerDescription": "待办事项",
+        "missingCanvaInitImage": "缺失画布初始图像",
+        "clipFieldDescription": "词元分析器和文本编码器的子模型。",
+        "noImageFoundState": "状态中未发现初始图像",
+        "nodeType": "节点类型",
+        "fullyContainNodes": "完全包含节点来进行选择",
+        "noOutputSchemaName": "在 ref 对象中找不到输出模式名称",
+        "vaeModelFieldDescription": "待办事项",
+        "skippingInputNoTemplate": "跳过无模板的输入",
+        "missingCanvaInitMaskImages": "缺失初始化画布和遮罩图像",
+        "problemReadingMetadata": "从图像读取元数据时出现问题",
+        "oNNXModelField": "ONNX 模型",
+        "node": "节点",
+        "skippingUnknownInputType": "跳过未知类型的输入",
+        "booleanDescription": "布尔值为真或为假。",
+        "collection": "合集",
+        "invalidOutputSchema": "无效的输出模式",
+        "boardFieldDescription": "图库面板",
+        "floatDescription": "浮点数是带小数点的数字。",
+        "unhandledOutputProperty": "未处理的输出属性",
+        "string": "字符串",
+        "inputFields": "输入",
+        "uNetFieldDescription": "UNet 子模型。",
+        "mismatchedVersion": "不匹配的版本",
+        "vaeFieldDescription": "Vae 子模型。",
+        "imageFieldDescription": "图像可以在节点间传递。",
+        "outputNode": "输出节点",
+        "mainModelFieldDescription": "待办事项",
+        "sDXLRefinerModelField": "Refiner 模型",
+        "unableToParseEdge": "无法解析边缘",
+        "latentsCollectionDescription": "Latents 可以在节点间传递。",
+        "oNNXModelFieldDescription": "ONNX 模型。",
+        "cannotDuplicateConnection": "无法创建重复的连接",
+        "ipAdapterModel": "IP-Adapter 模型",
+        "ipAdapterDescription": "图像提示词自适应 (IP-Adapter)。",
+        "ipAdapterModelDescription": "IP-Adapter 模型",
+        "floatCollectionDescription": "一个浮点数合集。",
+        "enum": "Enum (枚举)",
+        "integerPolymorphicDescription": "一个整数值合集。",
+        "float": "浮点",
+        "integer": "整数",
+        "colorField": "颜色",
+        "stringCollectionDescription": "一个字符串合集。",
+        "stringCollection": "字符串合集",
+        "uNetField": "UNet",
+        "integerCollection": "整数合集",
+        "vaeModelField": "VAE",
+        "integerCollectionDescription": "一个整数值合集。",
+        "clipField": "Clip",
+        "stringDescription": "字符串是指文本。",
+        "colorCollection": "一个颜色合集。",
+        "boolean": "布尔值",
+        "stringPolymorphicDescription": "一个字符串合集。",
+        "controlField": "控制信息",
+        "floatPolymorphicDescription": "一个浮点数合集。",
+        "vaeField": "Vae",
+        "floatCollection": "浮点合集",
+        "booleanCollection": "布尔值合集",
+        "imageCollectionDescription": "一个图像合集。",
+        "loRAModelField": "LoRA",
+        "imageCollection": "图像合集",
+        "ipAdapterPolymorphicDescription": "一个 IP-Adapters Collection 合集。",
+        "ipAdapterCollection": "IP-Adapters 合集",
+        "conditioningCollection": "条件合集",
+        "ipAdapterPolymorphic": "IP-Adapters 多态",
+        "conditioningCollectionDescription": "条件可以在节点间传递。",
+        "colorPolymorphic": "颜色多态",
+        "conditioningPolymorphic": "条件多态",
+        "latentsCollection": "Latents 合集",
+        "stringPolymorphic": "字符多态",
+        "conditioningPolymorphicDescription": "条件可以在节点间传递。",
+        "imagePolymorphic": "图像多态",
+        "floatPolymorphic": "浮点多态",
+        "ipAdapterCollectionDescription": "一个 IP-Adapters Collection 合集。",
+        "ipAdapter": "IP-Adapter",
+        "booleanPolymorphic": "布尔多态",
+        "conditioningFieldDescription": "条件可以在节点间传递。",
+        "integerPolymorphic": "整数多态",
+        "latentsPolymorphic": "Latents 多态",
+        "conditioningField": "条件",
+        "latentsField": "Latents"
+    },
+    "controlnet": {
+        "resize": "直接缩放",
+        "showAdvanced": "显示高级",
+        "contentShuffleDescription": "随机打乱图像内容",
+        "importImageFromCanvas": "从画布导入图像",
+        "lineartDescription": "将图像转换为线稿",
+        "importMaskFromCanvas": "从画布导入遮罩",
+        "hideAdvanced": "隐藏高级",
+        "ipAdapterModel": "Adapter 模型",
+        "resetControlImage": "重置控制图像",
+        "beginEndStepPercent": "开始 / 结束步数百分比",
+        "mlsdDescription": "简洁的分割线段(直线)检测器",
+        "duplicate": "复制",
+        "balanced": "平衡",
+        "prompt": "Prompt (提示词控制)",
+        "depthMidasDescription": "使用 Midas 生成深度图",
+        "openPoseDescription": "使用 Openpose 进行人体姿态估计",
+        "resizeMode": "缩放模式",
+        "weight": "权重",
+        "selectModel": "选择一个模型",
+        "crop": "裁剪",
+        "processor": "处理器",
+        "none": "无",
+        "incompatibleBaseModel": "不兼容的基础模型:",
+        "enableControlnet": "启用 ControlNet",
+        "detectResolution": "检测分辨率",
+        "pidiDescription": "像素差分 (PIDI) 图像处理",
+        "controlMode": "控制模式",
+        "fill": "填充",
+        "cannyDescription": "Canny 边缘检测",
+        "colorMapDescription": "从图像生成一张颜色图",
+        "imageResolution": "图像分辨率",
+        "autoConfigure": "自动配置处理器",
+        "normalBaeDescription": "法线 BAE 处理",
+        "noneDescription": "不应用任何处理",
+        "saveControlImage": "保存控制图像",
+        "toggleControlNet": "开关此 ControlNet",
+        "delete": "删除",
+        "colorMapTileSize": "分块大小",
+        "ipAdapterImageFallback": "无已选择的 IP Adapter 图像",
+        "mediapipeFaceDescription": "使用 Mediapipe 检测面部",
+        "depthZoeDescription": "使用 Zoe 生成深度图",
+        "hedDescription": "整体嵌套边缘检测",
+        "setControlImageDimensions": "设定控制图像尺寸宽/高为",
+        "resetIPAdapterImage": "重置 IP Adapter 图像",
+        "handAndFace": "手部和面部",
+        "enableIPAdapter": "启用 IP Adapter",
+        "amult": "角度倍率 (a_mult)",
+        "bgth": "背景移除阈值 (bg_th)",
+        "lineartAnimeDescription": "动漫风格线稿处理",
+        "minConfidence": "最小置信度",
+        "lowThreshold": "弱判断阈值",
+        "highThreshold": "强判断阈值",
+        "addT2IAdapter": "添加 $t(common.t2iAdapter)",
+        "controlNetEnabledT2IDisabled": "$t(common.controlNet) 已启用, $t(common.t2iAdapter) 已禁用",
+        "t2iEnabledControlNetDisabled": "$t(common.t2iAdapter) 已启用, $t(common.controlNet) 已禁用",
+        "addControlNet": "添加 $t(common.controlNet)",
+        "controlNetT2IMutexDesc": "$t(common.controlNet) 和 $t(common.t2iAdapter) 目前不支持同时启用。",
+        "addIPAdapter": "添加 $t(common.ipAdapter)",
+        "safe": "保守模式",
+        "scribble": "草绘 (scribble)",
+        "maxFaces": "最大面部数",
+        "pidi": "PIDI",
+        "normalBae": "Normal BAE",
+        "hed": "HED",
+        "contentShuffle": "Content Shuffle",
+        "f": "F",
+        "h": "H",
+        "controlnet": "$t(controlnet.controlAdapter) #{{number}} ($t(common.controlNet))",
+        "control": "Control (普通控制)",
+        "coarse": "Coarse",
+        "depthMidas": "Depth (Midas)",
+        "w": "W",
+        "ip_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.ipAdapter))",
+        "mediapipeFace": "Mediapipe Face",
+        "mlsd": "M-LSD",
+        "lineart": "Lineart",
+        "t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.t2iAdapter))",
+        "megaControl": "Mega Control (超级控制)",
+        "depthZoe": "Depth (Zoe)",
+        "colorMap": "Color",
+        "openPose": "Openpose",
+        "controlAdapter_other": "Control Adapters",
+        "lineartAnime": "Lineart Anime",
+        "canny": "Canny"
+    },
+    "queue": {
+        "status": "状态",
+        "cancelTooltip": "取消当前项目",
+        "queueEmpty": "队列为空",
+        "pauseSucceeded": "处理器已暂停",
+        "in_progress": "处理中",
+        "queueFront": "添加到队列前",
+        "completed": "已完成",
+        "queueBack": "添加到队列",
+        "cancelFailed": "取消项目时出现问题",
+        "pauseFailed": "暂停处理器时出现问题",
+        "clearFailed": "清除队列时出现问题",
+        "clearSucceeded": "队列已清除",
+        "pause": "暂停",
+        "cancelSucceeded": "项目已取消",
+        "queue": "队列",
+        "batch": "批处理",
+        "clearQueueAlertDialog": "清除队列时会立即取消所有处理中的项目并且会完全清除队列。",
+        "pending": "待定",
+        "completedIn": "完成于",
+        "resumeFailed": "恢复处理器时出现问题",
+        "clear": "清除",
+        "prune": "修剪",
+        "total": "总计",
+        "canceled": "已取消",
+        "pruneFailed": "修剪队列时出现问题",
+        "cancelBatchSucceeded": "批处理已取消",
+        "clearTooltip": "取消并清除所有项目",
+        "current": "当前",
+        "pauseTooltip": "暂停处理器",
+        "failed": "已失败",
+        "cancelItem": "取消项目",
+        "next": "下一个",
+        "cancelBatch": "取消批处理",
+        "cancel": "取消",
+        "resumeSucceeded": "处理器已恢复",
+        "resumeTooltip": "恢复处理器",
+        "resume": "恢复",
+        "cancelBatchFailed": "取消批处理时出现问题",
+        "clearQueueAlertDialog2": "您确定要清除队列吗?",
+        "item": "项目",
+        "pruneSucceeded": "从队列修剪 {{item_count}} 个已完成的项目",
+        "notReady": "无法排队",
+        "batchFailedToQueue": "批次加入队列失败",
+        "batchValues": "批次数",
+        "queueCountPrediction": "添加 {{predicted}} 到队列",
+        "batchQueued": "加入队列的批次",
+        "queuedCount": "{{pending}} 待处理",
+        "front": "前",
+        "pruneTooltip": "修剪 {{item_count}} 个已完成的项目",
+        "batchQueuedDesc_other": "在队列的 {{direction}} 中添加了 {{count}} 个会话",
+        "graphQueued": "节点图已加入队列",
+        "back": "后",
+        "session": "会话",
+        "queueTotal": "总计 {{total}}",
+        "enqueueing": "队列中的批次",
+        "queueMaxExceeded": "超出最大值 {{max_queue_size}},将跳过 {{skip}}",
+        "graphFailedToQueue": "节点图加入队列失败"
+    },
+    "sdxl": {
+        "refinerStart": "Refiner 开始作用时机",
+        "selectAModel": "选择一个模型",
+        "scheduler": "调度器",
+        "cfgScale": "CFG 等级",
+        "negStylePrompt": "负向样式提示词",
+        "noModelsAvailable": "无可用模型",
+        "negAestheticScore": "负向美学评分",
+        "useRefiner": "启用 Refiner",
+        "denoisingStrength": "去噪强度",
+        "refinermodel": "Refiner 模型",
+        "posAestheticScore": "正向美学评分",
+        "concatPromptStyle": "连接提示词 & 样式",
+        "loading": "加载中...",
+        "steps": "步数",
+        "posStylePrompt": "正向样式提示词",
+        "refiner": "Refiner"
+    },
+    "metadata": {
+        "positivePrompt": "正向提示词",
+        "negativePrompt": "负向提示词",
+        "generationMode": "生成模式",
+        "Threshold": "噪声阈值",
+        "metadata": "元数据",
+        "strength": "图生图强度",
+        "seed": "种子",
+        "imageDetails": "图像详细信息",
+        "perlin": "Perlin 噪声",
+        "model": "模型",
+        "noImageDetails": "未找到图像详细信息",
+        "hiresFix": "高分辨率优化",
+        "cfgScale": "CFG 等级",
+        "initImage": "初始图像",
+        "height": "高度",
+        "variations": "(成对/第二)种子权重",
+        "noMetaData": "未找到元数据",
+        "width": "宽度",
+        "createdBy": "创建者是",
+        "workflow": "工作流",
+        "steps": "步数",
+        "scheduler": "调度器",
+        "seamless": "无缝",
+        "fit": "图生图匹配",
+        "recallParameters": "召回参数",
+        "noRecallParameters": "未找到要召回的参数"
+    },
+    "models": {
+        "noMatchingModels": "无相匹配的模型",
+        "loading": "加载中",
+        "noMatchingLoRAs": "无相匹配的 LoRA",
+        "noLoRAsAvailable": "无可用 LoRA",
+        "noModelsAvailable": "无可用模型",
+        "selectModel": "选择一个模型",
+        "selectLoRA": "选择一个 LoRA"
+    },
+    "boards": {
+        "autoAddBoard": "自动添加面板",
+        "topMessage": "该面板包含的图像正使用以下功能:",
+        "move": "移动",
+        "menuItemAutoAdd": "自动添加到该面板",
+        "myBoard": "我的面板",
+        "searchBoard": "检索面板...",
+        "noMatching": "没有相匹配的面板",
+        "selectBoard": "选择一个面板",
+        "cancel": "取消",
+        "addBoard": "添加面板",
+        "bottomMessage": "删除该面板并且将其对应的图像将重置当前使用该面板的所有功能。",
+        "uncategorized": "未分类",
+        "changeBoard": "更改面板",
+        "loading": "加载中...",
+        "clearSearch": "清除检索",
+        "downloadBoard": "下载面板"
+    },
+    "embedding": {
+        "noMatchingEmbedding": "不匹配的 Embedding",
+        "addEmbedding": "添加 Embedding",
+        "incompatibleModel": "不兼容的基础模型:"
+    },
+    "dynamicPrompts": {
+        "seedBehaviour": {
+            "perPromptDesc": "每次生成图像使用不同的种子",
+            "perIterationLabel": "每次迭代的种子",
+            "perIterationDesc": "每次迭代使用不同的种子",
+            "perPromptLabel": "每张图像的种子",
+            "label": "种子行为"
+        },
+        "enableDynamicPrompts": "启用动态提示词",
+        "combinatorial": "组合生成",
+        "maxPrompts": "最大提示词数",
+        "dynamicPrompts": "动态提示词",
+        "promptsWithCount_other": "{{count}} 个提示词"
+    },
+    "popovers": {
+        "compositingMaskAdjustments": {
+            "heading": "遮罩调整",
+            "paragraphs": [
+                "调整遮罩。"
+            ]
+        },
+        "paramRatio": {
+            "heading": "纵横比",
+            "paragraphs": [
+                "生成图像的尺寸纵横比。",
+                "图像尺寸(单位:像素)建议 SD 1.5 模型使用等效 512x512 的尺寸,SDXL 模型使用等效 1024x1024 的尺寸。"
+            ]
+        },
+        "compositingCoherenceSteps": {
+            "heading": "步数",
+            "paragraphs": [
+                "一致性层中使用的去噪步数。",
+                "与主参数中的步数相同。"
+            ]
+        },
+        "compositingBlur": {
+            "heading": "模糊",
+            "paragraphs": [
+                "遮罩模糊半径。"
+            ]
+        },
+        "noiseUseCPU": {
+            "heading": "使用 CPU 噪声",
+            "paragraphs": [
+                "选择由 CPU 或 GPU 生成噪声。",
+                "启用 CPU 噪声后,特定的种子将会在不同的设备上产生下相同的图像。",
+                "启用 CPU 噪声不会对性能造成影响。"
+            ]
+        },
+        "paramVAEPrecision": {
+            "heading": "VAE 精度",
+            "paragraphs": [
+                "VAE 编解码过程种使用的精度。FP16/半精度以微小的图像变化为代价提高效率。"
+            ]
+        },
+        "compositingCoherenceMode": {
+            "heading": "模式",
+            "paragraphs": [
+                "一致性层模式。"
+            ]
+        },
+        "controlNetResizeMode": {
+            "heading": "缩放模式",
+            "paragraphs": [
+                "ControlNet 输入图像适应输出图像大小的方法。"
+            ]
+        },
+        "clipSkip": {
+            "paragraphs": [
+                "选择要跳过 CLIP 模型多少层。",
+                "部分模型跳过特定数值的层时效果会更好。",
+                "较高的数值通常会导致图像细节更少。"
+            ],
+            "heading": "CLIP 跳过层"
+        },
+        "paramModel": {
+            "heading": "模型",
+            "paragraphs": [
+                "用于去噪过程的模型。",
+                "不同的模型一般会通过接受训练来专门产生特定的美学内容和结果。"
+            ]
+        },
+        "paramIterations": {
+            "heading": "迭代数",
+            "paragraphs": [
+                "生成图像的数量。",
+                "若启用动态提示词,每种提示词都会生成这么多次。"
+            ]
+        },
+        "compositingCoherencePass": {
+            "heading": "一致性层",
+            "paragraphs": [
+                "第二轮去噪有助于合成内补/外扩图像。"
+            ]
+        },
+        "compositingStrength": {
+            "heading": "强度",
+            "paragraphs": [
+                "一致性层使用的去噪强度。",
+                "去噪强度与图生图的参数相同。"
+            ]
+        },
+        "paramNegativeConditioning": {
+            "paragraphs": [
+                "生成过程会避免生成负向提示词中的概念。使用此选项来使输出排除部分质量或对象。",
+                "支持 Compel 语法 和 embeddings。"
+            ],
+            "heading": "负向提示词"
+        },
+        "compositingBlurMethod": {
+            "heading": "模糊方式",
+            "paragraphs": [
+                "应用于遮罩区域的模糊方法。"
+            ]
+        },
+        "paramScheduler": {
+            "heading": "调度器",
+            "paragraphs": [
+                "调度器 (采样器) 定义如何在图像迭代过程中添加噪声,或者定义如何根据一个模型的输出来更新采样。"
+            ]
+        },
+        "controlNetWeight": {
+            "heading": "权重",
+            "paragraphs": [
+                "ControlNet 对生成图像的影响强度。"
+            ]
+        },
+        "paramCFGScale": {
+            "heading": "CFG 等级",
+            "paragraphs": [
+                "控制提示词对生成过程的影响程度。"
+            ]
+        },
+        "paramSteps": {
+            "heading": "步数",
+            "paragraphs": [
+                "每次生成迭代执行的步数。",
+                "通常情况下步数越多结果越好,但需要更多生成时间。"
+            ]
+        },
+        "paramPositiveConditioning": {
+            "heading": "正向提示词",
+            "paragraphs": [
+                "引导生成过程。您可以使用任何单词或短语。",
+                "Compel 语法、动态提示词语法和 embeddings。"
+            ]
+        },
+        "lora": {
+            "heading": "LoRA 权重",
+            "paragraphs": [
+                "更高的 LoRA 权重会对最终图像产生更大的影响。"
+            ]
+        },
+        "infillMethod": {
+            "heading": "填充方法",
+            "paragraphs": [
+                "填充选定区域的方式。"
+            ]
+        },
+        "controlNetBeginEnd": {
+            "heading": "开始 / 结束步数百分比",
+            "paragraphs": [
+                "去噪过程中在哪部分步数应用 ControlNet。",
+                "在组合处理开始阶段应用 ControlNet,且在引导细节生成的结束阶段应用 ControlNet。"
+            ]
+        },
+        "scaleBeforeProcessing": {
+            "heading": "处理前缩放",
+            "paragraphs": [
+                "生成图像前将所选区域缩放为最适合模型的大小。"
+            ]
+        },
+        "paramDenoisingStrength": {
+            "heading": "去噪强度",
+            "paragraphs": [
+                "为输入图像添加的噪声量。",
+                "输入 0 会导致结果图像和输入完全相同,输入 1 则会生成全新的图像。"
+            ]
+        },
+        "paramSeed": {
+            "heading": "种子",
+            "paragraphs": [
+                "控制用于生成的起始噪声。",
+                "禁用 “随机种子” 来以相同设置生成相同的结果。"
+            ]
+        },
+        "controlNetControlMode": {
+            "heading": "控制模式",
+            "paragraphs": [
+                "给提示词或 ControlNet 增加更大的权重。"
+            ]
+        },
+        "dynamicPrompts": {
+            "paragraphs": [
+                "动态提示词可将单个提示词解析为多个。",
+                "基本语法示例:\"a {red|green|blue} ball\"。这会产生三种提示词:\"a red ball\", \"a green ball\" 和 \"a blue ball\"。",
+                "可以在单个提示词中多次使用该语法,但务必请使用最大提示词设置来控制生成的提示词数量。"
+            ],
+            "heading": "动态提示词"
+        },
+        "paramVAE": {
+            "paragraphs": [
+                "用于将 AI 输出转换成最终图像的模型。"
+            ],
+            "heading": "VAE"
+        },
+        "dynamicPromptsSeedBehaviour": {
+            "paragraphs": [
+                "控制生成提示词时种子的使用方式。",
+                "每次迭代过程都会使用一个唯一的种子。使用本选项来探索单个种子的提示词变化。",
+                "例如,如果你有 5 种提示词,则生成的每个图像都会使用相同种子。",
+                "为每张图像使用独立的唯一种子。这可以提供更多变化。"
+            ],
+            "heading": "种子行为"
+        },
+        "dynamicPromptsMaxPrompts": {
+            "heading": "最大提示词数量",
+            "paragraphs": [
+                "限制动态提示词可生成的提示词数量。"
+            ]
+        },
+        "controlNet": {
+            "paragraphs": [
+                "ControlNet 为生成过程提供引导,为生成具有受控构图、结构、样式的图像提供帮助,具体的功能由所选的模型决定。"
+            ],
+            "heading": "ControlNet"
+        }
+    },
+    "invocationCache": {
+        "disable": "禁用",
+        "misses": "缓存未中",
+        "enableFailed": "启用调用缓存时出现问题",
+        "invocationCache": "调用缓存",
+        "clearSucceeded": "调用缓存已清除",
+        "enableSucceeded": "调用缓存已启用",
+        "clearFailed": "清除调用缓存时出现问题",
+        "hits": "缓存命中",
+        "disableSucceeded": "调用缓存已禁用",
+        "disableFailed": "禁用调用缓存时出现问题",
+        "enable": "启用",
+        "clear": "清除",
+        "maxCacheSize": "最大缓存大小",
+        "cacheSize": "缓存大小"
     }
 }
diff --git a/invokeai/frontend/web/public/locales/zh_Hant.json b/invokeai/frontend/web/public/locales/zh_Hant.json
index 98b4882018..fe51856117 100644
--- a/invokeai/frontend/web/public/locales/zh_Hant.json
+++ b/invokeai/frontend/web/public/locales/zh_Hant.json
@@ -13,9 +13,6 @@
         "settingsLabel": "設定",
         "upload": "上傳",
         "langArabic": "阿拉伯語",
-        "greenTheme": "綠色",
-        "lightTheme": "淺色",
-        "darkTheme": "深色",
         "discordLabel": "Discord",
         "nodesDesc": "使用Node生成圖像的系統正在開發中。敬請期待有關於這項功能的更新。",
         "reportBugLabel": "回報錯誤",
@@ -33,6 +30,24 @@
         "langBrPortuguese": "巴西葡萄牙語",
         "langRussian": "俄語",
         "langSpanish": "西班牙語",
-        "unifiedCanvas": "統一畫布"
+        "unifiedCanvas": "統一畫布",
+        "cancel": "取消",
+        "langHebrew": "希伯來語",
+        "txt2img": "文字轉圖片"
+    },
+    "accessibility": {
+        "modelSelect": "選擇模型",
+        "invokeProgressBar": "Invoke 進度條",
+        "uploadImage": "上傳圖片",
+        "reset": "重設",
+        "nextImage": "下一張圖片",
+        "previousImage": "上一張圖片",
+        "flipHorizontally": "水平翻轉",
+        "useThisParameter": "使用此參數",
+        "zoomIn": "放大",
+        "zoomOut": "縮小",
+        "flipVertically": "垂直翻轉",
+        "modifyConfig": "修改配置",
+        "menu": "選單"
     }
 }
diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts
index bdb8e03ad2..62a661756b 100644
--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts
+++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts
@@ -30,7 +30,7 @@ export const addBatchEnqueuedListener = () => {
           id: 'batch-queued',
           title: t('queue.batchQueued'),
           description: t('queue.batchQueuedDesc', {
-            item_count: response.enqueued,
+            count: response.enqueued,
             direction: arg.prepend ? t('queue.front') : t('queue.back'),
           }),
           duration: 1000,
diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts
index 62f7b60036..35c1affb97 100644
--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts
+++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts
@@ -44,7 +44,7 @@ export const addCanvasMergedListener = () => {
       }
 
       const baseLayerRect = canvasBaseLayer.getClientRect({
-        relativeTo: canvasBaseLayer.getParent(),
+        relativeTo: canvasBaseLayer.getParent() ?? undefined,
       });
 
       const imageDTO = await dispatch(
diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts
index 79a09c628f..bd5422841f 100644
--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts
+++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts
@@ -151,7 +151,9 @@ export const addRequestedSingleImageDeletionListener = () => {
 
       if (wasImageDeleted) {
         dispatch(
-          api.util.invalidateTags([{ type: 'Board', id: imageDTO.board_id }])
+          api.util.invalidateTags([
+            { type: 'Board', id: imageDTO.board_id ?? 'none' },
+          ])
         );
       }
     },
diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts
index c320c437f6..6ed0b93e99 100644
--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts
+++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts
@@ -73,14 +73,9 @@ export const addModelSelectedListener = () => {
           dispatch(
             addToast(
               makeToast({
-                title: t(
-                  modelsCleared === 1
-                    ? 'toast.baseModelChangedCleared_one'
-                    : 'toast.baseModelChangedCleared_many',
-                  {
-                    number: modelsCleared,
-                  }
-                ),
+                title: t('toast.baseModelChangedCleared', {
+                  count: modelsCleared,
+                }),
                 status: 'warning',
               })
             )
diff --git a/invokeai/frontend/web/src/app/types/invokeai.ts b/invokeai/frontend/web/src/app/types/invokeai.ts
index 0f1f7b3aaa..39e4ffd27a 100644
--- a/invokeai/frontend/web/src/app/types/invokeai.ts
+++ b/invokeai/frontend/web/src/app/types/invokeai.ts
@@ -22,7 +22,8 @@ export type AppFeature =
   | 'pauseQueue'
   | 'resumeQueue'
   | 'prependQueue'
-  | 'invocationCache';
+  | 'invocationCache'
+  | 'bulkDownload';
 
 /**
  * A disable-able Stable Diffusion feature
@@ -38,7 +39,8 @@ export type SDFeature =
   | 'hires'
   | 'lora'
   | 'embedding'
-  | 'vae';
+  | 'vae'
+  | 'hrf';
 
 /**
  * Configuration options for the InvokeAI UI.
@@ -109,6 +111,14 @@ export type AppConfig = {
       fineStep: number;
       coarseStep: number;
     };
+    hrfStrength: {
+      initial: number;
+      min: number;
+      sliderMax: number;
+      inputMax: number;
+      fineStep: number;
+      coarseStep: number;
+    };
     dynamicPrompts: {
       maxPrompts: {
         initial: number;
diff --git a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts
index f2398483bf..197f5f4068 100644
--- a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts
+++ b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts
@@ -2,6 +2,7 @@ import { PopoverProps } from '@chakra-ui/react';
 
 export type Feature =
   | 'clipSkip'
+  | 'hrf'
   | 'paramNegativeConditioning'
   | 'paramPositiveConditioning'
   | 'paramScheduler'
diff --git a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx
index 7c85b3557e..5ea17f788c 100644
--- a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx
+++ b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx
@@ -6,7 +6,7 @@ import { useMantineMultiSelectStyles } from 'mantine-theme/hooks/useMantineMulti
 import { KeyboardEvent, RefObject, memo, useCallback } from 'react';
 
 type IAIMultiSelectProps = Omit<MultiSelectProps, 'label'> & {
-  tooltip?: string;
+  tooltip?: string | null;
   inputRef?: RefObject<HTMLInputElement>;
   label?: string;
 };
diff --git a/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx
index 39fe7ead3c..675314b421 100644
--- a/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx
+++ b/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx
@@ -12,7 +12,7 @@ export type IAISelectDataType = {
 };
 
 type IAISelectProps = Omit<SelectProps, 'label'> & {
-  tooltip?: string;
+  tooltip?: string | null;
   label?: string;
   inputRef?: RefObject<HTMLInputElement>;
 };
diff --git a/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx
index 8cc08d2304..9541015b65 100644
--- a/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx
+++ b/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx
@@ -10,7 +10,7 @@ export type IAISelectDataType = {
 };
 
 export type IAISelectProps = Omit<SelectProps, 'label'> & {
-  tooltip?: string;
+  tooltip?: string | null;
   inputRef?: RefObject<HTMLInputElement>;
   label?: string;
 };
diff --git a/invokeai/frontend/web/src/common/hooks/useImage.ts b/invokeai/frontend/web/src/common/hooks/useImage.ts
new file mode 100644
index 0000000000..60c973ce59
--- /dev/null
+++ b/invokeai/frontend/web/src/common/hooks/useImage.ts
@@ -0,0 +1,102 @@
+import { useLayoutEffect, useRef, useState } from 'react';
+
+// Adapted from https://github.com/konvajs/use-image
+
+type CrossOrigin = 'anonymous' | 'use-credentials';
+type ReferrerPolicy =
+  | 'no-referrer'
+  | 'no-referrer-when-downgrade'
+  | 'origin'
+  | 'origin-when-cross-origin'
+  | 'same-origin'
+  | 'strict-origin'
+  | 'strict-origin-when-cross-origin'
+  | 'unsafe-url';
+type ImageStatus = 'loaded' | 'loading' | 'failed';
+
+export const useImage = (
+  url: string,
+  crossOrigin?: CrossOrigin,
+  referrerpolicy?: ReferrerPolicy
+): [undefined | HTMLImageElement, ImageStatus, Blob | null] => {
+  // lets use refs for image and status
+  // so we can update them during render
+  // to have instant update in status/image when new data comes in
+  const statusRef = useRef<ImageStatus>('loading');
+  const imageRef = useRef<HTMLImageElement>();
+  const blobRef = useRef<Blob | null>(null);
+
+  // we are not going to use token
+  // but we need to just to trigger state update
+  const [_, setStateToken] = useState(0);
+
+  // keep track of old props to trigger changes
+  const oldUrl = useRef<string>();
+  const oldCrossOrigin = useRef<string>();
+  const oldReferrerPolicy = useRef<string>();
+
+  if (
+    oldUrl.current !== url ||
+    oldCrossOrigin.current !== crossOrigin ||
+    oldReferrerPolicy.current !== referrerpolicy
+  ) {
+    statusRef.current = 'loading';
+    imageRef.current = undefined;
+    oldUrl.current = url;
+    oldCrossOrigin.current = crossOrigin;
+    oldReferrerPolicy.current = referrerpolicy;
+  }
+
+  useLayoutEffect(
+    function () {
+      if (!url) {
+        return;
+      }
+      const img = document.createElement('img');
+
+      function onload() {
+        statusRef.current = 'loaded';
+        imageRef.current = img;
+        const canvas = document.createElement('canvas');
+        canvas.width = img.clientWidth;
+        canvas.height = img.clientHeight;
+
+        const context = canvas.getContext('2d');
+        if (context) {
+          context.drawImage(img, 0, 0);
+          canvas.toBlob(function (blob) {
+            blobRef.current = blob;
+          }, 'image/png');
+        }
+        setStateToken(Math.random());
+      }
+
+      function onerror() {
+        statusRef.current = 'failed';
+        imageRef.current = undefined;
+        setStateToken(Math.random());
+      }
+
+      img.addEventListener('load', onload);
+      img.addEventListener('error', onerror);
+      if (crossOrigin) {
+        img.crossOrigin = crossOrigin;
+      }
+      if (referrerpolicy) {
+        img.referrerPolicy = referrerpolicy;
+      }
+      img.src = url;
+
+      return function cleanup() {
+        img.removeEventListener('load', onload);
+        img.removeEventListener('error', onerror);
+      };
+    },
+    [url, crossOrigin, referrerpolicy]
+  );
+
+  // return array because it is better to use in case of several useImage hooks
+  // const [background, backgroundStatus] = useImage(url1);
+  // const [patter] = useImage(url2);
+  return [imageRef.current, statusRef.current, blobRef.current];
+};
diff --git a/invokeai/frontend/web/src/common/hooks/useImageUrlToBlob.ts b/invokeai/frontend/web/src/common/hooks/useImageUrlToBlob.ts
new file mode 100644
index 0000000000..77538a929d
--- /dev/null
+++ b/invokeai/frontend/web/src/common/hooks/useImageUrlToBlob.ts
@@ -0,0 +1,40 @@
+import { useCallback } from 'react';
+import { $authToken } from 'services/api/client';
+
+/**
+ * Converts an image URL to a Blob by creating an <img /> element, drawing it to canvas
+ * and then converting the canvas to a Blob.
+ *
+ * @returns A function that takes a URL and returns a Promise that resolves with a Blob
+ */
+export const useImageUrlToBlob = () => {
+  const imageUrlToBlob = useCallback(
+    async (url: string) =>
+      new Promise<Blob | null>((resolve) => {
+        const img = new Image();
+        img.onload = () => {
+          const canvas = document.createElement('canvas');
+          canvas.width = img.width;
+          canvas.height = img.height;
+
+          const context = canvas.getContext('2d');
+          if (!context) {
+            return;
+          }
+          context.drawImage(img, 0, 0);
+          resolve(
+            new Promise<Blob | null>((resolve) => {
+              canvas.toBlob(function (blob) {
+                resolve(blob);
+              }, 'image/png');
+            })
+          );
+        };
+        img.crossOrigin = $authToken.get() ? 'use-credentials' : 'anonymous';
+        img.src = url;
+      }),
+    []
+  );
+
+  return imageUrlToBlob;
+};
diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx
index 7aa9cad003..2b13e5cf6b 100644
--- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx
+++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx
@@ -45,7 +45,7 @@ const selector = createSelector(
 
     return {
       activeLayerColor,
-      activeLayerString: layer.charAt(0).toUpperCase() + layer.slice(1),
+      layer,
       boundingBoxColor,
       boundingBoxCoordinatesString: `(${roundToHundreth(
         boxX
@@ -73,7 +73,7 @@ const selector = createSelector(
 const IAICanvasStatusText = () => {
   const {
     activeLayerColor,
-    activeLayerString,
+    layer,
     boundingBoxColor,
     boundingBoxCoordinatesString,
     boundingBoxDimensionsString,
@@ -116,7 +116,9 @@ const IAICanvasStatusText = () => {
         style={{
           color: activeLayerColor,
         }}
-      >{`${t('unifiedCanvas.activeLayer')}: ${activeLayerString}`}</Box>
+      >{`${t('unifiedCanvas.activeLayer')}: ${t(
+        `unifiedCanvas.${layer}`
+      )}`}</Box>
       <Box>{`${t('unifiedCanvas.canvasScale')}: ${canvasScaleString}%`}</Box>
       {shouldPreserveMaskedArea && (
         <Box
@@ -124,7 +126,7 @@ const IAICanvasStatusText = () => {
             color: warningColor,
           }}
         >
-          Preserve Masked Area: On
+          {t('unifiedCanvas.preserveMaskedArea')}: {t('common.on')}
         </Box>
       )}
       {shouldShowBoundingBox && (
diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts
index 77fae4e0a1..a5520322be 100644
--- a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts
+++ b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts
@@ -30,6 +30,7 @@ import {
   isCanvasMaskLine,
 } from './canvasTypes';
 import { appSocketQueueItemStatusChanged } from 'services/events/actions';
+import { queueApi } from 'services/api/endpoints/queue';
 
 export const initialLayerState: CanvasLayerState = {
   objects: [],
@@ -812,6 +813,20 @@ export const canvasSlice = createSlice({
         );
       }
     });
+    builder.addMatcher(
+      queueApi.endpoints.clearQueue.matchFulfilled,
+      (state) => {
+        state.batchIds = [];
+      }
+    );
+    builder.addMatcher(
+      queueApi.endpoints.cancelByBatchIds.matchFulfilled,
+      (state, action) => {
+        state.batchIds = state.batchIds.filter(
+          (id) => !action.meta.arg.originalArgs.batch_ids.includes(id)
+        );
+      }
+    );
   },
 });
 
diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdaptersCollapse.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdaptersCollapse.tsx
index 202222bed9..2cad007a03 100644
--- a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdaptersCollapse.tsx
+++ b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdaptersCollapse.tsx
@@ -11,31 +11,53 @@ import {
   selectAllIPAdapters,
   selectAllT2IAdapters,
   selectControlAdapterIds,
+  selectValidControlNets,
+  selectValidIPAdapters,
+  selectValidT2IAdapters,
 } from 'features/controlAdapters/store/controlAdaptersSlice';
 import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
 import { Fragment, memo } from 'react';
+import { useTranslation } from 'react-i18next';
 import { FaPlus } from 'react-icons/fa';
 import { useAddControlAdapter } from '../hooks/useAddControlAdapter';
-import { useTranslation } from 'react-i18next';
 
 const selector = createSelector(
   [stateSelector],
   ({ controlAdapters }) => {
     const activeLabel: string[] = [];
+    let isError = false;
 
-    const ipAdapterCount = selectAllIPAdapters(controlAdapters).length;
-    if (ipAdapterCount > 0) {
-      activeLabel.push(`${ipAdapterCount} IP`);
+    const enabledIPAdapterCount = selectAllIPAdapters(controlAdapters).filter(
+      (ca) => ca.isEnabled
+    ).length;
+    const validIPAdapterCount = selectValidIPAdapters(controlAdapters).length;
+    if (enabledIPAdapterCount > 0) {
+      activeLabel.push(`${enabledIPAdapterCount} IP`);
+    }
+    if (enabledIPAdapterCount > validIPAdapterCount) {
+      isError = true;
     }
 
-    const controlNetCount = selectAllControlNets(controlAdapters).length;
-    if (controlNetCount > 0) {
-      activeLabel.push(`${controlNetCount} ControlNet`);
+    const enabledControlNetCount = selectAllControlNets(controlAdapters).filter(
+      (ca) => ca.isEnabled
+    ).length;
+    const validControlNetCount = selectValidControlNets(controlAdapters).length;
+    if (enabledControlNetCount > 0) {
+      activeLabel.push(`${enabledControlNetCount} ControlNet`);
+    }
+    if (enabledControlNetCount > validControlNetCount) {
+      isError = true;
     }
 
-    const t2iAdapterCount = selectAllT2IAdapters(controlAdapters).length;
-    if (t2iAdapterCount > 0) {
-      activeLabel.push(`${t2iAdapterCount} T2I`);
+    const enabledT2IAdapterCount = selectAllT2IAdapters(controlAdapters).filter(
+      (ca) => ca.isEnabled
+    ).length;
+    const validT2IAdapterCount = selectValidT2IAdapters(controlAdapters).length;
+    if (enabledT2IAdapterCount > 0) {
+      activeLabel.push(`${enabledT2IAdapterCount} T2I`);
+    }
+    if (enabledT2IAdapterCount > validT2IAdapterCount) {
+      isError = true;
     }
 
     const controlAdapterIds =
@@ -44,6 +66,7 @@ const selector = createSelector(
     return {
       controlAdapterIds,
       activeLabel: activeLabel.join(', '),
+      isError, // TODO: Add some visual indicator that the control adapters are in an error state
     };
   },
   defaultSelectorOptions
@@ -66,7 +89,10 @@ const ControlAdaptersCollapse = () => {
   }
 
   return (
-    <IAICollapse label="Control Adapters" activeLabel={activeLabel}>
+    <IAICollapse
+      label={t('controlnet.controlAdapter_other')}
+      activeLabel={activeLabel}
+    >
       <Flex sx={{ flexDir: 'column', gap: 2 }}>
         <ButtonGroup size="sm" w="full" justifyContent="space-between">
           <IAIButton
diff --git a/invokeai/frontend/web/src/features/controlAdapters/store/controlAdaptersSlice.ts b/invokeai/frontend/web/src/features/controlAdapters/store/controlAdaptersSlice.ts
index 8cbd9978ae..a3645fad9d 100644
--- a/invokeai/frontend/web/src/features/controlAdapters/store/controlAdaptersSlice.ts
+++ b/invokeai/frontend/web/src/features/controlAdapters/store/controlAdaptersSlice.ts
@@ -3,6 +3,7 @@ import {
   Update,
   createEntityAdapter,
   createSlice,
+  isAnyOf,
 } from '@reduxjs/toolkit';
 import {
   ControlNetModelParam,
@@ -544,3 +545,9 @@ export const {
 } = controlAdaptersSlice.actions;
 
 export default controlAdaptersSlice.reducer;
+
+export const isAnyControlAdapterAdded = isAnyOf(
+  controlAdapterAdded,
+  controlAdapterAddedFromImage,
+  controlAdapterRecalled
+);
diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/store/dynamicPromptsSlice.ts b/invokeai/frontend/web/src/features/dynamicPrompts/store/dynamicPromptsSlice.ts
index 32e24845ea..4c2cd31eca 100644
--- a/invokeai/frontend/web/src/features/dynamicPrompts/store/dynamicPromptsSlice.ts
+++ b/invokeai/frontend/web/src/features/dynamicPrompts/store/dynamicPromptsSlice.ts
@@ -39,7 +39,10 @@ export const dynamicPromptsSlice = createSlice({
     promptsChanged: (state, action: PayloadAction<string[]>) => {
       state.prompts = action.payload;
     },
-    parsingErrorChanged: (state, action: PayloadAction<string | undefined>) => {
+    parsingErrorChanged: (
+      state,
+      action: PayloadAction<string | null | undefined>
+    ) => {
       state.parsingError = action.payload;
     },
     isErrorChanged: (state, action: PayloadAction<boolean>) => {
diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx
index 4e748d61e8..94e1e90fd3 100644
--- a/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx
@@ -1,7 +1,9 @@
 import { Badge, Flex } from '@chakra-ui/react';
 import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
 
 const AutoAddIcon = () => {
+  const { t } = useTranslation();
   return (
     <Flex
       sx={{
@@ -15,7 +17,7 @@ const AutoAddIcon = () => {
         variant="solid"
         sx={{ bg: 'accent.400', _dark: { bg: 'accent.500' } }}
       >
-        auto
+        {t('common.auto')}
       </Badge>
     </Flex>
   );
diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx
index c18a9f671c..5dd6b94753 100644
--- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx
@@ -11,12 +11,15 @@ import { autoAddBoardIdChanged } from 'features/gallery/store/gallerySlice';
 import { BoardId } from 'features/gallery/store/types';
 import { MouseEvent, memo, useCallback, useMemo } from 'react';
 import { useTranslation } from 'react-i18next';
-import { FaPlus } from 'react-icons/fa';
+import { FaDownload, FaPlus } from 'react-icons/fa';
 import { useBoardName } from 'services/api/hooks/useBoardName';
 import { BoardDTO } from 'services/api/types';
 import { menuListMotionProps } from 'theme/components/menu';
 import GalleryBoardContextMenuItems from './GalleryBoardContextMenuItems';
 import NoBoardContextMenuItems from './NoBoardContextMenuItems';
+import { useFeatureStatus } from '../../../system/hooks/useFeatureStatus';
+import { useBulkDownloadImagesMutation } from '../../../../services/api/endpoints/images';
+import { addToast } from '../../../system/store/systemSlice';
 
 type Props = {
   board?: BoardDTO;
@@ -31,6 +34,7 @@ const BoardContextMenu = ({
   setBoardToDelete,
   children,
 }: Props) => {
+  const { t } = useTranslation();
   const dispatch = useAppDispatch();
 
   const selector = useMemo(
@@ -49,17 +53,43 @@ const BoardContextMenu = ({
 
   const { isAutoAdd, autoAssignBoardOnClick } = useAppSelector(selector);
   const boardName = useBoardName(board_id);
+  const isBulkDownloadEnabled =
+    useFeatureStatus('bulkDownload').isFeatureEnabled;
+
+  const [bulkDownload] = useBulkDownloadImagesMutation();
 
   const handleSetAutoAdd = useCallback(() => {
     dispatch(autoAddBoardIdChanged(board_id));
   }, [board_id, dispatch]);
 
+  const handleBulkDownload = useCallback(async () => {
+    try {
+      const response = await bulkDownload({
+        image_names: [],
+        board_id: board_id,
+      }).unwrap();
+
+      dispatch(
+        addToast({
+          title: t('gallery.preparingDownload'),
+          status: 'success',
+          ...(response.response ? { description: response.response } : {}),
+        })
+      );
+    } catch {
+      dispatch(
+        addToast({
+          title: t('gallery.preparingDownloadFailed'),
+          status: 'error',
+        })
+      );
+    }
+  }, [t, board_id, bulkDownload, dispatch]);
+
   const skipEvent = useCallback((e: MouseEvent<HTMLDivElement>) => {
     e.preventDefault();
   }, []);
 
-  const { t } = useTranslation();
-
   return (
     <IAIContextMenu<HTMLDivElement>
       menuProps={{ size: 'sm', isLazy: true }}
@@ -81,6 +111,14 @@ const BoardContextMenu = ({
             >
               {t('boards.menuItemAutoAdd')}
             </MenuItem>
+            {isBulkDownloadEnabled && (
+              <MenuItem
+                icon={<FaDownload />}
+                onClickCapture={handleBulkDownload}
+              >
+                {t('boards.downloadBoard')}
+              </MenuItem>
+            )}
             {!board && <NoBoardContextMenuItems />}
             {board && (
               <GalleryBoardContextMenuItems
diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx
index 29b45761ee..675a4fd6af 100644
--- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx
@@ -8,20 +8,29 @@ import {
 } from 'features/changeBoardModal/store/slice';
 import { imagesToDeleteSelected } from 'features/deleteImageModal/store/slice';
 import { memo, useCallback, useMemo } from 'react';
-import { FaFolder, FaTrash } from 'react-icons/fa';
+import { FaDownload, FaFolder, FaTrash } from 'react-icons/fa';
 import { MdStar, MdStarBorder } from 'react-icons/md';
 import {
+  useBulkDownloadImagesMutation,
   useStarImagesMutation,
   useUnstarImagesMutation,
 } from '../../../../services/api/endpoints/images';
+import { useFeatureStatus } from '../../../system/hooks/useFeatureStatus';
+import { addToast } from '../../../system/store/systemSlice';
+import { useTranslation } from 'react-i18next';
 
 const MultipleSelectionMenuItems = () => {
+  const { t } = useTranslation();
   const dispatch = useAppDispatch();
   const selection = useAppSelector((state) => state.gallery.selection);
   const customStarUi = useStore($customStarUI);
 
+  const isBulkDownloadEnabled =
+    useFeatureStatus('bulkDownload').isFeatureEnabled;
+
   const [starImages] = useStarImagesMutation();
   const [unstarImages] = useUnstarImagesMutation();
+  const [bulkDownload] = useBulkDownloadImagesMutation();
 
   const handleChangeBoard = useCallback(() => {
     dispatch(imagesToChangeSelected(selection));
@@ -40,6 +49,29 @@ const MultipleSelectionMenuItems = () => {
     unstarImages({ imageDTOs: selection });
   }, [unstarImages, selection]);
 
+  const handleBulkDownload = useCallback(async () => {
+    try {
+      const response = await bulkDownload({
+        image_names: selection.map((img) => img.image_name),
+      }).unwrap();
+
+      dispatch(
+        addToast({
+          title: t('gallery.preparingDownload'),
+          status: 'success',
+          ...(response.response ? { description: response.response } : {}),
+        })
+      );
+    } catch {
+      dispatch(
+        addToast({
+          title: t('gallery.preparingDownloadFailed'),
+          status: 'error',
+        })
+      );
+    }
+  }, [t, selection, bulkDownload, dispatch]);
+
   const areAllStarred = useMemo(() => {
     return selection.every((img) => img.starred);
   }, [selection]);
@@ -66,6 +98,11 @@ const MultipleSelectionMenuItems = () => {
           {customStarUi ? customStarUi.on.text : `Star All`}
         </MenuItem>
       )}
+      {isBulkDownloadEnabled && (
+        <MenuItem icon={<FaDownload />} onClickCapture={handleBulkDownload}>
+          {t('gallery.downloadSelection')}
+        </MenuItem>
+      )}
       <MenuItem icon={<FaFolder />} onClickCapture={handleChangeBoard}>
         Change Board
       </MenuItem>
diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx
index 63e0cee378..fa640bf202 100644
--- a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx
@@ -20,6 +20,7 @@ import BoardsList from './Boards/BoardsList/BoardsList';
 import GalleryBoardName from './GalleryBoardName';
 import GallerySettingsPopover from './GallerySettingsPopover';
 import GalleryImageGrid from './ImageGrid/GalleryImageGrid';
+import { useTranslation } from 'react-i18next';
 
 const selector = createSelector(
   [stateSelector],
@@ -34,6 +35,7 @@ const selector = createSelector(
 );
 
 const ImageGalleryContent = () => {
+  const { t } = useTranslation();
   const resizeObserverRef = useRef<HTMLDivElement>(null);
   const galleryGridRef = useRef<HTMLDivElement>(null);
   const { galleryView } = useAppSelector(selector);
@@ -111,7 +113,7 @@ const ImageGalleryContent = () => {
                   leftIcon={<FaImages />}
                   data-testid="images-tab"
                 >
-                  Images
+                  {t('gallery.images')}
                 </Tab>
                 <Tab
                   as={IAIButton}
@@ -124,7 +126,7 @@ const ImageGalleryContent = () => {
                   leftIcon={<FaServer />}
                   data-testid="assets-tab"
                 >
-                  Assets
+                  {t('gallery.assets')}
                 </Tab>
               </ButtonGroup>
             </TabList>
diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx
index 8c7e69b2b1..e9cb3ffcaf 100644
--- a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx
@@ -18,6 +18,7 @@ import ImageMetadataActions from './ImageMetadataActions';
 import { useAppSelector } from '../../../../app/store/storeHooks';
 import { configSelector } from '../../../system/store/configSelectors';
 import { useTranslation } from 'react-i18next';
+import ScrollableContent from 'features/nodes/components/sidePanel/ScrollableContent';
 
 type ImageMetadataViewerProps = {
   image: ImageDTO;
@@ -65,19 +66,32 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => {
         </Link>
       </Flex>
 
-      <ImageMetadataActions metadata={metadata} />
-
       <Tabs
         variant="line"
-        sx={{ display: 'flex', flexDir: 'column', w: 'full', h: 'full' }}
+        sx={{
+          display: 'flex',
+          flexDir: 'column',
+          w: 'full',
+          h: 'full',
+        }}
       >
         <TabList>
+          <Tab>{t('metadata.recallParameters')}</Tab>
           <Tab>{t('metadata.metadata')}</Tab>
           <Tab>{t('metadata.imageDetails')}</Tab>
           <Tab>{t('metadata.workflow')}</Tab>
         </TabList>
 
         <TabPanels>
+          <TabPanel>
+            {metadata ? (
+              <ScrollableContent>
+                <ImageMetadataActions metadata={metadata} />
+              </ScrollableContent>
+            ) : (
+              <IAINoContentFallback label={t('metadata.noRecallParameters')} />
+            )}
+          </TabPanel>
           <TabPanel>
             {metadata ? (
               <DataViewer data={metadata} label={t('metadata.metadata')} />
diff --git a/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx b/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx
index c2edd94106..4f6fe26f1d 100644
--- a/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx
+++ b/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx
@@ -9,6 +9,7 @@ import { memo } from 'react';
 import { useFeatureStatus } from '../../system/hooks/useFeatureStatus';
 import ParamLoraList from './ParamLoraList';
 import ParamLoRASelect from './ParamLoraSelect';
+import { useTranslation } from 'react-i18next';
 
 const selector = createSelector(
   stateSelector,
@@ -22,6 +23,7 @@ const selector = createSelector(
 );
 
 const ParamLoraCollapse = () => {
+  const { t } = useTranslation();
   const { activeLabel } = useAppSelector(selector);
 
   const isLoraEnabled = useFeatureStatus('lora').isFeatureEnabled;
@@ -31,7 +33,7 @@ const ParamLoraCollapse = () => {
   }
 
   return (
-    <IAICollapse label="LoRA" activeLabel={activeLabel}>
+    <IAICollapse label={t('modelManager.loraModels')} activeLabel={activeLabel}>
       <Flex sx={{ flexDir: 'column', gap: 2 }}>
         <ParamLoRASelect />
         <ParamLoraList />
diff --git a/invokeai/frontend/web/src/features/nodes/types/types.ts b/invokeai/frontend/web/src/features/nodes/types/types.ts
index f7ef848211..87c716bb81 100644
--- a/invokeai/frontend/web/src/features/nodes/types/types.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/types.ts
@@ -10,7 +10,7 @@ import {
 } from 'features/parameters/types/parameterSchemas';
 import i18n from 'i18next';
 import { has, keyBy } from 'lodash-es';
-import { OpenAPIV3 } from 'openapi-types';
+import { OpenAPIV3_1 } from 'openapi-types';
 import { RgbaColor } from 'react-colorful';
 import { Node } from 'reactflow';
 import { Graph, _InputField, _OutputField } from 'services/api/types';
@@ -791,9 +791,9 @@ export type IntegerInputFieldTemplate = InputFieldTemplateBase & {
   default: number;
   multipleOf?: number;
   maximum?: number;
-  exclusiveMaximum?: boolean;
+  exclusiveMaximum?: number;
   minimum?: number;
-  exclusiveMinimum?: boolean;
+  exclusiveMinimum?: number;
 };
 
 export type IntegerCollectionInputFieldTemplate = InputFieldTemplateBase & {
@@ -814,9 +814,9 @@ export type FloatInputFieldTemplate = InputFieldTemplateBase & {
   default: number;
   multipleOf?: number;
   maximum?: number;
-  exclusiveMaximum?: boolean;
+  exclusiveMaximum?: number;
   minimum?: number;
-  exclusiveMinimum?: boolean;
+  exclusiveMinimum?: number;
 };
 
 export type FloatCollectionInputFieldTemplate = InputFieldTemplateBase & {
@@ -1163,20 +1163,20 @@ export type TypeHints = {
 };
 
 export type InvocationSchemaExtra = {
-  output: OpenAPIV3.ReferenceObject; // the output of the invocation
+  output: OpenAPIV3_1.ReferenceObject; // the output of the invocation
   title: string;
   category?: string;
   tags?: string[];
   version?: string;
   properties: Omit<
-    NonNullable<OpenAPIV3.SchemaObject['properties']> &
+    NonNullable<OpenAPIV3_1.SchemaObject['properties']> &
       (_InputField | _OutputField),
     'type'
   > & {
-    type: Omit<OpenAPIV3.SchemaObject, 'default'> & {
+    type: Omit<OpenAPIV3_1.SchemaObject, 'default'> & {
       default: AnyInvocationType;
     };
-    use_cache: Omit<OpenAPIV3.SchemaObject, 'default'> & {
+    use_cache: Omit<OpenAPIV3_1.SchemaObject, 'default'> & {
       default: boolean;
     };
   };
@@ -1187,17 +1187,17 @@ export type InvocationSchemaType = {
 };
 
 export type InvocationBaseSchemaObject = Omit<
-  OpenAPIV3.BaseSchemaObject,
+  OpenAPIV3_1.BaseSchemaObject,
   'title' | 'type' | 'properties'
 > &
   InvocationSchemaExtra;
 
 export type InvocationOutputSchemaObject = Omit<
-  OpenAPIV3.SchemaObject,
+  OpenAPIV3_1.SchemaObject,
   'properties'
 > & {
-  properties: OpenAPIV3.SchemaObject['properties'] & {
-    type: Omit<OpenAPIV3.SchemaObject, 'default'> & {
+  properties: OpenAPIV3_1.SchemaObject['properties'] & {
+    type: Omit<OpenAPIV3_1.SchemaObject, 'default'> & {
       default: string;
     };
   } & {
@@ -1205,14 +1205,18 @@ export type InvocationOutputSchemaObject = Omit<
   };
 };
 
-export type InvocationFieldSchema = OpenAPIV3.SchemaObject & _InputField;
+export type InvocationFieldSchema = OpenAPIV3_1.SchemaObject & _InputField;
+
+export type OpenAPIV3_1SchemaOrRef =
+  | OpenAPIV3_1.ReferenceObject
+  | OpenAPIV3_1.SchemaObject;
 
 export interface ArraySchemaObject extends InvocationBaseSchemaObject {
-  type: OpenAPIV3.ArraySchemaObjectType;
-  items: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
+  type: OpenAPIV3_1.ArraySchemaObjectType;
+  items: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject;
 }
 export interface NonArraySchemaObject extends InvocationBaseSchemaObject {
-  type?: OpenAPIV3.NonArraySchemaObjectType;
+  type?: OpenAPIV3_1.NonArraySchemaObjectType;
 }
 
 export type InvocationSchemaObject = (
@@ -1221,41 +1225,41 @@ export type InvocationSchemaObject = (
 ) & { class: 'invocation' };
 
 export const isSchemaObject = (
-  obj: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined
-): obj is OpenAPIV3.SchemaObject => Boolean(obj && !('$ref' in obj));
+  obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject | undefined
+): obj is OpenAPIV3_1.SchemaObject => Boolean(obj && !('$ref' in obj));
 
 export const isArraySchemaObject = (
-  obj: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined
-): obj is OpenAPIV3.ArraySchemaObject =>
+  obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject | undefined
+): obj is OpenAPIV3_1.ArraySchemaObject =>
   Boolean(obj && !('$ref' in obj) && obj.type === 'array');
 
 export const isNonArraySchemaObject = (
-  obj: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined
-): obj is OpenAPIV3.NonArraySchemaObject =>
+  obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject | undefined
+): obj is OpenAPIV3_1.NonArraySchemaObject =>
   Boolean(obj && !('$ref' in obj) && obj.type !== 'array');
 
 export const isRefObject = (
-  obj: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined
-): obj is OpenAPIV3.ReferenceObject => Boolean(obj && '$ref' in obj);
+  obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject | undefined
+): obj is OpenAPIV3_1.ReferenceObject => Boolean(obj && '$ref' in obj);
 
 export const isInvocationSchemaObject = (
   obj:
-    | OpenAPIV3.ReferenceObject
-    | OpenAPIV3.SchemaObject
+    | OpenAPIV3_1.ReferenceObject
+    | OpenAPIV3_1.SchemaObject
     | InvocationSchemaObject
 ): obj is InvocationSchemaObject =>
   'class' in obj && obj.class === 'invocation';
 
 export const isInvocationOutputSchemaObject = (
   obj:
-    | OpenAPIV3.ReferenceObject
-    | OpenAPIV3.SchemaObject
+    | OpenAPIV3_1.ReferenceObject
+    | OpenAPIV3_1.SchemaObject
     | InvocationOutputSchemaObject
 ): obj is InvocationOutputSchemaObject =>
   'class' in obj && obj.class === 'output';
 
 export const isInvocationFieldSchema = (
-  obj: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject
+  obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject
 ): obj is InvocationFieldSchema => !('$ref' in obj);
 
 export type InvocationEdgeExtra = { type: 'default' | 'collapsed' };
diff --git a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts
index 1f7fe81620..3fd44207c0 100644
--- a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts
@@ -1,5 +1,12 @@
-import { isBoolean, isInteger, isNumber, isString } from 'lodash-es';
-import { OpenAPIV3 } from 'openapi-types';
+import {
+  isArray,
+  isBoolean,
+  isInteger,
+  isNumber,
+  isString,
+  startCase,
+} from 'lodash-es';
+import { OpenAPIV3_1 } from 'openapi-types';
 import {
   COLLECTION_MAP,
   POLYMORPHIC_TYPES,
@@ -72,6 +79,7 @@ import {
   T2IAdapterCollectionInputFieldTemplate,
   BoardInputFieldTemplate,
   InputFieldTemplate,
+  OpenAPIV3_1SchemaOrRef,
 } from '../types/types';
 import { ControlField } from 'services/api/types';
 
@@ -90,7 +98,7 @@ export type BuildInputFieldArg = {
  * @example
  * refObjectToFieldType({ "$ref": "#/components/schemas/ImageField" }) --> 'ImageField'
  */
-export const refObjectToSchemaName = (refObject: OpenAPIV3.ReferenceObject) =>
+export const refObjectToSchemaName = (refObject: OpenAPIV3_1.ReferenceObject) =>
   refObject.$ref.split('/').slice(-1)[0];
 
 const buildIntegerInputFieldTemplate = ({
@@ -111,7 +119,10 @@ const buildIntegerInputFieldTemplate = ({
     template.maximum = schemaObject.maximum;
   }
 
-  if (schemaObject.exclusiveMaximum !== undefined) {
+  if (
+    schemaObject.exclusiveMaximum !== undefined &&
+    isNumber(schemaObject.exclusiveMaximum)
+  ) {
     template.exclusiveMaximum = schemaObject.exclusiveMaximum;
   }
 
@@ -119,7 +130,10 @@ const buildIntegerInputFieldTemplate = ({
     template.minimum = schemaObject.minimum;
   }
 
-  if (schemaObject.exclusiveMinimum !== undefined) {
+  if (
+    schemaObject.exclusiveMinimum !== undefined &&
+    isNumber(schemaObject.exclusiveMinimum)
+  ) {
     template.exclusiveMinimum = schemaObject.exclusiveMinimum;
   }
 
@@ -144,7 +158,10 @@ const buildIntegerPolymorphicInputFieldTemplate = ({
     template.maximum = schemaObject.maximum;
   }
 
-  if (schemaObject.exclusiveMaximum !== undefined) {
+  if (
+    schemaObject.exclusiveMaximum !== undefined &&
+    isNumber(schemaObject.exclusiveMaximum)
+  ) {
     template.exclusiveMaximum = schemaObject.exclusiveMaximum;
   }
 
@@ -152,7 +169,10 @@ const buildIntegerPolymorphicInputFieldTemplate = ({
     template.minimum = schemaObject.minimum;
   }
 
-  if (schemaObject.exclusiveMinimum !== undefined) {
+  if (
+    schemaObject.exclusiveMinimum !== undefined &&
+    isNumber(schemaObject.exclusiveMinimum)
+  ) {
     template.exclusiveMinimum = schemaObject.exclusiveMinimum;
   }
 
@@ -195,7 +215,10 @@ const buildFloatInputFieldTemplate = ({
     template.maximum = schemaObject.maximum;
   }
 
-  if (schemaObject.exclusiveMaximum !== undefined) {
+  if (
+    schemaObject.exclusiveMaximum !== undefined &&
+    isNumber(schemaObject.exclusiveMaximum)
+  ) {
     template.exclusiveMaximum = schemaObject.exclusiveMaximum;
   }
 
@@ -203,7 +226,10 @@ const buildFloatInputFieldTemplate = ({
     template.minimum = schemaObject.minimum;
   }
 
-  if (schemaObject.exclusiveMinimum !== undefined) {
+  if (
+    schemaObject.exclusiveMinimum !== undefined &&
+    isNumber(schemaObject.exclusiveMinimum)
+  ) {
     template.exclusiveMinimum = schemaObject.exclusiveMinimum;
   }
 
@@ -227,7 +253,10 @@ const buildFloatPolymorphicInputFieldTemplate = ({
     template.maximum = schemaObject.maximum;
   }
 
-  if (schemaObject.exclusiveMaximum !== undefined) {
+  if (
+    schemaObject.exclusiveMaximum !== undefined &&
+    isNumber(schemaObject.exclusiveMaximum)
+  ) {
     template.exclusiveMaximum = schemaObject.exclusiveMaximum;
   }
 
@@ -235,7 +264,10 @@ const buildFloatPolymorphicInputFieldTemplate = ({
     template.minimum = schemaObject.minimum;
   }
 
-  if (schemaObject.exclusiveMinimum !== undefined) {
+  if (
+    schemaObject.exclusiveMinimum !== undefined &&
+    isNumber(schemaObject.exclusiveMinimum)
+  ) {
     template.exclusiveMinimum = schemaObject.exclusiveMinimum;
   }
   return template;
@@ -872,84 +904,106 @@ const buildSchedulerInputFieldTemplate = ({
 };
 
 export const getFieldType = (
-  schemaObject: InvocationFieldSchema
+  schemaObject: OpenAPIV3_1SchemaOrRef
 ): string | undefined => {
-  if (schemaObject?.ui_type) {
-    return schemaObject.ui_type;
-  } else if (!schemaObject.type) {
-    // if schemaObject has no type, then it should have one of allOf, anyOf, oneOf
+  if (isSchemaObject(schemaObject)) {
+    if (!schemaObject.type) {
+      // if schemaObject has no type, then it should have one of allOf, anyOf, oneOf
 
-    if (schemaObject.allOf) {
-      const allOf = schemaObject.allOf;
-      if (allOf && allOf[0] && isRefObject(allOf[0])) {
-        return refObjectToSchemaName(allOf[0]);
-      }
-    } else if (schemaObject.anyOf) {
-      const anyOf = schemaObject.anyOf;
-      /**
-       * Handle Polymorphic inputs, eg string | string[]. In OpenAPI, this is:
-       * - an `anyOf` with two items
-       * - one is an `ArraySchemaObject` with a single `SchemaObject or ReferenceObject` of type T in its `items`
-       * - the other is a `SchemaObject` or `ReferenceObject` of type T
-       *
-       * Any other cases we ignore.
-       */
-
-      let firstType: string | undefined;
-      let secondType: string | undefined;
-
-      if (isArraySchemaObject(anyOf[0])) {
-        // first is array, second is not
-        const first = anyOf[0].items;
-        const second = anyOf[1];
-        if (isRefObject(first) && isRefObject(second)) {
-          firstType = refObjectToSchemaName(first);
-          secondType = refObjectToSchemaName(second);
-        } else if (
-          isNonArraySchemaObject(first) &&
-          isNonArraySchemaObject(second)
-        ) {
-          firstType = first.type;
-          secondType = second.type;
+      if (schemaObject.allOf) {
+        const allOf = schemaObject.allOf;
+        if (allOf && allOf[0] && isRefObject(allOf[0])) {
+          return refObjectToSchemaName(allOf[0]);
         }
-      } else if (isArraySchemaObject(anyOf[1])) {
-        // first is not array, second is
-        const first = anyOf[0];
-        const second = anyOf[1].items;
-        if (isRefObject(first) && isRefObject(second)) {
-          firstType = refObjectToSchemaName(first);
-          secondType = refObjectToSchemaName(second);
-        } else if (
-          isNonArraySchemaObject(first) &&
-          isNonArraySchemaObject(second)
-        ) {
-          firstType = first.type;
-          secondType = second.type;
+      } else if (schemaObject.anyOf) {
+        // ignore null types
+        const anyOf = schemaObject.anyOf.filter((i) => {
+          if (isSchemaObject(i)) {
+            if (i.type === 'null') {
+              return false;
+            }
+          }
+          return true;
+        });
+        if (anyOf.length === 1) {
+          if (isRefObject(anyOf[0])) {
+            return refObjectToSchemaName(anyOf[0]);
+          } else if (isSchemaObject(anyOf[0])) {
+            return getFieldType(anyOf[0]);
+          }
+        }
+        /**
+         * Handle Polymorphic inputs, eg string | string[]. In OpenAPI, this is:
+         * - an `anyOf` with two items
+         * - one is an `ArraySchemaObject` with a single `SchemaObject or ReferenceObject` of type T in its `items`
+         * - the other is a `SchemaObject` or `ReferenceObject` of type T
+         *
+         * Any other cases we ignore.
+         */
+
+        let firstType: string | undefined;
+        let secondType: string | undefined;
+
+        if (isArraySchemaObject(anyOf[0])) {
+          // first is array, second is not
+          const first = anyOf[0].items;
+          const second = anyOf[1];
+          if (isRefObject(first) && isRefObject(second)) {
+            firstType = refObjectToSchemaName(first);
+            secondType = refObjectToSchemaName(second);
+          } else if (
+            isNonArraySchemaObject(first) &&
+            isNonArraySchemaObject(second)
+          ) {
+            firstType = first.type;
+            secondType = second.type;
+          }
+        } else if (isArraySchemaObject(anyOf[1])) {
+          // first is not array, second is
+          const first = anyOf[0];
+          const second = anyOf[1].items;
+          if (isRefObject(first) && isRefObject(second)) {
+            firstType = refObjectToSchemaName(first);
+            secondType = refObjectToSchemaName(second);
+          } else if (
+            isNonArraySchemaObject(first) &&
+            isNonArraySchemaObject(second)
+          ) {
+            firstType = first.type;
+            secondType = second.type;
+          }
+        }
+        if (firstType === secondType && isPolymorphicItemType(firstType)) {
+          return SINGLE_TO_POLYMORPHIC_MAP[firstType];
         }
       }
-      if (firstType === secondType && isPolymorphicItemType(firstType)) {
-        return SINGLE_TO_POLYMORPHIC_MAP[firstType];
+    } else if (schemaObject.enum) {
+      return 'enum';
+    } else if (schemaObject.type) {
+      if (schemaObject.type === 'number') {
+        // floats are "number" in OpenAPI, while ints are "integer" - we need to distinguish them
+        return 'float';
+      } else if (schemaObject.type === 'array') {
+        const itemType = isSchemaObject(schemaObject.items)
+          ? schemaObject.items.type
+          : refObjectToSchemaName(schemaObject.items);
+
+        if (isArray(itemType)) {
+          // This is a nested array, which we don't support
+          return;
+        }
+
+        if (isCollectionItemType(itemType)) {
+          return COLLECTION_MAP[itemType];
+        }
+
+        return;
+      } else if (!isArray(schemaObject.type)) {
+        return schemaObject.type;
       }
     }
-  } else if (schemaObject.enum) {
-    return 'enum';
-  } else if (schemaObject.type) {
-    if (schemaObject.type === 'number') {
-      // floats are "number" in OpenAPI, while ints are "integer" - we need to distinguish them
-      return 'float';
-    } else if (schemaObject.type === 'array') {
-      const itemType = isSchemaObject(schemaObject.items)
-        ? schemaObject.items.type
-        : refObjectToSchemaName(schemaObject.items);
-
-      if (isCollectionItemType(itemType)) {
-        return COLLECTION_MAP[itemType];
-      }
-
-      return;
-    } else {
-      return schemaObject.type;
-    }
+  } else if (isRefObject(schemaObject)) {
+    return refObjectToSchemaName(schemaObject);
   }
   return;
 };
@@ -1025,7 +1079,15 @@ export const buildInputFieldTemplate = (
   name: string,
   fieldType: FieldType
 ) => {
-  const { input, ui_hidden, ui_component, ui_type, ui_order } = fieldSchema;
+  const {
+    input,
+    ui_hidden,
+    ui_component,
+    ui_type,
+    ui_order,
+    ui_choice_labels,
+    item_default,
+  } = fieldSchema;
 
   const extra = {
     // TODO: Can we support polymorphic inputs in the UI?
@@ -1035,11 +1097,13 @@ export const buildInputFieldTemplate = (
     ui_type,
     required: nodeSchema.required?.includes(name) ?? false,
     ui_order,
+    ui_choice_labels,
+    item_default,
   };
 
   const baseField = {
     name,
-    title: fieldSchema.title ?? '',
+    title: fieldSchema.title ?? (name ? startCase(name) : ''),
     description: fieldSchema.description ?? '',
     fieldKind: 'input' as const,
     ...extra,
diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addHrfToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addHrfToGraph.ts
new file mode 100644
index 0000000000..4b4a8a8a03
--- /dev/null
+++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addHrfToGraph.ts
@@ -0,0 +1,247 @@
+import { RootState } from 'app/store/store';
+import { NonNullableGraph } from 'features/nodes/types/types';
+import {
+  DenoiseLatentsInvocation,
+  ResizeLatentsInvocation,
+  NoiseInvocation,
+  LatentsToImageInvocation,
+  Edge,
+} from 'services/api/types';
+import {
+  LATENTS_TO_IMAGE,
+  DENOISE_LATENTS,
+  NOISE,
+  MAIN_MODEL_LOADER,
+  METADATA_ACCUMULATOR,
+  LATENTS_TO_IMAGE_HRF,
+  DENOISE_LATENTS_HRF,
+  RESCALE_LATENTS,
+  NOISE_HRF,
+  VAE_LOADER,
+} from './constants';
+import { logger } from 'app/logging/logger';
+
+// Copy certain connections from previous DENOISE_LATENTS to new DENOISE_LATENTS_HRF.
+function copyConnectionsToDenoiseLatentsHrf(graph: NonNullableGraph): void {
+  const destinationFields = [
+    'vae',
+    'control',
+    'ip_adapter',
+    'metadata',
+    'unet',
+    'positive_conditioning',
+    'negative_conditioning',
+  ];
+  const newEdges: Edge[] = [];
+
+  // Loop through the existing edges connected to DENOISE_LATENTS
+  graph.edges.forEach((edge: Edge) => {
+    if (
+      edge.destination.node_id === DENOISE_LATENTS &&
+      destinationFields.includes(edge.destination.field)
+    ) {
+      // Add a similar connection to DENOISE_LATENTS_HRF
+      newEdges.push({
+        source: {
+          node_id: edge.source.node_id,
+          field: edge.source.field,
+        },
+        destination: {
+          node_id: DENOISE_LATENTS_HRF,
+          field: edge.destination.field,
+        },
+      });
+    }
+  });
+  graph.edges = graph.edges.concat(newEdges);
+}
+
+// Adds the high-res fix feature to the given graph.
+export const addHrfToGraph = (
+  state: RootState,
+  graph: NonNullableGraph
+): void => {
+  // Double check hrf is enabled.
+  if (
+    !state.generation.hrfEnabled ||
+    state.config.disabledSDFeatures.includes('hrf') ||
+    state.generation.model?.model_type === 'onnx' // TODO: ONNX support
+  ) {
+    return;
+  }
+  const log = logger('txt2img');
+
+  const { vae } = state.generation;
+  const isAutoVae = !vae;
+  const hrfWidth = state.generation.hrfWidth;
+  const hrfHeight = state.generation.hrfHeight;
+
+  // Pre-existing (original) graph nodes.
+  const originalDenoiseLatentsNode = graph.nodes[DENOISE_LATENTS] as
+    | DenoiseLatentsInvocation
+    | undefined;
+  const originalNoiseNode = graph.nodes[NOISE] as NoiseInvocation | undefined;
+  // Original latents to image should pick this up.
+  const originalLatentsToImageNode = graph.nodes[LATENTS_TO_IMAGE] as
+    | LatentsToImageInvocation
+    | undefined;
+  // Check if originalDenoiseLatentsNode is undefined and log an error
+  if (!originalDenoiseLatentsNode) {
+    log.error('originalDenoiseLatentsNode is undefined');
+    return;
+  }
+  // Check if originalNoiseNode is undefined and log an error
+  if (!originalNoiseNode) {
+    log.error('originalNoiseNode is undefined');
+    return;
+  }
+
+  // Check if originalLatentsToImageNode is undefined and log an error
+  if (!originalLatentsToImageNode) {
+    log.error('originalLatentsToImageNode is undefined');
+    return;
+  }
+  // Change height and width of original noise node to initial resolution.
+  if (originalNoiseNode) {
+    originalNoiseNode.width = hrfWidth;
+    originalNoiseNode.height = hrfHeight;
+  }
+
+  // Define new nodes.
+  // Denoise latents node to be run on upscaled latents.
+  const denoiseLatentsHrfNode: DenoiseLatentsInvocation = {
+    type: 'denoise_latents',
+    id: DENOISE_LATENTS_HRF,
+    is_intermediate: originalDenoiseLatentsNode?.is_intermediate,
+    cfg_scale: originalDenoiseLatentsNode?.cfg_scale,
+    scheduler: originalDenoiseLatentsNode?.scheduler,
+    steps: originalDenoiseLatentsNode?.steps,
+    denoising_start: 1 - state.generation.hrfStrength,
+    denoising_end: 1,
+  };
+
+  // New base resolution noise node.
+  const hrfNoiseNode: NoiseInvocation = {
+    type: 'noise',
+    id: NOISE_HRF,
+    seed: originalNoiseNode?.seed,
+    use_cpu: originalNoiseNode?.use_cpu,
+    is_intermediate: originalNoiseNode?.is_intermediate,
+  };
+
+  const rescaleLatentsNode: ResizeLatentsInvocation = {
+    id: RESCALE_LATENTS,
+    type: 'lresize',
+    width: state.generation.width,
+    height: state.generation.height,
+  };
+
+  // New node to convert latents to image.
+  const latentsToImageHrfNode: LatentsToImageInvocation | undefined =
+    originalLatentsToImageNode
+      ? {
+          type: 'l2i',
+          id: LATENTS_TO_IMAGE_HRF,
+          fp32: originalLatentsToImageNode?.fp32,
+          is_intermediate: originalLatentsToImageNode?.is_intermediate,
+        }
+      : undefined;
+
+  // Add new nodes to graph.
+  graph.nodes[LATENTS_TO_IMAGE_HRF] =
+    latentsToImageHrfNode as LatentsToImageInvocation;
+  graph.nodes[DENOISE_LATENTS_HRF] =
+    denoiseLatentsHrfNode as DenoiseLatentsInvocation;
+  graph.nodes[NOISE_HRF] = hrfNoiseNode as NoiseInvocation;
+  graph.nodes[RESCALE_LATENTS] = rescaleLatentsNode as ResizeLatentsInvocation;
+
+  // Connect nodes.
+  graph.edges.push(
+    {
+      // Set up rescale latents.
+      source: {
+        node_id: DENOISE_LATENTS,
+        field: 'latents',
+      },
+      destination: {
+        node_id: RESCALE_LATENTS,
+        field: 'latents',
+      },
+    },
+    // Set up new noise node
+    {
+      source: {
+        node_id: RESCALE_LATENTS,
+        field: 'height',
+      },
+      destination: {
+        node_id: NOISE_HRF,
+        field: 'height',
+      },
+    },
+    {
+      source: {
+        node_id: RESCALE_LATENTS,
+        field: 'width',
+      },
+      destination: {
+        node_id: NOISE_HRF,
+        field: 'width',
+      },
+    },
+    // Set up new denoise node.
+    {
+      source: {
+        node_id: RESCALE_LATENTS,
+        field: 'latents',
+      },
+      destination: {
+        node_id: DENOISE_LATENTS_HRF,
+        field: 'latents',
+      },
+    },
+    {
+      source: {
+        node_id: NOISE_HRF,
+        field: 'noise',
+      },
+      destination: {
+        node_id: DENOISE_LATENTS_HRF,
+        field: 'noise',
+      },
+    },
+    // Set up new latents to image node.
+    {
+      source: {
+        node_id: DENOISE_LATENTS_HRF,
+        field: 'latents',
+      },
+      destination: {
+        node_id: LATENTS_TO_IMAGE_HRF,
+        field: 'latents',
+      },
+    },
+    {
+      source: {
+        node_id: METADATA_ACCUMULATOR,
+        field: 'metadata',
+      },
+      destination: {
+        node_id: LATENTS_TO_IMAGE_HRF,
+        field: 'metadata',
+      },
+    },
+    {
+      source: {
+        node_id: isAutoVae ? MAIN_MODEL_LOADER : VAE_LOADER,
+        field: 'vae',
+      },
+      destination: {
+        node_id: LATENTS_TO_IMAGE_HRF,
+        field: 'vae',
+      },
+    }
+  );
+
+  copyConnectionsToDenoiseLatentsHrf(graph);
+};
diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSaveImageNode.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSaveImageNode.ts
index 738c69faff..d5a6addf8a 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSaveImageNode.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSaveImageNode.ts
@@ -2,6 +2,7 @@ import { NonNullableGraph } from 'features/nodes/types/types';
 import {
   CANVAS_OUTPUT,
   LATENTS_TO_IMAGE,
+  LATENTS_TO_IMAGE_HRF,
   METADATA_ACCUMULATOR,
   NSFW_CHECKER,
   SAVE_IMAGE,
@@ -82,6 +83,14 @@ export const addSaveImageNode = (
       },
       destination,
     });
+  } else if (LATENTS_TO_IMAGE_HRF in graph.nodes) {
+    graph.edges.push({
+      source: {
+        node_id: LATENTS_TO_IMAGE_HRF,
+        field: 'image',
+      },
+      destination,
+    });
   } else if (LATENTS_TO_IMAGE in graph.nodes) {
     graph.edges.push({
       source: {
diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addT2IAdapterToLinearGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addT2IAdapterToLinearGraph.ts
index f07edcb220..16dc5bbc71 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addT2IAdapterToLinearGraph.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addT2IAdapterToLinearGraph.ts
@@ -86,7 +86,7 @@ export const addT2IAdaptersToLinearGraph = (
 
       graph.nodes[t2iAdapterNode.id] = t2iAdapterNode as T2IAdapterInvocation;
 
-      if (metadataAccumulator?.ipAdapters) {
+      if (metadataAccumulator?.t2iAdapters) {
         // metadata accumulator only needs a control field - not the whole node
         // extract what we need and add to the accumulator
         const t2iAdapterField = omit(t2iAdapterNode, [
diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts
index c3c7fcdf1b..e692e12fa4 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts
@@ -6,6 +6,7 @@ import {
   ONNXTextToLatentsInvocation,
 } from 'services/api/types';
 import { addControlNetToLinearGraph } from './addControlNetToLinearGraph';
+import { addHrfToGraph } from './addHrfToGraph';
 import { addIPAdapterToLinearGraph } from './addIPAdapterToLinearGraph';
 import { addLoRAsToGraph } from './addLoRAsToGraph';
 import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
@@ -47,6 +48,10 @@ export const buildLinearTextToImageGraph = (
     seamlessXAxis,
     seamlessYAxis,
     seed,
+    hrfWidth,
+    hrfHeight,
+    hrfStrength,
+    hrfEnabled: hrfEnabled,
   } = state.generation;
 
   const use_cpu = shouldUseCpuNoise;
@@ -254,6 +259,9 @@ export const buildLinearTextToImageGraph = (
     ipAdapters: [], // populated in addIPAdapterToLinearGraph
     t2iAdapters: [], // populated in addT2IAdapterToLinearGraph
     clip_skip: clipSkip,
+    hrf_width: hrfEnabled ? hrfWidth : undefined,
+    hrf_height: hrfEnabled ? hrfHeight : undefined,
+    hrf_strength: hrfEnabled ? hrfStrength : undefined,
   };
 
   graph.edges.push({
@@ -287,6 +295,12 @@ export const buildLinearTextToImageGraph = (
 
   addT2IAdaptersToLinearGraph(state, graph, DENOISE_LATENTS);
 
+  // High resolution fix.
+  // NOTE: Not supported for onnx models.
+  if (state.generation.hrfEnabled && !isUsingOnnxModel) {
+    addHrfToGraph(state, graph);
+  }
+
   // NSFW & watermark - must be last thing added to graph
   if (state.system.shouldUseNSFWChecker) {
     // must add before watermarker!
diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/constants.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/constants.ts
index e538094731..7d547d09e6 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/constants.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/constants.ts
@@ -2,11 +2,14 @@
 export const POSITIVE_CONDITIONING = 'positive_conditioning';
 export const NEGATIVE_CONDITIONING = 'negative_conditioning';
 export const DENOISE_LATENTS = 'denoise_latents';
+export const DENOISE_LATENTS_HRF = 'denoise_latents_hrf';
 export const LATENTS_TO_IMAGE = 'latents_to_image';
+export const LATENTS_TO_IMAGE_HRF = 'latents_to_image_hrf';
 export const SAVE_IMAGE = 'save_image';
 export const NSFW_CHECKER = 'nsfw_checker';
 export const WATERMARKER = 'invisible_watermark';
 export const NOISE = 'noise';
+export const NOISE_HRF = 'noise_hrf';
 export const RANDOM_INT = 'rand_int';
 export const RANGE_OF_SIZE = 'range_of_size';
 export const ITERATE = 'iterate';
@@ -18,6 +21,7 @@ export const CLIP_SKIP = 'clip_skip';
 export const IMAGE_TO_LATENTS = 'image_to_latents';
 export const LATENTS_TO_LATENTS = 'latents_to_latents';
 export const RESIZE = 'resize_image';
+export const RESCALE_LATENTS = 'rescale_latents';
 export const IMG2IMG_RESIZE = 'img2img_resize';
 export const CANVAS_OUTPUT = 'canvas_output';
 export const INPAINT_IMAGE = 'inpaint_image';
diff --git a/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts b/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts
index 69d8d9dd4c..93cd75dd75 100644
--- a/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts
@@ -1,7 +1,7 @@
 import { logger } from 'app/logging/logger';
 import { parseify } from 'common/util/serialize';
-import { reduce } from 'lodash-es';
-import { OpenAPIV3 } from 'openapi-types';
+import { reduce, startCase } from 'lodash-es';
+import { OpenAPIV3_1 } from 'openapi-types';
 import { AnyInvocationType } from 'services/events/types';
 import {
   FieldType,
@@ -60,7 +60,7 @@ const isNotInDenylist = (schema: InvocationSchemaObject) =>
   !invocationDenylist.includes(schema.properties.type.default);
 
 export const parseSchema = (
-  openAPI: OpenAPIV3.Document,
+  openAPI: OpenAPIV3_1.Document,
   nodesAllowlistExtra: string[] | undefined = undefined,
   nodesDenylistExtra: string[] | undefined = undefined
 ): Record<string, InvocationTemplate> => {
@@ -110,7 +110,7 @@ export const parseSchema = (
           return inputsAccumulator;
         }
 
-        const fieldType = getFieldType(property);
+        const fieldType = property.ui_type ?? getFieldType(property);
 
         if (!isFieldType(fieldType)) {
           logger('nodes').warn(
@@ -209,7 +209,7 @@ export const parseSchema = (
           return outputsAccumulator;
         }
 
-        const fieldType = getFieldType(property);
+        const fieldType = property.ui_type ?? getFieldType(property);
 
         if (!isFieldType(fieldType)) {
           logger('nodes').warn(
@@ -222,7 +222,8 @@ export const parseSchema = (
         outputsAccumulator[propertyName] = {
           fieldKind: 'output',
           name: propertyName,
-          title: property.title ?? '',
+          title:
+            property.title ?? (propertyName ? startCase(propertyName) : ''),
           description: property.description ?? '',
           type: fieldType,
           ui_hidden: property.ui_hidden ?? false,
diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx
index 3a5cc264e7..19d707765b 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx
@@ -6,10 +6,11 @@ import {
   setAspectRatio,
   setShouldLockAspectRatio,
 } from 'features/parameters/store/generationSlice';
+import i18next from 'i18next';
 import { activeTabNameSelector } from '../../../../ui/store/uiSelectors';
 
 const aspectRatios = [
-  { name: 'Free', value: null },
+  { name: i18next.t('parameters.aspectRatioFree'), value: null },
   { name: '2:3', value: 2 / 3 },
   { name: '16:9', value: 16 / 9 },
   { name: '1:1', value: 1 / 1 },
diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfCollapse.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfCollapse.tsx
new file mode 100644
index 0000000000..ef0db1af6d
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfCollapse.tsx
@@ -0,0 +1,65 @@
+import { Flex } from '@chakra-ui/react';
+import { createSelector } from '@reduxjs/toolkit';
+import { RootState, stateSelector } from 'app/store/store';
+import { useAppSelector } from 'app/store/storeHooks';
+import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
+import IAICollapse from 'common/components/IAICollapse';
+import { useMemo } from 'react';
+import ParamHrfStrength from './ParamHrfStrength';
+import ParamHrfToggle from './ParamHrfToggle';
+import ParamHrfWidth from './ParamHrfWidth';
+import ParamHrfHeight from './ParamHrfHeight';
+import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
+
+const selector = createSelector(
+  stateSelector,
+  (state: RootState) => {
+    const { hrfEnabled } = state.generation;
+
+    return { hrfEnabled };
+  },
+  defaultSelectorOptions
+);
+
+export default function ParamHrfCollapse() {
+  const isHRFFeatureEnabled = useFeatureStatus('hrf').isFeatureEnabled;
+  const { hrfEnabled } = useAppSelector(selector);
+  const activeLabel = useMemo(() => {
+    if (hrfEnabled) {
+      return 'On';
+    } else {
+      return 'Off';
+    }
+  }, [hrfEnabled]);
+
+  if (!isHRFFeatureEnabled) {
+    return null;
+  }
+
+  return (
+    <IAICollapse label="High Resolution Fix" activeLabel={activeLabel}>
+      <Flex sx={{ flexDir: 'column', gap: 2 }}>
+        <ParamHrfToggle />
+        {hrfEnabled && (
+          <Flex
+            sx={{
+              gap: 2,
+              p: 4,
+              borderRadius: 4,
+              flexDirection: 'column',
+              w: 'full',
+              bg: 'base.100',
+              _dark: {
+                bg: 'base.750',
+              },
+            }}
+          >
+            <ParamHrfWidth />
+            <ParamHrfHeight />
+          </Flex>
+        )}
+        {hrfEnabled && <ParamHrfStrength />}
+      </Flex>
+    </IAICollapse>
+  );
+}
diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfHeight.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfHeight.tsx
new file mode 100644
index 0000000000..053da11a5a
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfHeight.tsx
@@ -0,0 +1,87 @@
+import { createSelector } from '@reduxjs/toolkit';
+import { stateSelector } from 'app/store/store';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
+import IAISlider, { IAIFullSliderProps } from 'common/components/IAISlider';
+import { roundToMultiple } from 'common/util/roundDownToMultiple';
+import {
+  setHrfHeight,
+  setHrfWidth,
+} from 'features/parameters/store/generationSlice';
+import { memo, useCallback } from 'react';
+
+function findPrevMultipleOfEight(n: number): number {
+  return Math.floor((n - 1) / 8) * 8;
+}
+
+const selector = createSelector(
+  [stateSelector],
+  ({ generation, hotkeys, config }) => {
+    const { min, fineStep, coarseStep } = config.sd.height;
+    const { model, height, hrfHeight, aspectRatio, hrfEnabled } = generation;
+
+    const step = hotkeys.shift ? fineStep : coarseStep;
+
+    return {
+      model,
+      height,
+      hrfHeight,
+      min,
+      step,
+      aspectRatio,
+      hrfEnabled,
+    };
+  },
+  defaultSelectorOptions
+);
+
+type ParamHeightProps = Omit<
+  IAIFullSliderProps,
+  'label' | 'value' | 'onChange'
+>;
+
+const ParamHrfHeight = (props: ParamHeightProps) => {
+  const { height, hrfHeight, min, step, aspectRatio, hrfEnabled } =
+    useAppSelector(selector);
+  const dispatch = useAppDispatch();
+  const maxHrfHeight = Math.max(findPrevMultipleOfEight(height), min);
+
+  const handleChange = useCallback(
+    (v: number) => {
+      dispatch(setHrfHeight(v));
+      if (aspectRatio) {
+        const newWidth = roundToMultiple(v * aspectRatio, 8);
+        dispatch(setHrfWidth(newWidth));
+      }
+    },
+    [dispatch, aspectRatio]
+  );
+
+  const handleReset = useCallback(() => {
+    dispatch(setHrfHeight(maxHrfHeight));
+    if (aspectRatio) {
+      const newWidth = roundToMultiple(maxHrfHeight * aspectRatio, 8);
+      dispatch(setHrfWidth(newWidth));
+    }
+  }, [dispatch, maxHrfHeight, aspectRatio]);
+
+  return (
+    <IAISlider
+      label="Initial Height"
+      value={hrfHeight}
+      min={min}
+      step={step}
+      max={maxHrfHeight}
+      onChange={handleChange}
+      handleReset={handleReset}
+      withInput
+      withReset
+      withSliderMarks
+      sliderNumberInputProps={{ max: maxHrfHeight }}
+      isDisabled={!hrfEnabled}
+      {...props}
+    />
+  );
+};
+
+export default memo(ParamHrfHeight);
diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfStrength.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfStrength.tsx
new file mode 100644
index 0000000000..ba17bc2f36
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfStrength.tsx
@@ -0,0 +1,64 @@
+import { createSelector } from '@reduxjs/toolkit';
+import { useAppSelector, useAppDispatch } from 'app/store/storeHooks';
+import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
+import { memo, useCallback } from 'react';
+import { stateSelector } from 'app/store/store';
+import { setHrfStrength } from 'features/parameters/store/generationSlice';
+import IAISlider from 'common/components/IAISlider';
+
+const selector = createSelector(
+  [stateSelector],
+  ({ generation, hotkeys, config }) => {
+    const { initial, min, sliderMax, inputMax, fineStep, coarseStep } =
+      config.sd.hrfStrength;
+    const { hrfStrength, hrfEnabled } = generation;
+    const step = hotkeys.shift ? fineStep : coarseStep;
+
+    return {
+      hrfStrength,
+      initial,
+      min,
+      sliderMax,
+      inputMax,
+      step,
+      hrfEnabled,
+    };
+  },
+  defaultSelectorOptions
+);
+
+const ParamHrfStrength = () => {
+  const { hrfStrength, initial, min, sliderMax, step, hrfEnabled } =
+    useAppSelector(selector);
+  const dispatch = useAppDispatch();
+
+  const handleHrfStrengthReset = useCallback(() => {
+    dispatch(setHrfStrength(initial));
+  }, [dispatch, initial]);
+
+  const handleHrfStrengthChange = useCallback(
+    (v: number) => {
+      dispatch(setHrfStrength(v));
+    },
+    [dispatch]
+  );
+
+  return (
+    <IAISlider
+      label="Denoising Strength"
+      aria-label="High Resolution Denoising Strength"
+      min={min}
+      max={sliderMax}
+      step={step}
+      value={hrfStrength}
+      onChange={handleHrfStrengthChange}
+      withSliderMarks
+      withInput
+      withReset
+      handleReset={handleHrfStrengthReset}
+      isDisabled={!hrfEnabled}
+    />
+  );
+};
+
+export default memo(ParamHrfStrength);
diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfToggle.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfToggle.tsx
new file mode 100644
index 0000000000..8a68ead652
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfToggle.tsx
@@ -0,0 +1,27 @@
+import { RootState } from 'app/store/store';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import IAISwitch from 'common/components/IAISwitch';
+import { setHrfEnabled } from 'features/parameters/store/generationSlice';
+import { ChangeEvent, useCallback } from 'react';
+
+export default function ParamHrfToggle() {
+  const dispatch = useAppDispatch();
+
+  const hrfEnabled = useAppSelector(
+    (state: RootState) => state.generation.hrfEnabled
+  );
+
+  const handleHrfEnabled = useCallback(
+    (e: ChangeEvent<HTMLInputElement>) =>
+      dispatch(setHrfEnabled(e.target.checked)),
+    [dispatch]
+  );
+
+  return (
+    <IAISwitch
+      label="Enable High Resolution Fix"
+      isChecked={hrfEnabled}
+      onChange={handleHrfEnabled}
+    />
+  );
+}
diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfWidth.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfWidth.tsx
new file mode 100644
index 0000000000..09615d5154
--- /dev/null
+++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/HighResFix/ParamHrfWidth.tsx
@@ -0,0 +1,84 @@
+import { createSelector } from '@reduxjs/toolkit';
+import { stateSelector } from 'app/store/store';
+import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
+import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
+import IAISlider, { IAIFullSliderProps } from 'common/components/IAISlider';
+import { roundToMultiple } from 'common/util/roundDownToMultiple';
+import {
+  setHrfHeight,
+  setHrfWidth,
+} from 'features/parameters/store/generationSlice';
+import { memo, useCallback } from 'react';
+
+function findPrevMultipleOfEight(n: number): number {
+  return Math.floor((n - 1) / 8) * 8;
+}
+
+const selector = createSelector(
+  [stateSelector],
+  ({ generation, hotkeys, config }) => {
+    const { min, fineStep, coarseStep } = config.sd.width;
+    const { model, width, hrfWidth, aspectRatio, hrfEnabled } = generation;
+
+    const step = hotkeys.shift ? fineStep : coarseStep;
+
+    return {
+      model,
+      width,
+      hrfWidth,
+      min,
+      step,
+      aspectRatio,
+      hrfEnabled,
+    };
+  },
+  defaultSelectorOptions
+);
+
+type ParamWidthProps = Omit<IAIFullSliderProps, 'label' | 'value' | 'onChange'>;
+
+const ParamHrfWidth = (props: ParamWidthProps) => {
+  const { width, hrfWidth, min, step, aspectRatio, hrfEnabled } =
+    useAppSelector(selector);
+  const dispatch = useAppDispatch();
+  const maxHrfWidth = Math.max(findPrevMultipleOfEight(width), min);
+
+  const handleChange = useCallback(
+    (v: number) => {
+      dispatch(setHrfWidth(v));
+      if (aspectRatio) {
+        const newHeight = roundToMultiple(v / aspectRatio, 8);
+        dispatch(setHrfHeight(newHeight));
+      }
+    },
+    [dispatch, aspectRatio]
+  );
+
+  const handleReset = useCallback(() => {
+    dispatch(setHrfWidth(maxHrfWidth));
+    if (aspectRatio) {
+      const newHeight = roundToMultiple(maxHrfWidth / aspectRatio, 8);
+      dispatch(setHrfHeight(newHeight));
+    }
+  }, [dispatch, maxHrfWidth, aspectRatio]);
+
+  return (
+    <IAISlider
+      label="Initial Width"
+      value={hrfWidth}
+      min={min}
+      step={step}
+      max={maxHrfWidth}
+      onChange={handleChange}
+      handleReset={handleReset}
+      withInput
+      withReset
+      withSliderMarks
+      sliderNumberInputProps={{ max: maxHrfWidth }}
+      isDisabled={!hrfEnabled}
+      {...props}
+    />
+  );
+};
+
+export default memo(ParamHrfWidth);
diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/VAEModel/ParamVAEPrecision.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/VAEModel/ParamVAEPrecision.tsx
index f71794394e..723e57a288 100644
--- a/invokeai/frontend/web/src/features/parameters/components/Parameters/VAEModel/ParamVAEPrecision.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/VAEModel/ParamVAEPrecision.tsx
@@ -7,6 +7,7 @@ import IAIMantineSelect from 'common/components/IAIMantineSelect';
 import { vaePrecisionChanged } from 'features/parameters/store/generationSlice';
 import { PrecisionParam } from 'features/parameters/types/parameterSchemas';
 import { memo, useCallback } from 'react';
+import { useTranslation } from 'react-i18next';
 
 const selector = createSelector(
   stateSelector,
@@ -20,6 +21,7 @@ const selector = createSelector(
 const DATA = ['fp16', 'fp32'];
 
 const ParamVAEModelSelect = () => {
+  const { t } = useTranslation();
   const dispatch = useAppDispatch();
   const { vaePrecision } = useAppSelector(selector);
 
@@ -37,7 +39,7 @@ const ParamVAEModelSelect = () => {
   return (
     <IAIInformationalPopover feature="paramVAEPrecision">
       <IAIMantineSelect
-        label="VAE Precision"
+        label={t('modelManager.vaePrecision')}
         value={vaePrecision}
         data={DATA}
         onChange={handleChange}
diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts
index ea6aaf28ca..63d545662a 100644
--- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts
+++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts
@@ -5,6 +5,7 @@ import { configChanged } from 'features/system/store/configSlice';
 import { clamp } from 'lodash-es';
 import { ImageDTO } from 'services/api/types';
 
+import { isAnyControlAdapterAdded } from 'features/controlAdapters/store/controlAdaptersSlice';
 import { clipSkipMap } from '../types/constants';
 import {
   CanvasCoherenceModeParam,
@@ -26,6 +27,10 @@ import {
 } from '../types/parameterSchemas';
 
 export interface GenerationState {
+  hrfHeight: HeightParam;
+  hrfWidth: WidthParam;
+  hrfEnabled: boolean;
+  hrfStrength: StrengthParam;
   cfgScale: CfgScaleParam;
   height: HeightParam;
   img2imgStrength: StrengthParam;
@@ -68,6 +73,10 @@ export interface GenerationState {
 }
 
 export const initialGenerationState: GenerationState = {
+  hrfHeight: 64,
+  hrfWidth: 64,
+  hrfStrength: 0.75,
+  hrfEnabled: false,
   cfgScale: 7.5,
   height: 512,
   img2imgStrength: 0.75,
@@ -270,6 +279,18 @@ export const generationSlice = createSlice({
     setClipSkip: (state, action: PayloadAction<number>) => {
       state.clipSkip = action.payload;
     },
+    setHrfHeight: (state, action: PayloadAction<number>) => {
+      state.hrfHeight = action.payload;
+    },
+    setHrfWidth: (state, action: PayloadAction<number>) => {
+      state.hrfWidth = action.payload;
+    },
+    setHrfStrength: (state, action: PayloadAction<number>) => {
+      state.hrfStrength = action.payload;
+    },
+    setHrfEnabled: (state, action: PayloadAction<boolean>) => {
+      state.hrfEnabled = action.payload;
+    },
     shouldUseCpuNoiseChanged: (state, action: PayloadAction<boolean>) => {
       state.shouldUseCpuNoise = action.payload;
     },
@@ -302,6 +323,15 @@ export const generationSlice = createSlice({
         }
       }
     });
+
+    // TODO: This is a temp fix to reduce issues with T2I adapter having a different downscaling
+    // factor than the UNet. Hopefully we get an upstream fix in diffusers.
+    builder.addMatcher(isAnyControlAdapterAdded, (state, action) => {
+      if (action.payload.type === 't2i_adapter') {
+        state.width = roundToMultiple(state.width, 64);
+        state.height = roundToMultiple(state.height, 64);
+      }
+    });
   },
 });
 
@@ -345,6 +375,10 @@ export const {
   setSeamlessXAxis,
   setSeamlessYAxis,
   setClipSkip,
+  setHrfHeight,
+  setHrfWidth,
+  setHrfStrength,
+  setHrfEnabled,
   shouldUseCpuNoiseChanged,
   setAspectRatio,
   setShouldLockAspectRatio,
diff --git a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts
index e548b9aeaf..7a6b6b8a5c 100644
--- a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts
+++ b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts
@@ -210,6 +210,15 @@ export type HeightParam = z.infer<typeof zHeight>;
 export const isValidHeight = (val: unknown): val is HeightParam =>
   zHeight.safeParse(val).success;
 
+/**
+ * Zod schema for resolution parameter
+ */
+export const zResolution = z.tuple([zWidth, zHeight]);
+/**
+ * Type alias for resolution parameter, inferred from its zod schema
+ */
+export type ResolutionParam = z.infer<typeof zResolution>;
+
 export const zBaseModel = z.enum([
   'any',
   'sd-1',
diff --git a/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx b/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx
index eccb2d4628..65e641116d 100644
--- a/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx
+++ b/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx
@@ -60,9 +60,9 @@ const QueueButtonTooltipContent = ({ prepend = false }: Props) => {
       )}
       <StyledDivider />
       <Text fontWeight={400} fontStyle="oblique 10deg">
-        Adding images to{' '}
+        {t('parameters.invoke.addingImagesTo')}{' '}
         <Text as="span" fontWeight={600}>
-          {autoAddBoardName || 'Uncategorized'}
+          {autoAddBoardName || t('boards.uncategorized')}
         </Text>
       </Text>
     </Flex>
diff --git a/invokeai/frontend/web/src/features/queue/components/common/QueueItemCard.tsx b/invokeai/frontend/web/src/features/queue/components/common/QueueItemCard.tsx
index 9cc991335e..d441be4ecb 100644
--- a/invokeai/frontend/web/src/features/queue/components/common/QueueItemCard.tsx
+++ b/invokeai/frontend/web/src/features/queue/components/common/QueueItemCard.tsx
@@ -7,7 +7,7 @@ const QueueItemCard = ({
   session_queue_item,
   label,
 }: {
-  session_queue_item?: components['schemas']['SessionQueueItem'];
+  session_queue_item?: components['schemas']['SessionQueueItem'] | null;
   label: string;
 }) => {
   return (
diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabCoreParameters.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabCoreParameters.tsx
index dae462ad47..d107503dc6 100644
--- a/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabCoreParameters.tsx
+++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabCoreParameters.tsx
@@ -14,6 +14,7 @@ import { generationSelector } from 'features/parameters/store/generationSelector
 import { uiSelector } from 'features/ui/store/uiSelectors';
 import { memo } from 'react';
 import ParamSDXLImg2ImgDenoisingStrength from './ParamSDXLImg2ImgDenoisingStrength';
+import { useTranslation } from 'react-i18next';
 
 const selector = createSelector(
   [uiSelector, generationSelector],
@@ -29,10 +30,15 @@ const selector = createSelector(
 );
 
 const SDXLImageToImageTabCoreParameters = () => {
+  const { t } = useTranslation();
   const { shouldUseSliders, activeLabel } = useAppSelector(selector);
 
   return (
-    <IAICollapse label="General" activeLabel={activeLabel} defaultIsOpen={true}>
+    <IAICollapse
+      label={t('parameters.general')}
+      activeLabel={activeLabel}
+      defaultIsOpen={true}
+    >
       <Flex
         sx={{
           flexDirection: 'column',
diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabCoreParameters.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabCoreParameters.tsx
index 4cfbdeb895..30c71611fb 100644
--- a/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabCoreParameters.tsx
+++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabCoreParameters.tsx
@@ -12,6 +12,7 @@ import ParamSteps from 'features/parameters/components/Parameters/Core/ParamStep
 import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
 import { memo } from 'react';
 import ParamSDXLImg2ImgDenoisingStrength from './ParamSDXLImg2ImgDenoisingStrength';
+import { useTranslation } from 'react-i18next';
 
 const selector = createSelector(
   stateSelector,
@@ -27,10 +28,15 @@ const selector = createSelector(
 );
 
 const SDXLUnifiedCanvasTabCoreParameters = () => {
+  const { t } = useTranslation();
   const { shouldUseSliders, activeLabel } = useAppSelector(selector);
 
   return (
-    <IAICollapse label="General" activeLabel={activeLabel} defaultIsOpen={true}>
+    <IAICollapse
+      label={t('parameters.general')}
+      activeLabel={activeLabel}
+      defaultIsOpen={true}
+    >
       <Flex
         sx={{
           flexDirection: 'column',
diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsClearIntermediates.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsClearIntermediates.tsx
index b25fe6274e..fbe5692431 100644
--- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsClearIntermediates.tsx
+++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsClearIntermediates.tsx
@@ -2,6 +2,8 @@ import { Heading, Text } from '@chakra-ui/react';
 import { useAppDispatch } from 'app/store/storeHooks';
 import { controlAdaptersReset } from 'features/controlAdapters/store/controlAdaptersSlice';
 import { useCallback, useEffect } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useGetQueueStatusQuery } from 'services/api/endpoints/queue';
 import IAIButton from '../../../../common/components/IAIButton';
 import {
   useClearIntermediatesMutation,
@@ -12,6 +14,7 @@ import { addToast } from '../../store/systemSlice';
 import StyledFlex from './StyledFlex';
 
 export default function SettingsClearIntermediates() {
+  const { t } = useTranslation();
   const dispatch = useAppDispatch();
 
   const { data: intermediatesCount, refetch: updateIntermediatesCount } =
@@ -20,52 +23,62 @@ export default function SettingsClearIntermediates() {
   const [clearIntermediates, { isLoading: isLoadingClearIntermediates }] =
     useClearIntermediatesMutation();
 
+  const { data: queueStatus } = useGetQueueStatusQuery();
+  const hasPendingItems =
+    queueStatus &&
+    (queueStatus.queue.in_progress > 0 || queueStatus.queue.pending > 0);
+
   const handleClickClearIntermediates = useCallback(() => {
+    if (hasPendingItems) {
+      return;
+    }
+
     clearIntermediates()
       .unwrap()
-      .then((response) => {
+      .then((clearedCount) => {
         dispatch(controlAdaptersReset());
         dispatch(resetCanvas());
         dispatch(
           addToast({
-            title: `Cleared ${response} intermediates`,
+            title: t('settings.intermediatesCleared', { count: clearedCount }),
             status: 'info',
           })
         );
+      })
+      .catch(() => {
+        dispatch(
+          addToast({
+            title: t('settings.intermediatesClearedFailed'),
+            status: 'error',
+          })
+        );
       });
-  }, [clearIntermediates, dispatch]);
+  }, [t, clearIntermediates, dispatch, hasPendingItems]);
 
   useEffect(() => {
     // update the count on mount
     updateIntermediatesCount();
   }, [updateIntermediatesCount]);
 
-  const buttonText = intermediatesCount
-    ? `Clear ${intermediatesCount} Intermediate${
-        intermediatesCount > 1 ? 's' : ''
-      }`
-    : 'No Intermediates to Clear';
-
   return (
     <StyledFlex>
-      <Heading size="sm">Clear Intermediates</Heading>
+      <Heading size="sm">{t('settings.clearIntermediates')}</Heading>
       <IAIButton
+        tooltip={
+          hasPendingItems ? t('settings.clearIntermediatesDisabled') : undefined
+        }
         colorScheme="warning"
         onClick={handleClickClearIntermediates}
         isLoading={isLoadingClearIntermediates}
-        isDisabled={!intermediatesCount}
+        isDisabled={!intermediatesCount || hasPendingItems}
       >
-        {buttonText}
+        {t('settings.clearIntermediatesWithCount', {
+          count: intermediatesCount ?? 0,
+        })}
       </IAIButton>
-      <Text fontWeight="bold">
-        Clearing intermediates will reset your Canvas and ControlNet state.
-      </Text>
-      <Text variant="subtext">
-        Intermediate images are byproducts of generation, different from the
-        result images in the gallery. Clearing intermediates will free disk
-        space.
-      </Text>
-      <Text variant="subtext">Your gallery images will not be deleted.</Text>
+      <Text fontWeight="bold">{t('settings.clearIntermediatesDesc1')}</Text>
+      <Text variant="subtext">{t('settings.clearIntermediatesDesc2')}</Text>
+      <Text variant="subtext">{t('settings.clearIntermediatesDesc3')}</Text>
     </StyledFlex>
   );
 }
diff --git a/invokeai/frontend/web/src/features/system/store/configSlice.ts b/invokeai/frontend/web/src/features/system/store/configSlice.ts
index 8a20b050ed..78d540203b 100644
--- a/invokeai/frontend/web/src/features/system/store/configSlice.ts
+++ b/invokeai/frontend/web/src/features/system/store/configSlice.ts
@@ -7,7 +7,7 @@ export const initialConfigState: AppConfig = {
   shouldUpdateImagesOnConnect: false,
   shouldFetchMetadataFromApi: false,
   disabledTabs: [],
-  disabledFeatures: ['lightbox', 'faceRestore', 'batches'],
+  disabledFeatures: ['lightbox', 'faceRestore', 'batches', 'bulkDownload'],
   disabledSDFeatures: [
     'variation',
     'symmetry',
@@ -69,6 +69,14 @@ export const initialConfigState: AppConfig = {
       fineStep: 0.01,
       coarseStep: 0.05,
     },
+    hrfStrength: {
+      initial: 0.7,
+      min: 0,
+      sliderMax: 1,
+      inputMax: 1,
+      fineStep: 0.01,
+      coarseStep: 0.05,
+    },
     dynamicPrompts: {
       maxPrompts: {
         initial: 100,
diff --git a/invokeai/frontend/web/src/features/system/util/copyBlobToClipboard.ts b/invokeai/frontend/web/src/features/system/util/copyBlobToClipboard.ts
index cf59f2a687..b5e896f3bf 100644
--- a/invokeai/frontend/web/src/features/system/util/copyBlobToClipboard.ts
+++ b/invokeai/frontend/web/src/features/system/util/copyBlobToClipboard.ts
@@ -2,7 +2,7 @@
  * Copies a blob to the clipboard by calling navigator.clipboard.write().
  */
 export const copyBlobToClipboard = (
-  blob: Promise<Blob>,
+  blob: Promise<Blob> | Blob,
   type = 'image/png'
 ) => {
   navigator.clipboard.write([
diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImage/ImageToImageTabCoreParameters.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImage/ImageToImageTabCoreParameters.tsx
index 46054fcafd..2668062da6 100644
--- a/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImage/ImageToImageTabCoreParameters.tsx
+++ b/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImage/ImageToImageTabCoreParameters.tsx
@@ -11,14 +11,16 @@ import ImageToImageStrength from 'features/parameters/components/Parameters/Imag
 import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
 import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
 import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
 
 const ImageToImageTabCoreParameters = () => {
+  const { t } = useTranslation();
   const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
   const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
 
   return (
     <IAICollapse
-      label="General"
+      label={t('parameters.general')}
       activeLabel={iterationsAndSeedLabel}
       defaultIsOpen={true}
     >
diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/MergeModelsPanel.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/MergeModelsPanel.tsx
index 6837a2e853..e5c68ba6cf 100644
--- a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/MergeModelsPanel.tsx
+++ b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/MergeModelsPanel.tsx
@@ -112,7 +112,7 @@ export default function MergeModelsPanel() {
       }
     });
 
-    const mergeModelsInfo: MergeModelConfig = {
+    const mergeModelsInfo: MergeModelConfig['body'] = {
       model_names: models_names,
       merged_model_name:
         mergedModelName !== '' ? mergedModelName : models_names.join('-'),
@@ -125,7 +125,7 @@ export default function MergeModelsPanel() {
 
     mergeModels({
       base_model: baseModel,
-      body: mergeModelsInfo,
+      body: { body: mergeModelsInfo },
     })
       .unwrap()
       .then((_) => {
diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabCoreParameters.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabCoreParameters.tsx
index ea6ef03e09..3f3cf2db05 100644
--- a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabCoreParameters.tsx
+++ b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabCoreParameters.tsx
@@ -9,14 +9,16 @@ import ParamSteps from 'features/parameters/components/Parameters/Core/ParamStep
 import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
 import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
 import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
 
 const TextToImageTabCoreParameters = () => {
+  const { t } = useTranslation();
   const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
   const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
 
   return (
     <IAICollapse
-      label="General"
+      label={t('parameters.general')}
       activeLabel={iterationsAndSeedLabel}
       defaultIsOpen={true}
     >
diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabParameters.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabParameters.tsx
index 0c153fd7eb..8ec8c9caed 100644
--- a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabParameters.tsx
+++ b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImage/TextToImageTabParameters.tsx
@@ -3,6 +3,7 @@ import ParamLoraCollapse from 'features/lora/components/ParamLoraCollapse';
 import ParamAdvancedCollapse from 'features/parameters/components/Parameters/Advanced/ParamAdvancedCollapse';
 import ControlAdaptersCollapse from 'features/controlAdapters/components/ControlAdaptersCollapse';
 import ParamSymmetryCollapse from 'features/parameters/components/Parameters/Symmetry/ParamSymmetryCollapse';
+import ParamHrfCollapse from 'features/parameters/components/Parameters/HighResFix/ParamHrfCollapse';
 import { memo } from 'react';
 import ParamPromptArea from '../../../../parameters/components/Parameters/Prompt/ParamPromptArea';
 import TextToImageTabCoreParameters from './TextToImageTabCoreParameters';
@@ -16,6 +17,7 @@ const TextToImageTabParameters = () => {
       <ParamLoraCollapse />
       <ParamDynamicPromptsCollapse />
       <ParamSymmetryCollapse />
+      <ParamHrfCollapse />
       <ParamAdvancedCollapse />
     </>
   );
diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasCoreParameters.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasCoreParameters.tsx
index c57a68ed62..40a5026d09 100644
--- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasCoreParameters.tsx
+++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasCoreParameters.tsx
@@ -10,14 +10,16 @@ import ImageToImageStrength from 'features/parameters/components/Parameters/Imag
 import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
 import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
 import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
 
 const UnifiedCanvasCoreParameters = () => {
+  const { t } = useTranslation();
   const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
   const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
 
   return (
     <IAICollapse
-      label="General"
+      label={t('parameters.general')}
       activeLabel={iterationsAndSeedLabel}
       defaultIsOpen={true}
     >
diff --git a/invokeai/frontend/web/src/features/ui/hooks/useCopyImageToClipboard.ts b/invokeai/frontend/web/src/features/ui/hooks/useCopyImageToClipboard.ts
index 4b42a45e93..ef9db44a9d 100644
--- a/invokeai/frontend/web/src/features/ui/hooks/useCopyImageToClipboard.ts
+++ b/invokeai/frontend/web/src/features/ui/hooks/useCopyImageToClipboard.ts
@@ -1,11 +1,13 @@
 import { useAppToaster } from 'app/components/Toaster';
+import { useImageUrlToBlob } from 'common/hooks/useImageUrlToBlob';
+import { copyBlobToClipboard } from 'features/system/util/copyBlobToClipboard';
 import { useCallback, useMemo } from 'react';
 import { useTranslation } from 'react-i18next';
-import { copyBlobToClipboard } from 'features/system/util/copyBlobToClipboard';
 
 export const useCopyImageToClipboard = () => {
   const toaster = useAppToaster();
   const { t } = useTranslation();
+  const imageUrlToBlob = useImageUrlToBlob();
 
   const isClipboardAPIAvailable = useMemo(() => {
     return Boolean(navigator.clipboard) && Boolean(window.ClipboardItem);
@@ -23,15 +25,13 @@ export const useCopyImageToClipboard = () => {
         });
       }
       try {
-        const getImageBlob = async () => {
-          const response = await fetch(image_url);
-          if (!response.ok) {
-            throw new Error(`Problem retrieving image data`);
-          }
-          return await response.blob();
-        };
+        const blob = await imageUrlToBlob(image_url);
 
-        copyBlobToClipboard(getImageBlob());
+        if (!blob) {
+          throw new Error('Unable to create Blob');
+        }
+
+        copyBlobToClipboard(blob);
 
         toaster({
           title: t('toast.imageCopied'),
@@ -49,7 +49,7 @@ export const useCopyImageToClipboard = () => {
         });
       }
     },
-    [isClipboardAPIAvailable, t, toaster]
+    [imageUrlToBlob, isClipboardAPIAvailable, t, toaster]
   );
 
   return { isClipboardAPIAvailable, copyImageToClipboard };
diff --git a/invokeai/frontend/web/src/services/api/endpoints/images.ts b/invokeai/frontend/web/src/services/api/endpoints/images.ts
index ce9207144d..99a5fc5f50 100644
--- a/invokeai/frontend/web/src/services/api/endpoints/images.ts
+++ b/invokeai/frontend/web/src/services/api/endpoints/images.ts
@@ -520,7 +520,7 @@ export const imagesApi = api.injectEndpoints({
         // assume all images are on the same board/category
         if (images[0]) {
           const categories = getCategories(images[0]);
-          const boardId = images[0].board_id;
+          const boardId = images[0].board_id ?? undefined;
 
           return [
             {
@@ -637,7 +637,7 @@ export const imagesApi = api.injectEndpoints({
         // assume all images are on the same board/category
         if (images[0]) {
           const categories = getCategories(images[0]);
-          const boardId = images[0].board_id;
+          const boardId = images[0].board_id ?? undefined;
           return [
             {
               type: 'ImageList',
@@ -1599,6 +1599,19 @@ export const imagesApi = api.injectEndpoints({
         }
       },
     }),
+    bulkDownloadImages: build.mutation<
+      components['schemas']['ImagesDownloaded'],
+      components['schemas']['Body_download_images_from_list']
+    >({
+      query: ({ image_names, board_id }) => ({
+        url: `images/download`,
+        method: 'POST',
+        body: {
+          image_names,
+          board_id,
+        },
+      }),
+    }),
   }),
 });
 
@@ -1623,4 +1636,5 @@ export const {
   useStarImagesMutation,
   useUnstarImagesMutation,
   useGetImageMetadataFromFileQuery,
+  useBulkDownloadImagesMutation,
 } = imagesApi;
diff --git a/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts b/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts
index ce0cff7b8a..54e3745c27 100644
--- a/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts
+++ b/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts
@@ -1,11 +1,12 @@
 import { BoardId } from 'features/gallery/store/types';
 import { useListAllBoardsQuery } from '../endpoints/boards';
+import { t } from 'i18next';
 
 export const useBoardName = (board_id: BoardId) => {
   const { boardName } = useListAllBoardsQuery(undefined, {
     selectFromResult: ({ data }) => {
       const selectedBoard = data?.find((b) => b.board_id === board_id);
-      const boardName = selectedBoard?.board_name || 'Uncategorized';
+      const boardName = selectedBoard?.board_name || t('boards.uncategorized');
 
       return { boardName };
     },
diff --git a/invokeai/frontend/web/src/services/api/schema.d.ts b/invokeai/frontend/web/src/services/api/schema.d.ts
index 5bc2228eba..d4678dc03b 100644
--- a/invokeai/frontend/web/src/services/api/schema.d.ts
+++ b/invokeai/frontend/web/src/services/api/schema.d.ts
@@ -5,80 +5,6 @@
 
 
 export type paths = {
-  "/api/v1/sessions/": {
-    /**
-     * List Sessions
-     * @deprecated
-     * @description Gets a list of sessions, optionally searching
-     */
-    get: operations["list_sessions"];
-    /**
-     * Create Session
-     * @deprecated
-     * @description Creates a new session, optionally initializing it with an invocation graph
-     */
-    post: operations["create_session"];
-  };
-  "/api/v1/sessions/{session_id}": {
-    /**
-     * Get Session
-     * @deprecated
-     * @description Gets a session
-     */
-    get: operations["get_session"];
-  };
-  "/api/v1/sessions/{session_id}/nodes": {
-    /**
-     * Add Node
-     * @deprecated
-     * @description Adds a node to the graph
-     */
-    post: operations["add_node"];
-  };
-  "/api/v1/sessions/{session_id}/nodes/{node_path}": {
-    /**
-     * Update Node
-     * @deprecated
-     * @description Updates a node in the graph and removes all linked edges
-     */
-    put: operations["update_node"];
-    /**
-     * Delete Node
-     * @deprecated
-     * @description Deletes a node in the graph and removes all linked edges
-     */
-    delete: operations["delete_node"];
-  };
-  "/api/v1/sessions/{session_id}/edges": {
-    /**
-     * Add Edge
-     * @deprecated
-     * @description Adds an edge to the graph
-     */
-    post: operations["add_edge"];
-  };
-  "/api/v1/sessions/{session_id}/edges/{from_node_id}/{from_field}/{to_node_id}/{to_field}": {
-    /**
-     * Delete Edge
-     * @deprecated
-     * @description Deletes an edge from the graph
-     */
-    delete: operations["delete_edge"];
-  };
-  "/api/v1/sessions/{session_id}/invoke": {
-    /**
-     * Invoke Session
-     * @deprecated
-     * @description Invokes a session
-     */
-    put: operations["invoke_session"];
-    /**
-     * Cancel Session Invoke
-     * @deprecated
-     * @description Invokes a session
-     */
-    delete: operations["cancel_session_invoke"];
-  };
   "/api/v1/utilities/dynamicprompts": {
     /**
      * Parse Dynamicprompts
@@ -235,6 +161,10 @@ export type paths = {
     /** Unstar Images In List */
     post: operations["unstar_images_in_list"];
   };
+  "/api/v1/images/download": {
+    /** Download Images From List */
+    post: operations["download_images_from_list"];
+  };
   "/api/v1/boards/": {
     /**
      * List Boards
@@ -477,18 +407,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * A
        * @description The first number
@@ -502,9 +432,9 @@ export type components = {
        */
       b?: number;
       /**
-       * Type
+       * type
        * @default add
-       * @enum {string}
+       * @constant
        */
       type: "add";
     };
@@ -547,7 +477,6 @@ export type components = {
     };
     /**
      * BaseModelType
-     * @description An enumeration.
      * @enum {string}
      */
     BaseModelType: "any" | "sd-1" | "sd-2" | "sdxl" | "sdxl-refiner";
@@ -562,11 +491,8 @@ export type components = {
        * Data
        * @description The batch data collection.
        */
-      data?: components["schemas"]["BatchDatum"][][];
-      /**
-       * Graph
-       * @description The graph to initialize the session with
-       */
+      data?: components["schemas"]["BatchDatum"][][] | null;
+      /** @description The graph to initialize the session with */
       graph: components["schemas"]["Graph"];
       /**
        * Runs
@@ -651,18 +577,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Width
        * @description The width of the image
@@ -683,20 +609,19 @@ export type components = {
        */
       mode?: "RGB" | "RGBA";
       /**
-       * Color
        * @description The color of the image
        * @default {
-       *   "r": 0,
-       *   "g": 0,
+       *   "a": 255,
        *   "b": 0,
-       *   "a": 255
+       *   "g": 0,
+       *   "r": 0
        * }
        */
       color?: components["schemas"]["ColorField"];
       /**
-       * Type
+       * type
        * @default blank_image
-       * @enum {string}
+       * @constant
        */
       type: "blank_image";
     };
@@ -715,27 +640,21 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Latents A
-       * @description Latents tensor
-       */
+      use_cache?: boolean | null;
+      /** @description Latents tensor */
       latents_a?: components["schemas"]["LatentsField"];
-      /**
-       * Latents B
-       * @description Latents tensor
-       */
+      /** @description Latents tensor */
       latents_b?: components["schemas"]["LatentsField"];
       /**
        * Alpha
@@ -744,9 +663,9 @@ export type components = {
        */
       alpha?: number;
       /**
-       * Type
+       * type
        * @default lblend
-       * @enum {string}
+       * @constant
        */
       type: "lblend";
     };
@@ -756,12 +675,12 @@ export type components = {
        * Board Name
        * @description The board's new name.
        */
-      board_name?: string;
+      board_name?: string | null;
       /**
        * Cover Image Name
        * @description The name of the board's new cover image.
        */
-      cover_image_name?: string;
+      cover_image_name?: string | null;
     };
     /**
      * BoardDTO
@@ -792,12 +711,12 @@ export type components = {
        * Deleted At
        * @description The deleted timestamp of the board.
        */
-      deleted_at?: string;
+      deleted_at?: string | null;
       /**
        * Cover Image Name
        * @description The name of the board's cover image.
        */
-      cover_image_name?: string;
+      cover_image_name: string | null;
       /**
        * Image Count
        * @description The number of images in the board.
@@ -857,12 +776,22 @@ export type components = {
        */
       image_names: string[];
     };
+    /** Body_download_images_from_list */
+    Body_download_images_from_list: {
+      /**
+       * Image Names
+       * @description The list of names of images to download
+       */
+      image_names: string[];
+      /**
+       * Board Id
+       * @description The board from which image should be downloaded from
+       */
+      board_id?: string | null;
+    };
     /** Body_enqueue_batch */
     Body_enqueue_batch: {
-      /**
-       * Batch
-       * @description Batch to process
-       */
+      /** @description Batch to process */
       batch: components["schemas"]["Batch"];
       /**
        * Prepend
@@ -873,10 +802,7 @@ export type components = {
     };
     /** Body_enqueue_graph */
     Body_enqueue_graph: {
-      /**
-       * Graph
-       * @description The graph to enqueue
-       */
+      /** @description The graph to enqueue */
       graph: components["schemas"]["Graph"];
       /**
        * Prepend
@@ -895,41 +821,13 @@ export type components = {
       /**
        * Prediction Type
        * @description Prediction type for SDv2 checkpoints and rare SDv1 checkpoints
-       * @enum {string}
        */
-      prediction_type?: "v_prediction" | "epsilon" | "sample";
+      prediction_type?: ("v_prediction" | "epsilon" | "sample") | null;
     };
     /** Body_merge_models */
     Body_merge_models: {
-      /**
-       * Model Names
-       * @description model name
-       */
-      model_names: string[];
-      /**
-       * Merged Model Name
-       * @description Name of destination model
-       */
-      merged_model_name: string;
-      /**
-       * Alpha
-       * @description Alpha weighting strength to apply to 2d and 3d models
-       * @default 0.5
-       */
-      alpha?: number;
-      /** @description Interpolation method */
-      interp: components["schemas"]["MergeInterpolationMethod"];
-      /**
-       * Force
-       * @description Force merging of models created with different versions of diffusers
-       * @default false
-       */
-      force?: boolean;
-      /**
-       * Merge Dest Directory
-       * @description Save the merged model to the designated directory (with 'merged_model_name' appended)
-       */
-      merge_dest_directory?: string;
+      /** @description Model configuration */
+      body: components["schemas"]["MergeModelsBody"];
     };
     /** Body_parse_dynamicprompts */
     Body_parse_dynamicprompts: {
@@ -1006,27 +904,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The collection of boolean values
        */
       collection?: boolean[];
       /**
-       * Type
+       * type
        * @default boolean_collection
-       * @enum {string}
+       * @constant
        */
       type: "boolean_collection";
     };
@@ -1041,9 +939,9 @@ export type components = {
        */
       collection: boolean[];
       /**
-       * Type
+       * type
        * @default boolean_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "boolean_collection_output";
     };
@@ -1062,18 +960,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Value
        * @description The boolean value
@@ -1081,9 +979,9 @@ export type components = {
        */
       value?: boolean;
       /**
-       * Type
+       * type
        * @default boolean
-       * @enum {string}
+       * @constant
        */
       type: "boolean";
     };
@@ -1098,9 +996,9 @@ export type components = {
        */
       value: boolean;
       /**
-       * Type
+       * type
        * @default boolean_output
-       * @enum {string}
+       * @constant
        */
       type: "boolean_output";
     };
@@ -1111,19 +1009,20 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default clip_vision
+       * @constant
        */
       model_type: "clip_vision";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "diffusers";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
     };
     /** CLIPVisionModelField */
     CLIPVisionModelField: {
@@ -1150,27 +1049,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to infill
-       */
+      use_cache?: boolean | null;
+      /** @description The image to infill */
       image?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default infill_cv2
-       * @enum {string}
+       * @constant
        */
       type: "infill_cv2";
     };
@@ -1200,29 +1096,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default canny_image_processor
-       * @enum {string}
-       */
-      type: "canny_image_processor";
       /**
        * Low Threshold
        * @description The low threshold of the Canny pixel gradient (0-255)
@@ -1235,6 +1122,12 @@ export type components = {
        * @default 200
        */
       high_threshold?: number;
+      /**
+       * type
+       * @default canny_image_processor
+       * @constant
+       */
+      type: "canny_image_processor";
     };
     /**
      * ClearResult
@@ -1249,15 +1142,9 @@ export type components = {
     };
     /** ClipField */
     ClipField: {
-      /**
-       * Tokenizer
-       * @description Info to load tokenizer submodel
-       */
+      /** @description Info to load tokenizer submodel */
       tokenizer: components["schemas"]["ModelInfo"];
-      /**
-       * Text Encoder
-       * @description Info to load text_encoder submodel
-       */
+      /** @description Info to load text_encoder submodel */
       text_encoder: components["schemas"]["ModelInfo"];
       /**
        * Skipped Layers
@@ -1285,18 +1172,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * CLIP
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
@@ -1309,9 +1196,9 @@ export type components = {
        */
       skipped_layers?: number;
       /**
-       * Type
+       * type
        * @default clip_skip
-       * @enum {string}
+       * @constant
        */
       type: "clip_skip";
     };
@@ -1324,11 +1211,11 @@ export type components = {
        * CLIP
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
-      clip?: components["schemas"]["ClipField"];
+      clip?: components["schemas"]["ClipField"] | null;
       /**
-       * Type
+       * type
        * @default clip_skip_output
-       * @enum {string}
+       * @constant
        */
       type: "clip_skip_output";
     };
@@ -1347,18 +1234,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection Item
        * @description The item to collect (all inputs must be of the same type)
@@ -1370,18 +1257,13 @@ export type components = {
        */
       collection?: unknown[];
       /**
-       * Type
+       * type
        * @default collect
-       * @enum {string}
+       * @constant
        */
       type: "collect";
     };
-    /**
-     * CollectInvocationOutput
-     * @description Base class for all invocation outputs.
-     *
-     * All invocation outputs must use the `@invocation_output` decorator to provide their unique type.
-     */
+    /** CollectInvocationOutput */
     CollectInvocationOutput: {
       /**
        * Collection
@@ -1389,9 +1271,9 @@ export type components = {
        */
       collection: unknown[];
       /**
-       * Type
+       * type
        * @default collect_output
-       * @enum {string}
+       * @constant
        */
       type: "collect_output";
     };
@@ -1406,9 +1288,9 @@ export type components = {
        */
       collection: components["schemas"]["ColorField"][];
       /**
-       * Type
+       * type
        * @default color_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "color_collection_output";
     };
@@ -1428,33 +1310,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to color-correct
-       */
+      use_cache?: boolean | null;
+      /** @description The image to color-correct */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Reference
-       * @description Reference image for color-correction
-       */
+      /** @description Reference image for color-correction */
       reference?: components["schemas"]["ImageField"];
-      /**
-       * Mask
-       * @description Mask to use when applying color-correction
-       */
-      mask?: components["schemas"]["ImageField"];
+      /** @description Mask to use when applying color-correction */
+      mask?: components["schemas"]["ImageField"] | null;
       /**
        * Mask Blur Radius
        * @description Mask blur radius
@@ -1462,9 +1335,9 @@ export type components = {
        */
       mask_blur_radius?: number;
       /**
-       * Type
+       * type
        * @default color_correct
-       * @enum {string}
+       * @constant
        */
       type: "color_correct";
     };
@@ -1509,33 +1382,32 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
-       * Color
        * @description The color value
        * @default {
-       *   "r": 0,
-       *   "g": 0,
+       *   "a": 255,
        *   "b": 0,
-       *   "a": 255
+       *   "g": 0,
+       *   "r": 0
        * }
        */
       color?: components["schemas"]["ColorField"];
       /**
-       * Type
+       * type
        * @default color
-       * @enum {string}
+       * @constant
        */
       type: "color";
     };
@@ -1554,50 +1426,44 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default color_map_image_processor
-       * @enum {string}
-       */
-      type: "color_map_image_processor";
       /**
        * Color Map Tile Size
        * @description Tile size
        * @default 64
        */
       color_map_tile_size?: number;
+      /**
+       * type
+       * @default color_map_image_processor
+       * @constant
+       */
+      type: "color_map_image_processor";
     };
     /**
      * ColorOutput
      * @description Base class for nodes that output a single color
      */
     ColorOutput: {
-      /**
-       * Color
-       * @description The output color
-       */
+      /** @description The output color */
       color: components["schemas"]["ColorField"];
       /**
-       * Type
+       * type
        * @default color_output
-       * @enum {string}
+       * @constant
        */
       type: "color_output";
     };
@@ -1616,35 +1482,35 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Prompt
        * @description Prompt to be parsed by Compel to create a conditioning tensor
        * @default
        */
       prompt?: string;
-      /**
-       * Type
-       * @default compel
-       * @enum {string}
-       */
-      type: "compel";
       /**
        * CLIP
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
       clip?: components["schemas"]["ClipField"];
+      /**
+       * type
+       * @default compel
+       * @constant
+       */
+      type: "compel";
     };
     /**
      * Conditioning Collection Primitive
@@ -1661,27 +1527,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The collection of conditioning tensors
        */
       collection?: components["schemas"]["ConditioningField"][];
       /**
-       * Type
+       * type
        * @default conditioning_collection
-       * @enum {string}
+       * @constant
        */
       type: "conditioning_collection";
     };
@@ -1696,9 +1562,9 @@ export type components = {
        */
       collection: components["schemas"]["ConditioningField"][];
       /**
-       * Type
+       * type
        * @default conditioning_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "conditioning_collection_output";
     };
@@ -1728,27 +1594,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Conditioning
-       * @description Conditioning tensor
-       */
+      use_cache?: boolean | null;
+      /** @description Conditioning tensor */
       conditioning?: components["schemas"]["ConditioningField"];
       /**
-       * Type
+       * type
        * @default conditioning
-       * @enum {string}
+       * @constant
        */
       type: "conditioning";
     };
@@ -1757,15 +1620,12 @@ export type components = {
      * @description Base class for nodes that output a single conditioning tensor
      */
     ConditioningOutput: {
-      /**
-       * Conditioning
-       * @description Conditioning tensor
-       */
+      /** @description Conditioning tensor */
       conditioning: components["schemas"]["ConditioningField"];
       /**
-       * Type
+       * type
        * @default conditioning_output
-       * @enum {string}
+       * @constant
        */
       type: "conditioning_output";
     };
@@ -1784,29 +1644,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default content_shuffle_image_processor
-       * @enum {string}
-       */
-      type: "content_shuffle_image_processor";
       /**
        * Detect Resolution
        * @description Pixel resolution for detection
@@ -1837,18 +1688,18 @@ export type components = {
        * @default 256
        */
       f?: number;
+      /**
+       * type
+       * @default content_shuffle_image_processor
+       * @constant
+       */
+      type: "content_shuffle_image_processor";
     };
     /** ControlField */
     ControlField: {
-      /**
-       * Image
-       * @description The control image
-       */
+      /** @description The control image */
       image: components["schemas"]["ImageField"];
-      /**
-       * Control Model
-       * @description The ControlNet model to use
-       */
+      /** @description The ControlNet model to use */
       control_model: components["schemas"]["ControlNetModelField"];
       /**
        * Control Weight
@@ -1898,27 +1749,21 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The control image
-       */
+      use_cache?: boolean | null;
+      /** @description The control image */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Control Model
-       * @description ControlNet model to load
-       */
+      /** @description ControlNet model to load */
       control_model: components["schemas"]["ControlNetModelField"];
       /**
        * Control Weight
@@ -1953,9 +1798,9 @@ export type components = {
        */
       resize_mode?: "just_resize" | "crop_resize" | "fill_resize" | "just_resize_simple";
       /**
-       * Type
+       * type
        * @default controlnet
-       * @enum {string}
+       * @constant
        */
       type: "controlnet";
     };
@@ -1966,19 +1811,20 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default controlnet
+       * @constant
        */
       model_type: "controlnet";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "checkpoint";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       /** Config */
       config: string;
     };
@@ -1989,19 +1835,20 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default controlnet
+       * @constant
        */
       model_type: "controlnet";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "diffusers";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
     };
     /**
      * ControlNetModelField
@@ -2021,15 +1868,12 @@ export type components = {
      * @description node output for ControlNet info
      */
     ControlOutput: {
-      /**
-       * Control
-       * @description ControlNet(s) to apply
-       */
+      /** @description ControlNet(s) to apply */
       control: components["schemas"]["ControlField"];
       /**
-       * Type
+       * type
        * @default control_output
-       * @enum {string}
+       * @constant
        */
       type: "control_output";
     };
@@ -2041,154 +1885,145 @@ export type components = {
       /**
        * App Version
        * @description The version of InvokeAI used to generate this image
-       * @default 3.2.0
+       * @default 3.3.0
        */
       app_version?: string;
       /**
        * Generation Mode
        * @description The generation mode that output this image
        */
-      generation_mode: string;
+      generation_mode?: string | null;
       /**
        * Created By
        * @description The name of the creator of the image
        */
-      created_by?: string;
+      created_by: string | null;
       /**
        * Positive Prompt
        * @description The positive prompt parameter
        */
-      positive_prompt: string;
+      positive_prompt?: string | null;
       /**
        * Negative Prompt
        * @description The negative prompt parameter
        */
-      negative_prompt: string;
+      negative_prompt?: string | null;
       /**
        * Width
        * @description The width parameter
        */
-      width: number;
+      width?: number | null;
       /**
        * Height
        * @description The height parameter
        */
-      height: number;
+      height?: number | null;
       /**
        * Seed
        * @description The seed used for noise generation
        */
-      seed: number;
+      seed?: number | null;
       /**
        * Rand Device
        * @description The device used for random number generation
        */
-      rand_device: string;
+      rand_device?: string | null;
       /**
        * Cfg Scale
        * @description The classifier-free guidance scale parameter
        */
-      cfg_scale: number;
+      cfg_scale?: number | null;
       /**
        * Steps
        * @description The number of steps used for inference
        */
-      steps: number;
+      steps?: number | null;
       /**
        * Scheduler
        * @description The scheduler used for inference
        */
-      scheduler: string;
+      scheduler?: string | null;
       /**
        * Clip Skip
        * @description The number of skipped CLIP layers
        */
-      clip_skip?: number;
-      /**
-       * Model
-       * @description The main model used for inference
-       */
-      model: components["schemas"]["MainModelField"];
+      clip_skip?: number | null;
+      /** @description The main model used for inference */
+      model?: components["schemas"]["MainModelField"] | null;
       /**
        * Controlnets
        * @description The ControlNets used for inference
        */
-      controlnets: components["schemas"]["ControlField"][];
+      controlnets?: components["schemas"]["ControlField"][] | null;
       /**
        * Ipadapters
        * @description The IP Adapters used for inference
        */
-      ipAdapters: components["schemas"]["IPAdapterMetadataField"][];
+      ipAdapters?: components["schemas"]["IPAdapterMetadataField"][] | null;
       /**
        * T2Iadapters
        * @description The IP Adapters used for inference
        */
-      t2iAdapters: components["schemas"]["T2IAdapterField"][];
+      t2iAdapters?: components["schemas"]["T2IAdapterField"][] | null;
       /**
        * Loras
        * @description The LoRAs used for inference
        */
-      loras: components["schemas"]["LoRAMetadataField"][];
-      /**
-       * Vae
-       * @description The VAE used for decoding, if the main model's default was not used
-       */
-      vae?: components["schemas"]["VAEModelField"];
+      loras?: components["schemas"]["LoRAMetadataField"][] | null;
+      /** @description The VAE used for decoding, if the main model's default was not used */
+      vae?: components["schemas"]["VAEModelField"] | null;
       /**
        * Strength
        * @description The strength used for latents-to-latents
        */
-      strength?: number;
+      strength?: number | null;
       /**
        * Init Image
        * @description The name of the initial image
        */
-      init_image?: string;
+      init_image?: string | null;
       /**
        * Positive Style Prompt
        * @description The positive style prompt parameter
        */
-      positive_style_prompt?: string;
+      positive_style_prompt?: string | null;
       /**
        * Negative Style Prompt
        * @description The negative style prompt parameter
        */
-      negative_style_prompt?: string;
-      /**
-       * Refiner Model
-       * @description The SDXL Refiner model used
-       */
-      refiner_model?: components["schemas"]["MainModelField"];
+      negative_style_prompt?: string | null;
+      /** @description The SDXL Refiner model used */
+      refiner_model?: components["schemas"]["MainModelField"] | null;
       /**
        * Refiner Cfg Scale
        * @description The classifier-free guidance scale parameter used for the refiner
        */
-      refiner_cfg_scale?: number;
+      refiner_cfg_scale?: number | null;
       /**
        * Refiner Steps
        * @description The number of steps used for the refiner
        */
-      refiner_steps?: number;
+      refiner_steps?: number | null;
       /**
        * Refiner Scheduler
        * @description The scheduler used for the refiner
        */
-      refiner_scheduler?: string;
+      refiner_scheduler?: string | null;
       /**
        * Refiner Positive Aesthetic Score
        * @description The aesthetic score used for the refiner
        */
-      refiner_positive_aesthetic_score?: number;
+      refiner_positive_aesthetic_score?: number | null;
       /**
        * Refiner Negative Aesthetic Score
        * @description The aesthetic score used for the refiner
        */
-      refiner_negative_aesthetic_score?: number;
+      refiner_negative_aesthetic_score?: number | null;
       /**
        * Refiner Start
        * @description The start value used for refiner denoising
        */
-      refiner_start?: number;
+      refiner_start?: number | null;
     };
     /**
      * Create Denoise Mask
@@ -2205,32 +2040,23 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Vae
-       * @description VAE
-       */
+      use_cache?: boolean | null;
+      /** @description VAE */
       vae?: components["schemas"]["VaeField"];
-      /**
-       * Image
-       * @description Image which will be masked
-       */
-      image?: components["schemas"]["ImageField"];
-      /**
-       * Mask
-       * @description The mask to use when pasting
-       */
+      /** @description Image which will be masked */
+      image?: components["schemas"]["ImageField"] | null;
+      /** @description The mask to use when pasting */
       mask?: components["schemas"]["ImageField"];
       /**
        * Tiled
@@ -2245,16 +2071,13 @@ export type components = {
        */
       fp32?: boolean;
       /**
-       * Type
+       * type
        * @default create_denoise_mask
-       * @enum {string}
+       * @constant
        */
       type: "create_denoise_mask";
     };
-    /**
-     * CursorPaginatedResults[SessionQueueItemDTO]
-     * @description Cursor-paginated results
-     */
+    /** CursorPaginatedResults[SessionQueueItemDTO] */
     CursorPaginatedResults_SessionQueueItemDTO_: {
       /**
        * Limit
@@ -2287,32 +2110,26 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to inpaint
-       */
+      use_cache?: boolean | null;
+      /** @description The image to inpaint */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Mask
-       * @description The mask to use when inpainting
-       */
+      /** @description The mask to use when inpainting */
       mask?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default cv_inpaint
-       * @enum {string}
+       * @constant
        */
       type: "cv_inpaint";
     };
@@ -2354,23 +2171,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Noise
-       * @description Noise tensor
-       */
-      noise?: components["schemas"]["LatentsField"];
+      use_cache?: boolean | null;
+      /** @description Positive conditioning tensor */
+      positive_conditioning?: components["schemas"]["ConditioningField"];
+      /** @description Negative conditioning tensor */
+      negative_conditioning?: components["schemas"]["ConditioningField"];
+      /** @description Noise tensor */
+      noise?: components["schemas"]["LatentsField"] | null;
       /**
        * Steps
        * @description Number of steps to run
@@ -2402,49 +2220,33 @@ export type components = {
        * @enum {string}
        */
       scheduler?: "ddim" | "ddpm" | "deis" | "lms" | "lms_k" | "pndm" | "heun" | "heun_k" | "euler" | "euler_k" | "euler_a" | "kdpm_2" | "kdpm_2_a" | "dpmpp_2s" | "dpmpp_2s_k" | "dpmpp_2m" | "dpmpp_2m_k" | "dpmpp_2m_sde" | "dpmpp_2m_sde_k" | "dpmpp_sde" | "dpmpp_sde_k" | "unipc";
-      /** Control */
-      control?: components["schemas"]["ControlField"] | components["schemas"]["ControlField"][];
-      /**
-       * IP-Adapter
-       * @description IP-Adapter to apply
-       */
-      ip_adapter?: components["schemas"]["IPAdapterField"] | components["schemas"]["IPAdapterField"][];
-      /**
-       * T2I-Adapter
-       * @description T2I-Adapter(s) to apply
-       */
-      t2i_adapter?: components["schemas"]["T2IAdapterField"] | components["schemas"]["T2IAdapterField"][];
-      /**
-       * Latents
-       * @description Latents tensor
-       */
-      latents?: components["schemas"]["LatentsField"];
-      /**
-       * Denoise Mask
-       * @description The mask to use for the operation
-       */
-      denoise_mask?: components["schemas"]["DenoiseMaskField"];
-      /**
-       * Type
-       * @default denoise_latents
-       * @enum {string}
-       */
-      type: "denoise_latents";
-      /**
-       * Positive Conditioning
-       * @description Positive conditioning tensor
-       */
-      positive_conditioning?: components["schemas"]["ConditioningField"];
-      /**
-       * Negative Conditioning
-       * @description Negative conditioning tensor
-       */
-      negative_conditioning?: components["schemas"]["ConditioningField"];
       /**
        * UNet
        * @description UNet (scheduler, LoRAs)
        */
       unet?: components["schemas"]["UNetField"];
+      /** Control */
+      control?: components["schemas"]["ControlField"] | components["schemas"]["ControlField"][] | null;
+      /**
+       * IP-Adapter
+       * @description IP-Adapter to apply
+       */
+      ip_adapter?: components["schemas"]["IPAdapterField"] | components["schemas"]["IPAdapterField"][] | null;
+      /**
+       * T2I-Adapter
+       * @description T2I-Adapter(s) to apply
+       */
+      t2i_adapter?: components["schemas"]["T2IAdapterField"] | components["schemas"]["T2IAdapterField"][] | null;
+      /** @description Latents tensor */
+      latents?: components["schemas"]["LatentsField"] | null;
+      /** @description The mask to use for the operation */
+      denoise_mask?: components["schemas"]["DenoiseMaskField"] | null;
+      /**
+       * type
+       * @default denoise_latents
+       * @constant
+       */
+      type: "denoise_latents";
     };
     /**
      * DenoiseMaskField
@@ -2460,22 +2262,19 @@ export type components = {
        * Masked Latents Name
        * @description The name of the masked image latents
        */
-      masked_latents_name?: string;
+      masked_latents_name: string | null;
     };
     /**
      * DenoiseMaskOutput
      * @description Base class for nodes that output a single image
      */
     DenoiseMaskOutput: {
-      /**
-       * Denoise Mask
-       * @description Mask for denoise model run
-       */
+      /** @description Mask for denoise model run */
       denoise_mask: components["schemas"]["DenoiseMaskField"];
       /**
-       * Type
+       * type
        * @default denoise_mask_output
-       * @enum {string}
+       * @constant
        */
       type: "denoise_mask_output";
     };
@@ -2494,18 +2293,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * A
        * @description The first number
@@ -2519,9 +2318,9 @@ export type components = {
        */
       b?: number;
       /**
-       * Type
+       * type
        * @default div
-       * @enum {string}
+       * @constant
        */
       type: "div";
     };
@@ -2540,18 +2339,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default false
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Prompt
        * @description The prompt to parse with dynamicprompts
@@ -2570,9 +2369,9 @@ export type components = {
        */
       combinatorial?: boolean;
       /**
-       * Type
+       * type
        * @default dynamic_prompt
-       * @enum {string}
+       * @constant
        */
       type: "dynamic_prompt";
     };
@@ -2581,7 +2380,7 @@ export type components = {
       /** Prompts */
       prompts: string[];
       /** Error */
-      error?: string;
+      error?: string | null;
     };
     /**
      * Upscale (RealESRGAN)
@@ -2598,22 +2397,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The input image
-       */
+      use_cache?: boolean | null;
+      /** @description The input image */
       image?: components["schemas"]["ImageField"];
       /**
        * Model Name
@@ -2629,23 +2425,17 @@ export type components = {
        */
       tile_size?: number;
       /**
-       * Type
+       * type
        * @default esrgan
-       * @enum {string}
+       * @constant
        */
       type: "esrgan";
     };
     /** Edge */
     Edge: {
-      /**
-       * Source
-       * @description The connection for the edge's from node and field
-       */
+      /** @description The connection for the edge's from node and field */
       source: components["schemas"]["EdgeConnection"];
-      /**
-       * Destination
-       * @description The connection for the edge's to node and field
-       */
+      /** @description The connection for the edge's to node and field */
       destination: components["schemas"]["EdgeConnection"];
     };
     /** EdgeConnection */
@@ -2678,10 +2468,7 @@ export type components = {
        * @description The total number of queue items requested to be enqueued
        */
       requested: number;
-      /**
-       * Batch
-       * @description The batch that was enqueued
-       */
+      /** @description The batch that was enqueued */
       batch: components["schemas"]["Batch"];
       /**
        * Priority
@@ -2701,20 +2488,14 @@ export type components = {
        * @description The total number of queue items requested to be enqueued
        */
       requested: number;
-      /**
-       * Batch
-       * @description The batch that was enqueued
-       */
+      /** @description The batch that was enqueued */
       batch: components["schemas"]["Batch"];
       /**
        * Priority
        * @description The priority of the enqueued batch
        */
       priority: number;
-      /**
-       * Queue Item
-       * @description The queue item that was enqueued
-       */
+      /** @description The queue item that was enqueued */
       queue_item: components["schemas"]["SessionQueueItemDTO"];
     };
     /**
@@ -2732,22 +2513,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description Image to face detect
-       */
+      use_cache?: boolean | null;
+      /** @description Image to face detect */
       image?: components["schemas"]["ImageField"];
       /**
        * Minimum Confidence
@@ -2762,9 +2540,9 @@ export type components = {
        */
       chunk?: boolean;
       /**
-       * Type
+       * type
        * @default face_identifier
-       * @enum {string}
+       * @constant
        */
       type: "face_identifier";
     };
@@ -2783,22 +2561,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description Image to face detect
-       */
+      use_cache?: boolean | null;
+      /** @description Image to face detect */
       image?: components["schemas"]["ImageField"];
       /**
        * Face Ids
@@ -2837,9 +2612,9 @@ export type components = {
        */
       invert_mask?: boolean;
       /**
-       * Type
+       * type
        * @default face_mask_detection
-       * @enum {string}
+       * @constant
        */
       type: "face_mask_detection";
     };
@@ -2848,10 +2623,7 @@ export type components = {
      * @description Base class for FaceMask output
      */
     FaceMaskOutput: {
-      /**
-       * Image
-       * @description The output image
-       */
+      /** @description The output image */
       image: components["schemas"]["ImageField"];
       /**
        * Width
@@ -2864,15 +2636,12 @@ export type components = {
        */
       height: number;
       /**
-       * Type
+       * type
        * @default face_mask_output
-       * @enum {string}
+       * @constant
        */
       type: "face_mask_output";
-      /**
-       * Mask
-       * @description The output mask
-       */
+      /** @description The output mask */
       mask: components["schemas"]["ImageField"];
     };
     /**
@@ -2890,22 +2659,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description Image for face detection
-       */
+      use_cache?: boolean | null;
+      /** @description Image for face detection */
       image?: components["schemas"]["ImageField"];
       /**
        * Face Id
@@ -2944,9 +2710,9 @@ export type components = {
        */
       chunk?: boolean;
       /**
-       * Type
+       * type
        * @default face_off
-       * @enum {string}
+       * @constant
        */
       type: "face_off";
     };
@@ -2955,10 +2721,7 @@ export type components = {
      * @description Base class for FaceOff Output
      */
     FaceOffOutput: {
-      /**
-       * Image
-       * @description The output image
-       */
+      /** @description The output image */
       image: components["schemas"]["ImageField"];
       /**
        * Width
@@ -2971,15 +2734,12 @@ export type components = {
        */
       height: number;
       /**
-       * Type
+       * type
        * @default face_off_output
-       * @enum {string}
+       * @constant
        */
       type: "face_off_output";
-      /**
-       * Mask
-       * @description The output mask
-       */
+      /** @description The output mask */
       mask: components["schemas"]["ImageField"];
       /**
        * X
@@ -3007,27 +2767,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The collection of float values
        */
       collection?: number[];
       /**
-       * Type
+       * type
        * @default float_collection
-       * @enum {string}
+       * @constant
        */
       type: "float_collection";
     };
@@ -3042,9 +2802,9 @@ export type components = {
        */
       collection: number[];
       /**
-       * Type
+       * type
        * @default float_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "float_collection_output";
     };
@@ -3063,18 +2823,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Value
        * @description The float value
@@ -3082,9 +2842,9 @@ export type components = {
        */
       value?: number;
       /**
-       * Type
+       * type
        * @default float
-       * @enum {string}
+       * @constant
        */
       type: "float";
     };
@@ -3103,18 +2863,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Start
        * @description The first value of the range
@@ -3134,9 +2894,9 @@ export type components = {
        */
       steps?: number;
       /**
-       * Type
+       * type
        * @default float_range
-       * @enum {string}
+       * @constant
        */
       type: "float_range";
     };
@@ -3155,18 +2915,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Operation
        * @description The operation to perform
@@ -3187,9 +2947,9 @@ export type components = {
        */
       b?: number;
       /**
-       * Type
+       * type
        * @default float_math
-       * @enum {string}
+       * @constant
        */
       type: "float_math";
     };
@@ -3204,9 +2964,9 @@ export type components = {
        */
       value: number;
       /**
-       * Type
+       * type
        * @default float_output
-       * @enum {string}
+       * @constant
        */
       type: "float_output";
     };
@@ -3225,18 +2985,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Value
        * @description The value to round
@@ -3257,9 +3017,9 @@ export type components = {
        */
       method?: "Nearest" | "Floor" | "Ceiling" | "Truncate";
       /**
-       * Type
+       * type
        * @default float_to_int
-       * @enum {string}
+       * @constant
        */
       type: "float_to_int";
     };
@@ -3275,7 +3035,7 @@ export type components = {
        * @description The nodes in this graph
        */
       nodes?: {
-        [key: string]: components["schemas"]["BooleanInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["ColorMapImageProcessorInvocation"];
+        [key: string]: components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["StringInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["ColorMapImageProcessorInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["FloatInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["MainModelLoaderInvocation"];
       };
       /**
        * Edges
@@ -3293,15 +3053,9 @@ export type components = {
        * @description The id of the execution state
        */
       id: string;
-      /**
-       * Graph
-       * @description The graph being executed
-       */
+      /** @description The graph being executed */
       graph: components["schemas"]["Graph"];
-      /**
-       * Execution Graph
-       * @description The expanded graph of activated and executed nodes
-       */
+      /** @description The expanded graph of activated and executed nodes */
       execution_graph: components["schemas"]["Graph"];
       /**
        * Executed
@@ -3318,7 +3072,7 @@ export type components = {
        * @description The results of node executions
        */
       results: {
-        [key: string]: components["schemas"]["BooleanOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["SDXLLoraLoaderOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["SchedulerOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["StringPosNegOutput"] | components["schemas"]["String2Output"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["FaceOffOutput"];
+        [key: string]: components["schemas"]["SDXLLoraLoaderOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["String2Output"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["BooleanOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["FaceOffOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["StringPosNegOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SchedulerOutput"];
       };
       /**
        * Errors
@@ -3357,41 +3111,33 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Graph
-       * @description The graph to run
-       */
+      use_cache?: boolean | null;
+      /** @description The graph to run */
       graph?: components["schemas"]["Graph"];
       /**
-       * Type
+       * type
        * @default graph
-       * @enum {string}
+       * @constant
        */
       type: "graph";
     };
-    /**
-     * GraphInvocationOutput
-     * @description Base class for all invocation outputs.
-     *
-     * All invocation outputs must use the `@invocation_output` decorator to provide their unique type.
-     */
+    /** GraphInvocationOutput */
     GraphInvocationOutput: {
       /**
-       * Type
+       * type
        * @default graph_output
-       * @enum {string}
+       * @constant
        */
       type: "graph_output";
     };
@@ -3415,29 +3161,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default hed_image_processor
-       * @enum {string}
-       */
-      type: "hed_image_processor";
       /**
        * Detect Resolution
        * @description Pixel resolution for detection
@@ -3456,23 +3193,20 @@ export type components = {
        * @default false
        */
       scribble?: boolean;
+      /**
+       * type
+       * @default hed_image_processor
+       * @constant
+       */
+      type: "hed_image_processor";
     };
     /** IPAdapterField */
     IPAdapterField: {
-      /**
-       * Image
-       * @description The IP-Adapter image prompt.
-       */
+      /** @description The IP-Adapter image prompt. */
       image: components["schemas"]["ImageField"];
-      /**
-       * Ip Adapter Model
-       * @description The IP-Adapter model to use.
-       */
+      /** @description The IP-Adapter model to use. */
       ip_adapter_model: components["schemas"]["IPAdapterModelField"];
-      /**
-       * Image Encoder Model
-       * @description The name of the CLIP image encoder model.
-       */
+      /** @description The name of the CLIP image encoder model. */
       image_encoder_model: components["schemas"]["CLIPVisionModelField"];
       /**
        * Weight
@@ -3508,22 +3242,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The IP-Adapter image prompt.
-       */
+      use_cache?: boolean | null;
+      /** @description The IP-Adapter image prompt. */
       image?: components["schemas"]["ImageField"];
       /**
        * IP-Adapter Model
@@ -3549,23 +3280,17 @@ export type components = {
        */
       end_step_percent?: number;
       /**
-       * Type
+       * type
        * @default ip_adapter
-       * @enum {string}
+       * @constant
        */
       type: "ip_adapter";
     };
     /** IPAdapterMetadataField */
     IPAdapterMetadataField: {
-      /**
-       * Image
-       * @description The IP-Adapter image prompt.
-       */
+      /** @description The IP-Adapter image prompt. */
       image: components["schemas"]["ImageField"];
-      /**
-       * Ip Adapter Model
-       * @description The IP-Adapter model to use.
-       */
+      /** @description The IP-Adapter model to use. */
       ip_adapter_model: components["schemas"]["IPAdapterModelField"];
       /**
        * Weight
@@ -3602,26 +3327,22 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default ip_adapter
+       * @constant
        */
       model_type: "ip_adapter";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "invokeai";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
     };
-    /**
-     * IPAdapterOutput
-     * @description Base class for all invocation outputs.
-     *
-     * All invocation outputs must use the `@invocation_output` decorator to provide their unique type.
-     */
+    /** IPAdapterOutput */
     IPAdapterOutput: {
       /**
        * IP-Adapter
@@ -3629,9 +3350,9 @@ export type components = {
        */
       ip_adapter: components["schemas"]["IPAdapterField"];
       /**
-       * Type
+       * type
        * @default ip_adapter_output
-       * @enum {string}
+       * @constant
        */
       type: "ip_adapter_output";
     };
@@ -3650,22 +3371,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to blur
-       */
+      use_cache?: boolean | null;
+      /** @description The image to blur */
       image?: components["schemas"]["ImageField"];
       /**
        * Radius
@@ -3681,9 +3399,9 @@ export type components = {
        */
       blur_type?: "gaussian" | "box";
       /**
-       * Type
+       * type
        * @default img_blur
-       * @enum {string}
+       * @constant
        */
       type: "img_blur";
     };
@@ -3714,22 +3432,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to get the channel from
-       */
+      use_cache?: boolean | null;
+      /** @description The image to get the channel from */
       image?: components["schemas"]["ImageField"];
       /**
        * Channel
@@ -3739,9 +3454,9 @@ export type components = {
        */
       channel?: "A" | "R" | "G" | "B";
       /**
-       * Type
+       * type
        * @default img_chan
-       * @enum {string}
+       * @constant
        */
       type: "img_chan";
     };
@@ -3760,22 +3475,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to adjust
-       */
+      use_cache?: boolean | null;
+      /** @description The image to adjust */
       image?: components["schemas"]["ImageField"];
       /**
        * Channel
@@ -3796,9 +3508,9 @@ export type components = {
        */
       invert_channel?: boolean;
       /**
-       * Type
+       * type
        * @default img_channel_multiply
-       * @enum {string}
+       * @constant
        */
       type: "img_channel_multiply";
     };
@@ -3817,22 +3529,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to adjust
-       */
+      use_cache?: boolean | null;
+      /** @description The image to adjust */
       image?: components["schemas"]["ImageField"];
       /**
        * Channel
@@ -3847,9 +3556,9 @@ export type components = {
        */
       offset?: number;
       /**
-       * Type
+       * type
        * @default img_channel_offset
-       * @enum {string}
+       * @constant
        */
       type: "img_channel_offset";
     };
@@ -3868,27 +3577,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The collection of image values
        */
       collection?: components["schemas"]["ImageField"][];
       /**
-       * Type
+       * type
        * @default image_collection
-       * @enum {string}
+       * @constant
        */
       type: "image_collection";
     };
@@ -3903,9 +3612,9 @@ export type components = {
        */
       collection: components["schemas"]["ImageField"][];
       /**
-       * Type
+       * type
        * @default image_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "image_collection_output";
     };
@@ -3924,22 +3633,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to convert
-       */
+      use_cache?: boolean | null;
+      /** @description The image to convert */
       image?: components["schemas"]["ImageField"];
       /**
        * Mode
@@ -3949,9 +3655,9 @@ export type components = {
        */
       mode?: "L" | "RGB" | "RGBA" | "CMYK" | "YCbCr" | "LAB" | "HSV" | "I" | "F";
       /**
-       * Type
+       * type
        * @default img_conv
-       * @enum {string}
+       * @constant
        */
       type: "img_conv";
     };
@@ -3970,22 +3676,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to crop
-       */
+      use_cache?: boolean | null;
+      /** @description The image to crop */
       image?: components["schemas"]["ImageField"];
       /**
        * X
@@ -4012,9 +3715,9 @@ export type components = {
        */
       height?: number;
       /**
-       * Type
+       * type
        * @default img_crop
-       * @enum {string}
+       * @constant
        */
       type: "img_crop";
     };
@@ -4066,7 +3769,7 @@ export type components = {
        * Deleted At
        * @description The deleted timestamp of the image.
        */
-      deleted_at?: string;
+      deleted_at?: string | null;
       /**
        * Is Intermediate
        * @description Whether this is an intermediate image.
@@ -4076,12 +3779,12 @@ export type components = {
        * Session Id
        * @description The session ID that generated this image, if it is a generated image.
        */
-      session_id?: string;
+      session_id?: string | null;
       /**
        * Node Id
        * @description The node ID that generated this image, if it is a generated image.
        */
-      node_id?: string;
+      node_id?: string | null;
       /**
        * Starred
        * @description Whether this image is starred.
@@ -4091,7 +3794,7 @@ export type components = {
        * Board Id
        * @description The id of the board the image belongs to, if one exists.
        */
-      board_id?: string;
+      board_id?: string | null;
     };
     /**
      * ImageField
@@ -4119,22 +3822,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to adjust
-       */
+      use_cache?: boolean | null;
+      /** @description The image to adjust */
       image?: components["schemas"]["ImageField"];
       /**
        * Hue
@@ -4143,9 +3843,9 @@ export type components = {
        */
       hue?: number;
       /**
-       * Type
+       * type
        * @default img_hue_adjust
-       * @enum {string}
+       * @constant
        */
       type: "img_hue_adjust";
     };
@@ -4164,22 +3864,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to lerp
-       */
+      use_cache?: boolean | null;
+      /** @description The image to lerp */
       image?: components["schemas"]["ImageField"];
       /**
        * Min
@@ -4194,9 +3891,9 @@ export type components = {
        */
       max?: number;
       /**
-       * Type
+       * type
        * @default img_ilerp
-       * @enum {string}
+       * @constant
        */
       type: "img_ilerp";
     };
@@ -4215,27 +3912,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to load
-       */
+      use_cache?: boolean | null;
+      /** @description The image to load */
       image?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default image
-       * @enum {string}
+       * @constant
        */
       type: "image";
     };
@@ -4254,22 +3948,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to lerp
-       */
+      use_cache?: boolean | null;
+      /** @description The image to lerp */
       image?: components["schemas"]["ImageField"];
       /**
        * Min
@@ -4284,9 +3975,9 @@ export type components = {
        */
       max?: number;
       /**
-       * Type
+       * type
        * @default img_lerp
-       * @enum {string}
+       * @constant
        */
       type: "img_lerp";
     };
@@ -4299,12 +3990,12 @@ export type components = {
        * Metadata
        * @description The image's core metadata, if it was created in the Linear or Canvas UI
        */
-      metadata?: Record<string, never>;
+      metadata?: Record<string, never> | null;
       /**
        * Graph
        * @description The graph that created the image
        */
-      graph?: Record<string, never>;
+      graph?: Record<string, never> | null;
     };
     /**
      * Multiply Images
@@ -4321,32 +4012,26 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image1
-       * @description The first image to multiply
-       */
+      use_cache?: boolean | null;
+      /** @description The first image to multiply */
       image1?: components["schemas"]["ImageField"];
-      /**
-       * Image2
-       * @description The second image to multiply
-       */
+      /** @description The second image to multiply */
       image2?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default img_mul
-       * @enum {string}
+       * @constant
        */
       type: "img_mul";
     };
@@ -4365,44 +4050,35 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
+      /** @description The image to check */
+      image?: components["schemas"]["ImageField"];
+      /** @description Optional core metadata to be written to image */
+      metadata?: components["schemas"]["CoreMetadata"] | null;
       /**
-       * Metadata
-       * @description Optional core metadata to be written to image
-       */
-      metadata?: components["schemas"]["CoreMetadata"];
-      /**
-       * Type
+       * type
        * @default img_nsfw
-       * @enum {string}
+       * @constant
        */
       type: "img_nsfw";
-      /**
-       * Image
-       * @description The image to check
-       */
-      image?: components["schemas"]["ImageField"];
     };
     /**
      * ImageOutput
      * @description Base class for nodes that output a single image
      */
     ImageOutput: {
-      /**
-       * Image
-       * @description The output image
-       */
+      /** @description The output image */
       image: components["schemas"]["ImageField"];
       /**
        * Width
@@ -4415,9 +4091,9 @@ export type components = {
        */
       height: number;
       /**
-       * Type
+       * type
        * @default image_output
-       * @enum {string}
+       * @constant
        */
       type: "image_output";
     };
@@ -4436,33 +4112,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Base Image
-       * @description The base image
-       */
+      use_cache?: boolean | null;
+      /** @description The base image */
       base_image?: components["schemas"]["ImageField"];
-      /**
-       * Image
-       * @description The image to paste
-       */
+      /** @description The image to paste */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Mask
-       * @description The mask to use when pasting
-       */
-      mask?: components["schemas"]["ImageField"];
+      /** @description The mask to use when pasting */
+      mask?: components["schemas"]["ImageField"] | null;
       /**
        * X
        * @description The left x coordinate at which to paste the image
@@ -4482,51 +4149,12 @@ export type components = {
        */
       crop?: boolean;
       /**
-       * Type
+       * type
        * @default img_paste
-       * @enum {string}
+       * @constant
        */
       type: "img_paste";
     };
-    /**
-     * Base Image Processor
-     * @description Base class for invocations that preprocess images for ControlNet
-     */
-    ImageProcessorInvocation: {
-      /**
-       * Id
-       * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
-       */
-      id: string;
-      /**
-       * Is Intermediate
-       * @description Whether or not this is an intermediate invocation.
-       * @default false
-       */
-      is_intermediate?: boolean;
-      /**
-       * Workflow
-       * @description The workflow to save with the image
-       */
-      workflow?: string;
-      /**
-       * Use Cache
-       * @description Whether or not to use the cache
-       * @default true
-       */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
-      image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default image_processor
-       * @enum {string}
-       */
-      type: "image_processor";
-    };
     /**
      * ImageRecordChanges
      * @description A set of changes to apply to an image record.
@@ -4539,22 +4167,23 @@ export type components = {
      */
     ImageRecordChanges: {
       /** @description The image's new category. */
-      image_category?: components["schemas"]["ImageCategory"];
+      image_category?: components["schemas"]["ImageCategory"] | null;
       /**
        * Session Id
        * @description The image's new session ID.
        */
-      session_id?: string;
+      session_id?: string | null;
       /**
        * Is Intermediate
        * @description The image's new `is_intermediate` flag.
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Starred
        * @description The image's new `starred` state
        */
-      starred?: boolean;
+      starred?: boolean | null;
+      [key: string]: unknown;
     };
     /**
      * Resize Image
@@ -4571,22 +4200,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to resize
-       */
+      use_cache?: boolean | null;
+      /** @description The image to resize */
       image?: components["schemas"]["ImageField"];
       /**
        * Width
@@ -4607,15 +4233,12 @@ export type components = {
        * @enum {string}
        */
       resample_mode?: "nearest" | "box" | "bilinear" | "hamming" | "bicubic" | "lanczos";
+      /** @description Optional core metadata to be written to image */
+      metadata?: components["schemas"]["CoreMetadata"] | null;
       /**
-       * Metadata
-       * @description Optional core metadata to be written to image
-       */
-      metadata?: components["schemas"]["CoreMetadata"];
-      /**
-       * Type
+       * type
        * @default img_resize
-       * @enum {string}
+       * @constant
        */
       type: "img_resize";
     };
@@ -4634,22 +4257,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to scale
-       */
+      use_cache?: boolean | null;
+      /** @description The image to scale */
       image?: components["schemas"]["ImageField"];
       /**
        * Scale Factor
@@ -4665,9 +4285,9 @@ export type components = {
        */
       resample_mode?: "nearest" | "box" | "bilinear" | "hamming" | "bicubic" | "lanczos";
       /**
-       * Type
+       * type
        * @default img_scale
-       * @enum {string}
+       * @constant
        */
       type: "img_scale";
     };
@@ -4686,27 +4306,21 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to encode
-       */
+      use_cache?: boolean | null;
+      /** @description The image to encode */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Vae
-       * @description VAE
-       */
+      /** @description VAE */
       vae?: components["schemas"]["VaeField"];
       /**
        * Tiled
@@ -4721,9 +4335,9 @@ export type components = {
        */
       fp32?: boolean;
       /**
-       * Type
+       * type
        * @default i2l
-       * @enum {string}
+       * @constant
        */
       type: "i2l";
     };
@@ -4763,22 +4377,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to check
-       */
+      use_cache?: boolean | null;
+      /** @description The image to check */
       image?: components["schemas"]["ImageField"];
       /**
        * Text
@@ -4786,18 +4397,23 @@ export type components = {
        * @default InvokeAI
        */
       text?: string;
+      /** @description Optional core metadata to be written to image */
+      metadata?: components["schemas"]["CoreMetadata"] | null;
       /**
-       * Metadata
-       * @description Optional core metadata to be written to image
-       */
-      metadata?: components["schemas"]["CoreMetadata"];
-      /**
-       * Type
+       * type
        * @default img_watermark
-       * @enum {string}
+       * @constant
        */
       type: "img_watermark";
     };
+    /** ImagesDownloaded */
+    ImagesDownloaded: {
+      /**
+       * Response
+       * @description If defined, the message to display to the user when images begin downloading
+       */
+      response: string | null;
+    };
     /** ImagesUpdatedFromListResult */
     ImagesUpdatedFromListResult: {
       /**
@@ -4821,38 +4437,34 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to infill
-       */
+      use_cache?: boolean | null;
+      /** @description The image to infill */
       image?: components["schemas"]["ImageField"];
       /**
-       * Color
        * @description The color to use to infill
        * @default {
-       *   "r": 127,
-       *   "g": 127,
+       *   "a": 255,
        *   "b": 127,
-       *   "a": 255
+       *   "g": 127,
+       *   "r": 127
        * }
        */
       color?: components["schemas"]["ColorField"];
       /**
-       * Type
+       * type
        * @default infill_rgba
-       * @enum {string}
+       * @constant
        */
       type: "infill_rgba";
     };
@@ -4871,22 +4483,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to infill
-       */
+      use_cache?: boolean | null;
+      /** @description The image to infill */
       image?: components["schemas"]["ImageField"];
       /**
        * Downscale
@@ -4902,9 +4511,9 @@ export type components = {
        */
       resample_mode?: "nearest" | "box" | "bilinear" | "hamming" | "bicubic" | "lanczos";
       /**
-       * Type
+       * type
        * @default infill_patchmatch
-       * @enum {string}
+       * @constant
        */
       type: "infill_patchmatch";
     };
@@ -4923,22 +4532,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to infill
-       */
+      use_cache?: boolean | null;
+      /** @description The image to infill */
       image?: components["schemas"]["ImageField"];
       /**
        * Tile Size
@@ -4952,9 +4558,9 @@ export type components = {
        */
       seed?: number;
       /**
-       * Type
+       * type
        * @default infill_tile
-       * @enum {string}
+       * @constant
        */
       type: "infill_tile";
     };
@@ -4973,27 +4579,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The collection of integer values
        */
       collection?: number[];
       /**
-       * Type
+       * type
        * @default integer_collection
-       * @enum {string}
+       * @constant
        */
       type: "integer_collection";
     };
@@ -5008,9 +4614,9 @@ export type components = {
        */
       collection: number[];
       /**
-       * Type
+       * type
        * @default integer_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "integer_collection_output";
     };
@@ -5029,18 +4635,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Value
        * @description The integer value
@@ -5048,9 +4654,9 @@ export type components = {
        */
       value?: number;
       /**
-       * Type
+       * type
        * @default integer
-       * @enum {string}
+       * @constant
        */
       type: "integer";
     };
@@ -5069,18 +4675,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Operation
        * @description The operation to perform
@@ -5101,9 +4707,9 @@ export type components = {
        */
       b?: number;
       /**
-       * Type
+       * type
        * @default integer_math
-       * @enum {string}
+       * @constant
        */
       type: "integer_math";
     };
@@ -5118,9 +4724,9 @@ export type components = {
        */
       value: number;
       /**
-       * Type
+       * type
        * @default integer_output
-       * @enum {string}
+       * @constant
        */
       type: "integer_output";
     };
@@ -5167,18 +4773,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The list of items to iterate over
@@ -5191,9 +4797,9 @@ export type components = {
        */
       index?: number;
       /**
-       * Type
+       * type
        * @default iterate
-       * @enum {string}
+       * @constant
        */
       type: "iterate";
     };
@@ -5206,11 +4812,11 @@ export type components = {
        * Collection Item
        * @description The item being iterated over
        */
-      item?: unknown;
+      item: unknown;
       /**
-       * Type
+       * type
        * @default iterate_output
-       * @enum {string}
+       * @constant
        */
       type: "iterate_output";
     };
@@ -5229,27 +4835,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to infill
-       */
+      use_cache?: boolean | null;
+      /** @description The image to infill */
       image?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default infill_lama
-       * @enum {string}
+       * @constant
        */
       type: "infill_lama";
     };
@@ -5268,27 +4871,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The collection of latents tensors
        */
       collection?: components["schemas"]["LatentsField"][];
       /**
-       * Type
+       * type
        * @default latents_collection
-       * @enum {string}
+       * @constant
        */
       type: "latents_collection";
     };
@@ -5303,9 +4906,9 @@ export type components = {
        */
       collection: components["schemas"]["LatentsField"][];
       /**
-       * Type
+       * type
        * @default latents_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "latents_collection_output";
     };
@@ -5323,7 +4926,7 @@ export type components = {
        * Seed
        * @description Seed used to generate this latents
        */
-      seed?: number;
+      seed?: number | null;
     };
     /**
      * Latents Primitive
@@ -5340,27 +4943,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Latents
-       * @description The latents tensor
-       */
+      use_cache?: boolean | null;
+      /** @description The latents tensor */
       latents?: components["schemas"]["LatentsField"];
       /**
-       * Type
+       * type
        * @default latents
-       * @enum {string}
+       * @constant
        */
       type: "latents";
     };
@@ -5369,10 +4969,7 @@ export type components = {
      * @description Base class for nodes that output a single latents tensor
      */
     LatentsOutput: {
-      /**
-       * Latents
-       * @description Latents tensor
-       */
+      /** @description Latents tensor */
       latents: components["schemas"]["LatentsField"];
       /**
        * Width
@@ -5385,9 +4982,9 @@ export type components = {
        */
       height: number;
       /**
-       * Type
+       * type
        * @default latents_output
-       * @enum {string}
+       * @constant
        */
       type: "latents_output";
     };
@@ -5406,18 +5003,22 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
+      /** @description Latents tensor */
+      latents?: components["schemas"]["LatentsField"];
+      /** @description VAE */
+      vae?: components["schemas"]["VaeField"];
       /**
        * Tiled
        * @description Processing using overlapping tiles (reduce memory consumption)
@@ -5430,27 +5031,14 @@ export type components = {
        * @default false
        */
       fp32?: boolean;
+      /** @description Optional core metadata to be written to image */
+      metadata?: components["schemas"]["CoreMetadata"] | null;
       /**
-       * Metadata
-       * @description Optional core metadata to be written to image
-       */
-      metadata?: components["schemas"]["CoreMetadata"];
-      /**
-       * Type
+       * type
        * @default l2i
-       * @enum {string}
+       * @constant
        */
       type: "l2i";
-      /**
-       * Latents
-       * @description Latents tensor
-       */
-      latents?: components["schemas"]["LatentsField"];
-      /**
-       * Vae
-       * @description VAE
-       */
-      vae?: components["schemas"]["VaeField"];
     };
     /**
      * Leres (Depth) Processor
@@ -5467,29 +5055,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default leres_image_processor
-       * @enum {string}
-       */
-      type: "leres_image_processor";
       /**
        * Thr A
        * @description Leres parameter `thr_a`
@@ -5520,6 +5099,12 @@ export type components = {
        * @default 512
        */
       image_resolution?: number;
+      /**
+       * type
+       * @default leres_image_processor
+       * @constant
+       */
+      type: "leres_image_processor";
     };
     /**
      * Lineart Anime Processor
@@ -5536,29 +5121,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default lineart_anime_image_processor
-       * @enum {string}
-       */
-      type: "lineart_anime_image_processor";
       /**
        * Detect Resolution
        * @description Pixel resolution for detection
@@ -5571,6 +5147,12 @@ export type components = {
        * @default 512
        */
       image_resolution?: number;
+      /**
+       * type
+       * @default lineart_anime_image_processor
+       * @constant
+       */
+      type: "lineart_anime_image_processor";
     };
     /**
      * Lineart Processor
@@ -5587,29 +5169,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default lineart_image_processor
-       * @enum {string}
-       */
-      type: "lineart_image_processor";
       /**
        * Detect Resolution
        * @description Pixel resolution for detection
@@ -5628,16 +5201,19 @@ export type components = {
        * @default false
        */
       coarse?: boolean;
+      /**
+       * type
+       * @default lineart_image_processor
+       * @constant
+       */
+      type: "lineart_image_processor";
     };
     /**
      * LoRAMetadataField
      * @description LoRA metadata for an image generated in InvokeAI.
      */
     LoRAMetadataField: {
-      /**
-       * Lora
-       * @description The LoRA model
-       */
+      /** @description The LoRA model */
       lora: components["schemas"]["LoRAModelField"];
       /**
        * Weight
@@ -5652,15 +5228,16 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default lora
+       * @constant
        */
       model_type: "lora";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       model_format: components["schemas"]["LoRAModelFormat"];
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
     };
     /**
      * LoRAModelField
@@ -5677,13 +5254,11 @@ export type components = {
     };
     /**
      * LoRAModelFormat
-     * @description An enumeration.
      * @enum {string}
      */
     LoRAModelFormat: "lycoris" | "diffusers";
     /**
      * LogLevel
-     * @description An enumeration.
      * @enum {integer}
      */
     LogLevel: 0 | 10 | 20 | 30 | 40 | 50;
@@ -5699,7 +5274,7 @@ export type components = {
       /** @description Info to load submodel */
       model_type: components["schemas"]["ModelType"];
       /** @description Info to load submodel */
-      submodel?: components["schemas"]["SubModelType"];
+      submodel?: components["schemas"]["SubModelType"] | null;
       /**
        * Weight
        * @description Lora's weight which to use when apply to model
@@ -5721,18 +5296,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * LoRA
        * @description LoRA model to load
@@ -5748,16 +5323,16 @@ export type components = {
        * UNet
        * @description UNet (scheduler, LoRAs)
        */
-      unet?: components["schemas"]["UNetField"];
+      unet?: components["schemas"]["UNetField"] | null;
       /**
        * CLIP
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
-      clip?: components["schemas"]["ClipField"];
+      clip?: components["schemas"]["ClipField"] | null;
       /**
-       * Type
+       * type
        * @default lora_loader
-       * @enum {string}
+       * @constant
        */
       type: "lora_loader";
     };
@@ -5770,16 +5345,16 @@ export type components = {
        * UNet
        * @description UNet (scheduler, LoRAs)
        */
-      unet?: components["schemas"]["UNetField"];
+      unet?: components["schemas"]["UNetField"] | null;
       /**
        * CLIP
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
-      clip?: components["schemas"]["ClipField"];
+      clip?: components["schemas"]["ClipField"] | null;
       /**
-       * Type
+       * type
        * @default lora_loader_output
-       * @enum {string}
+       * @constant
        */
       type: "lora_loader_output";
     };
@@ -5813,27 +5388,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Model
-       * @description Main model (UNet, VAE, CLIP) to load
-       */
+      use_cache?: boolean | null;
+      /** @description Main model (UNet, VAE, CLIP) to load */
       model: components["schemas"]["MainModelField"];
       /**
-       * Type
+       * type
        * @default main_model_loader
-       * @enum {string}
+       * @constant
        */
       type: "main_model_loader";
     };
@@ -5852,32 +5424,26 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Mask1
-       * @description The first mask to combine
-       */
+      use_cache?: boolean | null;
+      /** @description The first mask to combine */
       mask1?: components["schemas"]["ImageField"];
-      /**
-       * Mask2
-       * @description The second image to combine
-       */
+      /** @description The second image to combine */
       mask2?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default mask_combine
-       * @enum {string}
+       * @constant
        */
       type: "mask_combine";
     };
@@ -5896,22 +5462,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to apply the mask to
-       */
+      use_cache?: boolean | null;
+      /** @description The image to apply the mask to */
       image?: components["schemas"]["ImageField"];
       /**
        * Edge Size
@@ -5934,9 +5497,9 @@ export type components = {
        */
       high_threshold?: number;
       /**
-       * Type
+       * type
        * @default mask_edge
-       * @enum {string}
+       * @constant
        */
       type: "mask_edge";
     };
@@ -5955,22 +5518,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to create the mask from
-       */
+      use_cache?: boolean | null;
+      /** @description The image to create the mask from */
       image?: components["schemas"]["ImageField"];
       /**
        * Invert
@@ -5979,9 +5539,9 @@ export type components = {
        */
       invert?: boolean;
       /**
-       * Type
+       * type
        * @default tomask
-       * @enum {string}
+       * @constant
        */
       type: "tomask";
     };
@@ -6000,29 +5560,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default mediapipe_face_processor
-       * @enum {string}
-       */
-      type: "mediapipe_face_processor";
       /**
        * Max Faces
        * @description Maximum number of faces to detect
@@ -6035,13 +5586,50 @@ export type components = {
        * @default 0.5
        */
       min_confidence?: number;
+      /**
+       * type
+       * @default mediapipe_face_processor
+       * @constant
+       */
+      type: "mediapipe_face_processor";
     };
     /**
      * MergeInterpolationMethod
-     * @description An enumeration.
      * @enum {string}
      */
     MergeInterpolationMethod: "weighted_sum" | "sigmoid" | "inv_sigmoid" | "add_difference";
+    /** MergeModelsBody */
+    MergeModelsBody: {
+      /**
+       * Model Names
+       * @description model name
+       */
+      model_names: string[];
+      /**
+       * Merged Model Name
+       * @description Name of destination model
+       */
+      merged_model_name: string | null;
+      /**
+       * Alpha
+       * @description Alpha weighting strength to apply to 2d and 3d models
+       * @default 0.5
+       */
+      alpha?: number | null;
+      /** @description Interpolation method */
+      interp: components["schemas"]["MergeInterpolationMethod"] | null;
+      /**
+       * Force
+       * @description Force merging of models created with different versions of diffusers
+       * @default false
+       */
+      force?: boolean | null;
+      /**
+       * Merge Dest Directory
+       * @description Save the merged model to the designated directory (with 'merged_model_name' appended)
+       */
+      merge_dest_directory?: string | null;
+    };
     /**
      * Metadata Accumulator
      * @description Outputs a Core Metadata Object
@@ -6057,162 +5645,168 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Generation Mode
        * @description The generation mode that output this image
        */
-      generation_mode?: string;
+      generation_mode?: string | null;
       /**
        * Positive Prompt
        * @description The positive prompt parameter
        */
-      positive_prompt?: string;
+      positive_prompt?: string | null;
       /**
        * Negative Prompt
        * @description The negative prompt parameter
        */
-      negative_prompt?: string;
+      negative_prompt?: string | null;
       /**
        * Width
        * @description The width parameter
        */
-      width?: number;
+      width?: number | null;
       /**
        * Height
        * @description The height parameter
        */
-      height?: number;
+      height?: number | null;
       /**
        * Seed
        * @description The seed used for noise generation
        */
-      seed?: number;
+      seed?: number | null;
       /**
        * Rand Device
        * @description The device used for random number generation
        */
-      rand_device?: string;
+      rand_device?: string | null;
       /**
        * Cfg Scale
        * @description The classifier-free guidance scale parameter
        */
-      cfg_scale?: number;
+      cfg_scale?: number | null;
       /**
        * Steps
        * @description The number of steps used for inference
        */
-      steps?: number;
+      steps?: number | null;
       /**
        * Scheduler
        * @description The scheduler used for inference
        */
-      scheduler?: string;
+      scheduler?: string | null;
       /**
        * Clip Skip
        * @description The number of skipped CLIP layers
        */
-      clip_skip?: number;
-      /**
-       * Model
-       * @description The main model used for inference
-       */
-      model?: components["schemas"]["MainModelField"];
+      clip_skip?: number | null;
+      /** @description The main model used for inference */
+      model?: components["schemas"]["MainModelField"] | null;
       /**
        * Controlnets
        * @description The ControlNets used for inference
        */
-      controlnets?: components["schemas"]["ControlField"][];
+      controlnets?: components["schemas"]["ControlField"][] | null;
       /**
        * Ipadapters
        * @description The IP Adapters used for inference
        */
-      ipAdapters?: components["schemas"]["IPAdapterMetadataField"][];
+      ipAdapters?: components["schemas"]["IPAdapterMetadataField"][] | null;
       /**
        * T2Iadapters
        * @description The IP Adapters used for inference
        */
-      t2iAdapters: components["schemas"]["T2IAdapterField"][];
+      t2iAdapters?: components["schemas"]["T2IAdapterField"][] | null;
       /**
        * Loras
        * @description The LoRAs used for inference
        */
-      loras?: components["schemas"]["LoRAMetadataField"][];
+      loras?: components["schemas"]["LoRAMetadataField"][] | null;
       /**
        * Strength
        * @description The strength used for latents-to-latents
        */
-      strength?: number;
+      strength?: number | null;
       /**
        * Init Image
        * @description The name of the initial image
        */
-      init_image?: string;
+      init_image?: string | null;
+      /** @description The VAE used for decoding, if the main model's default was not used */
+      vae?: components["schemas"]["VAEModelField"] | null;
       /**
-       * Vae
-       * @description The VAE used for decoding, if the main model's default was not used
+       * Hrf Width
+       * @description The high resolution fix height and width multipler.
        */
-      vae?: components["schemas"]["VAEModelField"];
+      hrf_width?: number | null;
+      /**
+       * Hrf Height
+       * @description The high resolution fix height and width multipler.
+       */
+      hrf_height?: number | null;
+      /**
+       * Hrf Strength
+       * @description The high resolution fix img2img strength used in the upscale pass.
+       */
+      hrf_strength?: number | null;
       /**
        * Positive Style Prompt
        * @description The positive style prompt parameter
        */
-      positive_style_prompt?: string;
+      positive_style_prompt?: string | null;
       /**
        * Negative Style Prompt
        * @description The negative style prompt parameter
        */
-      negative_style_prompt?: string;
-      /**
-       * Refiner Model
-       * @description The SDXL Refiner model used
-       */
-      refiner_model?: components["schemas"]["MainModelField"];
+      negative_style_prompt?: string | null;
+      /** @description The SDXL Refiner model used */
+      refiner_model?: components["schemas"]["MainModelField"] | null;
       /**
        * Refiner Cfg Scale
        * @description The classifier-free guidance scale parameter used for the refiner
        */
-      refiner_cfg_scale?: number;
+      refiner_cfg_scale?: number | null;
       /**
        * Refiner Steps
        * @description The number of steps used for the refiner
        */
-      refiner_steps?: number;
+      refiner_steps?: number | null;
       /**
        * Refiner Scheduler
        * @description The scheduler used for the refiner
        */
-      refiner_scheduler?: string;
+      refiner_scheduler?: string | null;
       /**
        * Refiner Positive Aesthetic Score
        * @description The aesthetic score used for the refiner
        */
-      refiner_positive_aesthetic_score?: number;
+      refiner_positive_aesthetic_score?: number | null;
       /**
        * Refiner Negative Aesthetic Score
        * @description The aesthetic score used for the refiner
        */
-      refiner_negative_aesthetic_score?: number;
+      refiner_negative_aesthetic_score?: number | null;
       /**
        * Refiner Start
        * @description The start value used for refiner denoising
        */
-      refiner_start?: number;
+      refiner_start?: number | null;
       /**
-       * Type
+       * type
        * @default metadata_accumulator
-       * @enum {string}
+       * @constant
        */
       type: "metadata_accumulator";
     };
@@ -6221,15 +5815,12 @@ export type components = {
      * @description The output of the MetadataAccumulator node
      */
     MetadataAccumulatorOutput: {
-      /**
-       * Metadata
-       * @description The core metadata for the image
-       */
+      /** @description The core metadata for the image */
       metadata: components["schemas"]["CoreMetadata"];
       /**
-       * Type
+       * type
        * @default metadata_accumulator_output
-       * @enum {string}
+       * @constant
        */
       type: "metadata_accumulator_output";
     };
@@ -6248,29 +5839,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default midas_depth_image_processor
-       * @enum {string}
-       */
-      type: "midas_depth_image_processor";
       /**
        * A Mult
        * @description Midas parameter `a_mult` (a = a_mult * PI)
@@ -6283,6 +5865,12 @@ export type components = {
        * @default 0.1
        */
       bg_th?: number;
+      /**
+       * type
+       * @default midas_depth_image_processor
+       * @constant
+       */
+      type: "midas_depth_image_processor";
     };
     /**
      * MLSD Processor
@@ -6299,29 +5887,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default mlsd_image_processor
-       * @enum {string}
-       */
-      type: "mlsd_image_processor";
       /**
        * Detect Resolution
        * @description Pixel resolution for detection
@@ -6346,11 +5925,16 @@ export type components = {
        * @default 0.1
        */
       thr_d?: number;
+      /**
+       * type
+       * @default mlsd_image_processor
+       * @constant
+       */
+      type: "mlsd_image_processor";
     };
     /**
      * ModelError
-     * @description An enumeration.
-     * @enum {string}
+     * @constant
      */
     ModelError: "not_found";
     /** ModelInfo */
@@ -6365,7 +5949,7 @@ export type components = {
       /** @description Info to load submodel */
       model_type: components["schemas"]["ModelType"];
       /** @description Info to load submodel */
-      submodel?: components["schemas"]["SubModelType"];
+      submodel?: components["schemas"]["SubModelType"] | null;
     };
     /**
      * ModelLoaderOutput
@@ -6388,21 +5972,19 @@ export type components = {
        */
       vae: components["schemas"]["VaeField"];
       /**
-       * Type
+       * type
        * @default model_loader_output
-       * @enum {string}
+       * @constant
        */
       type: "model_loader_output";
     };
     /**
      * ModelType
-     * @description An enumeration.
      * @enum {string}
      */
     ModelType: "onnx" | "main" | "vae" | "lora" | "controlnet" | "embedding" | "ip_adapter" | "clip_vision" | "t2i_adapter";
     /**
      * ModelVariantType
-     * @description An enumeration.
      * @enum {string}
      */
     ModelVariantType: "normal" | "inpaint" | "depth";
@@ -6426,18 +6008,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * A
        * @description The first number
@@ -6451,9 +6033,9 @@ export type components = {
        */
       b?: number;
       /**
-       * Type
+       * type
        * @default mul
-       * @enum {string}
+       * @constant
        */
       type: "mul";
     };
@@ -6490,18 +6072,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Seed
        * @description Seed for random number generation
@@ -6526,9 +6108,9 @@ export type components = {
        */
       use_cpu?: boolean;
       /**
-       * Type
+       * type
        * @default noise
-       * @enum {string}
+       * @constant
        */
       type: "noise";
     };
@@ -6537,11 +6119,8 @@ export type components = {
      * @description Invocation noise output
      */
     NoiseOutput: {
-      /**
-       * Noise
-       * @description Noise tensor
-       */
-      noise?: components["schemas"]["LatentsField"];
+      /** @description Noise tensor */
+      noise: components["schemas"]["LatentsField"];
       /**
        * Width
        * @description Width of output (px)
@@ -6553,9 +6132,9 @@ export type components = {
        */
       height: number;
       /**
-       * Type
+       * type
        * @default noise_output
-       * @enum {string}
+       * @constant
        */
       type: "noise_output";
     };
@@ -6574,29 +6153,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default normalbae_image_processor
-       * @enum {string}
-       */
-      type: "normalbae_image_processor";
       /**
        * Detect Resolution
        * @description Pixel resolution for detection
@@ -6609,6 +6179,12 @@ export type components = {
        * @default 512
        */
       image_resolution?: number;
+      /**
+       * type
+       * @default normalbae_image_processor
+       * @constant
+       */
+      type: "normalbae_image_processor";
     };
     /**
      * ONNX Latents to Image
@@ -6625,37 +6201,28 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Latents
-       * @description Denoised latents tensor
-       */
+      use_cache?: boolean | null;
+      /** @description Denoised latents tensor */
       latents?: components["schemas"]["LatentsField"];
-      /**
-       * Vae
-       * @description VAE
-       */
+      /** @description VAE */
       vae?: components["schemas"]["VaeField"];
+      /** @description Optional core metadata to be written to image */
+      metadata?: components["schemas"]["CoreMetadata"] | null;
       /**
-       * Metadata
-       * @description Optional core metadata to be written to image
-       */
-      metadata?: components["schemas"]["CoreMetadata"];
-      /**
-       * Type
+       * type
        * @default l2i_onnx
-       * @enum {string}
+       * @constant
        */
       type: "l2i_onnx";
     };
@@ -6685,19 +6252,13 @@ export type components = {
        */
       vae_encoder?: components["schemas"]["VaeField"];
       /**
-       * Type
+       * type
        * @default model_loader_output_onnx
-       * @enum {string}
+       * @constant
        */
       type: "model_loader_output_onnx";
     };
-    /**
-     * ONNX Prompt (Raw)
-     * @description A node to process inputs and produce outputs.
-     * May use dependency injection in __init__ to receive providers.
-     *
-     * All invocations must use the `@invocation` decorator to provide their unique type.
-     */
+    /** ONNX Prompt (Raw) */
     ONNXPromptInvocation: {
       /**
        * Id
@@ -6709,33 +6270,30 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Prompt
        * @description Raw prompt text (no parsing)
        * @default
        */
       prompt?: string;
-      /**
-       * Clip
-       * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
-       */
+      /** @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count */
       clip?: components["schemas"]["ClipField"];
       /**
-       * Type
+       * type
        * @default prompt_onnx
-       * @enum {string}
+       * @constant
        */
       type: "prompt_onnx";
     };
@@ -6746,19 +6304,20 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default onnx
+       * @constant
        */
       model_type: "onnx";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "onnx";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       variant: components["schemas"]["ModelVariantType"];
     };
     /** ONNXStableDiffusion2ModelConfig */
@@ -6768,19 +6327,20 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default onnx
+       * @constant
        */
       model_type: "onnx";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "onnx";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       variant: components["schemas"]["ModelVariantType"];
       prediction_type: components["schemas"]["SchedulerPredictionType"];
       /** Upcast Attention */
@@ -6801,32 +6361,23 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Positive Conditioning
-       * @description Positive conditioning tensor
-       */
+      use_cache?: boolean | null;
+      /** @description Positive conditioning tensor */
       positive_conditioning?: components["schemas"]["ConditioningField"];
-      /**
-       * Negative Conditioning
-       * @description Negative conditioning tensor
-       */
+      /** @description Negative conditioning tensor */
       negative_conditioning?: components["schemas"]["ConditioningField"];
-      /**
-       * Noise
-       * @description Noise tensor
-       */
+      /** @description Noise tensor */
       noise?: components["schemas"]["LatentsField"];
       /**
        * Steps
@@ -6854,10 +6405,7 @@ export type components = {
        * @enum {string}
        */
       precision?: "tensor(bool)" | "tensor(int8)" | "tensor(uint8)" | "tensor(int16)" | "tensor(uint16)" | "tensor(int32)" | "tensor(uint32)" | "tensor(int64)" | "tensor(uint64)" | "tensor(float16)" | "tensor(float)" | "tensor(double)";
-      /**
-       * Unet
-       * @description UNet (scheduler, LoRAs)
-       */
+      /** @description UNet (scheduler, LoRAs) */
       unet?: components["schemas"]["UNetField"];
       /**
        * Control
@@ -6865,63 +6413,57 @@ export type components = {
        */
       control?: components["schemas"]["ControlField"] | components["schemas"]["ControlField"][];
       /**
-       * Type
+       * type
        * @default t2l_onnx
-       * @enum {string}
+       * @constant
        */
       type: "t2l_onnx";
     };
-    /**
-     * OffsetPaginatedResults[BoardDTO]
-     * @description Offset-paginated results
-     */
+    /** OffsetPaginatedResults[BoardDTO] */
     OffsetPaginatedResults_BoardDTO_: {
+      /**
+       * Limit
+       * @description Limit of items to get
+       */
+      limit: number;
+      /**
+       * Offset
+       * @description Offset from which to retrieve items
+       */
+      offset: number;
+      /**
+       * Total
+       * @description Total number of items in result
+       */
+      total: number;
       /**
        * Items
        * @description Items
        */
       items: components["schemas"]["BoardDTO"][];
-      /**
-       * Offset
-       * @description Offset from which to retrieve items
-       */
-      offset: number;
+    };
+    /** OffsetPaginatedResults[ImageDTO] */
+    OffsetPaginatedResults_ImageDTO_: {
       /**
        * Limit
        * @description Limit of items to get
        */
       limit: number;
+      /**
+       * Offset
+       * @description Offset from which to retrieve items
+       */
+      offset: number;
       /**
        * Total
        * @description Total number of items in result
        */
       total: number;
-    };
-    /**
-     * OffsetPaginatedResults[ImageDTO]
-     * @description Offset-paginated results
-     */
-    OffsetPaginatedResults_ImageDTO_: {
       /**
        * Items
        * @description Items
        */
       items: components["schemas"]["ImageDTO"][];
-      /**
-       * Offset
-       * @description Offset from which to retrieve items
-       */
-      offset: number;
-      /**
-       * Limit
-       * @description Limit of items to get
-       */
-      limit: number;
-      /**
-       * Total
-       * @description Total number of items in result
-       */
-      total: number;
     };
     /**
      * OnnxModelField
@@ -6953,27 +6495,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Model
-       * @description ONNX Main model (UNet, VAE, CLIP) to load
-       */
+      use_cache?: boolean | null;
+      /** @description ONNX Main model (UNet, VAE, CLIP) to load */
       model: components["schemas"]["OnnxModelField"];
       /**
-       * Type
+       * type
        * @default onnx_model_loader
-       * @enum {string}
+       * @constant
        */
       type: "onnx_model_loader";
     };
@@ -6992,29 +6531,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default openpose_image_processor
-       * @enum {string}
-       */
-      type: "openpose_image_processor";
       /**
        * Hand And Face
        * @description Whether to use hands and face mode
@@ -7033,37 +6563,12 @@ export type components = {
        * @default 512
        */
       image_resolution?: number;
-    };
-    /**
-     * PaginatedResults[GraphExecutionState]
-     * @description Paginated results
-     */
-    PaginatedResults_GraphExecutionState_: {
       /**
-       * Items
-       * @description Items
+       * type
+       * @default openpose_image_processor
+       * @constant
        */
-      items: components["schemas"]["GraphExecutionState"][];
-      /**
-       * Page
-       * @description Current Page
-       */
-      page: number;
-      /**
-       * Pages
-       * @description Total number of pages
-       */
-      pages: number;
-      /**
-       * Per Page
-       * @description Number of items per page
-       */
-      per_page: number;
-      /**
-       * Total
-       * @description Total number of items in result
-       */
-      total: number;
+      type: "openpose_image_processor";
     };
     /**
      * PIDI Processor
@@ -7080,29 +6585,20 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default pidi_image_processor
-       * @enum {string}
-       */
-      type: "pidi_image_processor";
       /**
        * Detect Resolution
        * @description Pixel resolution for detection
@@ -7127,6 +6623,12 @@ export type components = {
        * @default false
        */
       scribble?: boolean;
+      /**
+       * type
+       * @default pidi_image_processor
+       * @constant
+       */
+      type: "pidi_image_processor";
     };
     /**
      * Prompts from File
@@ -7143,18 +6645,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * File Path
        * @description Path to prompt text file
@@ -7164,12 +6666,12 @@ export type components = {
        * Pre Prompt
        * @description String to prepend to each prompt
        */
-      pre_prompt?: string;
+      pre_prompt?: string | null;
       /**
        * Post Prompt
        * @description String to append to each prompt
        */
-      post_prompt?: string;
+      post_prompt?: string | null;
       /**
        * Start Line
        * @description Line in the file to start start from
@@ -7183,9 +6685,9 @@ export type components = {
        */
       max_prompts?: number;
       /**
-       * Type
+       * type
        * @default prompt_from_file
-       * @enum {string}
+       * @constant
        */
       type: "prompt_from_file";
     };
@@ -7215,18 +6717,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
-       * @default true
+       * @default false
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Low
        * @description The inclusive low value
@@ -7246,9 +6748,9 @@ export type components = {
        */
       decimals?: number;
       /**
-       * Type
+       * type
        * @default rand_float
-       * @enum {string}
+       * @constant
        */
       type: "rand_float";
     };
@@ -7267,18 +6769,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default false
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Low
        * @description The inclusive low value
@@ -7292,9 +6794,9 @@ export type components = {
        */
       high?: number;
       /**
-       * Type
+       * type
        * @default rand_int
-       * @enum {string}
+       * @constant
        */
       type: "rand_int";
     };
@@ -7313,18 +6815,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default false
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Low
        * @description The inclusive low value
@@ -7349,9 +6851,9 @@ export type components = {
        */
       seed?: number;
       /**
-       * Type
+       * type
        * @default random_range
-       * @enum {string}
+       * @constant
        */
       type: "random_range";
     };
@@ -7370,18 +6872,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Start
        * @description The start of the range
@@ -7401,9 +6903,9 @@ export type components = {
        */
       step?: number;
       /**
-       * Type
+       * type
        * @default range
-       * @enum {string}
+       * @constant
        */
       type: "range";
     };
@@ -7422,18 +6924,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Start
        * @description The start of the range
@@ -7453,9 +6955,9 @@ export type components = {
        */
       step?: number;
       /**
-       * Type
+       * type
        * @default range_of_size
-       * @enum {string}
+       * @constant
        */
       type: "range_of_size";
     };
@@ -7482,22 +6984,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Latents
-       * @description Latents tensor
-       */
+      use_cache?: boolean | null;
+      /** @description Latents tensor */
       latents?: components["schemas"]["LatentsField"];
       /**
        * Width
@@ -7523,9 +7022,9 @@ export type components = {
        */
       antialias?: boolean;
       /**
-       * Type
+       * type
        * @default lresize
-       * @enum {string}
+       * @constant
        */
       type: "lresize";
     };
@@ -7554,18 +7053,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Value
        * @description The float value
@@ -7579,9 +7078,9 @@ export type components = {
        */
       decimals?: number;
       /**
-       * Type
+       * type
        * @default round_float
-       * @enum {string}
+       * @constant
        */
       type: "round_float";
     };
@@ -7600,18 +7099,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Prompt
        * @description Prompt to be parsed by Compel to create a conditioning tensor
@@ -7665,9 +7164,9 @@ export type components = {
        */
       clip2?: components["schemas"]["ClipField"];
       /**
-       * Type
+       * type
        * @default sdxl_compel_prompt
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_compel_prompt";
     };
@@ -7686,18 +7185,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * LoRA
        * @description LoRA model to load
@@ -7713,21 +7212,21 @@ export type components = {
        * UNet
        * @description UNet (scheduler, LoRAs)
        */
-      unet?: components["schemas"]["UNetField"];
+      unet?: components["schemas"]["UNetField"] | null;
       /**
        * CLIP 1
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
-      clip?: components["schemas"]["ClipField"];
+      clip?: components["schemas"]["ClipField"] | null;
       /**
        * CLIP 2
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
-      clip2?: components["schemas"]["ClipField"];
+      clip2?: components["schemas"]["ClipField"] | null;
       /**
-       * Type
+       * type
        * @default sdxl_lora_loader
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_lora_loader";
     };
@@ -7740,21 +7239,21 @@ export type components = {
        * UNet
        * @description UNet (scheduler, LoRAs)
        */
-      unet?: components["schemas"]["UNetField"];
+      unet?: components["schemas"]["UNetField"] | null;
       /**
        * CLIP 1
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
-      clip?: components["schemas"]["ClipField"];
+      clip?: components["schemas"]["ClipField"] | null;
       /**
        * CLIP 2
        * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
        */
-      clip2?: components["schemas"]["ClipField"];
+      clip2?: components["schemas"]["ClipField"] | null;
       /**
-       * Type
+       * type
        * @default sdxl_lora_loader_output
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_lora_loader_output";
     };
@@ -7773,27 +7272,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Model
-       * @description SDXL Main model (UNet, VAE, CLIP1, CLIP2) to load
-       */
+      use_cache?: boolean | null;
+      /** @description SDXL Main model (UNet, VAE, CLIP1, CLIP2) to load */
       model: components["schemas"]["MainModelField"];
       /**
-       * Type
+       * type
        * @default sdxl_model_loader
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_model_loader";
     };
@@ -7823,9 +7319,9 @@ export type components = {
        */
       vae: components["schemas"]["VaeField"];
       /**
-       * Type
+       * type
        * @default sdxl_model_loader_output
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_model_loader_output";
     };
@@ -7844,18 +7340,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Style
        * @description Prompt to be parsed by Compel to create a conditioning tensor
@@ -7888,15 +7384,12 @@ export type components = {
        * @default 6
        */
       aesthetic_score?: number;
-      /**
-       * Clip2
-       * @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count
-       */
+      /** @description CLIP (tokenizer, text encoder, LoRAs) and skipped layer count */
       clip2?: components["schemas"]["ClipField"];
       /**
-       * Type
+       * type
        * @default sdxl_refiner_compel_prompt
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_refiner_compel_prompt";
     };
@@ -7915,27 +7408,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Model
-       * @description SDXL Refiner Main Modde (UNet, VAE, CLIP2) to load
-       */
+      use_cache?: boolean | null;
+      /** @description SDXL Refiner Main Modde (UNet, VAE, CLIP2) to load */
       model: components["schemas"]["MainModelField"];
       /**
-       * Type
+       * type
        * @default sdxl_refiner_model_loader
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_refiner_model_loader";
     };
@@ -7960,9 +7450,9 @@ export type components = {
        */
       vae: components["schemas"]["VaeField"];
       /**
-       * Type
+       * type
        * @default sdxl_refiner_model_loader_output
-       * @enum {string}
+       * @constant
        */
       type: "sdxl_refiner_model_loader_output";
     };
@@ -7981,37 +7471,28 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default false
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
+      /** @description The board to save the image to */
+      board?: components["schemas"]["BoardField"] | null;
+      /** @description Optional core metadata to be written to image */
+      metadata?: components["schemas"]["CoreMetadata"] | null;
       /**
-       * Board
-       * @description The board to save the image to
-       */
-      board?: components["schemas"]["BoardField"];
-      /**
-       * Metadata
-       * @description Optional core metadata to be written to image
-       */
-      metadata?: components["schemas"]["CoreMetadata"];
-      /**
-       * Type
+       * type
        * @default save_image
-       * @enum {string}
+       * @constant
        */
       type: "save_image";
     };
@@ -8030,22 +7511,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Latents
-       * @description Latents tensor
-       */
+      use_cache?: boolean | null;
+      /** @description Latents tensor */
       latents?: components["schemas"]["LatentsField"];
       /**
        * Scale Factor
@@ -8066,9 +7544,9 @@ export type components = {
        */
       antialias?: boolean;
       /**
-       * Type
+       * type
        * @default lscale
-       * @enum {string}
+       * @constant
        */
       type: "lscale";
     };
@@ -8087,18 +7565,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Scheduler
        * @description Scheduler to use during inference
@@ -8107,18 +7585,13 @@ export type components = {
        */
       scheduler?: "ddim" | "ddpm" | "deis" | "lms" | "lms_k" | "pndm" | "heun" | "heun_k" | "euler" | "euler_k" | "euler_a" | "kdpm_2" | "kdpm_2_a" | "dpmpp_2s" | "dpmpp_2s_k" | "dpmpp_2m" | "dpmpp_2m_k" | "dpmpp_2m_sde" | "dpmpp_2m_sde_k" | "dpmpp_sde" | "dpmpp_sde_k" | "unipc";
       /**
-       * Type
+       * type
        * @default scheduler
-       * @enum {string}
+       * @constant
        */
       type: "scheduler";
     };
-    /**
-     * SchedulerOutput
-     * @description Base class for all invocation outputs.
-     *
-     * All invocation outputs must use the `@invocation_output` decorator to provide their unique type.
-     */
+    /** SchedulerOutput */
     SchedulerOutput: {
       /**
        * Scheduler
@@ -8127,15 +7600,14 @@ export type components = {
        */
       scheduler: "ddim" | "ddpm" | "deis" | "lms" | "lms_k" | "pndm" | "heun" | "heun_k" | "euler" | "euler_k" | "euler_a" | "kdpm_2" | "kdpm_2_a" | "dpmpp_2s" | "dpmpp_2s_k" | "dpmpp_2m" | "dpmpp_2m_k" | "dpmpp_2m_sde" | "dpmpp_2m_sde_k" | "dpmpp_sde" | "dpmpp_sde_k" | "unipc";
       /**
-       * Type
+       * type
        * @default scheduler_output
-       * @enum {string}
+       * @constant
        */
       type: "scheduler_output";
     };
     /**
      * SchedulerPredictionType
-     * @description An enumeration.
      * @enum {string}
      */
     SchedulerPredictionType: "epsilon" | "v_prediction" | "sample";
@@ -8154,28 +7626,28 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * UNet
        * @description UNet (scheduler, LoRAs)
        */
-      unet?: components["schemas"]["UNetField"];
+      unet?: components["schemas"]["UNetField"] | null;
       /**
        * VAE
        * @description VAE model to load
        */
-      vae?: components["schemas"]["VaeField"];
+      vae?: components["schemas"]["VaeField"] | null;
       /**
        * Seamless Y
        * @description Specify whether Y axis is seamless
@@ -8189,9 +7661,9 @@ export type components = {
        */
       seamless_x?: boolean;
       /**
-       * Type
+       * type
        * @default seamless
-       * @enum {string}
+       * @constant
        */
       type: "seamless";
     };
@@ -8204,16 +7676,16 @@ export type components = {
        * UNet
        * @description UNet (scheduler, LoRAs)
        */
-      unet?: components["schemas"]["UNetField"];
+      unet?: components["schemas"]["UNetField"] | null;
       /**
        * VAE
        * @description VAE
        */
-      vae?: components["schemas"]["VaeField"];
+      vae?: components["schemas"]["VaeField"] | null;
       /**
-       * Type
+       * type
        * @default seamless_output
-       * @enum {string}
+       * @constant
        */
       type: "seamless_output";
     };
@@ -8232,27 +7704,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default segment_anything_processor
-       * @enum {string}
+       * @constant
        */
       type: "segment_anything_processor";
     };
@@ -8277,10 +7746,7 @@ export type components = {
       queue: components["schemas"]["SessionQueueStatus"];
       processor: components["schemas"]["SessionProcessorStatus"];
     };
-    /**
-     * SessionQueueItem
-     * @description Session queue item without the full graph. Used for serialization.
-     */
+    /** SessionQueueItem */
     SessionQueueItem: {
       /**
        * Item Id
@@ -8314,7 +7780,7 @@ export type components = {
        * Error
        * @description The error message if this queue item errored
        */
-      error?: string;
+      error?: string | null;
       /**
        * Created At
        * @description When this queue item was created
@@ -8329,12 +7795,12 @@ export type components = {
        * Started At
        * @description When this queue item was started
        */
-      started_at?: string;
+      started_at?: string | null;
       /**
        * Completed At
        * @description When this queue item was completed
        */
-      completed_at?: string;
+      completed_at?: string | null;
       /**
        * Queue Id
        * @description The id of the queue with which this item is associated
@@ -8344,17 +7810,11 @@ export type components = {
        * Field Values
        * @description The field values that were used for this queue item
        */
-      field_values?: components["schemas"]["NodeFieldValue"][];
-      /**
-       * Session
-       * @description The fully-populated session to be executed
-       */
+      field_values?: components["schemas"]["NodeFieldValue"][] | null;
+      /** @description The fully-populated session to be executed */
       session: components["schemas"]["GraphExecutionState"];
     };
-    /**
-     * SessionQueueItemDTO
-     * @description Session queue item without the full graph. Used for serialization.
-     */
+    /** SessionQueueItemDTO */
     SessionQueueItemDTO: {
       /**
        * Item Id
@@ -8388,7 +7848,7 @@ export type components = {
        * Error
        * @description The error message if this queue item errored
        */
-      error?: string;
+      error?: string | null;
       /**
        * Created At
        * @description When this queue item was created
@@ -8403,12 +7863,12 @@ export type components = {
        * Started At
        * @description When this queue item was started
        */
-      started_at?: string;
+      started_at?: string | null;
       /**
        * Completed At
        * @description When this queue item was completed
        */
-      completed_at?: string;
+      completed_at?: string | null;
       /**
        * Queue Id
        * @description The id of the queue with which this item is associated
@@ -8418,7 +7878,7 @@ export type components = {
        * Field Values
        * @description The field values that were used for this queue item
        */
-      field_values?: components["schemas"]["NodeFieldValue"][];
+      field_values?: components["schemas"]["NodeFieldValue"][] | null;
     };
     /** SessionQueueStatus */
     SessionQueueStatus: {
@@ -8431,17 +7891,17 @@ export type components = {
        * Item Id
        * @description The current queue item id
        */
-      item_id?: number;
+      item_id: number | null;
       /**
        * Batch Id
        * @description The current queue item's batch id
        */
-      batch_id?: string;
+      batch_id: string | null;
       /**
        * Session Id
        * @description The current queue item's session id
        */
-      session_id?: string;
+      session_id: string | null;
       /**
        * Pending
        * @description Number of queue items with status 'pending'
@@ -8488,27 +7948,24 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to show
-       */
+      use_cache?: boolean | null;
+      /** @description The image to show */
       image?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default show_image
-       * @enum {string}
+       * @constant
        */
       type: "show_image";
     };
@@ -8519,21 +7976,22 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default main
+       * @constant
        */
       model_type: "main";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "checkpoint";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       /** Vae */
-      vae?: string;
+      vae?: string | null;
       /** Config */
       config: string;
       variant: components["schemas"]["ModelVariantType"];
@@ -8545,21 +8003,22 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default main
+       * @constant
        */
       model_type: "main";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "diffusers";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       /** Vae */
-      vae?: string;
+      vae?: string | null;
       variant: components["schemas"]["ModelVariantType"];
     };
     /** StableDiffusion2ModelCheckpointConfig */
@@ -8569,21 +8028,22 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default main
+       * @constant
        */
       model_type: "main";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "checkpoint";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       /** Vae */
-      vae?: string;
+      vae?: string | null;
       /** Config */
       config: string;
       variant: components["schemas"]["ModelVariantType"];
@@ -8595,21 +8055,22 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default main
+       * @constant
        */
       model_type: "main";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "diffusers";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       /** Vae */
-      vae?: string;
+      vae?: string | null;
       variant: components["schemas"]["ModelVariantType"];
     };
     /** StableDiffusionXLModelCheckpointConfig */
@@ -8619,21 +8080,22 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default main
+       * @constant
        */
       model_type: "main";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "checkpoint";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       /** Vae */
-      vae?: string;
+      vae?: string | null;
       /** Config */
       config: string;
       variant: components["schemas"]["ModelVariantType"];
@@ -8645,21 +8107,22 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default main
+       * @constant
        */
       model_type: "main";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "diffusers";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
       /** Vae */
-      vae?: string;
+      vae?: string | null;
       variant: components["schemas"]["ModelVariantType"];
     };
     /**
@@ -8677,18 +8140,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Easing
        * @description The easing function to use
@@ -8730,12 +8193,12 @@ export type components = {
        * Pre Start Value
        * @description value before easing start
        */
-      pre_start_value?: number;
+      pre_start_value?: number | null;
       /**
        * Post End Value
        * @description value after easing end
        */
-      post_end_value?: number;
+      post_end_value?: number | null;
       /**
        * Mirror
        * @description include mirror of easing function
@@ -8749,9 +8212,9 @@ export type components = {
        */
       show_easing_plot?: boolean;
       /**
-       * Type
+       * type
        * @default step_param_easing
-       * @enum {string}
+       * @constant
        */
       type: "step_param_easing";
     };
@@ -8771,9 +8234,9 @@ export type components = {
        */
       string_2: string;
       /**
-       * Type
+       * type
        * @default string_2_output
-       * @enum {string}
+       * @constant
        */
       type: "string_2_output";
     };
@@ -8792,27 +8255,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Collection
        * @description The collection of string values
        */
       collection?: string[];
       /**
-       * Type
+       * type
        * @default string_collection
-       * @enum {string}
+       * @constant
        */
       type: "string_collection";
     };
@@ -8827,9 +8290,9 @@ export type components = {
        */
       collection: string[];
       /**
-       * Type
+       * type
        * @default string_collection_output
-       * @enum {string}
+       * @constant
        */
       type: "string_collection_output";
     };
@@ -8848,18 +8311,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * Value
        * @description The string value
@@ -8867,9 +8330,9 @@ export type components = {
        */
       value?: string;
       /**
-       * Type
+       * type
        * @default string
-       * @enum {string}
+       * @constant
        */
       type: "string";
     };
@@ -8888,18 +8351,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * String Left
        * @description String Left
@@ -8913,9 +8376,9 @@ export type components = {
        */
       string_right?: string;
       /**
-       * Type
+       * type
        * @default string_join
-       * @enum {string}
+       * @constant
        */
       type: "string_join";
     };
@@ -8934,18 +8397,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * String Left
        * @description String Left
@@ -8965,9 +8428,9 @@ export type components = {
        */
       string_right?: string;
       /**
-       * Type
+       * type
        * @default string_join_three
-       * @enum {string}
+       * @constant
        */
       type: "string_join_three";
     };
@@ -8982,9 +8445,9 @@ export type components = {
        */
       value: string;
       /**
-       * Type
+       * type
        * @default string_output
-       * @enum {string}
+       * @constant
        */
       type: "string_output";
     };
@@ -9004,9 +8467,9 @@ export type components = {
        */
       negative_string: string;
       /**
-       * Type
+       * type
        * @default string_pos_neg_output
-       * @enum {string}
+       * @constant
        */
       type: "string_pos_neg_output";
     };
@@ -9025,18 +8488,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * String
        * @description String to work on
@@ -9062,9 +8525,9 @@ export type components = {
        */
       use_regex?: boolean;
       /**
-       * Type
+       * type
        * @default string_replace
-       * @enum {string}
+       * @constant
        */
       type: "string_replace";
     };
@@ -9083,18 +8546,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * String
        * @description String to split
@@ -9108,9 +8571,9 @@ export type components = {
        */
       delimiter?: string;
       /**
-       * Type
+       * type
        * @default string_split
-       * @enum {string}
+       * @constant
        */
       type: "string_split";
     };
@@ -9129,18 +8592,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * String
        * @description String to split
@@ -9148,15 +8611,14 @@ export type components = {
        */
       string?: string;
       /**
-       * Type
+       * type
        * @default string_split_neg
-       * @enum {string}
+       * @constant
        */
       type: "string_split_neg";
     };
     /**
      * SubModelType
-     * @description An enumeration.
      * @enum {string}
      */
     SubModelType: "unet" | "text_encoder" | "text_encoder_2" | "tokenizer" | "tokenizer_2" | "vae" | "vae_decoder" | "vae_encoder" | "scheduler" | "safety_checker";
@@ -9175,18 +8637,18 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * A
        * @description The first number
@@ -9200,23 +8662,17 @@ export type components = {
        */
       b?: number;
       /**
-       * Type
+       * type
        * @default sub
-       * @enum {string}
+       * @constant
        */
       type: "sub";
     };
     /** T2IAdapterField */
     T2IAdapterField: {
-      /**
-       * Image
-       * @description The T2I-Adapter image prompt.
-       */
+      /** @description The T2I-Adapter image prompt. */
       image: components["schemas"]["ImageField"];
-      /**
-       * T2I Adapter Model
-       * @description The T2I-Adapter model to use.
-       */
+      /** @description The T2I-Adapter model to use. */
       t2i_adapter_model: components["schemas"]["T2IAdapterModelField"];
       /**
        * Weight
@@ -9259,22 +8715,19 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The IP-Adapter image prompt.
-       */
+      use_cache?: boolean | null;
+      /** @description The IP-Adapter image prompt. */
       image?: components["schemas"]["ImageField"];
       /**
        * T2I-Adapter Model
@@ -9307,9 +8760,9 @@ export type components = {
        */
       resize_mode?: "just_resize" | "crop_resize" | "fill_resize" | "just_resize_simple";
       /**
-       * Type
+       * type
        * @default t2i_adapter
-       * @enum {string}
+       * @constant
        */
       type: "t2i_adapter";
     };
@@ -9320,19 +8773,20 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default t2i_adapter
+       * @constant
        */
       model_type: "t2i_adapter";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /**
        * Model Format
-       * @enum {string}
+       * @constant
        */
       model_format: "diffusers";
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
     };
     /** T2IAdapterModelField */
     T2IAdapterModelField: {
@@ -9344,12 +8798,7 @@ export type components = {
       /** @description Base model */
       base_model: components["schemas"]["BaseModelType"];
     };
-    /**
-     * T2IAdapterOutput
-     * @description Base class for all invocation outputs.
-     *
-     * All invocation outputs must use the `@invocation_output` decorator to provide their unique type.
-     */
+    /** T2IAdapterOutput */
     T2IAdapterOutput: {
       /**
        * T2I Adapter
@@ -9357,9 +8806,9 @@ export type components = {
        */
       t2i_adapter: components["schemas"]["T2IAdapterField"];
       /**
-       * Type
+       * type
        * @default t2i_adapter_output
-       * @enum {string}
+       * @constant
        */
       type: "t2i_adapter_output";
     };
@@ -9370,16 +8819,17 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default embedding
+       * @constant
        */
       model_type: "embedding";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       /** Model Format */
       model_format: null;
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
     };
     /**
      * Tile Resample Processor
@@ -9396,47 +8846,38 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
-      /**
-       * Type
-       * @default tile_image_processor
-       * @enum {string}
-       */
-      type: "tile_image_processor";
       /**
        * Down Sampling Rate
        * @description Down sampling rate
        * @default 1
        */
       down_sampling_rate?: number;
+      /**
+       * type
+       * @default tile_image_processor
+       * @constant
+       */
+      type: "tile_image_processor";
     };
     /** UNetField */
     UNetField: {
-      /**
-       * Unet
-       * @description Info to load unet submodel
-       */
+      /** @description Info to load unet submodel */
       unet: components["schemas"]["ModelInfo"];
-      /**
-       * Scheduler
-       * @description Info to load scheduler submodel
-       */
+      /** @description Info to load scheduler submodel */
       scheduler: components["schemas"]["ModelInfo"];
       /**
        * Loras
@@ -9477,10 +8918,7 @@ export type components = {
     };
     /** VaeField */
     VaeField: {
-      /**
-       * Vae
-       * @description Info to load vae submodel
-       */
+      /** @description Info to load vae submodel */
       vae: components["schemas"]["ModelInfo"];
       /**
        * Seamless Axes
@@ -9503,27 +8941,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
+      use_cache?: boolean | null;
       /**
        * VAE
        * @description VAE model to load
        */
       vae_model: components["schemas"]["VAEModelField"];
       /**
-       * Type
+       * type
        * @default vae_loader
-       * @enum {string}
+       * @constant
        */
       type: "vae_loader";
     };
@@ -9538,9 +8976,9 @@ export type components = {
        */
       vae: components["schemas"]["VaeField"];
       /**
-       * Type
+       * type
        * @default vae_loader_output
-       * @enum {string}
+       * @constant
        */
       type: "vae_loader_output";
     };
@@ -9551,19 +8989,19 @@ export type components = {
       base_model: components["schemas"]["BaseModelType"];
       /**
        * Model Type
-       * @enum {string}
+       * @default vae
+       * @constant
        */
       model_type: "vae";
       /** Path */
       path: string;
       /** Description */
-      description?: string;
+      description?: string | null;
       model_format: components["schemas"]["VaeModelFormat"];
-      error?: components["schemas"]["ModelError"];
+      error?: components["schemas"]["ModelError"] | null;
     };
     /**
      * VaeModelFormat
-     * @description An enumeration.
      * @enum {string}
      */
     VaeModelFormat: "checkpoint" | "diffusers";
@@ -9591,57 +9029,27 @@ export type components = {
        * @description Whether or not this is an intermediate invocation.
        * @default false
        */
-      is_intermediate?: boolean;
+      is_intermediate?: boolean | null;
       /**
        * Workflow
        * @description The workflow to save with the image
        */
-      workflow?: string;
+      workflow?: string | null;
       /**
        * Use Cache
        * @description Whether or not to use the cache
        * @default true
        */
-      use_cache?: boolean;
-      /**
-       * Image
-       * @description The image to process
-       */
+      use_cache?: boolean | null;
+      /** @description The image to process */
       image?: components["schemas"]["ImageField"];
       /**
-       * Type
+       * type
        * @default zoe_depth_image_processor
-       * @enum {string}
+       * @constant
        */
       type: "zoe_depth_image_processor";
     };
-    /**
-     * UIConfigBase
-     * @description Provides additional node configuration to the UI.
-     * This is used internally by the @invocation decorator logic. Do not use this directly.
-     */
-    UIConfigBase: {
-      /**
-       * Tags
-       * @description The node's tags
-       */
-      tags?: string[];
-      /**
-       * Title
-       * @description The node's display name
-       */
-      title?: string;
-      /**
-       * Category
-       * @description The node's category
-       */
-      category?: string;
-      /**
-       * Version
-       * @description The node's version. Should be a valid semver string e.g. "1.0.0" or "3.8.13".
-       */
-      version?: string;
-    };
     /**
      * Input
      * @description The type of input a field accepts.
@@ -9651,6 +9059,42 @@ export type components = {
      * @enum {string}
      */
     Input: "connection" | "direct" | "any";
+    /**
+     * UIComponent
+     * @description The type of UI component to use for a field, used to override the default components, which are     inferred from the field type.
+     * @enum {string}
+     */
+    UIComponent: "none" | "textarea" | "slider";
+    /**
+     * UIConfigBase
+     * @description Provides additional node configuration to the UI.
+     * This is used internally by the @invocation decorator logic. Do not use this directly.
+     */
+    UIConfigBase: {
+      /**
+       * Tags
+       * @description The node's tags
+       */
+      tags: string[] | null;
+      /**
+       * Title
+       * @description The node's display name
+       * @default null
+       */
+      title: string | null;
+      /**
+       * Category
+       * @description The node's category
+       * @default null
+       */
+      category: string | null;
+      /**
+       * Version
+       * @description The node's version. Should be a valid semver string e.g. "1.0.0" or "3.8.13".
+       * @default null
+       */
+      version: string | null;
+    };
     /**
      * UIType
      * @description Type hints for the UI.
@@ -9658,12 +9102,6 @@ export type components = {
      * @enum {string}
      */
     UIType: "boolean" | "ColorField" | "ConditioningField" | "ControlField" | "float" | "ImageField" | "integer" | "LatentsField" | "string" | "BooleanCollection" | "ColorCollection" | "ConditioningCollection" | "ControlCollection" | "FloatCollection" | "ImageCollection" | "IntegerCollection" | "LatentsCollection" | "StringCollection" | "BooleanPolymorphic" | "ColorPolymorphic" | "ConditioningPolymorphic" | "ControlPolymorphic" | "FloatPolymorphic" | "ImagePolymorphic" | "IntegerPolymorphic" | "LatentsPolymorphic" | "StringPolymorphic" | "MainModelField" | "SDXLMainModelField" | "SDXLRefinerModelField" | "ONNXModelField" | "VaeModelField" | "LoRAModelField" | "ControlNetModelField" | "IPAdapterModelField" | "UNetField" | "VaeField" | "ClipField" | "Collection" | "CollectionItem" | "enum" | "Scheduler" | "WorkflowField" | "IsIntermediate" | "MetadataField" | "BoardField";
-    /**
-     * UIComponent
-     * @description The type of UI component to use for a field, used to override the default components, which are     inferred from the field type.
-     * @enum {string}
-     */
-    UIComponent: "none" | "textarea" | "slider";
     /**
      * _InputField
      * @description *DO NOT USE*
@@ -9675,16 +9113,16 @@ export type components = {
       input: components["schemas"]["Input"];
       /** Ui Hidden */
       ui_hidden: boolean;
-      ui_type?: components["schemas"]["UIType"];
-      ui_component?: components["schemas"]["UIComponent"];
+      ui_type: components["schemas"]["UIType"] | null;
+      ui_component: components["schemas"]["UIComponent"] | null;
       /** Ui Order */
-      ui_order?: number;
+      ui_order: number | null;
       /** Ui Choice Labels */
-      ui_choice_labels?: {
+      ui_choice_labels: {
         [key: string]: string;
-      };
+      } | null;
       /** Item Default */
-      item_default?: unknown;
+      item_default: unknown;
     };
     /**
      * _OutputField
@@ -9696,46 +9134,46 @@ export type components = {
     _OutputField: {
       /** Ui Hidden */
       ui_hidden: boolean;
-      ui_type?: components["schemas"]["UIType"];
+      ui_type: components["schemas"]["UIType"] | null;
       /** Ui Order */
-      ui_order?: number;
+      ui_order: number | null;
     };
-    /**
-     * T2IAdapterModelFormat
-     * @description An enumeration.
-     * @enum {string}
-     */
-    T2IAdapterModelFormat: "diffusers";
-    /**
-     * ControlNetModelFormat
-     * @description An enumeration.
-     * @enum {string}
-     */
-    ControlNetModelFormat: "checkpoint" | "diffusers";
-    /**
-     * StableDiffusion2ModelFormat
-     * @description An enumeration.
-     * @enum {string}
-     */
-    StableDiffusion2ModelFormat: "checkpoint" | "diffusers";
-    /**
-     * StableDiffusionXLModelFormat
-     * @description An enumeration.
-     * @enum {string}
-     */
-    StableDiffusionXLModelFormat: "checkpoint" | "diffusers";
     /**
      * StableDiffusionOnnxModelFormat
      * @description An enumeration.
      * @enum {string}
      */
     StableDiffusionOnnxModelFormat: "olive" | "onnx";
+    /**
+     * StableDiffusion2ModelFormat
+     * @description An enumeration.
+     * @enum {string}
+     */
+    StableDiffusion2ModelFormat: "checkpoint" | "diffusers";
+    /**
+     * StableDiffusion1ModelFormat
+     * @description An enumeration.
+     * @enum {string}
+     */
+    StableDiffusion1ModelFormat: "checkpoint" | "diffusers";
+    /**
+     * ControlNetModelFormat
+     * @description An enumeration.
+     * @enum {string}
+     */
+    ControlNetModelFormat: "checkpoint" | "diffusers";
     /**
      * CLIPVisionModelFormat
      * @description An enumeration.
      * @enum {string}
      */
     CLIPVisionModelFormat: "diffusers";
+    /**
+     * StableDiffusionXLModelFormat
+     * @description An enumeration.
+     * @enum {string}
+     */
+    StableDiffusionXLModelFormat: "checkpoint" | "diffusers";
     /**
      * IPAdapterModelFormat
      * @description An enumeration.
@@ -9743,11 +9181,11 @@ export type components = {
      */
     IPAdapterModelFormat: "invokeai";
     /**
-     * StableDiffusion1ModelFormat
+     * T2IAdapterModelFormat
      * @description An enumeration.
      * @enum {string}
      */
-    StableDiffusion1ModelFormat: "checkpoint" | "diffusers";
+    T2IAdapterModelFormat: "diffusers";
   };
   responses: never;
   parameters: never;
@@ -9762,382 +9200,6 @@ export type external = Record<string, never>;
 
 export type operations = {
 
-  /**
-   * List Sessions
-   * @deprecated
-   * @description Gets a list of sessions, optionally searching
-   */
-  list_sessions: {
-    parameters: {
-      query?: {
-        /** @description The page of results to get */
-        page?: number;
-        /** @description The number of results per page */
-        per_page?: number;
-        /** @description The query string to search for */
-        query?: string;
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": components["schemas"]["PaginatedResults_GraphExecutionState_"];
-        };
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Create Session
-   * @deprecated
-   * @description Creates a new session, optionally initializing it with an invocation graph
-   */
-  create_session: {
-    parameters: {
-      query?: {
-        /** @description The id of the queue to associate the session with */
-        queue_id?: string;
-      };
-    };
-    requestBody?: {
-      content: {
-        "application/json": components["schemas"]["Graph"];
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": components["schemas"]["GraphExecutionState"];
-        };
-      };
-      /** @description Invalid json */
-      400: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Get Session
-   * @deprecated
-   * @description Gets a session
-   */
-  get_session: {
-    parameters: {
-      path: {
-        /** @description The id of the session to get */
-        session_id: string;
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": components["schemas"]["GraphExecutionState"];
-        };
-      };
-      /** @description Session not found */
-      404: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Add Node
-   * @deprecated
-   * @description Adds a node to the graph
-   */
-  add_node: {
-    parameters: {
-      path: {
-        /** @description The id of the session */
-        session_id: string;
-      };
-    };
-    requestBody: {
-      content: {
-        "application/json": components["schemas"]["BooleanInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["ColorMapImageProcessorInvocation"];
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": string;
-        };
-      };
-      /** @description Invalid node or link */
-      400: {
-        content: never;
-      };
-      /** @description Session not found */
-      404: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Update Node
-   * @deprecated
-   * @description Updates a node in the graph and removes all linked edges
-   */
-  update_node: {
-    parameters: {
-      path: {
-        /** @description The id of the session */
-        session_id: string;
-        /** @description The path to the node in the graph */
-        node_path: string;
-      };
-    };
-    requestBody: {
-      content: {
-        "application/json": components["schemas"]["BooleanInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["ColorMapImageProcessorInvocation"];
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": components["schemas"]["GraphExecutionState"];
-        };
-      };
-      /** @description Invalid node or link */
-      400: {
-        content: never;
-      };
-      /** @description Session not found */
-      404: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Delete Node
-   * @deprecated
-   * @description Deletes a node in the graph and removes all linked edges
-   */
-  delete_node: {
-    parameters: {
-      path: {
-        /** @description The id of the session */
-        session_id: string;
-        /** @description The path to the node to delete */
-        node_path: string;
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": components["schemas"]["GraphExecutionState"];
-        };
-      };
-      /** @description Invalid node or link */
-      400: {
-        content: never;
-      };
-      /** @description Session not found */
-      404: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Add Edge
-   * @deprecated
-   * @description Adds an edge to the graph
-   */
-  add_edge: {
-    parameters: {
-      path: {
-        /** @description The id of the session */
-        session_id: string;
-      };
-    };
-    requestBody: {
-      content: {
-        "application/json": components["schemas"]["Edge"];
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": components["schemas"]["GraphExecutionState"];
-        };
-      };
-      /** @description Invalid node or link */
-      400: {
-        content: never;
-      };
-      /** @description Session not found */
-      404: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Delete Edge
-   * @deprecated
-   * @description Deletes an edge from the graph
-   */
-  delete_edge: {
-    parameters: {
-      path: {
-        /** @description The id of the session */
-        session_id: string;
-        /** @description The id of the node the edge is coming from */
-        from_node_id: string;
-        /** @description The field of the node the edge is coming from */
-        from_field: string;
-        /** @description The id of the node the edge is going to */
-        to_node_id: string;
-        /** @description The field of the node the edge is going to */
-        to_field: string;
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": components["schemas"]["GraphExecutionState"];
-        };
-      };
-      /** @description Invalid node or link */
-      400: {
-        content: never;
-      };
-      /** @description Session not found */
-      404: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Invoke Session
-   * @deprecated
-   * @description Invokes a session
-   */
-  invoke_session: {
-    parameters: {
-      query: {
-        /** @description The id of the queue to associate the session with */
-        queue_id: string;
-        /** @description Whether or not to invoke all remaining invocations */
-        all?: boolean;
-      };
-      path: {
-        /** @description The id of the session to invoke */
-        session_id: string;
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": unknown;
-        };
-      };
-      /** @description The invocation is queued */
-      202: {
-        content: never;
-      };
-      /** @description The session has no invocations ready to invoke */
-      400: {
-        content: never;
-      };
-      /** @description Session not found */
-      404: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
-  /**
-   * Cancel Session Invoke
-   * @deprecated
-   * @description Invokes a session
-   */
-  cancel_session_invoke: {
-    parameters: {
-      path: {
-        /** @description The id of the session to cancel */
-        session_id: string;
-      };
-    };
-    responses: {
-      /** @description Successful Response */
-      200: {
-        content: {
-          "application/json": unknown;
-        };
-      };
-      /** @description The invocation is canceled */
-      202: {
-        content: never;
-      };
-      /** @description Validation Error */
-      422: {
-        content: {
-          "application/json": components["schemas"]["HTTPValidationError"];
-        };
-      };
-    };
-  };
   /**
    * Parse Dynamicprompts
    * @description Creates a batch process
@@ -10171,9 +9233,9 @@ export type operations = {
     parameters: {
       query?: {
         /** @description Base models to include */
-        base_models?: components["schemas"]["BaseModelType"][];
+        base_models?: components["schemas"]["BaseModelType"][] | null;
         /** @description The type of model to get */
-        model_type?: components["schemas"]["ModelType"];
+        model_type?: components["schemas"]["ModelType"] | null;
       };
     };
     responses: {
@@ -10356,7 +9418,7 @@ export type operations = {
     parameters: {
       query?: {
         /** @description Save the converted model to the designated directory */
-        convert_dest_directory?: string;
+        convert_dest_directory?: string | null;
       };
       path: {
         /** @description Base model */
@@ -10497,11 +9559,11 @@ export type operations = {
         /** @description Whether this is an intermediate image */
         is_intermediate: boolean;
         /** @description The board to add this image to, if any */
-        board_id?: string;
+        board_id?: string | null;
         /** @description The session ID associated with this upload, if any */
-        session_id?: string;
+        session_id?: string | null;
         /** @description Whether to crop the image */
-        crop_visible?: boolean;
+        crop_visible?: boolean | null;
       };
     };
     requestBody: {
@@ -10620,7 +9682,7 @@ export type operations = {
       /** @description Successful Response */
       200: {
         content: {
-          "application/json": unknown;
+          "application/json": number;
         };
       };
     };
@@ -10745,13 +9807,13 @@ export type operations = {
     parameters: {
       query?: {
         /** @description The origin of images to list. */
-        image_origin?: components["schemas"]["ResourceOrigin"];
+        image_origin?: components["schemas"]["ResourceOrigin"] | null;
         /** @description The categories of image to include. */
-        categories?: components["schemas"]["ImageCategory"][];
+        categories?: components["schemas"]["ImageCategory"][] | null;
         /** @description Whether to list intermediate images. */
-        is_intermediate?: boolean;
+        is_intermediate?: boolean | null;
         /** @description The board id to filter by. Use 'none' to find images without a board. */
-        board_id?: string;
+        board_id?: string | null;
         /** @description The page offset */
         offset?: number;
         /** @description The number of images per page */
@@ -10839,6 +9901,28 @@ export type operations = {
       };
     };
   };
+  /** Download Images From List */
+  download_images_from_list: {
+    requestBody: {
+      content: {
+        "application/json": components["schemas"]["Body_download_images_from_list"];
+      };
+    };
+    responses: {
+      /** @description Successful Response */
+      200: {
+        content: {
+          "application/json": components["schemas"]["ImagesDownloaded"];
+        };
+      };
+      /** @description Validation Error */
+      422: {
+        content: {
+          "application/json": components["schemas"]["HTTPValidationError"];
+        };
+      };
+    };
+  };
   /**
    * List Boards
    * @description Gets a list of boards
@@ -10847,11 +9931,11 @@ export type operations = {
     parameters: {
       query?: {
         /** @description Whether to list all boards */
-        all?: boolean;
+        all?: boolean | null;
         /** @description The page offset */
-        offset?: number;
+        offset?: number | null;
         /** @description The number of boards per page */
-        limit?: number;
+        limit?: number | null;
       };
     };
     responses: {
@@ -10929,7 +10013,7 @@ export type operations = {
     parameters: {
       query?: {
         /** @description Permanently delete all images on the board */
-        include_images?: boolean;
+        include_images?: boolean | null;
       };
       path: {
         /** @description The id of board to delete */
@@ -11245,7 +10329,7 @@ export type operations = {
       /** @description Successful Response */
       200: {
         content: {
-          "application/json": unknown;
+          "application/json": components["schemas"]["EnqueueGraphResult"];
         };
       };
       /** @description Created */
@@ -11282,7 +10366,7 @@ export type operations = {
       /** @description Successful Response */
       200: {
         content: {
-          "application/json": unknown;
+          "application/json": components["schemas"]["EnqueueBatchResult"];
         };
       };
       /** @description Created */
@@ -11309,9 +10393,9 @@ export type operations = {
         /** @description The number of items to fetch */
         limit?: number;
         /** @description The status of items to fetch */
-        status?: "pending" | "in_progress" | "completed" | "failed" | "canceled";
+        status?: ("pending" | "in_progress" | "completed" | "failed" | "canceled") | null;
         /** @description The pagination cursor */
-        cursor?: number;
+        cursor?: number | null;
         /** @description The pagination cursor priority */
         priority?: number;
       };
@@ -11485,7 +10569,7 @@ export type operations = {
       /** @description Successful Response */
       200: {
         content: {
-          "application/json": components["schemas"]["SessionQueueItem"];
+          "application/json": components["schemas"]["SessionQueueItem"] | null;
         };
       };
       /** @description Validation Error */
@@ -11511,7 +10595,7 @@ export type operations = {
       /** @description Successful Response */
       200: {
         content: {
-          "application/json": components["schemas"]["SessionQueueItem"];
+          "application/json": components["schemas"]["SessionQueueItem"] | null;
         };
       };
       /** @description Validation Error */
diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts
index da56d2782f..6fda849b89 100644
--- a/invokeai/frontend/web/src/services/api/types.ts
+++ b/invokeai/frontend/web/src/services/api/types.ts
@@ -137,6 +137,7 @@ export type CompelInvocation = s['CompelInvocation'];
 export type DynamicPromptInvocation = s['DynamicPromptInvocation'];
 export type NoiseInvocation = s['NoiseInvocation'];
 export type DenoiseLatentsInvocation = s['DenoiseLatentsInvocation'];
+export type ResizeLatentsInvocation = s['ResizeLatentsInvocation'];
 export type ONNXTextToLatentsInvocation = s['ONNXTextToLatentsInvocation'];
 export type SDXLLoraLoaderInvocation = s['SDXLLoraLoaderInvocation'];
 export type ImageToLatentsInvocation = s['ImageToLatentsInvocation'];
diff --git a/invokeai/frontend/web/src/theme/components/text.ts b/invokeai/frontend/web/src/theme/components/text.ts
index cccbcf2391..2681fb1d67 100644
--- a/invokeai/frontend/web/src/theme/components/text.ts
+++ b/invokeai/frontend/web/src/theme/components/text.ts
@@ -1,6 +1,10 @@
 import { defineStyle, defineStyleConfig } from '@chakra-ui/react';
 import { mode } from '@chakra-ui/theme-tools';
 
+const error = defineStyle((props) => ({
+  color: mode('error.500', 'error.400')(props),
+}));
+
 const subtext = defineStyle((props) => ({
   color: mode('base.500', 'base.400')(props),
 }));
@@ -8,5 +12,6 @@ const subtext = defineStyle((props) => ({
 export const textTheme = defineStyleConfig({
   variants: {
     subtext,
+    error,
   },
 });
diff --git a/invokeai/frontend/web/yarn.lock b/invokeai/frontend/web/yarn.lock
index 2a531175d4..cc257115da 100644
--- a/invokeai/frontend/web/yarn.lock
+++ b/invokeai/frontend/web/yarn.lock
@@ -50,13 +50,20 @@
   resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55"
   integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==
 
-"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.18.3", "@babel/runtime@^7.19.4", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.5", "@babel/runtime@^7.9.2":
+"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.3", "@babel/runtime@^7.19.4", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.5", "@babel/runtime@^7.9.2":
   version "7.22.6"
   resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.6.tgz#57d64b9ae3cff1d67eb067ae117dac087f5bd438"
   integrity sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==
   dependencies:
     regenerator-runtime "^0.13.11"
 
+"@babel/runtime@^7.10.2", "@babel/runtime@^7.13.10":
+  version "7.23.2"
+  resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885"
+  integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==
+  dependencies:
+    regenerator-runtime "^0.14.0"
+
 "@babel/types@^7.22.5", "@babel/types@^7.4":
   version "7.22.5"
   resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe"
@@ -66,33 +73,33 @@
     "@babel/helper-validator-identifier" "^7.22.5"
     to-fast-properties "^2.0.0"
 
-"@chakra-ui/accordion@2.3.0":
-  version "2.3.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/accordion/-/accordion-2.3.0.tgz#2c85fd2d2734b176f019f8db9f4e075007b4e1fb"
-  integrity sha512-A4TkRw3Jnt+Fam6dSSJ62rskdrvjF3JGctYcfXlojfFIpHPuIw4pDwfZgNAxlaxWkcj0e7JJKlQ88dnZW+QfFg==
+"@chakra-ui/accordion@2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/accordion/-/accordion-2.3.1.tgz#a326509e286a5c4e8478de9bc2b4b05017039e6b"
+  integrity sha512-FSXRm8iClFyU+gVaXisOSEw0/4Q+qZbFRiuhIAkVU6Boj0FxAMrlo9a8AV5TuF77rgaHytCdHk0Ng+cyUijrag==
   dependencies:
     "@chakra-ui/descendant" "3.1.0"
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/react-use-controllable-state" "2.1.0"
     "@chakra-ui/react-use-merge-refs" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
     "@chakra-ui/transition" "2.1.0"
 
-"@chakra-ui/alert@2.2.0":
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/alert/-/alert-2.2.0.tgz#b59eadca4f083674dfcd43651b6c47b953c2c984"
-  integrity sha512-De+BT88iYOu3Con7MxQeICb1SwgAdVdgpHIYjTh3qvGlNXAQjs81rhG0fONXvwW1FIYletvr9DY2Tlg8xJe7tQ==
+"@chakra-ui/alert@2.2.1":
+  version "2.2.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/alert/-/alert-2.2.1.tgz#69f4fae19e4f8204ae1db906784139d416063d04"
+  integrity sha512-GduIqqWCkvID8hxRlKw29Jp3w93r/E9S30J2F8By3ODon9Bhk1o/KVolcPiSiQvRwKNBJCd/rBTpPpLkB+s7pw==
   dependencies:
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
     "@chakra-ui/spinner" "2.1.0"
 
-"@chakra-ui/anatomy@2.2.0", "@chakra-ui/anatomy@^2.2.0":
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/anatomy/-/anatomy-2.2.0.tgz#788229829f853dcd03314cd7ddd4f19f056ec24e"
-  integrity sha512-cD8Ms5C8+dFda0LrORMdxiFhAZwOIY1BSlCadz6/mHUIgNdQy13AHPrXiq6qWdMslqVHq10k5zH7xMPLt6kjFg==
+"@chakra-ui/anatomy@2.2.1", "@chakra-ui/anatomy@^2.2.1":
+  version "2.2.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/anatomy/-/anatomy-2.2.1.tgz#f7ef088dcb8be4f1d075f37101830199fb93f763"
+  integrity sha512-bbmyWTGwQo+aHYDMtLIj7k7hcWvwE7GFVDViLFArrrPhfUTDdQTNqhiDp1N7eh2HLyjNhc2MKXV8s2KTQqkmTg==
 
 "@chakra-ui/avatar@2.3.0":
   version "2.3.0"
@@ -137,12 +144,12 @@
   dependencies:
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/checkbox@2.3.0":
-  version "2.3.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/checkbox/-/checkbox-2.3.0.tgz#6a103555100008fcde0b25a4f3f87267dd6ea073"
-  integrity sha512-fX7M5sQK27aFWoj7vqnPkf1Q3AHmML/5dIRYfm7HEIsZXYH2C1CkM6+dijeSWIk6a0mp0r3el6SNDUti2ehH8g==
+"@chakra-ui/checkbox@2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/checkbox/-/checkbox-2.3.1.tgz#bde33a655a8f033656378e3e95ae0dc4c8e73864"
+  integrity sha512-e6qL9ntVI/Ui6g0+iljUV2chX86YMsXafldpTHBNYDEoNLjGo1lqLFzq3y6zs3iuB3DHI0X7eAG3REmMVs0A0w==
   dependencies:
-    "@chakra-ui/form-control" "2.1.0"
+    "@chakra-ui/form-control" "2.1.1"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/react-types" "2.0.7"
     "@chakra-ui/react-use-callback-ref" "2.1.0"
@@ -151,8 +158,8 @@
     "@chakra-ui/react-use-safe-layout-effect" "2.1.0"
     "@chakra-ui/react-use-update-effect" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
-    "@chakra-ui/visually-hidden" "2.1.0"
-    "@zag-js/focus-visible" "0.10.5"
+    "@chakra-ui/visually-hidden" "2.2.0"
+    "@zag-js/focus-visible" "0.16.0"
 
 "@chakra-ui/cli@^2.4.1":
   version "2.4.1"
@@ -175,12 +182,12 @@
     "@chakra-ui/react-use-merge-refs" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/close-button@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/close-button/-/close-button-2.1.0.tgz#5af435a62919793dc713be321eaff1f61749b6d5"
-  integrity sha512-KfJcz6UAaR2dDWSIv6UrCGkZQS54Fjl+DEEVOUTJ7gf4KOP4FQZCkv8hqsAB9FeCtnwU43adq2oaw3aZH/Uzew==
+"@chakra-ui/close-button@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/close-button/-/close-button-2.1.1.tgz#995b245c56eb41465a71d8667840c238618a7b66"
+  integrity sha512-gnpENKOanKexswSVpVz7ojZEALl2x5qjLYNqSQGbxz+aP9sOXPfUS56ebyBrre7T7exuWGiFeRwnM0oVeGPaiw==
   dependencies:
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
 
 "@chakra-ui/color-mode@2.2.0":
   version "2.2.0"
@@ -203,10 +210,10 @@
     "@chakra-ui/react-use-callback-ref" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/css-reset@2.2.0":
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/css-reset/-/css-reset-2.2.0.tgz#7bd8da563941709cd68e2d1cf1e71279bec038ea"
-  integrity sha512-nn7hjquIrPwCzwI4d/Y4wzM5A5xAeswREOfT8gT0Yd+U+Qnw3pPT8NPLbNJ3DvuOfJaCV6/N5ld/6RRTgYF/sQ==
+"@chakra-ui/css-reset@2.3.0":
+  version "2.3.0"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/css-reset/-/css-reset-2.3.0.tgz#83e3160a9c2a12431cad0ee27ebfbf3aedc5c9c7"
+  integrity sha512-cQwwBy5O0jzvl0K7PLTLgp8ijqLPKyuEMiDXwYzl95seD3AoeuoCLyzZcJtVqaUZ573PiBdAbY/IlZcwDOItWg==
 
 "@chakra-ui/descendant@3.1.0":
   version "3.1.0"
@@ -249,40 +256,40 @@
     "@chakra-ui/dom-utils" "2.1.0"
     react-focus-lock "^2.9.4"
 
-"@chakra-ui/form-control@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/form-control/-/form-control-2.1.0.tgz#a48ad454428c03daaaf71671925becd02a2c3f66"
-  integrity sha512-3QmWG9v6Rx+JOwJP3Wt89+AWZxK0F1NkVAgXP3WVfE9VDXOKFRV/faLT0GEe2V+l7WZHF5PLdEBvKG8Cgw2mkA==
+"@chakra-ui/form-control@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/form-control/-/form-control-2.1.1.tgz#05b06a52432642ddc7ed795bfe127108d160927d"
+  integrity sha512-LJPDzA1ITc3lhd/iDiINqGeca5bJD09PZAjePGEmmZyLPZZi8nPh/iii0RMxvKyJArsTBwXymCh+dEqK9aDzGQ==
   dependencies:
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/react-types" "2.0.7"
     "@chakra-ui/react-use-merge-refs" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/hooks@2.2.0":
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-2.2.0.tgz#f779bf85542dacd607abe7e67f4571cf8a1102fa"
-  integrity sha512-GZE64mcr20w+3KbCUPqQJHHmiFnX5Rcp8jS3YntGA4D5X2qU85jka7QkjfBwv/iduZ5Ei0YpCMYGCpi91dhD1Q==
+"@chakra-ui/hooks@2.2.1":
+  version "2.2.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-2.2.1.tgz#b86ce5eeaaab877ddcb11a50842d1227306ace28"
+  integrity sha512-RQbTnzl6b1tBjbDPf9zGRo9rf/pQMholsOudTxjy4i9GfTfz6kgp5ValGjQm2z7ng6Z31N1cnjZ1AlSzQ//ZfQ==
   dependencies:
     "@chakra-ui/react-utils" "2.0.12"
     "@chakra-ui/utils" "2.0.15"
-    compute-scroll-into-view "1.0.20"
+    compute-scroll-into-view "3.0.3"
     copy-to-clipboard "3.3.3"
 
-"@chakra-ui/icon@3.1.0":
-  version "3.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/icon/-/icon-3.1.0.tgz#48312c071b3a0ed20ce807c8bd24d5f3e9cfdb7f"
-  integrity sha512-t6v0lGCXRbwUJycN8A/nDTuLktMP+LRjKbYJnd2oL6Pm2vOl99XwEQ5cAEyEa4XoseYNEgXiLR+2TfvgfNFvcw==
+"@chakra-ui/icon@3.2.0":
+  version "3.2.0"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/icon/-/icon-3.2.0.tgz#92b9454aa0d561b4994bcd6a1b3bb1fdd5c67bef"
+  integrity sha512-xxjGLvlX2Ys4H0iHrI16t74rG9EBcpFvJ3Y3B7KMQTrnW34Kf7Da/UC8J67Gtx85mTHW020ml85SVPKORWNNKQ==
   dependencies:
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/icons@^2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/icons/-/icons-2.1.0.tgz#52677939e02f9d6b902bd2c2931e5f18d3c8b523"
-  integrity sha512-pGFxFfQ/P5VnSRnTzK8zGAJxoxkxpHo/Br9ohRZdOpuhnIHSW7va0P53UoycEO5/vNJ/7BN0oDY0k9qurChcew==
+"@chakra-ui/icons@^2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/icons/-/icons-2.1.1.tgz#58ff0f9e703f2f4f89debd600ce4e438f43f9c9a"
+  integrity sha512-3p30hdo4LlRZTT5CwoAJq3G9fHI0wDc0pBaMHj4SUn0yomO+RcDRlzhdXqdr5cVnzax44sqXJVnf3oQG0eI+4g==
   dependencies:
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
 
 "@chakra-ui/image@2.1.0":
   version "2.1.0"
@@ -292,24 +299,24 @@
     "@chakra-ui/react-use-safe-layout-effect" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/input@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/input/-/input-2.1.0.tgz#45a2e2ccdd65dc9f6dee11b6e3043438864bf806"
-  integrity sha512-HItI2vq6vupCuixdzof4sIanGdLlszhDtlR5be5z8Nrda1RkXVqI+9CTJPbNsx2nIKEfwPt01pnT9mozoOSMMw==
+"@chakra-ui/input@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/input/-/input-2.1.1.tgz#c9666bd1efd7763458bec713fb87cc3f365ec15d"
+  integrity sha512-RQYzQ/qcak3eCuCfvSqc1kEFx0sCcnIeiSi7i0r70CeBnAUK/CP1/4Uz849FpKz81K4z2SikC9MkHPQd8ZpOwg==
   dependencies:
-    "@chakra-ui/form-control" "2.1.0"
+    "@chakra-ui/form-control" "2.1.1"
     "@chakra-ui/object-utils" "2.1.0"
     "@chakra-ui/react-children-utils" "2.0.6"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/layout@2.3.0":
-  version "2.3.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/layout/-/layout-2.3.0.tgz#c53219235db737202006b8b0881b82fedcf3b225"
-  integrity sha512-tp1/Bn+cHn0Q4HWKY62HtOwzhpH1GUA3i5fvs23HEhOEryTps05hyuQVeJ71fLqSs6f1QEIdm+9It+5WCj64vQ==
+"@chakra-ui/layout@2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/layout/-/layout-2.3.1.tgz#0601c5eb91555d24a7015a7c9d4e01fed2698557"
+  integrity sha512-nXuZ6WRbq0WdgnRgLw+QuxWAHuhDtVX8ElWqcTK+cSMFg/52eVP47czYBE5F35YhnoW2XBwfNoNgZ7+e8Z01Rg==
   dependencies:
     "@chakra-ui/breakpoint-utils" "2.0.8"
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/object-utils" "2.1.0"
     "@chakra-ui/react-children-utils" "2.0.6"
     "@chakra-ui/react-context" "2.1.0"
@@ -334,10 +341,10 @@
     "@chakra-ui/react-env" "3.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/menu@2.2.0":
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/menu/-/menu-2.2.0.tgz#ba74b538a3fa3dc46313368ed2878f92b479e6d7"
-  integrity sha512-l7HQjriW4JGeCyxDdguAzekwwB+kHGDLxACi0DJNp37sil51SRaN1S1OrneISbOHVpHuQB+KVNgU0rqhoglVew==
+"@chakra-ui/menu@2.2.1":
+  version "2.2.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/menu/-/menu-2.2.1.tgz#7d9810d435f6b40fa72ed867a33b88a1ef75073f"
+  integrity sha512-lJS7XEObzJxsOwWQh7yfG4H8FzFPRP5hVPN/CL+JzytEINCSBvsCDHrYPQGp7jzpCi8vnTqQQGQe0f8dwnXd2g==
   dependencies:
     "@chakra-ui/clickable" "2.1.0"
     "@chakra-ui/descendant" "3.1.0"
@@ -355,12 +362,12 @@
     "@chakra-ui/shared-utils" "2.0.5"
     "@chakra-ui/transition" "2.1.0"
 
-"@chakra-ui/modal@2.3.0":
-  version "2.3.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/modal/-/modal-2.3.0.tgz#f7c35bb457c3c4be391c9366f892a5a779af810a"
-  integrity sha512-S1sITrIeLSf21LJ0Vz8xZhj5fWEud5z5Dl2dmvOEv1ezypgOrCCBdOEnnqCkoEKZDbKvzZWZXWR5791ikLP6+g==
+"@chakra-ui/modal@2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/modal/-/modal-2.3.1.tgz#524dc32b6b4f545b54ae531dbf6c74e1052ee794"
+  integrity sha512-TQv1ZaiJMZN+rR9DK0snx/OPwmtaGH1HbZtlYt4W4s6CzyK541fxLRTjIXfEzIGpvNW+b6VFuFjbcR78p4DEoQ==
   dependencies:
-    "@chakra-ui/close-button" "2.1.0"
+    "@chakra-ui/close-button" "2.1.1"
     "@chakra-ui/focus-lock" "2.1.0"
     "@chakra-ui/portal" "2.1.0"
     "@chakra-ui/react-context" "2.1.0"
@@ -368,17 +375,17 @@
     "@chakra-ui/react-use-merge-refs" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
     "@chakra-ui/transition" "2.1.0"
-    aria-hidden "^1.2.2"
-    react-remove-scroll "^2.5.5"
+    aria-hidden "^1.2.3"
+    react-remove-scroll "^2.5.6"
 
-"@chakra-ui/number-input@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/number-input/-/number-input-2.1.0.tgz#7812a6602edbed26829a8f7defe8c4f9f175421a"
-  integrity sha512-/gEAzQHhrMA+1rzyCMaN8OkKtUPuER6iA+nloYEYBoT7dH/EoNlRtBkiIQhDp+E4VpgZJ0SK3OVrm9/eBbtHHg==
+"@chakra-ui/number-input@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/number-input/-/number-input-2.1.1.tgz#5308a30e972cd45a017f613996d7d5c1f32bd89f"
+  integrity sha512-B4xwUPyr0NmjGN/dBhOmCD2xjX6OY1pr9GmGH3GQRozMsLAClD3TibwiZetwlyCp02qQqiFwEcZmUxaX88794Q==
   dependencies:
     "@chakra-ui/counter" "2.1.0"
-    "@chakra-ui/form-control" "2.1.0"
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/form-control" "2.1.1"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/react-types" "2.0.7"
     "@chakra-ui/react-use-callback-ref" "2.1.0"
@@ -411,12 +418,12 @@
     "@chakra-ui/react-use-merge-refs" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/popover@2.2.0":
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/popover/-/popover-2.2.0.tgz#470c4814447010a1b7db6839fcc3e8983cbabb60"
-  integrity sha512-cTqXdgkU0vgK82AR1nWcC2MJYhEL/y6uTeprvO2+j4o2D0yPrzVMuIZZRl0abrQwiravQyVGEMgA5y0ZLYwbiQ==
+"@chakra-ui/popover@2.2.1":
+  version "2.2.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/popover/-/popover-2.2.1.tgz#89cfd29817abcd204da570073c0f2b4d8072c3a3"
+  integrity sha512-K+2ai2dD0ljvJnlrzesCDT9mNzLifE3noGKZ3QwLqd/K34Ym1W/0aL1ERSynrcG78NKoXS54SdEzkhCZ4Gn/Zg==
   dependencies:
-    "@chakra-ui/close-button" "2.1.0"
+    "@chakra-ui/close-button" "2.1.1"
     "@chakra-ui/lazy-utils" "2.0.5"
     "@chakra-ui/popper" "3.1.0"
     "@chakra-ui/react-context" "2.1.0"
@@ -452,28 +459,28 @@
   dependencies:
     "@chakra-ui/react-context" "2.1.0"
 
-"@chakra-ui/provider@2.4.0":
-  version "2.4.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/provider/-/provider-2.4.0.tgz#1649e607b7dddd8dd160e624946769a29f67d9a3"
-  integrity sha512-KJ/TNczpY+EStQXa2Y5PZ+senlBHrY7P+RpBgJLBZLGkQUCS3APw5KvCwgpA0COb2M4AZXCjw+rm+Ko7ontlgA==
+"@chakra-ui/provider@2.4.1":
+  version "2.4.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/provider/-/provider-2.4.1.tgz#0c6c1bab2b50fdf9dfbcbb363df8982988c54d65"
+  integrity sha512-u4g02V9tJ9vVYfkLz5jBn/bKlAyjLdg4Sh3f7uckmYVAZpOL/uUlrStyADrynu3tZhI+BE8XdmXC4zs/SYD7ow==
   dependencies:
-    "@chakra-ui/css-reset" "2.2.0"
+    "@chakra-ui/css-reset" "2.3.0"
     "@chakra-ui/portal" "2.1.0"
     "@chakra-ui/react-env" "3.1.0"
-    "@chakra-ui/system" "2.6.0"
+    "@chakra-ui/system" "2.6.1"
     "@chakra-ui/utils" "2.0.15"
 
-"@chakra-ui/radio@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/radio/-/radio-2.1.0.tgz#68b2cb4193570369568052cb1254163224a1479c"
-  integrity sha512-WiRlSCqKWgy4m9106w4g77kcLYqBxqGhFRO1pTTJp99rxpM6jNadOeK+moEjqj64N9mSz3njEecMJftKKcOYdg==
+"@chakra-ui/radio@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/radio/-/radio-2.1.1.tgz#399983ce8a1bbc81e7cddfbaf091f54a1645fb7e"
+  integrity sha512-5JXDVvMWsF/Cprh6BKfcTLbLtRcgD6Wl2zwbNU30nmKIE8+WUfqD7JQETV08oWEzhi3Ea4e5EHvyll2sGx8H3w==
   dependencies:
-    "@chakra-ui/form-control" "2.1.0"
+    "@chakra-ui/form-control" "2.1.1"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/react-types" "2.0.7"
     "@chakra-ui/react-use-merge-refs" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
-    "@zag-js/focus-visible" "0.10.5"
+    "@zag-js/focus-visible" "0.16.0"
 
 "@chakra-ui/react-children-utils@2.0.6":
   version "2.0.6"
@@ -617,71 +624,71 @@
   dependencies:
     "@chakra-ui/utils" "2.0.15"
 
-"@chakra-ui/react@^2.8.0":
-  version "2.8.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/react/-/react-2.8.0.tgz#cc76a2448f9bc85f1645a1afb90d5756a5313ac3"
-  integrity sha512-tV82DaqE4fMbLIWq58BYh4Ol3gAlNEn+qYOzx8bPrZudboEDnboq8aVfSBwWOY++MLWz2Nn7CkT69YRm91e5sg==
+"@chakra-ui/react@^2.8.1":
+  version "2.8.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/react/-/react-2.8.1.tgz#fd80632b0ef34434443d8999d03d297f130aabcf"
+  integrity sha512-UL9Rtj4DovP3+oVbI06gsdfyJJb+wmS2RYnGNXjW9tsjCyXxjlBw9TAUj0jyOfWe0+zd/4juL8+J+QCwmdhptg==
   dependencies:
-    "@chakra-ui/accordion" "2.3.0"
-    "@chakra-ui/alert" "2.2.0"
+    "@chakra-ui/accordion" "2.3.1"
+    "@chakra-ui/alert" "2.2.1"
     "@chakra-ui/avatar" "2.3.0"
     "@chakra-ui/breadcrumb" "2.2.0"
     "@chakra-ui/button" "2.1.0"
     "@chakra-ui/card" "2.2.0"
-    "@chakra-ui/checkbox" "2.3.0"
-    "@chakra-ui/close-button" "2.1.0"
+    "@chakra-ui/checkbox" "2.3.1"
+    "@chakra-ui/close-button" "2.1.1"
     "@chakra-ui/control-box" "2.1.0"
     "@chakra-ui/counter" "2.1.0"
-    "@chakra-ui/css-reset" "2.2.0"
+    "@chakra-ui/css-reset" "2.3.0"
     "@chakra-ui/editable" "3.1.0"
     "@chakra-ui/focus-lock" "2.1.0"
-    "@chakra-ui/form-control" "2.1.0"
-    "@chakra-ui/hooks" "2.2.0"
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/form-control" "2.1.1"
+    "@chakra-ui/hooks" "2.2.1"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/image" "2.1.0"
-    "@chakra-ui/input" "2.1.0"
-    "@chakra-ui/layout" "2.3.0"
+    "@chakra-ui/input" "2.1.1"
+    "@chakra-ui/layout" "2.3.1"
     "@chakra-ui/live-region" "2.1.0"
     "@chakra-ui/media-query" "3.3.0"
-    "@chakra-ui/menu" "2.2.0"
-    "@chakra-ui/modal" "2.3.0"
-    "@chakra-ui/number-input" "2.1.0"
+    "@chakra-ui/menu" "2.2.1"
+    "@chakra-ui/modal" "2.3.1"
+    "@chakra-ui/number-input" "2.1.1"
     "@chakra-ui/pin-input" "2.1.0"
-    "@chakra-ui/popover" "2.2.0"
+    "@chakra-ui/popover" "2.2.1"
     "@chakra-ui/popper" "3.1.0"
     "@chakra-ui/portal" "2.1.0"
     "@chakra-ui/progress" "2.2.0"
-    "@chakra-ui/provider" "2.4.0"
-    "@chakra-ui/radio" "2.1.0"
+    "@chakra-ui/provider" "2.4.1"
+    "@chakra-ui/radio" "2.1.1"
     "@chakra-ui/react-env" "3.1.0"
-    "@chakra-ui/select" "2.1.0"
+    "@chakra-ui/select" "2.1.1"
     "@chakra-ui/skeleton" "2.1.0"
     "@chakra-ui/skip-nav" "2.1.0"
     "@chakra-ui/slider" "2.1.0"
     "@chakra-ui/spinner" "2.1.0"
-    "@chakra-ui/stat" "2.1.0"
-    "@chakra-ui/stepper" "2.3.0"
+    "@chakra-ui/stat" "2.1.1"
+    "@chakra-ui/stepper" "2.3.1"
     "@chakra-ui/styled-system" "2.9.1"
-    "@chakra-ui/switch" "2.1.0"
-    "@chakra-ui/system" "2.6.0"
+    "@chakra-ui/switch" "2.1.1"
+    "@chakra-ui/system" "2.6.1"
     "@chakra-ui/table" "2.1.0"
-    "@chakra-ui/tabs" "2.2.0"
-    "@chakra-ui/tag" "3.1.0"
-    "@chakra-ui/textarea" "2.1.0"
-    "@chakra-ui/theme" "3.2.0"
-    "@chakra-ui/theme-utils" "2.0.19"
-    "@chakra-ui/toast" "7.0.0"
+    "@chakra-ui/tabs" "3.0.0"
+    "@chakra-ui/tag" "3.1.1"
+    "@chakra-ui/textarea" "2.1.1"
+    "@chakra-ui/theme" "3.3.0"
+    "@chakra-ui/theme-utils" "2.0.20"
+    "@chakra-ui/toast" "7.0.1"
     "@chakra-ui/tooltip" "2.3.0"
     "@chakra-ui/transition" "2.1.0"
     "@chakra-ui/utils" "2.0.15"
-    "@chakra-ui/visually-hidden" "2.1.0"
+    "@chakra-ui/visually-hidden" "2.2.0"
 
-"@chakra-ui/select@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/select/-/select-2.1.0.tgz#4c9a6e881281e77ed35ba7a2e343f235b7e0b2fd"
-  integrity sha512-6GEjCJNOm1pS9E7XRvodoVOuSFl82Jio3MGWgmcQrLznjJAhIZVMq85vCQqzGpjjfbHys/UctfdJY75Ctas/Jg==
+"@chakra-ui/select@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/select/-/select-2.1.1.tgz#0792eeebdb82b1710c4527e7e8e2e07c686c714d"
+  integrity sha512-CERDATncv5w05Zo5/LrFtf1yKp1deyMUyDGv6eZvQG/etyukH4TstsuIHt/0GfNXrCF3CJLZ8lINzpv5wayVjQ==
   dependencies:
-    "@chakra-ui/form-control" "2.1.0"
+    "@chakra-ui/form-control" "2.1.1"
     "@chakra-ui/shared-utils" "2.0.5"
 
 "@chakra-ui/shared-utils@2.0.5":
@@ -726,21 +733,21 @@
   dependencies:
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/stat@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/stat/-/stat-2.1.0.tgz#6643b507358e9cacf008387b3f12b75899497369"
-  integrity sha512-sqx0/AdFFZ80dsiM5owmhtQyYl+zON1r+IY0m70I/ABRVy+I3br06xdUhoaxh3tcP7c0O/BQgb+VCfXa9Y34CA==
+"@chakra-ui/stat@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/stat/-/stat-2.1.1.tgz#a204ba915795345996a16c79794d84826d7dcc2d"
+  integrity sha512-LDn0d/LXQNbAn2KaR3F1zivsZCewY4Jsy1qShmfBMKwn6rI8yVlbvu6SiA3OpHS0FhxbsZxQI6HefEoIgtqY6Q==
   dependencies:
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/stepper@2.3.0":
-  version "2.3.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/stepper/-/stepper-2.3.0.tgz#5714df429936839145a62b5c197cff26b872b660"
-  integrity sha512-q80QX/NLrjJQIlBP1N+Q8GVJb7/HiOpMoK1PlP4denB/KxkU2K8GEjss8U2vklR1XsWJy1fwfj03+66Q78Uk/Q==
+"@chakra-ui/stepper@2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/stepper/-/stepper-2.3.1.tgz#a0a0b73e147f202ab4e51cae55dad45489cc89fd"
+  integrity sha512-ky77lZbW60zYkSXhYz7kbItUpAQfEdycT0Q4bkHLxfqbuiGMf8OmgZOQkOB9uM4v0zPwy2HXhe0vq4Dd0xa55Q==
   dependencies:
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
@@ -753,26 +760,26 @@
     csstype "^3.0.11"
     lodash.mergewith "4.6.2"
 
-"@chakra-ui/switch@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/switch/-/switch-2.1.0.tgz#750474ef7f0a9854062e692cbbe9f3ed0cfbc4d8"
-  integrity sha512-uWHOaIDQdGh+mszxeppj5aYVepbkSK445KZlJJkfr9Bnr6sythTwM63HSufnVDiTEE4uRqegv9jEjZK2JKA+9A==
+"@chakra-ui/switch@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/switch/-/switch-2.1.1.tgz#8049963e6421cdd5eaaac1d20d9febae8d731b62"
+  integrity sha512-cOHIhW5AlLZSFENxFEBYTBniqiduOowa1WdzslP1Fd0usBFaD5iAgOY1Fvr7xKhE8nmzzeMCkPB3XBvUSWnawQ==
   dependencies:
-    "@chakra-ui/checkbox" "2.3.0"
+    "@chakra-ui/checkbox" "2.3.1"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/system@2.6.0":
-  version "2.6.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/system/-/system-2.6.0.tgz#29f65bb0887ee0816bbb7b4b098ca5aa4918c409"
-  integrity sha512-MgAFRz9V1pW0dplwWsB99hx49LCC+LsrkMala7KXcP0OvWdrkjw+iu+voBksO3626+glzgIwlZW113Eja+7JEQ==
+"@chakra-ui/system@2.6.1":
+  version "2.6.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/system/-/system-2.6.1.tgz#22ee50ddc9e1f56b974a0dd42d86108391a2f372"
+  integrity sha512-P5Q/XRWy3f1pXJ7IxDkV+Z6AT7GJeR2JlBnQl109xewVQcBLWWMIp702fFMFw8KZ2ALB/aYKtWm5EmQMddC/tg==
   dependencies:
     "@chakra-ui/color-mode" "2.2.0"
     "@chakra-ui/object-utils" "2.1.0"
     "@chakra-ui/react-utils" "2.0.12"
     "@chakra-ui/styled-system" "2.9.1"
-    "@chakra-ui/theme-utils" "2.0.19"
+    "@chakra-ui/theme-utils" "2.0.20"
     "@chakra-ui/utils" "2.0.15"
-    react-fast-compare "3.2.1"
+    react-fast-compare "3.2.2"
 
 "@chakra-ui/table@2.1.0":
   version "2.1.0"
@@ -782,10 +789,10 @@
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/tabs@2.2.0":
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/tabs/-/tabs-2.2.0.tgz#72b6bf8bff3d3da3effb115991bf24e2157e29d2"
-  integrity sha512-ulN7McHZ322qlbJXg8S+IwdN8Axh8q0HzYBOHzSdcnVphEytfv9TsfJhN0Hx5yjkpekAzG5fewn33ZdIpIpKyQ==
+"@chakra-ui/tabs@3.0.0":
+  version "3.0.0"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/tabs/-/tabs-3.0.0.tgz#854c06880af26158d7c72881c4b5e0453f6c485d"
+  integrity sha512-6Mlclp8L9lqXmsGWF5q5gmemZXOiOYuh0SGT/7PgJVNPz3LXREXlXg2an4MBUD8W5oTkduCX+3KTMCwRrVrDYw==
   dependencies:
     "@chakra-ui/clickable" "2.1.0"
     "@chakra-ui/descendant" "3.1.0"
@@ -797,64 +804,64 @@
     "@chakra-ui/react-use-safe-layout-effect" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/tag@3.1.0":
-  version "3.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/tag/-/tag-3.1.0.tgz#b2c06254e1d5aaaf77ff41e5d2e6548b404cabd7"
-  integrity sha512-Mn2u828z5HvqEBEG+tUJWe3al5tzN87bK2U0QfThx3+zqWbBCWBSCVfnWRtkNh80m+5a1TekexDAPZqu5G8zdw==
+"@chakra-ui/tag@3.1.1":
+  version "3.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/tag/-/tag-3.1.1.tgz#d05284b6549a84d3a08e57eec57df3ad0eebd882"
+  integrity sha512-Bdel79Dv86Hnge2PKOU+t8H28nm/7Y3cKd4Kfk9k3lOpUh4+nkSGe58dhRzht59lEqa4N9waCgQiBdkydjvBXQ==
   dependencies:
-    "@chakra-ui/icon" "3.1.0"
+    "@chakra-ui/icon" "3.2.0"
     "@chakra-ui/react-context" "2.1.0"
 
-"@chakra-ui/textarea@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/textarea/-/textarea-2.1.0.tgz#d0f157c9a09aea87c372409eead4292bd26999a0"
-  integrity sha512-4F7X/lPRsY+sPxYrWGrhh1pBtdnFvVllIOapzAwnjYwsflm+vf6c+9ZgoDWobXsNezJ9fcqN0FTPwaBnDvDQRQ==
+"@chakra-ui/textarea@2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/textarea/-/textarea-2.1.1.tgz#3e33404ff8470140e877840a5702a406996a3834"
+  integrity sha512-28bpwgmXg3BzSpg8i1Ao9h7pHaE1j2mBBFJpWaqPgMhS0IHm0BQsqqyWU6PsxxJDvrC4HN6MTzrIL4C1RA1I0A==
   dependencies:
-    "@chakra-ui/form-control" "2.1.0"
+    "@chakra-ui/form-control" "2.1.1"
     "@chakra-ui/shared-utils" "2.0.5"
 
-"@chakra-ui/theme-tools@2.1.0", "@chakra-ui/theme-tools@^2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/theme-tools/-/theme-tools-2.1.0.tgz#ad34f2fdda61305ac96f69ad9ce38ad12f8bfdbf"
-  integrity sha512-TKv4trAY8q8+DWdZrpSabTd3SZtZrnzFDwUdzhbWBhFEDEVR3fAkRTPpnPDtf1X9w1YErWn3QAcMACVFz4+vkw==
+"@chakra-ui/theme-tools@2.1.1", "@chakra-ui/theme-tools@^2.1.1":
+  version "2.1.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/theme-tools/-/theme-tools-2.1.1.tgz#c7f3072ab533d7abc6a3831666be3c172f992554"
+  integrity sha512-n14L5L3ej3Zy+Xm/kDKO1G6/DkmieT7Li1C7NzMRcUj5C9YybQpyo7IZZ0BBUh3u+OVnKVhNC3d4P2NYDGRXmA==
   dependencies:
-    "@chakra-ui/anatomy" "2.2.0"
+    "@chakra-ui/anatomy" "2.2.1"
     "@chakra-ui/shared-utils" "2.0.5"
-    color2k "^2.0.0"
+    color2k "^2.0.2"
 
-"@chakra-ui/theme-utils@2.0.19":
-  version "2.0.19"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/theme-utils/-/theme-utils-2.0.19.tgz#47e6af43f8ef22403686b779ca1a869ab1b7a5ec"
-  integrity sha512-UQ+KvozTN86+0oA80rdQd1a++4rm4ulo+DEabkgwNpkK3yaWsucOxkDQpi2sMIMvw5X0oaWvNBZJuVyK7HdOXg==
+"@chakra-ui/theme-utils@2.0.20":
+  version "2.0.20"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/theme-utils/-/theme-utils-2.0.20.tgz#fdc4947ac4b95c16ff5885707c9a931c43b80cf6"
+  integrity sha512-IkAzSmwBlRIZ3dN2InDz0tf9SldbckVkgwylCobSFmYP8lnMjykL8Lex1BBo9U8UQjZxEDVZ+Qw6SeayKRntOQ==
   dependencies:
     "@chakra-ui/shared-utils" "2.0.5"
     "@chakra-ui/styled-system" "2.9.1"
-    "@chakra-ui/theme" "3.2.0"
+    "@chakra-ui/theme" "3.3.0"
     lodash.mergewith "4.6.2"
 
-"@chakra-ui/theme@3.2.0":
-  version "3.2.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/theme/-/theme-3.2.0.tgz#b8232d770e542895cf82535942a74ad803bb7133"
-  integrity sha512-q9mppdkhmaBnvOT8REr/lVNNBX/prwm50EzObJ+r+ErVhNQDc55gCFmtr+It3xlcCqmOteG6XUdwRCJz8qzOqg==
+"@chakra-ui/theme@3.3.0":
+  version "3.3.0"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/theme/-/theme-3.3.0.tgz#7fe364322e75c7bdfa45b96dd3db6dac7eb8f7ef"
+  integrity sha512-VHY2ax5Wqgfm83U/zYBk0GS0TGD8m41s/rxQgnEq8tU+ug1YZjvOZmtOq/VjfKP/bQraFhCt05zchcxXmDpEYg==
   dependencies:
-    "@chakra-ui/anatomy" "2.2.0"
+    "@chakra-ui/anatomy" "2.2.1"
     "@chakra-ui/shared-utils" "2.0.5"
-    "@chakra-ui/theme-tools" "2.1.0"
+    "@chakra-ui/theme-tools" "2.1.1"
 
-"@chakra-ui/toast@7.0.0":
-  version "7.0.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/toast/-/toast-7.0.0.tgz#6c6f1b7b8dc458ed0827b2edc47eb7d4075c95dc"
-  integrity sha512-XQgSnn4DYRgfOBzBvh8GI/AZ7SfrO8wlVSmChfp92Nfmqm7tRDUT9x8ws/iNKAvMRHkhl7fmRjJ39ipeXYrMvA==
+"@chakra-ui/toast@7.0.1":
+  version "7.0.1"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/toast/-/toast-7.0.1.tgz#11113b9185409ed1dc7a062f0498673f0840a013"
+  integrity sha512-V5JUhw6RZxbGRTijvd5k4iEMLCfbzTLNWbZLZhRZk10YvFfAP5OYfRCm68zpE/t3orN/f+4ZLL3P+Wb4E7oSmw==
   dependencies:
-    "@chakra-ui/alert" "2.2.0"
-    "@chakra-ui/close-button" "2.1.0"
+    "@chakra-ui/alert" "2.2.1"
+    "@chakra-ui/close-button" "2.1.1"
     "@chakra-ui/portal" "2.1.0"
     "@chakra-ui/react-context" "2.1.0"
     "@chakra-ui/react-use-timeout" "2.1.0"
     "@chakra-ui/react-use-update-effect" "2.1.0"
     "@chakra-ui/shared-utils" "2.0.5"
     "@chakra-ui/styled-system" "2.9.1"
-    "@chakra-ui/theme" "3.2.0"
+    "@chakra-ui/theme" "3.3.0"
 
 "@chakra-ui/tooltip@2.3.0":
   version "2.3.0"
@@ -887,10 +894,10 @@
     framesync "6.1.2"
     lodash.mergewith "4.6.2"
 
-"@chakra-ui/visually-hidden@2.1.0":
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/@chakra-ui/visually-hidden/-/visually-hidden-2.1.0.tgz#9ec573964e5a07f8682574a060140d78e9f91c32"
-  integrity sha512-3OHKqTz78PX7V4qto+a5Y6VvH6TbU3Pg6Z0Z2KnDkOBP3Po8fiz0kk+/OSPzIwdcSsQKiocLi0c1pnnUPdMZPg==
+"@chakra-ui/visually-hidden@2.2.0":
+  version "2.2.0"
+  resolved "https://registry.yarnpkg.com/@chakra-ui/visually-hidden/-/visually-hidden-2.2.0.tgz#9b0ecef8f01263ab808ba3bda7b36a0d91b4d5c1"
+  integrity sha512-KmKDg01SrQ7VbTD3+cPWf/UfpF5MSwm3v7MWi0n5t8HnnadT13MF0MJCDSXbBWnzLv1ZKJ6zlyAOeARWX+DpjQ==
 
 "@dagrejs/graphlib@^2.1.13":
   version "2.1.13"
@@ -1302,27 +1309,30 @@
     minimatch "^3.1.2"
     strip-json-comments "^3.1.1"
 
-"@eslint/js@^8.47.0":
-  version "8.47.0"
-  resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.47.0.tgz#5478fdf443ff8158f9de171c704ae45308696c7d"
-  integrity sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==
+"@eslint/js@8.51.0":
+  version "8.51.0"
+  resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.51.0.tgz#6d419c240cfb2b66da37df230f7e7eef801c32fa"
+  integrity sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==
 
 "@fastify/deepmerge@^1.0.0":
   version "1.3.0"
   resolved "https://registry.yarnpkg.com/@fastify/deepmerge/-/deepmerge-1.3.0.tgz#8116858108f0c7d9fd460d05a7d637a13fe3239a"
   integrity sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==
 
-"@floating-ui/core@^1.3.1":
-  version "1.3.1"
-  resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.3.1.tgz#4d795b649cc3b1cbb760d191c80dcb4353c9a366"
-  integrity sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==
-
-"@floating-ui/dom@^1.2.1", "@floating-ui/dom@^1.3.0":
-  version "1.4.5"
-  resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.4.5.tgz#336dfb9870c98b471ff5802002982e489b8bd1c5"
-  integrity sha512-96KnRWkRnuBSSFbj0sFGwwOUd8EkiecINVl0O9wiZlZ64EkpyAOG3Xc2vKKNJmru0Z7RqWNymA+6b8OZqjgyyw==
+"@floating-ui/core@^1.4.2":
+  version "1.5.0"
+  resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.5.0.tgz#5c05c60d5ae2d05101c3021c1a2a350ddc027f8c"
+  integrity sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==
   dependencies:
-    "@floating-ui/core" "^1.3.1"
+    "@floating-ui/utils" "^0.1.3"
+
+"@floating-ui/dom@^1.2.1", "@floating-ui/dom@^1.5.1":
+  version "1.5.3"
+  resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.5.3.tgz#54e50efcb432c06c23cd33de2b575102005436fa"
+  integrity sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==
+  dependencies:
+    "@floating-ui/core" "^1.4.2"
+    "@floating-ui/utils" "^0.1.3"
 
 "@floating-ui/react-dom@^1.3.0":
   version "1.3.0"
@@ -1331,12 +1341,12 @@
   dependencies:
     "@floating-ui/dom" "^1.2.1"
 
-"@floating-ui/react-dom@^2.0.1":
-  version "2.0.1"
-  resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.1.tgz#7972a4fc488a8c746cded3cfe603b6057c308a91"
-  integrity sha512-rZtAmSht4Lry6gdhAJDrCp/6rKN7++JnL1/Anbr/DdeyYXQPxvg/ivrbYvJulbRf4vL8b212suwMM2lxbv+RQA==
+"@floating-ui/react-dom@^2.0.2":
+  version "2.0.2"
+  resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.2.tgz#fab244d64db08e6bed7be4b5fcce65315ef44d20"
+  integrity sha512-5qhlDvjaLmAst/rKb3VdlCinwTF4EYMiVxuuc/HVUjs46W0zgtbMmAZ1UTsDrRTxRmUEzl92mOtWbeeXL26lSQ==
   dependencies:
-    "@floating-ui/dom" "^1.3.0"
+    "@floating-ui/dom" "^1.5.1"
 
 "@floating-ui/react@^0.19.1":
   version "0.19.2"
@@ -1347,20 +1357,25 @@
     aria-hidden "^1.1.3"
     tabbable "^6.0.1"
 
-"@fontsource-variable/inter@^5.0.8":
-  version "5.0.8"
-  resolved "https://registry.yarnpkg.com/@fontsource-variable/inter/-/inter-5.0.8.tgz#bd6d61ece1019c59b0ac330a138d48a34dfa6d8c"
-  integrity sha512-WkYfFNccmEIeL2fNg0mYeLWqOoB7xD8MFxFRc4IwbSP2o8ZaBt36v5aW4by4MyrgGRMNk7uNi5LbvYKq6clPjw==
+"@floating-ui/utils@^0.1.3":
+  version "0.1.6"
+  resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.1.6.tgz#22958c042e10b67463997bd6ea7115fe28cbcaf9"
+  integrity sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==
 
-"@fontsource/inter@^5.0.8":
-  version "5.0.8"
-  resolved "https://registry.yarnpkg.com/@fontsource/inter/-/inter-5.0.8.tgz#61b50cb0eb72b14ae1938d47c4a9a91546d2a50c"
-  integrity sha512-28knWH1BfOiRalfLs90U4sge5mpQ8ZH6FS0PTT+IZMKrZ7wNHDHRuKa1kQJg+uHcc6axBppnxll+HXM4c7zo/Q==
+"@fontsource-variable/inter@^5.0.13":
+  version "5.0.13"
+  resolved "https://registry.yarnpkg.com/@fontsource-variable/inter/-/inter-5.0.13.tgz#ddffb8cdc888c00bc232e30698fb872b775ee115"
+  integrity sha512-mb2WyZ2rHeqIG8aqGJIvLBOmo4sg2x7SHlsE6PUhwxbOicVzO59EZwSGtzNO3FmchuDPFVAxzcXYcR5B6jE6Qw==
 
-"@humanwhocodes/config-array@^0.11.10":
-  version "0.11.10"
-  resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2"
-  integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==
+"@fontsource/inter@^5.0.13":
+  version "5.0.13"
+  resolved "https://registry.yarnpkg.com/@fontsource/inter/-/inter-5.0.13.tgz#b106fdc43b8eea8d6f5c0ce55941b1ae577c49e5"
+  integrity sha512-FVIBhP9X/x02blF2VQl2Pji/c3jUjkWEQ9bom4vIrGwO1MlHRDXhXx9iA1hhjpcCIfH3oX68ihIBdYcFnOXhsg==
+
+"@humanwhocodes/config-array@^0.11.11":
+  version "0.11.11"
+  resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844"
+  integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==
   dependencies:
     "@humanwhocodes/object-schema" "^1.2.1"
     debug "^4.1.1"
@@ -1377,63 +1392,63 @@
   integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
 
 "@mantine/core@^6.0.19":
-  version "6.0.19"
-  resolved "https://registry.yarnpkg.com/@mantine/core/-/core-6.0.19.tgz#612413f0e8eb117e6a39068a625c6ccf2ae2ccdd"
-  integrity sha512-SvMZCOgCc315SIg6hkuLM0ZnBaAac4VFDHZ0BM5LIE4MPJUpe4QOLsg/5RGxOa5s7JRCtu/dawH3/9frvfDrhw==
+  version "6.0.21"
+  resolved "https://registry.yarnpkg.com/@mantine/core/-/core-6.0.21.tgz#6e3a1b8d0f6869518a644d5f5e3d55a5db7e1e51"
+  integrity sha512-Kx4RrRfv0I+cOCIcsq/UA2aWcYLyXgW3aluAuW870OdXnbII6qg7RW28D+r9D76SHPxWFKwIKwmcucAG08Divg==
   dependencies:
     "@floating-ui/react" "^0.19.1"
-    "@mantine/styles" "6.0.19"
-    "@mantine/utils" "6.0.19"
+    "@mantine/styles" "6.0.21"
+    "@mantine/utils" "6.0.21"
     "@radix-ui/react-scroll-area" "1.0.2"
     react-remove-scroll "^2.5.5"
     react-textarea-autosize "8.3.4"
 
 "@mantine/form@^6.0.19":
-  version "6.0.19"
-  resolved "https://registry.yarnpkg.com/@mantine/form/-/form-6.0.19.tgz#3d97f08a45b1a8bc8840dbf77defd267abb20e39"
-  integrity sha512-5SFLZEzaBH7yKIDSDt1r9UiN4y7RkFvu+7J7CFPIQM+nTdXeGnugVFM8rASuZI7/FSYty/XoPY+Yymq3xDX+MQ==
+  version "6.0.21"
+  resolved "https://registry.yarnpkg.com/@mantine/form/-/form-6.0.21.tgz#0d717631aa90b9cce834a479f4c8d7e9c0e1969b"
+  integrity sha512-d4tlxyZic7MSDnaPx/WliCX1sRFDkUd2nxx4MxxO2T4OSek0YDqTlSBCxeoveu60P+vrQQN5rbbsVsaOJBe4SQ==
   dependencies:
     fast-deep-equal "^3.1.3"
     klona "^2.0.5"
 
 "@mantine/hooks@^6.0.19":
-  version "6.0.19"
-  resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-6.0.19.tgz#39f61434304f687d3ba7bf0040c5adf380c7c4b3"
-  integrity sha512-YkmuB6kmoenU1PVuE8tLBA+6RJIY9hIsGyIQG1yuPAy6SLWNFT8g2T9YvI/psqsUbVIYGaNEXg8zq42xbxnD8Q==
+  version "6.0.21"
+  resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-6.0.21.tgz#bc009d8380ad18455b90f3ddaf484de16a13da95"
+  integrity sha512-sYwt5wai25W6VnqHbS5eamey30/HD5dNXaZuaVEAJ2i2bBv8C0cCiczygMDpAFiSYdXoSMRr/SZ2CrrPTzeNew==
 
-"@mantine/styles@6.0.19":
-  version "6.0.19"
-  resolved "https://registry.yarnpkg.com/@mantine/styles/-/styles-6.0.19.tgz#7d9a6f2c2a9b345dfd9d12f8fd66af3976d67ab2"
-  integrity sha512-0tg3Dvv/kxCc1mbQVFhZaIhlSbSbV1F/3xG0NRlP2DF23mw9088o5KaIXGKM6XkXU6OEt/f99nDCUHBk2ixtUg==
+"@mantine/styles@6.0.21":
+  version "6.0.21"
+  resolved "https://registry.yarnpkg.com/@mantine/styles/-/styles-6.0.21.tgz#8ea097fc76cbb3ed55f5cfd719d2f910aff5031b"
+  integrity sha512-PVtL7XHUiD/B5/kZ/QvZOZZQQOj12QcRs3Q6nPoqaoPcOX5+S7bMZLMH0iLtcGq5OODYk0uxlvuJkOZGoPj8Mg==
   dependencies:
     clsx "1.1.1"
     csstype "3.0.9"
 
-"@mantine/utils@6.0.19":
-  version "6.0.19"
-  resolved "https://registry.yarnpkg.com/@mantine/utils/-/utils-6.0.19.tgz#0197fccc5649259787d5468228139f8815909803"
-  integrity sha512-duvtnaW1gDR2gnvUqnWhl6DMW7sN0HEWqS8Z/BbwaMi75U+Xp17Q72R9JtiIrxQbzsq+KvH9L9B/pxMVwbLirg==
+"@mantine/utils@6.0.21":
+  version "6.0.21"
+  resolved "https://registry.yarnpkg.com/@mantine/utils/-/utils-6.0.21.tgz#6185506e91cba3e308aaa8ea9ababc8e767995d6"
+  integrity sha512-33RVDRop5jiWFao3HKd3Yp7A9mEq4HAJxJPTuYm1NkdqX6aTKOQK7wT8v8itVodBp+sb4cJK6ZVdD1UurK/txQ==
 
-"@microsoft/api-extractor-model@7.27.6":
-  version "7.27.6"
-  resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.27.6.tgz#308e44cd595d2fb446c6357759ee0675ec37d26e"
-  integrity sha512-eiCnlayyum1f7fS2nA9pfIod5VCNR1G+Tq84V/ijDrKrOFVa598BLw145nCsGDMoFenV6ajNi2PR5WCwpAxW6Q==
+"@microsoft/api-extractor-model@7.28.2":
+  version "7.28.2"
+  resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.28.2.tgz#91c66dd820ccc70e0c163e06b392d8363f1b9269"
+  integrity sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==
   dependencies:
     "@microsoft/tsdoc" "0.14.2"
     "@microsoft/tsdoc-config" "~0.16.1"
-    "@rushstack/node-core-library" "3.59.7"
+    "@rushstack/node-core-library" "3.61.0"
 
-"@microsoft/api-extractor@^7.36.3":
-  version "7.36.4"
-  resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.36.4.tgz#3bb9fbbbeacaa48eea49150351905a2677a506d9"
-  integrity sha512-21UECq8C/8CpHT23yiqTBQ10egKUacIpxkPyYR7hdswo/M5yTWdBvbq+77YC9uPKQJOUfOD1FImBQ1DzpsdeQQ==
+"@microsoft/api-extractor@^7.36.4":
+  version "7.38.0"
+  resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.38.0.tgz#e72546d6766b3866578a462b040f71b17779e1c5"
+  integrity sha512-e1LhZYnfw+JEebuY2bzhw0imDCl1nwjSThTrQqBXl40hrVo6xm3j/1EpUr89QyzgjqmAwek2ZkIVZbrhaR+cqg==
   dependencies:
-    "@microsoft/api-extractor-model" "7.27.6"
+    "@microsoft/api-extractor-model" "7.28.2"
     "@microsoft/tsdoc" "0.14.2"
     "@microsoft/tsdoc-config" "~0.16.1"
-    "@rushstack/node-core-library" "3.59.7"
-    "@rushstack/rig-package" "0.4.1"
-    "@rushstack/ts-command-line" "4.15.2"
+    "@rushstack/node-core-library" "3.61.0"
+    "@rushstack/rig-package" "0.5.1"
+    "@rushstack/ts-command-line" "4.16.1"
     colors "~1.2.1"
     lodash "~4.17.15"
     resolve "~1.22.1"
@@ -1589,28 +1604,28 @@
   dependencies:
     "@babel/runtime" "^7.13.10"
 
-"@reactflow/background@11.2.8":
-  version "11.2.8"
-  resolved "https://registry.yarnpkg.com/@reactflow/background/-/background-11.2.8.tgz#aa83f87b7d65442b52732f0a04d9da981f978265"
-  integrity sha512-5o41N2LygiNC2/Pk8Ak2rIJjXbKHfQ23/Y9LFsnAlufqwdzFqKA8txExpsMoPVHHlbAdA/xpQaMuoChGPqmyDw==
+"@reactflow/background@11.3.3":
+  version "11.3.3"
+  resolved "https://registry.yarnpkg.com/@reactflow/background/-/background-11.3.3.tgz#c2662ca22acf49cce5084daf21aa4a3ca9f241f2"
+  integrity sha512-m3MR25ufbrDkZI2Yi7pHX5uewVpiaaVM5px35pk2v3qdG68adqHOgJjncUOpGiJpc3rDwt4mqmW1V7RjBqNv6Q==
   dependencies:
-    "@reactflow/core" "11.8.3"
+    "@reactflow/core" "11.9.3"
     classcat "^5.0.3"
     zustand "^4.4.1"
 
-"@reactflow/controls@11.1.19":
-  version "11.1.19"
-  resolved "https://registry.yarnpkg.com/@reactflow/controls/-/controls-11.1.19.tgz#a8bc4b4eafc10d5d230db5286753e867bcf35e5b"
-  integrity sha512-Vo0LFfAYjiSRMLEII/aeBo+1MT2a0Yc7iLVnkuRTLzChC0EX+A2Fa+JlzeOEYKxXlN4qcDxckRNGR7092v1HOQ==
+"@reactflow/controls@11.2.3":
+  version "11.2.3"
+  resolved "https://registry.yarnpkg.com/@reactflow/controls/-/controls-11.2.3.tgz#d965399772f912b504f1e96d00ddf950aa822153"
+  integrity sha512-UTsfHE+PhgWrCZN4GUOTRU/3l8dGSyR2KslmgqV7mVNsh6EuS2cxboRczjpcIc8lF0EH+7QxLGeXSH42GWCcOQ==
   dependencies:
-    "@reactflow/core" "11.8.3"
+    "@reactflow/core" "11.9.3"
     classcat "^5.0.3"
     zustand "^4.4.1"
 
-"@reactflow/core@11.8.3":
-  version "11.8.3"
-  resolved "https://registry.yarnpkg.com/@reactflow/core/-/core-11.8.3.tgz#03ffeb06fbc141b8f786cb4ac8169f8a51a5f00e"
-  integrity sha512-y6DN8Wy4V4KQBGHFqlj9zWRjLJU6CgdnVwWaEA/PdDg/YUkFBMpZnXqTs60czinoA2rAcvsz50syLTPsj5e+Wg==
+"@reactflow/core@11.9.3":
+  version "11.9.3"
+  resolved "https://registry.yarnpkg.com/@reactflow/core/-/core-11.9.3.tgz#5212092e5f1ad741e9bd36b4e1a785a7611fd9da"
+  integrity sha512-45o8X1sjF48wSWALHybbLoWF6yo9SARgJpMKm96J8ZL8mrNhqSjll77sLRJg6zQ+VKdDwotEN30jp5eY6i28tw==
   dependencies:
     "@types/d3" "^7.4.0"
     "@types/d3-drag" "^3.0.1"
@@ -1622,12 +1637,12 @@
     d3-zoom "^3.0.0"
     zustand "^4.4.1"
 
-"@reactflow/minimap@11.6.3":
-  version "11.6.3"
-  resolved "https://registry.yarnpkg.com/@reactflow/minimap/-/minimap-11.6.3.tgz#1cfddd87e9afd23ad704167988c66bd683ffc5d2"
-  integrity sha512-PSA28dk09RnBHOA1zb45fjQXz3UozSJZmsIpgq49O3trfVFlSgRapxNdGsughWLs7/emg2M5jmi6Vc+ejcfjvQ==
+"@reactflow/minimap@11.7.3":
+  version "11.7.3"
+  resolved "https://registry.yarnpkg.com/@reactflow/minimap/-/minimap-11.7.3.tgz#d6ed45d48080e2d8bbd0af255dec958aca523574"
+  integrity sha512-u620uYwjmA5tJ/4p+F/0kyjNojvV0axTMSw87d/CCDij96m+2/drwqMW+BE8XHEqjG0c1HyplrkXQ3WhGu6ZaA==
   dependencies:
-    "@reactflow/core" "11.8.3"
+    "@reactflow/core" "11.9.3"
     "@types/d3-selection" "^3.0.3"
     "@types/d3-zoom" "^3.0.1"
     classcat "^5.0.3"
@@ -1635,40 +1650,40 @@
     d3-zoom "^3.0.0"
     zustand "^4.4.1"
 
-"@reactflow/node-resizer@2.1.5":
-  version "2.1.5"
-  resolved "https://registry.yarnpkg.com/@reactflow/node-resizer/-/node-resizer-2.1.5.tgz#f4033946ccc9cc8f47a94ed93f10a32befd546f1"
-  integrity sha512-z/hJlsptd2vTx13wKouqvN/Kln08qbkA+YTJLohc2aJ6rx3oGn9yX4E4IqNxhA7zNqYEdrnc1JTEA//ifh9z3w==
+"@reactflow/node-resizer@2.2.3":
+  version "2.2.3"
+  resolved "https://registry.yarnpkg.com/@reactflow/node-resizer/-/node-resizer-2.2.3.tgz#94665174cbf0524a3733bac836f5428f851b50e3"
+  integrity sha512-x1TXN4YZhBI1LxNegVsE51emUg1rf4rBgvNL8Tzj0xsKkD/av4DOzRizQ3xAGgk0joPrsOTiGiP511m/PWjsew==
   dependencies:
-    "@reactflow/core" "11.8.3"
+    "@reactflow/core" "11.9.3"
     classcat "^5.0.4"
     d3-drag "^3.0.0"
     d3-selection "^3.0.0"
     zustand "^4.4.1"
 
-"@reactflow/node-toolbar@1.2.7":
-  version "1.2.7"
-  resolved "https://registry.yarnpkg.com/@reactflow/node-toolbar/-/node-toolbar-1.2.7.tgz#cf6639945dc42b42416f293d6132e1187bca3424"
-  integrity sha512-vs+Wg1tjy3SuD7eoeTqEtscBfE9RY+APqC28urVvftkrtsN7KlnoQjqDG6aE45jWP4z+8bvFizRWjAhxysNLkg==
+"@reactflow/node-toolbar@1.3.3":
+  version "1.3.3"
+  resolved "https://registry.yarnpkg.com/@reactflow/node-toolbar/-/node-toolbar-1.3.3.tgz#ccedd3522a43426438e69c204c281f2bb6609f40"
+  integrity sha512-juNFBLZgC+KOYpVaQFTkSQTDf4hYK7WAagiQQ4Dw0IUcLaMY3TA31OLP6X6gMG73YGKFmkgrDwi0ZDB0jpMqdA==
   dependencies:
-    "@reactflow/core" "11.8.3"
+    "@reactflow/core" "11.9.3"
     classcat "^5.0.3"
     zustand "^4.4.1"
 
-"@reduxjs/toolkit@^1.9.5":
-  version "1.9.5"
-  resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.9.5.tgz#d3987849c24189ca483baa7aa59386c8e52077c4"
-  integrity sha512-Rt97jHmfTeaxL4swLRNPD/zV4OxTes4la07Xc4hetpUW/vc75t5m1ANyxG6ymnEQ2FsLQsoMlYB2vV1sO3m8tQ==
+"@reduxjs/toolkit@^1.9.7":
+  version "1.9.7"
+  resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.9.7.tgz#7fc07c0b0ebec52043f8cb43510cf346405f78a6"
+  integrity sha512-t7v8ZPxhhKgOKtU+uyJT13lu4vL7az5aFi4IdoDs/eS548edn2M8Ik9h8fxgvMjGoAUVFSt6ZC1P5cWmQ014QQ==
   dependencies:
     immer "^9.0.21"
     redux "^4.2.1"
     redux-thunk "^2.4.2"
     reselect "^4.1.8"
 
-"@roarr/browser-log-writer@^1.1.5":
-  version "1.1.5"
-  resolved "https://registry.yarnpkg.com/@roarr/browser-log-writer/-/browser-log-writer-1.1.5.tgz#755ff62ddaa297bb3488067408a7085db382352b"
-  integrity sha512-yLn//DRjh1/rUgZpZkwmT/5RqHYfkdOwGXWXnKBR3l/HE04DIhSVeYin3sc8aWHBa7s7WglQpYX/uw/WI6POpw==
+"@roarr/browser-log-writer@^1.3.0":
+  version "1.3.0"
+  resolved "https://registry.yarnpkg.com/@roarr/browser-log-writer/-/browser-log-writer-1.3.0.tgz#64aeb65ac88050f0e8c133876e548bec05cfa4af"
+  integrity sha512-RTzjxrm0CpTSoESmsO6104VymAksDS/yJEkaZrL/OLfbM6q+J+jLRBLtJxhJHSY03pBWOEE3wRh+pVwfKtBPqg==
   dependencies:
     boolean "^3.1.4"
     globalthis "^1.0.2"
@@ -1691,10 +1706,10 @@
     estree-walker "^2.0.2"
     picomatch "^2.3.1"
 
-"@rushstack/node-core-library@3.59.7":
-  version "3.59.7"
-  resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.59.7.tgz#9dcd62b79263e8a5b68465d4bf9124ec86e14b6c"
-  integrity sha512-ln1Drq0h+Hwa1JVA65x5mlSgUrBa1uHL+V89FqVWQgXd1vVIMhrtqtWGQrhTnFHxru5ppX+FY39VWELF/FjQCw==
+"@rushstack/node-core-library@3.61.0":
+  version "3.61.0"
+  resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.61.0.tgz#7441a0d2ae5268b758a7a49588a78cd55af57e66"
+  integrity sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==
   dependencies:
     colors "~1.2.1"
     fs-extra "~7.0.1"
@@ -1704,18 +1719,18 @@
     semver "~7.5.4"
     z-schema "~5.0.2"
 
-"@rushstack/rig-package@0.4.1":
-  version "0.4.1"
-  resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.4.1.tgz#ff11bf67dad46f9b4f09db91cf45739ab411ee9f"
-  integrity sha512-AGRwpqlXNSp9LhUSz4HKI9xCluqQDt/obsQFdv/NYIekF3pTTPzc+HbQsIsjVjYnJ3DcmxOREVMhvrMEjpiq6g==
+"@rushstack/rig-package@0.5.1":
+  version "0.5.1"
+  resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.5.1.tgz#6c9c283cc96b5bb1eae9875946d974ac5429bb21"
+  integrity sha512-pXRYSe29TjRw7rqxD4WS3HN/sRSbfr+tJs4a9uuaSIBAITbUggygdhuG0VrO0EO+QqH91GhYMN4S6KRtOEmGVA==
   dependencies:
     resolve "~1.22.1"
     strip-json-comments "~3.1.1"
 
-"@rushstack/ts-command-line@4.15.2":
-  version "4.15.2"
-  resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.15.2.tgz#7920e3fa2ab6af129d995ce4424c600da0bf8a93"
-  integrity sha512-5+C2uoJY8b+odcZD6coEe2XNC4ZjGB4vCMESbqW/8DHRWC/qIHfANdmN9F1wz/lAgxz72i7xRoVtPY2j7e4gpQ==
+"@rushstack/ts-command-line@4.16.1":
+  version "4.16.1"
+  resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.16.1.tgz#3537bbc323f77c8646646465c579b992d39feb16"
+  integrity sha512-+OCsD553GYVLEmz12yiFjMOzuPeCiZ3f8wTiFHL30ZVXexTyPmgjwXEhg2K2P0a2lVf+8YBy7WtPoflB2Fp8/A==
   dependencies:
     "@types/argparse" "1.0.38"
     argparse "~1.0.9"
@@ -1734,71 +1749,84 @@
   dependencies:
     pako "^2.1.0"
 
-"@swc/core-darwin-arm64@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.70.tgz#056ac6899e22cb7f7be21388d4d938ca5123a72b"
-  integrity sha512-31+mcl0dgdRHvZRjhLOK9V6B+qJ7nxDZYINr9pBlqGWxknz37Vld5KK19Kpr79r0dXUZvaaelLjCnJk9dA2PcQ==
+"@swc/core-darwin-arm64@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.93.tgz#aefd94625451988286bebccb1c072bae0a36bcdb"
+  integrity sha512-gEKgk7FVIgltnIfDO6GntyuQBBlAYg5imHpRgLxB1zSI27ijVVkksc6QwISzFZAhKYaBWIsFSVeL9AYSziAF7A==
 
-"@swc/core-darwin-x64@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.70.tgz#3945814de6fadbee5b46cb2a3422353acb420c5c"
-  integrity sha512-GMFJ65E18zQC80t0os+TZvI+8lbRuitncWVge/RXmXbVLPRcdykP4EJ87cqzcG5Ah0z18/E0T+ixD6jHRisrYQ==
+"@swc/core-darwin-x64@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.93.tgz#18409c6effdf508ddf1ebccfa77d35aaa6cd72f0"
+  integrity sha512-ZQPxm/fXdDQtn3yrYSL/gFfA8OfZ5jTi33yFQq6vcg/Y8talpZ+MgdSlYM0FkLrZdMTYYTNFiuBQuuvkA+av+Q==
 
-"@swc/core-linux-arm-gnueabihf@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.70.tgz#7960e54ede1af75a7ef99ee53febf37fea6269a8"
-  integrity sha512-wjhCwS8LCiAq2VedF1b4Bryyw68xZnfMED4pLRazAl8BaUlDFANfRBORNunxlfHQj4V3x39IaiLgCZRHMdzXBg==
+"@swc/core-linux-arm-gnueabihf@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.93.tgz#23a97bc94a8b2f23fb6cc4bc9d8936899e5eeff5"
+  integrity sha512-OYFMMI2yV+aNe3wMgYhODxHdqUB/jrK0SEMHHS44GZpk8MuBXEF+Mcz4qjkY5Q1EH7KVQqXb/gVWwdgTHpjM2A==
 
-"@swc/core-linux-arm64-gnu@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.70.tgz#df9654e5040bbeb1619739756a7f50100e38ace8"
-  integrity sha512-9D/Rx67cAOnMiexvCqARxvhj7coRajTp5HlJHuf+rfwMqI2hLhpO9/pBMQxBUAWxODO/ksQ/OF+GJRjmtWw/2A==
+"@swc/core-linux-arm64-gnu@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.93.tgz#7a17406a7cf76a959a617626d5ee2634ae9afa26"
+  integrity sha512-BT4dT78odKnJMNiq5HdjBsv29CiIdcCcImAPxeFqAeFw1LL6gh9nzI8E96oWc+0lVT5lfhoesCk4Qm7J6bty8w==
 
-"@swc/core-linux-arm64-musl@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.70.tgz#2c2aab5a136c7eb409ddc9cdc4f947a68fd74493"
-  integrity sha512-gkjxBio7XD+1GlQVVyPP/qeFkLu83VhRHXaUrkNYpr5UZG9zZurBERT9nkS6Y+ouYh+Q9xmw57aIyd2KvD2zqQ==
+"@swc/core-linux-arm64-musl@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.93.tgz#a30be7780090afefd3b8706398418cbe1d23db49"
+  integrity sha512-yH5fWEl1bktouC0mhh0Chuxp7HEO4uCtS/ly1Vmf18gs6wZ8DOOkgAEVv2dNKIryy+Na++ljx4Ym7C8tSJTrLw==
 
-"@swc/core-linux-x64-gnu@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.70.tgz#774351532b154ed36a5c6d14b647e7a8ab510028"
-  integrity sha512-/nCly+V4xfMVwfEUoLLAukxUSot/RcSzsf6GdsGTjFcrp5sZIntAjokYRytm3VT1c2TK321AfBorsi9R5w8Y7Q==
+"@swc/core-linux-x64-gnu@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.93.tgz#41e903fd82e059952d16051b442cbe65ee5b8cb3"
+  integrity sha512-OFUdx64qvrGJhXKEyxosHxgoUVgba2ztYh7BnMiU5hP8lbI8G13W40J0SN3CmFQwPP30+3oEbW7LWzhKEaYjlg==
 
-"@swc/core-linux-x64-musl@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.70.tgz#c0b1b4ad5f4ef187eaa093589a4933ecb6836546"
-  integrity sha512-HoOsPJbt361KGKaivAK0qIiYARkhzlxeAfvF5NlnKxkIMOZpQ46Lwj3tR0VWohKbrhS+cYKFlVuDi5XnDkx0XA==
+"@swc/core-linux-x64-musl@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.93.tgz#0866807545c44eac9b3254b374310ad5e1c573f9"
+  integrity sha512-4B8lSRwEq1XYm6xhxHhvHmKAS7pUp1Q7E33NQ2TlmFhfKvCOh86qvThcjAOo57x8DRwmpvEVrqvpXtYagMN6Ig==
 
-"@swc/core-win32-arm64-msvc@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.70.tgz#8640267ce3959db0e7e682103677a5e0500b5ea7"
-  integrity sha512-hm4IBK/IaRil+aj1cWU6f0GyAdHpw/Jr5nyFYLM2c/tt7w2t5hgb8NjzM2iM84lOClrig1fG6edj2vCF1dFzNQ==
+"@swc/core-win32-arm64-msvc@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.93.tgz#c72411dea2fd4f62a832f71a6e15424d849e7610"
+  integrity sha512-BHShlxtkven8ZjjvZ5QR6sC5fZCJ9bMujEkiha6W4cBUTY7ce7qGFyHmQd+iPC85d9kD/0cCiX/Xez8u0BhO7w==
 
-"@swc/core-win32-ia32-msvc@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.70.tgz#f95d5656622f5a963bc0125da9fda84cf40faa8d"
-  integrity sha512-5cgKUKIT/9Fp5fCA+zIjYCQ4dSvjFYOeWGZR3QiTXGkC4bGa1Ji9SEPyeIAX0iruUnKjYaZB9RvHK2tNn7RLrQ==
+"@swc/core-win32-ia32-msvc@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.93.tgz#05c2b031b976af4ef81f5073ee114254678a5d5d"
+  integrity sha512-nEwNWnz4JzYAK6asVvb92yeylfxMYih7eMQOnT7ZVlZN5ba9WF29xJ6kcQKs9HRH6MvWhz9+wRgv3FcjlU6HYA==
 
-"@swc/core-win32-x64-msvc@1.3.70":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.70.tgz#5b3acddb96fdf60df089b837061915cb4be94eaa"
-  integrity sha512-LE8lW46+TQBzVkn2mHBlk8DIElPIZ2dO5P8AbJiARNBAnlqQWu67l9gWM89UiZ2l33J2cI37pHzON3tKnT8f9g==
+"@swc/core-win32-x64-msvc@1.3.93":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.93.tgz#f8748b3fd1879f13084b1b0814edf328c662935c"
+  integrity sha512-jibQ0zUr4kwJaQVwgmH+svS04bYTPnPw/ZkNInzxS+wFAtzINBYcU8s2PMWbDb2NGYiRSEeoSGyAvS9H+24JFA==
 
-"@swc/core@^1.3.61":
-  version "1.3.70"
-  resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.70.tgz#f5ddc6fe6add7a99f5b94d2214ad0d8527d11479"
-  integrity sha512-LWVWlEDLlOD25PvA2NEz41UzdwXnlDyBiZbe69s3zM0DfCPwZXLUm79uSqH9ItsOjTrXSL5/1+XUL6C/BZwChA==
+"@swc/core@^1.3.85":
+  version "1.3.93"
+  resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.93.tgz#be4282aa44deffb0e5081a2613bac00335600630"
+  integrity sha512-690GRr1wUGmGYZHk7fUduX/JUwViMF2o74mnZYIWEcJaCcd9MQfkhsxPBtjeg6tF+h266/Cf3RPYhsFBzzxXcA==
+  dependencies:
+    "@swc/counter" "^0.1.1"
+    "@swc/types" "^0.1.5"
   optionalDependencies:
-    "@swc/core-darwin-arm64" "1.3.70"
-    "@swc/core-darwin-x64" "1.3.70"
-    "@swc/core-linux-arm-gnueabihf" "1.3.70"
-    "@swc/core-linux-arm64-gnu" "1.3.70"
-    "@swc/core-linux-arm64-musl" "1.3.70"
-    "@swc/core-linux-x64-gnu" "1.3.70"
-    "@swc/core-linux-x64-musl" "1.3.70"
-    "@swc/core-win32-arm64-msvc" "1.3.70"
-    "@swc/core-win32-ia32-msvc" "1.3.70"
-    "@swc/core-win32-x64-msvc" "1.3.70"
+    "@swc/core-darwin-arm64" "1.3.93"
+    "@swc/core-darwin-x64" "1.3.93"
+    "@swc/core-linux-arm-gnueabihf" "1.3.93"
+    "@swc/core-linux-arm64-gnu" "1.3.93"
+    "@swc/core-linux-arm64-musl" "1.3.93"
+    "@swc/core-linux-x64-gnu" "1.3.93"
+    "@swc/core-linux-x64-musl" "1.3.93"
+    "@swc/core-win32-arm64-msvc" "1.3.93"
+    "@swc/core-win32-ia32-msvc" "1.3.93"
+    "@swc/core-win32-x64-msvc" "1.3.93"
+
+"@swc/counter@^0.1.1":
+  version "0.1.2"
+  resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.2.tgz#bf06d0770e47c6f1102270b744e17b934586985e"
+  integrity sha512-9F4ys4C74eSTEUNndnER3VJ15oru2NumfQxS8geE+f3eB5xvfxpWyqE5XlVnxb/R14uoXi6SLbBwwiDSkv+XEw==
+
+"@swc/types@^0.1.5":
+  version "0.1.5"
+  resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.5.tgz#043b731d4f56a79b4897a3de1af35e75d56bc63a"
+  integrity sha512-myfUej5naTBWnqOCc/MdVOLVjXUXtIA+NpDrDBKJtLLg2shUjBu3cZmB/85RyitKc55+lUUyl7oRfLOvkr2hsw==
 
 "@types/argparse@1.0.38":
   version "1.0.38"
@@ -2061,10 +2089,10 @@
   resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
   integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
 
-"@types/lodash-es@^4.14.194":
-  version "4.17.8"
-  resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.8.tgz#cfffd0969507830c22da18dbb20d2ca126fdaa8b"
-  integrity sha512-euY3XQcZmIzSy7YH5+Unb3b2X12Wtk54YWINBvvGQ5SmMvwb11JQskGsfkH/5HXK77Kr8GF0wkVDIxzAisWtog==
+"@types/lodash-es@^4.17.9":
+  version "4.17.9"
+  resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.9.tgz#49dbe5112e23c54f2b387d860b7d03028ce170c2"
+  integrity sha512-ZTcmhiI3NNU7dEvWLZJkzG6ao49zOIjEgIE0RgV7wbPxU0f2xT3VSAHw2gmst8swH6V0YkLRGp4qPlX/6I90MQ==
   dependencies:
     "@types/lodash" "*"
 
@@ -2080,10 +2108,12 @@
   resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632"
   integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==
 
-"@types/node@^20.5.1":
-  version "20.5.1"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.1.tgz#178d58ee7e4834152b0e8b4d30cbfab578b9bb30"
-  integrity sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==
+"@types/node@^20.8.6":
+  version "20.8.6"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.6.tgz#0dbd4ebcc82ad0128df05d0e6f57e05359ee47fa"
+  integrity sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==
+  dependencies:
+    undici-types "~5.25.1"
 
 "@types/parse-json@^4.0.0":
   version "4.0.0"
@@ -2095,10 +2125,10 @@
   resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
   integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
 
-"@types/react-dom@^18.2.6":
-  version "18.2.7"
-  resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.7.tgz#67222a08c0a6ae0a0da33c3532348277c70abb63"
-  integrity sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==
+"@types/react-dom@^18.2.13":
+  version "18.2.13"
+  resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.13.tgz#89cd7f9ec8b28c8b6f0392b9591671fb4a9e96b7"
+  integrity sha512-eJIUv7rPP+EC45uNYp/ThhSpE16k22VJUknt5OLoH9tbXoi8bMhwLf5xRuWMywamNbWzhrSmU7IBJfPup1+3fw==
   dependencies:
     "@types/react" "*"
 
@@ -2109,20 +2139,20 @@
   dependencies:
     "@types/react" "*"
 
-"@types/react-redux@^7.1.25":
-  version "7.1.25"
-  resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.25.tgz#de841631205b24f9dfb4967dd4a7901e048f9a88"
-  integrity sha512-bAGh4e+w5D8dajd6InASVIyCo4pZLJ66oLb80F9OBLO1gKESbZcRCJpTT6uLXX+HAB57zw1WTdwJdAsewuTweg==
+"@types/react-redux@^7.1.27":
+  version "7.1.27"
+  resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.27.tgz#1afb31f7354bf787e162c10ff3fa19bafa9e6b57"
+  integrity sha512-xj7d9z32p1K/eBmO+OEy+qfaWXtcPlN8f1Xk3Ne0p/ZRQ867RI5bQ/bpBtxbqU1AHNhKJSgGvld/P2myU2uYkg==
   dependencies:
     "@types/hoist-non-react-statics" "^3.3.0"
     "@types/react" "*"
     hoist-non-react-statics "^3.3.0"
     redux "^4.0.0"
 
-"@types/react-transition-group@^4.4.6":
-  version "4.4.6"
-  resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.6.tgz#18187bcda5281f8e10dfc48f0943e2fdf4f75e2e"
-  integrity sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==
+"@types/react-transition-group@^4.4.7":
+  version "4.4.7"
+  resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.7.tgz#bf69f269d74aa78b99097673ca6dd6824a68ef1c"
+  integrity sha512-ICCyBl5mvyqYp8Qeq9B5G/fyBSRC0zx3XM3sCC6KkcMsNeAHqXBKkmat4GqdJET5jtYUpZXrxI5flve5qhi2Eg==
   dependencies:
     "@types/react" "*"
 
@@ -2135,10 +2165,10 @@
     "@types/scheduler" "*"
     csstype "^3.0.2"
 
-"@types/react@^18.2.20":
-  version "18.2.20"
-  resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.20.tgz#1605557a83df5c8a2cc4eeb743b3dfc0eb6aaeb2"
-  integrity sha512-WKNtmsLWJM/3D5mG4U84cysVY31ivmyw85dE84fOCk5Hx78wezB/XEjVPWl2JTZ5FkEeaTJf+VgUAUn3PE7Isw==
+"@types/react@^18.2.28":
+  version "18.2.28"
+  resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.28.tgz#86877465c0fcf751659a36c769ecedfcfacee332"
+  integrity sha512-ad4aa/RaaJS3hyGz0BGegdnSRXQBkd1CCYDCdNjBPg90UUpLgo+WlJqb9fMYUxtehmzF3PJaTWqRZjko6BRzBg==
   dependencies:
     "@types/prop-types" "*"
     "@types/scheduler" "*"
@@ -2159,21 +2189,21 @@
   resolved "https://registry.yarnpkg.com/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz#b6725d5f4af24ace33b36fafd295136e75509f43"
   integrity sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==
 
-"@types/uuid@^9.0.2":
-  version "9.0.2"
-  resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.2.tgz#ede1d1b1e451548d44919dc226253e32a6952c4b"
-  integrity sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==
+"@types/uuid@^9.0.5":
+  version "9.0.5"
+  resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.5.tgz#25a71eb73eba95ac0e559ff3dd018fc08294acf6"
+  integrity sha512-xfHdwa1FMJ082prjSJpoEI57GZITiQz10r3vEJCHa2khEFQjKy91aWKz6+zybzssCvXUwE1LQWgWVwZ4nYUvHQ==
 
-"@typescript-eslint/eslint-plugin@^6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz#bc0c6f000134b53c304ad0bec4ee4753cd3e89d2"
-  integrity sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==
+"@typescript-eslint/eslint-plugin@^6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz#f4024b9f63593d0c2b5bd6e4ca027e6f30934d4f"
+  integrity sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==
   dependencies:
     "@eslint-community/regexpp" "^4.5.1"
-    "@typescript-eslint/scope-manager" "6.4.1"
-    "@typescript-eslint/type-utils" "6.4.1"
-    "@typescript-eslint/utils" "6.4.1"
-    "@typescript-eslint/visitor-keys" "6.4.1"
+    "@typescript-eslint/scope-manager" "6.7.5"
+    "@typescript-eslint/type-utils" "6.7.5"
+    "@typescript-eslint/utils" "6.7.5"
+    "@typescript-eslint/visitor-keys" "6.7.5"
     debug "^4.3.4"
     graphemer "^1.4.0"
     ignore "^5.2.4"
@@ -2181,32 +2211,32 @@
     semver "^7.5.4"
     ts-api-utils "^1.0.1"
 
-"@typescript-eslint/parser@^6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.4.1.tgz#85ad550bf4ac4aa227504f1becb828f8e46c44e3"
-  integrity sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==
+"@typescript-eslint/parser@^6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.5.tgz#8d7ca3d1fbd9d5a58cc4d30b2aa797a760137886"
+  integrity sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw==
   dependencies:
-    "@typescript-eslint/scope-manager" "6.4.1"
-    "@typescript-eslint/types" "6.4.1"
-    "@typescript-eslint/typescript-estree" "6.4.1"
-    "@typescript-eslint/visitor-keys" "6.4.1"
+    "@typescript-eslint/scope-manager" "6.7.5"
+    "@typescript-eslint/types" "6.7.5"
+    "@typescript-eslint/typescript-estree" "6.7.5"
+    "@typescript-eslint/visitor-keys" "6.7.5"
     debug "^4.3.4"
 
-"@typescript-eslint/scope-manager@6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz#4b073a30be2dbe603e44e9ae0cff7e1d3ed19278"
-  integrity sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==
+"@typescript-eslint/scope-manager@6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz#1cf33b991043886cd67f4f3600b8e122fc14e711"
+  integrity sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==
   dependencies:
-    "@typescript-eslint/types" "6.4.1"
-    "@typescript-eslint/visitor-keys" "6.4.1"
+    "@typescript-eslint/types" "6.7.5"
+    "@typescript-eslint/visitor-keys" "6.7.5"
 
-"@typescript-eslint/type-utils@6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz#fa21cb13016c8d6f352fe9b2d6c9ab6edc2d1857"
-  integrity sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==
+"@typescript-eslint/type-utils@6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz#0a65949ec16588d8956f6d967f7d9c84ddb2d72a"
+  integrity sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==
   dependencies:
-    "@typescript-eslint/typescript-estree" "6.4.1"
-    "@typescript-eslint/utils" "6.4.1"
+    "@typescript-eslint/typescript-estree" "6.7.5"
+    "@typescript-eslint/utils" "6.7.5"
     debug "^4.3.4"
     ts-api-utils "^1.0.1"
 
@@ -2220,18 +2250,18 @@
   resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f"
   integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==
 
-"@typescript-eslint/types@6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.4.1.tgz#b2c61159f46dda210fed9f117f5d027f65bb5c3b"
-  integrity sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==
+"@typescript-eslint/types@6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.5.tgz#4571320fb9cf669de9a95d9849f922c3af809790"
+  integrity sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==
 
-"@typescript-eslint/typescript-estree@6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz#91ff88101c710adb0f70a317f2f65efa9441da45"
-  integrity sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==
+"@typescript-eslint/typescript-estree@6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz#4578de1a26e9f24950f029a4f00d1bfe41f15a39"
+  integrity sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==
   dependencies:
-    "@typescript-eslint/types" "6.4.1"
-    "@typescript-eslint/visitor-keys" "6.4.1"
+    "@typescript-eslint/types" "6.7.5"
+    "@typescript-eslint/visitor-keys" "6.7.5"
     debug "^4.3.4"
     globby "^11.1.0"
     is-glob "^4.0.3"
@@ -2264,17 +2294,17 @@
     semver "^7.3.7"
     tsutils "^3.21.0"
 
-"@typescript-eslint/utils@6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.4.1.tgz#81bf62ff0c3119a26c19fab683582e29450717bc"
-  integrity sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==
+"@typescript-eslint/utils@6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.5.tgz#ab847b53d6b65e029314b8247c2336843dba81ab"
+  integrity sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA==
   dependencies:
     "@eslint-community/eslint-utils" "^4.4.0"
     "@types/json-schema" "^7.0.12"
     "@types/semver" "^7.5.0"
-    "@typescript-eslint/scope-manager" "6.4.1"
-    "@typescript-eslint/types" "6.4.1"
-    "@typescript-eslint/typescript-estree" "6.4.1"
+    "@typescript-eslint/scope-manager" "6.7.5"
+    "@typescript-eslint/types" "6.7.5"
+    "@typescript-eslint/typescript-estree" "6.7.5"
     semver "^7.5.4"
 
 "@typescript-eslint/visitor-keys@4.33.0":
@@ -2293,20 +2323,20 @@
     "@typescript-eslint/types" "5.62.0"
     eslint-visitor-keys "^3.3.0"
 
-"@typescript-eslint/visitor-keys@6.4.1":
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz#e3ccf7b8d42e625946ac5094ed92a405fb4115e0"
-  integrity sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==
+"@typescript-eslint/visitor-keys@6.7.5":
+  version "6.7.5"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz#84c68d6ceb5b12d5246b918b84f2b79affd6c2f1"
+  integrity sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==
   dependencies:
-    "@typescript-eslint/types" "6.4.1"
+    "@typescript-eslint/types" "6.7.5"
     eslint-visitor-keys "^3.4.1"
 
-"@vitejs/plugin-react-swc@^3.3.2":
-  version "3.3.2"
-  resolved "https://registry.yarnpkg.com/@vitejs/plugin-react-swc/-/plugin-react-swc-3.3.2.tgz#34a82c1728066f48a86dfecb2f15df60f89207fb"
-  integrity sha512-VJFWY5sfoZerQRvJrh518h3AcQt6f/yTuWn4/TRB+dqmYU0NX1qz7qM5Wfd+gOQqUzQW4gxKqKN3KpE/P3+zrA==
+"@vitejs/plugin-react-swc@^3.4.0":
+  version "3.4.0"
+  resolved "https://registry.yarnpkg.com/@vitejs/plugin-react-swc/-/plugin-react-swc-3.4.0.tgz#53ca6a07423abadec92f967e188d5ba49b350830"
+  integrity sha512-m7UaA4Uvz82N/0EOVpZL4XsFIakRqrFKeSNxa1FBLSXGvWrWRBwmZb4qxk+ZIVAZcW3c3dn5YosomDgx62XWcQ==
   dependencies:
-    "@swc/core" "^1.3.61"
+    "@swc/core" "^1.3.85"
 
 "@volar/language-core@1.10.1", "@volar/language-core@~1.10.0":
   version "1.10.1"
@@ -2391,22 +2421,22 @@
   resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
   integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==
 
-"@zag-js/dom-query@0.10.5":
-  version "0.10.5"
-  resolved "https://registry.yarnpkg.com/@zag-js/dom-query/-/dom-query-0.10.5.tgz#9fc02a51383989667694d8747925e6d20294af9e"
-  integrity sha512-zm6wA5+kqU48it6afNjaUhjVSixKZruTKB23z0V1xBqKbuiLOMMOZ5oK26cTPSXtZ5CPhDNZ2Qk4pliS5n9SVw==
+"@zag-js/dom-query@0.16.0":
+  version "0.16.0"
+  resolved "https://registry.yarnpkg.com/@zag-js/dom-query/-/dom-query-0.16.0.tgz#bca46bcd78f78c900064478646d95f9781ed098e"
+  integrity sha512-Oqhd6+biWyKnhKwFFuZrrf6lxBz2tX2pRQe6grUnYwO6HJ8BcbqZomy2lpOdr+3itlaUqx+Ywj5E5ZZDr/LBfQ==
 
 "@zag-js/element-size@0.10.5":
   version "0.10.5"
   resolved "https://registry.yarnpkg.com/@zag-js/element-size/-/element-size-0.10.5.tgz#a24bad2eeb7e2c8709e32be5336e158e1a1a174f"
   integrity sha512-uQre5IidULANvVkNOBQ1tfgwTQcGl4hliPSe69Fct1VfYb2Fd0jdAcGzqQgPhfrXFpR62MxLPB7erxJ/ngtL8w==
 
-"@zag-js/focus-visible@0.10.5":
-  version "0.10.5"
-  resolved "https://registry.yarnpkg.com/@zag-js/focus-visible/-/focus-visible-0.10.5.tgz#643e196ea768bea5ce54771102fae22f5e9ba3c7"
-  integrity sha512-EhDHKLutMtvLFCjBjyIY6h1JoJJNXG3KJz7Dj1sh4tj4LWAqo/TqLvgHyUTB29XMHwoslFHDJHKVWmLGMi+ULQ==
+"@zag-js/focus-visible@0.16.0":
+  version "0.16.0"
+  resolved "https://registry.yarnpkg.com/@zag-js/focus-visible/-/focus-visible-0.16.0.tgz#c9e53e3dbab0f2649d04a489bb379f5800f4f069"
+  integrity sha512-a7U/HSopvQbrDU4GLerpqiMcHKEkQkNPeDZJWz38cw/6Upunh41GjHetq5TB84hxyCaDzJ6q2nEdNoBQfC0FKA==
   dependencies:
-    "@zag-js/dom-query" "0.10.5"
+    "@zag-js/dom-query" "0.16.0"
 
 acorn-jsx@^5.3.2:
   version "5.3.2"
@@ -2516,7 +2546,7 @@ argparse@~1.0.9:
   dependencies:
     sprintf-js "~1.0.2"
 
-aria-hidden@^1.1.3, aria-hidden@^1.2.2:
+aria-hidden@^1.1.3, aria-hidden@^1.2.3:
   version "1.2.3"
   resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.3.tgz#14aeb7fb692bbb72d69bebfa47279c1fd725e954"
   integrity sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==
@@ -2632,10 +2662,10 @@ available-typed-arrays@^1.0.5:
   resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
   integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==
 
-axios@^1.4.0:
-  version "1.4.0"
-  resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f"
-  integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==
+axios@^1.5.1:
+  version "1.5.1"
+  resolved "https://registry.yarnpkg.com/axios/-/axios-1.5.1.tgz#11fbaa11fc35f431193a9564109c88c1f27b585f"
+  integrity sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==
   dependencies:
     follow-redirects "^1.15.0"
     form-data "^4.0.0"
@@ -2918,7 +2948,7 @@ color-name@^1.1.4, color-name@~1.1.4:
   resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
   integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
 
-color2k@^2.0.0:
+color2k@^2.0.2:
   version "2.0.2"
   resolved "https://registry.yarnpkg.com/color2k/-/color2k-2.0.2.tgz#ac2b4aea11c822a6bcb70c768b5a289f4fffcebb"
   integrity sha512-kJhwH5nAwb34tmyuqq/lgjEKzlFXn1U99NlnB6Ws4qVaERcRUYeYP1cBw6BJ4vxaWStAUEef4WMr7WjOCnBt8w==
@@ -2940,10 +2970,10 @@ combined-stream@^1.0.8:
   dependencies:
     delayed-stream "~1.0.0"
 
-commander@11.0.0:
-  version "11.0.0"
-  resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67"
-  integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==
+commander@11.1.0:
+  version "11.1.0"
+  resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906"
+  integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==
 
 commander@^10.0.0:
   version "10.0.1"
@@ -2975,20 +3005,20 @@ compare-versions@^6.1.0:
   resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a"
   integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==
 
-compute-scroll-into-view@1.0.20:
-  version "1.0.20"
-  resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.20.tgz#1768b5522d1172754f5d0c9b02de3af6be506a43"
-  integrity sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==
+compute-scroll-into-view@3.0.3:
+  version "3.0.3"
+  resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-3.0.3.tgz#c418900a5c56e2b04b885b54995df164535962b1"
+  integrity sha512-nadqwNxghAGTamwIqQSG433W6OADZx2vCo3UXHNrzTRHK/htu+7+L0zhjEoaeaQVNAi3YgqWDv8+tzf0hRfR+A==
 
 concat-map@0.0.1:
   version "0.0.1"
   resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
   integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
 
-concurrently@^8.2.0:
-  version "8.2.0"
-  resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-8.2.0.tgz#cdc9f621a4d913366600355d68254df2c5e782f3"
-  integrity sha512-nnLMxO2LU492mTUj9qX/az/lESonSZu81UznYDoXtz1IQf996ixVqPAgHXwvHiHCAef/7S8HIK+fTFK7Ifk8YA==
+concurrently@^8.2.1:
+  version "8.2.1"
+  resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-8.2.1.tgz#bcab9cacc38c23c503839583151e0fa96fd5b584"
+  integrity sha512-nVraf3aXOpIcNud5pB9M82p1tynmZkrSGQ1p6X/VY8cJ+2LMVqAgXsJxYYefACSHbTYlm92O1xuhdGTjwoEvbQ==
   dependencies:
     chalk "^4.1.2"
     date-fns "^2.30.0"
@@ -3642,10 +3672,10 @@ eslint-config-prettier@^9.0.0:
   resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f"
   integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==
 
-eslint-plugin-prettier@^5.0.0:
-  version "5.0.0"
-  resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz#6887780ed95f7708340ec79acfdf60c35b9be57a"
-  integrity sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==
+eslint-plugin-prettier@^5.0.1:
+  version "5.0.1"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz#a3b399f04378f79f066379f544e42d6b73f11515"
+  integrity sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==
   dependencies:
     prettier-linter-helpers "^1.0.0"
     synckit "^0.8.5"
@@ -3700,16 +3730,16 @@ eslint-visitor-keys@^3.4.3:
   resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
   integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
 
-eslint@^8.47.0:
-  version "8.47.0"
-  resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.47.0.tgz#c95f9b935463fb4fad7005e626c7621052e90806"
-  integrity sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==
+eslint@^8.51.0:
+  version "8.51.0"
+  resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.51.0.tgz#4a82dae60d209ac89a5cff1604fea978ba4950f3"
+  integrity sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==
   dependencies:
     "@eslint-community/eslint-utils" "^4.2.0"
     "@eslint-community/regexpp" "^4.6.1"
     "@eslint/eslintrc" "^2.1.2"
-    "@eslint/js" "^8.47.0"
-    "@humanwhocodes/config-array" "^0.11.10"
+    "@eslint/js" "8.51.0"
+    "@humanwhocodes/config-array" "^0.11.11"
     "@humanwhocodes/module-importer" "^1.0.1"
     "@nodelib/fs.walk" "^1.2.8"
     ajv "^6.12.4"
@@ -3791,19 +3821,19 @@ eventemitter3@^5.0.1:
   resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4"
   integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==
 
-execa@7.2.0, execa@^7.1.1:
-  version "7.2.0"
-  resolved "https://registry.yarnpkg.com/execa/-/execa-7.2.0.tgz#657e75ba984f42a70f38928cedc87d6f2d4fe4e9"
-  integrity sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==
+execa@8.0.1:
+  version "8.0.1"
+  resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c"
+  integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==
   dependencies:
     cross-spawn "^7.0.3"
-    get-stream "^6.0.1"
-    human-signals "^4.3.0"
+    get-stream "^8.0.1"
+    human-signals "^5.0.0"
     is-stream "^3.0.0"
     merge-stream "^2.0.0"
     npm-run-path "^5.1.0"
     onetime "^6.0.0"
-    signal-exit "^3.0.7"
+    signal-exit "^4.1.0"
     strip-final-newline "^3.0.0"
 
 execa@^5.0.0:
@@ -3821,6 +3851,21 @@ execa@^5.0.0:
     signal-exit "^3.0.3"
     strip-final-newline "^2.0.0"
 
+execa@^7.1.1:
+  version "7.2.0"
+  resolved "https://registry.yarnpkg.com/execa/-/execa-7.2.0.tgz#657e75ba984f42a70f38928cedc87d6f2d4fe4e9"
+  integrity sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==
+  dependencies:
+    cross-spawn "^7.0.3"
+    get-stream "^6.0.1"
+    human-signals "^4.3.0"
+    is-stream "^3.0.0"
+    merge-stream "^2.0.0"
+    npm-run-path "^5.1.0"
+    onetime "^6.0.0"
+    signal-exit "^3.0.7"
+    strip-final-newline "^3.0.0"
+
 fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
   version "3.1.3"
   resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
@@ -4020,11 +4065,12 @@ form-data@^4.0.0:
     combined-stream "^1.0.8"
     mime-types "^2.1.12"
 
-formik@^2.4.3:
-  version "2.4.3"
-  resolved "https://registry.yarnpkg.com/formik/-/formik-2.4.3.tgz#6020e85eb3e3e8415b3b19d6f4f65793ab754b24"
-  integrity sha512-2Dy79Szw3zlXmZiokUdKsn+n1ow4G8hRrC/n92cOWHNTWXCRpQXlyvz6HcjW7aSQZrldytvDOavYjhfmDnUq8Q==
+formik@^2.4.5:
+  version "2.4.5"
+  resolved "https://registry.yarnpkg.com/formik/-/formik-2.4.5.tgz#f899b5b7a6f103a8fabb679823e8fafc7e0ee1b4"
+  integrity sha512-Gxlht0TD3vVdzMDHwkiNZqJ7Mvg77xQNfmBRrNtvzcHZs72TJppSTDKHpImCMJZwcWPBJ8jSQQ95GJzXFf1nAQ==
   dependencies:
+    "@types/hoist-non-react-statics" "^3.3.1"
     deepmerge "^2.1.1"
     hoist-non-react-statics "^3.3.0"
     lodash "^4.17.21"
@@ -4033,10 +4079,10 @@ formik@^2.4.3:
     tiny-warning "^1.0.2"
     tslib "^2.0.0"
 
-framer-motion@^10.16.1:
-  version "10.16.1"
-  resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-10.16.1.tgz#0ff5de554bbb35ee6605357d80f92b27d0271a94"
-  integrity sha512-K6TXr5mZtitC/dxQCBdg7xzdN0d5IAIrlaqCPKtIQVdzVPGC0qBuJKXggHX1vjnP5gPOFwB1KbCCTWcnFc3kWg==
+framer-motion@^10.16.4:
+  version "10.16.4"
+  resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-10.16.4.tgz#30279ef5499b8d85db3a298ee25c83429933e9f8"
+  integrity sha512-p9V9nGomS3m6/CALXqv6nFGMuFOxbWsmaOrdmhyQimMIlLl3LC7h7l86wge/Js/8cRu5ktutS/zlzgR7eBOtFA==
   dependencies:
     tslib "^2.4.0"
   optionalDependencies:
@@ -4149,6 +4195,11 @@ get-stream@^6.0.0, get-stream@^6.0.1:
   resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
   integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
 
+get-stream@^8.0.1:
+  version "8.0.1"
+  resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2"
+  integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==
+
 get-symbol-description@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6"
@@ -4313,6 +4364,11 @@ human-signals@^4.3.0:
   resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2"
   integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==
 
+human-signals@^5.0.0:
+  version "5.0.0"
+  resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28"
+  integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==
+
 husky@^8.0.3:
   version "8.0.3"
   resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
@@ -4330,17 +4386,17 @@ i18next-browser-languagedetector@^7.0.2:
   dependencies:
     "@babel/runtime" "^7.19.4"
 
-i18next-http-backend@^2.2.1:
-  version "2.2.1"
-  resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.2.1.tgz#cdb7efbafa46ce8f237d9db443f62514664a3bdf"
-  integrity sha512-ZXIdn/8NJIBJ0X4hzXfc3STYxKrCKh1fYjji9HPyIpEJfvTvy8/ZlTl8RuTizzCPj2ZcWrfaecyOMKs6bQ7u5A==
+i18next-http-backend@^2.2.2:
+  version "2.2.2"
+  resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.2.2.tgz#3ee16dfe5fe33524ec8925d4f0bf1508ebbbfadf"
+  integrity sha512-mJu4ZqzDtBiU3O4GV9AbK5ekEqoDMdMnCl3pkdXmb5b8yoIH//u8FsmIe6C5qXb3teZu+j6VMi20tjUgzeABiw==
   dependencies:
     cross-fetch "3.1.6"
 
-i18next@^23.4.4:
-  version "23.4.4"
-  resolved "https://registry.yarnpkg.com/i18next/-/i18next-23.4.4.tgz#ec8fb2b5f3c5d8e3bf3f8ab1b19e743be91300e0"
-  integrity sha512-+c9B0txp/x1m5zn+QlwHaCS9vyFtmIAEXbVSFzwCX7vupm5V7va8F9cJGNJZ46X9ZtoGzhIiRC7eTIIh93TxPA==
+i18next@^23.5.1:
+  version "23.5.1"
+  resolved "https://registry.yarnpkg.com/i18next/-/i18next-23.5.1.tgz#7f7c35ffaa907618d9489f106d5006b09fbca3d3"
+  integrity sha512-JelYzcaCoFDaa+Ysbfz2JsGAKkrHiMG6S61+HLBUEIPaF40WMwW9hCPymlQGrP+wWawKxKPuSuD71WZscCsWHg==
   dependencies:
     "@babel/runtime" "^7.22.5"
 
@@ -4837,10 +4893,10 @@ kolorist@^1.8.0:
   resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.8.0.tgz#edddbbbc7894bc13302cdf740af6374d4a04743c"
   integrity sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==
 
-konva@^9.2.0:
-  version "9.2.0"
-  resolved "https://registry.yarnpkg.com/konva/-/konva-9.2.0.tgz#3739e539724b0e6b76d697a322efdaa01baa1508"
-  integrity sha512-+woI76Sk+VFVl9z7zPkuTnN2zFpEYg27YWz8BCdQXpt5IS3pdnSPAPQVPPMidcbDi9/G5b/IOIp35/KqMGiYPA==
+konva@^9.2.2:
+  version "9.2.2"
+  resolved "https://registry.yarnpkg.com/konva/-/konva-9.2.2.tgz#972105ec79a89c60296d5e36d1f7cef9b84a42d4"
+  integrity sha512-Gyn5hQa/5+8pJvTn/IVyZWgum2otWXszuVCG/cevkAyKUFcmFv4tGbQhHFGtJPLQkGO+W6xfgRzyYIkNgKnPxA==
 
 levn@^0.4.1:
   version "0.4.1"
@@ -4860,21 +4916,21 @@ lines-and-columns@^1.1.6:
   resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
   integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
 
-lint-staged@^14.0.1:
-  version "14.0.1"
-  resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-14.0.1.tgz#57dfa3013a3d60762d9af5d9c83bdb51291a6232"
-  integrity sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==
+lint-staged@^15.0.1:
+  version "15.0.1"
+  resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.0.1.tgz#1db47c315c79bafe993aa33a0b50cbfeef50d906"
+  integrity sha512-2IU5OWmCaxch0X0+IBF4/v7sutpB+F3qoXbro43pYjQTOo5wumckjxoxn47pQBqqBsCWrD5HnI2uG/zJA7isew==
   dependencies:
     chalk "5.3.0"
-    commander "11.0.0"
+    commander "11.1.0"
     debug "4.3.4"
-    execa "7.2.0"
+    execa "8.0.1"
     lilconfig "2.1.0"
-    listr2 "6.6.1"
+    listr2 "7.0.1"
     micromatch "4.0.5"
     pidtree "0.6.0"
     string-argv "0.3.2"
-    yaml "2.3.1"
+    yaml "2.3.2"
 
 liqe@^3.6.0:
   version "3.6.1"
@@ -4884,10 +4940,10 @@ liqe@^3.6.0:
     nearley "^2.20.1"
     ts-error "^1.0.6"
 
-listr2@6.6.1:
-  version "6.6.1"
-  resolved "https://registry.yarnpkg.com/listr2/-/listr2-6.6.1.tgz#08b2329e7e8ba6298481464937099f4a2cd7f95d"
-  integrity sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==
+listr2@7.0.1:
+  version "7.0.1"
+  resolved "https://registry.yarnpkg.com/listr2/-/listr2-7.0.1.tgz#18e7a655b189cd7a8a76575a26f4d494b6ffc2c2"
+  integrity sha512-nz+7hwgbDp8eWNoDgzdl4hA/xDSLrNRzPu1TLgOYs6l5Y+Ma6zVWWy9Oyt9TQFONwKoSPoka3H50D3vD5EuNwg==
   dependencies:
     cli-truncate "^3.1.0"
     colorette "^2.0.20"
@@ -5299,27 +5355,27 @@ open@^9.1.0:
     is-inside-container "^1.0.0"
     is-wsl "^2.2.0"
 
-openapi-fetch@^0.7.4:
-  version "0.7.4"
-  resolved "https://registry.yarnpkg.com/openapi-fetch/-/openapi-fetch-0.7.4.tgz#3676e0c44433bfa6701cd408853fec75599a9f0d"
-  integrity sha512-ACoSikOuFO3sMROtqritJAsGd694gRNXFnWpYAqi+tQzowLOkcQ6SbeAvS+T6qNS92y/OLiiYcNrb/Rh/MrEVw==
+openapi-fetch@^0.7.10:
+  version "0.7.10"
+  resolved "https://registry.yarnpkg.com/openapi-fetch/-/openapi-fetch-0.7.10.tgz#624c928a646b53561ff2703f00d5617fa88a72df"
+  integrity sha512-lDZkHjSxBuSTPXkJuJ9kSpkLxY9jgsVHbKkhS7rukoKi5et5QUlWCEzO/E6PaSHTQkJDPOjXdBJeDOSj2e8QwQ==
   dependencies:
-    openapi-typescript-helpers "^0.0.1"
+    openapi-typescript-helpers "^0.0.4"
 
 openapi-types@^12.1.3:
   version "12.1.3"
   resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-12.1.3.tgz#471995eb26c4b97b7bd356aacf7b91b73e777dd3"
   integrity sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==
 
-openapi-typescript-helpers@^0.0.1:
-  version "0.0.1"
-  resolved "https://registry.yarnpkg.com/openapi-typescript-helpers/-/openapi-typescript-helpers-0.0.1.tgz#865c9b66f18db89e41cd0d770170719610f68d2d"
-  integrity sha512-WDmxej0eHSZtLgCuyPEn2NXRV7tcvUnBBNP/0c/U66mOlxs6Yn0/dHuWlkVKdHGNahSUwG57A1tyutHWRpWqFg==
+openapi-typescript-helpers@^0.0.4:
+  version "0.0.4"
+  resolved "https://registry.yarnpkg.com/openapi-typescript-helpers/-/openapi-typescript-helpers-0.0.4.tgz#ffe7c4868f094fcc8502dbdcddc6c32ce8011aee"
+  integrity sha512-Q0MTapapFAG993+dx8lNw33X6P/6EbFr31yNymJHq56fNc6dODyRm8tWyRnGxuC74lyl1iCRMV6nQCGQsfVNKg==
 
-openapi-typescript@^6.5.2:
-  version "6.5.2"
-  resolved "https://registry.yarnpkg.com/openapi-typescript/-/openapi-typescript-6.5.2.tgz#622e54e6de25bd65c65a1f129be42193160e6e42"
-  integrity sha512-Zz41utYZ3BAyr32QhOATSnN9zcWMsJeA4Jdq7xQjfYOdZbQfI8Fvsvx41Doe9Wvoho1aj5cP9b5Z7kHtG6mYvg==
+openapi-typescript@^6.7.0:
+  version "6.7.0"
+  resolved "https://registry.yarnpkg.com/openapi-typescript/-/openapi-typescript-6.7.0.tgz#6d1a4dfc0db60b61573a3ea3c52984a79c638c67"
+  integrity sha512-eoUfJwhnMEug7euZ1dATG7iRiDVsEROwdPkhLUDiaFjcClV4lzft9F0Ii0fYjULCPNIiWiFi0BqMpSxipuvAgQ==
   dependencies:
     ansi-colors "^4.1.3"
     fast-glob "^3.3.1"
@@ -5360,15 +5416,15 @@ os-tmpdir@~1.0.2:
   resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
   integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==
 
-overlayscrollbars-react@^0.5.0:
-  version "0.5.1"
-  resolved "https://registry.yarnpkg.com/overlayscrollbars-react/-/overlayscrollbars-react-0.5.1.tgz#b5dde9803bae0115f0f214db0c60cdf98213eedb"
-  integrity sha512-0xw9J1CT/cQ+ELYy3hudG6nY1H5dgJ1DdVW3d8aZwqx6wyHNZV4nsBQXUxoHmPo3dmlJ5MvOLzpKWA4X6nL4QA==
+overlayscrollbars-react@^0.5.2:
+  version "0.5.2"
+  resolved "https://registry.yarnpkg.com/overlayscrollbars-react/-/overlayscrollbars-react-0.5.2.tgz#b8a6294279a1d0984392586b56a03df78d6c1e34"
+  integrity sha512-y3xIPY3to7hneF30MQ/tK9nI6UOcflgenAYktgyfi0GuwnsYEuAqgLfs2qDGiNhFA30Xcz3gaMxvqD7+hTvFRA==
 
-overlayscrollbars@^2.2.0:
-  version "2.2.1"
-  resolved "https://registry.yarnpkg.com/overlayscrollbars/-/overlayscrollbars-2.2.1.tgz#2a6d43ebba5188a394a8b99611f39e22aad6e0c0"
-  integrity sha512-5oMxq4UCiEVLiOSvovbX8p+P2NtPosjHC0KkIcaobnYuxGwMyTOwBCtBdqO1tXrrA02VVrNzuIjGMLisO2mIwg==
+overlayscrollbars@^2.3.2:
+  version "2.3.2"
+  resolved "https://registry.yarnpkg.com/overlayscrollbars/-/overlayscrollbars-2.3.2.tgz#1f31daa0b808f5d4710a59c73eb579397745dd72"
+  integrity sha512-K3Sau7NpFruKfXBauvchAQshAW+un1qD8EYNcozrPAB2kbif8C2rqa+1EWvMMWPKl88wgf2rX2QDMLgAfR0hHA==
 
 p-limit@^3.0.2:
   version "3.1.0"
@@ -5577,10 +5633,10 @@ prettier@^2.0.5, prettier@^2.8.8:
   resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
   integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
 
-prettier@^3.0.2:
-  version "3.0.2"
-  resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.2.tgz#78fcecd6d870551aa5547437cdae39d4701dca5b"
-  integrity sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==
+prettier@^3.0.3:
+  version "3.0.3"
+  resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
+  integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==
 
 pretty-ms@^7.0.1:
   version "7.0.1"
@@ -5686,10 +5742,10 @@ react-error-boundary@^4.0.11:
   dependencies:
     "@babel/runtime" "^7.12.5"
 
-react-fast-compare@3.2.1:
-  version "3.2.1"
-  resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.1.tgz#53933d9e14f364281d6cba24bfed7a4afb808b5f"
-  integrity sha512-xTYf9zFim2pEif/Fw16dBiXpe0hoy5PxcD8+OwBnTtNLfIm3g6WxhKNurY+6OmdH1u6Ta/W/Vl6vjbYP1MFnDg==
+react-fast-compare@3.2.2:
+  version "3.2.2"
+  resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49"
+  integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==
 
 react-fast-compare@^2.0.1:
   version "2.0.4"
@@ -5713,18 +5769,18 @@ react-hotkeys-hook@4.4.1:
   resolved "https://registry.yarnpkg.com/react-hotkeys-hook/-/react-hotkeys-hook-4.4.1.tgz#1f7a7a1c9c21d4fa3280bf340fcca8fd77d81994"
   integrity sha512-sClBMBioFEgFGYLTWWRKvhxcCx1DRznd+wkFHwQZspnRBkHTgruKIHptlK/U/2DPX8BhHoRGzpMVWUXMmdZlmw==
 
-react-i18next@^13.1.2:
-  version "13.1.2"
-  resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.1.2.tgz#dbb1b18c364295af2a9072333ee4e0b43cbc2da8"
-  integrity sha512-D/OJ/8ZQYscabsvbCAiOgvJq8W3feQF/VIV0to1w7V7UvrUE1IZ3hcalOckUYvKBd7BP3b8EPm+hop3J8sS+Mw==
+react-i18next@^13.3.0:
+  version "13.3.0"
+  resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.3.0.tgz#8e39c0101f654db7eb971f159bb55067a78925c3"
+  integrity sha512-FlR9xjYHSPIJfQspEmkN0yOlxgRyNuiJKJ8gCaZH08UJ7SZHG+VrptEPcpEMEchjNoCOZdKcvJ3PnmHEZhkeXg==
   dependencies:
     "@babel/runtime" "^7.22.5"
     html-parse-stringify "^3.0.1"
 
-react-icons@^4.10.1:
-  version "4.10.1"
-  resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.10.1.tgz#3f3b5eec1f63c1796f6a26174a1091ca6437a500"
-  integrity sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==
+react-icons@^4.11.0:
+  version "4.11.0"
+  resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.11.0.tgz#4b0e31c9bfc919608095cc429c4f1846f4d66c65"
+  integrity sha512-V+4khzYcE5EBk/BvcuYRq6V/osf11ODUM2J8hg2FDSswRrGvqiYUYPRy4OdrWaQOBj4NcpJfmHZLNaD+VH0TyA==
 
 react-is@^16.13.1, react-is@^16.7.0:
   version "16.13.1"
@@ -5754,10 +5810,10 @@ react-reconciler@~0.29.0:
     loose-envify "^1.1.0"
     scheduler "^0.23.0"
 
-react-redux@^8.1.2:
-  version "8.1.2"
-  resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-8.1.2.tgz#9076bbc6b60f746659ad6d51cb05de9c5e1e9188"
-  integrity sha512-xJKYI189VwfsFc4CJvHqHlDrzyFTY/3vZACbE+rr/zQ34Xx1wQfB4OTOSeOSNrF6BDVe8OOdxIrAnMGXA3ggfw==
+react-redux@^8.1.3:
+  version "8.1.3"
+  resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-8.1.3.tgz#4fdc0462d0acb59af29a13c27ffef6f49ab4df46"
+  integrity sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==
   dependencies:
     "@babel/runtime" "^7.12.1"
     "@types/hoist-non-react-statics" "^3.3.1"
@@ -5774,10 +5830,10 @@ react-remove-scroll-bar@^2.3.4:
     react-style-singleton "^2.2.1"
     tslib "^2.0.0"
 
-react-remove-scroll@^2.5.5:
-  version "2.5.6"
-  resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.6.tgz#7510b8079e9c7eebe00e65a33daaa3aa29a10336"
-  integrity sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==
+react-remove-scroll@^2.5.5, react-remove-scroll@^2.5.6:
+  version "2.5.7"
+  resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.7.tgz#15a1fd038e8497f65a695bf26a4a57970cac1ccb"
+  integrity sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==
   dependencies:
     react-remove-scroll-bar "^2.3.4"
     react-style-singleton "^2.2.1"
@@ -5833,15 +5889,15 @@ react-use@^17.4.0:
     ts-easing "^0.2.0"
     tslib "^2.1.0"
 
-react-virtuoso@^4.5.0:
-  version "4.5.0"
-  resolved "https://registry.yarnpkg.com/react-virtuoso/-/react-virtuoso-4.5.0.tgz#0bc043b4e3e928e7891aa541dd7e55d5b46db8c8"
-  integrity sha512-OMP6XrzJMMos1vbJZC16RxGW7utAxUMP7i5PNPi6epBNVH7nz+CF/DlmecNBep5wyjLud51dQ5epjb2A0w9W/Q==
+react-virtuoso@^4.6.1:
+  version "4.6.1"
+  resolved "https://registry.yarnpkg.com/react-virtuoso/-/react-virtuoso-4.6.1.tgz#b08465be4222d9820a22fbe2fefec29e91d0b048"
+  integrity sha512-dQq0yOdRjdWIYaiTvUbudqmTodGSdWGt5lVYz3mM07TTEV91yv7eL5Fn3FPEJOA36whScxPWg0GiYBIOZYEIEA==
 
-react-zoom-pan-pinch@^3.0.8:
-  version "3.1.0"
-  resolved "https://registry.yarnpkg.com/react-zoom-pan-pinch/-/react-zoom-pan-pinch-3.1.0.tgz#d87a66fd22a97f5dd56b54076411a9dce1f448cd"
-  integrity sha512-a3LlP8QPgTikvteCNkZ3X6wIWC0lrg1geP5WkUJyx2MXXAhHQek3r17N1nT/esOiWGuPIECnsd9AGoK8jOeGcg==
+react-zoom-pan-pinch@^3.2.0:
+  version "3.2.0"
+  resolved "https://registry.yarnpkg.com/react-zoom-pan-pinch/-/react-zoom-pan-pinch-3.2.0.tgz#6ce7d014a8dc4aa62ce83ca57f85e76cf2e934b8"
+  integrity sha512-7MS0wYWoXjr6PrmpgHOVpVyNQr9gj7LEr4xIvq6lBy62nuNwjdI1r+XxahQ0SDHhWrLuSF11e2PTL/YLengYyg==
 
 react@^18.2.0:
   version "18.2.0"
@@ -5850,17 +5906,17 @@ react@^18.2.0:
   dependencies:
     loose-envify "^1.1.0"
 
-reactflow@^11.8.3:
-  version "11.8.3"
-  resolved "https://registry.yarnpkg.com/reactflow/-/reactflow-11.8.3.tgz#ad5cdf22408298956c92ab652929ff92206af9dc"
-  integrity sha512-wuVxJOFqi1vhA4WAEJLK0JWx2TsTiWpxTXTRp/wvpqKInQgQcB49I2QNyNYsKJCQ6jjXektS7H+LXoaVK/pG4A==
+reactflow@^11.9.3:
+  version "11.9.3"
+  resolved "https://registry.yarnpkg.com/reactflow/-/reactflow-11.9.3.tgz#4723774370ff87403c574bdec43c93e809165854"
+  integrity sha512-GiIo20Vgy1U4h1NlLyQChWYgsl2OQkEgKHjokyQsdmm1nidywTr0n94O6w97ixLljKzJynTMjDdWP0p8xkq6NQ==
   dependencies:
-    "@reactflow/background" "11.2.8"
-    "@reactflow/controls" "11.1.19"
-    "@reactflow/core" "11.8.3"
-    "@reactflow/minimap" "11.6.3"
-    "@reactflow/node-resizer" "2.1.5"
-    "@reactflow/node-toolbar" "1.2.7"
+    "@reactflow/background" "11.3.3"
+    "@reactflow/controls" "11.2.3"
+    "@reactflow/core" "11.9.3"
+    "@reactflow/minimap" "11.7.3"
+    "@reactflow/node-resizer" "2.2.3"
+    "@reactflow/node-toolbar" "1.3.3"
 
 readable-stream@^3.4.0:
   version "3.6.2"
@@ -5883,10 +5939,10 @@ redux-dynamic-middlewares@^2.2.0:
   resolved "https://registry.yarnpkg.com/redux-dynamic-middlewares/-/redux-dynamic-middlewares-2.2.0.tgz#6835dd6d4f2fd975266376b45dcae0141320ae97"
   integrity sha512-GHESQC+Y0PV98ZBoaC6br6cDOsNiM1Cu4UleGMqMWCXX03jIr3BoozYVrRkLVVAl4sC216chakMnZOu6SwNdGA==
 
-redux-remember@^4.0.1:
-  version "4.0.1"
-  resolved "https://registry.yarnpkg.com/redux-remember/-/redux-remember-4.0.1.tgz#fae416d140a9dccdf84285b957e7062934a337fb"
-  integrity sha512-mP/EWdBVKg0bJfe3srzofp5sNSmWBLjKX+JzJC7J+DBjbLaxTCsLXVq1fnE4rcHXb9Sz/4u5qZ040I/ZhKzjLw==
+redux-remember@^4.0.4:
+  version "4.0.4"
+  resolved "https://registry.yarnpkg.com/redux-remember/-/redux-remember-4.0.4.tgz#ca0b583088fdb1ff6d917c88ae80bb83001627de"
+  integrity sha512-a1T+UMYTa08Uq0YtCp0j5Z7v5yydbePPgfu4iAZ21Uk4ozcFfT/PoB9PwETFhHRxBW4Ij0yWPfPJw3mIE/CXlw==
 
 redux-thunk@^2.4.2:
   version "2.4.2"
@@ -5917,6 +5973,11 @@ regenerator-runtime@^0.13.11:
   resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
   integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
 
+regenerator-runtime@^0.14.0:
+  version "0.14.0"
+  resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45"
+  integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==
+
 regexp.prototype.flags@^1.4.3, regexp.prototype.flags@^1.5.0:
   version "1.5.0"
   resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb"
@@ -6169,10 +6230,10 @@ semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4, semve
   dependencies:
     lru-cache "^6.0.0"
 
-serialize-error@^11.0.1:
-  version "11.0.1"
-  resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-11.0.1.tgz#7cfa2b54f7aca3e4cbfc0137259d94d93793f813"
-  integrity sha512-B5yw3/Lg+Daspbs0f+iO3Qim0+lALnaLS8aZUAy8Y0tO92tkOoMEuwtKo4jpZ5XO16CTwMi4tYN8cZQI3QF2Qw==
+serialize-error@^11.0.2:
+  version "11.0.2"
+  resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-11.0.2.tgz#8c1a44f0ab872ee2c3ca6736ca5c750003bc1d04"
+  integrity sha512-o43i0jLcA0LXA5Uu+gI1Vj+lF66KR9IAcy0ThbGq1bAMPN+k5IgSHsulfnqf/ddKAz6dWf+k8PD5hAr9oCSHEQ==
   dependencies:
     type-fest "^2.12.2"
 
@@ -6212,6 +6273,11 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7:
   resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
   integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
 
+signal-exit@^4.1.0:
+  version "4.1.0"
+  resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04"
+  integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==
+
 slash@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
@@ -6629,20 +6695,20 @@ tslib@^1.8.1:
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
   integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
 
-tslib@^2.0.0, tslib@^2.1.0, tslib@^2.4.0:
-  version "2.6.0"
-  resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3"
-  integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==
+tslib@^2.0.0, tslib@^2.1.0, tslib@^2.5.0, tslib@^2.6.0:
+  version "2.6.2"
+  resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
+  integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
 
 tslib@^2.0.3:
   version "2.6.1"
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410"
   integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==
 
-tslib@^2.5.0, tslib@^2.6.0:
-  version "2.6.2"
-  resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
-  integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
+tslib@^2.4.0:
+  version "2.6.0"
+  resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3"
+  integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==
 
 tsutils@^3.21.0:
   version "3.21.0"
@@ -6673,10 +6739,10 @@ type-fest@^2.12.2:
   resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b"
   integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==
 
-type-fest@^4.2.0:
-  version "4.2.0"
-  resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.2.0.tgz#e259430307710e77721ecf6f545840acad72195f"
-  integrity sha512-5zknd7Dss75pMSED270A1RQS3KloqRJA9XbXLe0eCxyw7xXFb3rd+9B0UQ/0E+LQT6lnrLviEolYORlRWamn4w==
+type-fest@^4.4.0:
+  version "4.4.0"
+  resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.4.0.tgz#061cd10ff55664bb7174218cdf78c28c48f71c69"
+  integrity sha512-HT3RRs7sTfY22KuPQJkD/XjbTbxgP2Je5HPt6H6JEGvcjHd5Lqru75EbrP3tb4FYjNJ+DjLp+MNQTFQU0mhXNw==
 
 typed-array-buffer@^1.0.0:
   version "1.0.0"
@@ -6747,6 +6813,11 @@ unbox-primitive@^1.0.2:
     has-symbols "^1.0.3"
     which-boxed-primitive "^1.0.2"
 
+undici-types@~5.25.1:
+  version "5.25.3"
+  resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3"
+  integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==
+
 undici@^5.23.0:
   version "5.23.0"
   resolved "https://registry.yarnpkg.com/undici/-/undici-5.23.0.tgz#e7bdb0ed42cebe7b7aca87ced53e6eaafb8f8ca0"
@@ -6833,10 +6904,10 @@ util-deprecate@^1.0.1:
   resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
   integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
 
-uuid@^9.0.0:
-  version "9.0.0"
-  resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5"
-  integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==
+uuid@^9.0.1:
+  version "9.0.1"
+  resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
+  integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==
 
 validator@^13.7.0:
   version "13.9.0"
@@ -6848,12 +6919,12 @@ vite-plugin-css-injected-by-js@^3.3.0:
   resolved "https://registry.yarnpkg.com/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.3.0.tgz#c19480a9e42a95c5bced976a9dde1446f9bd91ff"
   integrity sha512-xG+jyHNCmUqi/TXp6q88wTJGeAOrNLSyUUTp4qEQ9QZLGcHWQQsCsSSKa59rPMQr8sOzfzmWDd8enGqfH/dBew==
 
-vite-plugin-dts@^3.5.2:
-  version "3.5.2"
-  resolved "https://registry.yarnpkg.com/vite-plugin-dts/-/vite-plugin-dts-3.5.2.tgz#429612f727f1bf4eff1f22e29c04b52a75d398b8"
-  integrity sha512-iKc851+jdHEoN1ifbOEsoMs+/Zg26PE1EyO2Jc+4apOWRoaeK2zRJnaStgUuJaVaEcAjTqWzpNgCAMq7iO6DWA==
+vite-plugin-dts@^3.6.0:
+  version "3.6.0"
+  resolved "https://registry.yarnpkg.com/vite-plugin-dts/-/vite-plugin-dts-3.6.0.tgz#8d1052e93ae4efef1b0860e44411570a58c77517"
+  integrity sha512-doxhDRFJCZD2sGjIp4V800nm8Y19GvmwckjG5vYPuiqJ7OBjc9NlW1Vp9Gkyh2aXlUs1jTDRH/lxWfcsPLOQHg==
   dependencies:
-    "@microsoft/api-extractor" "^7.36.3"
+    "@microsoft/api-extractor" "^7.36.4"
     "@rollup/pluginutils" "^5.0.2"
     "@vue/language-core" "^1.8.8"
     debug "^4.3.4"
@@ -6869,19 +6940,19 @@ vite-plugin-eslint@^1.8.1:
     "@types/eslint" "^8.4.5"
     rollup "^2.77.2"
 
-vite-tsconfig-paths@^4.2.0:
-  version "4.2.0"
-  resolved "https://registry.yarnpkg.com/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.0.tgz#bd2647d3eadafb65a10fc98a2ca565211f2eaf63"
-  integrity sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==
+vite-tsconfig-paths@^4.2.1:
+  version "4.2.1"
+  resolved "https://registry.yarnpkg.com/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.1.tgz#e53b89096b91d31a6d1e26f75999ea8c336a89ed"
+  integrity sha512-GNUI6ZgPqT3oervkvzU+qtys83+75N/OuDaQl7HmOqFTb0pjZsuARrRipsyJhJ3enqV8beI1xhGbToR4o78nSQ==
   dependencies:
     debug "^4.1.1"
     globrex "^0.1.2"
     tsconfck "^2.1.0"
 
-vite@^4.4.9:
-  version "4.4.9"
-  resolved "https://registry.yarnpkg.com/vite/-/vite-4.4.9.tgz#1402423f1a2f8d66fd8d15e351127c7236d29d3d"
-  integrity sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==
+vite@^4.4.11:
+  version "4.4.11"
+  resolved "https://registry.yarnpkg.com/vite/-/vite-4.4.11.tgz#babdb055b08c69cfc4c468072a2e6c9ca62102b0"
+  integrity sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==
   dependencies:
     esbuild "^0.18.10"
     postcss "^8.4.27"
@@ -7036,16 +7107,21 @@ yallist@^4.0.0:
   resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
   integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
 
-yaml@2.3.1, yaml@^2.2.2:
-  version "2.3.1"
-  resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
-  integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
+yaml@2.3.2:
+  version "2.3.2"
+  resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144"
+  integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==
 
 yaml@^1.10.0:
   version "1.10.2"
   resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
   integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
 
+yaml@^2.2.2:
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
+  integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
+
 yargs-parser@^21.1.1:
   version "21.1.1"
   resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
@@ -7090,10 +7166,10 @@ zod-validation-error@^1.5.0:
   resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-1.5.0.tgz#2b355007a1c3b7fb04fa476bfad4e7b3fd5491e3"
   integrity sha512-/7eFkAI4qV0tcxMBB/3+d2c1P6jzzZYdYSlBuAklzMuCrJu5bzJfHS0yVAS87dRHVlhftd6RFJDIvv03JgkSbw==
 
-zod@^3.22.2:
-  version "3.22.2"
-  resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.2.tgz#3add8c682b7077c05ac6f979fea6998b573e157b"
-  integrity sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==
+zod@^3.22.4:
+  version "3.22.4"
+  resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff"
+  integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==
 
 zustand@^4.4.1:
   version "4.4.1"
diff --git a/invokeai/version/invokeai_version.py b/invokeai/version/invokeai_version.py
index 11731085c0..88c513ea36 100644
--- a/invokeai/version/invokeai_version.py
+++ b/invokeai/version/invokeai_version.py
@@ -1 +1 @@
-__version__ = "3.2.0"
+__version__ = "3.3.0"
diff --git a/pyproject.toml b/pyproject.toml
index f4bbf01102..03fc45c5dc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -35,30 +35,33 @@ dependencies = [
   "accelerate~=0.23.0",
   "albumentations",
   "click",
-  "clip_anytorch",  # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip",
+  "clip_anytorch",         # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip",
   "compel~=2.0.2",
   "controlnet-aux>=0.0.6",
-  "timm==0.6.13",   # needed to override timm latest in controlnet_aux, see  https://github.com/isl-org/ZoeDepth/issues/26
+  "timm==0.6.13",          # needed to override timm latest in controlnet_aux, see  https://github.com/isl-org/ZoeDepth/issues/26
   "datasets",
+  # When bumping diffusers beyond 0.21, make sure to address this:
+  # https://github.com/invoke-ai/InvokeAI/blob/fc09ab7e13cb7ca5389100d149b6422ace7b8ed3/invokeai/app/invocations/latent.py#L513
   "diffusers[torch]~=0.21.0",
   "dnspython~=2.4.0",
   "dynamicprompts",
   "easing-functions",
   "einops",
   "facexlib",
-  "fastapi==0.88.0",
-  "fastapi-events==0.8.0",
+  "fastapi~=0.103.2",
+  "fastapi-events~=0.9.1",
   "huggingface-hub~=0.16.4",
-  "invisible-watermark~=0.2.0", # needed to install SDXL base and refiner using their repo_ids
-  "matplotlib",                 # needed for plotting of Penner easing functions
-  "mediapipe",                  # needed for "mediapipeface" controlnet model
+  "invisible-watermark~=0.2.0",            # needed to install SDXL base and refiner using their repo_ids
+  "matplotlib",                            # needed for plotting of Penner easing functions
+  "mediapipe",                             # needed for "mediapipeface" controlnet model
   "numpy",
   "npyscreen",
   "omegaconf",
   "onnx",
   "onnxruntime",
   "opencv-python",
-  "pydantic==1.*",
+  "pydantic~=2.4.2",
+  "pydantic-settings~=2.0.3",
   "picklescan",
   "pillow",
   "prompt-toolkit",
@@ -67,12 +70,12 @@ dependencies = [
   'pyperclip',
   "pyreadline3",
   "python-multipart",
-  "python-socketio",
+  "python-socketio~=5.10.0",
   "pytorch-lightning",
   "realesrgan",
   "requests~=2.28.2",
   "rich~=13.3",
-  "safetensors~=0.3.1",
+  "safetensors~=0.4.0",
   "scikit-image~=0.21.0",
   "semver~=3.0.1",
   "send2trash",
@@ -93,33 +96,25 @@ dependencies = [
   "mkdocs-git-revision-date-localized-plugin",
   "mkdocs-redirects==1.2.0",
 ]
-"dev" = [
-  "jurigged",
-  "pudb",
-]
+"dev" = ["jurigged", "pudb"]
 "test" = [
   "black",
   "flake8",
   "Flake8-pyproject",
   "isort",
+  "mypy",
   "pre-commit",
   "pytest>6.0.0",
   "pytest-cov",
   "pytest-datadir",
 ]
 "xformers" = [
-	   "xformers~=0.0.19; sys_platform!='darwin'",
-	   "triton; sys_platform=='linux'",
-]
-"onnx" = [
-  "onnxruntime",
-]
-"onnx-cuda" = [
-  "onnxruntime-gpu",
-]
-"onnx-directml" = [
-  "onnxruntime-directml",
+  "xformers~=0.0.19; sys_platform!='darwin'",
+  "triton; sys_platform=='linux'",
 ]
+"onnx" = ["onnxruntime"]
+"onnx-cuda" = ["onnxruntime-gpu"]
+"onnx-directml" = ["onnxruntime-directml"]
 
 [project.scripts]
 
@@ -161,12 +156,15 @@ version = { attr = "invokeai.version.__version__" }
 [tool.setuptools.packages.find]
 "where" = ["."]
 "include" = [
-    "invokeai.assets.fonts*","invokeai.version*",
-    "invokeai.generator*","invokeai.backend*",
-    "invokeai.frontend*", "invokeai.frontend.web.dist*",
-    "invokeai.frontend.web.static*",
-    "invokeai.configs*",
-    "invokeai.app*",
+  "invokeai.assets.fonts*",
+  "invokeai.version*",
+  "invokeai.generator*",
+  "invokeai.backend*",
+  "invokeai.frontend*",
+  "invokeai.frontend.web.dist*",
+  "invokeai.frontend.web.static*",
+  "invokeai.configs*",
+  "invokeai.app*",
 ]
 
 [tool.setuptools.package-data]
@@ -180,7 +178,7 @@ version = { attr = "invokeai.version.__version__" }
 [tool.pytest.ini_options]
 addopts = "--cov-report term --cov-report html --cov-report xml --strict-markers -m \"not slow\""
 markers = [
-    "slow: Marks tests as slow. Disabled by default. To run all tests, use -m \"\". To run only slow tests, use -m \"slow\"."
+  "slow: Marks tests as slow. Disabled by default. To run all tests, use -m \"\". To run only slow tests, use -m \"slow\".",
 ]
 [tool.coverage.run]
 branch = true
@@ -188,7 +186,7 @@ source = ["invokeai"]
 omit = ["*tests*", "*migrations*", ".venv/*", "*.env"]
 [tool.coverage.report]
 show_missing = true
-fail_under = 85  # let's set something sensible on Day 1 ...
+fail_under = 85     # let's set something sensible on Day 1 ...
 [tool.coverage.json]
 output = "coverage/coverage.json"
 pretty_print = true
@@ -207,7 +205,7 @@ exclude = [
   "__pycache__",
   "build",
   "dist",
-  "invokeai/frontend/web/node_modules/"
+  "invokeai/frontend/web/node_modules/",
 ]
 
 [tool.black]
@@ -216,3 +214,53 @@ line-length = 120
 [tool.isort]
 profile = "black"
 line_length = 120
+
+[tool.mypy]
+ignore_missing_imports = true # ignores missing types in third-party libraries
+
+[[tool.mypy.overrides]]
+follow_imports = "skip"
+module = [
+  "invokeai.app.api.routers.models",
+  "invokeai.app.invocations.compel",
+  "invokeai.app.invocations.latent",
+  "invokeai.app.services.config.config_base",
+  "invokeai.app.services.config.config_default",
+  "invokeai.app.services.invocation_stats.invocation_stats_default",
+  "invokeai.app.services.model_manager.model_manager_base",
+  "invokeai.app.services.model_manager.model_manager_default",
+  "invokeai.app.util.controlnet_utils",
+  "invokeai.backend.image_util.txt2mask",
+  "invokeai.backend.image_util.safety_checker",
+  "invokeai.backend.image_util.patchmatch",
+  "invokeai.backend.image_util.invisible_watermark",
+  "invokeai.backend.install.model_install_backend",
+  "invokeai.backend.ip_adapter.ip_adapter",
+  "invokeai.backend.ip_adapter.resampler",
+  "invokeai.backend.ip_adapter.unet_patcher",
+  "invokeai.backend.model_management.convert_ckpt_to_diffusers",
+  "invokeai.backend.model_management.lora",
+  "invokeai.backend.model_management.model_cache",
+  "invokeai.backend.model_management.model_manager",
+  "invokeai.backend.model_management.model_merge",
+  "invokeai.backend.model_management.model_probe",
+  "invokeai.backend.model_management.model_search",
+  "invokeai.backend.model_management.models.*",                            # this is needed to ignore the module's `__init__.py`
+  "invokeai.backend.model_management.models.base",
+  "invokeai.backend.model_management.models.controlnet",
+  "invokeai.backend.model_management.models.ip_adapter",
+  "invokeai.backend.model_management.models.lora",
+  "invokeai.backend.model_management.models.sdxl",
+  "invokeai.backend.model_management.models.stable_diffusion",
+  "invokeai.backend.model_management.models.vae",
+  "invokeai.backend.model_management.seamless",
+  "invokeai.backend.model_management.util",
+  "invokeai.backend.stable_diffusion.diffusers_pipeline",
+  "invokeai.backend.stable_diffusion.diffusion.cross_attention_control",
+  "invokeai.backend.stable_diffusion.diffusion.shared_invokeai_diffusion",
+  "invokeai.backend.util.hotfixes",
+  "invokeai.backend.util.logging",
+  "invokeai.backend.util.mps_fixes",
+  "invokeai.backend.util.util",
+  "invokeai.frontend.install.model_install",
+]
diff --git a/tests/backend/model_management/test_libc_util.py b/tests/backend/model_management/test_libc_util.py
index a517db4c90..e13a2fd3a2 100644
--- a/tests/backend/model_management/test_libc_util.py
+++ b/tests/backend/model_management/test_libc_util.py
@@ -11,7 +11,10 @@ def test_libc_util_mallinfo2():
         # TODO: Set the expected result preemptively based on the system properties.
         pytest.xfail("libc shared library is not available on this system.")
 
-    info = libc.mallinfo2()
+    try:
+        info = libc.mallinfo2()
+    except AttributeError:
+        pytest.xfail("`mallinfo2` is not available on this system, likely due to glibc < 2.33.")
 
     assert info.arena > 0
 
diff --git a/tests/nodes/test_graph_execution_state.py b/tests/nodes/test_graph_execution_state.py
index e43075bd32..27b8a58bea 100644
--- a/tests/nodes/test_graph_execution_state.py
+++ b/tests/nodes/test_graph_execution_state.py
@@ -1,5 +1,4 @@
 import logging
-import threading
 
 import pytest
 
@@ -10,20 +9,27 @@ from .test_nodes import (  # isort: split
     TestEventService,
     TextToImageTestInvocation,
 )
-import sqlite3
 
 from invokeai.app.invocations.baseinvocation import BaseInvocation, BaseInvocationOutput, InvocationContext
 from invokeai.app.invocations.collections import RangeInvocation
 from invokeai.app.invocations.math import AddInvocation, MultiplyInvocation
-from invokeai.app.services.config.invokeai_config import InvokeAIAppConfig
-from invokeai.app.services.graph import CollectInvocation, Graph, GraphExecutionState, IterateInvocation, LibraryGraph
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
 from invokeai.app.services.invocation_cache.invocation_cache_memory import MemoryInvocationCache
-from invokeai.app.services.invocation_queue import MemoryInvocationQueue
+from invokeai.app.services.invocation_processor.invocation_processor_default import DefaultInvocationProcessor
+from invokeai.app.services.invocation_queue.invocation_queue_memory import MemoryInvocationQueue
 from invokeai.app.services.invocation_services import InvocationServices
-from invokeai.app.services.invocation_stats import InvocationStatsService
-from invokeai.app.services.processor import DefaultInvocationProcessor
+from invokeai.app.services.invocation_stats.invocation_stats_default import InvocationStatsService
+from invokeai.app.services.item_storage.item_storage_sqlite import SqliteItemStorage
 from invokeai.app.services.session_queue.session_queue_common import DEFAULT_QUEUE_ID
-from invokeai.app.services.sqlite import SqliteItemStorage, sqlite_memory
+from invokeai.app.services.shared.graph import (
+    CollectInvocation,
+    Graph,
+    GraphExecutionState,
+    IterateInvocation,
+    LibraryGraph,
+)
+from invokeai.app.services.shared.sqlite import SqliteDatabase
+from invokeai.backend.util.logging import InvokeAILogger
 
 from .test_invoker import create_edge
 
@@ -42,29 +48,33 @@ def simple_graph():
 # the test invocations.
 @pytest.fixture
 def mock_services() -> InvocationServices:
-    lock = threading.Lock()
+    configuration = InvokeAIAppConfig(use_memory_db=True, node_cache_size=0)
+    db = SqliteDatabase(configuration, InvokeAILogger.get_logger())
     # NOTE: none of these are actually called by the test invocations
-    db_conn = sqlite3.connect(sqlite_memory, check_same_thread=False)
-    graph_execution_manager = SqliteItemStorage[GraphExecutionState](
-        conn=db_conn, table_name="graph_executions", lock=lock
-    )
+    graph_execution_manager = SqliteItemStorage[GraphExecutionState](db=db, table_name="graph_executions")
     return InvocationServices(
-        model_manager=None,  # type: ignore
-        events=TestEventService(),
-        logger=logging,  # type: ignore
-        images=None,  # type: ignore
-        latents=None,  # type: ignore
-        boards=None,  # type: ignore
+        board_image_records=None,  # type: ignore
         board_images=None,  # type: ignore
-        queue=MemoryInvocationQueue(),
-        graph_library=SqliteItemStorage[LibraryGraph](conn=db_conn, table_name="graphs", lock=lock),
+        board_records=None,  # type: ignore
+        boards=None,  # type: ignore
+        configuration=configuration,
+        events=TestEventService(),
         graph_execution_manager=graph_execution_manager,
-        performance_statistics=InvocationStatsService(graph_execution_manager),
+        graph_library=SqliteItemStorage[LibraryGraph](db=db, table_name="graphs"),
+        image_files=None,  # type: ignore
+        image_records=None,  # type: ignore
+        images=None,  # type: ignore
+        invocation_cache=MemoryInvocationCache(max_cache_size=0),
+        latents=None,  # type: ignore
+        logger=logging,  # type: ignore
+        model_manager=None,  # type: ignore
+        names=None,  # type: ignore
+        performance_statistics=InvocationStatsService(),
         processor=DefaultInvocationProcessor(),
-        configuration=InvokeAIAppConfig(node_cache_size=0),  # type: ignore
-        session_queue=None,  # type: ignore
+        queue=MemoryInvocationQueue(),
         session_processor=None,  # type: ignore
-        invocation_cache=MemoryInvocationCache(),  # type: ignore
+        session_queue=None,  # type: ignore
+        urls=None,  # type: ignore
     )
 
 
diff --git a/tests/nodes/test_invoker.py b/tests/nodes/test_invoker.py
index 7c636c3eca..105f7417cd 100644
--- a/tests/nodes/test_invoker.py
+++ b/tests/nodes/test_invoker.py
@@ -1,10 +1,9 @@
 import logging
-import sqlite3
-import threading
 
 import pytest
 
-from invokeai.app.services.config.invokeai_config import InvokeAIAppConfig
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.backend.util.logging import InvokeAILogger
 
 # This import must happen before other invoke imports or test in other files(!!) break
 from .test_nodes import (  # isort: split
@@ -16,15 +15,16 @@ from .test_nodes import (  # isort: split
     wait_until,
 )
 
-from invokeai.app.services.graph import Graph, GraphExecutionState, GraphInvocation, LibraryGraph
 from invokeai.app.services.invocation_cache.invocation_cache_memory import MemoryInvocationCache
-from invokeai.app.services.invocation_queue import MemoryInvocationQueue
+from invokeai.app.services.invocation_processor.invocation_processor_default import DefaultInvocationProcessor
+from invokeai.app.services.invocation_queue.invocation_queue_memory import MemoryInvocationQueue
 from invokeai.app.services.invocation_services import InvocationServices
-from invokeai.app.services.invocation_stats import InvocationStatsService
+from invokeai.app.services.invocation_stats.invocation_stats_default import InvocationStatsService
 from invokeai.app.services.invoker import Invoker
-from invokeai.app.services.processor import DefaultInvocationProcessor
+from invokeai.app.services.item_storage.item_storage_sqlite import SqliteItemStorage
 from invokeai.app.services.session_queue.session_queue_common import DEFAULT_QUEUE_ID
-from invokeai.app.services.sqlite import SqliteItemStorage, sqlite_memory
+from invokeai.app.services.shared.graph import Graph, GraphExecutionState, GraphInvocation, LibraryGraph
+from invokeai.app.services.shared.sqlite import SqliteDatabase
 
 
 @pytest.fixture
@@ -52,29 +52,34 @@ def graph_with_subgraph():
 # the test invocations.
 @pytest.fixture
 def mock_services() -> InvocationServices:
-    lock = threading.Lock()
+    db = SqliteDatabase(InvokeAIAppConfig(use_memory_db=True), InvokeAILogger.get_logger())
+    configuration = InvokeAIAppConfig(use_memory_db=True, node_cache_size=0)
+
     # NOTE: none of these are actually called by the test invocations
-    db_conn = sqlite3.connect(sqlite_memory, check_same_thread=False)
-    graph_execution_manager = SqliteItemStorage[GraphExecutionState](
-        conn=db_conn, table_name="graph_executions", lock=lock
-    )
+    graph_execution_manager = SqliteItemStorage[GraphExecutionState](db=db, table_name="graph_executions")
     return InvocationServices(
-        model_manager=None,  # type: ignore
-        events=TestEventService(),
-        logger=logging,  # type: ignore
-        images=None,  # type: ignore
-        latents=None,  # type: ignore
-        boards=None,  # type: ignore
+        board_image_records=None,  # type: ignore
         board_images=None,  # type: ignore
-        queue=MemoryInvocationQueue(),
-        graph_library=SqliteItemStorage[LibraryGraph](conn=db_conn, table_name="graphs", lock=lock),
+        board_records=None,  # type: ignore
+        boards=None,  # type: ignore
+        configuration=configuration,
+        events=TestEventService(),
         graph_execution_manager=graph_execution_manager,
-        processor=DefaultInvocationProcessor(),
-        performance_statistics=InvocationStatsService(graph_execution_manager),
-        configuration=InvokeAIAppConfig(node_cache_size=0),  # type: ignore
-        session_queue=None,  # type: ignore
-        session_processor=None,  # type: ignore
+        graph_library=SqliteItemStorage[LibraryGraph](db=db, table_name="graphs"),
+        image_files=None,  # type: ignore
+        image_records=None,  # type: ignore
+        images=None,  # type: ignore
         invocation_cache=MemoryInvocationCache(max_cache_size=0),
+        latents=None,  # type: ignore
+        logger=logging,  # type: ignore
+        model_manager=None,  # type: ignore
+        names=None,  # type: ignore
+        performance_statistics=InvocationStatsService(),
+        processor=DefaultInvocationProcessor(),
+        queue=MemoryInvocationQueue(),
+        session_processor=None,  # type: ignore
+        session_queue=None,  # type: ignore
+        urls=None,  # type: ignore
     )
 
 
diff --git a/tests/nodes/test_node_graph.py b/tests/nodes/test_node_graph.py
index 4793e6ffa6..3c965895f9 100644
--- a/tests/nodes/test_node_graph.py
+++ b/tests/nodes/test_node_graph.py
@@ -1,4 +1,5 @@
 import pytest
+from pydantic import TypeAdapter
 
 from invokeai.app.invocations.baseinvocation import (
     BaseInvocation,
@@ -11,8 +12,8 @@ from invokeai.app.invocations.image import ShowImageInvocation
 from invokeai.app.invocations.math import AddInvocation, SubtractInvocation
 from invokeai.app.invocations.primitives import FloatInvocation, IntegerInvocation
 from invokeai.app.invocations.upscale import ESRGANInvocation
-from invokeai.app.services.default_graphs import create_text_to_image
-from invokeai.app.services.graph import (
+from invokeai.app.services.shared.default_graphs import create_text_to_image
+from invokeai.app.services.shared.graph import (
     CollectInvocation,
     Edge,
     EdgeConnection,
@@ -593,20 +594,21 @@ def test_graph_can_serialize():
     g.add_edge(e)
 
     # Not throwing on this line is sufficient
-    _ = g.json()
+    _ = g.model_dump_json()
 
 
 def test_graph_can_deserialize():
     g = Graph()
     n1 = TextToImageTestInvocation(id="1", prompt="Banana sushi")
-    n2 = ESRGANInvocation(id="2")
+    n2 = ImageToImageTestInvocation(id="2")
     g.add_node(n1)
     g.add_node(n2)
     e = create_edge(n1.id, "image", n2.id, "image")
     g.add_edge(e)
 
-    json = g.json()
-    g2 = Graph.parse_raw(json)
+    json = g.model_dump_json()
+    adapter_graph = TypeAdapter(Graph)
+    g2 = adapter_graph.validate_json(json)
 
     assert g2 is not None
     assert g2.nodes["1"] is not None
@@ -619,7 +621,7 @@ def test_graph_can_deserialize():
 
 
 def test_invocation_decorator():
-    invocation_type = "test_invocation"
+    invocation_type = "test_invocation_decorator"
     title = "Test Invocation"
     tags = ["first", "second", "third"]
     category = "category"
@@ -630,7 +632,7 @@ def test_invocation_decorator():
         def invoke(self):
             pass
 
-    schema = TestInvocation.schema()
+    schema = TestInvocation.model_json_schema()
 
     assert schema.get("title") == title
     assert schema.get("tags") == tags
@@ -640,18 +642,17 @@ def test_invocation_decorator():
 
 
 def test_invocation_version_must_be_semver():
-    invocation_type = "test_invocation"
     valid_version = "1.0.0"
     invalid_version = "not_semver"
 
-    @invocation(invocation_type, version=valid_version)
+    @invocation("test_invocation_version_valid", version=valid_version)
     class ValidVersionInvocation(BaseInvocation):
         def invoke(self):
             pass
 
     with pytest.raises(InvalidVersionError):
 
-        @invocation(invocation_type, version=invalid_version)
+        @invocation("test_invocation_version_invalid", version=invalid_version)
         class InvalidVersionInvocation(BaseInvocation):
             def invoke(self):
                 pass
@@ -694,4 +695,4 @@ def test_ints_do_not_accept_floats():
 def test_graph_can_generate_schema():
     # Not throwing on this line is sufficient
     # NOTE: if this test fails, it's PROBABLY because a new invocation type is breaking schema generation
-    _ = Graph.schema_json(indent=2)
+    _ = Graph.model_json_schema()
diff --git a/tests/nodes/test_nodes.py b/tests/nodes/test_nodes.py
index 96a5040a38..471c72a005 100644
--- a/tests/nodes/test_nodes.py
+++ b/tests/nodes/test_nodes.py
@@ -82,8 +82,8 @@ class PromptCollectionTestInvocation(BaseInvocation):
 
 
 # Importing these must happen after test invocations are defined or they won't register
-from invokeai.app.services.events import EventServiceBase  # noqa: E402
-from invokeai.app.services.graph import Edge, EdgeConnection  # noqa: E402
+from invokeai.app.services.events.events_base import EventServiceBase  # noqa: E402
+from invokeai.app.services.shared.graph import Edge, EdgeConnection  # noqa: E402
 
 
 def create_edge(from_id: str, from_field: str, to_id: str, to_field: str) -> Edge:
diff --git a/tests/nodes/test_session_queue.py b/tests/nodes/test_session_queue.py
index f28ec1ac54..731316068c 100644
--- a/tests/nodes/test_session_queue.py
+++ b/tests/nodes/test_session_queue.py
@@ -1,7 +1,6 @@
 import pytest
-from pydantic import ValidationError, parse_raw_as
+from pydantic import TypeAdapter, ValidationError
 
-from invokeai.app.services.graph import Graph, GraphExecutionState, GraphInvocation
 from invokeai.app.services.session_queue.session_queue_common import (
     Batch,
     BatchDataCollection,
@@ -12,6 +11,7 @@ from invokeai.app.services.session_queue.session_queue_common import (
     populate_graph,
     prepare_values_to_insert,
 )
+from invokeai.app.services.shared.graph import Graph, GraphExecutionState, GraphInvocation
 from tests.nodes.test_nodes import PromptTestInvocation
 
 
@@ -150,8 +150,9 @@ def test_prepare_values_to_insert(batch_data_collection, batch_graph):
     values = prepare_values_to_insert(queue_id="default", batch=b, priority=0, max_new_queue_items=1000)
     assert len(values) == 8
 
+    session_adapter = TypeAdapter(GraphExecutionState)
     # graph should be serialized
-    ges = parse_raw_as(GraphExecutionState, values[0].session)
+    ges = session_adapter.validate_json(values[0].session)
 
     # graph values should be populated
     assert ges.graph.get_node("1").prompt == "Banana sushi"
@@ -160,15 +161,16 @@ def test_prepare_values_to_insert(batch_data_collection, batch_graph):
     assert ges.graph.get_node("4").prompt == "Nissan"
 
     # session ids should match deserialized graph
-    assert [v.session_id for v in values] == [parse_raw_as(GraphExecutionState, v.session).id for v in values]
+    assert [v.session_id for v in values] == [session_adapter.validate_json(v.session).id for v in values]
 
     # should unique session ids
     sids = [v.session_id for v in values]
     assert len(sids) == len(set(sids))
 
+    nfv_list_adapter = TypeAdapter(list[NodeFieldValue])
     # should have 3 node field values
     assert type(values[0].field_values) is str
-    assert len(parse_raw_as(list[NodeFieldValue], values[0].field_values)) == 3
+    assert len(nfv_list_adapter.validate_json(values[0].field_values)) == 3
 
     # should have batch id and priority
     assert all(v.batch_id == b.batch_id for v in values)
diff --git a/tests/nodes/test_sqlite.py b/tests/nodes/test_sqlite.py
index 002161e917..818f9d048f 100644
--- a/tests/nodes/test_sqlite.py
+++ b/tests/nodes/test_sqlite.py
@@ -1,10 +1,10 @@
-import sqlite3
-import threading
-
 import pytest
 from pydantic import BaseModel, Field
 
-from invokeai.app.services.sqlite import SqliteItemStorage, sqlite_memory
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
+from invokeai.app.services.item_storage.item_storage_sqlite import SqliteItemStorage
+from invokeai.app.services.shared.sqlite import SqliteDatabase
+from invokeai.backend.util.logging import InvokeAILogger
 
 
 class TestModel(BaseModel):
@@ -14,8 +14,9 @@ class TestModel(BaseModel):
 
 @pytest.fixture
 def db() -> SqliteItemStorage[TestModel]:
-    db_conn = sqlite3.connect(sqlite_memory, check_same_thread=False)
-    return SqliteItemStorage[TestModel](db_conn, table_name="test", id_field="id", lock=threading.Lock())
+    sqlite_db = SqliteDatabase(InvokeAIAppConfig(use_memory_db=True), InvokeAILogger.get_logger())
+    sqlite_item_storage = SqliteItemStorage[TestModel](db=sqlite_db, table_name="test", id_field="id")
+    return sqlite_item_storage
 
 
 def test_sqlite_service_can_create_and_get(db: SqliteItemStorage[TestModel]):
diff --git a/tests/test_config.py b/tests/test_config.py
index 2b2492f6a6..6d76872a0d 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -192,7 +192,7 @@ def test_deny_nodes(patch_rootdir):
     # must parse config before importing Graph, so its nodes union uses the config
     conf = InvokeAIAppConfig().get_config()
     conf.parse_args(conf=allow_deny_nodes_conf, argv=[])
-    from invokeai.app.services.graph import Graph
+    from invokeai.app.services.shared.graph import Graph
 
     # confirm graph validation fails when using denied node
     Graph(nodes={"1": {"id": "1", "type": "integer"}})
diff --git a/tests/test_model_manager.py b/tests/test_model_manager.py
index 5a28862e1f..3e48c7ed6f 100644
--- a/tests/test_model_manager.py
+++ b/tests/test_model_manager.py
@@ -2,7 +2,7 @@ from pathlib import Path
 
 import pytest
 
-from invokeai.app.services.config import InvokeAIAppConfig
+from invokeai.app.services.config.config_default import InvokeAIAppConfig
 from invokeai.backend import BaseModelType, ModelManager, ModelType, SubModelType
 
 BASIC_MODEL_NAME = ("SDXL base", BaseModelType.StableDiffusionXL, ModelType.Main)