diff --git a/.github/workflows/create-caches.yml b/.github/workflows/create-caches.yml index 33ea3b82ed..946025d78b 100644 --- a/.github/workflows/create-caches.yml +++ b/.github/workflows/create-caches.yml @@ -54,9 +54,10 @@ jobs: [[ -d models/ldm/stable-diffusion-v1 ]] \ || mkdir -p models/ldm/stable-diffusion-v1 [[ -r models/ldm/stable-diffusion-v1/model.ckpt ]] \ - || curl --user "${{ secrets.HUGGINGFACE_TOKEN }}" \ + || curl \ + -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ -o models/ldm/stable-diffusion-v1/model.ckpt \ - -O -L https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt + -L https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt - name: Activate Conda Env uses: conda-incubator/setup-miniconda@v2 diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 65e3e4e1e2..8348b4f516 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -14,16 +14,15 @@ jobs: strategy: fail-fast: false matrix: + stable-diffusion-model: ['https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt'] os: [ubuntu-latest, macos-latest] include: - os: ubuntu-latest environment-file: environment.yml default-shell: bash -l {0} - stable-diffusion-model: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt - os: macos-latest environment-file: environment-mac.yml default-shell: bash -l {0} - stable-diffusion-model: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt name: Test invoke.py on ${{ matrix.os }} with conda runs-on: ${{ matrix.os }} defaults: @@ -71,9 +70,10 @@ jobs: [[ -d models/ldm/stable-diffusion-v1 ]] \ || mkdir -p models/ldm/stable-diffusion-v1 [[ -r models/ldm/stable-diffusion-v1/model.ckpt ]] \ - || curl --user "${{ secrets.HUGGINGFACE_TOKEN }}" \ + || curl \ + -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ -o models/ldm/stable-diffusion-v1/model.ckpt \ - -O -L ${{ matrix.stable-diffusion-model }} + -L ${{ matrix.stable-diffusion-model }} - name: Activate Conda Env uses: conda-incubator/setup-miniconda@v2 diff --git a/backend/invoke_ai_web_server.py b/backend/invoke_ai_web_server.py index dabe072f80..d6c8053b78 100644 --- a/backend/invoke_ai_web_server.py +++ b/backend/invoke_ai_web_server.py @@ -5,6 +5,8 @@ import shutil import mimetypes import traceback import math +import io +import base64 from flask import Flask, redirect, send_from_directory from flask_socketio import SocketIO @@ -42,70 +44,64 @@ class InvokeAIWebServer: def setup_flask(self): # Fix missing mimetypes on Windows - mimetypes.add_type('application/javascript', '.js') - mimetypes.add_type('text/css', '.css') + mimetypes.add_type("application/javascript", ".js") + mimetypes.add_type("text/css", ".css") # Socket IO logger = True if args.web_verbose else False engineio_logger = True if args.web_verbose else False max_http_buffer_size = 10000000 socketio_args = { - 'logger': logger, - 'engineio_logger': engineio_logger, - 'max_http_buffer_size': max_http_buffer_size, - 'ping_interval': (50, 50), - 'ping_timeout': 60, + "logger": logger, + "engineio_logger": engineio_logger, + "max_http_buffer_size": max_http_buffer_size, + "ping_interval": (50, 50), + "ping_timeout": 60, } if opt.cors: - socketio_args['cors_allowed_origins'] = opt.cors + socketio_args["cors_allowed_origins"] = opt.cors self.app = Flask( - __name__, static_url_path='', static_folder='../frontend/dist/' + __name__, static_url_path="", static_folder="../frontend/dist/" ) - self.socketio = SocketIO( - self.app, - **socketio_args - ) + self.socketio = SocketIO(self.app, **socketio_args) # Keep Server Alive Route - @self.app.route('/flaskwebgui-keep-server-alive') + @self.app.route("/flaskwebgui-keep-server-alive") def keep_alive(): - return {'message': 'Server Running'} + return {"message": "Server Running"} # Outputs Route - self.app.config['OUTPUTS_FOLDER'] = os.path.abspath(args.outdir) + self.app.config["OUTPUTS_FOLDER"] = os.path.abspath(args.outdir) - @self.app.route('/outputs/') + @self.app.route("/outputs/") def outputs(file_path): - return send_from_directory( - self.app.config['OUTPUTS_FOLDER'], file_path - ) + return send_from_directory(self.app.config["OUTPUTS_FOLDER"], file_path) # Base Route - @self.app.route('/') + @self.app.route("/") def serve(): if args.web_develop: - return redirect('http://127.0.0.1:5173') + return redirect("http://127.0.0.1:5173") else: - return send_from_directory( - self.app.static_folder, 'index.html' - ) + return send_from_directory(self.app.static_folder, "index.html") self.load_socketio_listeners(self.socketio) if args.gui: - print('>> Launching Invoke AI GUI') + print(">> Launching Invoke AI GUI") close_server_on_exit = True if args.web_develop: close_server_on_exit = False try: from flaskwebgui import FlaskUI + FlaskUI( app=self.app, socketio=self.socketio, - start_server='flask-socketio', + start_server="flask-socketio", host=self.host, port=self.port, width=1600, @@ -118,36 +114,32 @@ class InvokeAIWebServer: sys.exit(0) else: - print('>> Started Invoke AI Web Server!') - if self.host == '0.0.0.0': + print(">> Started Invoke AI Web Server!") + if self.host == "0.0.0.0": print( f"Point your browser at http://localhost:{self.port} or use the host's DNS name or IP address." ) else: print( - '>> Default host address now 127.0.0.1 (localhost). Use --host 0.0.0.0 to bind any address.' - ) - print( - f'>> Point your browser at http://{self.host}:{self.port}' + ">> Default host address now 127.0.0.1 (localhost). Use --host 0.0.0.0 to bind any address." ) + print(f">> Point your browser at http://{self.host}:{self.port}") self.socketio.run(app=self.app, host=self.host, port=self.port) def setup_app(self): - self.result_url = 'outputs/' - self.init_image_url = 'outputs/init-images/' - self.mask_image_url = 'outputs/mask-images/' - self.intermediate_url = 'outputs/intermediates/' + self.result_url = "outputs/" + self.init_image_url = "outputs/init-images/" + self.mask_image_url = "outputs/mask-images/" + self.intermediate_url = "outputs/intermediates/" # location for "finished" images self.result_path = args.outdir # temporary path for intermediates - self.intermediate_path = os.path.join( - self.result_path, 'intermediates/' - ) + self.intermediate_path = os.path.join(self.result_path, "intermediates/") # path for user-uploaded init images and masks - self.init_image_path = os.path.join(self.result_path, 'init-images/') - self.mask_image_path = os.path.join(self.result_path, 'mask-images/') + self.init_image_path = os.path.join(self.result_path, "init-images/") + self.mask_image_path = os.path.join(self.result_path, "mask-images/") # txt log - self.log_path = os.path.join(self.result_path, 'invoke_log.txt') + self.log_path = os.path.join(self.result_path, "invoke_log.txt") # make all output paths [ os.makedirs(path, exist_ok=True) @@ -160,16 +152,42 @@ class InvokeAIWebServer: ] def load_socketio_listeners(self, socketio): - @socketio.on('requestSystemConfig') + @socketio.on("requestSystemConfig") def handle_request_capabilities(): - print(f'>> System config requested') + print(f">> System config requested") config = self.get_system_config() - socketio.emit('systemConfig', config) + socketio.emit("systemConfig", config) - @socketio.on('requestLatestImages') - def handle_request_latest_images(latest_mtime): + @socketio.on("requestModelChange") + def handle_set_model(model_name: str): try: - paths = glob.glob(os.path.join(self.result_path, '*.png')) + print(f">> Model change requested: {model_name}") + model = self.generate.set_model(model_name) + model_list = self.generate.model_cache.list_models() + if model is None: + socketio.emit( + "modelChangeFailed", + {"model_name": model_name, "model_list": model_list}, + ) + else: + socketio.emit( + "modelChanged", + {"model_name": model_name, "model_list": model_list}, + ) + except Exception as e: + self.socketio.emit("error", {"message": (str(e))}) + print("\n") + + traceback.print_exc() + print("\n") + + @socketio.on("requestLatestImages") + def handle_request_latest_images(category, latest_mtime): + try: + base_path = ( + self.result_path if category == "result" else self.init_image_path + ) + paths = glob.glob(os.path.join(base_path, "*.png")) image_paths = sorted( paths, key=lambda x: os.path.getmtime(x), reverse=True @@ -186,33 +204,39 @@ class InvokeAIWebServer: for path in image_paths: metadata = retrieve_metadata(path) + (width, height) = Image.open(path).size image_array.append( { - 'url': self.get_url_from_image_path(path), - 'mtime': os.path.getmtime(path), - 'metadata': metadata['sd-metadata'], + "url": self.get_url_from_image_path(path), + "mtime": os.path.getmtime(path), + "metadata": metadata["sd-metadata"], + "width": width, + "height": height, + "category": category, } ) socketio.emit( - 'galleryImages', - { - 'images': image_array, - }, + "galleryImages", + {"images": image_array, "category": category}, ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") - @socketio.on('requestImages') - def handle_request_images(earliest_mtime=None): + @socketio.on("requestImages") + def handle_request_images(category, earliest_mtime=None): try: page_size = 50 - paths = glob.glob(os.path.join(self.result_path, '*.png')) + base_path = ( + self.result_path if category == "result" else self.init_image_path + ) + + paths = glob.glob(os.path.join(base_path, "*.png")) image_paths = sorted( paths, key=lambda x: os.path.getmtime(x), reverse=True @@ -233,50 +257,67 @@ class InvokeAIWebServer: for path in image_paths: metadata = retrieve_metadata(path) + + (width, height) = Image.open(path).size + image_array.append( { - 'url': self.get_url_from_image_path(path), - 'mtime': os.path.getmtime(path), - 'metadata': metadata['sd-metadata'], + "url": self.get_url_from_image_path(path), + "mtime": os.path.getmtime(path), + "metadata": metadata["sd-metadata"], + "width": width, + "height": height, + "category": category, } ) socketio.emit( - 'galleryImages', + "galleryImages", { - 'images': image_array, - 'areMoreImagesAvailable': areMoreImagesAvailable, + "images": image_array, + "areMoreImagesAvailable": areMoreImagesAvailable, + "category": category, }, ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") - @socketio.on('generateImage') + @socketio.on("generateImage") def handle_generate_image_event( generation_parameters, esrgan_parameters, facetool_parameters ): try: - print( - f'>> Image generation requested: {generation_parameters}\nESRGAN parameters: {esrgan_parameters}\nFacetool parameters: {facetool_parameters}' - ) + # truncate long init_mask base64 if needed + if "init_mask" in generation_parameters: + printable_parameters = { + **generation_parameters, + "init_mask": generation_parameters["init_mask"][:20] + "...", + } + print( + f">> Image generation requested: {printable_parameters}\nESRGAN parameters: {esrgan_parameters}\nFacetool parameters: {facetool_parameters}" + ) + else: + print( + f">> Image generation requested: {generation_parameters}\nESRGAN parameters: {esrgan_parameters}\nFacetool parameters: {facetool_parameters}" + ) self.generate_images( - generation_parameters, esrgan_parameters, facetool_parameters + generation_parameters, + esrgan_parameters, + facetool_parameters, ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") - @socketio.on('runPostprocessing') - def handle_run_postprocessing( - original_image, postprocessing_parameters - ): + @socketio.on("runPostprocessing") + def handle_run_postprocessing(original_image, postprocessing_parameters): try: print( f'>> Postprocessing requested for "{original_image["url"]}": {postprocessing_parameters}' @@ -284,64 +325,64 @@ class InvokeAIWebServer: progress = Progress() - socketio.emit('progressUpdate', progress.to_formatted_dict()) + socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) original_image_path = self.get_image_path_from_url( - original_image['url'] + original_image["url"] ) image = Image.open(original_image_path) seed = ( - original_image['metadata']['seed'] - if 'seed' in original_image['metadata'] - else 'unknown_seed' + original_image["metadata"]["seed"] + if "seed" in original_image["metadata"] + else "unknown_seed" ) - if postprocessing_parameters['type'] == 'esrgan': - progress.set_current_status('Upscaling (ESRGAN)') - elif postprocessing_parameters['type'] == 'gfpgan': - progress.set_current_status('Restoring Faces (GFPGAN)') - elif postprocessing_parameters['type'] == 'codeformer': - progress.set_current_status('Restoring Faces (Codeformer)') + if postprocessing_parameters["type"] == "esrgan": + progress.set_current_status("Upscaling (ESRGAN)") + elif postprocessing_parameters["type"] == "gfpgan": + progress.set_current_status("Restoring Faces (GFPGAN)") + elif postprocessing_parameters["type"] == "codeformer": + progress.set_current_status("Restoring Faces (Codeformer)") - socketio.emit('progressUpdate', progress.to_formatted_dict()) + socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) - if postprocessing_parameters['type'] == 'esrgan': + if postprocessing_parameters["type"] == "esrgan": image = self.esrgan.process( image=image, - upsampler_scale=postprocessing_parameters['upscale'][ - 0 - ], - strength=postprocessing_parameters['upscale'][1], + upsampler_scale=postprocessing_parameters["upscale"][0], + strength=postprocessing_parameters["upscale"][1], seed=seed, ) - elif postprocessing_parameters['type'] == 'gfpgan': + elif postprocessing_parameters["type"] == "gfpgan": image = self.gfpgan.process( image=image, - strength=postprocessing_parameters['facetool_strength'], + strength=postprocessing_parameters["facetool_strength"], seed=seed, ) - elif postprocessing_parameters['type'] == 'codeformer': + elif postprocessing_parameters["type"] == "codeformer": image = self.codeformer.process( image=image, - strength=postprocessing_parameters['facetool_strength'], - fidelity=postprocessing_parameters['codeformer_fidelity'], + strength=postprocessing_parameters["facetool_strength"], + fidelity=postprocessing_parameters["codeformer_fidelity"], seed=seed, - device='cpu' if str(self.generate.device) == 'mps' else self.generate.device + device="cpu" + if str(self.generate.device) == "mps" + else self.generate.device, ) else: raise TypeError( f'{postprocessing_parameters["type"]} is not a valid postprocessing type' ) - progress.set_current_status('Saving Image') - socketio.emit('progressUpdate', progress.to_formatted_dict()) + progress.set_current_status("Saving Image") + socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) - postprocessing_parameters['seed'] = seed + postprocessing_parameters["seed"] = seed metadata = self.parameters_to_post_processed_image_metadata( parameters=postprocessing_parameters, original_image_path=original_image_path, @@ -349,12 +390,14 @@ class InvokeAIWebServer: command = parameters_to_command(postprocessing_parameters) + (width, height) = image.size + path = self.save_result_image( image, command, metadata, self.result_path, - postprocessing=postprocessing_parameters['type'], + postprocessing=postprocessing_parameters["type"], ) self.write_log_message( @@ -362,70 +405,83 @@ class InvokeAIWebServer: ) progress.mark_complete() - socketio.emit('progressUpdate', progress.to_formatted_dict()) + socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) socketio.emit( - 'postprocessingResult', + "postprocessingResult", { - 'url': self.get_url_from_image_path(path), - 'mtime': os.path.getmtime(path), - 'metadata': metadata, + "url": self.get_url_from_image_path(path), + "mtime": os.path.getmtime(path), + "metadata": metadata, + "width": width, + "height": height, }, ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") - @socketio.on('cancel') + @socketio.on("cancel") def handle_cancel(): - print(f'>> Cancel processing requested') + print(f">> Cancel processing requested") self.canceled.set() # TODO: I think this needs a safety mechanism. - @socketio.on('deleteImage') - def handle_delete_image(url, uuid): + @socketio.on("deleteImage") + def handle_delete_image(url, uuid, category): try: print(f'>> Delete requested "{url}"') from send2trash import send2trash path = self.get_image_path_from_url(url) + print(path) send2trash(path) - socketio.emit('imageDeleted', {'url': url, 'uuid': uuid}) + socketio.emit( + "imageDeleted", + {"url": url, "uuid": uuid, "category": category}, + ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") # TODO: I think this needs a safety mechanism. - @socketio.on('uploadInitialImage') - def handle_upload_initial_image(bytes, name): + @socketio.on("uploadImage") + def handle_upload_image(bytes, name, destination): try: - print(f'>> Init image upload requested "{name}"') + print(f'>> Image upload requested "{name}"') file_path = self.save_file_unique_uuid_name( bytes=bytes, name=name, path=self.init_image_path ) - + mtime = os.path.getmtime(file_path) + (width, height) = Image.open(file_path).size + print(file_path) socketio.emit( - 'initialImageUploaded', + "imageUploaded", { - 'url': self.get_url_from_image_path(file_path), + "url": self.get_url_from_image_path(file_path), + "mtime": mtime, + "width": width, + "height": height, + "category": "user", + "destination": destination, }, ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") # TODO: I think this needs a safety mechanism. - @socketio.on('uploadMaskImage') + @socketio.on("uploadMaskImage") def handle_upload_mask_image(bytes, name): try: print(f'>> Mask image upload requested "{name}"') @@ -435,26 +491,28 @@ class InvokeAIWebServer: ) socketio.emit( - 'maskImageUploaded', + "maskImageUploaded", { - 'url': self.get_url_from_image_path(file_path), + "url": self.get_url_from_image_path(file_path), }, ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") # App Functions def get_system_config(self): + model_list = self.generate.model_cache.list_models() return { - 'model': 'stable diffusion', - 'model_id': args.model, - 'model_hash': self.generate.model_hash, - 'app_id': APP_ID, - 'app_version': APP_VERSION, + "model": "stable diffusion", + "model_id": args.model, + "model_hash": self.generate.model_hash, + "app_id": APP_ID, + "app_version": APP_VERSION, + "model_list": model_list, } def generate_images( @@ -465,8 +523,8 @@ class InvokeAIWebServer: step_index = 1 prior_variations = ( - generation_parameters['with_variations'] - if 'with_variations' in generation_parameters + generation_parameters["with_variations"] + if "with_variations" in generation_parameters else [] ) @@ -480,33 +538,55 @@ class InvokeAIWebServer: init_img_url = None mask_img_url = None - if 'init_img' in generation_parameters: - init_img_url = generation_parameters['init_img'] - generation_parameters[ - 'init_img' - ] = self.get_image_path_from_url( - generation_parameters['init_img'] + if "init_img" in generation_parameters: + init_img_url = generation_parameters["init_img"] + init_img_path = self.get_image_path_from_url(init_img_url) + generation_parameters["init_img"] = init_img_path + + # if 'init_mask' in generation_parameters: + # mask_img_url = generation_parameters['init_mask'] + # generation_parameters[ + # 'init_mask' + # ] = self.get_image_path_from_url( + # generation_parameters['init_mask'] + # ) + + if "init_mask" in generation_parameters: + # grab an Image of the init image + original_image = Image.open(init_img_path) + + # copy a region from it which we will inpaint + cropped_init_image = copy_image_from_bounding_box( + original_image, **generation_parameters["bounding_box"] + ) + generation_parameters["init_img"] = cropped_init_image + + # grab an Image of the mask + mask_image = Image.open( + io.BytesIO( + base64.decodebytes( + bytes(generation_parameters["init_mask"], "utf-8") + ) + ) ) - if 'init_mask' in generation_parameters: - mask_img_url = generation_parameters['init_mask'] - generation_parameters[ - 'init_mask' - ] = self.get_image_path_from_url( - generation_parameters['init_mask'] + # crop the mask image + cropped_mask_image = copy_image_from_bounding_box( + mask_image, **generation_parameters["bounding_box"] ) + generation_parameters["init_mask"] = cropped_mask_image totalSteps = self.calculate_real_steps( - steps=generation_parameters['steps'], - strength=generation_parameters['strength'] - if 'strength' in generation_parameters + steps=generation_parameters["steps"], + strength=generation_parameters["strength"] + if "strength" in generation_parameters else None, - has_init_image='init_img' in generation_parameters, + has_init_image="init_img" in generation_parameters, ) progress = Progress(generation_parameters=generation_parameters) - self.socketio.emit('progressUpdate', progress.to_formatted_dict()) + self.socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) def image_progress(sample, step): @@ -518,13 +598,13 @@ class InvokeAIWebServer: nonlocal progress progress.set_current_step(step + 1) - progress.set_current_status('Generating') + progress.set_current_status("Generating") progress.set_current_status_has_steps(True) if ( - generation_parameters['progress_images'] + generation_parameters["progress_images"] and step % 5 == 0 - and step < generation_parameters['steps'] - 1 + and step < generation_parameters["steps"] - 1 ): image = self.generate.sample_to_image(sample) metadata = self.parameters_to_generated_image_metadata( @@ -532,6 +612,8 @@ class InvokeAIWebServer: ) command = parameters_to_command(generation_parameters) + (width, height) = image.size + path = self.save_result_image( image, command, @@ -543,16 +625,16 @@ class InvokeAIWebServer: step_index += 1 self.socketio.emit( - 'intermediateResult', + "intermediateResult", { - 'url': self.get_url_from_image_path(path), - 'mtime': os.path.getmtime(path), - 'metadata': metadata, + "url": self.get_url_from_image_path(path), + "mtime": os.path.getmtime(path), + "metadata": metadata, + "width": width, + "height": height, }, ) - self.socketio.emit( - 'progressUpdate', progress.to_formatted_dict() - ) + self.socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) def image_done(image, seed, first_seed): @@ -567,115 +649,115 @@ class InvokeAIWebServer: step_index = 1 nonlocal prior_variations - progress.set_current_status('Generation Complete') + progress.set_current_status("Generation Complete") - self.socketio.emit( - 'progressUpdate', progress.to_formatted_dict() - ) + self.socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) all_parameters = generation_parameters postprocessing = False if ( - 'variation_amount' in all_parameters - and all_parameters['variation_amount'] > 0 + "variation_amount" in all_parameters + and all_parameters["variation_amount"] > 0 ): first_seed = first_seed or seed - this_variation = [ - [seed, all_parameters['variation_amount']] - ] - all_parameters['with_variations'] = ( + this_variation = [[seed, all_parameters["variation_amount"]]] + all_parameters["with_variations"] = ( prior_variations + this_variation ) - all_parameters['seed'] = first_seed - elif 'with_variations' in all_parameters: - all_parameters['seed'] = first_seed + all_parameters["seed"] = first_seed + elif "with_variations" in all_parameters: + all_parameters["seed"] = first_seed else: - all_parameters['seed'] = seed + all_parameters["seed"] = seed if self.canceled.is_set(): raise CanceledException if esrgan_parameters: - progress.set_current_status('Upscaling') + progress.set_current_status("Upscaling") progress.set_current_status_has_steps(False) - self.socketio.emit( - 'progressUpdate', progress.to_formatted_dict() - ) + self.socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) image = self.esrgan.process( image=image, - upsampler_scale=esrgan_parameters['level'], - strength=esrgan_parameters['strength'], + upsampler_scale=esrgan_parameters["level"], + strength=esrgan_parameters["strength"], seed=seed, ) postprocessing = True - all_parameters['upscale'] = [ - esrgan_parameters['level'], - esrgan_parameters['strength'], + all_parameters["upscale"] = [ + esrgan_parameters["level"], + esrgan_parameters["strength"], ] if self.canceled.is_set(): raise CanceledException if facetool_parameters: - if facetool_parameters['type'] == 'gfpgan': - progress.set_current_status('Restoring Faces (GFPGAN)') - elif facetool_parameters['type'] == 'codeformer': - progress.set_current_status('Restoring Faces (Codeformer)') + if facetool_parameters["type"] == "gfpgan": + progress.set_current_status("Restoring Faces (GFPGAN)") + elif facetool_parameters["type"] == "codeformer": + progress.set_current_status("Restoring Faces (Codeformer)") progress.set_current_status_has_steps(False) - self.socketio.emit( - 'progressUpdate', progress.to_formatted_dict() - ) + self.socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) - if facetool_parameters['type'] == 'gfpgan': + if facetool_parameters["type"] == "gfpgan": image = self.gfpgan.process( image=image, - strength=facetool_parameters['strength'], + strength=facetool_parameters["strength"], seed=seed, ) - elif facetool_parameters['type'] == 'codeformer': + elif facetool_parameters["type"] == "codeformer": image = self.codeformer.process( image=image, - strength=facetool_parameters['strength'], - fidelity=facetool_parameters['codeformer_fidelity'], + strength=facetool_parameters["strength"], + fidelity=facetool_parameters["codeformer_fidelity"], seed=seed, - device='cpu' if str(self.generate.device) == 'mps' else self.generate.device, + device="cpu" + if str(self.generate.device) == "mps" + else self.generate.device, ) - all_parameters['codeformer_fidelity'] = facetool_parameters['codeformer_fidelity'] + all_parameters["codeformer_fidelity"] = facetool_parameters[ + "codeformer_fidelity" + ] postprocessing = True - all_parameters['facetool_strength'] = facetool_parameters[ - 'strength' - ] - all_parameters['facetool_type'] = facetool_parameters[ - 'type' + all_parameters["facetool_strength"] = facetool_parameters[ + "strength" ] + all_parameters["facetool_type"] = facetool_parameters["type"] - progress.set_current_status('Saving Image') - self.socketio.emit( - 'progressUpdate', progress.to_formatted_dict() - ) + progress.set_current_status("Saving Image") + self.socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) + # paste the inpainting image back onto the original + if "init_mask" in generation_parameters: + image = paste_image_into_bounding_box( + Image.open(init_img_path), + image, + **generation_parameters["bounding_box"], + ) + # restore the stashed URLS and discard the paths, we are about to send the result to client - if 'init_img' in all_parameters: - all_parameters['init_img'] = init_img_url + if "init_img" in all_parameters: + all_parameters["init_img"] = init_img_url - if 'init_mask' in all_parameters: - all_parameters['init_mask'] = mask_img_url + if "init_mask" in all_parameters: + all_parameters["init_mask"] = "" # - metadata = self.parameters_to_generated_image_metadata( - all_parameters - ) + metadata = self.parameters_to_generated_image_metadata(all_parameters) command = parameters_to_command(all_parameters) + (width, height) = image.size + path = self.save_result_image( image, command, @@ -689,22 +771,22 @@ class InvokeAIWebServer: if progress.total_iterations > progress.current_iteration: progress.set_current_step(1) - progress.set_current_status('Iteration complete') + progress.set_current_status("Iteration complete") progress.set_current_status_has_steps(False) else: progress.mark_complete() - self.socketio.emit( - 'progressUpdate', progress.to_formatted_dict() - ) + self.socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) self.socketio.emit( - 'generationResult', + "generationResult", { - 'url': self.get_url_from_image_path(path), - 'mtime': os.path.getmtime(path), - 'metadata': metadata, + "url": self.get_url_from_image_path(path), + "mtime": os.path.getmtime(path), + "metadata": metadata, + "width": width, + "height": height, }, ) eventlet.sleep(0) @@ -718,17 +800,18 @@ class InvokeAIWebServer: ) except KeyboardInterrupt: + self.socketio.emit("processingCanceled") raise except CanceledException: - self.socketio.emit('processingCanceled') + self.socketio.emit("processingCanceled") pass except Exception as e: print(e) - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def parameters_to_generated_image_metadata(self, parameters): try: @@ -736,22 +819,22 @@ class InvokeAIWebServer: metadata = self.get_system_config() # remove any image keys not mentioned in RFC #266 rfc266_img_fields = [ - 'type', - 'postprocessing', - 'sampler', - 'prompt', - 'seed', - 'variations', - 'steps', - 'cfg_scale', - 'threshold', - 'perlin', - 'step_number', - 'width', - 'height', - 'extra', - 'seamless', - 'hires_fix', + "type", + "postprocessing", + "sampler", + "prompt", + "seed", + "variations", + "steps", + "cfg_scale", + "threshold", + "perlin", + "step_number", + "width", + "height", + "extra", + "seamless", + "hires_fix", ] rfc_dict = {} @@ -764,141 +847,137 @@ class InvokeAIWebServer: postprocessing = [] # 'postprocessing' is either null or an - if 'facetool_strength' in parameters: + if "facetool_strength" in parameters: facetool_parameters = { - 'type': str(parameters['facetool_type']), - 'strength': float(parameters['facetool_strength']), - } + "type": str(parameters["facetool_type"]), + "strength": float(parameters["facetool_strength"]), + } - if parameters['facetool_type'] == 'codeformer': - facetool_parameters['fidelity'] = float(parameters['codeformer_fidelity']) + if parameters["facetool_type"] == "codeformer": + facetool_parameters["fidelity"] = float( + parameters["codeformer_fidelity"] + ) postprocessing.append(facetool_parameters) - if 'upscale' in parameters: + if "upscale" in parameters: postprocessing.append( { - 'type': 'esrgan', - 'scale': int(parameters['upscale'][0]), - 'strength': float(parameters['upscale'][1]), + "type": "esrgan", + "scale": int(parameters["upscale"][0]), + "strength": float(parameters["upscale"][1]), } ) - rfc_dict['postprocessing'] = ( + rfc_dict["postprocessing"] = ( postprocessing if len(postprocessing) > 0 else None ) # semantic drift - rfc_dict['sampler'] = parameters['sampler_name'] + rfc_dict["sampler"] = parameters["sampler_name"] # display weighted subprompts (liable to change) - subprompts = split_weighted_subprompts(parameters['prompt'], skip_normalize=True) - subprompts = [{'prompt': x[0], 'weight': x[1]} for x in subprompts] - rfc_dict['prompt'] = subprompts + subprompts = split_weighted_subprompts( + parameters["prompt"], skip_normalize=True + ) + subprompts = [{"prompt": x[0], "weight": x[1]} for x in subprompts] + rfc_dict["prompt"] = subprompts # 'variations' should always exist and be an array, empty or consisting of {'seed': seed, 'weight': weight} pairs variations = [] - if 'with_variations' in parameters: + if "with_variations" in parameters: variations = [ - {'seed': x[0], 'weight': x[1]} - for x in parameters['with_variations'] + {"seed": x[0], "weight": x[1]} + for x in parameters["with_variations"] ] - rfc_dict['variations'] = variations + rfc_dict["variations"] = variations - if 'init_img' in parameters: - rfc_dict['type'] = 'img2img' - rfc_dict['strength'] = parameters['strength'] - rfc_dict['fit'] = parameters['fit'] # TODO: Noncompliant - rfc_dict['orig_hash'] = calculate_init_img_hash( - self.get_image_path_from_url(parameters['init_img']) + if "init_img" in parameters: + rfc_dict["type"] = "img2img" + rfc_dict["strength"] = parameters["strength"] + rfc_dict["fit"] = parameters["fit"] # TODO: Noncompliant + rfc_dict["orig_hash"] = calculate_init_img_hash( + self.get_image_path_from_url(parameters["init_img"]) ) - rfc_dict['init_image_path'] = parameters[ - 'init_img' + rfc_dict["init_image_path"] = parameters[ + "init_img" ] # TODO: Noncompliant - if 'init_mask' in parameters: - rfc_dict['mask_hash'] = calculate_init_img_hash( - self.get_image_path_from_url(parameters['init_mask']) - ) # TODO: Noncompliant - rfc_dict['mask_image_path'] = parameters[ - 'init_mask' - ] # TODO: Noncompliant + # if 'init_mask' in parameters: + # rfc_dict['mask_hash'] = calculate_init_img_hash( + # self.get_image_path_from_url(parameters['init_mask']) + # ) # TODO: Noncompliant + # rfc_dict['mask_image_path'] = parameters[ + # 'init_mask' + # ] # TODO: Noncompliant else: - rfc_dict['type'] = 'txt2img' + rfc_dict["type"] = "txt2img" - metadata['image'] = rfc_dict + metadata["image"] = rfc_dict return metadata except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def parameters_to_post_processed_image_metadata( self, parameters, original_image_path ): try: - current_metadata = retrieve_metadata(original_image_path)[ - 'sd-metadata' - ] + current_metadata = retrieve_metadata(original_image_path)["sd-metadata"] postprocessing_metadata = {} """ if we don't have an original image metadata to reconstruct, need to record the original image and its hash """ - if 'image' not in current_metadata: - current_metadata['image'] = {} + if "image" not in current_metadata: + current_metadata["image"] = {} orig_hash = calculate_init_img_hash( self.get_image_path_from_url(original_image_path) ) - postprocessing_metadata['orig_path'] = (original_image_path,) - postprocessing_metadata['orig_hash'] = orig_hash + postprocessing_metadata["orig_path"] = (original_image_path,) + postprocessing_metadata["orig_hash"] = orig_hash - if parameters['type'] == 'esrgan': - postprocessing_metadata['type'] = 'esrgan' - postprocessing_metadata['scale'] = parameters['upscale'][0] - postprocessing_metadata['strength'] = parameters['upscale'][1] - elif parameters['type'] == 'gfpgan': - postprocessing_metadata['type'] = 'gfpgan' - postprocessing_metadata['strength'] = parameters[ - 'facetool_strength' - ] - elif parameters['type'] == 'codeformer': - postprocessing_metadata['type'] = 'codeformer' - postprocessing_metadata['strength'] = parameters[ - 'facetool_strength' - ] - postprocessing_metadata['fidelity'] = parameters['codeformer_fidelity'] + if parameters["type"] == "esrgan": + postprocessing_metadata["type"] = "esrgan" + postprocessing_metadata["scale"] = parameters["upscale"][0] + postprocessing_metadata["strength"] = parameters["upscale"][1] + elif parameters["type"] == "gfpgan": + postprocessing_metadata["type"] = "gfpgan" + postprocessing_metadata["strength"] = parameters["facetool_strength"] + elif parameters["type"] == "codeformer": + postprocessing_metadata["type"] = "codeformer" + postprocessing_metadata["strength"] = parameters["facetool_strength"] + postprocessing_metadata["fidelity"] = parameters["codeformer_fidelity"] else: raise TypeError(f"Invalid type: {parameters['type']}") - if 'postprocessing' in current_metadata['image'] and isinstance( - current_metadata['image']['postprocessing'], list + if "postprocessing" in current_metadata["image"] and isinstance( + current_metadata["image"]["postprocessing"], list ): - current_metadata['image']['postprocessing'].append( + current_metadata["image"]["postprocessing"].append( postprocessing_metadata ) else: - current_metadata['image']['postprocessing'] = [ - postprocessing_metadata - ] + current_metadata["image"]["postprocessing"] = [postprocessing_metadata] return current_metadata except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def save_result_image( self, @@ -911,22 +990,26 @@ class InvokeAIWebServer: ): try: pngwriter = PngWriter(output_dir) - prefix = pngwriter.unique_prefix() - seed = 'unknown_seed' + number_prefix = pngwriter.unique_prefix() - if 'image' in metadata: - if 'seed' in metadata['image']: - seed = metadata['image']['seed'] + uuid = uuid4().hex + truncated_uuid = uuid[:8] - filename = f'{prefix}.{seed}' + seed = "unknown_seed" + + if "image" in metadata: + if "seed" in metadata["image"]: + seed = metadata["image"]["seed"] + + filename = f"{number_prefix}.{truncated_uuid}.{seed}" if step_index: - filename += f'.{step_index}' + filename += f".{step_index}" if postprocessing: - filename += f'.postprocessed' + filename += f".postprocessed" - filename += '.png' + filename += ".png" path = pngwriter.save_image_and_prompt_to_png( image=image, @@ -938,24 +1021,24 @@ class InvokeAIWebServer: return os.path.abspath(path) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def make_unique_init_image_filename(self, name): try: uuid = uuid4().hex split = os.path.splitext(name) - name = f'{split[0]}.{uuid}{split[1]}' + name = f"{split[0]}.{uuid}{split[1]}" return name except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def calculate_real_steps(self, steps, strength, has_init_image): import math @@ -965,29 +1048,29 @@ class InvokeAIWebServer: def write_log_message(self, message): """Logs the filename and parameters used to generate or process that image to log file""" try: - message = f'{message}\n' - with open(self.log_path, 'a', encoding='utf-8') as file: + message = f"{message}\n" + with open(self.log_path, "a", encoding="utf-8") as file: file.writelines(message) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def get_image_path_from_url(self, url): """Given a url to an image used by the client, returns the absolute file path to that image""" try: - if 'init-images' in url: + if "init-images" in url: return os.path.abspath( os.path.join(self.init_image_path, os.path.basename(url)) ) - elif 'mask-images' in url: + elif "mask-images" in url: return os.path.abspath( os.path.join(self.mask_image_path, os.path.basename(url)) ) - elif 'intermediates' in url: + elif "intermediates" in url: return os.path.abspath( os.path.join(self.intermediate_path, os.path.basename(url)) ) @@ -996,52 +1079,52 @@ class InvokeAIWebServer: os.path.join(self.result_path, os.path.basename(url)) ) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def get_url_from_image_path(self, path): """Given an absolute file path to an image, returns the URL that the client can use to load the image""" try: - if 'init-images' in path: - return os.path.join( - self.init_image_url, os.path.basename(path) - ) - elif 'mask-images' in path: - return os.path.join( - self.mask_image_url, os.path.basename(path) - ) - elif 'intermediates' in path: - return os.path.join( - self.intermediate_url, os.path.basename(path) - ) + if "init-images" in path: + return os.path.join(self.init_image_url, os.path.basename(path)) + elif "mask-images" in path: + return os.path.join(self.mask_image_url, os.path.basename(path)) + elif "intermediates" in path: + return os.path.join(self.intermediate_url, os.path.basename(path)) else: return os.path.join(self.result_url, os.path.basename(path)) except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") def save_file_unique_uuid_name(self, bytes, name, path): try: uuid = uuid4().hex + truncated_uuid = uuid[:8] + split = os.path.splitext(name) - name = f'{split[0]}.{uuid}{split[1]}' + name = f"{split[0]}.{truncated_uuid}{split[1]}" + file_path = os.path.join(path, name) + os.makedirs(os.path.dirname(file_path), exist_ok=True) - newFile = open(file_path, 'wb') + + newFile = open(file_path, "wb") newFile.write(bytes) + return file_path except Exception as e: - self.socketio.emit('error', {'message': (str(e))}) - print('\n') + self.socketio.emit("error", {"message": (str(e))}) + print("\n") traceback.print_exc() - print('\n') + print("\n") class Progress: @@ -1049,20 +1132,20 @@ class Progress: self.current_step = 1 self.total_steps = ( self._calculate_real_steps( - steps=generation_parameters['steps'], - strength=generation_parameters['strength'] - if 'strength' in generation_parameters + steps=generation_parameters["steps"], + strength=generation_parameters["strength"] + if "strength" in generation_parameters else None, - has_init_image='init_img' in generation_parameters, + has_init_image="init_img" in generation_parameters, ) if generation_parameters else 1 ) self.current_iteration = 1 self.total_iterations = ( - generation_parameters['iterations'] if generation_parameters else 1 + generation_parameters["iterations"] if generation_parameters else 1 ) - self.current_status = 'Preparing' + self.current_status = "Preparing" self.is_processing = True self.current_status_has_steps = False self.has_error = False @@ -1092,7 +1175,7 @@ class Progress: self.has_error = has_error def mark_complete(self): - self.current_status = 'Processing Complete' + self.current_status = "Processing Complete" self.current_step = 0 self.total_steps = 0 self.current_iteration = 0 @@ -1103,14 +1186,14 @@ class Progress: self, ): return { - 'currentStep': self.current_step, - 'totalSteps': self.total_steps, - 'currentIteration': self.current_iteration, - 'totalIterations': self.total_iterations, - 'currentStatus': self.current_status, - 'isProcessing': self.is_processing, - 'currentStatusHasSteps': self.current_status_has_steps, - 'hasError': self.has_error, + "currentStep": self.current_step, + "totalSteps": self.total_steps, + "currentIteration": self.current_iteration, + "totalIterations": self.total_iterations, + "currentStatus": self.current_status, + "isProcessing": self.is_processing, + "currentStatusHasSteps": self.current_status_has_steps, + "hasError": self.has_error, } def _calculate_real_steps(self, steps, strength, has_init_image): @@ -1119,3 +1202,27 @@ class Progress: class CanceledException(Exception): pass + + +""" +Crops an image to a bounding box. +""" + + +def copy_image_from_bounding_box(image, x, y, width, height): + with image as im: + bounds = (x, y, x + width, y + height) + im_cropped = im.crop(bounds) + return im_cropped + + +""" +Pastes an image onto another with a bounding box. +""" + + +def paste_image_into_bounding_box(recipient_image, donor_image, x, y, width, height): + with recipient_image as im: + bounds = (x, y, x + width, y + height) + im.paste(donor_image, bounds) + return recipient_image diff --git a/backend/server.py b/backend/server.py deleted file mode 100644 index 8ad861356c..0000000000 --- a/backend/server.py +++ /dev/null @@ -1,822 +0,0 @@ -import mimetypes -import transformers -import json -import os -import traceback -import eventlet -import glob -import shlex -import math -import shutil -import sys - -sys.path.append(".") - -from argparse import ArgumentTypeError -from modules.create_cmd_parser import create_cmd_parser - -parser = create_cmd_parser() -opt = parser.parse_args() - - -from flask_socketio import SocketIO -from flask import Flask, send_from_directory, url_for, jsonify -from pathlib import Path -from PIL import Image -from pytorch_lightning import logging -from threading import Event -from uuid import uuid4 -from send2trash import send2trash - - -from ldm.generate import Generate -from ldm.invoke.restoration import Restoration -from ldm.invoke.pngwriter import PngWriter, retrieve_metadata -from ldm.invoke.args import APP_ID, APP_VERSION, calculate_init_img_hash -from ldm.invoke.prompt_parser import split_weighted_subprompts - -from modules.parameters import parameters_to_command - - -""" -USER CONFIG -""" -if opt.cors and "*" in opt.cors: - raise ArgumentTypeError('"*" is not an allowed CORS origin') - - -output_dir = "outputs/" # Base output directory for images -host = opt.host # Web & socket.io host -port = opt.port # Web & socket.io port -verbose = opt.verbose # enables copious socket.io logging -precision = opt.precision -free_gpu_mem = opt.free_gpu_mem -embedding_path = opt.embedding_path -additional_allowed_origins = ( - opt.cors if opt.cors else [] -) # additional CORS allowed origins -model = "stable-diffusion-1.4" - -""" -END USER CONFIG -""" - - -print("* Initializing, be patient...\n") - - -""" -SERVER SETUP -""" - - -# fix missing mimetypes on windows due to registry wonkiness -mimetypes.add_type("application/javascript", ".js") -mimetypes.add_type("text/css", ".css") - -app = Flask(__name__, static_url_path="", static_folder="../frontend/dist/") - - -app.config["OUTPUTS_FOLDER"] = "../outputs" - - -@app.route("/outputs/") -def outputs(filename): - return send_from_directory(app.config["OUTPUTS_FOLDER"], filename) - - -@app.route("/", defaults={"path": ""}) -def serve(path): - return send_from_directory(app.static_folder, "index.html") - - -logger = True if verbose else False -engineio_logger = True if verbose else False - -# default 1,000,000, needs to be higher for socketio to accept larger images -max_http_buffer_size = 10000000 - -cors_allowed_origins = [f"http://{host}:{port}"] + additional_allowed_origins - -socketio = SocketIO( - app, - logger=logger, - engineio_logger=engineio_logger, - max_http_buffer_size=max_http_buffer_size, - cors_allowed_origins=cors_allowed_origins, - ping_interval=(50, 50), - ping_timeout=60, -) - - -""" -END SERVER SETUP -""" - - -""" -APP SETUP -""" - - -class CanceledException(Exception): - pass - - -try: - gfpgan, codeformer, esrgan = None, None, None - from ldm.invoke.restoration.base import Restoration - - restoration = Restoration() - gfpgan, codeformer = restoration.load_face_restore_models() - esrgan = restoration.load_esrgan() - - # coreformer.process(self, image, strength, device, seed=None, fidelity=0.75) - -except (ModuleNotFoundError, ImportError): - print(traceback.format_exc(), file=sys.stderr) - print(">> You may need to install the ESRGAN and/or GFPGAN modules") - -canceled = Event() - -# reduce logging outputs to error -transformers.logging.set_verbosity_error() -logging.getLogger("pytorch_lightning").setLevel(logging.ERROR) - -# Initialize and load model -generate = Generate( - model, - precision=precision, - embedding_path=embedding_path, -) -generate.free_gpu_mem = free_gpu_mem -generate.load_model() - - -# location for "finished" images -result_path = os.path.join(output_dir, "img-samples/") - -# temporary path for intermediates -intermediate_path = os.path.join(result_path, "intermediates/") - -# path for user-uploaded init images and masks -init_image_path = os.path.join(result_path, "init-images/") -mask_image_path = os.path.join(result_path, "mask-images/") - -# txt log -log_path = os.path.join(result_path, "invoke_log.txt") - -# make all output paths -[ - os.makedirs(path, exist_ok=True) - for path in [result_path, intermediate_path, init_image_path, mask_image_path] -] - - -""" -END APP SETUP -""" - - -""" -SOCKET.IO LISTENERS -""" - - -@socketio.on("requestSystemConfig") -def handle_request_capabilities(): - print(f">> System config requested") - config = get_system_config() - socketio.emit("systemConfig", config) - - -@socketio.on("requestImages") -def handle_request_images(page=1, offset=0, last_mtime=None): - chunk_size = 50 - - if last_mtime: - print(f">> Latest images requested") - else: - print( - f">> Page {page} of images requested (page size {chunk_size} offset {offset})" - ) - - paths = glob.glob(os.path.join(result_path, "*.png")) - sorted_paths = sorted(paths, key=lambda x: os.path.getmtime(x), reverse=True) - - if last_mtime: - image_paths = filter(lambda x: os.path.getmtime(x) > last_mtime, sorted_paths) - else: - - image_paths = sorted_paths[ - slice(chunk_size * (page - 1) + offset, chunk_size * page + offset) - ] - page = page + 1 - - image_array = [] - - for path in image_paths: - metadata = retrieve_metadata(path) - image_array.append( - { - "url": path, - "mtime": os.path.getmtime(path), - "metadata": metadata["sd-metadata"], - } - ) - - socketio.emit( - "galleryImages", - { - "images": image_array, - "nextPage": page, - "offset": offset, - "onlyNewImages": True if last_mtime else False, - }, - ) - - -@socketio.on("generateImage") -def handle_generate_image_event( - generation_parameters, esrgan_parameters, gfpgan_parameters -): - print( - f">> Image generation requested: {generation_parameters}\nESRGAN parameters: {esrgan_parameters}\nGFPGAN parameters: {gfpgan_parameters}" - ) - generate_images(generation_parameters, esrgan_parameters, gfpgan_parameters) - - -@socketio.on("runESRGAN") -def handle_run_esrgan_event(original_image, esrgan_parameters): - print( - f'>> ESRGAN upscale requested for "{original_image["url"]}": {esrgan_parameters}' - ) - progress = { - "currentStep": 1, - "totalSteps": 1, - "currentIteration": 1, - "totalIterations": 1, - "currentStatus": "Preparing", - "isProcessing": True, - "currentStatusHasSteps": False, - } - - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - image = Image.open(original_image["url"]) - - seed = ( - original_image["metadata"]["seed"] - if "seed" in original_image["metadata"] - else "unknown_seed" - ) - - progress["currentStatus"] = "Upscaling" - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - image = esrgan.process( - image=image, - upsampler_scale=esrgan_parameters["upscale"][0], - strength=esrgan_parameters["upscale"][1], - seed=seed, - ) - - progress["currentStatus"] = "Saving image" - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - esrgan_parameters["seed"] = seed - metadata = parameters_to_post_processed_image_metadata( - parameters=esrgan_parameters, - original_image_path=original_image["url"], - type="esrgan", - ) - command = parameters_to_command(esrgan_parameters) - - path = save_image(image, command, metadata, result_path, postprocessing="esrgan") - - write_log_message(f'[Upscaled] "{original_image["url"]}" > "{path}": {command}') - - progress["currentStatus"] = "Finished" - progress["currentStep"] = 0 - progress["totalSteps"] = 0 - progress["currentIteration"] = 0 - progress["totalIterations"] = 0 - progress["isProcessing"] = False - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - socketio.emit( - "esrganResult", - { - "url": os.path.relpath(path), - "mtime": os.path.getmtime(path), - "metadata": metadata, - }, - ) - - -@socketio.on("runGFPGAN") -def handle_run_gfpgan_event(original_image, gfpgan_parameters): - print( - f'>> GFPGAN face fix requested for "{original_image["url"]}": {gfpgan_parameters}' - ) - progress = { - "currentStep": 1, - "totalSteps": 1, - "currentIteration": 1, - "totalIterations": 1, - "currentStatus": "Preparing", - "isProcessing": True, - "currentStatusHasSteps": False, - } - - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - image = Image.open(original_image["url"]) - - seed = ( - original_image["metadata"]["seed"] - if "seed" in original_image["metadata"] - else "unknown_seed" - ) - - progress["currentStatus"] = "Fixing faces" - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - image = gfpgan.process( - image=image, strength=gfpgan_parameters["facetool_strength"], seed=seed - ) - - progress["currentStatus"] = "Saving image" - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - gfpgan_parameters["seed"] = seed - metadata = parameters_to_post_processed_image_metadata( - parameters=gfpgan_parameters, - original_image_path=original_image["url"], - type="gfpgan", - ) - command = parameters_to_command(gfpgan_parameters) - - path = save_image(image, command, metadata, result_path, postprocessing="gfpgan") - - write_log_message(f'[Fixed faces] "{original_image["url"]}" > "{path}": {command}') - - progress["currentStatus"] = "Finished" - progress["currentStep"] = 0 - progress["totalSteps"] = 0 - progress["currentIteration"] = 0 - progress["totalIterations"] = 0 - progress["isProcessing"] = False - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - socketio.emit( - "gfpganResult", - { - "url": os.path.relpath(path), - "mtime": os.path.mtime(path), - "metadata": metadata, - }, - ) - - -@socketio.on("cancel") -def handle_cancel(): - print(f">> Cancel processing requested") - canceled.set() - socketio.emit("processingCanceled") - - -# TODO: I think this needs a safety mechanism. -@socketio.on("deleteImage") -def handle_delete_image(path, uuid): - print(f'>> Delete requested "{path}"') - send2trash(path) - socketio.emit("imageDeleted", {"url": path, "uuid": uuid}) - - -# TODO: I think this needs a safety mechanism. -@socketio.on("uploadInitialImage") -def handle_upload_initial_image(bytes, name): - print(f'>> Init image upload requested "{name}"') - uuid = uuid4().hex - split = os.path.splitext(name) - name = f"{split[0]}.{uuid}{split[1]}" - file_path = os.path.join(init_image_path, name) - os.makedirs(os.path.dirname(file_path), exist_ok=True) - newFile = open(file_path, "wb") - newFile.write(bytes) - socketio.emit("initialImageUploaded", {"url": file_path, "uuid": ""}) - - -# TODO: I think this needs a safety mechanism. -@socketio.on("uploadMaskImage") -def handle_upload_mask_image(bytes, name): - print(f'>> Mask image upload requested "{name}"') - uuid = uuid4().hex - split = os.path.splitext(name) - name = f"{split[0]}.{uuid}{split[1]}" - file_path = os.path.join(mask_image_path, name) - os.makedirs(os.path.dirname(file_path), exist_ok=True) - newFile = open(file_path, "wb") - newFile.write(bytes) - socketio.emit("maskImageUploaded", {"url": file_path, "uuid": ""}) - - -""" -END SOCKET.IO LISTENERS -""" - - -""" -ADDITIONAL FUNCTIONS -""" - - -def get_system_config(): - return { - "model": "stable diffusion", - "model_id": model, - "model_hash": generate.model_hash, - "app_id": APP_ID, - "app_version": APP_VERSION, - } - - -def parameters_to_post_processed_image_metadata(parameters, original_image_path, type): - # top-level metadata minus `image` or `images` - metadata = get_system_config() - - orig_hash = calculate_init_img_hash(original_image_path) - - image = {"orig_path": original_image_path, "orig_hash": orig_hash} - - if type == "esrgan": - image["type"] = "esrgan" - image["scale"] = parameters["upscale"][0] - image["strength"] = parameters["upscale"][1] - elif type == "gfpgan": - image["type"] = "gfpgan" - image["strength"] = parameters["facetool_strength"] - else: - raise TypeError(f"Invalid type: {type}") - - metadata["image"] = image - return metadata - - -def parameters_to_generated_image_metadata(parameters): - # top-level metadata minus `image` or `images` - - metadata = get_system_config() - # remove any image keys not mentioned in RFC #266 - rfc266_img_fields = [ - "type", - "postprocessing", - "sampler", - "prompt", - "seed", - "variations", - "steps", - "cfg_scale", - "threshold", - "perlin", - "step_number", - "width", - "height", - "extra", - "seamless", - "hires_fix", - ] - - rfc_dict = {} - - for item in parameters.items(): - key, value = item - if key in rfc266_img_fields: - rfc_dict[key] = value - - postprocessing = [] - - # 'postprocessing' is either null or an - if "facetool_strength" in parameters: - - postprocessing.append( - {"type": "gfpgan", "strength": float(parameters["facetool_strength"])} - ) - - if "upscale" in parameters: - postprocessing.append( - { - "type": "esrgan", - "scale": int(parameters["upscale"][0]), - "strength": float(parameters["upscale"][1]), - } - ) - - rfc_dict["postprocessing"] = postprocessing if len(postprocessing) > 0 else None - - # semantic drift - rfc_dict["sampler"] = parameters["sampler_name"] - - # display weighted subprompts (liable to change) - subprompts = split_weighted_subprompts(parameters["prompt"]) - subprompts = [{"prompt": x[0], "weight": x[1]} for x in subprompts] - rfc_dict["prompt"] = subprompts - - # 'variations' should always exist and be an array, empty or consisting of {'seed': seed, 'weight': weight} pairs - variations = [] - - if "with_variations" in parameters: - variations = [ - {"seed": x[0], "weight": x[1]} for x in parameters["with_variations"] - ] - - rfc_dict["variations"] = variations - - if "init_img" in parameters: - rfc_dict["type"] = "img2img" - rfc_dict["strength"] = parameters["strength"] - rfc_dict["fit"] = parameters["fit"] # TODO: Noncompliant - rfc_dict["orig_hash"] = calculate_init_img_hash(parameters["init_img"]) - rfc_dict["init_image_path"] = parameters["init_img"] # TODO: Noncompliant - rfc_dict["sampler"] = "ddim" # TODO: FIX ME WHEN IMG2IMG SUPPORTS ALL SAMPLERS - if "init_mask" in parameters: - rfc_dict["mask_hash"] = calculate_init_img_hash( - parameters["init_mask"] - ) # TODO: Noncompliant - rfc_dict["mask_image_path"] = parameters["init_mask"] # TODO: Noncompliant - else: - rfc_dict["type"] = "txt2img" - - metadata["image"] = rfc_dict - - return metadata - - -def make_unique_init_image_filename(name): - uuid = uuid4().hex - split = os.path.splitext(name) - name = f"{split[0]}.{uuid}{split[1]}" - return name - - -def write_log_message(message, log_path=log_path): - """Logs the filename and parameters used to generate or process that image to log file""" - message = f"{message}\n" - with open(log_path, "a", encoding="utf-8") as file: - file.writelines(message) - - -def save_image( - image, command, metadata, output_dir, step_index=None, postprocessing=False -): - pngwriter = PngWriter(output_dir) - prefix = pngwriter.unique_prefix() - - seed = "unknown_seed" - - if "image" in metadata: - if "seed" in metadata["image"]: - seed = metadata["image"]["seed"] - - filename = f"{prefix}.{seed}" - - if step_index: - filename += f".{step_index}" - if postprocessing: - filename += f".postprocessed" - - filename += ".png" - - path = pngwriter.save_image_and_prompt_to_png( - image=image, dream_prompt=command, metadata=metadata, name=filename - ) - - return path - - -def calculate_real_steps(steps, strength, has_init_image): - return math.floor(strength * steps) if has_init_image else steps - - -def generate_images(generation_parameters, esrgan_parameters, gfpgan_parameters): - canceled.clear() - - step_index = 1 - prior_variations = ( - generation_parameters["with_variations"] - if "with_variations" in generation_parameters - else [] - ) - """ - If a result image is used as an init image, and then deleted, we will want to be - able to use it as an init image in the future. Need to copy it. - - If the init/mask image doesn't exist in the init_image_path/mask_image_path, - make a unique filename for it and copy it there. - """ - if "init_img" in generation_parameters: - filename = os.path.basename(generation_parameters["init_img"]) - if not os.path.exists(os.path.join(init_image_path, filename)): - unique_filename = make_unique_init_image_filename(filename) - new_path = os.path.join(init_image_path, unique_filename) - shutil.copy(generation_parameters["init_img"], new_path) - generation_parameters["init_img"] = new_path - if "init_mask" in generation_parameters: - filename = os.path.basename(generation_parameters["init_mask"]) - if not os.path.exists(os.path.join(mask_image_path, filename)): - unique_filename = make_unique_init_image_filename(filename) - new_path = os.path.join(init_image_path, unique_filename) - shutil.copy(generation_parameters["init_img"], new_path) - generation_parameters["init_mask"] = new_path - - totalSteps = calculate_real_steps( - steps=generation_parameters["steps"], - strength=generation_parameters["strength"] - if "strength" in generation_parameters - else None, - has_init_image="init_img" in generation_parameters, - ) - - progress = { - "currentStep": 1, - "totalSteps": totalSteps, - "currentIteration": 1, - "totalIterations": generation_parameters["iterations"], - "currentStatus": "Preparing", - "isProcessing": True, - "currentStatusHasSteps": False, - } - - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - def image_progress(sample, step): - if canceled.is_set(): - raise CanceledException - - nonlocal step_index - nonlocal generation_parameters - nonlocal progress - - progress["currentStep"] = step + 1 - progress["currentStatus"] = "Generating" - progress["currentStatusHasSteps"] = True - - if ( - generation_parameters["progress_images"] - and step % 5 == 0 - and step < generation_parameters["steps"] - 1 - ): - image = generate.sample_to_image(sample) - - metadata = parameters_to_generated_image_metadata(generation_parameters) - command = parameters_to_command(generation_parameters) - path = save_image(image, command, metadata, intermediate_path, step_index=step_index, postprocessing=False) - - step_index += 1 - socketio.emit( - "intermediateResult", - { - "url": os.path.relpath(path), - "mtime": os.path.getmtime(path), - "metadata": metadata, - }, - ) - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - def image_done(image, seed, first_seed): - nonlocal generation_parameters - nonlocal esrgan_parameters - nonlocal gfpgan_parameters - nonlocal progress - - step_index = 1 - nonlocal prior_variations - - progress["currentStatus"] = "Generation complete" - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - all_parameters = generation_parameters - postprocessing = False - - if ( - "variation_amount" in all_parameters - and all_parameters["variation_amount"] > 0 - ): - first_seed = first_seed or seed - this_variation = [[seed, all_parameters["variation_amount"]]] - all_parameters["with_variations"] = prior_variations + this_variation - all_parameters["seed"] = first_seed - elif ("with_variations" in all_parameters): - all_parameters["seed"] = first_seed - else: - all_parameters["seed"] = seed - - if esrgan_parameters: - progress["currentStatus"] = "Upscaling" - progress["currentStatusHasSteps"] = False - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - image = esrgan.process( - image=image, - upsampler_scale=esrgan_parameters["level"], - strength=esrgan_parameters["strength"], - seed=seed, - ) - - postprocessing = True - all_parameters["upscale"] = [ - esrgan_parameters["level"], - esrgan_parameters["strength"], - ] - - if gfpgan_parameters: - progress["currentStatus"] = "Fixing faces" - progress["currentStatusHasSteps"] = False - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - image = gfpgan.process( - image=image, strength=gfpgan_parameters["strength"], seed=seed - ) - postprocessing = True - all_parameters["facetool_strength"] = gfpgan_parameters["strength"] - - progress["currentStatus"] = "Saving image" - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - metadata = parameters_to_generated_image_metadata(all_parameters) - command = parameters_to_command(all_parameters) - - path = save_image( - image, command, metadata, result_path, postprocessing=postprocessing - ) - - print(f'>> Image generated: "{path}"') - write_log_message(f'[Generated] "{path}": {command}') - - if progress["totalIterations"] > progress["currentIteration"]: - progress["currentStep"] = 1 - progress["currentIteration"] += 1 - progress["currentStatus"] = "Iteration finished" - progress["currentStatusHasSteps"] = False - else: - progress["currentStep"] = 0 - progress["totalSteps"] = 0 - progress["currentIteration"] = 0 - progress["totalIterations"] = 0 - progress["currentStatus"] = "Finished" - progress["isProcessing"] = False - - socketio.emit("progressUpdate", progress) - eventlet.sleep(0) - - socketio.emit( - "generationResult", - { - "url": os.path.relpath(path), - "mtime": os.path.getmtime(path), - "metadata": metadata, - }, - ) - eventlet.sleep(0) - - try: - generate.prompt2image( - **generation_parameters, - step_callback=image_progress, - image_callback=image_done, - ) - - except KeyboardInterrupt: - raise - except CanceledException: - pass - except Exception as e: - socketio.emit("error", {"message": (str(e))}) - print("\n") - traceback.print_exc() - print("\n") - - -""" -END ADDITIONAL FUNCTIONS -""" - - -if __name__ == "__main__": - print(f">> Starting server at http://{host}:{port}") - socketio.run(app, host=host, port=port) diff --git a/docs/features/INPAINTING.md b/docs/features/INPAINTING.md index 0308243b2f..2ed74b0f49 100644 --- a/docs/features/INPAINTING.md +++ b/docs/features/INPAINTING.md @@ -34,16 +34,6 @@ original unedited image and the masked (partially transparent) image: invoke> "man with cat on shoulder" -I./images/man.png -M./images/man-transparent.png ``` -If you are using Photoshop to make your transparent masks, here is a -protocol contributed by III_Communication36 (Discord name): - - Create your alpha channel for mask in photoshop, then run - image/adjust/threshold on that channel. Export as Save a copy using - superpng (3rd party free download plugin) making sure alpha channel - is selected. Then masking works as it should for the img2img - process 100%. Can feed just one image this way without needing to - feed the -M mask behind it - ## **Masking using Text** You can also create a mask using a text prompt to select the part of diff --git a/docs/features/WEBUIHOTKEYS.md b/docs/features/WEBUIHOTKEYS.md new file mode 100644 index 0000000000..020449e0b9 --- /dev/null +++ b/docs/features/WEBUIHOTKEYS.md @@ -0,0 +1,58 @@ +# **WebUI Hotkey List** + +## General + +| Setting | Hotkey | +| ------------ | ---------------------- | +| a | Set All Parameters | +| s | Set Seed | +| u | Upscale | +| r | Restoration | +| i | Show Metadata | +| Ddl | Delete Image | +| alt + a | Focus prompt input | +| shift + i | Send To Image to Image | +| ctrl + enter | Start processing | +| shift + x | cancel Processing | +| shift + d | Toggle Dark Mode | +| ` | Toggle console | + +## Tabs + +| Setting | Hotkey | +| ------- | ------------------------- | +| 1 | Go to Text To Image Tab | +| 2 | Go to Image to Image Tab | +| 3 | Go to Inpainting Tab | +| 4 | Go to Outpainting Tab | +| 5 | Go to Nodes Tab | +| 6 | Go to Post Processing Tab | + +## Gallery + +| Setting | Hotkey | +| ------------ | ------------------------------- | +| g | Toggle Gallery | +| left arrow | Go to previous image in gallery | +| right arrow | Go to next image in gallery | +| shift + p | Pin gallery | +| shift + up | Increase gallery image size | +| shift + down | Decrease gallery image size | +| shift + r | Reset image gallery size | + +## Inpainting + +| Setting | Hotkey | +| -------------------------- | --------------------- | +| [ | Decrease brush size | +| ] | Increase brush size | +| alt + [ | Decrease mask opacity | +| alt + ] | Increase mask opacity | +| b | Select brush | +| e | Select eraser | +| ctrl + z | Undo brush stroke | +| ctrl + shift + z, ctrl + y | Redo brush stroke | +| h | Hide mask | +| shift + m | Invert mask | +| shift + c | Clear mask | +| shift + j | Expand canvas | diff --git a/environment-mac.yml b/environment-mac.yml index 16fcccb67f..ea083185a1 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -3,57 +3,57 @@ channels: - pytorch - conda-forge dependencies: - - python==3.9.13 - - pip==22.2.2 + - python=3.9.13 + - pip=22.2.2 - # pytorch left unpinned - - pytorch==1.12.1 - - torchvision==0.13.1 + - pytorch=1.12.1 + - torchvision=0.13.1 # I suggest to keep the other deps sorted for convenience. # To determine what the latest versions should be, run: # # ```shell - # sed -E 's/ldm/ldm-updated/;20,99s/- ([^=]+)==.+/- \1/' environment-mac.yml > environment-mac-updated.yml - # CONDA_SUBDIR=osx-arm64 conda env create -f environment-mac-updated.yml && conda list -n ldm-updated | awk ' {print " - " $1 "==" $2;} ' + # sed -E 's/invokeai/invokeai-updated/;20,99s/- ([^=]+)==.+/- \1/' environment-mac.yml > environment-mac-updated.yml + # CONDA_SUBDIR=osx-arm64 conda env create -f environment-mac-updated.yml && conda list -n invokeai-updated | awk ' {print " - " $1 "==" $2;} ' # ``` - - albumentations==1.2.1 - - coloredlogs==15.0.1 - - diffusers==0.6.0 - - einops==0.4.1 - - grpcio==1.46.4 - - humanfriendly==10.0 - - imageio==2.21.2 - - imageio-ffmpeg==0.4.7 - - imgaug==0.4.0 - - kornia==0.6.7 - - mpmath==1.2.1 - - nomkl=1.0 - - numpy==1.23.2 - - omegaconf==2.1.1 - - openh264==2.3.0 - - onnx==1.12.0 - - onnxruntime==1.12.1 - - pudb==2022.1 - - pytorch-lightning==1.7.5 - - scipy==1.9.1 - - streamlit==1.12.2 - - sympy==1.10.1 - - tensorboard==2.10.0 - - torchmetrics==0.9.3 + + - albumentations=1.2.1 + - coloredlogs=15.0.1 + - diffusers=0.6.0 + - einops=0.4.1 + - grpcio=1.46.4 + - humanfriendly=10.0 + - imageio=2.21.2 + - imageio-ffmpeg=0.4.7 + - imgaug=0.4.0 + - kornia=0.6.7 + - mpmath=1.2.1 + - nomkl # arm64 has only 1.0 while x64 needs 3.0 + - numpy=1.23.4 + - omegaconf=2.1.1 + - openh264=2.3.0 + - onnx=1.12.0 + - onnxruntime=1.12.1 + - pudb=2022.1 + - pytorch-lightning=1.7.7 + - scipy=1.9.3 + - streamlit=1.12.2 + - sympy=1.10.1 + - tensorboard=2.10.0 + - torchmetrics=0.10.1 + - py-opencv=4.6.0 + - flask=2.1.3 + - flask-socketio=5.3.0 + - flask-cors=3.0.10 + - eventlet=0.33.1 + - protobuf=3.20.1 + - send2trash=1.8.0 + - transformers=4.23.1 + - torch-fidelity=0.3.0 - pip: - - flask==2.1.3 - - flask_socketio==5.3.0 - - flask_cors==3.0.10 - dependency_injector==4.40.0 - - eventlet==0.33.1 - - opencv-python==4.6.0 - - protobuf==3.19.6 - realesrgan==0.2.5.0 - - send2trash==1.8.0 - test-tube==0.7.5 - - transformers==4.21.3 - - torch-fidelity==0.3.0 - -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers - -e git+https://github.com/openai/CLIP.git@main#egg=clip - -e git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion diff --git a/frontend/dist/assets/index.0a6593a2.js b/frontend/dist/assets/index.0a6593a2.js deleted file mode 100644 index 8050cf16df..0000000000 --- a/frontend/dist/assets/index.0a6593a2.js +++ /dev/null @@ -1,483 +0,0 @@ -function VB(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Gi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function WB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v={exports:{}},Ye={};/** - * @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 _f=Symbol.for("react.element"),UB=Symbol.for("react.portal"),HB=Symbol.for("react.fragment"),jB=Symbol.for("react.strict_mode"),GB=Symbol.for("react.profiler"),ZB=Symbol.for("react.provider"),KB=Symbol.for("react.context"),qB=Symbol.for("react.forward_ref"),YB=Symbol.for("react.suspense"),XB=Symbol.for("react.memo"),QB=Symbol.for("react.lazy"),xw=Symbol.iterator;function JB(e){return e===null||typeof e!="object"?null:(e=xw&&e[xw]||e["@@iterator"],typeof e=="function"?e:null)}var V_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W_=Object.assign,U_={};function Zu(e,t,n){this.props=e,this.context=t,this.refs=U_,this.updater=n||V_}Zu.prototype.isReactComponent={};Zu.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")};Zu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function H_(){}H_.prototype=Zu.prototype;function h3(e,t,n){this.props=e,this.context=t,this.refs=U_,this.updater=n||V_}var m3=h3.prototype=new H_;m3.constructor=h3;W_(m3,Zu.prototype);m3.isPureReactComponent=!0;var ww=Array.isArray,j_=Object.prototype.hasOwnProperty,g3={current:null},G_={key:!0,ref:!0,__self:!0,__source:!0};function Z_(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)j_.call(t,r)&&!G_.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1>>1,G=D[M];if(0>>1;Mo(be,j))meo(_e,be)?(D[M]=_e,D[me]=j,M=me):(D[M]=be,D[ce]=j,M=ce);else if(meo(_e,j))D[M]=_e,D[me]=j,M=me;else break e}}return Z}function o(D,Z){var j=D.sortIndex-Z.sortIndex;return j!==0?j:D.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],d=[],f=1,p=null,m=3,g=!1,y=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(D){for(var Z=n(d);Z!==null;){if(Z.callback===null)r(d);else if(Z.startTime<=D)r(d),Z.sortIndex=Z.expirationTime,t(c,Z);else break;Z=n(d)}}function E(D){if(b=!1,_(D),!y)if(n(c)!==null)y=!0,ge(A);else{var Z=n(d);Z!==null&&J(E,Z.startTime-D)}}function A(D,Z){y=!1,b&&(b=!1,C($),$=-1),g=!0;var j=m;try{for(_(Z),p=n(c);p!==null&&(!(p.expirationTime>Z)||D&&!X());){var M=p.callback;if(typeof M=="function"){p.callback=null,m=p.priorityLevel;var G=M(p.expirationTime<=Z);Z=e.unstable_now(),typeof G=="function"?p.callback=G:p===n(c)&&r(c),_(Z)}else r(c);p=n(c)}if(p!==null)var le=!0;else{var ce=n(d);ce!==null&&J(E,ce.startTime-Z),le=!1}return le}finally{p=null,m=j,g=!1}}var R=!1,O=null,$=-1,H=5,z=-1;function X(){return!(e.unstable_now()-zD||125M?(D.sortIndex=j,t(d,D),n(c)===null&&D===n(d)&&(b?(C($),$=-1):b=!0,J(E,j-M))):(D.sortIndex=G,t(c,D),y||g||(y=!0,ge(A))),D},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(D){var Z=m;return function(){var j=m;m=Z;try{return D.apply(this,arguments)}finally{m=j}}}})(q_);(function(e){e.exports=q_})(K_);/** - * @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 Y_=v.exports,Hr=K_.exports;function de(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$y=Object.prototype.hasOwnProperty,oV=/^[: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]*$/,Cw={},_w={};function iV(e){return $y.call(_w,e)?!0:$y.call(Cw,e)?!1:oV.test(e)?_w[e]=!0:(Cw[e]=!0,!1)}function aV(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 sV(e,t,n,r){if(t===null||typeof t>"u"||aV(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 ur(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Fn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fn[e]=new ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fn[t]=new ur(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fn[e]=new ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fn[e]=new ur(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){Fn[e]=new ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fn[e]=new ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fn[e]=new ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fn[e]=new ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fn[e]=new ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var y3=/[\-:]([a-z])/g;function b3(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(y3,b3);Fn[t]=new ur(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(y3,b3);Fn[t]=new ur(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(y3,b3);Fn[t]=new ur(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fn[e]=new ur(e,1,!1,e.toLowerCase(),null,!1,!1)});Fn.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fn[e]=new ur(e,1,!1,e.toLowerCase(),null,!0,!0)});function x3(e,t,n,r){var o=Fn.hasOwnProperty(t)?Fn[t]:null;(o!==null?o.type!==0:r||!(2l||o[a]!==i[l]){var c=` -`+o[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{c2=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qc(e):""}function lV(e){switch(e.tag){case 5:return Qc(e.type);case 16:return Qc("Lazy");case 13:return Qc("Suspense");case 19:return Qc("SuspenseList");case 0:case 2:case 15:return e=d2(e.type,!1),e;case 11:return e=d2(e.type.render,!1),e;case 1:return e=d2(e.type,!0),e;default:return""}}function By(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 Xl:return"Fragment";case Yl:return"Portal";case Dy:return"Profiler";case w3:return"StrictMode";case Fy:return"Suspense";case zy:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J_:return(e.displayName||"Context")+".Consumer";case Q_:return(e._context.displayName||"Context")+".Provider";case S3:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case C3:return t=e.displayName||null,t!==null?t:By(e.type)||"Memo";case Oa:t=e._payload,e=e._init;try{return By(e(t))}catch{}}return null}function uV(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 By(t);case 8:return t===w3?"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 ts(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tk(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cV(e){var t=tk(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.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 ch(e){e._valueTracker||(e._valueTracker=cV(e))}function nk(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tk(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function V1(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 Vy(e,t){var n=t.checked;return Kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ew(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ts(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 rk(e,t){t=t.checked,t!=null&&x3(e,"checked",t,!1)}function Wy(e,t){rk(e,t);var n=ts(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")?Uy(e,t.type,n):t.hasOwnProperty("defaultValue")&&Uy(e,t.type,ts(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lw(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 Uy(e,t,n){(t!=="number"||V1(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jc=Array.isArray;function pu(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=dh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Rd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ld={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},dV=["Webkit","ms","Moz","O"];Object.keys(ld).forEach(function(e){dV.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ld[t]=ld[e]})});function sk(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ld.hasOwnProperty(e)&&ld[e]?(""+t).trim():t+"px"}function lk(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=sk(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var fV=Kt({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 Gy(e,t){if(t){if(fV[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(de(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(de(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(de(61))}if(t.style!=null&&typeof t.style!="object")throw Error(de(62))}}function Zy(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 Ky=null;function _3(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qy=null,hu=null,mu=null;function Tw(e){if(e=Lf(e)){if(typeof qy!="function")throw Error(de(280));var t=e.stateNode;t&&(t=im(t),qy(e.stateNode,e.type,t))}}function uk(e){hu?mu?mu.push(e):mu=[e]:hu=e}function ck(){if(hu){var e=hu,t=mu;if(mu=hu=null,Tw(e),t)for(e=0;e>>=0,e===0?32:31-(CV(e)/_V|0)|0}var fh=64,ph=4194304;function ed(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 j1(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=ed(l):(i&=a,i!==0&&(r=ed(i)))}else a=n&~o,a!==0?r=ed(a):i!==0&&(r=ed(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function kf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zo(t),e[t]=n}function PV(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=cd),zw=String.fromCharCode(32),Bw=!1;function Tk(e,t){switch(e){case"keyup":return nW.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ik(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ql=!1;function oW(e,t){switch(e){case"compositionend":return Ik(t);case"keypress":return t.which!==32?null:(Bw=!0,zw);case"textInput":return e=t.data,e===zw&&Bw?null:e;default:return null}}function iW(e,t){if(Ql)return e==="compositionend"||!O3&&Tk(e,t)?(e=Pk(),a1=A3=za=null,Ql=!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)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=Hw(n)}}function Nk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $k(){for(var e=window,t=V1();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=V1(e.document)}return t}function R3(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 hW(e){var t=$k(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Nk(n.ownerDocument.documentElement,n)){if(r!==null&&R3(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=jw(n,i);var a=jw(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>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=document.documentMode,Jl=null,t5=null,fd=null,n5=!1;function Gw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;n5||Jl==null||Jl!==V1(r)||(r=Jl,"selectionStart"in r&&R3(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}),fd&&zd(fd,r)||(fd=r,r=K1(t5,"onSelect"),0nu||(e.current=l5[nu],l5[nu]=null,nu--)}function Tt(e,t){nu++,l5[nu]=e.current,e.current=t}var ns={},Kn=ds(ns),Cr=ds(!1),qs=ns;function Tu(e,t){var n=e.type.contextTypes;if(!n)return ns;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function _r(e){return e=e.childContextTypes,e!=null}function Y1(){Dt(Cr),Dt(Kn)}function Jw(e,t,n){if(Kn.current!==ns)throw Error(de(168));Tt(Kn,t),Tt(Cr,n)}function jk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(de(108,uV(e)||"Unknown",o));return Kt({},n,r)}function X1(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ns,qs=Kn.current,Tt(Kn,e),Tt(Cr,Cr.current),!0}function eS(e,t,n){var r=e.stateNode;if(!r)throw Error(de(169));n?(e=jk(e,t,qs),r.__reactInternalMemoizedMergedChildContext=e,Dt(Cr),Dt(Kn),Tt(Kn,e)):Dt(Cr),Tt(Cr,n)}var ji=null,am=!1,k2=!1;function Gk(e){ji===null?ji=[e]:ji.push(e)}function EW(e){am=!0,Gk(e)}function fs(){if(!k2&&ji!==null){k2=!0;var e=0,t=gt;try{var n=ji;for(gt=1;e>=a,o-=a,Ki=1<<32-zo(t)+o|n<$?(H=O,O=null):H=O.sibling;var z=m(C,O,_[$],E);if(z===null){O===null&&(O=H);break}e&&O&&z.alternate===null&&t(C,O),S=i(z,S,$),R===null?A=z:R.sibling=z,R=z,O=H}if($===_.length)return n(C,O),Wt&&As(C,$),A;if(O===null){for(;$<_.length;$++)O=p(C,_[$],E),O!==null&&(S=i(O,S,$),R===null?A=O:R.sibling=O,R=O);return Wt&&As(C,$),A}for(O=r(C,O);$<_.length;$++)H=g(O,C,$,_[$],E),H!==null&&(e&&H.alternate!==null&&O.delete(H.key===null?$:H.key),S=i(H,S,$),R===null?A=H:R.sibling=H,R=H);return e&&O.forEach(function(X){return t(C,X)}),Wt&&As(C,$),A}function b(C,S,_,E){var A=Dc(_);if(typeof A!="function")throw Error(de(150));if(_=A.call(_),_==null)throw Error(de(151));for(var R=A=null,O=S,$=S=0,H=null,z=_.next();O!==null&&!z.done;$++,z=_.next()){O.index>$?(H=O,O=null):H=O.sibling;var X=m(C,O,z.value,E);if(X===null){O===null&&(O=H);break}e&&O&&X.alternate===null&&t(C,O),S=i(X,S,$),R===null?A=X:R.sibling=X,R=X,O=H}if(z.done)return n(C,O),Wt&&As(C,$),A;if(O===null){for(;!z.done;$++,z=_.next())z=p(C,z.value,E),z!==null&&(S=i(z,S,$),R===null?A=z:R.sibling=z,R=z);return Wt&&As(C,$),A}for(O=r(C,O);!z.done;$++,z=_.next())z=g(O,C,$,z.value,E),z!==null&&(e&&z.alternate!==null&&O.delete(z.key===null?$:z.key),S=i(z,S,$),R===null?A=z:R.sibling=z,R=z);return e&&O.forEach(function(he){return t(C,he)}),Wt&&As(C,$),A}function k(C,S,_,E){if(typeof _=="object"&&_!==null&&_.type===Xl&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case uh:e:{for(var A=_.key,R=S;R!==null;){if(R.key===A){if(A=_.type,A===Xl){if(R.tag===7){n(C,R.sibling),S=o(R,_.props.children),S.return=C,C=S;break e}}else if(R.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Oa&&sS(A)===R.type){n(C,R.sibling),S=o(R,_.props),S.ref=Wc(C,R,_),S.return=C,C=S;break e}n(C,R);break}else t(C,R);R=R.sibling}_.type===Xl?(S=Hs(_.props.children,C.mode,E,_.key),S.return=C,C=S):(E=h1(_.type,_.key,_.props,null,C.mode,E),E.ref=Wc(C,S,_),E.return=C,C=E)}return a(C);case Yl:e:{for(R=_.key;S!==null;){if(S.key===R)if(S.tag===4&&S.stateNode.containerInfo===_.containerInfo&&S.stateNode.implementation===_.implementation){n(C,S.sibling),S=o(S,_.children||[]),S.return=C,C=S;break e}else{n(C,S);break}else t(C,S);S=S.sibling}S=R2(_,C.mode,E),S.return=C,C=S}return a(C);case Oa:return R=_._init,k(C,S,R(_._payload),E)}if(Jc(_))return y(C,S,_,E);if(Dc(_))return b(C,S,_,E);xh(C,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,S!==null&&S.tag===6?(n(C,S.sibling),S=o(S,_),S.return=C,C=S):(n(C,S),S=O2(_,C.mode,E),S.return=C,C=S),a(C)):n(C,S)}return k}var Ou=eE(!0),tE=eE(!1),Pf={},ci=ds(Pf),Ud=ds(Pf),Hd=ds(Pf);function zs(e){if(e===Pf)throw Error(de(174));return e}function W3(e,t){switch(Tt(Hd,t),Tt(Ud,e),Tt(ci,Pf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jy(t,e)}Dt(ci),Tt(ci,t)}function Ru(){Dt(ci),Dt(Ud),Dt(Hd)}function nE(e){zs(Hd.current);var t=zs(ci.current),n=jy(t,e.type);t!==n&&(Tt(Ud,e),Tt(ci,n))}function U3(e){Ud.current===e&&(Dt(ci),Dt(Ud))}var Gt=ds(0);function r0(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)!==0)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 E2=[];function H3(){for(var e=0;en?n:4,e(!0);var r=L2.transition;L2.transition={};try{e(!1),t()}finally{gt=n,L2.transition=r}}function yE(){return ho().memoizedState}function TW(e,t,n){var r=Xa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bE(e))xE(t,n);else if(n=Yk(e,t,n,r),n!==null){var o=ar();Bo(n,e,r,o),wE(n,t,r)}}function IW(e,t,n){var r=Xa(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bE(e))xE(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,Wo(l,a)){var c=t.interleaved;c===null?(o.next=o,B3(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Yk(e,t,o,r),n!==null&&(o=ar(),Bo(n,e,r,o),wE(n,t,r))}}function bE(e){var t=e.alternate;return e===Zt||t!==null&&t===Zt}function xE(e,t){pd=o0=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wE(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,E3(e,n)}}var i0={readContext:po,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},OW={readContext:po,useCallback:function(e,t){return Jo().memoizedState=[e,t===void 0?null:t],e},useContext:po,useEffect:uS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,c1(4194308,4,pE.bind(null,t,e),n)},useLayoutEffect:function(e,t){return c1(4194308,4,e,t)},useInsertionEffect:function(e,t){return c1(4,2,e,t)},useMemo:function(e,t){var n=Jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jo();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=TW.bind(null,Zt,e),[r.memoizedState,e]},useRef:function(e){var t=Jo();return e={current:e},t.memoizedState=e},useState:lS,useDebugValue:q3,useDeferredValue:function(e){return Jo().memoizedState=e},useTransition:function(){var e=lS(!1),t=e[0];return e=AW.bind(null,e[1]),Jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Zt,o=Jo();if(Wt){if(n===void 0)throw Error(de(407));n=n()}else{if(n=t(),kn===null)throw Error(de(349));(Xs&30)!==0||iE(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,uS(sE.bind(null,r,i,e),[e]),r.flags|=2048,Zd(9,aE.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Jo(),t=kn.identifierPrefix;if(Wt){var n=qi,r=Ki;n=(r&~(1<<32-zo(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=jd++,0<\/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[ii]=t,e[Wd]=r,TE(e,t,!1,!1),t.stateNode=e;e:{switch(a=Zy(n,r),n){case"dialog":Nt("cancel",e),Nt("close",e),o=r;break;case"iframe":case"object":case"embed":Nt("load",e),o=r;break;case"video":case"audio":for(o=0;oNu&&(t.flags|=128,r=!0,Uc(i,!1),t.lanes=4194304)}else{if(!r)if(e=r0(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Uc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Wt)return Un(t),null}else 2*an()-i.renderingStartTime>Nu&&n!==1073741824&&(t.flags|=128,r=!0,Uc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=an(),t.sibling=null,n=Gt.current,Tt(Gt,r?n&1|2:n&1),t):(Un(t),null);case 22:case 23:return tb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(zr&1073741824)!==0&&(Un(t),t.subtreeFlags&6&&(t.flags|=8192)):Un(t),null;case 24:return null;case 25:return null}throw Error(de(156,t.tag))}function BW(e,t){switch(N3(t),t.tag){case 1:return _r(t.type)&&Y1(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ru(),Dt(Cr),Dt(Kn),H3(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return U3(t),null;case 13:if(Dt(Gt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(de(340));Iu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Dt(Gt),null;case 4:return Ru(),null;case 10:return z3(t.type._context),null;case 22:case 23:return tb(),null;case 24:return null;default:return null}}var Sh=!1,Gn=!1,VW=typeof WeakSet=="function"?WeakSet:Set,Le=null;function au(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xt(e,t,r)}else n.current=null}function x5(e,t,n){try{n()}catch(r){Xt(e,t,r)}}var yS=!1;function WW(e,t){if(r5=G1,e=$k(),R3(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,d=0,f=0,p=e,m=null;t:for(;;){for(var g;p!==n||o!==0&&p.nodeType!==3||(l=a+o),p!==i||r!==0&&p.nodeType!==3||(c=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(g=p.firstChild)!==null;)m=p,p=g;for(;;){if(p===e)break t;if(m===n&&++d===o&&(l=a),m===i&&++f===r&&(c=a),(g=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=g}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(o5={focusedElem:e,selectionRange:n},G1=!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 y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,k=y.memoizedState,C=t.stateNode,S=C.getSnapshotBeforeUpdate(t.elementType===t.type?b:Ro(t.type,b),k);C.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(de(163))}}catch(E){Xt(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,Le=e;break}Le=t.return}return y=yS,yS=!1,y}function hd(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&x5(t,n,i)}o=o.next}while(o!==r)}}function um(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 w5(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 RE(e){var t=e.alternate;t!==null&&(e.alternate=null,RE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ii],delete t[Wd],delete t[s5],delete t[_W],delete t[kW])),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 ME(e){return e.tag===5||e.tag===3||e.tag===4}function bS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ME(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 S5(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=q1));else if(r!==4&&(e=e.child,e!==null))for(S5(e,t,n),e=e.sibling;e!==null;)S5(e,t,n),e=e.sibling}function C5(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(C5(e,t,n),e=e.sibling;e!==null;)C5(e,t,n),e=e.sibling}var Rn=null,Mo=!1;function ka(e,t,n){for(n=n.child;n!==null;)NE(e,t,n),n=n.sibling}function NE(e,t,n){if(ui&&typeof ui.onCommitFiberUnmount=="function")try{ui.onCommitFiberUnmount(tm,n)}catch{}switch(n.tag){case 5:Gn||au(n,t);case 6:var r=Rn,o=Mo;Rn=null,ka(e,t,n),Rn=r,Mo=o,Rn!==null&&(Mo?(e=Rn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Rn.removeChild(n.stateNode));break;case 18:Rn!==null&&(Mo?(e=Rn,n=n.stateNode,e.nodeType===8?_2(e.parentNode,n):e.nodeType===1&&_2(e,n),Dd(e)):_2(Rn,n.stateNode));break;case 4:r=Rn,o=Mo,Rn=n.stateNode.containerInfo,Mo=!0,ka(e,t,n),Rn=r,Mo=o;break;case 0:case 11:case 14:case 15:if(!Gn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&x5(n,t,a),o=o.next}while(o!==r)}ka(e,t,n);break;case 1:if(!Gn&&(au(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Xt(n,t,l)}ka(e,t,n);break;case 21:ka(e,t,n);break;case 22:n.mode&1?(Gn=(r=Gn)||n.memoizedState!==null,ka(e,t,n),Gn=r):ka(e,t,n);break;default:ka(e,t,n)}}function xS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new VW),t.forEach(function(r){var o=XW.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Po(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=an()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*HW(r/1960))-r,10e?16:e,Ba===null)var r=!1;else{if(e=Ba,Ba=null,l0=0,(nt&6)!==0)throw Error(de(331));var o=nt;for(nt|=4,Le=e.current;Le!==null;){var i=Le,a=i.child;if((Le.flags&16)!==0){var l=i.deletions;if(l!==null){for(var c=0;can()-J3?Us(e,0):Q3|=n),kr(e,t)}function UE(e,t){t===0&&((e.mode&1)===0?t=1:(t=ph,ph<<=1,(ph&130023424)===0&&(ph=4194304)));var n=ar();e=ea(e,t),e!==null&&(kf(e,t,n),kr(e,n))}function YW(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),UE(e,n)}function XW(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(de(314))}r!==null&&r.delete(t),UE(e,n)}var HE;HE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Cr.current)Sr=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Sr=!1,FW(e,t,n);Sr=(e.flags&131072)!==0}else Sr=!1,Wt&&(t.flags&1048576)!==0&&Zk(t,J1,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;d1(e,t),e=t.pendingProps;var o=Tu(t,Kn.current);vu(t,n),o=G3(null,t,r,e,o,n);var i=Z3();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_r(r)?(i=!0,X1(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,V3(t),o.updater=sm,t.stateNode=o,o._reactInternals=t,p5(t,r,e,n),t=g5(null,t,r,!0,i,n)):(t.tag=0,Wt&&i&&M3(t),or(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(d1(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=JW(r),e=Ro(r,e),o){case 0:t=m5(null,t,r,e,n);break e;case 1:t=mS(null,t,r,e,n);break e;case 11:t=pS(null,t,r,e,n);break e;case 14:t=hS(null,t,r,Ro(r.type,e),n);break e}throw Error(de(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ro(r,o),m5(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ro(r,o),mS(e,t,r,o,n);case 3:e:{if(LE(t),e===null)throw Error(de(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Xk(e,t),n0(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Mu(Error(de(423)),t),t=gS(e,t,r,n,o);break e}else if(r!==o){o=Mu(Error(de(424)),t),t=gS(e,t,r,n,o);break e}else for(Br=Ka(t.stateNode.containerInfo.firstChild),Wr=t,Wt=!0,$o=null,n=tE(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Iu(),r===o){t=ta(e,t,n);break e}or(e,t,r,n)}t=t.child}return t;case 5:return nE(t),e===null&&c5(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,i5(r,o)?a=null:i!==null&&i5(r,i)&&(t.flags|=32),EE(e,t),or(e,t,a,n),t.child;case 6:return e===null&&c5(t),null;case 13:return PE(e,t,n);case 4:return W3(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ou(t,null,r,n):or(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ro(r,o),pS(e,t,r,o,n);case 7:return or(e,t,t.pendingProps,n),t.child;case 8:return or(e,t,t.pendingProps.children,n),t.child;case 12:return or(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Tt(e0,r._currentValue),r._currentValue=a,i!==null)if(Wo(i.value,a)){if(i.children===o.children&&!Cr.current){t=ta(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Xi(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?c.next=c:(c.next=f.next,f.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),d5(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(de(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),d5(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}or(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,vu(t,n),o=po(o),r=r(o),t.flags|=1,or(e,t,r,n),t.child;case 14:return r=t.type,o=Ro(r,t.pendingProps),o=Ro(r.type,o),hS(e,t,r,o,n);case 15:return _E(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ro(r,o),d1(e,t),t.tag=1,_r(r)?(e=!0,X1(t)):e=!1,vu(t,n),Jk(t,r,o),p5(t,r,o,n),g5(null,t,r,!0,e,n);case 19:return AE(e,t,n);case 22:return kE(e,t,n)}throw Error(de(156,t.tag))};function jE(e,t){return vk(e,t)}function QW(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 uo(e,t,n,r){return new QW(e,t,n,r)}function rb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JW(e){if(typeof e=="function")return rb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S3)return 11;if(e===C3)return 14}return 2}function Qa(e,t){var n=e.alternate;return n===null?(n=uo(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 h1(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")rb(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Xl:return Hs(n.children,o,i,t);case w3:a=8,o|=8;break;case Dy:return e=uo(12,n,t,o|2),e.elementType=Dy,e.lanes=i,e;case Fy:return e=uo(13,n,t,o),e.elementType=Fy,e.lanes=i,e;case zy:return e=uo(19,n,t,o),e.elementType=zy,e.lanes=i,e;case ek:return dm(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q_:a=10;break e;case J_:a=9;break e;case S3:a=11;break e;case C3:a=14;break e;case Oa:a=16,r=null;break e}throw Error(de(130,e==null?e:typeof e,""))}return t=uo(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Hs(e,t,n,r){return e=uo(7,e,r,t),e.lanes=n,e}function dm(e,t,n,r){return e=uo(22,e,r,t),e.elementType=ek,e.lanes=n,e.stateNode={isHidden:!1},e}function O2(e,t,n){return e=uo(6,e,null,t),e.lanes=n,e}function R2(e,t,n){return t=uo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function eU(e,t,n,r,o){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=p2(0),this.expirationTimes=p2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=p2(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ob(e,t,n,r,o,i,a,l,c){return e=new eU(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=uo(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},V3(i),e}function tU(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Zr})(ua);var PS=ua.exports;Ny.createRoot=PS.createRoot,Ny.hydrateRoot=PS.hydrateRoot;var di=Boolean(globalThis?.document)?v.exports.useLayoutEffect:v.exports.useEffect,gm={exports:{}},vm={};/** - * @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 aU=v.exports,sU=Symbol.for("react.element"),lU=Symbol.for("react.fragment"),uU=Object.prototype.hasOwnProperty,cU=aU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dU={key:!0,ref:!0,__self:!0,__source:!0};function qE(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)uU.call(t,r)&&!dU.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:sU,type:e,key:i,ref:a,props:o,_owner:cU.current}}vm.Fragment=lU;vm.jsx=qE;vm.jsxs=qE;(function(e){e.exports=vm})(gm);const wn=gm.exports.Fragment,x=gm.exports.jsx,Y=gm.exports.jsxs;var lb=v.exports.createContext({});lb.displayName="ColorModeContext";function ub(){const e=v.exports.useContext(lb);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var kh={light:"chakra-ui-light",dark:"chakra-ui-dark"};function fU(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const o=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,o?.()},setClassName(r){document.body.classList.add(r?kh.dark:kh.light),document.body.classList.remove(r?kh.light:kh.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const o=n.query(),i=a=>{r(a.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(i):o.addEventListener("change",i),()=>{typeof o.removeListener=="function"?o.removeListener(i):o.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 pU="chakra-ui-color-mode";function hU(e){return{ssr:!1,type:"localStorage",get(t){if(!globalThis?.document)return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var mU=hU(pU),AS=()=>{};function TS(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function YE(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:o,disableTransitionOnChange:i}={},colorModeManager:a=mU}=e,l=o==="dark"?"dark":"light",[c,d]=v.exports.useState(()=>TS(a,l)),[f,p]=v.exports.useState(()=>TS(a)),{getSystemTheme:m,setClassName:g,setDataset:y,addListener:b}=v.exports.useMemo(()=>fU({preventTransition:i}),[i]),k=o==="system"&&!c?f:c,C=v.exports.useCallback(E=>{const A=E==="system"?m():E;d(A),g(A==="dark"),y(A),a.set(A)},[a,m,g,y]);di(()=>{o==="system"&&p(m())},[]),v.exports.useEffect(()=>{const E=a.get();if(E){C(E);return}if(o==="system"){C("system");return}C(l)},[a,l,o,C]);const S=v.exports.useCallback(()=>{C(k==="dark"?"light":"dark")},[k,C]);v.exports.useEffect(()=>{if(!!r)return b(C)},[r,b,C]);const _=v.exports.useMemo(()=>({colorMode:t??k,toggleColorMode:t?AS:S,setColorMode:t?AS:C}),[k,S,C,t]);return x(lb.Provider,{value:_,children:n})}YE.displayName="ColorModeProvider";var gU=new Set(["dark","light","system"]);function vU(e){let t=e;return gU.has(t)||(t="light"),t}function yU(e={}){const{initialColorMode:t="light",type:n="localStorage",storageKey:r="chakra-ui-color-mode"}=e,o=vU(t),i=n==="cookie",a=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${o}",r="${r}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); - `,l=`(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${o}",e="${r}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})(); - `;return`!${i?a:l}`.trim()}function bU(e={}){return x("script",{id:"chakra-script",dangerouslySetInnerHTML:{__html:yU(e)}})}var P5={exports:{}};(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,a=9007199254740991,l="[object Arguments]",c="[object Array]",d="[object AsyncFunction]",f="[object Boolean]",p="[object Date]",m="[object Error]",g="[object Function]",y="[object GeneratorFunction]",b="[object Map]",k="[object Number]",C="[object Null]",S="[object Object]",_="[object Proxy]",E="[object RegExp]",A="[object Set]",R="[object String]",O="[object Undefined]",$="[object WeakMap]",H="[object ArrayBuffer]",z="[object DataView]",X="[object Float32Array]",he="[object Float64Array]",ye="[object Int8Array]",oe="[object Int16Array]",pe="[object Int32Array]",ge="[object Uint8Array]",J="[object Uint8ClampedArray]",D="[object Uint16Array]",Z="[object Uint32Array]",j=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,le={};le[X]=le[he]=le[ye]=le[oe]=le[pe]=le[ge]=le[J]=le[D]=le[Z]=!0,le[l]=le[c]=le[H]=le[f]=le[z]=le[p]=le[m]=le[g]=le[b]=le[k]=le[S]=le[E]=le[A]=le[R]=le[$]=!1;var ce=typeof Gi=="object"&&Gi&&Gi.Object===Object&&Gi,be=typeof self=="object"&&self&&self.Object===Object&&self,me=ce||be||Function("return this")(),_e=t&&!t.nodeType&&t,ue=_e&&!0&&e&&!e.nodeType&&e,we=ue&&ue.exports===_e,$e=we&&ce.process,rt=function(){try{var I=ue&&ue.require&&ue.require("util").types;return I||$e&&$e.binding&&$e.binding("util")}catch{}}(),Ct=rt&&rt.isTypedArray;function un(I,B,K){switch(K.length){case 0:return I.call(B);case 1:return I.call(B,K[0]);case 2:return I.call(B,K[0],K[1]);case 3:return I.call(B,K[0],K[1],K[2])}return I.apply(B,K)}function Se(I,B){for(var K=-1,Ce=Array(I);++K-1}function $g(I,B){var K=this.__data__,Ce=Ai(K,I);return Ce<0?(++this.size,K.push([I,B])):K[Ce][1]=B,this}So.prototype.clear=cc,So.prototype.delete=Mg,So.prototype.get=dc,So.prototype.has=Ng,So.prototype.set=$g;function ha(I){var B=-1,K=I==null?0:I.length;for(this.clear();++B1?K[Ze-1]:void 0,Be=Ze>2?K[2]:void 0;for(ht=I.length>3&&typeof ht=="function"?(Ze--,ht):void 0,Be&&fp(K[0],K[1],Be)&&(ht=Ze<3?void 0:ht,Ze=1),B=Object(B);++Ce-1&&I%1==0&&I0){if(++B>=o)return arguments[0]}else B=0;return I.apply(void 0,arguments)}}function vp(I){if(I!=null){try{return nn.call(I)}catch{}try{return I+""}catch{}}return""}function xl(I,B){return I===B||I!==I&&B!==B}var yc=pc(function(){return arguments}())?pc:function(I){return ys(I)&&qt.call(I,"callee")&&!Ho.call(I,"callee")},bc=Array.isArray;function wl(I){return I!=null&&bp(I.length)&&!xc(I)}function tv(I){return ys(I)&&wl(I)}var yp=vs||ov;function xc(I){if(!Co(I))return!1;var B=ml(I);return B==g||B==y||B==d||B==_}function bp(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=a}function Co(I){var B=typeof I;return I!=null&&(B=="object"||B=="function")}function ys(I){return I!=null&&typeof I=="object"}function nv(I){if(!ys(I)||ml(I)!=S)return!1;var B=zn(I);if(B===null)return!0;var K=qt.call(B,"constructor")&&B.constructor;return typeof K=="function"&&K instanceof K&&nn.call(K)==pt}var xp=Ct?Ie(Ct):rp;function rv(I){return lp(I,wp(I))}function wp(I){return wl(I)?Zg(I,!0):Yg(I)}var kt=gl(function(I,B,K,Ce){op(I,B,K,Ce)});function wt(I){return function(){return I}}function Sp(I){return I}function ov(){return!1}e.exports=kt})(P5,P5.exports);const rs=P5.exports;function li(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function lu(e,...t){return xU(e)?e(...t):e}var xU=e=>typeof e=="function",wU=e=>/!(important)?$/.test(e),IS=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,A5=(e,t)=>n=>{const r=String(t),o=wU(r),i=IS(r),a=e?`${e}.${i}`:i;let l=li(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return l=IS(l),o?`${l} !important`:l};function qd(e){const{scale:t,transform:n,compose:r}=e;return(i,a)=>{const l=A5(t,i)(a);let c=n?.(l,a)??l;return r&&(c=r(c,a)),c}}var Eh=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ao(e,t){return n=>{const r={property:n,scale:e};return r.transform=qd({scale:e,transform:t}),r}}var SU=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function CU(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:SU(t),transform:n?qd({scale:n,compose:r}):r}}var XE=["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 _U(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...XE].join(" ")}function kU(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...XE].join(" ")}var EU={"--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(" ")},LU={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 PU(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 AU={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},QE="& > :not(style) ~ :not(style)",TU={[QE]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},IU={[QE]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},T5={"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"},OU=new Set(Object.values(T5)),JE=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),RU=e=>e.trim();function MU(e,t){var n;if(e==null||JE.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:o,values:i}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!o||!i)return e;const a=o.includes("-gradient")?o:`${o}-gradient`,[l,...c]=i.split(",").map(RU).filter(Boolean);if(c?.length===0)return e;const d=l in T5?T5[l]:l;c.unshift(d);const f=c.map(p=>{if(OU.has(p))return p;const m=p.indexOf(" "),[g,y]=m!==-1?[p.substr(0,m),p.substr(m+1)]:[p],b=eL(y)?y:y&&y.split(" "),k=`colors.${g}`,C=k in t.__cssMap?t.__cssMap[k].varRef:g;return b?[C,...Array.isArray(b)?b:[b]].join(" "):C});return`${a}(${f.join(", ")})`}var eL=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),NU=(e,t)=>MU(e,t??{});function $U(e){return/^var\(--.+\)$/.test(e)}var DU=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},qo=e=>t=>`${e}(${t})`,tt={filter(e){return e!=="auto"?e:EU},backdropFilter(e){return e!=="auto"?e:LU},ring(e){return PU(tt.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?_U():e==="auto-gpu"?kU():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=DU(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($U(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:NU,blur:qo("blur"),opacity:qo("opacity"),brightness:qo("brightness"),contrast:qo("contrast"),dropShadow:qo("drop-shadow"),grayscale:qo("grayscale"),hueRotate:qo("hue-rotate"),invert:qo("invert"),saturate:qo("saturate"),sepia:qo("sepia"),bgImage(e){return e==null||eL(e)||JE.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){const{space:t,divide:n}=AU[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},V={borderWidths:Ao("borderWidths"),borderStyles:Ao("borderStyles"),colors:Ao("colors"),borders:Ao("borders"),radii:Ao("radii",tt.px),space:Ao("space",Eh(tt.vh,tt.px)),spaceT:Ao("space",Eh(tt.vh,tt.px)),degreeT(e){return{property:e,transform:tt.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:qd({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ao("sizes",Eh(tt.vh,tt.px)),sizesT:Ao("sizes",Eh(tt.vh,tt.fraction)),shadows:Ao("shadows"),logical:CU,blur:Ao("blur",tt.blur)},m1={background:V.colors("background"),backgroundColor:V.colors("backgroundColor"),backgroundImage:V.propT("backgroundImage",tt.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:tt.bgClip},bgSize:V.prop("backgroundSize"),bgPosition:V.prop("backgroundPosition"),bg:V.colors("background"),bgColor:V.colors("backgroundColor"),bgPos:V.prop("backgroundPosition"),bgRepeat:V.prop("backgroundRepeat"),bgAttachment:V.prop("backgroundAttachment"),bgGradient:V.propT("backgroundImage",tt.gradient),bgClip:{transform:tt.bgClip}};Object.assign(m1,{bgImage:m1.backgroundImage,bgImg:m1.backgroundImage});var at={border:V.borders("border"),borderWidth:V.borderWidths("borderWidth"),borderStyle:V.borderStyles("borderStyle"),borderColor:V.colors("borderColor"),borderRadius:V.radii("borderRadius"),borderTop:V.borders("borderTop"),borderBlockStart:V.borders("borderBlockStart"),borderTopLeftRadius:V.radii("borderTopLeftRadius"),borderStartStartRadius:V.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:V.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:V.radii("borderTopRightRadius"),borderStartEndRadius:V.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:V.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:V.borders("borderRight"),borderInlineEnd:V.borders("borderInlineEnd"),borderBottom:V.borders("borderBottom"),borderBlockEnd:V.borders("borderBlockEnd"),borderBottomLeftRadius:V.radii("borderBottomLeftRadius"),borderBottomRightRadius:V.radii("borderBottomRightRadius"),borderLeft:V.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:V.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:V.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:V.borders(["borderLeft","borderRight"]),borderInline:V.borders("borderInline"),borderY:V.borders(["borderTop","borderBottom"]),borderBlock:V.borders("borderBlock"),borderTopWidth:V.borderWidths("borderTopWidth"),borderBlockStartWidth:V.borderWidths("borderBlockStartWidth"),borderTopColor:V.colors("borderTopColor"),borderBlockStartColor:V.colors("borderBlockStartColor"),borderTopStyle:V.borderStyles("borderTopStyle"),borderBlockStartStyle:V.borderStyles("borderBlockStartStyle"),borderBottomWidth:V.borderWidths("borderBottomWidth"),borderBlockEndWidth:V.borderWidths("borderBlockEndWidth"),borderBottomColor:V.colors("borderBottomColor"),borderBlockEndColor:V.colors("borderBlockEndColor"),borderBottomStyle:V.borderStyles("borderBottomStyle"),borderBlockEndStyle:V.borderStyles("borderBlockEndStyle"),borderLeftWidth:V.borderWidths("borderLeftWidth"),borderInlineStartWidth:V.borderWidths("borderInlineStartWidth"),borderLeftColor:V.colors("borderLeftColor"),borderInlineStartColor:V.colors("borderInlineStartColor"),borderLeftStyle:V.borderStyles("borderLeftStyle"),borderInlineStartStyle:V.borderStyles("borderInlineStartStyle"),borderRightWidth:V.borderWidths("borderRightWidth"),borderInlineEndWidth:V.borderWidths("borderInlineEndWidth"),borderRightColor:V.colors("borderRightColor"),borderInlineEndColor:V.colors("borderInlineEndColor"),borderRightStyle:V.borderStyles("borderRightStyle"),borderInlineEndStyle:V.borderStyles("borderInlineEndStyle"),borderTopRadius:V.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:V.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:V.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:V.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(at,{rounded:at.borderRadius,roundedTop:at.borderTopRadius,roundedTopLeft:at.borderTopLeftRadius,roundedTopRight:at.borderTopRightRadius,roundedTopStart:at.borderStartStartRadius,roundedTopEnd:at.borderStartEndRadius,roundedBottom:at.borderBottomRadius,roundedBottomLeft:at.borderBottomLeftRadius,roundedBottomRight:at.borderBottomRightRadius,roundedBottomStart:at.borderEndStartRadius,roundedBottomEnd:at.borderEndEndRadius,roundedLeft:at.borderLeftRadius,roundedRight:at.borderRightRadius,roundedStart:at.borderInlineStartRadius,roundedEnd:at.borderInlineEndRadius,borderStart:at.borderInlineStart,borderEnd:at.borderInlineEnd,borderTopStartRadius:at.borderStartStartRadius,borderTopEndRadius:at.borderStartEndRadius,borderBottomStartRadius:at.borderEndStartRadius,borderBottomEndRadius:at.borderEndEndRadius,borderStartRadius:at.borderInlineStartRadius,borderEndRadius:at.borderInlineEndRadius,borderStartWidth:at.borderInlineStartWidth,borderEndWidth:at.borderInlineEndWidth,borderStartColor:at.borderInlineStartColor,borderEndColor:at.borderInlineEndColor,borderStartStyle:at.borderInlineStartStyle,borderEndStyle:at.borderInlineEndStyle});var FU={color:V.colors("color"),textColor:V.colors("color"),fill:V.colors("fill"),stroke:V.colors("stroke")},I5={boxShadow:V.shadows("boxShadow"),mixBlendMode:!0,blendMode:V.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:V.prop("backgroundBlendMode"),opacity:!0};Object.assign(I5,{shadow:I5.boxShadow});var zU={filter:{transform:tt.filter},blur:V.blur("--chakra-blur"),brightness:V.propT("--chakra-brightness",tt.brightness),contrast:V.propT("--chakra-contrast",tt.contrast),hueRotate:V.degreeT("--chakra-hue-rotate"),invert:V.propT("--chakra-invert",tt.invert),saturate:V.propT("--chakra-saturate",tt.saturate),dropShadow:V.propT("--chakra-drop-shadow",tt.dropShadow),backdropFilter:{transform:tt.backdropFilter},backdropBlur:V.blur("--chakra-backdrop-blur"),backdropBrightness:V.propT("--chakra-backdrop-brightness",tt.brightness),backdropContrast:V.propT("--chakra-backdrop-contrast",tt.contrast),backdropHueRotate:V.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:V.propT("--chakra-backdrop-invert",tt.invert),backdropSaturate:V.propT("--chakra-backdrop-saturate",tt.saturate)},d0={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:tt.flexDirection},experimental_spaceX:{static:TU,transform:qd({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:IU,transform:qd({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:V.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:V.space("gap"),rowGap:V.space("rowGap"),columnGap:V.space("columnGap")};Object.assign(d0,{flexDir:d0.flexDirection});var tL={gridGap:V.space("gridGap"),gridColumnGap:V.space("gridColumnGap"),gridRowGap:V.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},BU={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:tt.outline},outlineOffset:!0,outlineColor:V.colors("outlineColor")},ao={width:V.sizesT("width"),inlineSize:V.sizesT("inlineSize"),height:V.sizes("height"),blockSize:V.sizes("blockSize"),boxSize:V.sizes(["width","height"]),minWidth:V.sizes("minWidth"),minInlineSize:V.sizes("minInlineSize"),minHeight:V.sizes("minHeight"),minBlockSize:V.sizes("minBlockSize"),maxWidth:V.sizes("maxWidth"),maxInlineSize:V.sizes("maxInlineSize"),maxHeight:V.sizes("maxHeight"),maxBlockSize:V.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:V.propT("float",tt.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(ao,{w:ao.width,h:ao.height,minW:ao.minWidth,maxW:ao.maxWidth,minH:ao.minHeight,maxH:ao.maxHeight,overscroll:ao.overscrollBehavior,overscrollX:ao.overscrollBehaviorX,overscrollY:ao.overscrollBehaviorY});var VU={listStyleType:!0,listStylePosition:!0,listStylePos:V.prop("listStylePosition"),listStyleImage:!0,listStyleImg:V.prop("listStyleImage")};function WU(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const l=t.get(r);if(l.has(o))return l.get(o);const c=e(r,o,i,a);return l.set(o,c),c}},HU=UU(WU),jU={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},GU={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},M2=(e,t,n)=>{const r={},o=HU(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},ZU={srOnly:{transform(e){return e===!0?jU:e==="focusable"?GU:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>M2(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>M2(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>M2(t,e,n)}},vd={position:!0,pos:V.prop("position"),zIndex:V.prop("zIndex","zIndices"),inset:V.spaceT("inset"),insetX:V.spaceT(["left","right"]),insetInline:V.spaceT("insetInline"),insetY:V.spaceT(["top","bottom"]),insetBlock:V.spaceT("insetBlock"),top:V.spaceT("top"),insetBlockStart:V.spaceT("insetBlockStart"),bottom:V.spaceT("bottom"),insetBlockEnd:V.spaceT("insetBlockEnd"),left:V.spaceT("left"),insetInlineStart:V.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:V.spaceT("right"),insetInlineEnd:V.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(vd,{insetStart:vd.insetInlineStart,insetEnd:vd.insetInlineEnd});var KU={ring:{transform:tt.ring},ringColor:V.colors("--chakra-ring-color"),ringOffset:V.prop("--chakra-ring-offset-width"),ringOffsetColor:V.colors("--chakra-ring-offset-color"),ringInset:V.prop("--chakra-ring-inset")},$t={margin:V.spaceT("margin"),marginTop:V.spaceT("marginTop"),marginBlockStart:V.spaceT("marginBlockStart"),marginRight:V.spaceT("marginRight"),marginInlineEnd:V.spaceT("marginInlineEnd"),marginBottom:V.spaceT("marginBottom"),marginBlockEnd:V.spaceT("marginBlockEnd"),marginLeft:V.spaceT("marginLeft"),marginInlineStart:V.spaceT("marginInlineStart"),marginX:V.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:V.spaceT("marginInline"),marginY:V.spaceT(["marginTop","marginBottom"]),marginBlock:V.spaceT("marginBlock"),padding:V.space("padding"),paddingTop:V.space("paddingTop"),paddingBlockStart:V.space("paddingBlockStart"),paddingRight:V.space("paddingRight"),paddingBottom:V.space("paddingBottom"),paddingBlockEnd:V.space("paddingBlockEnd"),paddingLeft:V.space("paddingLeft"),paddingInlineStart:V.space("paddingInlineStart"),paddingInlineEnd:V.space("paddingInlineEnd"),paddingX:V.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:V.space("paddingInline"),paddingY:V.space(["paddingTop","paddingBottom"]),paddingBlock:V.space("paddingBlock")};Object.assign($t,{m:$t.margin,mt:$t.marginTop,mr:$t.marginRight,me:$t.marginInlineEnd,marginEnd:$t.marginInlineEnd,mb:$t.marginBottom,ml:$t.marginLeft,ms:$t.marginInlineStart,marginStart:$t.marginInlineStart,mx:$t.marginX,my:$t.marginY,p:$t.padding,pt:$t.paddingTop,py:$t.paddingY,px:$t.paddingX,pb:$t.paddingBottom,pl:$t.paddingLeft,ps:$t.paddingInlineStart,paddingStart:$t.paddingInlineStart,pr:$t.paddingRight,pe:$t.paddingInlineEnd,paddingEnd:$t.paddingInlineEnd});var qU={textDecorationColor:V.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:V.shadows("textShadow")},YU={clipPath:!0,transform:V.propT("transform",tt.transform),transformOrigin:!0,translateX:V.spaceT("--chakra-translate-x"),translateY:V.spaceT("--chakra-translate-y"),skewX:V.degreeT("--chakra-skew-x"),skewY:V.degreeT("--chakra-skew-y"),scaleX:V.prop("--chakra-scale-x"),scaleY:V.prop("--chakra-scale-y"),scale:V.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:V.degreeT("--chakra-rotate")},XU={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:V.prop("transitionDuration","transition.duration"),transitionProperty:V.prop("transitionProperty","transition.property"),transitionTimingFunction:V.prop("transitionTimingFunction","transition.easing")},QU={fontFamily:V.prop("fontFamily","fonts"),fontSize:V.prop("fontSize","fontSizes",tt.px),fontWeight:V.prop("fontWeight","fontWeights"),lineHeight:V.prop("lineHeight","lineHeights"),letterSpacing:V.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},JU={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:V.spaceT("scrollMargin"),scrollMarginTop:V.spaceT("scrollMarginTop"),scrollMarginBottom:V.spaceT("scrollMarginBottom"),scrollMarginLeft:V.spaceT("scrollMarginLeft"),scrollMarginRight:V.spaceT("scrollMarginRight"),scrollMarginX:V.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:V.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:V.spaceT("scrollPadding"),scrollPaddingTop:V.spaceT("scrollPaddingTop"),scrollPaddingBottom:V.spaceT("scrollPaddingBottom"),scrollPaddingLeft:V.spaceT("scrollPaddingLeft"),scrollPaddingRight:V.spaceT("scrollPaddingRight"),scrollPaddingX:V.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:V.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function nL(e){return li(e)&&e.reference?e.reference:String(e)}var ym=(e,...t)=>t.map(nL).join(` ${e} `).replace(/calc/g,""),OS=(...e)=>`calc(${ym("+",...e)})`,RS=(...e)=>`calc(${ym("-",...e)})`,O5=(...e)=>`calc(${ym("*",...e)})`,MS=(...e)=>`calc(${ym("/",...e)})`,NS=e=>{const t=nL(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:O5(t,-1)},Rs=Object.assign(e=>({add:(...t)=>Rs(OS(e,...t)),subtract:(...t)=>Rs(RS(e,...t)),multiply:(...t)=>Rs(O5(e,...t)),divide:(...t)=>Rs(MS(e,...t)),negate:()=>Rs(NS(e)),toString:()=>e.toString()}),{add:OS,subtract:RS,multiply:O5,divide:MS,negate:NS});function eH(e,t="-"){return e.replace(/\s+/g,t)}function tH(e){const t=eH(e.toString());return rH(nH(t))}function nH(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function rH(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function oH(e,t=""){return[t,e].filter(Boolean).join("-")}function iH(e,t){return`var(${e}${t?`, ${t}`:""})`}function aH(e,t=""){return tH(`--${oH(e,t)}`)}function ps(e,t,n){const r=aH(e,n);return{variable:r,reference:iH(r,t)}}function sH(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}Object.freeze(["base","sm","md","lg","xl","2xl"]);function lH(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function uH(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function R5(e){if(e==null)return e;const{unitless:t}=uH(e);return t||typeof e=="number"?`${e}px`:e}var rL=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,cb=e=>Object.fromEntries(Object.entries(e).sort(rL));function $S(e){const t=cb(e);return Object.assign(Object.values(t),t)}function cH(e){const t=Object.keys(cb(e));return new Set(t)}function DS(e){if(!e)return e;e=R5(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function nd(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${R5(e)})`),t&&n.push("and",`(max-width: ${R5(t)})`),n.join(" ")}function dH(e){if(!e)return null;e.base=e.base??"0px";const t=$S(e),n=Object.entries(e).sort(rL).map(([i,a],l,c)=>{let[,d]=c[l+1]??[];return d=parseFloat(d)>0?DS(d):void 0,{_minW:DS(a),breakpoint:i,minW:a,maxW:d,maxWQuery:nd(null,d),minWQuery:nd(a),minMaxQuery:nd(a,d)}}),r=cH(e),o=Array.from(r.values());return{keys:r,normalized:t,isResponsive(i){const a=Object.keys(i);return a.length>0&&a.every(l=>r.has(l))},asObject:cb(e),asArray:$S(e),details:n,media:[null,...t.map(i=>nd(i)).slice(1)],toArrayValue(i){if(!sH(i))throw new Error("toArrayValue: value must be an object");const a=o.map(l=>i[l]??null);for(;lH(a)===null;)a.pop();return a},toObjectValue(i){if(!Array.isArray(i))throw new Error("toObjectValue: value must be an array");return i.reduce((a,l,c)=>{const d=o[c];return d!=null&&l!=null&&(a[d]=l),a},{})}}}var Tn={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}`},Ea=e=>oL(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Bi=e=>oL(t=>e(t,"~ &"),"[data-peer]",".peer"),oL=(e,...t)=>t.map(e).join(", "),bm={_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], &[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",_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:Ea(Tn.hover),_peerHover:Bi(Tn.hover),_groupFocus:Ea(Tn.focus),_peerFocus:Bi(Tn.focus),_groupFocusVisible:Ea(Tn.focusVisible),_peerFocusVisible:Bi(Tn.focusVisible),_groupActive:Ea(Tn.active),_peerActive:Bi(Tn.active),_groupDisabled:Ea(Tn.disabled),_peerDisabled:Bi(Tn.disabled),_groupInvalid:Ea(Tn.invalid),_peerInvalid:Bi(Tn.invalid),_groupChecked:Ea(Tn.checked),_peerChecked:Bi(Tn.checked),_groupFocusWithin:Ea(Tn.focusWithin),_peerFocusWithin:Bi(Tn.focusWithin),_peerPlaceholderShown:Bi(Tn.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]"},fH=Object.keys(bm);function FS(e,t){return ps(String(e).replace(/\./g,"-"),void 0,t)}function pH(e,t){let n={};const r={};for(const[o,i]of Object.entries(e)){const{isSemantic:a,value:l}=i,{variable:c,reference:d}=FS(o,t?.cssVarPrefix);if(!a){if(o.startsWith("space")){const m=o.split("."),[g,...y]=m,b=`${g}.-${y.join(".")}`,k=Rs.negate(l),C=Rs.negate(d);r[b]={value:k,var:c,varRef:C}}n[c]=l,r[o]={value:l,var:c,varRef:d};continue}const f=m=>{const y=[String(o).split(".")[0],m].join(".");if(!e[y])return m;const{reference:k}=FS(y,t?.cssVarPrefix);return k},p=li(l)?l:{default:l};n=rs(n,Object.entries(p).reduce((m,[g,y])=>{var b;const k=f(y);if(g==="default")return m[c]=k,m;const C=((b=bm)==null?void 0:b[g])??g;return m[C]={[c]:k},m},{})),r[o]={value:d,var:c,varRef:d}}return{cssVars:n,cssMap:r}}function hH(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function mH(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var gH=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function vH(e){return mH(e,gH)}function yH(e){return e.semanticTokens}function bH(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}function xH({tokens:e,semanticTokens:t}){const n=Object.entries(M5(e)??{}).map(([o,i])=>[o,{isSemantic:!1,value:i}]),r=Object.entries(M5(t,1)??{}).map(([o,i])=>[o,{isSemantic:!0,value:i}]);return Object.fromEntries([...n,...r])}function M5(e,t=1/0){return!li(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,o])=>(li(o)||Array.isArray(o)?Object.entries(M5(o,t-1)).forEach(([i,a])=>{n[`${r}.${i}`]=a}):n[r]=o,n),{})}function wH(e){var t;const n=bH(e),r=vH(n),o=yH(n),i=xH({tokens:r,semanticTokens:o}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:l,cssVars:c}=pH(i,{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"},...c},__cssMap:l,__breakpoints:dH(n.breakpoints)}),n}var db=rs({},m1,at,FU,d0,ao,zU,KU,BU,tL,ZU,vd,I5,$t,JU,QU,qU,YU,VU,XU),SH=Object.assign({},$t,ao,d0,tL,vd),CH=Object.keys(SH),_H=[...Object.keys(db),...fH],kH={...db,...bm},EH=e=>e in kH;function LH(e){return/^var\(--.+\)$/.test(e)}var PH=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!LH(t),AH=(e,t)=>{if(t==null)return t;const n=l=>{var c,d;return(d=(c=e.__cssMap)==null?void 0:c[l])==null?void 0:d.varRef},r=l=>n(l)??l,o=t.split(",").map(l=>l.trim()),[i,a]=o;return t=n(i)??r(a)??r(t),t};function TH(e){const{configs:t={},pseudos:n={},theme:r}=e;if(!r.__breakpoints)return()=>({});const{isResponsive:o,toArrayValue:i,media:a}=r.__breakpoints,l=(c,d=!1)=>{var f;const p=lu(c,r);let m={};for(let g in p){let y=lu(p[g],r);if(y==null)continue;if(Array.isArray(y)||li(y)&&o(y)){let S=Array.isArray(y)?y:i(y);S=S.slice(0,a.length);for(let _=0;_t=>TH({theme:t,pseudos:bm,configs:db})(e);function Ut(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function IH(e,t){if(Array.isArray(e))return e;if(li(e))return t(e);if(e!=null)return[e]}function OH(e,t){for(let n=t+1;n{rs(d,{[_]:m?S[_]:{[C]:S[_]}})});continue}if(!g){m?rs(d,S):d[C]=S;continue}d[C]=S}}return d}}function MH(e){return t=>{const{variant:n,size:r,theme:o}=t,i=RH(o);return rs({},lu(e.baseStyle??{},t),i(e,"sizes",r,t),i(e,"variants",n,t))}}function NH(e,t,n){var r,o;return((o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)??n}function yt(e){return hH(e,["styleConfig","size","variant","colorScheme"])}function $H(e){if(e.sheet)return e.sheet;for(var t=0;t0?br(Yu,--Pr):0,$u--,fn===10&&($u=1,wm--),fn}function Ur(){return fn=Pr2||Xd(fn)>3?"":" "}function KH(e,t){for(;--t&&Ur()&&!(fn<48||fn>102||fn>57&&fn<65||fn>70&&fn<97););return Af(e,g1()+(t<6&&fi()==32&&Ur()==32))}function $5(e){for(;Ur();)switch(fn){case e:return Pr;case 34:case 39:e!==34&&e!==39&&$5(fn);break;case 40:e===41&&$5(e);break;case 92:Ur();break}return Pr}function qH(e,t){for(;Ur()&&e+fn!==47+10;)if(e+fn===42+42&&fi()===47)break;return"/*"+Af(t,Pr-1)+"*"+xm(e===47?e:Ur())}function YH(e){for(;!Xd(fi());)Ur();return Af(e,Pr)}function XH(e){return dL(y1("",null,null,null,[""],e=cL(e),0,[0],e))}function y1(e,t,n,r,o,i,a,l,c){for(var d=0,f=0,p=a,m=0,g=0,y=0,b=1,k=1,C=1,S=0,_="",E=o,A=i,R=r,O=_;k;)switch(y=S,S=Ur()){case 40:if(y!=108&&O.charCodeAt(p-1)==58){N5(O+=dt(v1(S),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:O+=v1(S);break;case 9:case 10:case 13:case 32:O+=ZH(y);break;case 92:O+=KH(g1()-1,7);continue;case 47:switch(fi()){case 42:case 47:Lh(QH(qH(Ur(),g1()),t,n),c);break;default:O+="/"}break;case 123*b:l[d++]=ri(O)*C;case 125*b:case 59:case 0:switch(S){case 0:case 125:k=0;case 59+f:g>0&&ri(O)-p&&Lh(g>32?BS(O+";",r,n,p-1):BS(dt(O," ","")+";",r,n,p-2),c);break;case 59:O+=";";default:if(Lh(R=zS(O,t,n,d,f,o,l,_,E=[],A=[],p),i),S===123)if(f===0)y1(O,t,R,R,E,i,p,l,A);else switch(m){case 100:case 109:case 115:y1(e,R,R,r&&Lh(zS(e,R,R,0,0,o,l,_,o,E=[],p),A),o,A,p,l,r?E:A);break;default:y1(O,R,R,R,[""],A,0,l,A)}}d=f=g=0,b=C=1,_=O="",p=a;break;case 58:p=1+ri(O),g=y;default:if(b<1){if(S==123)--b;else if(S==125&&b++==0&&GH()==125)continue}switch(O+=xm(S),S*b){case 38:C=f>0?1:(O+="\f",-1);break;case 44:l[d++]=(ri(O)-1)*C,C=1;break;case 64:fi()===45&&(O+=v1(Ur())),m=fi(),f=p=ri(_=O+=YH(g1())),S++;break;case 45:y===45&&ri(O)==2&&(b=0)}}return i}function zS(e,t,n,r,o,i,a,l,c,d,f){for(var p=o-1,m=o===0?i:[""],g=hb(m),y=0,b=0,k=0;y0?m[C]+" "+S:dt(S,/&\f/g,m[C])))&&(c[k++]=_);return Sm(e,t,n,o===0?fb:l,c,d,f)}function QH(e,t,n){return Sm(e,t,n,aL,xm(jH()),Yd(e,2,-2),0)}function BS(e,t,n,r){return Sm(e,t,n,pb,Yd(e,0,r),Yd(e,r+1,-1),r)}function fL(e,t){switch(WH(e,t)){case 5103:return st+"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 st+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return st+e+f0+e+Hn+e+e;case 6828:case 4268:return st+e+Hn+e+e;case 6165:return st+e+Hn+"flex-"+e+e;case 5187:return st+e+dt(e,/(\w+).+(:[^]+)/,st+"box-$1$2"+Hn+"flex-$1$2")+e;case 5443:return st+e+Hn+"flex-item-"+dt(e,/flex-|-self/,"")+e;case 4675:return st+e+Hn+"flex-line-pack"+dt(e,/align-content|flex-|-self/,"")+e;case 5548:return st+e+Hn+dt(e,"shrink","negative")+e;case 5292:return st+e+Hn+dt(e,"basis","preferred-size")+e;case 6060:return st+"box-"+dt(e,"-grow","")+st+e+Hn+dt(e,"grow","positive")+e;case 4554:return st+dt(e,/([^-])(transform)/g,"$1"+st+"$2")+e;case 6187:return dt(dt(dt(e,/(zoom-|grab)/,st+"$1"),/(image-set)/,st+"$1"),e,"")+e;case 5495:case 3959:return dt(e,/(image-set\([^]*)/,st+"$1$`$1");case 4968:return dt(dt(e,/(.+:)(flex-)?(.*)/,st+"box-pack:$3"+Hn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+st+e+e;case 4095:case 3583:case 4068:case 2532:return dt(e,/(.+)-inline(.+)/,st+"$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(ri(e)-1-t>6)switch(br(e,t+1)){case 109:if(br(e,t+4)!==45)break;case 102:return dt(e,/(.+:)(.+)-([^]+)/,"$1"+st+"$2-$3$1"+f0+(br(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~N5(e,"stretch")?fL(dt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(br(e,t+1)!==115)break;case 6444:switch(br(e,ri(e)-3-(~N5(e,"!important")&&10))){case 107:return dt(e,":",":"+st)+e;case 101:return dt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+st+(br(e,14)===45?"inline-":"")+"box$3$1"+st+"$2$3$1"+Hn+"$2box$3")+e}break;case 5936:switch(br(e,t+11)){case 114:return st+e+Hn+dt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return st+e+Hn+dt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return st+e+Hn+dt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return st+e+Hn+e+e}return e}function bu(e,t){for(var n="",r=hb(e),o=0;o-1&&!e.return)switch(e.type){case pb:e.return=fL(e.value,e.length);break;case sL:return bu([jc(e,{value:dt(e.value,"@","@"+st)})],r);case fb:if(e.length)return HH(e.props,function(o){switch(UH(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return bu([jc(e,{props:[dt(o,/:(read-\w+)/,":"+f0+"$1")]})],r);case"::placeholder":return bu([jc(e,{props:[dt(o,/:(plac\w+)/,":"+st+"input-$1")]}),jc(e,{props:[dt(o,/:(plac\w+)/,":"+f0+"$1")]}),jc(e,{props:[dt(o,/:(plac\w+)/,Hn+"input-$1")]})],r)}return""})}}var VS=function(t){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var o=t(r);return n.set(r,o),o}};function pL(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var rj=function(t,n,r){for(var o=0,i=0;o=i,i=fi(),o===38&&i===12&&(n[r]=1),!Xd(i);)Ur();return Af(t,Pr)},oj=function(t,n){var r=-1,o=44;do switch(Xd(o)){case 0:o===38&&fi()===12&&(n[r]=1),t[r]+=rj(Pr-1,n,r);break;case 2:t[r]+=v1(o);break;case 4:if(o===44){t[++r]=fi()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=xm(o)}while(o=Ur());return t},ij=function(t,n){return dL(oj(cL(t),n))},WS=new WeakMap,aj=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,o=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&&!WS.get(r))&&!o){WS.set(t,!0);for(var i=[],a=ij(n,i),l=r.props,c=0,d=0;c=4;++r,o-=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(o){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 xj={animationIterationCount: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},wj=/[A-Z]|^ms/g,Sj=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xL=function(t){return t.charCodeAt(1)===45},US=function(t){return t!=null&&typeof t!="boolean"},N2=pL(function(e){return xL(e)?e:e.replace(wj,"-$&").toLowerCase()}),HS=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Sj,function(r,o,i){return oi={name:o,styles:i,next:oi},o})}return xj[t]!==1&&!xL(t)&&typeof n=="number"&&n!==0?n+"px":n};function Qd(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 oi={name:n.name,styles:n.styles,next:oi},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)oi={name:r.name,styles:r.styles,next:oi},r=r.next;var o=n.styles+";";return o}return Cj(e,t,n)}case"function":{if(e!==void 0){var i=oi,a=n(e);return oi=i,Qd(e,t,a)}break}}if(t==null)return n;var l=t[n];return l!==void 0?l:n}function Cj(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o{t.includes(r)||(n[r]=e[r])}),n}function Oj(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const l=t.get(r);if(l.has(o))return l.get(o);const c=e(r,o,i,a);return l.set(o,c),c}},kL=Rj(Oj);function EL(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];t(o,r,e)&&(n[r]=o)}),n}var LL=e=>EL(e,t=>t!=null);function bb(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Mm(e){if(!bb(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function Mj(e){var t;return bb(e)?((t=If(e))==null?void 0:t.defaultView)??window:window}function If(e){return bb(e)?e.ownerDocument??document:document}function Nj(e){return e.view??window}function $j(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Of=$j();function Dj(e){const t=If(e);return t?.activeElement}function xb(e,t){return e?e===t||e.contains(t):!1}var PL=e=>e.hasAttribute("tabindex"),Fj=e=>PL(e)&&e.tabIndex===-1;function zj(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function Bj(e){return Mm(e)&&e.localName==="input"&&"select"in e}function AL(e){return(Mm(e)?If(e):document).activeElement===e}function TL(e){return e.parentElement&&TL(e.parentElement)?!0:e.hidden}function Vj(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function IL(e){if(!Mm(e)||TL(e)||zj(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]():Vj(e)?!0:PL(e)}function Wj(e){return e?Mm(e)&&IL(e)&&!Fj(e):!1}var Uj=["input:not([disabled])","select:not([disabled])","textarea:not([disabled])","embed","iframe","object","a[href]","area[href]","button:not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],Hj=Uj.join(),jj=e=>e.offsetWidth>0&&e.offsetHeight>0;function Gj(e){const t=Array.from(e.querySelectorAll(Hj));return t.unshift(e),t.filter(n=>IL(n)&&jj(n))}function p0(e,...t){return uu(e)?e(...t):e}function Zj(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function Kj(e){let t;return function(...r){return e&&(t=e.apply(this,r),e=null),t}}var qj=Kj(e=>()=>{const{condition:t,message:n}=e;t&&Tj&&console.warn(n)}),Yj=(...e)=>t=>e.reduce((n,r)=>r(n),t);function h0(e,t={}){const{isActive:n=AL,nextTick:r,preventScroll:o=!0,selectTextIfInput:i=!0}=t;if(!e||n(e))return-1;function a(){if(!e){qj({condition:!0,message:"[chakra-ui]: can't call focus() on `null` or `undefined` element"});return}if(Xj())e.focus({preventScroll:o});else if(e.focus(),o){const l=Qj(e);Jj(l)}if(i){if(Bj(e))e.select();else if("setSelectionRange"in e){const l=e;l.setSelectionRange(l.value.length,l.value.length)}}}return r?requestAnimationFrame(a):(a(),-1)}var Ph=null;function Xj(){if(Ph==null){Ph=!1;try{document.createElement("div").focus({get preventScroll(){return Ph=!0,!0}})}catch{}}return Ph}function Qj(e){const t=If(e),n=t.defaultView??window;let r=e.parentNode;const o=[],i=t.scrollingElement||t.documentElement;for(;r instanceof n.HTMLElement&&r!==i;)(r.offsetHeight{const n=Nj(t),r=t instanceof n.MouseEvent;(!r||r&&t.button===0)&&e(t)}}var nG={pageX:0,pageY:0};function rG(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||nG;return{x:r[`${t}X`],y:r[`${t}Y`]}}function oG(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function iG(e,t="page"){return{point:eG(e)?rG(e,t):oG(e,t)}}var aG=(e,t=!1)=>{const n=r=>e(r,iG(r));return t?tG(n):n},sG=()=>Of&&window.onpointerdown===null,lG=()=>Of&&window.ontouchstart===null,uG=()=>Of&&window.onmousedown===null,cG={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},dG={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function fG(e){return sG()?e:lG()?dG[e]:uG()?cG[e]:e}Object.freeze(["base","sm","md","lg","xl","2xl"]);function pG(e){const{userAgent:t,vendor:n}=e,r=/(android)/i.test(t);switch(!0){case/CriOS/.test(t):return"Chrome for iOS";case/Edg\//.test(t):return"Edge";case(r&&/Silk\//.test(t)):return"Silk";case(/Chrome/.test(t)&&/Google Inc/.test(n)):return"Chrome";case/Firefox\/\d+\.\d+$/.test(t):return"Firefox";case r:return"AOSP";case/MSIE|Trident/.test(t):return"IE";case(/Safari/.test(e.userAgent)&&/Apple Computer/.test(t)):return"Safari";case/AppleWebKit/.test(t):return"WebKit";default:return null}}function hG(e){return Of?pG(window.navigator)===e:!1}function mG(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=v.exports.createContext(void 0);o.displayName=r;function i(){var a;const l=v.exports.useContext(o);if(!l&&t){const c=new Error(n);throw c.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,c,i),c}return l}return[o.Provider,i,o]}function F5(){return F5=Object.assign?Object.assign.bind():function(e){for(var t=1;t96?yG:bG},KS=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(a){return t.__emotion_forwardProp(a)&&i(a)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},xG=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return yL(n,r,o),kj(function(){return bL(n,r,o)}),null},wG=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,a;n!==void 0&&(i=n.label,a=n.target);var l=KS(t,n,r),c=l||ZS(o),d=!c("as");return function(){var f=arguments,p=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&p.push("label:"+i+";"),f[0]==null||f[0].raw===void 0)p.push.apply(p,f);else{p.push(f[0][0]);for(var m=f.length,g=1;g` or ``");return e}function OL(){const e=ub(),t=Nm();return{...e,theme:t}}function PG(e,t,n){if(t==null)return t;const r=o=>{var i,a;return(a=(i=e.__breakpoints)==null?void 0:i.asArray)==null?void 0:a[o]};return r(t)??r(n)??n}function AG(e,t,n){if(t==null)return t;const r=o=>{var i,a;return(a=(i=e.__cssMap)==null?void 0:i[o])==null?void 0:a.value};return r(t)??r(n)??n}function TG(e,t,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return i=>{const a=o.filter(Boolean),l=r.map((c,d)=>{if(e==="breakpoints")return PG(i,c,a[d]??c);const f=`${e}.${c}`;return AG(i,f,a[d]??c)});return Array.isArray(t)?l:l[0]}}function IG(e){const{cssVarsRoot:t,theme:n,children:r}=e,o=v.exports.useMemo(()=>wH(n),[n]);return Y(Pj,{theme:o,children:[x(OG,{root:t}),r]})}function OG({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return x(Rm,{styles:n=>({[t]:n.__cssVars})})}mG({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function RG(){const{colorMode:e}=ub();return x(Rm,{styles:t=>{const n=kL(t,"styles.global"),r=p0(n,{theme:t,colorMode:e});return r?iL(r)(t):void 0}})}var MG=new Set([..._H,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),NG=new Set(["htmlWidth","htmlHeight","htmlSize"]);function $G(e){return NG.has(e)||!MG.has(e)}var DG=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:o,sx:i,...a}=t,l=EL(a,(p,m)=>EH(m)),c=p0(e,t),d=Object.assign({},o,c,LL(l),i),f=iL(d)(t.theme);return r?[f,r]:f};function $2(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=$G);const o=DG({baseStyle:n});return z5(e,r)(o)}function fe(e){return v.exports.forwardRef(e)}function RL(e,t={}){const{styleConfig:n,...r}=t,{theme:o,colorMode:i}=OL(),a=kL(o,`components.${e}`),l=n||a,c=rs({theme:o,colorMode:i},l?.defaultProps??{},LL(Ij(r,["children"]))),d=v.exports.useRef({});if(l){const p=MH(l)(c);LG(d.current,p)||(d.current=p)}return d.current}function cr(e,t={}){return RL(e,t)}function dr(e,t={}){return RL(e,t)}function FG(){const e=new Map;return new Proxy($2,{apply(t,n,r){return $2(...r)},get(t,n){return e.has(n)||e.set(n,$2(n)),e.get(n)}})}var ie=FG();function zG(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Rt(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i}=e,a=v.exports.createContext(void 0);a.displayName=t;function l(){var c;const d=v.exports.useContext(a);if(!d&&n){const f=new Error(i??zG(r,o));throw f.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,f,l),f}return d}return[a.Provider,l,a]}function BG(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 Qt(...e){return t=>{e.forEach(n=>{BG(n,t)})}}function VG(...e){return v.exports.useMemo(()=>Qt(...e),e)}function qS(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 WG=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function YS(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function XS(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var B5=typeof window<"u"?v.exports.useLayoutEffect:v.exports.useEffect,m0=e=>e,UG=class{descendants=new Map;register=e=>{if(e!=null)return WG(e)?this.registerNode(e):t=>{this.registerNode(t,e)}};unregister=e=>{this.descendants.delete(e);const t=qS(Array.from(this.descendants.keys()));this.assignIndex(t)};destroy=()=>{this.descendants.clear()};assignIndex=e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})};count=()=>this.descendants.size;enabledCount=()=>this.enabledValues().length;values=()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index);enabledValues=()=>this.values().filter(e=>!e.disabled);item=e=>{if(this.count()!==0)return this.values()[e]};enabledItem=e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]};first=()=>this.item(0);firstEnabled=()=>this.enabledItem(0);last=()=>this.item(this.descendants.size-1);lastEnabled=()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)};indexOf=e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1};enabledIndexOf=e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e));next=(e,t=!0)=>{const n=YS(e,this.count(),t);return this.item(n)};nextEnabled=(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=YS(r,this.enabledCount(),t);return this.enabledItem(o)};prev=(e,t=!0)=>{const n=XS(e,this.count()-1,t);return this.item(n)};prevEnabled=(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=XS(r,this.enabledCount()-1,t);return this.enabledItem(o)};registerNode=(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=qS(n);t?.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)}};function HG(){const e=v.exports.useRef(new UG);return B5(()=>()=>e.current.destroy()),e.current}var[jG,ML]=Rt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function GG(e){const t=ML(),[n,r]=v.exports.useState(-1),o=v.exports.useRef(null);B5(()=>()=>{!o.current||t.unregister(o.current)},[]),B5(()=>{if(!o.current)return;const a=Number(o.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const i=m0(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Qt(i,o)}}function NL(){return[m0(jG),()=>m0(ML()),()=>HG(),o=>GG(o)]}var en=(...e)=>e.filter(Boolean).join(" "),QS={path:Y("g",{stroke:"currentColor",strokeWidth:"1.5",children:[x("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"}),x("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),x("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Yr=fe((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:a,className:l,__css:c,...d}=e,f=en("chakra-icon",l),p={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...c},m={ref:t,focusable:i,className:f,__css:p},g=r??QS.viewBox;if(n&&typeof n!="string")return Q.createElement(ie.svg,{as:n,...m,...d});const y=a??QS.path;return Q.createElement(ie.svg,{verticalAlign:"middle",viewBox:g,...m,...d},y)});Yr.displayName="Icon";function Xu(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,i=v.exports.Children.toArray(e.path),a=fe((l,c)=>x(Yr,{ref:c,viewBox:t,...o,...l,children:i.length?i:x("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}function Zn(e,t=[]){const n=v.exports.useRef(e);return v.exports.useEffect(()=>{n.current=e}),v.exports.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function $L(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(m,g)=>m!==g}=e,i=Zn(r),a=Zn(o),[l,c]=v.exports.useState(n),d=t!==void 0,f=d?t:l,p=v.exports.useCallback(m=>{const y=typeof m=="function"?m(f):m;!a(f,y)||(d||c(y),i(y))},[d,i,f,a]);return[f,p]}const wb=v.exports.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),$m=v.exports.createContext({});function ZG(){return v.exports.useContext($m).visualElement}const Qu=v.exports.createContext(null),il=typeof document<"u",g0=il?v.exports.useLayoutEffect:v.exports.useEffect,DL=v.exports.createContext({strict:!1});function KG(e,t,n,r){const o=ZG(),i=v.exports.useContext(DL),a=v.exports.useContext(Qu),l=v.exports.useContext(wb).reducedMotion,c=v.exports.useRef(void 0);r=r||i.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current;return g0(()=>{d&&d.syncRender()}),v.exports.useEffect(()=>{d&&d.animationState&&d.animationState.animateChanges()}),g0(()=>()=>d&&d.notifyUnmount(),[]),d}function cu(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function qG(e,t,n){return v.exports.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):cu(n)&&(n.current=r))},[t])}function ef(e){return typeof e=="string"||Array.isArray(e)}function Dm(e){return typeof e=="object"&&typeof e.start=="function"}const YG=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Fm(e){return Dm(e.animate)||YG.some(t=>ef(e[t]))}function FL(e){return Boolean(Fm(e)||e.variants)}function XG(e,t){if(Fm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ef(n)?n:void 0,animate:ef(r)?r:void 0}}return e.inherit!==!1?t:{}}function QG(e){const{initial:t,animate:n}=XG(e,v.exports.useContext($m));return v.exports.useMemo(()=>({initial:t,animate:n}),[JS(t),JS(n)])}function JS(e){return Array.isArray(e)?e.join(" "):e}const Vi=e=>({isEnabled:t=>e.some(n=>!!t[n])}),tf={measureLayout:Vi(["layout","layoutId","drag"]),animation:Vi(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Vi(["exit"]),drag:Vi(["drag","dragControls"]),focus:Vi(["whileFocus"]),hover:Vi(["whileHover","onHoverStart","onHoverEnd"]),tap:Vi(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Vi(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Vi(["whileInView","onViewportEnter","onViewportLeave"])};function JG(e){for(const t in e)t==="projectionNodeConstructor"?tf.projectionNodeConstructor=e[t]:tf[t].Component=e[t]}function zm(e){const t=v.exports.useRef(null);return t.current===null&&(t.current=e()),t.current}const yd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let eZ=1;function tZ(){return zm(()=>{if(yd.hasEverUpdated)return eZ++})}const Sb=v.exports.createContext({});class nZ extends Q.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const zL=v.exports.createContext({}),rZ=Symbol.for("motionComponentSymbol");function oZ({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:o,Component:i}){e&&JG(e);function a(c,d){const f={...v.exports.useContext(wb),...c,layoutId:iZ(c)},{isStatic:p}=f;let m=null;const g=QG(c),y=p?void 0:tZ(),b=o(c,p);if(!p&&il){g.visualElement=KG(i,b,f,t);const k=v.exports.useContext(DL).strict,C=v.exports.useContext(zL);g.visualElement&&(m=g.visualElement.loadFeatures(f,k,e,y,n||tf.projectionNodeConstructor,C))}return Y(nZ,{visualElement:g.visualElement,props:f,children:[m,x($m.Provider,{value:g,children:r(i,c,y,qG(b,g.visualElement,d),b,p,g.visualElement)})]})}const l=v.exports.forwardRef(a);return l[rZ]=i,l}function iZ({layoutId:e}){const t=v.exports.useContext(Sb).id;return t&&e!==void 0?t+"-"+e:e}function aZ(e){function t(r,o={}){return oZ(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const sZ=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function Cb(e){return typeof e!="string"||e.includes("-")?!1:!!(sZ.indexOf(e)>-1||/[A-Z]/.test(e))}const v0={};function lZ(e){Object.assign(v0,e)}const y0=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Rf=new Set(y0);function BL(e,{layout:t,layoutId:n}){return Rf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!v0[e]||e==="opacity")}const bi=e=>!!e?.getVelocity,uZ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},cZ=(e,t)=>y0.indexOf(e)-y0.indexOf(t);function dZ({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},o,i){let a="";t.sort(cZ);for(const l of t)a+=`${uZ[l]||l}(${e[l]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),i?a=i(e,o?"":a):r&&o&&(a="none"),a}function VL(e){return e.startsWith("--")}const fZ=(e,t)=>t&&typeof e=="number"?t.transform(e):e,WL=(e,t)=>n=>Math.max(Math.min(n,t),e),bd=e=>e%1?Number(e.toFixed(5)):e,nf=/(-)?([\d]*\.?[\d])+/g,V5=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,pZ=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Mf(e){return typeof e=="string"}const al={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},xd=Object.assign(Object.assign({},al),{transform:WL(0,1)}),Ah=Object.assign(Object.assign({},al),{default:1}),Nf=e=>({test:t=>Mf(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Aa=Nf("deg"),pi=Nf("%"),De=Nf("px"),hZ=Nf("vh"),mZ=Nf("vw"),e8=Object.assign(Object.assign({},pi),{parse:e=>pi.parse(e)/100,transform:e=>pi.transform(e*100)}),_b=(e,t)=>n=>Boolean(Mf(n)&&pZ.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),UL=(e,t,n)=>r=>{if(!Mf(r))return r;const[o,i,a,l]=r.match(nf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},Bs={test:_b("hsl","hue"),parse:UL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+pi.transform(bd(t))+", "+pi.transform(bd(n))+", "+bd(xd.transform(r))+")"},gZ=WL(0,255),D2=Object.assign(Object.assign({},al),{transform:e=>Math.round(gZ(e))}),Va={test:_b("rgb","red"),parse:UL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+D2.transform(e)+", "+D2.transform(t)+", "+D2.transform(n)+", "+bd(xd.transform(r))+")"};function vZ(e){let t="",n="",r="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const W5={test:_b("#"),parse:vZ,transform:Va.transform},rr={test:e=>Va.test(e)||W5.test(e)||Bs.test(e),parse:e=>Va.test(e)?Va.parse(e):Bs.test(e)?Bs.parse(e):W5.parse(e),transform:e=>Mf(e)?e:e.hasOwnProperty("red")?Va.transform(e):Bs.transform(e)},HL="${c}",jL="${n}";function yZ(e){var t,n,r,o;return isNaN(e)&&Mf(e)&&((n=(t=e.match(nf))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((o=(r=e.match(V5))===null||r===void 0?void 0:r.length)!==null&&o!==void 0?o:0)>0}function GL(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(V5);r&&(n=r.length,e=e.replace(V5,HL),t.push(...r.map(rr.parse)));const o=e.match(nf);return o&&(e=e.replace(nf,jL),t.push(...o.map(al.parse))),{values:t,numColors:n,tokenised:e}}function ZL(e){return GL(e).values}function KL(e){const{values:t,numColors:n,tokenised:r}=GL(e),o=t.length;return i=>{let a=r;for(let l=0;ltypeof e=="number"?0:e;function xZ(e){const t=ZL(e);return KL(e)(t.map(bZ))}const na={test:yZ,parse:ZL,createTransformer:KL,getAnimatableNone:xZ},wZ=new Set(["brightness","contrast","saturate","opacity"]);function SZ(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(nf)||[];if(!r)return e;const o=n.replace(r,"");let i=wZ.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const CZ=/([a-z-]*)\(.*?\)/g,U5=Object.assign(Object.assign({},na),{getAnimatableNone:e=>{const t=e.match(CZ);return t?t.map(SZ).join(" "):e}}),t8={...al,transform:Math.round},qL={borderWidth:De,borderTopWidth:De,borderRightWidth:De,borderBottomWidth:De,borderLeftWidth:De,borderRadius:De,radius:De,borderTopLeftRadius:De,borderTopRightRadius:De,borderBottomRightRadius:De,borderBottomLeftRadius:De,width:De,maxWidth:De,height:De,maxHeight:De,size:De,top:De,right:De,bottom:De,left:De,padding:De,paddingTop:De,paddingRight:De,paddingBottom:De,paddingLeft:De,margin:De,marginTop:De,marginRight:De,marginBottom:De,marginLeft:De,rotate:Aa,rotateX:Aa,rotateY:Aa,rotateZ:Aa,scale:Ah,scaleX:Ah,scaleY:Ah,scaleZ:Ah,skew:Aa,skewX:Aa,skewY:Aa,distance:De,translateX:De,translateY:De,translateZ:De,x:De,y:De,z:De,perspective:De,transformPerspective:De,opacity:xd,originX:e8,originY:e8,originZ:De,zIndex:t8,fillOpacity:xd,strokeOpacity:xd,numOctaves:t8};function kb(e,t,n,r){const{style:o,vars:i,transform:a,transformKeys:l,transformOrigin:c}=e;l.length=0;let d=!1,f=!1,p=!0;for(const m in t){const g=t[m];if(VL(m)){i[m]=g;continue}const y=qL[m],b=fZ(g,y);if(Rf.has(m)){if(d=!0,a[m]=b,l.push(m),!p)continue;g!==(y.default||0)&&(p=!1)}else m.startsWith("origin")?(f=!0,c[m]=b):o[m]=b}if(d||r?o.transform=dZ(e,n,p,r):!t.transform&&o.transform&&(o.transform="none"),f){const{originX:m="50%",originY:g="50%",originZ:y=0}=c;o.transformOrigin=`${m} ${g} ${y}`}}const Eb=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function YL(e,t,n){for(const r in t)!bi(t[r])&&!BL(r,n)&&(e[r]=t[r])}function _Z({transformTemplate:e},t,n){return v.exports.useMemo(()=>{const r=Eb();return kb(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function kZ(e,t,n){const r=e.style||{},o={};return YL(o,r,e),Object.assign(o,_Z(e,t,n)),e.transformValues?e.transformValues(o):o}function EZ(e,t,n){const r={},o=kZ(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=o,r}const LZ=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],PZ=["whileTap","onTap","onTapStart","onTapCancel"],AZ=["onPan","onPanStart","onPanSessionStart","onPanEnd"],TZ=["whileInView","onViewportEnter","onViewportLeave","viewport"],IZ=new Set(["initial","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...TZ,...PZ,...LZ,...AZ]);function b0(e){return IZ.has(e)}let XL=e=>!b0(e);function OZ(e){!e||(XL=t=>t.startsWith("on")?!b0(t):e(t))}try{OZ(require("@emotion/is-prop-valid").default)}catch{}function RZ(e,t,n){const r={};for(const o in e)(XL(o)||n===!0&&b0(o)||!t&&!b0(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function n8(e,t,n){return typeof e=="string"?e:De.transform(t+n*e)}function MZ(e,t,n){const r=n8(t,e.x,e.width),o=n8(n,e.y,e.height);return`${r} ${o}`}const NZ={offset:"stroke-dashoffset",array:"stroke-dasharray"},$Z={offset:"strokeDashoffset",array:"strokeDasharray"};function DZ(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?NZ:$Z;e[i.offset]=De.transform(-r);const a=De.transform(t),l=De.transform(n);e[i.array]=`${a} ${l}`}function Lb(e,{attrX:t,attrY:n,originX:r,originY:o,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},d,f){kb(e,c,d,f),e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:g}=e;p.transform&&(g&&(m.transform=p.transform),delete p.transform),g&&(r!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=MZ(g,r!==void 0?r:.5,o!==void 0?o:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),i!==void 0&&DZ(p,i,a,l,!1)}const QL=()=>({...Eb(),attrs:{}});function FZ(e,t){const n=v.exports.useMemo(()=>{const r=QL();return Lb(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};YL(r,e.style,e),n.style={...r,...n.style}}return n}function zZ(e=!1){return(n,r,o,i,{latestValues:a},l)=>{const d=(Cb(n)?FZ:EZ)(r,a,l),p={...RZ(r,typeof n=="string",e),...d,ref:i};return o&&(p["data-projection-id"]=o),v.exports.createElement(n,p)}}const JL=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function eP(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const tP=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function nP(e,t,n,r){eP(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(tP.has(o)?o:JL(o),t.attrs[o])}function Pb(e){const{style:t}=e,n={};for(const r in t)(bi(t[r])||BL(r,e))&&(n[r]=t[r]);return n}function rP(e){const t=Pb(e);for(const n in e)if(bi(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function oP(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}const rf=e=>Array.isArray(e),BZ=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),iP=e=>rf(e)?e[e.length-1]||0:e;function x1(e){const t=bi(e)?e.get():e;return BZ(t)?t.toValue():t}function VZ({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const a={latestValues:WZ(r,o,i,e),renderState:t()};return n&&(a.mount=l=>n(r,l,a)),a}const aP=e=>(t,n)=>{const r=v.exports.useContext($m),o=v.exports.useContext(Qu),i=()=>VZ(e,t,r,o);return n?i():zm(i)};function WZ(e,t,n,r){const o={},i=r(e);for(const m in i)o[m]=x1(i[m]);let{initial:a,animate:l}=e;const c=Fm(e),d=FL(e);t&&d&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let f=n?n.initial===!1:!1;f=f||a===!1;const p=f?l:a;return p&&typeof p!="boolean"&&!Dm(p)&&(Array.isArray(p)?p:[p]).forEach(g=>{const y=oP(e,g);if(!y)return;const{transitionEnd:b,transition:k,...C}=y;for(const S in C){let _=C[S];if(Array.isArray(_)){const E=f?_.length-1:0;_=_[E]}_!==null&&(o[S]=_)}for(const S in b)o[S]=b[S]}),o}const UZ={useVisualState:aP({scrapeMotionValuesFromProps:rP,createRenderState:QL,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}Lb(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),nP(t,n)}})},HZ={useVisualState:aP({scrapeMotionValuesFromProps:Pb,createRenderState:Eb})};function jZ(e,{forwardMotionProps:t=!1},n,r,o){return{...Cb(e)?UZ:HZ,preloadedFeatures:n,useRender:zZ(t),createVisualElement:r,projectionNodeConstructor:o,Component:e}}var At;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(At||(At={}));function Bm(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function H5(e,t,n,r){v.exports.useEffect(()=>{const o=e.current;if(n&&o)return Bm(o,t,n,r)},[e,t,n,r])}function GZ({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(At.Focus,!0)},o=()=>{n&&n.setActive(At.Focus,!1)};H5(t,"focus",e?r:void 0),H5(t,"blur",e?o:void 0)}function sP(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function lP(e){return!!e.touches}function ZZ(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const KZ={pageX:0,pageY:0};function qZ(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||KZ;return{x:r[t+"X"],y:r[t+"Y"]}}function YZ(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function Ab(e,t="page"){return{point:lP(e)?qZ(e,t):YZ(e,t)}}const uP=(e,t=!1)=>{const n=r=>e(r,Ab(r));return t?ZZ(n):n},XZ=()=>il&&window.onpointerdown===null,QZ=()=>il&&window.ontouchstart===null,JZ=()=>il&&window.onmousedown===null,eK={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},tK={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function cP(e){return XZ()?e:QZ()?tK[e]:JZ()?eK[e]:e}function xu(e,t,n,r){return Bm(e,cP(t),uP(n,t==="pointerdown"),r)}function x0(e,t,n,r){return H5(e,cP(t),n&&uP(n,t==="pointerdown"),r)}function dP(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const r8=dP("dragHorizontal"),o8=dP("dragVertical");function fP(e){let t=!1;if(e==="y")t=o8();else if(e==="x")t=r8();else{const n=r8(),r=o8();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function pP(){const e=fP(!0);return e?(e(),!1):!0}function i8(e,t,n){return(r,o)=>{!sP(r)||pP()||(e.animationState&&e.animationState.setActive(At.Hover,t),n&&n(r,o))}}function nK({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){x0(r,"pointerenter",e||n?i8(r,!0,e):void 0,{passive:!e}),x0(r,"pointerleave",t||n?i8(r,!1,t):void 0,{passive:!t})}const hP=(e,t)=>t?e===t?!0:hP(e,t.parentElement):!1;function Tb(e){return v.exports.useEffect(()=>()=>e(),[])}var ai=function(){return ai=Object.assign||function(t){for(var n,r=1,o=arguments.length;r0&&i[i.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]0)&&!(o=r.next()).done;)i.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function j5(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;rMath.min(Math.max(n,e),t),F2=.001,oK=.01,s8=10,iK=.05,aK=1;function sK({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;rK(e<=s8*1e3);let a=1-t;a=S0(iK,aK,a),e=S0(oK,s8,e/1e3),a<1?(o=d=>{const f=d*a,p=f*e,m=f-n,g=G5(d,a),y=Math.exp(-p);return F2-m/g*y},i=d=>{const p=d*a*e,m=p*n+n,g=Math.pow(a,2)*Math.pow(d,2)*e,y=Math.exp(-p),b=G5(Math.pow(d,2),a);return(-o(d)+F2>0?-1:1)*((m-g)*y)/b}):(o=d=>{const f=Math.exp(-d*e),p=(d-n)*e+1;return-F2+f*p},i=d=>{const f=Math.exp(-d*e),p=(n-d)*(e*e);return f*p});const l=5/e,c=uK(o,i,l);if(e=e*1e3,isNaN(c))return{stiffness:100,damping:10,duration:e};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:e}}}const lK=12;function uK(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function fK(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!l8(e,dK)&&l8(e,cK)){const n=sK(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Ib(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:o}=e,i=Vm(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:l,damping:c,mass:d,velocity:f,duration:p,isResolvedFromDuration:m}=fK(i),g=u8,y=u8;function b(){const k=f?-(f/1e3):0,C=n-t,S=c/(2*Math.sqrt(l*d)),_=Math.sqrt(l/d)/1e3;if(o===void 0&&(o=Math.min(Math.abs(n-t)/100,.4)),S<1){const E=G5(_,S);g=A=>{const R=Math.exp(-S*_*A);return n-R*((k+S*_*C)/E*Math.sin(E*A)+C*Math.cos(E*A))},y=A=>{const R=Math.exp(-S*_*A);return S*_*R*(Math.sin(E*A)*(k+S*_*C)/E+C*Math.cos(E*A))-R*(Math.cos(E*A)*(k+S*_*C)-E*C*Math.sin(E*A))}}else if(S===1)g=E=>n-Math.exp(-_*E)*(C+(k+_*C)*E);else{const E=_*Math.sqrt(S*S-1);g=A=>{const R=Math.exp(-S*_*A),O=Math.min(E*A,300);return n-R*((k+S*_*C)*Math.sinh(O)+E*C*Math.cosh(O))/E}}}return b(),{next:k=>{const C=g(k);if(m)a.done=k>=p;else{const S=y(k)*1e3,_=Math.abs(S)<=r,E=Math.abs(n-C)<=o;a.done=_&&E}return a.value=a.done?n:C,a},flipTarget:()=>{f=-f,[t,n]=[n,t],b()}}}Ib.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const u8=e=>0,of=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Jt=(e,t,n)=>-n*e+n*t+e;function z2(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 c8({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=z2(c,l,e+1/3),i=z2(c,l,e),a=z2(c,l,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}const pK=(e,t,n)=>{const r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},hK=[W5,Va,Bs],d8=e=>hK.find(t=>t.test(e)),mP=(e,t)=>{let n=d8(e),r=d8(t),o=n.parse(e),i=r.parse(t);n===Bs&&(o=c8(o),n=Va),r===Bs&&(i=c8(i),r=Va);const a=Object.assign({},o);return l=>{for(const c in a)c!=="alpha"&&(a[c]=pK(o[c],i[c],l));return a.alpha=Jt(o.alpha,i.alpha,l),n.transform(a)}},Z5=e=>typeof e=="number",mK=(e,t)=>n=>t(e(n)),Wm=(...e)=>e.reduce(mK);function gP(e,t){return Z5(e)?n=>Jt(e,t,n):rr.test(e)?mP(e,t):yP(e,t)}const vP=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,a)=>gP(i,t[a]));return i=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=gP(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}};function f8(e){const t=na.parse(e),n=t.length;let r=0,o=0,i=0;for(let a=0;a{const n=na.createTransformer(t),r=f8(e),o=f8(t);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?Wm(vP(r.parsed,o.parsed),n):a=>`${a>0?t:e}`},vK=(e,t)=>n=>Jt(e,t,n);function yK(e){if(typeof e=="number")return vK;if(typeof e=="string")return rr.test(e)?mP:yP;if(Array.isArray(e))return vP;if(typeof e=="object")return gK}function bK(e,t,n){const r=[],o=n||yK(e[0]),i=e.length-1;for(let a=0;an(of(e,t,r))}function wK(e,t){const n=e.length,r=n-1;return o=>{let i=0,a=!1;if(o<=e[0]?a=!0:o>=e[r]&&(i=r-1,a=!0),!a){let c=1;for(;co||c===r);c++);i=c-1}const l=of(e[i],e[i+1],o);return t[i](l)}}function bP(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;w0(i===t.length),w0(!r||!Array.isArray(r)||r.length===i-1),e[0]>e[i-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=bK(t,r,o),l=i===2?xK(e,a):wK(e,a);return n?c=>l(S0(e[0],e[i-1],c)):l}const Um=e=>t=>1-e(1-t),Ob=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,SK=e=>t=>Math.pow(t,e),xP=e=>t=>t*t*((e+1)*t-e),CK=e=>{const t=xP(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},wP=1.525,_K=4/11,kK=8/11,EK=9/10,Rb=e=>e,Mb=SK(2),LK=Um(Mb),SP=Ob(Mb),CP=e=>1-Math.sin(Math.acos(e)),Nb=Um(CP),PK=Ob(Nb),$b=xP(wP),AK=Um($b),TK=Ob($b),IK=CK(wP),OK=4356/361,RK=35442/1805,MK=16061/1805,C0=e=>{if(e===1||e===0)return e;const t=e*e;return e<_K?7.5625*t:ee<.5?.5*(1-C0(1-e*2)):.5*C0(e*2-1)+.5;function DK(e,t){return e.map(()=>t||SP).splice(0,e.length-1)}function FK(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function zK(e,t){return e.map(n=>n*t)}function w1({from:e=0,to:t=1,ease:n,offset:r,duration:o=300}){const i={done:!1,value:e},a=Array.isArray(t)?t:[e,t],l=zK(r&&r.length===a.length?r:FK(a),o);function c(){return bP(l,a,{ease:Array.isArray(n)?n:DK(a,n)})}let d=c();return{next:f=>(i.value=d(f),i.done=f>=o,i),flipTarget:()=>{a.reverse(),d=c()}}}function BK({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:i}){const a={done:!1,value:t};let l=n*e;const c=t+l,d=i===void 0?c:i(c);return d!==c&&(l=d-t),{next:f=>{const p=-l*Math.exp(-f/r);return a.done=!(p>o||p<-o),a.value=a.done?d:d+p,a},flipTarget:()=>{}}}const p8={keyframes:w1,spring:Ib,decay:BK};function VK(e){if(Array.isArray(e.to))return w1;if(p8[e.type])return p8[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?w1:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Ib:w1}const _P=1/60*1e3,WK=typeof performance<"u"?()=>performance.now():()=>Date.now(),kP=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(WK()),_P);function UK(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,l={schedule:(c,d=!1,f=!1)=>{const p=f&&o,m=p?t:n;return d&&a.add(c),m.indexOf(c)===-1&&(m.push(c),p&&o&&(r=t.length)),c},cancel:c=>{const d=n.indexOf(c);d!==-1&&n.splice(d,1),a.delete(c)},process:c=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let d=0;d(e[t]=UK(()=>af=!0),e),{}),jK=$f.reduce((e,t)=>{const n=Hm[t];return e[t]=(r,o=!1,i=!1)=>(af||KK(),n.schedule(r,o,i)),e},{}),GK=$f.reduce((e,t)=>(e[t]=Hm[t].cancel,e),{});$f.reduce((e,t)=>(e[t]=()=>Hm[t].process(wu),e),{});const ZK=e=>Hm[e].process(wu),EP=e=>{af=!1,wu.delta=K5?_P:Math.max(Math.min(e-wu.timestamp,HK),1),wu.timestamp=e,q5=!0,$f.forEach(ZK),q5=!1,af&&(K5=!1,kP(EP))},KK=()=>{af=!0,K5=!0,q5||kP(EP)},qK=()=>wu;function LP(e,t,n=0){return e-t-n}function YK(e,t,n=0,r=!0){return r?LP(t+-e,t,n):t-(e-t)+n}function XK(e,t,n,r){return r?e>=t+n:e<=-n}const QK=e=>{const t=({delta:n})=>e(n);return{start:()=>jK.update(t,!0),stop:()=>GK.update(t)}};function PP(e){var t,n,{from:r,autoplay:o=!0,driver:i=QK,elapsed:a=0,repeat:l=0,repeatType:c="loop",repeatDelay:d=0,onPlay:f,onStop:p,onComplete:m,onRepeat:g,onUpdate:y}=e,b=Vm(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=b,C,S=0,_=b.duration,E,A=!1,R=!0,O;const $=VK(b);!((n=(t=$).needsInterpolation)===null||n===void 0)&&n.call(t,r,k)&&(O=bP([0,100],[r,k],{clamp:!1}),r=0,k=100);const H=$(Object.assign(Object.assign({},b),{from:r,to:k}));function z(){S++,c==="reverse"?(R=S%2===0,a=YK(a,_,d,R)):(a=LP(a,_,d),c==="mirror"&&H.flipTarget()),A=!1,g&&g()}function X(){C.stop(),m&&m()}function he(oe){if(R||(oe=-oe),a+=oe,!A){const pe=H.next(Math.max(0,a));E=pe.value,O&&(E=O(E)),A=R?pe.done:a<=0}y?.(E),A&&(S===0&&(_??(_=a)),S{p?.(),C.stop()}}}function AP(e,t){return t?e*(1e3/t):0}function JK({from:e=0,velocity:t=0,min:n,max:r,power:o=.8,timeConstant:i=750,bounceStiffness:a=500,bounceDamping:l=10,restDelta:c=1,modifyTarget:d,driver:f,onUpdate:p,onComplete:m,onStop:g}){let y;function b(_){return n!==void 0&&_r}function k(_){return n===void 0?r:r===void 0||Math.abs(n-_){var A;p?.(E),(A=_.onUpdate)===null||A===void 0||A.call(_,E)},onComplete:m,onStop:g}))}function S(_){C(Object.assign({type:"spring",stiffness:a,damping:l,restDelta:c},_))}if(b(e))S({from:e,velocity:t,to:k(e)});else{let _=o*t+e;typeof d<"u"&&(_=d(_));const E=k(_),A=E===n?-1:1;let R,O;const $=H=>{R=O,O=H,t=AP(H-R,qK().delta),(A===1&&H>E||A===-1&&Hy?.stop()}}const Y5=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),h8=e=>Y5(e)&&e.hasOwnProperty("z"),Th=(e,t)=>Math.abs(e-t);function Db(e,t){if(Z5(e)&&Z5(t))return Th(e,t);if(Y5(e)&&Y5(t)){const n=Th(e.x,t.x),r=Th(e.y,t.y),o=h8(e)&&h8(t)?Th(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(o,2))}}const TP=(e,t)=>1-3*t+3*e,IP=(e,t)=>3*t-6*e,OP=e=>3*e,_0=(e,t,n)=>((TP(t,n)*e+IP(t,n))*e+OP(t))*e,RP=(e,t,n)=>3*TP(t,n)*e*e+2*IP(t,n)*e+OP(t),eq=1e-7,tq=10;function nq(e,t,n,r,o){let i,a,l=0;do a=t+(n-t)/2,i=_0(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>eq&&++l=oq?iq(a,p,e,n):m===0?p:nq(a,l,l+Ih,e,n)}return a=>a===0||a===1?a:_0(i(a),t,r)}function sq({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:o}){const i=e||t||n||r,a=v.exports.useRef(!1),l=v.exports.useRef(null),c={passive:!(t||e||n||g)};function d(){l.current&&l.current(),l.current=null}function f(){return d(),a.current=!1,o.animationState&&o.animationState.setActive(At.Tap,!1),!pP()}function p(y,b){!f()||(hP(o.getInstance(),y.target)?e&&e(y,b):n&&n(y,b))}function m(y,b){!f()||n&&n(y,b)}function g(y,b){d(),!a.current&&(a.current=!0,l.current=Wm(xu(window,"pointerup",p,c),xu(window,"pointercancel",m,c)),o.animationState&&o.animationState.setActive(At.Tap,!0),t&&t(y,b))}x0(o,"pointerdown",i?g:void 0,c),Tb(d)}const lq="production",MP=typeof process>"u"||process.env===void 0?lq:"production",m8=new Set;function NP(e,t,n){e||m8.has(t)||(console.warn(t),n&&console.warn(n),m8.add(t))}const X5=new WeakMap,B2=new WeakMap,uq=e=>{const t=X5.get(e.target);t&&t(e)},cq=e=>{e.forEach(uq)};function dq({root:e,...t}){const n=e||document;B2.has(n)||B2.set(n,{});const r=B2.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(cq,{root:e,...t})),r[o]}function fq(e,t,n){const r=dq(t);return X5.set(e,n),r.observe(e),()=>{X5.delete(e),r.unobserve(e)}}function pq({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:o={}}){const i=v.exports.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);o.once&&i.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?gq:mq)(a,i.current,e,o)}const hq={some:0,all:1};function mq(e,t,n,{root:r,margin:o,amount:i="some",once:a}){v.exports.useEffect(()=>{if(!e)return;const l={root:r?.current,rootMargin:o,threshold:typeof i=="number"?i:hq[i]},c=d=>{const{isIntersecting:f}=d;if(t.isInView===f||(t.isInView=f,a&&!f&&t.hasEnteredView))return;f&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(At.InView,f);const p=n.getProps(),m=f?p.onViewportEnter:p.onViewportLeave;m&&m(d)};return fq(n.getInstance(),l,c)},[e,r,o,i])}function gq(e,t,n,{fallback:r=!0}){v.exports.useEffect(()=>{!e||!r||(MP!=="production"&&NP(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:o}=n.getProps();o&&o(null),n.animationState&&n.animationState.setActive(At.InView,!0)}))},[e])}const Wa=e=>t=>(e(t),null),vq={inView:Wa(pq),tap:Wa(sq),focus:Wa(GZ),hover:Wa(nK)};function Fb(){const e=v.exports.useContext(Qu);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=v.exports.useId();return v.exports.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}function yq(){return bq(v.exports.useContext(Qu))}function bq(e){return e===null?!0:e.isPresent}function $P(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,xq={linear:Rb,easeIn:Mb,easeInOut:SP,easeOut:LK,circIn:CP,circInOut:PK,circOut:Nb,backIn:$b,backInOut:TK,backOut:AK,anticipate:IK,bounceIn:NK,bounceInOut:$K,bounceOut:C0},g8=e=>{if(Array.isArray(e)){w0(e.length===4);const[t,n,r,o]=e;return aq(t,n,r,o)}else if(typeof e=="string")return xq[e];return e},wq=e=>Array.isArray(e)&&typeof e[0]!="number",v8=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&na.test(t)&&!t.startsWith("url(")),Ls=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Oh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),V2=()=>({type:"keyframes",ease:"linear",duration:.3}),Sq=e=>({type:"keyframes",duration:.8,values:e}),y8={x:Ls,y:Ls,z:Ls,rotate:Ls,rotateX:Ls,rotateY:Ls,rotateZ:Ls,scaleX:Oh,scaleY:Oh,scale:Oh,opacity:V2,backgroundColor:V2,color:V2,default:Oh},Cq=(e,t)=>{let n;return rf(t)?n=Sq:n=y8[e]||y8.default,{to:t,...n(t)}},_q={...qL,color:rr,backgroundColor:rr,outlineColor:rr,fill:rr,stroke:rr,borderColor:rr,borderTopColor:rr,borderRightColor:rr,borderBottomColor:rr,borderLeftColor:rr,filter:U5,WebkitFilter:U5},zb=e=>_q[e];function Bb(e,t){var n;let r=zb(e);return r!==U5&&(r=na),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const kq={current:!1};function Eq({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:l,from:c,...d}){return!!Object.keys(d).length}function Lq({ease:e,times:t,yoyo:n,flip:r,loop:o,...i}){const a={...i};return t&&(a.offset=t),i.duration&&(a.duration=k0(i.duration)),i.repeatDelay&&(a.repeatDelay=k0(i.repeatDelay)),e&&(a.ease=wq(e)?e.map(g8):g8(e)),i.type==="tween"&&(a.type="keyframes"),(n||o||r)&&(n?a.repeatType="reverse":o?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=o||n||r||i.repeat),i.type!=="spring"&&(a.type="keyframes"),a}function Pq(e,t){var n,r;return(r=(n=(Vb(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function Aq(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Tq(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),Aq(t),Eq(e)||(e={...e,...Cq(n,t.to)}),{...t,...Lq(e)}}function Iq(e,t,n,r,o){const i=Vb(r,e)||{};let a=i.from!==void 0?i.from:t.get();const l=v8(e,n);a==="none"&&l&&typeof n=="string"?a=Bb(e,n):b8(a)&&typeof n=="string"?a=x8(n):!Array.isArray(n)&&b8(n)&&typeof a=="string"&&(n=x8(a));const c=v8(e,a);function d(){const p={from:a,to:n,velocity:t.getVelocity(),onComplete:o,onUpdate:m=>t.set(m)};return i.type==="inertia"||i.type==="decay"?JK({...p,...i}):PP({...Tq(i,p,e),onUpdate:m=>{p.onUpdate(m),i.onUpdate&&i.onUpdate(m)},onComplete:()=>{p.onComplete(),i.onComplete&&i.onComplete()}})}function f(){const p=iP(n);return t.set(p),o(),i.onUpdate&&i.onUpdate(p),i.onComplete&&i.onComplete(),{stop:()=>{}}}return!c||!l||i.type===!1?f:d}function b8(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function x8(e){return typeof e=="number"?0:Bb("",e)}function Vb(e,t){return e[t]||e.default||e}function Wb(e,t,n,r={}){return kq.current&&(r={type:!1}),t.start(o=>{let i,a;const l=Iq(e,t,n,r,o),c=Pq(r,e),d=()=>a=l();return c?i=window.setTimeout(d,k0(c)):d(),()=>{clearTimeout(i),a&&a.stop()}})}const Oq=e=>/^\-?\d*\.?\d+$/.test(e),Rq=e=>/^0[^.\s]+$/.test(e),DP=1/60*1e3,Mq=typeof performance<"u"?()=>performance.now():()=>Date.now(),FP=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Mq()),DP);function Nq(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,l={schedule:(c,d=!1,f=!1)=>{const p=f&&o,m=p?t:n;return d&&a.add(c),m.indexOf(c)===-1&&(m.push(c),p&&o&&(r=t.length)),c},cancel:c=>{const d=n.indexOf(c);d!==-1&&n.splice(d,1),a.delete(c)},process:c=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let d=0;d(e[t]=Nq(()=>sf=!0),e),{}),hi=Df.reduce((e,t)=>{const n=jm[t];return e[t]=(r,o=!1,i=!1)=>(sf||Fq(),n.schedule(r,o,i)),e},{}),lf=Df.reduce((e,t)=>(e[t]=jm[t].cancel,e),{}),W2=Df.reduce((e,t)=>(e[t]=()=>jm[t].process(Su),e),{}),Dq=e=>jm[e].process(Su),zP=e=>{sf=!1,Su.delta=Q5?DP:Math.max(Math.min(e-Su.timestamp,$q),1),Su.timestamp=e,J5=!0,Df.forEach(Dq),J5=!1,sf&&(Q5=!1,FP(zP))},Fq=()=>{sf=!0,Q5=!0,J5||FP(zP)},e4=()=>Su;function Ub(e,t){e.indexOf(t)===-1&&e.push(t)}function Hb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class wd{constructor(){this.subscriptions=[]}add(t){return Ub(this.subscriptions,t),()=>Hb(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(!!o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class Bq{constructor(t){this.version="7.3.5",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new wd,this.velocityUpdateSubscribers=new wd,this.renderSubscribers=new wd,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:o,timestamp:i}=e4();this.lastUpdated!==i&&(this.timeDelta=o,this.lastUpdated=i,hi.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>hi.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=zq(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?AP(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Du(e){return new Bq(e)}const BP=e=>t=>t.test(e),Vq={test:e=>e==="auto",parse:e=>e},VP=[al,De,pi,Aa,mZ,hZ,Vq],Gc=e=>VP.find(BP(e)),Wq=[...VP,rr,na],Uq=e=>Wq.find(BP(e));function Hq(e){const t={};return e.forEachValue((n,r)=>t[r]=n.get()),t}function jq(e){const t={};return e.forEachValue((n,r)=>t[r]=n.getVelocity()),t}function Gm(e,t,n){const r=e.getProps();return oP(r,t,n!==void 0?n:r.custom,Hq(e),jq(e))}function Gq(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Du(n))}function Zq(e,t){const n=Gm(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const a in i){const l=iP(i[a]);Gq(e,a,l)}}function Kq(e,t,n){var r,o;const i=Object.keys(t).filter(l=>!e.hasValue(l)),a=i.length;if(!!a)for(let l=0;lt4(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=t4(e,t,n);else{const o=typeof t=="function"?Gm(e,t,n.custom):t;r=WP(e,o,n)}return r.then(()=>e.notifyAnimationComplete(t))}function t4(e,t,n={}){var r;const o=Gm(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const a=o?()=>WP(e,o,n):()=>Promise.resolve(),l=!((r=e.variantChildren)===null||r===void 0)&&r.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:m}=i;return Qq(e,t,f+d,p,m,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[d,f]=c==="beforeChildren"?[a,l]:[l,a];return d().then(f)}else return Promise.all([a(),l(n.delay)])}function WP(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=e.makeTargetAnimatable(t);const d=e.getValue("willChange");r&&(a=r);const f=[],p=o&&((i=e.animationState)===null||i===void 0?void 0:i.getState()[o]);for(const m in c){const g=e.getValue(m),y=c[m];if(!g||y===void 0||p&&eY(p,m))continue;let b={delay:n,...a};e.shouldReduceMotion&&Rf.has(m)&&(b={...b,type:!1,delay:0});let k=Wb(m,g,y,b);E0(d)&&(d.add(m),k=k.then(()=>d.remove(m))),f.push(k)}return Promise.all(f).then(()=>{l&&Zq(e,l)})}function Qq(e,t,n=0,r=0,o=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=o===1?(d=0)=>d*r:(d=0)=>l-d*r;return Array.from(e.variantChildren).sort(Jq).forEach((d,f)=>{a.push(t4(d,t,{...i,delay:n+c(f)}).then(()=>d.notifyAnimationComplete(t)))}),Promise.all(a)}function Jq(e,t){return e.sortNodePosition(t)}function eY({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const jb=[At.Animate,At.InView,At.Focus,At.Hover,At.Tap,At.Drag,At.Exit],tY=[...jb].reverse(),nY=jb.length;function rY(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Xq(e,n,r)))}function oY(e){let t=rY(e);const n=aY();let r=!0;const o=(c,d)=>{const f=Gm(e,d);if(f){const{transition:p,transitionEnd:m,...g}=f;c={...c,...g,...m}}return c};function i(c){t=c(e)}function a(c,d){var f;const p=e.getProps(),m=e.getVariantContext(!0)||{},g=[],y=new Set;let b={},k=1/0;for(let S=0;Sk&&R;const X=Array.isArray(A)?A:[A];let he=X.reduce(o,{});O===!1&&(he={});const{prevResolvedValues:ye={}}=E,oe={...ye,...he},pe=ge=>{z=!0,y.delete(ge),E.needsAnimating[ge]=!0};for(const ge in oe){const J=he[ge],D=ye[ge];b.hasOwnProperty(ge)||(J!==D?rf(J)&&rf(D)?!$P(J,D)||H?pe(ge):E.protectedKeys[ge]=!0:J!==void 0?pe(ge):y.add(ge):J!==void 0&&y.has(ge)?pe(ge):E.protectedKeys[ge]=!0)}E.prevProp=A,E.prevResolvedValues=he,E.isActive&&(b={...b,...he}),r&&e.blockInitialAnimation&&(z=!1),z&&!$&&g.push(...X.map(ge=>({animation:ge,options:{type:_,...c}})))}if(y.size){const S={};y.forEach(_=>{const E=e.getBaseTarget(_);E!==void 0&&(S[_]=E)}),g.push({animation:S})}let C=Boolean(g.length);return r&&p.initial===!1&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?t(g):Promise.resolve()}function l(c,d,f){var p;if(n[c].isActive===d)return Promise.resolve();(p=e.variantChildren)===null||p===void 0||p.forEach(g=>{var y;return(y=g.animationState)===null||y===void 0?void 0:y.setActive(c,d)}),n[c].isActive=d;const m=a(f,c);for(const g in n)n[g].protectedKeys={};return m}return{animateChanges:a,setActive:l,setAnimateFunction:i,getState:()=>n}}function iY(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!$P(t,e):!1}function Ps(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function aY(){return{[At.Animate]:Ps(!0),[At.InView]:Ps(),[At.Hover]:Ps(),[At.Tap]:Ps(),[At.Drag]:Ps(),[At.Focus]:Ps(),[At.Exit]:Ps()}}const sY={animation:Wa(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=oY(e)),Dm(t)&&v.exports.useEffect(()=>t.subscribe(e),[t])}),exit:Wa(e=>{const{custom:t,visualElement:n}=e,[r,o]=Fb(),i=v.exports.useContext(Qu);v.exports.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(At.Exit,!r,{custom:i&&i.custom||t});a&&!r&&a.then(o)},[r])})};class UP{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 d=H2(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=Db(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:g}=e4();this.history.push({...m,timestamp:g});const{onStart:y,onMove:b}=this.handlers;f||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{if(this.lastMoveEvent=d,this.lastMoveEventInfo=U2(f,this.transformPagePoint),sP(d)&&d.buttons===0){this.handlePointerUp(d,f);return}hi.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m}=this.handlers,g=H2(U2(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,g),m&&m(d,g)},lP(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const o=Ab(t),i=U2(o,this.transformPagePoint),{point:a}=i,{timestamp:l}=e4();this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,H2(i,this.history)),this.removeListeners=Wm(xu(window,"pointermove",this.handlePointerMove),xu(window,"pointerup",this.handlePointerUp),xu(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),lf.update(this.updatePoint)}}function U2(e,t){return t?{point:t(e.point)}:e}function w8(e,t){return{x:e.x-t.x,y:e.y-t.y}}function H2({point:e},t){return{point:e,delta:w8(e,HP(t)),offset:w8(e,lY(t)),velocity:uY(t,.1)}}function lY(e){return e[0]}function HP(e){return e[e.length-1]}function uY(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=HP(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>k0(t)));)n--;if(!r)return{x:0,y:0};const i=(o.timestamp-r.timestamp)/1e3;if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function jr(e){return e.max-e.min}function S8(e,t=0,n=.01){return Db(e,t)n&&(e=r?Jt(n,e,r.max):Math.min(e,n)),e}function E8(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 fY(e,{top:t,left:n,bottom:r,right:o}){return{x:E8(e.x,n,o),y:E8(e.y,t,r)}}function L8(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=of(t.min,t.max-r,e.min):r>o&&(n=of(e.min,e.max-o,t.min)),S0(0,1,n)}function mY(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 n4=.35;function gY(e=n4){return e===!1?e=0:e===!0&&(e=n4),{x:P8(e,"left","right"),y:P8(e,"top","bottom")}}function P8(e,t,n){return{min:A8(e,t),max:A8(e,n)}}function A8(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const T8=()=>({translate:0,scale:1,origin:0,originPoint:0}),_d=()=>({x:T8(),y:T8()}),I8=()=>({min:0,max:0}),On=()=>({x:I8(),y:I8()});function ei(e){return[e("x"),e("y")]}function jP({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function vY({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function yY(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 j2(e){return e===void 0||e===1}function GP({scale:e,scaleX:t,scaleY:n}){return!j2(e)||!j2(t)||!j2(n)}function Ta(e){return GP(e)||O8(e.x)||O8(e.y)||e.z||e.rotate||e.rotateX||e.rotateY}function O8(e){return e&&e!=="0%"}function L0(e,t,n){const r=e-n,o=t*r;return n+o}function R8(e,t,n,r,o){return o!==void 0&&(e=L0(e,o,r)),L0(e,n,r)+t}function r4(e,t=0,n=1,r,o){e.min=R8(e.min,t,n,r,o),e.max=R8(e.max,t,n,r,o)}function ZP(e,{x:t,y:n}){r4(e.x,t.translate,t.scale,t.originPoint),r4(e.y,n.translate,n.scale,n.originPoint)}function bY(e,t,n,r=!1){var o,i;const a=n.length;if(!a)return;t.x=t.y=1;let l,c;for(let d=0;d{this.stopAnimation(),n&&this.snapToCursor(Ab(l,"page").point)},o=(l,c)=>{var d;const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();f&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=fP(f),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ei(g=>{var y,b;let k=this.getAxisMotionValue(g).get()||0;if(pi.test(k)){const C=(b=(y=this.visualElement.projection)===null||y===void 0?void 0:y.layout)===null||b===void 0?void 0:b.actual[g];C&&(k=jr(C)*(parseFloat(k)/100))}this.originPoint[g]=k}),m?.(l,c),(d=this.visualElement.animationState)===null||d===void 0||d.setActive(At.Drag,!0))},i=(l,c)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:g}=c;if(f&&this.currentDirection===null){this.currentDirection=kY(g),this.currentDirection!==null&&p?.(this.currentDirection);return}this.updateAxis("x",c.point,g),this.updateAxis("y",c.point,g),this.visualElement.syncRender(),m?.(l,c)},a=(l,c)=>this.stop(l,c);this.panSession=new UP(t,{onSessionStart:r,onStart:o,onMove:i,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i?.(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(At.Drag,!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Rh(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=dY(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&cu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=fY(r.actual,t):this.constraints=!1,this.elastic=gY(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ei(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=mY(r.actual[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!cu(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=SY(r,o.root,this.visualElement.getTransformPagePoint());let a=pY(o.layout.actual,i);if(n){const l=n(vY(a));this.hasMutatedConstraints=!!l,l&&(a=jP(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=ei(f=>{var p;if(!Rh(f,n,this.currentDirection))return;let m=(p=c?.[f])!==null&&p!==void 0?p:{};a&&(m={min:0,max:0});const g=o?200:1e6,y=o?40:1e7,b={type:"inertia",velocity:r?t[f]:0,bounceStiffness:g,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...m};return this.startAxisValueAnimation(f,b)});return Promise.all(d).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Wb(t,r,0,n)}stopAnimation(){ei(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){ei(n=>{const{drag:r}=this.getProps();if(!Rh(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:l}=o.layout.actual[n];i.set(t[n]-Jt(a,l,.5))}})}scalePositionWithinConstraints(){var t;const{drag:n,dragConstraints:r}=this.getProps(),{projection:o}=this.visualElement;if(!cu(r)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ei(l=>{const c=this.getAxisMotionValue(l);if(c){const d=c.get();i[l]=hY({min:d,max:d},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=a?a({},""):"none",(t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),ei(l=>{if(!Rh(l,n,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(Jt(d,f,i[l]))})}addListeners(){var t;CY.set(this.visualElement,this);const n=this.visualElement.getInstance(),r=xu(n,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps();f&&p&&this.start(d)}),o=()=>{const{dragConstraints:d}=this.getProps();cu(d)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",o);i&&!i.layout&&((t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout()),o();const l=Bm(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(ei(p=>{const m=this.getAxisMotionValue(p);!m||(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.syncRender())});return()=>{l(),r(),a(),c?.()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=n4,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function Rh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function kY(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function EY(e){const{dragControls:t,visualElement:n}=e,r=zm(()=>new _Y(n));v.exports.useEffect(()=>t&&t.subscribe(r),[r,t]),v.exports.useEffect(()=>r.addListeners(),[r])}function LY({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:o}){const i=e||t||n||r,a=v.exports.useRef(null),{transformPagePoint:l}=v.exports.useContext(wb),c={onSessionStart:r,onStart:t,onMove:e,onEnd:(f,p)=>{a.current=null,n&&n(f,p)}};v.exports.useEffect(()=>{a.current!==null&&a.current.updateHandlers(c)});function d(f){a.current=new UP(f,c,{transformPagePoint:l})}x0(o,"pointerdown",i&&d),Tb(()=>a.current&&a.current.end())}const PY={pan:Wa(LY),drag:Wa(EY)},o4={current:null},qP={current:!1};function AY(){if(qP.current=!0,!!il)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>o4.current=e.matches;e.addListener(t),t()}else o4.current=!1}const Mh=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function TY(){const e=Mh.map(()=>new wd),t={},n={clearAllListeners:()=>e.forEach(r=>r.clear()),updatePropListeners:r=>{Mh.forEach(o=>{var i;const a="on"+o,l=r[a];(i=t[o])===null||i===void 0||i.call(t),l&&(t[o]=n[a](l))})}};return e.forEach((r,o)=>{n["on"+Mh[o]]=i=>r.add(i),n["notify"+Mh[o]]=(...i)=>r.notify(...i)}),n}function IY(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],a=n[o];if(bi(i))e.addValue(o,i),E0(r)&&r.add(o);else if(bi(a))e.addValue(o,Du(i)),E0(r)&&r.remove(o);else if(a!==i)if(e.hasValue(o)){const l=e.getValue(o);!l.hasAnimated&&l.set(i)}else{const l=e.getStaticValue(o);e.addValue(o,Du(l!==void 0?l:i))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const YP=Object.keys(tf),OY=YP.length,XP=({treeType:e="",build:t,getBaseTarget:n,makeTargetAnimatable:r,measureViewportBox:o,render:i,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:c,scrapeMotionValuesFromProps:d})=>({parent:f,props:p,presenceId:m,blockInitialAnimation:g,visualState:y,reducedMotionConfig:b},k={})=>{let C=!1;const{latestValues:S,renderState:_}=y;let E;const A=TY(),R=new Map,O=new Map;let $={};const H={...S};let z;function X(){!E||!C||(he(),i(E,_,p.style,Z.projection))}function he(){t(Z,_,S,k,p)}function ye(){A.notifyUpdate(S)}function oe(j,M){const G=M.onChange(ce=>{S[j]=ce,p.onUpdate&&hi.update(ye,!1,!0)}),le=M.onRenderRequest(Z.scheduleRender);O.set(j,()=>{G(),le()})}const{willChange:pe,...ge}=d(p);for(const j in ge){const M=ge[j];S[j]!==void 0&&bi(M)&&(M.set(S[j],!1),E0(pe)&&pe.add(j))}const J=Fm(p),D=FL(p),Z={treeType:e,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,presenceId:m,shouldReduceMotion:null,variantChildren:D?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(f?.isMounted()),blockInitialAnimation:g,isMounted:()=>Boolean(E),mount(j){C=!0,E=Z.current=j,Z.projection&&Z.projection.mount(j),D&&f&&!J&&(z=f?.addVariantChild(Z)),R.forEach((M,G)=>oe(G,M)),qP.current||AY(),Z.shouldReduceMotion=b==="never"?!1:b==="always"?!0:o4.current,f?.children.add(Z),Z.setProps(p)},unmount(){var j;(j=Z.projection)===null||j===void 0||j.unmount(),lf.update(ye),lf.render(X),O.forEach(M=>M()),z?.(),f?.children.delete(Z),A.clearAllListeners(),E=void 0,C=!1},loadFeatures(j,M,G,le,ce,be){const me=[];for(let _e=0;_eZ.scheduleRender(),animationType:typeof ue=="string"?ue:"both",initialPromotionConfig:be,layoutScroll:rt})}return me},addVariantChild(j){var M;const G=Z.getClosestVariantNode();if(G)return(M=G.variantChildren)===null||M===void 0||M.add(j),()=>G.variantChildren.delete(j)},sortNodePosition(j){return!c||e!==j.treeType?0:c(Z.getInstance(),j.getInstance())},getClosestVariantNode:()=>D?Z:f?.getClosestVariantNode(),getLayoutId:()=>p.layoutId,getInstance:()=>E,getStaticValue:j=>S[j],setStaticValue:(j,M)=>S[j]=M,getLatestValues:()=>S,setVisibility(j){Z.isVisible!==j&&(Z.isVisible=j,Z.scheduleRender())},makeTargetAnimatable(j,M=!0){return r(Z,j,p,M)},measureViewportBox(){return o(E,p)},addValue(j,M){Z.hasValue(j)&&Z.removeValue(j),R.set(j,M),S[j]=M.get(),oe(j,M)},removeValue(j){var M;R.delete(j),(M=O.get(j))===null||M===void 0||M(),O.delete(j),delete S[j],l(j,_)},hasValue:j=>R.has(j),getValue(j,M){let G=R.get(j);return G===void 0&&M!==void 0&&(G=Du(M),Z.addValue(j,G)),G},forEachValue:j=>R.forEach(j),readValue:j=>S[j]!==void 0?S[j]:a(E,j,k),setBaseTarget(j,M){H[j]=M},getBaseTarget(j){if(n){const M=n(p,j);if(M!==void 0&&!bi(M))return M}return H[j]},...A,build(){return he(),_},scheduleRender(){hi.render(X,!1,!0)},syncRender:X,setProps(j){(j.transformTemplate||p.transformTemplate)&&Z.scheduleRender(),p=j,A.updatePropListeners(j),$=IY(Z,d(p),$)},getProps:()=>p,getVariant:j=>{var M;return(M=p.variants)===null||M===void 0?void 0:M[j]},getDefaultTransition:()=>p.transition,getTransformPagePoint:()=>p.transformPagePoint,getVariantContext(j=!1){if(j)return f?.getVariantContext();if(!J){const G=f?.getVariantContext()||{};return p.initial!==void 0&&(G.initial=p.initial),G}const M={};for(let G=0;G{const i=o.get();if(!i4(i))return;const a=a4(i,r);a&&o.set(a)});for(const o in t){const i=t[o];if(!i4(i))continue;const a=a4(i,r);!a||(t[o]=a,n&&n[o]===void 0&&(n[o]=i))}return{target:t,transitionEnd:n}}const $Y=new Set(["width","height","top","left","right","bottom","x","y"]),eA=e=>$Y.has(e),DY=e=>Object.keys(e).some(eA),tA=(e,t)=>{e.set(t,!1),e.set(t)},N8=e=>e===al||e===De;var $8;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})($8||($8={}));const D8=(e,t)=>parseFloat(e.split(", ")[t]),F8=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return D8(o[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?D8(i[1],e):0}},FY=new Set(["x","y","z"]),zY=y0.filter(e=>!FY.has(e));function BY(e){const t=[];return zY.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.syncRender(),t}const z8={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:F8(4,13),y:F8(5,14)},VY=(e,t,n)=>{const r=t.measureViewportBox(),o=t.getInstance(),i=getComputedStyle(o),{display:a}=i,l={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(d=>{l[d]=z8[d](r,i)}),t.syncRender();const c=t.measureViewportBox();return n.forEach(d=>{const f=t.getValue(d);tA(f,l[d]),e[d]=z8[d](c,i)}),e},WY=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(eA);let i=[],a=!1;const l=[];if(o.forEach(c=>{const d=e.getValue(c);if(!e.hasValue(c))return;let f=n[c],p=Gc(f);const m=t[c];let g;if(rf(m)){const y=m.length,b=m[0]===null?1:0;f=m[b],p=Gc(f);for(let k=b;k=0?window.pageYOffset:null,d=VY(t,e,l);return i.length&&i.forEach(([f,p])=>{e.getValue(f).set(p)}),e.syncRender(),il&&c!==null&&window.scrollTo({top:c}),{target:d,transitionEnd:r}}else return{target:t,transitionEnd:r}};function UY(e,t,n,r){return DY(t)?WY(e,t,n,r):{target:t,transitionEnd:r}}const HY=(e,t,n,r)=>{const o=NY(e,t,r);return t=o.target,r=o.transitionEnd,UY(e,t,n,r)};function jY(e){return window.getComputedStyle(e)}const nA={treeType:"dom",readValueFromInstance(e,t){if(Rf.has(t)){const n=zb(t);return n&&n.default||0}else{const n=jY(e),r=(VL(t)?n.getPropertyValue(t):n[t])||0;return typeof r=="string"?r.trim():r}},sortNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1},getBaseTarget(e,t){var n;return(n=e.style)===null||n===void 0?void 0:n[t]},measureViewportBox(e,{transformPagePoint:t}){return KP(e,t)},resetTransform(e,t,n){const{transformTemplate:r}=n;t.style.transform=r?r({},""):"none",e.scheduleRender()},restoreTransform(e,t){e.style.transform=t.style.transform},removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]},makeTargetAnimatable(e,{transition:t,transitionEnd:n,...r},{transformValues:o},i=!0){let a=Yq(r,t||{},e);if(o&&(n&&(n=o(n)),r&&(r=o(r)),a&&(a=o(a))),i){Kq(e,r,a);const l=HY(e,r,a,n);n=l.transitionEnd,r=l.target}return{transition:t,transitionEnd:n,...r}},scrapeMotionValuesFromProps:Pb,build(e,t,n,r,o){e.isVisible!==void 0&&(t.style.visibility=e.isVisible?"visible":"hidden"),kb(t,n,r,o.transformTemplate)},render:eP},GY=XP(nA),ZY=XP({...nA,getBaseTarget(e,t){return e[t]},readValueFromInstance(e,t){var n;return Rf.has(t)?((n=zb(t))===null||n===void 0?void 0:n.default)||0:(t=tP.has(t)?t:JL(t),e.getAttribute(t))},scrapeMotionValuesFromProps:rP,build(e,t,n,r,o){Lb(t,n,r,o.transformTemplate)},render:nP}),KY=(e,t)=>Cb(e)?ZY(t,{enableHardwareAcceleration:!1}):GY(t,{enableHardwareAcceleration:!0});function B8(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Zc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(De.test(e))e=parseFloat(e);else return e;const n=B8(e,t.target.x),r=B8(e,t.target.y);return`${n}% ${r}%`}},V8="_$css",qY={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=e.includes("var("),i=[];o&&(e=e.replace(JP,g=>(i.push(g),V8)));const a=na.parse(e);if(a.length>5)return r;const l=na.createTransformer(e),c=typeof a[0]!="number"?1:0,d=n.x.scale*t.x,f=n.y.scale*t.y;a[0+c]/=d,a[1+c]/=f;const p=Jt(d,f,.5);typeof a[2+c]=="number"&&(a[2+c]/=p),typeof a[3+c]=="number"&&(a[3+c]/=p);let m=l(a);if(o){let g=0;m=m.replace(V8,()=>{const y=i[g];return g++,y})}return m}};class YY extends Q.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;lZ(QY),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),yd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||hi.postRender(()=>{var l;!((l=a.getStack())===null||l===void 0)&&l.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n?.group&&n.group.remove(o),r?.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t?.()}render(){return null}}function XY(e){const[t,n]=Fb(),r=v.exports.useContext(Sb);return x(YY,{...e,layoutGroup:r,switchLayoutGroup:v.exports.useContext(zL),isPresent:t,safeToRemove:n})}const QY={borderRadius:{...Zc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zc,borderTopRightRadius:Zc,borderBottomLeftRadius:Zc,borderBottomRightRadius:Zc,boxShadow:qY},JY={measureLayout:XY};function eX(e,t,n={}){const r=bi(e)?e:Du(e);return Wb("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const rA=["TopLeft","TopRight","BottomLeft","BottomRight"],tX=rA.length,W8=e=>typeof e=="string"?parseFloat(e):e,U8=e=>typeof e=="number"||De.test(e);function nX(e,t,n,r,o,i){var a,l,c,d;o?(e.opacity=Jt(0,(a=n.opacity)!==null&&a!==void 0?a:1,rX(r)),e.opacityExit=Jt((l=t.opacity)!==null&&l!==void 0?l:1,0,oX(r))):i&&(e.opacity=Jt((c=t.opacity)!==null&&c!==void 0?c:1,(d=n.opacity)!==null&&d!==void 0?d:1,r));for(let f=0;frt?1:n(of(e,t,r))}function j8(e,t){e.min=t.min,e.max=t.max}function To(e,t){j8(e.x,t.x),j8(e.y,t.y)}function G8(e,t,n,r,o){return e-=t,e=L0(e,1/n,r),o!==void 0&&(e=L0(e,1/o,r)),e}function iX(e,t=0,n=1,r=.5,o,i=e,a=e){if(pi.test(t)&&(t=parseFloat(t),t=Jt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Jt(i.min,i.max,r);e===i&&(l-=t),e.min=G8(e.min,t,n,l,o),e.max=G8(e.max,t,n,l,o)}function Z8(e,t,[n,r,o],i,a){iX(e,t[n],t[r],t[o],t.scale,i,a)}const aX=["x","scaleX","originX"],sX=["y","scaleY","originY"];function K8(e,t,n,r){Z8(e.x,t,aX,n?.x,r?.x),Z8(e.y,t,sX,n?.y,r?.y)}function q8(e){return e.translate===0&&e.scale===1}function iA(e){return q8(e.x)&&q8(e.y)}function aA(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 Y8(e){return jr(e.x)/jr(e.y)}function lX(e,t,n=.01){return Db(e,t)<=n}class uX{constructor(){this.members=[]}add(t){Ub(this.members,t),t.scheduleRender()}remove(t){if(Hb(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(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,n&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues,t.snapshot.isShared=!0),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,o,i,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(o=t.resumingFrom)===null||o===void 0?void 0:(i=o.options).onExitComplete)===null||a===void 0||a.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const cX="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function X8(e,t,n){const r=e.x.translate/t.x,o=e.y.translate/t.y;let i=`translate3d(${r}px, ${o}px, 0) `;if(i+=`scale(${1/t.x}, ${1/t.y}) `,n){const{rotate:c,rotateX:d,rotateY:f}=n;c&&(i+=`rotate(${c}deg) `),d&&(i+=`rotateX(${d}deg) `),f&&(i+=`rotateY(${f}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return i+=`scale(${a}, ${l})`,i===cX?"none":i}const dX=(e,t)=>e.depth-t.depth;class fX{constructor(){this.children=[],this.isDirty=!1}add(t){Ub(this.children,t),this.isDirty=!0}remove(t){Hb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(dX),this.isDirty=!1,this.children.forEach(t)}}const Q8=["","X","Y","Z"],J8=1e3;function sA({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a,l={},c=t?.()){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!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.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(yX),this.nodes.forEach(bX)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=a,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let d=0;dthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,clearTimeout(m),m=window.setTimeout(g,250),yd.hasAnimatedSinceResize&&(yd.hasAnimatedSinceResize=!1,this.nodes.forEach(vX))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&p&&(d||f)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeTargetChanged:y,layout:b})=>{var k,C,S,_,E;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=(C=(k=this.options.transition)!==null&&k!==void 0?k:p.getDefaultTransition())!==null&&C!==void 0?C:_X,{onLayoutAnimationStart:R,onLayoutAnimationComplete:O}=p.getProps(),$=!this.targetLayout||!aA(this.targetLayout,b)||y,H=!g&&y;if(((S=this.resumeFrom)===null||S===void 0?void 0:S.instance)||H||g&&($||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,H);const z={...Vb(A,"layout"),onPlay:R,onComplete:O};p.shouldReduceMotion&&(z.delay=0,z.type=!1),this.startAnimation(z)}else!g&&this.animationProgress===0&&this.finishAnimation(),this.isLead()&&((E=(_=this.options).onExitComplete)===null||E===void 0||E.call(_));this.targetLayout=b})}unmount(){var a,l;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(l=this.parent)===null||l===void 0||l.children.delete(this),this.instance=void 0,lf.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(xX))}willUpdate(a=!0){var l,c,d;if(this.root.isUpdateBlocked()){(c=(l=this.options).onExitComplete)===null||c===void 0||c.call(l);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const a=this.measure(),l=this.removeTransform(this.removeElementScroll(a));o7(l),this.snapshot={measured:a,layout:l,latestValues:{}}}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d{var S;const _=C/1e3;t7(m.x,a.x,_),t7(m.y,a.y,_),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&((S=this.relativeParent)===null||S===void 0?void 0:S.layout)&&(Cd(g,this.layout.actual,this.relativeParent.layout.actual),SX(this.relativeTarget,this.relativeTargetOrigin,g,_)),y&&(this.animationValues=p,nX(p,f,this.latestValues,_,k,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(0)}startAnimation(a){var l,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)===null||l===void 0||l.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(lf.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=hi.update(()=>{yd.hasAnimatedSinceResize=!0,this.currentAnimation=eX(0,J8,{...a,onUpdate:d=>{var f;this.mixTargetDelta(d),(f=a.onUpdate)===null||f===void 0||f.call(a,d)},onComplete:()=>{var d;(d=a.onComplete)===null||d===void 0||d.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,J8),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:f}=a;if(!(!l||!c||!d)){if(this!==a&&this.layout&&d&&lA(this.options.animationType,this.layout.actual,d.actual)){c=this.target||On();const p=jr(this.layout.actual.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const m=jr(this.layout.actual.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}To(l,c),du(l,f),Sd(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(a,l){var c,d,f;this.sharedNodes.has(a)||this.sharedNodes.set(a,new uX),this.sharedNodes.get(a).add(l),l.promote({transition:(c=l.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(f=(d=l.options.initialPromotionConfig)===null||d===void 0?void 0:d.shouldPreserveFollowOpacity)===null||f===void 0?void 0:f.call(d,l)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const c={};for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(e7),this.root.sharedNodes.clear()}}}function pX(e){e.updateLayout()}function hX(e){var t,n,r;const o=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&o&&e.hasListeners("didUpdate")){const{actual:i,measured:a}=e.layout,{animationType:l}=e.options;l==="size"?ei(m=>{const g=o.isShared?o.measured[m]:o.layout[m],y=jr(g);g.min=i[m].min,g.max=g.min+y}):lA(l,o.layout,i)&&ei(m=>{const g=o.isShared?o.measured[m]:o.layout[m],y=jr(i[m]);g.max=g.min+y});const c=_d();Sd(c,i,o.layout);const d=_d();o.isShared?Sd(d,e.applyTransform(a,!0),o.measured):Sd(d,i,o.layout);const f=!iA(c);let p=!1;if(!e.resumeFrom&&(e.relativeParent=e.getClosestProjectingParent(),e.relativeParent&&!e.relativeParent.resumeFrom)){const{snapshot:m,layout:g}=e.relativeParent;if(m&&g){const y=On();Cd(y,o.layout,m.layout);const b=On();Cd(b,i,g.actual),aA(y,b)||(p=!0)}}e.notifyListeners("didUpdate",{layout:i,snapshot:o,delta:d,layoutDelta:c,hasLayoutChanged:f,hasRelativeTargetChanged:p})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function mX(e){e.clearSnapshot()}function e7(e){e.clearMeasurements()}function gX(e){const{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notifyBeforeLayoutMeasure(),e.resetTransform()}function vX(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function yX(e){e.resolveTargetDelta()}function bX(e){e.calcProjection()}function xX(e){e.resetRotation()}function wX(e){e.removeLeadSnapshot()}function t7(e,t,n){e.translate=Jt(t.translate,0,n),e.scale=Jt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function n7(e,t,n,r){e.min=Jt(t.min,n.min,r),e.max=Jt(t.max,n.max,r)}function SX(e,t,n,r){n7(e.x,t.x,n.x,r),n7(e.y,t.y,n.y,r)}function CX(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _X={duration:.45,ease:[.4,0,.1,1]};function kX(e,t){let n=e.root;for(let i=e.path.length-1;i>=0;i--)if(Boolean(e.path[i].instance)){n=e.path[i];break}const o=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);o&&e.mount(o,!0)}function r7(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function o7(e){r7(e.x),r7(e.y)}function lA(e,t,n){return e==="position"||e==="preserve-aspect"&&!lX(Y8(t),Y8(n))}const EX=sA({attachResizeListener:(e,t)=>Bm(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),G2={current:void 0},LX=sA({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!G2.current){const e=new EX(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),G2.current=e}return G2.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),PX={...sY,...vq,...PY,...JY},bo=aZ((e,t)=>jZ(e,t,PX,KY,LX));function uA(){const e=v.exports.useRef(!1);return g0(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function AX(){const e=uA(),[t,n]=v.exports.useState(0),r=v.exports.useCallback(()=>{e.current&&n(t+1)},[t]);return[v.exports.useCallback(()=>hi.postRender(r),[r]),t]}class TX extends v.exports.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 IX({children:e,isPresent:t}){const n=v.exports.useId(),r=v.exports.useRef(null),o=v.exports.useRef({width:0,height:0,top:0,left:0});return v.exports.useInsertionEffect(()=>{const{width:i,height:a,top:l,left:c}=o.current;if(t||!r.current||!i||!a)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${i}px !important; - height: ${a}px !important; - top: ${l}px !important; - left: ${c}px !important; - } - `),()=>{document.head.removeChild(d)}},[t]),x(TX,{isPresent:t,childRef:r,sizeRef:o,children:v.exports.cloneElement(e,{ref:r})})}const Z2=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a})=>{const l=zm(OX),c=v.exports.useId(),d=v.exports.useMemo(()=>({id:c,initial:t,isPresent:n,custom:o,onExitComplete:f=>{l.set(f,!0);for(const p of l.values())if(!p)return;r&&r()},register:f=>(l.set(f,!1),()=>l.delete(f))}),i?void 0:[n]);return v.exports.useMemo(()=>{l.forEach((f,p)=>l.set(p,!1))},[n]),v.exports.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=x(IX,{isPresent:n,children:e})),x(Qu.Provider,{value:d,children:e})};function OX(){return new Map}const Kl=e=>e.key||"";function RX(e,t){e.forEach(n=>{const r=Kl(n);t.set(r,n)})}function MX(e){const t=[];return v.exports.Children.forEach(e,n=>{v.exports.isValidElement(n)&&t.push(n)}),t}const da=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:a="sync"})=>{o&&(a="wait",NP(!1,"Replace exitBeforeEnter with mode='wait'"));let[l]=AX();const c=v.exports.useContext(Sb).forceRender;c&&(l=c);const d=uA(),f=MX(e);let p=f;const m=new Set,g=v.exports.useRef(p),y=v.exports.useRef(new Map).current,b=v.exports.useRef(!0);if(g0(()=>{b.current=!1,RX(f,y),g.current=p}),Tb(()=>{b.current=!0,y.clear(),m.clear()}),b.current)return x(wn,{children:p.map(_=>x(Z2,{isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:a,children:_},Kl(_)))});p=[...p];const k=g.current.map(Kl),C=f.map(Kl),S=k.length;for(let _=0;_{if(C.indexOf(_)!==-1)return;const E=y.get(_);if(!E)return;const A=k.indexOf(_),R=()=>{y.delete(_),m.delete(_);const O=g.current.findIndex($=>$.key===_);if(g.current.splice(O,1),!m.size){if(g.current=f,d.current===!1)return;l(),r&&r()}};p.splice(A,0,x(Z2,{isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:i,mode:a,children:E},Kl(E)))}),p=p.map(_=>{const E=_.key;return m.has(E)?_:x(Z2,{isPresent:!0,presenceAffectsLayout:i,mode:a,children:_},Kl(_))}),MP!=="production"&&a==="wait"&&p.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),x(wn,{children:m.size?p:p.map(_=>v.exports.cloneElement(_))})};var Ff=(...e)=>e.filter(Boolean).join(" ");function NX(){return!1}var $X=e=>{const{condition:t,message:n}=e;t&&NX()&&console.warn(n)},Vs={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Kc={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function s4(e){switch(e?.direction??"right"){case"right":return Kc.slideRight;case"left":return Kc.slideLeft;case"bottom":return Kc.slideDown;case"top":return Kc.slideUp;default:return Kc.slideRight}}var js={enter:{duration:.2,ease:Vs.easeOut},exit:{duration:.1,ease:Vs.easeIn}},Vo={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t?.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t?.exit})},DX=e=>e!=null&&parseInt(e.toString(),10)>0,i7={exit:{height:{duration:.2,ease:Vs.ease},opacity:{duration:.3,ease:Vs.ease}},enter:{height:{duration:.3,ease:Vs.ease},opacity:{duration:.4,ease:Vs.ease}}},FX={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>({...e&&{opacity:DX(t)?1:0},height:t,transitionEnd:r?.exit,transition:n?.exit??Vo.exit(i7.exit,o)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>({...e&&{opacity:1},height:t,transitionEnd:r?.enter,transition:n?.enter??Vo.enter(i7.enter,o)})},cA=v.exports.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:i=0,endingHeight:a="auto",style:l,className:c,transition:d,transitionEnd:f,...p}=e,[m,g]=v.exports.useState(!1);v.exports.useEffect(()=>{const S=setTimeout(()=>{g(!0)});return()=>clearTimeout(S)},[]),$X({condition:Boolean(i>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const y=parseFloat(i.toString())>0,b={startingHeight:i,endingHeight:a,animateOpacity:o,transition:m?d:{enter:{duration:0}},transitionEnd:{enter:f?.enter,exit:r?f?.exit:{...f?.exit,display:y?"block":"none"}}},k=r?n:!0,C=n||r?"enter":"exit";return x(da,{initial:!1,custom:b,children:k&&Q.createElement(bo.div,{ref:t,...p,className:Ff("chakra-collapse",c),style:{overflow:"hidden",display:"block",...l},custom:b,variants:FX,initial:r?"exit":!1,animate:C,exit:"exit"})})});cA.displayName="Collapse";var zX={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:e?.enter??Vo.enter(js.enter,n),transitionEnd:t?.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:e?.exit??Vo.exit(js.exit,n),transitionEnd:t?.exit})},dA={initial:"exit",animate:"enter",exit:"exit",variants:zX},BX=v.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:a,transitionEnd:l,delay:c,...d}=t,f=o||r?"enter":"exit",p=r?o&&r:!0,m={transition:a,transitionEnd:l,delay:c};return x(da,{custom:m,children:p&&Q.createElement(bo.div,{ref:n,className:Ff("chakra-fade",i),custom:m,...dA,animate:f,...d})})});BX.displayName="Fade";var VX={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>({opacity:0,...e?{scale:t,transitionEnd:r?.exit}:{transitionEnd:{scale:t,...r?.exit}},transition:n?.exit??Vo.exit(js.exit,o)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:t?.enter??Vo.enter(js.enter,n),transitionEnd:e?.enter})},fA={initial:"exit",animate:"enter",exit:"exit",variants:VX},WX=v.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:a=.95,className:l,transition:c,transitionEnd:d,delay:f,...p}=t,m=r?o&&r:!0,g=o||r?"enter":"exit",y={initialScale:a,reverse:i,transition:c,transitionEnd:d,delay:f};return x(da,{custom:y,children:m&&Q.createElement(bo.div,{ref:n,className:Ff("chakra-offset-slide",l),...fA,animate:g,custom:y,...p})})});WX.displayName="ScaleFade";var a7={exit:{duration:.15,ease:Vs.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},UX={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:o}=s4({direction:e});return{...o,transition:t?.exit??Vo.exit(a7.exit,r),transitionEnd:n?.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:o}=s4({direction:e});return{...o,transition:n?.enter??Vo.enter(a7.enter,r),transitionEnd:t?.enter}}},pA=v.exports.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:i,in:a,className:l,transition:c,transitionEnd:d,delay:f,...p}=t,m=s4({direction:r}),g=Object.assign({position:"fixed"},m.position,o),y=i?a&&i:!0,b=a||i?"enter":"exit",k={transitionEnd:d,transition:c,direction:r,delay:f};return x(da,{custom:k,children:y&&Q.createElement(bo.div,{...p,ref:n,initial:"exit",className:Ff("chakra-slide",l),animate:b,exit:"exit",custom:k,variants:UX,style:g})})});pA.displayName="Slide";var HX={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>({opacity:0,x:e,y:t,transition:n?.exit??Vo.exit(js.exit,o),transitionEnd:r?.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:e?.enter??Vo.enter(js.enter,n),transitionEnd:t?.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{const a={x:t,y:e};return{opacity:0,transition:n?.exit??Vo.exit(js.exit,i),...o?{...a,transitionEnd:r?.exit}:{transitionEnd:{...a,...r?.exit}}}}},l4={initial:"initial",animate:"enter",exit:"exit",variants:HX},jX=v.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:a,offsetX:l=0,offsetY:c=8,transition:d,transitionEnd:f,delay:p,...m}=t,g=r?o&&r:!0,y=o||r?"enter":"exit",b={offsetX:l,offsetY:c,reverse:i,transition:d,transitionEnd:f,delay:p};return x(da,{custom:b,children:g&&Q.createElement(bo.div,{ref:n,className:Ff("chakra-offset-slide",a),custom:b,...l4,animate:y,...m})})});jX.displayName="SlideFade";var zf=(...e)=>e.filter(Boolean).join(" ");function GX(){return!1}var Zm=e=>{const{condition:t,message:n}=e;t&&GX()&&console.warn(n)};function K2(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var[ZX,Km]=Rt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[KX,Gb]=Rt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[qX,U2e,YX,XX]=NL(),hA=fe(function(t,n){const{getButtonProps:r}=Gb(),o=r(t,n),i=Km(),a={display:"flex",alignItems:"center",width:"100%",outline:0,...i.button};return Q.createElement(ie.button,{...o,className:zf("chakra-accordion__button",t.className),__css:a})});hA.displayName="AccordionButton";function QX(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:i,...a}=e;tQ(e),nQ(e);const l=YX(),[c,d]=v.exports.useState(-1);v.exports.useEffect(()=>()=>{d(-1)},[]);const[f,p]=$L({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:f,setIndex:p,htmlProps:a,getAccordionItemProps:g=>{let y=!1;return g!==null&&(y=Array.isArray(f)?f.includes(g):f===g),{isOpen:y,onChange:k=>{if(g!==null)if(o&&Array.isArray(f)){const C=k?f.concat(g):f.filter(S=>S!==g);p(C)}else k?p(g):i&&p(-1)}}},focusedIndex:c,setFocusedIndex:d,descendants:l}}var[JX,Zb]=Rt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function eQ(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:i,setFocusedIndex:a}=Zb(),l=v.exports.useRef(null),c=v.exports.useId(),d=r??c,f=`accordion-button-${d}`,p=`accordion-panel-${d}`;rQ(e);const{register:m,index:g,descendants:y}=XX({disabled:t&&!n}),{isOpen:b,onChange:k}=i(g===-1?null:g);oQ({isOpen:b,isDisabled:t});const C=()=>{k?.(!0)},S=()=>{k?.(!1)},_=v.exports.useCallback(()=>{k?.(!b),a(g)},[g,a,b,k]),E=v.exports.useCallback($=>{const z={ArrowDown:()=>{const X=y.nextEnabled(g);X?.node.focus()},ArrowUp:()=>{const X=y.prevEnabled(g);X?.node.focus()},Home:()=>{const X=y.firstEnabled();X?.node.focus()},End:()=>{const X=y.lastEnabled();X?.node.focus()}}[$.key];z&&($.preventDefault(),z($))},[y,g]),A=v.exports.useCallback(()=>{a(g)},[a,g]),R=v.exports.useCallback(function(H={},z=null){return{...H,type:"button",ref:Qt(m,l,z),id:f,disabled:!!t,"aria-expanded":!!b,"aria-controls":p,onClick:K2(H.onClick,_),onFocus:K2(H.onFocus,A),onKeyDown:K2(H.onKeyDown,E)}},[f,t,b,_,A,E,p,m]),O=v.exports.useCallback(function(H={},z=null){return{...H,ref:z,role:"region",id:p,"aria-labelledby":f,hidden:!b}},[f,b,p]);return{isOpen:b,isDisabled:t,isFocusable:n,onOpen:C,onClose:S,getButtonProps:R,getPanelProps:O,htmlProps:o}}function tQ(e){const t=e.index||e.defaultIndex,n=t==null&&!Array.isArray(t)&&e.allowMultiple;Zm({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function nQ(e){Zm({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 rQ(e){Zm({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 oQ(e){Zm({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function mA(e){const{isOpen:t,isDisabled:n}=Gb(),{reduceMotion:r}=Zb(),o=zf("chakra-accordion__icon",e.className),i=Km(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...i.icon};return x(Yr,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:a,...e,children:x("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}mA.displayName="AccordionIcon";var gA=fe(function(t,n){const{children:r,className:o}=t,{htmlProps:i,...a}=eQ(t),c={...Km().container,overflowAnchor:"none"},d=v.exports.useMemo(()=>a,[a]);return Q.createElement(KX,{value:d},Q.createElement(ie.div,{ref:n,...i,className:zf("chakra-accordion__item",o),__css:c},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});gA.displayName="AccordionItem";var vA=fe(function(t,n){const{reduceMotion:r}=Zb(),{getPanelProps:o,isOpen:i}=Gb(),a=o(t,n),l=zf("chakra-accordion__panel",t.className),c=Km();r||delete a.hidden;const d=Q.createElement(ie.div,{...a,__css:c.panel,className:l});return r?d:x(cA,{in:i,children:d})});vA.displayName="AccordionPanel";var yA=fe(function({children:t,reduceMotion:n,...r},o){const i=dr("Accordion",r),a=yt(r),{htmlProps:l,descendants:c,...d}=QX(a),f=v.exports.useMemo(()=>({...d,reduceMotion:!!n}),[d,n]);return Q.createElement(qX,{value:c},Q.createElement(JX,{value:f},Q.createElement(ZX,{value:i},Q.createElement(ie.div,{ref:o,...l,className:zf("chakra-accordion",r.className),__css:i.root},t))))});yA.displayName="Accordion";var iQ=(...e)=>e.filter(Boolean).join(" "),aQ=Tf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),qm=fe((e,t)=>{const n=cr("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:a="transparent",className:l,...c}=yt(e),d=iQ("chakra-spinner",l),f={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:a,borderLeftColor:a,animation:`${aQ} ${i} linear infinite`,...n};return Q.createElement(ie.div,{ref:t,__css:f,className:d,...c},r&&Q.createElement(ie.span,{srOnly:!0},r))});qm.displayName="Spinner";var Ym=(...e)=>e.filter(Boolean).join(" ");function sQ(e){return x(Yr,{viewBox:"0 0 24 24",...e,children:x("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 lQ(e){return x(Yr,{viewBox:"0 0 24 24",...e,children:x("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 s7(e){return x(Yr,{viewBox:"0 0 24 24",...e,children:x("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[uQ,cQ]=Rt({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[dQ,Kb]=Rt({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),bA={info:{icon:lQ,colorScheme:"blue"},warning:{icon:s7,colorScheme:"orange"},success:{icon:sQ,colorScheme:"green"},error:{icon:s7,colorScheme:"red"},loading:{icon:qm,colorScheme:"blue"}};function fQ(e){return bA[e].colorScheme}function pQ(e){return bA[e].icon}var xA=fe(function(t,n){const{status:r="info",addRole:o=!0,...i}=yt(t),a=t.colorScheme??fQ(r),l=dr("Alert",{...t,colorScheme:a}),c={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return Q.createElement(uQ,{value:{status:r}},Q.createElement(dQ,{value:l},Q.createElement(ie.div,{role:o?"alert":void 0,ref:n,...i,className:Ym("chakra-alert",t.className),__css:c})))});xA.displayName="Alert";var wA=fe(function(t,n){const r=Kb(),o={display:"inline",...r.description};return Q.createElement(ie.div,{ref:n,...t,className:Ym("chakra-alert__desc",t.className),__css:o})});wA.displayName="AlertDescription";function SA(e){const{status:t}=cQ(),n=pQ(t),r=Kb(),o=t==="loading"?r.spinner:r.icon;return Q.createElement(ie.span,{display:"inherit",...e,className:Ym("chakra-alert__icon",e.className),__css:o},e.children||x(n,{h:"100%",w:"100%"}))}SA.displayName="AlertIcon";var CA=fe(function(t,n){const r=Kb();return Q.createElement(ie.div,{ref:n,...t,className:Ym("chakra-alert__title",t.className),__css:r.title})});CA.displayName="AlertTitle";function hQ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function mQ(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:i,crossOrigin:a,sizes:l,ignoreFallback:c}=e,[d,f]=v.exports.useState("pending");v.exports.useEffect(()=>{f(n?"loading":"pending")},[n]);const p=v.exports.useRef(),m=v.exports.useCallback(()=>{if(!n)return;g();const y=new Image;y.src=n,a&&(y.crossOrigin=a),r&&(y.srcset=r),l&&(y.sizes=l),t&&(y.loading=t),y.onload=b=>{g(),f("loaded"),o?.(b)},y.onerror=b=>{g(),f("failed"),i?.(b)},p.current=y},[n,a,r,l,o,i,t]),g=()=>{p.current&&(p.current.onload=null,p.current.onerror=null,p.current=null)};return di(()=>{if(!c)return d==="loading"&&m(),()=>{g()}},[d,m,c]),c?"loaded":d}var gQ=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",P0=fe(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:i,...a}=t;return x("img",{width:r,height:o,ref:n,alt:i,...a})});P0.displayName="NativeImage";var Xm=fe(function(t,n){const{fallbackSrc:r,fallback:o,src:i,srcSet:a,align:l,fit:c,loading:d,ignoreFallback:f,crossOrigin:p,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:g,...y}=t,b=r!==void 0||o!==void 0,k=d!=null||f||!b,C=mQ({...t,ignoreFallback:k}),S=gQ(C,m),_={ref:n,objectFit:c,objectPosition:l,...k?y:hQ(y,["onError","onLoad"])};return S?o||Q.createElement(ie.img,{as:P0,className:"chakra-image__placeholder",src:r,..._}):Q.createElement(ie.img,{as:P0,src:i,srcSet:a,crossOrigin:p,loading:d,referrerPolicy:g,className:"chakra-image",..._})});Xm.displayName="Image";fe((e,t)=>Q.createElement(ie.img,{ref:t,as:P0,className:"chakra-image",...e}));var vQ=Object.create,_A=Object.defineProperty,yQ=Object.getOwnPropertyDescriptor,kA=Object.getOwnPropertyNames,bQ=Object.getPrototypeOf,xQ=Object.prototype.hasOwnProperty,EA=(e,t)=>function(){return t||(0,e[kA(e)[0]])((t={exports:{}}).exports,t),t.exports},wQ=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of kA(t))!xQ.call(e,o)&&o!==n&&_A(e,o,{get:()=>t[o],enumerable:!(r=yQ(t,o))||r.enumerable});return e},SQ=(e,t,n)=>(n=e!=null?vQ(bQ(e)):{},wQ(t||!e||!e.__esModule?_A(n,"default",{value:e,enumerable:!0}):n,e)),CQ=EA({"../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js"(e){var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function g(M){return M===null||typeof M!="object"?null:(M=m&&M[m]||M["@@iterator"],typeof M=="function"?M:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,k={};function C(M,G,le){this.props=M,this.context=G,this.refs=k,this.updater=le||y}C.prototype.isReactComponent={},C.prototype.setState=function(M,G){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,G,"setState")},C.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=C.prototype;function _(M,G,le){this.props=M,this.context=G,this.refs=k,this.updater=le||y}var E=_.prototype=new S;E.constructor=_,b(E,C.prototype),E.isPureReactComponent=!0;var A=Array.isArray,R=Object.prototype.hasOwnProperty,O={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function H(M,G,le){var ce,be={},me=null,_e=null;if(G!=null)for(ce in G.ref!==void 0&&(_e=G.ref),G.key!==void 0&&(me=""+G.key),G)R.call(G,ce)&&!$.hasOwnProperty(ce)&&(be[ce]=G[ce]);var ue=arguments.length-2;if(ue===1)be.children=le;else if(1(0,l7.isValidElement)(t))}/** - * @license React - * react.development.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. - *//** - * @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 Jm=(...e)=>e.filter(Boolean).join(" "),u7=e=>e?"":void 0,[kQ,EQ]=Rt({strict:!1,name:"ButtonGroupContext"});function u4(e){const{children:t,className:n,...r}=e,o=v.exports.isValidElement(t)?v.exports.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=Jm("chakra-button__icon",n);return Q.createElement(ie.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i},o)}u4.displayName="ButtonIcon";function c4(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=x(qm,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:a,...l}=e,c=Jm("chakra-button__spinner",i),d=n==="start"?"marginEnd":"marginStart",f=v.exports.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[d]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,d,r]);return Q.createElement(ie.div,{className:c,...l,__css:f},o)}c4.displayName="ButtonSpinner";function LQ(e){const[t,n]=v.exports.useState(!e);return{ref:v.exports.useCallback(i=>{!i||n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}var xi=fe((e,t)=>{const n=EQ(),r=cr("Button",{...n,...e}),{isDisabled:o=n?.isDisabled,isLoading:i,isActive:a,children:l,leftIcon:c,rightIcon:d,loadingText:f,iconSpacing:p="0.5rem",type:m,spinner:g,spinnerPlacement:y="start",className:b,as:k,...C}=yt(e),S=v.exports.useMemo(()=>{const R={...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:R}}},[r,n]),{ref:_,type:E}=LQ(k),A={rightIcon:d,leftIcon:c,iconSpacing:p,children:l};return Q.createElement(ie.button,{disabled:o||i,ref:VG(t,_),as:k,type:m??E,"data-active":u7(a),"data-loading":u7(i),__css:S,className:Jm("chakra-button",b),...C},i&&y==="start"&&x(c4,{className:"chakra-button__spinner--start",label:f,placement:"start",spacing:p,children:g}),i?f||Q.createElement(ie.span,{opacity:0},x(c7,{...A})):x(c7,{...A}),i&&y==="end"&&x(c4,{className:"chakra-button__spinner--end",label:f,placement:"end",spacing:p,children:g}))});xi.displayName="Button";function c7(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return Y(wn,{children:[t&&x(u4,{marginEnd:o,children:t}),r,n&&x(u4,{marginStart:o,children:n})]})}var PQ=fe(function(t,n){const{size:r,colorScheme:o,variant:i,className:a,spacing:l="0.5rem",isAttached:c,isDisabled:d,...f}=t,p=Jm("chakra-button__group",a),m=v.exports.useMemo(()=>({size:r,colorScheme:o,variant:i,isDisabled:d}),[r,o,i,d]);let g={display:"inline-flex"};return c?g={...g,"> *: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}}:g={...g,"& > *:not(style) ~ *:not(style)":{marginStart:l}},Q.createElement(kQ,{value:m},Q.createElement(ie.div,{ref:n,role:"group",__css:g,className:p,"data-attached":c?"":void 0,...f}))});PQ.displayName="ButtonGroup";var Nn=fe((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...a}=e,l=n||r,c=v.exports.isValidElement(l)?v.exports.cloneElement(l,{"aria-hidden":!0,focusable:!1}):null;return x(xi,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...a,children:c})});Nn.displayName="IconButton";var tc=(...e)=>e.filter(Boolean).join(" "),Nh=e=>e?"":void 0,q2=e=>e?!0:void 0;function d7(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var[AQ,LA]=Rt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[TQ,nc]=Rt({strict:!1,name:"FormControlContext"});function IQ(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...a}=e,l=v.exports.useId(),c=t||`field-${l}`,d=`${c}-label`,f=`${c}-feedback`,p=`${c}-helptext`,[m,g]=v.exports.useState(!1),[y,b]=v.exports.useState(!1),[k,C]=v.exports.useState(!1),S=v.exports.useCallback((O={},$=null)=>({id:p,...O,ref:Qt($,H=>{!H||b(!0)})}),[p]),_=v.exports.useCallback((O={},$=null)=>({...O,ref:$,"data-focus":Nh(k),"data-disabled":Nh(o),"data-invalid":Nh(r),"data-readonly":Nh(i),id:O.id??d,htmlFor:O.htmlFor??c}),[c,o,k,r,i,d]),E=v.exports.useCallback((O={},$=null)=>({id:f,...O,ref:Qt($,H=>{!H||g(!0)}),"aria-live":"polite"}),[f]),A=v.exports.useCallback((O={},$=null)=>({...O,...a,ref:$,role:"group"}),[a]),R=v.exports.useCallback((O={},$=null)=>({...O,ref:$,role:"presentation","aria-hidden":!0,children:O.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!k,onFocus:()=>C(!0),onBlur:()=>C(!1),hasFeedbackText:m,setHasFeedbackText:g,hasHelpText:y,setHasHelpText:b,id:c,labelId:d,feedbackId:f,helpTextId:p,htmlProps:a,getHelpTextProps:S,getErrorMessageProps:E,getRootProps:A,getLabelProps:_,getRequiredIndicatorProps:R}}var hs=fe(function(t,n){const r=dr("Form",t),o=yt(t),{getRootProps:i,htmlProps:a,...l}=IQ(o),c=tc("chakra-form-control",t.className);return Q.createElement(TQ,{value:l},Q.createElement(AQ,{value:r},Q.createElement(ie.div,{...i({},n),className:c,__css:r.container})))});hs.displayName="FormControl";var OQ=fe(function(t,n){const r=nc(),o=LA(),i=tc("chakra-form__helper-text",t.className);return Q.createElement(ie.div,{...r?.getHelpTextProps(t,n),__css:o.helperText,className:i})});OQ.displayName="FormHelperText";function qb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=Yb(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":q2(n),"aria-required":q2(o),"aria-readonly":q2(r)}}function Yb(e){const t=nc(),{id:n,disabled:r,readOnly:o,required:i,isRequired:a,isInvalid:l,isReadOnly:c,isDisabled:d,onFocus:f,onBlur:p,...m}=e,g=e["aria-describedby"]?[e["aria-describedby"]]:[];return t?.hasFeedbackText&&t?.isInvalid&&g.push(t.feedbackId),t?.hasHelpText&&g.push(t.helpTextId),{...m,"aria-describedby":g.join(" ")||void 0,id:n??t?.id,isDisabled:r??d??t?.isDisabled,isReadOnly:o??c??t?.isReadOnly,isRequired:i??a??t?.isRequired,isInvalid:l??t?.isInvalid,onFocus:d7(t?.onFocus,f),onBlur:d7(t?.onBlur,p)}}var[RQ,MQ]=Rt({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),NQ=fe((e,t)=>{const n=dr("FormError",e),r=yt(e),o=nc();return o?.isInvalid?Q.createElement(RQ,{value:n},Q.createElement(ie.div,{...o?.getErrorMessageProps(r,t),className:tc("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});NQ.displayName="FormErrorMessage";var $Q=fe((e,t)=>{const n=MQ(),r=nc();if(!r?.isInvalid)return null;const o=tc("chakra-form__error-icon",e.className);return x(Yr,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:x("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"})})});$Q.displayName="FormErrorIcon";var sl=fe(function(t,n){const r=cr("FormLabel",t),o=yt(t),{className:i,children:a,requiredIndicator:l=x(PA,{}),optionalIndicator:c=null,...d}=o,f=nc(),p=f?.getLabelProps(d,n)??{ref:n,...d};return Q.createElement(ie.label,{...p,className:tc("chakra-form__label",o.className),__css:{display:"block",textAlign:"start",...r}},a,f?.isRequired?l:c)});sl.displayName="FormLabel";var PA=fe(function(t,n){const r=nc(),o=LA();if(!r?.isRequired)return null;const i=tc("chakra-form__required-indicator",t.className);return Q.createElement(ie.span,{...r?.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:i})});PA.displayName="RequiredIndicator";function A0(e,t){const n=v.exports.useRef(!1),r=v.exports.useRef(!1);v.exports.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),v.exports.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var Xb={border:"0px",clip:"rect(0px, 0px, 0px, 0px)",height:"1px",width:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},DQ=ie("span",{baseStyle:Xb});DQ.displayName="VisuallyHidden";var FQ=ie("input",{baseStyle:Xb});FQ.displayName="VisuallyHiddenInput";var f7=!1,eg=null,Fu=!1,d4=new Set,zQ=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function BQ(e){return!(e.metaKey||!zQ&&e.altKey||e.ctrlKey)}function Qb(e,t){d4.forEach(n=>n(e,t))}function p7(e){Fu=!0,BQ(e)&&(eg="keyboard",Qb("keyboard",e))}function Fl(e){eg="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Fu=!0,Qb("pointer",e))}function VQ(e){e.target===window||e.target===document||(Fu||(eg="keyboard",Qb("keyboard",e)),Fu=!1)}function WQ(){Fu=!1}function h7(){return eg!=="pointer"}function UQ(){if(typeof window>"u"||f7)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Fu=!0,e.apply(this,n)},document.addEventListener("keydown",p7,!0),document.addEventListener("keyup",p7,!0),window.addEventListener("focus",VQ,!0),window.addEventListener("blur",WQ,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Fl,!0),document.addEventListener("pointermove",Fl,!0),document.addEventListener("pointerup",Fl,!0)):(document.addEventListener("mousedown",Fl,!0),document.addEventListener("mousemove",Fl,!0),document.addEventListener("mouseup",Fl,!0)),f7=!0}function HQ(e){UQ(),e(h7());const t=()=>e(h7());return d4.add(t),()=>{d4.delete(t)}}var[H2e,jQ]=Rt({name:"CheckboxGroupContext",strict:!1}),GQ=(...e)=>e.filter(Boolean).join(" "),nr=e=>e?"":void 0;function io(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function ZQ(...e){return function(n){e.forEach(r=>{r?.(n)})}}function KQ(e){const t=bo;return"custom"in t&&typeof t.custom=="function"?t.custom(e):t(e)}var AA=KQ(ie.svg);function qQ(e){return x(AA,{width:"1.2em",viewBox:"0 0 12 10",variants:{unchecked:{opacity:0,strokeDashoffset:16},checked:{opacity:1,strokeDashoffset:0,transition:{duration:.2}}},style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:x("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function YQ(e){return x(AA,{width:"1.2em",viewBox:"0 0 24 24",variants:{unchecked:{scaleX:.65,opacity:0},checked:{scaleX:1,opacity:1,transition:{scaleX:{duration:0},opacity:{duration:.02}}}},style:{stroke:"currentColor",strokeWidth:4},...e,children:x("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function XQ({open:e,children:t}){return x(da,{initial:!1,children:e&&Q.createElement(bo.div,{variants:{unchecked:{scale:.5},checked:{scale:1}},initial:"unchecked",animate:"checked",exit:"unchecked",style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},t)})}function QQ(e){const{isIndeterminate:t,isChecked:n,...r}=e;return x(XQ,{open:n||t,children:x(t?YQ:qQ,{...r})})}function JQ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function TA(e={}){const t=Yb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:i,id:a,onBlur:l,onFocus:c,"aria-describedby":d}=t,{defaultChecked:f,isChecked:p,isFocusable:m,onChange:g,isIndeterminate:y,name:b,value:k,tabIndex:C=void 0,"aria-label":S,"aria-labelledby":_,"aria-invalid":E,...A}=e,R=JQ(A,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),O=Zn(g),$=Zn(l),H=Zn(c),[z,X]=v.exports.useState(!1),[he,ye]=v.exports.useState(!1),[oe,pe]=v.exports.useState(!1),[ge,J]=v.exports.useState(!1);v.exports.useEffect(()=>HQ(X),[]);const D=v.exports.useRef(null),[Z,j]=v.exports.useState(!0),[M,G]=v.exports.useState(!!f),le=p!==void 0,ce=le?p:M,be=v.exports.useCallback(Se=>{if(r||n){Se.preventDefault();return}le||G(ce?Se.target.checked:y?!0:Se.target.checked),O?.(Se)},[r,n,ce,le,y,O]);di(()=>{D.current&&(D.current.indeterminate=Boolean(y))},[y]),A0(()=>{n&&ye(!1)},[n,ye]),di(()=>{const Se=D.current;!Se?.form||(Se.form.onreset=()=>{G(!!f)})},[]);const me=n&&!m,_e=v.exports.useCallback(Se=>{Se.key===" "&&J(!0)},[J]),ue=v.exports.useCallback(Se=>{Se.key===" "&&J(!1)},[J]);di(()=>{if(!D.current)return;D.current.checked!==ce&&G(D.current.checked)},[D.current]);const we=v.exports.useCallback((Se={},Ie=null)=>{const Qe=Oe=>{he&&Oe.preventDefault(),J(!0)};return{...Se,ref:Ie,"data-active":nr(ge),"data-hover":nr(oe),"data-checked":nr(ce),"data-focus":nr(he),"data-focus-visible":nr(he&&z),"data-indeterminate":nr(y),"data-disabled":nr(n),"data-invalid":nr(i),"data-readonly":nr(r),"aria-hidden":!0,onMouseDown:io(Se.onMouseDown,Qe),onMouseUp:io(Se.onMouseUp,()=>J(!1)),onMouseEnter:io(Se.onMouseEnter,()=>pe(!0)),onMouseLeave:io(Se.onMouseLeave,()=>pe(!1))}},[ge,ce,n,he,z,oe,y,i,r]),$e=v.exports.useCallback((Se={},Ie=null)=>({...R,...Se,ref:Qt(Ie,Qe=>{!Qe||j(Qe.tagName==="LABEL")}),onClick:io(Se.onClick,()=>{var Qe;Z||((Qe=D.current)==null||Qe.click(),requestAnimationFrame(()=>{var Oe;(Oe=D.current)==null||Oe.focus()}))}),"data-disabled":nr(n),"data-checked":nr(ce),"data-invalid":nr(i)}),[R,n,ce,i,Z]),rt=v.exports.useCallback((Se={},Ie=null)=>({...Se,ref:Qt(D,Ie),type:"checkbox",name:b,value:k,id:a,tabIndex:C,onChange:io(Se.onChange,be),onBlur:io(Se.onBlur,$,()=>ye(!1)),onFocus:io(Se.onFocus,H,()=>ye(!0)),onKeyDown:io(Se.onKeyDown,_e),onKeyUp:io(Se.onKeyUp,ue),required:o,checked:ce,disabled:me,readOnly:r,"aria-label":S,"aria-labelledby":_,"aria-invalid":E?Boolean(E):i,"aria-describedby":d,"aria-disabled":n,style:Xb}),[b,k,a,be,$,H,_e,ue,o,ce,me,r,S,_,E,i,d,n,C]),Ct=v.exports.useCallback((Se={},Ie=null)=>({...Se,ref:Ie,onMouseDown:io(Se.onMouseDown,m7),onTouchStart:io(Se.onTouchStart,m7),"data-disabled":nr(n),"data-checked":nr(ce),"data-invalid":nr(i)}),[ce,n,i]);return{state:{isInvalid:i,isFocused:he,isChecked:ce,isActive:ge,isHovered:oe,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:$e,getCheckboxProps:we,getInputProps:rt,getLabelProps:Ct,htmlProps:R}}function m7(e){e.preventDefault(),e.stopPropagation()}var eJ=ie("span",{baseStyle:{display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0}}),tJ=ie("label",{baseStyle:{cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"}}),nJ=fe(function(t,n){const r=jQ(),o={...r,...t},i=dr("Checkbox",o),a=yt(t),{spacing:l="0.5rem",className:c,children:d,iconColor:f,iconSize:p,icon:m=x(QQ,{}),isChecked:g,isDisabled:y=r?.isDisabled,onChange:b,inputProps:k,...C}=a;let S=g;r?.value&&a.value&&(S=r.value.includes(a.value));let _=b;r?.onChange&&a.value&&(_=ZQ(r.onChange,b));const{state:E,getInputProps:A,getCheckboxProps:R,getLabelProps:O,getRootProps:$}=TA({...C,isDisabled:y,isChecked:S,onChange:_}),H=v.exports.useMemo(()=>({opacity:E.isChecked||E.isIndeterminate?1:0,transform:E.isChecked||E.isIndeterminate?"scale(1)":"scale(0.95)",fontSize:p,color:f,...i.icon}),[f,p,E.isChecked,E.isIndeterminate,i.icon]),z=v.exports.cloneElement(m,{__css:H,isIndeterminate:E.isIndeterminate,isChecked:E.isChecked});return Y(tJ,{__css:i.container,className:GQ("chakra-checkbox",c),...$(),children:[x("input",{className:"chakra-checkbox__input",...A(k,n)}),x(eJ,{__css:i.control,className:"chakra-checkbox__control",...R(),children:z}),d&&Q.createElement(ie.span,{className:"chakra-checkbox__label",...O(),__css:{marginStart:l,...i.label}},d)]})});nJ.displayName="Checkbox";function rJ(e){return x(Yr,{focusable:"false","aria-hidden":!0,...e,children:x("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 tg=fe(function(t,n){const r=cr("CloseButton",t),{children:o,isDisabled:i,__css:a,...l}=yt(t),c={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return Q.createElement(ie.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...c,...r,...a},...l},o||x(rJ,{width:"1em",height:"1em"}))});tg.displayName="CloseButton";function oJ(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function IA(e,t){let n=oJ(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function g7(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 iJ(e,t,n){return e==null?e:(nr==null?"":Y2(r,i,n)??""),m=typeof o<"u",g=m?o:f,y=OA(Ia(g),i),b=n??y,k=v.exports.useCallback(z=>{z!==g&&(m||p(z.toString()),d?.(z.toString(),Ia(z)))},[d,m,g]),C=v.exports.useCallback(z=>{let X=z;return c&&(X=iJ(X,a,l)),IA(X,b)},[b,c,l,a]),S=v.exports.useCallback((z=i)=>{let X;g===""?X=Ia(z):X=Ia(g)+z,X=C(X),k(X)},[C,i,k,g]),_=v.exports.useCallback((z=i)=>{let X;g===""?X=Ia(-z):X=Ia(g)-z,X=C(X),k(X)},[C,i,k,g]),E=v.exports.useCallback(()=>{let z;r==null?z="":z=Y2(r,i,n)??a,k(z)},[r,n,i,k,a]),A=v.exports.useCallback(z=>{const X=Y2(z,i,b)??a;k(X)},[b,i,k,a]),R=Ia(g);return{isOutOfRange:R>l||Rx(Rm,{styles:RA}),lJ=()=>x(Rm,{styles:` - html { - line-height: 1.5; - -webkit-text-size-adjust: 100%; - font-family: system-ui, sans-serif; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - touch-action: manipulation; - } - - body { - position: relative; - min-height: 100%; - font-feature-settings: 'kern'; - } - - *, - *::before, - *::after { - border-width: 0; - border-style: solid; - box-sizing: border-box; - } - - main { - display: block; - } - - hr { - border-top-width: 1px; - box-sizing: content-box; - height: 0; - overflow: visible; - } - - pre, - code, - kbd, - samp { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; - font-size: 1em; - } - - a { - background-color: transparent; - color: inherit; - text-decoration: inherit; - } - - abbr[title] { - border-bottom: none; - text-decoration: underline; - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - } - - b, - strong { - font-weight: bold; - } - - small { - font-size: 80%; - } - - sub, - sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - } - - sub { - bottom: -0.25em; - } - - sup { - top: -0.5em; - } - - img { - border-style: none; - } - - button, - input, - optgroup, - select, - textarea { - font-family: inherit; - font-size: 100%; - line-height: 1.15; - margin: 0; - } - - button, - input { - overflow: visible; - } - - button, - select { - text-transform: none; - } - - button::-moz-focus-inner, - [type="button"]::-moz-focus-inner, - [type="reset"]::-moz-focus-inner, - [type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; - } - - fieldset { - padding: 0.35em 0.75em 0.625em; - } - - legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal; - } - - progress { - vertical-align: baseline; - } - - textarea { - overflow: auto; - } - - [type="checkbox"], - [type="radio"] { - box-sizing: border-box; - padding: 0; - } - - [type="number"]::-webkit-inner-spin-button, - [type="number"]::-webkit-outer-spin-button { - -webkit-appearance: none !important; - } - - input[type="number"] { - -moz-appearance: textfield; - } - - [type="search"] { - -webkit-appearance: textfield; - outline-offset: -2px; - } - - [type="search"]::-webkit-search-decoration { - -webkit-appearance: none !important; - } - - ::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; - } - - details { - display: block; - } - - summary { - display: list-item; - } - - template { - display: none; - } - - [hidden] { - display: none !important; - } - - body, - blockquote, - dl, - dd, - h1, - h2, - h3, - h4, - h5, - h6, - hr, - figure, - p, - pre { - margin: 0; - } - - button { - background: transparent; - padding: 0; - } - - fieldset { - margin: 0; - padding: 0; - } - - ol, - ul { - margin: 0; - padding: 0; - } - - textarea { - resize: vertical; - } - - button, - [role="button"] { - cursor: pointer; - } - - button::-moz-focus-inner { - border: 0 !important; - } - - table { - border-collapse: collapse; - } - - h1, - h2, - h3, - h4, - h5, - h6 { - font-size: inherit; - font-weight: inherit; - } - - button, - input, - optgroup, - select, - textarea { - padding: 0; - line-height: inherit; - color: inherit; - } - - img, - svg, - video, - canvas, - audio, - iframe, - embed, - object { - display: block; - } - - img, - video { - max-width: 100%; - height: auto; - } - - [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) { - outline: none; - box-shadow: none; - } - - select::-ms-expand { - display: none; - } - - ${RA} - `});function f4(e,t,n,r){const o=Zn(n);return v.exports.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i?.removeEventListener(t,o,r)}}var uJ=Of?v.exports.useLayoutEffect:v.exports.useEffect;function p4(e,t=[]){const n=v.exports.useRef(e);return uJ(()=>{n.current=e}),v.exports.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function Jb(e,t,n,r){const o=p4(t);return v.exports.useEffect(()=>{const i=p0(n)??document;if(!!t)return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{(p0(n)??document).removeEventListener(e,o,r)}}function cJ(e){const{isOpen:t,ref:n}=e,[r,o]=v.exports.useState(t),[i,a]=v.exports.useState(!1);return v.exports.useEffect(()=>{i||(o(t),a(!0))},[t,i,r]),Jb("animationend",()=>{o(t)},()=>n.current),{present:!(t?!1:!r),onComplete(){var c;const d=Mj(n.current),f=new d.CustomEvent("animationend",{bubbles:!0});(c=n.current)==null||c.dispatchEvent(f)}}}function dJ(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function fJ(e,t){const n=v.exports.useId();return v.exports.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function T0(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=p4(n),a=p4(t),[l,c]=v.exports.useState(e.defaultIsOpen||!1),[d,f]=dJ(r,l),p=fJ(o,"disclosure"),m=v.exports.useCallback(()=>{d||c(!1),a?.()},[d,a]),g=v.exports.useCallback(()=>{d||c(!0),i?.()},[d,i]),y=v.exports.useCallback(()=>{(f?m:g)()},[f,g,m]);return{isOpen:!!f,onOpen:g,onClose:m,onToggle:y,isControlled:d,getButtonProps:(b={})=>({...b,"aria-expanded":f,"aria-controls":p,onClick:Zj(b.onClick,y)}),getDisclosureProps:(b={})=>({...b,hidden:!f,id:p})}}var MA=(e,t)=>{const n=v.exports.useRef(!1),r=v.exports.useRef(!1);v.exports.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),v.exports.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function pJ(e){const t=e.current;if(!t)return!1;const n=Dj(t);return!n||xb(t,n)?!1:!!Wj(n)}function hJ(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;MA(()=>{if(!i||pJ(e))return;const a=o?.current||e.current;a&&h0(a,{nextTick:!0})},[i,e,o])}function mJ(e,t,n,r){return Jb(fG(t),aG(n,t==="pointerdown"),e,r)}function gJ(e){const{ref:t,elements:n,enabled:r}=e,o=hG("Safari");mJ(()=>If(t.current),"pointerdown",a=>{if(!o||!r)return;const l=a.target,d=(n??[t]).some(f=>{const p=_L(f)?f.current:f;return xb(p,l)});!AL(l)&&d&&(a.preventDefault(),h0(l))})}var vJ={preventScroll:!0,shouldFocus:!1};function yJ(e,t=vJ){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:i}=t,a=_L(e)?e.current:e,l=o&&i,c=v.exports.useCallback(()=>{if(!(!a||!l)&&!xb(a,document.activeElement))if(n?.current)h0(n.current,{preventScroll:r,nextTick:!0});else{const d=Gj(a);d.length>0&&h0(d[0],{preventScroll:r,nextTick:!0})}},[l,r,a,n]);MA(()=>{c()},[c]),Jb("transitionend",c,a)}function ex(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var tx=fe(function(t,n){const{htmlSize:r,...o}=t,i=dr("Input",o),a=yt(o),l=qb(a),c=en("chakra-input",t.className);return Q.createElement(ie.input,{size:r,...l,__css:i.field,ref:n,className:c})});tx.displayName="Input";tx.id="Input";var[bJ,NA]=Rt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),xJ=fe(function(t,n){const r=dr("Input",t),{children:o,className:i,...a}=yt(t),l=en("chakra-input__group",i),c={},d=Qm(o),f=r.field;d.forEach(m=>{!r||(f&&m.type.id==="InputLeftElement"&&(c.paddingStart=f.height??f.h),f&&m.type.id==="InputRightElement"&&(c.paddingEnd=f.height??f.h),m.type.id==="InputRightAddon"&&(c.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(c.borderStartRadius=0))});const p=d.map(m=>{var g,y;const b=ex({size:((g=m.props)==null?void 0:g.size)||t.size,variant:((y=m.props)==null?void 0:y.variant)||t.variant});return m.type.id!=="Input"?v.exports.cloneElement(m,b):v.exports.cloneElement(m,Object.assign(b,c,m.props))});return Q.createElement(ie.div,{className:l,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},x(bJ,{value:r,children:p}))});xJ.displayName="InputGroup";var wJ={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},SJ=ie("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),nx=fe(function(t,n){const{placement:r="left",...o}=t,i=wJ[r]??{},a=NA();return x(SJ,{ref:n,...o,__css:{...a.addon,...i}})});nx.displayName="InputAddon";var $A=fe(function(t,n){return x(nx,{ref:n,placement:"left",...t,className:en("chakra-input__left-addon",t.className)})});$A.displayName="InputLeftAddon";$A.id="InputLeftAddon";var DA=fe(function(t,n){return x(nx,{ref:n,placement:"right",...t,className:en("chakra-input__right-addon",t.className)})});DA.displayName="InputRightAddon";DA.id="InputRightAddon";var CJ=ie("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),ng=fe(function(t,n){const{placement:r="left",...o}=t,i=NA(),a=i.field,c={[r==="left"?"insetStart":"insetEnd"]:"0",width:a?.height??a?.h,height:a?.height??a?.h,fontSize:a?.fontSize,...i.element};return x(CJ,{ref:n,__css:c,...o})});ng.id="InputElement";ng.displayName="InputElement";var FA=fe(function(t,n){const{className:r,...o}=t,i=en("chakra-input__left-element",r);return x(ng,{ref:n,placement:"left",className:i,...o})});FA.id="InputLeftElement";FA.displayName="InputLeftElement";var zA=fe(function(t,n){const{className:r,...o}=t,i=en("chakra-input__right-element",r);return x(ng,{ref:n,placement:"right",className:i,...o})});zA.id="InputRightElement";zA.displayName="InputRightElement";function _J(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}Object.freeze(["base","sm","md","lg","xl","2xl"]);function os(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):_J(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var kJ=fe(function(e,t){const{ratio:n=4/3,children:r,className:o,...i}=e,a=v.exports.Children.only(r),l=en("chakra-aspect-ratio",o);return Q.createElement(ie.div,{ref:t,position:"relative",className:l,_before:{height:0,content:'""',display:"block",paddingBottom:os(n,c=>`${1/c*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...i},a)});kJ.displayName="AspectRatio";var EJ=fe(function(t,n){const r=cr("Badge",t),{className:o,...i}=yt(t);return Q.createElement(ie.span,{ref:n,className:en("chakra-badge",t.className),...i,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});EJ.displayName="Badge";var mo=ie("div");mo.displayName="Box";var BA=fe(function(t,n){const{size:r,centerContent:o=!0,...i}=t;return x(mo,{ref:n,boxSize:r,__css:{...o?{display:"flex",alignItems:"center",justifyContent:"center"}:{},flexShrink:0,flexGrow:0},...i})});BA.displayName="Square";var LJ=fe(function(t,n){const{size:r,...o}=t;return x(BA,{size:r,ref:n,borderRadius:"9999px",...o})});LJ.displayName="Circle";var VA=ie("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});VA.displayName="Center";var PJ={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};fe(function(t,n){const{axis:r="both",...o}=t;return Q.createElement(ie.div,{ref:n,__css:PJ[r],...o,position:"absolute"})});var AJ=fe(function(t,n){const r=cr("Code",t),{className:o,...i}=yt(t);return Q.createElement(ie.code,{ref:n,className:en("chakra-code",t.className),...i,__css:{display:"inline-block",...r}})});AJ.displayName="Code";var TJ=fe(function(t,n){const{className:r,centerContent:o,...i}=yt(t),a=cr("Container",t);return Q.createElement(ie.div,{ref:n,className:en("chakra-container",r),...i,__css:{...a,...o&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});TJ.displayName="Container";var IJ=fe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:i,borderRightWidth:a,borderWidth:l,borderStyle:c,borderColor:d,...f}=cr("Divider",t),{className:p,orientation:m="horizontal",__css:g,...y}=yt(t),b={vertical:{borderLeftWidth:r||a||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||i||l||"1px",width:"100%"}};return Q.createElement(ie.hr,{ref:n,"aria-orientation":m,...y,__css:{...f,border:"0",borderColor:d,borderStyle:c,...b[m],...g},className:en("chakra-divider",p)})});IJ.displayName="Divider";var Lt=fe(function(t,n){const{direction:r,align:o,justify:i,wrap:a,basis:l,grow:c,shrink:d,...f}=t,p={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:a,flexBasis:l,flexGrow:c,flexShrink:d};return Q.createElement(ie.div,{ref:n,__css:p,...f})});Lt.displayName="Flex";var WA=fe(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:a,column:l,row:c,autoFlow:d,autoRows:f,templateRows:p,autoColumns:m,templateColumns:g,...y}=t,b={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:a,gridAutoColumns:m,gridColumn:l,gridRow:c,gridAutoFlow:d,gridAutoRows:f,gridTemplateRows:p,gridTemplateColumns:g};return Q.createElement(ie.div,{ref:n,__css:b,...y})});WA.displayName="Grid";function v7(e){return os(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var OJ=fe(function(t,n){const{area:r,colSpan:o,colStart:i,colEnd:a,rowEnd:l,rowSpan:c,rowStart:d,...f}=t,p=ex({gridArea:r,gridColumn:v7(o),gridRow:v7(c),gridColumnStart:i,gridColumnEnd:a,gridRowStart:d,gridRowEnd:l});return Q.createElement(ie.div,{ref:n,__css:p,...f})});OJ.displayName="GridItem";var rx=fe(function(t,n){const r=cr("Heading",t),{className:o,...i}=yt(t);return Q.createElement(ie.h2,{ref:n,className:en("chakra-heading",t.className),...i,__css:r})});rx.displayName="Heading";fe(function(t,n){const r=cr("Mark",t),o=yt(t);return x(mo,{ref:n,...o,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var RJ=fe(function(t,n){const r=cr("Kbd",t),{className:o,...i}=yt(t);return Q.createElement(ie.kbd,{ref:n,className:en("chakra-kbd",o),...i,__css:{fontFamily:"mono",...r}})});RJ.displayName="Kbd";var Cu=fe(function(t,n){const r=cr("Link",t),{className:o,isExternal:i,...a}=yt(t);return Q.createElement(ie.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:n,className:en("chakra-link",o),...a,__css:r})});Cu.displayName="Link";fe(function(t,n){const{isExternal:r,target:o,rel:i,className:a,...l}=t;return Q.createElement(ie.a,{...l,ref:n,className:en("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":i,target:r?"_blank":o,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});fe(function(t,n){const{className:r,...o}=t;return Q.createElement(ie.div,{ref:n,position:"relative",...o,className:en("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[MJ,UA]=Rt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),ox=fe(function(t,n){const r=dr("List",t),{children:o,styleType:i="none",stylePosition:a,spacing:l,...c}=yt(t),d=Qm(o),p=l?{["& > *:not(style) ~ *:not(style)"]:{mt:l}}:{};return Q.createElement(MJ,{value:r},Q.createElement(ie.ul,{ref:n,listStyleType:i,listStylePosition:a,role:"list",__css:{...r.container,...p},...c},d))});ox.displayName="List";var NJ=fe((e,t)=>{const{as:n,...r}=e;return x(ox,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});NJ.displayName="OrderedList";var $J=fe(function(t,n){const{as:r,...o}=t;return x(ox,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});$J.displayName="UnorderedList";var DJ=fe(function(t,n){const r=UA();return Q.createElement(ie.li,{ref:n,...t,__css:r.item})});DJ.displayName="ListItem";var FJ=fe(function(t,n){const r=UA();return x(Yr,{ref:n,role:"presentation",...t,__css:r.icon})});FJ.displayName="ListIcon";var zJ=fe(function(t,n){const{columns:r,spacingX:o,spacingY:i,spacing:a,minChildWidth:l,...c}=t,d=Nm(),f=l?VJ(l,d):WJ(r);return x(WA,{ref:n,gap:a,columnGap:o,rowGap:i,templateColumns:f,...c})});zJ.displayName="SimpleGrid";function BJ(e){return typeof e=="number"?`${e}px`:e}function VJ(e,t){return os(e,n=>{const r=TG("sizes",n,BJ(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function WJ(e){return os(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var UJ=ie("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});UJ.displayName="Spacer";var h4="& > *:not(style) ~ *:not(style)";function HJ(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[h4]:os(n,o=>r[o])}}function jJ(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{"&":os(n,o=>r[o])}}var HA=e=>Q.createElement(ie.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});HA.displayName="StackItem";var ix=fe((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:a="0.5rem",wrap:l,children:c,divider:d,className:f,shouldWrapChildren:p,...m}=e,g=n?"row":r??"column",y=v.exports.useMemo(()=>HJ({direction:g,spacing:a}),[g,a]),b=v.exports.useMemo(()=>jJ({spacing:a,direction:g}),[a,g]),k=!!d,C=!p&&!k,S=Qm(c),_=C?S:S.map((A,R)=>{const O=typeof A.key<"u"?A.key:R,$=R+1===S.length,z=p?x(HA,{children:A},O):A;if(!k)return z;const X=v.exports.cloneElement(d,{__css:b}),he=$?null:X;return Y(v.exports.Fragment,{children:[z,he]},O)}),E=en("chakra-stack",f);return Q.createElement(ie.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:y.flexDirection,flexWrap:l,className:E,__css:k?{}:{[h4]:y[h4]},...m},_)});ix.displayName="Stack";var GJ=fe((e,t)=>x(ix,{align:"center",...e,direction:"row",ref:t}));GJ.displayName="HStack";var ZJ=fe((e,t)=>x(ix,{align:"center",...e,direction:"column",ref:t}));ZJ.displayName="VStack";var wr=fe(function(t,n){const r=cr("Text",t),{className:o,align:i,decoration:a,casing:l,...c}=yt(t),d=ex({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return Q.createElement(ie.p,{ref:n,className:en("chakra-text",t.className),...d,...c,__css:r})});wr.displayName="Text";function y7(e){return typeof e=="number"?`${e}px`:e}var KJ=fe(function(t,n){const{spacing:r="0.5rem",spacingX:o,spacingY:i,children:a,justify:l,direction:c,align:d,className:f,shouldWrapChildren:p,...m}=t,g=v.exports.useMemo(()=>{const{spacingX:b=r,spacingY:k=r}={spacingX:o,spacingY:i};return{"--chakra-wrap-x-spacing":C=>os(b,S=>y7(A5("space",S)(C))),"--chakra-wrap-y-spacing":C=>os(k,S=>y7(A5("space",S)(C))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:l,alignItems:d,flexDirection:c,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,o,i,l,d,c]),y=p?v.exports.Children.map(a,(b,k)=>x(jA,{children:b},k)):a;return Q.createElement(ie.div,{ref:n,className:en("chakra-wrap",f),overflow:"hidden",...m},Q.createElement(ie.ul,{className:"chakra-wrap__list",__css:g},y))});KJ.displayName="Wrap";var jA=fe(function(t,n){const{className:r,...o}=t;return Q.createElement(ie.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:en("chakra-wrap__listitem",r),...o})});jA.displayName="WrapItem";var qJ={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},GA=qJ,zl=()=>{},YJ={document:GA,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:zl,removeEventListener:zl,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:zl,removeListener:zl}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:zl,setInterval:()=>0,clearInterval:zl},XJ=YJ,QJ={window:XJ,document:GA},ZA=typeof window<"u"?{window,document}:QJ,KA=v.exports.createContext(ZA);KA.displayName="EnvironmentContext";function qA(e){const{children:t,environment:n}=e,[r,o]=v.exports.useState(null),[i,a]=v.exports.useState(!1);v.exports.useEffect(()=>a(!0),[]);const l=v.exports.useMemo(()=>{if(n)return n;const c=r?.ownerDocument,d=r?.ownerDocument.defaultView;return c?{document:c,window:d}:ZA},[r,n]);return Y(KA.Provider,{value:l,children:[t,!n&&i&&x("span",{id:"__chakra_env",hidden:!0,ref:c=>{v.exports.startTransition(()=>{c&&o(c)})}})]})}qA.displayName="EnvironmentProvider";var JJ=e=>e?"":void 0;function eee(){const e=v.exports.useRef(new Map),t=e.current,n=v.exports.useCallback((o,i,a,l)=>{e.current.set(a,{type:i,el:o,options:l}),o.addEventListener(i,a,l)},[]),r=v.exports.useCallback((o,i,a,l)=>{o.removeEventListener(i,a,l),e.current.delete(a)},[]);return v.exports.useEffect(()=>()=>{t.forEach((o,i)=>{r(o.el,o.type,i,o.options)})},[r,t]),{add:n,remove:r}}function X2(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function tee(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:i=!0,onMouseDown:a,onMouseUp:l,onClick:c,onKeyDown:d,onKeyUp:f,tabIndex:p,onMouseOver:m,onMouseLeave:g,...y}=e,[b,k]=v.exports.useState(!0),[C,S]=v.exports.useState(!1),_=eee(),E=J=>{!J||J.tagName!=="BUTTON"&&k(!1)},A=b?p:p||0,R=n&&!r,O=v.exports.useCallback(J=>{if(n){J.stopPropagation(),J.preventDefault();return}J.currentTarget.focus(),c?.(J)},[n,c]),$=v.exports.useCallback(J=>{C&&X2(J)&&(J.preventDefault(),J.stopPropagation(),S(!1),_.remove(document,"keyup",$,!1))},[C,_]),H=v.exports.useCallback(J=>{if(d?.(J),n||J.defaultPrevented||J.metaKey||!X2(J.nativeEvent)||b)return;const D=o&&J.key==="Enter";i&&J.key===" "&&(J.preventDefault(),S(!0)),D&&(J.preventDefault(),J.currentTarget.click()),_.add(document,"keyup",$,!1)},[n,b,d,o,i,_,$]),z=v.exports.useCallback(J=>{if(f?.(J),n||J.defaultPrevented||J.metaKey||!X2(J.nativeEvent)||b)return;i&&J.key===" "&&(J.preventDefault(),S(!1),J.currentTarget.click())},[i,b,n,f]),X=v.exports.useCallback(J=>{J.button===0&&(S(!1),_.remove(document,"mouseup",X,!1))},[_]),he=v.exports.useCallback(J=>{if(J.button!==0)return;if(n){J.stopPropagation(),J.preventDefault();return}b||S(!0),J.currentTarget.focus({preventScroll:!0}),_.add(document,"mouseup",X,!1),a?.(J)},[n,b,a,_,X]),ye=v.exports.useCallback(J=>{J.button===0&&(b||S(!1),l?.(J))},[l,b]),oe=v.exports.useCallback(J=>{if(n){J.preventDefault();return}m?.(J)},[n,m]),pe=v.exports.useCallback(J=>{C&&(J.preventDefault(),S(!1)),g?.(J)},[C,g]),ge=Qt(t,E);return b?{...y,ref:ge,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:O,onMouseDown:a,onMouseUp:l,onKeyUp:f,onKeyDown:d,onMouseOver:m,onMouseLeave:g}:{...y,ref:ge,role:"button","data-active":JJ(C),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:A,onClick:O,onMouseDown:he,onMouseUp:ye,onKeyUp:z,onKeyDown:H,onMouseOver:oe,onMouseLeave:pe}}function nee(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function ree(e){if(!nee(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}var oee=e=>e.hasAttribute("tabindex");function iee(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function YA(e){return e.parentElement&&YA(e.parentElement)?!0:e.hidden}function aee(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function see(e){if(!ree(e)||YA(e)||iee(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]():aee(e)?!0:oee(e)}var lee=["input:not([disabled])","select:not([disabled])","textarea:not([disabled])","embed","iframe","object","a[href]","area[href]","button:not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],uee=lee.join(),cee=e=>e.offsetWidth>0&&e.offsetHeight>0;function dee(e){const t=Array.from(e.querySelectorAll(uee));return t.unshift(e),t.filter(n=>see(n)&&cee(n))}var Er="top",go="bottom",vo="right",Lr="left",ax="auto",Bf=[Er,go,vo,Lr],zu="start",uf="end",fee="clippingParents",XA="viewport",qc="popper",pee="reference",b7=Bf.reduce(function(e,t){return e.concat([t+"-"+zu,t+"-"+uf])},[]),QA=[].concat(Bf,[ax]).reduce(function(e,t){return e.concat([t,t+"-"+zu,t+"-"+uf])},[]),hee="beforeRead",mee="read",gee="afterRead",vee="beforeMain",yee="main",bee="afterMain",xee="beforeWrite",wee="write",See="afterWrite",Cee=[hee,mee,gee,vee,yee,bee,xee,wee,See];function wi(e){return e?(e.nodeName||"").toLowerCase():null}function xo(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function el(e){var t=xo(e).Element;return e instanceof t||e instanceof Element}function fo(e){var t=xo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function sx(e){if(typeof ShadowRoot>"u")return!1;var t=xo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _ee(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!fo(i)||!wi(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var l=o[a];l===!1?i.removeAttribute(a):i.setAttribute(a,l===!0?"":l)}))})}function kee(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],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=a.reduce(function(c,d){return c[d]="",c},{});!fo(o)||!wi(o)||(Object.assign(o.style,l),Object.keys(i).forEach(function(c){o.removeAttribute(c)}))})}}const Eee={name:"applyStyles",enabled:!0,phase:"write",fn:_ee,effect:kee,requires:["computeStyles"]};function mi(e){return e.split("-")[0]}var Gs=Math.max,I0=Math.min,Bu=Math.round;function m4(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function JA(){return!/^((?!chrome|android).)*safari/i.test(m4())}function Vu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&fo(e)&&(o=e.offsetWidth>0&&Bu(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Bu(r.height)/e.offsetHeight||1);var a=el(e)?xo(e):window,l=a.visualViewport,c=!JA()&&n,d=(r.left+(c&&l?l.offsetLeft:0))/o,f=(r.top+(c&&l?l.offsetTop:0))/i,p=r.width/o,m=r.height/i;return{width:p,height:m,top:f,right:d+p,bottom:f+m,left:d,x:d,y:f}}function lx(e){var t=Vu(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 eT(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&sx(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ra(e){return xo(e).getComputedStyle(e)}function Lee(e){return["table","td","th"].indexOf(wi(e))>=0}function ms(e){return((el(e)?e.ownerDocument:e.document)||window.document).documentElement}function rg(e){return wi(e)==="html"?e:e.assignedSlot||e.parentNode||(sx(e)?e.host:null)||ms(e)}function x7(e){return!fo(e)||ra(e).position==="fixed"?null:e.offsetParent}function Pee(e){var t=/firefox/i.test(m4()),n=/Trident/i.test(m4());if(n&&fo(e)){var r=ra(e);if(r.position==="fixed")return null}var o=rg(e);for(sx(o)&&(o=o.host);fo(o)&&["html","body"].indexOf(wi(o))<0;){var i=ra(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Vf(e){for(var t=xo(e),n=x7(e);n&&Lee(n)&&ra(n).position==="static";)n=x7(n);return n&&(wi(n)==="html"||wi(n)==="body"&&ra(n).position==="static")?t:n||Pee(e)||t}function ux(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function kd(e,t,n){return Gs(e,I0(t,n))}function Aee(e,t,n){var r=kd(e,t,n);return r>n?n:r}function tT(){return{top:0,right:0,bottom:0,left:0}}function nT(e){return Object.assign({},tT(),e)}function rT(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Tee=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,nT(typeof t!="number"?t:rT(t,Bf))};function Iee(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,l=mi(n.placement),c=ux(l),d=[Lr,vo].indexOf(l)>=0,f=d?"height":"width";if(!(!i||!a)){var p=Tee(o.padding,n),m=lx(i),g=c==="y"?Er:Lr,y=c==="y"?go:vo,b=n.rects.reference[f]+n.rects.reference[c]-a[c]-n.rects.popper[f],k=a[c]-n.rects.reference[c],C=Vf(i),S=C?c==="y"?C.clientHeight||0:C.clientWidth||0:0,_=b/2-k/2,E=p[g],A=S-m[f]-p[y],R=S/2-m[f]/2+_,O=kd(E,R,A),$=c;n.modifiersData[r]=(t={},t[$]=O,t.centerOffset=O-R,t)}}function Oee(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)||!eT(t.elements.popper,o)||(t.elements.arrow=o))}const Ree={name:"arrow",enabled:!0,phase:"main",fn:Iee,effect:Oee,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Wu(e){return e.split("-")[1]}var Mee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Nee(e){var t=e.x,n=e.y,r=window,o=r.devicePixelRatio||1;return{x:Bu(t*o)/o||0,y:Bu(n*o)/o||0}}function w7(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,l=e.position,c=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,p=e.isFixed,m=a.x,g=m===void 0?0:m,y=a.y,b=y===void 0?0:y,k=typeof f=="function"?f({x:g,y:b}):{x:g,y:b};g=k.x,b=k.y;var C=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),_=Lr,E=Er,A=window;if(d){var R=Vf(n),O="clientHeight",$="clientWidth";if(R===xo(n)&&(R=ms(n),ra(R).position!=="static"&&l==="absolute"&&(O="scrollHeight",$="scrollWidth")),R=R,o===Er||(o===Lr||o===vo)&&i===uf){E=go;var H=p&&R===A&&A.visualViewport?A.visualViewport.height:R[O];b-=H-r.height,b*=c?1:-1}if(o===Lr||(o===Er||o===go)&&i===uf){_=vo;var z=p&&R===A&&A.visualViewport?A.visualViewport.width:R[$];g-=z-r.width,g*=c?1:-1}}var X=Object.assign({position:l},d&&Mee),he=f===!0?Nee({x:g,y:b}):{x:g,y:b};if(g=he.x,b=he.y,c){var ye;return Object.assign({},X,(ye={},ye[E]=S?"0":"",ye[_]=C?"0":"",ye.transform=(A.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",ye))}return Object.assign({},X,(t={},t[E]=S?b+"px":"",t[_]=C?g+"px":"",t.transform="",t))}function $ee(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,l=n.roundOffsets,c=l===void 0?!0:l,d={placement:mi(t.placement),variation:Wu(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,w7(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,w7(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Dee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$ee,data:{}};var $h={passive:!0};function Fee(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,l=a===void 0?!0:a,c=xo(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&d.forEach(function(f){f.addEventListener("scroll",n.update,$h)}),l&&c.addEventListener("resize",n.update,$h),function(){i&&d.forEach(function(f){f.removeEventListener("scroll",n.update,$h)}),l&&c.removeEventListener("resize",n.update,$h)}}const zee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Fee,data:{}};var Bee={left:"right",right:"left",bottom:"top",top:"bottom"};function C1(e){return e.replace(/left|right|bottom|top/g,function(t){return Bee[t]})}var Vee={start:"end",end:"start"};function S7(e){return e.replace(/start|end/g,function(t){return Vee[t]})}function cx(e){var t=xo(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function dx(e){return Vu(ms(e)).left+cx(e).scrollLeft}function Wee(e,t){var n=xo(e),r=ms(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;var d=JA();(d||!d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l+dx(e),y:c}}function Uee(e){var t,n=ms(e),r=cx(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Gs(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Gs(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+dx(e),c=-r.scrollTop;return ra(o||n).direction==="rtl"&&(l+=Gs(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:c}}function fx(e){var t=ra(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function oT(e){return["html","body","#document"].indexOf(wi(e))>=0?e.ownerDocument.body:fo(e)&&fx(e)?e:oT(rg(e))}function Ed(e,t){var n;t===void 0&&(t=[]);var r=oT(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=xo(r),a=o?[i].concat(i.visualViewport||[],fx(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(Ed(rg(a)))}function g4(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Hee(e,t){var n=Vu(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 C7(e,t,n){return t===XA?g4(Wee(e,n)):el(t)?Hee(t,n):g4(Uee(ms(e)))}function jee(e){var t=Ed(rg(e)),n=["absolute","fixed"].indexOf(ra(e).position)>=0,r=n&&fo(e)?Vf(e):e;return el(r)?t.filter(function(o){return el(o)&&eT(o,r)&&wi(o)!=="body"}):[]}function Gee(e,t,n,r){var o=t==="clippingParents"?jee(e):[].concat(t),i=[].concat(o,[n]),a=i[0],l=i.reduce(function(c,d){var f=C7(e,d,r);return c.top=Gs(f.top,c.top),c.right=I0(f.right,c.right),c.bottom=I0(f.bottom,c.bottom),c.left=Gs(f.left,c.left),c},C7(e,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function iT(e){var t=e.reference,n=e.element,r=e.placement,o=r?mi(r):null,i=r?Wu(r):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(o){case Er:c={x:a,y:t.y-n.height};break;case go:c={x:a,y:t.y+t.height};break;case vo:c={x:t.x+t.width,y:l};break;case Lr:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var d=o?ux(o):null;if(d!=null){var f=d==="y"?"height":"width";switch(i){case zu:c[d]=c[d]-(t[f]/2-n[f]/2);break;case uf:c[d]=c[d]+(t[f]/2-n[f]/2);break}}return c}function cf(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,l=n.boundary,c=l===void 0?fee:l,d=n.rootBoundary,f=d===void 0?XA:d,p=n.elementContext,m=p===void 0?qc:p,g=n.altBoundary,y=g===void 0?!1:g,b=n.padding,k=b===void 0?0:b,C=nT(typeof k!="number"?k:rT(k,Bf)),S=m===qc?pee:qc,_=e.rects.popper,E=e.elements[y?S:m],A=Gee(el(E)?E:E.contextElement||ms(e.elements.popper),c,f,a),R=Vu(e.elements.reference),O=iT({reference:R,element:_,strategy:"absolute",placement:o}),$=g4(Object.assign({},_,O)),H=m===qc?$:R,z={top:A.top-H.top+C.top,bottom:H.bottom-A.bottom+C.bottom,left:A.left-H.left+C.left,right:H.right-A.right+C.right},X=e.modifiersData.offset;if(m===qc&&X){var he=X[o];Object.keys(z).forEach(function(ye){var oe=[vo,go].indexOf(ye)>=0?1:-1,pe=[Er,go].indexOf(ye)>=0?"y":"x";z[ye]+=he[pe]*oe})}return z}function Zee(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?QA:c,f=Wu(r),p=f?l?b7:b7.filter(function(y){return Wu(y)===f}):Bf,m=p.filter(function(y){return d.indexOf(y)>=0});m.length===0&&(m=p);var g=m.reduce(function(y,b){return y[b]=cf(e,{placement:b,boundary:o,rootBoundary:i,padding:a})[mi(b)],y},{});return Object.keys(g).sort(function(y,b){return g[y]-g[b]})}function Kee(e){if(mi(e)===ax)return[];var t=C1(e);return[S7(e),t,S7(t)]}function qee(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,l=a===void 0?!0:a,c=n.fallbackPlacements,d=n.padding,f=n.boundary,p=n.rootBoundary,m=n.altBoundary,g=n.flipVariations,y=g===void 0?!0:g,b=n.allowedAutoPlacements,k=t.options.placement,C=mi(k),S=C===k,_=c||(S||!y?[C1(k)]:Kee(k)),E=[k].concat(_).reduce(function(ce,be){return ce.concat(mi(be)===ax?Zee(t,{placement:be,boundary:f,rootBoundary:p,padding:d,flipVariations:y,allowedAutoPlacements:b}):be)},[]),A=t.rects.reference,R=t.rects.popper,O=new Map,$=!0,H=E[0],z=0;z=0,pe=oe?"width":"height",ge=cf(t,{placement:X,boundary:f,rootBoundary:p,altBoundary:m,padding:d}),J=oe?ye?vo:Lr:ye?go:Er;A[pe]>R[pe]&&(J=C1(J));var D=C1(J),Z=[];if(i&&Z.push(ge[he]<=0),l&&Z.push(ge[J]<=0,ge[D]<=0),Z.every(function(ce){return ce})){H=X,$=!1;break}O.set(X,Z)}if($)for(var j=y?3:1,M=function(be){var me=E.find(function(_e){var ue=O.get(_e);if(ue)return ue.slice(0,be).every(function(we){return we})});if(me)return H=me,"break"},G=j;G>0;G--){var le=M(G);if(le==="break")break}t.placement!==H&&(t.modifiersData[r]._skip=!0,t.placement=H,t.reset=!0)}}const Yee={name:"flip",enabled:!0,phase:"main",fn:qee,requiresIfExists:["offset"],data:{_skip:!1}};function _7(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 k7(e){return[Er,vo,go,Lr].some(function(t){return e[t]>=0})}function Xee(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=cf(t,{elementContext:"reference"}),l=cf(t,{altBoundary:!0}),c=_7(a,r),d=_7(l,o,i),f=k7(c),p=k7(d);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}const Qee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Xee};function Jee(e,t,n){var r=mi(e),o=[Lr,Er].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],l=i[1];return a=a||0,l=(l||0)*o,[Lr,vo].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function ete(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=QA.reduce(function(f,p){return f[p]=Jee(p,t.rects,i),f},{}),l=a[t.placement],c=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=a}const tte={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ete};function nte(e){var t=e.state,n=e.name;t.modifiersData[n]=iT({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const rte={name:"popperOffsets",enabled:!0,phase:"read",fn:nte,data:{}};function ote(e){return e==="x"?"y":"x"}function ite(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,l=a===void 0?!1:a,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.padding,m=n.tether,g=m===void 0?!0:m,y=n.tetherOffset,b=y===void 0?0:y,k=cf(t,{boundary:c,rootBoundary:d,padding:p,altBoundary:f}),C=mi(t.placement),S=Wu(t.placement),_=!S,E=ux(C),A=ote(E),R=t.modifiersData.popperOffsets,O=t.rects.reference,$=t.rects.popper,H=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,z=typeof H=="number"?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),X=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,he={x:0,y:0};if(!!R){if(i){var ye,oe=E==="y"?Er:Lr,pe=E==="y"?go:vo,ge=E==="y"?"height":"width",J=R[E],D=J+k[oe],Z=J-k[pe],j=g?-$[ge]/2:0,M=S===zu?O[ge]:$[ge],G=S===zu?-$[ge]:-O[ge],le=t.elements.arrow,ce=g&&le?lx(le):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:tT(),me=be[oe],_e=be[pe],ue=kd(0,O[ge],ce[ge]),we=_?O[ge]/2-j-ue-me-z.mainAxis:M-ue-me-z.mainAxis,$e=_?-O[ge]/2+j+ue+_e+z.mainAxis:G+ue+_e+z.mainAxis,rt=t.elements.arrow&&Vf(t.elements.arrow),Ct=rt?E==="y"?rt.clientTop||0:rt.clientLeft||0:0,un=(ye=X?.[E])!=null?ye:0,Se=J+we-un-Ct,Ie=J+$e-un,Qe=kd(g?I0(D,Se):D,J,g?Gs(Z,Ie):Z);R[E]=Qe,he[E]=Qe-J}if(l){var Oe,ft=E==="x"?Er:Lr,tn=E==="x"?go:vo,Je=R[A],_t=A==="y"?"height":"width",nn=Je+k[ft],qt=Je-k[tn],ve=[Er,Lr].indexOf(C)!==-1,Pe=(Oe=X?.[A])!=null?Oe:0,pt=ve?nn:Je-O[_t]-$[_t]-Pe+z.altAxis,ut=ve?Je+O[_t]+$[_t]-Pe-z.altAxis:qt,ae=g&&ve?Aee(pt,Je,ut):kd(g?pt:nn,Je,g?ut:qt);R[A]=ae,he[A]=ae-Je}t.modifiersData[r]=he}}const ate={name:"preventOverflow",enabled:!0,phase:"main",fn:ite,requiresIfExists:["offset"]};function ste(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lte(e){return e===xo(e)||!fo(e)?cx(e):ste(e)}function ute(e){var t=e.getBoundingClientRect(),n=Bu(t.width)/e.offsetWidth||1,r=Bu(t.height)/e.offsetHeight||1;return n!==1||r!==1}function cte(e,t,n){n===void 0&&(n=!1);var r=fo(t),o=fo(t)&&ute(t),i=ms(t),a=Vu(e,o,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((wi(t)!=="body"||fx(i))&&(l=lte(t)),fo(t)?(c=Vu(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=dx(i))),{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function dte(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&o(c)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function fte(e){var t=dte(e);return Cee.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function pte(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function hte(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 E7={placement:"bottom",modifiers:[],strategy:"absolute"};function L7(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),pn={arrowShadowColor:Bl("--popper-arrow-shadow-color"),arrowSize:Bl("--popper-arrow-size","8px"),arrowSizeHalf:Bl("--popper-arrow-size-half"),arrowBg:Bl("--popper-arrow-bg"),transformOrigin:Bl("--popper-transform-origin"),arrowOffset:Bl("--popper-arrow-offset")};function yte(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var bte={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"},xte=e=>bte[e],P7={scroll:!0,resize:!0};function wte(e){let t;return typeof e=="object"?t={enabled:!0,options:{...P7,...e}}:t={enabled:e,options:P7},t}var Ste={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`}},Cte={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{A7(e)},effect:({state:e})=>()=>{A7(e)}},A7=e=>{e.elements.popper.style.setProperty(pn.transformOrigin.var,xte(e.placement))},_te={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{kte(e)}},kte=e=>{var t;if(!e.placement)return;const n=Ete(e.placement);if(((t=e.elements)==null?void 0:t.arrow)&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:pn.arrowSize.varRef,height:pn.arrowSize.varRef,zIndex:-1});const r={[pn.arrowSizeHalf.var]:`calc(${pn.arrowSize.varRef} / 2)`,[pn.arrowOffset.var]:`calc(${pn.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},Ete=e=>{if(e.startsWith("top"))return{property:"bottom",value:pn.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:pn.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:pn.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:pn.arrowOffset.varRef}},Lte={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{T7(e)},effect:({state:e})=>()=>{T7(e)}},T7=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");!t||Object.assign(t.style,{transform:"rotate(45deg)",background:pn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:yte(e.placement)})},Pte={"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"}},Ate={"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 Tte(e,t="ltr"){var n;const r=((n=Pte[e])==null?void 0:n[t])||e;return t==="ltr"?r:Ate[e]??r}function aT(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:i=8,eventListeners:a=!0,offset:l,gutter:c=8,flip:d=!0,boundary:f="clippingParents",preventOverflow:p=!0,matchWidth:m,direction:g="ltr"}=e,y=v.exports.useRef(null),b=v.exports.useRef(null),k=v.exports.useRef(null),C=Tte(r,g),S=v.exports.useRef(()=>{}),_=v.exports.useCallback(()=>{var z;!t||!y.current||!b.current||((z=S.current)==null||z.call(S),k.current=vte(y.current,b.current,{placement:C,modifiers:[Lte,_te,Cte,{...Ste,enabled:!!m},{name:"eventListeners",...wte(a)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:l??[0,c]}},{name:"flip",enabled:!!d,options:{padding:8}},{name:"preventOverflow",enabled:!!p,options:{boundary:f}},...n??[]],strategy:o}),k.current.forceUpdate(),S.current=k.current.destroy)},[C,t,n,m,a,i,l,c,d,p,f,o]);v.exports.useEffect(()=>()=>{var z;!y.current&&!b.current&&((z=k.current)==null||z.destroy(),k.current=null)},[]);const E=v.exports.useCallback(z=>{y.current=z,_()},[_]),A=v.exports.useCallback((z={},X=null)=>({...z,ref:Qt(E,X)}),[E]),R=v.exports.useCallback(z=>{b.current=z,_()},[_]),O=v.exports.useCallback((z={},X=null)=>({...z,ref:Qt(R,X),style:{...z.style,position:o,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[o,R,m]),$=v.exports.useCallback((z={},X=null)=>{const{size:he,shadowColor:ye,bg:oe,style:pe,...ge}=z;return{...ge,ref:X,"data-popper-arrow":"",style:Ite(z)}},[]),H=v.exports.useCallback((z={},X=null)=>({...z,ref:X,"data-popper-arrow-inner":""}),[]);return{update(){var z;(z=k.current)==null||z.update()},forceUpdate(){var z;(z=k.current)==null||z.forceUpdate()},transformOrigin:pn.transformOrigin.varRef,referenceRef:E,popperRef:R,getPopperProps:O,getArrowProps:$,getArrowInnerProps:H,getReferenceProps:A}}function Ite(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}function sT(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Zn(n),a=Zn(t),[l,c]=v.exports.useState(e.defaultIsOpen||!1),d=r!==void 0?r:l,f=r!==void 0,p=o??`disclosure-${v.exports.useId()}`,m=v.exports.useCallback(()=>{f||c(!1),a?.()},[f,a]),g=v.exports.useCallback(()=>{f||c(!0),i?.()},[f,i]),y=v.exports.useCallback(()=>{d?m():g()},[d,g,m]);function b(C={}){return{...C,"aria-expanded":d,"aria-controls":p,onClick(S){var _;(_=C.onClick)==null||_.call(C,S),y()}}}function k(C={}){return{...C,hidden:!d,id:p}}return{isOpen:d,onOpen:g,onClose:m,onToggle:y,isControlled:f,getButtonProps:b,getDisclosureProps:k}}function lT(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[Ote,Rte]=Rt({strict:!1,name:"PortalManagerContext"});function uT(e){const{children:t,zIndex:n}=e;return x(Ote,{value:{zIndex:n},children:t})}uT.displayName="PortalManager";var[cT,Mte]=Rt({strict:!1,name:"PortalContext"}),px="chakra-portal",Nte=".chakra-portal",$te=e=>x("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),Dte=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=v.exports.useState(null),i=v.exports.useRef(null),[,a]=v.exports.useState({});v.exports.useEffect(()=>a({}),[]);const l=Mte(),c=Rte();di(()=>{if(!r)return;const f=r.ownerDocument,p=t?l??f.body:f.body;if(!p)return;i.current=f.createElement("div"),i.current.className=px,p.appendChild(i.current),a({});const m=i.current;return()=>{p.contains(m)&&p.removeChild(m)}},[r]);const d=c?.zIndex?x($te,{zIndex:c?.zIndex,children:n}):n;return i.current?ua.exports.createPortal(x(cT,{value:i.current,children:d}),i.current):x("span",{ref:f=>{f&&o(f)}})},Fte=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),a=v.exports.useMemo(()=>{const c=o?.ownerDocument.createElement("div");return c&&(c.className=px),c},[o]),[,l]=v.exports.useState({});return di(()=>l({}),[]),di(()=>{if(!(!a||!i))return i.appendChild(a),()=>{i.removeChild(a)}},[a,i]),i&&a?ua.exports.createPortal(x(cT,{value:r?a:null,children:t}),a):null};function ll(e){const{containerRef:t,...n}=e;return t?x(Fte,{containerRef:t,...n}):x(Dte,{...n})}ll.defaultProps={appendToParentPortal:!0};ll.className=px;ll.selector=Nte;ll.displayName="Portal";var zte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vl=new WeakMap,Dh=new WeakMap,Fh={},Q2=0,Bte=function(e,t,n,r){var o=Array.isArray(e)?e:[e];Fh[n]||(Fh[n]=new WeakMap);var i=Fh[n],a=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))f(m);else{var g=m.getAttribute(r),y=g!==null&&g!=="false",b=(Vl.get(m)||0)+1,k=(i.get(m)||0)+1;Vl.set(m,b),i.set(m,k),a.push(m),b===1&&y&&Dh.set(m,!0),k===1&&m.setAttribute(n,"true"),y||m.setAttribute(r,"true")}})};return f(t),l.clear(),Q2++,function(){a.forEach(function(p){var m=Vl.get(p)-1,g=i.get(p)-1;Vl.set(p,m),i.set(p,g),m||(Dh.has(p)||p.removeAttribute(r),Dh.delete(p)),g||p.removeAttribute(n)}),Q2--,Q2||(Vl=new WeakMap,Vl=new WeakMap,Dh=new WeakMap,Fh={})}},dT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||zte(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Bte(r,o,n,"aria-hidden")):function(){return null}};function Vte(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function v4(){return v4=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0}).sort(dne)},fne=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],vx=fne.join(","),pne="".concat(vx,", [data-focus-guard]"),IT=function(e,t){var n;return ki(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,o){return r.concat(o.matches(t?pne:vx)?[o]:[],IT(o))},[])},yx=function(e,t){return e.reduce(function(n,r){return n.concat(IT(r,t),r.parentNode?ki(r.parentNode.querySelectorAll(vx)).filter(function(o){return o===r}):[])},[])},hne=function(e){var t=e.querySelectorAll("[".concat(Zte,"]"));return ki(t).map(function(n){return yx([n])}).reduce(function(n,r){return n.concat(r)},[])},bx=function(e,t){return ki(e).filter(function(n){return kT(t,n)}).filter(function(n){return lne(n)})},I7=function(e,t){return t===void 0&&(t=new Map),ki(e).filter(function(n){return ET(t,n)})},w4=function(e,t,n){return TT(bx(yx(e,n),t),!0,n)},O7=function(e,t){return TT(bx(yx(e),t),!1)},mne=function(e,t){return bx(hne(e),t)},df=function(e,t){return(e.shadowRoot?df(e.shadowRoot,t):Object.getPrototypeOf(e).contains.call(e,t))||ki(e.children).some(function(n){return df(n,t)})},gne=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,l){return!t.has(l)})},OT=function(e){return e.parentNode?OT(e.parentNode):e},xx=function(e){var t=x4(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(y4);return n.push.apply(n,o?gne(ki(OT(r).querySelectorAll("[".concat(y4,'="').concat(o,'"]:not([').concat(hT,'="disabled"])')))):[r]),n},[])},RT=function(e){return e.activeElement?e.activeElement.shadowRoot?RT(e.activeElement.shadowRoot):e.activeElement:void 0},wx=function(){return document.activeElement?document.activeElement.shadowRoot?RT(document.activeElement.shadowRoot):document.activeElement:void 0},vne=function(e){return e===document.activeElement},yne=function(e){return Boolean(ki(e.querySelectorAll("iframe")).some(function(t){return vne(t)}))},MT=function(e){var t=document&&wx();return!t||t.dataset&&t.dataset.focusGuard?!1:xx(e).some(function(n){return df(n,t)||yne(n)})},bne=function(){var e=document&&wx();return e?ki(document.querySelectorAll("[".concat(Gte,"]"))).some(function(t){return df(t,e)}):!1},xne=function(e,t){return t.filter(AT).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Sx=function(e,t){return AT(e)&&e.name?xne(e,t):e},wne=function(e){var t=new Set;return e.forEach(function(n){return t.add(Sx(n,e))}),e.filter(function(n){return t.has(n)})},R7=function(e){return e[0]&&e.length>1?Sx(e[0],e):e[0]},M7=function(e,t){return e.length>1?e.indexOf(Sx(e[t],e)):t},NT="NEW_FOCUS",Sne=function(e,t,n,r){var o=e.length,i=e[0],a=e[o-1],l=gx(n);if(!(n&&e.indexOf(n)>=0)){var c=n!==void 0?t.indexOf(n):-1,d=r?t.indexOf(r):c,f=r?e.indexOf(r):-1,p=c-d,m=t.indexOf(i),g=t.indexOf(a),y=wne(t),b=n!==void 0?y.indexOf(n):-1,k=b-(r?y.indexOf(r):c),C=M7(e,0),S=M7(e,o-1);if(c===-1||f===-1)return NT;if(!p&&f>=0)return f;if(c<=m&&l&&Math.abs(p)>1)return S;if(c>=g&&l&&Math.abs(p)>1)return C;if(p&&Math.abs(k)>1)return f;if(c<=m)return S;if(c>g)return C;if(p)return Math.abs(p)>1?f:(o+f+p)%o}},S4=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&S4(e.parentNode.host||e.parentNode,t),t},ey=function(e,t){for(var n=S4(e),r=S4(t),o=0;o=0)return i}return!1},$T=function(e,t,n){var r=x4(e),o=x4(t),i=r[0],a=!1;return o.filter(Boolean).forEach(function(l){a=ey(a||l,l)||a,n.filter(Boolean).forEach(function(c){var d=ey(i,c);d&&(!a||df(d,a)?a=d:a=ey(d,a))})}),a},Cne=function(e,t){return e.reduce(function(n,r){return n.concat(mne(r,t))},[])},_ne=function(e){return function(t){var n;return t.autofocus||!!(!((n=LT(t))===null||n===void 0)&&n.autofocus)||e.indexOf(t)>=0}},kne=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(cne)},Ene=function(e,t){var n=document&&wx(),r=xx(e).filter(O0),o=$T(n||e,e,r),i=new Map,a=O7(r,i),l=w4(r,i).filter(function(g){var y=g.node;return O0(y)});if(!(!l[0]&&(l=a,!l[0]))){var c=O7([o],i).map(function(g){var y=g.node;return y}),d=kne(c,l),f=d.map(function(g){var y=g.node;return y}),p=Sne(f,c,n,t);if(p===NT){var m=I7(a.map(function(g){var y=g.node;return y})).filter(_ne(Cne(r,i)));return{node:m&&m.length?R7(m):R7(I7(f))}}return p===void 0?p:d[p]}},Lne=function(e){var t=xx(e).filter(O0),n=$T(e,e,t),r=new Map,o=w4([n],r,!0),i=w4(t,r).filter(function(a){var l=a.node;return O0(l)}).map(function(a){var l=a.node;return l});return o.map(function(a){var l=a.node,c=a.index;return{node:l,index:c,lockItem:i.indexOf(l)>=0,guard:gx(l)}})},Pne=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},ty=0,ny=!1,Ane=function(e,t,n){n===void 0&&(n={});var r=Ene(e,t);if(!ny&&r){if(ty>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),ny=!0,setTimeout(function(){ny=!1},1);return}ty++,Pne(r.node,n.focusOptions),ty--}};const DT=Ane;function FT(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Tne=function(){return document&&document.activeElement===document.body},Ine=function(){return Tne()||bne()},_u=null,fu=null,ku=null,ff=!1,One=function(){return!0},Rne=function(t){return(_u.whiteList||One)(t)},Mne=function(t,n){ku={observerNode:t,portaledElement:n}},Nne=function(t){return ku&&ku.portaledElement===t};function N7(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else if(a.lockItem){if(i!==e)return;o=null}else break}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var $ne=function(t){return t&&"current"in t?t.current:t},Dne=function(t){return t?Boolean(ff):ff==="meanwhile"},Fne=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},zne=function(t,n){return n.some(function(r){return Fne(t,r,r)})},R0=function(){var t=!1;if(_u){var n=_u,r=n.observed,o=n.persistentFocus,i=n.autoFocus,a=n.shards,l=n.crossFrame,c=n.focusOptions,d=r||ku&&ku.portaledElement,f=document&&document.activeElement;if(d){var p=[d].concat(a.map($ne).filter(Boolean));if((!f||Rne(f))&&(o||Dne(l)||!Ine()||!fu&&i)&&(d&&!(MT(p)||f&&zne(f,p)||Nne(f))&&(document&&!fu&&f&&!i?(f.blur&&f.blur(),document.body.focus()):(t=DT(p,fu,{focusOptions:c}),ku={})),ff=!1,fu=document&&document.activeElement),document){var m=document&&document.activeElement,g=Lne(p),y=g.map(function(b){var k=b.node;return k}).indexOf(m);y>-1&&(g.filter(function(b){var k=b.guard,C=b.node;return k&&C.dataset.focusAutoGuard}).forEach(function(b){var k=b.node;return k.removeAttribute("tabIndex")}),N7(y,g.length,1,g),N7(y,-1,-1,g))}}}return t},zT=function(t){R0()&&t&&(t.stopPropagation(),t.preventDefault())},Cx=function(){return FT(R0)},Bne=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Mne(r,n)},Vne=function(){return null},BT=function(){ff="just",setTimeout(function(){ff="meanwhile"},0)},Wne=function(){document.addEventListener("focusin",zT),document.addEventListener("focusout",Cx),window.addEventListener("blur",BT)},Une=function(){document.removeEventListener("focusin",zT),document.removeEventListener("focusout",Cx),window.removeEventListener("blur",BT)};function Hne(e){return e.filter(function(t){var n=t.disabled;return!n})}function jne(e){var t=e.slice(-1)[0];t&&!_u&&Wne();var n=_u,r=n&&t&&t.id===n.id;_u=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(fu=null,(!r||n.observed!==t.observed)&&t.onActivation(),R0(),FT(R0)):(Une(),fu=null)}xT.assignSyncMedium(Bne);wT.assignMedium(Cx);Qte.assignMedium(function(e){return e({moveFocusInside:DT,focusInside:MT})});const Gne=rne(Hne,jne)(Vne);var VT=v.exports.forwardRef(function(t,n){return x(ST,{sideCar:Gne,ref:n,...t})}),WT=ST.propTypes||{};WT.sideCar;Vte(WT,["sideCar"]);VT.propTypes={};const Zne=VT;var UT=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:a,autoFocus:l,persistentFocus:c,lockFocusAcrossFrames:d}=e,f=v.exports.useCallback(()=>{t?.current?t.current.focus():r?.current&&dee(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),p=v.exports.useCallback(()=>{var g;(g=n?.current)==null||g.focus()},[n]);return x(Zne,{crossFrame:d,persistentFocus:c,autoFocus:l,disabled:a,onActivation:f,onDeactivation:p,returnFocus:o&&!n,children:i})};UT.displayName="FocusLock";var _1="right-scroll-bar-position",k1="width-before-scroll-bar",Kne="with-scroll-bars-hidden",qne="--removed-body-scroll-bar-size",HT=yT(),ry=function(){},og=v.exports.forwardRef(function(e,t){var n=v.exports.useRef(null),r=v.exports.useState({onScrollCapture:ry,onWheelCapture:ry,onTouchMoveCapture:ry}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,g=e.noIsolation,y=e.inert,b=e.allowPinchZoom,k=e.as,C=k===void 0?"div":k,S=Vm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=m,E=mT([n,t]),A=ai(ai({},S),o);return Y(wn,{children:[f&&x(_,{sideCar:HT,removeScrollBar:d,shards:p,noIsolation:g,inert:y,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),a?v.exports.cloneElement(v.exports.Children.only(l),ai(ai({},A),{ref:E})):x(C,{...ai({},A,{className:c,ref:E}),children:l})]})});og.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};og.classNames={fullWidth:k1,zeroRight:_1};var Yne=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xne(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Yne();return t&&e.setAttribute("nonce",t),e}function Qne(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jne(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ere=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xne())&&(Qne(t,n),Jne(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tre=function(){var e=ere();return function(t,n){v.exports.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jT=function(){var e=tre(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},nre={left:0,top:0,right:0,gap:0},oy=function(e){return parseInt(e||"",10)||0},rre=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[oy(n),oy(r),oy(o)]},ore=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nre;var t=rre(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])}},ire=jT(),are=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Kne,` { - 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(i,`px; - padding-right: `).concat(a,`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(_1,` { - right: `).concat(l,"px ").concat(r,`; - } - - .`).concat(k1,` { - margin-right: `).concat(l,"px ").concat(r,`; - } - - .`).concat(_1," .").concat(_1,` { - right: 0 `).concat(r,`; - } - - .`).concat(k1," .").concat(k1,` { - margin-right: 0 `).concat(r,`; - } - - body { - `).concat(qne,": ").concat(l,`px; - } -`)},sre=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=v.exports.useMemo(function(){return ore(o)},[o]);return x(ire,{styles:are(i,!t,o,n?"":"!important")})},C4=!1;if(typeof window<"u")try{var zh=Object.defineProperty({},"passive",{get:function(){return C4=!0,!0}});window.addEventListener("test",zh,zh),window.removeEventListener("test",zh,zh)}catch{C4=!1}var Wl=C4?{passive:!1}:!1,lre=function(e){return e.tagName==="TEXTAREA"},GT=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lre(e)&&n[t]==="visible")},ure=function(e){return GT(e,"overflowY")},cre=function(e){return GT(e,"overflowX")},$7=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=ZT(e,n);if(r){var o=KT(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},dre=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},fre=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ZT=function(e,t){return e==="v"?ure(t):cre(t)},KT=function(e,t){return e==="v"?dre(t):fre(t)},pre=function(e,t){return e==="h"&&t==="rtl"?-1:1},hre=function(e,t,n,r,o){var i=pre(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),d=!1,f=a>0,p=0,m=0;do{var g=KT(e,l),y=g[0],b=g[1],k=g[2],C=b-k-i*y;(y||C)&&ZT(e,l)&&(p+=C,m+=y),l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(f&&(o&&p===0||!o&&a>p)||!f&&(o&&m===0||!o&&-a>m))&&(d=!0),d},Bh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},D7=function(e){return[e.deltaX,e.deltaY]},F7=function(e){return e&&"current"in e?e.current:e},mre=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gre=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},vre=0,Ul=[];function yre(e){var t=v.exports.useRef([]),n=v.exports.useRef([0,0]),r=v.exports.useRef(),o=v.exports.useState(vre++)[0],i=v.exports.useState(function(){return jT()})[0],a=v.exports.useRef(e);v.exports.useEffect(function(){a.current=e},[e]),v.exports.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=j5([e.lockRef.current],(e.shards||[]).map(F7),!0).filter(Boolean);return b.forEach(function(k){return k.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=v.exports.useCallback(function(b,k){if("touches"in b&&b.touches.length===2)return!a.current.allowPinchZoom;var C=Bh(b),S=n.current,_="deltaX"in b?b.deltaX:S[0]-C[0],E="deltaY"in b?b.deltaY:S[1]-C[1],A,R=b.target,O=Math.abs(_)>Math.abs(E)?"h":"v";if("touches"in b&&O==="h"&&R.type==="range")return!1;var $=$7(O,R);if(!$)return!0;if($?A=O:(A=O==="v"?"h":"v",$=$7(O,R)),!$)return!1;if(!r.current&&"changedTouches"in b&&(_||E)&&(r.current=A),!A)return!0;var H=r.current||A;return hre(H,k,b,H==="h"?_:E,!0)},[]),c=v.exports.useCallback(function(b){var k=b;if(!(!Ul.length||Ul[Ul.length-1]!==i)){var C="deltaY"in k?D7(k):Bh(k),S=t.current.filter(function(A){return A.name===k.type&&A.target===k.target&&mre(A.delta,C)})[0];if(S&&S.should){k.cancelable&&k.preventDefault();return}if(!S){var _=(a.current.shards||[]).map(F7).filter(Boolean).filter(function(A){return A.contains(k.target)}),E=_.length>0?l(k,_[0]):!a.current.noIsolation;E&&k.cancelable&&k.preventDefault()}}},[]),d=v.exports.useCallback(function(b,k,C,S){var _={name:b,delta:k,target:C,should:S};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(E){return E!==_})},1)},[]),f=v.exports.useCallback(function(b){n.current=Bh(b),r.current=void 0},[]),p=v.exports.useCallback(function(b){d(b.type,D7(b),b.target,l(b,e.lockRef.current))},[]),m=v.exports.useCallback(function(b){d(b.type,Bh(b),b.target,l(b,e.lockRef.current))},[]);v.exports.useEffect(function(){return Ul.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Wl),document.addEventListener("touchmove",c,Wl),document.addEventListener("touchstart",f,Wl),function(){Ul=Ul.filter(function(b){return b!==i}),document.removeEventListener("wheel",c,Wl),document.removeEventListener("touchmove",c,Wl),document.removeEventListener("touchstart",f,Wl)}},[]);var g=e.removeScrollBar,y=e.inert;return Y(wn,{children:[y?x(i,{styles:gre(o)}):null,g?x(sre,{gapMode:"margin"}):null]})}const bre=Xte(HT,yre);var qT=v.exports.forwardRef(function(e,t){return x(og,{...ai({},e,{ref:t,sideCar:bre})})});qT.classNames=og.classNames;const YT=qT;var ul=(...e)=>e.filter(Boolean).join(" ");function rd(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var xre=class{modals;constructor(){this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},_4=new xre;function wre(e,t){v.exports.useEffect(()=>(t&&_4.add(e),()=>{_4.remove(e)}),[t,e])}function Sre(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:a=!0,onOverlayClick:l,onEsc:c}=e,d=v.exports.useRef(null),f=v.exports.useRef(null),[p,m,g]=_re(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Cre(d,t&&a),wre(d,t);const y=v.exports.useRef(null),b=v.exports.useCallback($=>{y.current=$.target},[]),k=v.exports.useCallback($=>{$.key==="Escape"&&($.stopPropagation(),i&&n?.(),c?.())},[i,n,c]),[C,S]=v.exports.useState(!1),[_,E]=v.exports.useState(!1),A=v.exports.useCallback(($={},H=null)=>({role:"dialog",...$,ref:Qt(H,d),id:p,tabIndex:-1,"aria-modal":!0,"aria-labelledby":C?m:void 0,"aria-describedby":_?g:void 0,onClick:rd($.onClick,z=>z.stopPropagation())}),[g,_,p,m,C]),R=v.exports.useCallback($=>{$.stopPropagation(),y.current===$.target&&(!_4.isTopModal(d)||(o&&n?.(),l?.()))},[n,o,l]),O=v.exports.useCallback(($={},H=null)=>({...$,ref:Qt(H,f),onClick:rd($.onClick,R),onKeyDown:rd($.onKeyDown,k),onMouseDown:rd($.onMouseDown,b)}),[k,b,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:g,setBodyMounted:E,setHeaderMounted:S,dialogRef:d,overlayRef:f,getDialogProps:A,getDialogContainerProps:O}}function Cre(e,t){const n=e.current;v.exports.useEffect(()=>{if(!(!e.current||!t))return dT(e.current)},[t,e,n])}function _re(e,...t){const n=v.exports.useId(),r=e||n;return v.exports.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[kre,cl]=Rt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Ere,is]=Rt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Uu=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:o,initialFocusRef:i,finalFocusRef:a,returnFocusOnClose:l,blockScrollOnMount:c,allowPinchZoom:d,preserveScrollBarGap:f,motionPreset:p,lockFocusAcrossFrames:m,onCloseComplete:g}=e,y=dr("Modal",e),k={...Sre(e),autoFocus:r,trapFocus:o,initialFocusRef:i,finalFocusRef:a,returnFocusOnClose:l,blockScrollOnMount:c,allowPinchZoom:d,preserveScrollBarGap:f,motionPreset:p,lockFocusAcrossFrames:m};return x(Ere,{value:k,children:x(kre,{value:y,children:x(da,{onExitComplete:g,children:k.isOpen&&x(ll,{...t,children:n})})})})};Uu.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Uu.displayName="Modal";var M0=fe((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=is();v.exports.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=ul("chakra-modal__body",n),l=cl();return Q.createElement(ie.div,{ref:t,className:a,id:o,...r,__css:l.body})});M0.displayName="ModalBody";var _x=fe((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=is(),a=ul("chakra-modal__close-btn",r),l=cl();return x(tg,{ref:t,__css:l.closeButton,className:a,onClick:rd(n,c=>{c.stopPropagation(),i()}),...o})});_x.displayName="ModalCloseButton";function XT(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:a,finalFocusRef:l,returnFocusOnClose:c,preserveScrollBarGap:d,lockFocusAcrossFrames:f}=is(),[p,m]=Fb();return v.exports.useEffect(()=>{!p&&m&&setTimeout(m)},[p,m]),x(UT,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:c,contentRef:r,lockFocusAcrossFrames:f,children:x(YT,{removeScrollBar:!d,allowPinchZoom:a,enabled:i,forwardProps:!0,children:e.children})})}var Lre={slideInBottom:{...l4,custom:{offsetY:16,reverse:!0}},slideInRight:{...l4,custom:{offsetX:16,reverse:!0}},scale:{...fA,custom:{initialScale:.95,reverse:!0}},none:{}},Pre=ie(bo.section),QT=v.exports.forwardRef((e,t)=>{const{preset:n,...r}=e,o=Lre[n];return x(Pre,{ref:t,...o,...r})});QT.displayName="ModalTransition";var pf=fe((e,t)=>{const{className:n,children:r,containerProps:o,...i}=e,{getDialogProps:a,getDialogContainerProps:l}=is(),c=a(i,t),d=l(o),f=ul("chakra-modal__content",n),p=cl(),m={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...p.dialog},g={display:"flex",width:"100vw",height:"100vh","@supports(height: -webkit-fill-available)":{height:"-webkit-fill-available"},position:"fixed",left:0,top:0,...p.dialogContainer},{motionPreset:y}=is();return Q.createElement(XT,null,Q.createElement(ie.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:g},x(QT,{preset:y,className:f,...c,__css:m,children:r})))});pf.displayName="ModalContent";var kx=fe((e,t)=>{const{className:n,...r}=e,o=ul("chakra-modal__footer",n),i=cl(),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...i.footer};return Q.createElement(ie.footer,{ref:t,...r,__css:a,className:o})});kx.displayName="ModalFooter";var Ex=fe((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=is();v.exports.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=ul("chakra-modal__header",n),l=cl(),c={flex:0,...l.header};return Q.createElement(ie.header,{ref:t,className:a,id:o,...r,__css:c})});Ex.displayName="ModalHeader";var Are=ie(bo.div),hf=fe((e,t)=>{const{className:n,transition:r,...o}=e,i=ul("chakra-modal__overlay",n),a=cl(),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...a.overlay},{motionPreset:c}=is();return x(Are,{...c==="none"?{}:dA,__css:l,ref:t,className:i,...o})});hf.displayName="ModalOverlay";function Tre(e){const{leastDestructiveRef:t,...n}=e;return x(Uu,{...n,initialFocusRef:t})}var Ire=fe((e,t)=>x(pf,{ref:t,role:"alertdialog",...e})),[j2e,Ore]=Rt(),Rre=ie(pA),Mre=fe((e,t)=>{const{className:n,children:r,...o}=e,{getDialogProps:i,getDialogContainerProps:a,isOpen:l}=is(),c=i(o,t),d=a(),f=ul("chakra-modal__content",n),p=cl(),m={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...p.dialog},g={display:"flex",width:"100vw",height:"100vh",position:"fixed",left:0,top:0,...p.dialogContainer},{placement:y}=Ore();return Q.createElement(ie.div,{...d,className:"chakra-modal__content-container",__css:g},x(XT,{children:x(Rre,{direction:y,in:l,className:f,...c,__css:m,children:r})}))});Mre.displayName="DrawerContent";function Nre(e,t){const n=Zn(e);v.exports.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var JT=(...e)=>e.filter(Boolean).join(" "),iy=e=>e?!0:void 0;function Yo(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var $re=e=>x(Yr,{viewBox:"0 0 24 24",...e,children:x("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"})}),Dre=e=>x(Yr,{viewBox:"0 0 24 24",...e,children:x("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 z7(e,t,n,r){v.exports.useEffect(()=>{if(!e.current||!r)return;const o=e.current.ownerDocument.defaultView??window,i=Array.isArray(t)?t:[t],a=new o.MutationObserver(l=>{for(const c of l)c.type==="attributes"&&c.attributeName&&i.includes(c.attributeName)&&n(c)});return a.observe(e.current,{attributes:!0,attributeFilter:i}),()=>a.disconnect()})}var Fre=50,B7=300;function zre(e,t){const[n,r]=v.exports.useState(!1),[o,i]=v.exports.useState(null),[a,l]=v.exports.useState(!0),c=v.exports.useRef(null),d=()=>clearTimeout(c.current);Nre(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?Fre:null);const f=v.exports.useCallback(()=>{a&&e(),c.current=setTimeout(()=>{l(!1),r(!0),i("increment")},B7)},[e,a]),p=v.exports.useCallback(()=>{a&&t(),c.current=setTimeout(()=>{l(!1),r(!0),i("decrement")},B7)},[t,a]),m=v.exports.useCallback(()=>{l(!0),r(!1),d()},[]);return v.exports.useEffect(()=>()=>d(),[]),{up:f,down:p,stop:m,isSpinning:n}}var Bre=/^[Ee0-9+\-.]$/;function Vre(e){return Bre.test(e)}function Wre(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 Ure(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:l,isDisabled:c,isRequired:d,isInvalid:f,pattern:p="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:g,id:y,onChange:b,precision:k,name:C,"aria-describedby":S,"aria-label":_,"aria-labelledby":E,onFocus:A,onBlur:R,onInvalid:O,getAriaValueText:$,isValidCharacter:H,format:z,parse:X,...he}=e,ye=Zn(A),oe=Zn(R),pe=Zn(O),ge=Zn(H??Vre),J=Zn($),D=aJ(e),{update:Z,increment:j,decrement:M}=D,[G,le]=v.exports.useState(!1),ce=!(l||c),be=v.exports.useRef(null),me=v.exports.useRef(null),_e=v.exports.useRef(null),ue=v.exports.useRef(null),we=v.exports.useCallback(ae=>ae.split("").filter(ge).join(""),[ge]),$e=v.exports.useCallback(ae=>X?.(ae)??ae,[X]),rt=v.exports.useCallback(ae=>(z?.(ae)??ae).toString(),[z]);A0(()=>{(D.valueAsNumber>i||D.valueAsNumber{if(!be.current)return;if(be.current.value!=D.value){const Ge=$e(be.current.value);D.setValue(we(Ge))}},[$e,we]);const Ct=v.exports.useCallback((ae=a)=>{ce&&j(ae)},[j,ce,a]),un=v.exports.useCallback((ae=a)=>{ce&&M(ae)},[M,ce,a]),Se=zre(Ct,un);z7(_e,"disabled",Se.stop,Se.isSpinning),z7(ue,"disabled",Se.stop,Se.isSpinning);const Ie=v.exports.useCallback(ae=>{if(ae.nativeEvent.isComposing)return;const Pt=$e(ae.currentTarget.value);Z(we(Pt)),me.current={start:ae.currentTarget.selectionStart,end:ae.currentTarget.selectionEnd}},[Z,we,$e]),Qe=v.exports.useCallback(ae=>{var Ge;ye?.(ae),me.current&&(ae.target.selectionStart=me.current.start??((Ge=ae.currentTarget.value)==null?void 0:Ge.length),ae.currentTarget.selectionEnd=me.current.end??ae.currentTarget.selectionStart)},[ye]),Oe=v.exports.useCallback(ae=>{if(ae.nativeEvent.isComposing)return;Wre(ae,ge)||ae.preventDefault();const Ge=ft(ae)*a,Pt=ae.key,zn={ArrowUp:()=>Ct(Ge),ArrowDown:()=>un(Ge),Home:()=>Z(o),End:()=>Z(i)}[Pt];zn&&(ae.preventDefault(),zn(ae))},[ge,a,Ct,un,Z,o,i]),ft=ae=>{let Ge=1;return(ae.metaKey||ae.ctrlKey)&&(Ge=.1),ae.shiftKey&&(Ge=10),Ge},tn=v.exports.useMemo(()=>{const ae=J?.(D.value);if(ae!=null)return ae;const Ge=D.value.toString();return Ge||void 0},[D.value,J]),Je=v.exports.useCallback(()=>{let ae=D.value;ae!==""&&(D.valueAsNumberi&&(ae=i),D.cast(ae))},[D,i,o]),_t=v.exports.useCallback(()=>{le(!1),n&&Je()},[n,le,Je]),nn=v.exports.useCallback(()=>{t&&requestAnimationFrame(()=>{var ae;(ae=be.current)==null||ae.focus()})},[t]),qt=v.exports.useCallback(ae=>{ae.preventDefault(),Se.up(),nn()},[nn,Se]),ve=v.exports.useCallback(ae=>{ae.preventDefault(),Se.down(),nn()},[nn,Se]);f4(()=>be.current,"wheel",ae=>{var Ge;const Ln=(((Ge=be.current)==null?void 0:Ge.ownerDocument)??document).activeElement===be.current;if(!g||!Ln)return;ae.preventDefault();const zn=ft(ae)*a,Tr=Math.sign(ae.deltaY);Tr===-1?Ct(zn):Tr===1&&un(zn)},{passive:!1});const Pe=v.exports.useCallback((ae={},Ge=null)=>{const Pt=c||r&&D.isAtMax;return{...ae,ref:Qt(Ge,_e),role:"button",tabIndex:-1,onPointerDown:Yo(ae.onPointerDown,Ln=>{Pt||qt(Ln)}),onPointerLeave:Yo(ae.onPointerLeave,Se.stop),onPointerUp:Yo(ae.onPointerUp,Se.stop),disabled:Pt,"aria-disabled":iy(Pt)}},[D.isAtMax,r,qt,Se.stop,c]),pt=v.exports.useCallback((ae={},Ge=null)=>{const Pt=c||r&&D.isAtMin;return{...ae,ref:Qt(Ge,ue),role:"button",tabIndex:-1,onPointerDown:Yo(ae.onPointerDown,Ln=>{Pt||ve(Ln)}),onPointerLeave:Yo(ae.onPointerLeave,Se.stop),onPointerUp:Yo(ae.onPointerUp,Se.stop),disabled:Pt,"aria-disabled":iy(Pt)}},[D.isAtMin,r,ve,Se.stop,c]),ut=v.exports.useCallback((ae={},Ge=null)=>({name:C,inputMode:m,type:"text",pattern:p,"aria-labelledby":E,"aria-label":_,"aria-describedby":S,id:y,disabled:c,...ae,readOnly:ae.readOnly??l,"aria-readonly":ae.readOnly??l,"aria-required":ae.required??d,required:ae.required??d,ref:Qt(be,Ge),value:rt(D.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":Number.isNaN(D.valueAsNumber)?void 0:D.valueAsNumber,"aria-invalid":iy(f??D.isOutOfRange),"aria-valuetext":tn,autoComplete:"off",autoCorrect:"off",onChange:Yo(ae.onChange,Ie),onKeyDown:Yo(ae.onKeyDown,Oe),onFocus:Yo(ae.onFocus,Qe,()=>le(!0)),onBlur:Yo(ae.onBlur,oe,_t)}),[C,m,p,E,_,rt,S,y,c,d,l,f,D.value,D.valueAsNumber,D.isOutOfRange,o,i,tn,Ie,Oe,Qe,oe,_t]);return{value:rt(D.value),valueAsNumber:D.valueAsNumber,isFocused:G,isDisabled:c,isReadOnly:l,getIncrementButtonProps:Pe,getDecrementButtonProps:pt,getInputProps:ut,htmlProps:he}}var[Hre,ig]=Rt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[jre,Lx]=Rt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),eI=fe(function(t,n){const r=dr("NumberInput",t),o=yt(t),i=Yb(o),{htmlProps:a,...l}=Ure(i),c=v.exports.useMemo(()=>l,[l]);return Q.createElement(jre,{value:c},Q.createElement(Hre,{value:r},Q.createElement(ie.div,{...a,ref:n,className:JT("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});eI.displayName="NumberInput";var Gre=fe(function(t,n){const r=ig();return Q.createElement(ie.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}})});Gre.displayName="NumberInputStepper";var tI=fe(function(t,n){const{getInputProps:r}=Lx(),o=r(t,n),i=ig();return Q.createElement(ie.input,{...o,className:JT("chakra-numberinput__field",t.className),__css:{width:"100%",...i.field}})});tI.displayName="NumberInputField";var nI=ie("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),rI=fe(function(t,n){const r=ig(),{getDecrementButtonProps:o}=Lx(),i=o(t,n);return x(nI,{...i,__css:r.stepper,children:t.children??x($re,{})})});rI.displayName="NumberDecrementStepper";var oI=fe(function(t,n){const{getIncrementButtonProps:r}=Lx(),o=r(t,n),i=ig();return x(nI,{...o,__css:i.stepper,children:t.children??x(Dre,{})})});oI.displayName="NumberIncrementStepper";var Wf=(...e)=>e.filter(Boolean).join(" ");function Zre(e,...t){return Kre(e)?e(...t):e}var Kre=e=>typeof e=="function";function Xo(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function qre(...e){return function(n){e.forEach(r=>{r?.(n)})}}var[Yre,dl]=Rt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[Xre,Uf]=Rt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Hl={click:"click",hover:"hover"};function Qre(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:i=!0,autoFocus:a=!0,arrowSize:l,arrowShadowColor:c,trigger:d=Hl.click,openDelay:f=200,closeDelay:p=200,isLazy:m,lazyBehavior:g="unmount",computePositionOnMount:y,...b}=e,{isOpen:k,onClose:C,onOpen:S,onToggle:_}=sT(e),E=v.exports.useRef(null),A=v.exports.useRef(null),R=v.exports.useRef(null),O=v.exports.useRef(!1),$=v.exports.useRef(!1);k&&($.current=!0);const[H,z]=v.exports.useState(!1),[X,he]=v.exports.useState(!1),ye=v.exports.useId(),oe=o??ye,[pe,ge,J,D]=["popover-trigger","popover-content","popover-header","popover-body"].map(Ie=>`${Ie}-${oe}`),{referenceRef:Z,getArrowProps:j,getPopperProps:M,getArrowInnerProps:G,forceUpdate:le}=aT({...b,enabled:k||!!y}),ce=cJ({isOpen:k,ref:R});gJ({enabled:k,ref:A}),hJ(R,{focusRef:A,visible:k,shouldFocus:i&&d===Hl.click}),yJ(R,{focusRef:r,visible:k,shouldFocus:a&&d===Hl.click});const be=lT({wasSelected:$.current,enabled:m,mode:g,isSelected:ce.present}),me=v.exports.useCallback((Ie={},Qe=null)=>{const Oe={...Ie,style:{...Ie.style,transformOrigin:pn.transformOrigin.varRef,[pn.arrowSize.var]:l?`${l}px`:void 0,[pn.arrowShadowColor.var]:c},ref:Qt(R,Qe),children:be?Ie.children:null,id:ge,tabIndex:-1,role:"dialog",onKeyDown:Xo(Ie.onKeyDown,ft=>{n&&ft.key==="Escape"&&C()}),onBlur:Xo(Ie.onBlur,ft=>{const tn=V7(ft),Je=ay(R.current,tn),_t=ay(A.current,tn);k&&t&&(!Je&&!_t)&&C()}),"aria-labelledby":H?J:void 0,"aria-describedby":X?D:void 0};return d===Hl.hover&&(Oe.role="tooltip",Oe.onMouseEnter=Xo(Ie.onMouseEnter,()=>{O.current=!0}),Oe.onMouseLeave=Xo(Ie.onMouseLeave,ft=>{ft.nativeEvent.relatedTarget!==null&&(O.current=!1,setTimeout(C,p))})),Oe},[be,ge,H,J,X,D,d,n,C,k,t,p,c,l]),_e=v.exports.useCallback((Ie={},Qe=null)=>M({...Ie,style:{visibility:k?"visible":"hidden",...Ie.style}},Qe),[k,M]),ue=v.exports.useCallback((Ie,Qe=null)=>({...Ie,ref:Qt(Qe,E,Z)}),[E,Z]),we=v.exports.useRef(),$e=v.exports.useRef(),rt=v.exports.useCallback(Ie=>{E.current==null&&Z(Ie)},[Z]),Ct=v.exports.useCallback((Ie={},Qe=null)=>{const Oe={...Ie,ref:Qt(A,Qe,rt),id:pe,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":ge};return d===Hl.click&&(Oe.onClick=Xo(Ie.onClick,_)),d===Hl.hover&&(Oe.onFocus=Xo(Ie.onFocus,()=>{we.current===void 0&&S()}),Oe.onBlur=Xo(Ie.onBlur,ft=>{const tn=V7(ft),Je=!ay(R.current,tn);k&&t&&Je&&C()}),Oe.onKeyDown=Xo(Ie.onKeyDown,ft=>{ft.key==="Escape"&&C()}),Oe.onMouseEnter=Xo(Ie.onMouseEnter,()=>{O.current=!0,we.current=window.setTimeout(S,f)}),Oe.onMouseLeave=Xo(Ie.onMouseLeave,()=>{O.current=!1,we.current&&(clearTimeout(we.current),we.current=void 0),$e.current=window.setTimeout(()=>{O.current===!1&&C()},p)})),Oe},[pe,k,ge,d,rt,_,S,t,C,f,p]);v.exports.useEffect(()=>()=>{we.current&&clearTimeout(we.current),$e.current&&clearTimeout($e.current)},[]);const un=v.exports.useCallback((Ie={},Qe=null)=>({...Ie,id:J,ref:Qt(Qe,Oe=>{z(!!Oe)})}),[J]),Se=v.exports.useCallback((Ie={},Qe=null)=>({...Ie,id:D,ref:Qt(Qe,Oe=>{he(!!Oe)})}),[D]);return{forceUpdate:le,isOpen:k,onAnimationComplete:ce.onComplete,onClose:C,getAnchorProps:ue,getArrowProps:j,getArrowInnerProps:G,getPopoverPositionerProps:_e,getPopoverProps:me,getTriggerProps:Ct,getHeaderProps:un,getBodyProps:Se}}function ay(e,t){return e===t||e?.contains(t)}function V7(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function Px(e){const t=dr("Popover",e),{children:n,...r}=yt(e),o=Nm(),i=Qre({...r,direction:o.direction});return x(Yre,{value:i,children:x(Xre,{value:t,children:Zre(n,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}Px.displayName="Popover";function Ax(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:o,getArrowInnerProps:i}=dl(),a=Uf(),l=t??n??r;return Q.createElement(ie.div,{...o(),className:"chakra-popover__arrow-positioner"},Q.createElement(ie.div,{className:Wf("chakra-popover__arrow",e.className),...i(e),__css:{...a.arrow,"--popper-arrow-bg":l?`colors.${l}, ${l}`:void 0}}))}Ax.displayName="PopoverArrow";var Jre=fe(function(t,n){const{getBodyProps:r}=dl(),o=Uf();return Q.createElement(ie.div,{...r(t,n),className:Wf("chakra-popover__body",t.className),__css:o.body})});Jre.displayName="PopoverBody";var eoe=fe(function(t,n){const{onClose:r}=dl(),o=Uf();return x(tg,{size:"sm",onClick:r,className:Wf("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});eoe.displayName="PopoverCloseButton";function toe(e){if(!!e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var noe={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]}}},roe=bo(ie.section),Tx=fe(function(t,n){const{isOpen:r}=dl();return Q.createElement(roe,{ref:n,variants:toe(t.variants),...t,initial:!1,animate:r?"enter":"exit"})});Tx.defaultProps={variants:noe};Tx.displayName="PopoverTransition";var Ix=fe(function(t,n){const{rootProps:r,...o}=t,{getPopoverProps:i,getPopoverPositionerProps:a,onAnimationComplete:l}=dl(),c=Uf(),d={position:"relative",display:"flex",flexDirection:"column",...c.content};return Q.createElement(ie.div,{...a(r),__css:c.popper,className:"chakra-popover__popper"},x(Tx,{...i(o,n),onAnimationComplete:qre(l,o.onAnimationComplete),className:Wf("chakra-popover__content",t.className),__css:d}))});Ix.displayName="PopoverContent";var iI=fe(function(t,n){const{getHeaderProps:r}=dl(),o=Uf();return Q.createElement(ie.header,{...r(t,n),className:Wf("chakra-popover__header",t.className),__css:o.header})});iI.displayName="PopoverHeader";function Ox(e){const t=v.exports.Children.only(e.children),{getTriggerProps:n}=dl();return v.exports.cloneElement(t,n(t.props,t.ref))}Ox.displayName="PopoverTrigger";function ooe(e,t,n){return(e-t)*100/(n-t)}Tf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});Tf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var ioe=Tf({"0%":{left:"-40%"},"100%":{left:"100%"}}),aoe=Tf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function soe(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:i,isIndeterminate:a}=e,l=ooe(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof i=="function"?i(t,l):o})(),role:"progressbar"},percent:l,value:t}}var[loe,uoe]=Rt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),coe=e=>{const{min:t,max:n,value:r,isIndeterminate:o,...i}=e,a=soe({value:r,min:t,max:n,isIndeterminate:o}),l=uoe(),c={height:"100%",...l.filledTrack};return Q.createElement(ie.div,{style:{width:`${a.percent}%`,...i.style},...a.bind,...i,__css:c})},aI=e=>{var t;const{value:n,min:r=0,max:o=100,hasStripe:i,isAnimated:a,children:l,borderRadius:c,isIndeterminate:d,"aria-label":f,"aria-labelledby":p,...m}=yt(e),g=dr("Progress",e),y=c??((t=g.track)==null?void 0:t.borderRadius),b={animation:`${aoe} 1s linear infinite`},S={...!d&&i&&a&&b,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${ioe} 1s ease infinite normal none running`}},_={overflow:"hidden",position:"relative",...g.track};return Q.createElement(ie.div,{borderRadius:y,__css:_,...m},Y(loe,{value:g,children:[x(coe,{"aria-label":f,"aria-labelledby":p,min:r,max:o,value:n,isIndeterminate:d,css:S,borderRadius:y}),l]}))};aI.displayName="Progress";var doe=ie("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});doe.displayName="CircularProgressLabel";var foe=(...e)=>e.filter(Boolean).join(" "),poe=e=>e?"":void 0;function hoe(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}var sI=fe(function(t,n){const{children:r,placeholder:o,className:i,...a}=t;return Q.createElement(ie.select,{...a,ref:n,className:foe("chakra-select",i)},o&&x("option",{value:"",children:o}),r)});sI.displayName="SelectField";var lI=fe((e,t)=>{var n;const r=dr("Select",e),{rootProps:o,placeholder:i,icon:a,color:l,height:c,h:d,minH:f,minHeight:p,iconColor:m,iconSize:g,...y}=yt(e),[b,k]=hoe(y,CH),C=qb(k),S={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 Q.createElement(ie.div,{className:"chakra-select__wrapper",__css:S,...b,...o},x(sI,{ref:t,height:d??c,minH:f??p,placeholder:i,...C,__css:_,children:e.children}),x(uI,{"data-disabled":poe(C.disabled),...(m||l)&&{color:m||l},__css:r.icon,...g&&{fontSize:g},children:a}))});lI.displayName="Select";var moe=e=>x("svg",{viewBox:"0 0 24 24",...e,children:x("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),goe=ie("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),uI=e=>{const{children:t=x(moe,{}),...n}=e,r=v.exports.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return x(goe,{...n,className:"chakra-select__icon-wrapper",children:v.exports.isValidElement(t)?r:null})};uI.displayName="SelectIcon";var voe=(...e)=>e.filter(Boolean).join(" "),W7=e=>e?"":void 0,ag=fe(function(t,n){const r=dr("Switch",t),{spacing:o="0.5rem",children:i,...a}=yt(t),{state:l,getInputProps:c,getCheckboxProps:d,getRootProps:f,getLabelProps:p}=TA(a),m=v.exports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),g=v.exports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),y=v.exports.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return Q.createElement(ie.label,{...f(),className:voe("chakra-switch",t.className),__css:m},x("input",{className:"chakra-switch__input",...c({},n)}),Q.createElement(ie.span,{...d(),className:"chakra-switch__track",__css:g},Q.createElement(ie.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":W7(l.isChecked),"data-hover":W7(l.isHovered)})),i&&Q.createElement(ie.span,{className:"chakra-switch__label",...p(),__css:y},i))});ag.displayName="Switch";var rc=(...e)=>e.filter(Boolean).join(" ");function k4(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var[yoe,cI,boe,xoe]=NL();function woe(e){const{defaultIndex:t,onChange:n,index:r,isManual:o,isLazy:i,lazyBehavior:a="unmount",orientation:l="horizontal",direction:c="ltr",...d}=e,[f,p]=v.exports.useState(t??0),[m,g]=$L({defaultValue:t??0,value:r,onChange:n});v.exports.useEffect(()=>{r!=null&&p(r)},[r]);const y=boe(),b=v.exports.useId();return{id:`tabs-${e.id??b}`,selectedIndex:m,focusedIndex:f,setSelectedIndex:g,setFocusedIndex:p,isManual:o,isLazy:i,lazyBehavior:a,orientation:l,descendants:y,direction:c,htmlProps:d}}var[Soe,Hf]=Rt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function Coe(e){const{focusedIndex:t,orientation:n,direction:r}=Hf(),o=cI(),i=v.exports.useCallback(a=>{const l=()=>{var S;const _=o.nextEnabled(t);_&&((S=_.node)==null||S.focus())},c=()=>{var S;const _=o.prevEnabled(t);_&&((S=_.node)==null||S.focus())},d=()=>{var S;const _=o.firstEnabled();_&&((S=_.node)==null||S.focus())},f=()=>{var S;const _=o.lastEnabled();_&&((S=_.node)==null||S.focus())},p=n==="horizontal",m=n==="vertical",g=a.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",b=r==="ltr"?"ArrowRight":"ArrowLeft",C={[y]:()=>p&&c(),[b]:()=>p&&l(),ArrowDown:()=>m&&l(),ArrowUp:()=>m&&c(),Home:d,End:f}[g];C&&(a.preventDefault(),C(a))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:k4(e.onKeyDown,i)}}function _oe(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:i,id:a,setFocusedIndex:l,selectedIndex:c}=Hf(),{index:d,register:f}=xoe({disabled:t&&!n}),p=d===c,m=()=>{o(d)},g=()=>{l(d),!i&&!(t&&n)&&o(d)},y=tee({...r,ref:Qt(f,e.ref),isDisabled:t,isFocusable:n,onClick:k4(e.onClick,m)}),b="button";return{...y,id:dI(a,d),role:"tab",tabIndex:p?0:-1,type:b,"aria-selected":p,"aria-controls":fI(a,d),onFocus:t?void 0:k4(e.onFocus,g)}}var[koe,Eoe]=Rt({});function Loe(e){const t=Hf(),{id:n,selectedIndex:r}=t,i=Qm(e.children).map((a,l)=>v.exports.createElement(koe,{key:l,value:{isSelected:l===r,id:fI(n,l),tabId:dI(n,l),selectedIndex:r}},a));return{...e,children:i}}function Poe(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Hf(),{isSelected:i,id:a,tabId:l}=Eoe(),c=v.exports.useRef(!1);i&&(c.current=!0);const d=lT({wasSelected:c.current,isSelected:i,enabled:r,mode:o});return{tabIndex:0,...n,children:d?t:null,role:"tabpanel","aria-labelledby":l,hidden:!i,id:a}}function Aoe(){const e=Hf(),t=cI(),{selectedIndex:n,orientation:r}=e,o=r==="horizontal",i=r==="vertical",[a,l]=v.exports.useState(()=>{if(o)return{left:0,width:0};if(i)return{top:0,height:0}}),[c,d]=v.exports.useState(!1);return di(()=>{if(n==null)return;const f=t.item(n);if(f==null)return;o&&l({left:f.node.offsetLeft,width:f.node.offsetWidth}),i&&l({top:f.node.offsetTop,height:f.node.offsetHeight});const p=requestAnimationFrame(()=>{d(!0)});return()=>{p&&cancelAnimationFrame(p)}},[n,o,i,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:c?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function dI(e,t){return`${e}--tab-${t}`}function fI(e,t){return`${e}--tabpanel-${t}`}var[Toe,jf]=Rt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pI=fe(function(t,n){const r=dr("Tabs",t),{children:o,className:i,...a}=yt(t),{htmlProps:l,descendants:c,...d}=woe(a),f=v.exports.useMemo(()=>d,[d]),{isFitted:p,...m}=l;return Q.createElement(yoe,{value:c},Q.createElement(Soe,{value:f},Q.createElement(Toe,{value:r},Q.createElement(ie.div,{className:rc("chakra-tabs",i),ref:n,...m,__css:r.root},o))))});pI.displayName="Tabs";var Ioe=fe(function(t,n){const r=Aoe(),o={...t.style,...r},i=jf();return Q.createElement(ie.div,{ref:n,...t,className:rc("chakra-tabs__tab-indicator",t.className),style:o,__css:i.indicator})});Ioe.displayName="TabIndicator";var Ooe=fe(function(t,n){const r=Coe({...t,ref:n}),o=jf(),i={display:"flex",...o.tablist};return Q.createElement(ie.div,{...r,className:rc("chakra-tabs__tablist",t.className),__css:i})});Ooe.displayName="TabList";var hI=fe(function(t,n){const r=Poe({...t,ref:n}),o=jf();return Q.createElement(ie.div,{outline:"0",...r,className:rc("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});hI.displayName="TabPanel";var mI=fe(function(t,n){const r=Loe(t),o=jf();return Q.createElement(ie.div,{...r,width:"100%",ref:n,className:rc("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});mI.displayName="TabPanels";var gI=fe(function(t,n){const r=jf(),o=_oe({...t,ref:n}),i={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return Q.createElement(ie.button,{...o,className:rc("chakra-tabs__tab",t.className),__css:i})});gI.displayName="Tab";var Roe=(...e)=>e.filter(Boolean).join(" ");function Moe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Noe=["h","minH","height","minHeight"],vI=fe((e,t)=>{const n=cr("Textarea",e),{className:r,rows:o,...i}=yt(e),a=qb(i),l=o?Moe(n,Noe):n;return Q.createElement(ie.textarea,{ref:t,rows:o,...a,className:Roe("chakra-textarea",r),__css:l})});vI.displayName="Textarea";function vt(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 o(...f){r();for(const p of f)t[p]=c(p);return vt(e,t)}function i(...f){for(const p of f)p in t||(t[p]=c(p));return vt(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([p,m])=>[p,m.selector]))}function l(){return Object.fromEntries(Object.entries(t).map(([p,m])=>[p,m.className]))}function c(f){const g=`chakra-${(["container","root"].includes(f??"")?[e]:[e,f]).filter(Boolean).join("__")}`;return{className:g,selector:`.${g}`,toString:()=>f}}return{parts:o,toPart:c,extend:i,selectors:a,classnames:l,get keys(){return Object.keys(t)},__type:{}}}var $oe=vt("accordion").parts("root","container","button","panel").extend("icon"),Doe=vt("alert").parts("title","description","container").extend("icon","spinner"),Foe=vt("avatar").parts("label","badge","container").extend("excessLabel","group"),zoe=vt("breadcrumb").parts("link","item","container").extend("separator");vt("button").parts();var Boe=vt("checkbox").parts("control","icon","container").extend("label");vt("progress").parts("track","filledTrack").extend("label");var Voe=vt("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Woe=vt("editable").parts("preview","input","textarea"),Uoe=vt("form").parts("container","requiredIndicator","helperText"),Hoe=vt("formError").parts("text","icon"),joe=vt("input").parts("addon","field","element"),Goe=vt("list").parts("container","item","icon"),Zoe=vt("menu").parts("button","list","item").extend("groupTitle","command","divider"),Koe=vt("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),qoe=vt("numberinput").parts("root","field","stepperGroup","stepper");vt("pininput").parts("field");var Yoe=vt("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Xoe=vt("progress").parts("label","filledTrack","track"),Qoe=vt("radio").parts("container","control","label"),Joe=vt("select").parts("field","icon"),eie=vt("slider").parts("container","track","thumb","filledTrack","mark"),tie=vt("stat").parts("container","label","helpText","number","icon"),nie=vt("switch").parts("container","track","thumb"),rie=vt("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),oie=vt("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),iie=vt("tag").parts("container","label","closeButton");function Dn(e,t){aie(e)&&(e="100%");var n=sie(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Vh(e){return Math.min(1,Math.max(0,e))}function aie(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function sie(e){return typeof e=="string"&&e.indexOf("%")!==-1}function yI(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Wh(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Ws(e){return e.length===1?"0"+e:String(e)}function lie(e,t,n){return{r:Dn(e,255)*255,g:Dn(t,255)*255,b:Dn(n,255)*255}}function U7(e,t,n){e=Dn(e,255),t=Dn(t,255),n=Dn(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=0,l=(r+o)/2;if(r===o)a=0,i=0;else{var c=r-o;switch(a=l>.5?c/(2-r-o):c/(r+o),r){case e:i=(t-n)/c+(t1&&(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 uie(e,t,n){var r,o,i;if(e=Dn(e,360),t=Dn(t,100),n=Dn(n,100),t===0)o=n,i=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=sy(l,a,e+1/3),o=sy(l,a,e),i=sy(l,a,e-1/3)}return{r:r*255,g:o*255,b:i*255}}function H7(e,t,n){e=Dn(e,255),t=Dn(t,255),n=Dn(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,l=r-o,c=r===0?0:l/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/l+(t>16,g:(e&65280)>>8,b:e&255}}var E4={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function hie(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,l=!1;return typeof e=="string"&&(e=vie(e)),typeof e=="object"&&(Wi(e.r)&&Wi(e.g)&&Wi(e.b)?(t=lie(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Wi(e.h)&&Wi(e.s)&&Wi(e.v)?(r=Wh(e.s),o=Wh(e.v),t=cie(e.h,r,o),a=!0,l="hsv"):Wi(e.h)&&Wi(e.s)&&Wi(e.l)&&(r=Wh(e.s),i=Wh(e.l),t=uie(e.h,r,i),a=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=yI(n),{ok:a,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var mie="[-\\+]?\\d+%?",gie="[-\\+]?\\d*\\.\\d+%?",Ua="(?:".concat(gie,")|(?:").concat(mie,")"),ly="[\\s|\\(]+(".concat(Ua,")[,|\\s]+(").concat(Ua,")[,|\\s]+(").concat(Ua,")\\s*\\)?"),uy="[\\s|\\(]+(".concat(Ua,")[,|\\s]+(").concat(Ua,")[,|\\s]+(").concat(Ua,")[,|\\s]+(").concat(Ua,")\\s*\\)?"),Oo={CSS_UNIT:new RegExp(Ua),rgb:new RegExp("rgb"+ly),rgba:new RegExp("rgba"+uy),hsl:new RegExp("hsl"+ly),hsla:new RegExp("hsla"+uy),hsv:new RegExp("hsv"+ly),hsva:new RegExp("hsva"+uy),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function vie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(E4[e])e=E4[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Oo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Oo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Oo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Oo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Oo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Oo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Oo.hex8.exec(e),n?{r:Fr(n[1]),g:Fr(n[2]),b:Fr(n[3]),a:G7(n[4]),format:t?"name":"hex8"}:(n=Oo.hex6.exec(e),n?{r:Fr(n[1]),g:Fr(n[2]),b:Fr(n[3]),format:t?"name":"hex"}:(n=Oo.hex4.exec(e),n?{r:Fr(n[1]+n[1]),g:Fr(n[2]+n[2]),b:Fr(n[3]+n[3]),a:G7(n[4]+n[4]),format:t?"name":"hex8"}:(n=Oo.hex3.exec(e),n?{r:Fr(n[1]+n[1]),g:Fr(n[2]+n[2]),b:Fr(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function Wi(e){return Boolean(Oo.CSS_UNIT.exec(String(e)))}var Gf=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=pie(t)),this.originalInput=t;var o=hie(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,o,i=t.r/255,a=t.g/255,l=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),l<=.03928?o=l/12.92:o=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*o},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=yI(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=H7(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=H7(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(o,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(o,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=U7(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=U7(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(o,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(o,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),j7(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),die(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Dn(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Dn(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+j7(this.r,this.g,this.b,!1),n=0,r=Object.entries(E4);n=0,i=!n&&o&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Vh(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Vh(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Vh(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Vh(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),i=n/100,a={r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),o=360/n,i=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,o=n.s,i=n.v,a=[],l=1/t;t--;)a.push(new e({h:r,s:o,v:i})),i=(i+l)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],i=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(bI(e));return e.count=t,n}var r=yie(e.hue,e.seed),o=bie(r,e),i=xie(r,o,e),a={h:r,s:o,v:i};return e.alpha!==void 0&&(a.a=e.alpha),new Gf(a)}function yie(e,t){var n=Sie(e),r=N0(n,t);return r<0&&(r=360+r),r}function bie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return N0([0,100],t.seed);var n=xI(e).saturationRange,r=n[0],o=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=o-10;break;case"light":o=55;break}return N0([r,o],t.seed)}function xie(e,t,n){var r=wie(e,t),o=100;switch(n.luminosity){case"dark":o=r+20;break;case"light":r=(o+r)/2;break;case"random":r=0,o=100;break}return N0([r,o],n.seed)}function wie(e,t){for(var n=xI(e).lowerBounds,r=0;r=o&&t<=a){var c=(l-i)/(a-o),d=i-c*o;return c*t+d}}return 0}function Sie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=SI.find(function(a){return a.name===e});if(n){var r=wI(n);if(r.hueRange)return r.hueRange}var o=new Gf(e);if(o.isValid){var i=o.toHsv().h;return[i,i]}}return[0,360]}function xI(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=SI;t=o.hueRange[0]&&e<=o.hueRange[1])return o}throw Error("Color not found")}function N0(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var o=t/233280;return Math.floor(r+o*(n-r))}function wI(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],o=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,o]}}var SI=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function Cie(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,xn=(e,t,n)=>{const r=Cie(e,`colors.${t}`,t),{isValid:o}=new Gf(r);return o?r:n},kie=e=>t=>{const n=xn(t,e);return new Gf(n).isDark()?"dark":"light"},Eie=e=>t=>kie(e)(t)==="dark",Hu=(e,t)=>n=>{const r=xn(n,e);return new Gf(r).setAlpha(t).toRgbString()};function Z7(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}`}}function Lie(e){const t=bI().toHexString();return!e||_ie(e)?t:e.string&&e.colors?Aie(e.string,e.colors):e.string&&!e.colors?Pie(e.string):e.colors&&!e.string?Tie(e.colors):t}function Pie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255).toString(16)}`.substr(-2);return n}function Aie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Rx(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Iie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function CI(e){return Iie(e)&&e.reference?e.reference:String(e)}var sg=(e,...t)=>t.map(CI).join(` ${e} `).replace(/calc/g,""),K7=(...e)=>`calc(${sg("+",...e)})`,q7=(...e)=>`calc(${sg("-",...e)})`,L4=(...e)=>`calc(${sg("*",...e)})`,Y7=(...e)=>`calc(${sg("/",...e)})`,X7=e=>{const t=CI(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:L4(t,-1)},Zi=Object.assign(e=>({add:(...t)=>Zi(K7(e,...t)),subtract:(...t)=>Zi(q7(e,...t)),multiply:(...t)=>Zi(L4(e,...t)),divide:(...t)=>Zi(Y7(e,...t)),negate:()=>Zi(X7(e)),toString:()=>e.toString()}),{add:K7,subtract:q7,multiply:L4,divide:Y7,negate:X7});function Oie(e){return!Number.isInteger(parseFloat(e.toString()))}function Rie(e,t="-"){return e.replace(/\s+/g,t)}function _I(e){const t=Rie(e.toString());return t.includes("\\.")?e:Oie(e)?t.replace(".","\\."):e}function Mie(e,t=""){return[t,_I(e)].filter(Boolean).join("-")}function Nie(e,t){return`var(${_I(e)}${t?`, ${t}`:""})`}function $ie(e,t=""){return`--${Mie(e,t)}`}function Ar(e,t){const n=$ie(e,t?.prefix);return{variable:n,reference:Nie(n,Die(t?.fallback))}}function Die(e){return typeof e=="string"?e:e?.reference}var{definePartsStyle:Fie,defineMultiStyleConfig:zie}=Ut($oe.keys),Bie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},Vie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Wie={pt:"2",px:"4",pb:"5"},Uie={fontSize:"1.25em"},Hie=Fie({container:Bie,button:Vie,panel:Wie,icon:Uie}),jie=zie({baseStyle:Hie}),{definePartsStyle:Zf,defineMultiStyleConfig:Gie}=Ut(Doe.keys),oa=ps("alert-fg"),Kf=ps("alert-bg"),Zie=Zf({container:{bg:Kf.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:oa.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:oa.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function Mx(e){const{theme:t,colorScheme:n}=e,r=xn(t,`${n}.100`,n),o=Hu(`${n}.200`,.16)(t);return re(r,o)(e)}var Kie=Zf(e=>{const{colorScheme:t}=e,n=re(`${t}.500`,`${t}.200`)(e);return{container:{[Kf.variable]:Mx(e),[oa.variable]:`colors.${n}`}}}),qie=Zf(e=>{const{colorScheme:t}=e,n=re(`${t}.500`,`${t}.200`)(e);return{container:{[Kf.variable]:Mx(e),[oa.variable]:`colors.${n}`,paddingStart:"3",borderStartWidth:"4px",borderStartColor:oa.reference}}}),Yie=Zf(e=>{const{colorScheme:t}=e,n=re(`${t}.500`,`${t}.200`)(e);return{container:{[Kf.variable]:Mx(e),[oa.variable]:`colors.${n}`,pt:"2",borderTopWidth:"4px",borderTopColor:oa.reference}}}),Xie=Zf(e=>{const{colorScheme:t}=e,n=re(`${t}.500`,`${t}.200`)(e),r=re("white","gray.900")(e);return{container:{[Kf.variable]:`colors.${n}`,[oa.variable]:`colors.${r}`,color:oa.reference}}}),Qie={subtle:Kie,"left-accent":qie,"top-accent":Yie,solid:Xie},Jie=Gie({baseStyle:Zie,variants:Qie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),kI={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"},eae={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"},tae={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},nae={...kI,...eae,container:tae},EI=nae,rae=e=>typeof e=="function";function ln(e,...t){return rae(e)?e(...t):e}var{definePartsStyle:LI,defineMultiStyleConfig:oae}=Ut(Foe.keys),iae=e=>({borderRadius:"full",border:"0.2em solid",borderColor:re("white","gray.800")(e)}),aae=e=>({bg:re("gray.200","whiteAlpha.400")(e)}),sae=e=>{const{name:t,theme:n}=e,r=t?Lie({string:t}):"gray.400",o=Eie(r)(n);let i="white";o||(i="gray.800");const a=re("white","gray.800")(e);return{bg:r,color:i,borderColor:a,verticalAlign:"top"}},lae=LI(e=>({badge:ln(iae,e),excessLabel:ln(aae,e),container:ln(sae,e)}));function La(e){const t=e!=="100%"?EI[e]:void 0;return LI({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var uae={"2xs":La(4),xs:La(6),sm:La(8),md:La(12),lg:La(16),xl:La(24),"2xl":La(32),full:La("100%")},cae=oae({baseStyle:lae,sizes:uae,defaultProps:{size:"md"}}),dae={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},fae=e=>{const{colorScheme:t,theme:n}=e,r=Hu(`${t}.500`,.6)(n);return{bg:re(`${t}.500`,r)(e),color:re("white","whiteAlpha.800")(e)}},pae=e=>{const{colorScheme:t,theme:n}=e,r=Hu(`${t}.200`,.16)(n);return{bg:re(`${t}.100`,r)(e),color:re(`${t}.800`,`${t}.200`)(e)}},hae=e=>{const{colorScheme:t,theme:n}=e,r=Hu(`${t}.200`,.8)(n),o=xn(n,`${t}.500`),i=re(o,r)(e);return{color:i,boxShadow:`inset 0 0 0px 1px ${i}`}},mae={solid:fae,subtle:pae,outline:hae},Ld={baseStyle:dae,variants:mae,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:gae,definePartsStyle:vae}=Ut(zoe.keys),yae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},bae=vae({link:yae}),xae=gae({baseStyle:bae}),wae={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"}}},PI=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:re("inherit","whiteAlpha.900")(e),_hover:{bg:re("gray.100","whiteAlpha.200")(e)},_active:{bg:re("gray.200","whiteAlpha.300")(e)}};const r=Hu(`${t}.200`,.12)(n),o=Hu(`${t}.200`,.24)(n);return{color:re(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:re(`${t}.50`,r)(e)},_active:{bg:re(`${t}.100`,o)(e)}}},Sae=e=>{const{colorScheme:t}=e,n=re("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...ln(PI,e)}},Cae={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},_ae=e=>{const{colorScheme:t}=e;if(t==="gray"){const l=re("gray.100","whiteAlpha.200")(e);return{bg:l,_hover:{bg:re("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:re("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:o=`${t}.600`,activeBg:i=`${t}.700`}=Cae[t]??{},a=re(n,`${t}.200`)(e);return{bg:a,color:re(r,"gray.800")(e),_hover:{bg:re(o,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:re(i,`${t}.400`)(e)}}},kae=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:re(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:re(`${t}.700`,`${t}.500`)(e)}}},Eae={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Lae={ghost:PI,outline:Sae,solid:_ae,link:kae,unstyled:Eae},Pae={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"}},Aae={baseStyle:wae,variants:Lae,sizes:Pae,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:E1,defineMultiStyleConfig:Tae}=Ut(Boe.keys),Pd=ps("checkbox-size"),Iae=e=>{const{colorScheme:t}=e;return{w:Pd.reference,h:Pd.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:re(`${t}.500`,`${t}.200`)(e),borderColor:re(`${t}.500`,`${t}.200`)(e),color:re("white","gray.900")(e),_hover:{bg:re(`${t}.600`,`${t}.300`)(e),borderColor:re(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:re("gray.200","transparent")(e),bg:re("gray.200","whiteAlpha.300")(e),color:re("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:re(`${t}.500`,`${t}.200`)(e),borderColor:re(`${t}.500`,`${t}.200`)(e),color:re("white","gray.900")(e)},_disabled:{bg:re("gray.100","whiteAlpha.100")(e),borderColor:re("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:re("red.500","red.300")(e)}}},Oae={_disabled:{cursor:"not-allowed"}},Rae={userSelect:"none",_disabled:{opacity:.4}},Mae={transitionProperty:"transform",transitionDuration:"normal"},Nae=E1(e=>({icon:Mae,container:Oae,control:ln(Iae,e),label:Rae})),$ae={sm:E1({control:{[Pd.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:E1({control:{[Pd.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:E1({control:{[Pd.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},$0=Tae({baseStyle:Nae,sizes:$ae,defaultProps:{size:"md",colorScheme:"blue"}}),Ad=Ar("close-button-size"),Dae=e=>{const t=re("blackAlpha.100","whiteAlpha.100")(e),n=re("blackAlpha.200","whiteAlpha.200")(e);return{w:[Ad.reference],h:[Ad.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{bg:t},_active:{bg:n},_focusVisible:{boxShadow:"outline"}}},Fae={lg:{[Ad.variable]:"sizes.10",fontSize:"md"},md:{[Ad.variable]:"sizes.8",fontSize:"xs"},sm:{[Ad.variable]:"sizes.6",fontSize:"2xs"}},zae={baseStyle:Dae,sizes:Fae,defaultProps:{size:"md"}},{variants:Bae,defaultProps:Vae}=Ld,Wae={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Uae={baseStyle:Wae,variants:Bae,defaultProps:Vae},Hae={w:"100%",mx:"auto",maxW:"prose",px:"4"},jae={baseStyle:Hae},Gae={opacity:.6,borderColor:"inherit"},Zae={borderStyle:"solid"},Kae={borderStyle:"dashed"},qae={solid:Zae,dashed:Kae},Yae={baseStyle:Gae,variants:qae,defaultProps:{variant:"solid"}},{definePartsStyle:P4,defineMultiStyleConfig:Xae}=Ut(Voe.keys);function jl(e){return P4(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Qae={bg:"blackAlpha.600",zIndex:"overlay"},Jae={display:"flex",zIndex:"modal",justifyContent:"center"},ese=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",bg:re("white","gray.700")(e),color:"inherit",boxShadow:re("lg","dark-lg")(e)}},tse={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},nse={position:"absolute",top:"2",insetEnd:"3"},rse={px:"6",py:"2",flex:"1",overflow:"auto"},ose={px:"6",py:"4"},ise=P4(e=>({overlay:Qae,dialogContainer:Jae,dialog:ln(ese,e),header:tse,closeButton:nse,body:rse,footer:ose})),ase={xs:jl("xs"),sm:jl("md"),md:jl("lg"),lg:jl("2xl"),xl:jl("4xl"),full:jl("full")},sse=Xae({baseStyle:ise,sizes:ase,defaultProps:{size:"xs"}}),{definePartsStyle:lse,defineMultiStyleConfig:use}=Ut(Woe.keys),cse={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},dse={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},fse={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},pse=lse({preview:cse,input:dse,textarea:fse}),hse=use({baseStyle:pse}),{definePartsStyle:mse,defineMultiStyleConfig:gse}=Ut(Uoe.keys),vse=e=>({marginStart:"1",color:re("red.500","red.300")(e)}),yse=e=>({mt:"2",color:re("gray.600","whiteAlpha.600")(e),lineHeight:"normal",fontSize:"sm"}),bse=mse(e=>({container:{width:"100%",position:"relative"},requiredIndicator:ln(vse,e),helperText:ln(yse,e)})),xse=gse({baseStyle:bse}),{definePartsStyle:wse,defineMultiStyleConfig:Sse}=Ut(Hoe.keys),Cse=e=>({color:re("red.500","red.300")(e),mt:"2",fontSize:"sm",lineHeight:"normal"}),_se=e=>({marginEnd:"0.5em",color:re("red.500","red.300")(e)}),kse=wse(e=>({text:ln(Cse,e),icon:ln(_se,e)})),Ese=Sse({baseStyle:kse}),Lse={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Pse={baseStyle:Lse},Ase={fontFamily:"heading",fontWeight:"bold"},Tse={"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}},Ise={baseStyle:Ase,sizes:Tse,defaultProps:{size:"xl"}},{definePartsStyle:Yi,defineMultiStyleConfig:Ose}=Ut(joe.keys),Rse=Yi({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Pa={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Mse={lg:Yi({field:Pa.lg,addon:Pa.lg}),md:Yi({field:Pa.md,addon:Pa.md}),sm:Yi({field:Pa.sm,addon:Pa.sm}),xs:Yi({field:Pa.xs,addon:Pa.xs})};function Nx(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||re("blue.500","blue.300")(e),errorBorderColor:n||re("red.500","red.300")(e)}}var Nse=Yi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Nx(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:re("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:xn(t,r),boxShadow:`0 0 0 1px ${xn(t,r)}`},_focusVisible:{zIndex:1,borderColor:xn(t,n),boxShadow:`0 0 0 1px ${xn(t,n)}`}},addon:{border:"1px solid",borderColor:re("inherit","whiteAlpha.50")(e),bg:re("gray.100","whiteAlpha.300")(e)}}}),$se=Yi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Nx(e);return{field:{border:"2px solid",borderColor:"transparent",bg:re("gray.100","whiteAlpha.50")(e),_hover:{bg:re("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:xn(t,r)},_focusVisible:{bg:"transparent",borderColor:xn(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:re("gray.100","whiteAlpha.50")(e)}}}),Dse=Yi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Nx(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:xn(t,r),boxShadow:`0px 1px 0px 0px ${xn(t,r)}`},_focusVisible:{borderColor:xn(t,n),boxShadow:`0px 1px 0px 0px ${xn(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Fse=Yi({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),zse={outline:Nse,filled:$se,flushed:Dse,unstyled:Fse},lt=Ose({baseStyle:Rse,sizes:Mse,variants:zse,defaultProps:{size:"md",variant:"outline"}}),Bse=e=>({bg:re("gray.100","whiteAlpha")(e),borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"}),Vse={baseStyle:Bse},Wse={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Use={baseStyle:Wse},{defineMultiStyleConfig:Hse,definePartsStyle:jse}=Ut(Goe.keys),Gse={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Zse=jse({icon:Gse}),Kse=Hse({baseStyle:Zse}),{defineMultiStyleConfig:qse,definePartsStyle:Yse}=Ut(Zoe.keys),Xse=e=>({bg:re("#fff","gray.700")(e),boxShadow:re("sm","dark-lg")(e),color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px"}),Qse=e=>({py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{bg:re("gray.100","whiteAlpha.100")(e)},_active:{bg:re("gray.200","whiteAlpha.200")(e)},_expanded:{bg:re("gray.100","whiteAlpha.100")(e)},_disabled:{opacity:.4,cursor:"not-allowed"}}),Jse={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},ele={opacity:.6},tle={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},nle={transitionProperty:"common",transitionDuration:"normal"},rle=Yse(e=>({button:nle,list:ln(Xse,e),item:ln(Qse,e),groupTitle:Jse,command:ele,divider:tle})),ole=qse({baseStyle:rle}),{defineMultiStyleConfig:ile,definePartsStyle:A4}=Ut(Koe.keys),ale={bg:"blackAlpha.600",zIndex:"modal"},sle=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},lle=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:re("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:re("lg","dark-lg")(e)}},ule={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},cle={position:"absolute",top:"2",insetEnd:"3"},dle=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},fle={px:"6",py:"4"},ple=A4(e=>({overlay:ale,dialogContainer:ln(sle,e),dialog:ln(lle,e),header:ule,closeButton:cle,body:ln(dle,e),footer:fle}));function Io(e){return A4(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var hle={xs:Io("xs"),sm:Io("sm"),md:Io("md"),lg:Io("lg"),xl:Io("xl"),"2xl":Io("2xl"),"3xl":Io("3xl"),"4xl":Io("4xl"),"5xl":Io("5xl"),"6xl":Io("6xl"),full:Io("full")},mle=ile({baseStyle:ple,sizes:hle,defaultProps:{size:"md"}}),gle={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"}},AI=gle,{defineMultiStyleConfig:vle,definePartsStyle:TI}=Ut(qoe.keys),$x=Ar("number-input-stepper-width"),II=Ar("number-input-input-padding"),yle=Zi($x).add("0.5rem").toString(),ble={[$x.variable]:"sizes.6",[II.variable]:yle},xle=e=>{var t;return((t=ln(lt.baseStyle,e))==null?void 0:t.field)??{}},wle={width:[$x.reference]},Sle=e=>({borderStart:"1px solid",borderStartColor:re("inherit","whiteAlpha.300")(e),color:re("inherit","whiteAlpha.800")(e),_active:{bg:re("gray.200","whiteAlpha.300")(e)},_disabled:{opacity:.4,cursor:"not-allowed"}}),Cle=TI(e=>({root:ble,field:xle,stepperGroup:wle,stepper:ln(Sle,e)??{}}));function Uh(e){var t,n;const r=(t=lt.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},i=((n=r.field)==null?void 0:n.fontSize)??"md",a=AI.fontSizes[i];return TI({field:{...r.field,paddingInlineEnd:II.reference,verticalAlign:"top"},stepper:{fontSize:Zi(a).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var _le={xs:Uh("xs"),sm:Uh("sm"),md:Uh("md"),lg:Uh("lg")},kle=vle({baseStyle:Cle,sizes:_le,variants:lt.variants,defaultProps:lt.defaultProps}),Q7,Ele={...(Q7=lt.baseStyle)==null?void 0:Q7.field,textAlign:"center"},Lle={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"}},J7,Ple={outline:e=>{var t,n;return((n=ln((t=lt.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=ln((t=lt.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=ln((t=lt.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((J7=lt.variants)==null?void 0:J7.unstyled.field)??{}},Ale={baseStyle:Ele,sizes:Lle,variants:Ple,defaultProps:lt.defaultProps},{defineMultiStyleConfig:Tle,definePartsStyle:Ile}=Ut(Yoe.keys),cy=Ar("popper-bg"),Ole=Ar("popper-arrow-bg"),Rle=Ar("popper-arrow-shadow-color"),Mle={zIndex:10},Nle=e=>{const t=re("white","gray.700")(e),n=re("gray.200","whiteAlpha.300")(e);return{[cy.variable]:`colors.${t}`,bg:cy.reference,[Ole.variable]:cy.reference,[Rle.variable]:`colors.${n}`,width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}}},$le={px:3,py:2,borderBottomWidth:"1px"},Dle={px:3,py:2},Fle={px:3,py:2,borderTopWidth:"1px"},zle={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Ble=Ile(e=>({popper:Mle,content:Nle(e),header:$le,body:Dle,footer:Fle,closeButton:zle})),Vle=Tle({baseStyle:Ble}),{defineMultiStyleConfig:Wle,definePartsStyle:od}=Ut(Xoe.keys),Ule=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=re(Z7(),Z7("1rem","rgba(0,0,0,0.1)"))(e),a=re(`${t}.500`,`${t}.200`)(e),l=`linear-gradient( - to right, - transparent 0%, - ${xn(n,a)} 50%, - transparent 100% - )`;return{...!r&&o&&i,...r?{bgImage:l}:{bgColor:a}}},Hle={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},jle=e=>({bg:re("gray.100","whiteAlpha.300")(e)}),Gle=e=>({transitionProperty:"common",transitionDuration:"slow",...Ule(e)}),Zle=od(e=>({label:Hle,filledTrack:Gle(e),track:jle(e)})),Kle={xs:od({track:{h:"1"}}),sm:od({track:{h:"2"}}),md:od({track:{h:"3"}}),lg:od({track:{h:"4"}})},qle=Wle({sizes:Kle,baseStyle:Zle,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Yle,definePartsStyle:L1}=Ut(Qoe.keys),Xle=e=>{var t;const n=(t=ln($0.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n?._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Qle=L1(e=>{var t,n,r,o;return{label:(n=(t=$0).baseStyle)==null?void 0:n.call(t,e).label,container:(o=(r=$0).baseStyle)==null?void 0:o.call(r,e).container,control:Xle(e)}}),Jle={md:L1({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:L1({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:L1({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},eue=Yle({baseStyle:Qle,sizes:Jle,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tue,definePartsStyle:nue}=Ut(Joe.keys),rue=e=>{var t;return{...(t=lt.baseStyle)==null?void 0:t.field,bg:re("white","gray.700")(e),appearance:"none",paddingBottom:"1px",lineHeight:"normal","> option, > optgroup":{bg:re("white","gray.700")(e)}}},oue={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},iue=nue(e=>({field:rue(e),icon:oue})),Hh={paddingInlineEnd:"8"},eC,tC,nC,rC,oC,iC,aC,sC,aue={lg:{...(eC=lt.sizes)==null?void 0:eC.lg,field:{...(tC=lt.sizes)==null?void 0:tC.lg.field,...Hh}},md:{...(nC=lt.sizes)==null?void 0:nC.md,field:{...(rC=lt.sizes)==null?void 0:rC.md.field,...Hh}},sm:{...(oC=lt.sizes)==null?void 0:oC.sm,field:{...(iC=lt.sizes)==null?void 0:iC.sm.field,...Hh}},xs:{...(aC=lt.sizes)==null?void 0:aC.xs,field:{...(sC=lt.sizes)==null?void 0:sC.sm.field,...Hh},icon:{insetEnd:"1"}}},sue=tue({baseStyle:iue,sizes:aue,variants:lt.variants,defaultProps:lt.defaultProps}),lue=ps("skeleton-start-color"),uue=ps("skeleton-end-color"),cue=e=>{const t=re("gray.100","gray.800")(e),n=re("gray.400","gray.600")(e),{startColor:r=t,endColor:o=n,theme:i}=e,a=xn(i,r),l=xn(i,o);return{[lue.variable]:a,[uue.variable]:l,opacity:.7,borderRadius:"2px",borderColor:a,background:l}},due={baseStyle:cue},fue=e=>({borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",bg:re("white","gray.700")(e)}}),pue={baseStyle:fue},{defineMultiStyleConfig:hue,definePartsStyle:lg}=Ut(eie.keys),mf=ps("slider-thumb-size"),gf=ps("slider-track-size"),mue=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Rx({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},gue=e=>({...Rx({orientation:e.orientation,horizontal:{h:gf.reference},vertical:{w:gf.reference}}),overflow:"hidden",borderRadius:"sm",bg:re("gray.200","whiteAlpha.200")(e),_disabled:{bg:re("gray.300","whiteAlpha.300")(e)}}),vue=e=>{const{orientation:t}=e;return{...Rx({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:mf.reference,h:mf.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"}}},yue=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",bg:re(`${t}.500`,`${t}.200`)(e)}},bue=lg(e=>({container:mue(e),track:gue(e),thumb:vue(e),filledTrack:yue(e)})),xue=lg({container:{[mf.variable]:"sizes.4",[gf.variable]:"sizes.1"}}),wue=lg({container:{[mf.variable]:"sizes.3.5",[gf.variable]:"sizes.1"}}),Sue=lg({container:{[mf.variable]:"sizes.2.5",[gf.variable]:"sizes.0.5"}}),Cue={lg:xue,md:wue,sm:Sue},_ue=hue({baseStyle:bue,sizes:Cue,defaultProps:{size:"md",colorScheme:"blue"}}),Ms=Ar("spinner-size"),kue={width:[Ms.reference],height:[Ms.reference]},Eue={xs:{[Ms.variable]:"sizes.3"},sm:{[Ms.variable]:"sizes.4"},md:{[Ms.variable]:"sizes.6"},lg:{[Ms.variable]:"sizes.8"},xl:{[Ms.variable]:"sizes.12"}},Lue={baseStyle:kue,sizes:Eue,defaultProps:{size:"md"}},{defineMultiStyleConfig:Pue,definePartsStyle:OI}=Ut(tie.keys),Aue={fontWeight:"medium"},Tue={opacity:.8,marginBottom:"2"},Iue={verticalAlign:"baseline",fontWeight:"semibold"},Oue={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Rue=OI({container:{},label:Aue,helpText:Tue,number:Iue,icon:Oue}),Mue={md:OI({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Nue=Pue({baseStyle:Rue,sizes:Mue,defaultProps:{size:"md"}}),{defineMultiStyleConfig:$ue,definePartsStyle:P1}=Ut(nie.keys),Td=Ar("switch-track-width"),Zs=Ar("switch-track-height"),dy=Ar("switch-track-diff"),Due=Zi.subtract(Td,Zs),T4=Ar("switch-thumb-x"),Fue=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Td.reference],height:[Zs.reference],transitionProperty:"common",transitionDuration:"fast",bg:re("gray.300","whiteAlpha.400")(e),_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{bg:re(`${t}.500`,`${t}.200`)(e)}}},zue={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Zs.reference],height:[Zs.reference],_checked:{transform:`translateX(${T4.reference})`}},Bue=P1(e=>({container:{[dy.variable]:Due,[T4.variable]:dy.reference,_rtl:{[T4.variable]:Zi(dy).negate().toString()}},track:Fue(e),thumb:zue})),Vue={sm:P1({container:{[Td.variable]:"1.375rem",[Zs.variable]:"sizes.3"}}),md:P1({container:{[Td.variable]:"1.875rem",[Zs.variable]:"sizes.4"}}),lg:P1({container:{[Td.variable]:"2.875rem",[Zs.variable]:"sizes.6"}})},Wue=$ue({baseStyle:Bue,sizes:Vue,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Uue,definePartsStyle:Eu}=Ut(rie.keys),Hue=Eu({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"}}),D0={"&[data-is-numeric=true]":{textAlign:"end"}},jue=Eu(e=>{const{colorScheme:t}=e;return{th:{color:re("gray.600","gray.400")(e),borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...D0},td:{borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...D0},caption:{color:re("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Gue=Eu(e=>{const{colorScheme:t}=e;return{th:{color:re("gray.600","gray.400")(e),borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...D0},td:{borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...D0},caption:{color:re("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e)},td:{background:re(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Zue={simple:jue,striped:Gue,unstyled:{}},Kue={sm:Eu({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:Eu({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Eu({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},que=Uue({baseStyle:Hue,variants:Zue,sizes:Kue,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),{defineMultiStyleConfig:Yue,definePartsStyle:gi}=Ut(oie.keys),Xue=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Que=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}}},Jue=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},ece={p:4},tce=gi(e=>({root:Xue(e),tab:Que(e),tablist:Jue(e),tabpanel:ece})),nce={sm:gi({tab:{py:1,px:4,fontSize:"sm"}}),md:gi({tab:{fontSize:"md",py:2,px:4}}),lg:gi({tab:{fontSize:"lg",py:3,px:4}})},rce=gi(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",o=n==="vertical"?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{color:re(`${t}.600`,`${t}.300`)(e),borderColor:"currentColor"},_active:{bg:re("gray.200","whiteAlpha.300")(e)},_disabled:{_active:{bg:"none"}}}}}),oce=gi(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",_selected:{color:re(`${t}.600`,`${t}.300`)(e),borderColor:"inherit",borderBottomColor:re("white","gray.800")(e)}},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),ice=gi(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",bg:re("gray.50","whiteAlpha.50")(e),mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{bg:re("#fff","gray.800")(e),color:re(`${t}.600`,`${t}.300`)(e),borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"}},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),ace=gi(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:xn(n,`${t}.700`),bg:xn(n,`${t}.100`)}}}}),sce=gi(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:re("gray.600","inherit")(e),_selected:{color:re("#fff","gray.800")(e),bg:re(`${t}.600`,`${t}.300`)(e)}}}}),lce=gi({}),uce={line:rce,enclosed:oce,"enclosed-colored":ice,"soft-rounded":ace,"solid-rounded":sce,unstyled:lce},cce=Yue({baseStyle:tce,sizes:nce,variants:uce,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:dce,definePartsStyle:Ks}=Ut(iie.keys),fce={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},pce={lineHeight:1.2,overflow:"visible"},hce={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}},mce=Ks({container:fce,label:pce,closeButton:hce}),gce={sm:Ks({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Ks({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Ks({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},vce={subtle:Ks(e=>{var t;return{container:(t=Ld.variants)==null?void 0:t.subtle(e)}}),solid:Ks(e=>{var t;return{container:(t=Ld.variants)==null?void 0:t.solid(e)}}),outline:Ks(e=>{var t;return{container:(t=Ld.variants)==null?void 0:t.outline(e)}})},yce=dce({variants:vce,baseStyle:mce,sizes:gce,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),lC,bce={...(lC=lt.baseStyle)==null?void 0:lC.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},uC,xce={outline:e=>{var t;return((t=lt.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=lt.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=lt.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((uC=lt.variants)==null?void 0:uC.unstyled.field)??{}},cC,dC,fC,pC,wce={xs:((cC=lt.sizes)==null?void 0:cC.xs.field)??{},sm:((dC=lt.sizes)==null?void 0:dC.sm.field)??{},md:((fC=lt.sizes)==null?void 0:fC.md.field)??{},lg:((pC=lt.sizes)==null?void 0:pC.lg.field)??{}},Sce={baseStyle:bce,sizes:wce,variants:xce,defaultProps:{size:"md",variant:"outline"}},fy=Ar("tooltip-bg"),hC=Ar("tooltip-fg"),Cce=Ar("popper-arrow-bg"),_ce=e=>{const t=re("gray.700","gray.300")(e),n=re("whiteAlpha.900","gray.900")(e);return{bg:fy.reference,color:hC.reference,[fy.variable]:`colors.${t}`,[hC.variable]:`colors.${n}`,[Cce.variable]:fy.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"}},kce={baseStyle:_ce},Ece={Accordion:jie,Alert:Jie,Avatar:cae,Badge:Ld,Breadcrumb:xae,Button:Aae,Checkbox:$0,CloseButton:zae,Code:Uae,Container:jae,Divider:Yae,Drawer:sse,Editable:hse,Form:xse,FormError:Ese,FormLabel:Pse,Heading:Ise,Input:lt,Kbd:Vse,Link:Use,List:Kse,Menu:ole,Modal:mle,NumberInput:kle,PinInput:Ale,Popover:Vle,Progress:qle,Radio:eue,Select:sue,Skeleton:due,SkipLink:pue,Slider:_ue,Spinner:Lue,Stat:Nue,Switch:Wue,Table:que,Tabs:cce,Tag:yce,Textarea:Sce,Tooltip:kce},Lce={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Pce=Lce,Ace={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Tce=Ace,Ice={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"}},Oce=Ice,Rce={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Mce=Rce,Nce={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"},$ce=Nce,Dce={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"},Fce={"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)"},zce={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Bce={property:Dce,easing:Fce,duration:zce},Vce=Bce,Wce={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},Uce=Wce,Hce={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},jce=Hce,Gce={breakpoints:Tce,zIndices:Uce,radii:Mce,blur:jce,colors:Oce,...AI,sizes:EI,shadows:$ce,space:kI,borders:Pce,transition:Vce},Zce={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-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Kce={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",wordWrap:"break-word"}}};function qce(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var Yce=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function Xce(e){return qce(e)?Yce.every(t=>Object.prototype.hasOwnProperty.call(e,t)):!1}var Qce="ltr",Jce={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},RI={semanticTokens:Zce,direction:Qce,...Gce,components:Ece,styles:Kce,config:Jce};function ede(e,t){const n=Zn(e);v.exports.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function I4(e,...t){return tde(e)?e(...t):e}var tde=e=>typeof e=="function";function nde(e,t){const n=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"}}[n];return o?.[t]??n}var rde=(e,t)=>e.find(n=>n.id===t);function mC(e,t){const n=MI(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function MI(e,t){for(const[n,r]of Object.entries(e))if(rde(r,t))return n}function ode(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 ide(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,o=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,i=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:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:o,right:i,left:a}}var ade={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},si=sde(ade);function sde(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(a=>({...a,[i]:a[i].filter(l=>l.id!=o)}))},notify:(o,i)=>{const a=lde(o,i),{position:l,id:c}=a;return r(d=>{const p=l.includes("top")?[a,...d[l]??[]]:[...d[l]??[],a];return{...d,[l]:p}}),c},update:(o,i)=>{!o||r(a=>{const l={...a},{position:c,index:d}=mC(l,o);return c&&d!==-1&&(l[c][d]={...l[c][d],...i,message:NI(i)}),l})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((c,d)=>(c[d]=i[d].map(f=>({...f,requestClose:!0})),c),{...i}))},close:o=>{r(i=>{const a=MI(i,o);return a?{...i,[a]:i[a].map(l=>l.id==o?{...l,requestClose:!0}:l)}:i})},isActive:o=>Boolean(mC(si.getState(),o).position)}}var gC=0;function lde(e,t={}){gC+=1;const n=t.id??gC,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>si.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var ude=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:a,description:l,icon:c}=e,d=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return Q.createElement(xA,{addRole:!1,status:t,variant:n,id:d?.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},x(SA,{children:c}),Q.createElement(ie.div,{flex:"1",maxWidth:"100%"},o&&x(CA,{id:d?.title,children:o}),l&&x(wA,{id:d?.description,display:"block",children:l})),i&&x(tg,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function NI(e={}){const{render:t,toastComponent:n=ude}=e;return o=>typeof t=="function"?t(o):x(n,{...o,...e})}function cde(e,t){const n=o=>({...t,...o,position:nde(o?.position??t?.position,e)}),r=o=>{const i=n(o),a=NI(i);return si.notify(a,i)};return r.update=(o,i)=>{si.update(o,n(i))},r.promise=(o,i)=>{const a=r({...i.loading,status:"loading",duration:null});o.then(l=>r.update(a,{status:"success",duration:5e3,...I4(i.success,l)})).catch(l=>r.update(a,{status:"error",duration:5e3,...I4(i.error,l)}))},r.closeAll=si.closeAll,r.close=si.close,r.isActive=si.isActive,r}function qf(e){const{theme:t}=OL();return v.exports.useMemo(()=>cde(t.direction,e),[e,t.direction])}var dde={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]}}},$I=v.exports.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:o,requestClose:i=!1,position:a="bottom",duration:l=5e3,containerStyle:c,motionVariants:d=dde,toastSpacing:f="0.5rem"}=e,[p,m]=v.exports.useState(l),g=yq();A0(()=>{g||r?.()},[g]),A0(()=>{m(l)},[l]);const y=()=>m(null),b=()=>m(l),k=()=>{g&&o()};v.exports.useEffect(()=>{g&&i&&o()},[g,i,o]),ede(k,p);const C=v.exports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:f,...c}),[c,f]),S=v.exports.useMemo(()=>ode(a),[a]);return Q.createElement(bo.li,{layout:!0,className:"chakra-toast",variants:d,initial:"initial",animate:"animate",exit:"exit",onHoverStart:y,onHoverEnd:b,custom:{position:a},style:S},Q.createElement(ie.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:C},I4(n,{id:t,onClose:k})))});$I.displayName="ToastComponent";var fde=e=>{const t=v.exports.useSyncExternalStore(si.subscribe,si.getState,si.getState),{children:n,motionVariants:r,component:o=$I,portalProps:i}=e,l=Object.keys(t).map(c=>{const d=t[c];return x("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${c}`,style:ide(c),children:x(da,{initial:!1,children:d.map(f=>x(o,{motionVariants:r,...f},f.id))})},c)});return Y(wn,{children:[n,x(ll,{...i,children:l})]})};function pde(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function hde(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var mde={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]}}}};function Yc(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var O4=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},R4=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function gde(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnEsc:i=!0,onOpen:a,onClose:l,placement:c,id:d,isOpen:f,defaultIsOpen:p,arrowSize:m=10,arrowShadowColor:g,arrowPadding:y,modifiers:b,isDisabled:k,gutter:C,offset:S,direction:_,...E}=e,{isOpen:A,onOpen:R,onClose:O}=sT({isOpen:f,defaultIsOpen:p,onOpen:a,onClose:l}),{referenceRef:$,getPopperProps:H,getArrowInnerProps:z,getArrowProps:X}=aT({enabled:A,placement:c,arrowPadding:y,modifiers:b,gutter:C,offset:S,direction:_}),he=v.exports.useId(),oe=`tooltip-${d??he}`,pe=v.exports.useRef(null),ge=v.exports.useRef(),J=v.exports.useRef(),D=v.exports.useCallback(()=>{J.current&&(clearTimeout(J.current),J.current=void 0),O()},[O]),Z=vde(pe,D),j=v.exports.useCallback(()=>{if(!k&&!ge.current){Z();const ue=R4(pe);ge.current=ue.setTimeout(R,t)}},[Z,k,R,t]),M=v.exports.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=void 0);const ue=R4(pe);J.current=ue.setTimeout(D,n)},[n,D]),G=v.exports.useCallback(()=>{A&&r&&M()},[r,M,A]),le=v.exports.useCallback(()=>{A&&o&&M()},[o,M,A]),ce=v.exports.useCallback(ue=>{A&&ue.key==="Escape"&&M()},[A,M]);f4(()=>O4(pe),"keydown",i?ce:void 0),v.exports.useEffect(()=>()=>{clearTimeout(ge.current),clearTimeout(J.current)},[]),f4(()=>pe.current,"mouseleave",M);const be=v.exports.useCallback((ue={},we=null)=>({...ue,ref:Qt(pe,we,$),onMouseEnter:Yc(ue.onMouseEnter,j),onClick:Yc(ue.onClick,G),onMouseDown:Yc(ue.onMouseDown,le),onFocus:Yc(ue.onFocus,j),onBlur:Yc(ue.onBlur,M),"aria-describedby":A?oe:void 0}),[j,M,le,A,oe,G,$]),me=v.exports.useCallback((ue={},we=null)=>H({...ue,style:{...ue.style,[pn.arrowSize.var]:m?`${m}px`:void 0,[pn.arrowShadowColor.var]:g}},we),[H,m,g]),_e=v.exports.useCallback((ue={},we=null)=>{const $e={...ue.style,position:"relative",transformOrigin:pn.transformOrigin.varRef};return{ref:we,...E,...ue,id:oe,role:"tooltip",style:$e}},[E,oe]);return{isOpen:A,show:j,hide:M,getTriggerProps:be,getTooltipProps:_e,getTooltipPositionerProps:me,getArrowProps:X,getArrowInnerProps:z}}var py="chakra-ui:close-tooltip";function vde(e,t){return v.exports.useEffect(()=>{const n=O4(e);return n.addEventListener(py,t),()=>n.removeEventListener(py,t)},[t,e]),()=>{const n=O4(e),r=R4(e);n.dispatchEvent(new r.CustomEvent(py))}}var yde=ie(bo.div),ir=fe((e,t)=>{const n=cr("Tooltip",e),r=yt(e),o=Nm(),{children:i,label:a,shouldWrapChildren:l,"aria-label":c,hasArrow:d,bg:f,portalProps:p,background:m,backgroundColor:g,bgColor:y,...b}=r,k=m??g??f??y;if(k){n.bg=k;const $=NH(o,"colors",k);n[pn.arrowBg.var]=$}const C=gde({...b,direction:o.direction}),S=typeof i=="string"||l;let _;if(S)_=Q.createElement(ie.span,{tabIndex:0,...C.getTriggerProps()},i);else{const $=v.exports.Children.only(i);_=v.exports.cloneElement($,C.getTriggerProps($.props,$.ref))}const E=!!c,A=C.getTooltipProps({},t),R=E?pde(A,["role","id"]):A,O=hde(A,["role","id"]);return a?Y(wn,{children:[_,x(da,{children:C.isOpen&&Q.createElement(ll,{...p},Q.createElement(ie.div,{...C.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},Y(yde,{variants:mde,...R,initial:"exit",animate:"enter",exit:"exit",__css:n,children:[a,E&&Q.createElement(ie.span,{srOnly:!0,...O},c),d&&Q.createElement(ie.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},Q.createElement(ie.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))]})))})]}):x(wn,{children:i})});ir.displayName="Tooltip";var bde=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:o=!0,theme:i={},environment:a,cssVarsRoot:l}=e,c=x(qA,{environment:a,children:t});return x(IG,{theme:i,cssVarsRoot:l,children:Y(YE,{colorModeManager:n,options:i.config,children:[o?x(lJ,{}):x(sJ,{}),x(RG,{}),r?x(uT,{zIndex:r,children:c}):c]})})};function xde({children:e,theme:t=RI,toastOptions:n,...r}){return Y(bde,{theme:t,...r,children:[e,x(fde,{...n})]})}function wde(...e){let t=[...e],n=e[e.length-1];return Xce(n)&&t.length>1?t=t.slice(0,t.length-1):n=RI,Yj(...t.map(r=>o=>uu(r)?r(o):Sde(o,r)))(n)}function Sde(...e){return rs({},...e,DI)}function DI(e,t,n,r){if((uu(e)||uu(t))&&Object.prototype.hasOwnProperty.call(r,n))return(...o)=>{const i=uu(e)?e(...o):e,a=uu(t)?t(...o):t;return rs({},i,a,DI)}}function Do(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:Dx(e)?2:Fx(e)?3:0}function Lu(e,t){return oc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Cde(e,t){return oc(e)===2?e.get(t):e[t]}function FI(e,t,n){var r=oc(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function zI(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Dx(e){return Ade&&e instanceof Map}function Fx(e){return Tde&&e instanceof Set}function Is(e){return e.o||e.t}function zx(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=VI(e);delete t[Vt];for(var n=Pu(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=_de),Object.freeze(e),t&&tl(e,function(n,r){return Bx(r,!0)},!0)),e}function _de(){Do(2)}function Vx(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function vi(e){var t=D4[e];return t||Do(18,e),t}function kde(e,t){D4[e]||(D4[e]=t)}function M4(){return vf}function hy(e,t){t&&(vi("Patches"),e.u=[],e.s=[],e.v=t)}function F0(e){N4(e),e.p.forEach(Ede),e.p=null}function N4(e){e===vf&&(vf=e.l)}function vC(e){return vf={p:[],l:vf,h:e,m:!0,_:0}}function Ede(e){var t=e[Vt];t.i===0||t.i===1?t.j():t.O=!0}function my(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||vi("ES5").S(t,e,r),r?(n[Vt].P&&(F0(t),Do(4)),ia(e)&&(e=z0(t,e),t.l||B0(t,e)),t.u&&vi("Patches").M(n[Vt].t,e,t.u,t.s)):e=z0(t,n,[]),F0(t),t.u&&t.v(t.u,t.s),e!==BI?e:void 0}function z0(e,t,n){if(Vx(t))return t;var r=t[Vt];if(!r)return tl(t,function(i,a){return yC(e,r,t,i,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return B0(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=zx(r.k):r.o;tl(r.i===3?new Set(o):o,function(i,a){return yC(e,r,o,i,a,n)}),B0(e,o,!1),n&&e.u&&vi("Patches").R(r,n,e.u,e.s)}return r.o}function yC(e,t,n,r,o,i){if(as(o)){var a=z0(e,o,i&&t&&t.i!==3&&!Lu(t.D,r)?i.concat(r):void 0);if(FI(n,r,a),!as(a))return;e.m=!1}if(ia(o)&&!Vx(o)){if(!e.h.F&&e._<1)return;z0(e,o),t&&t.A.l||B0(e,o)}}function B0(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&Bx(t,n)}function gy(e,t){var n=e[Vt];return(n?Is(n):e)[t]}function bC(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 Da(e){e.P||(e.P=!0,e.l&&Da(e.l))}function vy(e){e.o||(e.o=zx(e.t))}function $4(e,t,n){var r=Dx(t)?vi("MapSet").N(t,n):Fx(t)?vi("MapSet").T(t,n):e.g?function(o,i){var a=Array.isArray(o),l={i:a?1:0,A:i?i.A:M4(),P:!1,I:!1,D:{},l:i,t:o,k:null,o:null,j:null,C:!1},c=l,d=yf;a&&(c=[l],d=id);var f=Proxy.revocable(c,d),p=f.revoke,m=f.proxy;return l.k=m,l.j=p,m}(t,n):vi("ES5").J(t,n);return(n?n.A:M4()).p.push(r),r}function Lde(e){return as(e)||Do(22,e),function t(n){if(!ia(n))return n;var r,o=n[Vt],i=oc(n);if(o){if(!o.P&&(o.i<4||!vi("ES5").K(o)))return o.t;o.I=!0,r=xC(n,i),o.I=!1}else r=xC(n,i);return tl(r,function(a,l){o&&Cde(o.t,a)===l||FI(r,a,t(l))}),i===3?new Set(r):r}(e)}function xC(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return zx(e)}function Pde(){function e(i,a){var l=o[i];return l?l.enumerable=a:o[i]=l={configurable:!0,enumerable:a,get:function(){var c=this[Vt];return yf.get(c,i)},set:function(c){var d=this[Vt];yf.set(d,i,c)}},l}function t(i){for(var a=i.length-1;a>=0;a--){var l=i[a][Vt];if(!l.P)switch(l.i){case 5:r(l)&&Da(l);break;case 4:n(l)&&Da(l)}}}function n(i){for(var a=i.t,l=i.k,c=Pu(l),d=c.length-1;d>=0;d--){var f=c[d];if(f!==Vt){var p=a[f];if(p===void 0&&!Lu(a,f))return!0;var m=l[f],g=m&&m[Vt];if(g?g.t!==p:!zI(m,p))return!0}}var y=!!a[Vt];return c.length!==Pu(a).length+(y?0:1)}function r(i){var a=i.k;if(a.length!==i.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var c=0;c1?C-1:0),_=1;_1?f-1:0),m=1;m=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var a=vi("Patches").$;return as(n)?a(n,r):this.produce(n,function(l){return a(l,r)})},e}(),Gr=new Ode,WI=Gr.produce;Gr.produceWithPatches.bind(Gr);Gr.setAutoFreeze.bind(Gr);Gr.setUseProxies.bind(Gr);Gr.applyPatches.bind(Gr);Gr.createDraft.bind(Gr);Gr.finishDraft.bind(Gr);function Rde(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _C(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 kC(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(jn(1));return n(Ux)(e,t)}if(typeof e!="function")throw new Error(jn(2));var o=e,i=t,a=[],l=a,c=!1;function d(){l===a&&(l=a.slice())}function f(){if(c)throw new Error(jn(3));return i}function p(b){if(typeof b!="function")throw new Error(jn(4));if(c)throw new Error(jn(5));var k=!0;return d(),l.push(b),function(){if(!!k){if(c)throw new Error(jn(6));k=!1,d();var S=l.indexOf(b);l.splice(S,1),a=null}}}function m(b){if(!Mde(b))throw new Error(jn(7));if(typeof b.type>"u")throw new Error(jn(8));if(c)throw new Error(jn(9));try{c=!0,i=o(i,b)}finally{c=!1}for(var k=a=l,C=0;C"u")throw new Error(jn(12));if(typeof n(void 0,{type:V0.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(jn(13))})}function UI(e){for(var t=Object.keys(e),n={},r=0;r"u")throw d&&d.type,new Error(jn(14));p[g]=k,f=f||k!==b}return f=f||i.length!==Object.keys(c).length,f?p:c}}function W0(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var d=n[c];return c>0&&(n.splice(c,1),n.unshift(d)),d.value}return U0}function o(l,c){r(l)===U0&&(n.unshift({key:l,value:c}),n.length>e&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:o,getEntries:i,clear:a}}var zde=function(t,n){return t===n};function Bde(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,i=0;i1?t-1:0),r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ffe:dfe;KI.useSyncExternalStore=ju.useSyncExternalStore!==void 0?ju.useSyncExternalStore:pfe;(function(e){e.exports=KI})(ZI);var qI={exports:{}},YI={};/** - * @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 ug=v.exports,hfe=ZI.exports;function mfe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gfe=typeof Object.is=="function"?Object.is:mfe,vfe=hfe.useSyncExternalStore,yfe=ug.useRef,bfe=ug.useEffect,xfe=ug.useMemo,wfe=ug.useDebugValue;YI.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=yfe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=xfe(function(){function c(g){if(!d){if(d=!0,f=g,g=r(g),o!==void 0&&a.hasValue){var y=a.value;if(o(y,g))return p=y}return p=g}if(y=p,gfe(f,g))return y;var b=r(g);return o!==void 0&&o(y,b)?y:(f=g,p=b)}var d=!1,f,p,m=n===void 0?null:n;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,n,r,o]);var l=vfe(e,i[0],i[1]);return bfe(function(){a.hasValue=!0,a.value=l},[l]),wfe(l),l};(function(e){e.exports=YI})(qI);function Sfe(e){e()}let XI=Sfe;const Cfe=e=>XI=e,_fe=()=>XI,ss=Q.createContext(null);function QI(){return v.exports.useContext(ss)}const kfe=()=>{throw new Error("uSES not initialized!")};let JI=kfe;const Efe=e=>{JI=e},Lfe=(e,t)=>e===t;function Pfe(e=ss){const t=e===ss?QI:()=>v.exports.useContext(e);return function(r,o=Lfe){const{store:i,subscription:a,getServerState:l}=t(),c=JI(a.addNestedSub,i.getState,l||i.getState,r,o);return v.exports.useDebugValue(c),c}}const Afe=Pfe();var Tfe={exports:{}},xt={};/** - * @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 Gx=Symbol.for("react.element"),Zx=Symbol.for("react.portal"),cg=Symbol.for("react.fragment"),dg=Symbol.for("react.strict_mode"),fg=Symbol.for("react.profiler"),pg=Symbol.for("react.provider"),hg=Symbol.for("react.context"),Ife=Symbol.for("react.server_context"),mg=Symbol.for("react.forward_ref"),gg=Symbol.for("react.suspense"),vg=Symbol.for("react.suspense_list"),yg=Symbol.for("react.memo"),bg=Symbol.for("react.lazy"),Ofe=Symbol.for("react.offscreen"),eO;eO=Symbol.for("react.module.reference");function wo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Gx:switch(e=e.type,e){case cg:case fg:case dg:case gg:case vg:return e;default:switch(e=e&&e.$$typeof,e){case Ife:case hg:case mg:case bg:case yg:case pg:return e;default:return t}}case Zx:return t}}}xt.ContextConsumer=hg;xt.ContextProvider=pg;xt.Element=Gx;xt.ForwardRef=mg;xt.Fragment=cg;xt.Lazy=bg;xt.Memo=yg;xt.Portal=Zx;xt.Profiler=fg;xt.StrictMode=dg;xt.Suspense=gg;xt.SuspenseList=vg;xt.isAsyncMode=function(){return!1};xt.isConcurrentMode=function(){return!1};xt.isContextConsumer=function(e){return wo(e)===hg};xt.isContextProvider=function(e){return wo(e)===pg};xt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gx};xt.isForwardRef=function(e){return wo(e)===mg};xt.isFragment=function(e){return wo(e)===cg};xt.isLazy=function(e){return wo(e)===bg};xt.isMemo=function(e){return wo(e)===yg};xt.isPortal=function(e){return wo(e)===Zx};xt.isProfiler=function(e){return wo(e)===fg};xt.isStrictMode=function(e){return wo(e)===dg};xt.isSuspense=function(e){return wo(e)===gg};xt.isSuspenseList=function(e){return wo(e)===vg};xt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===cg||e===fg||e===dg||e===gg||e===vg||e===Ofe||typeof e=="object"&&e!==null&&(e.$$typeof===bg||e.$$typeof===yg||e.$$typeof===pg||e.$$typeof===hg||e.$$typeof===mg||e.$$typeof===eO||e.getModuleId!==void 0)};xt.typeOf=wo;(function(e){e.exports=xt})(Tfe);function Rfe(){const e=_fe();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=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}const TC={notify(){},get:()=>[]};function Mfe(e,t){let n,r=TC;function o(p){return c(),r.subscribe(p)}function i(){r.notify()}function a(){f.onStateChange&&f.onStateChange()}function l(){return Boolean(n)}function c(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=Rfe())}function d(){n&&(n(),n=void 0,r.clear(),r=TC)}const f={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:a,isSubscribed:l,trySubscribe:c,tryUnsubscribe:d,getListeners:()=>r};return f}const Nfe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$fe=Nfe?v.exports.useLayoutEffect:v.exports.useEffect;function Dfe({store:e,context:t,children:n,serverState:r}){const o=v.exports.useMemo(()=>{const l=Mfe(e);return{store:e,subscription:l,getServerState:r?()=>r:void 0}},[e,r]),i=v.exports.useMemo(()=>e.getState(),[e]);return $fe(()=>{const{subscription:l}=o;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==e.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[o,i]),x((t||ss).Provider,{value:o,children:n})}function tO(e=ss){const t=e===ss?QI:()=>v.exports.useContext(e);return function(){const{store:r}=t();return r}}const Ffe=tO();function zfe(e=ss){const t=e===ss?Ffe:tO(e);return function(){return t().dispatch}}const Bfe=zfe();Efe(qI.exports.useSyncExternalStoreWithSelector);Cfe(ua.exports.unstable_batchedUpdates);var Kx="persist:",nO="persist/FLUSH",qx="persist/REHYDRATE",rO="persist/PAUSE",oO="persist/PERSIST",iO="persist/PURGE",aO="persist/REGISTER",Vfe=-1;function A1(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A1=function(n){return typeof n}:A1=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},A1(e)}function IC(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 Wfe(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function Jfe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var epe=5e3;function sO(e,t){var n=e.version!==void 0?e.version:Vfe;e.debug;var r=e.stateReconciler===void 0?Hfe:e.stateReconciler,o=e.getStoredState||Zfe,i=e.timeout!==void 0?e.timeout:epe,a=null,l=!1,c=!0,d=function(p){return p._persist.rehydrated&&a&&!c&&a.update(p),p};return function(f,p){var m=f||{},g=m._persist,y=Qfe(m,["_persist"]),b=y;if(p.type===oO){var k=!1,C=function($,H){k||(p.rehydrate(e.key,$,H),k=!0)};if(i&&setTimeout(function(){!k&&C(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},i),c=!1,a||(a=jfe(e)),g)return Ui({},t(b,p),{_persist:g});if(typeof p.rehydrate!="function"||typeof p.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return p.register(e.key),o(e).then(function(O){var $=e.migrate||function(H,z){return Promise.resolve(H)};$(O,n).then(function(H){C(H)},function(H){C(void 0,H)})},function(O){C(void 0,O)}),Ui({},t(b,p),{_persist:{version:n,rehydrated:!1}})}else{if(p.type===iO)return l=!0,p.result(qfe(e)),Ui({},t(b,p),{_persist:g});if(p.type===nO)return p.result(a&&a.flush()),Ui({},t(b,p),{_persist:g});if(p.type===rO)c=!0;else if(p.type===qx){if(l)return Ui({},b,{_persist:Ui({},g,{rehydrated:!0})});if(p.key===e.key){var S=t(b,p),_=p.payload,E=r!==!1&&_!==void 0?r(_,f,S,e):S,A=Ui({},E,{_persist:Ui({},g,{rehydrated:!0})});return d(A)}}}if(!g)return t(f,p);var R=t(b,p);return R===b?f:d(Ui({},R,{_persist:g}))}}function RC(e){return rpe(e)||npe(e)||tpe()}function tpe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function npe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function rpe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:lO,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case aO:return z4({},t,{registry:[].concat(RC(t.registry),[n.key])});case qx:var r=t.registry.indexOf(n.key),o=RC(t.registry);return o.splice(r,1),z4({},t,{registry:o,bootstrapped:o.length===0});default:return t}};function ape(e,t,n){var r=n||!1,o=Ux(ipe,lO,t&&t.enhancer?t.enhancer:void 0),i=function(d){o.dispatch({type:aO,key:d})},a=function(d,f,p){var m={type:qx,payload:f,err:p,key:d};e.dispatch(m),o.dispatch(m),r&&l.getState().bootstrapped&&(r(),r=!1)},l=z4({},o,{purge:function(){var d=[];return e.dispatch({type:iO,result:function(p){d.push(p)}}),Promise.all(d)},flush:function(){var d=[];return e.dispatch({type:nO,result:function(p){d.push(p)}}),Promise.all(d)},pause:function(){e.dispatch({type:rO})},persist:function(){e.dispatch({type:oO,register:i,rehydrate:a})}});return t&&t.manualPersist||l.persist(),l}var Yx={},Xx={};Xx.__esModule=!0;Xx.default=upe;function T1(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T1=function(n){return typeof n}:T1=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},T1(e)}function xy(){}var spe={getItem:xy,setItem:xy,removeItem:xy};function lpe(e){if((typeof self>"u"?"undefined":T1(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function upe(e){var t="".concat(e,"Storage");return lpe(t)?self[t]:spe}Yx.__esModule=!0;Yx.default=fpe;var cpe=dpe(Xx);function dpe(e){return e&&e.__esModule?e:{default:e}}function fpe(e){var t=(0,cpe.default)(e);return{getItem:function(r){return new Promise(function(o,i){o(t.getItem(r))})},setItem:function(r,o){return new Promise(function(i,a){i(t.setItem(r,o))})},removeItem:function(r){return new Promise(function(o,i){o(t.removeItem(r))})}}}var Qx=void 0,ppe=hpe(Yx);function hpe(e){return e&&e.__esModule?e:{default:e}}var mpe=(0,ppe.default)("local");Qx=mpe;const I1=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" "),gpe=e=>{const r=e.split(",").map(o=>o.split(":")).map(o=>({seed:Number(o[0]),weight:Number(o[1])}));return Jx(r)?r:!1},Jx=e=>Boolean(typeof e=="string"?gpe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,o=!isNaN(parseInt(n.toString(),10)),i=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(o&&i)})),j0=e=>e.reduce((t,n,r,o)=>{const{seed:i,weight:a}=n;return t+=`${i}:${a}`,r!==o.length-1&&(t+=","),t},""),vpe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0]),parseFloat(r[1])]),uO={prompt:"",iterations:1,steps:50,cfgScale:7.5,height:512,width:512,sampler:"k_lms",threshold:0,perlin:0,seed:0,seamless:!1,hiresFix:!1,shouldUseInitImage:!1,img2imgStrength:.75,initialImagePath:null,maskPath:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,variationAmount:.1,seedWeights:"",shouldRunESRGAN:!1,upscalingLevel:4,upscalingStrength:.75,shouldRunFacetool:!1,facetoolStrength:.8,facetoolType:"gfpgan",codeformerFidelity:.75,shouldRandomizeSeed:!0,showAdvancedOptions:!0,activeTab:0,shouldShowImageDetails:!1,shouldShowGallery:!1},ype=uO,cO=Hx({name:"options",initialState:ype,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=I1(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},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},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setShouldUseInitImage:(e,t)=>{e.shouldUseInitImage=t.payload},setInitialImagePath:(e,t)=>{const n=t.payload;e.shouldUseInitImage=!!n,e.initialImagePath=n},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,o={...e,[n]:r};return n==="seed"&&(o.shouldRandomizeSeed=!1),n==="initialImagePath"&&r===""&&(o.shouldUseInitImage=!1),o},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:o,variations:i,steps:a,cfg_scale:l,threshold:c,perlin:d,seamless:f,hires_fix:p,width:m,height:g}=t.payload.image;i&&i.length>0?(e.seedWeights=j0(i),e.shouldGenerateVariations=!0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),r&&(e.prompt=I1(r)),n&&(e.sampler=n),a&&(e.steps=a),l&&(e.cfgScale=l),c&&(e.threshold=c),typeof c>"u"&&(e.threshold=0),d&&(e.perlin=d),typeof d>"u"&&(e.perlin=0),typeof f=="boolean"&&(e.seamless=f),typeof p=="boolean"&&(e.hiresFix=p),m&&(e.width=m),g&&(e.height=g)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:o,init_image_path:i,mask_image_path:a}=t.payload.image;n==="img2img"?(i&&(e.initialImagePath=i),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof o=="boolean"&&(e.shouldFitToWidthHeight=o),e.shouldUseInitImage=!0):e.shouldUseInitImage=!1},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:o,seed:i,variations:a,steps:l,cfg_scale:c,threshold:d,perlin:f,seamless:p,hires_fix:m,width:g,height:y,strength:b,fit:k,init_image_path:C,mask_image_path:S}=t.payload.image;n==="img2img"?(C&&(e.initialImagePath=C),S&&(e.maskPath=S),b&&(e.img2imgStrength=b),typeof k=="boolean"&&(e.shouldFitToWidthHeight=k),e.shouldUseInitImage=!0):e.shouldUseInitImage=!1,a&&a.length>0?(e.seedWeights=j0(a),e.shouldGenerateVariations=!0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),o&&(e.prompt=I1(o)),r&&(e.sampler=r),l&&(e.steps=l),c&&(e.cfgScale=c),d&&(e.threshold=d),typeof d>"u"&&(e.threshold=0),f&&(e.perlin=f),typeof f>"u"&&(e.perlin=0),typeof p=="boolean"&&(e.seamless=p),typeof m=="boolean"&&(e.hiresFix=m),g&&(e.width=g),y&&(e.height=y)},resetOptionsState:e=>({...e,...uO}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setShowAdvancedOptions:(e,t)=>{e.showAdvancedOptions=t.payload},setActiveTab:(e,t)=>{e.activeTab=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload}}}),{setPrompt:e6,setIterations:bpe,setSteps:dO,setCfgScale:fO,setThreshold:xpe,setPerlin:wpe,setHeight:pO,setWidth:hO,setSampler:mO,setSeed:Yf,setSeamless:gO,setHiresFix:vO,setImg2imgStrength:yO,setFacetoolStrength:O1,setFacetoolType:R1,setCodeformerFidelity:bO,setUpscalingLevel:B4,setUpscalingStrength:V4,setShouldUseInitImage:G2e,setInitialImagePath:nl,setMaskPath:W4,resetSeed:Z2e,resetOptionsState:K2e,setShouldFitToWidthHeight:xO,setParameter:q2e,setShouldGenerateVariations:Spe,setSeedWeights:wO,setVariationAmount:Cpe,setAllParameters:_pe,setShouldRunFacetool:kpe,setShouldRunESRGAN:Epe,setShouldRandomizeSeed:Lpe,setShowAdvancedOptions:Ppe,setActiveTab:ni,setShouldShowImageDetails:Ape,setShouldShowGallery:NC,setAllTextToImageParameters:Tpe,setAllImageToImageParameters:Ipe}=cO.actions,Ope=cO.reducer;var qn={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",d=500,f="__lodash_placeholder__",p=1,m=2,g=4,y=1,b=2,k=1,C=2,S=4,_=8,E=16,A=32,R=64,O=128,$=256,H=512,z=30,X="...",he=800,ye=16,oe=1,pe=2,ge=3,J=1/0,D=9007199254740991,Z=17976931348623157e292,j=0/0,M=4294967295,G=M-1,le=M>>>1,ce=[["ary",O],["bind",k],["bindKey",C],["curry",_],["curryRight",E],["flip",H],["partial",A],["partialRight",R],["rearg",$]],be="[object Arguments]",me="[object Array]",_e="[object AsyncFunction]",ue="[object Boolean]",we="[object Date]",$e="[object DOMException]",rt="[object Error]",Ct="[object Function]",un="[object GeneratorFunction]",Se="[object Map]",Ie="[object Number]",Qe="[object Null]",Oe="[object Object]",ft="[object Promise]",tn="[object Proxy]",Je="[object RegExp]",_t="[object Set]",nn="[object String]",qt="[object Symbol]",ve="[object Undefined]",Pe="[object WeakMap]",pt="[object WeakSet]",ut="[object ArrayBuffer]",ae="[object DataView]",Ge="[object Float32Array]",Pt="[object Float64Array]",Ln="[object Int8Array]",zn="[object Int16Array]",Tr="[object Int32Array]",Ho="[object Uint8Array]",Ei="[object Uint8ClampedArray]",Xn="[object Uint16Array]",Xr="[object Uint32Array]",vs=/\b__p \+= '';/g,hl=/\b(__p \+=) '' \+/g,Pg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,uc=/&(?:amp|lt|gt|quot|#39);/g,pa=/[&<>"']/g,Ag=RegExp(uc.source),Li=RegExp(pa.source),Tg=/<%-([\s\S]+?)%>/g,Ig=/<%([\s\S]+?)%>/g,tp=/<%=([\s\S]+?)%>/g,Og=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rg=/^\w*$/,So=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cc=/[\\^$.*+?()[\]{}|]/g,Mg=RegExp(cc.source),dc=/^\s+/,Ng=/\s/,$g=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ha=/\{\n\/\* \[wrapped with (.+)\] \*/,Dg=/,? & /,Fg=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zg=/[()=,{}\[\]\/\s]/,Bg=/\\(\\)?/g,Vg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pi=/\w*$/,Wg=/^[-+]0x[0-9a-f]+$/i,Ug=/^0b[01]+$/i,Hg=/^\[object .+?Constructor\]$/,jg=/^0o[0-7]+$/i,Gg=/^(?:0|[1-9]\d*)$/,Zg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ma=/($^)/,Kg=/['\n\r\u2028\u2029\\]/g,Ai="\\ud800-\\udfff",fc="\\u0300-\\u036f",qg="\\ufe20-\\ufe2f",ml="\\u20d0-\\u20ff",pc=fc+qg+ml,np="\\u2700-\\u27bf",rp="a-z\\xdf-\\xf6\\xf8-\\xff",Yg="\\xac\\xb1\\xd7\\xf7",op="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xg="\\u2000-\\u206f",Qg=" \\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",ip="A-Z\\xc0-\\xd6\\xd8-\\xde",ap="\\ufe0e\\ufe0f",sp=Yg+op+Xg+Qg,hc="['\u2019]",Jg="["+Ai+"]",lp="["+sp+"]",gl="["+pc+"]",up="\\d+",vl="["+np+"]",yl="["+rp+"]",cp="[^"+Ai+sp+up+np+rp+ip+"]",mc="\\ud83c[\\udffb-\\udfff]",dp="(?:"+gl+"|"+mc+")",fp="[^"+Ai+"]",gc="(?:\\ud83c[\\udde6-\\uddff]){2}",vc="[\\ud800-\\udbff][\\udc00-\\udfff]",Ti="["+ip+"]",pp="\\u200d",hp="(?:"+yl+"|"+cp+")",ev="(?:"+Ti+"|"+cp+")",bl="(?:"+hc+"(?:d|ll|m|re|s|t|ve))?",mp="(?:"+hc+"(?:D|LL|M|RE|S|T|VE))?",gp=dp+"?",vp="["+ap+"]?",xl="(?:"+pp+"(?:"+[fp,gc,vc].join("|")+")"+vp+gp+")*",yc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wl=vp+gp+xl,tv="(?:"+[vl,gc,vc].join("|")+")"+wl,yp="(?:"+[fp+gl+"?",gl,gc,vc,Jg].join("|")+")",xc=RegExp(hc,"g"),bp=RegExp(gl,"g"),Co=RegExp(mc+"(?="+mc+")|"+yp+wl,"g"),ys=RegExp([Ti+"?"+yl+"+"+bl+"(?="+[lp,Ti,"$"].join("|")+")",ev+"+"+mp+"(?="+[lp,Ti+hp,"$"].join("|")+")",Ti+"?"+hp+"+"+bl,Ti+"+"+mp,bc,yc,up,tv].join("|"),"g"),nv=RegExp("["+pp+Ai+pc+ap+"]"),xp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],wp=-1,kt={};kt[Ge]=kt[Pt]=kt[Ln]=kt[zn]=kt[Tr]=kt[Ho]=kt[Ei]=kt[Xn]=kt[Xr]=!0,kt[be]=kt[me]=kt[ut]=kt[ue]=kt[ae]=kt[we]=kt[rt]=kt[Ct]=kt[Se]=kt[Ie]=kt[Oe]=kt[Je]=kt[_t]=kt[nn]=kt[Pe]=!1;var wt={};wt[be]=wt[me]=wt[ut]=wt[ae]=wt[ue]=wt[we]=wt[Ge]=wt[Pt]=wt[Ln]=wt[zn]=wt[Tr]=wt[Se]=wt[Ie]=wt[Oe]=wt[Je]=wt[_t]=wt[nn]=wt[qt]=wt[Ho]=wt[Ei]=wt[Xn]=wt[Xr]=!0,wt[rt]=wt[Ct]=wt[Pe]=!1;var Sp={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},ov={"&":"&","<":"<",">":">",'"':""","'":"'"},I={"&":"&","<":"<",">":">",""":'"',"'":"'"},B={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},K=parseFloat,Ce=parseInt,Ze=typeof Gi=="object"&&Gi&&Gi.Object===Object&&Gi,ht=typeof self=="object"&&self&&self.Object===Object&&self,Be=Ze||ht||Function("return this")(),He=t&&!t.nodeType&&t,ot=He&&!0&&e&&!e.nodeType&&e,Qn=ot&&ot.exports===He,Pn=Qn&&Ze.process,Sn=function(){try{var W=ot&&ot.require&&ot.require("util").types;return W||Pn&&Pn.binding&&Pn.binding("util")}catch{}}(),Sl=Sn&&Sn.isArrayBuffer,Cl=Sn&&Sn.isDate,wc=Sn&&Sn.isMap,y6=Sn&&Sn.isRegExp,b6=Sn&&Sn.isSet,x6=Sn&&Sn.isTypedArray;function Ir(W,ee,q){switch(q.length){case 0:return W.call(ee);case 1:return W.call(ee,q[0]);case 2:return W.call(ee,q[0],q[1]);case 3:return W.call(ee,q[0],q[1],q[2])}return W.apply(ee,q)}function cM(W,ee,q,ke){for(var Fe=-1,it=W==null?0:W.length;++Fe-1}function iv(W,ee,q){for(var ke=-1,Fe=W==null?0:W.length;++ke-1;);return q}function P6(W,ee){for(var q=W.length;q--&&_l(ee,W[q],0)>-1;);return q}function bM(W,ee){for(var q=W.length,ke=0;q--;)W[q]===ee&&++ke;return ke}var xM=uv(Sp),wM=uv(ov);function SM(W){return"\\"+B[W]}function CM(W,ee){return W==null?n:W[ee]}function kl(W){return nv.test(W)}function _M(W){return xp.test(W)}function kM(W){for(var ee,q=[];!(ee=W.next()).done;)q.push(ee.value);return q}function pv(W){var ee=-1,q=Array(W.size);return W.forEach(function(ke,Fe){q[++ee]=[Fe,ke]}),q}function A6(W,ee){return function(q){return W(ee(q))}}function ya(W,ee){for(var q=-1,ke=W.length,Fe=0,it=[];++q-1}function fN(s,u){var h=this.__data__,w=Bp(h,s);return w<0?(++this.size,h.push([s,u])):h[w][1]=u,this}Ii.prototype.clear=lN,Ii.prototype.delete=uN,Ii.prototype.get=cN,Ii.prototype.has=dN,Ii.prototype.set=fN;function Oi(s){var u=-1,h=s==null?0:s.length;for(this.clear();++u=u?s:u)),s}function to(s,u,h,w,L,T){var N,F=u&p,U=u&m,te=u&g;if(h&&(N=L?h(s,w,L,T):h(s)),N!==n)return N;if(!Ht(s))return s;var ne=ze(s);if(ne){if(N=g$(s),!F)return fr(s,N)}else{var se=Vn(s),xe=se==Ct||se==un;if(_a(s))return d9(s,F);if(se==Oe||se==be||xe&&!L){if(N=U||xe?{}:T9(s),!F)return U?i$(s,PN(N,s)):o$(s,V6(N,s))}else{if(!wt[se])return L?s:{};N=v$(s,se,F)}}T||(T=new ko);var Ae=T.get(s);if(Ae)return Ae;T.set(s,N),iw(s)?s.forEach(function(Ne){N.add(to(Ne,u,h,Ne,s,T))}):rw(s)&&s.forEach(function(Ne,Ke){N.set(Ke,to(Ne,u,h,Ke,s,T))});var Me=te?U?zv:Fv:U?hr:Cn,We=ne?n:Me(s);return Qr(We||s,function(Ne,Ke){We&&(Ke=Ne,Ne=s[Ke]),Pc(N,Ke,to(Ne,u,h,Ke,s,T))}),N}function AN(s){var u=Cn(s);return function(h){return W6(h,s,u)}}function W6(s,u,h){var w=h.length;if(s==null)return!w;for(s=Et(s);w--;){var L=h[w],T=u[L],N=s[L];if(N===n&&!(L in s)||!T(N))return!1}return!0}function U6(s,u,h){if(typeof s!="function")throw new Jr(a);return Nc(function(){s.apply(n,h)},u)}function Ac(s,u,h,w){var L=-1,T=Cp,N=!0,F=s.length,U=[],te=u.length;if(!F)return U;h&&(u=Ft(u,Or(h))),w?(T=iv,N=!1):u.length>=o&&(T=Sc,N=!1,u=new ws(u));e:for(;++LL?0:L+h),w=w===n||w>L?L:Ve(w),w<0&&(w+=L),w=h>w?0:sw(w);h0&&h(F)?u>1?An(F,u-1,h,w,L):va(L,F):w||(L[L.length]=F)}return L}var xv=v9(),G6=v9(!0);function jo(s,u){return s&&xv(s,u,Cn)}function wv(s,u){return s&&G6(s,u,Cn)}function Wp(s,u){return ga(u,function(h){return Di(s[h])})}function Cs(s,u){u=Sa(u,s);for(var h=0,w=u.length;s!=null&&hu}function ON(s,u){return s!=null&&mt.call(s,u)}function RN(s,u){return s!=null&&u in Et(s)}function MN(s,u,h){return s>=Bn(u,h)&&s=120&&ne.length>=120)?new ws(N&&ne):n}ne=s[0];var se=-1,xe=F[0];e:for(;++se-1;)F!==s&&Rp.call(F,U,1),Rp.call(s,U,1);return s}function r9(s,u){for(var h=s?u.length:0,w=h-1;h--;){var L=u[h];if(h==w||L!==T){var T=L;$i(L)?Rp.call(s,L,1):Iv(s,L)}}return s}function Pv(s,u){return s+$p(D6()*(u-s+1))}function ZN(s,u,h,w){for(var L=-1,T=vn(Np((u-s)/(h||1)),0),N=q(T);T--;)N[w?T:++L]=s,s+=h;return N}function Av(s,u){var h="";if(!s||u<1||u>D)return h;do u%2&&(h+=s),u=$p(u/2),u&&(s+=s);while(u);return h}function je(s,u){return Gv(R9(s,u,mr),s+"")}function KN(s){return B6($l(s))}function qN(s,u){var h=$l(s);return Jp(h,Ss(u,0,h.length))}function Oc(s,u,h,w){if(!Ht(s))return s;u=Sa(u,s);for(var L=-1,T=u.length,N=T-1,F=s;F!=null&&++LL?0:L+u),h=h>L?L:h,h<0&&(h+=L),L=u>h?0:h-u>>>0,u>>>=0;for(var T=q(L);++w>>1,N=s[T];N!==null&&!Mr(N)&&(h?N<=u:N=o){var te=u?null:u$(s);if(te)return kp(te);N=!1,L=Sc,U=new ws}else U=u?[]:F;e:for(;++w=w?s:no(s,u,h)}var c9=BM||function(s){return Be.clearTimeout(s)};function d9(s,u){if(u)return s.slice();var h=s.length,w=O6?O6(h):new s.constructor(h);return s.copy(w),w}function Nv(s){var u=new s.constructor(s.byteLength);return new Ip(u).set(new Ip(s)),u}function e$(s,u){var h=u?Nv(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.byteLength)}function t$(s){var u=new s.constructor(s.source,Pi.exec(s));return u.lastIndex=s.lastIndex,u}function n$(s){return Lc?Et(Lc.call(s)):{}}function f9(s,u){var h=u?Nv(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.length)}function p9(s,u){if(s!==u){var h=s!==n,w=s===null,L=s===s,T=Mr(s),N=u!==n,F=u===null,U=u===u,te=Mr(u);if(!F&&!te&&!T&&s>u||T&&N&&U&&!F&&!te||w&&N&&U||!h&&U||!L)return 1;if(!w&&!T&&!te&&s=F)return U;var te=h[w];return U*(te=="desc"?-1:1)}}return s.index-u.index}function h9(s,u,h,w){for(var L=-1,T=s.length,N=h.length,F=-1,U=u.length,te=vn(T-N,0),ne=q(U+te),se=!w;++F1?h[L-1]:n,N=L>2?h[2]:n;for(T=s.length>3&&typeof T=="function"?(L--,T):n,N&&er(h[0],h[1],N)&&(T=L<3?n:T,L=1),u=Et(u);++w-1?L[T?u[N]:N]:n}}function x9(s){return Ni(function(u){var h=u.length,w=h,L=eo.prototype.thru;for(s&&u.reverse();w--;){var T=u[w];if(typeof T!="function")throw new Jr(a);if(L&&!N&&Xp(T)=="wrapper")var N=new eo([],!0)}for(w=N?w:h;++w1&&Xe.reverse(),ne&&UF))return!1;var te=T.get(s),ne=T.get(u);if(te&&ne)return te==u&&ne==s;var se=-1,xe=!0,Ae=h&b?new ws:n;for(T.set(s,u),T.set(u,s);++se1?"& ":"")+u[w],u=u.join(h>2?", ":" "),s.replace($g,`{ -/* [wrapped with `+u+`] */ -`)}function b$(s){return ze(s)||Es(s)||!!(N6&&s&&s[N6])}function $i(s,u){var h=typeof s;return u=u??D,!!u&&(h=="number"||h!="symbol"&&Gg.test(s))&&s>-1&&s%1==0&&s0){if(++u>=he)return arguments[0]}else u=0;return s.apply(n,arguments)}}function Jp(s,u){var h=-1,w=s.length,L=w-1;for(u=u===n?w:u;++h1?s[u-1]:n;return h=typeof h=="function"?(s.pop(),h):n,j9(s,h)});function G9(s){var u=P(s);return u.__chain__=!0,u}function TD(s,u){return u(s),s}function eh(s,u){return u(s)}var ID=Ni(function(s){var u=s.length,h=u?s[0]:0,w=this.__wrapped__,L=function(T){return bv(T,s)};return u>1||this.__actions__.length||!(w instanceof qe)||!$i(h)?this.thru(L):(w=w.slice(h,+h+(u?1:0)),w.__actions__.push({func:eh,args:[L],thisArg:n}),new eo(w,this.__chain__).thru(function(T){return u&&!T.length&&T.push(n),T}))});function OD(){return G9(this)}function RD(){return new eo(this.value(),this.__chain__)}function MD(){this.__values__===n&&(this.__values__=aw(this.value()));var s=this.__index__>=this.__values__.length,u=s?n:this.__values__[this.__index__++];return{done:s,value:u}}function ND(){return this}function $D(s){for(var u,h=this;h instanceof zp;){var w=z9(h);w.__index__=0,w.__values__=n,u?L.__wrapped__=w:u=w;var L=w;h=h.__wrapped__}return L.__wrapped__=s,u}function DD(){var s=this.__wrapped__;if(s instanceof qe){var u=s;return this.__actions__.length&&(u=new qe(this)),u=u.reverse(),u.__actions__.push({func:eh,args:[Zv],thisArg:n}),new eo(u,this.__chain__)}return this.thru(Zv)}function FD(){return l9(this.__wrapped__,this.__actions__)}var zD=Gp(function(s,u,h){mt.call(s,h)?++s[h]:Ri(s,h,1)});function BD(s,u,h){var w=ze(s)?w6:TN;return h&&er(s,u,h)&&(u=n),w(s,Re(u,3))}function VD(s,u){var h=ze(s)?ga:j6;return h(s,Re(u,3))}var WD=b9(B9),UD=b9(V9);function HD(s,u){return An(th(s,u),1)}function jD(s,u){return An(th(s,u),J)}function GD(s,u,h){return h=h===n?1:Ve(h),An(th(s,u),h)}function Z9(s,u){var h=ze(s)?Qr:xa;return h(s,Re(u,3))}function K9(s,u){var h=ze(s)?dM:H6;return h(s,Re(u,3))}var ZD=Gp(function(s,u,h){mt.call(s,h)?s[h].push(u):Ri(s,h,[u])});function KD(s,u,h,w){s=pr(s)?s:$l(s),h=h&&!w?Ve(h):0;var L=s.length;return h<0&&(h=vn(L+h,0)),ah(s)?h<=L&&s.indexOf(u,h)>-1:!!L&&_l(s,u,h)>-1}var qD=je(function(s,u,h){var w=-1,L=typeof u=="function",T=pr(s)?q(s.length):[];return xa(s,function(N){T[++w]=L?Ir(u,N,h):Tc(N,u,h)}),T}),YD=Gp(function(s,u,h){Ri(s,h,u)});function th(s,u){var h=ze(s)?Ft:X6;return h(s,Re(u,3))}function XD(s,u,h,w){return s==null?[]:(ze(u)||(u=u==null?[]:[u]),h=w?n:h,ze(h)||(h=h==null?[]:[h]),t9(s,u,h))}var QD=Gp(function(s,u,h){s[h?0:1].push(u)},function(){return[[],[]]});function JD(s,u,h){var w=ze(s)?av:k6,L=arguments.length<3;return w(s,Re(u,4),h,L,xa)}function eF(s,u,h){var w=ze(s)?fM:k6,L=arguments.length<3;return w(s,Re(u,4),h,L,H6)}function tF(s,u){var h=ze(s)?ga:j6;return h(s,oh(Re(u,3)))}function nF(s){var u=ze(s)?B6:KN;return u(s)}function rF(s,u,h){(h?er(s,u,h):u===n)?u=1:u=Ve(u);var w=ze(s)?kN:qN;return w(s,u)}function oF(s){var u=ze(s)?EN:XN;return u(s)}function iF(s){if(s==null)return 0;if(pr(s))return ah(s)?El(s):s.length;var u=Vn(s);return u==Se||u==_t?s.size:kv(s).length}function aF(s,u,h){var w=ze(s)?sv:QN;return h&&er(s,u,h)&&(u=n),w(s,Re(u,3))}var sF=je(function(s,u){if(s==null)return[];var h=u.length;return h>1&&er(s,u[0],u[1])?u=[]:h>2&&er(u[0],u[1],u[2])&&(u=[u[0]]),t9(s,An(u,1),[])}),nh=VM||function(){return Be.Date.now()};function lF(s,u){if(typeof u!="function")throw new Jr(a);return s=Ve(s),function(){if(--s<1)return u.apply(this,arguments)}}function q9(s,u,h){return u=h?n:u,u=s&&u==null?s.length:u,Mi(s,O,n,n,n,n,u)}function Y9(s,u){var h;if(typeof u!="function")throw new Jr(a);return s=Ve(s),function(){return--s>0&&(h=u.apply(this,arguments)),s<=1&&(u=n),h}}var qv=je(function(s,u,h){var w=k;if(h.length){var L=ya(h,Ml(qv));w|=A}return Mi(s,w,u,h,L)}),X9=je(function(s,u,h){var w=k|C;if(h.length){var L=ya(h,Ml(X9));w|=A}return Mi(u,w,s,h,L)});function Q9(s,u,h){u=h?n:u;var w=Mi(s,_,n,n,n,n,n,u);return w.placeholder=Q9.placeholder,w}function J9(s,u,h){u=h?n:u;var w=Mi(s,E,n,n,n,n,n,u);return w.placeholder=J9.placeholder,w}function ew(s,u,h){var w,L,T,N,F,U,te=0,ne=!1,se=!1,xe=!0;if(typeof s!="function")throw new Jr(a);u=oo(u)||0,Ht(h)&&(ne=!!h.leading,se="maxWait"in h,T=se?vn(oo(h.maxWait)||0,u):T,xe="trailing"in h?!!h.trailing:xe);function Ae(on){var Lo=w,zi=L;return w=L=n,te=on,N=s.apply(zi,Lo),N}function Me(on){return te=on,F=Nc(Ke,u),ne?Ae(on):N}function We(on){var Lo=on-U,zi=on-te,bw=u-Lo;return se?Bn(bw,T-zi):bw}function Ne(on){var Lo=on-U,zi=on-te;return U===n||Lo>=u||Lo<0||se&&zi>=T}function Ke(){var on=nh();if(Ne(on))return Xe(on);F=Nc(Ke,We(on))}function Xe(on){return F=n,xe&&w?Ae(on):(w=L=n,N)}function Nr(){F!==n&&c9(F),te=0,w=U=L=F=n}function tr(){return F===n?N:Xe(nh())}function $r(){var on=nh(),Lo=Ne(on);if(w=arguments,L=this,U=on,Lo){if(F===n)return Me(U);if(se)return c9(F),F=Nc(Ke,u),Ae(U)}return F===n&&(F=Nc(Ke,u)),N}return $r.cancel=Nr,$r.flush=tr,$r}var uF=je(function(s,u){return U6(s,1,u)}),cF=je(function(s,u,h){return U6(s,oo(u)||0,h)});function dF(s){return Mi(s,H)}function rh(s,u){if(typeof s!="function"||u!=null&&typeof u!="function")throw new Jr(a);var h=function(){var w=arguments,L=u?u.apply(this,w):w[0],T=h.cache;if(T.has(L))return T.get(L);var N=s.apply(this,w);return h.cache=T.set(L,N)||T,N};return h.cache=new(rh.Cache||Oi),h}rh.Cache=Oi;function oh(s){if(typeof s!="function")throw new Jr(a);return function(){var u=arguments;switch(u.length){case 0:return!s.call(this);case 1:return!s.call(this,u[0]);case 2:return!s.call(this,u[0],u[1]);case 3:return!s.call(this,u[0],u[1],u[2])}return!s.apply(this,u)}}function fF(s){return Y9(2,s)}var pF=JN(function(s,u){u=u.length==1&&ze(u[0])?Ft(u[0],Or(Re())):Ft(An(u,1),Or(Re()));var h=u.length;return je(function(w){for(var L=-1,T=Bn(w.length,h);++L=u}),Es=K6(function(){return arguments}())?K6:function(s){return Yt(s)&&mt.call(s,"callee")&&!M6.call(s,"callee")},ze=q.isArray,PF=Sl?Or(Sl):$N;function pr(s){return s!=null&&ih(s.length)&&!Di(s)}function rn(s){return Yt(s)&&pr(s)}function AF(s){return s===!0||s===!1||Yt(s)&&Jn(s)==ue}var _a=UM||s2,TF=Cl?Or(Cl):DN;function IF(s){return Yt(s)&&s.nodeType===1&&!$c(s)}function OF(s){if(s==null)return!0;if(pr(s)&&(ze(s)||typeof s=="string"||typeof s.splice=="function"||_a(s)||Nl(s)||Es(s)))return!s.length;var u=Vn(s);if(u==Se||u==_t)return!s.size;if(Mc(s))return!kv(s).length;for(var h in s)if(mt.call(s,h))return!1;return!0}function RF(s,u){return Ic(s,u)}function MF(s,u,h){h=typeof h=="function"?h:n;var w=h?h(s,u):n;return w===n?Ic(s,u,n,h):!!w}function Xv(s){if(!Yt(s))return!1;var u=Jn(s);return u==rt||u==$e||typeof s.message=="string"&&typeof s.name=="string"&&!$c(s)}function NF(s){return typeof s=="number"&&$6(s)}function Di(s){if(!Ht(s))return!1;var u=Jn(s);return u==Ct||u==un||u==_e||u==tn}function nw(s){return typeof s=="number"&&s==Ve(s)}function ih(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=D}function Ht(s){var u=typeof s;return s!=null&&(u=="object"||u=="function")}function Yt(s){return s!=null&&typeof s=="object"}var rw=wc?Or(wc):zN;function $F(s,u){return s===u||_v(s,u,Vv(u))}function DF(s,u,h){return h=typeof h=="function"?h:n,_v(s,u,Vv(u),h)}function FF(s){return ow(s)&&s!=+s}function zF(s){if(S$(s))throw new Fe(i);return q6(s)}function BF(s){return s===null}function VF(s){return s==null}function ow(s){return typeof s=="number"||Yt(s)&&Jn(s)==Ie}function $c(s){if(!Yt(s)||Jn(s)!=Oe)return!1;var u=Op(s);if(u===null)return!0;var h=mt.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&Pp.call(h)==DM}var Qv=y6?Or(y6):BN;function WF(s){return nw(s)&&s>=-D&&s<=D}var iw=b6?Or(b6):VN;function ah(s){return typeof s=="string"||!ze(s)&&Yt(s)&&Jn(s)==nn}function Mr(s){return typeof s=="symbol"||Yt(s)&&Jn(s)==qt}var Nl=x6?Or(x6):WN;function UF(s){return s===n}function HF(s){return Yt(s)&&Vn(s)==Pe}function jF(s){return Yt(s)&&Jn(s)==pt}var GF=Yp(Ev),ZF=Yp(function(s,u){return s<=u});function aw(s){if(!s)return[];if(pr(s))return ah(s)?_o(s):fr(s);if(Cc&&s[Cc])return kM(s[Cc]());var u=Vn(s),h=u==Se?pv:u==_t?kp:$l;return h(s)}function Fi(s){if(!s)return s===0?s:0;if(s=oo(s),s===J||s===-J){var u=s<0?-1:1;return u*Z}return s===s?s:0}function Ve(s){var u=Fi(s),h=u%1;return u===u?h?u-h:u:0}function sw(s){return s?Ss(Ve(s),0,M):0}function oo(s){if(typeof s=="number")return s;if(Mr(s))return j;if(Ht(s)){var u=typeof s.valueOf=="function"?s.valueOf():s;s=Ht(u)?u+"":u}if(typeof s!="string")return s===0?s:+s;s=E6(s);var h=Ug.test(s);return h||jg.test(s)?Ce(s.slice(2),h?2:8):Wg.test(s)?j:+s}function lw(s){return Go(s,hr(s))}function KF(s){return s?Ss(Ve(s),-D,D):s===0?s:0}function ct(s){return s==null?"":Rr(s)}var qF=Ol(function(s,u){if(Mc(u)||pr(u)){Go(u,Cn(u),s);return}for(var h in u)mt.call(u,h)&&Pc(s,h,u[h])}),uw=Ol(function(s,u){Go(u,hr(u),s)}),sh=Ol(function(s,u,h,w){Go(u,hr(u),s,w)}),YF=Ol(function(s,u,h,w){Go(u,Cn(u),s,w)}),XF=Ni(bv);function QF(s,u){var h=Il(s);return u==null?h:V6(h,u)}var JF=je(function(s,u){s=Et(s);var h=-1,w=u.length,L=w>2?u[2]:n;for(L&&er(u[0],u[1],L)&&(w=1);++h1),T}),Go(s,zv(s),h),w&&(h=to(h,p|m|g,c$));for(var L=u.length;L--;)Iv(h,u[L]);return h});function vz(s,u){return dw(s,oh(Re(u)))}var yz=Ni(function(s,u){return s==null?{}:jN(s,u)});function dw(s,u){if(s==null)return{};var h=Ft(zv(s),function(w){return[w]});return u=Re(u),n9(s,h,function(w,L){return u(w,L[0])})}function bz(s,u,h){u=Sa(u,s);var w=-1,L=u.length;for(L||(L=1,s=n);++wu){var w=s;s=u,u=w}if(h||s%1||u%1){var L=D6();return Bn(s+L*(u-s+K("1e-"+((L+"").length-1))),u)}return Pv(s,u)}var Tz=Rl(function(s,u,h){return u=u.toLowerCase(),s+(h?hw(u):u)});function hw(s){return t2(ct(s).toLowerCase())}function mw(s){return s=ct(s),s&&s.replace(Zg,xM).replace(bp,"")}function Iz(s,u,h){s=ct(s),u=Rr(u);var w=s.length;h=h===n?w:Ss(Ve(h),0,w);var L=h;return h-=u.length,h>=0&&s.slice(h,L)==u}function Oz(s){return s=ct(s),s&&Li.test(s)?s.replace(pa,wM):s}function Rz(s){return s=ct(s),s&&Mg.test(s)?s.replace(cc,"\\$&"):s}var Mz=Rl(function(s,u,h){return s+(h?"-":"")+u.toLowerCase()}),Nz=Rl(function(s,u,h){return s+(h?" ":"")+u.toLowerCase()}),$z=y9("toLowerCase");function Dz(s,u,h){s=ct(s),u=Ve(u);var w=u?El(s):0;if(!u||w>=u)return s;var L=(u-w)/2;return qp($p(L),h)+s+qp(Np(L),h)}function Fz(s,u,h){s=ct(s),u=Ve(u);var w=u?El(s):0;return u&&w>>0,h?(s=ct(s),s&&(typeof u=="string"||u!=null&&!Qv(u))&&(u=Rr(u),!u&&kl(s))?Ca(_o(s),0,h):s.split(u,h)):[]}var jz=Rl(function(s,u,h){return s+(h?" ":"")+t2(u)});function Gz(s,u,h){return s=ct(s),h=h==null?0:Ss(Ve(h),0,s.length),u=Rr(u),s.slice(h,h+u.length)==u}function Zz(s,u,h){var w=P.templateSettings;h&&er(s,u,h)&&(u=n),s=ct(s),u=sh({},u,w,k9);var L=sh({},u.imports,w.imports,k9),T=Cn(L),N=fv(L,T),F,U,te=0,ne=u.interpolate||ma,se="__p += '",xe=hv((u.escape||ma).source+"|"+ne.source+"|"+(ne===tp?Vg:ma).source+"|"+(u.evaluate||ma).source+"|$","g"),Ae="//# sourceURL="+(mt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wp+"]")+` -`;s.replace(xe,function(Ne,Ke,Xe,Nr,tr,$r){return Xe||(Xe=Nr),se+=s.slice(te,$r).replace(Kg,SM),Ke&&(F=!0,se+=`' + -__e(`+Ke+`) + -'`),tr&&(U=!0,se+=`'; -`+tr+`; -__p += '`),Xe&&(se+=`' + -((__t = (`+Xe+`)) == null ? '' : __t) + -'`),te=$r+Ne.length,Ne}),se+=`'; -`;var Me=mt.call(u,"variable")&&u.variable;if(!Me)se=`with (obj) { -`+se+` -} -`;else if(zg.test(Me))throw new Fe(l);se=(U?se.replace(vs,""):se).replace(hl,"$1").replace(Pg,"$1;"),se="function("+(Me||"obj")+`) { -`+(Me?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(F?", __e = _.escape":"")+(U?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+se+`return __p -}`;var We=vw(function(){return it(T,Ae+"return "+se).apply(n,N)});if(We.source=se,Xv(We))throw We;return We}function Kz(s){return ct(s).toLowerCase()}function qz(s){return ct(s).toUpperCase()}function Yz(s,u,h){if(s=ct(s),s&&(h||u===n))return E6(s);if(!s||!(u=Rr(u)))return s;var w=_o(s),L=_o(u),T=L6(w,L),N=P6(w,L)+1;return Ca(w,T,N).join("")}function Xz(s,u,h){if(s=ct(s),s&&(h||u===n))return s.slice(0,T6(s)+1);if(!s||!(u=Rr(u)))return s;var w=_o(s),L=P6(w,_o(u))+1;return Ca(w,0,L).join("")}function Qz(s,u,h){if(s=ct(s),s&&(h||u===n))return s.replace(dc,"");if(!s||!(u=Rr(u)))return s;var w=_o(s),L=L6(w,_o(u));return Ca(w,L).join("")}function Jz(s,u){var h=z,w=X;if(Ht(u)){var L="separator"in u?u.separator:L;h="length"in u?Ve(u.length):h,w="omission"in u?Rr(u.omission):w}s=ct(s);var T=s.length;if(kl(s)){var N=_o(s);T=N.length}if(h>=T)return s;var F=h-El(w);if(F<1)return w;var U=N?Ca(N,0,F).join(""):s.slice(0,F);if(L===n)return U+w;if(N&&(F+=U.length-F),Qv(L)){if(s.slice(F).search(L)){var te,ne=U;for(L.global||(L=hv(L.source,ct(Pi.exec(L))+"g")),L.lastIndex=0;te=L.exec(ne);)var se=te.index;U=U.slice(0,se===n?F:se)}}else if(s.indexOf(Rr(L),F)!=F){var xe=U.lastIndexOf(L);xe>-1&&(U=U.slice(0,xe))}return U+w}function eB(s){return s=ct(s),s&&Ag.test(s)?s.replace(uc,AM):s}var tB=Rl(function(s,u,h){return s+(h?" ":"")+u.toUpperCase()}),t2=y9("toUpperCase");function gw(s,u,h){return s=ct(s),u=h?n:u,u===n?_M(s)?OM(s):mM(s):s.match(u)||[]}var vw=je(function(s,u){try{return Ir(s,n,u)}catch(h){return Xv(h)?h:new Fe(h)}}),nB=Ni(function(s,u){return Qr(u,function(h){h=Zo(h),Ri(s,h,qv(s[h],s))}),s});function rB(s){var u=s==null?0:s.length,h=Re();return s=u?Ft(s,function(w){if(typeof w[1]!="function")throw new Jr(a);return[h(w[0]),w[1]]}):[],je(function(w){for(var L=-1;++LD)return[];var h=M,w=Bn(s,M);u=Re(u),s-=M;for(var L=dv(w,u);++h0||u<0)?new qe(h):(s<0?h=h.takeRight(-s):s&&(h=h.drop(s)),u!==n&&(u=Ve(u),h=u<0?h.dropRight(-u):h.take(u-s)),h)},qe.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},qe.prototype.toArray=function(){return this.take(M)},jo(qe.prototype,function(s,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),w=/^(?:head|last)$/.test(u),L=P[w?"take"+(u=="last"?"Right":""):u],T=w||/^find/.test(u);!L||(P.prototype[u]=function(){var N=this.__wrapped__,F=w?[1]:arguments,U=N instanceof qe,te=F[0],ne=U||ze(N),se=function(Ke){var Xe=L.apply(P,va([Ke],F));return w&&xe?Xe[0]:Xe};ne&&h&&typeof te=="function"&&te.length!=1&&(U=ne=!1);var xe=this.__chain__,Ae=!!this.__actions__.length,Me=T&&!xe,We=U&&!Ae;if(!T&&ne){N=We?N:new qe(this);var Ne=s.apply(N,F);return Ne.__actions__.push({func:eh,args:[se],thisArg:n}),new eo(Ne,xe)}return Me&&We?s.apply(this,F):(Ne=this.thru(se),Me?w?Ne.value()[0]:Ne.value():Ne)})}),Qr(["pop","push","shift","sort","splice","unshift"],function(s){var u=Ep[s],h=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",w=/^(?:pop|shift)$/.test(s);P.prototype[s]=function(){var L=arguments;if(w&&!this.__chain__){var T=this.value();return u.apply(ze(T)?T:[],L)}return this[h](function(N){return u.apply(ze(N)?N:[],L)})}}),jo(qe.prototype,function(s,u){var h=P[u];if(h){var w=h.name+"";mt.call(Tl,w)||(Tl[w]=[]),Tl[w].push({name:u,func:h})}}),Tl[Zp(n,C).name]=[{name:"wrapper",func:n}],qe.prototype.clone=eN,qe.prototype.reverse=tN,qe.prototype.value=nN,P.prototype.at=ID,P.prototype.chain=OD,P.prototype.commit=RD,P.prototype.next=MD,P.prototype.plant=$D,P.prototype.reverse=DD,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=FD,P.prototype.first=P.prototype.head,Cc&&(P.prototype[Cc]=ND),P},Ll=RM();ot?((ot.exports=Ll)._=Ll,He._=Ll):Be._=Ll}).call(Gi)})(qn,qn.exports);const xf=qn.exports,Rpe={currentImageUuid:"",images:[],areMoreImagesAvailable:!0},SO=Hx({name:"gallery",initialState:Rpe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const n=t.payload,r=e.images.filter(o=>o.uuid!==n);if(n===e.currentImageUuid){const o=e.images.findIndex(a=>a.uuid===n),i=qn.exports.clamp(o,0,r.length-1);e.currentImage=r.length?r[i]:void 0,e.currentImageUuid=r.length?r[i].uuid:""}e.images=r},addImage:(e,t)=>{const n=t.payload,{uuid:r,url:o,mtime:i}=n;e.images.find(a=>a.url===o&&a.mtime===i)||(e.images.unshift(n),e.currentImageUuid=r,e.intermediateImage=void 0,e.currentImage=n,e.latest_mtime=i)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{images:t,currentImage:n}=e;if(n){const r=t.findIndex(o=>o.uuid===n.uuid);if(xf.inRange(r,0,t.length)){const o=t[r+1];e.currentImage=o,e.currentImageUuid=o.uuid}}},selectPrevImage:e=>{const{images:t,currentImage:n}=e;if(n){const r=t.findIndex(o=>o.uuid===n.uuid);if(xf.inRange(r,1,t.length+1)){const o=t[r-1];e.currentImage=o,e.currentImageUuid=o.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r}=t.payload;if(n.length>0){const o=n.filter(i=>!e.images.find(a=>a.url===i.url&&a.mtime===i.mtime));if(e.images=e.images.concat(o).sort((i,a)=>a.mtime-i.mtime),!e.currentImage){const i=n[0];e.currentImage=i,e.currentImageUuid=i.uuid}e.latest_mtime=n[0].mtime,e.earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.areMoreImagesAvailable=r)}}}),{addImage:wy,clearIntermediateImage:$C,removeImage:Mpe,setCurrentImage:Npe,addGalleryImages:$pe,setIntermediateImage:Dpe,selectNextImage:CO,selectPrevImage:_O}=SO.actions,Fpe=SO.reducer,zpe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgress:!1,shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",hasError:!1,wasErrorSeen:!0},Bpe=zpe,kO=Hx({name:"system",initialState:Bpe,reducers:{setShouldDisplayInProgress:(e,t)=>{e.shouldDisplayInProgress=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Server error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:o}=t.payload,a={timestamp:n,message:r,level:o||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"}}}),{setShouldDisplayInProgress:Vpe,setIsProcessing:M1,addLogEntry:vr,setShouldShowLogViewer:DC,setIsConnected:FC,setSocketId:Y2e,setShouldConfirmOnDelete:EO,setOpenAccordions:Wpe,setSystemStatus:Upe,setCurrentStatus:zC,setSystemConfig:Hpe,setShouldDisplayGuides:jpe,processingCanceled:Gpe,errorOccurred:Zpe,errorSeen:LO}=kO.actions,Kpe=kO.reducer,Si=Object.create(null);Si.open="0";Si.close="1";Si.ping="2";Si.pong="3";Si.message="4";Si.upgrade="5";Si.noop="6";const N1=Object.create(null);Object.keys(Si).forEach(e=>{N1[Si[e]]=e});const qpe={type:"error",data:"parser error"},Ype=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Xpe=typeof ArrayBuffer=="function",Qpe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,PO=({type:e,data:t},n,r)=>Ype&&t instanceof Blob?n?r(t):BC(t,r):Xpe&&(t instanceof ArrayBuffer||Qpe(t))?n?r(t):BC(new Blob([t]),r):r(Si[e]+(t||"")),BC=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},VC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ad=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,o=0,i,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),f=new Uint8Array(d);for(r=0;r>4,f[o++]=(a&15)<<4|l>>2,f[o++]=(l&3)<<6|c&63;return d},ehe=typeof ArrayBuffer=="function",AO=(e,t)=>{if(typeof e!="string")return{type:"message",data:TO(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:the(e.substring(1),t)}:N1[n]?e.length>1?{type:N1[n],data:e.substring(1)}:{type:N1[n]}:qpe},the=(e,t)=>{if(ehe){const n=Jpe(e);return TO(n,t)}else return{base64:!0,data:e}},TO=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},IO=String.fromCharCode(30),nhe=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,a)=>{PO(i,!1,l=>{r[a]=l,++o===n&&t(r.join(IO))})})},rhe=(e,t)=>{const n=e.split(IO),r=[];for(let o=0;otypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function RO(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const ihe=setTimeout,ahe=clearTimeout;function xg(e,t){t.useNativeTimers?(e.setTimeoutFn=ihe.bind(Ha),e.clearTimeoutFn=ahe.bind(Ha)):(e.setTimeoutFn=setTimeout.bind(Ha),e.clearTimeoutFn=clearTimeout.bind(Ha))}const she=1.33;function lhe(e){return typeof e=="string"?uhe(e):Math.ceil((e.byteLength||e.size)*she)}function uhe(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}class che extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class MO extends mn{constructor(t){super(),this.writable=!1,xg(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new che(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(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=AO(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const NO="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),U4=64,dhe={};let WC=0,jh=0,UC;function HC(e){let t="";do t=NO[e%U4]+t,e=Math.floor(e/U4);while(e>0);return t}function $O(){const e=HC(+new Date);return e!==UC?(WC=0,UC=e):e+"."+HC(WC++)}for(;jh{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)};rhe(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,nhe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=$O()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const o=DO(t),i=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(o.length?"?"+o:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new yi(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}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}}class yi extends mn{constructor(t,n){super(),xg(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=RO(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new zO(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=yi.requestsCount++,yi.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=hhe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete yi.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()}}yi.requestsCount=0;yi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jC);else if(typeof addEventListener=="function"){const e="onpagehide"in Ha?"pagehide":"unload";addEventListener(e,jC,!1)}}function jC(){for(let e in yi.requests)yi.requests.hasOwnProperty(e)&&yi.requests[e].abort()}const vhe=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Gh=Ha.WebSocket||Ha.MozWebSocket,GC=!0,yhe="arraybuffer",ZC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bhe extends MO{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=ZC?{}:RO(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=GC&&!ZC?n?new Gh(t,n):new Gh(t):new Gh(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||yhe,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{const a={};try{GC&&this.ws.send(i)}catch{}o&&vhe(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=$O()),this.supportsBinary||(t.b64=1);const o=DO(t),i=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(o.length?"?"+o:"")}check(){return!!Gh}}const xhe={websocket:bhe,polling:ghe},whe=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,She=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function H4(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 o=whe.exec(e||""),i={},a=14;for(;a--;)i[She[a]]=o[a]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Che(i,i.path),i.queryKey=_he(i,i.query),i}function Che(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.substr(0,1)=="/"||t.length===0)&&r.splice(0,1),t.substr(t.length-1,1)=="/"&&r.splice(r.length-1,1),r}function _he(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}class Fa extends mn{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=H4(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=H4(n.host).host),xg(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"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=fhe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!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=OO,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new xhe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Fa.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;Fa.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Fa.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function i(){r||(r=!0,f(),n.close(),n=null)}const a=p=>{const m=new Error("probe error: "+p);m.transport=n.name,i(),this.emitReserved("upgradeError",m)};function l(){a("transport closed")}function c(){a("socket closed")}function d(p){n&&p.name!==n.name&&i()}const f=()=>{n.removeListener("open",o),n.removeListener("error",a),n.removeListener("close",l),this.off("close",c),this.off("upgrading",d)};n.once("open",o),n.once("error",a),n.once("close",l),this.once("close",c),this.once("upgrading",d),n.open()}onOpen(){if(this.readyState="open",Fa.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{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;r0&&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,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),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){Fa.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("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 o=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,BO=Object.prototype.toString,Phe=typeof Blob=="function"||typeof Blob<"u"&&BO.call(Blob)==="[object BlobConstructor]",Ahe=typeof File=="function"||typeof File<"u"&&BO.call(File)==="[object FileConstructor]";function t6(e){return Ehe&&(e instanceof ArrayBuffer||Lhe(e))||Phe&&e instanceof Blob||Ahe&&e instanceof File}function $1(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case et.ACK:case et.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Mhe{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=Ihe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Nhe=Object.freeze(Object.defineProperty({__proto__:null,protocol:Ohe,get PacketType(){return et},Encoder:Rhe,Decoder:n6},Symbol.toStringTag,{value:"Module"}));function No(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const $he=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class VO extends mn{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[No(t,"open",this.onopen.bind(this)),No(t,"packet",this.onpacket.bind(this)),No(t,"error",this.onerror.bind(this)),No(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($he.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:et.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,l=n.pop();this._registerAckCallback(a,l),r.id=a}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let i=0;i{this.io.clearTimeoutFn(o),n.apply(this,[null,...i])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:et.CONNECT,data:t})}):this.packet({type:et.CONNECT,data:this.auth})}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 et.CONNECT:if(t.data&&t.data.sid){const o=t.data.sid;this.onconnect(o)}else 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 et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.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)}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:et.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}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:et.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;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}ic.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)==0?e-n:e+n}return Math.min(e,this.max)|0};ic.prototype.reset=function(){this.attempts=0};ic.prototype.setMin=function(e){this.ms=e};ic.prototype.setMax=function(e){this.max=e};ic.prototype.setJitter=function(e){this.jitter=e};class Z4 extends mn{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,xg(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 ic({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||Nhe;this.encoder=new o.Encoder,this.decoder=new o.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 Fa(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=No(n,"open",function(){r.onopen(),t&&t()}),i=No(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&o();const l=this.setTimeoutFn(()=>{o(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&l.unref(),this.subs.push(function(){clearTimeout(l)})}return this.subs.push(o),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(No(t,"ping",this.onping.bind(this)),No(t,"data",this.ondata.bind(this)),No(t,"error",this.onerror.bind(this)),No(t,"close",this.onclose.bind(this)),No(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch{this.onclose("parse error")}}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new VO(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;rt()),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(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xc={};function D1(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=khe(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=Xc[o]&&i in Xc[o].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let c;return l?c=new Z4(r,t):(Xc[o]||(Xc[o]=new Z4(r,t)),c=Xc[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(D1,{Manager:Z4,Socket:VO,io:D1,connect:D1});let Zh;const Dhe=new Uint8Array(16);function Fhe(){if(!Zh&&(Zh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zh(Dhe)}const In=[];for(let e=0;e<256;++e)In.push((e+256).toString(16).slice(1));function zhe(e,t=0){return(In[e[t+0]]+In[e[t+1]]+In[e[t+2]]+In[e[t+3]]+"-"+In[e[t+4]]+In[e[t+5]]+"-"+In[e[t+6]]+In[e[t+7]]+"-"+In[e[t+8]]+In[e[t+9]]+"-"+In[e[t+10]]+In[e[t+11]]+In[e[t+12]]+In[e[t+13]]+In[e[t+14]]+In[e[t+15]]).toLowerCase()}const Bhe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),KC={randomUUID:Bhe};function Kh(e,t,n){if(KC.randomUUID&&!t&&!e)return KC.randomUUID();e=e||{};const r=e.random||(e.rng||Fhe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return zhe(r)}var Vhe=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Whe=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Uhe=/[^-+\dA-Z]/g;function yr(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(qC[t]||t||qC.default);var o=t.slice(0,4);(o==="UTC:"||o==="GMT:")&&(t=t.slice(4),n=!0,o==="GMT:"&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},l=function(){return e[i()+"Day"]()},c=function(){return e[i()+"Month"]()},d=function(){return e[i()+"FullYear"]()},f=function(){return e[i()+"Hours"]()},p=function(){return e[i()+"Minutes"]()},m=function(){return e[i()+"Seconds"]()},g=function(){return e[i()+"Milliseconds"]()},y=function(){return n?0:e.getTimezoneOffset()},b=function(){return Hhe(e)},k=function(){return jhe(e)},C={d:function(){return a()},dd:function(){return Dr(a())},ddd:function(){return gr.dayNames[l()]},DDD:function(){return YC({y:d(),m:c(),d:a(),_:i(),dayName:gr.dayNames[l()],short:!0})},dddd:function(){return gr.dayNames[l()+7]},DDDD:function(){return YC({y:d(),m:c(),d:a(),_:i(),dayName:gr.dayNames[l()+7]})},m:function(){return c()+1},mm:function(){return Dr(c()+1)},mmm:function(){return gr.monthNames[c()]},mmmm:function(){return gr.monthNames[c()+12]},yy:function(){return String(d()).slice(2)},yyyy:function(){return Dr(d(),4)},h:function(){return f()%12||12},hh:function(){return Dr(f()%12||12)},H:function(){return f()},HH:function(){return Dr(f())},M:function(){return p()},MM:function(){return Dr(p())},s:function(){return m()},ss:function(){return Dr(m())},l:function(){return Dr(g(),3)},L:function(){return Dr(Math.floor(g()/10))},t:function(){return f()<12?gr.timeNames[0]:gr.timeNames[1]},tt:function(){return f()<12?gr.timeNames[2]:gr.timeNames[3]},T:function(){return f()<12?gr.timeNames[4]:gr.timeNames[5]},TT:function(){return f()<12?gr.timeNames[6]:gr.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":Ghe(e)},o:function(){return(y()>0?"-":"+")+Dr(Math.floor(Math.abs(y())/60)*100+Math.abs(y())%60,4)},p:function(){return(y()>0?"-":"+")+Dr(Math.floor(Math.abs(y())/60),2)+":"+Dr(Math.floor(Math.abs(y())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return b()},WW:function(){return Dr(b())},N:function(){return k()}};return t.replace(Vhe,function(S){return S in C?C[S]():S.slice(1,S.length-1)})}var qC={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},gr={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Dr=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},YC=function(t){var n=t.y,r=t.m,o=t.d,i=t._,a=t.dayName,l=t.short,c=l===void 0?!1:l,d=new Date,f=new Date;f.setDate(f[i+"Date"]()-1);var p=new Date;p.setDate(p[i+"Date"]()+1);var m=function(){return d[i+"Date"]()},g=function(){return d[i+"Month"]()},y=function(){return d[i+"FullYear"]()},b=function(){return f[i+"Date"]()},k=function(){return f[i+"Month"]()},C=function(){return f[i+"FullYear"]()},S=function(){return p[i+"Date"]()},_=function(){return p[i+"Month"]()},E=function(){return p[i+"FullYear"]()};return y()===n&&g()===r&&m()===o?c?"Tdy":"Today":C()===n&&k()===r&&b()===o?c?"Ysd":"Yesterday":E()===n&&_()===r&&S()===o?c?"Tmw":"Tomorrow":a},Hhe=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var o=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-o);var i=(n-r)/(864e5*7);return 1+Math.floor(i)},jhe=function(t){var n=t.getDay();return n===0&&(n=7),n},Ghe=function(t){return(String(t).match(Whe)||[""]).pop().replace(Uhe,"").replace(/GMT\+0000/g,"UTC")};const K4=sr("socketio/generateImage"),Zhe=sr("socketio/runESRGAN"),Khe=sr("socketio/runFacetool"),qhe=sr("socketio/deleteImage"),WO=sr("socketio/requestImages"),Yhe=sr("socketio/requestNewImages"),Xhe=sr("socketio/cancelProcessing"),Qhe=sr("socketio/uploadInitialImage");sr("socketio/uploadMaskImage");const Jhe=sr("socketio/requestSystemConfig"),e1e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(FC(!0)),t(zC("Connected")),n().gallery.latest_mtime?t(Yhe()):t(WO())}catch(r){console.error(r)}},onDisconnect:()=>{try{t(FC(!1)),t(zC("Disconnected")),t(vr({timestamp:yr(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const{url:o,mtime:i,metadata:a}=r,l=Kh();t(wy({uuid:l,url:o,mtime:i,metadata:a})),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Image generated: ${o}`}))}catch(o){console.error(o)}},onIntermediateResult:r=>{try{const o=Kh(),{url:i,metadata:a,mtime:l}=r;t(Dpe({uuid:o,url:i,mtime:l,metadata:a})),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Intermediate image generated: ${i}`}))}catch(o){console.error(o)}},onPostprocessingResult:r=>{try{const{url:o,metadata:i,mtime:a}=r;t(wy({uuid:Kh(),url:o,mtime:a,metadata:i})),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Postprocessed: ${o}`}))}catch(o){console.error(o)}},onProgressUpdate:r=>{try{t(M1(!0)),t(Upe(r))}catch(o){console.error(o)}},onError:r=>{const{message:o,additionalData:i}=r;try{t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Server error: ${o}`,level:"error"})),t(Zpe()),t($C())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:o,areMoreImagesAvailable:i}=r,a=o.map(l=>{const{url:c,metadata:d,mtime:f}=l;return{uuid:Kh(),url:c,mtime:f,metadata:d}});t($pe({images:a,areMoreImagesAvailable:i})),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Loaded ${o.length} images`}))},onProcessingCanceled:()=>{t(Gpe());const{intermediateImage:r}=n().gallery;r&&(t(wy(r)),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`})),t($C())),t(vr({timestamp:yr(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:o,uuid:i}=r;t(Mpe(i));const{initialImagePath:a,maskPath:l}=n().options;a===o&&t(nl("")),l===o&&t(W4("")),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Image deleted: ${o}`}))},onInitialImageUploaded:r=>{const{url:o}=r;t(nl(o)),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Initial image uploaded: ${o}`}))},onMaskImageUploaded:r=>{const{url:o}=r;t(W4(o)),t(vr({timestamp:yr(new Date,"isoDateTime"),message:`Mask image uploaded: ${o}`}))},onSystemConfig:r=>{t(Hpe(r))}}},t1e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_euler","k_euler_a","k_heun"],n1e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],r1e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],o1e=[{key:"2x",value:2},{key:"4x",value:4}],r6=0,o6=4294967295,i1e=["gfpgan","codeformer"],UO=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),a1e=(e,t)=>{const{prompt:n,iterations:r,steps:o,cfgScale:i,threshold:a,perlin:l,height:c,width:d,sampler:f,seed:p,seamless:m,hiresFix:g,shouldUseInitImage:y,img2imgStrength:b,initialImagePath:k,maskPath:C,shouldFitToWidthHeight:S,shouldGenerateVariations:_,variationAmount:E,seedWeights:A,shouldRunESRGAN:R,upscalingLevel:O,upscalingStrength:$,shouldRunFacetool:H,facetoolStrength:z,codeformerFidelity:X,facetoolType:he,shouldRandomizeSeed:ye}=e,{shouldDisplayInProgress:oe}=t,pe={prompt:n,iterations:r,steps:o,cfg_scale:i,threshold:a,perlin:l,height:c,width:d,sampler_name:f,seed:p,seamless:m,hires_fix:g,progress_images:oe};pe.seed=ye?UO(r6,o6):p,y&&(pe.init_img=k,pe.strength=b,pe.fit=S,C&&(pe.init_mask=C)),_?(pe.variation_amount=E,A&&(pe.with_variations=vpe(A))):pe.variation_amount=0;let ge=!1,J=!1;return R&&(ge={level:O,strength:$}),H&&(J={type:he,strength:z},he==="codeformer"&&(J.codeformer_fidelity=X)),{generationParameters:pe,esrganParameters:ge,facetoolParameters:J}};var Sy=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Cy(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function HO(e,t){for(var n=t.slice(0,t.length-1),r=0;r=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function s1e(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,i=0;i=0&&Bt.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Bt.splice(0,Bt.length),(t===93||t===224)&&(t=91),t in Mn){Mn[t]=!1;for(var r in ls)ls[r]===t&&(Vr[r]=!1)}}function p1e(e){if(typeof e>"u")Object.keys(dn).forEach(function(a){return delete dn[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&_y(a)});else if(typeof e=="object")e.key&&_y(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?HO(ls,d):[];dn[m]=dn[m].filter(function(y){var b=o?y.method===o:!0;return!(b&&y.scope===r&&s1e(y.mods,g))})}})};function QC(e,t,n,r){if(t.element===r){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var i in Mn)Object.prototype.hasOwnProperty.call(Mn,i)&&(!Mn[i]&&t.mods.indexOf(+i)>-1||Mn[i]&&t.mods.indexOf(+i)===-1)&&(o=!1);(t.mods.length===0&&!Mn[16]&&!Mn[18]&&!Mn[17]&&!Mn[91]||o||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function JC(e,t){var n=dn["*"],r=e.keyCode||e.which||e.charCode;if(!!Vr.filter.call(this,e)){if((r===93||r===224)&&(r=91),Bt.indexOf(r)===-1&&r!==229&&Bt.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(y){var b=q4[y];e[y]&&Bt.indexOf(b)===-1?Bt.push(b):!e[y]&&Bt.indexOf(b)>-1?Bt.splice(Bt.indexOf(b),1):y==="metaKey"&&e[y]&&Bt.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Bt=Bt.slice(Bt.indexOf(b))))}),r in Mn){Mn[r]=!0;for(var o in ls)ls[o]===r&&(Vr[o]=!0);if(!n)return}for(var i in Mn)Object.prototype.hasOwnProperty.call(Mn,i)&&(Mn[i]=e[q4[i]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Bt.indexOf(17)===-1&&Bt.push(17),Bt.indexOf(18)===-1&&Bt.push(18),Mn[17]=!0,Mn[18]=!0);var a=wf();if(n)for(var l=0;l-1}function Vr(e,t,n){Bt=[];var r=jO(e),o=[],i="all",a=document,l=0,c=!1,d=!0,f="+",p=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(i=t.scope),t.element&&(a=t.element),t.keyup&&(c=t.keyup),t.keydown!==void 0&&(d=t.keydown),t.capture!==void 0&&(p=t.capture),typeof t.splitKey=="string"&&(f=t.splitKey)),typeof t=="string"&&(i=t);l1&&(o=HO(ls,e)),e=e[e.length-1],e=e==="*"?"*":wg(e),e in dn||(dn[e]=[]),dn[e].push({keyup:c,keydown:d,scope:i,mods:o,shortcut:r[l],method:n,key:r[l],splitKey:f,element:a});typeof a<"u"&&!h1e(a)&&window&&(ZO.push(a),Cy(a,"keydown",function(m){JC(m,a)},p),XC||(XC=!0,Cy(window,"focus",function(){Bt=[]},p)),Cy(a,"keyup",function(m){JC(m,a),f1e(m)},p))}function m1e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(dn).forEach(function(n){var r=dn[n].find(function(o){return o.scope===t&&o.shortcut===e});r&&r.method&&r.method()})}var ky={setScope:KO,getScope:wf,deleteScope:d1e,getPressedKeyCodes:l1e,isPressed:c1e,filter:u1e,trigger:m1e,unbind:p1e,keyMap:i6,modifier:ls,modifierMap:q4};for(var Ey in ky)Object.prototype.hasOwnProperty.call(ky,Ey)&&(Vr[Ey]=ky[Ey]);if(typeof window<"u"){var g1e=window.hotkeys;Vr.noConflict=function(e){return e&&window.hotkeys===Vr&&(window.hotkeys=g1e),Vr},window.hotkeys=Vr}Vr.filter=function(){return!0};var qO=function(t,n){var r=t.target,o=r&&r.tagName;return Boolean(o&&n&&n.includes(o))},v1e=function(t){return qO(t,["INPUT","TEXTAREA","SELECT"])};function sn(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var o=n||{},i=o.enableOnTags,a=o.filter,l=o.keyup,c=o.keydown,d=o.filterPreventDefault,f=d===void 0?!0:d,p=o.enabled,m=p===void 0?!0:p,g=o.enableOnContentEditable,y=g===void 0?!1:g,b=v.exports.useRef(null),k=v.exports.useCallback(function(C,S){var _,E;return a&&!a(C)?!f:v1e(C)&&!qO(C,i)||(_=C.target)!=null&&_.isContentEditable&&!y?!0:b.current===null||document.activeElement===b.current||(E=b.current)!=null&&E.contains(document.activeElement)?(t(C,S),!0):!1},r?[b,i,a].concat(r):[b,i,a]);return v.exports.useEffect(function(){if(!m){Vr.unbind(e,k);return}return l&&c!==!0&&(n.keydown=!1),Vr(e,n||{},k),function(){return Vr.unbind(e,k)}},[k,e,m]),b}Vr.isPressed;function y1e(){return Y("div",{className:"work-in-progress inpainting-work-in-progress",children:[x("h1",{children:"Inpainting"}),x("p",{children:"Inpainting is available as a part of the Invoke AI Command Line Interface. A dedicated WebUI interface will be released in the near future."})]})}function b1e(){return Y("div",{className:"work-in-progress nodes-work-in-progress",children:[x("h1",{children:"Nodes"}),x("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."})]})}function x1e(){return Y("div",{className:"work-in-progress outpainting-work-in-progress",children:[x("h1",{children:"Outpainting"}),x("p",{children:"Outpainting is available as a part of the Invoke AI Command Line Interface. A dedicated WebUI interface will be released in the near future."})]})}const w1e=()=>Y("div",{className:"work-in-progress post-processing-work-in-progress",children:[x("h1",{children:"Post Processing"}),x("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the main image display."}),x("p",{children:"A dedicated UI will be released soon to facilitate more advanced post processing workflows."}),x("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen."})]}),S1e=Xu({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:x("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:x("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),C1e=Xu({displayName:"InpaintIcon",viewBox:"0 0 3543 3543",path:x("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593C0,768.593 0,2774.71 0,2774.71C0,3025.98 203.999,3229.98 455.269,3229.98L3088.04,3229.98C3339.31,3229.98 3543.31,3025.98 3543.31,2774.71C3543.31,2774.71 3543.31,768.593 3543.31,768.593ZM3446.56,2252.63L3446.56,768.593C3446.56,570.718 3285.91,410.068 3088.04,410.068C3088.04,410.068 455.269,410.068 455.269,410.068C257.394,410.068 96.745,570.718 96.745,768.593L96.745,2061.49L988.344,1051.01L1326.63,1423.12C1281.74,1438.3 1227.39,1454.93 1158.26,1480.89C995.738,1541.9 944.356,1613.28 911.834,1718.7C884.979,1805.76 875.814,1922.93 811.322,2093.5C763.918,2218.87 765.18,2304.83 790.606,2364.87C817.014,2427.22 869.858,2467.73 941.71,2493.83C1023.86,2523.67 1134.43,2534.25 1242.45,2557.97C1365.72,2585.04 1455.23,2643.2 1532.76,2665.96C1587.03,2681.89 1637.04,2683.6 1686.56,2663.56C1731.54,2645.36 1777.95,2607.64 1825.43,2535.92C1874.9,2461.2 1979.98,2369.94 2102.8,2276.91L2241.64,2429.63L2739.91,1850.53C2754.47,1841.35 2767.47,1833.12 2778.66,1825.94C2832.6,1791.35 2866.82,1742.41 2884.38,1682.61L2898.06,1666.72L3446.56,2252.63ZM1680.71,2559.9C1666.7,2570.37 1652.86,2577.22 1638.81,2580.95L1610.62,2588.45L1625.61,2644.82L1653.8,2637.33C1674.48,2631.83 1695.02,2622.04 1715.64,2606.61L1739,2589.14L1704.06,2542.43L1680.71,2559.9ZM1541.62,2570.42C1524.94,2564.58 1507.63,2557.37 1489.49,2549.48L1462.75,2537.84L1439.48,2591.33L1466.22,2602.97C1485.74,2611.46 1504.38,2619.18 1522.33,2625.47L1549.86,2635.12L1569.15,2580.07L1541.62,2570.42ZM1381.21,2503.1C1363.08,2496.04 1344.17,2489.24 1324.38,2483.03L1296.55,2474.29L1279.07,2529.94L1306.9,2538.68C1325.41,2544.49 1343.09,2550.86 1360.05,2557.46L1387.23,2568.04L1408.39,2513.68L1381.21,2503.1ZM1788.46,2430.83C1773.91,2447.61 1761.19,2463.86 1750.55,2479.44L1734.09,2503.52L1782.25,2536.43L1798.71,2512.35C1808.2,2498.46 1819.56,2484 1832.53,2469.04L1851.64,2447.01L1807.57,2408.79L1788.46,2430.83ZM1262.54,2466.49C1243.17,2462.24 1223.71,2458.43 1204.35,2454.87L1175.67,2449.6L1165.12,2506.97L1193.81,2512.24C1212.52,2515.68 1231.32,2519.35 1250.03,2523.46L1278.52,2529.72L1291.03,2472.74L1262.54,2466.49ZM1089.5,2434.66C1070.28,2431.1 1051.6,2427.35 1033.72,2423.15L1005.32,2416.49L992.002,2473.28L1020.4,2479.94C1039.14,2484.34 1058.71,2488.28 1078.86,2492.02L1107.54,2497.34L1118.18,2439.99L1089.5,2434.66ZM932.182,2386.94C917.545,2378.53 904.788,2368.71 894.532,2356.8L875.504,2334.69L831.294,2372.75L850.322,2394.85C864.755,2411.62 882.513,2425.67 903.11,2437.51L928.396,2452.05L957.469,2401.48L932.182,2386.94ZM1917.04,2306.1C1901.59,2319.37 1886.77,2332.5 1872.67,2345.44L1851.18,2365.17L1890.64,2408.14L1912.12,2388.41C1925.76,2375.89 1940.1,2363.19 1955.04,2350.36L1977.17,2331.36L1939.17,2287.1L1917.04,2306.1ZM866.485,2267.79C866.715,2251.85 868.706,2234.39 872.54,2215.21L878.257,2186.61L821.055,2175.17L815.338,2203.77C810.733,2226.81 808.434,2247.8 808.158,2266.94L807.737,2296.11L866.064,2296.95L866.485,2267.79ZM2055.08,2195.63C2039.24,2207.6 2023.66,2219.55 2008.43,2231.46L1985.45,2249.43L2021.38,2295.38L2044.36,2277.42C2059.34,2265.7 2074.66,2253.95 2090.23,2242.18L2113.51,2224.61L2078.35,2178.06L2055.08,2195.63ZM2197.62,2092.3C2181.57,2103.52 2165.6,2114.82 2149.74,2126.16L2126.02,2143.12L2159.95,2190.57L2183.67,2173.61C2199.36,2162.38 2215.18,2151.21 2231.05,2140.1L2254.95,2123.38L2221.52,2075.58L2197.62,2092.3ZM905.788,2108.14C912.858,2088.7 919.236,2069.96 925.03,2051.88L933.93,2024.1L878.378,2006.3L869.478,2034.08C863.905,2051.47 857.769,2069.5 850.968,2088.2L840.998,2115.61L895.817,2135.55L905.788,2108.14ZM2342.87,1993.45C2326.76,2004.15 2310.52,2015.01 2294.22,2026L2270.04,2042.31L2302.65,2090.67L2326.83,2074.37C2343.01,2063.45 2359.14,2052.67 2375.14,2042.04L2399.44,2025.91L2367.17,1977.31L2342.87,1993.45ZM2489.92,1897.67C2473.88,1907.94 2457.46,1918.5 2440.74,1929.32L2416.26,1945.16L2447.95,1994.14L2472.44,1978.29C2489.07,1967.53 2505.41,1957.02 2521.37,1946.8L2545.93,1931.07L2514.48,1881.94L2489.92,1897.67ZM956.972,1937.49C961.849,1917.31 966.133,1898.15 970.079,1879.93L976.253,1851.43L919.241,1839.08L913.067,1867.59C909.215,1885.38 905.033,1904.08 900.271,1923.79L893.42,1952.13L950.121,1965.84L956.972,1937.49ZM2638.01,1803.95C2622.5,1813.69 2605.98,1824.08 2588.59,1835.04L2563.91,1850.59L2595.02,1899.94L2619.69,1884.38C2637.05,1873.44 2653.55,1863.08 2669.03,1853.35L2693.73,1837.84L2662.71,1788.44L2638.01,1803.95ZM2769.59,1708.14C2760.26,1721.07 2748.81,1732.54 2735.03,1742.4L2711.31,1759.37L2745.25,1806.81L2768.97,1789.84C2788.08,1776.17 2803.93,1760.22 2816.88,1742.3L2833.95,1718.65L2786.67,1684.5L2769.59,1708.14ZM995.304,1767.43C1000.24,1748.86 1005.64,1731.66 1012.23,1715.62L1023.31,1688.64L969.359,1666.47L958.273,1693.45C950.767,1711.72 944.551,1731.29 938.928,1752.44L931.436,1780.63L987.812,1795.62L995.304,1767.43ZM1071.42,1633.09C1083.85,1622.63 1098.26,1612.75 1115.07,1603.23L1140.45,1588.86L1111.71,1538.1L1086.33,1552.47C1066.11,1563.92 1048.82,1575.88 1033.86,1588.46L1011.55,1607.24L1049.11,1651.87L1071.42,1633.09ZM2804.87,1559.28C2805.5,1578.06 2804.95,1596.1 2803,1613.27L2799.72,1642.25L2857.68,1648.81L2860.97,1619.83C2863.22,1599.96 2863.9,1579.07 2863.17,1557.33L2862.2,1528.18L2803.9,1530.12L2804.87,1559.28ZM1217.5,1558.88C1236.87,1551.88 1254.98,1545.61 1271.98,1539.88L1299.62,1530.55L1280.97,1475.28L1253.33,1484.6C1235.96,1490.46 1217.45,1496.87 1197.66,1504.02L1170.23,1513.94L1190.07,1568.8L1217.5,1558.88ZM1383.15,1502.63C1403.9,1495.17 1422.61,1487.67 1439.93,1479.27L1466.18,1466.54L1440.73,1414.06L1414.48,1426.78C1398.91,1434.33 1382.06,1441.03 1363.41,1447.74L1335.96,1457.62L1355.71,1512.51L1383.15,1502.63ZM2777.41,1393.4C2782.33,1412.11 2786.73,1430.56 2790.49,1448.67L2796.42,1477.23L2853.54,1465.37L2847.6,1436.81C2843.64,1417.72 2839.01,1398.28 2833.83,1378.57L2826.41,1350.36L2770,1365.19L2777.41,1393.4ZM1541.19,1401.64C1553.52,1387.35 1565.77,1370.94 1578.31,1351.79L1594.28,1327.39L1545.48,1295.44L1529.5,1319.84C1518.52,1336.62 1507.83,1351.02 1497.03,1363.53L1477.97,1385.61L1522.14,1423.72L1541.19,1401.64ZM2725.02,1229.27C2731.61,1247.45 2738.01,1265.61 2744.12,1283.7L2753.45,1311.33L2808.72,1292.66L2799.38,1265.03C2793.13,1246.53 2786.6,1227.96 2779.85,1209.37L2769.9,1181.95L2715.07,1201.86L2725.02,1229.27ZM1636.99,1247.12C1644.26,1232.56 1651.77,1217.04 1659.58,1200.45C1660.59,1198.3 1661.61,1196.15 1662.61,1194.02L1675.08,1167.65L1622.34,1142.72L1609.88,1169.09C1608.86,1171.25 1607.83,1173.42 1606.81,1175.59C1599.2,1191.75 1591.88,1206.88 1584.8,1221.06L1571.77,1247.16L1623.96,1273.21L1636.99,1247.12ZM2251.58,766.326C2320.04,672.986 2430.48,612.355 2554.96,612.355C2762.48,612.355 2930.95,780.83 2930.95,988.344C2930.95,1087.56 2892.44,1177.85 2829.58,1245.06C2804.67,1171.95 2775.67,1097.93 2747.18,1026.98C2699.54,908.311 2654.38,849.115 2602.9,816.501C2565.59,792.868 2523.88,781.903 2471.8,777.274C2416.47,772.355 2346.53,774.829 2251.58,766.326ZM2662.3,1066.95C2669.46,1084.79 2676.66,1102.83 2683.81,1120.98L2694.51,1148.12L2748.78,1126.72L2738.08,1099.59C2730.88,1081.32 2723.64,1063.18 2716.44,1045.23L2705.58,1018.16L2651.44,1039.88L2662.3,1066.95ZM1713.81,1090.65C1723.08,1073.13 1732.27,1056.54 1741.52,1040.87L1756.33,1015.74L1706.08,986.113L1691.27,1011.24C1681.59,1027.65 1671.95,1045.03 1662.25,1063.39L1648.61,1089.17L1700.18,1116.44L1713.81,1090.65ZM2584.06,922.671C2594.47,934.345 2604.5,948.467 2614.55,965.492L2629.38,990.608L2679.62,960.949L2664.79,935.834C2652.56,915.134 2640.26,898.042 2627.6,883.849L2608.19,862.079L2564.65,900.901L2584.06,922.671ZM1805.33,949.853C1817.51,935.859 1830.16,923.259 1843.5,912.06L1865.85,893.314L1828.36,848.625L1806.01,867.372C1790.4,880.469 1775.59,895.178 1761.34,911.545L1742.18,933.541L1786.17,971.849L1805.33,949.853ZM2446.47,869.303C2466.17,870.516 2483.98,872.335 2500.35,875.649L2528.94,881.438L2540.51,824.265L2511.93,818.476C2493.13,814.67 2472.68,812.474 2450.05,811.08L2420.94,809.287L2417.35,867.51L2446.47,869.303ZM1935.15,861.305C1951.44,856.036 1968.78,851.999 1987.35,849.144L2016.18,844.713L2007.32,787.057L1978.49,791.488C1956.68,794.84 1936.32,799.616 1917.19,805.802L1889.44,814.778L1907.39,870.28L1935.15,861.305ZM2271.35,861.832C2292.28,863.33 2311.95,864.351 2330.47,865.114L2359.61,866.316L2362.01,808.032L2332.87,806.83C2314.9,806.09 2295.82,805.1 2275.51,803.648L2246.42,801.567L2242.26,859.751L2271.35,861.832ZM2097.81,844.858C2115.7,845.771 2134.46,847.337 2154.17,849.543L2183.16,852.787L2189.65,794.816L2160.66,791.572C2139.72,789.228 2119.79,787.57 2100.78,786.6L2071.65,785.114L2068.68,843.372L2097.81,844.858Z"})}),_1e=Xu({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:x("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),k1e=Xu({displayName:"OutpaintIcon",viewBox:"0 0 3543 3543",path:x("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,766.352C3543.31,516.705 3340.63,314.024 3090.98,314.024L452.328,314.024C202.681,314.024 0,516.705 0,766.352L0,2776.95C0,3026.6 202.681,3229.28 452.328,3229.28C452.328,3229.28 3090.98,3229.28 3090.98,3229.28C3340.63,3229.28 3543.31,3026.6 3543.31,2776.95C3543.31,2776.95 3543.31,766.352 3543.31,766.352ZM3454.26,766.352L3454.26,2776.95C3454.26,2977.46 3291.48,3140.24 3090.98,3140.24L452.328,3140.24C251.825,3140.24 89.043,2977.46 89.043,2776.95C89.043,2776.95 89.043,766.352 89.043,766.352C89.043,565.849 251.825,403.067 452.328,403.067C452.328,403.067 3090.98,403.067 3090.98,403.067C3291.48,403.067 3454.26,565.849 3454.26,766.352ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265Z"})}),E1e=Xu({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:x("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),L1e=Xu({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:x("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:x("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})});var Fo=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e))(Fo||{});const P1e={[0]:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:"ImageToImage allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},fl=e=>{const{label:t,isDisabled:n=!1,fontSize:r="md",size:o="md",width:i="auto",...a}=e;return x(hs,{isDisabled:n,width:i,children:Y(Lt,{justifyContent:"space-between",alignItems:"center",children:[t&&x(sl,{fontSize:r,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t}),x(ag,{size:o,className:"switch-button",...a})]})})};function YO(){const e=Ee(o=>o.system.isGFPGANAvailable),t=Ee(o=>o.options.shouldRunFacetool),n=Ue();return Y(Lt,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[x("p",{children:"Restore Face"}),x(fl,{isDisabled:!e,isChecked:t,onChange:o=>n(kpe(o.target.checked))})]})}const e_=/^-?(0\.)?\.?$/,Uo=e=>{const{label:t,styleClass:n,isDisabled:r=!1,showStepper:o=!0,fontSize:i="1rem",size:a="sm",width:l,textAlign:c,isInvalid:d,value:f,onChange:p,min:m,max:g,isInteger:y=!0,...b}=e,[k,C]=v.exports.useState(String(f));v.exports.useEffect(()=>{!k.match(e_)&&f!==Number(k)&&C(String(f))},[f,k]);const S=E=>{C(E),E.match(e_)||p(y?Math.floor(Number(E)):Number(E))},_=E=>{const A=xf.clamp(y?Math.floor(Number(E.target.value)):Number(E.target.value),m,g);C(String(A)),p(A)};return Y(hs,{isDisabled:r,isInvalid:d,className:`number-input ${n}`,children:[t&&x(sl,{fontSize:i,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",className:"number-input-label",children:t}),Y(eI,{size:a,...b,className:"number-input-field",value:k,keepWithinRange:!0,clampValueOnBlur:!1,onChange:S,onBlur:_,children:[x(tI,{fontSize:i,className:"number-input-entry",width:l,textAlign:c}),Y("div",{className:"number-input-stepper",style:o?{display:"block"}:{display:"none"},children:[x(oI,{className:"number-input-stepper-button"}),x(rI,{className:"number-input-stepper-button"})]})]})]})},Xf=e=>{const{label:t,isDisabled:n,validValues:r,size:o="sm",fontSize:i="md",styleClass:a,...l}=e;return Y(hs,{isDisabled:n,className:`iai-select ${a}`,children:[x(sl,{fontSize:i,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",className:"iai-select-label",children:t}),x(lI,{fontSize:i,size:o,...l,className:"iai-select-picker",children:r.map(c=>typeof c=="string"||typeof c=="number"?x("option",{value:c,className:"iai-select-option",children:c},c):x("option",{value:c.value,children:c.key},c.value))})]})},A1e=Yn(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),T1e=Yn(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),a6=()=>{const e=Ue(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=Ee(A1e),{isGFPGANAvailable:o}=Ee(T1e),i=c=>e(O1(c)),a=c=>e(bO(c)),l=c=>e(R1(c.target.value));return Y(Lt,{direction:"column",gap:2,children:[x(Xf,{label:"Type",validValues:i1e.concat(),value:n,onChange:l}),x(Uo,{isDisabled:!o,label:"Strength",step:.05,min:0,max:1,onChange:i,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&x(Uo,{isDisabled:!o,label:"Fidelity",step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};function I1e(){const e=Ue(),t=Ee(r=>r.options.shouldFitToWidthHeight);return x(fl,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:r=>e(xO(r.target.checked))})}function O1e(e){const{label:t="Strength",styleClass:n}=e,r=Ee(a=>a.options.img2imgStrength),o=Ue();return x(Uo,{label:t,step:.01,min:.01,max:.99,onChange:a=>o(yO(a)),value:r,width:"90px",isInteger:!1,styleClass:n})}function R1e(){const e=Ue(),t=Ee(r=>r.options.shouldRandomizeSeed);return x(fl,{label:"Randomize Seed",isChecked:t,onChange:r=>e(Lpe(r.target.checked))})}function M1e(){const e=Ee(i=>i.options.seed),t=Ee(i=>i.options.shouldRandomizeSeed),n=Ee(i=>i.options.shouldGenerateVariations),r=Ue(),o=i=>r(Yf(i));return x(Uo,{label:"Seed",step:1,precision:0,flexGrow:1,min:r6,max:o6,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"10rem"})}function N1e(){const e=Ue(),t=Ee(r=>r.options.shouldRandomizeSeed);return x(xi,{size:"sm",isDisabled:t,onClick:()=>e(Yf(UO(r6,o6))),children:x("p",{children:"Shuffle"})})}function $1e(){const e=Ue(),t=Ee(r=>r.options.threshold);return x(Uo,{label:"Threshold",min:0,max:1e3,step:.1,onChange:r=>e(xpe(r)),value:t,isInteger:!1})}function D1e(){const e=Ue(),t=Ee(r=>r.options.perlin);return x(Uo,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:r=>e(wpe(r)),value:t,isInteger:!1})}const XO=()=>Y(Lt,{gap:2,direction:"column",children:[x(R1e,{}),Y(Lt,{gap:2,children:[x(M1e,{}),x(N1e,{})]}),x(Lt,{gap:2,children:x($1e,{})}),x(Lt,{gap:2,children:x(D1e,{})})]});function QO(){const e=Ee(o=>o.system.isESRGANAvailable),t=Ee(o=>o.options.shouldRunESRGAN),n=Ue();return Y(Lt,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[x("p",{children:"Upscale"}),x(fl,{isDisabled:!e,isChecked:t,onChange:o=>n(Epe(o.target.checked))})]})}const F1e=Yn(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),z1e=Yn(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),s6=()=>{const e=Ue(),{upscalingLevel:t,upscalingStrength:n}=Ee(F1e),{isESRGANAvailable:r}=Ee(z1e);return Y("div",{className:"upscale-options",children:[x(Xf,{isDisabled:!r,label:"Scale",value:t,onChange:a=>e(B4(Number(a.target.value))),validValues:o1e}),x(Uo,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:a=>e(V4(a)),value:n,isInteger:!1})]})};function B1e(){const e=Ee(r=>r.options.shouldGenerateVariations),t=Ue();return x(fl,{isChecked:e,width:"auto",onChange:r=>t(Spe(r.target.checked))})}function JO(){return Y(Lt,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[x("p",{children:"Variations"}),x(B1e,{})]})}function V1e(e){const{label:t,styleClass:n,isDisabled:r=!1,fontSize:o="1rem",width:i,isInvalid:a,...l}=e;return Y(hs,{className:`input ${n}`,isInvalid:a,isDisabled:r,flexGrow:1,children:[x(sl,{fontSize:o,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t}),x(tx,{...l,className:"input-entry",size:"sm",width:i})]})}function W1e(){const e=Ee(o=>o.options.seedWeights),t=Ee(o=>o.options.shouldGenerateVariations),n=Ue(),r=o=>n(wO(o.target.value));return x(V1e,{label:"Seed Weights",value:e,isInvalid:t&&!(Jx(e)||e===""),isDisabled:!t,onChange:r})}function U1e(){const e=Ee(o=>o.options.variationAmount),t=Ee(o=>o.options.shouldGenerateVariations),n=Ue();return x(Uo,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:o=>n(Cpe(o)),isInteger:!1})}const eR=()=>Y(Lt,{gap:2,direction:"column",children:[x(U1e,{}),x(W1e,{})]});function tR(){const e=Ee(r=>r.options.showAdvancedOptions),t=Ue();return Y("div",{className:"advanced_options_checker",children:[x("input",{type:"checkbox",name:"advanced_options",id:"",onChange:r=>t(Ppe(r.target.checked)),checked:e}),x("label",{htmlFor:"advanced_options",children:"Advanced Options"})]})}function H1e(){const e=Ue(),t=Ee(r=>r.options.cfgScale);return x(Uo,{label:"CFG Scale",step:.5,min:1,max:30,onChange:r=>e(fO(r)),value:t,width:l6,fontSize:ac,styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function j1e(){const e=Ee(r=>r.options.height),t=Ue();return x(Xf,{label:"Height",value:e,flexGrow:1,onChange:r=>t(pO(Number(r.target.value))),validValues:r1e,fontSize:ac,styleClass:"main-option-block"})}function G1e(){const e=Ue(),t=Ee(r=>r.options.iterations);return x(Uo,{label:"Images",step:1,min:1,max:9999,onChange:r=>e(bpe(r)),value:t,width:l6,fontSize:ac,styleClass:"main-option-block",textAlign:"center"})}function Z1e(){const e=Ee(r=>r.options.sampler),t=Ue();return x(Xf,{label:"Sampler",value:e,onChange:r=>t(mO(r.target.value)),validValues:t1e,fontSize:ac,styleClass:"main-option-block"})}function K1e(){const e=Ue(),t=Ee(r=>r.options.steps);return x(Uo,{label:"Steps",min:1,max:9999,step:1,onChange:r=>e(dO(r)),value:t,width:l6,fontSize:ac,styleClass:"main-option-block",textAlign:"center"})}function q1e(){const e=Ee(r=>r.options.width),t=Ue();return x(Xf,{label:"Width",value:e,flexGrow:1,onChange:r=>t(hO(Number(r.target.value))),validValues:n1e,fontSize:ac,styleClass:"main-option-block"})}const ac="0.9rem",l6="auto";function nR(){return x("div",{className:"main-options",children:Y("div",{className:"main-options-list",children:[Y("div",{className:"main-options-row",children:[x(G1e,{}),x(K1e,{}),x(H1e,{})]}),Y("div",{className:"main-options-row",children:[x(q1e,{}),x(j1e,{}),x(Z1e,{})]})]})})}var rR={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},t_=Q.createContext&&Q.createContext(rR),Ja=globalThis&&globalThis.__assign||function(){return Ja=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.system,e=>e.shouldDisplayGuides),l0e=({children:e,feature:t})=>{const n=Ee(s0e),{text:r}=P1e[t];return n?Y(Px,{trigger:"hover",children:[x(Ox,{children:x(mo,{children:e})}),Y(Ix,{className:"guide-popover-content",maxWidth:"400px",onClick:o=>o.preventDefault(),cursor:"initial",children:[x(Ax,{className:"guide-popover-arrow"}),x("div",{className:"guide-popover-guide-content",children:r})]})]}):x(wn,{})},u0e=fe(({feature:e,icon:t=iR},n)=>x(l0e,{feature:e,children:x(mo,{ref:n,children:x(Yr,{as:t})})}));function c0e(e){const{header:t,feature:n,options:r}=e;return Y(gA,{className:"advanced-settings-item",children:[x("h2",{children:Y(hA,{className:"advanced-settings-header",children:[t,x(u0e,{feature:n}),x(mA,{})]})}),x(vA,{className:"advanced-settings-panel",children:r})]})}const sR=e=>{const{accordionInfo:t}=e,n=Ee(a=>a.system.openAccordions),r=Ue();return x(yA,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(Wpe(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(l=>{a.push(x(c0e,{header:t[l].header,feature:t[l].feature,options:t[l].options},l))}),a})()})},d0e=()=>{const e=Ue(),t=Ee(r=>r.options.hiresFix);return x(Lt,{gap:2,direction:"column",children:x(fl,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:r=>e(vO(r.target.checked))})})},f0e=()=>{const e=Ue(),t=Ee(r=>r.options.seamless);return x(Lt,{gap:2,direction:"column",children:x(fl,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:r=>e(gO(r.target.checked))})})},lR=()=>Y(Lt,{gap:2,direction:"column",children:[x(f0e,{}),x(d0e,{})]}),sd=e=>{const{label:t,tooltip:n="",size:r="sm",...o}=e;return x(ir,{label:n,children:x(xi,{size:r,...o,children:t})})},r_=Yn(e=>e.options,e=>({prompt:e.prompt,shouldGenerateVariations:e.shouldGenerateVariations,seedWeights:e.seedWeights,maskPath:e.maskPath,initialImagePath:e.initialImagePath,seed:e.seed,activeTab:e.activeTab}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),u6=Yn(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),uR=()=>{const{prompt:e}=Ee(r_),{shouldGenerateVariations:t,seedWeights:n,maskPath:r,initialImagePath:o,seed:i,activeTab:a}=Ee(r_),{isProcessing:l,isConnected:c}=Ee(u6);return v.exports.useMemo(()=>!(!e||Boolean(e.match(/^[\s\r\n]+$/))||e&&!o&&a===1||r&&!o||l||!c||t&&(!(Jx(n)||n==="")||i===-1)),[e,r,o,l,c,t,n,i,a])};function p0e(){const e=Ue(),t=uR();return x(sd,{label:"Invoke","aria-label":"Invoke",type:"submit",isDisabled:!t,onClick:()=>{e(K4())},className:"invoke-btn"})}const Ns=e=>{const{tooltip:t="",tooltipPlacement:n="bottom",onClick:r,...o}=e;return x(ir,{label:t,hasArrow:!0,placement:n,children:x(Nn,{...o,cursor:r?"pointer":"unset",onClick:r})})};function h0e(){const e=Ue(),{isProcessing:t,isConnected:n}=Ee(u6),r=()=>e(Xhe());return sn("shift+x",()=>{(n||t)&&r()},[n,t]),x(Ns,{icon:x(a0e,{}),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!n||!t,onClick:r,className:"cancel-btn"})}const cR=()=>Y("div",{className:"process-buttons",children:[x(p0e,{}),x(h0e,{})]}),m0e=Yn(e=>e.options,e=>({prompt:e.prompt}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),dR=()=>{const e=v.exports.useRef(null),{prompt:t}=Ee(m0e);Ee(u6);const n=Ue(),r=uR(),o=a=>{n(e6(a.target.value))};sn("ctrl+enter",()=>{r&&n(K4())},[r]),sn("alt+a",()=>{e.current?.focus()},[]);const i=a=>{a.key==="Enter"&&a.shiftKey===!1&&r&&(a.preventDefault(),n(K4()))};return x("div",{className:"prompt-bar",children:x(hs,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:x(vI,{id:"prompt",name:"prompt",placeholder:"I'm dreaming of...",size:"lg",value:t,onChange:o,onKeyDown:i,resize:"vertical",height:30,ref:e})})})};function g0e(){const e=Ee(n=>n.options.showAdvancedOptions),t={seed:{header:x(mo,{flex:"1",textAlign:"left",children:"Seed"}),feature:Fo.SEED,options:x(XO,{})},variations:{header:x(JO,{}),feature:Fo.VARIATIONS,options:x(eR,{})},face_restore:{header:x(YO,{}),feature:Fo.FACE_CORRECTION,options:x(a6,{})},upscale:{header:x(QO,{}),feature:Fo.UPSCALE,options:x(s6,{})},other:{header:x(mo,{flex:"1",textAlign:"left",children:"Other"}),feature:Fo.OTHER,options:x(lR,{})}};return Y("div",{className:"image-to-image-panel",children:[x(dR,{}),x(cR,{}),x(nR,{}),x(O1e,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),x(I1e,{}),x(tR,{}),e?x(sR,{accordionInfo:t}):null]})}function v0e(e){return Mt({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 y0e(e){return Mt({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 b0e(e){return Mt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function x0e(e){return Mt({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 w0e(e){return Mt({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 S0e(e){return Mt({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 C0e(e){return Mt({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 _0e(e){return Mt({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 k0e(e){return Mt({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 E0e(e){return Mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"}}]})(e)}function L0e(e){return Mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"}}]})(e)}function P0e(e){return Mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 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-16z"}}]})(e)}function A0e(e){return Mt({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)}var T0e=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 Qf(e,t){var n=I0e(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 I0e(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=T0e.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var O0e=[".DS_Store","Thumbs.db"];function R0e(e){return Ju(this,void 0,void 0,function(){return ec(this,function(t){return G0(e)&&M0e(e.dataTransfer)?[2,F0e(e.dataTransfer,e.type)]:N0e(e)?[2,$0e(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,D0e(e)]:[2,[]]})})}function M0e(e){return G0(e)}function N0e(e){return G0(e)&&G0(e.target)}function G0(e){return typeof e=="object"&&e!==null}function $0e(e){return Y4(e.target.files).map(function(t){return Qf(t)})}function D0e(e){return Ju(this,void 0,void 0,function(){var t;return ec(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 Qf(r)})]}})})}function F0e(e,t){return Ju(this,void 0,void 0,function(){var n,r;return ec(this,function(o){switch(o.label){case 0:return e.items?(n=Y4(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(z0e))]):[3,2];case 1:return r=o.sent(),[2,o_(fR(r))];case 2:return[2,o_(Y4(e.files).map(function(i){return Qf(i)}))]}})})}function o_(e){return e.filter(function(t){return O0e.indexOf(t.name)===-1})}function Y4(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,u_(n)];if(e.sizen)return[!1,u_(n)]}return[!0,null]}function $s(e){return e!=null}function tme(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,l=e.validator;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(c){var d=gR(c,n),f=Sf(d,1),p=f[0],m=vR(c,r,o),g=Sf(m,1),y=g[0],b=l?l(c):null;return p&&y&&!b})}function Z0(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Yh(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 d_(e){e.preventDefault()}function nme(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function rme(e){return e.indexOf("Edge/")!==-1}function ome(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return nme(e)||rme(e)}function Qo(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function wme(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var c6=v.exports.forwardRef(function(e,t){var n=e.children,r=K0(e,cme),o=SR(r),i=o.open,a=K0(o,dme);return v.exports.useImperativeHandle(t,function(){return{open:i}},[i]),x(v.exports.Fragment,{children:n(jt(jt({},a),{},{open:i}))})});c6.displayName="Dropzone";var wR={disabled:!1,getFilesFromEvent:R0e,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};c6.defaultProps=wR;c6.propTypes={children:St.exports.func,accept:St.exports.objectOf(St.exports.arrayOf(St.exports.string)),multiple:St.exports.bool,preventDropOnDocument:St.exports.bool,noClick:St.exports.bool,noKeyboard:St.exports.bool,noDrag:St.exports.bool,noDragEventsBubbling:St.exports.bool,minSize:St.exports.number,maxSize:St.exports.number,maxFiles:St.exports.number,disabled:St.exports.bool,getFilesFromEvent:St.exports.func,onFileDialogCancel:St.exports.func,onFileDialogOpen:St.exports.func,useFsAccessApi:St.exports.bool,autoFocus:St.exports.bool,onDragEnter:St.exports.func,onDragLeave:St.exports.func,onDragOver:St.exports.func,onDrop:St.exports.func,onDropAccepted:St.exports.func,onDropRejected:St.exports.func,onError:St.exports.func,validator:St.exports.func};var e3={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function SR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=jt(jt({},wR),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,l=t.multiple,c=t.maxFiles,d=t.onDragEnter,f=t.onDragLeave,p=t.onDragOver,m=t.onDrop,g=t.onDropAccepted,y=t.onDropRejected,b=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,S=t.autoFocus,_=t.preventDropOnDocument,E=t.noClick,A=t.noKeyboard,R=t.noDrag,O=t.noDragEventsBubbling,$=t.onError,H=t.validator,z=v.exports.useMemo(function(){return sme(n)},[n]),X=v.exports.useMemo(function(){return ame(n)},[n]),he=v.exports.useMemo(function(){return typeof k=="function"?k:p_},[k]),ye=v.exports.useMemo(function(){return typeof b=="function"?b:p_},[b]),oe=v.exports.useRef(null),pe=v.exports.useRef(null),ge=v.exports.useReducer(Sme,e3),J=Ly(ge,2),D=J[0],Z=J[1],j=D.isFocused,M=D.isFileDialogActive,G=v.exports.useRef(typeof window<"u"&&window.isSecureContext&&C&&ime()),le=function(){!G.current&&M&&setTimeout(function(){if(pe.current){var Pe=pe.current.files;Pe.length||(Z({type:"closeDialog"}),ye())}},300)};v.exports.useEffect(function(){return window.addEventListener("focus",le,!1),function(){window.removeEventListener("focus",le,!1)}},[pe,M,ye,G]);var ce=v.exports.useRef([]),be=function(Pe){oe.current&&oe.current.contains(Pe.target)||(Pe.preventDefault(),ce.current=[])};v.exports.useEffect(function(){return _&&(document.addEventListener("dragover",d_,!1),document.addEventListener("drop",be,!1)),function(){_&&(document.removeEventListener("dragover",d_),document.removeEventListener("drop",be))}},[oe,_]),v.exports.useEffect(function(){return!r&&S&&oe.current&&oe.current.focus(),function(){}},[oe,S,r]);var me=v.exports.useCallback(function(ve){$?$(ve):console.error(ve)},[$]),_e=v.exports.useCallback(function(ve){ve.preventDefault(),ve.persist(),Je(ve),ce.current=[].concat(hme(ce.current),[ve.target]),Yh(ve)&&Promise.resolve(o(ve)).then(function(Pe){if(!(Z0(ve)&&!O)){var pt=Pe.length,ut=pt>0&&tme({files:Pe,accept:z,minSize:a,maxSize:i,multiple:l,maxFiles:c,validator:H}),ae=pt>0&&!ut;Z({isDragAccept:ut,isDragReject:ae,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Pe){return me(Pe)})},[o,d,me,O,z,a,i,l,c,H]),ue=v.exports.useCallback(function(ve){ve.preventDefault(),ve.persist(),Je(ve);var Pe=Yh(ve);if(Pe&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Pe&&p&&p(ve),!1},[p,O]),we=v.exports.useCallback(function(ve){ve.preventDefault(),ve.persist(),Je(ve);var Pe=ce.current.filter(function(ut){return oe.current&&oe.current.contains(ut)}),pt=Pe.indexOf(ve.target);pt!==-1&&Pe.splice(pt,1),ce.current=Pe,!(Pe.length>0)&&(Z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Yh(ve)&&f&&f(ve))},[oe,f,O]),$e=v.exports.useCallback(function(ve,Pe){var pt=[],ut=[];ve.forEach(function(ae){var Ge=gR(ae,z),Pt=Ly(Ge,2),Ln=Pt[0],zn=Pt[1],Tr=vR(ae,a,i),Ho=Ly(Tr,2),Ei=Ho[0],Xn=Ho[1],Xr=H?H(ae):null;if(Ln&&Ei&&!Xr)pt.push(ae);else{var vs=[zn,Xn];Xr&&(vs=vs.concat(Xr)),ut.push({file:ae,errors:vs.filter(function(hl){return hl})})}}),(!l&&pt.length>1||l&&c>=1&&pt.length>c)&&(pt.forEach(function(ae){ut.push({file:ae,errors:[eme]})}),pt.splice(0)),Z({acceptedFiles:pt,fileRejections:ut,type:"setFiles"}),m&&m(pt,ut,Pe),ut.length>0&&y&&y(ut,Pe),pt.length>0&&g&&g(pt,Pe)},[Z,l,z,a,i,c,m,g,y,H]),rt=v.exports.useCallback(function(ve){ve.preventDefault(),ve.persist(),Je(ve),ce.current=[],Yh(ve)&&Promise.resolve(o(ve)).then(function(Pe){Z0(ve)&&!O||$e(Pe,ve)}).catch(function(Pe){return me(Pe)}),Z({type:"reset"})},[o,$e,me,O]),Ct=v.exports.useCallback(function(){if(G.current){Z({type:"openDialog"}),he();var ve={multiple:l,types:X};window.showOpenFilePicker(ve).then(function(Pe){return o(Pe)}).then(function(Pe){$e(Pe,null),Z({type:"closeDialog"})}).catch(function(Pe){lme(Pe)?(ye(Pe),Z({type:"closeDialog"})):ume(Pe)?(G.current=!1,pe.current?(pe.current.value=null,pe.current.click()):me(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 was provided."))):me(Pe)});return}pe.current&&(Z({type:"openDialog"}),he(),pe.current.value=null,pe.current.click())},[Z,he,ye,C,$e,me,X,l]),un=v.exports.useCallback(function(ve){!oe.current||!oe.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),Ct())},[oe,Ct]),Se=v.exports.useCallback(function(){Z({type:"focus"})},[]),Ie=v.exports.useCallback(function(){Z({type:"blur"})},[]),Qe=v.exports.useCallback(function(){E||(ome()?setTimeout(Ct,0):Ct())},[E,Ct]),Oe=function(Pe){return r?null:Pe},ft=function(Pe){return A?null:Oe(Pe)},tn=function(Pe){return R?null:Oe(Pe)},Je=function(Pe){O&&Pe.stopPropagation()},_t=v.exports.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Pe=ve.refKey,pt=Pe===void 0?"ref":Pe,ut=ve.role,ae=ve.onKeyDown,Ge=ve.onFocus,Pt=ve.onBlur,Ln=ve.onClick,zn=ve.onDragEnter,Tr=ve.onDragOver,Ho=ve.onDragLeave,Ei=ve.onDrop,Xn=K0(ve,fme);return jt(jt(J4({onKeyDown:ft(Qo(ae,un)),onFocus:ft(Qo(Ge,Se)),onBlur:ft(Qo(Pt,Ie)),onClick:Oe(Qo(Ln,Qe)),onDragEnter:tn(Qo(zn,_e)),onDragOver:tn(Qo(Tr,ue)),onDragLeave:tn(Qo(Ho,we)),onDrop:tn(Qo(Ei,rt)),role:typeof ut=="string"&&ut!==""?ut:"presentation"},pt,oe),!r&&!A?{tabIndex:0}:{}),Xn)}},[oe,un,Se,Ie,Qe,_e,ue,we,rt,A,R,r]),nn=v.exports.useCallback(function(ve){ve.stopPropagation()},[]),qt=v.exports.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Pe=ve.refKey,pt=Pe===void 0?"ref":Pe,ut=ve.onChange,ae=ve.onClick,Ge=K0(ve,pme),Pt=J4({accept:z,multiple:l,type:"file",style:{display:"none"},onChange:Oe(Qo(ut,rt)),onClick:Oe(Qo(ae,nn)),tabIndex:-1},pt,pe);return jt(jt({},Pt),Ge)}},[pe,n,l,rt,r]);return jt(jt({},D),{},{isFocused:j&&!r,getRootProps:_t,getInputProps:qt,rootRef:oe,inputRef:pe,open:Oe(Ct)})}function Sme(e,t){switch(t.type){case"focus":return jt(jt({},e),{},{isFocused:!0});case"blur":return jt(jt({},e),{},{isFocused:!1});case"openDialog":return jt(jt({},e3),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return jt(jt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return jt({},e3);default:return e}}function p_(){}const Cme=({children:e,fileAcceptedCallback:t,fileRejectionCallback:n,styleClass:r})=>{const o=v.exports.useCallback((d,f)=>{f.forEach(p=>{n(p)}),d.forEach(p=>{t(p)})},[t,n]),{getRootProps:i,getInputProps:a,open:l}=SR({onDrop:o,accept:{"image/jpeg":[".jpg",".jpeg",".png"]}}),c=d=>{d.stopPropagation(),l()};return Y(mo,{...i(),flexGrow:3,className:`${r}`,children:[x("input",{...a({multiple:!1})}),v.exports.cloneElement(e,{onClick:c})]})};function _me(e){const{label:t,icon:n,dispatcher:r,styleClass:o,onMouseOver:i,OnMouseout:a}=e,l=qf(),c=Ue(),d=v.exports.useCallback(p=>c(r(p)),[c,r]),f=v.exports.useCallback(p=>{const m=p.errors.reduce((g,y)=>g+` -`+y.message,"");l({title:"Upload failed",description:m,status:"error",isClosable:!0})},[l]);return x(Cme,{fileAcceptedCallback:d,fileRejectionCallback:f,styleClass:o,children:x(xi,{size:"sm",fontSize:"md",fontWeight:"normal",onMouseOver:i,onMouseOut:a,leftIcon:n,width:"100%",children:t||null})})}const kme=Yn(e=>e.system,e=>e.shouldConfirmOnDelete),t3=v.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:i}=T0(),a=Ue(),l=Ee(kme),c=v.exports.useRef(null),d=qf(),f=g=>{g.stopPropagation(),l?o():p()},p=()=>{a(qhe(e)),d({title:"Image Deleted",status:"success",duration:2500,isClosable:!0}),i()};sn("del",()=>{l?o():p()},[e,l]);const m=g=>a(EO(!g.target.checked));return Y(wn,{children:[v.exports.cloneElement(t,{onClick:f,ref:n}),x(Tre,{isOpen:r,leastDestructiveRef:c,onClose:i,children:x(hf,{children:Y(Ire,{children:[x(Ex,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),x(M0,{children:Y(Lt,{direction:"column",gap:5,children:[x(wr,{children:"Are you sure? You can't undo this action afterwards."}),x(hs,{children:Y(Lt,{alignItems:"center",children:[x(sl,{mb:0,children:"Don't ask me again"}),x(ag,{checked:!l,onChange:m})]})})]})}),Y(kx,{children:[x(xi,{ref:c,onClick:i,children:"Cancel"}),x(xi,{colorScheme:"red",onClick:p,ml:3,children:"Delete"})]})]})})})]})}),h_=({title:e="Popup",styleClass:t,delay:n=50,popoverOptions:r,actionButton:o,children:i})=>Y(Px,{trigger:"hover",closeDelay:n,children:[x(Ox,{children:x(mo,{children:i})}),Y(Ix,{className:`popover-content ${t}`,children:[x(Ax,{className:"popover-arrow"}),x(iI,{className:"popover-header",children:e}),Y("div",{className:"popover-options",children:[r||null,o]})]})]}),Eme=Yn(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isGFPGANAvailable:e.isGFPGANAvailable,isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),CR=({image:e})=>{const t=Ue(),n=Ee(C=>C.options.shouldShowImageDetails),r=qf(),o=Ee(C=>C.gallery.intermediateImage),i=Ee(C=>C.options.upscalingLevel),a=Ee(C=>C.options.facetoolStrength),{isProcessing:l,isConnected:c,isGFPGANAvailable:d,isESRGANAvailable:f}=Ee(Eme),p=()=>{t(nl(e.url)),t(ni(1))};sn("shift+i",()=>{e?(p(),r({title:"Sent To Image To Image",status:"success",duration:2500,isClosable:!0})):r({title:"No Image Loaded",description:"No image found to send to image to image module.",status:"error",duration:2500,isClosable:!0})},[e]);const m=()=>t(_pe(e.metadata));sn("a",()=>{["txt2img","img2img"].includes(e?.metadata?.image?.type)?(m(),r({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})):r({title:"Parameters Not Set",description:"No metadata found for this image.",status:"error",duration:2500,isClosable:!0})},[e]);const g=()=>t(Yf(e.metadata.image.seed));sn("s",()=>{e?.metadata?.image?.seed?(g(),r({title:"Seed Set",status:"success",duration:2500,isClosable:!0})):r({title:"Seed Not Set",description:"Could not find seed for this image.",status:"error",duration:2500,isClosable:!0})},[e]);const y=()=>t(Zhe(e));sn("u",()=>{f&&Boolean(!o)&&c&&!l&&i?y():r({title:"Upscaling Failed",status:"error",duration:2500,isClosable:!0})},[e,f,o,c,l,i]);const b=()=>t(Khe(e));sn("r",()=>{d&&Boolean(!o)&&c&&!l&&a?b():r({title:"Face Restoration Failed",status:"error",duration:2500,isClosable:!0})},[e,d,o,c,l,a]);const k=()=>t(Ape(!n));return sn("i",()=>{e?k():r({title:"Failed to load metadata",status:"error",duration:2500,isClosable:!0})},[e,n]),Y("div",{className:"current-image-options",children:[x(Ns,{icon:x(o0e,{}),tooltip:"Send To Image To Image","aria-label":"Send To Image To Image",onClick:p}),x(sd,{label:"Use All",isDisabled:!["txt2img","img2img"].includes(e?.metadata?.image?.type),onClick:m}),x(sd,{label:"Use Seed",isDisabled:!e?.metadata?.image?.seed,onClick:g}),x(h_,{title:"Restore Faces",popoverOptions:x(a6,{}),actionButton:x(sd,{label:"Restore Faces",isDisabled:!d||Boolean(o)||!(c&&!l)||!a,onClick:b}),children:x(Ns,{icon:x(J1e,{}),"aria-label":"Restore Faces"})}),x(h_,{title:"Upscale",styleClass:"upscale-popover",popoverOptions:x(s6,{}),actionButton:x(sd,{label:"Upscale Image",isDisabled:!f||Boolean(o)||!(c&&!l)||!i,onClick:y}),children:x(Ns,{icon:x(n0e,{}),"aria-label":"Upscale"})}),x(Ns,{icon:x(e0e,{}),tooltip:"Details","aria-label":"Details",onClick:k}),x(t3,{image:e,children:x(Ns,{icon:x(Q1e,{}),tooltip:"Delete Image","aria-label":"Delete Image",isDisabled:Boolean(o)})})]})},Lme=Yn(e=>e.gallery,e=>{const t=e.images.findIndex(r=>r.uuid===e?.currentImage?.uuid),n=e.images.length;return{isOnFirstImage:t===0,isOnLastImage:!isNaN(t)&&t===n-1}},{memoizeOptions:{resultEqualityCheck:xf.isEqual}});function _R(e){const{imageToDisplay:t}=e,n=Ue(),{isOnFirstImage:r,isOnLastImage:o}=Ee(Lme),i=Ee(m=>m.options.shouldShowImageDetails),[a,l]=v.exports.useState(!1),c=()=>{l(!0)},d=()=>{l(!1)},f=()=>{n(_O())},p=()=>{n(CO())};return Y("div",{className:"current-image-preview",children:[x(Xm,{src:t.url,fit:"contain",maxWidth:"100%",maxHeight:"100%"}),!i&&Y("div",{className:"current-image-next-prev-buttons",children:[x("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:d,children:a&&!r&&x(Nn,{"aria-label":"Previous image",icon:x(x0e,{className:"next-prev-button"}),variant:"unstyled",onClick:f})}),x("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:d,children:a&&!o&&x(Nn,{"aria-label":"Next image",icon:x(w0e,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]})]})}var m_={path:Y("g",{stroke:"currentColor",strokeWidth:"1.5",children:[x("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"}),x("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),x("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},kR=fe((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:a,className:l,__css:c,...d}=e,f=en("chakra-icon",l),p={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...c},m={ref:t,focusable:i,className:f,__css:p},g=r??m_.viewBox;if(n&&typeof n!="string")return Q.createElement(ie.svg,{as:n,...m,...d});const y=a??m_.path;return Q.createElement(ie.svg,{verticalAlign:"middle",viewBox:g,...m,...d},y)});kR.displayName="Icon";function Te(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,i=v.exports.Children.toArray(e.path),a=fe((l,c)=>x(kR,{ref:c,viewBox:t,...o,...l,children:i.length?i:x("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}Te({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});Te({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});Te({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});Te({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});Te({displayName:"SunIcon",path:Y("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[x("circle",{cx:"12",cy:"12",r:"5"}),x("path",{d:"M12 1v2"}),x("path",{d:"M12 21v2"}),x("path",{d:"M4.22 4.22l1.42 1.42"}),x("path",{d:"M18.36 18.36l1.42 1.42"}),x("path",{d:"M1 12h2"}),x("path",{d:"M21 12h2"}),x("path",{d:"M4.22 19.78l1.42-1.42"}),x("path",{d:"M18.36 5.64l1.42-1.42"})]})});Te({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});Te({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:x("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});Te({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});Te({displayName:"CheckCircleIcon",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"});Te({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});Te({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});Te({displayName:"ViewIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),x("circle",{cx:"12",cy:"12",r:"2"})]})});Te({displayName:"ViewOffIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),x("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})});Te({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});Te({displayName:"DeleteIcon",path:x("g",{fill:"currentColor",children:x("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"})})});Te({displayName:"RepeatIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),x("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})});Te({displayName:"RepeatClockIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),x("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"})]})});Te({displayName:"EditIcon",path:Y("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[x("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),x("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});Te({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});Te({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});Te({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});Te({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});Te({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});Te({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});Te({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});Te({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});Te({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var ER=Te({displayName:"ExternalLinkIcon",path:Y("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[x("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),x("path",{d:"M15 3h6v6"}),x("path",{d:"M10 14L21 3"})]})});Te({displayName:"LinkIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),x("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"})]})});Te({displayName:"PlusSquareIcon",path:Y("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[x("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),x("path",{d:"M12 8v8"}),x("path",{d:"M8 12h8"})]})});Te({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});Te({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});Te({displayName:"TimeIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),x("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"})]})});Te({displayName:"ArrowRightIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),x("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})});Te({displayName:"ArrowLeftIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),x("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})});Te({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});Te({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});Te({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});Te({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});Te({displayName:"EmailIcon",path:Y("g",{fill:"currentColor",children:[x("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),x("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"})]})});Te({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});Te({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});Te({displayName:"SpinnerIcon",path:Y(wn,{children:[x("defs",{children:Y("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[x("stop",{stopColor:"currentColor",offset:"0%"}),x("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),Y("g",{transform:"translate(2)",fill:"none",children:[x("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),x("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),x("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});Te({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"});Te({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:x("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});Te({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});Te({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",displayName:"TriangleDownIcon"});Te({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",displayName:"TriangleUpIcon"});Te({displayName:"InfoOutlineIcon",path:Y("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[x("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),x("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),x("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});Te({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});Te({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"});Te({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});Te({displayName:"QuestionOutlineIcon",path:Y("g",{stroke:"currentColor",strokeWidth:"1.5",children:[x("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"}),x("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),x("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});Te({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",displayName:"WarningIcon"});Te({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});Te({viewBox:"0 0 14 14",path:x("g",{fill:"currentColor",children:x("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});Te({displayName:"MinusIcon",path:x("g",{fill:"currentColor",children:x("rect",{height:"4",width:"20",x:"2",y:"10"})})});Te({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function Pme(e){return Mt({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 zt=({label:e,value:t,onClick:n,isLink:r,labelPosition:o})=>Y(Lt,{gap:2,children:[n&&x(ir,{label:`Recall ${e}`,children:x(Nn,{"aria-label":"Use this parameter",icon:x(Pme,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),Y(Lt,{direction:o?"column":"row",children:[Y(wr,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?Y(Cu,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",x(ER,{mx:"2px"})]}):x(wr,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Ame=(e,t)=>e.image.uuid===t.image.uuid,LR=v.exports.memo(({image:e,styleClass:t})=>{const n=Ue(),r=e?.metadata?.image||{},{type:o,postprocessing:i,sampler:a,prompt:l,seed:c,variations:d,steps:f,cfg_scale:p,seamless:m,hires_fix:g,width:y,height:b,strength:k,fit:C,init_image_path:S,mask_image_path:_,orig_path:E,scale:A}=r,R=JSON.stringify(r,null,2);return x("div",{className:`image-metadata-viewer ${t}`,children:Y(Lt,{gap:1,direction:"column",width:"100%",children:[Y(Lt,{gap:2,children:[x(wr,{fontWeight:"semibold",children:"File:"}),Y(Cu,{href:e.url,isExternal:!0,children:[e.url,x(ER,{mx:"2px"})]})]}),Object.keys(r).length>0?Y(wn,{children:[o&&x(zt,{label:"Generation type",value:o}),["esrgan","gfpgan"].includes(o)&&x(zt,{label:"Original image",value:E}),o==="gfpgan"&&k!==void 0&&x(zt,{label:"Fix faces strength",value:k,onClick:()=>n(O1(k))}),o==="esrgan"&&A!==void 0&&x(zt,{label:"Upscaling scale",value:A,onClick:()=>n(B4(A))}),o==="esrgan"&&k!==void 0&&x(zt,{label:"Upscaling strength",value:k,onClick:()=>n(V4(k))}),l&&x(zt,{label:"Prompt",labelPosition:"top",value:I1(l),onClick:()=>n(e6(l))}),c!==void 0&&x(zt,{label:"Seed",value:c,onClick:()=>n(Yf(c))}),a&&x(zt,{label:"Sampler",value:a,onClick:()=>n(mO(a))}),f&&x(zt,{label:"Steps",value:f,onClick:()=>n(dO(f))}),p!==void 0&&x(zt,{label:"CFG scale",value:p,onClick:()=>n(fO(p))}),d&&d.length>0&&x(zt,{label:"Seed-weight pairs",value:j0(d),onClick:()=>n(wO(j0(d)))}),m&&x(zt,{label:"Seamless",value:m,onClick:()=>n(gO(m))}),g&&x(zt,{label:"High Resolution Optimization",value:g,onClick:()=>n(vO(g))}),y&&x(zt,{label:"Width",value:y,onClick:()=>n(hO(y))}),b&&x(zt,{label:"Height",value:b,onClick:()=>n(pO(b))}),S&&x(zt,{label:"Initial image",value:S,isLink:!0,onClick:()=>n(nl(S))}),_&&x(zt,{label:"Mask image",value:_,isLink:!0,onClick:()=>n(W4(_))}),o==="img2img"&&k&&x(zt,{label:"Image to image strength",value:k,onClick:()=>n(yO(k))}),C&&x(zt,{label:"Image to image fit",value:C,onClick:()=>n(xO(C))}),i&&i.length>0&&Y(wn,{children:[x(rx,{size:"sm",children:"Postprocessing"}),i.map((O,$)=>{if(O.type==="esrgan"){const{scale:H,strength:z}=O;return Y(Lt,{pl:"2rem",gap:1,direction:"column",children:[x(wr,{size:"md",children:`${$+1}: Upscale (ESRGAN)`}),x(zt,{label:"Scale",value:H,onClick:()=>n(B4(H))}),x(zt,{label:"Strength",value:z,onClick:()=>n(V4(z))})]},$)}else if(O.type==="gfpgan"){const{strength:H}=O;return Y(Lt,{pl:"2rem",gap:1,direction:"column",children:[x(wr,{size:"md",children:`${$+1}: Face restoration (GFPGAN)`}),x(zt,{label:"Strength",value:H,onClick:()=>{n(O1(H)),n(R1("gfpgan"))}})]},$)}else if(O.type==="codeformer"){const{strength:H,fidelity:z}=O;return Y(Lt,{pl:"2rem",gap:1,direction:"column",children:[x(wr,{size:"md",children:`${$+1}: Face restoration (Codeformer)`}),x(zt,{label:"Strength",value:H,onClick:()=>{n(O1(H)),n(R1("codeformer"))}}),z&&x(zt,{label:"Fidelity",value:z,onClick:()=>{n(bO(z)),n(R1("codeformer"))}})]},$)}})]}),Y(Lt,{gap:2,direction:"column",children:[Y(Lt,{gap:2,children:[x(ir,{label:"Copy metadata JSON",children:x(Nn,{"aria-label":"Copy metadata JSON",icon:x(_0e,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(R)})}),x(wr,{fontWeight:"semibold",children:"Metadata JSON:"})]}),x("div",{className:"image-json-viewer",children:x("pre",{children:R})})]})]}):x(VA,{width:"100%",pt:10,children:x(wr,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},Ame);function g_(){const e=Ee(i=>i.options.initialImagePath),t=Ue(),n=qf();return Y("div",{className:"init-image-preview",children:[Y("div",{className:"init-image-preview-header",children:[x("h1",{children:"Initial Image"}),x(Nn,{isDisabled:!e,size:"sm","aria-label":"Reset Initial Image",onClick:i=>{i.stopPropagation(),t(nl(null))},icon:x(aR,{})})]}),e&&x("div",{className:"init-image-image",children:x(Xm,{fit:"contain",src:e,rounded:"md",onError:()=>{n({title:"Problem loading parameters",description:"Unable to load init image.",status:"error",isClosable:!0}),t(nl(null))}})})]})}function Tme(){const e=Ee(i=>i.options.initialImagePath),{currentImage:t,intermediateImage:n}=Ee(i=>i.gallery),r=Ee(i=>i.options.shouldShowImageDetails),o=n||t;return x("div",{className:"image-to-image-display",style:o?{gridAutoRows:"max-content auto"}:{gridAutoRows:"auto"},children:e?x(wn,{children:o?Y(wn,{children:[x(CR,{image:o}),Y("div",{className:"image-to-image-dual-preview-container",children:[Y("div",{className:"image-to-image-dual-preview",children:[x(g_,{}),x("div",{className:"image-to-image-current-image-display",children:x(_R,{imageToDisplay:o})})]}),r&&x(LR,{image:o,styleClass:"img2img-metadata"})]})]}):x("div",{className:"image-to-image-single-preview",children:x(g_,{})})}):x("div",{className:"upload-image",children:x(_me,{label:"Upload or Drop Image Here",icon:x(A0e,{}),styleClass:"image-to-image-upload-btn",dispatcher:Qhe})})})}var Ime=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cn=globalThis&&globalThis.__assign||function(){return cn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof i>"u"?void 0:Number(i),minHeight:typeof a>"u"?void 0:Number(a)}},Fme=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],w_="__resizable_base__",PR=function(e){Mme(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var o=r.parentNode;if(!o)return null;var i=r.window.document.createElement("div");return i.style.width="100%",i.style.height="100%",i.style.position="absolute",i.style.transform="scale(0, 0)",i.style.left="0",i.style.flex="0 0 100%",i.classList?i.classList.add(w_):i.className+=w_,o.appendChild(i),i},r.removeBase=function(o){var i=r.parentNode;!i||i.removeChild(o)},r.ref=function(o){o&&(r.resizable=o)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Nme},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,i=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:i,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(l){if(typeof n.state[l]>"u"||n.state[l]==="auto")return"auto";if(n.propsSize&&n.propsSize[l]&&n.propsSize[l].toString().endsWith("%")){if(n.state[l].toString().endsWith("%"))return n.state[l].toString();var c=n.getParentSize(),d=Number(n.state[l].toString().replace("px","")),f=d/c[l]*100;return f+"%"}return Py(n.state[l])},i=r&&typeof r.width<"u"&&!this.state.isResizing?Py(r.width):o("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?Py(r.height):o("height");return{width:i,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var i={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),i},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,i=this.state.direction,a=o&&Gl("left",i),l=o&&Gl("top",i),c,d;if(this.props.bounds==="parent"){var f=this.parentNode;f&&(c=a?this.resizableRight-this.parentLeft:f.offsetWidth+(this.parentLeft-this.resizableLeft),d=l?this.resizableBottom-this.parentTop:f.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(c=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,d=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(c=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),d=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return c&&Number.isFinite(c)&&(n=n&&n"u"?10:i.width,p=typeof o.width>"u"||o.width<0?n:o.width,m=typeof i.height>"u"?10:i.height,g=typeof o.height>"u"||o.height<0?r:o.height,y=c||0,b=d||0;if(l){var k=(m-y)*this.ratio+b,C=(g-y)*this.ratio+b,S=(f-b)/this.ratio+y,_=(p-b)/this.ratio+y,E=Math.max(f,k),A=Math.min(p,C),R=Math.max(m,S),O=Math.min(g,_);n=Qh(n,E,A),r=Qh(r,R,O)}else n=Qh(n,f,p),r=Qh(r,m,g);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,l=i.top,c=i.right,d=i.bottom;this.resizableLeft=a,this.resizableRight=c,this.resizableTop=l,this.resizableBottom=d}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,i=0;if(n.nativeEvent&&$me(n.nativeEvent)?(o=n.nativeEvent.clientX,i=n.nativeEvent.clientY):n.nativeEvent&&Jh(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,i=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,c=this.window.getComputedStyle(this.resizable);if(c.flexBasis!=="auto"){var d=this.parentNode;if(d){var f=this.window.getComputedStyle(d).flexDirection;this.flexDir=f.startsWith("row")?"row":"column",l=c.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:o,y:i,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:ti(ti({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:l};this.setState(p)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Jh(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,i=o.maxWidth,a=o.maxHeight,l=o.minWidth,c=o.minHeight,d=Jh(n)?n.touches[0].clientX:n.clientX,f=Jh(n)?n.touches[0].clientY:n.clientY,p=this.state,m=p.direction,g=p.original,y=p.width,b=p.height,k=this.getParentSize(),C=Dme(k,this.window.innerWidth,this.window.innerHeight,i,a,l,c);i=C.maxWidth,a=C.maxHeight,l=C.minWidth,c=C.minHeight;var S=this.calculateNewSizeFromDirection(d,f),_=S.newHeight,E=S.newWidth,A=this.calculateNewMaxFromBoundary(i,a);this.props.snap&&this.props.snap.x&&(E=x_(E,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(_=x_(_,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(E,_,{width:A.maxWidth,height:A.maxHeight},{width:l,height:c});if(E=R.newWidth,_=R.newHeight,this.props.grid){var O=b_(E,this.props.grid[0]),$=b_(_,this.props.grid[1]),H=this.props.snapGap||0;E=H===0||Math.abs(O-E)<=H?O:E,_=H===0||Math.abs($-_)<=H?$:_}var z={width:E-g.width,height:_-g.height};if(y&&typeof y=="string"){if(y.endsWith("%")){var X=E/k.width*100;E=X+"%"}else if(y.endsWith("vw")){var he=E/this.window.innerWidth*100;E=he+"vw"}else if(y.endsWith("vh")){var ye=E/this.window.innerHeight*100;E=ye+"vh"}}if(b&&typeof b=="string"){if(b.endsWith("%")){var X=_/k.height*100;_=X+"%"}else if(b.endsWith("vw")){var he=_/this.window.innerWidth*100;_=he+"vw"}else if(b.endsWith("vh")){var ye=_/this.window.innerHeight*100;_=ye+"vh"}}var oe={width:this.createSizeForCssProperty(E,"width"),height:this.createSizeForCssProperty(_,"height")};this.flexDir==="row"?oe.flexBasis=oe.width:this.flexDir==="column"&&(oe.flexBasis=oe.height),ua.exports.flushSync(function(){r.setState(oe)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,z)}},t.prototype.onMouseUp=function(n){var r=this.state,o=r.isResizing,i=r.direction,a=r.original;if(!(!o||!this.resizable)){var l={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,i,this.resizable,l),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:ti(ti({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,o=r.enable,i=r.handleStyles,a=r.handleClasses,l=r.handleWrapperStyle,c=r.handleWrapperClass,d=r.handleComponent;if(!o)return null;var f=Object.keys(o).map(function(p){return o[p]!==!1?x(Rme,{direction:p,onResizeStart:n.onResizeStart,replaceStyles:i&&i[p],className:a&&a[p],children:d&&d[p]?d[p]:null},p):null});return x("div",{className:c,style:l,children:f})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,l){return Fme.indexOf(l)!==-1||(a[l]=n.props[l]),a},{}),o=ti(ti(ti({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return Y(i,{...ti({ref:this.ref,style:o,className:this.props.className},r),children:[this.state.isResizing&&x("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]})},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(v.exports.PureComponent);function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;ty,Object.values(y));return v.exports.createElement(b.Provider,{value:k},g)}function f(p,m){const g=m?.[e][c]||l,y=v.exports.useContext(g);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,f]}const o=()=>{const i=n.map(a=>v.exports.createContext(a));return function(l){const c=l?.[e]||i;return v.exports.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,zme(o,...t)]}function zme(...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(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return v.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Bme(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function AR(...e){return t=>e.forEach(n=>Bme(n,t))}function yo(...e){return v.exports.useCallback(AR(...e),e)}const Cf=v.exports.forwardRef((e,t)=>{const{children:n,...r}=e,o=v.exports.Children.toArray(n),i=o.find(Wme);if(i){const a=i.props.children,l=o.map(c=>c===i?v.exports.Children.count(a)>1?v.exports.Children.only(null):v.exports.isValidElement(a)?a.props.children:null:c);return v.exports.createElement(n3,Ot({},r,{ref:t}),v.exports.isValidElement(a)?v.exports.cloneElement(a,void 0,l):null)}return v.exports.createElement(n3,Ot({},r,{ref:t}),n)});Cf.displayName="Slot";const n3=v.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return v.exports.isValidElement(n)?v.exports.cloneElement(n,{...Ume(r,n.props),ref:AR(t,n.ref)}):v.exports.Children.count(n)>1?v.exports.Children.only(null):null});n3.displayName="SlotClone";const Vme=({children:e})=>v.exports.createElement(v.exports.Fragment,null,e);function Wme(e){return v.exports.isValidElement(e)&&e.type===Vme}function Ume(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{i(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Hme=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],aa=Hme.reduce((e,t)=>{const n=v.exports.forwardRef((r,o)=>{const{asChild:i,...a}=r,l=i?Cf:t;return v.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),v.exports.createElement(l,Ot({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function TR(e,t){e&&ua.exports.flushSync(()=>e.dispatchEvent(t))}function IR(e){const t=e+"CollectionProvider",[n,r]=Jf(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:y,children:b}=g,k=Q.useRef(null),C=Q.useRef(new Map).current;return Q.createElement(o,{scope:y,itemMap:C,collectionRef:k},b)},l=e+"CollectionSlot",c=Q.forwardRef((g,y)=>{const{scope:b,children:k}=g,C=i(l,b),S=yo(y,C.collectionRef);return Q.createElement(Cf,{ref:S},k)}),d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Q.forwardRef((g,y)=>{const{scope:b,children:k,...C}=g,S=Q.useRef(null),_=yo(y,S),E=i(d,b);return Q.useEffect(()=>(E.itemMap.set(S,{ref:S,...C}),()=>void E.itemMap.delete(S))),Q.createElement(Cf,{[f]:"",ref:_},k)});function m(g){const y=i(e+"CollectionConsumer",g);return Q.useCallback(()=>{const k=y.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((E,A)=>C.indexOf(E.ref.current)-C.indexOf(A.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:c,ItemSlot:p},m,r]}const jme=v.exports.createContext(void 0);function OR(e){const t=v.exports.useContext(jme);return e||t||"ltr"}function Ci(e){const t=v.exports.useRef(e);return v.exports.useEffect(()=>{t.current=e}),v.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Gme(e,t=globalThis?.document){const n=Ci(e);v.exports.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const r3="dismissableLayer.update",Zme="dismissableLayer.pointerDownOutside",Kme="dismissableLayer.focusOutside";let S_;const qme=v.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yme=v.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...d}=e,f=v.exports.useContext(qme),[p,m]=v.exports.useState(null),g=(n=p?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,y]=v.exports.useState({}),b=yo(t,$=>m($)),k=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=k.indexOf(C),_=p?k.indexOf(p):-1,E=f.layersWithOutsidePointerEventsDisabled.size>0,A=_>=S,R=Xme($=>{const H=$.target,z=[...f.branches].some(X=>X.contains(H));!A||z||(i?.($),l?.($),$.defaultPrevented||c?.())},g),O=Qme($=>{const H=$.target;[...f.branches].some(X=>X.contains(H))||(a?.($),l?.($),$.defaultPrevented||c?.())},g);return Gme($=>{_===f.layers.size-1&&(o?.($),!$.defaultPrevented&&c&&($.preventDefault(),c()))},g),v.exports.useEffect(()=>{if(!!p)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(S_=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),C_(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=S_)}},[p,g,r,f]),v.exports.useEffect(()=>()=>{!p||(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),C_())},[p,f]),v.exports.useEffect(()=>{const $=()=>y({});return document.addEventListener(r3,$),()=>document.removeEventListener(r3,$)},[]),v.exports.createElement(aa.div,Ot({},d,{ref:b,style:{pointerEvents:E?A?"auto":"none":void 0,...e.style},onFocusCapture:It(e.onFocusCapture,O.onFocusCapture),onBlurCapture:It(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:It(e.onPointerDownCapture,R.onPointerDownCapture)}))});function Xme(e,t=globalThis?.document){const n=Ci(e),r=v.exports.useRef(!1),o=v.exports.useRef(()=>{});return v.exports.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let d=function(){RR(Zme,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Qme(e,t=globalThis?.document){const n=Ci(e),r=v.exports.useRef(!1);return v.exports.useEffect(()=>{const o=i=>{i.target&&!r.current&&RR(Kme,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function C_(){const e=new CustomEvent(r3);document.dispatchEvent(e)}function RR(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?TR(o,i):o.dispatchEvent(i)}let Ay=0;function Jme(){v.exports.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:__()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:__()),Ay++,()=>{Ay===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Ay--}},[])}function __(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Ty="focusScope.autoFocusOnMount",Iy="focusScope.autoFocusOnUnmount",k_={bubbles:!1,cancelable:!0},ege=v.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,c]=v.exports.useState(null),d=Ci(o),f=Ci(i),p=v.exports.useRef(null),m=yo(t,b=>c(b)),g=v.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.exports.useEffect(()=>{if(r){let b=function(C){if(g.paused||!l)return;const S=C.target;l.contains(S)?p.current=S:Os(p.current,{select:!0})},k=function(C){g.paused||!l||l.contains(C.relatedTarget)||Os(p.current,{select:!0})};return document.addEventListener("focusin",b),document.addEventListener("focusout",k),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",k)}}},[r,l,g.paused]),v.exports.useEffect(()=>{if(l){L_.add(g);const b=document.activeElement;if(!l.contains(b)){const C=new CustomEvent(Ty,k_);l.addEventListener(Ty,d),l.dispatchEvent(C),C.defaultPrevented||(tge(age(MR(l)),{select:!0}),document.activeElement===b&&Os(l))}return()=>{l.removeEventListener(Ty,d),setTimeout(()=>{const C=new CustomEvent(Iy,k_);l.addEventListener(Iy,f),l.dispatchEvent(C),C.defaultPrevented||Os(b??document.body,{select:!0}),l.removeEventListener(Iy,f),L_.remove(g)},0)}}},[l,d,f,g]);const y=v.exports.useCallback(b=>{if(!n&&!r||g.paused)return;const k=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,C=document.activeElement;if(k&&C){const S=b.currentTarget,[_,E]=nge(S);_&&E?!b.shiftKey&&C===E?(b.preventDefault(),n&&Os(_,{select:!0})):b.shiftKey&&C===_&&(b.preventDefault(),n&&Os(E,{select:!0})):C===S&&b.preventDefault()}},[n,r,g.paused]);return v.exports.createElement(aa.div,Ot({tabIndex:-1},a,{ref:m,onKeyDown:y}))});function tge(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Os(r,{select:t}),document.activeElement!==n)return}function nge(e){const t=MR(e),n=E_(t,e),r=E_(t.reverse(),e);return[n,r]}function MR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function E_(e,t){for(const n of e)if(!rge(n,{upTo:t}))return n}function rge(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function oge(e){return e instanceof HTMLInputElement&&"select"in e}function Os(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&oge(e)&&t&&e.select()}}const L_=ige();function ige(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=P_(e,t),e.unshift(t)},remove(t){var n;e=P_(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function P_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function age(e){return e.filter(t=>t.tagName!=="A")}const Gu=Boolean(globalThis?.document)?v.exports.useLayoutEffect:()=>{},sge=My["useId".toString()]||(()=>{});let lge=0;function uge(e){const[t,n]=v.exports.useState(sge());return Gu(()=>{e||n(r=>r??String(lge++))},[e]),e||(t?`radix-${t}`:"")}function sc(e){return e.split("-")[0]}function Sg(e){return e.split("-")[1]}function lc(e){return["top","bottom"].includes(sc(e))?"x":"y"}function d6(e){return e==="y"?"height":"width"}function A_(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=lc(t),c=d6(l),d=r[c]/2-o[c]/2,f=sc(t),p=l==="x";let m;switch(f){case"top":m={x:i,y:r.y-o.height};break;case"bottom":m={x:i,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-o.width,y:a};break;default:m={x:r.x,y:r.y}}switch(Sg(t)){case"start":m[l]-=d*(n&&p?-1:1);break;case"end":m[l]+=d*(n&&p?-1:1);break}return m}const cge=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=A_(c,r,l),p=r,m={},g=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:o,y:i,placement:a,rects:l,platform:c}=t;if(n==null)return{};const d=NR(r),f={x:o,y:i},p=lc(a),m=Sg(a),g=d6(p),y=await c.getDimensions(n),b=p==="y"?"top":"left",k=p==="y"?"bottom":"right",C=l.reference[g]+l.reference[p]-f[p]-l.floating[g],S=f[p]-l.reference[p],_=await(c.getOffsetParent==null?void 0:c.getOffsetParent(n));let E=_?p==="y"?_.clientHeight||0:_.clientWidth||0:0;E===0&&(E=l.floating[g]);const A=C/2-S/2,R=d[b],O=E-y[g]-d[k],$=E/2-y[g]/2+A,H=o3(R,$,O),he=(m==="start"?d[b]:d[k])>0&&$!==H&&l.reference[g]<=l.floating[g]?$hge[t])}function mge(e,t,n){n===void 0&&(n=!1);const r=Sg(e),o=lc(e),i=d6(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=X0(a)),{main:a,cross:X0(a)}}const gge={start:"end",end:"start"};function I_(e){return e.replace(/start|end/g,t=>gge[t])}const vge=["top","right","bottom","left"];function yge(e){const t=X0(e);return[I_(e),t,I_(t)]}const bge=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:g=!0,...y}=e,b=sc(r),C=p||(b===a||!g?[X0(a)]:yge(a)),S=[a,...C],_=await Y0(t,y),E=[];let A=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&E.push(_[b]),f){const{main:H,cross:z}=mge(r,i,await(l.isRTL==null?void 0:l.isRTL(c.floating)));E.push(_[H],_[z])}if(A=[...A,{placement:r,overflows:E}],!E.every(H=>H<=0)){var R,O;const H=((R=(O=o.flip)==null?void 0:O.index)!=null?R:0)+1,z=S[H];if(z)return{data:{index:H,overflows:A},reset:{placement:z}};let X="bottom";switch(m){case"bestFit":{var $;const he=($=A.map(ye=>[ye,ye.overflows.filter(oe=>oe>0).reduce((oe,pe)=>oe+pe,0)]).sort((ye,oe)=>ye[1]-oe[1])[0])==null?void 0:$[0].placement;he&&(X=he);break}case"initialPlacement":X=a;break}if(r!==X)return{reset:{placement:X}}}return{}}}};function O_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function R_(e){return vge.some(t=>e[t]>=0)}const xge=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:o}=r;switch(t){case"referenceHidden":{const i=await Y0(r,{...n,elementContext:"reference"}),a=O_(i,o.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:R_(a)}}}case"escaped":{const i=await Y0(r,{...n,altBoundary:!0}),a=O_(i,o.floating);return{data:{escapedOffsets:a,escaped:R_(a)}}}default:return{}}}}};async function wge(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=sc(n),l=Sg(n),c=lc(n)==="x",d=["left","top"].includes(a)?-1:1,f=i&&c?-1:1,p=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:g,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof y=="number"&&(g=l==="end"?y*-1:y),c?{x:g*f,y:m*d}:{x:m*d,y:g*f}}const Sge=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await wge(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function $R(e){return e==="x"?"y":"x"}const Cge=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:k=>{let{x:C,y:S}=k;return{x:C,y:S}}},...c}=e,d={x:n,y:r},f=await Y0(t,c),p=lc(sc(o)),m=$R(p);let g=d[p],y=d[m];if(i){const k=p==="y"?"top":"left",C=p==="y"?"bottom":"right",S=g+f[k],_=g-f[C];g=o3(S,g,_)}if(a){const k=m==="y"?"top":"left",C=m==="y"?"bottom":"right",S=y+f[k],_=y-f[C];y=o3(S,y,_)}const b=l.fn({...t,[p]:g,[m]:y});return{...b,data:{x:b.x-n,y:b.y-r}}}}},_ge=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=e,f={x:n,y:r},p=lc(o),m=$R(p);let g=f[p],y=f[m];const b=typeof l=="function"?l({...i,placement:o}):l,k=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const A=p==="y"?"height":"width",R=i.reference[p]-i.floating[A]+k.mainAxis,O=i.reference[p]+i.reference[A]-k.mainAxis;gO&&(g=O)}if(d){var C,S,_,E;const A=p==="y"?"width":"height",R=["top","left"].includes(sc(o)),O=i.reference[m]-i.floating[A]+(R&&(C=(S=a.offset)==null?void 0:S[m])!=null?C:0)+(R?0:k.crossAxis),$=i.reference[m]+i.reference[A]+(R?0:(_=(E=a.offset)==null?void 0:E[m])!=null?_:0)-(R?k.crossAxis:0);y$&&(y=$)}return{[p]:g,[m]:y}}}};function DR(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function fa(e){if(e==null)return window;if(!DR(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function ep(e){return fa(e).getComputedStyle(e)}function sa(e){return DR(e)?"":e?(e.nodeName||"").toLowerCase():""}function FR(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function _i(e){return e instanceof fa(e).HTMLElement}function us(e){return e instanceof fa(e).Element}function kge(e){return e instanceof fa(e).Node}function f6(e){if(typeof ShadowRoot>"u")return!1;const t=fa(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Cg(e){const{overflow:t,overflowX:n,overflowY:r}=ep(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function Ege(e){return["table","td","th"].includes(sa(e))}function zR(e){const t=/firefox/i.test(FR()),n=ep(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function BR(){return!/^((?!chrome|android).)*safari/i.test(FR())}const M_=Math.min,Id=Math.max,Q0=Math.round;function la(e,t,n){var r,o,i,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect();let c=1,d=1;t&&_i(e)&&(c=e.offsetWidth>0&&Q0(l.width)/e.offsetWidth||1,d=e.offsetHeight>0&&Q0(l.height)/e.offsetHeight||1);const f=us(e)?fa(e):window,p=!BR()&&n,m=(l.left+(p&&(r=(o=f.visualViewport)==null?void 0:o.offsetLeft)!=null?r:0))/c,g=(l.top+(p&&(i=(a=f.visualViewport)==null?void 0:a.offsetTop)!=null?i:0))/d,y=l.width/c,b=l.height/d;return{width:y,height:b,top:g,right:m+y,bottom:g+b,left:m,x:m,y:g}}function gs(e){return((kge(e)?e.ownerDocument:e.document)||window.document).documentElement}function _g(e){return us(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function VR(e){return la(gs(e)).left+_g(e).scrollLeft}function Lge(e){const t=la(e);return Q0(t.width)!==e.offsetWidth||Q0(t.height)!==e.offsetHeight}function Pge(e,t,n){const r=_i(t),o=gs(t),i=la(e,r&&Lge(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&n!=="fixed")if((sa(t)!=="body"||Cg(o))&&(a=_g(t)),_i(t)){const c=la(t,!0);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=VR(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function WR(e){return sa(e)==="html"?e:e.assignedSlot||e.parentNode||(f6(e)?e.host:null)||gs(e)}function N_(e){return!_i(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function Age(e){let t=WR(e);for(f6(t)&&(t=t.host);_i(t)&&!["html","body"].includes(sa(t));){if(zR(t))return t;t=t.parentNode}return null}function i3(e){const t=fa(e);let n=N_(e);for(;n&&Ege(n)&&getComputedStyle(n).position==="static";)n=N_(n);return n&&(sa(n)==="html"||sa(n)==="body"&&getComputedStyle(n).position==="static"&&!zR(n))?t:n||Age(e)||t}function $_(e){if(_i(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=la(e);return{width:t.width,height:t.height}}function Tge(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=_i(n),i=gs(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&r!=="fixed")&&((sa(n)!=="body"||Cg(i))&&(a=_g(n)),_i(n))){const c=la(n,!0);l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}}function Ige(e,t){const n=fa(e),r=gs(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const d=BR();(d||!d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function Oge(e){var t;const n=gs(e),r=_g(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Id(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Id(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+VR(e);const c=-r.scrollTop;return ep(o||n).direction==="rtl"&&(l+=Id(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:c}}function UR(e){const t=WR(e);return["html","body","#document"].includes(sa(t))?e.ownerDocument.body:_i(t)&&Cg(t)?t:UR(t)}function J0(e,t){var n;t===void 0&&(t=[]);const r=UR(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=fa(r),a=o?[i].concat(i.visualViewport||[],Cg(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(J0(a))}function Rge(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f6(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Mge(e,t){const n=la(e,!1,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function D_(e,t,n){return t==="viewport"?q0(Ige(e,n)):us(t)?Mge(t,n):q0(Oge(gs(e)))}function Nge(e){const t=J0(e),r=["absolute","fixed"].includes(ep(e).position)&&_i(e)?i3(e):e;return us(r)?t.filter(o=>us(o)&&Rge(o,r)&&sa(o)!=="body"):[]}function $ge(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Nge(t):[].concat(n),r],l=a[0],c=a.reduce((d,f)=>{const p=D_(t,f,o);return d.top=Id(p.top,d.top),d.right=M_(p.right,d.right),d.bottom=M_(p.bottom,d.bottom),d.left=Id(p.left,d.left),d},D_(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}const Dge={getClippingRect:$ge,convertOffsetParentRelativeRectToViewportRelativeRect:Tge,isElement:us,getDimensions:$_,getOffsetParent:i3,getDocumentElement:gs,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Pge(t,i3(n),r),floating:{...$_(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ep(e).direction==="rtl"};function Fge(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:l=!1}=r,c=o&&!l,d=i&&!l,f=c||d?[...us(e)?J0(e):[],...J0(t)]:[];f.forEach(b=>{c&&b.addEventListener("scroll",n,{passive:!0}),d&&b.addEventListener("resize",n)});let p=null;if(a){let b=!0;p=new ResizeObserver(()=>{b||n(),b=!1}),us(e)&&!l&&p.observe(e),p.observe(t)}let m,g=l?la(e):null;l&&y();function y(){const b=la(e);g&&(b.x!==g.x||b.y!==g.y||b.width!==g.width||b.height!==g.height)&&n(),g=b,m=requestAnimationFrame(y)}return n(),()=>{var b;f.forEach(k=>{c&&k.removeEventListener("scroll",n),d&&k.removeEventListener("resize",n)}),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const zge=(e,t,n)=>cge(e,t,{platform:Dge,...n});var a3=typeof document<"u"?v.exports.useLayoutEffect:v.exports.useEffect;function s3(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(!s3(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!s3(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Bge(e){const t=v.exports.useRef(e);return a3(()=>{t.current=e}),t}function Vge(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:o}=e===void 0?{}:e;const i=v.exports.useRef(null),a=v.exports.useRef(null),l=Bge(o),c=v.exports.useRef(null),[d,f]=v.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[p,m]=v.exports.useState(t);s3(p?.map(_=>{let{options:E}=_;return E}),t?.map(_=>{let{options:E}=_;return E}))||m(t);const g=v.exports.useCallback(()=>{!i.current||!a.current||zge(i.current,a.current,{middleware:p,placement:n,strategy:r}).then(_=>{y.current&&ua.exports.flushSync(()=>{f(_)})})},[p,n,r]);a3(()=>{y.current&&g()},[g]);const y=v.exports.useRef(!1);a3(()=>(y.current=!0,()=>{y.current=!1}),[]);const b=v.exports.useCallback(()=>{if(typeof c.current=="function"&&(c.current(),c.current=null),i.current&&a.current)if(l.current){const _=l.current(i.current,a.current,g);c.current=_}else g()},[g,l]),k=v.exports.useCallback(_=>{i.current=_,b()},[b]),C=v.exports.useCallback(_=>{a.current=_,b()},[b]),S=v.exports.useMemo(()=>({reference:i,floating:a}),[]);return v.exports.useMemo(()=>({...d,update:g,refs:S,reference:k,floating:C}),[d,g,S,k,C])}const Wge=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?T_({element:t.current,padding:n}).fn(o):{}:t?T_({element:t,padding:n}).fn(o):{}}}};function Uge(e){const[t,n]=v.exports.useState(void 0);return Gu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,l=d.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const HR="Popper",[p6,jR]=Jf(HR),[Hge,GR]=p6(HR),jge=e=>{const{__scopePopper:t,children:n}=e,[r,o]=v.exports.useState(null);return v.exports.createElement(Hge,{scope:t,anchor:r,onAnchorChange:o},n)},Gge="PopperAnchor",Zge=v.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=GR(Gge,n),a=v.exports.useRef(null),l=yo(t,a);return v.exports.useEffect(()=>{i.onAnchorChange(r?.current||a.current)}),r?null:v.exports.createElement(aa.div,Ot({},o,{ref:l}))}),em="PopperContent",[Kge,X2e]=p6(em),[qge,Yge]=p6(em,{hasParent:!1,positionUpdateFns:new Set}),Xge=v.exports.forwardRef((e,t)=>{var n,r,o,i,a,l,c,d;const{__scopePopper:f,side:p="bottom",sideOffset:m=0,align:g="center",alignOffset:y=0,arrowPadding:b=0,collisionBoundary:k=[],collisionPadding:C=0,sticky:S="partial",hideWhenDetached:_=!1,avoidCollisions:E=!0,...A}=e,R=GR(em,f),[O,$]=v.exports.useState(null),H=yo(t,Je=>$(Je)),[z,X]=v.exports.useState(null),he=Uge(z),ye=(n=he?.width)!==null&&n!==void 0?n:0,oe=(r=he?.height)!==null&&r!==void 0?r:0,pe=p+(g!=="center"?"-"+g:""),ge=typeof C=="number"?C:{top:0,right:0,bottom:0,left:0,...C},J=Array.isArray(k)?k:[k],D=J.length>0,Z={padding:ge,boundary:J.filter(Jge),altBoundary:D},{reference:j,floating:M,strategy:G,x:le,y:ce,placement:be,middlewareData:me,update:_e}=Vge({strategy:"fixed",placement:pe,whileElementsMounted:Fge,middleware:[Sge({mainAxis:m+oe,alignmentAxis:y}),E?Cge({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?_ge():void 0,...Z}):void 0,z?Wge({element:z,padding:b}):void 0,E?bge({...Z}):void 0,eve({arrowWidth:ye,arrowHeight:oe}),_?xge({strategy:"referenceHidden"}):void 0].filter(Qge)});Gu(()=>{j(R.anchor)},[j,R.anchor]);const ue=le!==null&&ce!==null,[we,$e]=ZR(be),rt=(o=me.arrow)===null||o===void 0?void 0:o.x,Ct=(i=me.arrow)===null||i===void 0?void 0:i.y,un=((a=me.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Se,Ie]=v.exports.useState();Gu(()=>{O&&Ie(window.getComputedStyle(O).zIndex)},[O]);const{hasParent:Qe,positionUpdateFns:Oe}=Yge(em,f),ft=!Qe;v.exports.useLayoutEffect(()=>{if(!ft)return Oe.add(_e),()=>{Oe.delete(_e)}},[ft,Oe,_e]),v.exports.useLayoutEffect(()=>{ft&&ue&&Array.from(Oe).reverse().forEach(Je=>requestAnimationFrame(Je))},[ft,ue,Oe]);const tn={"data-side":we,"data-align":$e,...A,ref:H,style:{...A.style,animation:ue?void 0:"none",opacity:(l=me.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}};return v.exports.createElement("div",{ref:M,"data-radix-popper-content-wrapper":"",style:{position:G,left:0,top:0,transform:ue?`translate3d(${Math.round(le)}px, ${Math.round(ce)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Se,["--radix-popper-transform-origin"]:[(c=me.transformOrigin)===null||c===void 0?void 0:c.x,(d=me.transformOrigin)===null||d===void 0?void 0:d.y].join(" ")}},v.exports.createElement(Kge,{scope:f,placedSide:we,onArrowChange:X,arrowX:rt,arrowY:Ct,shouldHideArrow:un},ft?v.exports.createElement(qge,{scope:f,hasParent:!0,positionUpdateFns:Oe},v.exports.createElement(aa.div,tn)):v.exports.createElement(aa.div,tn)))});function Qge(e){return e!==void 0}function Jge(e){return e!==null}const eve=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:l,rects:c,middlewareData:d}=t,p=((n=d.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=p?0:e.arrowWidth,g=p?0:e.arrowHeight,[y,b]=ZR(l),k={start:"0%",center:"50%",end:"100%"}[b],C=((r=(o=d.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+m/2,S=((i=(a=d.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+g/2;let _="",E="";return y==="bottom"?(_=p?k:`${C}px`,E=`${-g}px`):y==="top"?(_=p?k:`${C}px`,E=`${c.floating.height+g}px`):y==="right"?(_=`${-g}px`,E=p?k:`${S}px`):y==="left"&&(_=`${c.floating.width+g}px`,E=p?k:`${S}px`),{data:{x:_,y:E}}}});function ZR(e){const[t,n="center"]=e.split("-");return[t,n]}const tve=jge,nve=Zge,rve=Xge;function ove(e,t){return v.exports.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const KR=e=>{const{present:t,children:n}=e,r=ive(t),o=typeof n=="function"?n({present:r.isPresent}):v.exports.Children.only(n),i=yo(r.ref,o.ref);return typeof n=="function"||r.isPresent?v.exports.cloneElement(o,{ref:i}):null};KR.displayName="Presence";function ive(e){const[t,n]=v.exports.useState(),r=v.exports.useRef({}),o=v.exports.useRef(e),i=v.exports.useRef("none"),a=e?"mounted":"unmounted",[l,c]=ove(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.exports.useEffect(()=>{const d=t1(r.current);i.current=l==="mounted"?d:"none"},[l]),Gu(()=>{const d=r.current,f=o.current;if(f!==e){const m=i.current,g=t1(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Gu(()=>{if(t){const d=p=>{const g=t1(r.current).includes(p.animationName);p.target===t&&g&&ua.exports.flushSync(()=>c("ANIMATION_END"))},f=p=>{p.target===t&&(i.current=t1(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:v.exports.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function t1(e){return e?.animationName||"none"}function ave({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=sve({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,l=Ci(n),c=v.exports.useCallback(d=>{if(i){const p=typeof d=="function"?d(e):d;p!==e&&l(p)}else o(d)},[i,e,o,l]);return[a,c]}function sve({defaultProp:e,onChange:t}){const n=v.exports.useState(e),[r]=n,o=v.exports.useRef(r),i=Ci(t);return v.exports.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Oy="rovingFocusGroup.onEntryFocus",lve={bubbles:!1,cancelable:!0},h6="RovingFocusGroup",[l3,qR,uve]=IR(h6),[cve,YR]=Jf(h6,[uve]),[dve,fve]=cve(h6),pve=v.exports.forwardRef((e,t)=>v.exports.createElement(l3.Provider,{scope:e.__scopeRovingFocusGroup},v.exports.createElement(l3.Slot,{scope:e.__scopeRovingFocusGroup},v.exports.createElement(hve,Ot({},e,{ref:t}))))),hve=v.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,...f}=e,p=v.exports.useRef(null),m=yo(t,p),g=OR(i),[y=null,b]=ave({prop:a,defaultProp:l,onChange:c}),[k,C]=v.exports.useState(!1),S=Ci(d),_=qR(n),E=v.exports.useRef(!1),[A,R]=v.exports.useState(0);return v.exports.useEffect(()=>{const O=p.current;if(O)return O.addEventListener(Oy,S),()=>O.removeEventListener(Oy,S)},[S]),v.exports.createElement(dve,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:y,onItemFocus:v.exports.useCallback(O=>b(O),[b]),onItemShiftTab:v.exports.useCallback(()=>C(!0),[]),onFocusableItemAdd:v.exports.useCallback(()=>R(O=>O+1),[]),onFocusableItemRemove:v.exports.useCallback(()=>R(O=>O-1),[])},v.exports.createElement(aa.div,Ot({tabIndex:k||A===0?-1:0,"data-orientation":r},f,{ref:m,style:{outline:"none",...e.style},onMouseDown:It(e.onMouseDown,()=>{E.current=!0}),onFocus:It(e.onFocus,O=>{const $=!E.current;if(O.target===O.currentTarget&&$&&!k){const H=new CustomEvent(Oy,lve);if(O.currentTarget.dispatchEvent(H),!H.defaultPrevented){const z=_().filter(pe=>pe.focusable),X=z.find(pe=>pe.active),he=z.find(pe=>pe.id===y),oe=[X,he,...z].filter(Boolean).map(pe=>pe.ref.current);XR(oe)}}E.current=!1}),onBlur:It(e.onBlur,()=>C(!1))})))}),mve="RovingFocusGroupItem",gve=v.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...i}=e,a=uge(),l=fve(mve,n),c=l.currentTabStopId===a,d=qR(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return v.exports.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),v.exports.createElement(l3.ItemSlot,{scope:n,id:a,focusable:r,active:o},v.exports.createElement(aa.span,Ot({tabIndex:c?0:-1,"data-orientation":l.orientation},i,{ref:t,onMouseDown:It(e.onMouseDown,m=>{r?l.onItemFocus(a):m.preventDefault()}),onFocus:It(e.onFocus,()=>l.onItemFocus(a)),onKeyDown:It(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=bve(m,l.orientation,l.dir);if(g!==void 0){m.preventDefault();let b=d().filter(k=>k.focusable).map(k=>k.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();const k=b.indexOf(m.currentTarget);b=l.loop?xve(b,k+1):b.slice(k+1)}setTimeout(()=>XR(b))}})})))}),vve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yve(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bve(e,t,n){const r=yve(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return vve[r]}function XR(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xve(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const wve=pve,Sve=gve,Cve=["Enter"," "],_ve=["ArrowDown","PageUp","Home"],QR=["ArrowUp","PageDown","End"],kve=[..._ve,...QR],kg="Menu",[u3,Eve,Lve]=IR(kg),[pl,JR]=Jf(kg,[Lve,jR,YR]),m6=jR(),eM=YR(),[Pve,Eg]=pl(kg),[Ave,g6]=pl(kg),Tve=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,l=m6(t),[c,d]=v.exports.useState(null),f=v.exports.useRef(!1),p=Ci(i),m=OR(o);return v.exports.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),v.exports.createElement(tve,l,v.exports.createElement(Pve,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:d},v.exports.createElement(Ave,{scope:t,onClose:v.exports.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:a},r)))},Ive=v.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=m6(n);return v.exports.createElement(nve,Ot({},o,r,{ref:t}))}),Ove="MenuPortal",[Q2e,Rve]=pl(Ove,{forceMount:void 0}),es="MenuContent",[Mve,tM]=pl(es),Nve=v.exports.forwardRef((e,t)=>{const n=Rve(es,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Eg(es,e.__scopeMenu),a=g6(es,e.__scopeMenu);return v.exports.createElement(u3.Provider,{scope:e.__scopeMenu},v.exports.createElement(KR,{present:r||i.open},v.exports.createElement(u3.Slot,{scope:e.__scopeMenu},a.modal?v.exports.createElement($ve,Ot({},o,{ref:t})):v.exports.createElement(Dve,Ot({},o,{ref:t})))))}),$ve=v.exports.forwardRef((e,t)=>{const n=Eg(es,e.__scopeMenu),r=v.exports.useRef(null),o=yo(t,r);return v.exports.useEffect(()=>{const i=r.current;if(i)return dT(i)},[]),v.exports.createElement(nM,Ot({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:It(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),Dve=v.exports.forwardRef((e,t)=>{const n=Eg(es,e.__scopeMenu);return v.exports.createElement(nM,Ot({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),nM=v.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...y}=e,b=Eg(es,n),k=g6(es,n),C=m6(n),S=eM(n),_=Eve(n),[E,A]=v.exports.useState(null),R=v.exports.useRef(null),O=yo(t,R,b.onContentChange),$=v.exports.useRef(0),H=v.exports.useRef(""),z=v.exports.useRef(0),X=v.exports.useRef(null),he=v.exports.useRef("right"),ye=v.exports.useRef(0),oe=g?YT:v.exports.Fragment,pe=g?{as:Cf,allowPinchZoom:!0}:void 0,ge=D=>{var Z,j;const M=H.current+D,G=_().filter(ue=>!ue.disabled),le=document.activeElement,ce=(Z=G.find(ue=>ue.ref.current===le))===null||Z===void 0?void 0:Z.textValue,be=G.map(ue=>ue.textValue),me=Gve(be,M,ce),_e=(j=G.find(ue=>ue.textValue===me))===null||j===void 0?void 0:j.ref.current;(function ue(we){H.current=we,window.clearTimeout($.current),we!==""&&($.current=window.setTimeout(()=>ue(""),1e3))})(M),_e&&setTimeout(()=>_e.focus())};v.exports.useEffect(()=>()=>window.clearTimeout($.current),[]),Jme();const J=v.exports.useCallback(D=>{var Z,j;return he.current===((Z=X.current)===null||Z===void 0?void 0:Z.side)&&Kve(D,(j=X.current)===null||j===void 0?void 0:j.area)},[]);return v.exports.createElement(Mve,{scope:n,searchRef:H,onItemEnter:v.exports.useCallback(D=>{J(D)&&D.preventDefault()},[J]),onItemLeave:v.exports.useCallback(D=>{var Z;J(D)||((Z=R.current)===null||Z===void 0||Z.focus(),A(null))},[J]),onTriggerLeave:v.exports.useCallback(D=>{J(D)&&D.preventDefault()},[J]),pointerGraceTimerRef:z,onPointerGraceIntentChange:v.exports.useCallback(D=>{X.current=D},[])},v.exports.createElement(oe,pe,v.exports.createElement(ege,{asChild:!0,trapped:o,onMountAutoFocus:It(i,D=>{var Z;D.preventDefault(),(Z=R.current)===null||Z===void 0||Z.focus()}),onUnmountAutoFocus:a},v.exports.createElement(Yme,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m},v.exports.createElement(wve,Ot({asChild:!0},S,{dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:A,onEntryFocus:D=>{k.isUsingKeyboardRef.current||D.preventDefault()}}),v.exports.createElement(rve,Ot({role:"menu","aria-orientation":"vertical","data-state":Uve(b.open),"data-radix-menu-content":"",dir:k.dir},C,y,{ref:O,style:{outline:"none",...y.style},onKeyDown:It(y.onKeyDown,D=>{const j=D.target.closest("[data-radix-menu-content]")===D.currentTarget,M=D.ctrlKey||D.altKey||D.metaKey,G=D.key.length===1;j&&(D.key==="Tab"&&D.preventDefault(),!M&&G&&ge(D.key));const le=R.current;if(D.target!==le||!kve.includes(D.key))return;D.preventDefault();const be=_().filter(me=>!me.disabled).map(me=>me.ref.current);QR.includes(D.key)&&be.reverse(),Hve(be)}),onBlur:It(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout($.current),H.current="")}),onPointerMove:It(e.onPointerMove,d3(D=>{const Z=D.target,j=ye.current!==D.clientX;if(D.currentTarget.contains(Z)&&j){const M=D.clientX>ye.current?"right":"left";he.current=M,ye.current=D.clientX}}))})))))))}),c3="MenuItem",F_="menu.itemSelect",Fve=v.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=v.exports.useRef(null),a=g6(c3,e.__scopeMenu),l=tM(c3,e.__scopeMenu),c=yo(t,i),d=v.exports.useRef(!1),f=()=>{const p=i.current;if(!n&&p){const m=new CustomEvent(F_,{bubbles:!0,cancelable:!0});p.addEventListener(F_,g=>r?.(g),{once:!0}),TR(p,m),m.defaultPrevented?d.current=!1:a.onClose()}};return v.exports.createElement(zve,Ot({},o,{ref:c,disabled:n,onClick:It(e.onClick,f),onPointerDown:p=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,p),d.current=!0},onPointerUp:It(e.onPointerUp,p=>{var m;d.current||(m=p.currentTarget)===null||m===void 0||m.click()}),onKeyDown:It(e.onKeyDown,p=>{const m=l.searchRef.current!=="";n||m&&p.key===" "||Cve.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),zve=v.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=tM(c3,n),l=eM(n),c=v.exports.useRef(null),d=yo(t,c),[f,p]=v.exports.useState(!1),[m,g]=v.exports.useState("");return v.exports.useEffect(()=>{const y=c.current;if(y){var b;g(((b=y.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),v.exports.createElement(u3.ItemSlot,{scope:n,disabled:r,textValue:o??m},v.exports.createElement(Sve,Ot({asChild:!0},l,{focusable:!r}),v.exports.createElement(aa.div,Ot({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:d,onPointerMove:It(e.onPointerMove,d3(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus())})),onPointerLeave:It(e.onPointerLeave,d3(y=>a.onItemLeave(y))),onFocus:It(e.onFocus,()=>p(!0)),onBlur:It(e.onBlur,()=>p(!1))}))))}),Bve="MenuRadioGroup";pl(Bve,{value:void 0,onValueChange:()=>{}});const Vve="MenuItemIndicator";pl(Vve,{checked:!1});const Wve="MenuSub";pl(Wve);function Uve(e){return e?"open":"closed"}function Hve(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jve(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Gve(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=jve(e,Math.max(i,0));o.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Zve(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=f>r&&n<(d-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function Kve(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Zve(n,t)}function d3(e){return t=>t.pointerType==="mouse"?e(t):void 0}const qve=Tve,Yve=Ive,Xve=Nve,Qve=Fve,rM="ContextMenu",[Jve,J2e]=Jf(rM,[JR]),Lg=JR(),[e2e,oM]=Jve(rM),t2e=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[a,l]=v.exports.useState(!1),c=Lg(t),d=Ci(r),f=v.exports.useCallback(p=>{l(p),d(p)},[d]);return v.exports.createElement(e2e,{scope:t,open:a,onOpenChange:f,modal:i},v.exports.createElement(qve,Ot({},c,{dir:o,open:a,onOpenChange:f,modal:i}),n))},n2e="ContextMenuTrigger",r2e=v.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=oM(n2e,n),i=Lg(n),a=v.exports.useRef({x:0,y:0}),l=v.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),c=v.exports.useRef(0),d=v.exports.useCallback(()=>window.clearTimeout(c.current),[]),f=p=>{a.current={x:p.clientX,y:p.clientY},o.onOpenChange(!0)};return v.exports.useEffect(()=>d,[d]),v.exports.createElement(v.exports.Fragment,null,v.exports.createElement(Yve,Ot({},i,{virtualRef:l})),v.exports.createElement(aa.span,Ot({"data-state":o.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:It(e.onContextMenu,p=>{d(),f(p),p.preventDefault()}),onPointerDown:It(e.onPointerDown,n1(p=>{d(),c.current=window.setTimeout(()=>f(p),700)})),onPointerMove:It(e.onPointerMove,n1(d)),onPointerCancel:It(e.onPointerCancel,n1(d)),onPointerUp:It(e.onPointerUp,n1(d))})))}),o2e="ContextMenuContent",i2e=v.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=oM(o2e,n),i=Lg(n),a=v.exports.useRef(!1);return v.exports.createElement(Xve,Ot({},i,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{var c;(c=e.onCloseAutoFocus)===null||c===void 0||c.call(e,l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{var c;(c=e.onInteractOutside)===null||c===void 0||c.call(e,l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),a2e=v.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lg(n);return v.exports.createElement(Qve,Ot({},o,r,{ref:t}))});function n1(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const s2e=t2e,l2e=r2e,u2e=i2e,Zl=a2e,c2e=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,d2e=v.exports.memo(e=>{const t=Ue(),n=Ee(_=>_.options.activeTab),[r,o]=v.exports.useState(!1),i=qf(),{image:a,isSelected:l}=e,{url:c,uuid:d,metadata:f}=a,p=()=>o(!0),m=()=>o(!1),g=()=>{t(e6(a.metadata.image.prompt)),i({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})},y=()=>{t(Yf(a.metadata.image.seed)),i({title:"Seed Set",status:"success",duration:2500,isClosable:!0})},b=()=>{t(nl(a.url)),n!==1&&t(ni(1)),i({title:"Sent to Image To Image",status:"success",duration:2500,isClosable:!0})},k=()=>{t(Tpe(f)),i({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})},C=async()=>{if(f?.image?.init_image_path&&(await fetch(f.image.init_image_path)).ok){t(ni(v6.indexOf("img2img"))),t(Ipe(f)),i({title:"Initial Image Set",status:"success",duration:2500,isClosable:!0});return}i({title:"Initial Image Not Set",description:"Could not load initial image.",status:"error",duration:2500,isClosable:!0})};return Y(s2e,{children:[x(l2e,{children:Y(mo,{position:"relative",className:"hoverable-image",onMouseOver:p,onMouseOut:m,children:[x(Xm,{className:"hoverable-image-image",objectFit:"cover",rounded:"md",src:c,loading:"lazy"}),x("div",{className:"hoverable-image-content",onClick:()=>t(Npe(a)),children:l&&x(Yr,{width:"50%",height:"50%",as:S0e,className:"hoverable-image-check"})}),r&&x("div",{className:"hoverable-image-delete-button",children:x(ir,{label:"Delete image",hasArrow:!0,children:x(t3,{image:a,children:x(Nn,{"aria-label":"Delete image",icon:x(P0e,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14})})})})]},d)}),Y(u2e,{className:"hoverable-image-context-menu",children:[x(Zl,{onClickCapture:g,disabled:a?.metadata?.image?.prompt===void 0,children:"Use Prompt"}),x(Zl,{onClickCapture:y,disabled:a?.metadata?.image?.seed===void 0,children:"Use Seed"}),x(Zl,{onClickCapture:k,disabled:!["txt2img","img2img"].includes(a?.metadata?.image?.type),children:"Use All Parameters"}),x(ir,{label:"Load initial image used for this generation",children:x(Zl,{onClickCapture:C,disabled:a?.metadata?.image?.type!=="img2img",children:"Use Initial Image"})}),x(Zl,{onClickCapture:b,children:"Send to Image To Image"}),x(t3,{image:a,children:x(Zl,{"data-warning":!0,children:"Delete Image"})})]})]})},c2e);function iM(){const{images:e,currentImageUuid:t,areMoreImagesAvailable:n}=Ee(d=>d.gallery),r=Ee(d=>d.options.shouldShowGallery),o=Ee(d=>d.options.activeTab),i=Ue(),a=()=>{i(NC(!r))},l=()=>{i(NC(!1))},c=()=>{i(WO())};return sn("g",()=>{a()},[r]),sn("left",()=>{i(_O())},[]),sn("right",()=>{i(CO())},[]),Y("div",{className:"image-gallery-area",children:[!r&&x(Ns,{tooltip:"Show Gallery",tooltipPlacement:"top","aria-label":"Show Gallery",onClick:a,className:"image-gallery-popup-btn",children:x(n_,{})}),r&&Y(PR,{defaultSize:{width:"300",height:"100%"},minWidth:"300",maxWidth:o==1?"300":"600",className:"image-gallery-popup",children:[Y("div",{className:"image-gallery-header",children:[x("h1",{children:"Your Invocations"}),x(Nn,{size:"sm","aria-label":"Close Gallery",onClick:l,className:"image-gallery-close-btn",icon:x(aR,{})})]}),Y("div",{className:"image-gallery-container",children:[e.length?x("div",{className:"image-gallery",children:e.map(d=>{const{uuid:f}=d;return x(d2e,{image:d,isSelected:t===f},f)})}):Y("div",{className:"image-gallery-container-placeholder",children:[x(n_,{}),x("p",{children:"No Images In Gallery"})]}),x(xi,{onClick:c,isDisabled:!n,className:"image-gallery-load-more-btn",children:n?"Load More":"All Images Loaded"})]})]})]})}function f2e(){const e=Ee(t=>t.options.shouldShowGallery);return Y("div",{className:"image-to-image-workarea",children:[x(g0e,{}),Y("div",{className:"image-to-image-display-area",style:e?{gridTemplateColumns:"auto max-content"}:{gridTemplateColumns:"auto"},children:[x(Tme,{}),x(iM,{})]})]})}function p2e(){const e=Ee(n=>n.options.showAdvancedOptions),t={seed:{header:x(mo,{flex:"1",textAlign:"left",children:"Seed"}),feature:Fo.SEED,options:x(XO,{})},variations:{header:x(JO,{}),feature:Fo.VARIATIONS,options:x(eR,{})},face_restore:{header:x(YO,{}),feature:Fo.FACE_CORRECTION,options:x(a6,{})},upscale:{header:x(QO,{}),feature:Fo.UPSCALE,options:x(s6,{})},other:{header:x(mo,{flex:"1",textAlign:"left",children:"Other"}),feature:Fo.OTHER,options:x(lR,{})}};return Y("div",{className:"text-to-image-panel",children:[x(dR,{}),x(cR,{}),x(nR,{}),x(tR,{}),e?x(sR,{accordionInfo:t}):null]})}const h2e=()=>{const{currentImage:e,intermediateImage:t}=Ee(o=>o.gallery),n=Ee(o=>o.options.shouldShowImageDetails),r=t||e;return r?Y("div",{className:"current-image-display",children:[x("div",{className:"current-image-tools",children:x(CR,{image:r})}),x(_R,{imageToDisplay:r}),n&&x(LR,{image:r,styleClass:"current-image-metadata"})]}):x("div",{className:"current-image-display-placeholder",children:x(i0e,{})})};function m2e(){const e=Ee(t=>t.options.shouldShowGallery);return Y("div",{className:"text-to-image-workarea",children:[x(p2e,{}),Y("div",{className:"text-to-image-display",style:e?{gridTemplateColumns:"auto max-content"}:{gridTemplateColumns:"auto"},children:[x(h2e,{}),x(iM,{})]})]})}const ql={txt2img:{title:x(L1e,{fill:"black",boxSize:"2.5rem"}),panel:x(m2e,{}),tooltip:"Text To Image"},img2img:{title:x(S1e,{fill:"black",boxSize:"2.5rem"}),panel:x(f2e,{}),tooltip:"Image To Image"},inpainting:{title:x(C1e,{fill:"black",boxSize:"2.5rem"}),panel:x(y1e,{}),tooltip:"Inpainting"},outpainting:{title:x(k1e,{fill:"black",boxSize:"2.5rem"}),panel:x(x1e,{}),tooltip:"Outpainting"},nodes:{title:x(_1e,{fill:"black",boxSize:"2.5rem"}),panel:x(b1e,{}),tooltip:"Nodes"},postprocess:{title:x(E1e,{fill:"black",boxSize:"2.5rem"}),panel:x(w1e,{}),tooltip:"Post Processing"}},v6=xf.map(ql,(e,t)=>t);[...v6];function g2e(){const e=Ee(o=>o.options.activeTab),t=Ue();sn("1",()=>{t(ni(0))}),sn("2",()=>{t(ni(1))}),sn("3",()=>{t(ni(2))}),sn("4",()=>{t(ni(3))}),sn("5",()=>{t(ni(4))}),sn("6",()=>{t(ni(5))});const n=()=>{const o=[];return Object.keys(ql).forEach(i=>{o.push(x(ir,{hasArrow:!0,label:ql[i].tooltip,placement:"right",children:x(gI,{children:ql[i].title})},i))}),o},r=()=>{const o=[];return Object.keys(ql).forEach(i=>{o.push(x(hI,{className:"app-tabs-panel",children:ql[i].panel},i))}),o};return Y(pI,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{t(ni(o))},children:[x("div",{className:"app-tabs-list",children:n()}),x(mI,{className:"app-tabs-panels",children:r()})]})}const v2e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:()=>{n(M1(!0));const o={...r().options};v6[o.activeTab]!=="img2img"&&(o.shouldUseInitImage=!1);const{generationParameters:i,esrganParameters:a,facetoolParameters:l}=a1e(o,r().system);t.emit("generateImage",i,a,l),n(vr({timestamp:yr(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...i,...a,...l})}`}))},emitRunESRGAN:o=>{n(M1(!0));const{upscalingLevel:i,upscalingStrength:a}=r().options,l={upscale:[i,a]};t.emit("runPostprocessing",o,{type:"esrgan",...l}),n(vr({timestamp:yr(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:o.url,...l})}`}))},emitRunFacetool:o=>{n(M1(!0));const{facetoolType:i,facetoolStrength:a,codeformerFidelity:l}=r().options,c={facetool_strength:a};i==="codeformer"&&(c.codeformer_fidelity=l),t.emit("runPostprocessing",o,{type:i,...c}),n(vr({timestamp:yr(new Date,"isoDateTime"),message:`Face restoration (${i}) requested: ${JSON.stringify({file:o.url,...c})}`}))},emitDeleteImage:o=>{const{url:i,uuid:a}=o;t.emit("deleteImage",i,a)},emitRequestImages:()=>{const{earliest_mtime:o}=r().gallery;t.emit("requestImages",o)},emitRequestNewImages:()=>{const{latest_mtime:o}=r().gallery;t.emit("requestLatestImages",o)},emitCancelProcessing:()=>{t.emit("cancel")},emitUploadInitialImage:o=>{t.emit("uploadInitialImage",o,o.name)},emitUploadMaskImage:o=>{t.emit("uploadMaskImage",o,o.name)},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")}}},y2e=()=>{const{origin:e}=new URL(window.location.href),t=D1(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return o=>i=>a=>{const{onConnect:l,onDisconnect:c,onError:d,onPostprocessingResult:f,onGenerationResult:p,onIntermediateResult:m,onProgressUpdate:g,onGalleryImages:y,onProcessingCanceled:b,onImageDeleted:k,onInitialImageUploaded:C,onMaskImageUploaded:S,onSystemConfig:_}=e1e(o),{emitGenerateImage:E,emitRunESRGAN:A,emitRunFacetool:R,emitDeleteImage:O,emitRequestImages:$,emitRequestNewImages:H,emitCancelProcessing:z,emitUploadInitialImage:X,emitUploadMaskImage:he,emitRequestSystemConfig:ye}=v2e(o,t);switch(n||(t.on("connect",()=>l()),t.on("disconnect",()=>c()),t.on("error",oe=>d(oe)),t.on("generationResult",oe=>p(oe)),t.on("postprocessingResult",oe=>f(oe)),t.on("intermediateResult",oe=>m(oe)),t.on("progressUpdate",oe=>g(oe)),t.on("galleryImages",oe=>y(oe)),t.on("processingCanceled",()=>{b()}),t.on("imageDeleted",oe=>{k(oe)}),t.on("initialImageUploaded",oe=>{C(oe)}),t.on("maskImageUploaded",oe=>{S(oe)}),t.on("systemConfig",oe=>{_(oe)}),n=!0),a.type){case"socketio/generateImage":{E();break}case"socketio/runESRGAN":{A(a.payload);break}case"socketio/runFacetool":{R(a.payload);break}case"socketio/deleteImage":{O(a.payload);break}case"socketio/requestImages":{$();break}case"socketio/requestNewImages":{H();break}case"socketio/cancelProcessing":{z();break}case"socketio/uploadInitialImage":{X(a.payload);break}case"socketio/uploadMaskImage":{he(a.payload);break}case"socketio/requestSystemConfig":{ye();break}}i(a)}},b2e={key:"root",storage:Qx,blacklist:["gallery","system"]},x2e={key:"system",storage:Qx,blacklist:["isConnected","isProcessing","currentStep","socketId","isESRGANAvailable","isGFPGANAvailable","currentStep","totalSteps","currentIteration","totalIterations","currentStatus"]},w2e=UI({options:Ope,gallery:Fpe,system:sO(x2e,Kpe)}),S2e=sO(b2e,w2e),aM=tfe({reducer:S2e,middleware:e=>e({serializableCheck:!1}).concat(y2e())}),Ue=Bfe,Ee=Afe;function F1(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F1=function(n){return typeof n}:F1=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},F1(e)}function C2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z_(e,t){for(var n=0;n({textColor:e.colorMode==="dark"?"gray.800":"gray.100"})},Accordion:{baseStyle:e=>({button:{fontWeight:"bold",_hover:{bgColor:e.colorMode==="dark"?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"}},panel:{paddingBottom:2}})},FormLabel:{baseStyle:{fontWeight:"light"}},Button:{variants:{imageHoverIconButton:e=>({bg:e.colorMode==="dark"?"blackAlpha.700":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.700":"blackAlpha.700",_hover:{bg:e.colorMode==="dark"?"blackAlpha.800":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.900":"blackAlpha.900"}})}}}}),lM=()=>x(Lt,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:x(qm,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),L2e=Yn(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),P2e=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=Ee(L2e),o=t?Math.round(t*100/n):0;return x(aI,{height:"4px",value:o,isIndeterminate:e&&!r,className:"progress-bar"})},A2e=""+new URL("logo.13003d72.png",import.meta.url).href;function T2e(e){const{title:t,hotkey:n,description:r}=e;return Y("div",{className:"hotkey-modal-item",children:[Y("div",{className:"hotkey-info",children:[x("p",{className:"hotkey-title",children:t}),r&&x("p",{className:"hotkey-description",children:r})]}),x("div",{className:"hotkey-key",children:n})]})}function I2e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=T0(),o=[{title:"Invoke",desc:"Generate an image",hotkey:"Ctrl+Enter"},{title:"Cancel",desc:"Cancel image generation",hotkey:"Shift+X"},{title:"Toggle Gallery",desc:"Open and close the gallery drawer",hotkey:"G"},{title:"Set Seed",desc:"Use the seed of the current image",hotkey:"S"},{title:"Set Parameters",desc:"Use all parameters of the current image",hotkey:"A"},{title:"Restore Faces",desc:"Restore the current image",hotkey:"R"},{title:"Upscale",desc:"Upscale the current image",hotkey:"U"},{title:"Show Info",desc:"Show metadata info of the current image",hotkey:"I"},{title:"Send To Image To Image",desc:"Send the current image to Image to Image module",hotkey:"Shift+I"},{title:"Delete Image",desc:"Delete the current image",hotkey:"Del"},{title:"Focus Prompt",desc:"Focus the prompt input area",hotkey:"Alt+A"},{title:"Previous Image",desc:"Display the previous image in the gallery",hotkey:"Arrow left"},{title:"Next Image",desc:"Display the next image in the gallery",hotkey:"Arrow right"},{title:"Change Tabs",desc:"Switch to another workspace",hotkey:"1-6"},{title:"Theme Toggle",desc:"Switch between dark and light modes",hotkey:"Shift+D"},{title:"Console Toggle",desc:"Open and close console",hotkey:"`"}],i=()=>{const a=[];return o.forEach((l,c)=>{a.push(x(T2e,{title:l.title,description:l.desc,hotkey:l.hotkey},c))}),a};return Y(wn,{children:[v.exports.cloneElement(e,{onClick:n}),Y(Uu,{isOpen:t,onClose:r,children:[x(hf,{}),Y(pf,{className:"hotkeys-modal",children:[x(_x,{}),x("h1",{children:"Keyboard Shorcuts"}),x("div",{className:"hotkeys-modal-items",children:i()})]})]})]})}function Ry({settingTitle:e,isChecked:t,dispatcher:n}){const r=Ue();return Y(hs,{className:"settings-modal-item",children:[x(sl,{marginBottom:1,children:e}),x(ag,{isChecked:t,onChange:o=>r(n(o.target.checked))})]})}const O2e=Yn(e=>e.system,e=>{const{shouldDisplayInProgress:t,shouldConfirmOnDelete:n,shouldDisplayGuides:r}=e;return{shouldDisplayInProgress:t,shouldConfirmOnDelete:n,shouldDisplayGuides:r}},{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),R2e=({children:e})=>{const{isOpen:t,onOpen:n,onClose:r}=T0(),{isOpen:o,onOpen:i,onClose:a}=T0(),{shouldDisplayInProgress:l,shouldConfirmOnDelete:c,shouldDisplayGuides:d}=Ee(O2e),f=()=>{uM.purge().then(()=>{r(),i()})};return Y(wn,{children:[v.exports.cloneElement(e,{onClick:n}),Y(Uu,{isOpen:t,onClose:r,children:[x(hf,{}),Y(pf,{className:"settings-modal",children:[x(Ex,{className:"settings-modal-header",children:"Settings"}),x(_x,{}),Y(M0,{className:"settings-modal-content",children:[Y("div",{className:"settings-modal-items",children:[x(Ry,{settingTitle:"Display In-Progress Images (slower)",isChecked:l,dispatcher:Vpe}),x(Ry,{settingTitle:"Confirm on Delete",isChecked:c,dispatcher:EO}),x(Ry,{settingTitle:"Display Help Icons",isChecked:d,dispatcher:jpe})]}),Y("div",{className:"settings-modal-reset",children:[x(rx,{size:"md",children:"Reset Web UI"}),x(wr,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."}),x(wr,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."}),x(xi,{colorScheme:"red",onClick:f,children:"Reset Web UI"})]})]}),x(kx,{children:x(xi,{onClick:r,children:"Close"})})]})]}),Y(Uu,{closeOnOverlayClick:!1,isOpen:o,onClose:a,isCentered:!0,children:[x(hf,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),x(pf,{children:x(M0,{pb:6,pt:6,children:x(Lt,{justifyContent:"center",children:x(wr,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."})})})})]})]})},M2e=Yn(e=>e.system,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),N2e=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:i,wasErrorSeen:a}=Ee(M2e),l=Ue();let c;e&&!i?c="status-good":c="status-bad";let d=o;return["generating","preparing","saving image","restoring faces","upscaling"].includes(d.toLowerCase())&&(c="status-working"),d&&t&&r>1&&(d+=` (${n}/${r})`),x(ir,{label:i&&!a?"Click to clear, check logs for details":void 0,children:x(wr,{cursor:i&&!a?"pointer":"initial",onClick:()=>{(i||!a)&&l(LO())},className:`status ${c}`,children:d})})},$2e=()=>{const{colorMode:e,toggleColorMode:t}=ub();sn("shift+d",()=>{t()},[e,t]);const n=e=="light"?x(E0e,{}):x(L0e,{}),r=e=="light"?18:20;return Y("div",{className:"site-header",children:[Y("div",{className:"site-header-left-side",children:[x("img",{src:A2e,alt:"invoke-ai-logo"}),Y("h1",{children:["invoke ",x("strong",{children:"ai"})]})]}),Y("div",{className:"site-header-right-side",children:[x(N2e,{}),x(R2e,{children:x(Nn,{"aria-label":"Settings",variant:"link",fontSize:24,size:"sm",icon:x(t0e,{})})}),x(I2e,{children:x(Nn,{"aria-label":"Hotkeys",variant:"link",fontSize:24,size:"sm",icon:x(r0e,{})})}),x(ir,{hasArrow:!0,label:"Report Bug",placement:"bottom",children:x(Nn,{"aria-label":"Link to Github Issues",variant:"link",fontSize:23,size:"sm",icon:x(Cu,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:x(iR,{})})})}),x(ir,{hasArrow:!0,label:"Github",placement:"bottom",children:x(Nn,{"aria-label":"Link to Github Repo",variant:"link",fontSize:20,size:"sm",icon:x(Cu,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:x(y0e,{})})})}),x(ir,{hasArrow:!0,label:"Discord",placement:"bottom",children:x(Nn,{"aria-label":"Link to Discord Server",variant:"link",fontSize:20,size:"sm",icon:x(Cu,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:x(v0e,{})})})}),x(ir,{hasArrow:!0,label:"Theme",placement:"bottom",children:x(Nn,{"aria-label":"Toggle Dark Mode",onClick:t,variant:"link",size:"sm",fontSize:r,icon:n})})]})]})},D2e=Yn(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),F2e=Yn(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:qn.exports.isEqual}}),z2e=()=>{const e=Ue(),t=Ee(D2e),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=Ee(F2e),[i,a]=v.exports.useState(!0),l=v.exports.useRef(null);v.exports.useLayoutEffect(()=>{l.current!==null&&i&&(l.current.scrollTop=l.current.scrollHeight)},[i,t,n]);const c=()=>{e(LO()),e(DC(!n))};return sn("`",()=>{e(DC(!n))},[n]),Y(wn,{children:[n&&x(PR,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0},maxHeight:"90vh",children:x("div",{className:"console",ref:l,children:t.map((d,f)=>{const{timestamp:p,message:m,level:g}=d;return Y("div",{className:`console-entry console-${g}-color`,children:[Y("p",{className:"console-timestamp",children:[p,":"]}),x("p",{className:"console-message",children:m})]},f)})})}),n&&x(ir,{hasArrow:!0,label:i?"Autoscroll On":"Autoscroll Off",children:x(Nn,{className:`console-autoscroll-icon-button ${i&&"autoscroll-enabled"}`,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:x(b0e,{}),onClick:()=>a(!i)})}),x(ir,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:x(Nn,{className:`console-toggle-icon-button ${(r||!o)&&"error-seen"}`,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?x(k0e,{}):x(C0e,{}),onClick:c})})]})};function B2e(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(o=>o)};(!{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV||{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}B2e();const V2e=()=>{const e=Ue(),[t,n]=v.exports.useState(!1);return v.exports.useEffect(()=>{e(Jhe()),n(!0)},[e]),t?Y("div",{className:"App",children:[x(P2e,{}),Y("div",{className:"app-content",children:[x($2e,{}),x(g2e,{})]}),x("div",{className:"app-console",children:x(z2e,{})})]}):x(lM,{})};const uM=ape(aM);Ny.createRoot(document.getElementById("root")).render(x(Q.StrictMode,{children:x(Dfe,{store:aM,children:x(sM,{loading:x(lM,{}),persistor:uM,children:Y(xde,{theme:B_,children:[x(bU,{initialColorMode:B_.config.initialColorMode}),x(V2e,{})]})})})})); diff --git a/frontend/dist/assets/index.193aec6f.css b/frontend/dist/assets/index.193aec6f.css deleted file mode 100644 index 06e1f15922..0000000000 --- a/frontend/dist/assets/index.193aec6f.css +++ /dev/null @@ -1 +0,0 @@ -[data-theme=dark]{--white: rgb(255, 255, 255);--root-bg-color: rgb(10, 10, 10);--background-color: rgb(20, 20, 26);--background-color-secondary: rgb(16, 16, 22);--text-color: rgb(255, 255, 255);--text-color-secondary: rgb(160, 162, 188);--subtext-color: rgb(24, 24, 34);--subtext-color-bright: rgb(48, 48, 64);--border-color: rgb(30, 30, 46);--border-color-light: rgb(60, 60, 76);--invalid: rgb(255, 75, 75);--invalid-secondary: rgb(120, 5, 5);--border-color-invalid: rgb(255, 80, 50);--box-shadow-color-invalid: rgb(210, 30, 10);--svg-color: rgb(24, 24, 34);--progress-bar-color: rgb(100, 50, 245);--prompt-bg-color: rgb(10, 10, 10);--prompt-border-color: rgb(140, 110, 255);--prompt-box-shadow-color: rgb(80, 30, 210);--btn-svg-color: rgb(255, 255, 255);--btn-grey: rgb(30, 32, 42);--btn-grey-hover: rgb(46, 48, 68);--btn-purple: rgb(80, 40, 200);--btn-purple-hover: rgb(104, 60, 230);--btn-red: rgb(185, 55, 55);--btn-red-hover: rgb(255, 75, 75);--btn-load-more: rgb(30, 32, 42);--btn-load-more-hover: rgb(54, 56, 66);--switch-bg-color: rgb(100, 102, 110);--switch-bg-active-color: rgb(80, 40, 200);--tab-color: rgb(30, 32, 42);--tab-hover-color: rgb(36, 38, 48);--tab-list-bg: rgb(100, 50, 255);--tab-list-text: rgb(20, 20, 20);--tab-list-text-inactive: rgb(92, 94, 114);--tab-panel-bg: rgb(20, 22, 28);--metadata-bg-color: rgba(0, 0, 0, .7);--metadata-json-bg-color: rgba(255, 255, 255, .1);--status-good-color: rgb(125, 255, 100);--status-good-glow: rgb(40, 215, 40);--status-working-color: rgb(255, 175, 55);--status-working-glow: rgb(255, 160, 55);--status-bad-color: rgb(255, 90, 90);--status-bad-glow: rgb(255, 40, 40);--settings-modal-bg: rgb(30, 32, 42);--input-checkbox-bg: rgb(90, 90, 120);--input-checkbox-checked-bg: rgb(80, 40, 200);--input-checkbox-checked-tick: rgb(0, 0, 0);--error-level-info: rgb(200, 202, 224);--error-level-warning: rgb(255, 225, 105);--error-level-error: rgb(255, 81, 46);--console-bg-color: rgb(30, 30, 36);--console-border-color: rgb(80, 82, 112);--console-icon-button-bg-color: rgb(50, 53, 64);--console-icon-button-bg-color-hover: rgb(70, 73, 84);--img2img-img-bg-color: rgb(30, 32, 42);--gallery-resizeable-color: rgb(36, 38, 48);--context-menu-bg-color: rgb(46, 48, 58);--context-menu-box-shadow: none;--context-menu-bg-color-hover: rgb(30, 32, 42)}[data-theme=light]{--white: rgb(255, 255, 255);--root-bg-color: rgb(255, 255, 255);--background-color: rgb(220, 222, 224);--background-color-secondary: rgb(204, 206, 208);--text-color: rgb(0, 0, 0);--text-color-secondary: rgb(40, 40, 40);--subtext-color: rgb(24, 24, 34);--subtext-color-bright: rgb(142, 144, 146);--border-color: rgb(200, 200, 200);--border-color-light: rgb(147, 147, 147);--invalid: rgb(255, 75, 75);--invalid-secondary: rgb(120, 5, 5);--border-color-invalid: rgb(255, 80, 50);--box-shadow-color-invalid: none;--svg-color: rgb(186, 188, 190);--progress-bar-color: rgb(235, 185, 5);--prompt-bg-color: rgb(225, 227, 229);--prompt-border-color: rgb(0, 0, 0);--prompt-box-shadow-color: rgb(217, 217, 217);--btn-svg-color: rgb(0, 0, 0);--btn-grey: rgb(220, 222, 224);--btn-grey-hover: rgb(230, 232, 234);--btn-purple: rgb(235, 185, 5);--btn-purple-hover: rgb(255, 200, 0);--btn-red: rgb(237, 51, 51);--btn-red-hover: rgb(255, 55, 55);--btn-load-more: rgb(202, 204, 206);--btn-load-more-hover: rgb(178, 180, 182);--switch-bg-color: rgb(178, 180, 182);--switch-bg-active-color: rgb(235, 185, 5);--tab-color: rgb(202, 204, 206);--tab-hover-color: rgb(206, 208, 210);--tab-list-bg: rgb(235, 185, 5);--tab-list-text: rgb(0, 0, 0);--tab-list-text-inactive: rgb(106, 108, 110);--tab-panel-bg: rgb(214, 216, 218);--metadata-bg-color: rgba(230, 230, 230, .9);--metadata-json-bg-color: rgba(0, 0, 0, .1);--status-good-color: rgb(21, 126, 0);--status-good-glow: var(--background-color);--status-working-color: rgb(235, 141, 0);--status-working-glow: var(--background-color);--status-bad-color: rgb(202, 0, 0);--status-bad-glow: var(--background-color);--settings-modal-bg: rgb(202, 204, 206);--input-checkbox-bg: rgb(90, 90, 120);--input-checkbox-checked-bg: rgb(235, 185, 5);--input-checkbox-checked-tick: rgb(0, 0, 0);--error-level-info: rgb(42, 42, 42);--error-level-warning: rgb(173, 121, 0);--error-level-error: rgb(145, 14, 0);--console-bg-color: rgb(220, 224, 230);--console-border-color: rgb(160, 162, 164);--console-icon-button-bg-color: var(--switch-bg-color);--console-icon-button-bg-color-hover: var(--console-border-color);--img2img-img-bg-color: rgb(180, 182, 184);--gallery-resizeable-color: rgb(192, 194, 196);--context-menu-bg-color: var(--background-color);--context-menu-box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, .35), 0px 10px 20px -15px rgba(22, 23, 24, .2);--context-menu-bg-color-hover: var(--background-color-secondary)}@font-face{font-family:Inter;src:url(./Inter.b9a8e5e2.ttf);font-display:swap;font-weight:400;font-style:normal}@font-face{font-family:Inter;src:url(./Inter-Bold.790c108b.ttf);font-display:swap;font-weight:600;font-style:normal}@keyframes slideOut{0%{transform:translate(10rem)}to{transform:translate(0)}}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.App{display:grid;width:max-content}.app-content{display:grid;row-gap:1rem;margin:.6rem;padding:1rem;border-radius:.5rem;background-color:var(--background-color);grid-auto-rows:max-content;width:calc(100vw - 1.6rem);height:calc(100vh - 1.6rem);min-width:min-content}.app-console{z-index:9999}.site-header{display:grid;grid-template-columns:auto max-content}.site-header-left-side{display:grid;grid-template-columns:repeat(2,max-content);column-gap:.6rem;align-items:center}.site-header-left-side img{width:32px;height:32px}.site-header-left-side h1{font-size:1.4rem}.site-header-right-side{display:grid;grid-template-columns:repeat(7,max-content);align-items:center;column-gap:.5rem}.status{font-size:.8rem;font-weight:700}.status-good{color:var(--status-good-color);text-shadow:0 0 10px var(--status-good-glow)}.status-bad{color:var(--status-bad-color);text-shadow:0 0 10px var(--status-bad-glow)}.status-working{color:var(--status-working-color);text-shadow:0 0 10px var(--status-working-glow)}.settings-modal{background-color:var(--settings-modal-bg)!important;font-family:Inter}.settings-modal .settings-modal-content{display:grid;row-gap:2rem}.settings-modal .settings-modal-header{font-weight:700}.settings-modal .settings-modal-items{display:grid;row-gap:.5rem}.settings-modal .settings-modal-items .settings-modal-item{display:grid;grid-auto-flow:column;background-color:var(--background-color);padding:.4rem 1rem;border-radius:.5rem;justify-content:space-between;align-items:center}.settings-modal .settings-modal-reset{display:grid;row-gap:1rem}.settings-modal .settings-modal-reset button{min-width:100%;min-height:100%;background-color:var(--btn-red)}.settings-modal .settings-modal-reset button:hover{background-color:var(--btn-red-hover)}.settings-modal .settings-modal-reset button:disabled{background-color:#2d2d37}.settings-modal .settings-modal-reset button:disabled:hover{background-color:#2d2d37}.settings-modal .settings-modal-reset button svg{width:20px;height:20px;color:var(--btn-svg-color)}.hotkeys-modal{display:grid;padding:1rem;background-color:var(--settings-modal-bg)!important;row-gap:1rem;font-family:Inter}.hotkeys-modal h1{font-size:1.2rem;font-weight:700}.hotkeys-modal-items{display:grid;row-gap:.5rem;max-height:32rem;overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.hotkeys-modal-items::-webkit-scrollbar{display:none}.hotkey-modal-item{display:grid;grid-template-columns:auto max-content;justify-content:space-between;align-items:center;background-color:var(--background-color);padding:.5rem 1rem;border-radius:.3rem}.hotkey-modal-item .hotkey-info{display:grid}.hotkey-modal-item .hotkey-info .hotkey-title{font-weight:700}.hotkey-modal-item .hotkey-info .hotkey-description{font-size:.9rem;color:var(--text-color-secondary)}.hotkey-modal-item .hotkey-key{font-size:.8rem;font-weight:700;border:2px solid var(--settings-modal-bg);padding:.2rem .5rem;border-radius:.3rem}.console{display:flex;flex-direction:column;background:var(--console-bg-color);overflow:auto;direction:column;font-family:monospace;padding:0 1rem 1rem 3rem;border-top-width:.3rem;border-color:var(--console-border-color)}.console .console-info-color{color:var(--error-level-info)}.console .console-warning-color{color:var(--error-level-warning)}.console .console-error-color{color:var(--status-bad-color)}.console .console-entry{display:flex;column-gap:.5rem}.console .console-entry .console-timestamp{font-weight:semibold}.console .console-entry .console-message{word-break:break-all}.console-toggle-icon-button{background:var(--console-icon-button-bg-color)!important;position:fixed!important;left:.5rem;bottom:.5rem}.console-toggle-icon-button:hover{background:var(--console-icon-button-bg-color-hover)!important}.console-toggle-icon-button.error-seen,.console-toggle-icon-button.error-seen:hover{background:var(--status-bad-color)!important}.console-autoscroll-icon-button{background:var(--console-icon-button-bg-color)!important;position:fixed!important;left:.5rem;bottom:3rem}.console-autoscroll-icon-button:hover{background:var(--console-icon-button-bg-color-hover)!important}.console-autoscroll-icon-button.autoscroll-enabled{background:var(--btn-purple)!important}.console-autoscroll-icon-button.autoscroll-enabled:hover{background:var(--btn-purple-hover)!important}.prompt-bar{display:grid;row-gap:1rem}.prompt-bar input,.prompt-bar textarea{background-color:var(--prompt-bg-color);font-size:1rem;border:2px solid var(--border-color)}.prompt-bar input:hover,.prompt-bar textarea:hover{border:2px solid var(--border-color-light)}.prompt-bar input:focus-visible,.prompt-bar textarea:focus-visible{border:2px solid var(--prompt-border-color);box-shadow:0 0 10px 0 var(--prompt-box-shadow-color)}.prompt-bar input[aria-invalid=true],.prompt-bar textarea[aria-invalid=true]{border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.prompt-bar input:disabled,.prompt-bar textarea:disabled{border:2px solid var(--border-color);box-shadow:none}.prompt-bar textarea{min-height:10rem}.process-buttons{display:grid;grid-template-columns:auto max-content;column-gap:.5rem}.process-buttons .invoke-btn{min-width:5rem;min-height:100%;background-color:var(--btn-purple)}.process-buttons .invoke-btn:hover{background-color:var(--btn-purple-hover)}.process-buttons .invoke-btn:disabled{background-color:#2d2d37}.process-buttons .invoke-btn:disabled:hover{background-color:#2d2d37}.process-buttons .invoke-btn svg{width:20px;height:20px;color:var(--btn-svg-color)}.process-buttons .cancel-btn{min-width:3rem;min-height:100%;background-color:var(--btn-red)}.process-buttons .cancel-btn:hover{background-color:var(--btn-red-hover)}.process-buttons .cancel-btn:disabled{background-color:#2d2d37}.process-buttons .cancel-btn:disabled:hover{background-color:#2d2d37}.process-buttons .cancel-btn svg{width:20px;height:20px;color:var(--btn-svg-color)}.main-options,.main-options-list{display:grid;row-gap:1rem}.main-options-row{display:grid;grid-template-columns:repeat(3,auto);column-gap:1rem;max-width:22.5rem}.main-option-block{border-radius:.5rem;grid-template-columns:auto!important;row-gap:.4rem}.main-option-block .number-input-label,.main-option-block .iai-select-label{width:100%;font-size:.9rem;font-weight:700}.main-option-block .number-input-entry{padding:0;height:2.4rem}.main-option-block .iai-select-picker{height:2.4rem;border-radius:.3rem}.advanced_options_checker{display:grid;grid-template-columns:repeat(2,max-content);column-gap:.5rem;align-items:center;background-color:var(--background-color-secondary);padding:1rem;font-weight:700;border-radius:.5rem}.advanced_options_checker input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:var(--input-checkbox-bg);width:1rem;height:1rem;border-radius:.2rem;display:grid;place-content:center}.advanced_options_checker input[type=checkbox]:before{content:"";width:1rem;height:1rem;transform:scale(0);transition:.12s transform ease-in-out;border-radius:.2rem;box-shadow:inset 1rem 1rem var(--input-checkbox-checked-tick);clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0%,43% 62%)}.advanced_options_checker input[type=checkbox]:checked{background-color:var(--input-checkbox-checked-bg)}.advanced_options_checker input[type=checkbox]:checked:before{transform:scale(.7)}.advanced-settings{display:grid;row-gap:.5rem}.advanced-settings-item{display:grid;max-width:22.5rem;border:none;border-top:0px;border-radius:.4rem}.advanced-settings-item[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:0 0 .4rem .4rem}.advanced-settings-panel{background-color:var(--tab-panel-bg);border-radius:0 0 .4rem .4rem;border:2px solid var(--tab-hover-color)}.advanced-settings-header{border-radius:.4rem}.advanced-settings-header[aria-expanded=true]{background-color:var(--tab-color);border-radius:.4rem .4rem 0 0}.advanced-settings-header:hover{background-color:var(--tab-hover-color)!important}.upscale-options{display:grid;grid-template-columns:auto 1fr;column-gap:1rem}.progress-bar{background-color:var(--root-bg-color)}.progress-bar div{background-color:var(--progress-bar-color)}.current-image-display{display:grid;grid-template-areas:"current-image-tools" "current-image-preview";grid-template-rows:auto 1fr;justify-items:center;background-color:var(--background-color-secondary);border-radius:.5rem}.current-image-tools{width:100%;height:100%;display:grid;justify-content:center}.current-image-options{display:grid;grid-auto-flow:column;padding:1rem;height:fit-content;gap:.5rem}.current-image-options button{min-width:3rem;min-height:100%;background-color:var(--btn-grey)}.current-image-options button:hover{background-color:var(--btn-grey-hover)}.current-image-options button:disabled{background-color:#2d2d37}.current-image-options button:disabled:hover{background-color:#2d2d37}.current-image-options button svg{width:22px;height:22px;color:var(--btn-svg-color)}.current-image-preview{grid-area:current-image-preview;position:relative;justify-content:center;align-items:center;display:grid;width:100%;grid-template-areas:"current-image-content"}.current-image-preview img{grid-area:current-image-content;background-color:var(--img2img-img-bg-color);border-radius:.5rem;object-fit:contain;width:auto;height:calc(100vh - 13rem);max-height:calc(100vh - 13rem)}.current-image-metadata{grid-area:current-image-preview}.current-image-next-prev-buttons{grid-area:current-image-content;display:flex;justify-content:space-between;z-index:1;height:100%;pointer-events:none}.next-prev-button-trigger-area{width:7rem;height:100%;width:15%;display:grid;align-items:center;pointer-events:auto}.next-prev-button-trigger-area.prev-button-trigger-area{justify-content:flex-start}.next-prev-button-trigger-area.next-button-trigger-area{justify-content:flex-end}.next-prev-button{font-size:4rem;fill:var(--white);filter:drop-shadow(0 0 1rem var(--text-color-secondary));opacity:70%}.current-image-display-placeholder{background-color:var(--background-color-secondary);display:grid;display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:.5rem}.current-image-display-placeholder svg{width:10rem;height:10rem;color:var(--svg-color)}.image-gallery-area .image-gallery-popup-btn{position:absolute;top:50%;right:1rem;border-radius:.5rem 0 0 .5rem;padding:0 .5rem;min-width:1rem;min-height:6rem;background-color:var(--btn-grey)}.image-gallery-area .image-gallery-popup-btn:hover{background-color:var(--btn-grey-hover)}.image-gallery-area .image-gallery-popup-btn:disabled{background-color:#2d2d37}.image-gallery-area .image-gallery-popup-btn:disabled:hover{background-color:#2d2d37}.image-gallery-area .image-gallery-popup-btn svg{width:20px;height:20px;color:var(--btn-svg-color)}.image-gallery-popup{background-color:var(--tab-color);padding:1rem;animation:slideOut .3s ease-out;display:flex;flex-direction:column;row-gap:1rem;border-radius:.5rem;border-left-width:.2rem;min-width:300px;border-color:var(--gallery-resizeable-color)}.image-gallery-header{display:flex;align-items:center}.image-gallery-header h1{font-weight:700}.image-gallery-close-btn{background-color:var(--btn-load-more)!important}.image-gallery-close-btn:hover{background-color:var(--btn-load-more-hover)!important}.image-gallery-container{display:flex;flex-direction:column;gap:1rem;max-height:calc(100vh - 13rem);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.image-gallery-container::-webkit-scrollbar{display:none}.image-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,auto));grid-gap:.5rem}.image-gallery .hoverable-image{padding:.5rem;position:relative}.image-gallery .hoverable-image:before{content:"";display:block;padding-bottom:100%}.image-gallery .hoverable-image .hoverable-image-image{position:absolute;max-width:100%;top:50%;left:50%;transform:translate(-50%,-50%)}.image-gallery-load-more-btn{background-color:var(--btn-load-more)!important;font-size:.85rem!important;font-family:Inter}.image-gallery-load-more-btn:disabled:hover{background-color:var(--btn-load-more)!important}.image-gallery-load-more-btn:hover{background-color:var(--btn-load-more-hover)!important}.image-gallery-container-placeholder{display:flex;background-color:var(--background-color-secondary);border-radius:.5rem;place-items:center;padding:2rem 0}.image-gallery-container-placeholder p{color:var(--subtext-color-bright);font-family:Inter}.image-gallery-container-placeholder svg{width:5rem;height:5rem;color:var(--svg-color)}.hoverable-image{display:flex;justify-content:center;transition:transform .2s ease-out}.hoverable-image:hover{cursor:pointer;border-radius:.5rem;z-index:2}.hoverable-image .hoverable-image-image{width:100%;height:100%;object-fit:cover;max-width:100%;max-height:100%}.hoverable-image .hoverable-image-delete-button{position:absolute;top:.25rem;right:.25rem}.hoverable-image .hoverable-image-content{display:flex;position:absolute;top:0;left:0;width:100%;height:100%;align-items:center;justify-content:center}.hoverable-image .hoverable-image-content .hoverable-image-check{fill:var(--status-good-color)}.hoverable-image .hoverable-image-icons{position:absolute;bottom:-2rem;display:grid;width:min-content;grid-template-columns:repeat(2,max-content);border-radius:.4rem;background-color:var(--background-color-secondary);padding:.2rem;gap:.2rem;grid-auto-rows:max-content}.hoverable-image .hoverable-image-icons button{width:12px;height:12px;border-radius:.2rem;padding:10px 0;flex-shrink:2}.hoverable-image .hoverable-image-icons button svg{width:12px;height:12px}.hoverable-image-context-menu{z-index:999;padding:.4rem;border-radius:.25rem;background-color:var(--context-menu-bg-color);box-shadow:var(--context-menu-box-shadow)}.hoverable-image-context-menu [role=menuitem]{font-size:.8rem;line-height:1rem;border-radius:3px;display:flex;align-items:center;height:1.75rem;padding:0 .5rem;position:relative;user-select:none;cursor:pointer;outline:none}.hoverable-image-context-menu [role=menuitem][data-disabled]{color:gray;pointer-events:none;cursor:not-allowed}.hoverable-image-context-menu [role=menuitem][data-warning]{color:var(--status-bad-color)}.hoverable-image-context-menu [role=menuitem][data-highlighted]{background-color:var(--context-menu-bg-color-hover)}.popover-content{background-color:var(--background-color-secondary)!important;border:none!important;border-top:0px;background-color:var(--tab-hover-color);border-radius:0 0 .4rem .4rem}.popover-arrow{background:var(--tab-hover-color)!important;box-shadow:none}.popover-options{background:var(--tab-panel-bg);border-radius:0 0 .4rem .4rem;border:2px solid var(--tab-hover-color);padding:.75rem 1rem;display:grid;grid-auto-rows:max-content;grid-row-gap:.5rem;justify-content:space-between}.popover-header{background:var(--tab-hover-color);border-radius:.4rem .4rem 0 0;font-weight:700;border:none;padding-left:1rem!important}.upscale-popover{width:23rem!important}.image-metadata-viewer{width:100%;border-radius:.5rem;padding:1rem;background-color:var(--metadata-bg-color);overflow:scroll;max-height:calc(100vh - 11.4rem);z-index:10}.image-json-viewer{border-radius:.5rem;margin:0 .5rem 1rem;padding:1rem;overflow-x:scroll;word-break:break-all;background-color:var(--metadata-json-bg-color)}.app-tabs{display:grid!important;grid-template-columns:min-content auto;column-gap:1rem}.app-tabs-list{display:grid;row-gap:.3rem;grid-auto-rows:max-content;color:var(--tab-list-text-inactive)}.app-tabs-list button{font-size:.85rem;padding:.5rem}.app-tabs-list button:hover{background-color:var(--tab-hover-color);border-radius:.3rem}.app-tabs-list button svg{width:26px;height:26px}.app-tabs-list button[aria-selected=true]{background-color:var(--tab-list-bg);color:var(--tab-list-text);font-weight:700;border-radius:.3rem;border:none}.app-tabs-panels .app-tabs-panel{padding:0}.text-to-image-workarea{display:grid;grid-template-columns:max-content auto;column-gap:1rem}.text-to-image-panel{display:grid;row-gap:1rem;grid-auto-rows:max-content;height:calc(100vh - 7rem);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.text-to-image-panel::-webkit-scrollbar{display:none}.text-to-image-display{display:grid;grid-template-areas:"text-to-image-display";column-gap:.5rem}.text-to-image-display .current-image-display,.text-to-image-display .current-image-display-placeholder{grid-area:text-to-image-display;height:calc(100vh - 7rem)}.text-to-image-display .image-gallery-area{height:100%;z-index:2;place-self:end}.image-to-image-workarea{display:grid;grid-template-columns:max-content auto;column-gap:1rem}.image-to-image-panel{display:grid;row-gap:1rem;grid-auto-rows:max-content;width:22.5rem;height:calc(100vh - 7rem);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.image-to-image-panel::-webkit-scrollbar{display:none}.image-to-image-display-area{display:grid;column-gap:.5rem}.image-to-image-display-area .image-gallery-area{z-index:2;height:100%}.image-to-image-strength-main-option{display:grid;grid-template-columns:none!important}.image-to-image-strength-main-option .number-input-entry{padding:0 1rem}.image-to-image-display{border-radius:.5rem;background-color:var(--background-color-secondary);display:grid;height:calc(100vh - 7rem)}.image-to-image-display .current-image-options{grid-auto-columns:max-content;justify-self:center;align-self:start}.image-to-image-single-preview{display:grid;column-gap:.5rem;padding:0 1rem;place-content:center}.image-to-image-dual-preview-container{display:grid;grid-template-areas:"img2img-preview"}.image-to-image-dual-preview{grid-area:img2img-preview;display:grid;grid-template-columns:1fr 1fr;column-gap:.5rem;padding:0 1rem;place-content:center}.image-to-image-dual-preview .current-image-preview img{height:calc(100vh - 15rem);max-height:calc(100vh - 15rem)}.img2img-metadata{grid-area:img2img-preview;z-index:3}.init-image-preview{display:grid;grid-template-areas:"init-image-content";justify-content:center;align-items:center;border-radius:.5rem}.init-image-preview .init-image-preview-header{grid-area:init-image-content;z-index:2;display:grid;grid-template-columns:auto max-content;height:max-content;align-items:center;align-self:start;padding:1rem;border-radius:.5rem}.init-image-preview .init-image-preview-header h1{padding:.2rem .6rem;border-radius:.4rem;background-color:var(--tab-hover-color);width:max-content;font-weight:700;font-size:.85rem}.init-image-preview .init-image-image{grid-area:init-image-content}.init-image-preview .init-image-image img{border-radius:.5rem;object-fit:contain;background-color:var(--img2img-img-bg-color);width:auto;height:calc(100vh - 15rem);max-height:calc(100vh - 15rem)}.image-to-image-upload-btn{display:grid;width:100%;height:calc(100vh - 7rem)}.image-to-image-upload-btn button{overflow:hidden;width:100%;height:100%;font-size:1.5rem;color:var(--text-color-secondary);background-color:var(--background-color-secondary)}.image-to-image-upload-btn button:hover{background-color:var(--img2img-img-bg-color)}.number-input{display:grid;grid-template-columns:max-content auto;column-gap:1rem;align-items:center}.number-input .number-input-label{color:var(--text-color-secondary);margin-right:0}.number-input .number-input-field{display:grid;grid-template-columns:auto max-content;column-gap:.5rem;align-items:center;background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.2rem}.number-input .number-input-entry{border:none;font-weight:700;width:100%;padding-inline-end:0}.number-input .number-input-entry:focus{outline:none;border:2px solid var(--prompt-border-color);box-shadow:0 0 10px 0 var(--prompt-box-shadow-color)}.number-input .number-input-entry:disabled{opacity:.2}.number-input .number-input-stepper{display:grid;padding-right:.7rem}.number-input .number-input-stepper svg{width:12px;height:12px}.number-input .number-input-stepper .number-input-stepper-button{border:none}.input{display:grid;grid-template-columns:max-content auto;column-gap:1rem;align-items:center}.input .input-label{color:var(--text-color-secondary);margin-right:0}.input .input-entry{background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.2rem;font-weight:700}.input .input-entry:focus{outline:none;border:2px solid var(--prompt-border-color);box-shadow:0 0 10px 0 var(--prompt-box-shadow-color)}.input .input-entry:disabled{opacity:.2}.input .input-entry[aria-invalid=true]{outline:none;border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.iai-select{display:grid;grid-template-columns:repeat(2,max-content);column-gap:1rem;align-items:center;width:max-content}.iai-select .iai-select-label{color:var(--text-color-secondary);margin-right:0}.iai-select .iai-select-picker{border:2px solid var(--border-color);background-color:var(--background-color-secondary);font-weight:700}.iai-select .iai-select-picker:focus{outline:none;border:2px solid var(--prompt-border-color);box-shadow:0 0 10px 0 var(--prompt-box-shadow-color)}.iai-select .iai-select-option{background-color:var(--background-color-secondary)}.chakra-switch span,.switch-button span{background-color:var(--switch-bg-color)}.chakra-switch span span,.switch-button span span{background-color:var(--white)}.chakra-switch span[data-checked],.switch-button span[data-checked]{background:var(--switch-bg-active-color)}.chakra-switch span[data-checked] span,.switch-button span[data-checked] span{background-color:var(--white)}.work-in-progress{display:grid;width:100%;height:calc(100vh - 7rem);grid-auto-rows:max-content;background-color:var(--background-color-secondary);border-radius:.4rem;place-content:center;place-items:center;row-gap:1rem}.work-in-progress h1{font-size:2rem;font-weight:700}.work-in-progress p{text-align:center;max-width:50rem;color:var(--subtext-color-bright)}.guide-popover-arrow{background-color:var(--tab-panel-bg)!important;box-shadow:none!important}.guide-popover-content{background-color:var(--background-color-secondary)!important;border:none!important}.guide-popover-guide-content{background:var(--tab-panel-bg);border:2px solid var(--tab-hover-color);border-radius:.4rem;padding:.75rem 1rem;display:grid;grid-template-rows:repeat(auto-fill,1fr);grid-row-gap:.5rem;justify-content:space-between}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{-ms-overflow-style:none;scrollbar-width:none;background-color:var(--root-bg-color)}html::-webkit-scrollbar,body::-webkit-scrollbar{display:none}#root{background-color:var(--root-bg-color);color:var(--text-color);font-family:Inter,Arial,Helvetica,sans-serif} diff --git a/frontend/dist/assets/index.352e4760.css b/frontend/dist/assets/index.352e4760.css new file mode 100644 index 0000000000..7216d2ff34 --- /dev/null +++ b/frontend/dist/assets/index.352e4760.css @@ -0,0 +1 @@ +[data-theme=dark]{--white: rgb(255, 255, 255);--root-bg-color: rgb(10, 10, 10);--background-color: rgb(20, 20, 26);--background-color-secondary: rgb(16, 16, 22);--text-color: rgb(255, 255, 255);--text-color-secondary: rgb(160, 162, 188);--subtext-color: rgb(24, 24, 34);--subtext-color-bright: rgb(48, 48, 64);--border-color: rgb(30, 30, 46);--border-color-light: rgb(60, 60, 76);--invalid: rgb(255, 75, 75);--invalid-secondary: rgb(120, 5, 5);--accent-color: rgb(80, 40, 200);--accent-color-hover: rgb(104, 60, 230);--destructive-color: rgb(185, 55, 55);--destructive-color-hover: rgb(255, 75, 75);--border-color-invalid: rgb(255, 80, 50);--box-shadow-color-invalid: rgb(210, 30, 10);--svg-color: rgb(24, 24, 34);--progress-bar-color: rgb(100, 50, 245);--prompt-bg-color: rgb(10, 10, 10);--btn-svg-color: rgb(255, 255, 255);--btn-grey: rgb(30, 32, 42);--btn-grey-hover: rgb(46, 48, 68);--btn-load-more: rgb(30, 32, 42);--btn-load-more-hover: rgb(54, 56, 66);--switch-bg-color: rgb(100, 102, 110);--switch-bg-active-color: rgb(80, 40, 200);--resizeable-handle-border-color: rgb(80, 82, 112);--tab-color: rgb(30, 32, 42);--tab-hover-color: rgb(36, 38, 48);--tab-list-bg: rgb(100, 50, 255);--tab-list-text: rgb(20, 20, 20);--tab-list-text-inactive: rgb(92, 94, 114);--tab-panel-bg: rgb(20, 22, 28);--metadata-bg-color: rgba(0, 0, 0, .7);--metadata-json-bg-color: rgba(255, 255, 255, .1);--status-good-color: rgb(125, 255, 100);--status-good-glow: rgb(40, 215, 40);--status-working-color: rgb(255, 175, 55);--status-working-glow: rgb(255, 160, 55);--status-bad-color: rgb(255, 90, 90);--status-bad-glow: rgb(255, 40, 40);--settings-modal-bg: rgb(30, 32, 42);--input-checkbox-bg: rgb(90, 90, 120);--input-checkbox-checked-bg: rgb(80, 40, 200);--input-checkbox-checked-tick: rgb(0, 0, 0);--input-border-color: rgb(140, 110, 255);--input-box-shadow-color: rgb(80, 30, 210);--error-level-info: rgb(200, 202, 224);--error-level-warning: rgb(255, 225, 105);--error-level-error: rgb(255, 81, 46);--console-bg-color: rgb(30, 30, 36);--console-icon-button-bg-color: rgb(50, 53, 64);--console-icon-button-bg-color-hover: rgb(70, 73, 84);--img2img-img-bg-color: rgb(30, 32, 42);--context-menu-bg-color: rgb(46, 48, 58);--context-menu-box-shadow: none;--context-menu-bg-color-hover: rgb(30, 32, 42);--inpaint-bg-color: rgb(30, 32, 42)}[data-theme=light]{--white: rgb(255, 255, 255);--root-bg-color: rgb(255, 255, 255);--background-color: rgb(220, 222, 224);--background-color-secondary: rgb(204, 206, 208);--text-color: rgb(0, 0, 0);--text-color-secondary: rgb(40, 40, 40);--subtext-color: rgb(24, 24, 34);--subtext-color-bright: rgb(142, 144, 146);--border-color: rgb(200, 200, 200);--border-color-light: rgb(147, 147, 147);--invalid: rgb(255, 75, 75);--invalid-secondary: rgb(120, 5, 5);--accent-color: rgb(235, 185, 5);--accent-color-hover: rgb(255, 200, 0);--destructive-color: rgb(237, 51, 51);--destructive-color-hover: rgb(255, 55, 55);--border-color-invalid: rgb(255, 80, 50);--box-shadow-color-invalid: none;--svg-color: rgb(186, 188, 190);--progress-bar-color: rgb(235, 185, 5);--prompt-bg-color: rgb(225, 227, 229);--btn-svg-color: rgb(0, 0, 0);--btn-grey: rgb(220, 222, 224);--btn-grey-hover: rgb(230, 232, 234);--btn-load-more: rgb(202, 204, 206);--btn-load-more-hover: rgb(178, 180, 182);--switch-bg-color: rgb(178, 180, 182);--switch-bg-active-color: rgb(235, 185, 5);--resizeable-handle-border-color: rgb(160, 162, 164);--tab-color: rgb(202, 204, 206);--tab-hover-color: rgb(206, 208, 210);--tab-list-bg: rgb(235, 185, 5);--tab-list-text: rgb(0, 0, 0);--tab-list-text-inactive: rgb(106, 108, 110);--tab-panel-bg: rgb(214, 216, 218);--metadata-bg-color: rgba(230, 230, 230, .9);--metadata-json-bg-color: rgba(0, 0, 0, .1);--status-good-color: rgb(21, 126, 0);--status-good-glow: var(--background-color);--status-working-color: rgb(235, 141, 0);--status-working-glow: var(--background-color);--status-bad-color: rgb(202, 0, 0);--status-bad-glow: var(--background-color);--settings-modal-bg: rgb(202, 204, 206);--input-checkbox-bg: rgb(90, 90, 120);--input-checkbox-checked-bg: rgb(235, 185, 5);--input-checkbox-checked-tick: rgb(0, 0, 0);--input-border-color: rgb(0, 0, 0);--input-box-shadow-color: none;--error-level-info: rgb(42, 42, 42);--error-level-warning: rgb(173, 121, 0);--error-level-error: rgb(145, 14, 0);--console-bg-color: rgb(220, 224, 230);--console-icon-button-bg-color: var(--switch-bg-color);--console-icon-button-bg-color-hover: var(--resizeable-handle-border-color);--img2img-img-bg-color: rgb(180, 182, 184);--context-menu-bg-color: var(--background-color);--context-menu-box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, .35), 0px 10px 20px -15px rgba(22, 23, 24, .2);--context-menu-bg-color-hover: var(--background-color-secondary);--inpaint-bg-color: rgb(180, 182, 184)}@font-face{font-family:Inter;src:url(./Inter.b9a8e5e2.ttf);font-display:swap;font-weight:400;font-style:normal}@font-face{font-family:Inter;src:url(./Inter-Bold.790c108b.ttf);font-display:swap;font-weight:600;font-style:normal}@keyframes slideOut{0%{transform:translate(10rem)}to{transform:translate(0)}}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.checkerboard{background-position:0px 0px,10px 10px;background-size:20px 20px;background-image:linear-gradient(45deg,#eee 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),linear-gradient(45deg,#eee 25%,white 25%,white 75%,#eee 75%,#eee 100%)}.App{display:grid;width:100vw;height:100vh;background-color:var(--background-color)}.app-content{display:grid;row-gap:.5rem;padding:.5rem;grid-auto-rows:max-content;width:calc(100vw + -0px);height:calc(100vh - .3rem)}.app-console{z-index:20}.site-header{display:grid;grid-template-columns:auto max-content}.site-header-left-side{display:flex;align-items:center;column-gap:.7rem;padding-left:.5rem}.site-header-left-side img{width:32px;height:32px}.site-header-left-side h1{font-size:1.4rem}.site-header-right-side{display:flex;align-items:center;column-gap:.5rem}.status{font-size:.8rem;font-weight:700}.status-good{color:var(--status-good-color);text-shadow:0 0 10px var(--status-good-glow)}.status-bad{color:var(--status-bad-color);text-shadow:0 0 10px var(--status-bad-glow)}.status-working{color:var(--status-working-color);text-shadow:0 0 10px var(--status-working-glow)}.settings-modal{background-color:var(--settings-modal-bg)!important;max-height:36rem;font-family:Inter}.settings-modal .settings-modal-content{display:grid;row-gap:2rem;overflow-y:scroll}.settings-modal .settings-modal-header{font-weight:700}.settings-modal .settings-modal-items{display:grid;row-gap:.5rem}.settings-modal .settings-modal-items .settings-modal-item{display:grid;grid-auto-flow:column;background-color:var(--background-color);padding:.4rem 1rem;border-radius:.5rem;align-items:center;width:100%}.settings-modal .settings-modal-reset{display:grid;row-gap:1rem}.settings-modal .settings-modal-reset button{min-width:100%;min-height:100%;background-color:var(--destructive-color)!important}.settings-modal .settings-modal-reset button:hover{background-color:var(--destructive-color-hover)!important}.settings-modal .settings-modal-reset button:disabled{background-color:#2d2d37!important}.settings-modal .settings-modal-reset button:disabled:hover{background-color:#2d2d37!important}.settings-modal .settings-modal-reset button svg{width:20px;height:20px;color:var(--btn-svg-color)}.model-list .chakra-accordion{display:grid;row-gap:.5rem}.model-list .chakra-accordion__item{border:none;border-radius:.3rem;background-color:var(--tab-hover-color)}.model-list button{border-radius:.3rem!important}.model-list button[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:.3rem}.model-list .model-list-button{display:flex;flex-direction:row;row-gap:.5rem;justify-content:space-between;align-items:center;width:100%}.model-list .model-list-header-hint{color:var(--text-color-secondary);font-weight:400}.model-list .model-list-list{display:flex;flex-direction:column;row-gap:.5rem}.model-list .model-list-list .model-list-item{display:flex;column-gap:.5rem;width:100%;justify-content:space-between;align-items:center}.model-list .model-list-list .model-list-item .model-list-item-description{font-size:.9rem}.model-list .model-list-list .model-list-item .model-list-item-status.active{color:var(--status-good-color)}.model-list .model-list-list .model-list-item .model-list-item-status.cached{color:var(--status-working-color)}.model-list .model-list-list .model-list-item .model-list-item-status.not-loaded{color:var(--text-color-secondary)}.hotkeys-modal{width:36rem!important;max-width:36rem!important;display:grid;padding:1rem;background-color:var(--settings-modal-bg)!important;row-gap:1rem;font-family:Inter}.hotkeys-modal h1{font-size:1.2rem;font-weight:700}.hotkeys-modal h2{font-weight:700}.hotkeys-modal-button{display:flex;align-items:center;justify-content:space-between}.hotkeys-modal-items{max-height:36rem;overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.hotkeys-modal-items::-webkit-scrollbar{display:none}.hotkeys-modal-items .chakra-accordion{display:grid;row-gap:.5rem}.hotkeys-modal-items .chakra-accordion__item{border:none;border-radius:.3rem;background-color:var(--tab-hover-color)}.hotkeys-modal-items button{border-radius:.3rem!important}.hotkeys-modal-items button[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:.3rem}.hotkey-modal-category{display:grid;row-gap:.5rem}.hotkey-modal-item{display:grid;grid-template-columns:auto max-content;justify-content:space-between;align-items:center;background-color:var(--background-color);padding:.5rem 1rem;border-radius:.3rem}.hotkey-modal-item .hotkey-info{display:grid}.hotkey-modal-item .hotkey-info .hotkey-title{font-weight:700}.hotkey-modal-item .hotkey-info .hotkey-description{font-size:.9rem;color:var(--text-color-secondary)}.hotkey-modal-item .hotkey-key{font-size:.8rem;font-weight:700;border:2px solid var(--settings-modal-bg);padding:.2rem .5rem;border-radius:.3rem}.console{width:100vw;display:flex;flex-direction:column;background:var(--console-bg-color);overflow:auto;direction:column;font-family:monospace;padding:0 1rem 1rem 3rem;border-top-width:.3rem;border-color:var(--resizeable-handle-border-color)}.console .console-info-color{color:var(--error-level-info)}.console .console-warning-color{color:var(--error-level-warning)}.console .console-error-color{color:var(--status-bad-color)}.console .console-entry{display:flex;column-gap:.5rem}.console .console-entry .console-timestamp{font-weight:semibold}.console .console-entry .console-message{word-break:break-all}.console-toggle-icon-button{background:var(--console-icon-button-bg-color)!important;position:fixed!important;left:.5rem;bottom:.5rem}.console-toggle-icon-button:hover{background:var(--console-icon-button-bg-color-hover)!important}.console-toggle-icon-button.error-seen,.console-toggle-icon-button.error-seen:hover{background:var(--status-bad-color)!important}.console-autoscroll-icon-button{background:var(--console-icon-button-bg-color)!important;position:fixed!important;left:.5rem;bottom:3rem}.console-autoscroll-icon-button:hover{background:var(--console-icon-button-bg-color-hover)!important}.console-autoscroll-icon-button.autoscroll-enabled{background:var(--accent-color)!important}.console-autoscroll-icon-button.autoscroll-enabled:hover{background:var(--accent-color-hover)!important}.prompt-bar{display:grid;row-gap:1rem}.prompt-bar input,.prompt-bar textarea{background-color:var(--prompt-bg-color);font-size:1rem;border:2px solid var(--border-color)}.prompt-bar input:hover,.prompt-bar textarea:hover{border:2px solid var(--border-color-light)}.prompt-bar input:focus-visible,.prompt-bar textarea:focus-visible{border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.prompt-bar input[aria-invalid=true],.prompt-bar textarea[aria-invalid=true]{border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.prompt-bar input:disabled,.prompt-bar textarea:disabled{border:2px solid var(--border-color);box-shadow:none}.prompt-bar textarea{min-height:10rem}.process-buttons{display:grid;grid-template-columns:auto max-content;column-gap:.5rem}.process-buttons .invoke-btn{min-width:5rem;min-height:100%;background-color:var(--accent-color)!important}.process-buttons .invoke-btn:hover{background-color:var(--accent-color-hover)!important}.process-buttons .invoke-btn:disabled{background-color:#2d2d37!important}.process-buttons .invoke-btn:disabled:hover{background-color:#2d2d37!important}.process-buttons .invoke-btn svg{width:20px;height:20px;color:var(--btn-svg-color)}.process-buttons .cancel-btn{min-width:3rem;min-height:100%;background-color:var(--destructive-color)!important}.process-buttons .cancel-btn:hover{background-color:var(--destructive-color-hover)!important}.process-buttons .cancel-btn:disabled{background-color:#2d2d37!important}.process-buttons .cancel-btn:disabled:hover{background-color:#2d2d37!important}.process-buttons .cancel-btn svg{width:20px;height:20px;color:var(--btn-svg-color)}.main-options,.main-options-list{display:grid;row-gap:1rem}.main-options-row{display:grid;grid-template-columns:repeat(3,auto);column-gap:1rem;max-width:22.5rem}.main-option-block{border-radius:.5rem;grid-template-columns:auto!important;row-gap:.4rem}.main-option-block .invokeai__number-input-form-label,.main-option-block .invokeai__select-label{width:100%;font-size:.9rem!important;font-weight:700}.main-option-block .number-input-entry{padding:0;height:2.4rem}.main-option-block .iai-select-picker{height:2.4rem;border-radius:.3rem}.advanced-options-checkbox{padding:1rem;font-weight:700}.advanced-settings{display:grid;row-gap:.5rem}.advanced-settings-item{display:grid;max-width:22.5rem;border:none;border-top:0px;border-radius:.4rem}.advanced-settings-item[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:0 0 .4rem .4rem}.advanced-settings-panel{background-color:var(--tab-panel-bg);border-radius:0 0 .4rem .4rem;border:2px solid var(--tab-hover-color)}.advanced-settings-header{border-radius:.4rem}.advanced-settings-header[aria-expanded=true]{background-color:var(--tab-color);border-radius:.4rem .4rem 0 0}.advanced-settings-header:hover{background-color:var(--tab-hover-color)!important}.upscale-options{display:grid;grid-template-columns:auto 1fr;column-gap:1rem}.inpainting-bounding-box-settings{display:flex;flex-direction:column;border-radius:.4rem;border:2px solid var(--tab-color)}.inpainting-bounding-box-header{background-color:var(--tab-color);display:flex;flex-direction:row;justify-content:space-between;padding:.5rem 1rem;border-radius:.4rem .4rem 0 0}.inpainting-bounding-box-header p{font-weight:700}.inpainting-bounding-box-settings-items{padding:1rem;display:flex;flex-direction:column;row-gap:1rem}.inpainting-bounding-box-settings-items .inpainting-bounding-box-reset-icon-btn{background-color:var(--btn-load-more)!important}.inpainting-bounding-box-settings-items .inpainting-bounding-box-reset-icon-btn:hover{background-color:var(--btn-load-more-hover)!important}.inpainting-bounding-box-dimensions-slider-numberinput{display:grid;grid-template-columns:repeat(3,auto);column-gap:1rem}.inpainting-bounding-box-darken{width:max-content}.progress-bar{background-color:var(--root-bg-color);height:.3rem!important}.progress-bar div{background-color:var(--progress-bar-color)}.progress-bar div[data-indeterminate]{background-color:unset;background-image:linear-gradient(to right,transparent 0%,var(--progress-bar-color) 50%,transparent 100%)}.current-image-area{display:flex;flex-direction:column;height:100%;row-gap:1rem;background-color:var(--background-color-secondary);border-radius:.5rem}.current-image-options{width:100%;display:flex;justify-content:center;align-items:center;column-gap:.5rem}.current-image-options .chakra-popover__popper{z-index:11}.current-image-preview{position:relative;justify-content:center;align-items:center;display:flex;width:100%;height:100%}.current-image-preview img{background-color:var(--img2img-img-bg-color);border-radius:.5rem;object-fit:contain;max-width:100%;max-height:100%;height:auto;position:absolute}.current-image-metadata{grid-area:current-image-preview}.current-image-next-prev-buttons{grid-area:current-image-content;display:flex;justify-content:space-between;z-index:1;height:100%;pointer-events:none}.next-prev-button-trigger-area{width:7rem;height:100%;width:15%;display:grid;align-items:center;pointer-events:auto}.next-prev-button-trigger-area.prev-button-trigger-area{justify-content:flex-start}.next-prev-button-trigger-area.next-button-trigger-area{justify-content:flex-end}.next-prev-button{font-size:4rem;fill:var(--white);filter:drop-shadow(0 0 1rem var(--text-color-secondary));opacity:70%}.current-image-display-placeholder{background-color:var(--background-color-secondary);display:grid;display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:.5rem}.current-image-display-placeholder svg{width:10rem;height:10rem;color:var(--svg-color)}.image-gallery-area-enter{transform:translate(150%)}.image-gallery-area-enter-active{transform:translate(0);transition:all .12s ease-out}.image-gallery-area-exit{transform:translate(0)}.image-gallery-area-exit-active{transform:translate(150%);transition:all .12s ease-out}.image-gallery-area{z-index:10}.image-gallery-area[data-pinned=false]{position:fixed;height:100vh;top:0;right:0}.image-gallery-area[data-pinned=false] .image-gallery-popup{border-radius:0}.image-gallery-area[data-pinned=false] .image-gallery-popup .image-gallery-container{max-height:calc(100vh + 4.7rem)}.image-gallery-area .image-gallery-popup{background-color:var(--tab-color);padding:1rem;display:flex;flex-direction:column;row-gap:1rem;border-radius:.5rem;border-left-width:.3rem;border-color:var(--resizeable-handle-border-color)}.image-gallery-area .image-gallery-popup[data-resize-alert=true]{border-color:var(--status-bad-color)}.image-gallery-area .image-gallery-popup .image-gallery-header{display:flex;align-items:center;column-gap:.5rem;justify-content:space-between}.image-gallery-area .image-gallery-popup .image-gallery-header div{display:flex;column-gap:.5rem}.image-gallery-area .image-gallery-popup .image-gallery-header .image-gallery-icon-btn{background-color:var(--btn-load-more)!important}.image-gallery-area .image-gallery-popup .image-gallery-header .image-gallery-icon-btn:hover{background-color:var(--btn-load-more-hover)!important}.image-gallery-area .image-gallery-popup .image-gallery-header .image-gallery-settings-popover{display:flex;flex-direction:column;row-gap:.5rem}.image-gallery-area .image-gallery-popup .image-gallery-header .image-gallery-settings-popover div{display:flex;column-gap:.5rem;align-items:center;justify-content:space-between}.image-gallery-area .image-gallery-popup .image-gallery-header h1{font-weight:700}.image-gallery-area .image-gallery-popup .image-gallery-container{display:flex;flex-direction:column;max-height:calc(100vh - 10rem);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.image-gallery-area .image-gallery-popup .image-gallery-container::-webkit-scrollbar{display:none}.image-gallery-area .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder{display:flex;flex-direction:column;background-color:var(--background-color-secondary);border-radius:.5rem;place-items:center;padding:2rem;text-align:center}.image-gallery-area .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder p{color:var(--subtext-color-bright);font-family:Inter}.image-gallery-area .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder svg{width:5rem;height:5rem;color:var(--svg-color)}.image-gallery-area .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn{background-color:var(--btn-load-more)!important;font-size:.85rem!important;padding:.5rem;margin-top:1rem}.image-gallery-area .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn:disabled:hover{background-color:var(--btn-load-more)!important}.image-gallery-area .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn:hover{background-color:var(--btn-load-more-hover)!important}.image-gallery-category-btn-group{width:100%!important;column-gap:0!important;justify-content:stretch!important}.image-gallery-category-btn-group button{flex-grow:1}.image-gallery-category-btn-group button[data-selected=true]{background-color:var(--accent-color)}.image-gallery-category-btn-group button[data-selected=true]:hover{background-color:var(--accent-color-hover)}.image-gallery{display:grid;grid-gap:.5rem}.image-gallery .hoverable-image{padding:.5rem;position:relative}.image-gallery .hoverable-image:before{content:"";display:block;padding-bottom:100%}.image-gallery .hoverable-image .hoverable-image-image{position:absolute;max-width:100%;top:50%;left:50%;transform:translate(-50%,-50%)}.hoverable-image{display:flex;justify-content:center;transition:transform .2s ease-out}.hoverable-image:hover{cursor:pointer;border-radius:.5rem;z-index:2}.hoverable-image .hoverable-image-image{width:100%;height:100%;max-width:100%;max-height:100%}.hoverable-image .hoverable-image-delete-button{position:absolute;top:.25rem;right:.25rem}.hoverable-image .hoverable-image-content{display:flex;position:absolute;top:0;left:0;width:100%;height:100%;align-items:center;justify-content:center}.hoverable-image .hoverable-image-content .hoverable-image-check{fill:var(--status-good-color)}.hoverable-image .hoverable-image-icons{position:absolute;bottom:-2rem;display:grid;width:min-content;grid-template-columns:repeat(2,max-content);border-radius:.4rem;background-color:var(--background-color-secondary);padding:.2rem;gap:.2rem;grid-auto-rows:max-content}.hoverable-image .hoverable-image-icons button{width:12px;height:12px;border-radius:.2rem;padding:10px 0;flex-shrink:2}.hoverable-image .hoverable-image-icons button svg{width:12px;height:12px}.hoverable-image-context-menu{z-index:15;padding:.4rem;border-radius:.25rem;background-color:var(--context-menu-bg-color);box-shadow:var(--context-menu-box-shadow)}.hoverable-image-context-menu [role=menuitem]{font-size:.8rem;line-height:1rem;border-radius:3px;display:flex;align-items:center;height:1.75rem;padding:0 .5rem;position:relative;user-select:none;cursor:pointer;outline:none}.hoverable-image-context-menu [role=menuitem][data-disabled]{color:gray;pointer-events:none;cursor:not-allowed}.hoverable-image-context-menu [role=menuitem][data-warning]{color:var(--status-bad-color)}.hoverable-image-context-menu [role=menuitem][data-highlighted]{background-color:var(--context-menu-bg-color-hover)}.popover-content{background-color:var(--background-color-secondary)!important;border:none!important;border-top:0px;background-color:var(--tab-hover-color);border-radius:0 0 .4rem .4rem}.popover-arrow{background:var(--tab-hover-color)!important;box-shadow:none}.popover-options{background:var(--tab-panel-bg);border-radius:0 0 .4rem .4rem;border:2px solid var(--tab-hover-color);padding:.75rem 1rem;display:grid;grid-auto-rows:max-content;grid-row-gap:.5rem;justify-content:space-between}.popover-header{background:var(--tab-hover-color);border-radius:.4rem .4rem 0 0;font-weight:700;border:none;padding-left:1rem!important}.upscale-popover{width:23rem!important}.show-hide-gallery-button{position:absolute!important;top:50%;right:-1rem;transform:translateY(-50%);z-index:10;border-radius:.5rem 0 0 .5rem!important;padding:0 .5rem;min-width:1rem;min-height:12rem;background-color:var(--btn-grey)!important}.show-hide-gallery-button:hover{background-color:var(--btn-grey-hover)!important}.show-hide-gallery-button:disabled{background-color:#2d2d37!important}.show-hide-gallery-button:disabled:hover{background-color:#2d2d37!important}.show-hide-gallery-button svg{width:20px;height:20px;color:var(--btn-svg-color)}.image-metadata-viewer{position:absolute;top:0;width:100%;border-radius:.5rem;padding:1rem;background-color:var(--metadata-bg-color);overflow:scroll;max-height:calc(100vh - 8.4rem);height:100%;z-index:10}.image-json-viewer{border-radius:.5rem;margin:0 .5rem 1rem;padding:1rem;overflow-x:scroll;word-break:break-all;background-color:var(--metadata-json-bg-color)}.app-tabs{display:grid!important;grid-template-columns:min-content auto;column-gap:.5rem}.app-tabs-list{display:grid;row-gap:.3rem;grid-auto-rows:max-content;color:var(--tab-list-text-inactive)}.app-tabs-list button{font-size:.85rem;padding:.5rem}.app-tabs-list button:hover{background-color:var(--tab-hover-color);border-radius:.3rem}.app-tabs-list button svg{width:26px;height:26px}.app-tabs-list button[aria-selected=true]{background-color:var(--tab-list-bg);color:var(--tab-list-text);font-weight:700;border-radius:.3rem;border:none}.app-tabs-panels .app-tabs-panel{padding:0}.workarea-wrapper{position:relative;width:100%;height:100%}.workarea-wrapper .workarea-main{display:flex;column-gap:.5rem;height:100%}.workarea-wrapper .workarea-main .workarea-options-panel{width:22.5rem;max-width:22.5rem;flex-shrink:0}.workarea-wrapper .workarea-main .workarea-split-view{width:100%;display:grid;grid-template-columns:1fr 1fr;background-color:var(--background-color-secondary);border-radius:.5rem}.workarea-wrapper .workarea-main .workarea-single-view{width:100%;background-color:var(--background-color-secondary);border-radius:.5rem}.workarea-wrapper .workarea-main .workarea-split-view-left,.workarea-wrapper .workarea-main .workarea-split-view-right{display:flex;flex-direction:column;height:100%;width:100%;row-gap:1rem;background-color:var(--background-color-secondary);border-radius:.5rem;padding:1rem}.text-to-image-area{padding:1rem;height:100%}.text-to-image-panel{display:grid;row-gap:1rem;grid-auto-rows:max-content;height:calc(100vh - 4rem);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.text-to-image-panel::-webkit-scrollbar{display:none}.image-to-image-area{display:flex;flex-direction:column;row-gap:1rem;width:100%;height:100%}.image-to-image-panel{display:grid;row-gap:1rem;grid-auto-rows:max-content;height:calc(100vh - 4rem);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.image-to-image-panel::-webkit-scrollbar{display:none}.image-to-image-strength-main-option{display:grid;grid-template-columns:none!important}.image-to-image-strength-main-option .number-input-entry{padding:0 1rem}.init-image-preview-header{display:flex;align-items:center;justify-content:space-between;width:100%}.init-image-preview-header h2{font-weight:700;font-size:.9rem}.init-image-preview{position:relative;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.init-image-preview img{border-radius:.5rem;object-fit:contain;position:absolute}.image-to-image-current-image-display{position:relative}.inpainting-main-area{display:flex;flex-direction:column;align-items:center;row-gap:1rem;width:100%;height:100%}.inpainting-main-area .inpainting-settings{display:flex;align-items:center;column-gap:1rem}.inpainting-main-area .inpainting-settings .inpainting-buttons-group{display:flex;align-items:center;column-gap:.5rem}.inpainting-main-area .inpainting-settings .inpainting-button-dropdown{display:flex;flex-direction:column;row-gap:.5rem}.inpainting-main-area .inpainting-settings .inpainting-color-picker{margin-left:1rem!important}.inpainting-main-area .inpainting-settings .inpainting-slider-numberinput{display:flex;column-gap:1rem;align-items:center}.inpainting-main-area .inpainting-canvas-area{display:flex;flex-direction:column;align-items:center;row-gap:1rem;width:100%;height:100%}.inpainting-main-area .inpainting-canvas-wrapper{display:flex;align-items:center;justify-content:center;position:relative;height:100%;width:100%;border-radius:.5rem}.inpainting-main-area .inpainting-canvas-wrapper .inpainting-alerts{position:absolute;top:0;left:0;display:flex;column-gap:.5rem;z-index:2;padding:.5rem;pointer-events:none;font-size:.9rem;font-weight:700}.inpainting-main-area .inpainting-canvas-wrapper .inpainting-alerts div{background-color:var(--accent-color);color:var(--text-color);padding:.2rem .6rem;border-radius:.25rem}.inpainting-main-area .inpainting-canvas-wrapper .inpainting-canvas-stage{border-radius:.5rem}.inpainting-main-area .inpainting-canvas-wrapper .inpainting-canvas-stage canvas{border-radius:.5rem}.inpainting-workarea-overrides .image-gallery-area .chakra-popover__popper{inset:0 auto auto -75px!important}.invokeai__number-input-form-control{display:grid;grid-template-columns:max-content auto;column-gap:1rem;align-items:center}.invokeai__number-input-form-control .invokeai__number-input-form-label{color:var(--text-color-secondary);margin-right:0;font-size:1rem;margin-bottom:0;flex-grow:2;white-space:nowrap}.invokeai__number-input-form-control .invokeai__number-input-form-label[data-focus]+.invokeai__number-input-root{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__number-input-form-control .invokeai__number-input-form-label[aria-invalid=true]+.invokeai__number-input-root{outline:none;border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.invokeai__number-input-form-control .invokeai__number-input-root{height:2rem;display:grid;grid-template-columns:auto max-content;column-gap:.5rem;align-items:center;background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.2rem}.invokeai__number-input-form-control .invokeai__number-input-field{border:none;font-weight:700;width:100%;height:auto;padding:0;font-size:.9rem;padding-left:.5rem;padding-right:.5rem}.invokeai__number-input-form-control .invokeai__number-input-field:focus{outline:none;box-shadow:none}.invokeai__number-input-form-control .invokeai__number-input-field:disabled{opacity:.2}.invokeai__number-input-form-control .invokeai__number-input-stepper{display:grid;padding-right:.5rem}.invokeai__number-input-form-control .invokeai__number-input-stepper .invokeai__number-input-stepper-button{border:none;padding:0 .5rem;margin:0 -.5rem}.invokeai__number-input-form-control .invokeai__number-input-stepper .invokeai__number-input-stepper-button svg{width:10px;height:10px}.input{display:grid;grid-template-columns:max-content auto;column-gap:1rem;align-items:center}.input .input-label{color:var(--text-color-secondary);margin-right:0}.input .input-entry{background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.2rem;font-weight:700}.input .input-entry:focus{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.input .input-entry:disabled{opacity:.2}.input .input-entry[aria-invalid=true]{outline:none;border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.icon-button{background-color:var(--btn-grey);cursor:pointer}.icon-button:hover{background-color:var(--btn-grey-hover)}.icon-button[data-selected=true]{background-color:var(--accent-color)}.icon-button[data-selected=true]:hover{background-color:var(--accent-color-hover)}.icon-button[disabled]{cursor:not-allowed}.invokeai__switch-form-control .invokeai__switch-form-label{display:flex;column-gap:1rem;justify-content:space-between;align-items:center;color:var(--text-color-secondary);font-size:1rem;margin-right:0;margin-bottom:.1rem;white-space:nowrap;width:auto}.invokeai__switch-form-control .invokeai__switch-form-label .invokeai__switch-root span{background-color:var(--switch-bg-color)}.invokeai__switch-form-control .invokeai__switch-form-label .invokeai__switch-root span span{background-color:var(--white)}.invokeai__switch-form-control .invokeai__switch-form-label .invokeai__switch-root[data-checked] span{background:var(--switch-bg-active-color)}.invokeai__switch-form-control .invokeai__switch-form-label .invokeai__switch-root[data-checked] span span{background-color:var(--white)}.invokeai__select{display:grid;grid-template-columns:repeat(2,max-content);column-gap:1rem;align-items:center;width:max-content}.invokeai__select .invokeai__select-label{color:var(--text-color-secondary);margin-right:0}.invokeai__select .invokeai__select-picker{border:2px solid var(--border-color);background-color:var(--background-color-secondary);font-weight:700;height:2rem;border-radius:.2rem}.invokeai__select .invokeai__select-picker:focus{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__select .invokeai__select-option{background-color:var(--background-color-secondary)}.invokeai__slider-form-control{display:flex;column-gap:1rem;justify-content:space-between;align-items:center;width:max-content;padding-right:.25rem}.invokeai__slider-form-control .invokeai__slider-inner-container{display:flex;column-gap:.5rem}.invokeai__slider-form-control .invokeai__slider-inner-container .invokeai__slider-form-label{color:var(--text-color-secondary);margin:0;margin-right:.5rem;margin-bottom:.1rem}.invokeai__slider-form-control .invokeai__slider-inner-container .invokeai__slider-root .invokeai__slider-filled-track{background-color:var(--accent-color-hover)}.invokeai__slider-form-control .invokeai__slider-inner-container .invokeai__slider-root .invokeai__slider-track{background-color:var(--text-color-secondary);height:5px;border-radius:9999px}.invokeai__checkbox .chakra-checkbox__label{margin-top:1px;color:var(--text-color-secondary);font-size:.9rem}.invokeai__checkbox .chakra-checkbox__control{width:1rem;height:1rem;border:none;border-radius:.2rem;background-color:var(--input-checkbox-bg)}.invokeai__checkbox .chakra-checkbox__control svg{width:.6rem;height:.6rem;stroke-width:3px!important}.invokeai__checkbox .chakra-checkbox__control[data-checked]{color:var(--text-color);background-color:var(--input-checkbox-checked-bg)}.invokeai__popover-content{min-width:unset;width:unset!important;padding:1rem;border-radius:.5rem!important;background-color:var(--background-color)!important;border:2px solid var(--border-color)!important}.invokeai__popover-content .invokeai__popover-arrow{background-color:var(--background-color)!important}.invokeai__color-picker .react-colorful__hue-pointer,.invokeai__color-picker .react-colorful__saturation-pointer{width:1.5rem;height:1.5rem;border-color:var(--white)}.dropzone-container{position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:999;backdrop-filter:blur(20px)}.dropzone-container .dropzone-overlay{opacity:.5;width:100%;height:100%;display:flex;flex-direction:column;row-gap:1rem;align-items:center;justify-content:center}.dropzone-container .dropzone-overlay.is-drag-accept{box-shadow:inset 0 0 20rem 1rem var(--status-good-color)}.dropzone-container .dropzone-overlay.is-drag-reject{box-shadow:inset 0 0 20rem 1rem var(--status-bad-color)}.dropzone-container .dropzone-overlay.is-handling-upload{box-shadow:inset 0 0 20rem 1rem var(--status-working-color)}.image-uploader-button-outer{width:100%;height:100%;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:.5rem;color:var(--subtext-color-bright)}.image-uploader-button-outer:hover{background-color:var(--inpaint-bg-color)}.image-upload-button-inner{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.image-upload-button{display:flex;flex-direction:column;row-gap:2rem;align-items:center;justify-content:center;text-align:center}.image-upload-button svg{width:4rem!important;height:4rem!important}.image-upload-button h2{font-size:1.2rem!important}.work-in-progress{display:grid;width:100%;height:calc(100vh - 4rem);grid-auto-rows:max-content;background-color:var(--background-color-secondary);border-radius:.4rem;place-content:center;place-items:center;row-gap:1rem}.work-in-progress h1{font-size:2rem;font-weight:700}.work-in-progress p{text-align:center;max-width:50rem;color:var(--subtext-color-bright)}.guide-popover-arrow{background-color:var(--tab-panel-bg)!important;box-shadow:none!important}.guide-popover-content{background-color:var(--background-color-secondary)!important;border:none!important}.guide-popover-guide-content{background:var(--tab-panel-bg);border:2px solid var(--tab-hover-color);border-radius:.4rem;padding:.75rem 1rem;display:grid;grid-template-rows:repeat(auto-fill,1fr);grid-row-gap:.5rem;justify-content:space-between}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{-ms-overflow-style:none;scrollbar-width:none;background-color:var(--root-bg-color);overflow:hidden}html::-webkit-scrollbar,body::-webkit-scrollbar{display:none}#root{background-color:var(--root-bg-color);color:var(--text-color);font-family:Inter,Arial,Helvetica,sans-serif} diff --git a/frontend/dist/assets/index.64b87783.js b/frontend/dist/assets/index.64b87783.js new file mode 100644 index 0000000000..98a4794090 --- /dev/null +++ b/frontend/dist/assets/index.64b87783.js @@ -0,0 +1,517 @@ +function gj(e,t){for(var n=0;nr[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 Cu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function YC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w={exports:{}},Yt={};/** + * @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 Qm=Symbol.for("react.element"),mj=Symbol.for("react.portal"),vj=Symbol.for("react.fragment"),yj=Symbol.for("react.strict_mode"),bj=Symbol.for("react.profiler"),xj=Symbol.for("react.provider"),Sj=Symbol.for("react.context"),wj=Symbol.for("react.forward_ref"),Cj=Symbol.for("react.suspense"),_j=Symbol.for("react.memo"),kj=Symbol.for("react.lazy"),pk=Symbol.iterator;function Ej(e){return e===null||typeof e!="object"?null:(e=pk&&e[pk]||e["@@iterator"],typeof e=="function"?e:null)}var SI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wI=Object.assign,CI={};function O0(e,t,n){this.props=e,this.context=t,this.refs=CI,this.updater=n||SI}O0.prototype.isReactComponent={};O0.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")};O0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _I(){}_I.prototype=O0.prototype;function XC(e,t,n){this.props=e,this.context=t,this.refs=CI,this.updater=n||SI}var QC=XC.prototype=new _I;QC.constructor=XC;wI(QC,O0.prototype);QC.isPureReactComponent=!0;var gk=Array.isArray,kI=Object.prototype.hasOwnProperty,JC={current:null},EI={key:!0,ref:!0,__self:!0,__source:!0};function PI(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)kI.call(t,r)&&!EI.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,ie=G[W];if(0>>1;Wi(De,Q))Rei(Ve,De)?(G[W]=Ve,G[Re]=Q,W=Re):(G[W]=De,G[be]=Q,W=be);else if(Rei(Ve,Q))G[W]=Ve,G[Re]=Q,W=Re;else break e}}return te}function i(G,te){var Q=G.sortIndex-te.sortIndex;return Q!==0?Q:G.id-te.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=[],d=[],p=1,g=null,m=3,y=!1,x=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(G){for(var te=n(d);te!==null;){if(te.callback===null)r(d);else if(te.startTime<=G)r(d),te.sortIndex=te.expirationTime,t(l,te);else break;te=n(d)}}function M(G){if(S=!1,T(G),!x)if(n(l)!==null)x=!0,Se(N);else{var te=n(d);te!==null&&J(M,te.startTime-G)}}function N(G,te){x=!1,S&&(S=!1,P(B),B=-1),y=!0;var Q=m;try{for(T(te),g=n(l);g!==null&&(!(g.expirationTime>te)||G&&!X());){var W=g.callback;if(typeof W=="function"){g.callback=null,m=g.priorityLevel;var ie=W(g.expirationTime<=te);te=e.unstable_now(),typeof ie=="function"?g.callback=ie:g===n(l)&&r(l),T(te)}else r(l);g=n(l)}if(g!==null)var de=!0;else{var be=n(d);be!==null&&J(M,be.startTime-te),de=!1}return de}finally{g=null,m=Q,y=!1}}var F=!1,z=null,B=-1,K=5,j=-1;function X(){return!(e.unstable_now()-jG||125W?(G.sortIndex=Q,t(d,G),n(l)===null&&G===n(d)&&(S?(P(B),B=-1):S=!0,J(M,Q-W))):(G.sortIndex=ie,t(l,G),x||y||(x=!0,Se(N))),G},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(G){var te=m;return function(){var Q=m;m=te;try{return G.apply(this,arguments)}finally{m=Q}}}})(TI);(function(e){e.exports=TI})(Gp);/** + * @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 LI=w.exports,ba=Gp.exports;function ze(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),KS=Object.prototype.hasOwnProperty,Ij=/^[: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]*$/,vk={},yk={};function Mj(e){return KS.call(yk,e)?!0:KS.call(vk,e)?!1:Ij.test(e)?yk[e]=!0:(vk[e]=!0,!1)}function Rj(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 Oj(e,t,n,r){if(t===null||typeof t>"u"||Rj(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 xo(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 Fi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fi[e]=new xo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fi[t]=new xo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fi[e]=new xo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fi[e]=new xo(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){Fi[e]=new xo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fi[e]=new xo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fi[e]=new xo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fi[e]=new xo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fi[e]=new xo(e,5,!1,e.toLowerCase(),null,!1,!1)});var t9=/[\-:]([a-z])/g;function n9(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(t9,n9);Fi[t]=new xo(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(t9,n9);Fi[t]=new xo(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(t9,n9);Fi[t]=new xo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fi[e]=new xo(e,1,!1,e.toLowerCase(),null,!1,!1)});Fi.xlinkHref=new xo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fi[e]=new xo(e,1,!1,e.toLowerCase(),null,!0,!0)});function r9(e,t,n,r){var i=Fi.hasOwnProperty(t)?Fi[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{ax=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fg(e):""}function Nj(e){switch(e.tag){case 5:return fg(e.type);case 16:return fg("Lazy");case 13:return fg("Suspense");case 19:return fg("SuspenseList");case 0:case 2:case 15:return e=sx(e.type,!1),e;case 11:return e=sx(e.type.render,!1),e;case 1:return e=sx(e.type,!0),e;default:return""}}function XS(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 Tp:return"Fragment";case Pp:return"Portal";case qS:return"Profiler";case i9:return"StrictMode";case ZS:return"Suspense";case YS:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case MI:return(e.displayName||"Context")+".Consumer";case II:return(e._context.displayName||"Context")+".Provider";case o9:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case a9:return t=e.displayName||null,t!==null?t:XS(e.type)||"Memo";case $c:t=e._payload,e=e._init;try{return XS(e(t))}catch{}}return null}function Dj(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 XS(t);case 8:return t===i9?"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 ld(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function OI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zj(e){var t=OI(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 b2(e){e._valueTracker||(e._valueTracker=zj(e))}function NI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=OI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function x5(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 QS(e,t){var n=t.checked;return gr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ld(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 DI(e,t){t=t.checked,t!=null&&r9(e,"checked",t,!1)}function JS(e,t){DI(e,t);var n=ld(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")?ew(e,t.type,n):t.hasOwnProperty("defaultValue")&&ew(e,t.type,ld(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sk(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 ew(e,t,n){(t!=="number"||x5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var hg=Array.isArray;function jp(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=x2.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function am(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ag={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},Fj=["Webkit","ms","Moz","O"];Object.keys(Ag).forEach(function(e){Fj.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ag[t]=Ag[e]})});function BI(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ag.hasOwnProperty(e)&&Ag[e]?(""+t).trim():t+"px"}function HI(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=BI(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var $j=gr({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 rw(e,t){if(t){if($j[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ze(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ze(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ze(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ze(62))}}function iw(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 ow=null;function s9(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var aw=null,Kp=null,qp=null;function _k(e){if(e=tv(e)){if(typeof aw!="function")throw Error(ze(280));var t=e.stateNode;t&&(t=V3(t),aw(e.stateNode,e.type,t))}}function WI(e){Kp?qp?qp.push(e):qp=[e]:Kp=e}function VI(){if(Kp){var e=Kp,t=qp;if(qp=Kp=null,_k(e),t)for(e=0;e>>=0,e===0?32:31-(Yj(e)/Xj|0)|0}var S2=64,w2=4194304;function pg(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 _5(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=pg(s):(o&=a,o!==0&&(r=pg(o)))}else a=n&~i,a!==0?r=pg(a):o!==0&&(r=pg(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jm(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ms(t),e[t]=n}function tK(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=Mg),Rk=String.fromCharCode(32),Ok=!1;function uM(e,t){switch(e){case"keyup":return LK.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cM(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Lp=!1;function IK(e,t){switch(e){case"compositionend":return cM(t);case"keypress":return t.which!==32?null:(Ok=!0,Rk);case"textInput":return e=t.data,e===Rk&&Ok?null:e;default:return null}}function MK(e,t){if(Lp)return e==="compositionend"||!g9&&uM(e,t)?(e=sM(),My=f9=jc=null,Lp=!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)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=Fk(n)}}function pM(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pM(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gM(){for(var e=window,t=x5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=x5(e.document)}return t}function m9(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 HK(e){var t=gM(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pM(n.ownerDocument.documentElement,n)){if(r!==null&&m9(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=$k(n,o);var a=$k(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=document.documentMode,Ap=null,fw=null,Og=null,hw=!1;function Bk(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;hw||Ap==null||Ap!==x5(r)||(r=Ap,"selectionStart"in r&&m9(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}),Og&&fm(Og,r)||(Og=r,r=P5(fw,"onSelect"),0Rp||(e.current=bw[Rp],bw[Rp]=null,Rp--)}function Un(e,t){Rp++,bw[Rp]=e.current,e.current=t}var ud={},Qi=yd(ud),Bo=yd(!1),nh=ud;function p0(e,t){var n=e.type.contextTypes;if(!n)return ud;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 Ho(e){return e=e.childContextTypes,e!=null}function L5(){Xn(Bo),Xn(Qi)}function Kk(e,t,n){if(Qi.current!==ud)throw Error(ze(168));Un(Qi,t),Un(Bo,n)}function _M(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(ze(108,Dj(e)||"Unknown",i));return gr({},n,r)}function A5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ud,nh=Qi.current,Un(Qi,e),Un(Bo,Bo.current),!0}function qk(e,t,n){var r=e.stateNode;if(!r)throw Error(ze(169));n?(e=_M(e,t,nh),r.__reactInternalMemoizedMergedChildContext=e,Xn(Bo),Xn(Qi),Un(Qi,e)):Xn(Bo),Un(Bo,n)}var wu=null,U3=!1,Sx=!1;function kM(e){wu===null?wu=[e]:wu.push(e)}function JK(e){U3=!0,kM(e)}function bd(){if(!Sx&&wu!==null){Sx=!0;var e=0,t=Tn;try{var n=wu;for(Tn=1;e>=a,i-=a,ku=1<<32-Ms(t)+i|n<B?(K=z,z=null):K=z.sibling;var j=m(P,z,T[B],M);if(j===null){z===null&&(z=K);break}e&&z&&j.alternate===null&&t(P,z),k=o(j,k,B),F===null?N=j:F.sibling=j,F=j,z=K}if(B===T.length)return n(P,z),rr&&Tf(P,B),N;if(z===null){for(;BB?(K=z,z=null):K=z.sibling;var X=m(P,z,j.value,M);if(X===null){z===null&&(z=K);break}e&&z&&X.alternate===null&&t(P,z),k=o(X,k,B),F===null?N=X:F.sibling=X,F=X,z=K}if(j.done)return n(P,z),rr&&Tf(P,B),N;if(z===null){for(;!j.done;B++,j=T.next())j=g(P,j.value,M),j!==null&&(k=o(j,k,B),F===null?N=j:F.sibling=j,F=j);return rr&&Tf(P,B),N}for(z=r(P,z);!j.done;B++,j=T.next())j=y(z,P,B,j.value,M),j!==null&&(e&&j.alternate!==null&&z.delete(j.key===null?B:j.key),k=o(j,k,B),F===null?N=j:F.sibling=j,F=j);return e&&z.forEach(function(ue){return t(P,ue)}),rr&&Tf(P,B),N}function E(P,k,T,M){if(typeof T=="object"&&T!==null&&T.type===Tp&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case y2:e:{for(var N=T.key,F=k;F!==null;){if(F.key===N){if(N=T.type,N===Tp){if(F.tag===7){n(P,F.sibling),k=i(F,T.props.children),k.return=P,P=k;break e}}else if(F.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===$c&&tE(N)===F.type){n(P,F.sibling),k=i(F,T.props),k.ref=Z1(P,F,T),k.return=P,P=k;break e}n(P,F);break}else t(P,F);F=F.sibling}T.type===Tp?(k=Yf(T.props.children,P.mode,M,T.key),k.return=P,P=k):(M=By(T.type,T.key,T.props,null,P.mode,M),M.ref=Z1(P,k,T),M.return=P,P=M)}return a(P);case Pp:e:{for(F=T.key;k!==null;){if(k.key===F)if(k.tag===4&&k.stateNode.containerInfo===T.containerInfo&&k.stateNode.implementation===T.implementation){n(P,k.sibling),k=i(k,T.children||[]),k.return=P,P=k;break e}else{n(P,k);break}else t(P,k);k=k.sibling}k=Lx(T,P.mode,M),k.return=P,P=k}return a(P);case $c:return F=T._init,E(P,k,F(T._payload),M)}if(hg(T))return x(P,k,T,M);if(U1(T))return S(P,k,T,M);L2(P,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,k!==null&&k.tag===6?(n(P,k.sibling),k=i(k,T),k.return=P,P=k):(n(P,k),k=Tx(T,P.mode,M),k.return=P,P=k),a(P)):n(P,k)}return E}var m0=RM(!0),OM=RM(!1),nv={},kl=yd(nv),mm=yd(nv),vm=yd(nv);function Bf(e){if(e===nv)throw Error(ze(174));return e}function k9(e,t){switch(Un(vm,t),Un(mm,e),Un(kl,nv),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:nw(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=nw(t,e)}Xn(kl),Un(kl,t)}function v0(){Xn(kl),Xn(mm),Xn(vm)}function NM(e){Bf(vm.current);var t=Bf(kl.current),n=nw(t,e.type);t!==n&&(Un(mm,e),Un(kl,n))}function E9(e){mm.current===e&&(Xn(kl),Xn(mm))}var hr=yd(0);function D5(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)!==0)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 wx=[];function P9(){for(var e=0;en?n:4,e(!0);var r=Cx.transition;Cx.transition={};try{e(!1),t()}finally{Tn=n,Cx.transition=r}}function XM(){return es().memoizedState}function rq(e,t,n){var r=id(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},QM(e))JM(t,n);else if(n=LM(e,t,n,r),n!==null){var i=vo();Rs(n,e,r,i),eR(n,t,r)}}function iq(e,t,n){var r=id(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(QM(e))JM(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,Ns(s,a)){var l=t.interleaved;l===null?(i.next=i,C9(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=LM(e,t,i,r),n!==null&&(i=vo(),Rs(n,e,r,i),eR(n,t,r))}}function QM(e){var t=e.alternate;return e===pr||t!==null&&t===pr}function JM(e,t){Ng=z5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eR(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,u9(e,n)}}var F5={readContext:Ja,useCallback:ji,useContext:ji,useEffect:ji,useImperativeHandle:ji,useInsertionEffect:ji,useLayoutEffect:ji,useMemo:ji,useReducer:ji,useRef:ji,useState:ji,useDebugValue:ji,useDeferredValue:ji,useTransition:ji,useMutableSource:ji,useSyncExternalStore:ji,useId:ji,unstable_isNewReconciler:!1},oq={readContext:Ja,useCallback:function(e,t){return pl().memoizedState=[e,t===void 0?null:t],e},useContext:Ja,useEffect:rE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dy(4194308,4,jM.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dy(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dy(4,2,e,t)},useMemo:function(e,t){var n=pl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=pl();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=rq.bind(null,pr,e),[r.memoizedState,e]},useRef:function(e){var t=pl();return e={current:e},t.memoizedState=e},useState:nE,useDebugValue:M9,useDeferredValue:function(e){return pl().memoizedState=e},useTransition:function(){var e=nE(!1),t=e[0];return e=nq.bind(null,e[1]),pl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pr,i=pl();if(rr){if(n===void 0)throw Error(ze(407));n=n()}else{if(n=t(),vi===null)throw Error(ze(349));(ih&30)!==0||FM(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,rE(BM.bind(null,r,o,e),[e]),r.flags|=2048,xm(9,$M.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=pl(),t=vi.identifierPrefix;if(rr){var n=Eu,r=ku;n=(r&~(1<<32-Ms(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ym++,0<\/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[xl]=t,e[gm]=r,uR(e,t,!1,!1),t.stateNode=e;e:{switch(a=iw(n,r),n){case"dialog":Zn("cancel",e),Zn("close",e),i=r;break;case"iframe":case"object":case"embed":Zn("load",e),i=r;break;case"video":case"audio":for(i=0;ib0&&(t.flags|=128,r=!0,Y1(o,!1),t.lanes=4194304)}else{if(!r)if(e=D5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Y1(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!rr)return Ki(t),null}else 2*$r()-o.renderingStartTime>b0&&n!==1073741824&&(t.flags|=128,r=!0,Y1(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=$r(),t.sibling=null,n=hr.current,Un(hr,r?n&1|2:n&1),t):(Ki(t),null);case 22:case 23:return F9(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(fa&1073741824)!==0&&(Ki(t),t.subtreeFlags&6&&(t.flags|=8192)):Ki(t),null;case 24:return null;case 25:return null}throw Error(ze(156,t.tag))}function hq(e,t){switch(y9(t),t.tag){case 1:return Ho(t.type)&&L5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return v0(),Xn(Bo),Xn(Qi),P9(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return E9(t),null;case 13:if(Xn(hr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ze(340));g0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xn(hr),null;case 4:return v0(),null;case 10:return w9(t.type._context),null;case 22:case 23:return F9(),null;case 24:return null;default:return null}}var I2=!1,Yi=!1,pq=typeof WeakSet=="function"?WeakSet:Set,ot=null;function zp(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_r(e,t,r)}else n.current=null}function Iw(e,t,n){try{n()}catch(r){_r(e,t,r)}}var fE=!1;function gq(e,t){if(pw=k5,e=gM(),m9(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,d=0,p=0,g=e,m=null;t:for(;;){for(var y;g!==n||i!==0&&g.nodeType!==3||(s=a+i),g!==o||r!==0&&g.nodeType!==3||(l=a+r),g.nodeType===3&&(a+=g.nodeValue.length),(y=g.firstChild)!==null;)m=g,g=y;for(;;){if(g===e)break t;if(m===n&&++d===i&&(s=a),m===o&&++p===r&&(l=a),(y=g.nextSibling)!==null)break;g=m,m=g.parentNode}g=y}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(gw={focusedElem:e,selectionRange:n},k5=!1,ot=t;ot!==null;)if(t=ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ot=e;else for(;ot!==null;){t=ot;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var S=x.memoizedProps,E=x.memoizedState,P=t.stateNode,k=P.getSnapshotBeforeUpdate(t.elementType===t.type?S:Ps(t.type,S),E);P.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ze(163))}}catch(M){_r(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,ot=e;break}ot=t.return}return x=fE,fE=!1,x}function Dg(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&&Iw(t,n,o)}i=i.next}while(i!==r)}}function K3(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 Mw(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 fR(e){var t=e.alternate;t!==null&&(e.alternate=null,fR(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xl],delete t[gm],delete t[yw],delete t[XK],delete t[QK])),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 hR(e){return e.tag===5||e.tag===3||e.tag===4}function hE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hR(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 Rw(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=T5));else if(r!==4&&(e=e.child,e!==null))for(Rw(e,t,n),e=e.sibling;e!==null;)Rw(e,t,n),e=e.sibling}function Ow(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(Ow(e,t,n),e=e.sibling;e!==null;)Ow(e,t,n),e=e.sibling}var Oi=null,Ts=!1;function Ic(e,t,n){for(n=n.child;n!==null;)pR(e,t,n),n=n.sibling}function pR(e,t,n){if(_l&&typeof _l.onCommitFiberUnmount=="function")try{_l.onCommitFiberUnmount($3,n)}catch{}switch(n.tag){case 5:Yi||zp(n,t);case 6:var r=Oi,i=Ts;Oi=null,Ic(e,t,n),Oi=r,Ts=i,Oi!==null&&(Ts?(e=Oi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oi.removeChild(n.stateNode));break;case 18:Oi!==null&&(Ts?(e=Oi,n=n.stateNode,e.nodeType===8?xx(e.parentNode,n):e.nodeType===1&&xx(e,n),cm(e)):xx(Oi,n.stateNode));break;case 4:r=Oi,i=Ts,Oi=n.stateNode.containerInfo,Ts=!0,Ic(e,t,n),Oi=r,Ts=i;break;case 0:case 11:case 14:case 15:if(!Yi&&(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)!==0||(o&4)!==0)&&Iw(n,t,a),i=i.next}while(i!==r)}Ic(e,t,n);break;case 1:if(!Yi&&(zp(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){_r(n,t,s)}Ic(e,t,n);break;case 21:Ic(e,t,n);break;case 22:n.mode&1?(Yi=(r=Yi)||n.memoizedState!==null,Ic(e,t,n),Yi=r):Ic(e,t,n);break;default:Ic(e,t,n)}}function pE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new pq),t.forEach(function(r){var i=_q.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ws(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=$r()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vq(r/1960))-r,10e?16:e,Kc===null)var r=!1;else{if(e=Kc,Kc=null,H5=0,(un&6)!==0)throw Error(ze(331));var i=un;for(un|=4,ot=e.current;ot!==null;){var o=ot,a=o.child;if((ot.flags&16)!==0){var s=o.deletions;if(s!==null){for(var l=0;l$r()-D9?Zf(e,0):N9|=n),Wo(e,t)}function wR(e,t){t===0&&((e.mode&1)===0?t=1:(t=w2,w2<<=1,(w2&130023424)===0&&(w2=4194304)));var n=vo();e=Iu(e,t),e!==null&&(Jm(e,t,n),Wo(e,n))}function Cq(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wR(e,n)}function _q(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(ze(314))}r!==null&&r.delete(t),wR(e,n)}var CR;CR=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bo.current)$o=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return $o=!1,dq(e,t,n);$o=(e.flags&131072)!==0}else $o=!1,rr&&(t.flags&1048576)!==0&&EM(t,M5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zy(e,t),e=t.pendingProps;var i=p0(t,Qi.current);Yp(t,n),i=L9(null,t,r,e,i,n);var o=A9();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,Ho(r)?(o=!0,A5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,_9(t),i.updater=G3,t.stateNode=i,i._reactInternals=t,_w(t,r,e,n),t=Pw(null,t,r,!0,o,n)):(t.tag=0,rr&&o&&v9(t),po(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zy(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Eq(r),e=Ps(r,e),i){case 0:t=Ew(null,t,r,e,n);break e;case 1:t=uE(null,t,r,e,n);break e;case 11:t=sE(null,t,r,e,n);break e;case 14:t=lE(null,t,r,Ps(r.type,e),n);break e}throw Error(ze(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ps(r,i),Ew(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ps(r,i),uE(e,t,r,i,n);case 3:e:{if(aR(t),e===null)throw Error(ze(387));r=t.pendingProps,o=t.memoizedState,i=o.element,AM(e,t),N5(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=y0(Error(ze(423)),t),t=cE(e,t,r,n,i);break e}else if(r!==i){i=y0(Error(ze(424)),t),t=cE(e,t,r,n,i);break e}else for(pa=td(t.stateNode.containerInfo.firstChild),ma=t,rr=!0,As=null,n=OM(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(g0(),r===i){t=Mu(e,t,n);break e}po(e,t,r,n)}t=t.child}return t;case 5:return NM(t),e===null&&Sw(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,mw(r,i)?a=null:o!==null&&mw(r,o)&&(t.flags|=32),oR(e,t),po(e,t,a,n),t.child;case 6:return e===null&&Sw(t),null;case 13:return sR(e,t,n);case 4:return k9(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=m0(t,null,r,n):po(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ps(r,i),sE(e,t,r,i,n);case 7:return po(e,t,t.pendingProps,n),t.child;case 8:return po(e,t,t.pendingProps.children,n),t.child;case 12:return po(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,Un(R5,r._currentValue),r._currentValue=a,o!==null)if(Ns(o.value,a)){if(o.children===i.children&&!Bo.current){t=Mu(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=Tu(-1,n&-n),l.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?l.next=l:(l.next=p.next,p.next=l),d.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),ww(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(ze(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ww(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}po(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Yp(t,n),i=Ja(i),r=r(i),t.flags|=1,po(e,t,r,n),t.child;case 14:return r=t.type,i=Ps(r,t.pendingProps),i=Ps(r.type,i),lE(e,t,r,i,n);case 15:return rR(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ps(r,i),zy(e,t),t.tag=1,Ho(r)?(e=!0,A5(t)):e=!1,Yp(t,n),MM(t,r,i),_w(t,r,i,n),Pw(null,t,r,!0,e,n);case 19:return lR(e,t,n);case 22:return iR(e,t,n)}throw Error(ze(156,t.tag))};function _R(e,t){return YI(e,t)}function kq(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 Za(e,t,n,r){return new kq(e,t,n,r)}function B9(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Eq(e){if(typeof e=="function")return B9(e)?1:0;if(e!=null){if(e=e.$$typeof,e===o9)return 11;if(e===a9)return 14}return 2}function od(e,t){var n=e.alternate;return n===null?(n=Za(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 By(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")B9(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Tp:return Yf(n.children,i,o,t);case i9:a=8,i|=8;break;case qS:return e=Za(12,n,t,i|2),e.elementType=qS,e.lanes=o,e;case ZS:return e=Za(13,n,t,i),e.elementType=ZS,e.lanes=o,e;case YS:return e=Za(19,n,t,i),e.elementType=YS,e.lanes=o,e;case RI:return Z3(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case II:a=10;break e;case MI:a=9;break e;case o9:a=11;break e;case a9:a=14;break e;case $c:a=16,r=null;break e}throw Error(ze(130,e==null?e:typeof e,""))}return t=Za(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Yf(e,t,n,r){return e=Za(7,e,r,t),e.lanes=n,e}function Z3(e,t,n,r){return e=Za(22,e,r,t),e.elementType=RI,e.lanes=n,e.stateNode={isHidden:!1},e}function Tx(e,t,n){return e=Za(6,e,null,t),e.lanes=n,e}function Lx(e,t,n){return t=Za(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pq(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=ux(0),this.expirationTimes=ux(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ux(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function H9(e,t,n,r,i,o,a,s,l){return e=new Pq(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Za(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_9(o),e}function Tq(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Ca})($l);const O2=YC($l.exports);var wE=$l.exports;jS.createRoot=wE.createRoot,jS.hydrateRoot=wE.hydrateRoot;var El=Boolean(globalThis?.document)?w.exports.useLayoutEffect:w.exports.useEffect,e4={exports:{}},t4={};/** + * @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 Rq=w.exports,Oq=Symbol.for("react.element"),Nq=Symbol.for("react.fragment"),Dq=Object.prototype.hasOwnProperty,zq=Rq.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Fq={key:!0,ref:!0,__self:!0,__source:!0};function TR(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)Dq.call(t,r)&&!Fq.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:Oq,type:e,key:o,ref:a,props:i,_owner:zq.current}}t4.Fragment=Nq;t4.jsx=TR;t4.jsxs=TR;(function(e){e.exports=t4})(e4);const jn=e4.exports.Fragment,_=e4.exports.jsx,ae=e4.exports.jsxs;var G9=w.exports.createContext({});G9.displayName="ColorModeContext";function j9(){const e=w.exports.useContext(G9);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var N2={light:"chakra-ui-light",dark:"chakra-ui-dark"};function $q(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i?.()},setClassName(r){document.body.classList.add(r?N2.dark:N2.light),document.body.classList.remove(r?N2.light:N2.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},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 Bq="chakra-ui-color-mode";function Hq(e){return{ssr:!1,type:"localStorage",get(t){if(!globalThis?.document)return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Wq=Hq(Bq),CE=()=>{};function _E(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function LR(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Wq}=e,s=i==="dark"?"dark":"light",[l,d]=w.exports.useState(()=>_E(a,s)),[p,g]=w.exports.useState(()=>_E(a)),{getSystemTheme:m,setClassName:y,setDataset:x,addListener:S}=w.exports.useMemo(()=>$q({preventTransition:o}),[o]),E=i==="system"&&!l?p:l,P=w.exports.useCallback(M=>{const N=M==="system"?m():M;d(N),y(N==="dark"),x(N),a.set(N)},[a,m,y,x]);El(()=>{i==="system"&&g(m())},[]),w.exports.useEffect(()=>{const M=a.get();if(M){P(M);return}if(i==="system"){P("system");return}P(s)},[a,s,i,P]);const k=w.exports.useCallback(()=>{P(E==="dark"?"light":"dark")},[E,P]);w.exports.useEffect(()=>{if(!!r)return S(P)},[r,S,P]);const T=w.exports.useMemo(()=>({colorMode:t??E,toggleColorMode:t?CE:k,setColorMode:t?CE:P}),[E,k,P,t]);return _(G9.Provider,{value:T,children:n})}LR.displayName="ColorModeProvider";var Vq=new Set(["dark","light","system"]);function Uq(e){let t=e;return Vq.has(t)||(t="light"),t}function Gq(e={}){const{initialColorMode:t="light",type:n="localStorage",storageKey:r="chakra-ui-color-mode"}=e,i=Uq(t),o=n==="cookie",a=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${i}",r="${r}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); + `,s=`(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${i}",e="${r}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})(); + `;return`!${o?a:s}`.trim()}function jq(e={}){return _("script",{id:"chakra-script",dangerouslySetInnerHTML:{__html:Gq(e)}})}var $w={exports:{}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",p="[object Boolean]",g="[object Date]",m="[object Error]",y="[object Function]",x="[object GeneratorFunction]",S="[object Map]",E="[object Number]",P="[object Null]",k="[object Object]",T="[object Proxy]",M="[object RegExp]",N="[object Set]",F="[object String]",z="[object Undefined]",B="[object WeakMap]",K="[object ArrayBuffer]",j="[object DataView]",X="[object Float32Array]",ue="[object Float64Array]",ge="[object Int8Array]",xe="[object Int16Array]",we="[object Int32Array]",Se="[object Uint8Array]",J="[object Uint8ClampedArray]",G="[object Uint16Array]",te="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,de={};de[X]=de[ue]=de[ge]=de[xe]=de[we]=de[Se]=de[J]=de[G]=de[te]=!0,de[s]=de[l]=de[K]=de[p]=de[j]=de[g]=de[m]=de[y]=de[S]=de[E]=de[k]=de[M]=de[N]=de[F]=de[B]=!1;var be=typeof Cu=="object"&&Cu&&Cu.Object===Object&&Cu,De=typeof self=="object"&&self&&self.Object===Object&&self,Re=be||De||Function("return this")(),Ve=t&&!t.nodeType&&t,ke=Ve&&!0&&e&&!e.nodeType&&e,$e=ke&&ke.exports===Ve,nt=$e&&be.process,ft=function(){try{var I=ke&&ke.require&&ke.require("util").types;return I||nt&&nt.binding&&nt.binding("util")}catch{}}(),Rt=ft&&ft.isTypedArray;function Ot(I,D,U){switch(U.length){case 0:return I.call(D);case 1:return I.call(D,U[0]);case 2:return I.call(D,U[0],U[1]);case 3:return I.call(D,U[0],U[1],U[2])}return I.apply(D,U)}function Me(I,D){for(var U=-1,me=Array(I);++U-1}function Md(I,D){var U=this.__data__,me=Hi(U,I);return me<0?(++this.size,U.push([I,D])):U[me][1]=D,this}or.prototype.clear=Ul,or.prototype.delete=Id,or.prototype.get=Bs,or.prototype.has=Gl,or.prototype.set=Md;function bi(I){var D=-1,U=I==null?0:I.length;for(this.clear();++D1?U[Ye-1]:void 0,Ke=Ye>2?U[2]:void 0;for(dt=I.length>3&&typeof dt=="function"?(Ye--,dt):void 0,Ke&&Qu(U[0],U[1],Ke)&&(dt=Ye<3?void 0:dt,Ye=1),D=Object(D);++me-1&&I%1==0&&I0){if(++D>=i)return arguments[0]}else D=0;return I.apply(void 0,arguments)}}function Us(I){if(I!=null){try{return nn.call(I)}catch{}try{return I+""}catch{}}return""}function Si(I,D){return I===D||I!==I&&D!==D}var us=Pa(function(){return arguments}())?Pa:function(I){return dn(I)&&zt.call(I,"callee")&&!Be.call(I,"callee")},Yo=Array.isArray;function At(I){return I!=null&&Xl(I.length)&&!Ra(I)}function Ju(I){return dn(I)&&At(I)}var cs=Qt||Gd;function Ra(I){if(!Ar(I))return!1;var D=eo(I);return D==y||D==x||D==d||D==T}function Xl(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=a}function Ar(I){var D=typeof I;return I!=null&&(D=="object"||D=="function")}function dn(I){return I!=null&&typeof I=="object"}function Ql(I){if(!dn(I)||eo(I)!=k)return!1;var D=Ge(I);if(D===null)return!0;var U=zt.call(D,"constructor")&&D.constructor;return typeof U=="function"&&U instanceof U&&nn.call(U)==Gt}var Jl=Rt?tt(Rt):Ws;function eu(I){return Lr(I,tu(I))}function tu(I){return At(I)?Wd(I,!0):Ta(I)}var rn=Zo(function(I,D,U,me){Wi(I,D,U,me)});function Nt(I){return function(){return I}}function nu(I){return I}function Gd(){return!1}e.exports=rn})($w,$w.exports);const cd=$w.exports;function Cl(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function $p(e,...t){return Kq(e)?e(...t):e}var Kq=e=>typeof e=="function",qq=e=>/!(important)?$/.test(e),kE=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Bw=(e,t)=>n=>{const r=String(t),i=qq(r),o=kE(r),a=e?`${e}.${o}`:o;let s=Cl(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=kE(s),i?`${s} !important`:s};function wm(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=Bw(t,o)(a);let l=n?.(s,a)??s;return r&&(l=r(l,a)),l}}var D2=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Cs(e,t){return n=>{const r={property:n,scale:e};return r.transform=wm({scale:e,transform:t}),r}}var Zq=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function Yq(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Zq(t),transform:n?wm({scale:n,compose:r}):r}}var AR=["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 Xq(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...AR].join(" ")}function Qq(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...AR].join(" ")}var Jq={"--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(" ")},eZ={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 tZ(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 nZ={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},IR="& > :not(style) ~ :not(style)",rZ={[IR]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},iZ={[IR]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},Hw={"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"},oZ=new Set(Object.values(Hw)),MR=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),aZ=e=>e.trim();function sZ(e,t){var n;if(e==null||MR.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(aZ).filter(Boolean);if(l?.length===0)return e;const d=s in Hw?Hw[s]:s;l.unshift(d);const p=l.map(g=>{if(oZ.has(g))return g;const m=g.indexOf(" "),[y,x]=m!==-1?[g.substr(0,m),g.substr(m+1)]:[g],S=RR(x)?x:x&&x.split(" "),E=`colors.${y}`,P=E in t.__cssMap?t.__cssMap[E].varRef:y;return S?[P,...Array.isArray(S)?S:[S]].join(" "):P});return`${a}(${p.join(", ")})`}var RR=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),lZ=(e,t)=>sZ(e,t??{});function uZ(e){return/^var\(--.+\)$/.test(e)}var cZ=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},ul=e=>t=>`${e}(${t})`,ln={filter(e){return e!=="auto"?e:Jq},backdropFilter(e){return e!=="auto"?e:eZ},ring(e){return tZ(ln.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Xq():e==="auto-gpu"?Qq():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=cZ(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(uZ(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:lZ,blur:ul("blur"),opacity:ul("opacity"),brightness:ul("brightness"),contrast:ul("contrast"),dropShadow:ul("drop-shadow"),grayscale:ul("grayscale"),hueRotate:ul("hue-rotate"),invert:ul("invert"),saturate:ul("saturate"),sepia:ul("sepia"),bgImage(e){return e==null||RR(e)||MR.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){const{space:t,divide:n}=nZ[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},ne={borderWidths:Cs("borderWidths"),borderStyles:Cs("borderStyles"),colors:Cs("colors"),borders:Cs("borders"),radii:Cs("radii",ln.px),space:Cs("space",D2(ln.vh,ln.px)),spaceT:Cs("space",D2(ln.vh,ln.px)),degreeT(e){return{property:e,transform:ln.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:wm({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Cs("sizes",D2(ln.vh,ln.px)),sizesT:Cs("sizes",D2(ln.vh,ln.fraction)),shadows:Cs("shadows"),logical:Yq,blur:Cs("blur",ln.blur)},Hy={background:ne.colors("background"),backgroundColor:ne.colors("backgroundColor"),backgroundImage:ne.propT("backgroundImage",ln.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:ln.bgClip},bgSize:ne.prop("backgroundSize"),bgPosition:ne.prop("backgroundPosition"),bg:ne.colors("background"),bgColor:ne.colors("backgroundColor"),bgPos:ne.prop("backgroundPosition"),bgRepeat:ne.prop("backgroundRepeat"),bgAttachment:ne.prop("backgroundAttachment"),bgGradient:ne.propT("backgroundImage",ln.gradient),bgClip:{transform:ln.bgClip}};Object.assign(Hy,{bgImage:Hy.backgroundImage,bgImg:Hy.backgroundImage});var mn={border:ne.borders("border"),borderWidth:ne.borderWidths("borderWidth"),borderStyle:ne.borderStyles("borderStyle"),borderColor:ne.colors("borderColor"),borderRadius:ne.radii("borderRadius"),borderTop:ne.borders("borderTop"),borderBlockStart:ne.borders("borderBlockStart"),borderTopLeftRadius:ne.radii("borderTopLeftRadius"),borderStartStartRadius:ne.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:ne.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:ne.radii("borderTopRightRadius"),borderStartEndRadius:ne.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:ne.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:ne.borders("borderRight"),borderInlineEnd:ne.borders("borderInlineEnd"),borderBottom:ne.borders("borderBottom"),borderBlockEnd:ne.borders("borderBlockEnd"),borderBottomLeftRadius:ne.radii("borderBottomLeftRadius"),borderBottomRightRadius:ne.radii("borderBottomRightRadius"),borderLeft:ne.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:ne.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:ne.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:ne.borders(["borderLeft","borderRight"]),borderInline:ne.borders("borderInline"),borderY:ne.borders(["borderTop","borderBottom"]),borderBlock:ne.borders("borderBlock"),borderTopWidth:ne.borderWidths("borderTopWidth"),borderBlockStartWidth:ne.borderWidths("borderBlockStartWidth"),borderTopColor:ne.colors("borderTopColor"),borderBlockStartColor:ne.colors("borderBlockStartColor"),borderTopStyle:ne.borderStyles("borderTopStyle"),borderBlockStartStyle:ne.borderStyles("borderBlockStartStyle"),borderBottomWidth:ne.borderWidths("borderBottomWidth"),borderBlockEndWidth:ne.borderWidths("borderBlockEndWidth"),borderBottomColor:ne.colors("borderBottomColor"),borderBlockEndColor:ne.colors("borderBlockEndColor"),borderBottomStyle:ne.borderStyles("borderBottomStyle"),borderBlockEndStyle:ne.borderStyles("borderBlockEndStyle"),borderLeftWidth:ne.borderWidths("borderLeftWidth"),borderInlineStartWidth:ne.borderWidths("borderInlineStartWidth"),borderLeftColor:ne.colors("borderLeftColor"),borderInlineStartColor:ne.colors("borderInlineStartColor"),borderLeftStyle:ne.borderStyles("borderLeftStyle"),borderInlineStartStyle:ne.borderStyles("borderInlineStartStyle"),borderRightWidth:ne.borderWidths("borderRightWidth"),borderInlineEndWidth:ne.borderWidths("borderInlineEndWidth"),borderRightColor:ne.colors("borderRightColor"),borderInlineEndColor:ne.colors("borderInlineEndColor"),borderRightStyle:ne.borderStyles("borderRightStyle"),borderInlineEndStyle:ne.borderStyles("borderInlineEndStyle"),borderTopRadius:ne.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:ne.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:ne.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:ne.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(mn,{rounded:mn.borderRadius,roundedTop:mn.borderTopRadius,roundedTopLeft:mn.borderTopLeftRadius,roundedTopRight:mn.borderTopRightRadius,roundedTopStart:mn.borderStartStartRadius,roundedTopEnd:mn.borderStartEndRadius,roundedBottom:mn.borderBottomRadius,roundedBottomLeft:mn.borderBottomLeftRadius,roundedBottomRight:mn.borderBottomRightRadius,roundedBottomStart:mn.borderEndStartRadius,roundedBottomEnd:mn.borderEndEndRadius,roundedLeft:mn.borderLeftRadius,roundedRight:mn.borderRightRadius,roundedStart:mn.borderInlineStartRadius,roundedEnd:mn.borderInlineEndRadius,borderStart:mn.borderInlineStart,borderEnd:mn.borderInlineEnd,borderTopStartRadius:mn.borderStartStartRadius,borderTopEndRadius:mn.borderStartEndRadius,borderBottomStartRadius:mn.borderEndStartRadius,borderBottomEndRadius:mn.borderEndEndRadius,borderStartRadius:mn.borderInlineStartRadius,borderEndRadius:mn.borderInlineEndRadius,borderStartWidth:mn.borderInlineStartWidth,borderEndWidth:mn.borderInlineEndWidth,borderStartColor:mn.borderInlineStartColor,borderEndColor:mn.borderInlineEndColor,borderStartStyle:mn.borderInlineStartStyle,borderEndStyle:mn.borderInlineEndStyle});var dZ={color:ne.colors("color"),textColor:ne.colors("color"),fill:ne.colors("fill"),stroke:ne.colors("stroke")},Ww={boxShadow:ne.shadows("boxShadow"),mixBlendMode:!0,blendMode:ne.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:ne.prop("backgroundBlendMode"),opacity:!0};Object.assign(Ww,{shadow:Ww.boxShadow});var fZ={filter:{transform:ln.filter},blur:ne.blur("--chakra-blur"),brightness:ne.propT("--chakra-brightness",ln.brightness),contrast:ne.propT("--chakra-contrast",ln.contrast),hueRotate:ne.degreeT("--chakra-hue-rotate"),invert:ne.propT("--chakra-invert",ln.invert),saturate:ne.propT("--chakra-saturate",ln.saturate),dropShadow:ne.propT("--chakra-drop-shadow",ln.dropShadow),backdropFilter:{transform:ln.backdropFilter},backdropBlur:ne.blur("--chakra-backdrop-blur"),backdropBrightness:ne.propT("--chakra-backdrop-brightness",ln.brightness),backdropContrast:ne.propT("--chakra-backdrop-contrast",ln.contrast),backdropHueRotate:ne.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:ne.propT("--chakra-backdrop-invert",ln.invert),backdropSaturate:ne.propT("--chakra-backdrop-saturate",ln.saturate)},U5={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:ln.flexDirection},experimental_spaceX:{static:rZ,transform:wm({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:iZ,transform:wm({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:ne.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:ne.space("gap"),rowGap:ne.space("rowGap"),columnGap:ne.space("columnGap")};Object.assign(U5,{flexDir:U5.flexDirection});var OR={gridGap:ne.space("gridGap"),gridColumnGap:ne.space("gridColumnGap"),gridRowGap:ne.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},hZ={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:ln.outline},outlineOffset:!0,outlineColor:ne.colors("outlineColor")},Va={width:ne.sizesT("width"),inlineSize:ne.sizesT("inlineSize"),height:ne.sizes("height"),blockSize:ne.sizes("blockSize"),boxSize:ne.sizes(["width","height"]),minWidth:ne.sizes("minWidth"),minInlineSize:ne.sizes("minInlineSize"),minHeight:ne.sizes("minHeight"),minBlockSize:ne.sizes("minBlockSize"),maxWidth:ne.sizes("maxWidth"),maxInlineSize:ne.sizes("maxInlineSize"),maxHeight:ne.sizes("maxHeight"),maxBlockSize:ne.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:ne.propT("float",ln.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Va,{w:Va.width,h:Va.height,minW:Va.minWidth,maxW:Va.maxWidth,minH:Va.minHeight,maxH:Va.maxHeight,overscroll:Va.overscrollBehavior,overscrollX:Va.overscrollBehaviorX,overscrollY:Va.overscrollBehaviorY});var pZ={listStyleType:!0,listStylePosition:!0,listStylePos:ne.prop("listStylePosition"),listStyleImage:!0,listStyleImg:ne.prop("listStyleImage")};function gZ(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{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}},vZ=mZ(gZ),yZ={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},bZ={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Ax=(e,t,n)=>{const r={},i=vZ(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},xZ={srOnly:{transform(e){return e===!0?yZ:e==="focusable"?bZ:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Ax(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Ax(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Ax(t,e,n)}},$g={position:!0,pos:ne.prop("position"),zIndex:ne.prop("zIndex","zIndices"),inset:ne.spaceT("inset"),insetX:ne.spaceT(["left","right"]),insetInline:ne.spaceT("insetInline"),insetY:ne.spaceT(["top","bottom"]),insetBlock:ne.spaceT("insetBlock"),top:ne.spaceT("top"),insetBlockStart:ne.spaceT("insetBlockStart"),bottom:ne.spaceT("bottom"),insetBlockEnd:ne.spaceT("insetBlockEnd"),left:ne.spaceT("left"),insetInlineStart:ne.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:ne.spaceT("right"),insetInlineEnd:ne.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign($g,{insetStart:$g.insetInlineStart,insetEnd:$g.insetInlineEnd});var SZ={ring:{transform:ln.ring},ringColor:ne.colors("--chakra-ring-color"),ringOffset:ne.prop("--chakra-ring-offset-width"),ringOffsetColor:ne.colors("--chakra-ring-offset-color"),ringInset:ne.prop("--chakra-ring-inset")},Yn={margin:ne.spaceT("margin"),marginTop:ne.spaceT("marginTop"),marginBlockStart:ne.spaceT("marginBlockStart"),marginRight:ne.spaceT("marginRight"),marginInlineEnd:ne.spaceT("marginInlineEnd"),marginBottom:ne.spaceT("marginBottom"),marginBlockEnd:ne.spaceT("marginBlockEnd"),marginLeft:ne.spaceT("marginLeft"),marginInlineStart:ne.spaceT("marginInlineStart"),marginX:ne.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:ne.spaceT("marginInline"),marginY:ne.spaceT(["marginTop","marginBottom"]),marginBlock:ne.spaceT("marginBlock"),padding:ne.space("padding"),paddingTop:ne.space("paddingTop"),paddingBlockStart:ne.space("paddingBlockStart"),paddingRight:ne.space("paddingRight"),paddingBottom:ne.space("paddingBottom"),paddingBlockEnd:ne.space("paddingBlockEnd"),paddingLeft:ne.space("paddingLeft"),paddingInlineStart:ne.space("paddingInlineStart"),paddingInlineEnd:ne.space("paddingInlineEnd"),paddingX:ne.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:ne.space("paddingInline"),paddingY:ne.space(["paddingTop","paddingBottom"]),paddingBlock:ne.space("paddingBlock")};Object.assign(Yn,{m:Yn.margin,mt:Yn.marginTop,mr:Yn.marginRight,me:Yn.marginInlineEnd,marginEnd:Yn.marginInlineEnd,mb:Yn.marginBottom,ml:Yn.marginLeft,ms:Yn.marginInlineStart,marginStart:Yn.marginInlineStart,mx:Yn.marginX,my:Yn.marginY,p:Yn.padding,pt:Yn.paddingTop,py:Yn.paddingY,px:Yn.paddingX,pb:Yn.paddingBottom,pl:Yn.paddingLeft,ps:Yn.paddingInlineStart,paddingStart:Yn.paddingInlineStart,pr:Yn.paddingRight,pe:Yn.paddingInlineEnd,paddingEnd:Yn.paddingInlineEnd});var wZ={textDecorationColor:ne.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:ne.shadows("textShadow")},CZ={clipPath:!0,transform:ne.propT("transform",ln.transform),transformOrigin:!0,translateX:ne.spaceT("--chakra-translate-x"),translateY:ne.spaceT("--chakra-translate-y"),skewX:ne.degreeT("--chakra-skew-x"),skewY:ne.degreeT("--chakra-skew-y"),scaleX:ne.prop("--chakra-scale-x"),scaleY:ne.prop("--chakra-scale-y"),scale:ne.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:ne.degreeT("--chakra-rotate")},_Z={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:ne.prop("transitionDuration","transition.duration"),transitionProperty:ne.prop("transitionProperty","transition.property"),transitionTimingFunction:ne.prop("transitionTimingFunction","transition.easing")},kZ={fontFamily:ne.prop("fontFamily","fonts"),fontSize:ne.prop("fontSize","fontSizes",ln.px),fontWeight:ne.prop("fontWeight","fontWeights"),lineHeight:ne.prop("lineHeight","lineHeights"),letterSpacing:ne.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},EZ={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:ne.spaceT("scrollMargin"),scrollMarginTop:ne.spaceT("scrollMarginTop"),scrollMarginBottom:ne.spaceT("scrollMarginBottom"),scrollMarginLeft:ne.spaceT("scrollMarginLeft"),scrollMarginRight:ne.spaceT("scrollMarginRight"),scrollMarginX:ne.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:ne.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:ne.spaceT("scrollPadding"),scrollPaddingTop:ne.spaceT("scrollPaddingTop"),scrollPaddingBottom:ne.spaceT("scrollPaddingBottom"),scrollPaddingLeft:ne.spaceT("scrollPaddingLeft"),scrollPaddingRight:ne.spaceT("scrollPaddingRight"),scrollPaddingX:ne.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:ne.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function NR(e){return Cl(e)&&e.reference?e.reference:String(e)}var n4=(e,...t)=>t.map(NR).join(` ${e} `).replace(/calc/g,""),EE=(...e)=>`calc(${n4("+",...e)})`,PE=(...e)=>`calc(${n4("-",...e)})`,Vw=(...e)=>`calc(${n4("*",...e)})`,TE=(...e)=>`calc(${n4("/",...e)})`,LE=e=>{const t=NR(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Vw(t,-1)},Of=Object.assign(e=>({add:(...t)=>Of(EE(e,...t)),subtract:(...t)=>Of(PE(e,...t)),multiply:(...t)=>Of(Vw(e,...t)),divide:(...t)=>Of(TE(e,...t)),negate:()=>Of(LE(e)),toString:()=>e.toString()}),{add:EE,subtract:PE,multiply:Vw,divide:TE,negate:LE});function PZ(e,t="-"){return e.replace(/\s+/g,t)}function TZ(e){const t=PZ(e.toString());return AZ(LZ(t))}function LZ(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function AZ(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function IZ(e,t=""){return[t,e].filter(Boolean).join("-")}function MZ(e,t){return`var(${e}${t?`, ${t}`:""})`}function RZ(e,t=""){return TZ(`--${IZ(e,t)}`)}function xd(e,t,n){const r=RZ(e,n);return{variable:r,reference:MZ(r,t)}}function OZ(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}Object.freeze(["base","sm","md","lg","xl","2xl"]);function NZ(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function DZ(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function Uw(e){if(e==null)return e;const{unitless:t}=DZ(e);return t||typeof e=="number"?`${e}px`:e}var DR=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,K9=e=>Object.fromEntries(Object.entries(e).sort(DR));function AE(e){const t=K9(e);return Object.assign(Object.values(t),t)}function zZ(e){const t=Object.keys(K9(e));return new Set(t)}function IE(e){if(!e)return e;e=Uw(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function mg(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${Uw(e)})`),t&&n.push("and",`(max-width: ${Uw(t)})`),n.join(" ")}function FZ(e){if(!e)return null;e.base=e.base??"0px";const t=AE(e),n=Object.entries(e).sort(DR).map(([o,a],s,l)=>{let[,d]=l[s+1]??[];return d=parseFloat(d)>0?IE(d):void 0,{_minW:IE(a),breakpoint:o,minW:a,maxW:d,maxWQuery:mg(null,d),minWQuery:mg(a),minMaxQuery:mg(a,d)}}),r=zZ(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:K9(e),asArray:AE(e),details:n,media:[null,...t.map(o=>mg(o)).slice(1)],toArrayValue(o){if(!OZ(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;NZ(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const d=i[l];return d!=null&&s!=null&&(a[d]=s),a},{})}}}var Li={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}`},Mc=e=>zR(t=>e(t,"&"),"[role=group]","[data-group]",".group"),mu=e=>zR(t=>e(t,"~ &"),"[data-peer]",".peer"),zR=(e,...t)=>t.map(e).join(", "),r4={_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], &[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",_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:Mc(Li.hover),_peerHover:mu(Li.hover),_groupFocus:Mc(Li.focus),_peerFocus:mu(Li.focus),_groupFocusVisible:Mc(Li.focusVisible),_peerFocusVisible:mu(Li.focusVisible),_groupActive:Mc(Li.active),_peerActive:mu(Li.active),_groupDisabled:Mc(Li.disabled),_peerDisabled:mu(Li.disabled),_groupInvalid:Mc(Li.invalid),_peerInvalid:mu(Li.invalid),_groupChecked:Mc(Li.checked),_peerChecked:mu(Li.checked),_groupFocusWithin:Mc(Li.focusWithin),_peerFocusWithin:mu(Li.focusWithin),_peerPlaceholderShown:mu(Li.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]"},$Z=Object.keys(r4);function ME(e,t){return xd(String(e).replace(/\./g,"-"),void 0,t)}function BZ(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:d}=ME(i,t?.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[y,...x]=m,S=`${y}.-${x.join(".")}`,E=Of.negate(s),P=Of.negate(d);r[S]={value:E,var:l,varRef:P}}n[l]=s,r[i]={value:s,var:l,varRef:d};continue}const p=m=>{const x=[String(i).split(".")[0],m].join(".");if(!e[x])return m;const{reference:E}=ME(x,t?.cssVarPrefix);return E},g=Cl(s)?s:{default:s};n=cd(n,Object.entries(g).reduce((m,[y,x])=>{var S;const E=p(x);if(y==="default")return m[l]=E,m;const P=((S=r4)==null?void 0:S[y])??y;return m[P]={[l]:E},m},{})),r[i]={value:d,var:l,varRef:d}}return{cssVars:n,cssMap:r}}function HZ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function WZ(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var VZ=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function UZ(e){return WZ(e,VZ)}function GZ(e){return e.semanticTokens}function jZ(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function KZ({tokens:e,semanticTokens:t}){const n=Object.entries(Gw(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(Gw(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function Gw(e,t=1/0){return!Cl(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(Cl(i)||Array.isArray(i)?Object.entries(Gw(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function qZ(e){var t;const n=jZ(e),r=UZ(n),i=GZ(n),o=KZ({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=BZ(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:FZ(n.breakpoints)}),n}var q9=cd({},Hy,mn,dZ,U5,Va,fZ,SZ,hZ,OR,xZ,$g,Ww,Yn,EZ,kZ,wZ,CZ,pZ,_Z),ZZ=Object.assign({},Yn,Va,U5,OR,$g),YZ=Object.keys(ZZ),XZ=[...Object.keys(q9),...$Z],QZ={...q9,...r4},JZ=e=>e in QZ;function eY(e){return/^var\(--.+\)$/.test(e)}var tY=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!eY(t),nY=(e,t)=>{if(t==null)return t;const n=s=>{var l,d;return(d=(l=e.__cssMap)==null?void 0:l[s])==null?void 0:d.varRef},r=s=>n(s)??s,i=t.split(",").map(s=>s.trim()),[o,a]=i;return t=n(o)??r(a)??r(t),t};function rY(e){const{configs:t={},pseudos:n={},theme:r}=e;if(!r.__breakpoints)return()=>({});const{isResponsive:i,toArrayValue:o,media:a}=r.__breakpoints,s=(l,d=!1)=>{var p;const g=$p(l,r);let m={};for(let y in g){let x=$p(g[y],r);if(x==null)continue;if(Array.isArray(x)||Cl(x)&&i(x)){let k=Array.isArray(x)?x:o(x);k=k.slice(0,a.length);for(let T=0;Tt=>rY({theme:t,pseudos:r4,configs:q9})(e);function ir(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function iY(e,t){if(Array.isArray(e))return e;if(Cl(e))return t(e);if(e!=null)return[e]}function oY(e,t){for(let n=t+1;n{cd(d,{[T]:m?k[T]:{[P]:k[T]}})});continue}if(!y){m?cd(d,k):d[P]=k;continue}d[P]=k}}return d}}function sY(e){return t=>{const{variant:n,size:r,theme:i}=t,o=aY(i);return cd({},$p(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function lY(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function bn(e){return HZ(e,["styleConfig","size","variant","colorScheme"])}function uY(e){if(e.sheet)return e.sheet;for(var t=0;t0?Do(z0,--Go):0,x0--,Kr===10&&(x0=1,o4--),Kr}function va(){return Kr=Go2||_m(Kr)>3?"":" "}function SY(e,t){for(;--t&&va()&&!(Kr<48||Kr>102||Kr>57&&Kr<65||Kr>70&&Kr<97););return rv(e,Wy()+(t<6&&Pl()==32&&va()==32))}function Kw(e){for(;va();)switch(Kr){case e:return Go;case 34:case 39:e!==34&&e!==39&&Kw(Kr);break;case 40:e===41&&Kw(e);break;case 92:va();break}return Go}function wY(e,t){for(;va()&&e+Kr!==47+10;)if(e+Kr===42+42&&Pl()===47)break;return"/*"+rv(t,Go-1)+"*"+i4(e===47?e:va())}function CY(e){for(;!_m(Pl());)va();return rv(e,Go)}function _Y(e){return UR(Uy("",null,null,null,[""],e=VR(e),0,[0],e))}function Uy(e,t,n,r,i,o,a,s,l){for(var d=0,p=0,g=a,m=0,y=0,x=0,S=1,E=1,P=1,k=0,T="",M=i,N=o,F=r,z=T;E;)switch(x=k,k=va()){case 40:if(x!=108&&z.charCodeAt(g-1)==58){jw(z+=Cn(Vy(k),"&","&\f"),"&\f")!=-1&&(P=-1);break}case 34:case 39:case 91:z+=Vy(k);break;case 9:case 10:case 13:case 32:z+=xY(x);break;case 92:z+=SY(Wy()-1,7);continue;case 47:switch(Pl()){case 42:case 47:z2(kY(wY(va(),Wy()),t,n),l);break;default:z+="/"}break;case 123*S:s[d++]=vl(z)*P;case 125*S:case 59:case 0:switch(k){case 0:case 125:E=0;case 59+p:y>0&&vl(z)-g&&z2(y>32?OE(z+";",r,n,g-1):OE(Cn(z," ","")+";",r,n,g-2),l);break;case 59:z+=";";default:if(z2(F=RE(z,t,n,d,p,i,s,T,M=[],N=[],g),o),k===123)if(p===0)Uy(z,t,F,F,M,o,g,s,N);else switch(m){case 100:case 109:case 115:Uy(e,F,F,r&&z2(RE(e,F,F,0,0,i,s,T,i,M=[],g),N),i,N,g,s,r?M:N);break;default:Uy(z,F,F,F,[""],N,0,s,N)}}d=p=y=0,S=P=1,T=z="",g=a;break;case 58:g=1+vl(z),y=x;default:if(S<1){if(k==123)--S;else if(k==125&&S++==0&&bY()==125)continue}switch(z+=i4(k),k*S){case 38:P=p>0?1:(z+="\f",-1);break;case 44:s[d++]=(vl(z)-1)*P,P=1;break;case 64:Pl()===45&&(z+=Vy(va())),m=Pl(),p=g=vl(T=z+=CY(Wy())),k++;break;case 45:x===45&&vl(z)==2&&(S=0)}}return o}function RE(e,t,n,r,i,o,a,s,l,d,p){for(var g=i-1,m=i===0?o:[""],y=X9(m),x=0,S=0,E=0;x0?m[P]+" "+k:Cn(k,/&\f/g,m[P])))&&(l[E++]=T);return a4(e,t,n,i===0?Z9:s,l,d,p)}function kY(e,t,n){return a4(e,t,n,$R,i4(yY()),Cm(e,2,-2),0)}function OE(e,t,n,r){return a4(e,t,n,Y9,Cm(e,0,r),Cm(e,r+1,-1),r)}function GR(e,t){switch(gY(e,t)){case 5103:return vn+"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 vn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return vn+e+G5+e+qi+e+e;case 6828:case 4268:return vn+e+qi+e+e;case 6165:return vn+e+qi+"flex-"+e+e;case 5187:return vn+e+Cn(e,/(\w+).+(:[^]+)/,vn+"box-$1$2"+qi+"flex-$1$2")+e;case 5443:return vn+e+qi+"flex-item-"+Cn(e,/flex-|-self/,"")+e;case 4675:return vn+e+qi+"flex-line-pack"+Cn(e,/align-content|flex-|-self/,"")+e;case 5548:return vn+e+qi+Cn(e,"shrink","negative")+e;case 5292:return vn+e+qi+Cn(e,"basis","preferred-size")+e;case 6060:return vn+"box-"+Cn(e,"-grow","")+vn+e+qi+Cn(e,"grow","positive")+e;case 4554:return vn+Cn(e,/([^-])(transform)/g,"$1"+vn+"$2")+e;case 6187:return Cn(Cn(Cn(e,/(zoom-|grab)/,vn+"$1"),/(image-set)/,vn+"$1"),e,"")+e;case 5495:case 3959:return Cn(e,/(image-set\([^]*)/,vn+"$1$`$1");case 4968:return Cn(Cn(e,/(.+:)(flex-)?(.*)/,vn+"box-pack:$3"+qi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+vn+e+e;case 4095:case 3583:case 4068:case 2532:return Cn(e,/(.+)-inline(.+)/,vn+"$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(vl(e)-1-t>6)switch(Do(e,t+1)){case 109:if(Do(e,t+4)!==45)break;case 102:return Cn(e,/(.+:)(.+)-([^]+)/,"$1"+vn+"$2-$3$1"+G5+(Do(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~jw(e,"stretch")?GR(Cn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Do(e,t+1)!==115)break;case 6444:switch(Do(e,vl(e)-3-(~jw(e,"!important")&&10))){case 107:return Cn(e,":",":"+vn)+e;case 101:return Cn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+vn+(Do(e,14)===45?"inline-":"")+"box$3$1"+vn+"$2$3$1"+qi+"$2box$3")+e}break;case 5936:switch(Do(e,t+11)){case 114:return vn+e+qi+Cn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return vn+e+qi+Cn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return vn+e+qi+Cn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return vn+e+qi+e+e}return e}function Qp(e,t){for(var n="",r=X9(e),i=0;i-1&&!e.return)switch(e.type){case Y9:e.return=GR(e.value,e.length);break;case BR:return Qp([Q1(e,{value:Cn(e.value,"@","@"+vn)})],r);case Z9:if(e.length)return vY(e.props,function(i){switch(mY(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qp([Q1(e,{props:[Cn(i,/:(read-\w+)/,":"+G5+"$1")]})],r);case"::placeholder":return Qp([Q1(e,{props:[Cn(i,/:(plac\w+)/,":"+vn+"input-$1")]}),Q1(e,{props:[Cn(i,/:(plac\w+)/,":"+G5+"$1")]}),Q1(e,{props:[Cn(i,/:(plac\w+)/,qi+"input-$1")]})],r)}return""})}}var NE=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 jR(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var AY=function(t,n,r){for(var i=0,o=0;i=o,o=Pl(),i===38&&o===12&&(n[r]=1),!_m(o);)va();return rv(t,Go)},IY=function(t,n){var r=-1,i=44;do switch(_m(i)){case 0:i===38&&Pl()===12&&(n[r]=1),t[r]+=AY(Go-1,n,r);break;case 2:t[r]+=Vy(i);break;case 4:if(i===44){t[++r]=Pl()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=i4(i)}while(i=va());return t},MY=function(t,n){return UR(IY(VR(t),n))},DE=new WeakMap,RY=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&&!DE.get(r))&&!i){DE.set(t,!0);for(var o=[],a=MY(n,o),s=r.props,l=0,d=0;l=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 KY={animationIterationCount: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},qY=/[A-Z]|^ms/g,ZY=/_EMO_([^_]+?)_([^]*?)_EMO_/g,JR=function(t){return t.charCodeAt(1)===45},zE=function(t){return t!=null&&typeof t!="boolean"},Ix=jR(function(e){return JR(e)?e:e.replace(qY,"-$&").toLowerCase()}),FE=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ZY,function(r,i,o){return yl={name:i,styles:o,next:yl},i})}return KY[t]!==1&&!JR(t)&&typeof n=="number"&&n!==0?n+"px":n};function km(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 yl={name:n.name,styles:n.styles,next:yl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)yl={name:r.name,styles:r.styles,next:yl},r=r.next;var i=n.styles+";";return i}return YY(e,t,n)}case"function":{if(e!==void 0){var o=yl,a=n(e);return yl=o,km(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function YY(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function fX(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{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}},sO=hX(fX);function lO(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var uO=e=>lO(e,t=>t!=null);function r8(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function b4(e){if(!r8(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function pX(e){var t;return r8(e)?((t=ov(e))==null?void 0:t.defaultView)??window:window}function ov(e){return r8(e)?e.ownerDocument??document:document}function gX(e){return e.view??window}function mX(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var av=mX();function vX(e){const t=ov(e);return t?.activeElement}function i8(e,t){return e?e===t||e.contains(t):!1}var cO=e=>e.hasAttribute("tabindex"),yX=e=>cO(e)&&e.tabIndex===-1;function bX(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function xX(e){return b4(e)&&e.localName==="input"&&"select"in e}function dO(e){return(b4(e)?ov(e):document).activeElement===e}function fO(e){return e.parentElement&&fO(e.parentElement)?!0:e.hidden}function SX(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function hO(e){if(!b4(e)||fO(e)||bX(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]():SX(e)?!0:cO(e)}function wX(e){return e?b4(e)&&hO(e)&&!yX(e):!1}var CX=["input:not([disabled])","select:not([disabled])","textarea:not([disabled])","embed","iframe","object","a[href]","area[href]","button:not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],_X=CX.join(),kX=e=>e.offsetWidth>0&&e.offsetHeight>0;function EX(e){const t=Array.from(e.querySelectorAll(_X));return t.unshift(e),t.filter(n=>hO(n)&&kX(n))}function j5(e,...t){return Bp(e)?e(...t):e}function PX(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function TX(e){let t;return function(...r){return e&&(t=e.apply(this,r),e=null),t}}var LX=TX(e=>()=>{const{condition:t,message:n}=e;t&&cX&&console.warn(n)}),AX=(...e)=>t=>e.reduce((n,r)=>r(n),t);function K5(e,t={}){const{isActive:n=dO,nextTick:r,preventScroll:i=!0,selectTextIfInput:o=!0}=t;if(!e||n(e))return-1;function a(){if(!e){LX({condition:!0,message:"[chakra-ui]: can't call focus() on `null` or `undefined` element"});return}if(IX())e.focus({preventScroll:i});else if(e.focus(),i){const s=MX(e);RX(s)}if(o){if(xX(e))e.select();else if("setSelectionRange"in e){const s=e;s.setSelectionRange(s.value.length,s.value.length)}}}return r?requestAnimationFrame(a):(a(),-1)}var F2=null;function IX(){if(F2==null){F2=!1;try{document.createElement("div").focus({get preventScroll(){return F2=!0,!0}})}catch{}}return F2}function MX(e){const t=ov(e),n=t.defaultView??window;let r=e.parentNode;const i=[],o=t.scrollingElement||t.documentElement;for(;r instanceof n.HTMLElement&&r!==o;)(r.offsetHeight{const n=gX(t),r=t instanceof n.MouseEvent;(!r||r&&t.button===0)&&e(t)}}var DX={pageX:0,pageY:0};function zX(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||DX;return{x:r[`${t}X`],y:r[`${t}Y`]}}function FX(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function $X(e,t="page"){return{point:OX(e)?zX(e,t):FX(e,t)}}var BX=(e,t=!1)=>{const n=r=>e(r,$X(r));return t?NX(n):n},HX=()=>av&&window.onpointerdown===null,WX=()=>av&&window.ontouchstart===null,VX=()=>av&&window.onmousedown===null,UX={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},GX={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function jX(e){return HX()?e:WX()?GX[e]:VX()?UX[e]:e}Object.freeze(["base","sm","md","lg","xl","2xl"]);function KX(e){const{userAgent:t,vendor:n}=e,r=/(android)/i.test(t);switch(!0){case/CriOS/.test(t):return"Chrome for iOS";case/Edg\//.test(t):return"Edge";case(r&&/Silk\//.test(t)):return"Silk";case(/Chrome/.test(t)&&/Google Inc/.test(n)):return"Chrome";case/Firefox\/\d+\.\d+$/.test(t):return"Firefox";case r:return"AOSP";case/MSIE|Trident/.test(t):return"IE";case(/Safari/.test(e.userAgent)&&/Apple Computer/.test(t)):return"Safari";case/AppleWebKit/.test(t):return"WebKit";default:return null}}function qX(e){return av?KX(window.navigator)===e:!1}function ZX(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.exports.createContext(void 0);i.displayName=r;function o(){var a;const s=w.exports.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 Xw(){return Xw=Object.assign?Object.assign.bind():function(e){for(var t=1;t96?QX:JX},VE=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},eQ=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return XR(n,r,i),QY(function(){return QR(n,r,i)}),null},tQ=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=VE(t,n,r),l=s||WE(i),d=!l("as");return function(){var p=arguments,g=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&g.push("label:"+o+";"),p[0]==null||p[0].raw===void 0)g.push.apply(g,p);else{g.push(p[0][0]);for(var m=p.length,y=1;y` or ``");return e}function pO(){const e=j9(),t=F0();return{...e,theme:t}}function lQ(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function uQ(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function cQ(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,d)=>{if(e==="breakpoints")return lQ(o,l,a[d]??l);const p=`${e}.${l}`;return uQ(o,p,a[d]??l)});return Array.isArray(t)?s:s[0]}}function dQ(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.exports.useMemo(()=>qZ(n),[n]);return ae(tX,{theme:i,children:[_(fQ,{root:t}),r]})}function fQ({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return _(v4,{styles:n=>({[t]:n.__cssVars})})}ZX({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function hQ(){const{colorMode:e}=j9();return _(v4,{styles:t=>{const n=sO(t,"styles.global"),r=j5(n,{theme:t,colorMode:e});return r?FR(r)(t):void 0}})}var pQ=new Set([...XZ,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),gQ=new Set(["htmlWidth","htmlHeight","htmlSize"]);function mQ(e){return gQ.has(e)||!pQ.has(e)}var vQ=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=lO(a,(g,m)=>JZ(m)),l=j5(e,t),d=Object.assign({},i,l,uO(s),o),p=FR(d)(t.theme);return r?[p,r]:p};function Mx(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=mQ);const i=vQ({baseStyle:n});return Qw(e,r)(i)}function Ie(e){return w.exports.forwardRef(e)}function gO(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=pO(),a=sO(i,`components.${e}`),s=n||a,l=cd({theme:i,colorMode:o},s?.defaultProps??{},uO(dX(r,["children"]))),d=w.exports.useRef({});if(s){const g=sY(s)(l);sQ(d.current,g)||(d.current=g)}return d.current}function So(e,t={}){return gO(e,t)}function $i(e,t={}){return gO(e,t)}function yQ(){const e=new Map;return new Proxy(Mx,{apply(t,n,r){return Mx(...r)},get(t,n){return e.has(n)||e.set(n,Mx(n)),e.get(n)}})}var Ce=yQ();function bQ(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function _n(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.exports.createContext(void 0);a.displayName=t;function s(){var l;const d=w.exports.useContext(a);if(!d&&n){const p=new Error(o??bQ(r,i));throw p.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,p,s),p}return d}return[a.Provider,s,a]}function xQ(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 Fn(...e){return t=>{e.forEach(n=>{xQ(n,t)})}}function SQ(...e){return w.exports.useMemo(()=>Fn(...e),e)}function UE(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 wQ=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function GE(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function jE(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var Jw=typeof window<"u"?w.exports.useLayoutEffect:w.exports.useEffect,q5=e=>e,CQ=class{descendants=new Map;register=e=>{if(e!=null)return wQ(e)?this.registerNode(e):t=>{this.registerNode(t,e)}};unregister=e=>{this.descendants.delete(e);const t=UE(Array.from(this.descendants.keys()));this.assignIndex(t)};destroy=()=>{this.descendants.clear()};assignIndex=e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})};count=()=>this.descendants.size;enabledCount=()=>this.enabledValues().length;values=()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index);enabledValues=()=>this.values().filter(e=>!e.disabled);item=e=>{if(this.count()!==0)return this.values()[e]};enabledItem=e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]};first=()=>this.item(0);firstEnabled=()=>this.enabledItem(0);last=()=>this.item(this.descendants.size-1);lastEnabled=()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)};indexOf=e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1};enabledIndexOf=e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e));next=(e,t=!0)=>{const n=GE(e,this.count(),t);return this.item(n)};nextEnabled=(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=GE(r,this.enabledCount(),t);return this.enabledItem(i)};prev=(e,t=!0)=>{const n=jE(e,this.count()-1,t);return this.item(n)};prevEnabled=(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=jE(r,this.enabledCount()-1,t);return this.enabledItem(i)};registerNode=(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=UE(n);t?.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)}};function _Q(){const e=w.exports.useRef(new CQ);return Jw(()=>()=>e.current.destroy()),e.current}var[kQ,mO]=_n({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function EQ(e){const t=mO(),[n,r]=w.exports.useState(-1),i=w.exports.useRef(null);Jw(()=>()=>{!i.current||t.unregister(i.current)},[]),Jw(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=q5(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Fn(o,i)}}function vO(){return[q5(kQ),()=>q5(mO()),()=>_Q(),i=>EQ(i)]}var Pr=(...e)=>e.filter(Boolean).join(" "),KE={path:ae("g",{stroke:"currentColor",strokeWidth:"1.5",children:[_("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"}),_("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),_("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Ea=Ie((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...d}=e,p=Pr("chakra-icon",s),g={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:p,__css:g},y=r??KE.viewBox;if(n&&typeof n!="string")return le.createElement(Ce.svg,{as:n,...m,...d});const x=a??KE.path;return le.createElement(Ce.svg,{verticalAlign:"middle",viewBox:y,...m,...d},x)});Ea.displayName="Icon";function $0(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.exports.Children.toArray(e.path),a=Ie((s,l)=>_(Ea,{ref:l,viewBox:t,...i,...s,children:o.length?o:_("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}function kr(e,t=[]){const n=w.exports.useRef(e);return w.exports.useEffect(()=>{n.current=e}),w.exports.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function x4(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,y)=>m!==y}=e,o=kr(r),a=kr(i),[s,l]=w.exports.useState(n),d=t!==void 0,p=d?t:s,g=w.exports.useCallback(m=>{const x=typeof m=="function"?m(p):m;!a(p,x)||(d||l(x),o(x))},[d,o,p,a]);return[p,g]}const o8=w.exports.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),S4=w.exports.createContext({});function PQ(){return w.exports.useContext(S4).visualElement}const B0=w.exports.createContext(null),fh=typeof document<"u",Z5=fh?w.exports.useLayoutEffect:w.exports.useEffect,yO=w.exports.createContext({strict:!1});function TQ(e,t,n,r){const i=PQ(),o=w.exports.useContext(yO),a=w.exports.useContext(B0),s=w.exports.useContext(o8).reducedMotion,l=w.exports.useRef(void 0);r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const d=l.current;return Z5(()=>{d&&d.syncRender()}),w.exports.useEffect(()=>{d&&d.animationState&&d.animationState.animateChanges()}),Z5(()=>()=>d&&d.notifyUnmount(),[]),d}function Hp(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function LQ(e,t,n){return w.exports.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Hp(n)&&(n.current=r))},[t])}function Tm(e){return typeof e=="string"||Array.isArray(e)}function w4(e){return typeof e=="object"&&typeof e.start=="function"}const AQ=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function C4(e){return w4(e.animate)||AQ.some(t=>Tm(e[t]))}function bO(e){return Boolean(C4(e)||e.variants)}function IQ(e,t){if(C4(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tm(n)?n:void 0,animate:Tm(r)?r:void 0}}return e.inherit!==!1?t:{}}function MQ(e){const{initial:t,animate:n}=IQ(e,w.exports.useContext(S4));return w.exports.useMemo(()=>({initial:t,animate:n}),[qE(t),qE(n)])}function qE(e){return Array.isArray(e)?e.join(" "):e}const vu=e=>({isEnabled:t=>e.some(n=>!!t[n])}),Lm={measureLayout:vu(["layout","layoutId","drag"]),animation:vu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:vu(["exit"]),drag:vu(["drag","dragControls"]),focus:vu(["whileFocus"]),hover:vu(["whileHover","onHoverStart","onHoverEnd"]),tap:vu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:vu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:vu(["whileInView","onViewportEnter","onViewportLeave"])};function RQ(e){for(const t in e)t==="projectionNodeConstructor"?Lm.projectionNodeConstructor=e[t]:Lm[t].Component=e[t]}function _4(e){const t=w.exports.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hg={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let OQ=1;function NQ(){return _4(()=>{if(Hg.hasEverUpdated)return OQ++})}const a8=w.exports.createContext({});class DQ extends le.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const xO=w.exports.createContext({}),zQ=Symbol.for("motionComponentSymbol");function FQ({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&RQ(e);function a(l,d){const p={...w.exports.useContext(o8),...l,layoutId:$Q(l)},{isStatic:g}=p;let m=null;const y=MQ(l),x=g?void 0:NQ(),S=i(l,g);if(!g&&fh){y.visualElement=TQ(o,S,p,t);const E=w.exports.useContext(yO).strict,P=w.exports.useContext(xO);y.visualElement&&(m=y.visualElement.loadFeatures(p,E,e,x,n||Lm.projectionNodeConstructor,P))}return ae(DQ,{visualElement:y.visualElement,props:p,children:[m,_(S4.Provider,{value:y,children:r(o,l,x,LQ(S,y.visualElement,d),S,g,y.visualElement)})]})}const s=w.exports.forwardRef(a);return s[zQ]=o,s}function $Q({layoutId:e}){const t=w.exports.useContext(a8).id;return t&&e!==void 0?t+"-"+e:e}function BQ(e){function t(r,i={}){return FQ(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 HQ=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function s8(e){return typeof e!="string"||e.includes("-")?!1:!!(HQ.indexOf(e)>-1||/[A-Z]/.test(e))}const Y5={};function WQ(e){Object.assign(Y5,e)}const X5=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sv=new Set(X5);function SO(e,{layout:t,layoutId:n}){return sv.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Y5[e]||e==="opacity")}const Ol=e=>!!e?.getVelocity,VQ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},UQ=(e,t)=>X5.indexOf(e)-X5.indexOf(t);function GQ({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(UQ);for(const s of t)a+=`${VQ[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function wO(e){return e.startsWith("--")}const jQ=(e,t)=>t&&typeof e=="number"?t.transform(e):e,CO=(e,t)=>n=>Math.max(Math.min(n,t),e),Wg=e=>e%1?Number(e.toFixed(5)):e,Am=/(-)?([\d]*\.?[\d])+/g,e6=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,KQ=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function lv(e){return typeof e=="string"}const hh={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Vg=Object.assign(Object.assign({},hh),{transform:CO(0,1)}),$2=Object.assign(Object.assign({},hh),{default:1}),uv=e=>({test:t=>lv(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nc=uv("deg"),Tl=uv("%"),St=uv("px"),qQ=uv("vh"),ZQ=uv("vw"),ZE=Object.assign(Object.assign({},Tl),{parse:e=>Tl.parse(e)/100,transform:e=>Tl.transform(e*100)}),l8=(e,t)=>n=>Boolean(lv(n)&&KQ.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),_O=(e,t,n)=>r=>{if(!lv(r))return r;const[i,o,a,s]=r.match(Am);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Hf={test:l8("hsl","hue"),parse:_O("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Tl.transform(Wg(t))+", "+Tl.transform(Wg(n))+", "+Wg(Vg.transform(r))+")"},YQ=CO(0,255),Rx=Object.assign(Object.assign({},hh),{transform:e=>Math.round(YQ(e))}),qc={test:l8("rgb","red"),parse:_O("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rx.transform(e)+", "+Rx.transform(t)+", "+Rx.transform(n)+", "+Wg(Vg.transform(r))+")"};function XQ(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),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 t6={test:l8("#"),parse:XQ,transform:qc.transform},ho={test:e=>qc.test(e)||t6.test(e)||Hf.test(e),parse:e=>qc.test(e)?qc.parse(e):Hf.test(e)?Hf.parse(e):t6.parse(e),transform:e=>lv(e)?e:e.hasOwnProperty("red")?qc.transform(e):Hf.transform(e)},kO="${c}",EO="${n}";function QQ(e){var t,n,r,i;return isNaN(e)&&lv(e)&&((n=(t=e.match(Am))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(e6))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function PO(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(e6);r&&(n=r.length,e=e.replace(e6,kO),t.push(...r.map(ho.parse)));const i=e.match(Am);return i&&(e=e.replace(Am,EO),t.push(...i.map(hh.parse))),{values:t,numColors:n,tokenised:e}}function TO(e){return PO(e).values}function LO(e){const{values:t,numColors:n,tokenised:r}=PO(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function eJ(e){const t=TO(e);return LO(e)(t.map(JQ))}const Ru={test:QQ,parse:TO,createTransformer:LO,getAnimatableNone:eJ},tJ=new Set(["brightness","contrast","saturate","opacity"]);function nJ(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Am)||[];if(!r)return e;const i=n.replace(r,"");let o=tJ.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const rJ=/([a-z-]*)\(.*?\)/g,n6=Object.assign(Object.assign({},Ru),{getAnimatableNone:e=>{const t=e.match(rJ);return t?t.map(nJ).join(" "):e}}),YE={...hh,transform:Math.round},AO={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:Nc,rotateX:Nc,rotateY:Nc,rotateZ:Nc,scale:$2,scaleX:$2,scaleY:$2,scaleZ:$2,skew:Nc,skewX:Nc,skewY:Nc,distance:St,translateX:St,translateY:St,translateZ:St,x:St,y:St,z:St,perspective:St,transformPerspective:St,opacity:Vg,originX:ZE,originY:ZE,originZ:St,zIndex:YE,fillOpacity:Vg,strokeOpacity:Vg,numOctaves:YE};function u8(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let d=!1,p=!1,g=!0;for(const m in t){const y=t[m];if(wO(m)){o[m]=y;continue}const x=AO[m],S=jQ(y,x);if(sv.has(m)){if(d=!0,a[m]=S,s.push(m),!g)continue;y!==(x.default||0)&&(g=!1)}else m.startsWith("origin")?(p=!0,l[m]=S):i[m]=S}if(d||r?i.transform=GQ(e,n,g,r):!t.transform&&i.transform&&(i.transform="none"),p){const{originX:m="50%",originY:y="50%",originZ:x=0}=l;i.transformOrigin=`${m} ${y} ${x}`}}const c8=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function IO(e,t,n){for(const r in t)!Ol(t[r])&&!SO(r,n)&&(e[r]=t[r])}function iJ({transformTemplate:e},t,n){return w.exports.useMemo(()=>{const r=c8();return u8(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function oJ(e,t,n){const r=e.style||{},i={};return IO(i,r,e),Object.assign(i,iJ(e,t,n)),e.transformValues?e.transformValues(i):i}function aJ(e,t,n){const r={},i=oJ(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"}`),r.style=i,r}const sJ=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],lJ=["whileTap","onTap","onTapStart","onTapCancel"],uJ=["onPan","onPanStart","onPanSessionStart","onPanEnd"],cJ=["whileInView","onViewportEnter","onViewportLeave","viewport"],dJ=new Set(["initial","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...cJ,...lJ,...sJ,...uJ]);function Q5(e){return dJ.has(e)}let MO=e=>!Q5(e);function fJ(e){!e||(MO=t=>t.startsWith("on")?!Q5(t):e(t))}try{fJ(require("@emotion/is-prop-valid").default)}catch{}function hJ(e,t,n){const r={};for(const i in e)(MO(i)||n===!0&&Q5(i)||!t&&!Q5(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function XE(e,t,n){return typeof e=="string"?e:St.transform(t+n*e)}function pJ(e,t,n){const r=XE(t,e.x,e.width),i=XE(n,e.y,e.height);return`${r} ${i}`}const gJ={offset:"stroke-dashoffset",array:"stroke-dasharray"},mJ={offset:"strokeDashoffset",array:"strokeDasharray"};function vJ(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?gJ:mJ;e[o.offset]=St.transform(-r);const a=St.transform(t),s=St.transform(n);e[o.array]=`${a} ${s}`}function d8(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},d,p){u8(e,l,d,p),e.attrs=e.style,e.style={};const{attrs:g,style:m,dimensions:y}=e;g.transform&&(y&&(m.transform=g.transform),delete g.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=pJ(y,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),o!==void 0&&vJ(g,o,a,s,!1)}const RO=()=>({...c8(),attrs:{}});function yJ(e,t){const n=w.exports.useMemo(()=>{const r=RO();return d8(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};IO(r,e.style,e),n.style={...r,...n.style}}return n}function bJ(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const d=(s8(n)?yJ:aJ)(r,a,s),g={...hJ(r,typeof n=="string",e),...d,ref:o};return i&&(g["data-projection-id"]=i),w.exports.createElement(n,g)}}const OO=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function NO(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 DO=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function zO(e,t,n,r){NO(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(DO.has(i)?i:OO(i),t.attrs[i])}function f8(e){const{style:t}=e,n={};for(const r in t)(Ol(t[r])||SO(r,e))&&(n[r]=t[r]);return n}function FO(e){const t=f8(e);for(const n in e)if(Ol(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function $O(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}const Im=e=>Array.isArray(e),xJ=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),BO=e=>Im(e)?e[e.length-1]||0:e;function jy(e){const t=Ol(e)?e.get():e;return xJ(t)?t.toValue():t}function SJ({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:wJ(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const HO=e=>(t,n)=>{const r=w.exports.useContext(S4),i=w.exports.useContext(B0),o=()=>SJ(e,t,r,i);return n?o():_4(o)};function wJ(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=jy(o[m]);let{initial:a,animate:s}=e;const l=C4(e),d=bO(e);t&&d&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let p=n?n.initial===!1:!1;p=p||a===!1;const g=p?s:a;return g&&typeof g!="boolean"&&!w4(g)&&(Array.isArray(g)?g:[g]).forEach(y=>{const x=$O(e,y);if(!x)return;const{transitionEnd:S,transition:E,...P}=x;for(const k in P){let T=P[k];if(Array.isArray(T)){const M=p?T.length-1:0;T=T[M]}T!==null&&(i[k]=T)}for(const k in S)i[k]=S[k]}),i}const CJ={useVisualState:HO({scrapeMotionValuesFromProps:FO,createRenderState:RO,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}d8(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),zO(t,n)}})},_J={useVisualState:HO({scrapeMotionValuesFromProps:f8,createRenderState:c8})};function kJ(e,{forwardMotionProps:t=!1},n,r,i){return{...s8(e)?CJ:_J,preloadedFeatures:n,useRender:bJ(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var Vn;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(Vn||(Vn={}));function k4(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function r6(e,t,n,r){w.exports.useEffect(()=>{const i=e.current;if(n&&i)return k4(i,t,n,r)},[e,t,n,r])}function EJ({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(Vn.Focus,!0)},i=()=>{n&&n.setActive(Vn.Focus,!1)};r6(t,"focus",e?r:void 0),r6(t,"blur",e?i:void 0)}function WO(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function VO(e){return!!e.touches}function PJ(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const TJ={pageX:0,pageY:0};function LJ(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||TJ;return{x:r[t+"X"],y:r[t+"Y"]}}function AJ(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function h8(e,t="page"){return{point:VO(e)?LJ(e,t):AJ(e,t)}}const UO=(e,t=!1)=>{const n=r=>e(r,h8(r));return t?PJ(n):n},IJ=()=>fh&&window.onpointerdown===null,MJ=()=>fh&&window.ontouchstart===null,RJ=()=>fh&&window.onmousedown===null,OJ={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},NJ={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function GO(e){return IJ()?e:MJ()?NJ[e]:RJ()?OJ[e]:e}function Jp(e,t,n,r){return k4(e,GO(t),UO(n,t==="pointerdown"),r)}function J5(e,t,n,r){return r6(e,GO(t),n&&UO(n,t==="pointerdown"),r)}function jO(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const QE=jO("dragHorizontal"),JE=jO("dragVertical");function KO(e){let t=!1;if(e==="y")t=JE();else if(e==="x")t=QE();else{const n=QE(),r=JE();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function qO(){const e=KO(!0);return e?(e(),!1):!0}function eP(e,t,n){return(r,i)=>{!WO(r)||qO()||(e.animationState&&e.animationState.setActive(Vn.Hover,t),n&&n(r,i))}}function DJ({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){J5(r,"pointerenter",e||n?eP(r,!0,e):void 0,{passive:!e}),J5(r,"pointerleave",t||n?eP(r,!1,t):void 0,{passive:!t})}const ZO=(e,t)=>t?e===t?!0:ZO(e,t.parentElement):!1;function p8(e){return w.exports.useEffect(()=>()=>e(),[])}var Sl=function(){return Sl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function i6(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;rMath.min(Math.max(n,e),t),Ox=.001,FJ=.01,nP=10,$J=.05,BJ=1;function HJ({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;zJ(e<=nP*1e3);let a=1-t;a=t3($J,BJ,a),e=t3(FJ,nP,e/1e3),a<1?(i=d=>{const p=d*a,g=p*e,m=p-n,y=o6(d,a),x=Math.exp(-g);return Ox-m/y*x},o=d=>{const g=d*a*e,m=g*n+n,y=Math.pow(a,2)*Math.pow(d,2)*e,x=Math.exp(-g),S=o6(Math.pow(d,2),a);return(-i(d)+Ox>0?-1:1)*((m-y)*x)/S}):(i=d=>{const p=Math.exp(-d*e),g=(d-n)*e+1;return-Ox+p*g},o=d=>{const p=Math.exp(-d*e),g=(n-d)*(e*e);return p*g});const s=5/e,l=VJ(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const d=Math.pow(l,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:e}}}const WJ=12;function VJ(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function jJ(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!rP(e,GJ)&&rP(e,UJ)){const n=HJ(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function g8(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=E4(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:d,velocity:p,duration:g,isResolvedFromDuration:m}=jJ(o),y=iP,x=iP;function S(){const E=p?-(p/1e3):0,P=n-t,k=l/(2*Math.sqrt(s*d)),T=Math.sqrt(s/d)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),k<1){const M=o6(T,k);y=N=>{const F=Math.exp(-k*T*N);return n-F*((E+k*T*P)/M*Math.sin(M*N)+P*Math.cos(M*N))},x=N=>{const F=Math.exp(-k*T*N);return k*T*F*(Math.sin(M*N)*(E+k*T*P)/M+P*Math.cos(M*N))-F*(Math.cos(M*N)*(E+k*T*P)-M*P*Math.sin(M*N))}}else if(k===1)y=M=>n-Math.exp(-T*M)*(P+(E+T*P)*M);else{const M=T*Math.sqrt(k*k-1);y=N=>{const F=Math.exp(-k*T*N),z=Math.min(M*N,300);return n-F*((E+k*T*P)*Math.sinh(z)+M*P*Math.cosh(z))/M}}}return S(),{next:E=>{const P=y(E);if(m)a.done=E>=g;else{const k=x(E)*1e3,T=Math.abs(k)<=r,M=Math.abs(n-P)<=i;a.done=T&&M}return a.value=a.done?n:P,a},flipTarget:()=>{p=-p,[t,n]=[n,t],S()}}}g8.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const iP=e=>0,Mm=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Er=(e,t,n)=>-n*e+n*t+e;function Nx(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 oP({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=Nx(l,s,e+1/3),o=Nx(l,s,e),a=Nx(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const KJ=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},qJ=[t6,qc,Hf],aP=e=>qJ.find(t=>t.test(e)),YO=(e,t)=>{let n=aP(e),r=aP(t),i=n.parse(e),o=r.parse(t);n===Hf&&(i=oP(i),n=qc),r===Hf&&(o=oP(o),r=qc);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=KJ(i[l],o[l],s));return a.alpha=Er(i.alpha,o.alpha,s),n.transform(a)}},a6=e=>typeof e=="number",ZJ=(e,t)=>n=>t(e(n)),P4=(...e)=>e.reduce(ZJ);function XO(e,t){return a6(e)?n=>Er(e,t,n):ho.test(e)?YO(e,t):JO(e,t)}const QO=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>XO(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=XO(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function sP(e){const t=Ru.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=Ru.createTransformer(t),r=sP(e),i=sP(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?P4(QO(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},XJ=(e,t)=>n=>Er(e,t,n);function QJ(e){if(typeof e=="number")return XJ;if(typeof e=="string")return ho.test(e)?YO:JO;if(Array.isArray(e))return QO;if(typeof e=="object")return YJ}function JJ(e,t,n){const r=[],i=n||QJ(e[0]),o=e.length-1;for(let a=0;an(Mm(e,t,r))}function tee(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=Mm(e[o],e[o+1],i);return t[o](s)}}function eN(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;e3(o===t.length),e3(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=JJ(t,r,i),s=o===2?eee(e,a):tee(e,a);return n?l=>s(t3(e[0],e[o-1],l)):s}const T4=e=>t=>1-e(1-t),m8=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,nee=e=>t=>Math.pow(t,e),tN=e=>t=>t*t*((e+1)*t-e),ree=e=>{const t=tN(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},nN=1.525,iee=4/11,oee=8/11,aee=9/10,v8=e=>e,y8=nee(2),see=T4(y8),rN=m8(y8),iN=e=>1-Math.sin(Math.acos(e)),b8=T4(iN),lee=m8(b8),x8=tN(nN),uee=T4(x8),cee=m8(x8),dee=ree(nN),fee=4356/361,hee=35442/1805,pee=16061/1805,n3=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-n3(1-e*2)):.5*n3(e*2-1)+.5;function vee(e,t){return e.map(()=>t||rN).splice(0,e.length-1)}function yee(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function bee(e,t){return e.map(n=>n*t)}function Ky({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=bee(r&&r.length===a.length?r:yee(a),i);function l(){return eN(s,a,{ease:Array.isArray(n)?n:vee(a,n)})}let d=l();return{next:p=>(o.value=d(p),o.done=p>=i,o),flipTarget:()=>{a.reverse(),d=l()}}}function xee({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,d=o===void 0?l:o(l);return d!==l&&(s=d-t),{next:p=>{const g=-s*Math.exp(-p/r);return a.done=!(g>i||g<-i),a.value=a.done?d:d+g,a},flipTarget:()=>{}}}const lP={keyframes:Ky,spring:g8,decay:xee};function See(e){if(Array.isArray(e.to))return Ky;if(lP[e.type])return lP[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Ky:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?g8:Ky}const oN=1/60*1e3,wee=typeof performance<"u"?()=>performance.now():()=>Date.now(),aN=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(wee()),oN);function Cee(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,d=!1,p=!1)=>{const g=p&&i,m=g?t:n;return d&&a.add(l),m.indexOf(l)===-1&&(m.push(l),g&&i&&(r=t.length)),l},cancel:l=>{const d=n.indexOf(l);d!==-1&&n.splice(d,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 d=0;d(e[t]=Cee(()=>Rm=!0),e),{}),kee=cv.reduce((e,t)=>{const n=L4[t];return e[t]=(r,i=!1,o=!1)=>(Rm||Tee(),n.schedule(r,i,o)),e},{}),Eee=cv.reduce((e,t)=>(e[t]=L4[t].cancel,e),{});cv.reduce((e,t)=>(e[t]=()=>L4[t].process(e0),e),{});const Pee=e=>L4[e].process(e0),sN=e=>{Rm=!1,e0.delta=s6?oN:Math.max(Math.min(e-e0.timestamp,_ee),1),e0.timestamp=e,l6=!0,cv.forEach(Pee),l6=!1,Rm&&(s6=!1,aN(sN))},Tee=()=>{Rm=!0,s6=!0,l6||aN(sN)},Lee=()=>e0;function lN(e,t,n=0){return e-t-n}function Aee(e,t,n=0,r=!0){return r?lN(t+-e,t,n):t-(e-t)+n}function Iee(e,t,n,r){return r?e>=t+n:e<=-n}const Mee=e=>{const t=({delta:n})=>e(n);return{start:()=>kee.update(t,!0),stop:()=>Eee.update(t)}};function uN(e){var t,n,{from:r,autoplay:i=!0,driver:o=Mee,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:d=0,onPlay:p,onStop:g,onComplete:m,onRepeat:y,onUpdate:x}=e,S=E4(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:E}=S,P,k=0,T=S.duration,M,N=!1,F=!0,z;const B=See(S);!((n=(t=B).needsInterpolation)===null||n===void 0)&&n.call(t,r,E)&&(z=eN([0,100],[r,E],{clamp:!1}),r=0,E=100);const K=B(Object.assign(Object.assign({},S),{from:r,to:E}));function j(){k++,l==="reverse"?(F=k%2===0,a=Aee(a,T,d,F)):(a=lN(a,T,d),l==="mirror"&&K.flipTarget()),N=!1,y&&y()}function X(){P.stop(),m&&m()}function ue(xe){if(F||(xe=-xe),a+=xe,!N){const we=K.next(Math.max(0,a));M=we.value,z&&(M=z(M)),N=F?we.done:a<=0}x?.(M),N&&(k===0&&(T??(T=a)),k{g?.(),P.stop()}}}function cN(e,t){return t?e*(1e3/t):0}function Ree({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:d,driver:p,onUpdate:g,onComplete:m,onStop:y}){let x;function S(T){return n!==void 0&&Tr}function E(T){return n===void 0?r:r===void 0||Math.abs(n-T){var N;g?.(M),(N=T.onUpdate)===null||N===void 0||N.call(T,M)},onComplete:m,onStop:y}))}function k(T){P(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},T))}if(S(e))k({from:e,velocity:t,to:E(e)});else{let T=i*t+e;typeof d<"u"&&(T=d(T));const M=E(T),N=M===n?-1:1;let F,z;const B=K=>{F=z,z=K,t=cN(K-F,Lee().delta),(N===1&&K>M||N===-1&&Kx?.stop()}}const u6=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),uP=e=>u6(e)&&e.hasOwnProperty("z"),B2=(e,t)=>Math.abs(e-t);function S8(e,t){if(a6(e)&&a6(t))return B2(e,t);if(u6(e)&&u6(t)){const n=B2(e.x,t.x),r=B2(e.y,t.y),i=uP(e)&&uP(t)?B2(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const dN=(e,t)=>1-3*t+3*e,fN=(e,t)=>3*t-6*e,hN=e=>3*e,r3=(e,t,n)=>((dN(t,n)*e+fN(t,n))*e+hN(t))*e,pN=(e,t,n)=>3*dN(t,n)*e*e+2*fN(t,n)*e+hN(t),Oee=1e-7,Nee=10;function Dee(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=r3(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Oee&&++s=Fee?$ee(a,g,e,n):m===0?g:Dee(a,s,s+H2,e,n)}return a=>a===0||a===1?a:r3(o(a),t,r)}function Hee({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.exports.useRef(!1),s=w.exports.useRef(null),l={passive:!(t||e||n||y)};function d(){s.current&&s.current(),s.current=null}function p(){return d(),a.current=!1,i.animationState&&i.animationState.setActive(Vn.Tap,!1),!qO()}function g(x,S){!p()||(ZO(i.getInstance(),x.target)?e&&e(x,S):n&&n(x,S))}function m(x,S){!p()||n&&n(x,S)}function y(x,S){d(),!a.current&&(a.current=!0,s.current=P4(Jp(window,"pointerup",g,l),Jp(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(Vn.Tap,!0),t&&t(x,S))}J5(i,"pointerdown",o?y:void 0,l),p8(d)}const Wee="production",gN=typeof process>"u"||process.env===void 0?Wee:"production",cP=new Set;function mN(e,t,n){e||cP.has(t)||(console.warn(t),n&&console.warn(n),cP.add(t))}const c6=new WeakMap,Dx=new WeakMap,Vee=e=>{const t=c6.get(e.target);t&&t(e)},Uee=e=>{e.forEach(Vee)};function Gee({root:e,...t}){const n=e||document;Dx.has(n)||Dx.set(n,{});const r=Dx.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Uee,{root:e,...t})),r[i]}function jee(e,t,n){const r=Gee(t);return c6.set(e,n),r.observe(e),()=>{c6.delete(e),r.unobserve(e)}}function Kee({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.exports.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Yee:Zee)(a,o.current,e,i)}const qee={some:0,all:1};function Zee(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.exports.useEffect(()=>{if(!e)return;const s={root:r?.current,rootMargin:i,threshold:typeof o=="number"?o:qee[o]},l=d=>{const{isIntersecting:p}=d;if(t.isInView===p||(t.isInView=p,a&&!p&&t.hasEnteredView))return;p&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(Vn.InView,p);const g=n.getProps(),m=p?g.onViewportEnter:g.onViewportLeave;m&&m(d)};return jee(n.getInstance(),s,l)},[e,r,i,o])}function Yee(e,t,n,{fallback:r=!0}){w.exports.useEffect(()=>{!e||!r||(gN!=="production"&&mN(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(Vn.InView,!0)}))},[e])}const Zc=e=>t=>(e(t),null),Xee={inView:Zc(Kee),tap:Zc(Hee),focus:Zc(EJ),hover:Zc(DJ)};function w8(){const e=w.exports.useContext(B0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.exports.useId();return w.exports.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Qee(){return Jee(w.exports.useContext(B0))}function Jee(e){return e===null?!0:e.isPresent}function vN(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,ete={linear:v8,easeIn:y8,easeInOut:rN,easeOut:see,circIn:iN,circInOut:lee,circOut:b8,backIn:x8,backInOut:cee,backOut:uee,anticipate:dee,bounceIn:gee,bounceInOut:mee,bounceOut:n3},dP=e=>{if(Array.isArray(e)){e3(e.length===4);const[t,n,r,i]=e;return Bee(t,n,r,i)}else if(typeof e=="string")return ete[e];return e},tte=e=>Array.isArray(e)&&typeof e[0]!="number",fP=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&Ru.test(t)&&!t.startsWith("url(")),_f=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),W2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),zx=()=>({type:"keyframes",ease:"linear",duration:.3}),nte=e=>({type:"keyframes",duration:.8,values:e}),hP={x:_f,y:_f,z:_f,rotate:_f,rotateX:_f,rotateY:_f,rotateZ:_f,scaleX:W2,scaleY:W2,scale:W2,opacity:zx,backgroundColor:zx,color:zx,default:W2},rte=(e,t)=>{let n;return Im(t)?n=nte:n=hP[e]||hP.default,{to:t,...n(t)}},ite={...AO,color:ho,backgroundColor:ho,outlineColor:ho,fill:ho,stroke:ho,borderColor:ho,borderTopColor:ho,borderRightColor:ho,borderBottomColor:ho,borderLeftColor:ho,filter:n6,WebkitFilter:n6},C8=e=>ite[e];function _8(e,t){var n;let r=C8(e);return r!==n6&&(r=Ru),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const ote={current:!1};function ate({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...d}){return!!Object.keys(d).length}function ste({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=i3(o.duration)),o.repeatDelay&&(a.repeatDelay=i3(o.repeatDelay)),e&&(a.ease=tte(e)?e.map(dP):dP(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function lte(e,t){var n,r;return(r=(n=(k8(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function ute(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function cte(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),ute(t),ate(e)||(e={...e,...rte(n,t.to)}),{...t,...ste(e)}}function dte(e,t,n,r,i){const o=k8(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=fP(e,n);a==="none"&&s&&typeof n=="string"?a=_8(e,n):pP(a)&&typeof n=="string"?a=gP(n):!Array.isArray(n)&&pP(n)&&typeof a=="string"&&(n=gP(a));const l=fP(e,a);function d(){const g={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?Ree({...g,...o}):uN({...cte(o,g,e),onUpdate:m=>{g.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{g.onComplete(),o.onComplete&&o.onComplete()}})}function p(){const g=BO(n);return t.set(g),i(),o.onUpdate&&o.onUpdate(g),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?p:d}function pP(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function gP(e){return typeof e=="number"?0:_8("",e)}function k8(e,t){return e[t]||e.default||e}function E8(e,t,n,r={}){return ote.current&&(r={type:!1}),t.start(i=>{let o,a;const s=dte(e,t,n,r,i),l=lte(r,e),d=()=>a=s();return l?o=window.setTimeout(d,i3(l)):d(),()=>{clearTimeout(o),a&&a.stop()}})}const fte=e=>/^\-?\d*\.?\d+$/.test(e),hte=e=>/^0[^.\s]+$/.test(e),yN=1/60*1e3,pte=typeof performance<"u"?()=>performance.now():()=>Date.now(),bN=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(pte()),yN);function gte(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,d=!1,p=!1)=>{const g=p&&i,m=g?t:n;return d&&a.add(l),m.indexOf(l)===-1&&(m.push(l),g&&i&&(r=t.length)),l},cancel:l=>{const d=n.indexOf(l);d!==-1&&n.splice(d,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 d=0;d(e[t]=gte(()=>Om=!0),e),{}),Ll=dv.reduce((e,t)=>{const n=A4[t];return e[t]=(r,i=!1,o=!1)=>(Om||yte(),n.schedule(r,i,o)),e},{}),Nm=dv.reduce((e,t)=>(e[t]=A4[t].cancel,e),{}),Fx=dv.reduce((e,t)=>(e[t]=()=>A4[t].process(t0),e),{}),vte=e=>A4[e].process(t0),xN=e=>{Om=!1,t0.delta=d6?yN:Math.max(Math.min(e-t0.timestamp,mte),1),t0.timestamp=e,f6=!0,dv.forEach(vte),f6=!1,Om&&(d6=!1,bN(xN))},yte=()=>{Om=!0,d6=!0,f6||bN(xN)},h6=()=>t0;function P8(e,t){e.indexOf(t)===-1&&e.push(t)}function T8(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ug{constructor(){this.subscriptions=[]}add(t){return P8(this.subscriptions,t),()=>T8(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!isNaN(parseFloat(e));class xte{constructor(t){this.version="7.3.5",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ug,this.velocityUpdateSubscribers=new Ug,this.renderSubscribers=new Ug,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=h6();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Ll.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ll.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=bte(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?cN(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function S0(e){return new xte(e)}const SN=e=>t=>t.test(e),Ste={test:e=>e==="auto",parse:e=>e},wN=[hh,St,Tl,Nc,ZQ,qQ,Ste],J1=e=>wN.find(SN(e)),wte=[...wN,ho,Ru],Cte=e=>wte.find(SN(e));function _te(e){const t={};return e.forEachValue((n,r)=>t[r]=n.get()),t}function kte(e){const t={};return e.forEachValue((n,r)=>t[r]=n.getVelocity()),t}function I4(e,t,n){const r=e.getProps();return $O(r,t,n!==void 0?n:r.custom,_te(e),kte(e))}function Ete(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,S0(n))}function Pte(e,t){const n=I4(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=BO(o[a]);Ete(e,a,s)}}function Tte(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;sp6(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=p6(e,t,n);else{const i=typeof t=="function"?I4(e,t,n.custom):t;r=CN(e,i,n)}return r.then(()=>e.notifyAnimationComplete(t))}function p6(e,t,n={}){var r;const i=I4(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>CN(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(d=0)=>{const{delayChildren:p=0,staggerChildren:g,staggerDirection:m}=o;return Mte(e,t,p+d,g,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[d,p]=l==="beforeChildren"?[a,s]:[s,a];return d().then(p)}else return Promise.all([a(),s(n.delay)])}function CN(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const d=e.getValue("willChange");r&&(a=r);const p=[],g=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const y=e.getValue(m),x=l[m];if(!y||x===void 0||g&&Ote(g,m))continue;let S={delay:n,...a};e.shouldReduceMotion&&sv.has(m)&&(S={...S,type:!1,delay:0});let E=E8(m,y,x,S);o3(d)&&(d.add(m),E=E.then(()=>d.remove(m))),p.push(E)}return Promise.all(p).then(()=>{s&&Pte(e,s)})}function Mte(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(d=0)=>d*r:(d=0)=>s-d*r;return Array.from(e.variantChildren).sort(Rte).forEach((d,p)=>{a.push(p6(d,t,{...o,delay:n+l(p)}).then(()=>d.notifyAnimationComplete(t)))}),Promise.all(a)}function Rte(e,t){return e.sortNodePosition(t)}function Ote({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const L8=[Vn.Animate,Vn.InView,Vn.Focus,Vn.Hover,Vn.Tap,Vn.Drag,Vn.Exit],Nte=[...L8].reverse(),Dte=L8.length;function zte(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Ite(e,n,r)))}function Fte(e){let t=zte(e);const n=Bte();let r=!0;const i=(l,d)=>{const p=I4(e,d);if(p){const{transition:g,transitionEnd:m,...y}=p;l={...l,...y,...m}}return l};function o(l){t=l(e)}function a(l,d){var p;const g=e.getProps(),m=e.getVariantContext(!0)||{},y=[],x=new Set;let S={},E=1/0;for(let k=0;kE&&F;const X=Array.isArray(N)?N:[N];let ue=X.reduce(i,{});z===!1&&(ue={});const{prevResolvedValues:ge={}}=M,xe={...ge,...ue},we=Se=>{j=!0,x.delete(Se),M.needsAnimating[Se]=!0};for(const Se in xe){const J=ue[Se],G=ge[Se];S.hasOwnProperty(Se)||(J!==G?Im(J)&&Im(G)?!vN(J,G)||K?we(Se):M.protectedKeys[Se]=!0:J!==void 0?we(Se):x.add(Se):J!==void 0&&x.has(Se)?we(Se):M.protectedKeys[Se]=!0)}M.prevProp=N,M.prevResolvedValues=ue,M.isActive&&(S={...S,...ue}),r&&e.blockInitialAnimation&&(j=!1),j&&!B&&y.push(...X.map(Se=>({animation:Se,options:{type:T,...l}})))}if(x.size){const k={};x.forEach(T=>{const M=e.getBaseTarget(T);M!==void 0&&(k[T]=M)}),y.push({animation:k})}let P=Boolean(y.length);return r&&g.initial===!1&&!e.manuallyAnimateOnMount&&(P=!1),r=!1,P?t(y):Promise.resolve()}function s(l,d,p){var g;if(n[l].isActive===d)return Promise.resolve();(g=e.variantChildren)===null||g===void 0||g.forEach(y=>{var x;return(x=y.animationState)===null||x===void 0?void 0:x.setActive(l,d)}),n[l].isActive=d;const m=a(p,l);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function $te(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!vN(t,e):!1}function kf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Bte(){return{[Vn.Animate]:kf(!0),[Vn.InView]:kf(),[Vn.Hover]:kf(),[Vn.Tap]:kf(),[Vn.Drag]:kf(),[Vn.Focus]:kf(),[Vn.Exit]:kf()}}const Hte={animation:Zc(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Fte(e)),w4(t)&&w.exports.useEffect(()=>t.subscribe(e),[t])}),exit:Zc(e=>{const{custom:t,visualElement:n}=e,[r,i]=w8(),o=w.exports.useContext(B0);w.exports.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(Vn.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class _N{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 d=Bx(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=S8(d.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:m}=d,{timestamp:y}=h6();this.history.push({...m,timestamp:y});const{onStart:x,onMove:S}=this.handlers;p||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{if(this.lastMoveEvent=d,this.lastMoveEventInfo=$x(p,this.transformPagePoint),WO(d)&&d.buttons===0){this.handlePointerUp(d,p);return}Ll.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:g,onSessionEnd:m}=this.handlers,y=Bx($x(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,y),m&&m(d,y)},VO(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=h8(t),o=$x(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=h6();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,Bx(o,this.history)),this.removeListeners=P4(Jp(window,"pointermove",this.handlePointerMove),Jp(window,"pointerup",this.handlePointerUp),Jp(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Nm.update(this.updatePoint)}}function $x(e,t){return t?{point:t(e.point)}:e}function mP(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Bx({point:e},t){return{point:e,delta:mP(e,kN(t)),offset:mP(e,Wte(t)),velocity:Vte(t,.1)}}function Wte(e){return e[0]}function kN(e){return e[e.length-1]}function Vte(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=kN(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>i3(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;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 xa(e){return e.max-e.min}function vP(e,t=0,n=.01){return S8(e,t)n&&(e=r?Er(n,e,r.max):Math.min(e,n)),e}function SP(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 jte(e,{top:t,left:n,bottom:r,right:i}){return{x:SP(e.x,n,i),y:SP(e.y,t,r)}}function wP(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Mm(t.min,t.max-r,e.min):r>i&&(n=Mm(e.min,e.max-i,t.min)),t3(0,1,n)}function Zte(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 g6=.35;function Yte(e=g6){return e===!1?e=0:e===!0&&(e=g6),{x:CP(e,"left","right"),y:CP(e,"top","bottom")}}function CP(e,t,n){return{min:_P(e,t),max:_P(e,n)}}function _P(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const kP=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kg=()=>({x:kP(),y:kP()}),EP=()=>({min:0,max:0}),Ii=()=>({x:EP(),y:EP()});function gl(e){return[e("x"),e("y")]}function EN({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Xte({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Qte(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 Hx(e){return e===void 0||e===1}function PN({scale:e,scaleX:t,scaleY:n}){return!Hx(e)||!Hx(t)||!Hx(n)}function Dc(e){return PN(e)||PP(e.x)||PP(e.y)||e.z||e.rotate||e.rotateX||e.rotateY}function PP(e){return e&&e!=="0%"}function a3(e,t,n){const r=e-n,i=t*r;return n+i}function TP(e,t,n,r,i){return i!==void 0&&(e=a3(e,i,r)),a3(e,n,r)+t}function m6(e,t=0,n=1,r,i){e.min=TP(e.min,t,n,r,i),e.max=TP(e.max,t,n,r,i)}function TN(e,{x:t,y:n}){m6(e.x,t.translate,t.scale,t.originPoint),m6(e.y,n.translate,n.scale,n.originPoint)}function Jte(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let d=0;d{this.stopAnimation(),n&&this.snapToCursor(h8(s,"page").point)},i=(s,l)=>{var d;const{drag:p,dragPropagation:g,onDragStart:m}=this.getProps();p&&!g&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=KO(p),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gl(y=>{var x,S;let E=this.getAxisMotionValue(y).get()||0;if(Tl.test(E)){const P=(S=(x=this.visualElement.projection)===null||x===void 0?void 0:x.layout)===null||S===void 0?void 0:S.actual[y];P&&(E=xa(P)*(parseFloat(E)/100))}this.originPoint[y]=E}),m?.(s,l),(d=this.visualElement.animationState)===null||d===void 0||d.setActive(Vn.Drag,!0))},o=(s,l)=>{const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:g,onDrag:m}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:y}=l;if(p&&this.currentDirection===null){this.currentDirection=one(y),this.currentDirection!==null&&g?.(this.currentDirection);return}this.updateAxis("x",l.point,y),this.updateAxis("y",l.point,y),this.visualElement.syncRender(),m?.(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new _N(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{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?.(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(Vn.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!V2(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Gte(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&&Hp(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=jte(r.actual,t):this.constraints=!1,this.elastic=Yte(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&gl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Zte(r.actual[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Hp(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=nne(r,i.root,this.visualElement.getTransformPagePoint());let a=Kte(i.layout.actual,o);if(n){const s=n(Xte(a));this.hasMutatedConstraints=!!s,s&&(a=EN(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},d=gl(p=>{var g;if(!V2(p,n,this.currentDirection))return;let m=(g=l?.[p])!==null&&g!==void 0?g:{};a&&(m={min:0,max:0});const y=i?200:1e6,x=i?40:1e7,S={type:"inertia",velocity:r?t[p]:0,bounceStiffness:y,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(p,S)});return Promise.all(d).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return E8(t,r,0,n)}stopAnimation(){gl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){gl(n=>{const{drag:r}=this.getProps();if(!V2(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.actual[n];o.set(t[n]-Er(a,s,.5))}})}scalePositionWithinConstraints(){var t;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Hp(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};gl(s=>{const l=this.getAxisMotionValue(s);if(l){const d=l.get();o[s]=qte({min:d,max:d},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),gl(s=>{if(!V2(s,n,null))return;const l=this.getAxisMotionValue(s),{min:d,max:p}=this.constraints[s];l.set(Er(d,p,o[s]))})}addListeners(){var t;rne.set(this.visualElement,this);const n=this.visualElement.getInstance(),r=Jp(n,"pointerdown",d=>{const{drag:p,dragListener:g=!0}=this.getProps();p&&g&&this.start(d)}),i=()=>{const{dragConstraints:d}=this.getProps();Hp(d)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=k4(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(gl(g=>{const m=this.getAxisMotionValue(g);!m||(this.originPoint[g]+=d[g].translate,m.set(m.get()+d[g].translate))}),this.visualElement.syncRender())});return()=>{s(),r(),a(),l?.()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=g6,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function V2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function one(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function ane(e){const{dragControls:t,visualElement:n}=e,r=_4(()=>new ine(n));w.exports.useEffect(()=>t&&t.subscribe(r),[r,t]),w.exports.useEffect(()=>r.addListeners(),[r])}function sne({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.exports.useRef(null),{transformPagePoint:s}=w.exports.useContext(o8),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(p,g)=>{a.current=null,n&&n(p,g)}};w.exports.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function d(p){a.current=new _N(p,l,{transformPagePoint:s})}J5(i,"pointerdown",o&&d),p8(()=>a.current&&a.current.end())}const lne={pan:Zc(sne),drag:Zc(ane)},v6={current:null},AN={current:!1};function une(){if(AN.current=!0,!!fh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>v6.current=e.matches;e.addListener(t),t()}else v6.current=!1}const U2=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function cne(){const e=U2.map(()=>new Ug),t={},n={clearAllListeners:()=>e.forEach(r=>r.clear()),updatePropListeners:r=>{U2.forEach(i=>{var o;const a="on"+i,s=r[a];(o=t[i])===null||o===void 0||o.call(t),s&&(t[i]=n[a](s))})}};return e.forEach((r,i)=>{n["on"+U2[i]]=o=>r.add(o),n["notify"+U2[i]]=(...o)=>r.notify(...o)}),n}function dne(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(Ol(o))e.addValue(i,o),o3(r)&&r.add(i);else if(Ol(a))e.addValue(i,S0(o)),o3(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,S0(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const IN=Object.keys(Lm),fne=IN.length,MN=({treeType:e="",build:t,getBaseTarget:n,makeTargetAnimatable:r,measureViewportBox:i,render:o,readValueFromInstance:a,removeValueFromRenderState:s,sortNodePosition:l,scrapeMotionValuesFromProps:d})=>({parent:p,props:g,presenceId:m,blockInitialAnimation:y,visualState:x,reducedMotionConfig:S},E={})=>{let P=!1;const{latestValues:k,renderState:T}=x;let M;const N=cne(),F=new Map,z=new Map;let B={};const K={...k};let j;function X(){!M||!P||(ue(),o(M,T,g.style,te.projection))}function ue(){t(te,T,k,E,g)}function ge(){N.notifyUpdate(k)}function xe(Q,W){const ie=W.onChange(be=>{k[Q]=be,g.onUpdate&&Ll.update(ge,!1,!0)}),de=W.onRenderRequest(te.scheduleRender);z.set(Q,()=>{ie(),de()})}const{willChange:we,...Se}=d(g);for(const Q in Se){const W=Se[Q];k[Q]!==void 0&&Ol(W)&&(W.set(k[Q],!1),o3(we)&&we.add(Q))}const J=C4(g),G=bO(g),te={treeType:e,current:null,depth:p?p.depth+1:0,parent:p,children:new Set,presenceId:m,shouldReduceMotion:null,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(p?.isMounted()),blockInitialAnimation:y,isMounted:()=>Boolean(M),mount(Q){P=!0,M=te.current=Q,te.projection&&te.projection.mount(Q),G&&p&&!J&&(j=p?.addVariantChild(te)),F.forEach((W,ie)=>xe(ie,W)),AN.current||une(),te.shouldReduceMotion=S==="never"?!1:S==="always"?!0:v6.current,p?.children.add(te),te.setProps(g)},unmount(){var Q;(Q=te.projection)===null||Q===void 0||Q.unmount(),Nm.update(ge),Nm.render(X),z.forEach(W=>W()),j?.(),p?.children.delete(te),N.clearAllListeners(),M=void 0,P=!1},loadFeatures(Q,W,ie,de,be,De){const Re=[];for(let Ve=0;Vete.scheduleRender(),animationType:typeof ke=="string"?ke:"both",initialPromotionConfig:De,layoutScroll:ft})}return Re},addVariantChild(Q){var W;const ie=te.getClosestVariantNode();if(ie)return(W=ie.variantChildren)===null||W===void 0||W.add(Q),()=>ie.variantChildren.delete(Q)},sortNodePosition(Q){return!l||e!==Q.treeType?0:l(te.getInstance(),Q.getInstance())},getClosestVariantNode:()=>G?te:p?.getClosestVariantNode(),getLayoutId:()=>g.layoutId,getInstance:()=>M,getStaticValue:Q=>k[Q],setStaticValue:(Q,W)=>k[Q]=W,getLatestValues:()=>k,setVisibility(Q){te.isVisible!==Q&&(te.isVisible=Q,te.scheduleRender())},makeTargetAnimatable(Q,W=!0){return r(te,Q,g,W)},measureViewportBox(){return i(M,g)},addValue(Q,W){te.hasValue(Q)&&te.removeValue(Q),F.set(Q,W),k[Q]=W.get(),xe(Q,W)},removeValue(Q){var W;F.delete(Q),(W=z.get(Q))===null||W===void 0||W(),z.delete(Q),delete k[Q],s(Q,T)},hasValue:Q=>F.has(Q),getValue(Q,W){let ie=F.get(Q);return ie===void 0&&W!==void 0&&(ie=S0(W),te.addValue(Q,ie)),ie},forEachValue:Q=>F.forEach(Q),readValue:Q=>k[Q]!==void 0?k[Q]:a(M,Q,E),setBaseTarget(Q,W){K[Q]=W},getBaseTarget(Q){if(n){const W=n(g,Q);if(W!==void 0&&!Ol(W))return W}return K[Q]},...N,build(){return ue(),T},scheduleRender(){Ll.render(X,!1,!0)},syncRender:X,setProps(Q){(Q.transformTemplate||g.transformTemplate)&&te.scheduleRender(),g=Q,N.updatePropListeners(Q),B=dne(te,d(g),B)},getProps:()=>g,getVariant:Q=>{var W;return(W=g.variants)===null||W===void 0?void 0:W[Q]},getDefaultTransition:()=>g.transition,getTransformPagePoint:()=>g.transformPagePoint,getVariantContext(Q=!1){if(Q)return p?.getVariantContext();if(!J){const ie=p?.getVariantContext()||{};return g.initial!==void 0&&(ie.initial=g.initial),ie}const W={};for(let ie=0;ie{const o=i.get();if(!y6(o))return;const a=b6(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!y6(o))continue;const a=b6(o,r);!a||(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const mne=new Set(["width","height","top","left","right","bottom","x","y"]),NN=e=>mne.has(e),vne=e=>Object.keys(e).some(NN),DN=(e,t)=>{e.set(t,!1),e.set(t)},AP=e=>e===hh||e===St;var IP;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(IP||(IP={}));const MP=(e,t)=>parseFloat(e.split(", ")[t]),RP=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return MP(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?MP(o[1],e):0}},yne=new Set(["x","y","z"]),bne=X5.filter(e=>!yne.has(e));function xne(e){const t=[];return bne.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.syncRender(),t}const OP={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:RP(4,13),y:RP(5,14)},Sne=(e,t,n)=>{const r=t.measureViewportBox(),i=t.getInstance(),o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(d=>{s[d]=OP[d](r,o)}),t.syncRender();const l=t.measureViewportBox();return n.forEach(d=>{const p=t.getValue(d);DN(p,s[d]),e[d]=OP[d](l,o)}),e},wne=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(NN);let o=[],a=!1;const s=[];if(i.forEach(l=>{const d=e.getValue(l);if(!e.hasValue(l))return;let p=n[l],g=J1(p);const m=t[l];let y;if(Im(m)){const x=m.length,S=m[0]===null?1:0;p=m[S],g=J1(p);for(let E=S;E=0?window.pageYOffset:null,d=Sne(t,e,s);return o.length&&o.forEach(([p,g])=>{e.getValue(p).set(g)}),e.syncRender(),fh&&l!==null&&window.scrollTo({top:l}),{target:d,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Cne(e,t,n,r){return vne(t)?wne(e,t,n,r):{target:t,transitionEnd:r}}const _ne=(e,t,n,r)=>{const i=gne(e,t,r);return t=i.target,r=i.transitionEnd,Cne(e,t,n,r)};function kne(e){return window.getComputedStyle(e)}const zN={treeType:"dom",readValueFromInstance(e,t){if(sv.has(t)){const n=C8(t);return n&&n.default||0}else{const n=kne(e),r=(wO(t)?n.getPropertyValue(t):n[t])||0;return typeof r=="string"?r.trim():r}},sortNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1},getBaseTarget(e,t){var n;return(n=e.style)===null||n===void 0?void 0:n[t]},measureViewportBox(e,{transformPagePoint:t}){return LN(e,t)},resetTransform(e,t,n){const{transformTemplate:r}=n;t.style.transform=r?r({},""):"none",e.scheduleRender()},restoreTransform(e,t){e.style.transform=t.style.transform},removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]},makeTargetAnimatable(e,{transition:t,transitionEnd:n,...r},{transformValues:i},o=!0){let a=Ate(r,t||{},e);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){Tte(e,r,a);const s=_ne(e,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}},scrapeMotionValuesFromProps:f8,build(e,t,n,r,i){e.isVisible!==void 0&&(t.style.visibility=e.isVisible?"visible":"hidden"),u8(t,n,r,i.transformTemplate)},render:NO},Ene=MN(zN),Pne=MN({...zN,getBaseTarget(e,t){return e[t]},readValueFromInstance(e,t){var n;return sv.has(t)?((n=C8(t))===null||n===void 0?void 0:n.default)||0:(t=DO.has(t)?t:OO(t),e.getAttribute(t))},scrapeMotionValuesFromProps:FO,build(e,t,n,r,i){d8(t,n,r,i.transformTemplate)},render:zO}),Tne=(e,t)=>s8(e)?Pne(t,{enableHardwareAcceleration:!1}):Ene(t,{enableHardwareAcceleration:!0});function NP(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const eg={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(St.test(e))e=parseFloat(e);else return e;const n=NP(e,t.target.x),r=NP(e,t.target.y);return`${n}% ${r}%`}},DP="_$css",Lne={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(ON,y=>(o.push(y),DP)));const a=Ru.parse(e);if(a.length>5)return r;const s=Ru.createTransformer(e),l=typeof a[0]!="number"?1:0,d=n.x.scale*t.x,p=n.y.scale*t.y;a[0+l]/=d,a[1+l]/=p;const g=Er(d,p,.5);typeof a[2+l]=="number"&&(a[2+l]/=g),typeof a[3+l]=="number"&&(a[3+l]/=g);let m=s(a);if(i){let y=0;m=m.replace(DP,()=>{const x=o[y];return y++,x})}return m}};class Ane extends le.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;WQ(Mne),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()})),Hg.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()||Ll.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n?.group&&n.group.remove(i),r?.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t?.()}render(){return null}}function Ine(e){const[t,n]=w8(),r=w.exports.useContext(a8);return _(Ane,{...e,layoutGroup:r,switchLayoutGroup:w.exports.useContext(xO),isPresent:t,safeToRemove:n})}const Mne={borderRadius:{...eg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:eg,borderTopRightRadius:eg,borderBottomLeftRadius:eg,borderBottomRightRadius:eg,boxShadow:Lne},Rne={measureLayout:Ine};function One(e,t,n={}){const r=Ol(e)?e:S0(e);return E8("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const FN=["TopLeft","TopRight","BottomLeft","BottomRight"],Nne=FN.length,zP=e=>typeof e=="string"?parseFloat(e):e,FP=e=>typeof e=="number"||St.test(e);function Dne(e,t,n,r,i,o){var a,s,l,d;i?(e.opacity=Er(0,(a=n.opacity)!==null&&a!==void 0?a:1,zne(r)),e.opacityExit=Er((s=t.opacity)!==null&&s!==void 0?s:1,0,Fne(r))):o&&(e.opacity=Er((l=t.opacity)!==null&&l!==void 0?l:1,(d=n.opacity)!==null&&d!==void 0?d:1,r));for(let p=0;prt?1:n(Mm(e,t,r))}function BP(e,t){e.min=t.min,e.max=t.max}function _s(e,t){BP(e.x,t.x),BP(e.y,t.y)}function HP(e,t,n,r,i){return e-=t,e=a3(e,1/n,r),i!==void 0&&(e=a3(e,1/i,r)),e}function $ne(e,t=0,n=1,r=.5,i,o=e,a=e){if(Tl.test(t)&&(t=parseFloat(t),t=Er(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Er(o.min,o.max,r);e===o&&(s-=t),e.min=HP(e.min,t,n,s,i),e.max=HP(e.max,t,n,s,i)}function WP(e,t,[n,r,i],o,a){$ne(e,t[n],t[r],t[i],t.scale,o,a)}const Bne=["x","scaleX","originX"],Hne=["y","scaleY","originY"];function VP(e,t,n,r){WP(e.x,t,Bne,n?.x,r?.x),WP(e.y,t,Hne,n?.y,r?.y)}function UP(e){return e.translate===0&&e.scale===1}function BN(e){return UP(e.x)&&UP(e.y)}function HN(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 GP(e){return xa(e.x)/xa(e.y)}function Wne(e,t,n=.01){return S8(e,t)<=n}class Vne{constructor(){this.members=[]}add(t){P8(this.members,t),t.scheduleRender()}remove(t){if(T8(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){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues,t.snapshot.isShared=!0),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Une="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function jP(e,t,n){const r=e.x.translate/t.x,i=e.y.translate/t.y;let o=`translate3d(${r}px, ${i}px, 0) `;if(o+=`scale(${1/t.x}, ${1/t.y}) `,n){const{rotate:l,rotateX:d,rotateY:p}=n;l&&(o+=`rotate(${l}deg) `),d&&(o+=`rotateX(${d}deg) `),p&&(o+=`rotateY(${p}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return o+=`scale(${a}, ${s})`,o===Une?"none":o}const Gne=(e,t)=>e.depth-t.depth;class jne{constructor(){this.children=[],this.isDirty=!1}add(t){P8(this.children,t),this.isDirty=!0}remove(t){T8(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gne),this.isDirty=!1,this.children.forEach(t)}}const KP=["","X","Y","Z"],qP=1e3;function WN({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t?.()){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!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.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Qne),this.nodes.forEach(Jne)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let d=0;dthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,clearTimeout(m),m=window.setTimeout(y,250),Hg.hasAnimatedSinceResize&&(Hg.hasAnimatedSinceResize=!1,this.nodes.forEach(Xne))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&g&&(d||p)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeTargetChanged:x,layout:S})=>{var E,P,k,T,M;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const N=(P=(E=this.options.transition)!==null&&E!==void 0?E:g.getDefaultTransition())!==null&&P!==void 0?P:ire,{onLayoutAnimationStart:F,onLayoutAnimationComplete:z}=g.getProps(),B=!this.targetLayout||!HN(this.targetLayout,S)||x,K=!y&&x;if(((k=this.resumeFrom)===null||k===void 0?void 0:k.instance)||K||y&&(B||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,K);const j={...k8(N,"layout"),onPlay:F,onComplete:z};g.shouldReduceMotion&&(j.delay=0,j.type=!1),this.startAnimation(j)}else!y&&this.animationProgress===0&&this.finishAnimation(),this.isLead()&&((M=(T=this.options).onExitComplete)===null||M===void 0||M.call(T));this.targetLayout=S})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Nm.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(ere))}willUpdate(a=!0){var s,l,d;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const a=this.measure(),s=this.removeTransform(this.removeElementScroll(a));JP(s),this.snapshot={measured:a,layout:s,latestValues:{}}}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d{var k;const T=P/1e3;YP(m.x,a.x,T),YP(m.y,a.y,T),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&((k=this.relativeParent)===null||k===void 0?void 0:k.layout)&&(jg(y,this.layout.actual,this.relativeParent.layout.actual),nre(this.relativeTarget,this.relativeTargetOrigin,y,T)),x&&(this.animationValues=g,Dne(g,p,this.latestValues,T,E,S)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Nm.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ll.update(()=>{Hg.hasAnimatedSinceResize=!0,this.currentAnimation=One(0,qP,{...a,onUpdate:d=>{var p;this.mixTargetDelta(d),(p=a.onUpdate)===null||p===void 0||p.call(a,d)},onComplete:()=>{var d;(d=a.onComplete)===null||d===void 0||d.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,qP),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:d,latestValues:p}=a;if(!(!s||!l||!d)){if(this!==a&&this.layout&&d&&VN(this.options.animationType,this.layout.actual,d.actual)){l=this.target||Ii();const g=xa(this.layout.actual.x);l.x.min=a.target.x.min,l.x.max=l.x.min+g;const m=xa(this.layout.actual.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}_s(s,l),Wp(s,p),Gg(this.projectionDeltaWithTransform,this.layoutCorrected,s,p)}}registerSharedNode(a,s){var l,d,p;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Vne),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(p=(d=s.options.initialPromotionConfig)===null||d===void 0?void 0:d.shouldPreserveFollowOpacity)===null||p===void 0?void 0:p.call(d,s)})}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 d=this.getStack();d&&d.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 l={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(ZP),this.root.sharedNodes.clear()}}}function Kne(e){e.updateLayout()}function qne(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{actual:o,measured:a}=e.layout,{animationType:s}=e.options;s==="size"?gl(m=>{const y=i.isShared?i.measured[m]:i.layout[m],x=xa(y);y.min=o[m].min,y.max=y.min+x}):VN(s,i.layout,o)&&gl(m=>{const y=i.isShared?i.measured[m]:i.layout[m],x=xa(o[m]);y.max=y.min+x});const l=Kg();Gg(l,o,i.layout);const d=Kg();i.isShared?Gg(d,e.applyTransform(a,!0),i.measured):Gg(d,o,i.layout);const p=!BN(l);let g=!1;if(!e.resumeFrom&&(e.relativeParent=e.getClosestProjectingParent(),e.relativeParent&&!e.relativeParent.resumeFrom)){const{snapshot:m,layout:y}=e.relativeParent;if(m&&y){const x=Ii();jg(x,i.layout,m.layout);const S=Ii();jg(S,o,y.actual),HN(x,S)||(g=!0)}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:l,hasLayoutChanged:p,hasRelativeTargetChanged:g})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Zne(e){e.clearSnapshot()}function ZP(e){e.clearMeasurements()}function Yne(e){const{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notifyBeforeLayoutMeasure(),e.resetTransform()}function Xne(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Qne(e){e.resolveTargetDelta()}function Jne(e){e.calcProjection()}function ere(e){e.resetRotation()}function tre(e){e.removeLeadSnapshot()}function YP(e,t,n){e.translate=Er(t.translate,0,n),e.scale=Er(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function XP(e,t,n,r){e.min=Er(t.min,n.min,r),e.max=Er(t.max,n.max,r)}function nre(e,t,n,r){XP(e.x,t.x,n.x,r),XP(e.y,t.y,n.y,r)}function rre(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ire={duration:.45,ease:[.4,0,.1,1]};function ore(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function QP(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function JP(e){QP(e.x),QP(e.y)}function VN(e,t,n){return e==="position"||e==="preserve-aspect"&&!Wne(GP(t),GP(n))}const are=WN({attachResizeListener:(e,t)=>k4(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Wx={current:void 0},sre=WN({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Wx.current){const e=new are(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),Wx.current=e}return Wx.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),lre={...Hte,...Xee,...lne,...Rne},is=BQ((e,t)=>kJ(e,t,lre,Tne,sre));function UN(){const e=w.exports.useRef(!1);return Z5(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ure(){const e=UN(),[t,n]=w.exports.useState(0),r=w.exports.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.exports.useCallback(()=>Ll.postRender(r),[r]),t]}class cre extends w.exports.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 dre({children:e,isPresent:t}){const n=w.exports.useId(),r=w.exports.useRef(null),i=w.exports.useRef({width:0,height:0,top:0,left:0});return w.exports.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 d=document.createElement("style");return document.head.appendChild(d),d.sheet&&d.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(d)}},[t]),_(cre,{isPresent:t,childRef:r,sizeRef:i,children:w.exports.cloneElement(e,{ref:r})})}const Vx=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=_4(fre),l=w.exports.useId(),d=w.exports.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:p=>{s.set(p,!0);for(const g of s.values())if(!g)return;r&&r()},register:p=>(s.set(p,!1),()=>s.delete(p))}),o?void 0:[n]);return w.exports.useMemo(()=>{s.forEach((p,g)=>s.set(g,!1))},[n]),w.exports.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=_(dre,{isPresent:n,children:e})),_(B0.Provider,{value:d,children:e})};function fre(){return new Map}const _p=e=>e.key||"";function hre(e,t){e.forEach(n=>{const r=_p(n);t.set(r,n)})}function pre(e){const t=[];return w.exports.Children.forEach(e,n=>{w.exports.isValidElement(n)&&t.push(n)}),t}const Hu=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",mN(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=ure();const l=w.exports.useContext(a8).forceRender;l&&(s=l);const d=UN(),p=pre(e);let g=p;const m=new Set,y=w.exports.useRef(g),x=w.exports.useRef(new Map).current,S=w.exports.useRef(!0);if(Z5(()=>{S.current=!1,hre(p,x),y.current=g}),p8(()=>{S.current=!0,x.clear(),m.clear()}),S.current)return _(jn,{children:g.map(T=>_(Vx,{isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a,children:T},_p(T)))});g=[...g];const E=y.current.map(_p),P=p.map(_p),k=E.length;for(let T=0;T{if(P.indexOf(T)!==-1)return;const M=x.get(T);if(!M)return;const N=E.indexOf(T),F=()=>{x.delete(T),m.delete(T);const z=y.current.findIndex(B=>B.key===T);if(y.current.splice(z,1),!m.size){if(y.current=p,d.current===!1)return;s(),r&&r()}};g.splice(N,0,_(Vx,{isPresent:!1,onExitComplete:F,custom:t,presenceAffectsLayout:o,mode:a,children:M},_p(M)))}),g=g.map(T=>{const M=T.key;return m.has(M)?T:_(Vx,{isPresent:!0,presenceAffectsLayout:o,mode:a,children:T},_p(T))}),gN!=="production"&&a==="wait"&&g.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),_(jn,{children:m.size?g:g.map(T=>w.exports.cloneElement(T))})};var fv=(...e)=>e.filter(Boolean).join(" ");function gre(){return!1}var mre=e=>{const{condition:t,message:n}=e;t&&gre()&&console.warn(n)},Wf={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},tg={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function x6(e){switch(e?.direction??"right"){case"right":return tg.slideRight;case"left":return tg.slideLeft;case"bottom":return tg.slideDown;case"top":return tg.slideUp;default:return tg.slideRight}}var Xf={enter:{duration:.2,ease:Wf.easeOut},exit:{duration:.1,ease:Wf.easeIn}},Os={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t?.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t?.exit})},vre=e=>e!=null&&parseInt(e.toString(),10)>0,eT={exit:{height:{duration:.2,ease:Wf.ease},opacity:{duration:.3,ease:Wf.ease}},enter:{height:{duration:.3,ease:Wf.ease},opacity:{duration:.4,ease:Wf.ease}}},yre={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:vre(t)?1:0},height:t,transitionEnd:r?.exit,transition:n?.exit??Os.exit(eT.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r?.enter,transition:n?.enter??Os.enter(eT.enter,i)})},GN=w.exports.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:d,transitionEnd:p,...g}=e,[m,y]=w.exports.useState(!1);w.exports.useEffect(()=>{const k=setTimeout(()=>{y(!0)});return()=>clearTimeout(k)},[]),mre({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const x=parseFloat(o.toString())>0,S={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?d:{enter:{duration:0}},transitionEnd:{enter:p?.enter,exit:r?p?.exit:{...p?.exit,display:x?"block":"none"}}},E=r?n:!0,P=n||r?"enter":"exit";return _(Hu,{initial:!1,custom:S,children:E&&le.createElement(is.div,{ref:t,...g,className:fv("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:S,variants:yre,initial:r?"exit":!1,animate:P,exit:"exit"})})});GN.displayName="Collapse";var bre={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:e?.enter??Os.enter(Xf.enter,n),transitionEnd:t?.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:e?.exit??Os.exit(Xf.exit,n),transitionEnd:t?.exit})},jN={initial:"exit",animate:"enter",exit:"exit",variants:bre},xre=w.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...d}=t,p=i||r?"enter":"exit",g=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return _(Hu,{custom:m,children:g&&le.createElement(is.div,{ref:n,className:fv("chakra-fade",o),custom:m,...jN,animate:p,...d})})});xre.displayName="Fade";var Sre={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r?.exit}:{transitionEnd:{scale:t,...r?.exit}},transition:n?.exit??Os.exit(Xf.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:t?.enter??Os.enter(Xf.enter,n),transitionEnd:e?.enter})},KN={initial:"exit",animate:"enter",exit:"exit",variants:Sre},wre=w.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:d,delay:p,...g}=t,m=r?i&&r:!0,y=i||r?"enter":"exit",x={initialScale:a,reverse:o,transition:l,transitionEnd:d,delay:p};return _(Hu,{custom:x,children:m&&le.createElement(is.div,{ref:n,className:fv("chakra-offset-slide",s),...KN,animate:y,custom:x,...g})})});wre.displayName="ScaleFade";var tT={exit:{duration:.15,ease:Wf.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},Cre={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=x6({direction:e});return{...i,transition:t?.exit??Os.exit(tT.exit,r),transitionEnd:n?.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=x6({direction:e});return{...i,transition:n?.enter??Os.enter(tT.enter,r),transitionEnd:t?.enter}}},qN=w.exports.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:d,delay:p,...g}=t,m=x6({direction:r}),y=Object.assign({position:"fixed"},m.position,i),x=o?a&&o:!0,S=a||o?"enter":"exit",E={transitionEnd:d,transition:l,direction:r,delay:p};return _(Hu,{custom:E,children:x&&le.createElement(is.div,{...g,ref:n,initial:"exit",className:fv("chakra-slide",s),animate:S,exit:"exit",custom:E,variants:Cre,style:y})})});qN.displayName="Slide";var _re={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:n?.exit??Os.exit(Xf.exit,i),transitionEnd:r?.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:e?.enter??Os.enter(Xf.enter,n),transitionEnd:t?.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:n?.exit??Os.exit(Xf.exit,o),...i?{...a,transitionEnd:r?.exit}:{transitionEnd:{...a,...r?.exit}}}}},S6={initial:"initial",animate:"enter",exit:"exit",variants:_re},kre=w.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:d,transitionEnd:p,delay:g,...m}=t,y=r?i&&r:!0,x=i||r?"enter":"exit",S={offsetX:s,offsetY:l,reverse:o,transition:d,transitionEnd:p,delay:g};return _(Hu,{custom:S,children:y&&le.createElement(is.div,{ref:n,className:fv("chakra-offset-slide",a),custom:S,...S6,animate:x,...m})})});kre.displayName="SlideFade";var hv=(...e)=>e.filter(Boolean).join(" ");function Ere(){return!1}var M4=e=>{const{condition:t,message:n}=e;t&&Ere()&&console.warn(n)};function Ux(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var[Pre,R4]=_n({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[Tre,A8]=_n({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[Lre,u8e,Are,Ire]=vO(),Vf=Ie(function(t,n){const{getButtonProps:r}=A8(),i=r(t,n),o=R4(),a={display:"flex",alignItems:"center",width:"100%",outline:0,...o.button};return le.createElement(Ce.button,{...i,className:hv("chakra-accordion__button",t.className),__css:a})});Vf.displayName="AccordionButton";function Mre(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Nre(e),Dre(e);const s=Are(),[l,d]=w.exports.useState(-1);w.exports.useEffect(()=>()=>{d(-1)},[]);const[p,g]=x4({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:p,setIndex:g,htmlProps:a,getAccordionItemProps:y=>{let x=!1;return y!==null&&(x=Array.isArray(p)?p.includes(y):p===y),{isOpen:x,onChange:E=>{if(y!==null)if(i&&Array.isArray(p)){const P=E?p.concat(y):p.filter(k=>k!==y);g(P)}else E?g(y):o&&g(-1)}}},focusedIndex:l,setFocusedIndex:d,descendants:s}}var[Rre,I8]=_n({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Ore(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=I8(),s=w.exports.useRef(null),l=w.exports.useId(),d=r??l,p=`accordion-button-${d}`,g=`accordion-panel-${d}`;zre(e);const{register:m,index:y,descendants:x}=Ire({disabled:t&&!n}),{isOpen:S,onChange:E}=o(y===-1?null:y);Fre({isOpen:S,isDisabled:t});const P=()=>{E?.(!0)},k=()=>{E?.(!1)},T=w.exports.useCallback(()=>{E?.(!S),a(y)},[y,a,S,E]),M=w.exports.useCallback(B=>{const j={ArrowDown:()=>{const X=x.nextEnabled(y);X?.node.focus()},ArrowUp:()=>{const X=x.prevEnabled(y);X?.node.focus()},Home:()=>{const X=x.firstEnabled();X?.node.focus()},End:()=>{const X=x.lastEnabled();X?.node.focus()}}[B.key];j&&(B.preventDefault(),j(B))},[x,y]),N=w.exports.useCallback(()=>{a(y)},[a,y]),F=w.exports.useCallback(function(K={},j=null){return{...K,type:"button",ref:Fn(m,s,j),id:p,disabled:!!t,"aria-expanded":!!S,"aria-controls":g,onClick:Ux(K.onClick,T),onFocus:Ux(K.onFocus,N),onKeyDown:Ux(K.onKeyDown,M)}},[p,t,S,T,N,M,g,m]),z=w.exports.useCallback(function(K={},j=null){return{...K,ref:j,role:"region",id:g,"aria-labelledby":p,hidden:!S}},[p,S,g]);return{isOpen:S,isDisabled:t,isFocusable:n,onOpen:P,onClose:k,getButtonProps:F,getPanelProps:z,htmlProps:i}}function Nre(e){const t=e.index||e.defaultIndex,n=t==null&&!Array.isArray(t)&&e.allowMultiple;M4({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Dre(e){M4({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 zre(e){M4({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 Fre(e){M4({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Uf(e){const{isOpen:t,isDisabled:n}=A8(),{reduceMotion:r}=I8(),i=hv("chakra-accordion__icon",e.className),o=R4(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return _(Ea,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e,children:_("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Uf.displayName="AccordionIcon";var Gf=Ie(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Ore(t),l={...R4().container,overflowAnchor:"none"},d=w.exports.useMemo(()=>a,[a]);return le.createElement(Tre,{value:d},le.createElement(Ce.div,{ref:n,...o,className:hv("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Gf.displayName="AccordionItem";var jf=Ie(function(t,n){const{reduceMotion:r}=I8(),{getPanelProps:i,isOpen:o}=A8(),a=i(t,n),s=hv("chakra-accordion__panel",t.className),l=R4();r||delete a.hidden;const d=le.createElement(Ce.div,{...a,__css:l.panel,className:s});return r?d:_(GN,{in:o,children:d})});jf.displayName="AccordionPanel";var O4=Ie(function({children:t,reduceMotion:n,...r},i){const o=$i("Accordion",r),a=bn(r),{htmlProps:s,descendants:l,...d}=Mre(a),p=w.exports.useMemo(()=>({...d,reduceMotion:!!n}),[d,n]);return le.createElement(Lre,{value:l},le.createElement(Rre,{value:p},le.createElement(Pre,{value:o},le.createElement(Ce.div,{ref:i,...s,className:hv("chakra-accordion",r.className),__css:o.root},t))))});O4.displayName="Accordion";var $re=(...e)=>e.filter(Boolean).join(" "),Bre=iv({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),V0=Ie((e,t)=>{const n=So("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=bn(e),d=$re("chakra-spinner",s),p={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${Bre} ${o} linear infinite`,...n};return le.createElement(Ce.div,{ref:t,__css:p,className:d,...l},r&&le.createElement(Ce.span,{srOnly:!0},r))});V0.displayName="Spinner";var N4=(...e)=>e.filter(Boolean).join(" ");function Hre(e){return _(Ea,{viewBox:"0 0 24 24",...e,children:_("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 Wre(e){return _(Ea,{viewBox:"0 0 24 24",...e,children:_("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 nT(e){return _(Ea,{viewBox:"0 0 24 24",...e,children:_("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[Vre,Ure]=_n({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Gre,M8]=_n({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),ZN={info:{icon:Wre,colorScheme:"blue"},warning:{icon:nT,colorScheme:"orange"},success:{icon:Hre,colorScheme:"green"},error:{icon:nT,colorScheme:"red"},loading:{icon:V0,colorScheme:"blue"}};function jre(e){return ZN[e].colorScheme}function Kre(e){return ZN[e].icon}var YN=Ie(function(t,n){const{status:r="info",addRole:i=!0,...o}=bn(t),a=t.colorScheme??jre(r),s=$i("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return le.createElement(Vre,{value:{status:r}},le.createElement(Gre,{value:s},le.createElement(Ce.div,{role:i?"alert":void 0,ref:n,...o,className:N4("chakra-alert",t.className),__css:l})))});YN.displayName="Alert";var XN=Ie(function(t,n){const r=M8(),i={display:"inline",...r.description};return le.createElement(Ce.div,{ref:n,...t,className:N4("chakra-alert__desc",t.className),__css:i})});XN.displayName="AlertDescription";function QN(e){const{status:t}=Ure(),n=Kre(t),r=M8(),i=t==="loading"?r.spinner:r.icon;return le.createElement(Ce.span,{display:"inherit",...e,className:N4("chakra-alert__icon",e.className),__css:i},e.children||_(n,{h:"100%",w:"100%"}))}QN.displayName="AlertIcon";var JN=Ie(function(t,n){const r=M8();return le.createElement(Ce.div,{ref:n,...t,className:N4("chakra-alert__title",t.className),__css:r.title})});JN.displayName="AlertTitle";function qre(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Zre(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[d,p]=w.exports.useState("pending");w.exports.useEffect(()=>{p(n?"loading":"pending")},[n]);const g=w.exports.useRef(),m=w.exports.useCallback(()=>{if(!n)return;y();const x=new Image;x.src=n,a&&(x.crossOrigin=a),r&&(x.srcset=r),s&&(x.sizes=s),t&&(x.loading=t),x.onload=S=>{y(),p("loaded"),i?.(S)},x.onerror=S=>{y(),p("failed"),o?.(S)},g.current=x},[n,a,r,s,i,o,t]),y=()=>{g.current&&(g.current.onload=null,g.current.onerror=null,g.current=null)};return El(()=>{if(!l)return d==="loading"&&m(),()=>{y()}},[d,m,l]),l?"loaded":d}var Yre=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",s3=Ie(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return _("img",{width:r,height:i,ref:n,alt:o,...a})});s3.displayName="NativeImage";var D4=Ie(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:d,ignoreFallback:p,crossOrigin:g,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:y,...x}=t,S=r!==void 0||i!==void 0,E=d!=null||p||!S,P=Zre({...t,ignoreFallback:E}),k=Yre(P,m),T={ref:n,objectFit:l,objectPosition:s,...E?x:qre(x,["onError","onLoad"])};return k?i||le.createElement(Ce.img,{as:s3,className:"chakra-image__placeholder",src:r,...T}):le.createElement(Ce.img,{as:s3,src:o,srcSet:a,crossOrigin:g,loading:d,referrerPolicy:y,className:"chakra-image",...T})});D4.displayName="Image";Ie((e,t)=>le.createElement(Ce.img,{ref:t,as:s3,className:"chakra-image",...e}));var Xre=Object.create,eD=Object.defineProperty,Qre=Object.getOwnPropertyDescriptor,tD=Object.getOwnPropertyNames,Jre=Object.getPrototypeOf,eie=Object.prototype.hasOwnProperty,nD=(e,t)=>function(){return t||(0,e[tD(e)[0]])((t={exports:{}}).exports,t),t.exports},tie=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tD(t))!eie.call(e,i)&&i!==n&&eD(e,i,{get:()=>t[i],enumerable:!(r=Qre(t,i))||r.enumerable});return e},nie=(e,t,n)=>(n=e!=null?Xre(Jre(e)):{},tie(t||!e||!e.__esModule?eD(n,"default",{value:e,enumerable:!0}):n,e)),rie=nD({"../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js"(e){var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.iterator;function y(W){return W===null||typeof W!="object"?null:(W=m&&W[m]||W["@@iterator"],typeof W=="function"?W:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function P(W,ie,de){this.props=W,this.context=ie,this.refs=E,this.updater=de||x}P.prototype.isReactComponent={},P.prototype.setState=function(W,ie){if(typeof W!="object"&&typeof W!="function"&&W!=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,W,ie,"setState")},P.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function k(){}k.prototype=P.prototype;function T(W,ie,de){this.props=W,this.context=ie,this.refs=E,this.updater=de||x}var M=T.prototype=new k;M.constructor=T,S(M,P.prototype),M.isPureReactComponent=!0;var N=Array.isArray,F=Object.prototype.hasOwnProperty,z={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function K(W,ie,de){var be,De={},Re=null,Ve=null;if(ie!=null)for(be in ie.ref!==void 0&&(Ve=ie.ref),ie.key!==void 0&&(Re=""+ie.key),ie)F.call(ie,be)&&!B.hasOwnProperty(be)&&(De[be]=ie[be]);var ke=arguments.length-2;if(ke===1)De.children=de;else if(1(0,rT.isValidElement)(t))}/** + * @license React + * react.development.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. + *//** + * @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 F4=(...e)=>e.filter(Boolean).join(" "),iT=e=>e?"":void 0,[oie,aie]=_n({strict:!1,name:"ButtonGroupContext"});function w6(e){const{children:t,className:n,...r}=e,i=w.exports.isValidElement(t)?w.exports.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=F4("chakra-button__icon",n);return le.createElement(Ce.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}w6.displayName="ButtonIcon";function C6(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=_(V0,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=F4("chakra-button__spinner",o),d=n==="start"?"marginEnd":"marginStart",p=w.exports.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[d]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,d,r]);return le.createElement(Ce.div,{className:l,...s,__css:p},i)}C6.displayName="ButtonSpinner";function sie(e){const[t,n]=w.exports.useState(!e);return{ref:w.exports.useCallback(o=>{!o||n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var Xa=Ie((e,t)=>{const n=aie(),r=So("Button",{...n,...e}),{isDisabled:i=n?.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:d,loadingText:p,iconSpacing:g="0.5rem",type:m,spinner:y,spinnerPlacement:x="start",className:S,as:E,...P}=bn(e),k=w.exports.useMemo(()=>{const F={...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:F}}},[r,n]),{ref:T,type:M}=sie(E),N={rightIcon:d,leftIcon:l,iconSpacing:g,children:s};return le.createElement(Ce.button,{disabled:i||o,ref:SQ(t,T),as:E,type:m??M,"data-active":iT(a),"data-loading":iT(o),__css:k,className:F4("chakra-button",S),...P},o&&x==="start"&&_(C6,{className:"chakra-button__spinner--start",label:p,placement:"start",spacing:g,children:y}),o?p||le.createElement(Ce.span,{opacity:0},_(oT,{...N})):_(oT,{...N}),o&&x==="end"&&_(C6,{className:"chakra-button__spinner--end",label:p,placement:"end",spacing:g,children:y}))});Xa.displayName="Button";function oT(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return ae(jn,{children:[t&&_(w6,{marginEnd:i,children:t}),r,n&&_(w6,{marginStart:i,children:n})]})}var rD=Ie(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:d,...p}=t,g=F4("chakra-button__group",a),m=w.exports.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:d}),[r,i,o,d]);let y={display:"inline-flex"};return l?y={...y,"> *: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}}:y={...y,"& > *:not(style) ~ *:not(style)":{marginStart:s}},le.createElement(oie,{value:m},le.createElement(Ce.div,{ref:n,role:"group",__css:y,className:g,"data-attached":l?"":void 0,...p}))});rD.displayName="ButtonGroup";var Xi=Ie((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.exports.isValidElement(s)?w.exports.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return _(Xa,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a,children:l})});Xi.displayName="IconButton";var U0=(...e)=>e.filter(Boolean).join(" "),G2=e=>e?"":void 0,Gx=e=>e?!0:void 0;function aT(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var[lie,iD]=_n({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[uie,G0]=_n({strict:!1,name:"FormControlContext"});function cie(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.exports.useId(),l=t||`field-${s}`,d=`${l}-label`,p=`${l}-feedback`,g=`${l}-helptext`,[m,y]=w.exports.useState(!1),[x,S]=w.exports.useState(!1),[E,P]=w.exports.useState(!1),k=w.exports.useCallback((z={},B=null)=>({id:g,...z,ref:Fn(B,K=>{!K||S(!0)})}),[g]),T=w.exports.useCallback((z={},B=null)=>({...z,ref:B,"data-focus":G2(E),"data-disabled":G2(i),"data-invalid":G2(r),"data-readonly":G2(o),id:z.id??d,htmlFor:z.htmlFor??l}),[l,i,E,r,o,d]),M=w.exports.useCallback((z={},B=null)=>({id:p,...z,ref:Fn(B,K=>{!K||y(!0)}),"aria-live":"polite"}),[p]),N=w.exports.useCallback((z={},B=null)=>({...z,...a,ref:B,role:"group"}),[a]),F=w.exports.useCallback((z={},B=null)=>({...z,ref:B,role:"presentation","aria-hidden":!0,children:z.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!E,onFocus:()=>P(!0),onBlur:()=>P(!1),hasFeedbackText:m,setHasFeedbackText:y,hasHelpText:x,setHasHelpText:S,id:l,labelId:d,feedbackId:p,helpTextId:g,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:M,getRootProps:N,getLabelProps:T,getRequiredIndicatorProps:F}}var Sd=Ie(function(t,n){const r=$i("Form",t),i=bn(t),{getRootProps:o,htmlProps:a,...s}=cie(i),l=U0("chakra-form-control",t.className);return le.createElement(uie,{value:s},le.createElement(lie,{value:r},le.createElement(Ce.div,{...o({},n),className:l,__css:r.container})))});Sd.displayName="FormControl";var die=Ie(function(t,n){const r=G0(),i=iD(),o=U0("chakra-form__helper-text",t.className);return le.createElement(Ce.div,{...r?.getHelpTextProps(t,n),__css:i.helperText,className:o})});die.displayName="FormHelperText";function R8(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=O8(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":Gx(n),"aria-required":Gx(i),"aria-readonly":Gx(r)}}function O8(e){const t=G0(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:d,onFocus:p,onBlur:g,...m}=e,y=e["aria-describedby"]?[e["aria-describedby"]]:[];return t?.hasFeedbackText&&t?.isInvalid&&y.push(t.feedbackId),t?.hasHelpText&&y.push(t.helpTextId),{...m,"aria-describedby":y.join(" ")||void 0,id:n??t?.id,isDisabled:r??d??t?.isDisabled,isReadOnly:i??l??t?.isReadOnly,isRequired:o??a??t?.isRequired,isInvalid:s??t?.isInvalid,onFocus:aT(t?.onFocus,p),onBlur:aT(t?.onBlur,g)}}var[fie,hie]=_n({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pie=Ie((e,t)=>{const n=$i("FormError",e),r=bn(e),i=G0();return i?.isInvalid?le.createElement(fie,{value:n},le.createElement(Ce.div,{...i?.getErrorMessageProps(r,t),className:U0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});pie.displayName="FormErrorMessage";var gie=Ie((e,t)=>{const n=hie(),r=G0();if(!r?.isInvalid)return null;const i=U0("chakra-form__error-icon",e.className);return _(Ea,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i,children:_("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"})})});gie.displayName="FormErrorIcon";var ph=Ie(function(t,n){const r=So("FormLabel",t),i=bn(t),{className:o,children:a,requiredIndicator:s=_(oD,{}),optionalIndicator:l=null,...d}=i,p=G0(),g=p?.getLabelProps(d,n)??{ref:n,...d};return le.createElement(Ce.label,{...g,className:U0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,p?.isRequired?s:l)});ph.displayName="FormLabel";var oD=Ie(function(t,n){const r=G0(),i=iD();if(!r?.isRequired)return null;const o=U0("chakra-form__required-indicator",t.className);return le.createElement(Ce.span,{...r?.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});oD.displayName="RequiredIndicator";function w0(e,t){const n=w.exports.useRef(!1),r=w.exports.useRef(!1);w.exports.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.exports.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var N8={border:"0px",clip:"rect(0px, 0px, 0px, 0px)",height:"1px",width:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},mie=Ce("span",{baseStyle:N8});mie.displayName="VisuallyHidden";var vie=Ce("input",{baseStyle:N8});vie.displayName="VisuallyHiddenInput";var sT=!1,$4=null,C0=!1,_6=new Set,yie=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function bie(e){return!(e.metaKey||!yie&&e.altKey||e.ctrlKey)}function D8(e,t){_6.forEach(n=>n(e,t))}function lT(e){C0=!0,bie(e)&&($4="keyboard",D8("keyboard",e))}function fp(e){$4="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(C0=!0,D8("pointer",e))}function xie(e){e.target===window||e.target===document||(C0||($4="keyboard",D8("keyboard",e)),C0=!1)}function Sie(){C0=!1}function uT(){return $4!=="pointer"}function wie(){if(typeof window>"u"||sT)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){C0=!0,e.apply(this,n)},document.addEventListener("keydown",lT,!0),document.addEventListener("keyup",lT,!0),window.addEventListener("focus",xie,!0),window.addEventListener("blur",Sie,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",fp,!0),document.addEventListener("pointermove",fp,!0),document.addEventListener("pointerup",fp,!0)):(document.addEventListener("mousedown",fp,!0),document.addEventListener("mousemove",fp,!0),document.addEventListener("mouseup",fp,!0)),sT=!0}function Cie(e){wie(),e(uT());const t=()=>e(uT());return _6.add(t),()=>{_6.delete(t)}}var[c8e,_ie]=_n({name:"CheckboxGroupContext",strict:!1}),kie=(...e)=>e.filter(Boolean).join(" "),fo=e=>e?"":void 0;function Wa(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function Eie(...e){return function(n){e.forEach(r=>{r?.(n)})}}function Pie(e){const t=is;return"custom"in t&&typeof t.custom=="function"?t.custom(e):t(e)}var aD=Pie(Ce.svg);function Tie(e){return _(aD,{width:"1.2em",viewBox:"0 0 12 10",variants:{unchecked:{opacity:0,strokeDashoffset:16},checked:{opacity:1,strokeDashoffset:0,transition:{duration:.2}}},style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:_("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function Lie(e){return _(aD,{width:"1.2em",viewBox:"0 0 24 24",variants:{unchecked:{scaleX:.65,opacity:0},checked:{scaleX:1,opacity:1,transition:{scaleX:{duration:0},opacity:{duration:.02}}}},style:{stroke:"currentColor",strokeWidth:4},...e,children:_("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function Aie({open:e,children:t}){return _(Hu,{initial:!1,children:e&&le.createElement(is.div,{variants:{unchecked:{scale:.5},checked:{scale:1}},initial:"unchecked",animate:"checked",exit:"unchecked",style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},t)})}function Iie(e){const{isIndeterminate:t,isChecked:n,...r}=e;return _(Aie,{open:n||t,children:_(t?Lie:Tie,{...r})})}function Mie(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function sD(e={}){const t=O8(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":d}=t,{defaultChecked:p,isChecked:g,isFocusable:m,onChange:y,isIndeterminate:x,name:S,value:E,tabIndex:P=void 0,"aria-label":k,"aria-labelledby":T,"aria-invalid":M,...N}=e,F=Mie(N,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),z=kr(y),B=kr(s),K=kr(l),[j,X]=w.exports.useState(!1),[ue,ge]=w.exports.useState(!1),[xe,we]=w.exports.useState(!1),[Se,J]=w.exports.useState(!1);w.exports.useEffect(()=>Cie(X),[]);const G=w.exports.useRef(null),[te,Q]=w.exports.useState(!0),[W,ie]=w.exports.useState(!!p),de=g!==void 0,be=de?g:W,De=w.exports.useCallback(Me=>{if(r||n){Me.preventDefault();return}de||ie(be?Me.target.checked:x?!0:Me.target.checked),z?.(Me)},[r,n,be,de,x,z]);El(()=>{G.current&&(G.current.indeterminate=Boolean(x))},[x]),w0(()=>{n&&ge(!1)},[n,ge]),El(()=>{const Me=G.current;!Me?.form||(Me.form.onreset=()=>{ie(!!p)})},[]);const Re=n&&!m,Ve=w.exports.useCallback(Me=>{Me.key===" "&&J(!0)},[J]),ke=w.exports.useCallback(Me=>{Me.key===" "&&J(!1)},[J]);El(()=>{if(!G.current)return;G.current.checked!==be&&ie(G.current.checked)},[G.current]);const $e=w.exports.useCallback((Me={},tt=null)=>{const pt=at=>{ue&&at.preventDefault(),J(!0)};return{...Me,ref:tt,"data-active":fo(Se),"data-hover":fo(xe),"data-checked":fo(be),"data-focus":fo(ue),"data-focus-visible":fo(ue&&j),"data-indeterminate":fo(x),"data-disabled":fo(n),"data-invalid":fo(o),"data-readonly":fo(r),"aria-hidden":!0,onMouseDown:Wa(Me.onMouseDown,pt),onMouseUp:Wa(Me.onMouseUp,()=>J(!1)),onMouseEnter:Wa(Me.onMouseEnter,()=>we(!0)),onMouseLeave:Wa(Me.onMouseLeave,()=>we(!1))}},[Se,be,n,ue,j,xe,x,o,r]),nt=w.exports.useCallback((Me={},tt=null)=>({...F,...Me,ref:Fn(tt,pt=>{!pt||Q(pt.tagName==="LABEL")}),onClick:Wa(Me.onClick,()=>{var pt;te||((pt=G.current)==null||pt.click(),requestAnimationFrame(()=>{var at;(at=G.current)==null||at.focus()}))}),"data-disabled":fo(n),"data-checked":fo(be),"data-invalid":fo(o)}),[F,n,be,o,te]),ft=w.exports.useCallback((Me={},tt=null)=>({...Me,ref:Fn(G,tt),type:"checkbox",name:S,value:E,id:a,tabIndex:P,onChange:Wa(Me.onChange,De),onBlur:Wa(Me.onBlur,B,()=>ge(!1)),onFocus:Wa(Me.onFocus,K,()=>ge(!0)),onKeyDown:Wa(Me.onKeyDown,Ve),onKeyUp:Wa(Me.onKeyUp,ke),required:i,checked:be,disabled:Re,readOnly:r,"aria-label":k,"aria-labelledby":T,"aria-invalid":M?Boolean(M):o,"aria-describedby":d,"aria-disabled":n,style:N8}),[S,E,a,De,B,K,Ve,ke,i,be,Re,r,k,T,M,o,d,n,P]),Rt=w.exports.useCallback((Me={},tt=null)=>({...Me,ref:tt,onMouseDown:Wa(Me.onMouseDown,cT),onTouchStart:Wa(Me.onTouchStart,cT),"data-disabled":fo(n),"data-checked":fo(be),"data-invalid":fo(o)}),[be,n,o]);return{state:{isInvalid:o,isFocused:ue,isChecked:be,isActive:Se,isHovered:xe,isIndeterminate:x,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:nt,getCheckboxProps:$e,getInputProps:ft,getLabelProps:Rt,htmlProps:F}}function cT(e){e.preventDefault(),e.stopPropagation()}var Rie=Ce("span",{baseStyle:{display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0}}),Oie=Ce("label",{baseStyle:{cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"}}),lD=Ie(function(t,n){const r=_ie(),i={...r,...t},o=$i("Checkbox",i),a=bn(t),{spacing:s="0.5rem",className:l,children:d,iconColor:p,iconSize:g,icon:m=_(Iie,{}),isChecked:y,isDisabled:x=r?.isDisabled,onChange:S,inputProps:E,...P}=a;let k=y;r?.value&&a.value&&(k=r.value.includes(a.value));let T=S;r?.onChange&&a.value&&(T=Eie(r.onChange,S));const{state:M,getInputProps:N,getCheckboxProps:F,getLabelProps:z,getRootProps:B}=sD({...P,isDisabled:x,isChecked:k,onChange:T}),K=w.exports.useMemo(()=>({opacity:M.isChecked||M.isIndeterminate?1:0,transform:M.isChecked||M.isIndeterminate?"scale(1)":"scale(0.95)",fontSize:g,color:p,...o.icon}),[p,g,M.isChecked,M.isIndeterminate,o.icon]),j=w.exports.cloneElement(m,{__css:K,isIndeterminate:M.isIndeterminate,isChecked:M.isChecked});return ae(Oie,{__css:o.container,className:kie("chakra-checkbox",l),...B(),children:[_("input",{className:"chakra-checkbox__input",...N(E,n)}),_(Rie,{__css:o.control,className:"chakra-checkbox__control",...F(),children:j}),d&&le.createElement(Ce.span,{className:"chakra-checkbox__label",...z(),__css:{marginStart:s,...o.label}},d)]})});lD.displayName="Checkbox";function Nie(e){return _(Ea,{focusable:"false","aria-hidden":!0,...e,children:_("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 B4=Ie(function(t,n){const r=So("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=bn(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return le.createElement(Ce.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||_(Nie,{width:"1em",height:"1em"}))});B4.displayName="CloseButton";function Die(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function z8(e,t){let n=Die(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function k6(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 l3(e,t,n){return(e-t)*100/(n-t)}function uD(e,t,n){return(n-t)*e+t}function E6(e,t,n){const r=Math.round((e-t)/n)*n+t,i=k6(n);return z8(r,i)}function n0(e,t,n){return e==null?e:(nr==null?"":jx(r,o,n)??""),m=typeof i<"u",y=m?i:p,x=cD(zc(y),o),S=n??x,E=w.exports.useCallback(j=>{j!==y&&(m||g(j.toString()),d?.(j.toString(),zc(j)))},[d,m,y]),P=w.exports.useCallback(j=>{let X=j;return l&&(X=n0(X,a,s)),z8(X,S)},[S,l,s,a]),k=w.exports.useCallback((j=o)=>{let X;y===""?X=zc(j):X=zc(y)+j,X=P(X),E(X)},[P,o,E,y]),T=w.exports.useCallback((j=o)=>{let X;y===""?X=zc(-j):X=zc(y)-j,X=P(X),E(X)},[P,o,E,y]),M=w.exports.useCallback(()=>{let j;r==null?j="":j=jx(r,o,n)??a,E(j)},[r,n,o,E,a]),N=w.exports.useCallback(j=>{const X=jx(j,o,S)??a;E(X)},[S,o,E,a]),F=zc(y);return{isOutOfRange:F>s||F_(v4,{styles:dD}),$ie=()=>_(v4,{styles:` + html { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + font-family: system-ui, sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + touch-action: manipulation; + } + + body { + position: relative; + min-height: 100%; + font-feature-settings: 'kern'; + } + + *, + *::before, + *::after { + border-width: 0; + border-style: solid; + box-sizing: border-box; + } + + main { + display: block; + } + + hr { + border-top-width: 1px; + box-sizing: content-box; + height: 0; + overflow: visible; + } + + pre, + code, + kbd, + samp { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 1em; + } + + a { + background-color: transparent; + color: inherit; + text-decoration: inherit; + } + + abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + + b, + strong { + font-weight: bold; + } + + small { + font-size: 80%; + } + + sub, + sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + sub { + bottom: -0.25em; + } + + sup { + top: -0.5em; + } + + img { + border-style: none; + } + + button, + input, + optgroup, + select, + textarea { + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; + } + + button, + input { + overflow: visible; + } + + button, + select { + text-transform: none; + } + + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; + } + + fieldset { + padding: 0.35em 0.75em 0.625em; + } + + legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; + } + + progress { + vertical-align: baseline; + } + + textarea { + overflow: auto; + } + + [type="checkbox"], + [type="radio"] { + box-sizing: border-box; + padding: 0; + } + + [type="number"]::-webkit-inner-spin-button, + [type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none !important; + } + + input[type="number"] { + -moz-appearance: textfield; + } + + [type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; + } + + [type="search"]::-webkit-search-decoration { + -webkit-appearance: none !important; + } + + ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; + } + + details { + display: block; + } + + summary { + display: list-item; + } + + template { + display: none; + } + + [hidden] { + display: none !important; + } + + body, + blockquote, + dl, + dd, + h1, + h2, + h3, + h4, + h5, + h6, + hr, + figure, + p, + pre { + margin: 0; + } + + button { + background: transparent; + padding: 0; + } + + fieldset { + margin: 0; + padding: 0; + } + + ol, + ul { + margin: 0; + padding: 0; + } + + textarea { + resize: vertical; + } + + button, + [role="button"] { + cursor: pointer; + } + + button::-moz-focus-inner { + border: 0 !important; + } + + table { + border-collapse: collapse; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: inherit; + font-weight: inherit; + } + + button, + input, + optgroup, + select, + textarea { + padding: 0; + line-height: inherit; + color: inherit; + } + + img, + svg, + video, + canvas, + audio, + iframe, + embed, + object { + display: block; + } + + img, + video { + max-width: 100%; + height: auto; + } + + [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) { + outline: none; + box-shadow: none; + } + + select::-ms-expand { + display: none; + } + + ${dD} + `});function P6(e,t,n,r){const i=kr(n);return w.exports.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o?.removeEventListener(t,i,r)}}var Bie=av?w.exports.useLayoutEffect:w.exports.useEffect;function T6(e,t=[]){const n=w.exports.useRef(e);return Bie(()=>{n.current=e}),w.exports.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function F8(e,t,n,r){const i=T6(t);return w.exports.useEffect(()=>{const o=j5(n)??document;if(!!t)return o.addEventListener(e,i,r),()=>{o.removeEventListener(e,i,r)}},[e,n,r,i,t]),()=>{(j5(n)??document).removeEventListener(e,i,r)}}function Hie(e){const{isOpen:t,ref:n}=e,[r,i]=w.exports.useState(t),[o,a]=w.exports.useState(!1);return w.exports.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),F8("animationend",()=>{i(t)},()=>n.current),{present:!(t?!1:!r),onComplete(){var l;const d=pX(n.current),p=new d.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(p)}}}function Wie(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Vie(e,t){const n=w.exports.useId();return w.exports.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function u3(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=T6(n),a=T6(t),[s,l]=w.exports.useState(e.defaultIsOpen||!1),[d,p]=Wie(r,s),g=Vie(i,"disclosure"),m=w.exports.useCallback(()=>{d||l(!1),a?.()},[d,a]),y=w.exports.useCallback(()=>{d||l(!0),o?.()},[d,o]),x=w.exports.useCallback(()=>{(p?m:y)()},[p,y,m]);return{isOpen:!!p,onOpen:y,onClose:m,onToggle:x,isControlled:d,getButtonProps:(S={})=>({...S,"aria-expanded":p,"aria-controls":g,onClick:PX(S.onClick,x)}),getDisclosureProps:(S={})=>({...S,hidden:!p,id:g})}}var fD=(e,t)=>{const n=w.exports.useRef(!1),r=w.exports.useRef(!1);w.exports.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.exports.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Uie(e){const t=e.current;if(!t)return!1;const n=vX(t);return!n||i8(t,n)?!1:!!wX(n)}function Gie(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;fD(()=>{if(!o||Uie(e))return;const a=i?.current||e.current;a&&K5(a,{nextTick:!0})},[o,e,i])}function jie(e,t,n,r){return F8(jX(t),BX(n,t==="pointerdown"),e,r)}function Kie(e){const{ref:t,elements:n,enabled:r}=e,i=qX("Safari");jie(()=>ov(t.current),"pointerdown",a=>{if(!i||!r)return;const s=a.target,d=(n??[t]).some(p=>{const g=aO(p)?p.current:p;return i8(g,s)});!dO(s)&&d&&(a.preventDefault(),K5(s))})}var qie={preventScroll:!0,shouldFocus:!1};function Zie(e,t=qie){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=aO(e)?e.current:e,s=i&&o,l=w.exports.useCallback(()=>{if(!(!a||!s)&&!i8(a,document.activeElement))if(n?.current)K5(n.current,{preventScroll:r,nextTick:!0});else{const d=EX(a);d.length>0&&K5(d[0],{preventScroll:r,nextTick:!0})}},[s,r,a,n]);fD(()=>{l()},[l]),F8("transitionend",l,a)}function $8(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var B8=Ie(function(t,n){const{htmlSize:r,...i}=t,o=$i("Input",i),a=bn(i),s=R8(a),l=Pr("chakra-input",t.className);return le.createElement(Ce.input,{size:r,...s,__css:o.field,ref:n,className:l})});B8.displayName="Input";B8.id="Input";var[Yie,hD]=_n({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Xie=Ie(function(t,n){const r=$i("Input",t),{children:i,className:o,...a}=bn(t),s=Pr("chakra-input__group",o),l={},d=z4(i),p=r.field;d.forEach(m=>{!r||(p&&m.type.id==="InputLeftElement"&&(l.paddingStart=p.height??p.h),p&&m.type.id==="InputRightElement"&&(l.paddingEnd=p.height??p.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const g=d.map(m=>{var y,x;const S=$8({size:((y=m.props)==null?void 0:y.size)||t.size,variant:((x=m.props)==null?void 0:x.variant)||t.variant});return m.type.id!=="Input"?w.exports.cloneElement(m,S):w.exports.cloneElement(m,Object.assign(S,l,m.props))});return le.createElement(Ce.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},_(Yie,{value:r,children:g}))});Xie.displayName="InputGroup";var Qie={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Jie=Ce("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),H8=Ie(function(t,n){const{placement:r="left",...i}=t,o=Qie[r]??{},a=hD();return _(Jie,{ref:n,...i,__css:{...a.addon,...o}})});H8.displayName="InputAddon";var pD=Ie(function(t,n){return _(H8,{ref:n,placement:"left",...t,className:Pr("chakra-input__left-addon",t.className)})});pD.displayName="InputLeftAddon";pD.id="InputLeftAddon";var gD=Ie(function(t,n){return _(H8,{ref:n,placement:"right",...t,className:Pr("chakra-input__right-addon",t.className)})});gD.displayName="InputRightAddon";gD.id="InputRightAddon";var eoe=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),H4=Ie(function(t,n){const{placement:r="left",...i}=t,o=hD(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:a?.height??a?.h,height:a?.height??a?.h,fontSize:a?.fontSize,...o.element};return _(eoe,{ref:n,__css:l,...i})});H4.id="InputElement";H4.displayName="InputElement";var mD=Ie(function(t,n){const{className:r,...i}=t,o=Pr("chakra-input__left-element",r);return _(H4,{ref:n,placement:"left",className:o,...i})});mD.id="InputLeftElement";mD.displayName="InputLeftElement";var vD=Ie(function(t,n){const{className:r,...i}=t,o=Pr("chakra-input__right-element",r);return _(H4,{ref:n,placement:"right",className:o,...i})});vD.id="InputRightElement";vD.displayName="InputRightElement";function toe(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}Object.freeze(["base","sm","md","lg","xl","2xl"]);function dd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):toe(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var noe=Ie(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.exports.Children.only(r),s=Pr("chakra-aspect-ratio",i);return le.createElement(Ce.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:dd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});noe.displayName="AspectRatio";var roe=Ie(function(t,n){const r=So("Badge",t),{className:i,...o}=bn(t);return le.createElement(Ce.span,{ref:n,className:Pr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});roe.displayName="Badge";var Bl=Ce("div");Bl.displayName="Box";var yD=Ie(function(t,n){const{size:r,centerContent:i=!0,...o}=t;return _(Bl,{ref:n,boxSize:r,__css:{...i?{display:"flex",alignItems:"center",justifyContent:"center"}:{},flexShrink:0,flexGrow:0},...o})});yD.displayName="Square";var ioe=Ie(function(t,n){const{size:r,...i}=t;return _(yD,{size:r,ref:n,borderRadius:"9999px",...i})});ioe.displayName="Circle";var bD=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});bD.displayName="Center";var ooe={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ie(function(t,n){const{axis:r="both",...i}=t;return le.createElement(Ce.div,{ref:n,__css:ooe[r],...i,position:"absolute"})});var aoe=Ie(function(t,n){const r=So("Code",t),{className:i,...o}=bn(t);return le.createElement(Ce.code,{ref:n,className:Pr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});aoe.displayName="Code";var soe=Ie(function(t,n){const{className:r,centerContent:i,...o}=bn(t),a=So("Container",t);return le.createElement(Ce.div,{ref:n,className:Pr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});soe.displayName="Container";var loe=Ie(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:d,...p}=So("Divider",t),{className:g,orientation:m="horizontal",__css:y,...x}=bn(t),S={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return le.createElement(Ce.hr,{ref:n,"aria-orientation":m,...x,__css:{...p,border:"0",borderColor:d,borderStyle:l,...S[m],...y},className:Pr("chakra-divider",g)})});loe.displayName="Divider";var zn=Ie(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:d,...p}=t,g={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:d};return le.createElement(Ce.div,{ref:n,__css:g,...p})});zn.displayName="Flex";var xD=Ie(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:d,autoRows:p,templateRows:g,autoColumns:m,templateColumns:y,...x}=t,S={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:d,gridAutoRows:p,gridTemplateRows:g,gridTemplateColumns:y};return le.createElement(Ce.div,{ref:n,__css:S,...x})});xD.displayName="Grid";function dT(e){return dd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var uoe=Ie(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:d,...p}=t,g=$8({gridArea:r,gridColumn:dT(i),gridRow:dT(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:d,gridRowEnd:s});return le.createElement(Ce.div,{ref:n,__css:g,...p})});uoe.displayName="GridItem";var Qf=Ie(function(t,n){const r=So("Heading",t),{className:i,...o}=bn(t);return le.createElement(Ce.h2,{ref:n,className:Pr("chakra-heading",t.className),...o,__css:r})});Qf.displayName="Heading";Ie(function(t,n){const r=So("Mark",t),i=bn(t);return _(Bl,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var coe=Ie(function(t,n){const r=So("Kbd",t),{className:i,...o}=bn(t);return le.createElement(Ce.kbd,{ref:n,className:Pr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});coe.displayName="Kbd";var r0=Ie(function(t,n){const r=So("Link",t),{className:i,isExternal:o,...a}=bn(t);return le.createElement(Ce.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Pr("chakra-link",i),...a,__css:r})});r0.displayName="Link";Ie(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return le.createElement(Ce.a,{...s,ref:n,className:Pr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Ie(function(t,n){const{className:r,...i}=t;return le.createElement(Ce.div,{ref:n,position:"relative",...i,className:Pr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[doe,SD]=_n({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),W8=Ie(function(t,n){const r=$i("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=bn(t),d=z4(i),g=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return le.createElement(doe,{value:r},le.createElement(Ce.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...g},...l},d))});W8.displayName="List";var foe=Ie((e,t)=>{const{as:n,...r}=e;return _(W8,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});foe.displayName="OrderedList";var hoe=Ie(function(t,n){const{as:r,...i}=t;return _(W8,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});hoe.displayName="UnorderedList";var poe=Ie(function(t,n){const r=SD();return le.createElement(Ce.li,{ref:n,...t,__css:r.item})});poe.displayName="ListItem";var goe=Ie(function(t,n){const r=SD();return _(Ea,{ref:n,role:"presentation",...t,__css:r.icon})});goe.displayName="ListIcon";var moe=Ie(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,d=F0(),p=s?yoe(s,d):boe(r);return _(xD,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:p,...l})});moe.displayName="SimpleGrid";function voe(e){return typeof e=="number"?`${e}px`:e}function yoe(e,t){return dd(e,n=>{const r=cQ("sizes",n,voe(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function boe(e){return dd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var wD=Ce("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});wD.displayName="Spacer";var L6="& > *:not(style) ~ *:not(style)";function xoe(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[L6]:dd(n,i=>r[i])}}function Soe(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{"&":dd(n,i=>r[i])}}var CD=e=>le.createElement(Ce.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});CD.displayName="StackItem";var V8=Ie((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:d,className:p,shouldWrapChildren:g,...m}=e,y=n?"row":r??"column",x=w.exports.useMemo(()=>xoe({direction:y,spacing:a}),[y,a]),S=w.exports.useMemo(()=>Soe({spacing:a,direction:y}),[a,y]),E=!!d,P=!g&&!E,k=z4(l),T=P?k:k.map((N,F)=>{const z=typeof N.key<"u"?N.key:F,B=F+1===k.length,j=g?_(CD,{children:N},z):N;if(!E)return j;const X=w.exports.cloneElement(d,{__css:S}),ue=B?null:X;return ae(w.exports.Fragment,{children:[j,ue]},z)}),M=Pr("chakra-stack",p);return le.createElement(Ce.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:x.flexDirection,flexWrap:s,className:M,__css:E?{}:{[L6]:x[L6]},...m},T)});V8.displayName="Stack";var woe=Ie((e,t)=>_(V8,{align:"center",...e,direction:"row",ref:t}));woe.displayName="HStack";var Coe=Ie((e,t)=>_(V8,{align:"center",...e,direction:"column",ref:t}));Coe.displayName="VStack";var Fo=Ie(function(t,n){const r=So("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=bn(t),d=$8({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return le.createElement(Ce.p,{ref:n,className:Pr("chakra-text",t.className),...d,...l,__css:r})});Fo.displayName="Text";function fT(e){return typeof e=="number"?`${e}px`:e}var _oe=Ie(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:d,className:p,shouldWrapChildren:g,...m}=t,y=w.exports.useMemo(()=>{const{spacingX:S=r,spacingY:E=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":P=>dd(S,k=>fT(Bw("space",k)(P))),"--chakra-wrap-y-spacing":P=>dd(E,k=>fT(Bw("space",k)(P))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:d,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,d,l]),x=g?w.exports.Children.map(a,(S,E)=>_(_D,{children:S},E)):a;return le.createElement(Ce.div,{ref:n,className:Pr("chakra-wrap",p),overflow:"hidden",...m},le.createElement(Ce.ul,{className:"chakra-wrap__list",__css:y},x))});_oe.displayName="Wrap";var _D=Ie(function(t,n){const{className:r,...i}=t;return le.createElement(Ce.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Pr("chakra-wrap__listitem",r),...i})});_D.displayName="WrapItem";var koe={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},kD=koe,hp=()=>{},Eoe={document:kD,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:hp,removeEventListener:hp,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:hp,removeListener:hp}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:hp,setInterval:()=>0,clearInterval:hp},Poe=Eoe,Toe={window:Poe,document:kD},ED=typeof window<"u"?{window,document}:Toe,PD=w.exports.createContext(ED);PD.displayName="EnvironmentContext";function TD(e){const{children:t,environment:n}=e,[r,i]=w.exports.useState(null),[o,a]=w.exports.useState(!1);w.exports.useEffect(()=>a(!0),[]);const s=w.exports.useMemo(()=>{if(n)return n;const l=r?.ownerDocument,d=r?.ownerDocument.defaultView;return l?{document:l,window:d}:ED},[r,n]);return ae(PD.Provider,{value:s,children:[t,!n&&o&&_("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.exports.startTransition(()=>{l&&i(l)})}})]})}TD.displayName="EnvironmentProvider";var Loe=e=>e?"":void 0;function Aoe(){const e=w.exports.useRef(new Map),t=e.current,n=w.exports.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.exports.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.exports.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function Kx(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function Ioe(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:d,onKeyUp:p,tabIndex:g,onMouseOver:m,onMouseLeave:y,...x}=e,[S,E]=w.exports.useState(!0),[P,k]=w.exports.useState(!1),T=Aoe(),M=J=>{!J||J.tagName!=="BUTTON"&&E(!1)},N=S?g:g||0,F=n&&!r,z=w.exports.useCallback(J=>{if(n){J.stopPropagation(),J.preventDefault();return}J.currentTarget.focus(),l?.(J)},[n,l]),B=w.exports.useCallback(J=>{P&&Kx(J)&&(J.preventDefault(),J.stopPropagation(),k(!1),T.remove(document,"keyup",B,!1))},[P,T]),K=w.exports.useCallback(J=>{if(d?.(J),n||J.defaultPrevented||J.metaKey||!Kx(J.nativeEvent)||S)return;const G=i&&J.key==="Enter";o&&J.key===" "&&(J.preventDefault(),k(!0)),G&&(J.preventDefault(),J.currentTarget.click()),T.add(document,"keyup",B,!1)},[n,S,d,i,o,T,B]),j=w.exports.useCallback(J=>{if(p?.(J),n||J.defaultPrevented||J.metaKey||!Kx(J.nativeEvent)||S)return;o&&J.key===" "&&(J.preventDefault(),k(!1),J.currentTarget.click())},[o,S,n,p]),X=w.exports.useCallback(J=>{J.button===0&&(k(!1),T.remove(document,"mouseup",X,!1))},[T]),ue=w.exports.useCallback(J=>{if(J.button!==0)return;if(n){J.stopPropagation(),J.preventDefault();return}S||k(!0),J.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",X,!1),a?.(J)},[n,S,a,T,X]),ge=w.exports.useCallback(J=>{J.button===0&&(S||k(!1),s?.(J))},[s,S]),xe=w.exports.useCallback(J=>{if(n){J.preventDefault();return}m?.(J)},[n,m]),we=w.exports.useCallback(J=>{P&&(J.preventDefault(),k(!1)),y?.(J)},[P,y]),Se=Fn(t,M);return S?{...x,ref:Se,type:"button","aria-disabled":F?void 0:n,disabled:F,onClick:z,onMouseDown:a,onMouseUp:s,onKeyUp:p,onKeyDown:d,onMouseOver:m,onMouseLeave:y}:{...x,ref:Se,role:"button","data-active":Loe(P),"aria-disabled":n?"true":void 0,tabIndex:F?void 0:N,onClick:z,onMouseDown:ue,onMouseUp:ge,onKeyUp:j,onKeyDown:K,onMouseOver:xe,onMouseLeave:we}}function Moe(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Roe(e){if(!Moe(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}var Ooe=e=>e.hasAttribute("tabindex");function Noe(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function LD(e){return e.parentElement&&LD(e.parentElement)?!0:e.hidden}function Doe(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function zoe(e){if(!Roe(e)||LD(e)||Noe(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]():Doe(e)?!0:Ooe(e)}var Foe=["input:not([disabled])","select:not([disabled])","textarea:not([disabled])","embed","iframe","object","a[href]","area[href]","button:not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],$oe=Foe.join(),Boe=e=>e.offsetWidth>0&&e.offsetHeight>0;function Hoe(e){const t=Array.from(e.querySelectorAll($oe));return t.unshift(e),t.filter(n=>zoe(n)&&Boe(n))}var Vo="top",ts="bottom",ns="right",Uo="left",U8="auto",pv=[Vo,ts,ns,Uo],_0="start",Dm="end",Woe="clippingParents",AD="viewport",ng="popper",Voe="reference",hT=pv.reduce(function(e,t){return e.concat([t+"-"+_0,t+"-"+Dm])},[]),ID=[].concat(pv,[U8]).reduce(function(e,t){return e.concat([t,t+"-"+_0,t+"-"+Dm])},[]),Uoe="beforeRead",Goe="read",joe="afterRead",Koe="beforeMain",qoe="main",Zoe="afterMain",Yoe="beforeWrite",Xoe="write",Qoe="afterWrite",Joe=[Uoe,Goe,joe,Koe,qoe,Zoe,Yoe,Xoe,Qoe];function Nl(e){return e?(e.nodeName||"").toLowerCase():null}function os(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function sh(e){var t=os(e).Element;return e instanceof t||e instanceof Element}function Qa(e){var t=os(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function G8(e){if(typeof ShadowRoot>"u")return!1;var t=os(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function eae(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Qa(o)||!Nl(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function tae(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 i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,d){return l[d]="",l},{});!Qa(i)||!Nl(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const nae={name:"applyStyles",enabled:!0,phase:"write",fn:eae,effect:tae,requires:["computeStyles"]};function Al(e){return e.split("-")[0]}var Jf=Math.max,c3=Math.min,k0=Math.round;function A6(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function MD(){return!/^((?!chrome|android).)*safari/i.test(A6())}function E0(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Qa(e)&&(i=e.offsetWidth>0&&k0(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&k0(r.height)/e.offsetHeight||1);var a=sh(e)?os(e):window,s=a.visualViewport,l=!MD()&&n,d=(r.left+(l&&s?s.offsetLeft:0))/i,p=(r.top+(l&&s?s.offsetTop:0))/o,g=r.width/i,m=r.height/o;return{width:g,height:m,top:p,right:d+g,bottom:p+m,left:d,x:d,y:p}}function j8(e){var t=E0(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 RD(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&G8(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ou(e){return os(e).getComputedStyle(e)}function rae(e){return["table","td","th"].indexOf(Nl(e))>=0}function wd(e){return((sh(e)?e.ownerDocument:e.document)||window.document).documentElement}function W4(e){return Nl(e)==="html"?e:e.assignedSlot||e.parentNode||(G8(e)?e.host:null)||wd(e)}function pT(e){return!Qa(e)||Ou(e).position==="fixed"?null:e.offsetParent}function iae(e){var t=/firefox/i.test(A6()),n=/Trident/i.test(A6());if(n&&Qa(e)){var r=Ou(e);if(r.position==="fixed")return null}var i=W4(e);for(G8(i)&&(i=i.host);Qa(i)&&["html","body"].indexOf(Nl(i))<0;){var o=Ou(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function gv(e){for(var t=os(e),n=pT(e);n&&rae(n)&&Ou(n).position==="static";)n=pT(n);return n&&(Nl(n)==="html"||Nl(n)==="body"&&Ou(n).position==="static")?t:n||iae(e)||t}function K8(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qg(e,t,n){return Jf(e,c3(t,n))}function oae(e,t,n){var r=qg(e,t,n);return r>n?n:r}function OD(){return{top:0,right:0,bottom:0,left:0}}function ND(e){return Object.assign({},OD(),e)}function DD(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var aae=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,ND(typeof t!="number"?t:DD(t,pv))};function sae(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Al(n.placement),l=K8(s),d=[Uo,ns].indexOf(s)>=0,p=d?"height":"width";if(!(!o||!a)){var g=aae(i.padding,n),m=j8(o),y=l==="y"?Vo:Uo,x=l==="y"?ts:ns,S=n.rects.reference[p]+n.rects.reference[l]-a[l]-n.rects.popper[p],E=a[l]-n.rects.reference[l],P=gv(o),k=P?l==="y"?P.clientHeight||0:P.clientWidth||0:0,T=S/2-E/2,M=g[y],N=k-m[p]-g[x],F=k/2-m[p]/2+T,z=qg(M,F,N),B=l;n.modifiersData[r]=(t={},t[B]=z,t.centerOffset=z-F,t)}}function lae(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!RD(t.elements.popper,i)||(t.elements.arrow=i))}const uae={name:"arrow",enabled:!0,phase:"main",fn:sae,effect:lae,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function P0(e){return e.split("-")[1]}var cae={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dae(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:k0(t*i)/i||0,y:k0(n*i)/i||0}}function gT(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,d=e.adaptive,p=e.roundOffsets,g=e.isFixed,m=a.x,y=m===void 0?0:m,x=a.y,S=x===void 0?0:x,E=typeof p=="function"?p({x:y,y:S}):{x:y,y:S};y=E.x,S=E.y;var P=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),T=Uo,M=Vo,N=window;if(d){var F=gv(n),z="clientHeight",B="clientWidth";if(F===os(n)&&(F=wd(n),Ou(F).position!=="static"&&s==="absolute"&&(z="scrollHeight",B="scrollWidth")),F=F,i===Vo||(i===Uo||i===ns)&&o===Dm){M=ts;var K=g&&F===N&&N.visualViewport?N.visualViewport.height:F[z];S-=K-r.height,S*=l?1:-1}if(i===Uo||(i===Vo||i===ts)&&o===Dm){T=ns;var j=g&&F===N&&N.visualViewport?N.visualViewport.width:F[B];y-=j-r.width,y*=l?1:-1}}var X=Object.assign({position:s},d&&cae),ue=p===!0?dae({x:y,y:S}):{x:y,y:S};if(y=ue.x,S=ue.y,l){var ge;return Object.assign({},X,(ge={},ge[M]=k?"0":"",ge[T]=P?"0":"",ge.transform=(N.devicePixelRatio||1)<=1?"translate("+y+"px, "+S+"px)":"translate3d("+y+"px, "+S+"px, 0)",ge))}return Object.assign({},X,(t={},t[M]=k?S+"px":"",t[T]=P?y+"px":"",t.transform="",t))}function fae(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,d={placement:Al(t.placement),variation:P0(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gT(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gT(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const hae={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fae,data:{}};var j2={passive:!0};function pae(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=os(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(p){p.addEventListener("scroll",n.update,j2)}),s&&l.addEventListener("resize",n.update,j2),function(){o&&d.forEach(function(p){p.removeEventListener("scroll",n.update,j2)}),s&&l.removeEventListener("resize",n.update,j2)}}const gae={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:pae,data:{}};var mae={left:"right",right:"left",bottom:"top",top:"bottom"};function Zy(e){return e.replace(/left|right|bottom|top/g,function(t){return mae[t]})}var vae={start:"end",end:"start"};function mT(e){return e.replace(/start|end/g,function(t){return vae[t]})}function q8(e){var t=os(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Z8(e){return E0(wd(e)).left+q8(e).scrollLeft}function yae(e,t){var n=os(e),r=wd(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var d=MD();(d||!d&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Z8(e),y:l}}function bae(e){var t,n=wd(e),r=q8(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Jf(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Jf(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Z8(e),l=-r.scrollTop;return Ou(i||n).direction==="rtl"&&(s+=Jf(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Y8(e){var t=Ou(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function zD(e){return["html","body","#document"].indexOf(Nl(e))>=0?e.ownerDocument.body:Qa(e)&&Y8(e)?e:zD(W4(e))}function Zg(e,t){var n;t===void 0&&(t=[]);var r=zD(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=os(r),a=i?[o].concat(o.visualViewport||[],Y8(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Zg(W4(a)))}function I6(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function xae(e,t){var n=E0(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 vT(e,t,n){return t===AD?I6(yae(e,n)):sh(t)?xae(t,n):I6(bae(wd(e)))}function Sae(e){var t=Zg(W4(e)),n=["absolute","fixed"].indexOf(Ou(e).position)>=0,r=n&&Qa(e)?gv(e):e;return sh(r)?t.filter(function(i){return sh(i)&&RD(i,r)&&Nl(i)!=="body"}):[]}function wae(e,t,n,r){var i=t==="clippingParents"?Sae(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,d){var p=vT(e,d,r);return l.top=Jf(p.top,l.top),l.right=c3(p.right,l.right),l.bottom=c3(p.bottom,l.bottom),l.left=Jf(p.left,l.left),l},vT(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function FD(e){var t=e.reference,n=e.element,r=e.placement,i=r?Al(r):null,o=r?P0(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Vo:l={x:a,y:t.y-n.height};break;case ts:l={x:a,y:t.y+t.height};break;case ns:l={x:t.x+t.width,y:s};break;case Uo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var d=i?K8(i):null;if(d!=null){var p=d==="y"?"height":"width";switch(o){case _0:l[d]=l[d]-(t[p]/2-n[p]/2);break;case Dm:l[d]=l[d]+(t[p]/2-n[p]/2);break}}return l}function zm(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?Woe:s,d=n.rootBoundary,p=d===void 0?AD:d,g=n.elementContext,m=g===void 0?ng:g,y=n.altBoundary,x=y===void 0?!1:y,S=n.padding,E=S===void 0?0:S,P=ND(typeof E!="number"?E:DD(E,pv)),k=m===ng?Voe:ng,T=e.rects.popper,M=e.elements[x?k:m],N=wae(sh(M)?M:M.contextElement||wd(e.elements.popper),l,p,a),F=E0(e.elements.reference),z=FD({reference:F,element:T,strategy:"absolute",placement:i}),B=I6(Object.assign({},T,z)),K=m===ng?B:F,j={top:N.top-K.top+P.top,bottom:K.bottom-N.bottom+P.bottom,left:N.left-K.left+P.left,right:K.right-N.right+P.right},X=e.modifiersData.offset;if(m===ng&&X){var ue=X[i];Object.keys(j).forEach(function(ge){var xe=[ns,ts].indexOf(ge)>=0?1:-1,we=[Vo,ts].indexOf(ge)>=0?"y":"x";j[ge]+=ue[we]*xe})}return j}function Cae(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,d=l===void 0?ID:l,p=P0(r),g=p?s?hT:hT.filter(function(x){return P0(x)===p}):pv,m=g.filter(function(x){return d.indexOf(x)>=0});m.length===0&&(m=g);var y=m.reduce(function(x,S){return x[S]=zm(e,{placement:S,boundary:i,rootBoundary:o,padding:a})[Al(S)],x},{});return Object.keys(y).sort(function(x,S){return y[x]-y[S]})}function _ae(e){if(Al(e)===U8)return[];var t=Zy(e);return[mT(e),t,mT(t)]}function kae(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,d=n.padding,p=n.boundary,g=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,x=y===void 0?!0:y,S=n.allowedAutoPlacements,E=t.options.placement,P=Al(E),k=P===E,T=l||(k||!x?[Zy(E)]:_ae(E)),M=[E].concat(T).reduce(function(be,De){return be.concat(Al(De)===U8?Cae(t,{placement:De,boundary:p,rootBoundary:g,padding:d,flipVariations:x,allowedAutoPlacements:S}):De)},[]),N=t.rects.reference,F=t.rects.popper,z=new Map,B=!0,K=M[0],j=0;j=0,we=xe?"width":"height",Se=zm(t,{placement:X,boundary:p,rootBoundary:g,altBoundary:m,padding:d}),J=xe?ge?ns:Uo:ge?ts:Vo;N[we]>F[we]&&(J=Zy(J));var G=Zy(J),te=[];if(o&&te.push(Se[ue]<=0),s&&te.push(Se[J]<=0,Se[G]<=0),te.every(function(be){return be})){K=X,B=!1;break}z.set(X,te)}if(B)for(var Q=x?3:1,W=function(De){var Re=M.find(function(Ve){var ke=z.get(Ve);if(ke)return ke.slice(0,De).every(function($e){return $e})});if(Re)return K=Re,"break"},ie=Q;ie>0;ie--){var de=W(ie);if(de==="break")break}t.placement!==K&&(t.modifiersData[r]._skip=!0,t.placement=K,t.reset=!0)}}const Eae={name:"flip",enabled:!0,phase:"main",fn:kae,requiresIfExists:["offset"],data:{_skip:!1}};function yT(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 bT(e){return[Vo,ns,ts,Uo].some(function(t){return e[t]>=0})}function Pae(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=zm(t,{elementContext:"reference"}),s=zm(t,{altBoundary:!0}),l=yT(a,r),d=yT(s,i,o),p=bT(l),g=bT(d);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:p,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":g})}const Tae={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Pae};function Lae(e,t,n){var r=Al(e),i=[Uo,Vo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Uo,ns].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Aae(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=ID.reduce(function(p,g){return p[g]=Lae(g,t.rects,o),p},{}),s=a[t.placement],l=s.x,d=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=a}const Iae={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Aae};function Mae(e){var t=e.state,n=e.name;t.modifiersData[n]=FD({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Rae={name:"popperOffsets",enabled:!0,phase:"read",fn:Mae,data:{}};function Oae(e){return e==="x"?"y":"x"}function Nae(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,d=n.rootBoundary,p=n.altBoundary,g=n.padding,m=n.tether,y=m===void 0?!0:m,x=n.tetherOffset,S=x===void 0?0:x,E=zm(t,{boundary:l,rootBoundary:d,padding:g,altBoundary:p}),P=Al(t.placement),k=P0(t.placement),T=!k,M=K8(P),N=Oae(M),F=t.modifiersData.popperOffsets,z=t.rects.reference,B=t.rects.popper,K=typeof S=="function"?S(Object.assign({},t.rects,{placement:t.placement})):S,j=typeof K=="number"?{mainAxis:K,altAxis:K}:Object.assign({mainAxis:0,altAxis:0},K),X=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ue={x:0,y:0};if(!!F){if(o){var ge,xe=M==="y"?Vo:Uo,we=M==="y"?ts:ns,Se=M==="y"?"height":"width",J=F[M],G=J+E[xe],te=J-E[we],Q=y?-B[Se]/2:0,W=k===_0?z[Se]:B[Se],ie=k===_0?-B[Se]:-z[Se],de=t.elements.arrow,be=y&&de?j8(de):{width:0,height:0},De=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:OD(),Re=De[xe],Ve=De[we],ke=qg(0,z[Se],be[Se]),$e=T?z[Se]/2-Q-ke-Re-j.mainAxis:W-ke-Re-j.mainAxis,nt=T?-z[Se]/2+Q+ke+Ve+j.mainAxis:ie+ke+Ve+j.mainAxis,ft=t.elements.arrow&&gv(t.elements.arrow),Rt=ft?M==="y"?ft.clientTop||0:ft.clientLeft||0:0,Ot=(ge=X?.[M])!=null?ge:0,Me=J+$e-Ot-Rt,tt=J+nt-Ot,pt=qg(y?c3(G,Me):G,J,y?Jf(te,tt):te);F[M]=pt,ue[M]=pt-J}if(s){var at,gt=M==="x"?Vo:Uo,pn=M==="x"?ts:ns,mt=F[N],Ht=N==="y"?"height":"width",nn=mt+E[gt],zt=mt-E[pn],Oe=[Vo,Uo].indexOf(P)!==-1,et=(at=X?.[N])!=null?at:0,Gt=Oe?nn:mt-z[Ht]-B[Ht]-et+j.altAxis,Wt=Oe?mt+z[Ht]+B[Ht]-et-j.altAxis:zt,Ee=y&&Oe?oae(Gt,mt,Wt):qg(y?Gt:nn,mt,y?Wt:zt);F[N]=Ee,ue[N]=Ee-mt}t.modifiersData[r]=ue}}const Dae={name:"preventOverflow",enabled:!0,phase:"main",fn:Nae,requiresIfExists:["offset"]};function zae(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Fae(e){return e===os(e)||!Qa(e)?q8(e):zae(e)}function $ae(e){var t=e.getBoundingClientRect(),n=k0(t.width)/e.offsetWidth||1,r=k0(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Bae(e,t,n){n===void 0&&(n=!1);var r=Qa(t),i=Qa(t)&&$ae(t),o=wd(t),a=E0(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Nl(t)!=="body"||Y8(o))&&(s=Fae(t)),Qa(t)?(l=E0(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Z8(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Hae(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Wae(e){var t=Hae(e);return Joe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Vae(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Uae(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var xT={placement:"bottom",modifiers:[],strategy:"absolute"};function ST(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),qr={arrowShadowColor:pp("--popper-arrow-shadow-color"),arrowSize:pp("--popper-arrow-size","8px"),arrowSizeHalf:pp("--popper-arrow-size-half"),arrowBg:pp("--popper-arrow-bg"),transformOrigin:pp("--popper-transform-origin"),arrowOffset:pp("--popper-arrow-offset")};function qae(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var Zae={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"},Yae=e=>Zae[e],wT={scroll:!0,resize:!0};function Xae(e){let t;return typeof e=="object"?t={enabled:!0,options:{...wT,...e}}:t={enabled:e,options:wT},t}var Qae={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`}},Jae={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{CT(e)},effect:({state:e})=>()=>{CT(e)}},CT=e=>{e.elements.popper.style.setProperty(qr.transformOrigin.var,Yae(e.placement))},ese={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{tse(e)}},tse=e=>{var t;if(!e.placement)return;const n=nse(e.placement);if(((t=e.elements)==null?void 0:t.arrow)&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:qr.arrowSize.varRef,height:qr.arrowSize.varRef,zIndex:-1});const r={[qr.arrowSizeHalf.var]:`calc(${qr.arrowSize.varRef} / 2)`,[qr.arrowOffset.var]:`calc(${qr.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},nse=e=>{if(e.startsWith("top"))return{property:"bottom",value:qr.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:qr.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:qr.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:qr.arrowOffset.varRef}},rse={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{_T(e)},effect:({state:e})=>()=>{_T(e)}},_T=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");!t||Object.assign(t.style,{transform:"rotate(45deg)",background:qr.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:qae(e.placement)})},ise={"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"}},ose={"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 ase(e,t="ltr"){var n;const r=((n=ise[e])==null?void 0:n[t])||e;return t==="ltr"?r:ose[e]??r}function $D(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:d=!0,boundary:p="clippingParents",preventOverflow:g=!0,matchWidth:m,direction:y="ltr"}=e,x=w.exports.useRef(null),S=w.exports.useRef(null),E=w.exports.useRef(null),P=ase(r,y),k=w.exports.useRef(()=>{}),T=w.exports.useCallback(()=>{var j;!t||!x.current||!S.current||((j=k.current)==null||j.call(k),E.current=Kae(x.current,S.current,{placement:P,modifiers:[rse,ese,Jae,{...Qae,enabled:!!m},{name:"eventListeners",...Xae(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!d,options:{padding:8}},{name:"preventOverflow",enabled:!!g,options:{boundary:p}},...n??[]],strategy:i}),E.current.forceUpdate(),k.current=E.current.destroy)},[P,t,n,m,a,o,s,l,d,g,p,i]);w.exports.useEffect(()=>()=>{var j;!x.current&&!S.current&&((j=E.current)==null||j.destroy(),E.current=null)},[]);const M=w.exports.useCallback(j=>{x.current=j,T()},[T]),N=w.exports.useCallback((j={},X=null)=>({...j,ref:Fn(M,X)}),[M]),F=w.exports.useCallback(j=>{S.current=j,T()},[T]),z=w.exports.useCallback((j={},X=null)=>({...j,ref:Fn(F,X),style:{...j.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,F,m]),B=w.exports.useCallback((j={},X=null)=>{const{size:ue,shadowColor:ge,bg:xe,style:we,...Se}=j;return{...Se,ref:X,"data-popper-arrow":"",style:sse(j)}},[]),K=w.exports.useCallback((j={},X=null)=>({...j,ref:X,"data-popper-arrow-inner":""}),[]);return{update(){var j;(j=E.current)==null||j.update()},forceUpdate(){var j;(j=E.current)==null||j.forceUpdate()},transformOrigin:qr.transformOrigin.varRef,referenceRef:M,popperRef:F,getPopperProps:z,getArrowProps:B,getArrowInnerProps:K,getReferenceProps:N}}function sse(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function BD(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=kr(n),a=kr(t),[s,l]=w.exports.useState(e.defaultIsOpen||!1),d=r!==void 0?r:s,p=r!==void 0,g=i??`disclosure-${w.exports.useId()}`,m=w.exports.useCallback(()=>{p||l(!1),a?.()},[p,a]),y=w.exports.useCallback(()=>{p||l(!0),o?.()},[p,o]),x=w.exports.useCallback(()=>{d?m():y()},[d,y,m]);function S(P={}){return{...P,"aria-expanded":d,"aria-controls":g,onClick(k){var T;(T=P.onClick)==null||T.call(P,k),x()}}}function E(P={}){return{...P,hidden:!d,id:g}}return{isOpen:d,onOpen:y,onClose:m,onToggle:x,isControlled:p,getButtonProps:S,getDisclosureProps:E}}function HD(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var[lse,use]=_n({strict:!1,name:"PortalManagerContext"});function WD(e){const{children:t,zIndex:n}=e;return _(lse,{value:{zIndex:n},children:t})}WD.displayName="PortalManager";var[VD,cse]=_n({strict:!1,name:"PortalContext"}),X8="chakra-portal",dse=".chakra-portal",fse=e=>_("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),hse=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.exports.useState(null),o=w.exports.useRef(null),[,a]=w.exports.useState({});w.exports.useEffect(()=>a({}),[]);const s=cse(),l=use();El(()=>{if(!r)return;const p=r.ownerDocument,g=t?s??p.body:p.body;if(!g)return;o.current=p.createElement("div"),o.current.className=X8,g.appendChild(o.current),a({});const m=o.current;return()=>{g.contains(m)&&g.removeChild(m)}},[r]);const d=l?.zIndex?_(fse,{zIndex:l?.zIndex,children:n}):n;return o.current?$l.exports.createPortal(_(VD,{value:o.current,children:d}),o.current):_("span",{ref:p=>{p&&i(p)}})},pse=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.exports.useMemo(()=>{const l=i?.ownerDocument.createElement("div");return l&&(l.className=X8),l},[i]),[,s]=w.exports.useState({});return El(()=>s({}),[]),El(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?$l.exports.createPortal(_(VD,{value:r?a:null,children:t}),a):null};function gh(e){const{containerRef:t,...n}=e;return t?_(pse,{containerRef:t,...n}):_(hse,{...n})}gh.defaultProps={appendToParentPortal:!0};gh.className=X8;gh.selector=dse;gh.displayName="Portal";var gse=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gp=new WeakMap,K2=new WeakMap,q2={},qx=0,mse=function(e,t,n,r){var i=Array.isArray(e)?e:[e];q2[n]||(q2[n]=new WeakMap);var o=q2[n],a=[],s=new Set,l=new Set(i),d=function(g){!g||s.has(g)||(s.add(g),d(g.parentNode))};i.forEach(d);var p=function(g){!g||l.has(g)||Array.prototype.forEach.call(g.children,function(m){if(s.has(m))p(m);else{var y=m.getAttribute(r),x=y!==null&&y!=="false",S=(gp.get(m)||0)+1,E=(o.get(m)||0)+1;gp.set(m,S),o.set(m,E),a.push(m),S===1&&x&&K2.set(m,!0),E===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}})};return p(t),s.clear(),qx++,function(){a.forEach(function(g){var m=gp.get(g)-1,y=o.get(g)-1;gp.set(g,m),o.set(g,y),m||(K2.has(g)||g.removeAttribute(r),K2.delete(g)),y||g.removeAttribute(n)}),qx--,qx||(gp=new WeakMap,gp=new WeakMap,K2=new WeakMap,q2={})}},UD=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||gse(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),mse(r,i,n,"aria-hidden")):function(){return null}};function vse(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function M6(){return M6=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0}).sort(Hse)},Wse=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],t_=Wse.join(","),Vse="".concat(t_,", [data-focus-guard]"),cz=function(e,t){var n;return Hl(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?Vse:t_)?[i]:[],cz(i))},[])},n_=function(e,t){return e.reduce(function(n,r){return n.concat(cz(r,t),r.parentNode?Hl(r.parentNode.querySelectorAll(t_)).filter(function(i){return i===r}):[])},[])},Use=function(e){var t=e.querySelectorAll("[".concat(Cse,"]"));return Hl(t).map(function(n){return n_([n])}).reduce(function(n,r){return n.concat(r)},[])},r_=function(e,t){return Hl(e).filter(function(n){return iz(t,n)}).filter(function(n){return Fse(n)})},kT=function(e,t){return t===void 0&&(t=new Map),Hl(e).filter(function(n){return oz(t,n)})},D6=function(e,t,n){return uz(r_(n_(e,n),t),!0,n)},ET=function(e,t){return uz(r_(n_(e),t),!1)},Gse=function(e,t){return r_(Use(e),t)},Fm=function(e,t){return(e.shadowRoot?Fm(e.shadowRoot,t):Object.getPrototypeOf(e).contains.call(e,t))||Hl(e.children).some(function(n){return Fm(n,t)})},jse=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},dz=function(e){return e.parentNode?dz(e.parentNode):e},i_=function(e){var t=N6(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(R6);return n.push.apply(n,i?jse(Hl(dz(r).querySelectorAll("[".concat(R6,'="').concat(i,'"]:not([').concat(KD,'="disabled"])')))):[r]),n},[])},fz=function(e){return e.activeElement?e.activeElement.shadowRoot?fz(e.activeElement.shadowRoot):e.activeElement:void 0},o_=function(){return document.activeElement?document.activeElement.shadowRoot?fz(document.activeElement.shadowRoot):document.activeElement:void 0},Kse=function(e){return e===document.activeElement},qse=function(e){return Boolean(Hl(e.querySelectorAll("iframe")).some(function(t){return Kse(t)}))},hz=function(e){var t=document&&o_();return!t||t.dataset&&t.dataset.focusGuard?!1:i_(e).some(function(n){return Fm(n,t)||qse(n)})},Zse=function(){var e=document&&o_();return e?Hl(document.querySelectorAll("[".concat(wse,"]"))).some(function(t){return Fm(t,e)}):!1},Yse=function(e,t){return t.filter(lz).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},a_=function(e,t){return lz(e)&&e.name?Yse(e,t):e},Xse=function(e){var t=new Set;return e.forEach(function(n){return t.add(a_(n,e))}),e.filter(function(n){return t.has(n)})},PT=function(e){return e[0]&&e.length>1?a_(e[0],e):e[0]},TT=function(e,t){return e.length>1?e.indexOf(a_(e[t],e)):t},pz="NEW_FOCUS",Qse=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=e_(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,d=r?t.indexOf(r):l,p=r?e.indexOf(r):-1,g=l-d,m=t.indexOf(o),y=t.indexOf(a),x=Xse(t),S=n!==void 0?x.indexOf(n):-1,E=S-(r?x.indexOf(r):l),P=TT(e,0),k=TT(e,i-1);if(l===-1||p===-1)return pz;if(!g&&p>=0)return p;if(l<=m&&s&&Math.abs(g)>1)return k;if(l>=y&&s&&Math.abs(g)>1)return P;if(g&&Math.abs(E)>1)return p;if(l<=m)return k;if(l>y)return P;if(g)return Math.abs(g)>1?p:(i+p+g)%i}},z6=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&z6(e.parentNode.host||e.parentNode,t),t},Yx=function(e,t){for(var n=z6(e),r=z6(t),i=0;i=0)return o}return!1},gz=function(e,t,n){var r=N6(e),i=N6(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=Yx(a||s,s)||a,n.filter(Boolean).forEach(function(l){var d=Yx(o,l);d&&(!a||Fm(d,a)?a=d:a=Yx(d,a))})}),a},Jse=function(e,t){return e.reduce(function(n,r){return n.concat(Gse(r,t))},[])},ele=function(e){return function(t){var n;return t.autofocus||!!(!((n=az(t))===null||n===void 0)&&n.autofocus)||e.indexOf(t)>=0}},tle=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(Bse)},nle=function(e,t){var n=document&&o_(),r=i_(e).filter(d3),i=gz(n||e,e,r),o=new Map,a=ET(r,o),s=D6(r,o).filter(function(y){var x=y.node;return d3(x)});if(!(!s[0]&&(s=a,!s[0]))){var l=ET([i],o).map(function(y){var x=y.node;return x}),d=tle(l,s),p=d.map(function(y){var x=y.node;return x}),g=Qse(p,l,n,t);if(g===pz){var m=kT(a.map(function(y){var x=y.node;return x})).filter(ele(Jse(r,o)));return{node:m&&m.length?PT(m):PT(kT(p))}}return g===void 0?g:d[g]}},rle=function(e){var t=i_(e).filter(d3),n=gz(e,e,t),r=new Map,i=D6([n],r,!0),o=D6(t,r).filter(function(a){var s=a.node;return d3(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:e_(s)}})},ile=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},Xx=0,Qx=!1,ole=function(e,t,n){n===void 0&&(n={});var r=nle(e,t);if(!Qx&&r){if(Xx>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Qx=!0,setTimeout(function(){Qx=!1},1);return}Xx++,ile(r.node,n.focusOptions),Xx--}};const mz=ole;function vz(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var ale=function(){return document&&document.activeElement===document.body},sle=function(){return ale()||Zse()},i0=null,Vp=null,o0=null,$m=!1,lle=function(){return!0},ule=function(t){return(i0.whiteList||lle)(t)},cle=function(t,n){o0={observerNode:t,portaledElement:n}},dle=function(t){return o0&&o0.portaledElement===t};function LT(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var fle=function(t){return t&&"current"in t?t.current:t},hle=function(t){return t?Boolean($m):$m==="meanwhile"},ple=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},gle=function(t,n){return n.some(function(r){return ple(t,r,r)})},f3=function(){var t=!1;if(i0){var n=i0,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,d=r||o0&&o0.portaledElement,p=document&&document.activeElement;if(d){var g=[d].concat(a.map(fle).filter(Boolean));if((!p||ule(p))&&(i||hle(s)||!sle()||!Vp&&o)&&(d&&!(hz(g)||p&&gle(p,g)||dle(p))&&(document&&!Vp&&p&&!o?(p.blur&&p.blur(),document.body.focus()):(t=mz(g,Vp,{focusOptions:l}),o0={})),$m=!1,Vp=document&&document.activeElement),document){var m=document&&document.activeElement,y=rle(g),x=y.map(function(S){var E=S.node;return E}).indexOf(m);x>-1&&(y.filter(function(S){var E=S.guard,P=S.node;return E&&P.dataset.focusAutoGuard}).forEach(function(S){var E=S.node;return E.removeAttribute("tabIndex")}),LT(x,y.length,1,y),LT(x,-1,-1,y))}}}return t},yz=function(t){f3()&&t&&(t.stopPropagation(),t.preventDefault())},s_=function(){return vz(f3)},mle=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||cle(r,n)},vle=function(){return null},bz=function(){$m="just",setTimeout(function(){$m="meanwhile"},0)},yle=function(){document.addEventListener("focusin",yz),document.addEventListener("focusout",s_),window.addEventListener("blur",bz)},ble=function(){document.removeEventListener("focusin",yz),document.removeEventListener("focusout",s_),window.removeEventListener("blur",bz)};function xle(e){return e.filter(function(t){var n=t.disabled;return!n})}function Sle(e){var t=e.slice(-1)[0];t&&!i0&&yle();var n=i0,r=n&&t&&t.id===n.id;i0=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(Vp=null,(!r||n.observed!==t.observed)&&t.onActivation(),f3(),vz(f3)):(ble(),Vp=null)}JD.assignSyncMedium(mle);ez.assignMedium(s_);Tse.assignMedium(function(e){return e({moveFocusInside:mz,focusInside:hz})});const wle=Rse(xle,Sle)(vle);var xz=w.exports.forwardRef(function(t,n){return _(tz,{sideCar:wle,ref:n,...t})}),Sz=tz.propTypes||{};Sz.sideCar;vse(Sz,["sideCar"]);xz.propTypes={};const Cle=xz;var wz=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:d}=e,p=w.exports.useCallback(()=>{t?.current?t.current.focus():r?.current&&Hoe(r.current).length===0&&requestAnimationFrame(()=>{var x;(x=r.current)==null||x.focus()})},[t,r]),g=w.exports.useCallback(()=>{var y;(y=n?.current)==null||y.focus()},[n]);return _(Cle,{crossFrame:d,persistentFocus:l,autoFocus:s,disabled:a,onActivation:p,onDeactivation:g,returnFocus:i&&!n,children:o})};wz.displayName="FocusLock";var Yy="right-scroll-bar-position",Xy="width-before-scroll-bar",_le="with-scroll-bars-hidden",kle="--removed-body-scroll-bar-size",Cz=XD(),Jx=function(){},V4=w.exports.forwardRef(function(e,t){var n=w.exports.useRef(null),r=w.exports.useState({onScrollCapture:Jx,onWheelCapture:Jx,onTouchMoveCapture:Jx}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,d=e.removeScrollBar,p=e.enabled,g=e.shards,m=e.sideCar,y=e.noIsolation,x=e.inert,S=e.allowPinchZoom,E=e.as,P=E===void 0?"div":E,k=E4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,M=qD([n,t]),N=Sl(Sl({},k),i);return ae(jn,{children:[p&&_(T,{sideCar:Cz,removeScrollBar:d,shards:g,noIsolation:y,inert:x,setCallbacks:o,allowPinchZoom:!!S,lockRef:n}),a?w.exports.cloneElement(w.exports.Children.only(s),Sl(Sl({},N),{ref:M})):_(P,{...Sl({},N,{className:l,ref:M}),children:s})]})});V4.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};V4.classNames={fullWidth:Xy,zeroRight:Yy};var Ele=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ple(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ele();return t&&e.setAttribute("nonce",t),e}function Tle(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Lle(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ale=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ple())&&(Tle(t,n),Lle(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ile=function(){var e=Ale();return function(t,n){w.exports.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_z=function(){var e=Ile(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Mle={left:0,top:0,right:0,gap:0},eS=function(e){return parseInt(e||"",10)||0},Rle=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[eS(n),eS(r),eS(i)]},Ole=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Mle;var t=Rle(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])}},Nle=_z(),Dle=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(_le,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Yy,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Xy,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Yy," .").concat(Yy,` { + right: 0 `).concat(r,`; + } + + .`).concat(Xy," .").concat(Xy,` { + margin-right: 0 `).concat(r,`; + } + + body { + `).concat(kle,": ").concat(s,`px; + } +`)},zle=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.exports.useMemo(function(){return Ole(i)},[i]);return _(Nle,{styles:Dle(o,!t,i,n?"":"!important")})},F6=!1;if(typeof window<"u")try{var Z2=Object.defineProperty({},"passive",{get:function(){return F6=!0,!0}});window.addEventListener("test",Z2,Z2),window.removeEventListener("test",Z2,Z2)}catch{F6=!1}var mp=F6?{passive:!1}:!1,Fle=function(e){return e.tagName==="TEXTAREA"},kz=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Fle(e)&&n[t]==="visible")},$le=function(e){return kz(e,"overflowY")},Ble=function(e){return kz(e,"overflowX")},AT=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Ez(e,n);if(r){var i=Pz(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Hle=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wle=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ez=function(e,t){return e==="v"?$le(t):Ble(t)},Pz=function(e,t){return e==="v"?Hle(t):Wle(t)},Vle=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ule=function(e,t,n,r,i){var o=Vle(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),d=!1,p=a>0,g=0,m=0;do{var y=Pz(e,s),x=y[0],S=y[1],E=y[2],P=S-E-o*x;(x||P)&&Ez(e,s)&&(g+=P,m+=x),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(p&&(i&&g===0||!i&&a>g)||!p&&(i&&m===0||!i&&-a>m))&&(d=!0),d},Y2=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},IT=function(e){return[e.deltaX,e.deltaY]},MT=function(e){return e&&"current"in e?e.current:e},Gle=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jle=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Kle=0,vp=[];function qle(e){var t=w.exports.useRef([]),n=w.exports.useRef([0,0]),r=w.exports.useRef(),i=w.exports.useState(Kle++)[0],o=w.exports.useState(function(){return _z()})[0],a=w.exports.useRef(e);w.exports.useEffect(function(){a.current=e},[e]),w.exports.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=i6([e.lockRef.current],(e.shards||[]).map(MT),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.exports.useCallback(function(S,E){if("touches"in S&&S.touches.length===2)return!a.current.allowPinchZoom;var P=Y2(S),k=n.current,T="deltaX"in S?S.deltaX:k[0]-P[0],M="deltaY"in S?S.deltaY:k[1]-P[1],N,F=S.target,z=Math.abs(T)>Math.abs(M)?"h":"v";if("touches"in S&&z==="h"&&F.type==="range")return!1;var B=AT(z,F);if(!B)return!0;if(B?N=z:(N=z==="v"?"h":"v",B=AT(z,F)),!B)return!1;if(!r.current&&"changedTouches"in S&&(T||M)&&(r.current=N),!N)return!0;var K=r.current||N;return Ule(K,E,S,K==="h"?T:M,!0)},[]),l=w.exports.useCallback(function(S){var E=S;if(!(!vp.length||vp[vp.length-1]!==o)){var P="deltaY"in E?IT(E):Y2(E),k=t.current.filter(function(N){return N.name===E.type&&N.target===E.target&&Gle(N.delta,P)})[0];if(k&&k.should){E.cancelable&&E.preventDefault();return}if(!k){var T=(a.current.shards||[]).map(MT).filter(Boolean).filter(function(N){return N.contains(E.target)}),M=T.length>0?s(E,T[0]):!a.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),d=w.exports.useCallback(function(S,E,P,k){var T={name:S,delta:E,target:P,should:k};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(M){return M!==T})},1)},[]),p=w.exports.useCallback(function(S){n.current=Y2(S),r.current=void 0},[]),g=w.exports.useCallback(function(S){d(S.type,IT(S),S.target,s(S,e.lockRef.current))},[]),m=w.exports.useCallback(function(S){d(S.type,Y2(S),S.target,s(S,e.lockRef.current))},[]);w.exports.useEffect(function(){return vp.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",l,mp),document.addEventListener("touchmove",l,mp),document.addEventListener("touchstart",p,mp),function(){vp=vp.filter(function(S){return S!==o}),document.removeEventListener("wheel",l,mp),document.removeEventListener("touchmove",l,mp),document.removeEventListener("touchstart",p,mp)}},[]);var y=e.removeScrollBar,x=e.inert;return ae(jn,{children:[x?_(o,{styles:jle(i)}):null,y?_(zle,{gapMode:"margin"}):null]})}const Zle=Pse(Cz,qle);var Tz=w.exports.forwardRef(function(e,t){return _(V4,{...Sl({},e,{ref:t,sideCar:Zle})})});Tz.classNames=V4.classNames;const Lz=Tz;var mh=(...e)=>e.filter(Boolean).join(" ");function vg(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var Yle=class{modals;constructor(){this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},$6=new Yle;function Xle(e,t){w.exports.useEffect(()=>(t&&$6.add(e),()=>{$6.remove(e)}),[t,e])}function Qle(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,d=w.exports.useRef(null),p=w.exports.useRef(null),[g,m,y]=eue(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Jle(d,t&&a),Xle(d,t);const x=w.exports.useRef(null),S=w.exports.useCallback(B=>{x.current=B.target},[]),E=w.exports.useCallback(B=>{B.key==="Escape"&&(B.stopPropagation(),o&&n?.(),l?.())},[o,n,l]),[P,k]=w.exports.useState(!1),[T,M]=w.exports.useState(!1),N=w.exports.useCallback((B={},K=null)=>({role:"dialog",...B,ref:Fn(K,d),id:g,tabIndex:-1,"aria-modal":!0,"aria-labelledby":P?m:void 0,"aria-describedby":T?y:void 0,onClick:vg(B.onClick,j=>j.stopPropagation())}),[y,T,g,m,P]),F=w.exports.useCallback(B=>{B.stopPropagation(),x.current===B.target&&(!$6.isTopModal(d)||(i&&n?.(),s?.()))},[n,i,s]),z=w.exports.useCallback((B={},K=null)=>({...B,ref:Fn(K,p),onClick:vg(B.onClick,F),onKeyDown:vg(B.onKeyDown,E),onMouseDown:vg(B.onMouseDown,S)}),[E,S,F]);return{isOpen:t,onClose:n,headerId:m,bodyId:y,setBodyMounted:M,setHeaderMounted:k,dialogRef:d,overlayRef:p,getDialogProps:N,getDialogContainerProps:z}}function Jle(e,t){const n=e.current;w.exports.useEffect(()=>{if(!(!e.current||!t))return UD(e.current)},[t,e,n])}function eue(e,...t){const n=w.exports.useId(),r=e||n;return w.exports.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[tue,vh]=_n({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[nue,fd]=_n({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),T0=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:g,lockFocusAcrossFrames:m,onCloseComplete:y}=e,x=$i("Modal",e),E={...Qle(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:g,lockFocusAcrossFrames:m};return _(nue,{value:E,children:_(tue,{value:x,children:_(Hu,{onExitComplete:y,children:E.isOpen&&_(gh,{...t,children:n})})})})};T0.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};T0.displayName="Modal";var h3=Ie((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=fd();w.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=mh("chakra-modal__body",n),s=vh();return le.createElement(Ce.div,{ref:t,className:a,id:i,...r,__css:s.body})});h3.displayName="ModalBody";var l_=Ie((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=fd(),a=mh("chakra-modal__close-btn",r),s=vh();return _(B4,{ref:t,__css:s.closeButton,className:a,onClick:vg(n,l=>{l.stopPropagation(),o()}),...i})});l_.displayName="ModalCloseButton";function Az(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:d,lockFocusAcrossFrames:p}=fd(),[g,m]=w8();return w.exports.useEffect(()=>{!g&&m&&setTimeout(m)},[g,m]),_(wz,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:p,children:_(Lz,{removeScrollBar:!d,allowPinchZoom:a,enabled:o,forwardProps:!0,children:e.children})})}var rue={slideInBottom:{...S6,custom:{offsetY:16,reverse:!0}},slideInRight:{...S6,custom:{offsetX:16,reverse:!0}},scale:{...KN,custom:{initialScale:.95,reverse:!0}},none:{}},iue=Ce(is.section),Iz=w.exports.forwardRef((e,t)=>{const{preset:n,...r}=e,i=rue[n];return _(iue,{ref:t,...i,...r})});Iz.displayName="ModalTransition";var Bm=Ie((e,t)=>{const{className:n,children:r,containerProps:i,...o}=e,{getDialogProps:a,getDialogContainerProps:s}=fd(),l=a(o,t),d=s(i),p=mh("chakra-modal__content",n),g=vh(),m={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...g.dialog},y={display:"flex",width:"100vw",height:"100vh","@supports(height: -webkit-fill-available)":{height:"-webkit-fill-available"},position:"fixed",left:0,top:0,...g.dialogContainer},{motionPreset:x}=fd();return le.createElement(Az,null,le.createElement(Ce.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:y},_(Iz,{preset:x,className:p,...l,__css:m,children:r})))});Bm.displayName="ModalContent";var u_=Ie((e,t)=>{const{className:n,...r}=e,i=mh("chakra-modal__footer",n),o=vh(),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...o.footer};return le.createElement(Ce.footer,{ref:t,...r,__css:a,className:i})});u_.displayName="ModalFooter";var c_=Ie((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=fd();w.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=mh("chakra-modal__header",n),s=vh(),l={flex:0,...s.header};return le.createElement(Ce.header,{ref:t,className:a,id:i,...r,__css:l})});c_.displayName="ModalHeader";var oue=Ce(is.div),Hm=Ie((e,t)=>{const{className:n,transition:r,...i}=e,o=mh("chakra-modal__overlay",n),a=vh(),s={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...a.overlay},{motionPreset:l}=fd();return _(oue,{...l==="none"?{}:jN,__css:s,ref:t,className:o,...i})});Hm.displayName="ModalOverlay";function aue(e){const{leastDestructiveRef:t,...n}=e;return _(T0,{...n,initialFocusRef:t})}var sue=Ie((e,t)=>_(Bm,{ref:t,role:"alertdialog",...e})),[d8e,lue]=_n(),uue=Ce(qN),cue=Ie((e,t)=>{const{className:n,children:r,...i}=e,{getDialogProps:o,getDialogContainerProps:a,isOpen:s}=fd(),l=o(i,t),d=a(),p=mh("chakra-modal__content",n),g=vh(),m={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},{placement:x}=lue();return le.createElement(Ce.div,{...d,className:"chakra-modal__content-container",__css:y},_(Az,{children:_(uue,{direction:x,in:s,className:p,...l,__css:m,children:r})}))});cue.displayName="DrawerContent";function due(e,t){const n=kr(e);w.exports.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var Mz=(...e)=>e.filter(Boolean).join(" "),tS=e=>e?!0:void 0;function cl(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var fue=e=>_(Ea,{viewBox:"0 0 24 24",...e,children:_("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"})}),hue=e=>_(Ea,{viewBox:"0 0 24 24",...e,children:_("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 RT(e,t,n,r){w.exports.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var pue=50,OT=300;function gue(e,t){const[n,r]=w.exports.useState(!1),[i,o]=w.exports.useState(null),[a,s]=w.exports.useState(!0),l=w.exports.useRef(null),d=()=>clearTimeout(l.current);due(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?pue:null);const p=w.exports.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},OT)},[e,a]),g=w.exports.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},OT)},[t,a]),m=w.exports.useCallback(()=>{s(!0),r(!1),d()},[]);return w.exports.useEffect(()=>()=>d(),[]),{up:p,down:g,stop:m,isSpinning:n}}var mue=/^[Ee0-9+\-.]$/;function vue(e){return mue.test(e)}function yue(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 bue(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:d,isInvalid:p,pattern:g="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:y,id:x,onChange:S,precision:E,name:P,"aria-describedby":k,"aria-label":T,"aria-labelledby":M,onFocus:N,onBlur:F,onInvalid:z,getAriaValueText:B,isValidCharacter:K,format:j,parse:X,...ue}=e,ge=kr(N),xe=kr(F),we=kr(z),Se=kr(K??vue),J=kr(B),G=zie(e),{update:te,increment:Q,decrement:W}=G,[ie,de]=w.exports.useState(!1),be=!(s||l),De=w.exports.useRef(null),Re=w.exports.useRef(null),Ve=w.exports.useRef(null),ke=w.exports.useRef(null),$e=w.exports.useCallback(Ee=>Ee.split("").filter(Se).join(""),[Se]),nt=w.exports.useCallback(Ee=>X?.(Ee)??Ee,[X]),ft=w.exports.useCallback(Ee=>(j?.(Ee)??Ee).toString(),[j]);w0(()=>{(G.valueAsNumber>o||G.valueAsNumber{if(!De.current)return;if(De.current.value!=G.value){const kt=nt(De.current.value);G.setValue($e(kt))}},[nt,$e]);const Rt=w.exports.useCallback((Ee=a)=>{be&&Q(Ee)},[Q,be,a]),Ot=w.exports.useCallback((Ee=a)=>{be&&W(Ee)},[W,be,a]),Me=gue(Rt,Ot);RT(Ve,"disabled",Me.stop,Me.isSpinning),RT(ke,"disabled",Me.stop,Me.isSpinning);const tt=w.exports.useCallback(Ee=>{if(Ee.nativeEvent.isComposing)return;const Xt=nt(Ee.currentTarget.value);te($e(Xt)),Re.current={start:Ee.currentTarget.selectionStart,end:Ee.currentTarget.selectionEnd}},[te,$e,nt]),pt=w.exports.useCallback(Ee=>{var kt;ge?.(Ee),Re.current&&(Ee.target.selectionStart=Re.current.start??((kt=Ee.currentTarget.value)==null?void 0:kt.length),Ee.currentTarget.selectionEnd=Re.current.end??Ee.currentTarget.selectionStart)},[ge]),at=w.exports.useCallback(Ee=>{if(Ee.nativeEvent.isComposing)return;yue(Ee,Se)||Ee.preventDefault();const kt=gt(Ee)*a,Xt=Ee.key,Ge={ArrowUp:()=>Rt(kt),ArrowDown:()=>Ot(kt),Home:()=>te(i),End:()=>te(o)}[Xt];Ge&&(Ee.preventDefault(),Ge(Ee))},[Se,a,Rt,Ot,te,i,o]),gt=Ee=>{let kt=1;return(Ee.metaKey||Ee.ctrlKey)&&(kt=.1),Ee.shiftKey&&(kt=10),kt},pn=w.exports.useMemo(()=>{const Ee=J?.(G.value);if(Ee!=null)return Ee;const kt=G.value.toString();return kt||void 0},[G.value,J]),mt=w.exports.useCallback(()=>{let Ee=G.value;Ee!==""&&(G.valueAsNumbero&&(Ee=o),G.cast(Ee))},[G,o,i]),Ht=w.exports.useCallback(()=>{de(!1),n&&mt()},[n,de,mt]),nn=w.exports.useCallback(()=>{t&&requestAnimationFrame(()=>{var Ee;(Ee=De.current)==null||Ee.focus()})},[t]),zt=w.exports.useCallback(Ee=>{Ee.preventDefault(),Me.up(),nn()},[nn,Me]),Oe=w.exports.useCallback(Ee=>{Ee.preventDefault(),Me.down(),nn()},[nn,Me]);P6(()=>De.current,"wheel",Ee=>{var kt;const Bn=(((kt=De.current)==null?void 0:kt.ownerDocument)??document).activeElement===De.current;if(!y||!Bn)return;Ee.preventDefault();const Ge=gt(Ee)*a,Lt=Math.sign(Ee.deltaY);Lt===-1?Rt(Ge):Lt===1&&Ot(Ge)},{passive:!1});const et=w.exports.useCallback((Ee={},kt=null)=>{const Xt=l||r&&G.isAtMax;return{...Ee,ref:Fn(kt,Ve),role:"button",tabIndex:-1,onPointerDown:cl(Ee.onPointerDown,Bn=>{Xt||zt(Bn)}),onPointerLeave:cl(Ee.onPointerLeave,Me.stop),onPointerUp:cl(Ee.onPointerUp,Me.stop),disabled:Xt,"aria-disabled":tS(Xt)}},[G.isAtMax,r,zt,Me.stop,l]),Gt=w.exports.useCallback((Ee={},kt=null)=>{const Xt=l||r&&G.isAtMin;return{...Ee,ref:Fn(kt,ke),role:"button",tabIndex:-1,onPointerDown:cl(Ee.onPointerDown,Bn=>{Xt||Oe(Bn)}),onPointerLeave:cl(Ee.onPointerLeave,Me.stop),onPointerUp:cl(Ee.onPointerUp,Me.stop),disabled:Xt,"aria-disabled":tS(Xt)}},[G.isAtMin,r,Oe,Me.stop,l]),Wt=w.exports.useCallback((Ee={},kt=null)=>({name:P,inputMode:m,type:"text",pattern:g,"aria-labelledby":M,"aria-label":T,"aria-describedby":k,id:x,disabled:l,...Ee,readOnly:Ee.readOnly??s,"aria-readonly":Ee.readOnly??s,"aria-required":Ee.required??d,required:Ee.required??d,ref:Fn(De,kt),value:ft(G.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(G.valueAsNumber)?void 0:G.valueAsNumber,"aria-invalid":tS(p??G.isOutOfRange),"aria-valuetext":pn,autoComplete:"off",autoCorrect:"off",onChange:cl(Ee.onChange,tt),onKeyDown:cl(Ee.onKeyDown,at),onFocus:cl(Ee.onFocus,pt,()=>de(!0)),onBlur:cl(Ee.onBlur,xe,Ht)}),[P,m,g,M,T,ft,k,x,l,d,s,p,G.value,G.valueAsNumber,G.isOutOfRange,i,o,pn,tt,at,pt,xe,Ht]);return{value:ft(G.value),valueAsNumber:G.valueAsNumber,isFocused:ie,isDisabled:l,isReadOnly:s,getIncrementButtonProps:et,getDecrementButtonProps:Gt,getInputProps:Wt,htmlProps:ue}}var[xue,U4]=_n({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Sue,d_]=_n({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),Rz=Ie(function(t,n){const r=$i("NumberInput",t),i=bn(t),o=O8(i),{htmlProps:a,...s}=bue(o),l=w.exports.useMemo(()=>s,[s]);return le.createElement(Sue,{value:l},le.createElement(xue,{value:r},le.createElement(Ce.div,{...a,ref:n,className:Mz("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});Rz.displayName="NumberInput";var wue=Ie(function(t,n){const r=U4();return le.createElement(Ce.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}})});wue.displayName="NumberInputStepper";var Oz=Ie(function(t,n){const{getInputProps:r}=d_(),i=r(t,n),o=U4();return le.createElement(Ce.input,{...i,className:Mz("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});Oz.displayName="NumberInputField";var Nz=Ce("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Dz=Ie(function(t,n){const r=U4(),{getDecrementButtonProps:i}=d_(),o=i(t,n);return _(Nz,{...o,__css:r.stepper,children:t.children??_(fue,{})})});Dz.displayName="NumberDecrementStepper";var zz=Ie(function(t,n){const{getIncrementButtonProps:r}=d_(),i=r(t,n),o=U4();return _(Nz,{...i,__css:o.stepper,children:t.children??_(hue,{})})});zz.displayName="NumberIncrementStepper";var mv=(...e)=>e.filter(Boolean).join(" ");function Cue(e,...t){return _ue(e)?e(...t):e}var _ue=e=>typeof e=="function";function dl(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function kue(...e){return function(n){e.forEach(r=>{r?.(n)})}}var[Eue,yh]=_n({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[Pue,vv]=_n({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),yp={click:"click",hover:"hover"};function Tue(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:d=yp.click,openDelay:p=200,closeDelay:g=200,isLazy:m,lazyBehavior:y="unmount",computePositionOnMount:x,...S}=e,{isOpen:E,onClose:P,onOpen:k,onToggle:T}=BD(e),M=w.exports.useRef(null),N=w.exports.useRef(null),F=w.exports.useRef(null),z=w.exports.useRef(!1),B=w.exports.useRef(!1);E&&(B.current=!0);const[K,j]=w.exports.useState(!1),[X,ue]=w.exports.useState(!1),ge=w.exports.useId(),xe=i??ge,[we,Se,J,G]=["popover-trigger","popover-content","popover-header","popover-body"].map(tt=>`${tt}-${xe}`),{referenceRef:te,getArrowProps:Q,getPopperProps:W,getArrowInnerProps:ie,forceUpdate:de}=$D({...S,enabled:E||!!x}),be=Hie({isOpen:E,ref:F});Kie({enabled:E,ref:N}),Gie(F,{focusRef:N,visible:E,shouldFocus:o&&d===yp.click}),Zie(F,{focusRef:r,visible:E,shouldFocus:a&&d===yp.click});const De=HD({wasSelected:B.current,enabled:m,mode:y,isSelected:be.present}),Re=w.exports.useCallback((tt={},pt=null)=>{const at={...tt,style:{...tt.style,transformOrigin:qr.transformOrigin.varRef,[qr.arrowSize.var]:s?`${s}px`:void 0,[qr.arrowShadowColor.var]:l},ref:Fn(F,pt),children:De?tt.children:null,id:Se,tabIndex:-1,role:"dialog",onKeyDown:dl(tt.onKeyDown,gt=>{n&>.key==="Escape"&&P()}),onBlur:dl(tt.onBlur,gt=>{const pn=NT(gt),mt=nS(F.current,pn),Ht=nS(N.current,pn);E&&t&&(!mt&&!Ht)&&P()}),"aria-labelledby":K?J:void 0,"aria-describedby":X?G:void 0};return d===yp.hover&&(at.role="tooltip",at.onMouseEnter=dl(tt.onMouseEnter,()=>{z.current=!0}),at.onMouseLeave=dl(tt.onMouseLeave,gt=>{gt.nativeEvent.relatedTarget!==null&&(z.current=!1,setTimeout(P,g))})),at},[De,Se,K,J,X,G,d,n,P,E,t,g,l,s]),Ve=w.exports.useCallback((tt={},pt=null)=>W({...tt,style:{visibility:E?"visible":"hidden",...tt.style}},pt),[E,W]),ke=w.exports.useCallback((tt,pt=null)=>({...tt,ref:Fn(pt,M,te)}),[M,te]),$e=w.exports.useRef(),nt=w.exports.useRef(),ft=w.exports.useCallback(tt=>{M.current==null&&te(tt)},[te]),Rt=w.exports.useCallback((tt={},pt=null)=>{const at={...tt,ref:Fn(N,pt,ft),id:we,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":Se};return d===yp.click&&(at.onClick=dl(tt.onClick,T)),d===yp.hover&&(at.onFocus=dl(tt.onFocus,()=>{$e.current===void 0&&k()}),at.onBlur=dl(tt.onBlur,gt=>{const pn=NT(gt),mt=!nS(F.current,pn);E&&t&&mt&&P()}),at.onKeyDown=dl(tt.onKeyDown,gt=>{gt.key==="Escape"&&P()}),at.onMouseEnter=dl(tt.onMouseEnter,()=>{z.current=!0,$e.current=window.setTimeout(k,p)}),at.onMouseLeave=dl(tt.onMouseLeave,()=>{z.current=!1,$e.current&&(clearTimeout($e.current),$e.current=void 0),nt.current=window.setTimeout(()=>{z.current===!1&&P()},g)})),at},[we,E,Se,d,ft,T,k,t,P,p,g]);w.exports.useEffect(()=>()=>{$e.current&&clearTimeout($e.current),nt.current&&clearTimeout(nt.current)},[]);const Ot=w.exports.useCallback((tt={},pt=null)=>({...tt,id:J,ref:Fn(pt,at=>{j(!!at)})}),[J]),Me=w.exports.useCallback((tt={},pt=null)=>({...tt,id:G,ref:Fn(pt,at=>{ue(!!at)})}),[G]);return{forceUpdate:de,isOpen:E,onAnimationComplete:be.onComplete,onClose:P,getAnchorProps:ke,getArrowProps:Q,getArrowInnerProps:ie,getPopoverPositionerProps:Ve,getPopoverProps:Re,getTriggerProps:Rt,getHeaderProps:Ot,getBodyProps:Me}}function nS(e,t){return e===t||e?.contains(t)}function NT(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function G4(e){const t=$i("Popover",e),{children:n,...r}=bn(e),i=F0(),o=Tue({...r,direction:i.direction});return _(Eue,{value:o,children:_(Pue,{value:t,children:Cue(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})})})}G4.displayName="Popover";function j4(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=yh(),a=vv(),s=t??n??r;return le.createElement(Ce.div,{...i(),className:"chakra-popover__arrow-positioner"},le.createElement(Ce.div,{className:mv("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}j4.displayName="PopoverArrow";var Lue=Ie(function(t,n){const{getBodyProps:r}=yh(),i=vv();return le.createElement(Ce.div,{...r(t,n),className:mv("chakra-popover__body",t.className),__css:i.body})});Lue.displayName="PopoverBody";var Aue=Ie(function(t,n){const{onClose:r}=yh(),i=vv();return _(B4,{size:"sm",onClick:r,className:mv("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});Aue.displayName="PopoverCloseButton";function Iue(e){if(!!e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var Mue={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]}}},Rue=is(Ce.section),f_=Ie(function(t,n){const{isOpen:r}=yh();return le.createElement(Rue,{ref:n,variants:Iue(t.variants),...t,initial:!1,animate:r?"enter":"exit"})});f_.defaultProps={variants:Mue};f_.displayName="PopoverTransition";var K4=Ie(function(t,n){const{rootProps:r,...i}=t,{getPopoverProps:o,getPopoverPositionerProps:a,onAnimationComplete:s}=yh(),l=vv(),d={position:"relative",display:"flex",flexDirection:"column",...l.content};return le.createElement(Ce.div,{...a(r),__css:l.popper,className:"chakra-popover__popper"},_(f_,{...o(i,n),onAnimationComplete:kue(s,i.onAnimationComplete),className:mv("chakra-popover__content",t.className),__css:d}))});K4.displayName="PopoverContent";var Fz=Ie(function(t,n){const{getHeaderProps:r}=yh(),i=vv();return le.createElement(Ce.header,{...r(t,n),className:mv("chakra-popover__header",t.className),__css:i.header})});Fz.displayName="PopoverHeader";function q4(e){const t=w.exports.Children.only(e.children),{getTriggerProps:n}=yh();return w.exports.cloneElement(t,n(t.props,t.ref))}q4.displayName="PopoverTrigger";function Oue(e,t,n){return(e-t)*100/(n-t)}iv({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});iv({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var Nue=iv({"0%":{left:"-40%"},"100%":{left:"100%"}}),Due=iv({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function zue(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a}=e,s=Oue(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,s):i})(),role:"progressbar"},percent:s,value:t}}var[Fue,$ue]=_n({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Bue=e=>{const{min:t,max:n,value:r,isIndeterminate:i,...o}=e,a=zue({value:r,min:t,max:n,isIndeterminate:i}),s=$ue(),l={height:"100%",...s.filledTrack};return le.createElement(Ce.div,{style:{width:`${a.percent}%`,...o.style},...a.bind,...o,__css:l})},$z=e=>{var t;const{value:n,min:r=0,max:i=100,hasStripe:o,isAnimated:a,children:s,borderRadius:l,isIndeterminate:d,"aria-label":p,"aria-labelledby":g,...m}=bn(e),y=$i("Progress",e),x=l??((t=y.track)==null?void 0:t.borderRadius),S={animation:`${Due} 1s linear infinite`},k={...!d&&o&&a&&S,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${Nue} 1s ease infinite normal none running`}},T={overflow:"hidden",position:"relative",...y.track};return le.createElement(Ce.div,{borderRadius:x,__css:T,...m},ae(Fue,{value:y,children:[_(Bue,{"aria-label":p,"aria-labelledby":g,min:r,max:i,value:n,isIndeterminate:d,css:k,borderRadius:x}),s]}))};$z.displayName="Progress";var Hue=Ce("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});Hue.displayName="CircularProgressLabel";var Wue=(...e)=>e.filter(Boolean).join(" "),Vue=e=>e?"":void 0;function Uue(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var Bz=Ie(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return le.createElement(Ce.select,{...a,ref:n,className:Wue("chakra-select",o)},i&&_("option",{value:"",children:i}),r)});Bz.displayName="SelectField";var Hz=Ie((e,t)=>{var n;const r=$i("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:d,minH:p,minHeight:g,iconColor:m,iconSize:y,...x}=bn(e),[S,E]=Uue(x,YZ),P=R8(E),k={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return le.createElement(Ce.div,{className:"chakra-select__wrapper",__css:k,...S,...i},_(Bz,{ref:t,height:d??l,minH:p??g,placeholder:o,...P,__css:T,children:e.children}),_(Wz,{"data-disabled":Vue(P.disabled),...(m||s)&&{color:m||s},__css:r.icon,...y&&{fontSize:y},children:a}))});Hz.displayName="Select";var Gue=e=>_("svg",{viewBox:"0 0 24 24",...e,children:_("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),jue=Ce("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Wz=e=>{const{children:t=_(Gue,{}),...n}=e,r=w.exports.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return _(jue,{...n,className:"chakra-select__icon-wrapper",children:w.exports.isValidElement(t)?r:null})};Wz.displayName="SelectIcon";function Kue(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function que(e){const t=Yue(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function Vz(e){return!!e.touches}function Zue(e){return Vz(e)&&e.touches.length>1}function Yue(e){return e.view??window}function Xue(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Que(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function Uz(e,t="page"){return Vz(e)?Xue(e,t):Que(e,t)}function Jue(e){return t=>{const n=que(t);(!n||n&&t.button===0)&&e(t)}}function ece(e,t=!1){function n(i){e(i,{point:Uz(i)})}return t?Jue(n):n}function Qy(e,t,n,r){return Kue(e,t,ece(n,t==="pointerdown"),r)}var tce=class{history=[];startEvent=null;lastEvent=null;lastEventInfo=null;handlers={};removeListeners=()=>{};threshold=3;win;constructor(e,t,n){if(this.win=e.view??window,Zue(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:Uz(e)},{timestamp:i}=HE();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o?.(e,rS(r,this.history)),this.removeListeners=ice(Qy(this.win,"pointermove",this.onPointerMove),Qy(this.win,"pointerup",this.onPointerUp),Qy(this.win,"pointercancel",this.onPointerUp))}updatePoint=()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=rS(this.lastEventInfo,this.history),t=this.startEvent!==null,n=oce(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=HE();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i?.(this.lastEvent,e),this.startEvent=this.lastEvent),o?.(this.lastEvent,e)};onPointerMove=(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,aX.update(this.updatePoint,!0)};onPointerUp=(e,t)=>{const n=rS(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i?.(e,n),this.end(),!(!r||!this.startEvent)&&r?.(e,n)};updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),sX.update(this.updatePoint)}};function DT(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rS(e,t){return{point:e.point,delta:DT(e.point,t[t.length-1]),offset:DT(e.point,t[0]),velocity:rce(t,.1)}}var nce=e=>e*1e3;function rce(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>nce(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;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 ice(...e){return t=>e.reduce((n,r)=>r(n),t)}function iS(e,t){return Math.abs(e-t)}function zT(e){return"x"in e&&"y"in e}function oce(e,t){if(typeof e=="number"&&typeof t=="number")return iS(e,t);if(zT(e)&&zT(t)){const n=iS(e.x,t.x),r=iS(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function Gz(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),d=w.exports.useRef(null),p={onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(m,y){d.current=null,i?.(m,y)}};w.exports.useEffect(()=>{var m;(m=d.current)==null||m.updateHandlers(p)});function g(m){d.current=new tce(m,p,s)}w.exports.useEffect(()=>{const m=e.current;if(!(!m||!l))return Qy(m,"pointerdown",g)},[l]),w.exports.useEffect(()=>()=>{var m;(m=d.current)==null||m.end(),d.current=null},[])}function ace(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(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,d=Array.isArray(l)?l[0]:l;a=d.inlineSize,s=d.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var sce=Boolean(globalThis?.document)?w.exports.useLayoutEffect:w.exports.useEffect;function lce(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function jz({getNodes:e,observeMutation:t=!0}){const[n,r]=w.exports.useState([]),[i,o]=w.exports.useState(0);return sce(()=>{const a=e(),s=a.map((l,d)=>ace(l,p=>{r(g=>[...g.slice(0,d),p,...g.slice(d+1)])}));if(t){const l=a[0];s.push(lce(l,()=>{o(d=>d+1)}))}return()=>{s.forEach(l=>{l?.()})}},[i]),n}function uce(e){return typeof e=="object"&&e!==null&&"current"in e}function cce(e){const[t]=jz({observeMutation:!1,getNodes(){return[uce(e)?e.current:e]}});return t}var dce=Object.create,Kz=Object.defineProperty,fce=Object.getOwnPropertyDescriptor,h_=Object.getOwnPropertyNames,hce=Object.getPrototypeOf,pce=Object.prototype.hasOwnProperty,gce=(e,t)=>function(){return e&&(t=(0,e[h_(e)[0]])(e=0)),t},mce=(e,t)=>function(){return t||(0,e[h_(e)[0]])((t={exports:{}}).exports,t),t.exports},vce=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of h_(t))!pce.call(e,i)&&i!==n&&Kz(e,i,{get:()=>t[i],enumerable:!(r=fce(t,i))||r.enumerable});return e},yce=(e,t,n)=>(n=e!=null?dce(hce(e)):{},vce(t||!e||!e.__esModule?Kz(n,"default",{value:e,enumerable:!0}):n,e)),Ds=gce({"../../../react-shim.js"(){}}),bce=mce({"../../../node_modules/.pnpm/lodash.mergewith@4.6.2/node_modules/lodash.mergewith/index.js"(e,t){Ds();var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",p="[object Boolean]",g="[object Date]",m="[object Error]",y="[object Function]",x="[object GeneratorFunction]",S="[object Map]",E="[object Number]",P="[object Null]",k="[object Object]",T="[object Proxy]",M="[object RegExp]",N="[object Set]",F="[object String]",z="[object Undefined]",B="[object WeakMap]",K="[object ArrayBuffer]",j="[object DataView]",X="[object Float32Array]",ue="[object Float64Array]",ge="[object Int8Array]",xe="[object Int16Array]",we="[object Int32Array]",Se="[object Uint8Array]",J="[object Uint8ClampedArray]",G="[object Uint16Array]",te="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,de={};de[X]=de[ue]=de[ge]=de[xe]=de[we]=de[Se]=de[J]=de[G]=de[te]=!0,de[s]=de[l]=de[K]=de[p]=de[j]=de[g]=de[m]=de[y]=de[S]=de[E]=de[k]=de[M]=de[N]=de[F]=de[B]=!1;var be=typeof global=="object"&&global&&global.Object===Object&&global,De=typeof self=="object"&&self&&self.Object===Object&&self,Re=be||De||Function("return this")(),Ve=typeof e=="object"&&e&&!e.nodeType&&e,ke=Ve&&typeof t=="object"&&t&&!t.nodeType&&t,$e=ke&&ke.exports===Ve,nt=$e&&be.process,ft=function(){try{var I=ke&&ke.require&&ke.require("util").types;return I||nt&&nt.binding&&nt.binding("util")}catch{}}(),Rt=ft&&ft.isTypedArray;function Ot(I,D,U){switch(U.length){case 0:return I.call(D);case 1:return I.call(D,U[0]);case 2:return I.call(D,U[0],U[1]);case 3:return I.call(D,U[0],U[1],U[2])}return I.apply(D,U)}function Me(I,D){for(var U=-1,me=Array(I);++U-1}function Md(I,D){var U=this.__data__,me=Hi(U,I);return me<0?(++this.size,U.push([I,D])):U[me][1]=D,this}or.prototype.clear=Ul,or.prototype.delete=Id,or.prototype.get=Bs,or.prototype.has=Gl,or.prototype.set=Md;function bi(I){var D=-1,U=I==null?0:I.length;for(this.clear();++D1?U[Ye-1]:void 0,Ke=Ye>2?U[2]:void 0;for(dt=I.length>3&&typeof dt=="function"?(Ye--,dt):void 0,Ke&&Qu(U[0],U[1],Ke)&&(dt=Ye<3?void 0:dt,Ye=1),D=Object(D);++me-1&&I%1==0&&I0){if(++D>=i)return arguments[0]}else D=0;return I.apply(void 0,arguments)}}function Us(I){if(I!=null){try{return nn.call(I)}catch{}try{return I+""}catch{}}return""}function Si(I,D){return I===D||I!==I&&D!==D}var us=Pa(function(){return arguments}())?Pa:function(I){return dn(I)&&zt.call(I,"callee")&&!Be.call(I,"callee")},Yo=Array.isArray;function At(I){return I!=null&&Xl(I.length)&&!Ra(I)}function Ju(I){return dn(I)&&At(I)}var cs=Qt||Gd;function Ra(I){if(!Ar(I))return!1;var D=eo(I);return D==y||D==x||D==d||D==T}function Xl(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=a}function Ar(I){var D=typeof I;return I!=null&&(D=="object"||D=="function")}function dn(I){return I!=null&&typeof I=="object"}function Ql(I){if(!dn(I)||eo(I)!=k)return!1;var D=Ge(I);if(D===null)return!0;var U=zt.call(D,"constructor")&&D.constructor;return typeof U=="function"&&U instanceof U&&nn.call(U)==Gt}var Jl=Rt?tt(Rt):Ws;function eu(I){return Lr(I,tu(I))}function tu(I){return At(I)?Wd(I,!0):Ta(I)}var rn=Zo(function(I,D,U,me){Wi(I,D,U,me)});function Nt(I){return function(){return I}}function nu(I){return I}function Gd(){return!1}t.exports=rn}});Ds();Ds();Ds();yce(bce());Ds();Ds();Ds();var Ka=e=>e?"":void 0,a0=e=>e?!0:void 0,Cd=(...e)=>e.filter(Boolean).join(" ");function s0(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}Object.freeze(["base","sm","md","lg","xl","2xl"]);Ds();Ds();function xce(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 yg(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Jy={width:0,height:0},X2=e=>e||Jy;function qz(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=S=>{const E=r[S]??Jy;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...yg({orientation:t,vertical:{bottom:`calc(${n[S]}% - ${E.height/2}px)`},horizontal:{left:`calc(${n[S]}% - ${E.width/2}px)`}})}},a=t==="vertical"?r.reduce((S,E)=>X2(S).height>X2(E).height?S:E,Jy):r.reduce((S,E)=>X2(S).width>X2(E).width?S:E,Jy),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...yg({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...yg({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},d=n.length===1,p=[0,i?100-n[0]:n[0]],g=d?p:n;let m=g[0];!d&&i&&(m=100-m);const y=Math.abs(g[g.length-1]-g[0]),x={...l,...yg({orientation:t,vertical:i?{height:`${y}%`,top:`${m}%`}:{height:`${y}%`,bottom:`${m}%`},horizontal:i?{width:`${y}%`,right:`${m}%`}:{width:`${y}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:x,rootStyle:s,getThumbStyle:o}}function Zz(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function Sce(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:d,isDisabled:p,isReadOnly:g,onChangeStart:m,onChangeEnd:y,step:x=1,getAriaValueText:S,"aria-valuetext":E,"aria-label":P,"aria-labelledby":k,name:T,focusThumbOnChange:M=!0,minStepsBetweenThumbs:N=0,...F}=e,z=kr(m),B=kr(y),K=kr(S),j=Zz({isReversed:a,direction:s,orientation:l}),[X,ue]=x4({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(X))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof X}\``);const[ge,xe]=w.exports.useState(!1),[we,Se]=w.exports.useState(!1),[J,G]=w.exports.useState(-1),te=!(p||g),Q=w.exports.useRef(X),W=X.map(Be=>n0(Be,t,n)),ie=N*x,de=wce(W,t,n,ie),be=w.exports.useRef({eventSource:null,value:[],valueBounds:[]});be.current.value=W,be.current.valueBounds=de;const De=W.map(Be=>n-Be+t),Ve=(j?De:W).map(Be=>l3(Be,t,n)),ke=l==="vertical",$e=w.exports.useRef(null),nt=w.exports.useRef(null),ft=jz({getNodes(){const Be=nt.current,ut=Be?.querySelectorAll("[role=slider]");return ut?Array.from(ut):[]}}),Rt=w.exports.useId(),Me=xce(d??Rt),tt=w.exports.useCallback(Be=>{var ut;if(!$e.current)return;be.current.eventSource="pointer";const je=$e.current.getBoundingClientRect(),{clientX:xt,clientY:Qt}=((ut=Be.touches)==null?void 0:ut[0])??Be,qn=ke?je.bottom-Qt:xt-je.left,yr=ke?je.height:je.width;let Hr=qn/yr;return j&&(Hr=1-Hr),uD(Hr,t,n)},[ke,j,n,t]),pt=(n-t)/10,at=x||(n-t)/100,gt=w.exports.useMemo(()=>({setValueAtIndex(Be,ut){if(!te)return;const je=be.current.valueBounds[Be];ut=parseFloat(E6(ut,je.min,at)),ut=n0(ut,je.min,je.max);const xt=[...be.current.value];xt[Be]=ut,ue(xt)},setActiveIndex:G,stepUp(Be,ut=at){const je=be.current.value[Be],xt=j?je-ut:je+ut;gt.setValueAtIndex(Be,xt)},stepDown(Be,ut=at){const je=be.current.value[Be],xt=j?je+ut:je-ut;gt.setValueAtIndex(Be,xt)},reset(){ue(Q.current)}}),[at,j,ue,te]),pn=w.exports.useCallback(Be=>{const ut=Be.key,xt={ArrowRight:()=>gt.stepUp(J),ArrowUp:()=>gt.stepUp(J),ArrowLeft:()=>gt.stepDown(J),ArrowDown:()=>gt.stepDown(J),PageUp:()=>gt.stepUp(J,pt),PageDown:()=>gt.stepDown(J,pt),Home:()=>{const{min:Qt}=de[J];gt.setValueAtIndex(J,Qt)},End:()=>{const{max:Qt}=de[J];gt.setValueAtIndex(J,Qt)}}[ut];xt&&(Be.preventDefault(),Be.stopPropagation(),xt(Be),be.current.eventSource="keyboard")},[gt,J,pt,de]),{getThumbStyle:mt,rootStyle:Ht,trackStyle:nn,innerTrackStyle:zt}=w.exports.useMemo(()=>qz({isReversed:j,orientation:l,thumbRects:ft,thumbPercents:Ve}),[j,l,Ve,ft]),Oe=w.exports.useCallback(Be=>{var ut;const je=Be??J;if(je!==-1&&M){const xt=Me.getThumb(je),Qt=(ut=nt.current)==null?void 0:ut.ownerDocument.getElementById(xt);Qt&&setTimeout(()=>Qt.focus())}},[M,J,Me]);w0(()=>{be.current.eventSource==="keyboard"&&B?.(be.current.value)},[W,B]);const et=Be=>{const ut=tt(Be)||0,je=be.current.value.map(Hr=>Math.abs(Hr-ut)),xt=Math.min(...je);let Qt=je.indexOf(xt);const qn=je.filter(Hr=>Hr===xt);qn.length>1&&ut>be.current.value[Qt]&&(Qt=Qt+qn.length-1),G(Qt),gt.setValueAtIndex(Qt,ut),Oe(Qt)},Gt=Be=>{if(J==-1)return;const ut=tt(Be)||0;G(J),gt.setValueAtIndex(J,ut),Oe(J)};Gz(nt,{onPanSessionStart(Be){!te||(xe(!0),et(Be),z?.(be.current.value))},onPanSessionEnd(){!te||(xe(!1),B?.(be.current.value))},onPan(Be){!te||Gt(Be)}});const Wt=w.exports.useCallback((Be={},ut=null)=>({...Be,...F,id:Me.root,ref:Fn(ut,nt),tabIndex:-1,"aria-disabled":a0(p),"data-focused":Ka(we),style:{...Be.style,...Ht}}),[F,p,we,Ht,Me]),Ee=w.exports.useCallback((Be={},ut=null)=>({...Be,ref:Fn(ut,$e),id:Me.track,"data-disabled":Ka(p),style:{...Be.style,...nn}}),[p,nn,Me]),kt=w.exports.useCallback((Be={},ut=null)=>({...Be,ref:ut,id:Me.innerTrack,style:{...Be.style,...zt}}),[zt,Me]),Xt=w.exports.useCallback((Be,ut=null)=>{const{index:je,...xt}=Be,Qt=W[je];if(Qt==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${je}\`. The \`value\` or \`defaultValue\` length is : ${W.length}`);const qn=de[je];return{...xt,ref:ut,role:"slider",tabIndex:te?0:void 0,id:Me.getThumb(je),"data-active":Ka(ge&&J===je),"aria-valuetext":K?.(Qt)??E?.[je],"aria-valuemin":qn.min,"aria-valuemax":qn.max,"aria-valuenow":Qt,"aria-orientation":l,"aria-disabled":a0(p),"aria-readonly":a0(g),"aria-label":P?.[je],"aria-labelledby":P?.[je]?void 0:k?.[je],style:{...Be.style,...mt(je)},onKeyDown:s0(Be.onKeyDown,pn),onFocus:s0(Be.onFocus,()=>{Se(!0),G(je)}),onBlur:s0(Be.onBlur,()=>{Se(!1),G(-1)})}},[Me,W,de,te,ge,J,K,E,l,p,g,P,k,mt,pn,Se]),Bn=w.exports.useCallback((Be={},ut=null)=>({...Be,ref:ut,id:Me.output,htmlFor:W.map((je,xt)=>Me.getThumb(xt)).join(" "),"aria-live":"off"}),[Me,W]),Ge=w.exports.useCallback((Be,ut=null)=>{const{value:je,...xt}=Be,Qt=!(jen),qn=je>=W[0]&&je<=W[W.length-1];let yr=l3(je,t,n);yr=j?100-yr:yr;const Hr={position:"absolute",pointerEvents:"none",...yg({orientation:l,vertical:{bottom:`${yr}%`},horizontal:{left:`${yr}%`}})};return{...xt,ref:ut,id:Me.getMarker(Be.value),role:"presentation","aria-hidden":!0,"data-disabled":Ka(p),"data-invalid":Ka(!Qt),"data-highlighted":Ka(qn),style:{...Be.style,...Hr}}},[p,j,n,t,l,W,Me]),Lt=w.exports.useCallback((Be,ut=null)=>{const{index:je,...xt}=Be;return{...xt,ref:ut,id:Me.getInput(je),type:"hidden",value:W[je],name:Array.isArray(T)?T[je]:`${T}-${je}`}},[T,W,Me]);return{state:{value:W,isFocused:we,isDragging:ge,getThumbPercent:Be=>Ve[Be],getThumbMinValue:Be=>de[Be].min,getThumbMaxValue:Be=>de[Be].max},actions:gt,getRootProps:Wt,getTrackProps:Ee,getInnerTrackProps:kt,getThumbProps:Xt,getMarkerProps:Ge,getInputProps:Lt,getOutputProps:Bn}}function wce(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[Cce,Z4]=_n({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[_ce,p_]=_n({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Yz=Ie(function(t,n){const r=$i("Slider",t),i=bn(t),{direction:o}=F0();i.direction=o;const{getRootProps:a,...s}=Sce(i),l=w.exports.useMemo(()=>({...s,name:t.name}),[s,t.name]);return le.createElement(Cce,{value:l},le.createElement(_ce,{value:r},le.createElement(Ce.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});Yz.defaultProps={orientation:"horizontal"};Yz.displayName="RangeSlider";var kce=Ie(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=Z4(),a=p_(),s=r(t,n);return le.createElement(Ce.div,{...s,className:Cd("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&_("input",{...i({index:t.index})}))});kce.displayName="RangeSliderThumb";var Ece=Ie(function(t,n){const{getTrackProps:r}=Z4(),i=p_(),o=r(t,n);return le.createElement(Ce.div,{...o,className:Cd("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});Ece.displayName="RangeSliderTrack";var Pce=Ie(function(t,n){const{getInnerTrackProps:r}=Z4(),i=p_(),o=r(t,n);return le.createElement(Ce.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});Pce.displayName="RangeSliderFilledTrack";var Tce=Ie(function(t,n){const{getMarkerProps:r}=Z4(),i=r(t,n);return le.createElement(Ce.div,{...i,className:Cd("chakra-slider__marker",t.className)})});Tce.displayName="RangeSliderMark";Ds();Ds();function Lce(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:d,isDisabled:p,isReadOnly:g,onChangeStart:m,onChangeEnd:y,step:x=1,getAriaValueText:S,"aria-valuetext":E,"aria-label":P,"aria-labelledby":k,name:T,focusThumbOnChange:M=!0,...N}=e,F=kr(m),z=kr(y),B=kr(S),K=Zz({isReversed:a,direction:s,orientation:l}),[j,X]=x4({value:i,defaultValue:o??Ice(t,n),onChange:r}),[ue,ge]=w.exports.useState(!1),[xe,we]=w.exports.useState(!1),Se=w.exports.useRef(null),J=!(p||g),G=n0(j,t,n),te=w.exports.useRef(-1);te.current=G;const Q=w.exports.useRef(te.current),W=n-G+t,de=l3(K?W:G,t,n),be=l==="vertical",De=w.exports.useRef(null),Re=w.exports.useRef(null),Ve=w.exports.useRef(null),ke=w.exports.useId(),$e=d??ke,[nt,ft]=[`slider-thumb-${$e}`,`slider-track-${$e}`],Rt=w.exports.useCallback(Ge=>{var Lt;if(!De.current)return;Se.current="pointer";const Be=De.current.getBoundingClientRect(),{clientX:ut,clientY:je}=((Lt=Ge.touches)==null?void 0:Lt[0])??Ge,xt=be?Be.bottom-je:ut-Be.left,Qt=be?Be.height:Be.width;let qn=xt/Qt;K&&(qn=1-qn);let yr=uD(qn,t,n);return x&&(yr=parseFloat(E6(yr,t,x))),yr=n0(yr,t,n),yr},[be,K,n,t,x]),Ot=(n-t)/10,Me=x||(n-t)/100,tt=w.exports.useCallback(Ge=>{!J||(Ge=parseFloat(E6(Ge,t,Me)),Ge=n0(Ge,t,n),X(Ge))},[Me,n,t,X,J]),pt=w.exports.useMemo(()=>({stepUp(Ge=Me){const Lt=K?G-Ge:G+Ge;tt(Lt)},stepDown(Ge=Me){const Lt=K?G+Ge:G-Ge;tt(Lt)},reset(){tt(o||0)},stepTo(Ge){tt(Ge)}}),[tt,K,G,Me,o]),at=w.exports.useCallback(Ge=>{const Be={ArrowRight:()=>pt.stepUp(),ArrowUp:()=>pt.stepUp(),ArrowLeft:()=>pt.stepDown(),ArrowDown:()=>pt.stepDown(),PageUp:()=>pt.stepUp(Ot),PageDown:()=>pt.stepDown(Ot),Home:()=>tt(t),End:()=>tt(n)}[Ge.key];Be&&(Ge.preventDefault(),Ge.stopPropagation(),Be(Ge),Se.current="keyboard")},[pt,tt,n,t,Ot]),gt=B?.(G)??E,pn=cce(Re),{getThumbStyle:mt,rootStyle:Ht,trackStyle:nn,innerTrackStyle:zt}=w.exports.useMemo(()=>qz({isReversed:K,orientation:l,thumbRects:[pn??{width:0,height:0}],thumbPercents:[de]}),[K,l,pn,de]),Oe=w.exports.useCallback(()=>{M&&setTimeout(()=>{var Ge;return(Ge=Re.current)==null?void 0:Ge.focus()})},[M]);w0(()=>{Oe(),Se.current==="keyboard"&&z?.(te.current)},[G,z]);function et(Ge){const Lt=Rt(Ge);Lt!=null&&Lt!==te.current&&X(Lt)}Gz(Ve,{onPanSessionStart(Ge){!J||(ge(!0),Oe(),et(Ge),F?.(te.current))},onPanSessionEnd(){!J||(ge(!1),z?.(te.current),Q.current=te.current)},onPan(Ge){!J||et(Ge)}});const Gt=w.exports.useCallback((Ge={},Lt=null)=>({...Ge,...N,ref:Fn(Lt,Ve),tabIndex:-1,"aria-disabled":a0(p),"data-focused":Ka(xe),style:{...Ge.style,...Ht}}),[N,p,xe,Ht]),Wt=w.exports.useCallback((Ge={},Lt=null)=>({...Ge,ref:Fn(Lt,De),id:ft,"data-disabled":Ka(p),style:{...Ge.style,...nn}}),[p,ft,nn]),Ee=w.exports.useCallback((Ge={},Lt=null)=>({...Ge,ref:Lt,style:{...Ge.style,...zt}}),[zt]),kt=w.exports.useCallback((Ge={},Lt=null)=>({...Ge,ref:Fn(Lt,Re),role:"slider",tabIndex:J?0:void 0,id:nt,"data-active":Ka(ue),"aria-valuetext":gt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":G,"aria-orientation":l,"aria-disabled":a0(p),"aria-readonly":a0(g),"aria-label":P,"aria-labelledby":P?void 0:k,style:{...Ge.style,...mt(0)},onKeyDown:s0(Ge.onKeyDown,at),onFocus:s0(Ge.onFocus,()=>we(!0)),onBlur:s0(Ge.onBlur,()=>we(!1))}),[J,nt,ue,gt,t,n,G,l,p,g,P,k,mt,at]),Xt=w.exports.useCallback((Ge,Lt=null)=>{const Be=!(Ge.valuen),ut=G>=Ge.value,je=l3(Ge.value,t,n),xt={position:"absolute",pointerEvents:"none",...Ace({orientation:l,vertical:{bottom:K?`${100-je}%`:`${je}%`},horizontal:{left:K?`${100-je}%`:`${je}%`}})};return{...Ge,ref:Lt,role:"presentation","aria-hidden":!0,"data-disabled":Ka(p),"data-invalid":Ka(!Be),"data-highlighted":Ka(ut),style:{...Ge.style,...xt}}},[p,K,n,t,l,G]),Bn=w.exports.useCallback((Ge={},Lt=null)=>({...Ge,ref:Lt,type:"hidden",value:G,name:T}),[T,G]);return{state:{value:G,isFocused:xe,isDragging:ue},actions:pt,getRootProps:Gt,getTrackProps:Wt,getInnerTrackProps:Ee,getThumbProps:kt,getMarkerProps:Xt,getInputProps:Bn}}function Ace(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function Ice(e,t){return t"}),[Rce,X4]=_n({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),g_=Ie((e,t)=>{const n=$i("Slider",e),r=bn(e),{direction:i}=F0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=Lce(r),l=a(),d=o({},t);return le.createElement(Mce,{value:s},le.createElement(Rce,{value:n},le.createElement(Ce.div,{...l,className:Cd("chakra-slider",e.className),__css:n.container},e.children,_("input",{...d}))))});g_.defaultProps={orientation:"horizontal"};g_.displayName="Slider";var Xz=Ie((e,t)=>{const{getThumbProps:n}=Y4(),r=X4(),i=n(e,t);return le.createElement(Ce.div,{...i,className:Cd("chakra-slider__thumb",e.className),__css:r.thumb})});Xz.displayName="SliderThumb";var Qz=Ie((e,t)=>{const{getTrackProps:n}=Y4(),r=X4(),i=n(e,t);return le.createElement(Ce.div,{...i,className:Cd("chakra-slider__track",e.className),__css:r.track})});Qz.displayName="SliderTrack";var Jz=Ie((e,t)=>{const{getInnerTrackProps:n}=Y4(),r=X4(),i=n(e,t);return le.createElement(Ce.div,{...i,className:Cd("chakra-slider__filled-track",e.className),__css:r.filledTrack})});Jz.displayName="SliderFilledTrack";var Oce=Ie((e,t)=>{const{getMarkerProps:n}=Y4(),r=X4(),i=n(e,t);return le.createElement(Ce.div,{...i,className:Cd("chakra-slider__marker",e.className),__css:r.mark})});Oce.displayName="SliderMark";var Nce=(...e)=>e.filter(Boolean).join(" "),FT=e=>e?"":void 0,m_=Ie(function(t,n){const r=$i("Switch",t),{spacing:i="0.5rem",children:o,...a}=bn(t),{state:s,getInputProps:l,getCheckboxProps:d,getRootProps:p,getLabelProps:g}=sD(a),m=w.exports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=w.exports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),x=w.exports.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return le.createElement(Ce.label,{...p(),className:Nce("chakra-switch",t.className),__css:m},_("input",{className:"chakra-switch__input",...l({},n)}),le.createElement(Ce.span,{...d(),className:"chakra-switch__track",__css:y},le.createElement(Ce.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":FT(s.isChecked),"data-hover":FT(s.isHovered)})),o&&le.createElement(Ce.span,{className:"chakra-switch__label",...g(),__css:x},o))});m_.displayName="Switch";var j0=(...e)=>e.filter(Boolean).join(" ");function B6(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var[Dce,eF,zce,Fce]=vO();function $ce(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...d}=e,[p,g]=w.exports.useState(t??0),[m,y]=x4({defaultValue:t??0,value:r,onChange:n});w.exports.useEffect(()=>{r!=null&&g(r)},[r]);const x=zce(),S=w.exports.useId();return{id:`tabs-${e.id??S}`,selectedIndex:m,focusedIndex:p,setSelectedIndex:y,setFocusedIndex:g,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:x,direction:l,htmlProps:d}}var[Bce,yv]=_n({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function Hce(e){const{focusedIndex:t,orientation:n,direction:r}=yv(),i=eF(),o=w.exports.useCallback(a=>{const s=()=>{var k;const T=i.nextEnabled(t);T&&((k=T.node)==null||k.focus())},l=()=>{var k;const T=i.prevEnabled(t);T&&((k=T.node)==null||k.focus())},d=()=>{var k;const T=i.firstEnabled();T&&((k=T.node)==null||k.focus())},p=()=>{var k;const T=i.lastEnabled();T&&((k=T.node)==null||k.focus())},g=n==="horizontal",m=n==="vertical",y=a.key,x=r==="ltr"?"ArrowLeft":"ArrowRight",S=r==="ltr"?"ArrowRight":"ArrowLeft",P={[x]:()=>g&&l(),[S]:()=>g&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:d,End:p}[y];P&&(a.preventDefault(),P(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:B6(e.onKeyDown,o)}}function Wce(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=yv(),{index:d,register:p}=Fce({disabled:t&&!n}),g=d===l,m=()=>{i(d)},y=()=>{s(d),!o&&!(t&&n)&&i(d)},x=Ioe({...r,ref:Fn(p,e.ref),isDisabled:t,isFocusable:n,onClick:B6(e.onClick,m)}),S="button";return{...x,id:tF(a,d),role:"tab",tabIndex:g?0:-1,type:S,"aria-selected":g,"aria-controls":nF(a,d),onFocus:t?void 0:B6(e.onFocus,y)}}var[Vce,Uce]=_n({});function Gce(e){const t=yv(),{id:n,selectedIndex:r}=t,o=z4(e.children).map((a,s)=>w.exports.createElement(Vce,{key:s,value:{isSelected:s===r,id:nF(n,s),tabId:tF(n,s),selectedIndex:r}},a));return{...e,children:o}}function jce(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=yv(),{isSelected:o,id:a,tabId:s}=Uce(),l=w.exports.useRef(!1);o&&(l.current=!0);const d=HD({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:d?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function Kce(){const e=yv(),t=eF(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.exports.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,d]=w.exports.useState(!1);return El(()=>{if(n==null)return;const p=t.item(n);if(p==null)return;i&&s({left:p.node.offsetLeft,width:p.node.offsetWidth}),o&&s({top:p.node.offsetTop,height:p.node.offsetHeight});const g=requestAnimationFrame(()=>{d(!0)});return()=>{g&&cancelAnimationFrame(g)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function tF(e,t){return`${e}--tab-${t}`}function nF(e,t){return`${e}--tabpanel-${t}`}var[qce,bv]=_n({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),rF=Ie(function(t,n){const r=$i("Tabs",t),{children:i,className:o,...a}=bn(t),{htmlProps:s,descendants:l,...d}=$ce(a),p=w.exports.useMemo(()=>d,[d]),{isFitted:g,...m}=s;return le.createElement(Dce,{value:l},le.createElement(Bce,{value:p},le.createElement(qce,{value:r},le.createElement(Ce.div,{className:j0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});rF.displayName="Tabs";var Zce=Ie(function(t,n){const r=Kce(),i={...t.style,...r},o=bv();return le.createElement(Ce.div,{ref:n,...t,className:j0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});Zce.displayName="TabIndicator";var Yce=Ie(function(t,n){const r=Hce({...t,ref:n}),i=bv(),o={display:"flex",...i.tablist};return le.createElement(Ce.div,{...r,className:j0("chakra-tabs__tablist",t.className),__css:o})});Yce.displayName="TabList";var iF=Ie(function(t,n){const r=jce({...t,ref:n}),i=bv();return le.createElement(Ce.div,{outline:"0",...r,className:j0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});iF.displayName="TabPanel";var oF=Ie(function(t,n){const r=Gce(t),i=bv();return le.createElement(Ce.div,{...r,width:"100%",ref:n,className:j0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});oF.displayName="TabPanels";var aF=Ie(function(t,n){const r=bv(),i=Wce({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return le.createElement(Ce.button,{...i,className:j0("chakra-tabs__tab",t.className),__css:o})});aF.displayName="Tab";var Xce=(...e)=>e.filter(Boolean).join(" ");function Qce(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Jce=["h","minH","height","minHeight"],sF=Ie((e,t)=>{const n=So("Textarea",e),{className:r,rows:i,...o}=bn(e),a=R8(o),s=i?Qce(n,Jce):n;return le.createElement(Ce.textarea,{ref:t,rows:i,...a,className:Xce("chakra-textarea",r),__css:s})});sF.displayName="Textarea";function Ln(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(...p){r();for(const g of p)t[g]=l(g);return Ln(e,t)}function o(...p){for(const g of p)g in t||(t[g]=l(g));return Ln(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([g,m])=>[g,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([g,m])=>[g,m.className]))}function l(p){const y=`chakra-${(["container","root"].includes(p??"")?[e]:[e,p]).filter(Boolean).join("__")}`;return{className:y,selector:`.${y}`,toString:()=>p}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var ede=Ln("accordion").parts("root","container","button","panel").extend("icon"),tde=Ln("alert").parts("title","description","container").extend("icon","spinner"),nde=Ln("avatar").parts("label","badge","container").extend("excessLabel","group"),rde=Ln("breadcrumb").parts("link","item","container").extend("separator");Ln("button").parts();var ide=Ln("checkbox").parts("control","icon","container").extend("label");Ln("progress").parts("track","filledTrack").extend("label");var ode=Ln("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),ade=Ln("editable").parts("preview","input","textarea"),sde=Ln("form").parts("container","requiredIndicator","helperText"),lde=Ln("formError").parts("text","icon"),ude=Ln("input").parts("addon","field","element"),cde=Ln("list").parts("container","item","icon"),dde=Ln("menu").parts("button","list","item").extend("groupTitle","command","divider"),fde=Ln("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),hde=Ln("numberinput").parts("root","field","stepperGroup","stepper");Ln("pininput").parts("field");var pde=Ln("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),gde=Ln("progress").parts("label","filledTrack","track"),mde=Ln("radio").parts("container","control","label"),vde=Ln("select").parts("field","icon"),yde=Ln("slider").parts("container","track","thumb","filledTrack","mark"),bde=Ln("stat").parts("container","label","helpText","number","icon"),xde=Ln("switch").parts("container","track","thumb"),Sde=Ln("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),wde=Ln("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),Cde=Ln("tag").parts("container","label","closeButton");function zi(e,t){_de(e)&&(e="100%");var n=kde(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Q2(e){return Math.min(1,Math.max(0,e))}function _de(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function kde(e){return typeof e=="string"&&e.indexOf("%")!==-1}function lF(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function J2(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Kf(e){return e.length===1?"0"+e:String(e)}function Ede(e,t,n){return{r:zi(e,255)*255,g:zi(t,255)*255,b:zi(n,255)*255}}function $T(e,t,n){e=zi(e,255),t=zi(t,255),n=zi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(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 Pde(e,t,n){var r,i,o;if(e=zi(e,360),t=zi(t,100),n=zi(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=oS(s,a,e+1/3),i=oS(s,a,e),o=oS(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function BT(e,t,n){e=zi(e,255),t=zi(t,255),n=zi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var H6={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Mde(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=Nde(e)),typeof e=="object"&&(yu(e.r)&&yu(e.g)&&yu(e.b)?(t=Ede(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):yu(e.h)&&yu(e.s)&&yu(e.v)?(r=J2(e.s),i=J2(e.v),t=Tde(e.h,r,i),a=!0,s="hsv"):yu(e.h)&&yu(e.s)&&yu(e.l)&&(r=J2(e.s),o=J2(e.l),t=Pde(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=lF(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Rde="[-\\+]?\\d+%?",Ode="[-\\+]?\\d*\\.\\d+%?",Yc="(?:".concat(Ode,")|(?:").concat(Rde,")"),aS="[\\s|\\(]+(".concat(Yc,")[,|\\s]+(").concat(Yc,")[,|\\s]+(").concat(Yc,")\\s*\\)?"),sS="[\\s|\\(]+(".concat(Yc,")[,|\\s]+(").concat(Yc,")[,|\\s]+(").concat(Yc,")[,|\\s]+(").concat(Yc,")\\s*\\)?"),Es={CSS_UNIT:new RegExp(Yc),rgb:new RegExp("rgb"+aS),rgba:new RegExp("rgba"+sS),hsl:new RegExp("hsl"+aS),hsla:new RegExp("hsla"+sS),hsv:new RegExp("hsv"+aS),hsva:new RegExp("hsva"+sS),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Nde(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(H6[e])e=H6[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Es.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Es.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Es.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Es.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Es.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Es.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Es.hex8.exec(e),n?{r:da(n[1]),g:da(n[2]),b:da(n[3]),a:WT(n[4]),format:t?"name":"hex8"}:(n=Es.hex6.exec(e),n?{r:da(n[1]),g:da(n[2]),b:da(n[3]),format:t?"name":"hex"}:(n=Es.hex4.exec(e),n?{r:da(n[1]+n[1]),g:da(n[2]+n[2]),b:da(n[3]+n[3]),a:WT(n[4]+n[4]),format:t?"name":"hex8"}:(n=Es.hex3.exec(e),n?{r:da(n[1]+n[1]),g:da(n[2]+n[2]),b:da(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function yu(e){return Boolean(Es.CSS_UNIT.exec(String(e)))}var xv=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=Ide(t)),this.originalInput=t;var i=Mde(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=lF(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=BT(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=BT(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=$T(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=$T(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),HT(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Lde(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(zi(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(zi(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+HT(this.r,this.g,this.b,!1),n=0,r=Object.entries(H6);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Q2(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Q2(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Q2(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Q2(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(uF(e));return e.count=t,n}var r=Dde(e.hue,e.seed),i=zde(r,e),o=Fde(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new xv(a)}function Dde(e,t){var n=Bde(e),r=p3(n,t);return r<0&&(r=360+r),r}function zde(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return p3([0,100],t.seed);var n=cF(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return p3([r,i],t.seed)}function Fde(e,t,n){var r=$de(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return p3([r,i],n.seed)}function $de(e,t){for(var n=cF(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),d=o-l*i;return l*t+d}}return 0}function Bde(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=fF.find(function(a){return a.name===e});if(n){var r=dF(n);if(r.hueRange)return r.hueRange}var i=new xv(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function cF(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=fF;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function p3(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function dF(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var fF=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function Hde(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ri=(e,t,n)=>{const r=Hde(e,`colors.${t}`,t),{isValid:i}=new xv(r);return i?r:n},Vde=e=>t=>{const n=ri(t,e);return new xv(n).isDark()?"dark":"light"},Ude=e=>t=>Vde(e)(t)==="dark",L0=(e,t)=>n=>{const r=ri(n,e);return new xv(r).setAlpha(t).toRgbString()};function VT(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}`}}function Gde(e){const t=uF().toHexString();return!e||Wde(e)?t:e.string&&e.colors?Kde(e.string,e.colors):e.string&&!e.colors?jde(e.string):e.colors&&!e.string?qde(e.colors):t}function jde(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255).toString(16)}`.substr(-2);return n}function Kde(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function v_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Zde(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function hF(e){return Zde(e)&&e.reference?e.reference:String(e)}var Q4=(e,...t)=>t.map(hF).join(` ${e} `).replace(/calc/g,""),UT=(...e)=>`calc(${Q4("+",...e)})`,GT=(...e)=>`calc(${Q4("-",...e)})`,W6=(...e)=>`calc(${Q4("*",...e)})`,jT=(...e)=>`calc(${Q4("/",...e)})`,KT=e=>{const t=hF(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:W6(t,-1)},_u=Object.assign(e=>({add:(...t)=>_u(UT(e,...t)),subtract:(...t)=>_u(GT(e,...t)),multiply:(...t)=>_u(W6(e,...t)),divide:(...t)=>_u(jT(e,...t)),negate:()=>_u(KT(e)),toString:()=>e.toString()}),{add:UT,subtract:GT,multiply:W6,divide:jT,negate:KT});function Yde(e){return!Number.isInteger(parseFloat(e.toString()))}function Xde(e,t="-"){return e.replace(/\s+/g,t)}function pF(e){const t=Xde(e.toString());return t.includes("\\.")?e:Yde(e)?t.replace(".","\\."):e}function Qde(e,t=""){return[t,pF(e)].filter(Boolean).join("-")}function Jde(e,t){return`var(${pF(e)}${t?`, ${t}`:""})`}function efe(e,t=""){return`--${Qde(e,t)}`}function jo(e,t){const n=efe(e,t?.prefix);return{variable:n,reference:Jde(n,tfe(t?.fallback))}}function tfe(e){return typeof e=="string"?e:e?.reference}var{definePartsStyle:nfe,defineMultiStyleConfig:rfe}=ir(ede.keys),ife={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},ofe={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},afe={pt:"2",px:"4",pb:"5"},sfe={fontSize:"1.25em"},lfe=nfe({container:ife,button:ofe,panel:afe,icon:sfe}),ufe=rfe({baseStyle:lfe}),{definePartsStyle:Sv,defineMultiStyleConfig:cfe}=ir(tde.keys),Nu=xd("alert-fg"),wv=xd("alert-bg"),dfe=Sv({container:{bg:wv.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Nu.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Nu.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function y_(e){const{theme:t,colorScheme:n}=e,r=ri(t,`${n}.100`,n),i=L0(`${n}.200`,.16)(t);return Te(r,i)(e)}var ffe=Sv(e=>{const{colorScheme:t}=e,n=Te(`${t}.500`,`${t}.200`)(e);return{container:{[wv.variable]:y_(e),[Nu.variable]:`colors.${n}`}}}),hfe=Sv(e=>{const{colorScheme:t}=e,n=Te(`${t}.500`,`${t}.200`)(e);return{container:{[wv.variable]:y_(e),[Nu.variable]:`colors.${n}`,paddingStart:"3",borderStartWidth:"4px",borderStartColor:Nu.reference}}}),pfe=Sv(e=>{const{colorScheme:t}=e,n=Te(`${t}.500`,`${t}.200`)(e);return{container:{[wv.variable]:y_(e),[Nu.variable]:`colors.${n}`,pt:"2",borderTopWidth:"4px",borderTopColor:Nu.reference}}}),gfe=Sv(e=>{const{colorScheme:t}=e,n=Te(`${t}.500`,`${t}.200`)(e),r=Te("white","gray.900")(e);return{container:{[wv.variable]:`colors.${n}`,[Nu.variable]:`colors.${r}`,color:Nu.reference}}}),mfe={subtle:ffe,"left-accent":hfe,"top-accent":pfe,solid:gfe},vfe=cfe({baseStyle:dfe,variants:mfe,defaultProps:{variant:"subtle",colorScheme:"blue"}}),gF={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"},yfe={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"},bfe={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},xfe={...gF,...yfe,container:bfe},mF=xfe,Sfe=e=>typeof e=="function";function Br(e,...t){return Sfe(e)?e(...t):e}var{definePartsStyle:vF,defineMultiStyleConfig:wfe}=ir(nde.keys),Cfe=e=>({borderRadius:"full",border:"0.2em solid",borderColor:Te("white","gray.800")(e)}),_fe=e=>({bg:Te("gray.200","whiteAlpha.400")(e)}),kfe=e=>{const{name:t,theme:n}=e,r=t?Gde({string:t}):"gray.400",i=Ude(r)(n);let o="white";i||(o="gray.800");const a=Te("white","gray.800")(e);return{bg:r,color:o,borderColor:a,verticalAlign:"top"}},Efe=vF(e=>({badge:Br(Cfe,e),excessLabel:Br(_fe,e),container:Br(kfe,e)}));function Rc(e){const t=e!=="100%"?mF[e]:void 0;return vF({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var Pfe={"2xs":Rc(4),xs:Rc(6),sm:Rc(8),md:Rc(12),lg:Rc(16),xl:Rc(24),"2xl":Rc(32),full:Rc("100%")},Tfe=wfe({baseStyle:Efe,sizes:Pfe,defaultProps:{size:"md"}}),Lfe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},Afe=e=>{const{colorScheme:t,theme:n}=e,r=L0(`${t}.500`,.6)(n);return{bg:Te(`${t}.500`,r)(e),color:Te("white","whiteAlpha.800")(e)}},Ife=e=>{const{colorScheme:t,theme:n}=e,r=L0(`${t}.200`,.16)(n);return{bg:Te(`${t}.100`,r)(e),color:Te(`${t}.800`,`${t}.200`)(e)}},Mfe=e=>{const{colorScheme:t,theme:n}=e,r=L0(`${t}.200`,.8)(n),i=ri(n,`${t}.500`),o=Te(i,r)(e);return{color:o,boxShadow:`inset 0 0 0px 1px ${o}`}},Rfe={solid:Afe,subtle:Ife,outline:Mfe},Yg={baseStyle:Lfe,variants:Rfe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:Ofe,definePartsStyle:Nfe}=ir(rde.keys),Dfe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},zfe=Nfe({link:Dfe}),Ffe=Ofe({baseStyle:zfe}),$fe={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"}}},yF=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Te("inherit","whiteAlpha.900")(e),_hover:{bg:Te("gray.100","whiteAlpha.200")(e)},_active:{bg:Te("gray.200","whiteAlpha.300")(e)}};const r=L0(`${t}.200`,.12)(n),i=L0(`${t}.200`,.24)(n);return{color:Te(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Te(`${t}.50`,r)(e)},_active:{bg:Te(`${t}.100`,i)(e)}}},Bfe=e=>{const{colorScheme:t}=e,n=Te("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...Br(yF,e)}},Hfe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Wfe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Te("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Te("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Te("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=Hfe[t]??{},a=Te(n,`${t}.200`)(e);return{bg:a,color:Te(r,"gray.800")(e),_hover:{bg:Te(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Te(o,`${t}.400`)(e)}}},Vfe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Te(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Te(`${t}.700`,`${t}.500`)(e)}}},Ufe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Gfe={ghost:yF,outline:Bfe,solid:Wfe,link:Vfe,unstyled:Ufe},jfe={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"}},Kfe={baseStyle:$fe,variants:Gfe,sizes:jfe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:e5,defineMultiStyleConfig:qfe}=ir(ide.keys),Xg=xd("checkbox-size"),Zfe=e=>{const{colorScheme:t}=e;return{w:Xg.reference,h:Xg.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Te(`${t}.500`,`${t}.200`)(e),borderColor:Te(`${t}.500`,`${t}.200`)(e),color:Te("white","gray.900")(e),_hover:{bg:Te(`${t}.600`,`${t}.300`)(e),borderColor:Te(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Te("gray.200","transparent")(e),bg:Te("gray.200","whiteAlpha.300")(e),color:Te("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Te(`${t}.500`,`${t}.200`)(e),borderColor:Te(`${t}.500`,`${t}.200`)(e),color:Te("white","gray.900")(e)},_disabled:{bg:Te("gray.100","whiteAlpha.100")(e),borderColor:Te("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Te("red.500","red.300")(e)}}},Yfe={_disabled:{cursor:"not-allowed"}},Xfe={userSelect:"none",_disabled:{opacity:.4}},Qfe={transitionProperty:"transform",transitionDuration:"normal"},Jfe=e5(e=>({icon:Qfe,container:Yfe,control:Br(Zfe,e),label:Xfe})),ehe={sm:e5({control:{[Xg.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:e5({control:{[Xg.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:e5({control:{[Xg.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},g3=qfe({baseStyle:Jfe,sizes:ehe,defaultProps:{size:"md",colorScheme:"blue"}}),Qg=jo("close-button-size"),the=e=>{const t=Te("blackAlpha.100","whiteAlpha.100")(e),n=Te("blackAlpha.200","whiteAlpha.200")(e);return{w:[Qg.reference],h:[Qg.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{bg:t},_active:{bg:n},_focusVisible:{boxShadow:"outline"}}},nhe={lg:{[Qg.variable]:"sizes.10",fontSize:"md"},md:{[Qg.variable]:"sizes.8",fontSize:"xs"},sm:{[Qg.variable]:"sizes.6",fontSize:"2xs"}},rhe={baseStyle:the,sizes:nhe,defaultProps:{size:"md"}},{variants:ihe,defaultProps:ohe}=Yg,ahe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},she={baseStyle:ahe,variants:ihe,defaultProps:ohe},lhe={w:"100%",mx:"auto",maxW:"prose",px:"4"},uhe={baseStyle:lhe},che={opacity:.6,borderColor:"inherit"},dhe={borderStyle:"solid"},fhe={borderStyle:"dashed"},hhe={solid:dhe,dashed:fhe},phe={baseStyle:che,variants:hhe,defaultProps:{variant:"solid"}},{definePartsStyle:V6,defineMultiStyleConfig:ghe}=ir(ode.keys);function bp(e){return V6(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var mhe={bg:"blackAlpha.600",zIndex:"overlay"},vhe={display:"flex",zIndex:"modal",justifyContent:"center"},yhe=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",bg:Te("white","gray.700")(e),color:"inherit",boxShadow:Te("lg","dark-lg")(e)}},bhe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},xhe={position:"absolute",top:"2",insetEnd:"3"},She={px:"6",py:"2",flex:"1",overflow:"auto"},whe={px:"6",py:"4"},Che=V6(e=>({overlay:mhe,dialogContainer:vhe,dialog:Br(yhe,e),header:bhe,closeButton:xhe,body:She,footer:whe})),_he={xs:bp("xs"),sm:bp("md"),md:bp("lg"),lg:bp("2xl"),xl:bp("4xl"),full:bp("full")},khe=ghe({baseStyle:Che,sizes:_he,defaultProps:{size:"xs"}}),{definePartsStyle:Ehe,defineMultiStyleConfig:Phe}=ir(ade.keys),The={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},Lhe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},Ahe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},Ihe=Ehe({preview:The,input:Lhe,textarea:Ahe}),Mhe=Phe({baseStyle:Ihe}),{definePartsStyle:Rhe,defineMultiStyleConfig:Ohe}=ir(sde.keys),Nhe=e=>({marginStart:"1",color:Te("red.500","red.300")(e)}),Dhe=e=>({mt:"2",color:Te("gray.600","whiteAlpha.600")(e),lineHeight:"normal",fontSize:"sm"}),zhe=Rhe(e=>({container:{width:"100%",position:"relative"},requiredIndicator:Br(Nhe,e),helperText:Br(Dhe,e)})),Fhe=Ohe({baseStyle:zhe}),{definePartsStyle:$he,defineMultiStyleConfig:Bhe}=ir(lde.keys),Hhe=e=>({color:Te("red.500","red.300")(e),mt:"2",fontSize:"sm",lineHeight:"normal"}),Whe=e=>({marginEnd:"0.5em",color:Te("red.500","red.300")(e)}),Vhe=$he(e=>({text:Br(Hhe,e),icon:Br(Whe,e)})),Uhe=Bhe({baseStyle:Vhe}),Ghe={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},jhe={baseStyle:Ghe},Khe={fontFamily:"heading",fontWeight:"bold"},qhe={"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}},Zhe={baseStyle:Khe,sizes:qhe,defaultProps:{size:"xl"}},{definePartsStyle:Pu,defineMultiStyleConfig:Yhe}=ir(ude.keys),Xhe=Pu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Oc={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Qhe={lg:Pu({field:Oc.lg,addon:Oc.lg}),md:Pu({field:Oc.md,addon:Oc.md}),sm:Pu({field:Oc.sm,addon:Oc.sm}),xs:Pu({field:Oc.xs,addon:Oc.xs})};function b_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Te("blue.500","blue.300")(e),errorBorderColor:n||Te("red.500","red.300")(e)}}var Jhe=Pu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=b_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Te("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ri(t,r),boxShadow:`0 0 0 1px ${ri(t,r)}`},_focusVisible:{zIndex:1,borderColor:ri(t,n),boxShadow:`0 0 0 1px ${ri(t,n)}`}},addon:{border:"1px solid",borderColor:Te("inherit","whiteAlpha.50")(e),bg:Te("gray.100","whiteAlpha.300")(e)}}}),epe=Pu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=b_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Te("gray.100","whiteAlpha.50")(e),_hover:{bg:Te("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ri(t,r)},_focusVisible:{bg:"transparent",borderColor:ri(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Te("gray.100","whiteAlpha.50")(e)}}}),tpe=Pu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=b_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ri(t,r),boxShadow:`0px 1px 0px 0px ${ri(t,r)}`},_focusVisible:{borderColor:ri(t,n),boxShadow:`0px 1px 0px 0px ${ri(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),npe=Pu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),rpe={outline:Jhe,filled:epe,flushed:tpe,unstyled:npe},yn=Yhe({baseStyle:Xhe,sizes:Qhe,variants:rpe,defaultProps:{size:"md",variant:"outline"}}),ipe=e=>({bg:Te("gray.100","whiteAlpha")(e),borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"}),ope={baseStyle:ipe},ape={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},spe={baseStyle:ape},{defineMultiStyleConfig:lpe,definePartsStyle:upe}=ir(cde.keys),cpe={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},dpe=upe({icon:cpe}),fpe=lpe({baseStyle:dpe}),{defineMultiStyleConfig:hpe,definePartsStyle:ppe}=ir(dde.keys),gpe=e=>({bg:Te("#fff","gray.700")(e),boxShadow:Te("sm","dark-lg")(e),color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px"}),mpe=e=>({py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{bg:Te("gray.100","whiteAlpha.100")(e)},_active:{bg:Te("gray.200","whiteAlpha.200")(e)},_expanded:{bg:Te("gray.100","whiteAlpha.100")(e)},_disabled:{opacity:.4,cursor:"not-allowed"}}),vpe={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},ype={opacity:.6},bpe={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},xpe={transitionProperty:"common",transitionDuration:"normal"},Spe=ppe(e=>({button:xpe,list:Br(gpe,e),item:Br(mpe,e),groupTitle:vpe,command:ype,divider:bpe})),wpe=hpe({baseStyle:Spe}),{defineMultiStyleConfig:Cpe,definePartsStyle:U6}=ir(fde.keys),_pe={bg:"blackAlpha.600",zIndex:"modal"},kpe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},Epe=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Te("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Te("lg","dark-lg")(e)}},Ppe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Tpe={position:"absolute",top:"2",insetEnd:"3"},Lpe=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},Ape={px:"6",py:"4"},Ipe=U6(e=>({overlay:_pe,dialogContainer:Br(kpe,e),dialog:Br(Epe,e),header:Ppe,closeButton:Tpe,body:Br(Lpe,e),footer:Ape}));function ks(e){return U6(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var Mpe={xs:ks("xs"),sm:ks("sm"),md:ks("md"),lg:ks("lg"),xl:ks("xl"),"2xl":ks("2xl"),"3xl":ks("3xl"),"4xl":ks("4xl"),"5xl":ks("5xl"),"6xl":ks("6xl"),full:ks("full")},Rpe=Cpe({baseStyle:Ipe,sizes:Mpe,defaultProps:{size:"md"}}),Ope={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"}},bF=Ope,{defineMultiStyleConfig:Npe,definePartsStyle:xF}=ir(hde.keys),x_=jo("number-input-stepper-width"),SF=jo("number-input-input-padding"),Dpe=_u(x_).add("0.5rem").toString(),zpe={[x_.variable]:"sizes.6",[SF.variable]:Dpe},Fpe=e=>{var t;return((t=Br(yn.baseStyle,e))==null?void 0:t.field)??{}},$pe={width:[x_.reference]},Bpe=e=>({borderStart:"1px solid",borderStartColor:Te("inherit","whiteAlpha.300")(e),color:Te("inherit","whiteAlpha.800")(e),_active:{bg:Te("gray.200","whiteAlpha.300")(e)},_disabled:{opacity:.4,cursor:"not-allowed"}}),Hpe=xF(e=>({root:zpe,field:Fpe,stepperGroup:$pe,stepper:Br(Bpe,e)??{}}));function ey(e){var t,n;const r=(t=yn.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=bF.fontSizes[o];return xF({field:{...r.field,paddingInlineEnd:SF.reference,verticalAlign:"top"},stepper:{fontSize:_u(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var Wpe={xs:ey("xs"),sm:ey("sm"),md:ey("md"),lg:ey("lg")},Vpe=Npe({baseStyle:Hpe,sizes:Wpe,variants:yn.variants,defaultProps:yn.defaultProps}),qT,Upe={...(qT=yn.baseStyle)==null?void 0:qT.field,textAlign:"center"},Gpe={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"}},ZT,jpe={outline:e=>{var t,n;return((n=Br((t=yn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=Br((t=yn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=Br((t=yn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((ZT=yn.variants)==null?void 0:ZT.unstyled.field)??{}},Kpe={baseStyle:Upe,sizes:Gpe,variants:jpe,defaultProps:yn.defaultProps},{defineMultiStyleConfig:qpe,definePartsStyle:Zpe}=ir(pde.keys),lS=jo("popper-bg"),Ype=jo("popper-arrow-bg"),Xpe=jo("popper-arrow-shadow-color"),Qpe={zIndex:10},Jpe=e=>{const t=Te("white","gray.700")(e),n=Te("gray.200","whiteAlpha.300")(e);return{[lS.variable]:`colors.${t}`,bg:lS.reference,[Ype.variable]:lS.reference,[Xpe.variable]:`colors.${n}`,width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}}},e0e={px:3,py:2,borderBottomWidth:"1px"},t0e={px:3,py:2},n0e={px:3,py:2,borderTopWidth:"1px"},r0e={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},i0e=Zpe(e=>({popper:Qpe,content:Jpe(e),header:e0e,body:t0e,footer:n0e,closeButton:r0e})),o0e=qpe({baseStyle:i0e}),{defineMultiStyleConfig:a0e,definePartsStyle:bg}=ir(gde.keys),s0e=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Te(VT(),VT("1rem","rgba(0,0,0,0.1)"))(e),a=Te(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + to right, + transparent 0%, + ${ri(n,a)} 50%, + transparent 100% + )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},l0e={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},u0e=e=>({bg:Te("gray.100","whiteAlpha.300")(e)}),c0e=e=>({transitionProperty:"common",transitionDuration:"slow",...s0e(e)}),d0e=bg(e=>({label:l0e,filledTrack:c0e(e),track:u0e(e)})),f0e={xs:bg({track:{h:"1"}}),sm:bg({track:{h:"2"}}),md:bg({track:{h:"3"}}),lg:bg({track:{h:"4"}})},h0e=a0e({sizes:f0e,baseStyle:d0e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:p0e,definePartsStyle:t5}=ir(mde.keys),g0e=e=>{var t;const n=(t=Br(g3.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n?._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},m0e=t5(e=>{var t,n,r,i;return{label:(n=(t=g3).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=g3).baseStyle)==null?void 0:i.call(r,e).container,control:g0e(e)}}),v0e={md:t5({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:t5({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:t5({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},y0e=p0e({baseStyle:m0e,sizes:v0e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:b0e,definePartsStyle:x0e}=ir(vde.keys),S0e=e=>{var t;return{...(t=yn.baseStyle)==null?void 0:t.field,bg:Te("white","gray.700")(e),appearance:"none",paddingBottom:"1px",lineHeight:"normal","> option, > optgroup":{bg:Te("white","gray.700")(e)}}},w0e={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},C0e=x0e(e=>({field:S0e(e),icon:w0e})),ty={paddingInlineEnd:"8"},YT,XT,QT,JT,eL,tL,nL,rL,_0e={lg:{...(YT=yn.sizes)==null?void 0:YT.lg,field:{...(XT=yn.sizes)==null?void 0:XT.lg.field,...ty}},md:{...(QT=yn.sizes)==null?void 0:QT.md,field:{...(JT=yn.sizes)==null?void 0:JT.md.field,...ty}},sm:{...(eL=yn.sizes)==null?void 0:eL.sm,field:{...(tL=yn.sizes)==null?void 0:tL.sm.field,...ty}},xs:{...(nL=yn.sizes)==null?void 0:nL.xs,field:{...(rL=yn.sizes)==null?void 0:rL.sm.field,...ty},icon:{insetEnd:"1"}}},k0e=b0e({baseStyle:C0e,sizes:_0e,variants:yn.variants,defaultProps:yn.defaultProps}),E0e=xd("skeleton-start-color"),P0e=xd("skeleton-end-color"),T0e=e=>{const t=Te("gray.100","gray.800")(e),n=Te("gray.400","gray.600")(e),{startColor:r=t,endColor:i=n,theme:o}=e,a=ri(o,r),s=ri(o,i);return{[E0e.variable]:a,[P0e.variable]:s,opacity:.7,borderRadius:"2px",borderColor:a,background:s}},L0e={baseStyle:T0e},A0e=e=>({borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",bg:Te("white","gray.700")(e)}}),I0e={baseStyle:A0e},{defineMultiStyleConfig:M0e,definePartsStyle:J4}=ir(yde.keys),Wm=xd("slider-thumb-size"),Vm=xd("slider-track-size"),R0e=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...v_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},O0e=e=>({...v_({orientation:e.orientation,horizontal:{h:Vm.reference},vertical:{w:Vm.reference}}),overflow:"hidden",borderRadius:"sm",bg:Te("gray.200","whiteAlpha.200")(e),_disabled:{bg:Te("gray.300","whiteAlpha.300")(e)}}),N0e=e=>{const{orientation:t}=e;return{...v_({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:Wm.reference,h:Wm.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"}}},D0e=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",bg:Te(`${t}.500`,`${t}.200`)(e)}},z0e=J4(e=>({container:R0e(e),track:O0e(e),thumb:N0e(e),filledTrack:D0e(e)})),F0e=J4({container:{[Wm.variable]:"sizes.4",[Vm.variable]:"sizes.1"}}),$0e=J4({container:{[Wm.variable]:"sizes.3.5",[Vm.variable]:"sizes.1"}}),B0e=J4({container:{[Wm.variable]:"sizes.2.5",[Vm.variable]:"sizes.0.5"}}),H0e={lg:F0e,md:$0e,sm:B0e},W0e=M0e({baseStyle:z0e,sizes:H0e,defaultProps:{size:"md",colorScheme:"blue"}}),Nf=jo("spinner-size"),V0e={width:[Nf.reference],height:[Nf.reference]},U0e={xs:{[Nf.variable]:"sizes.3"},sm:{[Nf.variable]:"sizes.4"},md:{[Nf.variable]:"sizes.6"},lg:{[Nf.variable]:"sizes.8"},xl:{[Nf.variable]:"sizes.12"}},G0e={baseStyle:V0e,sizes:U0e,defaultProps:{size:"md"}},{defineMultiStyleConfig:j0e,definePartsStyle:wF}=ir(bde.keys),K0e={fontWeight:"medium"},q0e={opacity:.8,marginBottom:"2"},Z0e={verticalAlign:"baseline",fontWeight:"semibold"},Y0e={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},X0e=wF({container:{},label:K0e,helpText:q0e,number:Z0e,icon:Y0e}),Q0e={md:wF({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},J0e=j0e({baseStyle:X0e,sizes:Q0e,defaultProps:{size:"md"}}),{defineMultiStyleConfig:e1e,definePartsStyle:n5}=ir(xde.keys),Jg=jo("switch-track-width"),eh=jo("switch-track-height"),uS=jo("switch-track-diff"),t1e=_u.subtract(Jg,eh),G6=jo("switch-thumb-x"),n1e=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Jg.reference],height:[eh.reference],transitionProperty:"common",transitionDuration:"fast",bg:Te("gray.300","whiteAlpha.400")(e),_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{bg:Te(`${t}.500`,`${t}.200`)(e)}}},r1e={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[eh.reference],height:[eh.reference],_checked:{transform:`translateX(${G6.reference})`}},i1e=n5(e=>({container:{[uS.variable]:t1e,[G6.variable]:uS.reference,_rtl:{[G6.variable]:_u(uS).negate().toString()}},track:n1e(e),thumb:r1e})),o1e={sm:n5({container:{[Jg.variable]:"1.375rem",[eh.variable]:"sizes.3"}}),md:n5({container:{[Jg.variable]:"1.875rem",[eh.variable]:"sizes.4"}}),lg:n5({container:{[Jg.variable]:"2.875rem",[eh.variable]:"sizes.6"}})},a1e=e1e({baseStyle:i1e,sizes:o1e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:s1e,definePartsStyle:l0}=ir(Sde.keys),l1e=l0({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"}}),m3={"&[data-is-numeric=true]":{textAlign:"end"}},u1e=l0(e=>{const{colorScheme:t}=e;return{th:{color:Te("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Te(`${t}.100`,`${t}.700`)(e),...m3},td:{borderBottom:"1px",borderColor:Te(`${t}.100`,`${t}.700`)(e),...m3},caption:{color:Te("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),c1e=l0(e=>{const{colorScheme:t}=e;return{th:{color:Te("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Te(`${t}.100`,`${t}.700`)(e),...m3},td:{borderBottom:"1px",borderColor:Te(`${t}.100`,`${t}.700`)(e),...m3},caption:{color:Te("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Te(`${t}.100`,`${t}.700`)(e)},td:{background:Te(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),d1e={simple:u1e,striped:c1e,unstyled:{}},f1e={sm:l0({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:l0({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:l0({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},h1e=s1e({baseStyle:l1e,variants:d1e,sizes:f1e,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),{defineMultiStyleConfig:p1e,definePartsStyle:Il}=ir(wde.keys),g1e=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},m1e=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}}},v1e=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},y1e={p:4},b1e=Il(e=>({root:g1e(e),tab:m1e(e),tablist:v1e(e),tabpanel:y1e})),x1e={sm:Il({tab:{py:1,px:4,fontSize:"sm"}}),md:Il({tab:{fontSize:"md",py:2,px:4}}),lg:Il({tab:{fontSize:"lg",py:3,px:4}})},S1e=Il(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{color:Te(`${t}.600`,`${t}.300`)(e),borderColor:"currentColor"},_active:{bg:Te("gray.200","whiteAlpha.300")(e)},_disabled:{_active:{bg:"none"}}}}}),w1e=Il(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",_selected:{color:Te(`${t}.600`,`${t}.300`)(e),borderColor:"inherit",borderBottomColor:Te("white","gray.800")(e)}},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),C1e=Il(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",bg:Te("gray.50","whiteAlpha.50")(e),mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{bg:Te("#fff","gray.800")(e),color:Te(`${t}.600`,`${t}.300`)(e),borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"}},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),_1e=Il(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ri(n,`${t}.700`),bg:ri(n,`${t}.100`)}}}}),k1e=Il(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:Te("gray.600","inherit")(e),_selected:{color:Te("#fff","gray.800")(e),bg:Te(`${t}.600`,`${t}.300`)(e)}}}}),E1e=Il({}),P1e={line:S1e,enclosed:w1e,"enclosed-colored":C1e,"soft-rounded":_1e,"solid-rounded":k1e,unstyled:E1e},T1e=p1e({baseStyle:b1e,sizes:x1e,variants:P1e,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:L1e,definePartsStyle:th}=ir(Cde.keys),A1e={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},I1e={lineHeight:1.2,overflow:"visible"},M1e={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}},R1e=th({container:A1e,label:I1e,closeButton:M1e}),O1e={sm:th({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:th({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:th({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},N1e={subtle:th(e=>{var t;return{container:(t=Yg.variants)==null?void 0:t.subtle(e)}}),solid:th(e=>{var t;return{container:(t=Yg.variants)==null?void 0:t.solid(e)}}),outline:th(e=>{var t;return{container:(t=Yg.variants)==null?void 0:t.outline(e)}})},D1e=L1e({variants:N1e,baseStyle:R1e,sizes:O1e,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),iL,z1e={...(iL=yn.baseStyle)==null?void 0:iL.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},oL,F1e={outline:e=>{var t;return((t=yn.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=yn.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=yn.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((oL=yn.variants)==null?void 0:oL.unstyled.field)??{}},aL,sL,lL,uL,$1e={xs:((aL=yn.sizes)==null?void 0:aL.xs.field)??{},sm:((sL=yn.sizes)==null?void 0:sL.sm.field)??{},md:((lL=yn.sizes)==null?void 0:lL.md.field)??{},lg:((uL=yn.sizes)==null?void 0:uL.lg.field)??{}},B1e={baseStyle:z1e,sizes:$1e,variants:F1e,defaultProps:{size:"md",variant:"outline"}},cS=jo("tooltip-bg"),cL=jo("tooltip-fg"),H1e=jo("popper-arrow-bg"),W1e=e=>{const t=Te("gray.700","gray.300")(e),n=Te("whiteAlpha.900","gray.900")(e);return{bg:cS.reference,color:cL.reference,[cS.variable]:`colors.${t}`,[cL.variable]:`colors.${n}`,[H1e.variable]:cS.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"}},V1e={baseStyle:W1e},U1e={Accordion:ufe,Alert:vfe,Avatar:Tfe,Badge:Yg,Breadcrumb:Ffe,Button:Kfe,Checkbox:g3,CloseButton:rhe,Code:she,Container:uhe,Divider:phe,Drawer:khe,Editable:Mhe,Form:Fhe,FormError:Uhe,FormLabel:jhe,Heading:Zhe,Input:yn,Kbd:ope,Link:spe,List:fpe,Menu:wpe,Modal:Rpe,NumberInput:Vpe,PinInput:Kpe,Popover:o0e,Progress:h0e,Radio:y0e,Select:k0e,Skeleton:L0e,SkipLink:I0e,Slider:W0e,Spinner:G0e,Stat:J0e,Switch:a1e,Table:h1e,Tabs:T1e,Tag:D1e,Textarea:B1e,Tooltip:V1e},G1e={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},j1e=G1e,K1e={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},q1e=K1e,Z1e={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"}},Y1e=Z1e,X1e={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Q1e=X1e,J1e={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"},ege=J1e,tge={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"},nge={"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)"},rge={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},ige={property:tge,easing:nge,duration:rge},oge=ige,age={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},sge=age,lge={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},uge=lge,cge={breakpoints:q1e,zIndices:sge,radii:Q1e,blur:uge,colors:Y1e,...bF,sizes:mF,shadows:ege,space:gF,borders:j1e,transition:oge},dge={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-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},fge={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",wordWrap:"break-word"}}};function hge(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var pge=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function gge(e){return hge(e)?pge.every(t=>Object.prototype.hasOwnProperty.call(e,t)):!1}var mge="ltr",vge={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},CF={semanticTokens:dge,direction:mge,...cge,components:U1e,styles:fge,config:vge};function yge(e,t){const n=kr(e);w.exports.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function j6(e,...t){return bge(e)?e(...t):e}var bge=e=>typeof e=="function";function xge(e,t){const n=e??"bottom",i={"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"}}[n];return i?.[t]??n}var Sge=(e,t)=>e.find(n=>n.id===t);function dL(e,t){const n=_F(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function _F(e,t){for(const[n,r]of Object.entries(e))if(Sge(r,t))return n}function wge(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 Cge(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:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var _ge={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},wl=kge(_ge);function kge(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=Ege(i,o),{position:s,id:l}=a;return r(d=>{const g=s.includes("top")?[a,...d[s]??[]]:[...d[s]??[],a];return{...d,[s]:g}}),l},update:(i,o)=>{!i||r(a=>{const s={...a},{position:l,index:d}=dL(s,i);return l&&d!==-1&&(s[l][d]={...s[l][d],...o,message:kF(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,d)=>(l[d]=o[d].map(p=>({...p,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=_F(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(dL(wl.getState(),i).position)}}var fL=0;function Ege(e,t={}){fL+=1;const n=t.id??fL,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>wl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Pge=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,d=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return le.createElement(YN,{addRole:!1,status:t,variant:n,id:d?.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},_(QN,{children:l}),le.createElement(Ce.div,{flex:"1",maxWidth:"100%"},i&&_(JN,{id:d?.title,children:i}),s&&_(XN,{id:d?.description,display:"block",children:s})),o&&_(B4,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function kF(e={}){const{render:t,toastComponent:n=Pge}=e;return i=>typeof t=="function"?t(i):_(n,{...i,...e})}function Tge(e,t){const n=i=>({...t,...i,position:xge(i?.position??t?.position,e)}),r=i=>{const o=n(i),a=kF(o);return wl.notify(a,o)};return r.update=(i,o)=>{wl.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,...j6(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...j6(o.error,s)}))},r.closeAll=wl.closeAll,r.close=wl.close,r.isActive=wl.isActive,r}function Wu(e){const{theme:t}=pO();return w.exports.useMemo(()=>Tge(t.direction,e),[e,t.direction])}var Lge={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]}}},EF=w.exports.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:d=Lge,toastSpacing:p="0.5rem"}=e,[g,m]=w.exports.useState(s),y=Qee();w0(()=>{y||r?.()},[y]),w0(()=>{m(s)},[s]);const x=()=>m(null),S=()=>m(s),E=()=>{y&&i()};w.exports.useEffect(()=>{y&&o&&i()},[y,o,i]),yge(E,g);const P=w.exports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:p,...l}),[l,p]),k=w.exports.useMemo(()=>wge(a),[a]);return le.createElement(is.li,{layout:!0,className:"chakra-toast",variants:d,initial:"initial",animate:"animate",exit:"exit",onHoverStart:x,onHoverEnd:S,custom:{position:a},style:k},le.createElement(Ce.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:P},j6(n,{id:t,onClose:E})))});EF.displayName="ToastComponent";var Age=e=>{const t=w.exports.useSyncExternalStore(wl.subscribe,wl.getState,wl.getState),{children:n,motionVariants:r,component:i=EF,portalProps:o}=e,s=Object.keys(t).map(l=>{const d=t[l];return _("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${l}`,style:Cge(l),children:_(Hu,{initial:!1,children:d.map(p=>_(i,{motionVariants:r,...p},p.id))})},l)});return ae(jn,{children:[n,_(gh,{...o,children:s})]})};function Ige(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Mge(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Rge={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]}}}};function rg(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}var K6=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},q6=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function Oge(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnEsc:o=!0,onOpen:a,onClose:s,placement:l,id:d,isOpen:p,defaultIsOpen:g,arrowSize:m=10,arrowShadowColor:y,arrowPadding:x,modifiers:S,isDisabled:E,gutter:P,offset:k,direction:T,...M}=e,{isOpen:N,onOpen:F,onClose:z}=BD({isOpen:p,defaultIsOpen:g,onOpen:a,onClose:s}),{referenceRef:B,getPopperProps:K,getArrowInnerProps:j,getArrowProps:X}=$D({enabled:N,placement:l,arrowPadding:x,modifiers:S,gutter:P,offset:k,direction:T}),ue=w.exports.useId(),xe=`tooltip-${d??ue}`,we=w.exports.useRef(null),Se=w.exports.useRef(),J=w.exports.useRef(),G=w.exports.useCallback(()=>{J.current&&(clearTimeout(J.current),J.current=void 0),z()},[z]),te=Nge(we,G),Q=w.exports.useCallback(()=>{if(!E&&!Se.current){te();const ke=q6(we);Se.current=ke.setTimeout(F,t)}},[te,E,F,t]),W=w.exports.useCallback(()=>{Se.current&&(clearTimeout(Se.current),Se.current=void 0);const ke=q6(we);J.current=ke.setTimeout(G,n)},[n,G]),ie=w.exports.useCallback(()=>{N&&r&&W()},[r,W,N]),de=w.exports.useCallback(()=>{N&&i&&W()},[i,W,N]),be=w.exports.useCallback(ke=>{N&&ke.key==="Escape"&&W()},[N,W]);P6(()=>K6(we),"keydown",o?be:void 0),w.exports.useEffect(()=>()=>{clearTimeout(Se.current),clearTimeout(J.current)},[]),P6(()=>we.current,"mouseleave",W);const De=w.exports.useCallback((ke={},$e=null)=>({...ke,ref:Fn(we,$e,B),onMouseEnter:rg(ke.onMouseEnter,Q),onClick:rg(ke.onClick,ie),onMouseDown:rg(ke.onMouseDown,de),onFocus:rg(ke.onFocus,Q),onBlur:rg(ke.onBlur,W),"aria-describedby":N?xe:void 0}),[Q,W,de,N,xe,ie,B]),Re=w.exports.useCallback((ke={},$e=null)=>K({...ke,style:{...ke.style,[qr.arrowSize.var]:m?`${m}px`:void 0,[qr.arrowShadowColor.var]:y}},$e),[K,m,y]),Ve=w.exports.useCallback((ke={},$e=null)=>{const nt={...ke.style,position:"relative",transformOrigin:qr.transformOrigin.varRef};return{ref:$e,...M,...ke,id:xe,role:"tooltip",style:nt}},[M,xe]);return{isOpen:N,show:Q,hide:W,getTriggerProps:De,getTooltipProps:Ve,getTooltipPositionerProps:Re,getArrowProps:X,getArrowInnerProps:j}}var dS="chakra-ui:close-tooltip";function Nge(e,t){return w.exports.useEffect(()=>{const n=K6(e);return n.addEventListener(dS,t),()=>n.removeEventListener(dS,t)},[t,e]),()=>{const n=K6(e),r=q6(e);n.dispatchEvent(new r.CustomEvent(dS))}}var Dge=Ce(is.div),mi=Ie((e,t)=>{const n=So("Tooltip",e),r=bn(e),i=F0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:d,bg:p,portalProps:g,background:m,backgroundColor:y,bgColor:x,...S}=r,E=m??y??p??x;if(E){n.bg=E;const B=lY(i,"colors",E);n[qr.arrowBg.var]=B}const P=Oge({...S,direction:i.direction}),k=typeof o=="string"||s;let T;if(k)T=le.createElement(Ce.span,{tabIndex:0,...P.getTriggerProps()},o);else{const B=w.exports.Children.only(o);T=w.exports.cloneElement(B,P.getTriggerProps(B.props,B.ref))}const M=!!l,N=P.getTooltipProps({},t),F=M?Ige(N,["role","id"]):N,z=Mge(N,["role","id"]);return a?ae(jn,{children:[T,_(Hu,{children:P.isOpen&&le.createElement(gh,{...g},le.createElement(Ce.div,{...P.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},ae(Dge,{variants:Rge,...F,initial:"exit",animate:"enter",exit:"exit",__css:n,children:[a,M&&le.createElement(Ce.span,{srOnly:!0,...z},l),d&&le.createElement(Ce.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},le.createElement(Ce.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))]})))})]}):_(jn,{children:o})});mi.displayName="Tooltip";var zge=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=_(TD,{environment:a,children:t});return _(dQ,{theme:o,cssVarsRoot:s,children:ae(LR,{colorModeManager:n,options:o.config,children:[i?_($ie,{}):_(Fie,{}),_(hQ,{}),r?_(WD,{zIndex:r,children:l}):l]})})};function Fge({children:e,theme:t=CF,toastOptions:n,...r}){return ae(zge,{theme:t,...r,children:[e,_(Age,{...n})]})}function $ge(...e){let t=[...e],n=e[e.length-1];return gge(n)&&t.length>1?t=t.slice(0,t.length-1):n=CF,AX(...t.map(r=>i=>Bp(r)?r(i):Bge(i,r)))(n)}function Bge(...e){return cd({},...e,PF)}function PF(e,t,n,r){if((Bp(e)||Bp(t))&&Object.prototype.hasOwnProperty.call(r,n))return(...i)=>{const o=Bp(e)?e(...i):e,a=Bp(t)?t(...i):t;return cd({},o,a,PF)}}function Is(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:S_(e)?2:w_(e)?3:0}function u0(e,t){return K0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Hge(e,t){return K0(e)===2?e.get(t):e[t]}function TF(e,t,n){var r=K0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function LF(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function S_(e){return Kge&&e instanceof Map}function w_(e){return qge&&e instanceof Set}function Af(e){return e.o||e.t}function C_(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=IF(e);delete t[nr];for(var n=c0(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=Wge),Object.freeze(e),t&&lh(e,function(n,r){return __(r,!0)},!0)),e}function Wge(){Is(2)}function k_(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ml(e){var t=Q6[e];return t||Is(18,e),t}function Vge(e,t){Q6[e]||(Q6[e]=t)}function Z6(){return Um}function fS(e,t){t&&(Ml("Patches"),e.u=[],e.s=[],e.v=t)}function v3(e){Y6(e),e.p.forEach(Uge),e.p=null}function Y6(e){e===Um&&(Um=e.l)}function hL(e){return Um={p:[],l:Um,h:e,m:!0,_:0}}function Uge(e){var t=e[nr];t.i===0||t.i===1?t.j():t.O=!0}function hS(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Ml("ES5").S(t,e,r),r?(n[nr].P&&(v3(t),Is(4)),Du(e)&&(e=y3(t,e),t.l||b3(t,e)),t.u&&Ml("Patches").M(n[nr].t,e,t.u,t.s)):e=y3(t,n,[]),v3(t),t.u&&t.v(t.u,t.s),e!==AF?e:void 0}function y3(e,t,n){if(k_(t))return t;var r=t[nr];if(!r)return lh(t,function(o,a){return pL(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return b3(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=C_(r.k):r.o;lh(r.i===3?new Set(i):i,function(o,a){return pL(e,r,i,o,a,n)}),b3(e,i,!1),n&&e.u&&Ml("Patches").R(r,n,e.u,e.s)}return r.o}function pL(e,t,n,r,i,o){if(hd(i)){var a=y3(e,i,o&&t&&t.i!==3&&!u0(t.D,r)?o.concat(r):void 0);if(TF(n,r,a),!hd(a))return;e.m=!1}if(Du(i)&&!k_(i)){if(!e.h.F&&e._<1)return;y3(e,i),t&&t.A.l||b3(e,i)}}function b3(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&__(t,n)}function pS(e,t){var n=e[nr];return(n?Af(n):e)[t]}function gL(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 Uc(e){e.P||(e.P=!0,e.l&&Uc(e.l))}function gS(e){e.o||(e.o=C_(e.t))}function X6(e,t,n){var r=S_(t)?Ml("MapSet").N(t,n):w_(t)?Ml("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:Z6(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,d=Gm;a&&(l=[s],d=xg);var p=Proxy.revocable(l,d),g=p.revoke,m=p.proxy;return s.k=m,s.j=g,m}(t,n):Ml("ES5").J(t,n);return(n?n.A:Z6()).p.push(r),r}function Gge(e){return hd(e)||Is(22,e),function t(n){if(!Du(n))return n;var r,i=n[nr],o=K0(n);if(i){if(!i.P&&(i.i<4||!Ml("ES5").K(i)))return i.t;i.I=!0,r=mL(n,o),i.I=!1}else r=mL(n,o);return lh(r,function(a,s){i&&Hge(i.t,a)===s||TF(r,a,t(s))}),o===3?new Set(r):r}(e)}function mL(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return C_(e)}function jge(){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[nr];return Gm.get(l,o)},set:function(l){var d=this[nr];Gm.set(d,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][nr];if(!s.P)switch(s.i){case 5:r(s)&&Uc(s);break;case 4:n(s)&&Uc(s)}}}function n(o){for(var a=o.t,s=o.k,l=c0(s),d=l.length-1;d>=0;d--){var p=l[d];if(p!==nr){var g=a[p];if(g===void 0&&!u0(a,p))return!0;var m=s[p],y=m&&m[nr];if(y?y.t!==g:!LF(m,g))return!0}}var x=!!a[nr];return l.length!==c0(a).length+(x?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;l1?P-1:0),T=1;T1?p-1:0),m=1;m=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=Ml("Patches").$;return hd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Sa=new Yge,MF=Sa.produce;Sa.produceWithPatches.bind(Sa);Sa.setAutoFreeze.bind(Sa);Sa.setUseProxies.bind(Sa);Sa.applyPatches.bind(Sa);Sa.createDraft.bind(Sa);Sa.finishDraft.bind(Sa);function Xge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xL(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 SL(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Zi(1));return n(P_)(e,t)}if(typeof e!="function")throw new Error(Zi(2));var i=e,o=t,a=[],s=a,l=!1;function d(){s===a&&(s=a.slice())}function p(){if(l)throw new Error(Zi(3));return o}function g(S){if(typeof S!="function")throw new Error(Zi(4));if(l)throw new Error(Zi(5));var E=!0;return d(),s.push(S),function(){if(!!E){if(l)throw new Error(Zi(6));E=!1,d();var k=s.indexOf(S);s.splice(k,1),a=null}}}function m(S){if(!Qge(S))throw new Error(Zi(7));if(typeof S.type>"u")throw new Error(Zi(8));if(l)throw new Error(Zi(9));try{l=!0,o=i(o,S)}finally{l=!1}for(var E=a=s,P=0;P"u")throw new Error(Zi(12));if(typeof n(void 0,{type:x3.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Zi(13))})}function RF(e){for(var t=Object.keys(e),n={},r=0;r"u")throw d&&d.type,new Error(Zi(14));g[y]=E,p=p||E!==S}return p=p||o.length!==Object.keys(l).length,p?g:l}}function S3(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var d=n[l];return l>0&&(n.splice(l,1),n.unshift(d)),d.value}return w3}function i(s,l){r(s)===w3&&(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 rme=function(t,n){return t===n};function ime(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ame:Lme;FF.useSyncExternalStore=A0.useSyncExternalStore!==void 0?A0.useSyncExternalStore:Ime;(function(e){e.exports=FF})(zF);var $F={exports:{}},BF={};/** + * @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 tb=w.exports,Mme=zF.exports;function Rme(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ome=typeof Object.is=="function"?Object.is:Rme,Nme=Mme.useSyncExternalStore,Dme=tb.useRef,zme=tb.useEffect,Fme=tb.useMemo,$me=tb.useDebugValue;BF.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Dme(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Fme(function(){function l(y){if(!d){if(d=!0,p=y,y=r(y),i!==void 0&&a.hasValue){var x=a.value;if(i(x,y))return g=x}return g=y}if(x=g,Ome(p,y))return x;var S=r(y);return i!==void 0&&i(x,S)?x:(p=y,g=S)}var d=!1,p,g,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=Nme(e,o[0],o[1]);return zme(function(){a.hasValue=!0,a.value=s},[s]),$me(s),s};(function(e){e.exports=BF})($F);function Bme(e){e()}let HF=Bme;const Hme=e=>HF=e,Wme=()=>HF,pd=le.createContext(null);function WF(){return w.exports.useContext(pd)}const Vme=()=>{throw new Error("uSES not initialized!")};let VF=Vme;const Ume=e=>{VF=e},Gme=(e,t)=>e===t;function jme(e=pd){const t=e===pd?WF:()=>w.exports.useContext(e);return function(r,i=Gme){const{store:o,subscription:a,getServerState:s}=t(),l=VF(a.addNestedSub,o.getState,s||o.getState,r,i);return w.exports.useDebugValue(l),l}}const Kme=jme();var qme={exports:{}},In={};/** + * @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 L_=Symbol.for("react.element"),A_=Symbol.for("react.portal"),nb=Symbol.for("react.fragment"),rb=Symbol.for("react.strict_mode"),ib=Symbol.for("react.profiler"),ob=Symbol.for("react.provider"),ab=Symbol.for("react.context"),Zme=Symbol.for("react.server_context"),sb=Symbol.for("react.forward_ref"),lb=Symbol.for("react.suspense"),ub=Symbol.for("react.suspense_list"),cb=Symbol.for("react.memo"),db=Symbol.for("react.lazy"),Yme=Symbol.for("react.offscreen"),UF;UF=Symbol.for("react.module.reference");function as(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case L_:switch(e=e.type,e){case nb:case ib:case rb:case lb:case ub:return e;default:switch(e=e&&e.$$typeof,e){case Zme:case ab:case sb:case db:case cb:case ob:return e;default:return t}}case A_:return t}}}In.ContextConsumer=ab;In.ContextProvider=ob;In.Element=L_;In.ForwardRef=sb;In.Fragment=nb;In.Lazy=db;In.Memo=cb;In.Portal=A_;In.Profiler=ib;In.StrictMode=rb;In.Suspense=lb;In.SuspenseList=ub;In.isAsyncMode=function(){return!1};In.isConcurrentMode=function(){return!1};In.isContextConsumer=function(e){return as(e)===ab};In.isContextProvider=function(e){return as(e)===ob};In.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===L_};In.isForwardRef=function(e){return as(e)===sb};In.isFragment=function(e){return as(e)===nb};In.isLazy=function(e){return as(e)===db};In.isMemo=function(e){return as(e)===cb};In.isPortal=function(e){return as(e)===A_};In.isProfiler=function(e){return as(e)===ib};In.isStrictMode=function(e){return as(e)===rb};In.isSuspense=function(e){return as(e)===lb};In.isSuspenseList=function(e){return as(e)===ub};In.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===nb||e===ib||e===rb||e===lb||e===ub||e===Yme||typeof e=="object"&&e!==null&&(e.$$typeof===db||e.$$typeof===cb||e.$$typeof===ob||e.$$typeof===ab||e.$$typeof===sb||e.$$typeof===UF||e.getModuleId!==void 0)};In.typeOf=as;(function(e){e.exports=In})(qme);function Xme(){const e=Wme();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 EL={notify(){},get:()=>[]};function Qme(e,t){let n,r=EL;function i(g){return l(),r.subscribe(g)}function o(){r.notify()}function a(){p.onStateChange&&p.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=Xme())}function d(){n&&(n(),n=void 0,r.clear(),r=EL)}const p={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:d,getListeners:()=>r};return p}const Jme=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eve=Jme?w.exports.useLayoutEffect:w.exports.useEffect;function tve({store:e,context:t,children:n,serverState:r}){const i=w.exports.useMemo(()=>{const s=Qme(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.exports.useMemo(()=>e.getState(),[e]);return eve(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]),_((t||pd).Provider,{value:i,children:n})}function GF(e=pd){const t=e===pd?WF:()=>w.exports.useContext(e);return function(){const{store:r}=t();return r}}const nve=GF();function rve(e=pd){const t=e===pd?nve:GF(e);return function(){return t().dispatch}}const ive=rve();Ume($F.exports.useSyncExternalStoreWithSelector);Hme($l.exports.unstable_batchedUpdates);var I_="persist:",jF="persist/FLUSH",M_="persist/REHYDRATE",KF="persist/PAUSE",qF="persist/PERSIST",ZF="persist/PURGE",YF="persist/REGISTER",ove=-1;function r5(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r5=function(n){return typeof n}:r5=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},r5(e)}function PL(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 ave(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function vve(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var yve=5e3;function i5(e,t){var n=e.version!==void 0?e.version:ove;e.debug;var r=e.stateReconciler===void 0?lve:e.stateReconciler,i=e.getStoredState||dve,o=e.timeout!==void 0?e.timeout:yve,a=null,s=!1,l=!0,d=function(g){return g._persist.rehydrated&&a&&!l&&a.update(g),g};return function(p,g){var m=p||{},y=m._persist,x=mve(m,["_persist"]),S=x;if(g.type===qF){var E=!1,P=function(B,K){E||(g.rehydrate(e.key,B,K),E=!0)};if(o&&setTimeout(function(){!E&&P(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=uve(e)),y)return bu({},t(S,g),{_persist:y});if(typeof g.rehydrate!="function"||typeof g.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return g.register(e.key),i(e).then(function(z){var B=e.migrate||function(K,j){return Promise.resolve(K)};B(z,n).then(function(K){P(K)},function(K){P(void 0,K)})},function(z){P(void 0,z)}),bu({},t(S,g),{_persist:{version:n,rehydrated:!1}})}else{if(g.type===ZF)return s=!0,g.result(hve(e)),bu({},t(S,g),{_persist:y});if(g.type===jF)return g.result(a&&a.flush()),bu({},t(S,g),{_persist:y});if(g.type===KF)l=!0;else if(g.type===M_){if(s)return bu({},S,{_persist:bu({},y,{rehydrated:!0})});if(g.key===e.key){var k=t(S,g),T=g.payload,M=r!==!1&&T!==void 0?r(T,p,k,e):k,N=bu({},M,{_persist:bu({},y,{rehydrated:!0})});return d(N)}}}if(!y)return t(p,g);var F=t(S,g);return F===S?p:d(bu({},F,{_persist:y}))}}function LL(e){return Sve(e)||xve(e)||bve()}function bve(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function xve(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Sve(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:XF,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case YF:return eC({},t,{registry:[].concat(LL(t.registry),[n.key])});case M_:var r=t.registry.indexOf(n.key),i=LL(t.registry);return i.splice(r,1),eC({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function _ve(e,t,n){var r=n||!1,i=P_(Cve,XF,t&&t.enhancer?t.enhancer:void 0),o=function(d){i.dispatch({type:YF,key:d})},a=function(d,p,g){var m={type:M_,payload:p,err:g,key:d};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=eC({},i,{purge:function(){var d=[];return e.dispatch({type:ZF,result:function(g){d.push(g)}}),Promise.all(d)},flush:function(){var d=[];return e.dispatch({type:jF,result:function(g){d.push(g)}}),Promise.all(d)},pause:function(){e.dispatch({type:KF})},persist:function(){e.dispatch({type:qF,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var R_={},O_={};O_.__esModule=!0;O_.default=Pve;function o5(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o5=function(n){return typeof n}:o5=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},o5(e)}function yS(){}var kve={getItem:yS,setItem:yS,removeItem:yS};function Eve(e){if((typeof self>"u"?"undefined":o5(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function Pve(e){var t="".concat(e,"Storage");return Eve(t)?self[t]:kve}R_.__esModule=!0;R_.default=Ave;var Tve=Lve(O_);function Lve(e){return e&&e.__esModule?e:{default:e}}function Ave(e){var t=(0,Tve.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var Cv=void 0,Ive=Mve(R_);function Mve(e){return e&&e.__esModule?e:{default:e}}var Rve=(0,Ive.default)("local");Cv=Rve;const a5=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" "),Ove=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return N_(r)?r:!1},N_=e=>Boolean(typeof e=="string"?Ove(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),_3=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),Nve=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0]),parseFloat(r[1])]);var wa={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",d=500,p="__lodash_placeholder__",g=1,m=2,y=4,x=1,S=2,E=1,P=2,k=4,T=8,M=16,N=32,F=64,z=128,B=256,K=512,j=30,X="...",ue=800,ge=16,xe=1,we=2,Se=3,J=1/0,G=9007199254740991,te=17976931348623157e292,Q=0/0,W=4294967295,ie=W-1,de=W>>>1,be=[["ary",z],["bind",E],["bindKey",P],["curry",T],["curryRight",M],["flip",K],["partial",N],["partialRight",F],["rearg",B]],De="[object Arguments]",Re="[object Array]",Ve="[object AsyncFunction]",ke="[object Boolean]",$e="[object Date]",nt="[object DOMException]",ft="[object Error]",Rt="[object Function]",Ot="[object GeneratorFunction]",Me="[object Map]",tt="[object Number]",pt="[object Null]",at="[object Object]",gt="[object Promise]",pn="[object Proxy]",mt="[object RegExp]",Ht="[object Set]",nn="[object String]",zt="[object Symbol]",Oe="[object Undefined]",et="[object WeakMap]",Gt="[object WeakSet]",Wt="[object ArrayBuffer]",Ee="[object DataView]",kt="[object Float32Array]",Xt="[object Float64Array]",Bn="[object Int8Array]",Ge="[object Int16Array]",Lt="[object Int32Array]",Be="[object Uint8Array]",ut="[object Uint8ClampedArray]",je="[object Uint16Array]",xt="[object Uint32Array]",Qt=/\b__p \+= '';/g,qn=/\b(__p \+=) '' \+/g,yr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Hr=/&(?:amp|lt|gt|quot|#39);/g,Bi=/[&<>"']/g,Ld=RegExp(Hr.source),Wr=RegExp(Bi.source),qu=/<%-([\s\S]+?)%>/g,Ad=/<%([\s\S]+?)%>/g,$s=/<%=([\s\S]+?)%>/g,Zu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yu=/^\w*$/,or=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ul=/[\\^$.*+?()[\]{}|]/g,Id=RegExp(Ul.source),Bs=/^\s+/,Gl=/\s/,Md=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bi=/\{\n\/\* \[wrapped with (.+)\] \*/,Hs=/,? & /,Rd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Od=/[()=,{}\[\]\/\s]/,Nd=/\\(\\)?/g,Dd=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,oi=/\w*$/,zd=/^[-+]0x[0-9a-f]+$/i,Fd=/^0b[01]+$/i,$d=/^\[object .+?Constructor\]$/,Bd=/^0o[0-7]+$/i,Hd=/^(?:0|[1-9]\d*)$/,Wd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wo=/($^)/,Vd=/['\n\r\u2028\u2029\\]/g,Hi="\\ud800-\\udfff",qo="\\u0300-\\u036f",ss="\\ufe20-\\ufe2f",eo="\\u20d0-\\u20ff",Pa=qo+ss+eo,Xu="\\u2700-\\u27bf",Ws="a-z\\xdf-\\xf6\\xf8-\\xff",Ta="\\xac\\xb1\\xd7\\xf7",Wi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gn="\\u2000-\\u206f",cn=" \\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",to="A-Z\\xc0-\\xd6\\xd8-\\xde",ar="\\ufe0e\\ufe0f",Tr=Ta+Wi+gn+cn,no="['\u2019]",La="["+Hi+"]",Lr="["+Tr+"]",Zo="["+Pa+"]",jl="\\d+",Co="["+Xu+"]",ro="["+Ws+"]",Kl="[^"+Hi+Tr+jl+Xu+Ws+to+"]",Xr="\\ud83c[\\udffb-\\udfff]",ql="(?:"+Zo+"|"+Xr+")",Qu="[^"+Hi+"]",Zl="(?:\\ud83c[\\udde6-\\uddff]){2}",Aa="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+to+"]",Ia="\\u200d",ls="(?:"+ro+"|"+Kl+")",Ud="(?:"+xi+"|"+Kl+")",Ma="(?:"+no+"(?:d|ll|m|re|s|t|ve))?",Vs="(?:"+no+"(?:D|LL|M|RE|S|T|VE))?",Yl=ql+"?",Us="["+ar+"]?",Si="(?:"+Ia+"(?:"+[Qu,Zl,Aa].join("|")+")"+Us+Yl+")*",us="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",At=Us+Yl+Si,Ju="(?:"+[Co,Zl,Aa].join("|")+")"+At,cs="(?:"+[Qu+Zo+"?",Zo,Zl,Aa,La].join("|")+")",Ra=RegExp(no,"g"),Xl=RegExp(Zo,"g"),Ar=RegExp(Xr+"(?="+Xr+")|"+cs+At,"g"),dn=RegExp([xi+"?"+ro+"+"+Ma+"(?="+[Lr,xi,"$"].join("|")+")",Ud+"+"+Vs+"(?="+[Lr,xi+ls,"$"].join("|")+")",xi+"?"+ls+"+"+Ma,xi+"+"+Vs,Yo,us,jl,Ju].join("|"),"g"),Ql=RegExp("["+Ia+Hi+Pa+ar+"]"),Jl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tu=-1,rn={};rn[kt]=rn[Xt]=rn[Bn]=rn[Ge]=rn[Lt]=rn[Be]=rn[ut]=rn[je]=rn[xt]=!0,rn[De]=rn[Re]=rn[Wt]=rn[ke]=rn[Ee]=rn[$e]=rn[ft]=rn[Rt]=rn[Me]=rn[tt]=rn[at]=rn[mt]=rn[Ht]=rn[nn]=rn[et]=!1;var Nt={};Nt[De]=Nt[Re]=Nt[Wt]=Nt[Ee]=Nt[ke]=Nt[$e]=Nt[kt]=Nt[Xt]=Nt[Bn]=Nt[Ge]=Nt[Lt]=Nt[Me]=Nt[tt]=Nt[at]=Nt[mt]=Nt[Ht]=Nt[nn]=Nt[zt]=Nt[Be]=Nt[ut]=Nt[je]=Nt[xt]=!0,Nt[ft]=Nt[Rt]=Nt[et]=!1;var nu={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Gd={"&":"&","<":"<",">":">",'"':""","'":"'"},I={"&":"&","<":"<",">":">",""":'"',"'":"'"},D={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},U=parseFloat,me=parseInt,Ye=typeof Cu=="object"&&Cu&&Cu.Object===Object&&Cu,dt=typeof self=="object"&&self&&self.Object===Object&&self,Ke=Ye||dt||Function("return this")(),Ue=t&&!t.nodeType&&t,lt=Ue&&!0&&e&&!e.nodeType&&e,sn=lt&<.exports===Ue,qt=sn&&Ye.process,jt=function(){try{var ee=lt&<.require&<.require("util").types;return ee||qt&&qt.binding&&qt.binding("util")}catch{}}(),sr=jt&&jt.isArrayBuffer,ai=jt&&jt.isDate,si=jt&&jt.isMap,Oa=jt&&jt.isRegExp,Gs=jt&&jt.isSet,e1=jt&&jt.isTypedArray;function wi(ee,ye,pe){switch(pe.length){case 0:return ee.call(ye);case 1:return ee.call(ye,pe[0]);case 2:return ee.call(ye,pe[0],pe[1]);case 3:return ee.call(ye,pe[0],pe[1],pe[2])}return ee.apply(ye,pe)}function t1(ee,ye,pe,Qe){for(var Ct=-1,Jt=ee==null?0:ee.length;++Ct-1}function Eh(ee,ye,pe){for(var Qe=-1,Ct=ee==null?0:ee.length;++Qe-1;);return pe}function ds(ee,ye){for(var pe=ee.length;pe--&&nc(ye,ee[pe],0)>-1;);return pe}function r1(ee,ye){for(var pe=ee.length,Qe=0;pe--;)ee[pe]===ye&&++Qe;return Qe}var Ov=Zd(nu),fs=Zd(Gd);function Ks(ee){return"\\"+D[ee]}function Th(ee,ye){return ee==null?n:ee[ye]}function iu(ee){return Ql.test(ee)}function Lh(ee){return Jl.test(ee)}function Nv(ee){for(var ye,pe=[];!(ye=ee.next()).done;)pe.push(ye.value);return pe}function Ah(ee){var ye=-1,pe=Array(ee.size);return ee.forEach(function(Qe,Ct){pe[++ye]=[Ct,Qe]}),pe}function Ih(ee,ye){return function(pe){return ee(ye(pe))}}function Jo(ee,ye){for(var pe=-1,Qe=ee.length,Ct=0,Jt=[];++pe-1}function e2(u,h){var b=this.__data__,A=Mr(b,u);return A<0?(++this.size,b.push([u,h])):b[A][1]=h,this}ea.prototype.clear=Qv,ea.prototype.delete=Jv,ea.prototype.get=y1,ea.prototype.has=b1,ea.prototype.set=e2;function ta(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h=h?u:h)),u}function ci(u,h,b,A,O,H){var q,Y=h&g,se=h&m,_e=h&y;if(b&&(q=O?b(u,A,O,H):b(u)),q!==n)return q;if(!dr(u))return u;var Pe=Mt(u);if(Pe){if(q=UH(u),!Y)return Ti(u,q)}else{var Ae=hi(u),Xe=Ae==Rt||Ae==Ot;if(Ac(u))return il(u,Y);if(Ae==at||Ae==De||Xe&&!O){if(q=se||Xe?{}:_7(u),!Y)return se?z1(u,xc(q,u)):Ao(u,rt(q,u))}else{if(!Nt[Ae])return O?u:{};q=GH(u,Ae,Y)}}H||(H=new xr);var ct=H.get(u);if(ct)return ct;H.set(u,q),J7(u)?u.forEach(function(yt){q.add(ci(yt,h,b,yt,u,H))}):X7(u)&&u.forEach(function(yt,Kt){q.set(Kt,ci(yt,h,b,Kt,u,H))});var vt=_e?se?he:aa:se?Mo:pi,Bt=Pe?n:vt(u);return Hn(Bt||u,function(yt,Kt){Bt&&(Kt=yt,yt=u[Kt]),Ys(q,Kt,ci(yt,h,b,Kt,u,H))}),q}function $h(u){var h=pi(u);return function(b){return Bh(b,u,h)}}function Bh(u,h,b){var A=b.length;if(u==null)return!A;for(u=fn(u);A--;){var O=b[A],H=h[O],q=u[O];if(q===n&&!(O in u)||!H(q))return!1}return!0}function C1(u,h,b){if(typeof u!="function")throw new Ci(a);return W1(function(){u.apply(n,b)},h)}function Sc(u,h,b,A){var O=-1,H=Vi,q=!0,Y=u.length,se=[],_e=h.length;if(!Y)return se;b&&(h=Nn(h,Ir(b))),A?(H=Eh,q=!1):h.length>=i&&(H=ic,q=!1,h=new Fa(h));e:for(;++OO?0:O+b),A=A===n||A>O?O:Dt(A),A<0&&(A+=O),A=b>A?0:tk(A);b0&&b(Y)?h>1?Rr(Y,h-1,b,A,O):Na(O,Y):A||(O[O.length]=Y)}return O}var Wh=ol(),Po=ol(!0);function oa(u,h){return u&&Wh(u,h,pi)}function To(u,h){return u&&Po(u,h,pi)}function Vh(u,h){return ko(h,function(b){return hu(u[b])})}function Xs(u,h){h=rl(h,u);for(var b=0,A=h.length;u!=null&&bh}function Gh(u,h){return u!=null&&on.call(u,h)}function jh(u,h){return u!=null&&h in fn(u)}function Kh(u,h,b){return u>=Jr(h,b)&&u=120&&Pe.length>=120)?new Fa(q&&Pe):n}Pe=u[0];var Ae=-1,Xe=Y[0];e:for(;++Ae-1;)Y!==u&&rf.call(Y,se,1),rf.call(u,se,1);return u}function hf(u,h){for(var b=u?h.length:0,A=b-1;b--;){var O=h[b];if(b==A||O!==H){var H=O;fu(O)?rf.call(u,O,1):rp(u,O)}}return u}function pf(u,h){return u+au(f1()*(h-u+1))}function tl(u,h,b,A){for(var O=-1,H=br(sf((h-u)/(b||1)),0),q=pe(H);H--;)q[A?H:++O]=u,u+=b;return q}function Pc(u,h){var b="";if(!u||h<1||h>G)return b;do h%2&&(b+=u),h=au(h/2),h&&(u+=u);while(h);return b}function wt(u,h){return Wb(P7(u,h,Ro),u+"")}function Qh(u){return bc(cp(u))}function gf(u,h){var b=cp(u);return l2(b,lu(h,0,b.length))}function cu(u,h,b,A){if(!dr(u))return u;h=rl(h,u);for(var O=-1,H=h.length,q=H-1,Y=u;Y!=null&&++OO?0:O+h),b=b>O?O:b,b<0&&(b+=O),O=h>b?0:b-h>>>0,h>>>=0;for(var H=pe(O);++A>>1,q=u[H];q!==null&&!sa(q)&&(b?q<=h:q=i){var _e=h?null:V(u);if(_e)return Jd(_e);q=!1,O=ic,se=new Fa}else se=h?[]:Y;e:for(;++A=A?u:Nr(u,h,b)}var R1=Bv||function(u){return Ke.clearTimeout(u)};function il(u,h){if(h)return u.slice();var b=u.length,A=uc?uc(b):new u.constructor(b);return u.copy(A),A}function O1(u){var h=new u.constructor(u.byteLength);return new _i(h).set(new _i(u)),h}function du(u,h){var b=h?O1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.byteLength)}function i2(u){var h=new u.constructor(u.source,oi.exec(u));return h.lastIndex=u.lastIndex,h}function Wn(u){return uf?fn(uf.call(u)):{}}function o2(u,h){var b=h?O1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.length)}function N1(u,h){if(u!==h){var b=u!==n,A=u===null,O=u===u,H=sa(u),q=h!==n,Y=h===null,se=h===h,_e=sa(h);if(!Y&&!_e&&!H&&u>h||H&&q&&se&&!Y&&!_e||A&&q&&se||!b&&se||!O)return 1;if(!A&&!H&&!_e&&u=Y)return se;var _e=b[A];return se*(_e=="desc"?-1:1)}}return u.index-h.index}function a2(u,h,b,A){for(var O=-1,H=u.length,q=b.length,Y=-1,se=h.length,_e=br(H-q,0),Pe=pe(se+_e),Ae=!A;++Y1?b[O-1]:n,q=O>2?b[2]:n;for(H=u.length>3&&typeof H=="function"?(O--,H):n,q&&uo(b[0],b[1],q)&&(H=O<3?n:H,O=1),h=fn(h);++A-1?O[H?h[q]:q]:n}}function $1(u){return Jn(function(h){var b=h.length,A=b,O=oo.prototype.thru;for(u&&h.reverse();A--;){var H=h[A];if(typeof H!="function")throw new Ci(a);if(O&&!q&&ve(H)=="wrapper")var q=new oo([],!0)}for(A=q?A:b;++A1&&en.reverse(),Pe&&seY))return!1;var _e=H.get(u),Pe=H.get(h);if(_e&&Pe)return _e==h&&Pe==u;var Ae=-1,Xe=!0,ct=b&S?new Fa:n;for(H.set(u,h),H.set(h,u);++Ae1?"& ":"")+h[A],h=h.join(b>2?", ":" "),u.replace(Md,`{ +/* [wrapped with `+h+`] */ +`)}function KH(u){return Mt(u)||Cf(u)||!!(c1&&u&&u[c1])}function fu(u,h){var b=typeof u;return h=h??G,!!h&&(b=="number"||b!="symbol"&&Hd.test(u))&&u>-1&&u%1==0&&u0){if(++h>=ue)return arguments[0]}else h=0;return u.apply(n,arguments)}}function l2(u,h){var b=-1,A=u.length,O=A-1;for(h=h===n?A:h;++b1?u[h-1]:n;return b=typeof b=="function"?(u.pop(),b):n,$7(u,b)});function B7(u){var h=$(u);return h.__chain__=!0,h}function iV(u,h){return h(u),u}function u2(u,h){return h(u)}var oV=Jn(function(u){var h=u.length,b=h?u[0]:0,A=this.__wrapped__,O=function(H){return Fh(H,u)};return h>1||this.__actions__.length||!(A instanceof Vt)||!fu(b)?this.thru(O):(A=A.slice(b,+b+(h?1:0)),A.__actions__.push({func:u2,args:[O],thisArg:n}),new oo(A,this.__chain__).thru(function(H){return h&&!H.length&&H.push(n),H}))});function aV(){return B7(this)}function sV(){return new oo(this.value(),this.__chain__)}function lV(){this.__values__===n&&(this.__values__=ek(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function uV(){return this}function cV(u){for(var h,b=this;b instanceof cf;){var A=R7(b);A.__index__=0,A.__values__=n,h?O.__wrapped__=A:h=A;var O=A;b=b.__wrapped__}return O.__wrapped__=u,h}function dV(){var u=this.__wrapped__;if(u instanceof Vt){var h=u;return this.__actions__.length&&(h=new Vt(this)),h=h.reverse(),h.__actions__.push({func:u2,args:[Vb],thisArg:n}),new oo(h,this.__chain__)}return this.thru(Vb)}function fV(){return nl(this.__wrapped__,this.__actions__)}var hV=op(function(u,h,b){on.call(u,b)?++u[b]:na(u,b,1)});function pV(u,h,b){var A=Mt(u)?On:_1;return b&&uo(u,h,b)&&(h=n),A(u,Le(h,3))}function gV(u,h){var b=Mt(u)?ko:ia;return b(u,Le(h,3))}var mV=F1(O7),vV=F1(N7);function yV(u,h){return Rr(c2(u,h),1)}function bV(u,h){return Rr(c2(u,h),J)}function xV(u,h,b){return b=b===n?1:Dt(b),Rr(c2(u,h),b)}function H7(u,h){var b=Mt(u)?Hn:gs;return b(u,Le(h,3))}function W7(u,h){var b=Mt(u)?_o:Hh;return b(u,Le(h,3))}var SV=op(function(u,h,b){on.call(u,b)?u[b].push(h):na(u,b,[h])});function wV(u,h,b,A){u=Io(u)?u:cp(u),b=b&&!A?Dt(b):0;var O=u.length;return b<0&&(b=br(O+b,0)),g2(u)?b<=O&&u.indexOf(h,b)>-1:!!O&&nc(u,h,b)>-1}var CV=wt(function(u,h,b){var A=-1,O=typeof h=="function",H=Io(u)?pe(u.length):[];return gs(u,function(q){H[++A]=O?wi(h,q,b):ms(q,h,b)}),H}),_V=op(function(u,h,b){na(u,b,h)});function c2(u,h){var b=Mt(u)?Nn:wr;return b(u,Le(h,3))}function kV(u,h,b,A){return u==null?[]:(Mt(h)||(h=h==null?[]:[h]),b=A?n:b,Mt(b)||(b=b==null?[]:[b]),Ei(u,h,b))}var EV=op(function(u,h,b){u[b?0:1].push(h)},function(){return[[],[]]});function PV(u,h,b){var A=Mt(u)?jd:Ph,O=arguments.length<3;return A(u,Le(h,4),b,O,gs)}function TV(u,h,b){var A=Mt(u)?Av:Ph,O=arguments.length<3;return A(u,Le(h,4),b,O,Hh)}function LV(u,h){var b=Mt(u)?ko:ia;return b(u,h2(Le(h,3)))}function AV(u){var h=Mt(u)?bc:Qh;return h(u)}function IV(u,h,b){(b?uo(u,h,b):h===n)?h=1:h=Dt(h);var A=Mt(u)?ui:gf;return A(u,h)}function MV(u){var h=Mt(u)?Ob:fi;return h(u)}function RV(u){if(u==null)return 0;if(Io(u))return g2(u)?Da(u):u.length;var h=hi(u);return h==Me||h==Ht?u.size:Or(u).length}function OV(u,h,b){var A=Mt(u)?ec:Lo;return b&&uo(u,h,b)&&(h=n),A(u,Le(h,3))}var NV=wt(function(u,h){if(u==null)return[];var b=h.length;return b>1&&uo(u,h[0],h[1])?h=[]:b>2&&uo(h[0],h[1],h[2])&&(h=[h[0]]),Ei(u,Rr(h,1),[])}),d2=Hv||function(){return Ke.Date.now()};function DV(u,h){if(typeof h!="function")throw new Ci(a);return u=Dt(u),function(){if(--u<1)return h.apply(this,arguments)}}function V7(u,h,b){return h=b?n:h,h=u&&h==null?u.length:h,fe(u,z,n,n,n,n,h)}function U7(u,h){var b;if(typeof h!="function")throw new Ci(a);return u=Dt(u),function(){return--u>0&&(b=h.apply(this,arguments)),u<=1&&(h=n),b}}var Gb=wt(function(u,h,b){var A=E;if(b.length){var O=Jo(b,Ze(Gb));A|=N}return fe(u,A,h,b,O)}),G7=wt(function(u,h,b){var A=E|P;if(b.length){var O=Jo(b,Ze(G7));A|=N}return fe(h,A,u,b,O)});function j7(u,h,b){h=b?n:h;var A=fe(u,T,n,n,n,n,n,h);return A.placeholder=j7.placeholder,A}function K7(u,h,b){h=b?n:h;var A=fe(u,M,n,n,n,n,n,h);return A.placeholder=K7.placeholder,A}function q7(u,h,b){var A,O,H,q,Y,se,_e=0,Pe=!1,Ae=!1,Xe=!0;if(typeof u!="function")throw new Ci(a);h=Ha(h)||0,dr(b)&&(Pe=!!b.leading,Ae="maxWait"in b,H=Ae?br(Ha(b.maxWait)||0,h):H,Xe="trailing"in b?!!b.trailing:Xe);function ct(zr){var Ss=A,gu=O;return A=O=n,_e=zr,q=u.apply(gu,Ss),q}function vt(zr){return _e=zr,Y=W1(Kt,h),Pe?ct(zr):q}function Bt(zr){var Ss=zr-se,gu=zr-_e,hk=h-Ss;return Ae?Jr(hk,H-gu):hk}function yt(zr){var Ss=zr-se,gu=zr-_e;return se===n||Ss>=h||Ss<0||Ae&&gu>=H}function Kt(){var zr=d2();if(yt(zr))return en(zr);Y=W1(Kt,Bt(zr))}function en(zr){return Y=n,Xe&&A?ct(zr):(A=O=n,q)}function la(){Y!==n&&R1(Y),_e=0,A=se=O=Y=n}function co(){return Y===n?q:en(d2())}function ua(){var zr=d2(),Ss=yt(zr);if(A=arguments,O=this,se=zr,Ss){if(Y===n)return vt(se);if(Ae)return R1(Y),Y=W1(Kt,h),ct(se)}return Y===n&&(Y=W1(Kt,h)),q}return ua.cancel=la,ua.flush=co,ua}var zV=wt(function(u,h){return C1(u,1,h)}),FV=wt(function(u,h,b){return C1(u,Ha(h)||0,b)});function $V(u){return fe(u,K)}function f2(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new Ci(a);var b=function(){var A=arguments,O=h?h.apply(this,A):A[0],H=b.cache;if(H.has(O))return H.get(O);var q=u.apply(this,A);return b.cache=H.set(O,q)||H,q};return b.cache=new(f2.Cache||ta),b}f2.Cache=ta;function h2(u){if(typeof u!="function")throw new Ci(a);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function BV(u){return U7(2,u)}var HV=zb(function(u,h){h=h.length==1&&Mt(h[0])?Nn(h[0],Ir(Le())):Nn(Rr(h,1),Ir(Le()));var b=h.length;return wt(function(A){for(var O=-1,H=Jr(A.length,b);++O=h}),Cf=Zh(function(){return arguments}())?Zh:function(u){return Cr(u)&&on.call(u,"callee")&&!u1.call(u,"callee")},Mt=pe.isArray,nU=sr?Ir(sr):E1;function Io(u){return u!=null&&p2(u.length)&&!hu(u)}function Dr(u){return Cr(u)&&Io(u)}function rU(u){return u===!0||u===!1||Cr(u)&&di(u)==ke}var Ac=Wv||rx,iU=ai?Ir(ai):P1;function oU(u){return Cr(u)&&u.nodeType===1&&!V1(u)}function aU(u){if(u==null)return!0;if(Io(u)&&(Mt(u)||typeof u=="string"||typeof u.splice=="function"||Ac(u)||up(u)||Cf(u)))return!u.length;var h=hi(u);if(h==Me||h==Ht)return!u.size;if(H1(u))return!Or(u).length;for(var b in u)if(on.call(u,b))return!1;return!0}function sU(u,h){return Cc(u,h)}function lU(u,h,b){b=typeof b=="function"?b:n;var A=b?b(u,h):n;return A===n?Cc(u,h,n,b):!!A}function Kb(u){if(!Cr(u))return!1;var h=di(u);return h==ft||h==nt||typeof u.message=="string"&&typeof u.name=="string"&&!V1(u)}function uU(u){return typeof u=="number"&&Oh(u)}function hu(u){if(!dr(u))return!1;var h=di(u);return h==Rt||h==Ot||h==Ve||h==pn}function Y7(u){return typeof u=="number"&&u==Dt(u)}function p2(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=G}function dr(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function Cr(u){return u!=null&&typeof u=="object"}var X7=si?Ir(si):Db;function cU(u,h){return u===h||_c(u,h,_t(h))}function dU(u,h,b){return b=typeof b=="function"?b:n,_c(u,h,_t(h),b)}function fU(u){return Q7(u)&&u!=+u}function hU(u){if(YH(u))throw new Ct(o);return Yh(u)}function pU(u){return u===null}function gU(u){return u==null}function Q7(u){return typeof u=="number"||Cr(u)&&di(u)==tt}function V1(u){if(!Cr(u)||di(u)!=at)return!1;var h=cc(u);if(h===null)return!0;var b=on.call(h,"constructor")&&h.constructor;return typeof b=="function"&&b instanceof b&&lr.call(b)==li}var qb=Oa?Ir(Oa):ur;function mU(u){return Y7(u)&&u>=-G&&u<=G}var J7=Gs?Ir(Gs):Ft;function g2(u){return typeof u=="string"||!Mt(u)&&Cr(u)&&di(u)==nn}function sa(u){return typeof u=="symbol"||Cr(u)&&di(u)==zt}var up=e1?Ir(e1):Vr;function vU(u){return u===n}function yU(u){return Cr(u)&&hi(u)==et}function bU(u){return Cr(u)&&di(u)==Gt}var xU=C(Qs),SU=C(function(u,h){return u<=h});function ek(u){if(!u)return[];if(Io(u))return g2(u)?Ui(u):Ti(u);if(dc&&u[dc])return Nv(u[dc]());var h=hi(u),b=h==Me?Ah:h==Ht?Jd:cp;return b(u)}function pu(u){if(!u)return u===0?u:0;if(u=Ha(u),u===J||u===-J){var h=u<0?-1:1;return h*te}return u===u?u:0}function Dt(u){var h=pu(u),b=h%1;return h===h?b?h-b:h:0}function tk(u){return u?lu(Dt(u),0,W):0}function Ha(u){if(typeof u=="number")return u;if(sa(u))return Q;if(dr(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=dr(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=io(u);var b=Fd.test(u);return b||Bd.test(u)?me(u.slice(2),b?2:8):zd.test(u)?Q:+u}function nk(u){return $a(u,Mo(u))}function wU(u){return u?lu(Dt(u),-G,G):u===0?u:0}function wn(u){return u==null?"":so(u)}var CU=lo(function(u,h){if(H1(h)||Io(h)){$a(h,pi(h),u);return}for(var b in h)on.call(h,b)&&Ys(u,b,h[b])}),rk=lo(function(u,h){$a(h,Mo(h),u)}),m2=lo(function(u,h,b,A){$a(h,Mo(h),u,A)}),_U=lo(function(u,h,b,A){$a(h,pi(h),u,A)}),kU=Jn(Fh);function EU(u,h){var b=su(u);return h==null?b:rt(b,h)}var PU=wt(function(u,h){u=fn(u);var b=-1,A=h.length,O=A>2?h[2]:n;for(O&&uo(h[0],h[1],O)&&(A=1);++b1),H}),$a(u,he(u),b),A&&(b=ci(b,g|m|y,Et));for(var O=h.length;O--;)rp(b,h[O]);return b});function GU(u,h){return ok(u,h2(Le(h)))}var jU=Jn(function(u,h){return u==null?{}:A1(u,h)});function ok(u,h){if(u==null)return{};var b=Nn(he(u),function(A){return[A]});return h=Le(h),Xh(u,b,function(A,O){return h(A,O[0])})}function KU(u,h,b){h=rl(h,u);var A=-1,O=h.length;for(O||(O=1,u=n);++Ah){var A=u;u=h,h=A}if(b||u%1||h%1){var O=f1();return Jr(u+O*(h-u+U("1e-"+((O+"").length-1))),h)}return pf(u,h)}var iG=al(function(u,h,b){return h=h.toLowerCase(),u+(b?lk(h):h)});function lk(u){return Xb(wn(u).toLowerCase())}function uk(u){return u=wn(u),u&&u.replace(Wd,Ov).replace(Xl,"")}function oG(u,h,b){u=wn(u),h=so(h);var A=u.length;b=b===n?A:lu(Dt(b),0,A);var O=b;return b-=h.length,b>=0&&u.slice(b,O)==h}function aG(u){return u=wn(u),u&&Wr.test(u)?u.replace(Bi,fs):u}function sG(u){return u=wn(u),u&&Id.test(u)?u.replace(Ul,"\\$&"):u}var lG=al(function(u,h,b){return u+(b?"-":"")+h.toLowerCase()}),uG=al(function(u,h,b){return u+(b?" ":"")+h.toLowerCase()}),cG=sp("toLowerCase");function dG(u,h,b){u=wn(u),h=Dt(h);var A=h?Da(u):0;if(!h||A>=h)return u;var O=(h-A)/2;return c(au(O),b)+u+c(sf(O),b)}function fG(u,h,b){u=wn(u),h=Dt(h);var A=h?Da(u):0;return h&&A>>0,b?(u=wn(u),u&&(typeof h=="string"||h!=null&&!qb(h))&&(h=so(h),!h&&iu(u))?ys(Ui(u),0,b):u.split(h,b)):[]}var bG=al(function(u,h,b){return u+(b?" ":"")+Xb(h)});function xG(u,h,b){return u=wn(u),b=b==null?0:lu(Dt(b),0,u.length),h=so(h),u.slice(b,b+h.length)==h}function SG(u,h,b){var A=$.templateSettings;b&&uo(u,h,b)&&(h=n),u=wn(u),h=m2({},h,A,Fe);var O=m2({},h.imports,A.imports,Fe),H=pi(O),q=Qd(O,H),Y,se,_e=0,Pe=h.interpolate||wo,Ae="__p += '",Xe=tf((h.escape||wo).source+"|"+Pe.source+"|"+(Pe===$s?Dd:wo).source+"|"+(h.evaluate||wo).source+"|$","g"),ct="//# sourceURL="+(on.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tu+"]")+` +`;u.replace(Xe,function(yt,Kt,en,la,co,ua){return en||(en=la),Ae+=u.slice(_e,ua).replace(Vd,Ks),Kt&&(Y=!0,Ae+=`' + +__e(`+Kt+`) + +'`),co&&(se=!0,Ae+=`'; +`+co+`; +__p += '`),en&&(Ae+=`' + +((__t = (`+en+`)) == null ? '' : __t) + +'`),_e=ua+yt.length,yt}),Ae+=`'; +`;var vt=on.call(h,"variable")&&h.variable;if(!vt)Ae=`with (obj) { +`+Ae+` +} +`;else if(Od.test(vt))throw new Ct(s);Ae=(se?Ae.replace(Qt,""):Ae).replace(qn,"$1").replace(yr,"$1;"),Ae="function("+(vt||"obj")+`) { +`+(vt?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(Y?", __e = _.escape":"")+(se?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Ae+`return __p +}`;var Bt=dk(function(){return Jt(H,ct+"return "+Ae).apply(n,q)});if(Bt.source=Ae,Kb(Bt))throw Bt;return Bt}function wG(u){return wn(u).toLowerCase()}function CG(u){return wn(u).toUpperCase()}function _G(u,h,b){if(u=wn(u),u&&(b||h===n))return io(u);if(!u||!(h=so(h)))return u;var A=Ui(u),O=Ui(h),H=Qo(A,O),q=ds(A,O)+1;return ys(A,H,q).join("")}function kG(u,h,b){if(u=wn(u),u&&(b||h===n))return u.slice(0,o1(u)+1);if(!u||!(h=so(h)))return u;var A=Ui(u),O=ds(A,Ui(h))+1;return ys(A,0,O).join("")}function EG(u,h,b){if(u=wn(u),u&&(b||h===n))return u.replace(Bs,"");if(!u||!(h=so(h)))return u;var A=Ui(u),O=Qo(A,Ui(h));return ys(A,O).join("")}function PG(u,h){var b=j,A=X;if(dr(h)){var O="separator"in h?h.separator:O;b="length"in h?Dt(h.length):b,A="omission"in h?so(h.omission):A}u=wn(u);var H=u.length;if(iu(u)){var q=Ui(u);H=q.length}if(b>=H)return u;var Y=b-Da(A);if(Y<1)return A;var se=q?ys(q,0,Y).join(""):u.slice(0,Y);if(O===n)return se+A;if(q&&(Y+=se.length-Y),qb(O)){if(u.slice(Y).search(O)){var _e,Pe=se;for(O.global||(O=tf(O.source,wn(oi.exec(O))+"g")),O.lastIndex=0;_e=O.exec(Pe);)var Ae=_e.index;se=se.slice(0,Ae===n?Y:Ae)}}else if(u.indexOf(so(O),Y)!=Y){var Xe=se.lastIndexOf(O);Xe>-1&&(se=se.slice(0,Xe))}return se+A}function TG(u){return u=wn(u),u&&Ld.test(u)?u.replace(Hr,Fv):u}var LG=al(function(u,h,b){return u+(b?" ":"")+h.toUpperCase()}),Xb=sp("toUpperCase");function ck(u,h,b){return u=wn(u),h=b?n:h,h===n?Lh(u)?ef(u):n1(u):u.match(h)||[]}var dk=wt(function(u,h){try{return wi(u,n,h)}catch(b){return Kb(b)?b:new Ct(b)}}),AG=Jn(function(u,h){return Hn(h,function(b){b=sl(b),na(u,b,Gb(u[b],u))}),u});function IG(u){var h=u==null?0:u.length,b=Le();return u=h?Nn(u,function(A){if(typeof A[1]!="function")throw new Ci(a);return[b(A[0]),A[1]]}):[],wt(function(A){for(var O=-1;++OG)return[];var b=W,A=Jr(u,W);h=Le(h),u-=W;for(var O=Xd(A,h);++b0||h<0)?new Vt(b):(u<0?b=b.takeRight(-u):u&&(b=b.drop(u)),h!==n&&(h=Dt(h),b=h<0?b.dropRight(-h):b.take(h-u)),b)},Vt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Vt.prototype.toArray=function(){return this.take(W)},oa(Vt.prototype,function(u,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),A=/^(?:head|last)$/.test(h),O=$[A?"take"+(h=="last"?"Right":""):h],H=A||/^find/.test(h);!O||($.prototype[h]=function(){var q=this.__wrapped__,Y=A?[1]:arguments,se=q instanceof Vt,_e=Y[0],Pe=se||Mt(q),Ae=function(Kt){var en=O.apply($,Na([Kt],Y));return A&&Xe?en[0]:en};Pe&&b&&typeof _e=="function"&&_e.length!=1&&(se=Pe=!1);var Xe=this.__chain__,ct=!!this.__actions__.length,vt=H&&!Xe,Bt=se&&!ct;if(!H&&Pe){q=Bt?q:new Vt(this);var yt=u.apply(q,Y);return yt.__actions__.push({func:u2,args:[Ae],thisArg:n}),new oo(yt,Xe)}return vt&&Bt?u.apply(this,Y):(yt=this.thru(Ae),vt?A?yt.value()[0]:yt.value():yt)})}),Hn(["pop","push","shift","sort","splice","unshift"],function(u){var h=ac[u],b=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",A=/^(?:pop|shift)$/.test(u);$.prototype[u]=function(){var O=arguments;if(A&&!this.__chain__){var H=this.value();return h.apply(Mt(H)?H:[],O)}return this[b](function(q){return h.apply(Mt(q)?q:[],O)})}}),oa(Vt.prototype,function(u,h){var b=$[h];if(b){var A=b.name+"";on.call(hs,A)||(hs[A]=[]),hs[A].push({name:h,func:b})}}),hs[xf(n,P).name]=[{name:"wrapper",func:n}],Vt.prototype.clone=Gi,Vt.prototype.reverse=ki,Vt.prototype.value=Kv,$.prototype.at=oV,$.prototype.chain=aV,$.prototype.commit=sV,$.prototype.next=lV,$.prototype.plant=cV,$.prototype.reverse=dV,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=fV,$.prototype.first=$.prototype.head,dc&&($.prototype[dc]=uV),$},za=Eo();lt?((lt.exports=za)._=za,Ue._=za):Ke._=za}).call(Cu)})(wa,wa.exports);const tn=wa.exports;var bS=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function xS(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function QF(e,t){for(var n=t.slice(0,t.length-1),r=0;r=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function Dve(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,o=0;o=0&&tr.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&tr.splice(0,tr.length),(t===93||t===224)&&(t=91),t in Ni){Ni[t]=!1;for(var r in gd)gd[r]===t&&(ga[r]=!1)}}function Wve(e){if(typeof e>"u")Object.keys(jr).forEach(function(a){return delete jr[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&SS(a)});else if(typeof e=="object")e.key&&SS(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?QF(gd,d):[];jr[m]=jr[m].filter(function(x){var S=i?x.method===i:!0;return!(S&&x.scope===r&&Dve(x.mods,y))})}})};function ML(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var o in Ni)Object.prototype.hasOwnProperty.call(Ni,o)&&(!Ni[o]&&t.mods.indexOf(+o)>-1||Ni[o]&&t.mods.indexOf(+o)===-1)&&(i=!1);(t.mods.length===0&&!Ni[16]&&!Ni[18]&&!Ni[17]&&!Ni[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function RL(e,t){var n=jr["*"],r=e.keyCode||e.which||e.charCode;if(!!ga.filter.call(this,e)){if((r===93||r===224)&&(r=91),tr.indexOf(r)===-1&&r!==229&&tr.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(x){var S=tC[x];e[x]&&tr.indexOf(S)===-1?tr.push(S):!e[x]&&tr.indexOf(S)>-1?tr.splice(tr.indexOf(S),1):x==="metaKey"&&e[x]&&tr.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(tr=tr.slice(tr.indexOf(S))))}),r in Ni){Ni[r]=!0;for(var i in gd)gd[i]===r&&(ga[i]=!0);if(!n)return}for(var o in Ni)Object.prototype.hasOwnProperty.call(Ni,o)&&(Ni[o]=e[tC[o]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(tr.indexOf(17)===-1&&tr.push(17),tr.indexOf(18)===-1&&tr.push(18),Ni[17]=!0,Ni[18]=!0);var a=Km();if(n)for(var s=0;s-1}function ga(e,t,n){tr=[];var r=JF(e),i=[],o="all",a=document,s=0,l=!1,d=!0,p="+",g=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(o=t.scope),t.element&&(a=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(d=t.keydown),t.capture!==void 0&&(g=t.capture),typeof t.splitKey=="string"&&(p=t.splitKey)),typeof t=="string"&&(o=t);s1&&(i=QF(gd,e)),e=e[e.length-1],e=e==="*"?"*":fb(e),e in jr||(jr[e]=[]),jr[e].push({keyup:l,keydown:d,scope:o,mods:i,shortcut:r[s],method:n,key:r[s],splitKey:p,element:a});typeof a<"u"&&!Vve(a)&&window&&(t$.push(a),xS(a,"keydown",function(m){RL(m,a)},g),IL||(IL=!0,xS(window,"focus",function(){tr=[]},g)),xS(a,"keyup",function(m){RL(m,a),Hve(m)},g))}function Uve(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(jr).forEach(function(n){var r=jr[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var wS={setScope:n$,getScope:Km,deleteScope:Bve,getPressedKeyCodes:zve,isPressed:$ve,filter:Fve,trigger:Uve,unbind:Wve,keyMap:D_,modifier:gd,modifierMap:tC};for(var CS in wS)Object.prototype.hasOwnProperty.call(wS,CS)&&(ga[CS]=wS[CS]);if(typeof window<"u"){var Gve=window.hotkeys;ga.noConflict=function(e){return e&&window.hotkeys===ga&&(window.hotkeys=Gve),ga},window.hotkeys=ga}ga.filter=function(){return!0};var r$=function(t,n){var r=t.target,i=r&&r.tagName;return Boolean(i&&n&&n.includes(i))},jve=function(t){return r$(t,["INPUT","TEXTAREA","SELECT"])};function Ut(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},o=i.enableOnTags,a=i.filter,s=i.keyup,l=i.keydown,d=i.filterPreventDefault,p=d===void 0?!0:d,g=i.enabled,m=g===void 0?!0:g,y=i.enableOnContentEditable,x=y===void 0?!1:y,S=w.exports.useRef(null),E=w.exports.useCallback(function(P,k){var T,M;return a&&!a(P)?!p:jve(P)&&!r$(P,o)||(T=P.target)!=null&&T.isContentEditable&&!x?!0:S.current===null||document.activeElement===S.current||(M=S.current)!=null&&M.contains(document.activeElement)?(t(P,k),!0):!1},r?[S,o,a].concat(r):[S,o,a]);return w.exports.useEffect(function(){if(!m){ga.unbind(e,E);return}return s&&l!==!0&&(n.keydown=!1),ga(e,n||{},E),function(){return ga.unbind(e,E)}},[E,e,m]),S}ga.isPressed;function Kve(){return ae("div",{className:"work-in-progress nodes-work-in-progress",children:[_("h1",{children:"Nodes"}),_("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."})]})}function qve(){return ae("div",{className:"work-in-progress outpainting-work-in-progress",children:[_("h1",{children:"Outpainting"}),_("p",{children:"Outpainting is available as a part of the Invoke AI Command Line Interface. A dedicated WebUI interface will be released in the near future."})]})}const Zve=()=>ae("div",{className:"work-in-progress post-processing-work-in-progress",children:[_("h1",{children:"Post Processing"}),_("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the main image display."}),_("p",{children:"A dedicated UI will be released soon to facilitate more advanced post processing workflows."}),_("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen."})]}),Yve=$0({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:_("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:_("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),Xve=$0({displayName:"InpaintIcon",viewBox:"0 0 3543 3543",path:_("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593C0,768.593 0,2774.71 0,2774.71C0,3025.98 203.999,3229.98 455.269,3229.98L3088.04,3229.98C3339.31,3229.98 3543.31,3025.98 3543.31,2774.71C3543.31,2774.71 3543.31,768.593 3543.31,768.593ZM3446.56,2252.63L3446.56,768.593C3446.56,570.718 3285.91,410.068 3088.04,410.068C3088.04,410.068 455.269,410.068 455.269,410.068C257.394,410.068 96.745,570.718 96.745,768.593L96.745,2061.49L988.344,1051.01L1326.63,1423.12C1281.74,1438.3 1227.39,1454.93 1158.26,1480.89C995.738,1541.9 944.356,1613.28 911.834,1718.7C884.979,1805.76 875.814,1922.93 811.322,2093.5C763.918,2218.87 765.18,2304.83 790.606,2364.87C817.014,2427.22 869.858,2467.73 941.71,2493.83C1023.86,2523.67 1134.43,2534.25 1242.45,2557.97C1365.72,2585.04 1455.23,2643.2 1532.76,2665.96C1587.03,2681.89 1637.04,2683.6 1686.56,2663.56C1731.54,2645.36 1777.95,2607.64 1825.43,2535.92C1874.9,2461.2 1979.98,2369.94 2102.8,2276.91L2241.64,2429.63L2739.91,1850.53C2754.47,1841.35 2767.47,1833.12 2778.66,1825.94C2832.6,1791.35 2866.82,1742.41 2884.38,1682.61L2898.06,1666.72L3446.56,2252.63ZM1680.71,2559.9C1666.7,2570.37 1652.86,2577.22 1638.81,2580.95L1610.62,2588.45L1625.61,2644.82L1653.8,2637.33C1674.48,2631.83 1695.02,2622.04 1715.64,2606.61L1739,2589.14L1704.06,2542.43L1680.71,2559.9ZM1541.62,2570.42C1524.94,2564.58 1507.63,2557.37 1489.49,2549.48L1462.75,2537.84L1439.48,2591.33L1466.22,2602.97C1485.74,2611.46 1504.38,2619.18 1522.33,2625.47L1549.86,2635.12L1569.15,2580.07L1541.62,2570.42ZM1381.21,2503.1C1363.08,2496.04 1344.17,2489.24 1324.38,2483.03L1296.55,2474.29L1279.07,2529.94L1306.9,2538.68C1325.41,2544.49 1343.09,2550.86 1360.05,2557.46L1387.23,2568.04L1408.39,2513.68L1381.21,2503.1ZM1788.46,2430.83C1773.91,2447.61 1761.19,2463.86 1750.55,2479.44L1734.09,2503.52L1782.25,2536.43L1798.71,2512.35C1808.2,2498.46 1819.56,2484 1832.53,2469.04L1851.64,2447.01L1807.57,2408.79L1788.46,2430.83ZM1262.54,2466.49C1243.17,2462.24 1223.71,2458.43 1204.35,2454.87L1175.67,2449.6L1165.12,2506.97L1193.81,2512.24C1212.52,2515.68 1231.32,2519.35 1250.03,2523.46L1278.52,2529.72L1291.03,2472.74L1262.54,2466.49ZM1089.5,2434.66C1070.28,2431.1 1051.6,2427.35 1033.72,2423.15L1005.32,2416.49L992.002,2473.28L1020.4,2479.94C1039.14,2484.34 1058.71,2488.28 1078.86,2492.02L1107.54,2497.34L1118.18,2439.99L1089.5,2434.66ZM932.182,2386.94C917.545,2378.53 904.788,2368.71 894.532,2356.8L875.504,2334.69L831.294,2372.75L850.322,2394.85C864.755,2411.62 882.513,2425.67 903.11,2437.51L928.396,2452.05L957.469,2401.48L932.182,2386.94ZM1917.04,2306.1C1901.59,2319.37 1886.77,2332.5 1872.67,2345.44L1851.18,2365.17L1890.64,2408.14L1912.12,2388.41C1925.76,2375.89 1940.1,2363.19 1955.04,2350.36L1977.17,2331.36L1939.17,2287.1L1917.04,2306.1ZM866.485,2267.79C866.715,2251.85 868.706,2234.39 872.54,2215.21L878.257,2186.61L821.055,2175.17L815.338,2203.77C810.733,2226.81 808.434,2247.8 808.158,2266.94L807.737,2296.11L866.064,2296.95L866.485,2267.79ZM2055.08,2195.63C2039.24,2207.6 2023.66,2219.55 2008.43,2231.46L1985.45,2249.43L2021.38,2295.38L2044.36,2277.42C2059.34,2265.7 2074.66,2253.95 2090.23,2242.18L2113.51,2224.61L2078.35,2178.06L2055.08,2195.63ZM2197.62,2092.3C2181.57,2103.52 2165.6,2114.82 2149.74,2126.16L2126.02,2143.12L2159.95,2190.57L2183.67,2173.61C2199.36,2162.38 2215.18,2151.21 2231.05,2140.1L2254.95,2123.38L2221.52,2075.58L2197.62,2092.3ZM905.788,2108.14C912.858,2088.7 919.236,2069.96 925.03,2051.88L933.93,2024.1L878.378,2006.3L869.478,2034.08C863.905,2051.47 857.769,2069.5 850.968,2088.2L840.998,2115.61L895.817,2135.55L905.788,2108.14ZM2342.87,1993.45C2326.76,2004.15 2310.52,2015.01 2294.22,2026L2270.04,2042.31L2302.65,2090.67L2326.83,2074.37C2343.01,2063.45 2359.14,2052.67 2375.14,2042.04L2399.44,2025.91L2367.17,1977.31L2342.87,1993.45ZM2489.92,1897.67C2473.88,1907.94 2457.46,1918.5 2440.74,1929.32L2416.26,1945.16L2447.95,1994.14L2472.44,1978.29C2489.07,1967.53 2505.41,1957.02 2521.37,1946.8L2545.93,1931.07L2514.48,1881.94L2489.92,1897.67ZM956.972,1937.49C961.849,1917.31 966.133,1898.15 970.079,1879.93L976.253,1851.43L919.241,1839.08L913.067,1867.59C909.215,1885.38 905.033,1904.08 900.271,1923.79L893.42,1952.13L950.121,1965.84L956.972,1937.49ZM2638.01,1803.95C2622.5,1813.69 2605.98,1824.08 2588.59,1835.04L2563.91,1850.59L2595.02,1899.94L2619.69,1884.38C2637.05,1873.44 2653.55,1863.08 2669.03,1853.35L2693.73,1837.84L2662.71,1788.44L2638.01,1803.95ZM2769.59,1708.14C2760.26,1721.07 2748.81,1732.54 2735.03,1742.4L2711.31,1759.37L2745.25,1806.81L2768.97,1789.84C2788.08,1776.17 2803.93,1760.22 2816.88,1742.3L2833.95,1718.65L2786.67,1684.5L2769.59,1708.14ZM995.304,1767.43C1000.24,1748.86 1005.64,1731.66 1012.23,1715.62L1023.31,1688.64L969.359,1666.47L958.273,1693.45C950.767,1711.72 944.551,1731.29 938.928,1752.44L931.436,1780.63L987.812,1795.62L995.304,1767.43ZM1071.42,1633.09C1083.85,1622.63 1098.26,1612.75 1115.07,1603.23L1140.45,1588.86L1111.71,1538.1L1086.33,1552.47C1066.11,1563.92 1048.82,1575.88 1033.86,1588.46L1011.55,1607.24L1049.11,1651.87L1071.42,1633.09ZM2804.87,1559.28C2805.5,1578.06 2804.95,1596.1 2803,1613.27L2799.72,1642.25L2857.68,1648.81L2860.97,1619.83C2863.22,1599.96 2863.9,1579.07 2863.17,1557.33L2862.2,1528.18L2803.9,1530.12L2804.87,1559.28ZM1217.5,1558.88C1236.87,1551.88 1254.98,1545.61 1271.98,1539.88L1299.62,1530.55L1280.97,1475.28L1253.33,1484.6C1235.96,1490.46 1217.45,1496.87 1197.66,1504.02L1170.23,1513.94L1190.07,1568.8L1217.5,1558.88ZM1383.15,1502.63C1403.9,1495.17 1422.61,1487.67 1439.93,1479.27L1466.18,1466.54L1440.73,1414.06L1414.48,1426.78C1398.91,1434.33 1382.06,1441.03 1363.41,1447.74L1335.96,1457.62L1355.71,1512.51L1383.15,1502.63ZM2777.41,1393.4C2782.33,1412.11 2786.73,1430.56 2790.49,1448.67L2796.42,1477.23L2853.54,1465.37L2847.6,1436.81C2843.64,1417.72 2839.01,1398.28 2833.83,1378.57L2826.41,1350.36L2770,1365.19L2777.41,1393.4ZM1541.19,1401.64C1553.52,1387.35 1565.77,1370.94 1578.31,1351.79L1594.28,1327.39L1545.48,1295.44L1529.5,1319.84C1518.52,1336.62 1507.83,1351.02 1497.03,1363.53L1477.97,1385.61L1522.14,1423.72L1541.19,1401.64ZM2725.02,1229.27C2731.61,1247.45 2738.01,1265.61 2744.12,1283.7L2753.45,1311.33L2808.72,1292.66L2799.38,1265.03C2793.13,1246.53 2786.6,1227.96 2779.85,1209.37L2769.9,1181.95L2715.07,1201.86L2725.02,1229.27ZM1636.99,1247.12C1644.26,1232.56 1651.77,1217.04 1659.58,1200.45C1660.59,1198.3 1661.61,1196.15 1662.61,1194.02L1675.08,1167.65L1622.34,1142.72L1609.88,1169.09C1608.86,1171.25 1607.83,1173.42 1606.81,1175.59C1599.2,1191.75 1591.88,1206.88 1584.8,1221.06L1571.77,1247.16L1623.96,1273.21L1636.99,1247.12ZM2251.58,766.326C2320.04,672.986 2430.48,612.355 2554.96,612.355C2762.48,612.355 2930.95,780.83 2930.95,988.344C2930.95,1087.56 2892.44,1177.85 2829.58,1245.06C2804.67,1171.95 2775.67,1097.93 2747.18,1026.98C2699.54,908.311 2654.38,849.115 2602.9,816.501C2565.59,792.868 2523.88,781.903 2471.8,777.274C2416.47,772.355 2346.53,774.829 2251.58,766.326ZM2662.3,1066.95C2669.46,1084.79 2676.66,1102.83 2683.81,1120.98L2694.51,1148.12L2748.78,1126.72L2738.08,1099.59C2730.88,1081.32 2723.64,1063.18 2716.44,1045.23L2705.58,1018.16L2651.44,1039.88L2662.3,1066.95ZM1713.81,1090.65C1723.08,1073.13 1732.27,1056.54 1741.52,1040.87L1756.33,1015.74L1706.08,986.113L1691.27,1011.24C1681.59,1027.65 1671.95,1045.03 1662.25,1063.39L1648.61,1089.17L1700.18,1116.44L1713.81,1090.65ZM2584.06,922.671C2594.47,934.345 2604.5,948.467 2614.55,965.492L2629.38,990.608L2679.62,960.949L2664.79,935.834C2652.56,915.134 2640.26,898.042 2627.6,883.849L2608.19,862.079L2564.65,900.901L2584.06,922.671ZM1805.33,949.853C1817.51,935.859 1830.16,923.259 1843.5,912.06L1865.85,893.314L1828.36,848.625L1806.01,867.372C1790.4,880.469 1775.59,895.178 1761.34,911.545L1742.18,933.541L1786.17,971.849L1805.33,949.853ZM2446.47,869.303C2466.17,870.516 2483.98,872.335 2500.35,875.649L2528.94,881.438L2540.51,824.265L2511.93,818.476C2493.13,814.67 2472.68,812.474 2450.05,811.08L2420.94,809.287L2417.35,867.51L2446.47,869.303ZM1935.15,861.305C1951.44,856.036 1968.78,851.999 1987.35,849.144L2016.18,844.713L2007.32,787.057L1978.49,791.488C1956.68,794.84 1936.32,799.616 1917.19,805.802L1889.44,814.778L1907.39,870.28L1935.15,861.305ZM2271.35,861.832C2292.28,863.33 2311.95,864.351 2330.47,865.114L2359.61,866.316L2362.01,808.032L2332.87,806.83C2314.9,806.09 2295.82,805.1 2275.51,803.648L2246.42,801.567L2242.26,859.751L2271.35,861.832ZM2097.81,844.858C2115.7,845.771 2134.46,847.337 2154.17,849.543L2183.16,852.787L2189.65,794.816L2160.66,791.572C2139.72,789.228 2119.79,787.57 2100.78,786.6L2071.65,785.114L2068.68,843.372L2097.81,844.858Z"})}),Qve=$0({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:_("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),Jve=$0({displayName:"OutpaintIcon",viewBox:"0 0 3543 3543",path:_("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,766.352C3543.31,516.705 3340.63,314.024 3090.98,314.024L452.328,314.024C202.681,314.024 0,516.705 0,766.352L0,2776.95C0,3026.6 202.681,3229.28 452.328,3229.28C452.328,3229.28 3090.98,3229.28 3090.98,3229.28C3340.63,3229.28 3543.31,3026.6 3543.31,2776.95C3543.31,2776.95 3543.31,766.352 3543.31,766.352ZM3454.26,766.352L3454.26,2776.95C3454.26,2977.46 3291.48,3140.24 3090.98,3140.24L452.328,3140.24C251.825,3140.24 89.043,2977.46 89.043,2776.95C89.043,2776.95 89.043,766.352 89.043,766.352C89.043,565.849 251.825,403.067 452.328,403.067C452.328,403.067 3090.98,403.067 3090.98,403.067C3291.48,403.067 3454.26,565.849 3454.26,766.352ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265Z"})}),e2e=$0({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:_("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),t2e=$0({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:_("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:_("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})});var go=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e))(go||{});const n2e={[0]:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:"ImageToImage allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},Wl=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return _(Sd,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,...i,children:ae(ph,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",...o,children:[t,_(m_,{className:"invokeai__switch-root",...s})]})})};function z_(){const e=qe(i=>i.system.isGFPGANAvailable),t=qe(i=>i.options.shouldRunFacetool),n=bt();return ae(zn,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[_("p",{children:"Restore Face"}),_(Wl,{isDisabled:!e,isChecked:t,onChange:i=>n(P6e(i.target.checked))})]})}const OL=/^-?(0\.)?\.?$/,yo=e=>{const{label:t,styleClass:n,isDisabled:r=!1,showStepper:i=!0,width:o,textAlign:a,isInvalid:s,value:l,onChange:d,min:p,max:g,isInteger:m=!0,formControlProps:y,formLabelProps:x,numberInputFieldProps:S,numberInputStepperProps:E,tooltipProps:P,...k}=e,[T,M]=w.exports.useState(String(l));w.exports.useEffect(()=>{!T.match(OL)&&l!==Number(T)&&M(String(l))},[l,T]);const N=z=>{M(z),z.match(OL)||d(m?Math.floor(Number(z)):Number(z))},F=z=>{const B=tn.clamp(m?Math.floor(Number(z.target.value)):Number(z.target.value),p,g);M(String(B)),d(B)};return _(mi,{...P,children:ae(Sd,{isDisabled:r,isInvalid:s,className:n?`invokeai__number-input-form-control ${n}`:"invokeai__number-input-form-control",...y,children:[_(ph,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},...x,children:t}),ae(Rz,{className:"invokeai__number-input-root",value:T,keepWithinRange:!0,clampValueOnBlur:!1,onChange:N,onBlur:F,width:o,...k,children:[_(Oz,{className:"invokeai__number-input-field",textAlign:a,...S}),ae("div",{className:"invokeai__number-input-stepper",style:i?{display:"block"}:{display:"none"},children:[_(zz,{...E,className:"invokeai__number-input-stepper-button"}),_(Dz,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},_v=e=>{const{label:t,isDisabled:n,validValues:r,size:i="sm",fontSize:o="md",styleClass:a,...s}=e;return ae(Sd,{isDisabled:n,className:`invokeai__select ${a}`,children:[_(ph,{fontSize:o,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",className:"invokeai__select-label",children:t}),_(Hz,{fontSize:o,size:i,...s,className:"invokeai__select-picker",children:r.map(l=>typeof l=="string"||typeof l=="number"?_("option",{value:l,className:"invokeai__select-option",children:l},l):_("option",{value:l.value,children:l.key},l.value))})]})},r2e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_euler","k_euler_a","k_heun"],i2e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],o2e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],a2e=[{key:"2x",value:2},{key:"4x",value:4}],F_=0,$_=4294967295,s2e=["gfpgan","codeformer"],l2e=xn(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),u2e=xn(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),hb=()=>{const e=bt(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=qe(l2e),{isGFPGANAvailable:i}=qe(u2e),o=l=>e(f5(l)),a=l=>e(cH(l)),s=l=>e(h5(l.target.value));return ae(zn,{direction:"column",gap:2,children:[_(_v,{label:"Type",validValues:s2e.concat(),value:n,onChange:s}),_(yo,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&_(yo,{isDisabled:!i,label:"Fidelity",step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};function c2e(){const e=bt(),t=qe(r=>r.options.shouldFitToWidthHeight);return _(Wl,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:r=>e(dH(r.target.checked))})}function i$(e){const{label:t="Strength",styleClass:n}=e,r=qe(a=>a.options.img2imgStrength),i=bt();return _(yo,{label:t,step:.01,min:.01,max:.99,onChange:a=>i(uH(a)),value:r,width:"100%",isInteger:!1,styleClass:n})}const o$=()=>_(Bl,{flex:"1",textAlign:"left",children:"Other Options"}),d2e=()=>{const e=bt(),t=qe(r=>r.options.hiresFix);return _(zn,{gap:2,direction:"column",children:_(Wl,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:r=>e(lH(r.target.checked))})})},f2e=()=>{const e=bt(),t=qe(r=>r.options.seamless);return _(zn,{gap:2,direction:"column",children:_(Wl,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:r=>e(sH(r.target.checked))})})},a$=()=>ae(zn,{gap:2,direction:"column",children:[_(f2e,{}),_(d2e,{})]}),B_=()=>_(Bl,{flex:"1",textAlign:"left",children:"Seed"});function h2e(){const e=bt(),t=qe(r=>r.options.shouldRandomizeSeed);return _(Wl,{label:"Randomize Seed",isChecked:t,onChange:r=>e(L6e(r.target.checked))})}function p2e(){const e=qe(o=>o.options.seed),t=qe(o=>o.options.shouldRandomizeSeed),n=qe(o=>o.options.shouldGenerateVariations),r=bt(),i=o=>r(Tv(o));return _(yo,{label:"Seed",step:1,precision:0,flexGrow:1,min:F_,max:$_,isDisabled:t,isInvalid:e<0&&n,onChange:i,value:e,width:"10rem"})}const s$=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function g2e(){const e=bt(),t=qe(r=>r.options.shouldRandomizeSeed);return _(Xa,{size:"sm",isDisabled:t,onClick:()=>e(Tv(s$(F_,$_))),children:_("p",{children:"Shuffle"})})}function m2e(){const e=bt(),t=qe(r=>r.options.threshold);return _(yo,{label:"Threshold",min:0,max:1e3,step:.1,onChange:r=>e(w6e(r)),value:t,isInteger:!1})}function v2e(){const e=bt(),t=qe(r=>r.options.perlin);return _(yo,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:r=>e(C6e(r)),value:t,isInteger:!1})}const H_=()=>ae(zn,{gap:2,direction:"column",children:[_(h2e,{}),ae(zn,{gap:2,children:[_(p2e,{}),_(g2e,{})]}),_(zn,{gap:2,children:_(m2e,{})}),_(zn,{gap:2,children:_(v2e,{})})]});function W_(){const e=qe(i=>i.system.isESRGANAvailable),t=qe(i=>i.options.shouldRunESRGAN),n=bt();return ae(zn,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[_("p",{children:"Upscale"}),_(Wl,{isDisabled:!e,isChecked:t,onChange:i=>n(T6e(i.target.checked))})]})}const y2e=xn(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),b2e=xn(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),pb=()=>{const e=bt(),{upscalingLevel:t,upscalingStrength:n}=qe(y2e),{isESRGANAvailable:r}=qe(b2e);return ae("div",{className:"upscale-options",children:[_(_v,{isDisabled:!r,label:"Scale",value:t,onChange:a=>e(OC(Number(a.target.value))),validValues:a2e}),_(yo,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:a=>e(NC(a)),value:n,isInteger:!1})]})};function x2e(){const e=qe(r=>r.options.shouldGenerateVariations),t=bt();return _(Wl,{isChecked:e,width:"auto",onChange:r=>t(_6e(r.target.checked))})}function V_(){return ae(zn,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[_("p",{children:"Variations"}),_(x2e,{})]})}function S2e(e){const{label:t,styleClass:n,isDisabled:r=!1,fontSize:i="1rem",width:o,isInvalid:a,...s}=e;return ae(Sd,{className:`input ${n}`,isInvalid:a,isDisabled:r,flexGrow:1,children:[_(ph,{fontSize:i,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t}),_(B8,{...s,className:"input-entry",size:"sm",width:o})]})}function w2e(){const e=qe(i=>i.options.seedWeights),t=qe(i=>i.options.shouldGenerateVariations),n=bt(),r=i=>n(fH(i.target.value));return _(S2e,{label:"Seed Weights",value:e,isInvalid:t&&!(N_(e)||e===""),isDisabled:!t,onChange:r})}function C2e(){const e=qe(i=>i.options.variationAmount),t=qe(i=>i.options.shouldGenerateVariations),n=bt();return _(yo,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i=>n(k6e(i)),isInteger:!1})}const U_=()=>ae(zn,{gap:2,direction:"column",children:[_(C2e,{}),_(w2e,{})]}),qm=e=>{const{label:t,styleClass:n,...r}=e;return _(lD,{className:`invokeai__checkbox ${n}`,...r,children:t})};function G_(){const e=qe(r=>r.options.showAdvancedOptions),t=bt();return _(qm,{label:"Advanced Options",styleClass:"advanced-options-checkbox",onChange:r=>t(A6e(r.target.checked)),isChecked:e})}function _2e(){const e=bt(),t=qe(r=>r.options.cfgScale);return _(yo,{label:"CFG Scale",step:.5,min:1.01,max:30,onChange:r=>e(rH(r)),value:t,width:j_,fontSize:q0,styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function k2e(){const{activeTab:e,height:t}=qe(i=>i.options),n=bt(),r=i=>n(iH(Number(i.target.value)));return _(_v,{isDisabled:Ko[e]==="inpainting",label:"Height",value:t,flexGrow:1,onChange:r,validValues:o2e,fontSize:q0,styleClass:"main-option-block"})}function E2e(){const e=bt(),t=qe(r=>r.options.iterations);return _(yo,{label:"Images",step:1,min:1,max:9999,onChange:r=>e(S6e(r)),value:t,width:j_,fontSize:q0,styleClass:"main-option-block",textAlign:"center"})}function P2e(){const e=qe(r=>r.options.sampler),t=bt();return _(_v,{label:"Sampler",value:e,onChange:r=>t(aH(r.target.value)),validValues:r2e,fontSize:q0,styleClass:"main-option-block"})}function T2e(){const e=bt(),t=qe(r=>r.options.steps);return _(yo,{label:"Steps",min:1,max:9999,step:1,onChange:r=>e(nH(r)),value:t,width:j_,fontSize:q0,styleClass:"main-option-block",textAlign:"center"})}function L2e(){const{width:e,activeTab:t}=qe(i=>i.options),n=bt(),r=i=>n(oH(Number(i.target.value)));return _(_v,{isDisabled:Ko[t]==="inpainting",label:"Width",value:e,flexGrow:1,onChange:r,validValues:i2e,fontSize:q0,styleClass:"main-option-block"})}const q0="0.9rem",j_="auto";function K_(){return _("div",{className:"main-options",children:ae("div",{className:"main-options-list",children:[ae("div",{className:"main-options-row",children:[_(E2e,{}),_(T2e,{}),_(_2e,{})]}),ae("div",{className:"main-options-row",children:[_(L2e,{}),_(k2e,{}),_(P2e,{})]})]})})}const A2e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgress:!1,shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},hasError:!1,wasErrorSeen:!0,isCancelable:!0},I2e=A2e,l$=eb({name:"system",initialState:I2e,reducers:{setShouldDisplayInProgress:(e,t)=>{e.shouldDisplayInProgress=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload}}}),{setShouldDisplayInProgress:M2e,setIsProcessing:qf,addLogEntry:Mi,setShouldShowLogViewer:NL,setIsConnected:DL,setSocketId:f8e,setShouldConfirmOnDelete:u$,setOpenAccordions:R2e,setSystemStatus:O2e,setCurrentStatus:s5,setSystemConfig:N2e,setShouldDisplayGuides:D2e,processingCanceled:z2e,errorOccurred:nC,errorSeen:c$,setModelList:zL,setIsCancelable:rC}=l$.actions,F2e=l$.reducer;var d$={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},FL=le.createContext&&le.createContext(d$),ad=globalThis&&globalThis.__assign||function(){return ad=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.system,e=>e.shouldDisplayGuides),J2e=({children:e,feature:t})=>{const n=qe(Q2e),{text:r}=n2e[t];return n?ae(G4,{trigger:"hover",children:[_(q4,{children:_(Bl,{children:e})}),ae(K4,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[_(j4,{className:"guide-popover-arrow"}),_("div",{className:"guide-popover-guide-content",children:r})]})]}):null},eye=Ie(({feature:e,icon:t=h$},n)=>_(J2e,{feature:e,children:_(Bl,{ref:n,children:_(Ea,{as:t})})}));function tye(e){const{header:t,feature:n,options:r}=e;return ae(Gf,{className:"advanced-settings-item",children:[_("h2",{children:ae(Vf,{className:"advanced-settings-header",children:[t,_(eye,{feature:n}),_(Uf,{})]})}),_(jf,{className:"advanced-settings-panel",children:r})]})}const q_=e=>{const{accordionInfo:t}=e,n=qe(a=>a.system.openAccordions),r=bt();return _(O4,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(R2e(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{a.push(_(tye,{header:t[s].header,feature:t[s].feature,options:t[s].options},s))}),a})()})},iC=Ji("socketio/generateImage"),nye=Ji("socketio/runESRGAN"),rye=Ji("socketio/runFacetool"),iye=Ji("socketio/deleteImage"),oC=Ji("socketio/requestImages"),$L=Ji("socketio/requestNewImages"),oye=Ji("socketio/cancelProcessing"),BL=Ji("socketio/uploadImage");Ji("socketio/uploadMaskImage");const aye=Ji("socketio/requestSystemConfig"),sye=Ji("socketio/requestModelChange"),k3=e=>{const{label:t,tooltip:n="",size:r="sm",...i}=e;return _(mi,{label:n,children:_(Xa,{size:r,...i,children:t})})},lye=xn([e=>e.options,e=>e.system,e=>e.inpainting],(e,t,n)=>({prompt:e.prompt,shouldGenerateVariations:e.shouldGenerateVariations,seedWeights:e.seedWeights,maskPath:e.maskPath,initialImage:e.initialImage,seed:e.seed,activeTabName:Ko[e.activeTab],isProcessing:t.isProcessing,isConnected:t.isConnected,hasInpaintingImage:Boolean(n.imageToInpaint)}),{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),m$=()=>{const{prompt:e,shouldGenerateVariations:t,seedWeights:n,maskPath:r,initialImage:i,seed:o,activeTabName:a,isProcessing:s,isConnected:l,hasInpaintingImage:d}=qe(lye);return w.exports.useMemo(()=>!(!e||Boolean(e.match(/^[\s\r\n]+$/))||a==="img2img"&&!i||a==="inpainting"&&!d||r&&!i||s||!l||t&&(!(N_(n)||n==="")||o===-1)),[e,r,s,i,l,t,n,o,a,d])};function uye(){const e=bt(),t=m$(),n=qe(i=>i.options.activeTab);return _(k3,{label:"Invoke","aria-label":"Invoke",type:"submit",isDisabled:!t,onClick:()=>{e(iC(Ko[n]))},className:"invoke-btn"})}const Pn=e=>{const{tooltip:t="",tooltipPlacement:n="bottom",styleClass:r,onClick:i,cursor:o,...a}=e;return _(mi,{label:t,hasArrow:!0,placement:n,children:_(Xi,{className:`icon-button ${r}`,...a,cursor:o||(i?"pointer":"unset"),onClick:i})})},cye=xn(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:tn.isEqual}});function dye(){const e=bt(),{isProcessing:t,isConnected:n,isCancelable:r}=qe(cye),i=()=>e(oye());return Ut("shift+x",()=>{(n||t)&&r&&i()},[n,t,r]),_(Pn,{icon:_(X2e,{}),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!n||!t||!r,onClick:i,styleClass:"cancel-btn"})}const Z_=()=>ae("div",{className:"process-buttons",children:[_(uye,{}),_(dye,{})]}),fye=xn(e=>e.options,e=>({prompt:e.prompt,activeTabName:Ko[e.activeTab]}),{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),Y_=()=>{const e=w.exports.useRef(null),{prompt:t,activeTabName:n}=qe(fye),r=bt(),i=m$(),o=s=>{r(b7(s.target.value))};Ut("ctrl+enter, cmd+enter",()=>{i&&r(iC(n))},[i,n]),Ut("alt+a",()=>{e.current?.focus()},[]);const a=s=>{s.key==="Enter"&&s.shiftKey===!1&&i&&(s.preventDefault(),r(iC(n)))};return _("div",{className:"prompt-bar",children:_(Sd,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:_(sF,{id:"prompt",name:"prompt",placeholder:"I'm dreaming of...",size:"lg",value:t,onChange:o,onKeyDown:a,resize:"vertical",height:30,ref:e})})})};function hye(){const e=qe(n=>n.options.showAdvancedOptions),t={seed:{header:_(B_,{}),feature:go.SEED,options:_(H_,{})},variations:{header:_(V_,{}),feature:go.VARIATIONS,options:_(U_,{})},face_restore:{header:_(z_,{}),feature:go.FACE_CORRECTION,options:_(hb,{})},upscale:{header:_(W_,{}),feature:go.UPSCALE,options:_(pb,{})},other:{header:_(o$,{}),feature:go.OTHER,options:_(a$,{})}};return ae("div",{className:"image-to-image-panel",children:[_(Y_,{}),_(Z_,{}),_(K_,{}),_(i$,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),_(c2e,{}),_(G_,{}),e?_(q_,{accordionInfo:t}):null]})}function pye(e){return Tt({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 gye(e){return Tt({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 mye(e){return Tt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function vye(e){return Tt({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 yye(e){return Tt({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 bye(e){return Tt({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 xye(e){return Tt({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 v$(e){return Tt({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 Sye(e){return Tt({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 wye(e){return Tt({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 Cye(e){return Tt({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 _ye(e){return Tt({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 kye(e){return Tt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"}}]})(e)}function y$(e){return Tt({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 Eye(e){return Tt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function Pye(e){return Tt({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 Tye(e){return Tt({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 Lye(e){return Tt({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 Aye(e){return Tt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"}}]})(e)}function Iye(e){return Tt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 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-16z"}}]})(e)}function Mye(e){return Tt({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 Rye(e){return Tt({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 Oye(e){return Tt({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 Nye(e){return Tt({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 Dye(e){return Tt({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 b$=w.exports.createContext(null),x$=e=>{const{styleClass:t}=e,n=w.exports.useContext(b$),r=()=>{n&&n()};return _("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:ae("div",{className:"image-upload-button",children:[_(Oye,{}),_(Qf,{size:"lg",children:"Click or Drag and Drop"})]})})},zye=xn(e=>e.system,e=>e.shouldConfirmOnDelete),aC=w.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=u3(),a=bt(),s=qe(zye),l=w.exports.useRef(null),d=Wu(),p=y=>{y.stopPropagation(),s?i():g()},g=()=>{a(iye(e)),d({title:"Image Deleted",status:"success",duration:2500,isClosable:!0}),o()};Ut("del",()=>{s?i():g()},[e,s]);const m=y=>a(u$(!y.target.checked));return ae(jn,{children:[w.exports.cloneElement(t,{onClick:p,ref:n}),_(aue,{isOpen:r,leastDestructiveRef:l,onClose:o,children:_(Hm,{children:ae(sue,{children:[_(c_,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),_(h3,{children:ae(zn,{direction:"column",gap:5,children:[_(Fo,{children:"Are you sure? You can't undo this action afterwards."}),_(Sd,{children:ae(zn,{alignItems:"center",children:[_(ph,{mb:0,children:"Don't ask me again"}),_(m_,{checked:!s,onChange:m})]})})]})}),ae(u_,{children:[_(Xa,{ref:l,onClick:o,children:"Cancel"}),_(Xa,{colorScheme:"red",onClick:g,ml:3,children:"Delete"})]})]})})})]})}),HL=({title:e="Popup",styleClass:t,delay:n=50,popoverOptions:r,actionButton:i,children:o})=>ae(G4,{trigger:"hover",closeDelay:n,children:[_(q4,{children:_(Bl,{children:o})}),ae(K4,{className:`popover-content ${t}`,children:[_(j4,{className:"popover-arrow"}),_(Fz,{className:"popover-header",children:e}),ae("div",{className:"popover-options",children:[r||null,i]})]})]}),No=(e,t)=>Math.floor(e/t)*t,WL=(e,t)=>Math.round(e/t)*t,Fye={tool:"brush",brushSize:50,maskColor:{r:255,g:90,b:90,a:.5},canvasDimensions:{width:0,height:0},boundingBoxDimensions:{width:64,height:64},boundingBoxCoordinate:{x:0,y:0},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.7},shouldShowBoundingBox:!1,shouldShowBoundingBoxFill:!1,cursorPosition:null,lines:[],pastLines:[],futureLines:[],shouldShowMask:!0,shouldInvertMask:!1,shouldShowCheckboardTransparency:!1,shouldShowBrush:!0,shouldShowBrushPreview:!1,needsCache:!1,isDrawing:!1,stageScale:1,shouldUseInpaintReplace:!1,inpaintReplace:1,shouldLockBoundingBox:!0},$ye=Fye,S$=eb({name:"inpainting",initialState:$ye,reducers:{setTool:(e,t)=>{e.tool=t.payload},toggleTool:e=>{e.tool=e.tool==="brush"?"eraser":"brush"},setBrushSize:(e,t)=>{e.brushSize=t.payload},addLine:(e,t)=>{e.pastLines.push(e.lines),e.lines.push(t.payload),e.futureLines=[]},addPointToCurrentLine:(e,t)=>{e.lines[e.lines.length-1].points.push(...t.payload)},undo:e=>{if(e.pastLines.length===0)return;const t=e.pastLines.pop();!t||(e.futureLines.unshift(e.lines),e.lines=t)},redo:e=>{if(e.futureLines.length===0)return;const t=e.futureLines.shift();!t||(e.pastLines.push(e.lines),e.lines=t)},clearMask:e=>{e.pastLines.push(e.lines),e.lines=[],e.futureLines=[],e.shouldInvertMask=!1},toggleShouldInvertMask:e=>{e.shouldInvertMask=!e.shouldInvertMask},toggleShouldShowMask:e=>{e.shouldShowMask=!e.shouldShowMask},setShouldInvertMask:(e,t)=>{e.shouldInvertMask=t.payload},setShouldShowMask:(e,t)=>{e.shouldShowMask=t.payload,t.payload||(e.shouldInvertMask=!1)},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setMaskColor:(e,t)=>{e.maskColor=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},clearImageToInpaint:e=>{e.imageToInpaint=void 0},setImageToInpaint:(e,t)=>{const{width:n,height:r}=t.payload,{width:i,height:o}=e.boundingBoxDimensions,{x:a,y:s}=e.boundingBoxCoordinate,l=No(tn.clamp(i,64,n),64),d=No(tn.clamp(o,64,r),64),p=No(tn.clamp(a,0,n-l),64),g=No(tn.clamp(s,0,r-d),64);e.boundingBoxDimensions={width:l,height:d},e.boundingBoxCoordinate={x:p,y:g},e.canvasDimensions={width:n,height:r},e.imageToInpaint=t.payload,e.needsCache=!0},setCanvasDimensions:(e,t)=>{e.canvasDimensions=t.payload;const{width:n,height:r}=t.payload,{width:i,height:o}=e.boundingBoxDimensions,a=No(tn.clamp(i,64,n),64),s=No(tn.clamp(o,64,r),64);e.boundingBoxDimensions={width:a,height:s}},setBoundingBoxDimensions:(e,t)=>{e.boundingBoxDimensions=t.payload;const{width:n,height:r}=t.payload,{x:i,y:o}=e.boundingBoxCoordinate,{width:a,height:s}=e.canvasDimensions,l=No(a,64),d=No(s,64),p=No(n,64),g=No(r,64),m=i+n-a,y=o+r-s,x=tn.clamp(p,64,l),S=tn.clamp(g,64,d),E=m>0?i-m:i,P=y>0?o-y:o,k=tn.clamp(E,0,l-x),T=tn.clamp(P,0,d-S);e.boundingBoxDimensions={width:x,height:S},e.boundingBoxCoordinate={x:k,y:T}},setBoundingBoxCoordinate:(e,t)=>{e.boundingBoxCoordinate=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setNeedsCache:(e,t)=>{e.needsCache=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload,e.needsCache=!1},setShouldShowBoundingBoxFill:(e,t)=>{e.shouldShowBoundingBoxFill=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setClearBrushHistory:e=>{e.pastLines=[],e.futureLines=[]},setShouldUseInpaintReplace:(e,t)=>{e.shouldUseInpaintReplace=t.payload},setInpaintReplace:(e,t)=>{e.inpaintReplace=t.payload},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox}}}),{setTool:VL,setBrushSize:Bye,addLine:UL,addPointToCurrentLine:GL,setShouldInvertMask:Hye,setShouldShowMask:Wye,setShouldShowCheckboardTransparency:h8e,setShouldShowBrushPreview:_S,setMaskColor:Vye,clearMask:Uye,clearImageToInpaint:X_,undo:Gye,redo:jye,setCursorPosition:jL,setCanvasDimensions:p8e,setImageToInpaint:Q_,setBoundingBoxDimensions:Sg,setBoundingBoxCoordinate:KL,setBoundingBoxPreviewFill:g8e,setNeedsCache:Df,setStageScale:Kye,toggleTool:qye,setShouldShowBoundingBoxFill:Zye,setIsDrawing:wg,setShouldShowBrush:m8e,setShouldShowBoundingBox:Yye,setClearBrushHistory:Xye,setShouldUseInpaintReplace:Qye,setInpaintReplace:Jye,setShouldLockBoundingBox:w$,toggleShouldLockBoundingBox:e5e}=S$.actions,t5e=S$.reducer,n5e=xn([e=>e.gallery,e=>e.options],(e,t)=>{const{categories:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryImageObjectFit:d,shouldHoldGalleryOpen:p,shouldAutoSwitchToNewImages:g,galleryWidth:m}=e,{activeTab:y}=t;return{currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryImageObjectFit:d,galleryGridTemplateColumns:`repeat(auto-fill, minmax(${l}px, auto))`,activeTabName:Ko[y],shouldHoldGalleryOpen:p,shouldAutoSwitchToNewImages:g,images:n[r].images,areMoreImagesAvailable:n[r].areMoreImagesAvailable,currentCategory:r,galleryWidth:m}}),C$=xn([e=>e.options,e=>e.gallery],(e,t)=>({galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,activeTabName:Ko[e.activeTab]})),r5e=xn(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isGFPGANAvailable:e.isGFPGANAvailable,isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),i5e=({image:e})=>{const t=bt(),{activeTabName:n}=qe(C$),r=qe(T=>T.options.shouldShowImageDetails),i=Wu(),o=qe(T=>T.gallery.intermediateImage),a=qe(T=>T.options.upscalingLevel),s=qe(T=>T.options.facetoolStrength),{isProcessing:l,isConnected:d,isGFPGANAvailable:p,isESRGANAvailable:g}=qe(r5e),m=()=>{t(Pb(e)),t(Ua(1))};Ut("shift+i",()=>{e?(m(),i({title:"Sent To Image To Image",status:"success",duration:2500,isClosable:!0})):i({title:"No Image Loaded",description:"No image found to send to image to image module.",status:"error",duration:2500,isClosable:!0})},[e]);const y=()=>e.metadata&&t(E6e(e.metadata));Ut("a",()=>{["txt2img","img2img"].includes(e?.metadata?.image?.type)?(y(),i({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})):i({title:"Parameters Not Set",description:"No metadata found for this image.",status:"error",duration:2500,isClosable:!0})},[e]);const x=()=>e.metadata&&t(Tv(e.metadata.image.seed));Ut("s",()=>{e?.metadata?.image?.seed?(x(),i({title:"Seed Set",status:"success",duration:2500,isClosable:!0})):i({title:"Seed Not Set",description:"Could not find seed for this image.",status:"error",duration:2500,isClosable:!0})},[e]);const S=()=>t(nye(e));Ut("u",()=>{g&&Boolean(!o)&&d&&!l&&a?S():i({title:"Upscaling Failed",status:"error",duration:2500,isClosable:!0})},[e,g,o,d,l,a]);const E=()=>t(rye(e));Ut("r",()=>{p&&Boolean(!o)&&d&&!l&&s?E():i({title:"Face Restoration Failed",status:"error",duration:2500,isClosable:!0})},[e,p,o,d,l,s]);const P=()=>t(I6e(!r)),k=()=>{t(Q_(e)),n!=="inpainting"&&t(Ua("inpainting")),i({title:"Sent to Inpainting",status:"success",duration:2500,isClosable:!0})};return Ut("i",()=>{e?P():i({title:"Failed to load metadata",status:"error",duration:2500,isClosable:!0})},[e,r]),ae("div",{className:"current-image-options",children:[_(Pn,{icon:_(Z2e,{}),tooltip:"Send To Image To Image","aria-label":"Send To Image To Image",onClick:m}),_(Pn,{icon:_(y$,{}),tooltip:"Send To Inpainting","aria-label":"Send To Inpainting",onClick:k}),_(Pn,{icon:_(v$,{}),tooltip:"Use All","aria-label":"Use All",isDisabled:!["txt2img","img2img"].includes(e?.metadata?.image?.type),onClick:y}),_(Pn,{icon:_(Lye,{}),tooltip:"Use Seed","aria-label":"Use Seed",isDisabled:!e?.metadata?.image?.seed,onClick:x}),_(HL,{title:"Restore Faces",popoverOptions:_(hb,{}),actionButton:_(k3,{label:"Restore Faces",isDisabled:!p||Boolean(o)||!(d&&!l)||!s,onClick:E}),children:_(Pn,{icon:_(W2e,{}),"aria-label":"Restore Faces"})}),_(HL,{title:"Upscale",styleClass:"upscale-popover",popoverOptions:_(pb,{}),actionButton:_(k3,{label:"Upscale Image",isDisabled:!g||Boolean(o)||!(d&&!l)||!a,onClick:S}),children:_(Pn,{icon:_(j2e,{}),"aria-label":"Upscale"})}),_(Pn,{icon:_(V2e,{}),tooltip:"Details","aria-label":"Details",onClick:P}),_(aC,{image:e,children:_(Pn,{icon:_(H2e,{}),tooltip:"Delete Image","aria-label":"Delete Image",isDisabled:Boolean(o)})})]})},o5e={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300},_$=eb({name:"gallery",initialState:o5e,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=wa.exports.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,r==="result"&&(e.currentCategory="result")),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:(e,t)=>{const n=t.payload,{currentImage:r}=e,i=e.categories[n].images;if(r){const o=i.findIndex(a=>a.uuid===r.uuid);if(tn.inRange(o,0,i.length)){const a=i[o+1];e.currentImage=a,e.currentImageUuid=a.uuid}}},selectPrevImage:(e,t)=>{const n=t.payload,{currentImage:r}=e,i=e.categories[n].images;if(r){const o=i.findIndex(a=>a.uuid===r.uuid);if(tn.inRange(o,1,i.length+1)){const a=i[o-1];e.currentImage=a,e.currentImageUuid=a.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload}}}),{addImage:ry,clearIntermediateImage:qL,removeImage:a5e,setCurrentImage:k$,addGalleryImages:s5e,setIntermediateImage:l5e,selectNextImage:E$,selectPrevImage:P$,setShouldPinGallery:u5e,setShouldShowGallery:E3,setGalleryScrollPosition:c5e,setGalleryImageMinimumWidth:Ef,setGalleryImageObjectFit:d5e,setShouldHoldGalleryOpen:T$,setShouldAutoSwitchToNewImages:f5e,setCurrentCategory:iy,setGalleryWidth:oy}=_$.actions,h5e=_$.reducer;var ZL={path:ae("g",{stroke:"currentColor",strokeWidth:"1.5",children:[_("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"}),_("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),_("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},L$=Ie((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...d}=e,p=Pr("chakra-icon",s),g={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:p,__css:g},y=r??ZL.viewBox;if(n&&typeof n!="string")return le.createElement(Ce.svg,{as:n,...m,...d});const x=a??ZL.path;return le.createElement(Ce.svg,{verticalAlign:"middle",viewBox:y,...m,...d},x)});L$.displayName="Icon";function ht(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.exports.Children.toArray(e.path),a=Ie((s,l)=>_(L$,{ref:l,viewBox:t,...i,...s,children:o.length?o:_("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}ht({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});ht({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});ht({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});ht({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});ht({displayName:"SunIcon",path:ae("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[_("circle",{cx:"12",cy:"12",r:"5"}),_("path",{d:"M12 1v2"}),_("path",{d:"M12 21v2"}),_("path",{d:"M4.22 4.22l1.42 1.42"}),_("path",{d:"M18.36 18.36l1.42 1.42"}),_("path",{d:"M1 12h2"}),_("path",{d:"M21 12h2"}),_("path",{d:"M4.22 19.78l1.42-1.42"}),_("path",{d:"M18.36 5.64l1.42-1.42"})]})});ht({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});ht({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:_("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});ht({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});ht({displayName:"CheckCircleIcon",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"});ht({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});ht({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});ht({displayName:"ViewIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),_("circle",{cx:"12",cy:"12",r:"2"})]})});ht({displayName:"ViewOffIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),_("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})});ht({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});ht({displayName:"DeleteIcon",path:_("g",{fill:"currentColor",children:_("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"})})});ht({displayName:"RepeatIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),_("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})});ht({displayName:"RepeatClockIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),_("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"})]})});ht({displayName:"EditIcon",path:ae("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[_("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),_("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});ht({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});ht({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});ht({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});ht({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});ht({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});ht({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});ht({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});ht({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});ht({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var A$=ht({displayName:"ExternalLinkIcon",path:ae("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[_("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),_("path",{d:"M15 3h6v6"}),_("path",{d:"M10 14L21 3"})]})});ht({displayName:"LinkIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),_("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"})]})});ht({displayName:"PlusSquareIcon",path:ae("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[_("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),_("path",{d:"M12 8v8"}),_("path",{d:"M8 12h8"})]})});ht({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});ht({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});ht({displayName:"TimeIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),_("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"})]})});ht({displayName:"ArrowRightIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),_("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})});ht({displayName:"ArrowLeftIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),_("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})});ht({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});ht({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});ht({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});ht({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});ht({displayName:"EmailIcon",path:ae("g",{fill:"currentColor",children:[_("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),_("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"})]})});ht({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});ht({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});ht({displayName:"SpinnerIcon",path:ae(jn,{children:[_("defs",{children:ae("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[_("stop",{stopColor:"currentColor",offset:"0%"}),_("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),ae("g",{transform:"translate(2)",fill:"none",children:[_("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),_("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),_("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});ht({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"});ht({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:_("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});ht({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});ht({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",displayName:"TriangleDownIcon"});ht({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",displayName:"TriangleUpIcon"});ht({displayName:"InfoOutlineIcon",path:ae("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[_("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),_("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),_("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});ht({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});ht({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"});ht({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});ht({displayName:"QuestionOutlineIcon",path:ae("g",{stroke:"currentColor",strokeWidth:"1.5",children:[_("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"}),_("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),_("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});ht({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",displayName:"WarningIcon"});ht({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});ht({viewBox:"0 0 14 14",path:_("g",{fill:"currentColor",children:_("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});ht({displayName:"MinusIcon",path:_("g",{fill:"currentColor",children:_("rect",{height:"4",width:"20",x:"2",y:"10"})})});ht({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function p5e(e){return Tt({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 er=({label:e,value:t,onClick:n,isLink:r,labelPosition:i})=>ae(zn,{gap:2,children:[n&&_(mi,{label:`Recall ${e}`,children:_(Xi,{"aria-label":"Use this parameter",icon:_(p5e,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),ae(zn,{direction:i?"column":"row",children:[ae(Fo,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?ae(r0,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",_(A$,{mx:"2px"})]}):_(Fo,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),g5e=(e,t)=>e.image.uuid===t.image.uuid,m5e=w.exports.memo(({image:e,styleClass:t})=>{const n=bt(),r=e?.metadata?.image||{},{type:i,postprocessing:o,sampler:a,prompt:s,seed:l,variations:d,steps:p,cfg_scale:g,seamless:m,hires_fix:y,width:x,height:S,strength:E,fit:P,init_image_path:k,mask_image_path:T,orig_path:M,scale:N}=r,F=JSON.stringify(r,null,2);return _("div",{className:`image-metadata-viewer ${t}`,children:ae(zn,{gap:1,direction:"column",width:"100%",children:[ae(zn,{gap:2,children:[_(Fo,{fontWeight:"semibold",children:"File:"}),ae(r0,{href:e.url,isExternal:!0,children:[e.url,_(A$,{mx:"2px"})]})]}),Object.keys(r).length>0?ae(jn,{children:[i&&_(er,{label:"Generation type",value:i}),["esrgan","gfpgan"].includes(i)&&_(er,{label:"Original image",value:M}),i==="gfpgan"&&E!==void 0&&_(er,{label:"Fix faces strength",value:E,onClick:()=>n(f5(E))}),i==="esrgan"&&N!==void 0&&_(er,{label:"Upscaling scale",value:N,onClick:()=>n(OC(N))}),i==="esrgan"&&E!==void 0&&_(er,{label:"Upscaling strength",value:E,onClick:()=>n(NC(E))}),s&&_(er,{label:"Prompt",labelPosition:"top",value:a5(s),onClick:()=>n(b7(s))}),l!==void 0&&_(er,{label:"Seed",value:l,onClick:()=>n(Tv(l))}),a&&_(er,{label:"Sampler",value:a,onClick:()=>n(aH(a))}),p&&_(er,{label:"Steps",value:p,onClick:()=>n(nH(p))}),g!==void 0&&_(er,{label:"CFG scale",value:g,onClick:()=>n(rH(g))}),d&&d.length>0&&_(er,{label:"Seed-weight pairs",value:_3(d),onClick:()=>n(fH(_3(d)))}),m&&_(er,{label:"Seamless",value:m,onClick:()=>n(sH(m))}),y&&_(er,{label:"High Resolution Optimization",value:y,onClick:()=>n(lH(y))}),x&&_(er,{label:"Width",value:x,onClick:()=>n(oH(x))}),S&&_(er,{label:"Height",value:S,onClick:()=>n(iH(S))}),k&&_(er,{label:"Initial image",value:k,isLink:!0,onClick:()=>n(Pb(k))}),T&&_(er,{label:"Mask image",value:T,isLink:!0,onClick:()=>n(DC(T))}),i==="img2img"&&E&&_(er,{label:"Image to image strength",value:E,onClick:()=>n(uH(E))}),P&&_(er,{label:"Image to image fit",value:P,onClick:()=>n(dH(P))}),o&&o.length>0&&ae(jn,{children:[_(Qf,{size:"sm",children:"Postprocessing"}),o.map((z,B)=>{if(z.type==="esrgan"){const{scale:K,strength:j}=z;return ae(zn,{pl:"2rem",gap:1,direction:"column",children:[_(Fo,{size:"md",children:`${B+1}: Upscale (ESRGAN)`}),_(er,{label:"Scale",value:K,onClick:()=>n(OC(K))}),_(er,{label:"Strength",value:j,onClick:()=>n(NC(j))})]},B)}else if(z.type==="gfpgan"){const{strength:K}=z;return ae(zn,{pl:"2rem",gap:1,direction:"column",children:[_(Fo,{size:"md",children:`${B+1}: Face restoration (GFPGAN)`}),_(er,{label:"Strength",value:K,onClick:()=>{n(f5(K)),n(h5("gfpgan"))}})]},B)}else if(z.type==="codeformer"){const{strength:K,fidelity:j}=z;return ae(zn,{pl:"2rem",gap:1,direction:"column",children:[_(Fo,{size:"md",children:`${B+1}: Face restoration (Codeformer)`}),_(er,{label:"Strength",value:K,onClick:()=>{n(f5(K)),n(h5("codeformer"))}}),j&&_(er,{label:"Fidelity",value:j,onClick:()=>{n(cH(j)),n(h5("codeformer"))}})]},B)}})]}),ae(zn,{gap:2,direction:"column",children:[ae(zn,{gap:2,children:[_(mi,{label:"Copy metadata JSON",children:_(Xi,{"aria-label":"Copy metadata JSON",icon:_(v$,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(F)})}),_(Fo,{fontWeight:"semibold",children:"Metadata JSON:"})]}),_("div",{className:"image-json-viewer",children:_("pre",{children:F})})]})]}):_(bD,{width:"100%",pt:10,children:_(Fo,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},g5e),v5e=xn([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n}=e,{shouldShowImageDetails:r}=t,i=e.categories[n].images,o=i.findIndex(s=>s.uuid===e?.currentImage?.uuid),a=i.length;return{currentCategory:n,isOnFirstImage:o===0,isOnLastImage:!isNaN(o)&&o===a-1,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}});function y5e(e){const{imageToDisplay:t}=e,n=bt(),{isOnFirstImage:r,isOnLastImage:i,currentCategory:o,shouldShowImageDetails:a}=qe(v5e),[s,l]=w.exports.useState(!1),d=()=>{l(!0)},p=()=>{l(!1)},g=()=>{n(P$(o))},m=()=>{n(E$(o))};return ae("div",{className:"current-image-preview",children:[_(D4,{src:t.url,width:t.width,height:t.height}),!a&&ae("div",{className:"current-image-next-prev-buttons",children:[_("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:d,onMouseOut:p,children:s&&!r&&_(Xi,{"aria-label":"Previous image",icon:_(vye,{className:"next-prev-button"}),variant:"unstyled",onClick:g})}),_("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:d,onMouseOut:p,children:s&&!i&&_(Xi,{"aria-label":"Next image",icon:_(yye,{className:"next-prev-button"}),variant:"unstyled",onClick:m})})]}),a&&_(m5e,{image:t,styleClass:"current-image-metadata"})]})}const b5e=xn([e=>e.gallery,e=>e.options],(e,t)=>{const{currentImage:n,intermediateImage:r}=e,{activeTab:i,shouldShowImageDetails:o}=t;return{currentImage:n,intermediateImage:r,activeTabName:Ko[i],shouldShowImageDetails:o}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),J_=()=>{const{currentImage:e,intermediateImage:t,activeTabName:n}=qe(b5e),r=t||e;return _("div",{className:"current-image-area","data-tab-name":n,children:r?ae(jn,{children:[_(i5e,{image:r}),_(y5e,{imageToDisplay:r})]}):_("div",{className:"current-image-display-placeholder",children:_(Y2e,{})})})};function x5e(){const{initialImage:e}=qe(o=>o.options),t=bt(),n=Wu(),r=o=>{o.stopPropagation(),t(zC())},i=()=>{n({title:"Problem loading parameters",description:"Unable to load init image.",status:"error",isClosable:!0}),t(zC())};return ae(jn,{children:[ae("div",{className:"init-image-preview-header",children:[_("h2",{children:"Initial Image"}),_(Xi,{isDisabled:!e,"aria-label":"Reset Initial Image",onClick:r,icon:_(p$,{})})]}),e&&_("div",{className:"init-image-preview",children:_(D4,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const S5e=()=>{const e=qe(r=>r.options.initialImage),{currentImage:t}=qe(r=>r.gallery);return ae("div",{className:"workarea-split-view",children:[_("div",{className:"workarea-split-view-left",children:e?_("div",{className:"image-to-image-area",children:_(x5e,{})}):_(x$,{})}),t&&_("div",{className:"workarea-split-view-right",children:_(J_,{})})]})};var w5e=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){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gr=globalThis&&globalThis.__assign||function(){return Gr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},L5e=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],eA="__resizable_base__",I$=function(e){k5e(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(eA):o.className+=eA,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;!o||o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||E5e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),d=Number(n.state[s].toString().replace("px","")),p=d/l[s]*100;return p+"%"}return kS(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?kS(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?kS(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&xp("left",o),s=i&&xp("top",o),l,d;if(this.props.bounds==="parent"){var p=this.parentNode;p&&(l=a?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),d=s?this.resizableBottom-this.parentTop:p.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,d=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),d=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,g=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,y=typeof i.height>"u"||i.height<0?r:i.height,x=l||0,S=d||0;if(s){var E=(m-x)*this.ratio+S,P=(y-x)*this.ratio+S,k=(p-S)/this.ratio+x,T=(g-S)/this.ratio+x,M=Math.max(p,E),N=Math.min(g,P),F=Math.max(m,k),z=Math.min(y,T);n=sy(n,M,N),r=sy(r,F,z)}else n=sy(n,p,g),r=sy(r,m,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,d=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=d}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&P5e(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&ly(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var d=this.parentNode;if(d){var p=this.window.getComputedStyle(d).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var g={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:ml(ml({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(g)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&ly(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,d=ly(n)?n.touches[0].clientX:n.clientX,p=ly(n)?n.touches[0].clientY:n.clientY,g=this.state,m=g.direction,y=g.original,x=g.width,S=g.height,E=this.getParentSize(),P=T5e(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=P.maxWidth,a=P.maxHeight,s=P.minWidth,l=P.minHeight;var k=this.calculateNewSizeFromDirection(d,p),T=k.newHeight,M=k.newWidth,N=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(M=JL(M,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=JL(T,this.props.snap.y,this.props.snapGap));var F=this.calculateNewSizeFromAspectRatio(M,T,{width:N.maxWidth,height:N.maxHeight},{width:s,height:l});if(M=F.newWidth,T=F.newHeight,this.props.grid){var z=QL(M,this.props.grid[0]),B=QL(T,this.props.grid[1]),K=this.props.snapGap||0;M=K===0||Math.abs(z-M)<=K?z:M,T=K===0||Math.abs(B-T)<=K?B:T}var j={width:M-y.width,height:T-y.height};if(x&&typeof x=="string"){if(x.endsWith("%")){var X=M/E.width*100;M=X+"%"}else if(x.endsWith("vw")){var ue=M/this.window.innerWidth*100;M=ue+"vw"}else if(x.endsWith("vh")){var ge=M/this.window.innerHeight*100;M=ge+"vh"}}if(S&&typeof S=="string"){if(S.endsWith("%")){var X=T/E.height*100;T=X+"%"}else if(S.endsWith("vw")){var ue=T/this.window.innerWidth*100;T=ue+"vw"}else if(S.endsWith("vh")){var ge=T/this.window.innerHeight*100;T=ge+"vh"}}var xe={width:this.createSizeForCssProperty(M,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?xe.flexBasis=xe.width:this.flexDir==="column"&&(xe.flexBasis=xe.height),$l.exports.flushSync(function(){r.setState(xe)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,j)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:ml(ml({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,d=r.handleComponent;if(!i)return null;var p=Object.keys(i).map(function(g){return i[g]!==!1?_(_5e,{direction:g,onResizeStart:n.onResizeStart,replaceStyles:o&&o[g],className:a&&a[g],children:d&&d[g]?d[g]:null},g):null});return _("div",{className:l,style:s,children:p})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return L5e.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=ml(ml(ml({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return ae(o,{...ml({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&_("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]})},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(w.exports.PureComponent);function A5e(e){return Tt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function Kn(){return Kn=Object.assign?Object.assign.bind():function(e){for(var t=1;tx,Object.values(x));return w.exports.createElement(S.Provider,{value:E},y)}function p(g,m){const y=m?.[e][l]||s,x=w.exports.useContext(y);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${o}\``)}return d.displayName=o+"Provider",[d,p]}const i=()=>{const o=n.map(a=>w.exports.createContext(a));return function(s){const l=s?.[e]||o;return w.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,I5e(i,...t)]}function I5e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:d})=>{const g=l(o)[`__scope${d}`];return{...s,...g}},{});return w.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function M5e(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function M$(...e){return t=>e.forEach(n=>M5e(n,t))}function rs(...e){return w.exports.useCallback(M$(...e),e)}const Zm=w.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.exports.Children.toArray(n),o=i.find(O5e);if(o){const a=o.props.children,s=i.map(l=>l===o?w.exports.Children.count(a)>1?w.exports.Children.only(null):w.exports.isValidElement(a)?a.props.children:null:l);return w.exports.createElement(sC,Kn({},r,{ref:t}),w.exports.isValidElement(a)?w.exports.cloneElement(a,void 0,s):null)}return w.exports.createElement(sC,Kn({},r,{ref:t}),n)});Zm.displayName="Slot";const sC=w.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return w.exports.isValidElement(n)?w.exports.cloneElement(n,{...N5e(r,n.props),ref:M$(t,n.ref)}):w.exports.Children.count(n)>1?w.exports.Children.only(null):null});sC.displayName="SlotClone";const R5e=({children:e})=>w.exports.createElement(w.exports.Fragment,null,e);function O5e(e){return w.exports.isValidElement(e)&&e.type===R5e}function N5e(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const D5e=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],zu=D5e.reduce((e,t)=>{const n=w.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Zm:t;return w.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.exports.createElement(s,Kn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function R$(e,t){e&&$l.exports.flushSync(()=>e.dispatchEvent(t))}function O$(e){const t=e+"CollectionProvider",[n,r]=kv(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:x,children:S}=y,E=le.useRef(null),P=le.useRef(new Map).current;return le.createElement(i,{scope:x,itemMap:P,collectionRef:E},S)},s=e+"CollectionSlot",l=le.forwardRef((y,x)=>{const{scope:S,children:E}=y,P=o(s,S),k=rs(x,P.collectionRef);return le.createElement(Zm,{ref:k},E)}),d=e+"CollectionItemSlot",p="data-radix-collection-item",g=le.forwardRef((y,x)=>{const{scope:S,children:E,...P}=y,k=le.useRef(null),T=rs(x,k),M=o(d,S);return le.useEffect(()=>(M.itemMap.set(k,{ref:k,...P}),()=>void M.itemMap.delete(k))),le.createElement(Zm,{[p]:"",ref:T},E)});function m(y){const x=o(e+"CollectionConsumer",y);return le.useCallback(()=>{const E=x.collectionRef.current;if(!E)return[];const P=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((M,N)=>P.indexOf(M.ref.current)-P.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:l,ItemSlot:g},m,r]}const z5e=w.exports.createContext(void 0);function N$(e){const t=w.exports.useContext(z5e);return e||t||"ltr"}function Dl(e){const t=w.exports.useRef(e);return w.exports.useEffect(()=>{t.current=e}),w.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function F5e(e,t=globalThis?.document){const n=Dl(e);w.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const lC="dismissableLayer.update",$5e="dismissableLayer.pointerDownOutside",B5e="dismissableLayer.focusOutside";let tA;const H5e=w.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),W5e=w.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...d}=e,p=w.exports.useContext(H5e),[g,m]=w.exports.useState(null),y=(n=g?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,x]=w.exports.useState({}),S=rs(t,B=>m(B)),E=Array.from(p.layers),[P]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=E.indexOf(P),T=g?E.indexOf(g):-1,M=p.layersWithOutsidePointerEventsDisabled.size>0,N=T>=k,F=V5e(B=>{const K=B.target,j=[...p.branches].some(X=>X.contains(K));!N||j||(o?.(B),s?.(B),B.defaultPrevented||l?.())},y),z=U5e(B=>{const K=B.target;[...p.branches].some(X=>X.contains(K))||(a?.(B),s?.(B),B.defaultPrevented||l?.())},y);return F5e(B=>{T===p.layers.size-1&&(i?.(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},y),w.exports.useEffect(()=>{if(!!g)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(tA=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),nA(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=tA)}},[g,y,r,p]),w.exports.useEffect(()=>()=>{!g||(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),nA())},[g,p]),w.exports.useEffect(()=>{const B=()=>x({});return document.addEventListener(lC,B),()=>document.removeEventListener(lC,B)},[]),w.exports.createElement(zu.div,Kn({},d,{ref:S,style:{pointerEvents:M?N?"auto":"none":void 0,...e.style},onFocusCapture:Gn(e.onFocusCapture,z.onFocusCapture),onBlurCapture:Gn(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Gn(e.onPointerDownCapture,F.onPointerDownCapture)}))});function V5e(e,t=globalThis?.document){const n=Dl(e),r=w.exports.useRef(!1),i=w.exports.useRef(()=>{});return w.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let d=function(){D$($5e,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function U5e(e,t=globalThis?.document){const n=Dl(e),r=w.exports.useRef(!1);return w.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&D$(B5e,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nA(){const e=new CustomEvent(lC);document.dispatchEvent(e)}function D$(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?R$(i,o):i.dispatchEvent(o)}let ES=0;function G5e(){w.exports.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:rA()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:rA()),ES++,()=>{ES===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),ES--}},[])}function rA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const PS="focusScope.autoFocusOnMount",TS="focusScope.autoFocusOnUnmount",iA={bubbles:!1,cancelable:!0},j5e=w.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.exports.useState(null),d=Dl(i),p=Dl(o),g=w.exports.useRef(null),m=rs(t,S=>l(S)),y=w.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.exports.useEffect(()=>{if(r){let S=function(P){if(y.paused||!s)return;const k=P.target;s.contains(k)?g.current=k:If(g.current,{select:!0})},E=function(P){y.paused||!s||s.contains(P.relatedTarget)||If(g.current,{select:!0})};return document.addEventListener("focusin",S),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",E)}}},[r,s,y.paused]),w.exports.useEffect(()=>{if(s){aA.add(y);const S=document.activeElement;if(!s.contains(S)){const P=new CustomEvent(PS,iA);s.addEventListener(PS,d),s.dispatchEvent(P),P.defaultPrevented||(K5e(Q5e(z$(s)),{select:!0}),document.activeElement===S&&If(s))}return()=>{s.removeEventListener(PS,d),setTimeout(()=>{const P=new CustomEvent(TS,iA);s.addEventListener(TS,p),s.dispatchEvent(P),P.defaultPrevented||If(S??document.body,{select:!0}),s.removeEventListener(TS,p),aA.remove(y)},0)}}},[s,d,p,y]);const x=w.exports.useCallback(S=>{if(!n&&!r||y.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,P=document.activeElement;if(E&&P){const k=S.currentTarget,[T,M]=q5e(k);T&&M?!S.shiftKey&&P===M?(S.preventDefault(),n&&If(T,{select:!0})):S.shiftKey&&P===T&&(S.preventDefault(),n&&If(M,{select:!0})):P===k&&S.preventDefault()}},[n,r,y.paused]);return w.exports.createElement(zu.div,Kn({tabIndex:-1},a,{ref:m,onKeyDown:x}))});function K5e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(If(r,{select:t}),document.activeElement!==n)return}function q5e(e){const t=z$(e),n=oA(t,e),r=oA(t.reverse(),e);return[n,r]}function z$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function oA(e,t){for(const n of e)if(!Z5e(n,{upTo:t}))return n}function Z5e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Y5e(e){return e instanceof HTMLInputElement&&"select"in e}function If(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Y5e(e)&&t&&e.select()}}const aA=X5e();function X5e(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=sA(e,t),e.unshift(t)},remove(t){var n;e=sA(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function sA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Q5e(e){return e.filter(t=>t.tagName!=="A")}const I0=Boolean(globalThis?.document)?w.exports.useLayoutEffect:()=>{},J5e=GS["useId".toString()]||(()=>{});let e3e=0;function t3e(e){const[t,n]=w.exports.useState(J5e());return I0(()=>{e||n(r=>r??String(e3e++))},[e]),e||(t?`radix-${t}`:"")}function Z0(e){return e.split("-")[0]}function gb(e){return e.split("-")[1]}function Y0(e){return["top","bottom"].includes(Z0(e))?"x":"y"}function e7(e){return e==="y"?"height":"width"}function lA(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=Y0(t),l=e7(s),d=r[l]/2-i[l]/2,p=Z0(t),g=s==="x";let m;switch(p){case"top":m={x:o,y:r.y-i.height};break;case"bottom":m={x:o,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-i.width,y:a};break;default:m={x:r.x,y:r.y}}switch(gb(t)){case"start":m[s]-=d*(n&&g?-1:1);break;case"end":m[s]+=d*(n&&g?-1:1);break}return m}const n3e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:p}=lA(l,r,s),g=r,m={},y=0;for(let x=0;x({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const d=F$(r),p={x:i,y:o},g=Y0(a),m=gb(a),y=e7(g),x=await l.getDimensions(n),S=g==="y"?"top":"left",E=g==="y"?"bottom":"right",P=s.reference[y]+s.reference[g]-p[g]-s.floating[y],k=p[g]-s.reference[g],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let M=T?g==="y"?T.clientHeight||0:T.clientWidth||0:0;M===0&&(M=s.floating[y]);const N=P/2-k/2,F=d[S],z=M-x[y]-d[E],B=M/2-x[y]/2+N,K=uC(F,B,z),ue=(m==="start"?d[S]:d[E])>0&&B!==K&&s.reference[y]<=s.floating[y]?Ba3e[t])}function s3e(e,t,n){n===void 0&&(n=!1);const r=gb(e),i=Y0(e),o=e7(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=L3(a)),{main:a,cross:L3(a)}}const l3e={start:"end",end:"start"};function cA(e){return e.replace(/start|end/g,t=>l3e[t])}const u3e=["top","right","bottom","left"];function c3e(e){const t=L3(e);return[cA(e),t,cA(t)]}const d3e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",flipAlignment:y=!0,...x}=e,S=Z0(r),P=g||(S===a||!y?[L3(a)]:c3e(a)),k=[a,...P],T=await T3(t,x),M=[];let N=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&M.push(T[S]),p){const{main:K,cross:j}=s3e(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));M.push(T[K],T[j])}if(N=[...N,{placement:r,overflows:M}],!M.every(K=>K<=0)){var F,z;const K=((F=(z=i.flip)==null?void 0:z.index)!=null?F:0)+1,j=k[K];if(j)return{data:{index:K,overflows:N},reset:{placement:j}};let X="bottom";switch(m){case"bestFit":{var B;const ue=(B=N.map(ge=>[ge,ge.overflows.filter(xe=>xe>0).reduce((xe,we)=>xe+we,0)]).sort((ge,xe)=>ge[1]-xe[1])[0])==null?void 0:B[0].placement;ue&&(X=ue);break}case"initialPlacement":X=a;break}if(r!==X)return{reset:{placement:X}}}return{}}}};function dA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fA(e){return u3e.some(t=>e[t]>=0)}const f3e=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=await T3(r,{...n,elementContext:"reference"}),a=dA(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:fA(a)}}}case"escaped":{const o=await T3(r,{...n,altBoundary:!0}),a=dA(o,i.floating);return{data:{escapedOffsets:a,escaped:fA(a)}}}default:return{}}}}};async function h3e(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Z0(n),s=gb(n),l=Y0(n)==="x",d=["left","top"].includes(a)?-1:1,p=o&&l?-1:1,g=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return s&&typeof x=="number"&&(y=s==="end"?x*-1:x),l?{x:y*p,y:m*d}:{x:m*d,y:y*p}}const p3e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await h3e(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function $$(e){return e==="x"?"y":"x"}const g3e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:E=>{let{x:P,y:k}=E;return{x:P,y:k}}},...l}=e,d={x:n,y:r},p=await T3(t,l),g=Y0(Z0(i)),m=$$(g);let y=d[g],x=d[m];if(o){const E=g==="y"?"top":"left",P=g==="y"?"bottom":"right",k=y+p[E],T=y-p[P];y=uC(k,y,T)}if(a){const E=m==="y"?"top":"left",P=m==="y"?"bottom":"right",k=x+p[E],T=x-p[P];x=uC(k,x,T)}const S=s.fn({...t,[g]:y,[m]:x});return{...S,data:{x:S.x-n,y:S.y-r}}}}},m3e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:d=!0}=e,p={x:n,y:r},g=Y0(i),m=$$(g);let y=p[g],x=p[m];const S=typeof s=="function"?s({...o,placement:i}):s,E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(l){const N=g==="y"?"height":"width",F=o.reference[g]-o.floating[N]+E.mainAxis,z=o.reference[g]+o.reference[N]-E.mainAxis;yz&&(y=z)}if(d){var P,k,T,M;const N=g==="y"?"width":"height",F=["top","left"].includes(Z0(i)),z=o.reference[m]-o.floating[N]+(F&&(P=(k=a.offset)==null?void 0:k[m])!=null?P:0)+(F?0:E.crossAxis),B=o.reference[m]+o.reference[N]+(F?0:(T=(M=a.offset)==null?void 0:M[m])!=null?T:0)-(F?E.crossAxis:0);xB&&(x=B)}return{[g]:y,[m]:x}}}};function B$(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Vu(e){if(e==null)return window;if(!B$(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ev(e){return Vu(e).getComputedStyle(e)}function Fu(e){return B$(e)?"":e?(e.nodeName||"").toLowerCase():""}function H$(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function zl(e){return e instanceof Vu(e).HTMLElement}function md(e){return e instanceof Vu(e).Element}function v3e(e){return e instanceof Vu(e).Node}function t7(e){if(typeof ShadowRoot>"u")return!1;const t=Vu(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function mb(e){const{overflow:t,overflowX:n,overflowY:r}=Ev(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function y3e(e){return["table","td","th"].includes(Fu(e))}function W$(e){const t=/firefox/i.test(H$()),n=Ev(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function V$(){return!/^((?!chrome|android).)*safari/i.test(H$())}const hA=Math.min,em=Math.max,A3=Math.round;function $u(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,d=1;t&&zl(e)&&(l=e.offsetWidth>0&&A3(s.width)/e.offsetWidth||1,d=e.offsetHeight>0&&A3(s.height)/e.offsetHeight||1);const p=md(e)?Vu(e):window,g=!V$()&&n,m=(s.left+(g&&(r=(i=p.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,y=(s.top+(g&&(o=(a=p.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/d,x=s.width/l,S=s.height/d;return{width:x,height:S,top:y,right:m+x,bottom:y+S,left:m,x:m,y}}function _d(e){return((v3e(e)?e.ownerDocument:e.document)||window.document).documentElement}function vb(e){return md(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function U$(e){return $u(_d(e)).left+vb(e).scrollLeft}function b3e(e){const t=$u(e);return A3(t.width)!==e.offsetWidth||A3(t.height)!==e.offsetHeight}function x3e(e,t,n){const r=zl(t),i=_d(t),o=$u(e,r&&b3e(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Fu(t)!=="body"||mb(i))&&(a=vb(t)),zl(t)){const l=$u(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=U$(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function G$(e){return Fu(e)==="html"?e:e.assignedSlot||e.parentNode||(t7(e)?e.host:null)||_d(e)}function pA(e){return!zl(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function S3e(e){let t=G$(e);for(t7(t)&&(t=t.host);zl(t)&&!["html","body"].includes(Fu(t));){if(W$(t))return t;t=t.parentNode}return null}function cC(e){const t=Vu(e);let n=pA(e);for(;n&&y3e(n)&&getComputedStyle(n).position==="static";)n=pA(n);return n&&(Fu(n)==="html"||Fu(n)==="body"&&getComputedStyle(n).position==="static"&&!W$(n))?t:n||S3e(e)||t}function gA(e){if(zl(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=$u(e);return{width:t.width,height:t.height}}function w3e(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=zl(n),o=_d(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Fu(n)!=="body"||mb(o))&&(a=vb(n)),zl(n))){const l=$u(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}}function C3e(e,t){const n=Vu(e),r=_d(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const d=V$();(d||!d&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function _3e(e){var t;const n=_d(e),r=vb(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=em(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=em(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+U$(e);const l=-r.scrollTop;return Ev(i||n).direction==="rtl"&&(s+=em(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function j$(e){const t=G$(e);return["html","body","#document"].includes(Fu(t))?e.ownerDocument.body:zl(t)&&mb(t)?t:j$(t)}function I3(e,t){var n;t===void 0&&(t=[]);const r=j$(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Vu(r),a=i?[o].concat(o.visualViewport||[],mb(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(I3(a))}function k3e(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&t7(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function E3e(e,t){const n=$u(e,!1,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function mA(e,t,n){return t==="viewport"?P3(C3e(e,n)):md(t)?E3e(t,n):P3(_3e(_d(e)))}function P3e(e){const t=I3(e),r=["absolute","fixed"].includes(Ev(e).position)&&zl(e)?cC(e):e;return md(r)?t.filter(i=>md(i)&&k3e(i,r)&&Fu(i)!=="body"):[]}function T3e(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?P3e(t):[].concat(n),r],s=a[0],l=a.reduce((d,p)=>{const g=mA(t,p,i);return d.top=em(g.top,d.top),d.right=hA(g.right,d.right),d.bottom=hA(g.bottom,d.bottom),d.left=em(g.left,d.left),d},mA(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const L3e={getClippingRect:T3e,convertOffsetParentRelativeRectToViewportRelativeRect:w3e,isElement:md,getDimensions:gA,getOffsetParent:cC,getDocumentElement:_d,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:x3e(t,cC(n),r),floating:{...gA(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ev(e).direction==="rtl"};function A3e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,d=o&&!s,p=l||d?[...md(e)?I3(e):[],...I3(t)]:[];p.forEach(S=>{l&&S.addEventListener("scroll",n,{passive:!0}),d&&S.addEventListener("resize",n)});let g=null;if(a){let S=!0;g=new ResizeObserver(()=>{S||n(),S=!1}),md(e)&&!s&&g.observe(e),g.observe(t)}let m,y=s?$u(e):null;s&&x();function x(){const S=$u(e);y&&(S.x!==y.x||S.y!==y.y||S.width!==y.width||S.height!==y.height)&&n(),y=S,m=requestAnimationFrame(x)}return n(),()=>{var S;p.forEach(E=>{l&&E.removeEventListener("scroll",n),d&&E.removeEventListener("resize",n)}),(S=g)==null||S.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const I3e=(e,t,n)=>n3e(e,t,{platform:L3e,...n});var dC=typeof document<"u"?w.exports.useLayoutEffect:w.exports.useEffect;function fC(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,i;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(!fC(e[r],t[r]))return!1;return!0}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;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!fC(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function M3e(e){const t=w.exports.useRef(e);return dC(()=>{t.current=e}),t}function R3e(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.exports.useRef(null),a=w.exports.useRef(null),s=M3e(i),l=w.exports.useRef(null),[d,p]=w.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[g,m]=w.exports.useState(t);fC(g?.map(T=>{let{options:M}=T;return M}),t?.map(T=>{let{options:M}=T;return M}))||m(t);const y=w.exports.useCallback(()=>{!o.current||!a.current||I3e(o.current,a.current,{middleware:g,placement:n,strategy:r}).then(T=>{x.current&&$l.exports.flushSync(()=>{p(T)})})},[g,n,r]);dC(()=>{x.current&&y()},[y]);const x=w.exports.useRef(!1);dC(()=>(x.current=!0,()=>{x.current=!1}),[]);const S=w.exports.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,y);l.current=T}else y()},[y,s]),E=w.exports.useCallback(T=>{o.current=T,S()},[S]),P=w.exports.useCallback(T=>{a.current=T,S()},[S]),k=w.exports.useMemo(()=>({reference:o,floating:a}),[]);return w.exports.useMemo(()=>({...d,update:y,refs:k,reference:E,floating:P}),[d,y,k,E,P])}const O3e=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?uA({element:t.current,padding:n}).fn(i):{}:t?uA({element:t,padding:n}).fn(i):{}}}};function N3e(e){const[t,n]=w.exports.useState(void 0);return I0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,d=Array.isArray(l)?l[0]:l;a=d.inlineSize,s=d.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const K$="Popper",[n7,q$]=kv(K$),[D3e,Z$]=n7(K$),z3e=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.exports.useState(null);return w.exports.createElement(D3e,{scope:t,anchor:r,onAnchorChange:i},n)},F3e="PopperAnchor",$3e=w.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Z$(F3e,n),a=w.exports.useRef(null),s=rs(t,a);return w.exports.useEffect(()=>{o.onAnchorChange(r?.current||a.current)}),r?null:w.exports.createElement(zu.div,Kn({},i,{ref:s}))}),M3="PopperContent",[B3e,v8e]=n7(M3),[H3e,W3e]=n7(M3,{hasParent:!1,positionUpdateFns:new Set}),V3e=w.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,d;const{__scopePopper:p,side:g="bottom",sideOffset:m=0,align:y="center",alignOffset:x=0,arrowPadding:S=0,collisionBoundary:E=[],collisionPadding:P=0,sticky:k="partial",hideWhenDetached:T=!1,avoidCollisions:M=!0,...N}=e,F=Z$(M3,p),[z,B]=w.exports.useState(null),K=rs(t,mt=>B(mt)),[j,X]=w.exports.useState(null),ue=N3e(j),ge=(n=ue?.width)!==null&&n!==void 0?n:0,xe=(r=ue?.height)!==null&&r!==void 0?r:0,we=g+(y!=="center"?"-"+y:""),Se=typeof P=="number"?P:{top:0,right:0,bottom:0,left:0,...P},J=Array.isArray(E)?E:[E],G=J.length>0,te={padding:Se,boundary:J.filter(G3e),altBoundary:G},{reference:Q,floating:W,strategy:ie,x:de,y:be,placement:De,middlewareData:Re,update:Ve}=R3e({strategy:"fixed",placement:we,whileElementsMounted:A3e,middleware:[p3e({mainAxis:m+xe,alignmentAxis:x}),M?g3e({mainAxis:!0,crossAxis:!1,limiter:k==="partial"?m3e():void 0,...te}):void 0,j?O3e({element:j,padding:S}):void 0,M?d3e({...te}):void 0,j3e({arrowWidth:ge,arrowHeight:xe}),T?f3e({strategy:"referenceHidden"}):void 0].filter(U3e)});I0(()=>{Q(F.anchor)},[Q,F.anchor]);const ke=de!==null&&be!==null,[$e,nt]=Y$(De),ft=(i=Re.arrow)===null||i===void 0?void 0:i.x,Rt=(o=Re.arrow)===null||o===void 0?void 0:o.y,Ot=((a=Re.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Me,tt]=w.exports.useState();I0(()=>{z&&tt(window.getComputedStyle(z).zIndex)},[z]);const{hasParent:pt,positionUpdateFns:at}=W3e(M3,p),gt=!pt;w.exports.useLayoutEffect(()=>{if(!gt)return at.add(Ve),()=>{at.delete(Ve)}},[gt,at,Ve]),w.exports.useLayoutEffect(()=>{gt&&ke&&Array.from(at).reverse().forEach(mt=>requestAnimationFrame(mt))},[gt,ke,at]);const pn={"data-side":$e,"data-align":nt,...N,ref:K,style:{...N.style,animation:ke?void 0:"none",opacity:(s=Re.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.exports.createElement("div",{ref:W,"data-radix-popper-content-wrapper":"",style:{position:ie,left:0,top:0,transform:ke?`translate3d(${Math.round(de)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Me,["--radix-popper-transform-origin"]:[(l=Re.transformOrigin)===null||l===void 0?void 0:l.x,(d=Re.transformOrigin)===null||d===void 0?void 0:d.y].join(" ")}},w.exports.createElement(B3e,{scope:p,placedSide:$e,onArrowChange:X,arrowX:ft,arrowY:Rt,shouldHideArrow:Ot},gt?w.exports.createElement(H3e,{scope:p,hasParent:!0,positionUpdateFns:at},w.exports.createElement(zu.div,pn)):w.exports.createElement(zu.div,pn)))});function U3e(e){return e!==void 0}function G3e(e){return e!==null}const j3e=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:d}=t,g=((n=d.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=g?0:e.arrowWidth,y=g?0:e.arrowHeight,[x,S]=Y$(s),E={start:"0%",center:"50%",end:"100%"}[S],P=((r=(i=d.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,k=((o=(a=d.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+y/2;let T="",M="";return x==="bottom"?(T=g?E:`${P}px`,M=`${-y}px`):x==="top"?(T=g?E:`${P}px`,M=`${l.floating.height+y}px`):x==="right"?(T=`${-y}px`,M=g?E:`${k}px`):x==="left"&&(T=`${l.floating.width+y}px`,M=g?E:`${k}px`),{data:{x:T,y:M}}}});function Y$(e){const[t,n="center"]=e.split("-");return[t,n]}const K3e=z3e,q3e=$3e,Z3e=V3e;function Y3e(e,t){return w.exports.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const X$=e=>{const{present:t,children:n}=e,r=X3e(t),i=typeof n=="function"?n({present:r.isPresent}):w.exports.Children.only(n),o=rs(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.exports.cloneElement(i,{ref:o}):null};X$.displayName="Presence";function X3e(e){const[t,n]=w.exports.useState(),r=w.exports.useRef({}),i=w.exports.useRef(e),o=w.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=Y3e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.exports.useEffect(()=>{const d=cy(r.current);o.current=s==="mounted"?d:"none"},[s]),I0(()=>{const d=r.current,p=i.current;if(p!==e){const m=o.current,y=cy(d);e?l("MOUNT"):y==="none"||d?.display==="none"?l("UNMOUNT"):l(p&&m!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),I0(()=>{if(t){const d=g=>{const y=cy(r.current).includes(g.animationName);g.target===t&&y&&$l.exports.flushSync(()=>l("ANIMATION_END"))},p=g=>{g.target===t&&(o.current=cy(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.exports.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function cy(e){return e?.animationName||"none"}function Q3e({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=J3e({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Dl(n),l=w.exports.useCallback(d=>{if(o){const g=typeof d=="function"?d(e):d;g!==e&&s(g)}else i(d)},[o,e,i,s]);return[a,l]}function J3e({defaultProp:e,onChange:t}){const n=w.exports.useState(e),[r]=n,i=w.exports.useRef(r),o=Dl(t);return w.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const LS="rovingFocusGroup.onEntryFocus",e4e={bubbles:!1,cancelable:!0},r7="RovingFocusGroup",[hC,Q$,t4e]=O$(r7),[n4e,J$]=kv(r7,[t4e]),[r4e,i4e]=n4e(r7),o4e=w.exports.forwardRef((e,t)=>w.exports.createElement(hC.Provider,{scope:e.__scopeRovingFocusGroup},w.exports.createElement(hC.Slot,{scope:e.__scopeRovingFocusGroup},w.exports.createElement(a4e,Kn({},e,{ref:t}))))),a4e=w.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:d,...p}=e,g=w.exports.useRef(null),m=rs(t,g),y=N$(o),[x=null,S]=Q3e({prop:a,defaultProp:s,onChange:l}),[E,P]=w.exports.useState(!1),k=Dl(d),T=Q$(n),M=w.exports.useRef(!1),[N,F]=w.exports.useState(0);return w.exports.useEffect(()=>{const z=g.current;if(z)return z.addEventListener(LS,k),()=>z.removeEventListener(LS,k)},[k]),w.exports.createElement(r4e,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:x,onItemFocus:w.exports.useCallback(z=>S(z),[S]),onItemShiftTab:w.exports.useCallback(()=>P(!0),[]),onFocusableItemAdd:w.exports.useCallback(()=>F(z=>z+1),[]),onFocusableItemRemove:w.exports.useCallback(()=>F(z=>z-1),[])},w.exports.createElement(zu.div,Kn({tabIndex:E||N===0?-1:0,"data-orientation":r},p,{ref:m,style:{outline:"none",...e.style},onMouseDown:Gn(e.onMouseDown,()=>{M.current=!0}),onFocus:Gn(e.onFocus,z=>{const B=!M.current;if(z.target===z.currentTarget&&B&&!E){const K=new CustomEvent(LS,e4e);if(z.currentTarget.dispatchEvent(K),!K.defaultPrevented){const j=T().filter(we=>we.focusable),X=j.find(we=>we.active),ue=j.find(we=>we.id===x),xe=[X,ue,...j].filter(Boolean).map(we=>we.ref.current);eB(xe)}}M.current=!1}),onBlur:Gn(e.onBlur,()=>P(!1))})))}),s4e="RovingFocusGroupItem",l4e=w.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=t3e(),s=i4e(s4e,n),l=s.currentTabStopId===a,d=Q$(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=s;return w.exports.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),w.exports.createElement(hC.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.exports.createElement(zu.span,Kn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:Gn(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:Gn(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:Gn(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=d4e(m,s.orientation,s.dir);if(y!==void 0){m.preventDefault();let S=d().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const E=S.indexOf(m.currentTarget);S=s.loop?f4e(S,E+1):S.slice(E+1)}setTimeout(()=>eB(S))}})})))}),u4e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function c4e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function d4e(e,t,n){const r=c4e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return u4e[r]}function eB(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function f4e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const h4e=o4e,p4e=l4e,g4e=["Enter"," "],m4e=["ArrowDown","PageUp","Home"],tB=["ArrowUp","PageDown","End"],v4e=[...m4e,...tB],yb="Menu",[pC,y4e,b4e]=O$(yb),[bh,nB]=kv(yb,[b4e,q$,J$]),i7=q$(),rB=J$(),[x4e,bb]=bh(yb),[S4e,o7]=bh(yb),w4e=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=i7(t),[l,d]=w.exports.useState(null),p=w.exports.useRef(!1),g=Dl(o),m=N$(i);return w.exports.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),w.exports.createElement(K3e,s,w.exports.createElement(x4e,{scope:t,open:n,onOpenChange:g,content:l,onContentChange:d},w.exports.createElement(S4e,{scope:t,onClose:w.exports.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:m,modal:a},r)))},C4e=w.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=i7(n);return w.exports.createElement(q3e,Kn({},i,r,{ref:t}))}),_4e="MenuPortal",[y8e,k4e]=bh(_4e,{forceMount:void 0}),sd="MenuContent",[E4e,iB]=bh(sd),P4e=w.exports.forwardRef((e,t)=>{const n=k4e(sd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=bb(sd,e.__scopeMenu),a=o7(sd,e.__scopeMenu);return w.exports.createElement(pC.Provider,{scope:e.__scopeMenu},w.exports.createElement(X$,{present:r||o.open},w.exports.createElement(pC.Slot,{scope:e.__scopeMenu},a.modal?w.exports.createElement(T4e,Kn({},i,{ref:t})):w.exports.createElement(L4e,Kn({},i,{ref:t})))))}),T4e=w.exports.forwardRef((e,t)=>{const n=bb(sd,e.__scopeMenu),r=w.exports.useRef(null),i=rs(t,r);return w.exports.useEffect(()=>{const o=r.current;if(o)return UD(o)},[]),w.exports.createElement(oB,Kn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Gn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),L4e=w.exports.forwardRef((e,t)=>{const n=bb(sd,e.__scopeMenu);return w.exports.createElement(oB,Kn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),oB=w.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:g,onDismiss:m,disableOutsideScroll:y,...x}=e,S=bb(sd,n),E=o7(sd,n),P=i7(n),k=rB(n),T=y4e(n),[M,N]=w.exports.useState(null),F=w.exports.useRef(null),z=rs(t,F,S.onContentChange),B=w.exports.useRef(0),K=w.exports.useRef(""),j=w.exports.useRef(0),X=w.exports.useRef(null),ue=w.exports.useRef("right"),ge=w.exports.useRef(0),xe=y?Lz:w.exports.Fragment,we=y?{as:Zm,allowPinchZoom:!0}:void 0,Se=G=>{var te,Q;const W=K.current+G,ie=T().filter(ke=>!ke.disabled),de=document.activeElement,be=(te=ie.find(ke=>ke.ref.current===de))===null||te===void 0?void 0:te.textValue,De=ie.map(ke=>ke.textValue),Re=F4e(De,W,be),Ve=(Q=ie.find(ke=>ke.textValue===Re))===null||Q===void 0?void 0:Q.ref.current;(function ke($e){K.current=$e,window.clearTimeout(B.current),$e!==""&&(B.current=window.setTimeout(()=>ke(""),1e3))})(W),Ve&&setTimeout(()=>Ve.focus())};w.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),G5e();const J=w.exports.useCallback(G=>{var te,Q;return ue.current===((te=X.current)===null||te===void 0?void 0:te.side)&&B4e(G,(Q=X.current)===null||Q===void 0?void 0:Q.area)},[]);return w.exports.createElement(E4e,{scope:n,searchRef:K,onItemEnter:w.exports.useCallback(G=>{J(G)&&G.preventDefault()},[J]),onItemLeave:w.exports.useCallback(G=>{var te;J(G)||((te=F.current)===null||te===void 0||te.focus(),N(null))},[J]),onTriggerLeave:w.exports.useCallback(G=>{J(G)&&G.preventDefault()},[J]),pointerGraceTimerRef:j,onPointerGraceIntentChange:w.exports.useCallback(G=>{X.current=G},[])},w.exports.createElement(xe,we,w.exports.createElement(j5e,{asChild:!0,trapped:i,onMountAutoFocus:Gn(o,G=>{var te;G.preventDefault(),(te=F.current)===null||te===void 0||te.focus()}),onUnmountAutoFocus:a},w.exports.createElement(W5e,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:g,onDismiss:m},w.exports.createElement(h4e,Kn({asChild:!0},k,{dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:N,onEntryFocus:G=>{E.isUsingKeyboardRef.current||G.preventDefault()}}),w.exports.createElement(Z3e,Kn({role:"menu","aria-orientation":"vertical","data-state":N4e(S.open),"data-radix-menu-content":"",dir:E.dir},P,x,{ref:z,style:{outline:"none",...x.style},onKeyDown:Gn(x.onKeyDown,G=>{const Q=G.target.closest("[data-radix-menu-content]")===G.currentTarget,W=G.ctrlKey||G.altKey||G.metaKey,ie=G.key.length===1;Q&&(G.key==="Tab"&&G.preventDefault(),!W&&ie&&Se(G.key));const de=F.current;if(G.target!==de||!v4e.includes(G.key))return;G.preventDefault();const De=T().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);tB.includes(G.key)&&De.reverse(),D4e(De)}),onBlur:Gn(e.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(B.current),K.current="")}),onPointerMove:Gn(e.onPointerMove,mC(G=>{const te=G.target,Q=ge.current!==G.clientX;if(G.currentTarget.contains(te)&&Q){const W=G.clientX>ge.current?"right":"left";ue.current=W,ge.current=G.clientX}}))})))))))}),gC="MenuItem",vA="menu.itemSelect",A4e=w.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.exports.useRef(null),a=o7(gC,e.__scopeMenu),s=iB(gC,e.__scopeMenu),l=rs(t,o),d=w.exports.useRef(!1),p=()=>{const g=o.current;if(!n&&g){const m=new CustomEvent(vA,{bubbles:!0,cancelable:!0});g.addEventListener(vA,y=>r?.(y),{once:!0}),R$(g,m),m.defaultPrevented?d.current=!1:a.onClose()}};return w.exports.createElement(I4e,Kn({},i,{ref:l,disabled:n,onClick:Gn(e.onClick,p),onPointerDown:g=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,g),d.current=!0},onPointerUp:Gn(e.onPointerUp,g=>{var m;d.current||(m=g.currentTarget)===null||m===void 0||m.click()}),onKeyDown:Gn(e.onKeyDown,g=>{const m=s.searchRef.current!=="";n||m&&g.key===" "||g4e.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})}))}),I4e=w.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=iB(gC,n),s=rB(n),l=w.exports.useRef(null),d=rs(t,l),[p,g]=w.exports.useState(!1),[m,y]=w.exports.useState("");return w.exports.useEffect(()=>{const x=l.current;if(x){var S;y(((S=x.textContent)!==null&&S!==void 0?S:"").trim())}},[o.children]),w.exports.createElement(pC.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.exports.createElement(p4e,Kn({asChild:!0},s,{focusable:!r}),w.exports.createElement(zu.div,Kn({role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:d,onPointerMove:Gn(e.onPointerMove,mC(x=>{r?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus())})),onPointerLeave:Gn(e.onPointerLeave,mC(x=>a.onItemLeave(x))),onFocus:Gn(e.onFocus,()=>g(!0)),onBlur:Gn(e.onBlur,()=>g(!1))}))))}),M4e="MenuRadioGroup";bh(M4e,{value:void 0,onValueChange:()=>{}});const R4e="MenuItemIndicator";bh(R4e,{checked:!1});const O4e="MenuSub";bh(O4e);function N4e(e){return e?"open":"closed"}function D4e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function z4e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function F4e(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=z4e(e,Math.max(o,0));i.length===1&&(a=a.filter(d=>d!==n));const l=a.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function $4e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=p>r&&n<(d-s)*(r-l)/(p-l)+s&&(i=!i)}return i}function B4e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $4e(n,t)}function mC(e){return t=>t.pointerType==="mouse"?e(t):void 0}const H4e=w4e,W4e=C4e,V4e=P4e,U4e=A4e,aB="ContextMenu",[G4e,b8e]=kv(aB,[nB]),xb=nB(),[j4e,sB]=G4e(aB),K4e=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.exports.useState(!1),l=xb(t),d=Dl(r),p=w.exports.useCallback(g=>{s(g),d(g)},[d]);return w.exports.createElement(j4e,{scope:t,open:a,onOpenChange:p,modal:o},w.exports.createElement(H4e,Kn({},l,{dir:i,open:a,onOpenChange:p,modal:o}),n))},q4e="ContextMenuTrigger",Z4e=w.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sB(q4e,n),o=xb(n),a=w.exports.useRef({x:0,y:0}),s=w.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.exports.useRef(0),d=w.exports.useCallback(()=>window.clearTimeout(l.current),[]),p=g=>{a.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return w.exports.useEffect(()=>d,[d]),w.exports.createElement(w.exports.Fragment,null,w.exports.createElement(W4e,Kn({},o,{virtualRef:s})),w.exports.createElement(zu.span,Kn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:Gn(e.onContextMenu,g=>{d(),p(g),g.preventDefault()}),onPointerDown:Gn(e.onPointerDown,dy(g=>{d(),l.current=window.setTimeout(()=>p(g),700)})),onPointerMove:Gn(e.onPointerMove,dy(d)),onPointerCancel:Gn(e.onPointerCancel,dy(d)),onPointerUp:Gn(e.onPointerUp,dy(d))})))}),Y4e="ContextMenuContent",X4e=w.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sB(Y4e,n),o=xb(n),a=w.exports.useRef(!1);return w.exports.createElement(V4e,Kn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),Q4e=w.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=xb(n);return w.exports.createElement(U4e,Kn({},i,r,{ref:t}))});function dy(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const J4e=K4e,ebe=Z4e,tbe=X4e,Pf=Q4e,nbe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,rbe=w.exports.memo(e=>{const t=bt(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i}=qe(C$),{image:o,isSelected:a}=e,{url:s,uuid:l,metadata:d}=o,[p,g]=w.exports.useState(!1),m=Wu(),y=()=>g(!0),x=()=>g(!1),S=()=>{o.metadata&&t(b7(o.metadata.image.prompt)),m({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})},E=()=>{o.metadata&&t(Tv(o.metadata.image.seed)),m({title:"Seed Set",status:"success",duration:2500,isClosable:!0})},P=()=>{t(Pb(o)),n!=="img2img"&&t(Ua("img2img")),m({title:"Sent to Image To Image",status:"success",duration:2500,isClosable:!0})},k=()=>{t(Q_(o)),n!=="inpainting"&&t(Ua("inpainting")),m({title:"Sent to Inpainting",status:"success",duration:2500,isClosable:!0})},T=()=>{d&&t(M6e(d)),m({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})},M=async()=>{if(d?.image?.init_image_path&&(await fetch(d.image.init_image_path)).ok){t(Ua(Ko.indexOf("img2img"))),t(R6e(d)),m({title:"Initial Image Set",status:"success",duration:2500,isClosable:!0});return}m({title:"Initial Image Not Set",description:"Could not load initial image.",status:"error",duration:2500,isClosable:!0})};return ae(J4e,{onOpenChange:F=>{t(T$(F)),t(E3(!0))},children:[_(ebe,{children:ae(Bl,{position:"relative",className:"hoverable-image",onMouseOver:y,onMouseOut:x,children:[_(D4,{className:"hoverable-image-image",objectFit:r,rounded:"md",src:s,loading:"lazy"}),_("div",{className:"hoverable-image-content",onClick:()=>t(k$(o)),children:a&&_(Ea,{width:"50%",height:"50%",as:bye,className:"hoverable-image-check"})}),p&&i>=64&&_("div",{className:"hoverable-image-delete-button",children:_(mi,{label:"Delete image",hasArrow:!0,children:_(aC,{image:o,children:_(Xi,{"aria-label":"Delete image",icon:_(Iye,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14})})})})]},l)}),ae(tbe,{className:"hoverable-image-context-menu",sticky:"always",children:[_(Pf,{onClickCapture:S,disabled:o?.metadata?.image?.prompt===void 0,children:"Use Prompt"}),_(Pf,{onClickCapture:E,disabled:o?.metadata?.image?.seed===void 0,children:"Use Seed"}),_(Pf,{onClickCapture:T,disabled:!["txt2img","img2img"].includes(o?.metadata?.image?.type),children:"Use All Parameters"}),_(mi,{label:"Load initial image used for this generation",children:_(Pf,{onClickCapture:M,disabled:o?.metadata?.image?.type!=="img2img",children:"Use Initial Image"})}),_(Pf,{onClickCapture:P,children:"Send to Image To Image"}),_(Pf,{onClickCapture:k,children:"Send to Inpainting"}),_(aC,{image:o,children:_(Pf,{"data-warning":!0,children:"Delete Image"})})]})]})},nbe);function lB(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function vC(e,t){return vC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},vC(e,t)}function uB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,vC(e,t)}function ibe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function obe(e,t){e.classList?e.classList.add(t):ibe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function yA(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function abe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=yA(e.className,t):e.setAttribute("class",yA(e.className&&e.className.baseVal||"",t))}const bA={disabled:!1},cB=le.createContext(null);var dB=function(t){return t.scrollTop},Cg="unmounted",Mf="exited",Rf="entering",kp="entered",yC="exiting",Uu=function(e){uB(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Mf,o.appearStatus=Rf):l=kp:r.unmountOnExit||r.mountOnEnter?l=Cg:l=Mf,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Cg?{status:Mf}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Rf&&a!==kp&&(o=Rf):(a===Rf||a===kp)&&(o=yC)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Rf){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:O2.findDOMNode(this);a&&dB(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Mf&&this.setState({status:Cg})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[O2.findDOMNode(this),s],d=l[0],p=l[1],g=this.getTimeouts(),m=s?g.appear:g.enter;if(!i&&!a||bA.disabled){this.safeSetState({status:kp},function(){o.props.onEntered(d)});return}this.props.onEnter(d,p),this.safeSetState({status:Rf},function(){o.props.onEntering(d,p),o.onTransitionEnd(m,function(){o.safeSetState({status:kp},function(){o.props.onEntered(d,p)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:O2.findDOMNode(this);if(!o||bA.disabled){this.safeSetState({status:Mf},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:yC},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Mf},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:O2.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],d=l[0],p=l[1];this.props.addEndListener(d,p)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Cg)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=lB(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return _(cB.Provider,{value:null,children:typeof a=="function"?a(i,s):le.cloneElement(le.Children.only(a),s)})},t}(le.Component);Uu.contextType=cB;Uu.propTypes={};function Sp(){}Uu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Sp,onEntering:Sp,onEntered:Sp,onExit:Sp,onExiting:Sp,onExited:Sp};Uu.UNMOUNTED=Cg;Uu.EXITED=Mf;Uu.ENTERING=Rf;Uu.ENTERED=kp;Uu.EXITING=yC;const sbe=Uu;var lbe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return obe(t,r)})},AS=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return abe(t,r)})},a7=function(e){uB(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;a{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return ae(G4,{...o,children:[_(q4,{children:_(Bl,{children:t})}),ae(K4,{className:`invokeai__popover-content ${r}`,children:[i&&_(j4,{className:"invokeai__popover-arrow"}),n]})]})},R3=e=>{const{label:t,styleClass:n,formControlProps:r,formLabelProps:i,sliderTrackProps:o,sliderInnerTrackProps:a,sliderThumbProps:s,sliderThumbTooltipProps:l,...d}=e;return _(Sd,{className:`invokeai__slider-form-control ${n}`,...r,children:ae("div",{className:"invokeai__slider-inner-container",children:[_(ph,{className:"invokeai__slider-form-label",whiteSpace:"nowrap",...i,children:t}),ae(g_,{className:"invokeai__slider-root","aria-label":t,...d,children:[_(Qz,{className:"invokeai__slider-track",...o,children:_(Jz,{className:"invokeai__slider-filled-track",...a})}),_(mi,{className:"invokeai__slider-thumb-tooltip",placement:"top",hasArrow:!0,...l,children:_(Xz,{className:"invokeai__slider-thumb",...s})})]})]})})};function cbe(e){return Tt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"}}]})(e)}function bC(e){return Tt({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)}function dbe(e){return Tt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 9a3.02 3.02 0 0 0-3 3c0 1.642 1.358 3 3 3 1.641 0 3-1.358 3-3 0-1.641-1.359-3-3-3z"}},{tag:"path",attr:{d:"M12 5c-7.633 0-9.927 6.617-9.948 6.684L1.946 12l.105.316C2.073 12.383 4.367 19 12 19s9.927-6.617 9.948-6.684l.106-.316-.105-.316C21.927 11.617 19.633 5 12 5zm0 12c-5.351 0-7.424-3.846-7.926-5C4.578 10.842 6.652 7 12 7c5.351 0 7.424 3.846 7.926 5-.504 1.158-2.578 5-7.926 5z"}}]})(e)}const fbe=320;function hbe(){const e=bt(),t=Wu(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:d,activeTabName:p,galleryImageObjectFit:g,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,areMoreImagesAvailable:x,galleryWidth:S}=qe(n5e),[E,P]=w.exports.useState(300),[k,T]=w.exports.useState(590),[M,N]=w.exports.useState(S>=fbe);w.exports.useEffect(()=>{!o||(p==="inpainting"?(e(oy(220)),P(220),T(220)):p==="img2img"?(e(oy(Math.min(Math.max(Number(S),0),490))),T(490)):(e(oy(Math.min(Math.max(Number(S),0),590))),T(590)),e(Df(!0)))},[e,p,o,S]),w.exports.useEffect(()=>{o||T(window.innerWidth)},[o]);const F=w.exports.useRef(null),z=w.exports.useRef(null),B=w.exports.useRef(null),K=()=>{e(Df(!0)),e(u5e(!o))},j=()=>{a?ue():X()},X=()=>{e(E3(!0)),e(Df(!0))},ue=()=>{e(c5e(z.current?z.current.scrollTop:0)),e(E3(!1)),e(T$(!1)),e(Df(!0))},ge=()=>{e(oC(r))},xe=G=>{e(Ef(G)),e(Df(!0))},we=()=>{B.current=window.setTimeout(()=>ue(),500)},Se=()=>{B.current&&window.clearTimeout(B.current)};Ut("g",()=>{j()},[a]),Ut("left",()=>{e(P$(r))},[r]),Ut("right",()=>{e(E$(r))},[r]),Ut("shift+p",()=>{K()},[o]);const J=32;return Ut("shift+up",()=>{if(!(l>=256)&&l<256){const G=l+J;G<=256?(e(Ef(G)),t({title:`Gallery Thumbnail Size set to ${G}`,status:"success",duration:1e3,isClosable:!0})):(e(Ef(256)),t({title:"Gallery Thumbnail Size set to 256",status:"success",duration:1e3,isClosable:!0}))}},[l]),Ut("shift+down",()=>{if(!(l<=32)&&l>32){const G=l-J;G>32?(e(Ef(G)),t({title:`Gallery Thumbnail Size set to ${G}`,status:"success",duration:1e3,isClosable:!0})):(e(Ef(32)),t({title:"Gallery Thumbnail Size set to 32",status:"success",duration:1e3,isClosable:!0}))}},[l]),Ut("shift+r",()=>{e(Ef(64)),t({title:"Reset Gallery Image Size",status:"success",duration:2500,isClosable:!0})},[l]),w.exports.useEffect(()=>{!z.current||(z.current.scrollTop=s)},[s,a]),_(ube,{nodeRef:F,in:a||m&&!o,unmountOnExit:!0,timeout:200,classNames:"image-gallery-area",children:_("div",{className:"image-gallery-area","data-pinned":o,ref:F,onMouseLeave:o?void 0:we,onMouseEnter:o?void 0:Se,onMouseOver:o?void 0:Se,children:ae(I$,{minWidth:E,maxWidth:k,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{top:!1,right:!1,bottom:!1,left:!0,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},size:{width:S,height:o?"100%":"100vh"},onResizeStop:(G,te,Q,W)=>{e(oy(tn.clamp(Number(S)+W.width,0,Number(k)))),Q.removeAttribute("data-resize-alert")},onResize:(G,te,Q,W)=>{const ie=tn.clamp(Number(S)+W.width,0,Number(k));ie>=320&&!M?N(!0):ie<320&&M&&N(!1),ie>=k?Q.setAttribute("data-resize-alert","true"):Q.removeAttribute("data-resize-alert")},children:[ae("div",{className:"image-gallery-header",children:[_("div",{children:_(rD,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:M?ae(jn,{children:[_(Xa,{"data-selected":r==="result",onClick:()=>e(iy("result")),children:"Invocations"}),_(Xa,{"data-selected":r==="user",onClick:()=>e(iy("user")),children:"User"})]}):ae(jn,{children:[_(Pn,{"aria-label":"Show Invocations",tooltip:"Show Invocations","data-selected":r==="result",icon:_(wye,{}),onClick:()=>e(iy("result"))}),_(Pn,{"aria-label":"Show Uploads",tooltip:"Show Uploads","data-selected":r==="user",icon:_(Nye,{}),onClick:()=>e(iy("user"))})]})})}),ae("div",{children:[_(l5,{trigger:"hover",hasArrow:p!=="inpainting",placement:"left",triggerComponent:_(Pn,{size:"sm","aria-label":"Gallery Settings",icon:_(Dye,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:ae("div",{className:"image-gallery-settings-popover",children:[ae("div",{children:[_(R3,{value:l,onChange:xe,min:32,max:256,width:100,label:"Image Size",formLabelProps:{style:{fontSize:"0.9rem"}},sliderThumbTooltipProps:{label:`${l}px`}}),_(Pn,{size:"sm","aria-label":"Reset",tooltip:"Reset Size",onClick:()=>e(Ef(64)),icon:_(bC,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),_("div",{children:_(qm,{label:"Maintain Aspect Ratio",isChecked:g==="contain",onChange:()=>e(d5e(g==="contain"?"cover":"contain"))})}),_("div",{children:_(qm,{label:"Auto-Switch to New Images",isChecked:y,onChange:G=>e(f5e(G.target.checked))})})]})}),_(Pn,{size:"sm","aria-label":"Pin Gallery",tooltip:"Pin Gallery (Shift+P)",onClick:K,icon:_(A5e,{}),"data-selected":o}),_(Pn,{size:"sm","aria-label":"Close Gallery",tooltip:"Close Gallery (G)",onClick:ue,className:"image-gallery-icon-btn",icon:_(p$,{})})]})]}),_("div",{className:"image-gallery-container",ref:z,children:n.length||x?ae(jn,{children:[_("div",{className:"image-gallery",style:{gridTemplateColumns:d},children:n.map(G=>{const{uuid:te}=G;return _(rbe,{image:G,isSelected:i===te},te)})}),_(Xa,{onClick:ge,isDisabled:!x,className:"image-gallery-load-more-btn",children:x?"Load More":"All Images Loaded"})]}):ae("div",{className:"image-gallery-container-placeholder",children:[_(g$,{}),_("p",{children:"No Images In Gallery"})]})})]})})})}const pbe=()=>{const e=bt(),{shouldPinGallery:t,shouldShowGallery:n}=qe(i=>i.gallery),r=()=>{e(E3(!n))};return _(Pn,{tooltip:"Show Gallery (G)",tooltipPlacement:"top","aria-label":"Show Gallery",onClick:r,styleClass:"show-hide-gallery-button",onMouseOver:t?void 0:r,children:_(g$,{})})},s7=e=>{const{optionsPanel:t,children:n,styleClass:r}=e,{shouldShowGallery:i,shouldHoldGalleryOpen:o,shouldPinGallery:a}=qe(s=>s.gallery);return ae("div",{className:r?`workarea-wrapper ${r}`:"workarea-wrapper",children:[ae("div",{className:"workarea-main",children:[_("div",{className:"workarea-options-panel",children:t}),n,_(hbe,{})]}),!(i||o&&!a)&&_(pbe,{})]})};function gbe(){return _(s7,{optionsPanel:_(hye,{}),children:_(S5e,{})})}const mbe=xn(e=>e.inpainting,e=>{const{canvasDimensions:t,boundingBoxDimensions:n,shouldShowBoundingBox:r,shouldShowBoundingBoxFill:i,pastLines:o,futureLines:a,shouldLockBoundingBox:s}=e;return{canvasDimensions:t,boundingBoxDimensions:n,shouldShowBoundingBox:r,shouldShowBoundingBoxFill:i,pastLines:o,futureLines:a,shouldLockBoundingBox:s}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),vbe=()=>{const e=bt(),{canvasDimensions:t,boundingBoxDimensions:n,shouldShowBoundingBox:r,shouldShowBoundingBoxFill:i,shouldLockBoundingBox:o}=qe(mbe),a=y=>{e(Sg({...n,width:Math.floor(y)}))},s=y=>{e(Sg({...n,height:Math.floor(y)}))},l=y=>e(Yye(y.target.checked)),d=()=>{e(Zye(!i))},p=()=>{e(w$(!o))},g=()=>{e(Sg({...n,width:Math.floor(t.width)}))},m=()=>{e(Sg({...n,height:Math.floor(t.height)}))};return ae("div",{className:"inpainting-bounding-box-settings",children:[ae("div",{className:"inpainting-bounding-box-header",children:[_("p",{children:"Inpaint Box"}),_(Wl,{isChecked:r,width:"auto",onChange:l})]}),ae("div",{className:"inpainting-bounding-box-settings-items",children:[ae("div",{className:"inpainting-bounding-box-dimensions-slider-numberinput",children:[_(R3,{label:"Box W",min:64,max:No(t.width,64),step:64,value:n.width,onChange:a,isDisabled:!r,width:"5rem"}),_(yo,{value:n.width,onChange:a,min:64,max:No(t.width,64),step:64,isDisabled:!r,width:"5rem"}),_(Pn,{size:"sm","aria-label":"Reset Width",tooltip:"Reset Width",onClick:g,icon:_(bC,{}),styleClass:"inpainting-bounding-box-reset-icon-btn",isDisabled:!r||t.width===n.width})]}),ae("div",{className:"inpainting-bounding-box-dimensions-slider-numberinput",children:[_(R3,{label:"Box H",min:64,max:No(t.height,64),step:64,value:n.height,onChange:s,isDisabled:!r,width:"5rem"}),_(yo,{value:n.height,onChange:s,min:64,max:No(t.height,64),step:64,padding:"0",isDisabled:!r,width:"5rem"}),_(Pn,{size:"sm","aria-label":"Reset Height",tooltip:"Reset Height",onClick:m,icon:_(bC,{}),styleClass:"inpainting-bounding-box-reset-icon-btn",isDisabled:!r||t.height===n.height})]}),ae(zn,{alignItems:"center",justifyContent:"space-between",children:[_(qm,{label:"Darken Outside Box",isChecked:i,onChange:d,styleClass:"inpainting-bounding-box-darken",isDisabled:!r}),_(qm,{label:"Lock Bounding Box",isChecked:o,onChange:p,styleClass:"inpainting-bounding-box-darken",isDisabled:!r})]})]})]})},ybe=xn(e=>e.inpainting,e=>{const{pastLines:t,futureLines:n,inpaintReplace:r,shouldUseInpaintReplace:i}=e;return{pastLines:t,futureLines:n,inpaintReplace:r,shouldUseInpaintReplace:i}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}});function bbe(){const e=bt(),t=Wu(),{pastLines:n,futureLines:r,inpaintReplace:i,shouldUseInpaintReplace:o}=qe(ybe);return ae(jn,{children:[ae("div",{style:{display:"flex",alignItems:"center",padding:"0 1rem 0 0.2rem"},children:[_(yo,{label:"Inpaint Replace",value:i,min:0,max:1,step:.05,width:"auto",formControlProps:{style:{paddingRight:"1rem"}},isInteger:!1,isDisabled:!o,onChange:s=>{e(Jye(s))}}),_(Wl,{isChecked:o,onChange:s=>e(Qye(s.target.checked))})]}),_(vbe,{}),_(k3,{label:"Clear Brush History",onClick:()=>{e(Xye()),t({title:"Brush Stroke History Cleared",status:"success",duration:2500,isClosable:!0})},tooltip:"Clears brush stroke history",disabled:!(r.length>0||n.length>0)})]})}function xbe(){const e=qe(n=>n.options.showAdvancedOptions),t={seed:{header:_(B_,{}),feature:go.SEED,options:_(H_,{})},variations:{header:_(V_,{}),feature:go.VARIATIONS,options:_(U_,{})},face_restore:{header:_(z_,{}),feature:go.FACE_CORRECTION,options:_(hb,{})},upscale:{header:_(W_,{}),feature:go.UPSCALE,options:_(pb,{})}};return ae("div",{className:"image-to-image-panel",children:[_(Y_,{}),_(Z_,{}),_(K_,{}),_(i$,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),_(bbe,{}),_(G_,{}),e?_(q_,{accordionInfo:t}):null]})}var Sbe=Math.PI/180;function wbe(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const d0=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},st={_global:d0,version:"8.3.13",isBrowser:wbe(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return st.angleDeg?e*Sbe:e},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 st.DD.isDragging},isDragReady(){return!!st.DD.node},document:d0.document,_injectGlobal(e){d0.Konva=e}},vr=e=>{st[e.prototype.getClassName()]=e};st._injectGlobal(st);class ha{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.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 ha(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var d=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/d):-Math.acos(t/d),l.scaleX=d,l.scaleY=s/d,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var p=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/p):-Math.acos(r/p)),l.scaleX=s/p,l.scaleY=p,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=ce._getRotation(l.rotation),l}}var Cbe="[object Array]",_be="[object Number]",kbe="[object String]",Ebe="[object Boolean]",Pbe=Math.PI/180,Tbe=180/Math.PI,IS="#",Lbe="",Abe="0",Ibe="Konva warning: ",xA="Konva error: ",Mbe="rgb(",MS={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]},Rbe=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,fy=[];const Obe=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},ce={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===Cbe},_isNumber(e){return Object.prototype.toString.call(e)===_be&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===kbe},_isBoolean(e){return Object.prototype.toString.call(e)===Ebe},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){fy.push(e),fy.length===1&&Obe(function(){const t=fy;fy=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=ce.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(IS,Lbe);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=Abe+e;return IS+e},getRGB(e){var t;return e in MS?(t=MS[e],{r:t[0],g:t[1],b:t[2]}):e[0]===IS?this._hexToRgb(e.substring(1)):e.substr(0,4)===Mbe?(t=Rbe.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",ce._namedColorToRBA(e)||ce._hex3ColorToRGBA(e)||ce._hex6ColorToRGBA(e)||ce._rgbColorToRGBA(e)||ce._rgbaColorToRGBA(e)||ce._hslColorToRGBA(e)},_namedColorToRBA(e){var t=MS[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const d=2*o-a,p=[0,0,0];for(let g=0;g<3;g++)s=r+1/3*-(g-1),s<0&&s++,s>1&&s--,6*s<1?l=d+(a-d)*6*s:2*s<1?l=a:3*s<2?l=d+(a-d)*(2/3-s)*6:l=d,p[g]=l*255;return{r:Math.round(p[0]),g:Math.round(p[1]),b:Math.round(p[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+p*(n-e),s=t+p*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=ce.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=ce._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),d=l[0],p=l[1],g=l[2];gt.length){var a=t;t=e,e=a}for(r=0;r255?255:e<0?0:Math.round(e)}function He(){if(st.isUnminified)return function(e,t){return ce._isNumber(e)||ce.warn(kd(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function hB(e){if(st.isUnminified)return function(t,n){let r=ce._isNumber(t),i=ce._isArray(t)&&t.length==e;return!r&&!i&&ce.warn(kd(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function l7(){if(st.isUnminified)return function(e,t){var n=ce._isNumber(e),r=e==="auto";return n||r||ce.warn(kd(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function X0(){if(st.isUnminified)return function(e,t){return ce._isString(e)||ce.warn(kd(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function pB(){if(st.isUnminified)return function(e,t){const n=ce._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||ce.warn(kd(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function Nbe(){if(st.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(ce._isArray(e)?e.forEach(function(r){ce._isNumber(r)||ce.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):ce.warn(kd(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function zs(){if(st.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||ce.warn(kd(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function Dbe(e){if(st.isUnminified)return function(t,n){return t==null||ce.isObject(t)||ce.warn(kd(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var ig="get",og="set";const Z={addGetterSetter(e,t,n,r,i){Z.addGetter(e,t,n),Z.addSetter(e,t,r,i),Z.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=ig+ce._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=og+ce._capitalize(t);e.prototype[i]||Z.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=og+ce._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=ce._capitalize,s=ig+a(t),l=og+a(t),d,p;e.prototype[s]=function(){var m={};for(d=0;d{this._setAttr(t+a(S),void 0)}),this._fireChangeEvent(t,y,m),i&&i.call(this),this},Z.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=ce._capitalize(t),r=og+n,i=ig+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){ce.error("Adding deprecated "+t);var i=ig+ce._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){ce.error(o);var a=this.attrs[t];return a===void 0?n:a},Z.addSetter(e,t,r,function(){ce.error(o)}),Z.addOverloadedGetterSetter(e,t)},backCompat(e,t){ce.each(t,function(n,r){var i=e.prototype[r],o=ig+ce._capitalize(n),a=og+ce._capitalize(n);function s(){i.apply(this,arguments),ce.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function zbe(e){var t=[],n=e.length,r=ce,i,o;for(i=0;itypeof p=="number"?Math.floor(p):p)),o+=Fbe+d.join(SA)+$be)):(o+=s.property,t||(o+=Ube+s.val)),o+=Wbe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=jbe&&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){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var 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(){this._context.clip()}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,d){var p=arguments,g=this._context;p.length===3?g.drawImage(t,n,r):p.length===5?g.drawImage(t,n,r,i,o):p.length===9&&g.drawImage(t,n,r,i,o,a,s,l,d)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}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=wA.length,r=this.setAttr,i,o,a=function(s){var l=t[s],d;t[s]=function(){return o=zbe(Array.prototype.slice.call(arguments,0)),d=l.apply(t,arguments),t._trace({method:s,args:o}),d}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return hn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];hn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=ce._getFirstPointerId(e));const a=o._changedPointerPositions.find(d=>d.id===n.pointerId);if(!!a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];hn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(hn.justDragged=!0,st._mouseListenClick=!1,st._touchListenClick=!1,st._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof st.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){hn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&hn._dragElements.delete(n)})}};st.isBrowser&&(window.addEventListener("mouseup",hn._endDragBefore,!0),window.addEventListener("touchend",hn._endDragBefore,!0),window.addEventListener("mousemove",hn._drag),window.addEventListener("touchmove",hn._drag),window.addEventListener("mouseup",hn._endDragAfter,!1),window.addEventListener("touchend",hn._endDragAfter,!1));var u5="absoluteOpacity",py="allEventListeners",xu="absoluteTransform",CA="absoluteScale",ag="canvas",Ybe="Change",Xbe="children",Qbe="konva",xC="listening",_A="mouseenter",kA="mouseleave",EA="set",PA="Shape",c5=" ",TA="stage",Fc="transform",Jbe="Stage",SC="visible",exe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(c5);let txe=1;class We{constructor(t){this._id=txe++,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===Fc||t===xu)&&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===Fc||t===xu,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(c5);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(ag)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===xu&&this.fire("absoluteTransformChange")}clearCache(){return this._cache.delete(ag),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,d=n.offset||0,p=n.drawBorder||!1,g=n.hitCanvasPixelRatio||1;if(!i||!o){ce.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=d*2+1,o+=d*2+1,s-=d,l-=d;var m=new f0({pixelRatio:a,width:i,height:o}),y=new f0({pixelRatio:a,width:0,height:0}),x=new u7({pixelRatio:g,width:i,height:o}),S=m.getContext(),E=x.getContext();return x.isCache=!0,m.isCache=!0,this._cache.delete(ag),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),S.save(),E.save(),S.translate(-s,-l),E.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(u5),this._clearSelfAndDescendantCache(CA),this.drawScene(m,this),this.drawHit(x,this),this._isUnderCache=!1,S.restore(),E.restore(),p&&(S.save(),S.beginPath(),S.rect(0,0,i,o),S.closePath(),S.setAttr("strokeStyle","red"),S.setAttr("lineWidth",5),S.stroke(),S.restore()),this._cache.set(ag,{scene:m,filter:y,hit:x,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(ag)}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(d){var p=l.point(d);i===void 0&&(i=a=p.x,o=s=p.y),i=Math.min(i,p.x),o=Math.min(o,p.y),a=Math.max(a,p.x),s=Math.max(s,p.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,d;if(t){if(!this._filterUpToDate){var p=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()/p,r.getHeight()/p),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==Xbe&&(r=EA+ce._capitalize(n),ce._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(xC,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(SC,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;hn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!st.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(d){for(i=[],o=d.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==Jbe&&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(Fc),this._clearSelfAndDescendantCache(xu)),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 ha,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(Fc);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(Fc),this._clearSelfAndDescendantCache(xu),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;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return ce.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 ce.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&ce.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(u5,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=ce.isObject(i)&&!ce._isPlainObject(i)&&!ce._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(),ce._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{try{const i=t?.callback;i&&delete t.callback,ce._urlToImage(this.toDataURL(t),function(o){n(o),i?.(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t?.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),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():st.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(!!r&&!this.isDragging()){var i=!1;hn._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=hn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&hn._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 ce.haveIntersection(r,this.getClientRect())}static create(t,n){return ce._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=We.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),st[r]||(ce.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=st[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}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(arguments.length>1){for(var n=0;n0?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=We.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=We.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 d=this.getAbsoluteTransform(n).getMatrix();o.transform(d[0],d[1],d[2],d[3],d[4],d[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(),d=a&&s||l;const p=r===this;if(d){o.save();var g=this.getAbsoluteTransform(r),m=g.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var y=this.clipX(),x=this.clipY();o.rect(y,x,a,s)}o.clip(),m=g.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var S=!p&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";S&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(E){E[t](n,r)}),S&&o.restore(),d&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,d={x:1/0,y:1/0,width:0,height:0},p=this;(n=this.children)===null||n===void 0||n.forEach(function(S){if(!!S.visible()){var E=S.getClientRect({relativeTo:p,skipShadow:t.skipShadow,skipStroke:t.skipStroke});E.width===0&&E.height===0||(o===void 0?(o=E.x,a=E.y,s=E.x+E.width,l=E.y+E.height):(o=Math.min(o,E.x),a=Math.min(a,E.y),s=Math.max(s,E.x+E.width),l=Math.max(l,E.y+E.height)))}});for(var g=this.find("Shape"),m=!1,y=0;ye.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",wp=e=>{const t=Pg(e);if(t==="pointer")return st.pointerEventsEnabled&&OS.pointer;if(t==="touch")return OS.touch;if(t==="mouse")return OS.mouse};function AA(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&ce.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const lxe="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);",d5=[];class Cb extends ya{constructor(t){super(AA(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),d5.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{AA(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||ce.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===rxe){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&d5.splice(n,1),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(ce.warn(lxe),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new f0({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(!!o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+LA,this.content.style.height=n+LA),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;raxe&&ce.warn("The stage has "+i+" 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."),t.setSize({width:this.width(),height:this.height()}),t.draw(),st.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return mB(t,this)}setPointerCapture(t){vB(t,this)}releaseCapture(t){tm(t)}getLayers(){return this.children}_bindContentEvents(){!st.isBrowser||sxe.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=wp(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=wp(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=wp(t.type),r=Pg(t.type);if(!!n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!hn.isDragging||st.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=wp(t.type),r=Pg(t.type);if(!!n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(hn.justDragged=!1,st["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;st.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=wp(t.type),r=Pg(t.type);if(!n)return;hn.isDragging&&hn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!hn.isDragging||st.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const d=RS(l.id)||this.getIntersection(l),p=l.id,g={evt:t,pointerId:p};var m=s!==d;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},g),d),s._fireAndBubble(n.pointerleave,Object.assign({},g),d)),d){if(o[d._id])return;o[d._id]=!0}d&&d.isListening()?(a=!0,m&&(d._fireAndBubble(n.pointerover,Object.assign({},g),s),d._fireAndBubble(n.pointerenter,Object.assign({},g),s),this[r+"targetShape"]=d),d._fireAndBubble(n.pointermove,Object.assign({},g))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:p}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=wp(t.type),r=Pg(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const d=RS(l.id)||this.getIntersection(l);if(d){if(d.releaseCapture(l.id),a[d._id])return;a[d._id]=!0}const p=l.id,g={evt:t,pointerId:p};let m=!1;st["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):hn.justDragged||(st["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){st["_"+r+"InDblClickWindow"]=!1},st.dblClickWindow),d&&d.isListening()?(s=!0,this[r+"ClickEndShape"]=d,d._fireAndBubble(n.pointerup,Object.assign({},g)),st["_"+r+"ListenClick"]&&i&&i===d&&(d._fireAndBubble(n.pointerclick,Object.assign({},g)),m&&o&&o===d&&d._fireAndBubble(n.pointerdblclick,Object.assign({},g)))):(this[r+"ClickEndShape"]=null,st["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:p}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:p}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),st["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(wC,{evt:t}):this._fire(wC,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(CC,{evt:t}):this._fire(CC,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=RS(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Up,c7(t)),tm(t.pointerId)}_lostpointercapture(t){tm(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:ce._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:ce._getFirstPointerId(t)}])}_setPointerPosition(t){ce.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new f0({width:this.width(),height:this.height()}),this.bufferHitCanvas=new u7({pixelRatio:1,width:this.width(),height:this.height()}),!!st.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.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"),t.appendChild(this.content),this._resizeDOM()}}cache(){return ce.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(t){t.batchDraw()}),this}}Cb.prototype.nodeType=nxe;vr(Cb);Z.addGetterSetter(Cb,"container");var TB="hasShadow",LB="shadowRGBA",AB="patternImage",IB="linearGradient",MB="radialGradient";let by;function NS(){return by||(by=ce.createCanvasElement().getContext("2d"),by)}const nm={};function uxe(e){e.fill()}function cxe(e){e.stroke()}function dxe(e){e.fill()}function fxe(e){e.stroke()}function hxe(){this._clearCache(TB)}function pxe(){this._clearCache(LB)}function gxe(){this._clearCache(AB)}function mxe(){this._clearCache(IB)}function vxe(){this._clearCache(MB)}class Ne extends We{constructor(t){super(t);let n;for(;n=ce.getRandomColor(),!(n&&!(n in nm)););this.colorKey=n,nm[n]=this}getContext(){return ce.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return ce.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(TB,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(AB,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=NS();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new ha;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(st.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(IB,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=NS(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.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 n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return We.prototype.destroy.call(this),delete nm[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){ce.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 n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,d=!t.skipShadow&&this.hasShadow(),p=d?this.shadowOffsetX():0,g=d?this.shadowOffsetY():0,m=s+Math.abs(p),y=l+Math.abs(g),x=d&&this.shadowBlur()||0,S=m+x*2,E=y+x*2,P={width:S,height:E,x:-(a/2+x)+Math.min(p,0)+i.x,y:-(a/2+x)+Math.min(g,0)+i.y};return n?P:this._transformedRect(P,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),d,p,g,m=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(a){o.save();var x=this.getAbsoluteTransform(n).getMatrix();return o.transform(x[0],x[1],x[2],x[3],x[4],x[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){d=this.getStage(),p=d.bufferCanvas,g=p.getContext(),g.clear(),g.save(),g._applyLineJoin(this);var S=this.getAbsoluteTransform(n).getMatrix();g.transform(S[0],S[1],S[2],S[3],S[4],S[5]),s.call(this,g,this),g.restore();var E=p.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(p._canvas,0,0,p.width/E,p.height/E)}else{if(o._applyLineJoin(this),!y){var S=this.getAbsoluteTransform(n).getMatrix();o.transform(S[0],S[1],S[2],S[3],S[4],S[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),d=l&&l.hit;if(this.colorKey||ce.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()"),d){a.save();var p=this.getAbsoluteTransform(n).getMatrix();return a.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,d,p,g,m,y;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),d=l.data,p=d.length,g=ce._hexToRgb(this.colorKey),m=0;mt?(d[m]=g.r,d[m+1]=g.g,d[m+2]=g.b,d[m+3]=255):d[m+3]=0;o.putImageData(l,0,0)}catch(x){ce.error("Unable to draw hit graph from cached scene canvas. "+x.message)}return this}hasPointerCapture(t){return mB(t,this)}setPointerCapture(t){vB(t,this)}releaseCapture(t){tm(t)}}Ne.prototype._fillFunc=uxe;Ne.prototype._strokeFunc=cxe;Ne.prototype._fillFuncHit=dxe;Ne.prototype._strokeFuncHit=fxe;Ne.prototype._centroid=!1;Ne.prototype.nodeType="Shape";vr(Ne);Ne.prototype.eventListeners={};Ne.prototype.on.call(Ne.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",hxe);Ne.prototype.on.call(Ne.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",pxe);Ne.prototype.on.call(Ne.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",gxe);Ne.prototype.on.call(Ne.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",mxe);Ne.prototype.on.call(Ne.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",vxe);Z.addGetterSetter(Ne,"stroke",void 0,pB());Z.addGetterSetter(Ne,"strokeWidth",2,He());Z.addGetterSetter(Ne,"fillAfterStrokeEnabled",!1);Z.addGetterSetter(Ne,"hitStrokeWidth","auto",l7());Z.addGetterSetter(Ne,"strokeHitEnabled",!0,zs());Z.addGetterSetter(Ne,"perfectDrawEnabled",!0,zs());Z.addGetterSetter(Ne,"shadowForStrokeEnabled",!0,zs());Z.addGetterSetter(Ne,"lineJoin");Z.addGetterSetter(Ne,"lineCap");Z.addGetterSetter(Ne,"sceneFunc");Z.addGetterSetter(Ne,"hitFunc");Z.addGetterSetter(Ne,"dash");Z.addGetterSetter(Ne,"dashOffset",0,He());Z.addGetterSetter(Ne,"shadowColor",void 0,X0());Z.addGetterSetter(Ne,"shadowBlur",0,He());Z.addGetterSetter(Ne,"shadowOpacity",1,He());Z.addComponentsGetterSetter(Ne,"shadowOffset",["x","y"]);Z.addGetterSetter(Ne,"shadowOffsetX",0,He());Z.addGetterSetter(Ne,"shadowOffsetY",0,He());Z.addGetterSetter(Ne,"fillPatternImage");Z.addGetterSetter(Ne,"fill",void 0,pB());Z.addGetterSetter(Ne,"fillPatternX",0,He());Z.addGetterSetter(Ne,"fillPatternY",0,He());Z.addGetterSetter(Ne,"fillLinearGradientColorStops");Z.addGetterSetter(Ne,"strokeLinearGradientColorStops");Z.addGetterSetter(Ne,"fillRadialGradientStartRadius",0);Z.addGetterSetter(Ne,"fillRadialGradientEndRadius",0);Z.addGetterSetter(Ne,"fillRadialGradientColorStops");Z.addGetterSetter(Ne,"fillPatternRepeat","repeat");Z.addGetterSetter(Ne,"fillEnabled",!0);Z.addGetterSetter(Ne,"strokeEnabled",!0);Z.addGetterSetter(Ne,"shadowEnabled",!0);Z.addGetterSetter(Ne,"dashEnabled",!0);Z.addGetterSetter(Ne,"strokeScaleEnabled",!0);Z.addGetterSetter(Ne,"fillPriority","color");Z.addComponentsGetterSetter(Ne,"fillPatternOffset",["x","y"]);Z.addGetterSetter(Ne,"fillPatternOffsetX",0,He());Z.addGetterSetter(Ne,"fillPatternOffsetY",0,He());Z.addComponentsGetterSetter(Ne,"fillPatternScale",["x","y"]);Z.addGetterSetter(Ne,"fillPatternScaleX",1,He());Z.addGetterSetter(Ne,"fillPatternScaleY",1,He());Z.addComponentsGetterSetter(Ne,"fillLinearGradientStartPoint",["x","y"]);Z.addComponentsGetterSetter(Ne,"strokeLinearGradientStartPoint",["x","y"]);Z.addGetterSetter(Ne,"fillLinearGradientStartPointX",0);Z.addGetterSetter(Ne,"strokeLinearGradientStartPointX",0);Z.addGetterSetter(Ne,"fillLinearGradientStartPointY",0);Z.addGetterSetter(Ne,"strokeLinearGradientStartPointY",0);Z.addComponentsGetterSetter(Ne,"fillLinearGradientEndPoint",["x","y"]);Z.addComponentsGetterSetter(Ne,"strokeLinearGradientEndPoint",["x","y"]);Z.addGetterSetter(Ne,"fillLinearGradientEndPointX",0);Z.addGetterSetter(Ne,"strokeLinearGradientEndPointX",0);Z.addGetterSetter(Ne,"fillLinearGradientEndPointY",0);Z.addGetterSetter(Ne,"strokeLinearGradientEndPointY",0);Z.addComponentsGetterSetter(Ne,"fillRadialGradientStartPoint",["x","y"]);Z.addGetterSetter(Ne,"fillRadialGradientStartPointX",0);Z.addGetterSetter(Ne,"fillRadialGradientStartPointY",0);Z.addComponentsGetterSetter(Ne,"fillRadialGradientEndPoint",["x","y"]);Z.addGetterSetter(Ne,"fillRadialGradientEndPointX",0);Z.addGetterSetter(Ne,"fillRadialGradientEndPointY",0);Z.addGetterSetter(Ne,"fillPatternRotation",0);Z.backCompat(Ne,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var yxe="#",bxe="beforeDraw",xxe="draw",RB=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Sxe=RB.length;class xh extends ya{constructor(t){super(t),this.canvas=new f0,this.hitCanvas=new u7({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{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;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(bxe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),ya.prototype.drawScene.call(this,i,n),this._fire(xxe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),ya.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){ce.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return ce.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)}}}xh.prototype.nodeType="Layer";vr(xh);Z.addGetterSetter(xh,"imageSmoothingEnabled",!0);Z.addGetterSetter(xh,"clearBeforeDraw",!0);Z.addGetterSetter(xh,"hitGraphEnabled",!0,zs());class d7 extends xh{constructor(t){super(t),this.listening(!1),ce.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}d7.prototype.nodeType="FastLayer";vr(d7);class M0 extends ya{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&ce.throw("You may only add groups and shapes to groups.")}}M0.prototype.nodeType="Group";vr(M0);var DS=function(){return d0.performance&&d0.performance.now?function(){return d0.performance.now()}:function(){return new Date().getTime()}}();class qa{constructor(t,n){this.id=qa.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:DS(),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;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=IA,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=MA,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,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 t=this.getTimer()-this._startTime;this.state===IA?this.setTime(t):this.state===MA&&this.setTime(this.duration-t)}pause(){this.state=Cxe,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Fr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||rm.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=_xe++;var d=r.getLayer()||(r instanceof st.Stage?r.getLayers():null);d||ce.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new qa(function(){n.tween.onEnterFrame()},d),this.tween=new kxe(l,function(p){n._tweenFunc(p)},a,0,1,o*1e3,s),this._addListeners(),Fr.attrs[i]||(Fr.attrs[i]={}),Fr.attrs[i][this._id]||(Fr.attrs[i][this._id]={}),Fr.tweens[i]||(Fr.tweens[i]={});for(l in t)wxe[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,d,p,g,m;if(s=Fr.tweens[i][t],s&&delete Fr.attrs[i][s][t],o=r.getAttr(t),ce._isArray(n))if(a=[],d=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(g=o,o=ce._prepareArrayForTween(o,n,r.closed())):(p=n,n=ce._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Fr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Fr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.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(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Fr.tweens[t],i;this.pause();for(i in r)delete Fr.tweens[t][i];delete Fr.attrs[t][n]}}Fr.attrs={};Fr.tweens={};We.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Fr(e);n.play()};const rm={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),p=a*n,g=s*(s>0?t:n),m=l*(l>0?n:t);return{x:d,y:r?-1*m:g,width:p-d,height:m-g}}}Gu.prototype._centroid=!0;Gu.prototype.className="Arc";Gu.prototype._attrsAffectingSize=["innerRadius","outerRadius"];vr(Gu);Z.addGetterSetter(Gu,"innerRadius",0,He());Z.addGetterSetter(Gu,"outerRadius",0,He());Z.addGetterSetter(Gu,"angle",0,He());Z.addGetterSetter(Gu,"clockwise",!1,zs());function _C(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)),d=a*s/(s+l),p=a*l/(s+l),g=n-d*(i-e),m=r-d*(o-t),y=n+p*(i-e),x=r+p*(o-t);return[g,m,y,x]}function OA(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,d=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);dp?d:p,E=d>p?1:d/p,P=d>p?p/d:1;t.translate(s,l),t.rotate(y),t.scale(E,P),t.arc(0,0,S,g,g+m,1-x),t.scale(1/E,1/P),t.rotate(-y),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(d){if(d.command==="A"){var p=d.points[4],g=d.points[5],m=d.points[4]+g,y=Math.PI/180;if(Math.abs(p-m)m;x-=y){const S=Rn.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],x,0);t.push(S.x,S.y)}else for(let x=p+y;xthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return Rn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return Rn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return Rn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],d=a[2],p=a[3],g=a[4],m=a[5],y=a[6];return g+=m*t/o.pathLength,Rn.getPointOnEllipticalArc(s,l,d,p,g,y)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}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),d=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(x[0]);){var k=null,T=[],M=l,N=d,F,z,B,K,j,X,ue,ge,xe,we;switch(y){case"l":l+=x.shift(),d+=x.shift(),k="L",T.push(l,d);break;case"L":l=x.shift(),d=x.shift(),T.push(l,d);break;case"m":var Se=x.shift(),J=x.shift();if(l+=Se,d+=J,k="M",a.length>2&&a[a.length-1].command==="z"){for(var G=a.length-2;G>=0;G--)if(a[G].command==="M"){l=a[G].points[0]+Se,d=a[G].points[1]+J;break}}T.push(l,d),y="l";break;case"M":l=x.shift(),d=x.shift(),k="M",T.push(l,d),y="L";break;case"h":l+=x.shift(),k="L",T.push(l,d);break;case"H":l=x.shift(),k="L",T.push(l,d);break;case"v":d+=x.shift(),k="L",T.push(l,d);break;case"V":d=x.shift(),k="L",T.push(l,d);break;case"C":T.push(x.shift(),x.shift(),x.shift(),x.shift()),l=x.shift(),d=x.shift(),T.push(l,d);break;case"c":T.push(l+x.shift(),d+x.shift(),l+x.shift(),d+x.shift()),l+=x.shift(),d+=x.shift(),k="C",T.push(l,d);break;case"S":z=l,B=d,F=a[a.length-1],F.command==="C"&&(z=l+(l-F.points[2]),B=d+(d-F.points[3])),T.push(z,B,x.shift(),x.shift()),l=x.shift(),d=x.shift(),k="C",T.push(l,d);break;case"s":z=l,B=d,F=a[a.length-1],F.command==="C"&&(z=l+(l-F.points[2]),B=d+(d-F.points[3])),T.push(z,B,l+x.shift(),d+x.shift()),l+=x.shift(),d+=x.shift(),k="C",T.push(l,d);break;case"Q":T.push(x.shift(),x.shift()),l=x.shift(),d=x.shift(),T.push(l,d);break;case"q":T.push(l+x.shift(),d+x.shift()),l+=x.shift(),d+=x.shift(),k="Q",T.push(l,d);break;case"T":z=l,B=d,F=a[a.length-1],F.command==="Q"&&(z=l+(l-F.points[0]),B=d+(d-F.points[1])),l=x.shift(),d=x.shift(),k="Q",T.push(z,B,l,d);break;case"t":z=l,B=d,F=a[a.length-1],F.command==="Q"&&(z=l+(l-F.points[0]),B=d+(d-F.points[1])),l+=x.shift(),d+=x.shift(),k="Q",T.push(z,B,l,d);break;case"A":K=x.shift(),j=x.shift(),X=x.shift(),ue=x.shift(),ge=x.shift(),xe=l,we=d,l=x.shift(),d=x.shift(),k="A",T=this.convertEndpointToCenterParameterization(xe,we,l,d,ue,ge,K,j,X);break;case"a":K=x.shift(),j=x.shift(),X=x.shift(),ue=x.shift(),ge=x.shift(),xe=l,we=d,l+=x.shift(),d+=x.shift(),k="A",T=this.convertEndpointToCenterParameterization(xe,we,l,d,ue,ge,K,j,X);break}a.push({command:k||y,points:T,start:{x:M,y:N},pathLength:this.calcLength(M,N,k||y,T)})}(y==="z"||y==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,d=Rn;switch(r){case"L":return d.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=d.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=d.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=d.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=d.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=d.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=d.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var p=i[4],g=i[5],m=i[4]+g,y=Math.PI/180;if(Math.abs(p-m)m;l-=y)s=d.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=d.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=p+y;l1&&(s*=Math.sqrt(y),l*=Math.sqrt(y));var x=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(g*g))/(s*s*(m*m)+l*l*(g*g)));o===a&&(x*=-1),isNaN(x)&&(x=0);var S=x*s*m/l,E=x*-l*g/s,P=(t+r)/2+Math.cos(p)*S-Math.sin(p)*E,k=(n+i)/2+Math.sin(p)*S+Math.cos(p)*E,T=function(j){return Math.sqrt(j[0]*j[0]+j[1]*j[1])},M=function(j,X){return(j[0]*X[0]+j[1]*X[1])/(T(j)*T(X))},N=function(j,X){return(j[0]*X[1]=1&&(K=0),a===0&&K>0&&(K=K-2*Math.PI),a===1&&K<0&&(K=K+2*Math.PI),[P,k,s,l,F,K,p,a]}}Rn.prototype.className="Path";Rn.prototype._attrsAffectingSize=["data"];vr(Rn);Z.addGetterSetter(Rn,"data");class Sh extends ju{_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,d;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],y=Rn.calcLength(i[i.length-4],i[i.length-3],"C",m),x=Rn.getPointOnQuadraticBezier(Math.min(1,1-a/y),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-x.x,d=r[s-1]-x.y}else l=r[s-2]-r[s-4],d=r[s-1]-r[s-3];var p=(Math.atan2(d,l)+n)%n,g=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(p),t.moveTo(0,0),t.lineTo(-a,g/2),t.lineTo(-a,-g/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],d=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],d=r[3]-r[1]),t.rotate((Math.atan2(-d,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,g/2),t.lineTo(-a,-g/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}}}Sh.prototype.className="Arrow";vr(Sh);Z.addGetterSetter(Sh,"pointerLength",10,He());Z.addGetterSetter(Sh,"pointerWidth",10,He());Z.addGetterSetter(Sh,"pointerAtBeginning",!1);Z.addGetterSetter(Sh,"pointerAtEnding",!0);class Q0 extends Ne{_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)}}Q0.prototype._centroid=!0;Q0.prototype.className="Circle";Q0.prototype._attrsAffectingSize=["radius"];vr(Q0);Z.addGetterSetter(Q0,"radius",0,He());class Ed extends Ne{_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)}}Ed.prototype.className="Ellipse";Ed.prototype._centroid=!0;Ed.prototype._attrsAffectingSize=["radiusX","radiusY"];vr(Ed);Z.addComponentsGetterSetter(Ed,"radius",["x","y"]);Z.addGetterSetter(Ed,"radiusX",0,He());Z.addGetterSetter(Ed,"radiusY",0,He());class Fs extends Ne{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.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),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=ce.createImageElement();i.onload=function(){var o=new Fs({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}}Fs.prototype.className="Image";vr(Fs);Z.addGetterSetter(Fs,"image");Z.addComponentsGetterSetter(Fs,"crop",["x","y","width","height"]);Z.addGetterSetter(Fs,"cropX",0,He());Z.addGetterSetter(Fs,"cropY",0,He());Z.addGetterSetter(Fs,"cropWidth",0,He());Z.addGetterSetter(Fs,"cropHeight",0,He());var OB=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Exe="Change.konva",Pxe="none",kC="up",EC="right",PC="down",TC="left",Txe=OB.length;class f7 extends M0{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{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)}}Ch.prototype.className="RegularPolygon";Ch.prototype._centroid=!0;Ch.prototype._attrsAffectingSize=["radius"];vr(Ch);Z.addGetterSetter(Ch,"radius",0,He());Z.addGetterSetter(Ch,"sides",0,He());var NA=Math.PI*2;class _h extends Ne{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,NA,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),NA,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)}}_h.prototype.className="Ring";_h.prototype._centroid=!0;_h.prototype._attrsAffectingSize=["innerRadius","outerRadius"];vr(_h);Z.addGetterSetter(_h,"innerRadius",0,He());Z.addGetterSetter(_h,"outerRadius",0,He());class Vl extends Ne{constructor(t){super(t),this._updated=!0,this.anim=new qa(()=>{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],d=o[i+2],p=o[i+3],g=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,d,p),t.closePath(),t.fillStrokeShape(this)),g)if(a){var m=a[n],y=r*2;t.drawImage(g,s,l,d,p,m[y+0],m[y+1],d,p)}else t.drawImage(g,s,l,d,p,0,0,d,p)}_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 d=a[n],p=r*2;t.rect(d[p+0],d[p+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{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Sy;function FS(){return Sy||(Sy=ce.createCanvasElement().getContext(Ixe),Sy)}function Wxe(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Vxe(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Uxe(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class mr extends Ne{constructor(t){super(Uxe(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(P+=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=ce._isString(t)?t:t==null?"":t+"";return this._setAttr(Mxe,n),this}getWidth(){var t=this.attrs.width===Cp||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Cp||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 ce.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=FS(),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()+xy+this.fontVariant()+xy+(this.fontSize()+Dxe)+Hxe(this.fontFamily())}_addTextLine(t){this.align()===sg&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return FS().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!==Cp&&o!==void 0,l=a!==Cp&&a!==void 0,d=this.padding(),p=o-d*2,g=a-d*2,m=0,y=this.wrap(),x=y!==FA,S=y!==$xe&&x,E=this.ellipsis();this.textArr=[],FS().font=this._getContextFont();for(var P=E?this._getTextWidth(zS):0,k=0,T=t.length;kp)for(;M.length>0;){for(var F=0,z=M.length,B="",K=0;F>>1,X=M.slice(0,j+1),ue=this._getTextWidth(X)+P;ue<=p?(F=j+1,B=X,K=ue):z=j}if(B){if(S){var ge,xe=M[B.length],we=xe===xy||xe===DA;we&&K<=p?ge=B.length:ge=Math.max(B.lastIndexOf(xy),B.lastIndexOf(DA))+1,ge>0&&(F=ge,B=B.slice(0,F),K=this._getTextWidth(B))}B=B.trimRight(),this._addTextLine(B),r=Math.max(r,K),m+=i;var Se=this._shouldHandleEllipsis(m);if(Se){this._tryToAddEllipsisToLastLine();break}if(M=M.slice(F),M=M.trimLeft(),M.length>0&&(N=this._getTextWidth(M),N<=p)){this._addTextLine(M),m+=i,r=Math.max(r,N);break}}else break}else this._addTextLine(M),m+=i,r=Math.max(r,N),this._shouldHandleEllipsis(m)&&kg)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Cp&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),d=l!==FA;return!d||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Cp&&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+zS)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var d=0;i==="center"&&(d=Math.max(0,s/2-a/2)),i==="right"&&(d=Math.max(0,s-a));for(var p=NB(this.text()),g=this.text().split(" ").length-1,m,y,x,S=-1,E=0,P=function(){E=0;for(var ue=t.dataArray,ge=S+1;ge0)return S=ge,ue[ge];ue[ge].command==="M"&&(m={x:ue[ge].points[0],y:ue[ge].points[1]})}return{}},k=function(ue){var ge=t._getTextSize(ue).width+r;ue===" "&&i==="justify"&&(ge+=(s-a)/g);var xe=0,we=0;for(y=void 0;Math.abs(ge-xe)/ge>.01&&we<20;){we++;for(var Se=xe;x===void 0;)x=P(),x&&Se+x.pathLengthge?y=Rn.getPointOnLine(ge,m.x,m.y,x.points[0],x.points[1],m.x,m.y):x=void 0;break;case"A":var G=x.points[4],te=x.points[5],Q=x.points[4]+te;E===0?E=G+1e-8:ge>xe?E+=Math.PI/180*te/Math.abs(te):E-=Math.PI/360*te/Math.abs(te),(te<0&&E=0&&E>Q)&&(E=Q,J=!0),y=Rn.getPointOnEllipticalArc(x.points[0],x.points[1],x.points[2],x.points[3],E,x.points[6]);break;case"C":E===0?ge>x.pathLength?E=1e-8:E=ge/x.pathLength:ge>xe?E+=(ge-xe)/x.pathLength/2:E=Math.max(E-(xe-ge)/x.pathLength/2,0),E>1&&(E=1,J=!0),y=Rn.getPointOnCubicBezier(E,x.start.x,x.start.y,x.points[0],x.points[1],x.points[2],x.points[3],x.points[4],x.points[5]);break;case"Q":E===0?E=ge/x.pathLength:ge>xe?E+=(ge-xe)/x.pathLength:E-=(xe-ge)/x.pathLength,E>1&&(E=1,J=!0),y=Rn.getPointOnQuadraticBezier(E,x.start.x,x.start.y,x.points[0],x.points[1],x.points[2],x.points[3]);break}y!==void 0&&(xe=Rn.getLineLength(m.x,m.y,y.x,y.y)),J&&(J=!1,x=void 0)}},T="C",M=t._getTextSize(T).width+r,N=d/M-1,F=0;Fe+`.${WB}`).join(" "),$A="nodesRect",Kxe=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],qxe={"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 Zxe="ontouchstart"in st._global;function Yxe(e,t){if(e==="rotater")return"crosshair";t+=ce.degToRad(qxe[e]||0);var n=(ce.radToDeg(t)%360+360)%360;return ce._inRange(n,315+22.5,360)||ce._inRange(n,0,22.5)?"ns-resize":ce._inRange(n,45-22.5,45+22.5)?"nesw-resize":ce._inRange(n,90-22.5,90+22.5)?"ew-resize":ce._inRange(n,135-22.5,135+22.5)?"nwse-resize":ce._inRange(n,180-22.5,180+22.5)?"ns-resize":ce._inRange(n,225-22.5,225+22.5)?"nesw-resize":ce._inRange(n,270-22.5,270+22.5)?"ew-resize":ce._inRange(n,315-22.5,315+22.5)?"nwse-resize":(ce.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var O3=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],BA=1e8;function Xxe(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 VB(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 Qxe(e,t){const n=Xxe(e);return VB(e,t,n)}function Jxe(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(Kxe.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&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($A),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache($A,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 d=(st.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),p={x:a.x+s*Math.cos(d)+l*Math.sin(-d),y:a.y+l*Math.cos(d)+s*Math.sin(d),width:i.width*o.x,height:i.height*o.y,rotation:d};return VB(p,-st.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-BA,y:-BA,width:0,height:0,rotation:0};const n=[];this.nodes().map(d=>{const p=d.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var g=[{x:p.x,y:p.y},{x:p.x+p.width,y:p.y},{x:p.x+p.width,y:p.y+p.height},{x:p.x,y:p.y+p.height}],m=d.getAbsoluteTransform();g.forEach(function(y){var x=m.point(y);n.push(x)})});const r=new ha;r.rotate(-st.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(d){var p=r.point(d);i===void 0&&(i=a=p.x,o=s=p.y),i=Math.min(i,p.x),o=Math.min(o,p.y),a=Math.max(a,p.x),s=Math.max(s,p.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:st.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(),O3.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Pv({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Zxe?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=st.getAngle(this.rotation()),o=Yxe(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 Ne({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()*ce._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 d=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(d,l,t)),o.setAbsolutePosition(l);const p=o.getAbsolutePosition();if(!(d.x===p.x&&d.y===p.y)){if(this._movingAnchorName==="rotater"){var g=this._getNodeRect();n=o.x()-g.width/2,r=-o.y()+g.height/2;let ue=Math.atan2(-r,n)+Math.PI/2;g.height<0&&(ue-=Math.PI);var m=st.getAngle(this.rotation());const ge=m+ue,xe=st.getAngle(this.rotationSnapTolerance()),Se=Jxe(this.rotationSnaps(),ge,xe)-g.rotation,J=Qxe(g,Se);this._fitNodesInto(J,t);return}var y=this.keepRatio()||t.shiftKey,k=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(y){var x=k?{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(x.x-o.x(),2)+Math.pow(x.y-o.y(),2));var S=this.findOne(".top-left").x()>x.x?-1:1,E=this.findOne(".top-left").y()>x.y?-1:1;n=i*this.cos*S,r=i*this.sin*E,this.findOne(".top-left").x(x.x-n),this.findOne(".top-left").y(x.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){var x=k?{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()-x.x,2)+Math.pow(x.y-o.y(),2));var S=this.findOne(".top-right").x()x.y?-1:1;n=i*this.cos*S,r=i*this.sin*E,this.findOne(".top-right").x(x.x+n),this.findOne(".top-right").y(x.y-r)}var P=o.position();this.findOne(".top-left").y(P.y),this.findOne(".bottom-right").x(P.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(y){var x=k?{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(x.x-o.x(),2)+Math.pow(o.y()-x.y,2));var S=x.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(ce._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(ce._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new ha;if(a.rotate(st.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const g=a.point({x:-this.padding()*2,y:0});if(t.x+=g.x,t.y+=g.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const g=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const g=a.point({x:0,y:-this.padding()*2});if(t.x+=g.x,t.y+=g.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const g=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const g=this.boundBoxFunc()(r,t);g?t=g:ce.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new ha;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const d=new ha;d.translate(t.x,t.y),d.rotate(t.rotation),d.scale(t.width/s,t.height/s);const p=d.multiply(l.invert());this._nodes.forEach(g=>{var m;const y=g.getParent().getAbsoluteTransform(),x=g.getTransform().copy();x.translate(g.offsetX(),g.offsetY());const S=new ha;S.multiply(y.copy().invert()).multiply(p).multiply(y).multiply(x);const E=S.decompose();g.setAttrs(E),this._fire("transform",{evt:n,target:g}),g._fire("transform",{evt:n,target:g}),(m=g.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(ce._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(ce._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").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()*ce._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}),(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=""),M0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return We.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}function eSe(e){return e instanceof Array||ce.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){O3.indexOf(t)===-1&&ce.warn("Unknown anchor name: "+t+". Available names are: "+O3.join(", "))}),e||[]}kn.prototype.className="Transformer";vr(kn);Z.addGetterSetter(kn,"enabledAnchors",O3,eSe);Z.addGetterSetter(kn,"flipEnabled",!0,zs());Z.addGetterSetter(kn,"resizeEnabled",!0);Z.addGetterSetter(kn,"anchorSize",10,He());Z.addGetterSetter(kn,"rotateEnabled",!0);Z.addGetterSetter(kn,"rotationSnaps",[]);Z.addGetterSetter(kn,"rotateAnchorOffset",50,He());Z.addGetterSetter(kn,"rotationSnapTolerance",5,He());Z.addGetterSetter(kn,"borderEnabled",!0);Z.addGetterSetter(kn,"anchorStroke","rgb(0, 161, 255)");Z.addGetterSetter(kn,"anchorStrokeWidth",1,He());Z.addGetterSetter(kn,"anchorFill","white");Z.addGetterSetter(kn,"anchorCornerRadius",0,He());Z.addGetterSetter(kn,"borderStroke","rgb(0, 161, 255)");Z.addGetterSetter(kn,"borderStrokeWidth",1,He());Z.addGetterSetter(kn,"borderDash");Z.addGetterSetter(kn,"keepRatio",!0);Z.addGetterSetter(kn,"centeredScaling",!1);Z.addGetterSetter(kn,"ignoreStroke",!1);Z.addGetterSetter(kn,"padding",0,He());Z.addGetterSetter(kn,"node");Z.addGetterSetter(kn,"nodes");Z.addGetterSetter(kn,"boundBoxFunc");Z.addGetterSetter(kn,"anchorDragBoundFunc");Z.addGetterSetter(kn,"shouldOverdrawWholeArea",!1);Z.addGetterSetter(kn,"useSingleNodeRotation",!0);Z.backCompat(kn,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Ku extends Ne{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,st.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)}}Ku.prototype.className="Wedge";Ku.prototype._centroid=!0;Ku.prototype._attrsAffectingSize=["radius"];vr(Ku);Z.addGetterSetter(Ku,"radius",0,He());Z.addGetterSetter(Ku,"angle",0,He());Z.addGetterSetter(Ku,"clockwise",!1);Z.backCompat(Ku,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function HA(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var tSe=[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],nSe=[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 rSe(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,d,p,g,m,y,x,S,E,P,k,T,M,N,F,z,B,K,j,X,ue,ge=t+t+1,xe=r-1,we=i-1,Se=t+1,J=Se*(Se+1)/2,G=new HA,te=null,Q=G,W=null,ie=null,de=tSe[t],be=nSe[t];for(s=1;s>be,X!==0?(X=255/X,n[p]=(m*de>>be)*X,n[p+1]=(y*de>>be)*X,n[p+2]=(x*de>>be)*X):n[p]=n[p+1]=n[p+2]=0,m-=E,y-=P,x-=k,S-=T,E-=W.r,P-=W.g,k-=W.b,T-=W.a,l=g+((l=o+t+1)>be,X>0?(X=255/X,n[l]=(m*de>>be)*X,n[l+1]=(y*de>>be)*X,n[l+2]=(x*de>>be)*X):n[l]=n[l+1]=n[l+2]=0,m-=E,y-=P,x-=k,S-=T,E-=W.r,P-=W.g,k-=W.b,T-=W.a,l=o+((l=a+Se)0&&rSe(t,n)};Z.addGetterSetter(We,"blurRadius",0,He(),Z.afterSetFilter);const oSe=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?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};Z.addGetterSetter(We,"contrast",0,He(),Z.afterSetFilter);const sSe=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,d=e.height,p=l*4,g=d;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:ce.error("Unknown emboss direction: "+r)}do{var m=(g-1)*p,y=o;g+y<1&&(y=0),g+y>d&&(y=0);var x=(g-1+y)*l*4,S=l;do{var E=m+(S-1)*4,P=a;S+P<1&&(P=0),S+P>l&&(P=0);var k=x+(S-1+P)*4,T=s[E]-s[k],M=s[E+1]-s[k+1],N=s[E+2]-s[k+2],F=T,z=F>0?F:-F,B=M>0?M:-M,K=N>0?N:-N;if(B>z&&(F=M),K>z&&(F=N),F*=t,i){var j=s[E]+F,X=s[E+1]+F,ue=s[E+2]+F;s[E]=j>255?255:j<0?0:j,s[E+1]=X>255?255:X<0?0:X,s[E+2]=ue>255?255:ue<0?0:ue}else{var ge=n-F;ge<0?ge=0:ge>255&&(ge=255),s[E]=s[E+1]=s[E+2]=ge}}while(--S)}while(--g)};Z.addGetterSetter(We,"embossStrength",.5,He(),Z.afterSetFilter);Z.addGetterSetter(We,"embossWhiteLevel",.5,He(),Z.afterSetFilter);Z.addGetterSetter(We,"embossDirection","top-left",null,Z.afterSetFilter);Z.addGetterSetter(We,"embossBlend",!1,null,Z.afterSetFilter);function $S(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 lSe=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,d=t[2],p=d,g,m,y=this.enhance();if(y!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),g=t[m+2],gp&&(p=g);i===r&&(i=255,r=0),s===a&&(s=255,a=0),p===d&&(p=255,d=0);var x,S,E,P,k,T,M,N,F;for(y>0?(S=i+y*(255-i),E=r-y*(r-0),k=s+y*(255-s),T=a-y*(a-0),N=p+y*(255-p),F=d-y*(d-0)):(x=(i+r)*.5,S=i+y*(i-x),E=r+y*(r-x),P=(s+a)*.5,k=s+y*(s-P),T=a+y*(a-P),M=(p+d)*.5,N=p+y*(p-M),F=d+y*(d-M)),m=0;mP?E:P;var k=a,T=o,M,N,F=360/T*Math.PI/180,z,B;for(N=0;NT?k:T;var M=a,N=o,F,z,B=n.polarRotation||0,K,j;for(p=0;pt&&(M=T,N=0,F=-1),i=0;i=0&&y=0&&x=0&&y=0&&x=255*4?255:0}return a}function SSe(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=0&&y=0&&x=n))for(o=S;o=r||(a=(n*o+i)*4,s+=M[a+0],l+=M[a+1],d+=M[a+2],p+=M[a+3],T+=1);for(s=s/T,l=l/T,d=d/T,p=p/T,i=y;i=n))for(o=S;o=r||(a=(n*o+i)*4,M[a+0]=s,M[a+1]=l,M[a+2]=d,M[a+3]=p)}};Z.addGetterSetter(We,"pixelSize",8,He(),Z.afterSetFilter);const kSe=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});Z.addGetterSetter(We,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Z.addGetterSetter(We,"blue",0,fB,Z.afterSetFilter);const PSe=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;s255?255:e<0?0:Math.round(e)});Z.addGetterSetter(We,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Z.addGetterSetter(We,"blue",0,fB,Z.afterSetFilter);Z.addGetterSetter(We,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const TSe=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(d=255-d),p>127&&(p=255-p),g>127&&(g=255-g),t[l]=d,t[l+1]=p,t[l+2]=g}while(--s)}while(--o)},ASe=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;ire||L[V]!==R[re]){var fe=` +`+L[V].replace(" at new "," at ");return c.displayName&&fe.includes("")&&(fe=fe.replace("",c.displayName)),fe}while(1<=V&&0<=re);break}}}finally{eo=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?ss(c):""}var Xu=Object.prototype.hasOwnProperty,Ws=[],Ta=-1;function Wi(c){return{current:c}}function gn(c){0>Ta||(c.current=Ws[Ta],Ws[Ta]=null,Ta--)}function cn(c,f){Ta++,Ws[Ta]=c.current,c.current=f}var to={},ar=Wi(to),Tr=Wi(!1),no=to;function La(c,f){var v=c.type.contextTypes;if(!v)return to;var C=c.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===f)return C.__reactInternalMemoizedMaskedChildContext;var L={},R;for(R in v)L[R]=f[R];return C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=L),L}function Lr(c){return c=c.childContextTypes,c!=null}function Zo(){gn(Tr),gn(ar)}function jl(c,f,v){if(ar.current!==to)throw Error(a(168));cn(ar,f),cn(Tr,v)}function Co(c,f,v){var C=c.stateNode;if(f=f.childContextTypes,typeof C.getChildContext!="function")return v;C=C.getChildContext();for(var L in C)if(!(L in f))throw Error(a(108,B(c)||"Unknown",L));return o({},v,C)}function ro(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||to,no=ar.current,cn(ar,c),cn(Tr,Tr.current),!0}function Kl(c,f,v){var C=c.stateNode;if(!C)throw Error(a(169));v?(c=Co(c,f,no),C.__reactInternalMemoizedMergedChildContext=c,gn(Tr),gn(ar),cn(ar,c)):gn(Tr),cn(Tr,v)}var Xr=Math.clz32?Math.clz32:Zl,ql=Math.log,Qu=Math.LN2;function Zl(c){return c>>>=0,c===0?32:31-(ql(c)/Qu|0)|0}var Aa=64,xi=4194304;function Ia(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 ls(c,f){var v=c.pendingLanes;if(v===0)return 0;var C=0,L=c.suspendedLanes,R=c.pingedLanes,V=v&268435455;if(V!==0){var re=V&~L;re!==0?C=Ia(re):(R&=V,R!==0&&(C=Ia(R)))}else V=v&~L,V!==0?C=Ia(V):R!==0&&(C=Ia(R));if(C===0)return 0;if(f!==0&&f!==C&&(f&L)===0&&(L=C&-C,R=f&-f,L>=R||L===16&&(R&4194240)!==0))return f;if((C&4)!==0&&(C|=v&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=C;0v;v++)f.push(c);return f}function Si(c,f,v){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Xr(f),c[f]=v}function us(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,L-=V,si=1<<32-Xr(f)+L|v<$t?(Ur=_t,_t=null):Ur=_t.sibling;var Zt=Je(he,_t,ve[$t],Ze);if(Zt===null){_t===null&&(_t=Ur);break}c&&_t&&Zt.alternate===null&&f(he,_t),oe=R(Zt,oe,$t),Pt===null?Le=Zt:Pt.sibling=Zt,Pt=Zt,_t=Ur}if($t===ve.length)return v(he,_t),On&&Gs(he,$t),Le;if(_t===null){for(;$t$t?(Ur=_t,_t=null):Ur=_t.sibling;var bs=Je(he,_t,Zt.value,Ze);if(bs===null){_t===null&&(_t=Ur);break}c&&_t&&bs.alternate===null&&f(he,_t),oe=R(bs,oe,$t),Pt===null?Le=bs:Pt.sibling=bs,Pt=bs,_t=Ur}if(Zt.done)return v(he,_t),On&&Gs(he,$t),Le;if(_t===null){for(;!Zt.done;$t++,Zt=ve.next())Zt=Et(he,Zt.value,Ze),Zt!==null&&(oe=R(Zt,oe,$t),Pt===null?Le=Zt:Pt.sibling=Zt,Pt=Zt);return On&&Gs(he,$t),Le}for(_t=C(he,_t);!Zt.done;$t++,Zt=ve.next())Zt=Dn(_t,he,$t,Zt.value,Ze),Zt!==null&&(c&&Zt.alternate!==null&&_t.delete(Zt.key===null?$t:Zt.key),oe=R(Zt,oe,$t),Pt===null?Le=Zt:Pt.sibling=Zt,Pt=Zt);return c&&_t.forEach(function(hi){return f(he,hi)}),On&&Gs(he,$t),Le}function aa(he,oe,ve,Ze){if(typeof ve=="object"&&ve!==null&&ve.type===p&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case l:e:{for(var Le=ve.key,Pt=oe;Pt!==null;){if(Pt.key===Le){if(Le=ve.type,Le===p){if(Pt.tag===7){v(he,Pt.sibling),oe=L(Pt,ve.props.children),oe.return=he,he=oe;break e}}else if(Pt.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&o1(Le)===Pt.type){v(he,Pt.sibling),oe=L(Pt,ve.props),oe.ref=Da(he,Pt,ve),oe.return=he,he=oe;break e}v(he,Pt);break}else f(he,Pt);Pt=Pt.sibling}ve.type===p?(oe=ol(ve.props.children,he.mode,Ze,ve.key),oe.return=he,he=oe):(Ze=yf(ve.type,ve.key,ve.props,null,he.mode,Ze),Ze.ref=Da(he,oe,ve),Ze.return=he,he=Ze)}return V(he);case d:e:{for(Pt=ve.key;oe!==null;){if(oe.key===Pt)if(oe.tag===4&&oe.stateNode.containerInfo===ve.containerInfo&&oe.stateNode.implementation===ve.implementation){v(he,oe.sibling),oe=L(oe,ve.children||[]),oe.return=he,he=oe;break e}else{v(he,oe);break}else f(he,oe);oe=oe.sibling}oe=al(ve,he.mode,Ze),oe.return=he,he=oe}return V(he);case T:return Pt=ve._init,aa(he,oe,Pt(ve._payload),Ze)}if(we(ve))return En(he,oe,ve,Ze);if(F(ve))return Jn(he,oe,ve,Ze);Ui(he,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,oe!==null&&oe.tag===6?(v(he,oe.sibling),oe=L(oe,ve),oe.return=he,he=oe):(v(he,oe),oe=sp(ve,he.mode,Ze),oe.return=he,he=oe),V(he)):v(he,oe)}return aa}var oc=Fv(!0),$v=Fv(!1),ef={},Eo=Wi(ef),za=Wi(ef),ee=Wi(ef);function ye(c){if(c===ef)throw Error(a(174));return c}function pe(c,f){cn(ee,f),cn(za,c),cn(Eo,ef),c=J(f),gn(Eo),cn(Eo,c)}function Qe(){gn(Eo),gn(za),gn(ee)}function Ct(c){var f=ye(ee.current),v=ye(Eo.current);f=G(v,c.type,f),v!==f&&(cn(za,c),cn(Eo,f))}function Jt(c){za.current===c&&(gn(Eo),gn(za))}var It=Wi(0);function fn(c){for(var f=c;f!==null;){if(f.tag===13){var v=f.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Bs(v)||Gl(v)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)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 tf=[];function a1(){for(var c=0;cv?v:4,c(!0);var C=ac.transition;ac.transition={};try{c(!1),f()}finally{At=v,ac.transition=C}}function hc(){return _i().memoizedState}function p1(c,f,v){var C=Nr(c);if(v={lane:C,action:v,hasEagerState:!1,eagerState:null,next:null},gc(c))mc(f,v);else if(v=ic(c,f,v,C),v!==null){var L=fi();Lo(v,c,C,L),lf(v,f,C)}}function pc(c,f,v){var C=Nr(c),L={lane:C,action:v,hasEagerState:!1,eagerState:null,next:null};if(gc(c))mc(f,L);else{var R=c.alternate;if(c.lanes===0&&(R===null||R.lanes===0)&&(R=f.lastRenderedReducer,R!==null))try{var V=f.lastRenderedState,re=R(V,v);if(L.hasEagerState=!0,L.eagerState=re,I(re,V)){var fe=f.interleaved;fe===null?(L.next=L,Qd(f)):(L.next=fe.next,fe.next=L),f.interleaved=L;return}}catch{}finally{}v=ic(c,f,L,C),v!==null&&(L=fi(),Lo(v,c,C,L),lf(v,f,C))}}function gc(c){var f=c.alternate;return c===Sn||f!==null&&f===Sn}function mc(c,f){nf=on=!0;var v=c.pending;v===null?f.next=f:(f.next=v.next,v.next=f),c.pending=f}function lf(c,f,v){if((v&4194240)!==0){var C=f.lanes;C&=c.pendingLanes,v|=C,f.lanes=v,Yo(c,v)}}var hs={readContext:io,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},Lb={readContext:io,useCallback:function(c,f){return Qr().memoizedState=[c,f===void 0?null:f],c},useContext:io,useEffect:Wv,useImperativeHandle:function(c,f,v){return v=v!=null?v.concat([c]):null,au(4194308,4,br.bind(null,f,c),v)},useLayoutEffect:function(c,f){return au(4194308,4,c,f)},useInsertionEffect:function(c,f){return au(4,2,c,f)},useMemo:function(c,f){var v=Qr();return f=f===void 0?null:f,c=c(),v.memoizedState=[c,f],c},useReducer:function(c,f,v){var C=Qr();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=p1.bind(null,Sn,c),[C.memoizedState,c]},useRef:function(c){var f=Qr();return c={current:c},f.memoizedState=c},useState:Hv,useDebugValue:d1,useDeferredValue:function(c){return Qr().memoizedState=c},useTransition:function(){var c=Hv(!1),f=c[0];return c=h1.bind(null,c[1]),Qr().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,v){var C=Sn,L=Qr();if(On){if(v===void 0)throw Error(a(407));v=v()}else{if(v=f(),Vr===null)throw Error(a(349));(ou&30)!==0||c1(C,f,v)}L.memoizedState=v;var R={value:v,getSnapshot:f};return L.queue=R,Wv(qs.bind(null,C,R,c),[c]),C.flags|=2048,af(9,dc.bind(null,C,R,v,f),void 0,null),v},useId:function(){var c=Qr(),f=Vr.identifierPrefix;if(On){var v=Oa,C=si;v=(C&~(1<<32-Xr(C)-1)).toString(32)+v,f=":"+f+"R"+v,v=sc++,0Xh&&(f.flags|=128,C=!0,bc(L,!1),f.lanes=4194304)}else{if(!C)if(c=fn(R),c!==null){if(f.flags|=128,C=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),bc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!R.alternate&&!On)return ui(f),null}else 2*dn()-L.renderingStartTime>Xh&&v!==1073741824&&(f.flags|=128,C=!0,bc(L,!1),f.lanes=4194304);L.isBackwards?(R.sibling=f.child,f.child=R):(c=L.last,c!==null?c.sibling=R:f.child=R,L.last=R)}return L.tail!==null?(f=L.tail,L.rendering=f,L.tail=f.sibling,L.renderingStartTime=dn(),f.sibling=null,c=It.current,cn(It,C?c&1|2:c&1),f):(ui(f),null);case 22:case 23:return Tc(),v=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==v&&(f.flags|=8192),v&&(f.mode&1)!==0?(ao&1073741824)!==0&&(ui(f),ft&&f.subtreeFlags&6&&(f.flags|=8192)):ui(f),null;case 24:return null;case 25:return null}throw Error(a(156,f.tag))}function w1(c,f){switch(t1(f),f.tag){case 1:return Lr(f.type)&&Zo(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return Qe(),gn(Tr),gn(ar),a1(),c=f.flags,(c&65536)!==0&&(c&128)===0?(f.flags=c&-65537|128,f):null;case 5:return Jt(f),null;case 13:if(gn(It),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(a(340));tc()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return gn(It),null;case 4:return Qe(),null;case 10:return Yd(f.type._context),null;case 22:case 23:return Tc(),null;case 24:return null;default:return null}}var Ys=!1,Mr=!1,Nb=typeof WeakSet=="function"?WeakSet:Set,rt=null;function xc(c,f){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(C){Wn(c,f,C)}else v.current=null}function na(c,f,v){try{v()}catch(C){Wn(c,f,C)}}var Fh=!1;function lu(c,f){for(te(c.containerInfo),rt=f;rt!==null;)if(c=rt,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,rt=f;else for(;rt!==null;){c=rt;try{var v=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var C=v.memoizedProps,L=v.memoizedState,R=c.stateNode,V=R.getSnapshotBeforeUpdate(c.elementType===c.type?C:Xo(c.type,C),L);R.__reactInternalSnapshotBeforeUpdate=V}break;case 3:ft&&Bi(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(re){Wn(c,c.return,re)}if(f=c.sibling,f!==null){f.return=c.return,rt=f;break}rt=c.return}return v=Fh,Fh=!1,v}function ci(c,f,v){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var L=C=C.next;do{if((L.tag&c)===c){var R=L.destroy;L.destroy=void 0,R!==void 0&&na(f,v,R)}L=L.next}while(L!==C)}}function $h(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 Bh(c){var f=c.ref;if(f!==null){var v=c.stateNode;switch(c.tag){case 5:c=Se(v);break;default:c=v}typeof f=="function"?f(c):f.current=c}}function C1(c){var f=c.alternate;f!==null&&(c.alternate=null,C1(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&at(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 Sc(c){return c.tag===5||c.tag===3||c.tag===4}function gs(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Sc(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 Hh(c,f,v){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?Be(v,c,f):kt(v,c);else if(C!==4&&(c=c.child,c!==null))for(Hh(c,f,v),c=c.sibling;c!==null;)Hh(c,f,v),c=c.sibling}function _1(c,f,v){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?Lt(v,c,f):Ee(v,c);else if(C!==4&&(c=c.child,c!==null))for(_1(c,f,v),c=c.sibling;c!==null;)_1(c,f,v),c=c.sibling}var Sr=null,ra=!1;function ia(c,f,v){for(v=v.child;v!==null;)Rr(c,f,v),v=v.sibling}function Rr(c,f,v){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(rn,v)}catch{}switch(v.tag){case 5:Mr||xc(v,f);case 6:if(ft){var C=Sr,L=ra;Sr=null,ia(c,f,v),Sr=C,ra=L,Sr!==null&&(ra?je(Sr,v.stateNode):ut(Sr,v.stateNode))}else ia(c,f,v);break;case 18:ft&&Sr!==null&&(ra?Wd(Sr,v.stateNode):Hd(Sr,v.stateNode));break;case 4:ft?(C=Sr,L=ra,Sr=v.stateNode.containerInfo,ra=!0,ia(c,f,v),Sr=C,ra=L):(Rt&&(C=v.stateNode.containerInfo,L=Wr(C),$s(C,L)),ia(c,f,v));break;case 0:case 11:case 14:case 15:if(!Mr&&(C=v.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){L=C=C.next;do{var R=L,V=R.destroy;R=R.tag,V!==void 0&&((R&2)!==0||(R&4)!==0)&&na(v,f,V),L=L.next}while(L!==C)}ia(c,f,v);break;case 1:if(!Mr&&(xc(v,f),C=v.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=v.memoizedProps,C.state=v.memoizedState,C.componentWillUnmount()}catch(re){Wn(v,f,re)}ia(c,f,v);break;case 21:ia(c,f,v);break;case 22:v.mode&1?(Mr=(C=Mr)||v.memoizedState!==null,ia(c,f,v),Mr=C):ia(c,f,v);break;default:ia(c,f,v)}}function Wh(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new Nb),f.forEach(function(C){var L=a2.bind(null,c,C);v.has(C)||(v.add(C),C.then(L,L))})}}function Po(c,f){var v=f.deletions;if(v!==null)for(var C=0;C";case jh:return":has("+(P1(c)||"")+")";case Kh:return'[role="'+c.value+'"]';case qh:return'"'+c.value+'"';case wc:return'[data-testname="'+c.value+'"]';default:throw Error(a(365))}}function Cc(c,f){var v=[];c=[c,0];for(var C=0;CL&&(L=V),C&=~R}if(C=L,C=dn()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*Db(C/1960))-C,10c?16:c,wt===null)var C=!1;else{if(c=wt,wt=null,Qh=0,(Ft&6)!==0)throw Error(a(331));var L=Ft;for(Ft|=4,rt=c.current;rt!==null;){var R=rt,V=R.child;if((rt.flags&16)!==0){var re=R.deletions;if(re!==null){for(var fe=0;fedn()-A1?nl(c,0):L1|=v),ei(c,f)}function N1(c,f){f===0&&((c.mode&1)===0?f=1:(f=xi,xi<<=1,(xi&130023424)===0&&(xi=4194304)));var v=fi();c=Qo(c,f),c!==null&&(Si(c,f,v),ei(c,v))}function Fb(c){var f=c.memoizedState,v=0;f!==null&&(v=f.retryLane),N1(c,v)}function a2(c,f){var v=0;switch(c.tag){case 13:var C=c.stateNode,L=c.memoizedState;L!==null&&(v=L.retryLane);break;case 19:C=c.stateNode;break;default:throw Error(a(314))}C!==null&&C.delete(f),N1(c,v)}var D1;D1=function(c,f,v){if(c!==null)if(c.memoizedProps!==f.pendingProps||Tr.current)Gi=!0;else{if((c.lanes&v)===0&&(f.flags&128)===0)return Gi=!1,Rb(c,f,v);Gi=(c.flags&131072)!==0}else Gi=!1,On&&(f.flags&1048576)!==0&&e1(f,qt,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;Fa(c,f),c=f.pendingProps;var L=La(f,ar.current);rc(f,v),L=l1(null,f,C,c,L,v);var R=lc();return f.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Lr(C)?(R=!0,ro(f)):R=!1,f.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,r1(f),L.updater=Jo,f.stateNode=L,L._reactInternals=f,i1(f,C,c,v),f=ea(null,f,C,!0,R,v)):(f.tag=0,On&&R&&wi(f),ki(null,f,L,v),f=f.child),f;case 16:C=f.elementType;e:{switch(Fa(c,f),c=f.pendingProps,L=C._init,C=L(C._payload),f.type=C,L=f.tag=op(C),c=Xo(C,c),L){case 0:f=v1(null,f,C,c,v);break e;case 1:f=Xv(null,f,C,c,v);break e;case 11:f=Kv(null,f,C,c,v);break e;case 14:f=Zs(null,f,C,Xo(C.type,c),v);break e}throw Error(a(306,C,""))}return f;case 0:return C=f.type,L=f.pendingProps,L=f.elementType===C?L:Xo(C,L),v1(c,f,C,L,v);case 1:return C=f.type,L=f.pendingProps,L=f.elementType===C?L:Xo(C,L),Xv(c,f,C,L,v);case 3:e:{if(Qv(f),c===null)throw Error(a(387));C=f.pendingProps,R=f.memoizedState,L=R.element,Ov(c,f),Lh(f,C,null,v);var V=f.memoizedState;if(C=V.element,Ot&&R.isDehydrated)if(R={element:C,isDehydrated:!1,cache:V.cache,pendingSuspenseBoundaries:V.pendingSuspenseBoundaries,transitions:V.transitions},f.updateQueue.baseState=R,f.memoizedState=R,f.flags&256){L=vc(Error(a(423)),f),f=Jv(c,f,C,v,L);break e}else if(C!==L){L=vc(Error(a(424)),f),f=Jv(c,f,C,v,L);break e}else for(Ot&&(_o=Od(f.stateNode.containerInfo),Hn=f,On=!0,Vi=null,ko=!1),v=$v(f,null,C,v),f.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(tc(),C===L){f=ps(c,f,v);break e}ki(c,f,C,v)}f=f.child}return f;case 5:return Ct(f),c===null&&jd(f),C=f.type,L=f.pendingProps,R=c!==null?c.memoizedProps:null,V=L.children,De(C,L)?V=null:R!==null&&De(C,R)&&(f.flags|=32),Yv(c,f),ki(c,f,V,v),f.child;case 6:return c===null&&jd(f),null;case 13:return e2(c,f,v);case 4:return pe(f,f.stateNode.containerInfo),C=f.pendingProps,c===null?f.child=oc(f,null,C,v):ki(c,f,C,v),f.child;case 11:return C=f.type,L=f.pendingProps,L=f.elementType===C?L:Xo(C,L),Kv(c,f,C,L,v);case 7:return ki(c,f,f.pendingProps,v),f.child;case 8:return ki(c,f,f.pendingProps.children,v),f.child;case 12:return ki(c,f,f.pendingProps.children,v),f.child;case 10:e:{if(C=f.type._context,L=f.pendingProps,R=f.memoizedProps,V=L.value,Rv(f,C,V),R!==null)if(I(R.value,V)){if(R.children===L.children&&!Tr.current){f=ps(c,f,v);break e}}else for(R=f.child,R!==null&&(R.return=f);R!==null;){var re=R.dependencies;if(re!==null){V=R.child;for(var fe=re.firstContext;fe!==null;){if(fe.context===C){if(R.tag===1){fe=fs(-1,v&-v),fe.tag=2;var Fe=R.updateQueue;if(Fe!==null){Fe=Fe.shared;var it=Fe.pending;it===null?fe.next=fe:(fe.next=it.next,it.next=fe),Fe.pending=fe}}R.lanes|=v,fe=R.alternate,fe!==null&&(fe.lanes|=v),Xd(R.return,v,f),re.lanes|=v;break}fe=fe.next}}else if(R.tag===10)V=R.type===f.type?null:R.child;else if(R.tag===18){if(V=R.return,V===null)throw Error(a(341));V.lanes|=v,re=V.alternate,re!==null&&(re.lanes|=v),Xd(V,v,f),V=R.sibling}else V=R.child;if(V!==null)V.return=R;else for(V=R;V!==null;){if(V===f){V=null;break}if(R=V.sibling,R!==null){R.return=V.return,V=R;break}V=V.return}R=V}ki(c,f,L.children,v),f=f.child}return f;case 9:return L=f.type,C=f.pendingProps.children,rc(f,v),L=io(L),C=C(L),f.flags|=1,ki(c,f,C,v),f.child;case 14:return C=f.type,L=Xo(C,f.pendingProps),L=Xo(C.type,L),Zs(c,f,C,L,v);case 15:return qv(c,f,f.type,f.pendingProps,v);case 17:return C=f.type,L=f.pendingProps,L=f.elementType===C?L:Xo(C,L),Fa(c,f),f.tag=1,Lr(C)?(c=!0,ro(f)):c=!1,rc(f,v),Dv(f,C,L),i1(f,C,L,v),ea(null,f,C,!0,c,v);case 19:return n2(c,f,v);case 22:return Zv(c,f,v)}throw Error(a(156,f.tag))};function Ti(c,f){return cs(c,f)}function $a(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 Ao(c,f,v,C){return new $a(c,f,v,C)}function z1(c){return c=c.prototype,!(!c||!c.isReactComponent)}function op(c){if(typeof c=="function")return z1(c)?1:0;if(c!=null){if(c=c.$$typeof,c===S)return 11;if(c===k)return 14}return 2}function lo(c,f){var v=c.alternate;return v===null?(v=Ao(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 yf(c,f,v,C,L,R){var V=2;if(C=c,typeof c=="function")z1(c)&&(V=1);else if(typeof c=="string")V=5;else e:switch(c){case p:return ol(v.children,L,R,f);case g:V=8,L|=8;break;case m:return c=Ao(12,v,f,L|2),c.elementType=m,c.lanes=R,c;case E:return c=Ao(13,v,f,L),c.elementType=E,c.lanes=R,c;case P:return c=Ao(19,v,f,L),c.elementType=P,c.lanes=R,c;case M:return ap(v,L,R,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case y:V=10;break e;case x:V=9;break e;case S:V=11;break e;case k:V=14;break e;case T:V=16,C=null;break e}throw Error(a(130,c==null?c:typeof c,""))}return f=Ao(V,v,f,L),f.elementType=c,f.type=C,f.lanes=R,f}function ol(c,f,v,C){return c=Ao(7,c,C,f),c.lanes=v,c}function ap(c,f,v,C){return c=Ao(22,c,C,f),c.elementType=M,c.lanes=v,c.stateNode={isHidden:!1},c}function sp(c,f,v){return c=Ao(6,c,null,f),c.lanes=v,c}function al(c,f,v){return f=Ao(4,c.children!==null?c.children:[],c.key,f),f.lanes=v,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function bf(c,f,v,C,L){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=$e,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Us(0),this.expirationTimes=Us(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Us(0),this.identifierPrefix=C,this.onRecoverableError=L,Ot&&(this.mutableSourceEagerHydrationData=null)}function s2(c,f,v,C,L,R,V,re,fe){return c=new bf(c,f,v,re,fe),f===1?(f=1,R===!0&&(f|=8)):f=0,R=Ao(3,null,null,f),c.current=R,R.stateNode=c,R.memoizedState={element:C,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},r1(R),c}function F1(c){if(!c)return to;c=c._reactInternals;e:{if(K(c)!==c||c.tag!==1)throw Error(a(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Lr(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(a(171))}if(c.tag===1){var v=c.type;if(Lr(v))return Co(c,v,f)}return f}function $1(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(a(188)):(c=Object.keys(c).join(","),Error(a(268,c)));return c=ue(f),c===null?null:c.stateNode}function xf(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v=Fe&&R>=Et&&L<=it&&V<=Je){c.splice(f,1);break}else if(C!==Fe||v.width!==fe.width||JeV){if(!(R!==Et||v.height!==fe.height||itL)){Fe>C&&(fe.width+=Fe-C,fe.x=C),itR&&(fe.height+=Et-R,fe.y=R),Jev&&(v=V)),V ")+` + +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 Se(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:s.ReactCurrentDispatcher,findHostInstanceByFiber:lp,findFiberByHostInstance:c.findFiberByHostInstance||B1,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{rn=f.inject(c),Nt=f}catch{}c=!!f.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,f,v,C){if(!mt)throw Error(a(363));c=T1(c,f);var L=Wt(c,v,C).disconnect;return{disconnect:function(){L()}}},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=At;try{return At=c,f()}finally{At=v}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,f,v,C){var L=f.current,R=fi(),V=Nr(L);return v=F1(v),f.context===null?f.context=v:f.pendingContext=v,f=fs(R,V),f.payload={element:c},C=C===void 0?null:C,C!==null&&(f.callback=C),c=Ks(L,f,V),c!==null&&(Lo(c,L,V,R),Th(c,L,V)),V},n};(function(e){e.exports=ISe})(UB);const MSe=YC(UB.exports);var h7={exports:{}},kh={};/** + * @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. + */kh.ConcurrentRoot=1;kh.ContinuousEventPriority=4;kh.DefaultEventPriority=16;kh.DiscreteEventPriority=1;kh.IdleEventPriority=536870912;kh.LegacyRoot=0;(function(e){e.exports=kh})(h7);const WA={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let VA=!1,UA=!1;const p7=".react-konva-event",RSe=`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 +`,OSe=`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 +`,NSe={};function _b(e,t,n=NSe){if(!VA&&"zIndex"in t&&(console.warn(OSe),VA=!0),!UA&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(RSe),UA=!0)}for(var o in n)if(!WA[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var d=!t.hasOwnProperty(o);d&&e.setAttr(o,void 0)}var p=t._useStrictMode,g={},m=!1;const y={};for(var o in t)if(!WA[o]){var a=o.slice(0,2)==="on",x=n[o]!==t[o];if(a&&x){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(y[l]=t[o])}!a&&(t[o]!==n[o]||p&&t[o]!==e.getAttr(o))&&(m=!0,g[o]=t[o])}m&&(e.setAttrs(g),Td(e));for(var l in y)e.on(l+p7,y[l])}function Td(e){if(!st.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const GB={},DSe={};uh.Node.prototype._applyProps=_b;function zSe(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),Td(e)}function FSe(e,t,n){let r=uh[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=uh.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return _b(l,o),l}function $Se(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function BSe(e,t,n){return!1}function HSe(e){return e}function WSe(){return null}function VSe(){return null}function USe(e,t,n,r){return DSe}function GSe(){}function jSe(e){}function KSe(e,t){return!1}function qSe(){return GB}function ZSe(){return GB}const YSe=setTimeout,XSe=clearTimeout,QSe=-1;function JSe(e,t){return!1}const ewe=!1,twe=!0,nwe=!0;function rwe(e,t){t.parent===e?t.moveToTop():e.add(t),Td(e)}function iwe(e,t){t.parent===e?t.moveToTop():e.add(t),Td(e)}function jB(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),Td(e)}function owe(e,t,n){jB(e,t,n)}function awe(e,t){t.destroy(),t.off(p7),Td(e)}function swe(e,t){t.destroy(),t.off(p7),Td(e)}function lwe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function uwe(e,t,n){}function cwe(e,t,n,r,i){_b(e,i,r)}function dwe(e){e.hide(),Td(e)}function fwe(e){}function hwe(e,t){(t.visible==null||t.visible)&&e.show()}function pwe(e,t){}function gwe(e){}function mwe(){}const vwe=()=>h7.exports.DefaultEventPriority,ywe=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:zSe,createInstance:FSe,createTextInstance:$Se,finalizeInitialChildren:BSe,getPublicInstance:HSe,prepareForCommit:WSe,preparePortalMount:VSe,prepareUpdate:USe,resetAfterCommit:GSe,resetTextContent:jSe,shouldDeprioritizeSubtree:KSe,getRootHostContext:qSe,getChildHostContext:ZSe,scheduleTimeout:YSe,cancelTimeout:XSe,noTimeout:QSe,shouldSetTextContent:JSe,isPrimaryRenderer:ewe,warnsIfNotActing:twe,supportsMutation:nwe,appendChild:rwe,appendChildToContainer:iwe,insertBefore:jB,insertInContainerBefore:owe,removeChild:awe,removeChildFromContainer:swe,commitTextUpdate:lwe,commitMount:uwe,commitUpdate:cwe,hideInstance:dwe,hideTextInstance:fwe,unhideInstance:hwe,unhideTextInstance:pwe,clearContainer:gwe,detachDeletedInstance:mwe,getCurrentEventPriority:vwe,now:Gp.exports.unstable_now,idlePriority:Gp.exports.unstable_IdlePriority,run:Gp.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"}));var bwe=Object.defineProperty,xwe=Object.defineProperties,Swe=Object.getOwnPropertyDescriptors,GA=Object.getOwnPropertySymbols,wwe=Object.prototype.hasOwnProperty,Cwe=Object.prototype.propertyIsEnumerable,jA=(e,t,n)=>t in e?bwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KA=(e,t)=>{for(var n in t||(t={}))wwe.call(t,n)&&jA(e,n,t[n]);if(GA)for(var n of GA(t))Cwe.call(t,n)&&jA(e,n,t[n]);return e},_we=(e,t)=>xwe(e,Swe(t));function g7(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=g7(r,t,n);if(i)return i;r=t?null:r.sibling}}function KB(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const m7=KB(w.exports.createContext(null));class qB extends w.exports.Component{render(){return _(m7.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:kwe,ReactCurrentDispatcher:Ewe}=w.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Pwe(){const e=w.exports.useContext(m7);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.exports.useId();return w.exports.useMemo(()=>{var r;return(r=kwe.current)!=null?r:g7(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const ug=[],qA=new WeakMap;function Twe(){var e;const t=Pwe();ug.splice(0,ug.length),g7(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==m7&&ug.push(KB(i))});for(const n of ug){const r=(e=Ewe.current)==null?void 0:e.readContext(n);qA.set(n,r)}return w.exports.useMemo(()=>ug.reduce((n,r)=>i=>w.exports.createElement(n,null,w.exports.createElement(r.Provider,_we(KA({},i),{value:qA.get(r)}))),n=>_(qB,{...KA({},n)})),[])}function Lwe(e){const t=le.useRef();return le.useLayoutEffect(()=>{t.current=e}),t.current}const Awe=e=>{const t=le.useRef(),n=le.useRef(),r=le.useRef(),i=Lwe(e),o=Twe(),a=s=>{const{forwardedRef:l}=e;!l||(typeof l=="function"?l(s):l.current=s)};return le.useLayoutEffect(()=>(n.current=new uh.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Tg.createContainer(n.current,h7.exports.LegacyRoot,!1,null),Tg.updateContainer(_(o,{children:e.children}),r.current),()=>{!uh.isBrowser||(a(null),Tg.updateContainer(null,r.current,null),n.current.destroy())}),[]),le.useLayoutEffect(()=>{a(n.current),_b(n.current,e,i),Tg.updateContainer(_(o,{children:e.children}),r.current,null)}),_("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},BS="Layer",Iwe="Group",LC="Rect",AC="Circle",Mwe="Line",HS="Image",Rwe="Transformer",Tg=MSe(ywe);Tg.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:le.version,rendererPackageName:"react-konva"});const Owe=le.forwardRef((e,t)=>_(qB,{children:_(Awe,{...e,forwardedRef:t})})),Nwe=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},ZB=e=>{const{r:t,g:n,b:r}=e;return`rgba(${t}, ${n}, ${r})`},Dwe=xn(e=>e.inpainting,e=>{const{lines:t,maskColor:n}=e;return{lines:t,maskColorString:ZB(n)}}),zwe=xn([e=>e.inpainting,e=>e.options],(e,t)=>{const{tool:n,brushSize:r,maskColor:i,shouldInvertMask:o,shouldShowMask:a,shouldShowCheckboardTransparency:s,lines:l,pastLines:d,futureLines:p,shouldShowBoundingBoxFill:g,shouldShowBoundingBox:m}=e,{activeTab:y,showDualDisplay:x}=t;return{tool:n,brushSize:r,maskColor:i,shouldInvertMask:o,shouldShowMask:a,shouldShowCheckboardTransparency:s,canUndo:d.length>0,canRedo:p.length>0,isMaskEmpty:l.length===0,activeTabName:Ko[y],showDualDisplay:x,shouldShowBoundingBoxFill:g,shouldShowBoundingBox:m}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),Fwe=xn(e=>e.inpainting,e=>{const{tool:t,brushSize:n,maskColor:r,shouldInvertMask:i,shouldShowMask:o,shouldShowCheckboardTransparency:a,imageToInpaint:s,stageScale:l,shouldShowBoundingBoxFill:d,isDrawing:p,shouldLockBoundingBox:g,shouldShowBoundingBox:m}=e;return{tool:t,brushSize:n,shouldInvertMask:i,shouldShowMask:o,shouldShowCheckboardTransparency:a,maskColor:r,imageToInpaint:s,stageScale:l,shouldShowBoundingBoxFill:d,isDrawing:p,shouldLockBoundingBox:g,shouldShowBoundingBox:m}},{memoizeOptions:{resultEqualityCheck:(e,t)=>{const{imageToInpaint:n,...r}=e,{imageToInpaint:i,...o}=t;return tn.isEqual(r,o)&&n==i}}}),$we=()=>{const{lines:e,maskColorString:t}=qe(Dwe);return _(jn,{children:e.map((n,r)=>_(Mwe,{points:n.points,stroke:t,strokeWidth:n.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:n.tool==="brush"?"source-over":"destination-out"},r))})},Bwe=xn(e=>e.inpainting,e=>{const{cursorPosition:t,canvasDimensions:{width:n,height:r},shouldShowBrushPreview:i,brushSize:o,maskColor:a,tool:s,shouldShowBrush:l}=e;return{cursorPosition:t,width:n,height:r,shouldShowBrushPreview:i,brushSize:o,maskColorString:ZB(a),tool:s,shouldShowBrush:l}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),Hwe=()=>{const{cursorPosition:e,width:t,height:n,shouldShowBrushPreview:r,brushSize:i,maskColorString:o,tool:a,shouldShowBrush:s}=qe(Bwe);return!s||!(e||r)?null:_(AC,{x:e?e.x:t/2,y:e?e.y:n/2,radius:i/2,fill:o,listening:!1,globalCompositeOperation:a==="eraser"?"destination-out":"source-over"})},Wwe=xn(e=>e.inpainting,e=>{const{cursorPosition:t,canvasDimensions:{width:n,height:r},shouldShowBrushPreview:i,brushSize:o,stageScale:a,shouldShowBrush:s}=e;return{cursorPosition:t,width:n,height:r,shouldShowBrushPreview:i,brushSize:o,strokeWidth:1/a,shouldShowBrush:s}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),Vwe=()=>{const{cursorPosition:e,width:t,height:n,shouldShowBrushPreview:r,brushSize:i,strokeWidth:o,shouldShowBrush:a}=qe(Wwe);return!a||!(e||r)?null:ae(jn,{children:[_(AC,{x:e?e.x:t/2,y:e?e.y:n/2,radius:i/2,stroke:"rgba(0,0,0,1)",strokeWidth:o,strokeEnabled:!0,listening:!1}),_(AC,{x:e?e.x:t/2,y:e?e.y:n/2,radius:1,fill:"rgba(0,0,0,1)",listening:!1})]})},Uwe=()=>{const{tool:e,lines:t,cursorPosition:n,brushSize:r,canvasDimensions:{width:i,height:o},maskColor:a,shouldInvertMask:s,shouldShowMask:l,shouldShowBrushPreview:d,shouldShowCheckboardTransparency:p,imageToInpaint:g,shouldShowBrush:m,shouldShowBoundingBoxFill:y,shouldLockBoundingBox:x,stageScale:S,pastLines:E,futureLines:P,needsCache:k,isDrawing:T}=qe(M=>M.inpainting);return w.exports.useLayoutEffect(()=>{!bl.current||bl.current.cache({x:0,y:0,width:i,height:o})},[t,n,i,o,e,r,a,s,l,d,p,g,m,y,x,S,E,P,k,T]),w.exports.useEffect(()=>{const M=window.setTimeout(()=>{!bl.current||bl.current.cache({x:0,y:0,width:i,height:o})},0);return()=>{window.clearTimeout(M)}}),null},_y=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:Math.floor(r.x),y:Math.floor(r.y)}},Gwe=4,YB=xn(e=>e.inpainting,e=>{const{boundingBoxCoordinate:t,boundingBoxDimensions:n,boundingBoxPreviewFill:r,canvasDimensions:i,stageScale:o,imageToInpaint:a,shouldLockBoundingBox:s}=e;return{boundingBoxCoordinate:t,boundingBoxDimensions:n,boundingBoxPreviewFillString:Nwe(r),canvasDimensions:i,stageScale:o,imageToInpaint:a,dash:Gwe/o,strokeWidth:1/o,shouldLockBoundingBox:s}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),jwe=()=>{const{boundingBoxCoordinate:e,boundingBoxDimensions:t,boundingBoxPreviewFillString:n,canvasDimensions:r}=qe(YB);return ae(Iwe,{children:[_(LC,{x:0,y:0,height:r.height,width:r.width,fill:n}),_(LC,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,globalCompositeOperation:"destination-out"})]})},Kwe=()=>{const e=bt(),{boundingBoxCoordinate:t,boundingBoxDimensions:n,strokeWidth:r,stageScale:i,imageToInpaint:o,shouldLockBoundingBox:a}=qe(YB),s=w.exports.useRef(null),l=w.exports.useRef(null);w.exports.useEffect(()=>{!s.current||!l.current||(s.current.nodes([l.current]),s.current.getLayer()?.batchDraw())},[a]);const d=64*i,p=w.exports.useCallback(S=>{e(KL({x:Math.floor(S.target.x()),y:Math.floor(S.target.y())}))},[e]),g=w.exports.useCallback(S=>{if(!o)return t;const{x:E,y:P}=S,k=o.width-n.width,T=o.height-n.height,M=Math.floor(tn.clamp(E,0,k*i)),N=Math.floor(tn.clamp(P,0,T*i));return{x:M,y:N}},[t,n,o,i]),m=w.exports.useCallback(()=>{if(!l.current)return;const S=l.current,E=S.scaleX(),P=S.scaleY(),k=Math.round(S.width()*E),T=Math.round(S.height()*P),M=Math.round(S.x()),N=Math.round(S.y());e(Sg({width:k,height:T})),e(KL({x:M,y:N})),S.scaleX(1),S.scaleY(1)},[e]),y=w.exports.useCallback((S,E,P)=>{const k=S.x%d,T=S.y%d,M=WL(E.x,d)+k,N=WL(E.y,d)+T,F=Math.abs(E.x-M),z=Math.abs(E.y-N),B=F!o||E.width+E.x>o.width*i||E.height+E.y>o.height*i||E.x<0||E.y<0?S:E,[o,i]);return ae(jn,{children:[_(LC,{x:t.x,y:t.y,width:n.width,height:n.height,ref:l,stroke:"white",strokeWidth:r,listening:!a,onMouseEnter:S=>{const E=S?.target?.getStage()?.container();!E||(E.style.cursor=a?"none":"move")},onMouseLeave:S=>{const E=S?.target?.getStage()?.container();!E||(E.style.cursor=a?"none":"default")},draggable:!a,onDragMove:p,dragBoundFunc:g,onTransform:m}),_(Rwe,{ref:s,anchorCornerRadius:3,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderStroke:"black",rotateEnabled:!1,borderEnabled:!0,flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!a,enabledAnchors:a?[]:void 0,boundBoxFunc:x,anchorDragBoundFunc:y})]})},qwe=xn([e=>e.options,e=>e.inpainting],(e,t)=>{const{shouldShowMask:n,cursorPosition:r,shouldLockBoundingBox:i}=t;return{activeTabName:Ko[e.activeTab],shouldShowMask:n,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),Zwe=()=>{const e=bt(),{shouldShowMask:t,activeTabName:n,isCursorOnCanvas:r,shouldLockBoundingBox:i}=qe(qwe),o=w.exports.useRef(!1),a=w.exports.useRef(null);return w.exports.useEffect(()=>{const s=l=>{if(!(!["z"," "].includes(l.key)||n!=="inpainting"||!t)){if(!r){a.current||(a.current=l),o.current=!1;return}if(l.stopPropagation(),l.preventDefault(),!l.repeat){if(a.current||(o.current=!0,a.current=l),!o.current&&l.type==="keyup"){o.current=!0,a.current=l;return}switch(l.key){case"z":{e(qye());break}case" ":{if(!t)break;l.type==="keydown"&&e(wg(!1)),e(w$(!i));break}}a.current=l,o.current=!0}}};return document.addEventListener("keydown",s),document.addEventListener("keyup",s),()=>{document.removeEventListener("keydown",s),document.removeEventListener("keyup",s)}},[e,n,t,r,i]),null};let fl,bl,N3;const Ywe=()=>{const e=bt(),{tool:t,brushSize:n,shouldInvertMask:r,shouldShowMask:i,shouldShowCheckboardTransparency:o,maskColor:a,imageToInpaint:s,stageScale:l,shouldShowBoundingBoxFill:d,isDrawing:p,shouldLockBoundingBox:g,shouldShowBoundingBox:m}=qe(Fwe),y=Wu();fl=w.exports.useRef(null),bl=w.exports.useRef(null),N3=w.exports.useRef(null);const x=w.exports.useRef({x:0,y:0}),S=w.exports.useRef(!1),[E,P]=w.exports.useState(null);w.exports.useEffect(()=>{if(s){const z=new Image;z.onload=()=>{N3.current=z,P(z)},z.onerror=()=>{y({title:"Unable to Load Image",description:`Image ${s.url} failed to load`,status:"error",isClosable:!0}),e(X_())},z.src=s.url}else P(null)},[s,e,l,y]);const k=w.exports.useCallback(()=>{if(!fl.current)return;const z=_y(fl.current);!z||!bl.current||!g||(e(wg(!0)),e(UL({tool:t,strokeWidth:n/2,points:[z.x,z.y]})))},[e,n,t,g]),T=w.exports.useCallback(()=>{if(!fl.current)return;const z=_y(fl.current);!z||(e(jL(z)),!(!bl.current||!g)&&(x.current=z,p&&(S.current=!0,e(GL([z.x,z.y])))))},[e,p,g]),M=w.exports.useCallback(()=>{if(!S.current&&p&&fl.current){const z=_y(fl.current);if(!z||!bl.current||!g)return;e(GL([z.x,z.y]))}else S.current=!1;e(wg(!1))},[e,p,g]),N=w.exports.useCallback(()=>{e(jL(null)),e(wg(!1))},[e]),F=w.exports.useCallback(z=>{if(z.evt.buttons===1){if(!fl.current)return;const B=_y(fl.current);if(!B||!bl.current||!g)return;e(wg(!0)),e(UL({tool:t,strokeWidth:n/2,points:[B.x,B.y]}))}},[e,n,t,g]);return ae("div",{className:"inpainting-canvas-wrapper",tabIndex:1,children:[ae("div",{className:"inpainting-alerts",children:[!i&&_("div",{style:{pointerEvents:"none"},children:"Mask Hidden (H)"}),r&&_("div",{style:{pointerEvents:"none"},children:"Mask Inverted (Shift+M)"}),!g&&_("div",{style:{pointerEvents:"none"},children:"Transforming Bounding Box (M)"})]}),E&&ae(Owe,{width:Math.floor(E.width*l),height:Math.floor(E.height*l),scale:{x:l,y:l},onMouseDown:k,onMouseMove:T,onMouseEnter:F,onMouseUp:M,onMouseOut:N,onMouseLeave:N,style:{cursor:i?"none":"default"},className:"inpainting-canvas-stage checkerboard",ref:fl,children:[!r&&!o&&_(BS,{name:"image-layer",listening:!1,children:_(HS,{listening:!1,image:E})}),i&&ae(jn,{children:[ae(BS,{name:"mask-layer",listening:!1,opacity:o||r?1:a.a,ref:bl,children:[_($we,{}),g&&_(Hwe,{}),r&&_(HS,{image:E,listening:!1,globalCompositeOperation:"source-in"}),!r&&o&&_(HS,{image:E,listening:!1,globalCompositeOperation:"source-out"})]}),ae(BS,{children:[m&&d&&_(jwe,{}),m&&_(Kwe,{}),g&&_(Vwe,{})]})]})]}),_(Uwe,{}),_(Zwe,{})]})},Xwe=()=>{const e=bt(),{needsCache:t,imageToInpaint:n}=qe(i=>i.inpainting),r=w.exports.useRef(null);return w.exports.useLayoutEffect(()=>{if(!r.current||!n)return;const i=r.current.clientWidth,o=r.current.clientHeight,a=Math.min(1,Math.min(i/n.width,o/n.height));e(Kye(a))},[e,n,t]),_("div",{ref:r,className:"inpainting-canvas-area",children:_(V0,{thickness:"2px",speed:"1s",size:"xl"})})};function Qwe(e){return Tt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}function kb(){return(kb=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function IC(e){var t=w.exports.useRef(e),n=w.exports.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var R0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:E.buttons>0)&&i.current?o(ZA(i.current,E,s.current)):S(!1)},x=function(){return S(!1)};function S(E){var P=l.current,k=MC(i.current),T=E?k.addEventListener:k.removeEventListener;T(P?"touchmove":"mousemove",y),T(P?"touchend":"mouseup",x)}return[function(E){var P=E.nativeEvent,k=i.current;if(k&&(YA(P),!function(M,N){return N&&!im(M)}(P,l.current)&&k)){if(im(P)){l.current=!0;var T=P.changedTouches||[];T.length&&(s.current=T[0].identifier)}k.focus(),o(ZA(k,P,s.current)),S(!0)}},function(E){var P=E.which||E.keyCode;P<37||P>40||(E.preventDefault(),a({left:P===39?.05:P===37?-.05:0,top:P===40?.05:P===38?-.05:0}))},S]},[a,o]),p=d[0],g=d[1],m=d[2];return w.exports.useEffect(function(){return m},[m]),_("div",{...kb({},r,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:i,onKeyDown:g,tabIndex:0,role:"slider"})})}),Eb=function(e){return e.filter(Boolean).join(" ")},y7=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=Eb(["react-colorful__pointer",e.className]);return _("div",{className:o,style:{top:100*i+"%",left:100*n+"%"},children:_("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},mo=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},QB=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:mo(e.h),s:mo(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:mo(i/2),a:mo(r,2)}},RC=function(e){var t=QB(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},WS=function(e){var t=QB(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Jwe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),d=o%6;return{r:mo(255*[r,s,a,a,l,r][d]),g:mo(255*[l,r,r,s,a,a][d]),b:mo(255*[a,a,l,r,r,s][d]),a:mo(i,2)}},e6e=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:mo(60*(s<0?s+6:s)),s:mo(o?a/o*100:0),v:mo(o/255*100),a:i}},t6e=le.memo(function(e){var t=e.hue,n=e.onChange,r=Eb(["react-colorful__hue",e.className]);return le.createElement("div",{className:r},le.createElement(v7,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:R0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":mo(t),"aria-valuemax":"360","aria-valuemin":"0"},le.createElement(y7,{className:"react-colorful__hue-pointer",left:t/360,color:RC({h:t,s:100,v:100,a:1})})))}),n6e=le.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:RC({h:t.h,s:100,v:100,a:1})};return le.createElement("div",{className:"react-colorful__saturation",style:r},le.createElement(v7,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:R0(t.s+100*i.left,0,100),v:R0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+mo(t.s)+"%, Brightness "+mo(t.v)+"%"},le.createElement(y7,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:RC(t)})))}),JB=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function r6e(e,t,n){var r=IC(n),i=w.exports.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.exports.useRef({color:t,hsva:o});w.exports.useEffect(function(){if(!e.equal(t,s.current.color)){var d=e.toHsva(t);s.current={hsva:d,color:t},a(d)}},[t,e]),w.exports.useEffect(function(){var d;JB(o,s.current.hsva)||e.equal(d=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:d},r(d))},[o,e,r]);var l=w.exports.useCallback(function(d){a(function(p){return Object.assign({},p,d)})},[]);return[o,l]}var i6e=typeof window<"u"?w.exports.useLayoutEffect:w.exports.useEffect,o6e=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},XA=new Map,a6e=function(e){i6e(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!XA.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,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,XA.set(t,n);var r=o6e();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},s6e=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+WS(Object.assign({},n,{a:0}))+", "+WS(Object.assign({},n,{a:1}))+")"},o=Eb(["react-colorful__alpha",t]),a=mo(100*n.a);return le.createElement("div",{className:o},_("div",{className:"react-colorful__alpha-gradient",style:i}),le.createElement(v7,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:R0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},le.createElement(y7,{className:"react-colorful__alpha-pointer",left:n.a,color:WS(n)})))},l6e=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=XB(e,["className","colorModel","color","onChange"]),s=w.exports.useRef(null);a6e(s);var l=r6e(n,i,o),d=l[0],p=l[1],g=Eb(["react-colorful",t]);return le.createElement("div",kb({},a,{ref:s,className:g}),_(n6e,{hsva:d,onChange:p}),_(t6e,{hue:d.h,onChange:p}),le.createElement(s6e,{hsva:d,onChange:p,className:"react-colorful__last-control"}))},u6e={defaultColor:{r:0,g:0,b:0,a:1},toHsva:e6e,fromHsva:Jwe,equal:JB},c6e=function(e){return le.createElement(l6e,kb({},e,{colorModel:u6e}))};const d6e=e=>{const{styleClass:t,...n}=e;return _(c6e,{className:`invokeai__color-picker ${t}`,...n})},f6e=()=>{const{tool:e,brushSize:t,maskColor:n,shouldInvertMask:r,shouldShowMask:i,canUndo:o,canRedo:a,isMaskEmpty:s,activeTabName:l,showDualDisplay:d,shouldShowBoundingBox:p}=qe(zwe),g=bt(),m=Wu(),[y,x]=w.exports.useState(!1);Ut("[",ue=>{ue.preventDefault(),t-5>0?k(t-5):k(1)},{enabled:l==="inpainting"&&i},[l,i,t]),Ut("]",ue=>{ue.preventDefault(),k(t+5)},{enabled:l==="inpainting"&&i},[l,i,t]),Ut("shift+[",ue=>{ue.preventDefault(),z({...n,a:Math.max(n.a-.05,0)})},{enabled:l==="inpainting"&&i},[l,i,n.a]),Ut("shift+]",ue=>{ue.preventDefault(),z({...n,a:Math.min(n.a+.05,100)})},{enabled:l==="inpainting"&&i},[l,i,n.a]),Ut("e",ue=>{ue.preventDefault(),!(l!=="inpainting"||!i)&&E()},{enabled:l==="inpainting"&&i},[l,i]),Ut("b",ue=>{ue.preventDefault(),P()},{enabled:l==="inpainting"&&i},[l,i]),Ut("m",ue=>{ue.preventDefault(),g(e5e())},{enabled:l==="inpainting"&&i&&p},[l,i,p]),Ut("cmd+z, control+z",ue=>{ue.preventDefault(),B()},{enabled:l==="inpainting"&&i&&o},[l,i,o]),Ut("cmd+shift+z, control+shift+z, control+y, cmd+y",ue=>{ue.preventDefault(),K()},{enabled:l==="inpainting"&&i&&a},[l,i,a]),Ut("h",ue=>{ue.preventDefault(),T()},{enabled:l==="inpainting"},[l,i]),Ut("shift+m",ue=>{ue.preventDefault(),M()},{enabled:l==="inpainting"&&i},[l,r,i]),Ut("shift+c",ue=>{ue.preventDefault(),S(),m({title:"Mask Cleared",status:"success",duration:2500,isClosable:!0})},{enabled:l==="inpainting"&&i&&!s},[l,s,i]),Ut("shift+j",()=>{j()},[d]);const S=()=>{g(Uye())},E=()=>g(VL("eraser")),P=()=>g(VL("brush")),k=ue=>{g(_S(!0)),g(Bye(ue))},T=()=>g(Wye(!i)),M=()=>g(Hye(!r)),N=()=>{g(_S(!0))},F=()=>{g(_S(!1))},z=ue=>{g(Vye(ue))},B=()=>g(Gye()),K=()=>g(jye()),j=()=>{g(O6e(!d)),g(Df(!0))};return ae("div",{className:"inpainting-settings",children:[ae("div",{className:"inpainting-buttons-group",children:[_(l5,{trigger:"hover",onOpen:N,onClose:F,triggerComponent:_(Pn,{"aria-label":"Brush (B)",tooltip:"Brush (B)",icon:_(y$,{}),onClick:P,"data-selected":e==="brush",isDisabled:!i}),children:ae("div",{className:"inpainting-slider-numberinput",children:[_(R3,{label:"Brush Size",value:t,onChange:k,min:1,max:200,width:"100px",focusThumbOnChange:!1,isDisabled:!i}),_(yo,{value:t,onChange:k,width:"80px",min:1,max:999,isDisabled:!i})]})}),_(Pn,{"aria-label":"Eraser (E)",tooltip:"Eraser (E)",icon:_(Sye,{}),onClick:E,"data-selected":e==="eraser",isDisabled:!i})]}),ae("div",{className:"inpainting-buttons-group",children:[_(l5,{trigger:"click",onOpen:()=>x(!0),onClose:()=>x(!1),triggerComponent:_(Pn,{"aria-label":"Mask Options",tooltip:"Mask Options",icon:_(Cye,{}),cursor:"pointer",isDisabled:s,"data-selected":y}),children:ae("div",{className:"inpainting-button-dropdown",children:[_(Pn,{"aria-label":"Hide/Show Mask (H)",tooltip:"Hide/Show Mask (H)","data-selected":!i,icon:i?_(dbe,{size:22}):_(cbe,{size:22}),onClick:T}),_(Pn,{tooltip:"Invert Mask Display (Shift+M)","aria-label":"Invert Mask Display (Shift+M)","data-selected":r,icon:r?_(U2e,{size:22}):_(K2e,{size:22}),onClick:M,isDisabled:!i}),_(l5,{trigger:"hover",placement:"right",styleClass:"inpainting-color-picker",triggerComponent:_(Pn,{"aria-label":"Mask Color",tooltip:"Mask Color",icon:_(Eye,{}),isDisabled:!i,cursor:"pointer"}),children:_(d6e,{color:n,onChange:z})})]})}),_(Pn,{"aria-label":"Clear Mask (Shift+C)",tooltip:"Clear Mask (Shift+C)",icon:_(Pye,{size:18,style:{transform:"rotate(45deg)"}}),onClick:S,isDisabled:s||!i})]}),ae("div",{className:"inpainting-buttons-group",children:[_(Pn,{"aria-label":"Undo",tooltip:"Undo",icon:_(Rye,{}),onClick:B,isDisabled:!o||!i}),_(Pn,{"aria-label":"Redo",tooltip:"Redo",icon:_(Tye,{}),onClick:K,isDisabled:!a||!i})]}),_("div",{className:"inpainting-buttons-group",children:_(Pn,{"aria-label":"Clear Image",tooltip:"Clear Image",icon:_(Mye,{size:16}),onClick:()=>{g(X_())}})}),_(Pn,{"aria-label":"Split Layout (Shift+J)",tooltip:"Split Layout (Shift+J)",icon:_(Qwe,{}),"data-selected":d,onClick:j})]})},h6e=xn([e=>e.inpainting,e=>e.options],(e,t)=>{const{needsCache:n,imageToInpaint:r}=e,{showDualDisplay:i}=t;return{needsCache:n,showDualDisplay:i,imageToInpaint:r}},{memoizeOptions:{resultEqualityCheck:tn.isEqual}}),p6e=()=>{const e=bt(),{showDualDisplay:t,needsCache:n,imageToInpaint:r}=qe(h6e);return w.exports.useLayoutEffect(()=>{const o=tn.debounce(()=>e(Df(!0)),250);return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),ae("div",{className:t?"workarea-split-view":"workarea-single-view",children:[ae("div",{className:"workarea-split-view-left",children:[r?ae("div",{className:"inpainting-main-area",children:[_(f6e,{}),_("div",{className:"inpainting-canvas-area",children:n?_(Xwe,{}):_(Ywe,{})})]}):_(x$,{})," "]}),t&&_("div",{className:"workarea-split-view-right",children:_(J_,{})})]})};function g6e(){return _(s7,{optionsPanel:_(xbe,{}),styleClass:"inpainting-workarea-overrides",children:_(p6e,{})})}function m6e(){const e=qe(n=>n.options.showAdvancedOptions),t={seed:{header:_(B_,{}),feature:go.SEED,options:_(H_,{})},variations:{header:_(V_,{}),feature:go.VARIATIONS,options:_(U_,{})},face_restore:{header:_(z_,{}),feature:go.FACE_CORRECTION,options:_(hb,{})},upscale:{header:_(W_,{}),feature:go.UPSCALE,options:_(pb,{})},other:{header:_(o$,{}),feature:go.OTHER,options:_(a$,{})}};return ae("div",{className:"text-to-image-panel",children:[_(Y_,{}),_(Z_,{}),_(K_,{}),_(G_,{}),e?_(q_,{accordionInfo:t}):null]})}const v6e=()=>_("div",{className:"workarea-single-view",children:_("div",{className:"text-to-image-area",children:_(J_,{})})});function y6e(){return _(s7,{optionsPanel:_(m6e,{}),children:_(v6e,{})})}const Ep={txt2img:{title:_(t2e,{fill:"black",boxSize:"2.5rem"}),workarea:_(y6e,{}),tooltip:"Text To Image"},img2img:{title:_(Yve,{fill:"black",boxSize:"2.5rem"}),workarea:_(gbe,{}),tooltip:"Image To Image"},inpainting:{title:_(Xve,{fill:"black",boxSize:"2.5rem"}),workarea:_(g6e,{}),tooltip:"Inpainting"},outpainting:{title:_(Jve,{fill:"black",boxSize:"2.5rem"}),workarea:_(qve,{}),tooltip:"Outpainting"},nodes:{title:_(Qve,{fill:"black",boxSize:"2.5rem"}),workarea:_(Kve,{}),tooltip:"Nodes"},postprocess:{title:_(e2e,{fill:"black",boxSize:"2.5rem"}),workarea:_(Zve,{}),tooltip:"Post Processing"}},Ko=tn.map(Ep,(e,t)=>t);[...Ko];function b6e(){const e=qe(i=>i.options.activeTab),t=bt();Ut("1",()=>{t(Ua(0))}),Ut("2",()=>{t(Ua(1))}),Ut("3",()=>{t(Ua(2))}),Ut("4",()=>{t(Ua(3))}),Ut("5",()=>{t(Ua(4))}),Ut("6",()=>{t(Ua(5))});const n=()=>{const i=[];return Object.keys(Ep).forEach(o=>{i.push(_(mi,{hasArrow:!0,label:Ep[o].tooltip,placement:"right",children:_(aF,{children:Ep[o].title})},o))}),i},r=()=>{const i=[];return Object.keys(Ep).forEach(o=>{i.push(_(iF,{className:"app-tabs-panel",children:Ep[o].workarea},o))}),i};return ae(rF,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:i=>{t(Ua(i))},children:[_("div",{className:"app-tabs-list",children:n()}),_(oF,{className:"app-tabs-panels",children:r()})]})}const eH={prompt:"",iterations:1,steps:50,cfgScale:7.5,height:512,width:512,sampler:"k_lms",threshold:0,perlin:0,seed:0,seamless:!1,hiresFix:!1,img2imgStrength:.75,maskPath:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,variationAmount:.1,seedWeights:"",shouldRunESRGAN:!1,upscalingLevel:4,upscalingStrength:.75,shouldRunFacetool:!1,facetoolStrength:.8,facetoolType:"gfpgan",codeformerFidelity:.75,shouldRandomizeSeed:!0,showAdvancedOptions:!0,activeTab:0,shouldShowImageDetails:!1,showDualDisplay:!0},x6e=eH,tH=eb({name:"options",initialState:x6e,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=a5(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},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},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:d,seamless:p,hires_fix:g,width:m,height:y}=t.payload.image;o&&o.length>0?(e.seedWeights=_3(o),e.shouldGenerateVariations=!0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=a5(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),l&&(e.threshold=l),typeof l>"u"&&(e.threshold=0),d&&(e.perlin=d),typeof d>"u"&&(e.perlin=0),typeof p=="boolean"&&(e.seamless=p),typeof g=="boolean"&&(e.hiresFix=g),m&&(e.width=m),y&&(e.height=y)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:d,perlin:p,seamless:g,hires_fix:m,width:y,height:x,strength:S,fit:E,init_image_path:P,mask_image_path:k}=t.payload.image;n==="img2img"&&(P&&(e.initialImage=P),k&&(e.maskPath=k),S&&(e.img2imgStrength=S),typeof E=="boolean"&&(e.shouldFitToWidthHeight=E)),a&&a.length>0?(e.seedWeights=_3(a),e.shouldGenerateVariations=!0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i&&(e.prompt=a5(i)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),d&&(e.threshold=d),typeof d>"u"&&(e.threshold=0),p&&(e.perlin=p),typeof p>"u"&&(e.perlin=0),typeof g=="boolean"&&(e.seamless=g),typeof m=="boolean"&&(e.hiresFix=m),y&&(e.width=y),x&&(e.height=x)},resetOptionsState:e=>({...e,...eH}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setShowAdvancedOptions:(e,t)=>{e.showAdvancedOptions=t.payload},setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=Ko.indexOf(t.payload)},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShowDualDisplay:(e,t)=>{e.showDualDisplay=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0}}}),{setPrompt:b7,setIterations:S6e,setSteps:nH,setCfgScale:rH,setThreshold:w6e,setPerlin:C6e,setHeight:iH,setWidth:oH,setSampler:aH,setSeed:Tv,setSeamless:sH,setHiresFix:lH,setImg2imgStrength:uH,setFacetoolStrength:f5,setFacetoolType:h5,setCodeformerFidelity:cH,setUpscalingLevel:OC,setUpscalingStrength:NC,setMaskPath:DC,resetSeed:x8e,resetOptionsState:S8e,setShouldFitToWidthHeight:dH,setParameter:w8e,setShouldGenerateVariations:_6e,setSeedWeights:fH,setVariationAmount:k6e,setAllParameters:E6e,setShouldRunFacetool:P6e,setShouldRunESRGAN:T6e,setShouldRandomizeSeed:L6e,setShowAdvancedOptions:A6e,setActiveTab:Ua,setShouldShowImageDetails:I6e,setAllTextToImageParameters:M6e,setAllImageToImageParameters:R6e,setShowDualDisplay:O6e,setInitialImage:Pb,clearInitialImage:zC}=tH.actions,N6e=tH.reducer,Fl=Object.create(null);Fl.open="0";Fl.close="1";Fl.ping="2";Fl.pong="3";Fl.message="4";Fl.upgrade="5";Fl.noop="6";const p5=Object.create(null);Object.keys(Fl).forEach(e=>{p5[Fl[e]]=e});const D6e={type:"error",data:"parser error"},z6e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",F6e=typeof ArrayBuffer=="function",$6e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,hH=({type:e,data:t},n,r)=>z6e&&t instanceof Blob?n?r(t):QA(t,r):F6e&&(t instanceof ArrayBuffer||$6e(t))?n?r(t):QA(new Blob([t]),r):r(Fl[e]+(t||"")),QA=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},JA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;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 d=new ArrayBuffer(t),p=new Uint8Array(d);for(r=0;r>4,p[i++]=(a&15)<<4|s>>2,p[i++]=(s&3)<<6|l&63;return d},H6e=typeof ArrayBuffer=="function",pH=(e,t)=>{if(typeof e!="string")return{type:"message",data:gH(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:W6e(e.substring(1),t)}:p5[n]?e.length>1?{type:p5[n],data:e.substring(1)}:{type:p5[n]}:D6e},W6e=(e,t)=>{if(H6e){const n=B6e(e);return gH(n,t)}else return{base64:!0,data:e}},gH=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},mH=String.fromCharCode(30),V6e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{hH(o,!1,s=>{r[a]=s,++i===n&&t(r.join(mH))})})},U6e=(e,t)=>{const n=e.split(mH),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function yH(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const j6e=setTimeout,K6e=clearTimeout;function Tb(e,t){t.useNativeTimers?(e.setTimeoutFn=j6e.bind(Xc),e.clearTimeoutFn=K6e.bind(Xc)):(e.setTimeoutFn=setTimeout.bind(Xc),e.clearTimeoutFn=clearTimeout.bind(Xc))}const q6e=1.33;function Z6e(e){return typeof e=="string"?Y6e(e):Math.ceil((e.byteLength||e.size)*q6e)}function Y6e(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class X6e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class bH extends Yr{constructor(t){super(),this.writable=!1,Tb(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new X6e(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(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=pH(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const xH="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),FC=64,Q6e={};let eI=0,ky=0,tI;function nI(e){let t="";do t=xH[e%FC]+t,e=Math.floor(e/FC);while(e>0);return t}function SH(){const e=nI(+new Date);return e!==tI?(eI=0,tI=e):e+"."+nI(eI++)}for(;ky{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)};U6e(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,V6e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=SH()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=wH(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Rl(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}}class Rl extends Yr{constructor(t,n){super(),Tb(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=yH(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new _H(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=Rl.requestsCount++,Rl.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=tCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Rl.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()}}Rl.requestsCount=0;Rl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",rI);else if(typeof addEventListener=="function"){const e="onpagehide"in Xc?"pagehide":"unload";addEventListener(e,rI,!1)}}function rI(){for(let e in Rl.requests)Rl.requests.hasOwnProperty(e)&&Rl.requests[e].abort()}const iCe=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Ey=Xc.WebSocket||Xc.MozWebSocket,iI=!0,oCe="arraybuffer",oI=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class aCe extends bH{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=oI?{}:yH(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=iI&&!oI?n?new Ey(t,n):new Ey(t):new Ey(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||oCe,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{const a={};try{iI&&this.ws.send(o)}catch{}i&&iCe(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=SH()),this.supportsBinary||(t.b64=1);const i=wH(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Ey}}const sCe={websocket:aCe,polling:rCe},lCe=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,uCe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function $C(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=lCe.exec(e||""),o={},a=14;for(;a--;)o[uCe[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=cCe(o,o.path),o.queryKey=dCe(o,o.query),o}function cCe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.substr(0,1)=="/"||t.length===0)&&r.splice(0,1),t.substr(t.length-1,1)=="/"&&r.splice(r.length-1,1),r}function dCe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class Gc extends Yr{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=$C(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=$C(n.host).host),Tb(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"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=J6e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!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=vH,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new sCe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Gc.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;Gc.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!r)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Gc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,p(),n.close(),n=null)}const a=g=>{const m=new Error("probe error: "+g);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function d(g){n&&g.name!==n.name&&o()}const p=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",d)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",d),n.open()}onOpen(){if(this.readyState="open",Gc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{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;r0&&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){Gc.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("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(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,kH=Object.prototype.toString,gCe=typeof Blob=="function"||typeof Blob<"u"&&kH.call(Blob)==="[object BlobConstructor]",mCe=typeof File=="function"||typeof File<"u"&&kH.call(File)==="[object FileConstructor]";function x7(e){return hCe&&(e instanceof ArrayBuffer||pCe(e))||gCe&&e instanceof Blob||mCe&&e instanceof File}function g5(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case an.ACK:case an.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class SCe{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=yCe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const wCe=Object.freeze(Object.defineProperty({__proto__:null,protocol:bCe,get PacketType(){return an},Encoder:xCe,Decoder:S7},Symbol.toStringTag,{value:"Module"}));function Ls(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const CCe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class EH extends Yr{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ls(t,"open",this.onopen.bind(this)),Ls(t,"packet",this.onpacket.bind(this)),Ls(t,"error",this.onerror.bind(this)),Ls(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(CCe.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:an.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){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:an.CONNECT,data:t})}):this.packet({type:an.CONNECT,data:this.auth})}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 an.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else 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 an.EVENT:case an.BINARY_EVENT:this.onevent(t);break;case an.ACK:case an.BINARY_ACK:this.onack(t);break;case an.DISCONNECT:this.ondisconnect();break;case an.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)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:an.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){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}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:an.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;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}J0.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)==0?e-n:e+n}return Math.min(e,this.max)|0};J0.prototype.reset=function(){this.attempts=0};J0.prototype.setMin=function(e){this.ms=e};J0.prototype.setMax=function(e){this.max=e};J0.prototype.setJitter=function(e){this.jitter=e};class WC extends Yr{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,Tb(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 J0({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||wCe;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 Gc(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ls(n,"open",function(){r.onopen(),t&&t()}),o=Ls(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ls(t,"ping",this.onping.bind(this)),Ls(t,"data",this.ondata.bind(this)),Ls(t,"error",this.onerror.bind(this)),Ls(t,"close",this.onclose.bind(this)),Ls(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch{this.onclose("parse error")}}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new EH(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;rt()),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(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const cg={};function m5(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=fCe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=cg[i]&&o in cg[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new WC(r,t):(cg[i]||(cg[i]=new WC(r,t)),l=cg[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(m5,{Manager:WC,Socket:EH,io:m5,connect:m5});let Py;const _Ce=new Uint8Array(16);function kCe(){if(!Py&&(Py=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Py))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Py(_Ce)}const Ai=[];for(let e=0;e<256;++e)Ai.push((e+256).toString(16).slice(1));function ECe(e,t=0){return(Ai[e[t+0]]+Ai[e[t+1]]+Ai[e[t+2]]+Ai[e[t+3]]+"-"+Ai[e[t+4]]+Ai[e[t+5]]+"-"+Ai[e[t+6]]+Ai[e[t+7]]+"-"+Ai[e[t+8]]+Ai[e[t+9]]+"-"+Ai[e[t+10]]+Ai[e[t+11]]+Ai[e[t+12]]+Ai[e[t+13]]+Ai[e[t+14]]+Ai[e[t+15]]).toLowerCase()}const PCe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),aI={randomUUID:PCe};function dg(e,t,n){if(aI.randomUUID&&!t&&!e)return aI.randomUUID();e=e||{};const r=e.random||(e.rng||kCe)();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 ECe(r)}var TCe=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,LCe=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,ACe=/[^-+\dA-Z]/g;function Ri(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(sI[t]||t||sI.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},d=function(){return e[o()+"FullYear"]()},p=function(){return e[o()+"Hours"]()},g=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},y=function(){return e[o()+"Milliseconds"]()},x=function(){return n?0:e.getTimezoneOffset()},S=function(){return ICe(e)},E=function(){return MCe(e)},P={d:function(){return a()},dd:function(){return ca(a())},ddd:function(){return Oo.dayNames[s()]},DDD:function(){return lI({y:d(),m:l(),d:a(),_:o(),dayName:Oo.dayNames[s()],short:!0})},dddd:function(){return Oo.dayNames[s()+7]},DDDD:function(){return lI({y:d(),m:l(),d:a(),_:o(),dayName:Oo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return ca(l()+1)},mmm:function(){return Oo.monthNames[l()]},mmmm:function(){return Oo.monthNames[l()+12]},yy:function(){return String(d()).slice(2)},yyyy:function(){return ca(d(),4)},h:function(){return p()%12||12},hh:function(){return ca(p()%12||12)},H:function(){return p()},HH:function(){return ca(p())},M:function(){return g()},MM:function(){return ca(g())},s:function(){return m()},ss:function(){return ca(m())},l:function(){return ca(y(),3)},L:function(){return ca(Math.floor(y()/10))},t:function(){return p()<12?Oo.timeNames[0]:Oo.timeNames[1]},tt:function(){return p()<12?Oo.timeNames[2]:Oo.timeNames[3]},T:function(){return p()<12?Oo.timeNames[4]:Oo.timeNames[5]},TT:function(){return p()<12?Oo.timeNames[6]:Oo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":RCe(e)},o:function(){return(x()>0?"-":"+")+ca(Math.floor(Math.abs(x())/60)*100+Math.abs(x())%60,4)},p:function(){return(x()>0?"-":"+")+ca(Math.floor(Math.abs(x())/60),2)+":"+ca(Math.floor(Math.abs(x())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return S()},WW:function(){return ca(S())},N:function(){return E()}};return t.replace(TCe,function(k){return k in P?P[k]():k.slice(1,k.length-1)})}var sI={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Oo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},ca=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},lI=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,d=new Date,p=new Date;p.setDate(p[o+"Date"]()-1);var g=new Date;g.setDate(g[o+"Date"]()+1);var m=function(){return d[o+"Date"]()},y=function(){return d[o+"Month"]()},x=function(){return d[o+"FullYear"]()},S=function(){return p[o+"Date"]()},E=function(){return p[o+"Month"]()},P=function(){return p[o+"FullYear"]()},k=function(){return g[o+"Date"]()},T=function(){return g[o+"Month"]()},M=function(){return g[o+"FullYear"]()};return x()===n&&y()===r&&m()===i?l?"Tdy":"Today":P()===n&&E()===r&&S()===i?l?"Ysd":"Yesterday":M()===n&&T()===r&&k()===i?l?"Tmw":"Tomorrow":a},ICe=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},MCe=function(t){var n=t.getDay();return n===0&&(n=7),n},RCe=function(t){return(String(t).match(LCe)||[""]).pop().replace(ACe,"").replace(/GMT\+0000/g,"UTC")};const OCe=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(DL(!0)),t(s5("Connected"));const r=n().gallery;r.categories.user.latest_mtime?t($L("user")):t(oC("user")),r.categories.result.latest_mtime?t($L("result")):t(oC("result"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(DL(!1)),t(s5("Disconnected")),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{t(ry({category:"result",image:{uuid:dg(),...r}})),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(l5e({uuid:dg(),...r})),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(ry({category:"result",image:{uuid:dg(),...r}})),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(qf(!0)),t(O2e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(nC()),t(qL())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:dg(),...l}));t(s5e({images:s,areMoreImagesAvailable:o,category:a})),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(z2e());const{intermediateImage:r}=n().gallery;r&&(t(ry({category:"result",image:r})),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`})),t(qL())),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i,uuid:o,category:a}=r;t(a5e(r));const{initialImage:s,maskPath:l}=n().options,{imageToInpaint:d}=n().inpainting;(s?.url===i||s===i)&&t(zC()),d?.url===i&&t(X_()),l===i&&t(DC("")),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onImageUploaded:r=>{const{destination:i,...o}=r,a={uuid:dg(),...o};try{switch(t(ry({image:a,category:"user"})),i){case"img2img":{t(Pb(a));break}case"inpainting":{t(Q_(a));break}default:{t(k$(a));break}}t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Image uploaded: ${r.url}`}))}catch(s){console.error(s)}},onMaskImageUploaded:r=>{const{url:i}=r;t(DC(i)),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Mask image uploaded: ${i}`}))},onSystemConfig:r=>{t(N2e(r))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(zL(o)),t(s5("Model Changed")),t(qf(!1)),t(rC(!1)),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(zL(o)),t(qf(!1)),t(rC(!1)),t(nC()),t(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))}}},NCe=(e,t,n)=>{const{width:r,height:i}=e,o=document.createElement("div"),a=new Cy.Stage({container:o,width:r,height:i}),s=new Cy.Layer;return a.add(s),t.forEach(l=>s.add(new Cy.Line({points:l.points,stroke:"rgb(255,255,255)",strokeWidth:l.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:l.tool==="brush"?"source-over":"destination-out"}))),s.add(new Cy.Image({image:e,globalCompositeOperation:"source-out"})),o.remove(),a.toDataURL()},DCe=e=>{const{generationMode:t,optionsState:n,inpaintingState:r,systemState:i,imageToProcessUrl:o,maskImageElement:a}=e,{prompt:s,iterations:l,steps:d,cfgScale:p,threshold:g,perlin:m,height:y,width:x,sampler:S,seed:E,seamless:P,hiresFix:k,img2imgStrength:T,initialImage:M,shouldFitToWidthHeight:N,shouldGenerateVariations:F,variationAmount:z,seedWeights:B,shouldRunESRGAN:K,upscalingLevel:j,upscalingStrength:X,shouldRunFacetool:ue,facetoolStrength:ge,codeformerFidelity:xe,facetoolType:we,shouldRandomizeSeed:Se}=n,{shouldDisplayInProgress:J}=i,G={prompt:s,iterations:l,steps:d,cfg_scale:p,threshold:g,perlin:m,height:y,width:x,sampler_name:S,seed:E,progress_images:J};if(G.seed=Se?s$(F_,$_):E,["txt2img","img2img"].includes(t)&&(G.seamless=P,G.hires_fix=k),t==="img2img"&&M&&(G.init_img=typeof M=="string"?M:M.url,G.strength=T,G.fit=N),t==="inpainting"&&a){const{lines:W,boundingBoxCoordinate:{x:ie,y:de},boundingBoxDimensions:{width:be,height:De},shouldShowBoundingBox:Re,inpaintReplace:Ve,shouldUseInpaintReplace:ke}=r;let $e=ie,nt=de,ft=be,Rt=De;Re||($e=0,nt=0,ft=a.width,Rt=a.height);const Ot={x:$e,y:nt,width:ft,height:Rt};ke&&(G.inpaint_replace=Ve),G.init_img=o,G.strength=T,G.fit=!1;const Me=NCe(a,W);G.init_mask=Me.split("data:image/png;base64,")[1],G.bounding_box=Ot}F?(G.variation_amount=z,B&&(G.with_variations=Nve(B))):G.variation_amount=0;let te=!1,Q=!1;return K&&(te={level:j,strength:X}),ue&&(Q={type:we,strength:ge},we==="codeformer"&&(Q.codeformer_fidelity=xe)),{generationParameters:G,esrganParameters:te,facetoolParameters:Q}},zCe=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(qf(!0));const o=r(),{options:a,system:s,inpainting:l,gallery:d}=o,p={generationMode:i,optionsState:a,inpaintingState:l,systemState:s};if(i==="inpainting"){if(!N3.current||!l.imageToInpaint?.url){n(Mi({timestamp:Ri(new Date,"isoDateTime"),message:"Inpainting image not loaded, cannot generate image.",level:"error"})),n(nC());return}p.imageToProcessUrl=l.imageToInpaint.url,p.maskImageElement=N3.current}else if(!["txt2img","img2img"].includes(i)){if(!d.currentImage?.url)return;p.imageToProcessUrl=d.currentImage.url}const{generationParameters:g,esrganParameters:m,facetoolParameters:y}=DCe(p);t.emit("generateImage",g,m,y),g.init_mask&&(g.init_mask=g.init_mask.substr(0,20).concat("...")),n(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...g,...m,...y})}`}))},emitRunESRGAN:i=>{n(qf(!0));const o=r().options,{upscalingLevel:a,upscalingStrength:s}=o,l={upscale:[a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(qf(!0));const o=r().options,{facetoolType:a,facetoolStrength:s,codeformerFidelity:l}=o,d={facetool_strength:s};a==="codeformer"&&(d.codeformer_fidelity=l),t.emit("runPostprocessing",i,{type:a,...d}),n(Mi({timestamp:Ri(new Date,"isoDateTime"),message:`Face restoration (${a}) requested: ${JSON.stringify({file:i.url,...d})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s}=i;t.emit("deleteImage",o,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitUploadImage:i=>{const{file:o,destination:a}=i;t.emit("uploadImage",o,o.name,a)},emitUploadMaskImage:i=>{t.emit("uploadMaskImage",i,i.name)},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitRequestModelChange:i=>{n(s5("Changing Model")),n(qf(!0)),n(rC(!1)),t.emit("requestModelChange",i)}}},FCe=()=>{const{origin:e}=new URL(window.location.href),t=m5(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:d,onPostprocessingResult:p,onGenerationResult:g,onIntermediateResult:m,onProgressUpdate:y,onGalleryImages:x,onProcessingCanceled:S,onImageDeleted:E,onImageUploaded:P,onMaskImageUploaded:k,onSystemConfig:T,onModelChanged:M,onModelChangeFailed:N}=OCe(i),{emitGenerateImage:F,emitRunESRGAN:z,emitRunFacetool:B,emitDeleteImage:K,emitRequestImages:j,emitRequestNewImages:X,emitCancelProcessing:ue,emitUploadImage:ge,emitUploadMaskImage:xe,emitRequestSystemConfig:we,emitRequestModelChange:Se}=zCe(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",J=>d(J)),t.on("generationResult",J=>g(J)),t.on("postprocessingResult",J=>p(J)),t.on("intermediateResult",J=>m(J)),t.on("progressUpdate",J=>y(J)),t.on("galleryImages",J=>x(J)),t.on("processingCanceled",()=>{S()}),t.on("imageDeleted",J=>{E(J)}),t.on("imageUploaded",J=>{P(J)}),t.on("maskImageUploaded",J=>{k(J)}),t.on("systemConfig",J=>{T(J)}),t.on("modelChanged",J=>{M(J)}),t.on("modelChangeFailed",J=>{N(J)}),n=!0),a.type){case"socketio/generateImage":{F(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{B(a.payload);break}case"socketio/deleteImage":{K(a.payload);break}case"socketio/requestImages":{j(a.payload);break}case"socketio/requestNewImages":{X(a.payload);break}case"socketio/cancelProcessing":{ue();break}case"socketio/uploadImage":{ge(a.payload);break}case"socketio/uploadMaskImage":{xe(a.payload);break}case"socketio/requestSystemConfig":{we();break}case"socketio/requestModelChange":{Se(a.payload);break}}o(a)}},$Ce={key:"root",storage:Cv,blacklist:["gallery","system","inpainting"]},BCe={key:"system",storage:Cv,blacklist:["isCancelable","isConnected","isProcessing","currentStep","socketId","isESRGANAvailable","isGFPGANAvailable","currentStep","totalSteps","currentIteration","totalIterations","currentStatus"]},HCe={key:"gallery",storage:Cv,whitelist:["galleryWidth","shouldPinGallery","shouldShowGallery","galleryScrollPosition","galleryImageMinimumWidth","galleryImageObjectFit"]},WCe={key:"inpainting",storage:Cv,blacklist:["pastLines","futuresLines","cursorPosition"]},VCe=RF({options:N6e,gallery:i5(HCe,h5e),system:i5(BCe,F2e),inpainting:i5(WCe,t5e)}),UCe=i5($Ce,VCe),PH=bme({reducer:UCe,middleware:e=>e({serializableCheck:!1}).concat(FCe())}),bt=ive,qe=Kme;function v5(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?v5=function(n){return typeof n}:v5=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},v5(e)}function GCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(e,t){for(var n=0;n({textColor:e.colorMode==="dark"?"gray.800":"gray.100"})},Accordion:{baseStyle:e=>({button:{fontWeight:"bold",_hover:{bgColor:e.colorMode==="dark"?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"}},panel:{paddingBottom:2}})},FormLabel:{baseStyle:{fontWeight:"light"}},Button:{variants:{imageHoverIconButton:e=>({bg:e.colorMode==="dark"?"blackAlpha.700":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.700":"blackAlpha.700",_hover:{bg:e.colorMode==="dark"?"blackAlpha.800":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.900":"blackAlpha.900"}})}}}}),LH=()=>_(zn,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:_(V0,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),ZCe=xn(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),YCe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=qe(ZCe),i=t?Math.round(t*100/n):0;return _($z,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})},XCe=""+new URL("logo.13003d72.png",import.meta.url).href;function QCe(e){const{title:t,hotkey:n,description:r}=e;return ae("div",{className:"hotkey-modal-item",children:[ae("div",{className:"hotkey-info",children:[_("p",{className:"hotkey-title",children:t}),r&&_("p",{className:"hotkey-description",children:r})]}),_("div",{className:"hotkey-key",children:n})]})}function JCe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=u3(),i=[{title:"Invoke",desc:"Generate an image",hotkey:"Ctrl+Enter"},{title:"Cancel",desc:"Cancel image generation",hotkey:"Shift+X"},{title:"Focus Prompt",desc:"Focus the prompt input area",hotkey:"Alt+A"},{title:"Toggle Gallery",desc:"Open and close the gallery drawer",hotkey:"G"},{title:"Change Tabs",desc:"Switch to another workspace",hotkey:"1-6"},{title:"Theme Toggle",desc:"Switch between dark and light modes",hotkey:"Shift+D"},{title:"Console Toggle",desc:"Open and close console",hotkey:"`"}],o=[{title:"Set Parameters",desc:"Use all parameters of the current image",hotkey:"A"},{title:"Set Seed",desc:"Use the seed of the current image",hotkey:"S"},{title:"Restore Faces",desc:"Restore the current image",hotkey:"R"},{title:"Upscale",desc:"Upscale the current image",hotkey:"U"},{title:"Show Info",desc:"Show metadata info of the current image",hotkey:"I"},{title:"Send To Image To Image",desc:"Send current image to Image to Image",hotkey:"Shift+I"},{title:"Delete Image",desc:"Delete the current image",hotkey:"Del"}],a=[{title:"Previous Image",desc:"Display the previous image in gallery",hotkey:"Arrow left"},{title:"Next Image",desc:"Display the next image in gallery",hotkey:"Arrow right"},{title:"Toggle Gallery Pin",desc:"Pins and unpins the gallery to the UI",hotkey:"Shift+P"},{title:"Increase Gallery Image Size",desc:"Increases gallery thumbnails size",hotkey:"Shift+Up"},{title:"Decrease Gallery Image Size",desc:"Decreases gallery thumbnails size",hotkey:"Shift+Down"},{title:"Reset Gallery Image Size",desc:"Resets image gallery size",hotkey:"Shift+R"}],s=[{title:"Select Brush",desc:"Selects the inpainting brush",hotkey:"B"},{title:"Select Eraser",desc:"Selects the inpainting eraser",hotkey:"E"},{title:"Quick Toggle Brush/Eraser",desc:"Quick toggle between brush and eraser",hotkey:"Z"},{title:"Decrease Brush Size",desc:"Decreases the size of the inpainting brush/eraser",hotkey:"["},{title:"Increase Brush Size",desc:"Increases the size of the inpainting brush/eraser",hotkey:"]"},{title:"Hide Mask",desc:"Hide and unhide mask",hotkey:"H"},{title:"Decrease Mask Opacity",desc:"Decreases the opacity of the mask",hotkey:"Shift+["},{title:"Increase Mask Opacity",desc:"Increases the opacity of the mask",hotkey:"Shift+]"},{title:"Invert Mask",desc:"Invert the mask preview",hotkey:"Shift+M"},{title:"Clear Mask",desc:"Clear the entire mask",hotkey:"Shift+C"},{title:"Undo Stroke",desc:"Undo a brush stroke",hotkey:"Ctrl+Z"},{title:"Redo Stroke",desc:"Redo a brush stroke",hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:"Lock Bounding Box",desc:"Locks the bounding box",hotkey:"M"},{title:"Quick Toggle Lock Bounding Box",desc:"Hold to toggle locking the bounding box",hotkey:"Space"},{title:"Expand Inpainting Area",desc:"Expand your inpainting work area",hotkey:"Shift+J"}],l=d=>{const p=[];return d.forEach((g,m)=>{p.push(_(QCe,{title:g.title,description:g.desc,hotkey:g.hotkey},m))}),_("div",{className:"hotkey-modal-category",children:p})};return ae(jn,{children:[w.exports.cloneElement(e,{onClick:n}),ae(T0,{isOpen:t,onClose:r,children:[_(Hm,{}),ae(Bm,{className:"hotkeys-modal",children:[_(l_,{}),_("h1",{children:"Keyboard Shorcuts"}),_("div",{className:"hotkeys-modal-items",children:ae(O4,{allowMultiple:!0,children:[ae(Gf,{children:[ae(Vf,{className:"hotkeys-modal-button",children:[_("h2",{children:"App Hotkeys"}),_(Uf,{})]}),_(jf,{children:l(i)})]}),ae(Gf,{children:[ae(Vf,{className:"hotkeys-modal-button",children:[_("h2",{children:"General Hotkeys"}),_(Uf,{})]}),_(jf,{children:l(o)})]}),ae(Gf,{children:[ae(Vf,{className:"hotkeys-modal-button",children:[_("h2",{children:"Gallery Hotkeys"}),_(Uf,{})]}),_(jf,{children:l(a)})]}),ae(Gf,{children:[ae(Vf,{className:"hotkeys-modal-button",children:[_("h2",{children:"Inpainting Hotkeys"}),_(Uf,{})]}),_(jf,{children:l(s)})]})]})})]})]})]})}const e9e=e=>{const{isProcessing:t,isConnected:n}=qe(l=>l.system),r=bt(),{name:i,status:o,description:a}=e,s=()=>{r(sye(i))};return ae("div",{className:"model-list-item",children:[_(mi,{label:a,hasArrow:!0,placement:"bottom",children:_("div",{className:"model-list-item-name",children:i})}),_(wD,{}),_("div",{className:`model-list-item-status ${o.split(" ").join("-")}`,children:o}),_("div",{className:"model-list-item-load-btn",children:_(Xa,{size:"sm",onClick:s,isDisabled:o==="active"||t||!n,children:"Load"})})]})},t9e=xn(e=>e.system,e=>{const t=tn.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),n9e=()=>{const{models:e}=qe(t9e);return _("div",{className:"model-list",children:_(O4,{allowToggle:!0,children:ae(Gf,{children:[_(Vf,{children:ae("div",{className:"model-list-button",children:[_("h2",{children:"Models"}),_(Uf,{})]})}),_(jf,{children:_("div",{className:"model-list-list",children:e.map((t,n)=>_(e9e,{name:t.name,status:t.status,description:t.description},n))})})]})})})};function VS({settingTitle:e,isChecked:t,dispatcher:n}){const r=bt();return _(Wl,{styleClass:"settings-modal-item",label:e,isChecked:t,onChange:i=>r(n(i.target.checked))})}const r9e=xn(e=>e.system,e=>{const{shouldDisplayInProgress:t,shouldConfirmOnDelete:n,shouldDisplayGuides:r,model_list:i}=e;return{shouldDisplayInProgress:t,shouldConfirmOnDelete:n,shouldDisplayGuides:r,models:tn.map(i,(o,a)=>a)}},{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),i9e=({children:e})=>{const{isOpen:t,onOpen:n,onClose:r}=u3(),{isOpen:i,onOpen:o,onClose:a}=u3(),{shouldDisplayInProgress:s,shouldConfirmOnDelete:l,shouldDisplayGuides:d}=qe(r9e),p=()=>{HH.purge().then(()=>{r(),o()})};return ae(jn,{children:[w.exports.cloneElement(e,{onClick:n}),ae(T0,{isOpen:t,onClose:r,children:[_(Hm,{}),ae(Bm,{className:"settings-modal",children:[_(c_,{className:"settings-modal-header",children:"Settings"}),_(l_,{}),ae(h3,{className:"settings-modal-content",children:[_(n9e,{}),ae("div",{className:"settings-modal-items",children:[_(VS,{settingTitle:"Display In-Progress Images (slower)",isChecked:s,dispatcher:M2e}),_(VS,{settingTitle:"Confirm on Delete",isChecked:l,dispatcher:u$}),_(VS,{settingTitle:"Display Help Icons",isChecked:d,dispatcher:D2e})]}),ae("div",{className:"settings-modal-reset",children:[_(Qf,{size:"md",children:"Reset Web UI"}),_(Fo,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."}),_(Fo,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."}),_(Xa,{colorScheme:"red",onClick:p,children:"Reset Web UI"})]})]}),_(u_,{children:_(Xa,{onClick:r,children:"Close"})})]})]}),ae(T0,{closeOnOverlayClick:!1,isOpen:i,onClose:a,isCentered:!0,children:[_(Hm,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),_(Bm,{children:_(h3,{pb:6,pt:6,children:_(zn,{justifyContent:"center",children:_(Fo,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."})})})})]})]})},o9e=xn(e=>e.system,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),a9e=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=qe(o9e),s=bt();let l;e&&!o?l="status-good":l="status-bad";let d=i;return["generating","preparing","saving image","restoring faces","upscaling"].includes(d.toLowerCase())&&(l="status-working"),d&&t&&r>1&&(d+=` (${n}/${r})`),_(mi,{label:o&&!a?"Click to clear, check logs for details":void 0,children:_(Fo,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(c$())},className:`status ${l}`,children:d})})},s9e=()=>{const{colorMode:e,toggleColorMode:t}=j9();Ut("shift+d",()=>{t()},[e,t]);const n=e=="light"?_(kye,{}):_(Aye,{}),r=e=="light"?18:20;return ae("div",{className:"site-header",children:[ae("div",{className:"site-header-left-side",children:[_("img",{src:XCe,alt:"invoke-ai-logo"}),ae("h1",{children:["invoke ",_("strong",{children:"ai"})]})]}),ae("div",{className:"site-header-right-side",children:[_(a9e,{}),_(JCe,{children:_(Xi,{"aria-label":"Hotkeys",variant:"link",fontSize:24,size:"sm",icon:_(q2e,{})})}),_(mi,{hasArrow:!0,label:"Theme",placement:"bottom",children:_(Xi,{"aria-label":"Toggle Dark Mode",onClick:t,variant:"link",size:"sm",fontSize:r,icon:n})}),_(mi,{hasArrow:!0,label:"Report Bug",placement:"bottom",children:_(Xi,{"aria-label":"Link to Github Issues",variant:"link",fontSize:23,size:"sm",icon:_(r0,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:_(h$,{})})})}),_(mi,{hasArrow:!0,label:"Github",placement:"bottom",children:_(Xi,{"aria-label":"Link to Github Repo",variant:"link",fontSize:20,size:"sm",icon:_(r0,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:_(gye,{})})})}),_(mi,{hasArrow:!0,label:"Discord",placement:"bottom",children:_(Xi,{"aria-label":"Link to Discord Server",variant:"link",fontSize:20,size:"sm",icon:_(r0,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:_(pye,{})})})}),_(i9e,{children:_(Xi,{"aria-label":"Settings",variant:"link",fontSize:24,size:"sm",icon:_(G2e,{})})})]})]})},l9e=xn(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),u9e=xn(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:wa.exports.isEqual}}),c9e=()=>{const e=bt(),t=qe(l9e),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=qe(u9e),[o,a]=w.exports.useState(!0),s=w.exports.useRef(null);w.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(c$()),e(NL(!n))};return Ut("`",()=>{e(NL(!n))},[n]),ae(jn,{children:[n&&_(I$,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0},maxHeight:"90vh",children:_("div",{className:"console",ref:s,children:t.map((d,p)=>{const{timestamp:g,message:m,level:y}=d;return ae("div",{className:`console-entry console-${y}-color`,children:[ae("p",{className:"console-timestamp",children:[g,":"]}),_("p",{className:"console-message",children:m})]},p)})})}),n&&_(mi,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:_(Xi,{className:`console-autoscroll-icon-button ${o&&"autoscroll-enabled"}`,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:_(mye,{}),onClick:()=>a(!o)})}),_(mi,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:_(Xi,{className:`console-toggle-icon-button ${(r||!i)&&"error-seen"}`,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?_(_ye,{}):_(xye,{}),onClick:l})})]})};function d9e(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV||{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}var f9e=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 Lv(e,t){var n=h9e(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 h9e(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=f9e.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var p9e=[".DS_Store","Thumbs.db"];function g9e(e){return H0(this,void 0,void 0,function(){return W0(this,function(t){return D3(e)&&m9e(e.dataTransfer)?[2,x9e(e.dataTransfer,e.type)]:v9e(e)?[2,y9e(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,b9e(e)]:[2,[]]})})}function m9e(e){return D3(e)}function v9e(e){return D3(e)&&D3(e.target)}function D3(e){return typeof e=="object"&&e!==null}function y9e(e){return GC(e.target.files).map(function(t){return Lv(t)})}function b9e(e){return H0(this,void 0,void 0,function(){var t;return W0(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 Lv(r)})]}})})}function x9e(e,t){return H0(this,void 0,void 0,function(){var n,r;return W0(this,function(i){switch(i.label){case 0:return e.items?(n=GC(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(S9e))]):[3,2];case 1:return r=i.sent(),[2,dI(AH(r))];case 2:return[2,dI(GC(e.files).map(function(o){return Lv(o)}))]}})})}function dI(e){return e.filter(function(t){return p9e.indexOf(t.name)===-1})}function GC(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,mI(n)];if(e.sizen)return[!1,mI(n)]}return[!0,null]}function zf(e){return e!=null}function z9e(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var d=OH(l,n),p=Xm(d,1),g=p[0],m=NH(l,r,i),y=Xm(m,1),x=y[0],S=s?s(l):null;return g&&x&&!S})}function z3(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ty(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 yI(e){e.preventDefault()}function F9e(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function $9e(e){return e.indexOf("Edge/")!==-1}function B9e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return F9e(e)||$9e(e)}function hl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function r8e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var w7=w.exports.forwardRef(function(e,t){var n=e.children,r=F3(e,j9e),i=BH(r),o=i.open,a=F3(i,K9e);return w.exports.useImperativeHandle(t,function(){return{open:o}},[o]),_(w.exports.Fragment,{children:n(fr(fr({},a),{},{open:o}))})});w7.displayName="Dropzone";var $H={disabled:!1,getFilesFromEvent:g9e,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};w7.defaultProps=$H;w7.propTypes={children:Mn.exports.func,accept:Mn.exports.objectOf(Mn.exports.arrayOf(Mn.exports.string)),multiple:Mn.exports.bool,preventDropOnDocument:Mn.exports.bool,noClick:Mn.exports.bool,noKeyboard:Mn.exports.bool,noDrag:Mn.exports.bool,noDragEventsBubbling:Mn.exports.bool,minSize:Mn.exports.number,maxSize:Mn.exports.number,maxFiles:Mn.exports.number,disabled:Mn.exports.bool,getFilesFromEvent:Mn.exports.func,onFileDialogCancel:Mn.exports.func,onFileDialogOpen:Mn.exports.func,useFsAccessApi:Mn.exports.bool,autoFocus:Mn.exports.bool,onDragEnter:Mn.exports.func,onDragLeave:Mn.exports.func,onDragOver:Mn.exports.func,onDrop:Mn.exports.func,onDropAccepted:Mn.exports.func,onDropRejected:Mn.exports.func,onError:Mn.exports.func,validator:Mn.exports.func};var ZC={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function BH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=fr(fr({},$H),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,g=t.onDragOver,m=t.onDrop,y=t.onDropAccepted,x=t.onDropRejected,S=t.onFileDialogCancel,E=t.onFileDialogOpen,P=t.useFsAccessApi,k=t.autoFocus,T=t.preventDropOnDocument,M=t.noClick,N=t.noKeyboard,F=t.noDrag,z=t.noDragEventsBubbling,B=t.onError,K=t.validator,j=w.exports.useMemo(function(){return V9e(n)},[n]),X=w.exports.useMemo(function(){return W9e(n)},[n]),ue=w.exports.useMemo(function(){return typeof E=="function"?E:xI},[E]),ge=w.exports.useMemo(function(){return typeof S=="function"?S:xI},[S]),xe=w.exports.useRef(null),we=w.exports.useRef(null),Se=w.exports.useReducer(i8e,ZC),J=US(Se,2),G=J[0],te=J[1],Q=G.isFocused,W=G.isFileDialogActive,ie=w.exports.useRef(typeof window<"u"&&window.isSecureContext&&P&&H9e()),de=function(){!ie.current&&W&&setTimeout(function(){if(we.current){var et=we.current.files;et.length||(te({type:"closeDialog"}),ge())}},300)};w.exports.useEffect(function(){return window.addEventListener("focus",de,!1),function(){window.removeEventListener("focus",de,!1)}},[we,W,ge,ie]);var be=w.exports.useRef([]),De=function(et){xe.current&&xe.current.contains(et.target)||(et.preventDefault(),be.current=[])};w.exports.useEffect(function(){return T&&(document.addEventListener("dragover",yI,!1),document.addEventListener("drop",De,!1)),function(){T&&(document.removeEventListener("dragover",yI),document.removeEventListener("drop",De))}},[xe,T]),w.exports.useEffect(function(){return!r&&k&&xe.current&&xe.current.focus(),function(){}},[xe,k,r]);var Re=w.exports.useCallback(function(Oe){B?B(Oe):console.error(Oe)},[B]),Ve=w.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),mt(Oe),be.current=[].concat(Y9e(be.current),[Oe.target]),Ty(Oe)&&Promise.resolve(i(Oe)).then(function(et){if(!(z3(Oe)&&!z)){var Gt=et.length,Wt=Gt>0&&z9e({files:et,accept:j,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:K}),Ee=Gt>0&&!Wt;te({isDragAccept:Wt,isDragReject:Ee,isDragActive:!0,type:"setDraggedFiles"}),d&&d(Oe)}}).catch(function(et){return Re(et)})},[i,d,Re,z,j,a,o,s,l,K]),ke=w.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),mt(Oe);var et=Ty(Oe);if(et&&Oe.dataTransfer)try{Oe.dataTransfer.dropEffect="copy"}catch{}return et&&g&&g(Oe),!1},[g,z]),$e=w.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),mt(Oe);var et=be.current.filter(function(Wt){return xe.current&&xe.current.contains(Wt)}),Gt=et.indexOf(Oe.target);Gt!==-1&&et.splice(Gt,1),be.current=et,!(et.length>0)&&(te({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ty(Oe)&&p&&p(Oe))},[xe,p,z]),nt=w.exports.useCallback(function(Oe,et){var Gt=[],Wt=[];Oe.forEach(function(Ee){var kt=OH(Ee,j),Xt=US(kt,2),Bn=Xt[0],Ge=Xt[1],Lt=NH(Ee,a,o),Be=US(Lt,2),ut=Be[0],je=Be[1],xt=K?K(Ee):null;if(Bn&&ut&&!xt)Gt.push(Ee);else{var Qt=[Ge,je];xt&&(Qt=Qt.concat(xt)),Wt.push({file:Ee,errors:Qt.filter(function(qn){return qn})})}}),(!s&&Gt.length>1||s&&l>=1&&Gt.length>l)&&(Gt.forEach(function(Ee){Wt.push({file:Ee,errors:[D9e]})}),Gt.splice(0)),te({acceptedFiles:Gt,fileRejections:Wt,type:"setFiles"}),m&&m(Gt,Wt,et),Wt.length>0&&x&&x(Wt,et),Gt.length>0&&y&&y(Gt,et)},[te,s,j,a,o,l,m,y,x,K]),ft=w.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),mt(Oe),be.current=[],Ty(Oe)&&Promise.resolve(i(Oe)).then(function(et){z3(Oe)&&!z||nt(et,Oe)}).catch(function(et){return Re(et)}),te({type:"reset"})},[i,nt,Re,z]),Rt=w.exports.useCallback(function(){if(ie.current){te({type:"openDialog"}),ue();var Oe={multiple:s,types:X};window.showOpenFilePicker(Oe).then(function(et){return i(et)}).then(function(et){nt(et,null),te({type:"closeDialog"})}).catch(function(et){U9e(et)?(ge(et),te({type:"closeDialog"})):G9e(et)?(ie.current=!1,we.current?(we.current.value=null,we.current.click()):Re(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 was provided."))):Re(et)});return}we.current&&(te({type:"openDialog"}),ue(),we.current.value=null,we.current.click())},[te,ue,ge,P,nt,Re,X,s]),Ot=w.exports.useCallback(function(Oe){!xe.current||!xe.current.isEqualNode(Oe.target)||(Oe.key===" "||Oe.key==="Enter"||Oe.keyCode===32||Oe.keyCode===13)&&(Oe.preventDefault(),Rt())},[xe,Rt]),Me=w.exports.useCallback(function(){te({type:"focus"})},[]),tt=w.exports.useCallback(function(){te({type:"blur"})},[]),pt=w.exports.useCallback(function(){M||(B9e()?setTimeout(Rt,0):Rt())},[M,Rt]),at=function(et){return r?null:et},gt=function(et){return N?null:at(et)},pn=function(et){return F?null:at(et)},mt=function(et){z&&et.stopPropagation()},Ht=w.exports.useMemo(function(){return function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=Oe.refKey,Gt=et===void 0?"ref":et,Wt=Oe.role,Ee=Oe.onKeyDown,kt=Oe.onFocus,Xt=Oe.onBlur,Bn=Oe.onClick,Ge=Oe.onDragEnter,Lt=Oe.onDragOver,Be=Oe.onDragLeave,ut=Oe.onDrop,je=F3(Oe,q9e);return fr(fr(qC({onKeyDown:gt(hl(Ee,Ot)),onFocus:gt(hl(kt,Me)),onBlur:gt(hl(Xt,tt)),onClick:at(hl(Bn,pt)),onDragEnter:pn(hl(Ge,Ve)),onDragOver:pn(hl(Lt,ke)),onDragLeave:pn(hl(Be,$e)),onDrop:pn(hl(ut,ft)),role:typeof Wt=="string"&&Wt!==""?Wt:"presentation"},Gt,xe),!r&&!N?{tabIndex:0}:{}),je)}},[xe,Ot,Me,tt,pt,Ve,ke,$e,ft,N,F,r]),nn=w.exports.useCallback(function(Oe){Oe.stopPropagation()},[]),zt=w.exports.useMemo(function(){return function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=Oe.refKey,Gt=et===void 0?"ref":et,Wt=Oe.onChange,Ee=Oe.onClick,kt=F3(Oe,Z9e),Xt=qC({accept:j,multiple:s,type:"file",style:{display:"none"},onChange:at(hl(Wt,ft)),onClick:at(hl(Ee,nn)),tabIndex:-1},Gt,we);return fr(fr({},Xt),kt)}},[we,n,s,ft,r]);return fr(fr({},G),{},{isFocused:Q&&!r,getRootProps:Ht,getInputProps:zt,rootRef:xe,inputRef:we,open:at(Rt)})}function i8e(e,t){switch(t.type){case"focus":return fr(fr({},e),{},{isFocused:!0});case"blur":return fr(fr({},e),{},{isFocused:!1});case"openDialog":return fr(fr({},ZC),{},{isFileDialogActive:!0});case"closeDialog":return fr(fr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return fr(fr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return fr(fr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return fr({},ZC);default:return e}}function xI(){}const o8e=xn(e=>e.options,e=>{const{activeTab:t}=e;return{activeTabName:Ko[t]}}),a8e=e=>{const{children:t}=e,n=bt(),{activeTabName:r}=qe(o8e),i=Wu({}),[o,a]=w.exports.useState(!1),s=w.exports.useCallback(E=>{a(!0);const P=E.errors.reduce((k,T)=>k+` +`+T.message,"");i({title:"Upload failed",description:P,status:"error",isClosable:!0})},[i]),l=w.exports.useCallback(E=>{a(!0);const P={file:E};["img2img","inpainting"].includes(r)&&(P.destination=r),n(BL(P))},[n,r]),d=w.exports.useCallback((E,P)=>{P.forEach(k=>{s(k)}),E.forEach(k=>{l(k)})},[l,s]),{getRootProps:p,getInputProps:g,isDragAccept:m,isDragReject:y,isDragActive:x,open:S}=BH({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:d,maxFiles:1});return w.exports.useEffect(()=>{const E=P=>{const k=P.clipboardData?.items;if(!k)return;const T=[];for(const F of k)F.kind==="file"&&["image/png","image/jpg"].includes(F.type)&&T.push(F);if(!T.length)return;if(P.stopImmediatePropagation(),T.length>1){i({description:"Multiple images pasted, may only upload one image at a time",status:"error",isClosable:!0});return}const M=T[0].getAsFile();if(!M){i({description:"Unable to load file",status:"error",isClosable:!0});return}const N={file:M};["img2img","inpainting"].includes(r)&&(N.destination=r),n(BL(N))};return document.addEventListener("paste",E),()=>{document.removeEventListener("paste",E)}},[n,i,r]),_(b$.Provider,{value:S,children:ae("div",{...p({style:{}}),children:[_("input",{...g()}),t,x&&ae("div",{className:"dropzone-container",children:[m&&_("div",{className:"dropzone-overlay is-drag-accept",children:_(Qf,{size:"lg",children:"Drop Images"})}),y&&ae("div",{className:"dropzone-overlay is-drag-reject",children:[_(Qf,{size:"lg",children:"Invalid Upload"}),_(Qf,{size:"md",children:"Must be single JPEG or PNG image"})]}),o&&_("div",{className:"dropzone-overlay is-handling-upload",children:_(V0,{})})]})]})})};d9e();const s8e=()=>{const e=bt(),[t,n]=w.exports.useState(!1);return w.exports.useEffect(()=>{e(aye()),n(!0)},[e]),t?_("div",{className:"App",children:ae(a8e,{children:[_(YCe,{}),ae("div",{className:"app-content",children:[_(s9e,{}),_(b6e,{})]}),_("div",{className:"app-console",children:_(c9e,{})})]})}):_(LH,{})};const HH=_ve(PH);jS.createRoot(document.getElementById("root")).render(_(le.StrictMode,{children:_(tve,{store:PH,children:_(TH,{loading:_(LH,{}),persistor:HH,children:ae(Fge,{theme:cI,children:[_(jq,{initialColorMode:cI.config.initialColorMode}),_(s8e,{})]})})})})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 9113d2dc24..37beeed2fa 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -6,8 +6,8 @@ InvokeAI - A Stable Diffusion Toolkit - - + + diff --git a/frontend/package.json b/frontend/package.json index ad4a255eea..5d9b7d72f8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,27 +15,36 @@ "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@radix-ui/react-context-menu": "^2.0.1", + "@radix-ui/react-slider": "^1.1.0", + "@radix-ui/react-tooltip": "^1.0.2", "@reduxjs/toolkit": "^1.8.5", "@types/uuid": "^8.3.4", + "add": "^2.0.6", "dateformat": "^5.0.3", "framer-motion": "^7.2.1", + "konva": "^8.3.13", "lodash": "^4.17.21", "re-resizable": "^6.9.9", "react": "^18.2.0", + "react-colorful": "^5.6.1", "react-dom": "^18.2.0", "react-dropzone": "^14.2.2", "react-hotkeys-hook": "^3.4.7", "react-icons": "^4.4.0", + "react-konva": "^18.2.3", "react-redux": "^8.0.2", + "react-transition-group": "^4.4.5", "redux-persist": "^6.0.0", "socket.io": "^4.5.2", "socket.io-client": "^4.5.2", - "uuid": "^9.0.0" + "uuid": "^9.0.0", + "yarn": "^1.22.19" }, "devDependencies": { "@types/dateformat": "^5.0.0", "@types/react": "^18.0.17", "@types/react-dom": "^18.0.6", + "@types/react-transition-group": "^4.4.5", "@typescript-eslint/eslint-plugin": "^5.36.2", "@typescript-eslint/parser": "^5.36.2", "@vitejs/plugin-react": "^2.0.1", diff --git a/frontend/src/app/App.scss b/frontend/src/app/App.scss index 043c36c036..4e5d516be5 100644 --- a/frontend/src/app/App.scss +++ b/frontend/src/app/App.scss @@ -2,22 +2,20 @@ .App { display: grid; - width: max-content; + width: 100vw; + height: 100vh; + background-color: var(--background-color); } .app-content { display: grid; - row-gap: 1rem; - margin: 0.6rem; - padding: 1rem; - border-radius: 0.5rem; - background-color: var(--background-color); + row-gap: 0.5rem; + padding: $app-padding; grid-auto-rows: max-content; width: $app-width; height: $app-height; - min-width: min-content; } .app-console { - z-index: 9999; + z-index: 20; } diff --git a/frontend/src/app/App.tsx b/frontend/src/app/App.tsx index f91bc24c51..61bd3472f5 100644 --- a/frontend/src/app/App.tsx +++ b/frontend/src/app/App.tsx @@ -7,11 +7,13 @@ import { useAppDispatch } from './store'; import { requestSystemConfig } from './socketio/actions'; import { keepGUIAlive } from './utils'; import InvokeTabs from '../features/tabs/InvokeTabs'; +import ImageUploader from '../common/components/ImageUploader'; keepGUIAlive(); const App = () => { const dispatch = useAppDispatch(); + const [isReady, setIsReady] = useState(false); useEffect(() => { @@ -21,14 +23,16 @@ const App = () => { return isReady ? (
- -
- - -
-
- -
+ + +
+ + +
+
+ +
+
) : ( diff --git a/frontend/src/app/contexts/ImageUploaderTriggerContext.ts b/frontend/src/app/contexts/ImageUploaderTriggerContext.ts new file mode 100644 index 0000000000..804e124625 --- /dev/null +++ b/frontend/src/app/contexts/ImageUploaderTriggerContext.ts @@ -0,0 +1,8 @@ +import { createContext } from 'react'; + +type VoidFunc = () => void; + +type ImageUploaderTriggerContextType = VoidFunc | null; + +export const ImageUploaderTriggerContext = + createContext(null); diff --git a/frontend/src/app/invokeai.d.ts b/frontend/src/app/invokeai.d.ts index 24580377f7..dbe5e518bb 100644 --- a/frontend/src/app/invokeai.d.ts +++ b/frontend/src/app/invokeai.d.ts @@ -12,6 +12,8 @@ * 'gfpgan'. */ +import { Category as GalleryCategory } from '../features/gallery/gallerySlice'; + /** * TODO: * Once an image has been generated, if it is postprocessed again, @@ -105,12 +107,15 @@ export declare type Metadata = SystemConfig & { image: GeneratedImageMetadata | PostProcessedImageMetadata; }; -// An Image has a UUID, url (path?) and Metadata. +// An Image has a UUID, url, modified timestamp, width, height and maybe metadata export declare type Image = { uuid: string; url: string; mtime: number; - metadata: Metadata; + metadata?: Metadata; + width: number; + height: number; + category: GalleryCategory; }; // GalleryImages is an array of Image. @@ -140,20 +145,35 @@ export declare type SystemConfig = { model_hash: string; app_id: string; app_version: string; + model_list: ModelList; }; +export declare type ModelStatus = 'active' | 'cached' | 'not loaded'; + +export declare type Model = { + status: ModelStatus; + description: string; +}; + +export declare type ModelList = Record; + /** * These types type data received from the server via socketio. */ +export declare type ModelChangeResponse = { + model_name: string; + model_list: ModelList; +}; + export declare type SystemStatusResponse = SystemStatus; export declare type SystemConfigResponse = SystemConfig; -export declare type ImageResultResponse = { - url: string; - mtime: number; - metadata: Metadata; +export declare type ImageResultResponse = Omit; + +export declare type ImageUploadResponse = Omit & { + destination: 'img2img' | 'inpainting'; }; export declare type ErrorResponse = { @@ -164,13 +184,22 @@ export declare type ErrorResponse = { export declare type GalleryImagesResponse = { images: Array>; areMoreImagesAvailable: boolean; + category: GalleryCategory; }; -export declare type ImageUrlAndUuidResponse = { +export declare type ImageDeletedResponse = { uuid: string; url: string; + category: GalleryCategory; }; export declare type ImageUrlResponse = { url: string; }; + +export declare type ImageUploadDestination = 'img2img' | 'inpainting'; + +export declare type UploadImagePayload = { + file: File; + destination?: ImageUploadDestination; +}; diff --git a/frontend/src/app/socketio/actions.ts b/frontend/src/app/socketio/actions.ts index 9591dd5214..05e0eb92b8 100644 --- a/frontend/src/app/socketio/actions.ts +++ b/frontend/src/app/socketio/actions.ts @@ -1,6 +1,9 @@ import { createAction } from '@reduxjs/toolkit'; +import { GalleryCategory } from '../../features/gallery/gallerySlice'; +import { InvokeTabName } from '../../features/tabs/InvokeTabs'; import * as InvokeAI from '../invokeai'; + /** * We can't use redux-toolkit's createSlice() to make these actions, * because they have no associated reducer. They only exist to dispatch @@ -8,24 +11,28 @@ import * as InvokeAI from '../invokeai'; * by the middleware. */ -export const generateImage = createAction('socketio/generateImage'); +export const generateImage = createAction( + 'socketio/generateImage' +); export const runESRGAN = createAction('socketio/runESRGAN'); export const runFacetool = createAction('socketio/runFacetool'); export const deleteImage = createAction('socketio/deleteImage'); -export const requestImages = createAction( +export const requestImages = createAction( 'socketio/requestImages' ); -export const requestNewImages = createAction( +export const requestNewImages = createAction( 'socketio/requestNewImages' ); export const cancelProcessing = createAction( 'socketio/cancelProcessing' ); -export const uploadInitialImage = createAction( - 'socketio/uploadInitialImage' -); +export const uploadImage = createAction('socketio/uploadImage'); export const uploadMaskImage = createAction('socketio/uploadMaskImage'); export const requestSystemConfig = createAction( 'socketio/requestSystemConfig' ); + +export const requestModelChange = createAction( + 'socketio/requestModelChange' +); diff --git a/frontend/src/app/socketio/emitters.ts b/frontend/src/app/socketio/emitters.ts index 45be0a1f37..8ed94f17f3 100644 --- a/frontend/src/app/socketio/emitters.ts +++ b/frontend/src/app/socketio/emitters.ts @@ -1,13 +1,26 @@ import { AnyAction, Dispatch, MiddlewareAPI } from '@reduxjs/toolkit'; import dateFormat from 'dateformat'; import { Socket } from 'socket.io-client'; -import { frontendToBackendParameters } from '../../common/util/parameterTranslation'; +import { + frontendToBackendParameters, + FrontendToBackendParametersConfig, +} from '../../common/util/parameterTranslation'; +import { + GalleryCategory, + GalleryState, +} from '../../features/gallery/gallerySlice'; +import { OptionsState } from '../../features/options/optionsSlice'; import { addLogEntry, + errorOccurred, + setCurrentStatus, + setIsCancelable, setIsProcessing, } from '../../features/system/systemSlice'; -import { tabMap, tab_dict } from '../../features/tabs/InvokeTabs'; +import { inpaintingImageElementRef } from '../../features/tabs/Inpainting/InpaintingCanvas'; +import { InvokeTabName } from '../../features/tabs/InvokeTabs'; import * as InvokeAI from '../invokeai'; +import { RootState } from '../store'; /** * Returns an object containing all functions which use `socketio.emit()`. @@ -21,17 +34,56 @@ const makeSocketIOEmitters = ( const { dispatch, getState } = store; return { - emitGenerateImage: () => { + emitGenerateImage: (generationMode: InvokeTabName) => { dispatch(setIsProcessing(true)); - const options = { ...getState().options }; + const state: RootState = getState(); - if (tabMap[options.activeTab] !== 'img2img') { - options.shouldUseInitImage = false; + const { + options: optionsState, + system: systemState, + inpainting: inpaintingState, + gallery: galleryState, + } = state; + + const frontendToBackendParametersConfig: FrontendToBackendParametersConfig = + { + generationMode, + optionsState, + inpaintingState, + systemState, + }; + + if (generationMode === 'inpainting') { + if ( + !inpaintingImageElementRef.current || + !inpaintingState.imageToInpaint?.url + ) { + dispatch( + addLogEntry({ + timestamp: dateFormat(new Date(), 'isoDateTime'), + message: 'Inpainting image not loaded, cannot generate image.', + level: 'error', + }) + ); + dispatch(errorOccurred()); + return; + } + + frontendToBackendParametersConfig.imageToProcessUrl = + inpaintingState.imageToInpaint.url; + + frontendToBackendParametersConfig.maskImageElement = + inpaintingImageElementRef.current; + } else if (!['txt2img', 'img2img'].includes(generationMode)) { + if (!galleryState.currentImage?.url) return; + + frontendToBackendParametersConfig.imageToProcessUrl = + galleryState.currentImage.url; } const { generationParameters, esrganParameters, facetoolParameters } = - frontendToBackendParameters(options, getState().system); + frontendToBackendParameters(frontendToBackendParametersConfig); socketio.emit( 'generateImage', @@ -40,6 +92,14 @@ const makeSocketIOEmitters = ( facetoolParameters ); + // we need to truncate the init_mask base64 else it takes up the whole log + // TODO: handle maintaining masks for reproducibility in future + if (generationParameters.init_mask) { + generationParameters.init_mask = generationParameters.init_mask + .substr(0, 20) + .concat('...'); + } + dispatch( addLogEntry({ timestamp: dateFormat(new Date(), 'isoDateTime'), @@ -53,7 +113,8 @@ const makeSocketIOEmitters = ( }, emitRunESRGAN: (imageToProcess: InvokeAI.Image) => { dispatch(setIsProcessing(true)); - const { upscalingLevel, upscalingStrength } = getState().options; + const options: OptionsState = getState().options; + const { upscalingLevel, upscalingStrength } = options; const esrganParameters = { upscale: [upscalingLevel, upscalingStrength], }; @@ -73,8 +134,8 @@ const makeSocketIOEmitters = ( }, emitRunFacetool: (imageToProcess: InvokeAI.Image) => { dispatch(setIsProcessing(true)); - const { facetoolType, facetoolStrength, codeformerFidelity } = - getState().options; + const options: OptionsState = getState().options; + const { facetoolType, facetoolStrength, codeformerFidelity } = options; const facetoolParameters: Record = { facetool_strength: facetoolStrength, @@ -101,22 +162,25 @@ const makeSocketIOEmitters = ( ); }, emitDeleteImage: (imageToDelete: InvokeAI.Image) => { - const { url, uuid } = imageToDelete; - socketio.emit('deleteImage', url, uuid); + const { url, uuid, category } = imageToDelete; + socketio.emit('deleteImage', url, uuid, category); }, - emitRequestImages: () => { - const { earliest_mtime } = getState().gallery; - socketio.emit('requestImages', earliest_mtime); + emitRequestImages: (category: GalleryCategory) => { + const gallery: GalleryState = getState().gallery; + const { earliest_mtime } = gallery.categories[category]; + socketio.emit('requestImages', category, earliest_mtime); }, - emitRequestNewImages: () => { - const { latest_mtime } = getState().gallery; - socketio.emit('requestLatestImages', latest_mtime); + emitRequestNewImages: (category: GalleryCategory) => { + const gallery: GalleryState = getState().gallery; + const { latest_mtime } = gallery.categories[category]; + socketio.emit('requestLatestImages', category, latest_mtime); }, emitCancelProcessing: () => { socketio.emit('cancel'); }, - emitUploadInitialImage: (file: File) => { - socketio.emit('uploadInitialImage', file, file.name); + emitUploadImage: (payload: InvokeAI.UploadImagePayload) => { + const { file, destination } = payload; + socketio.emit('uploadImage', file, file.name, destination); }, emitUploadMaskImage: (file: File) => { socketio.emit('uploadMaskImage', file, file.name); @@ -124,6 +188,12 @@ const makeSocketIOEmitters = ( emitRequestSystemConfig: () => { socketio.emit('requestSystemConfig'); }, + emitRequestModelChange: (modelName: string) => { + dispatch(setCurrentStatus('Changing Model')); + dispatch(setIsProcessing(true)); + dispatch(setIsCancelable(false)); + socketio.emit('requestModelChange', modelName); + }, }; }; diff --git a/frontend/src/app/socketio/listeners.ts b/frontend/src/app/socketio/listeners.ts index f1c2d806f4..907a6508b4 100644 --- a/frontend/src/app/socketio/listeners.ts +++ b/frontend/src/app/socketio/listeners.ts @@ -13,21 +13,27 @@ import { setSystemConfig, processingCanceled, errorOccurred, + setModelList, + setIsCancelable, } from '../../features/system/systemSlice'; import { addGalleryImages, addImage, clearIntermediateImage, + GalleryState, removeImage, + setCurrentImage, setIntermediateImage, } from '../../features/gallery/gallerySlice'; import { - setInitialImagePath, + clearInitialImage, + setInitialImage, setMaskPath, } from '../../features/options/optionsSlice'; import { requestImages, requestNewImages } from './actions'; +import { clearImageToInpaint, setImageToInpaint } from '../../features/tabs/Inpainting/inpaintingSlice'; /** * Returns an object containing listener callbacks for socketio events. @@ -46,10 +52,18 @@ const makeSocketIOListeners = ( try { dispatch(setIsConnected(true)); dispatch(setCurrentStatus('Connected')); - if (getState().gallery.latest_mtime) { - dispatch(requestNewImages()); + const gallery: GalleryState = getState().gallery; + + if (gallery.categories.user.latest_mtime) { + dispatch(requestNewImages('user')); } else { - dispatch(requestImages()); + dispatch(requestImages('user')); + } + + if (gallery.categories.result.latest_mtime) { + dispatch(requestNewImages('result')); + } else { + dispatch(requestImages('result')); } } catch (e) { console.error(e); @@ -79,21 +93,19 @@ const makeSocketIOListeners = ( */ onGenerationResult: (data: InvokeAI.ImageResultResponse) => { try { - const { url, mtime, metadata } = data; - const newUuid = uuidv4(); - dispatch( addImage({ - uuid: newUuid, - url, - mtime, - metadata: metadata, + category: 'result', + image: { + uuid: uuidv4(), + ...data, + }, }) ); dispatch( addLogEntry({ timestamp: dateFormat(new Date(), 'isoDateTime'), - message: `Image generated: ${url}`, + message: `Image generated: ${data.url}`, }) ); } catch (e) { @@ -105,20 +117,16 @@ const makeSocketIOListeners = ( */ onIntermediateResult: (data: InvokeAI.ImageResultResponse) => { try { - const uuid = uuidv4(); - const { url, metadata, mtime } = data; dispatch( setIntermediateImage({ - uuid, - url, - mtime, - metadata, + uuid: uuidv4(), + ...data, }) ); dispatch( addLogEntry({ timestamp: dateFormat(new Date(), 'isoDateTime'), - message: `Intermediate image generated: ${url}`, + message: `Intermediate image generated: ${data.url}`, }) ); } catch (e) { @@ -130,21 +138,20 @@ const makeSocketIOListeners = ( */ onPostprocessingResult: (data: InvokeAI.ImageResultResponse) => { try { - const { url, metadata, mtime } = data; - dispatch( addImage({ - uuid: uuidv4(), - url, - mtime, - metadata, + category: 'result', + image: { + uuid: uuidv4(), + ...data, + }, }) ); dispatch( addLogEntry({ timestamp: dateFormat(new Date(), 'isoDateTime'), - message: `Postprocessed: ${url}`, + message: `Postprocessed: ${data.url}`, }) ); } catch (e) { @@ -191,7 +198,7 @@ const makeSocketIOListeners = ( * Callback to run when we receive a 'galleryImages' event. */ onGalleryImages: (data: InvokeAI.GalleryImagesResponse) => { - const { images, areMoreImagesAvailable } = data; + const { images, areMoreImagesAvailable, category } = data; /** * the logic here ideally would be in the reducer but we have a side effect: @@ -200,17 +207,18 @@ const makeSocketIOListeners = ( // Generate a UUID for each image const preparedImages = images.map((image): InvokeAI.Image => { - const { url, metadata, mtime } = image; return { uuid: uuidv4(), - url, - mtime, - metadata, + ...image, }; }); dispatch( - addGalleryImages({ images: preparedImages, areMoreImagesAvailable }) + addGalleryImages({ + images: preparedImages, + areMoreImagesAvailable, + category, + }) ); dispatch( @@ -229,7 +237,12 @@ const makeSocketIOListeners = ( const { intermediateImage } = getState().gallery; if (intermediateImage) { - dispatch(addImage(intermediateImage)); + dispatch( + addImage({ + category: 'result', + image: intermediateImage, + }) + ); dispatch( addLogEntry({ timestamp: dateFormat(new Date(), 'isoDateTime'), @@ -250,14 +263,22 @@ const makeSocketIOListeners = ( /** * Callback to run when we receive a 'imageDeleted' event. */ - onImageDeleted: (data: InvokeAI.ImageUrlAndUuidResponse) => { - const { url, uuid } = data; - dispatch(removeImage(uuid)); + onImageDeleted: (data: InvokeAI.ImageDeletedResponse) => { + const { url, uuid, category } = data; - const { initialImagePath, maskPath } = getState().options; + // remove image from gallery + dispatch(removeImage(data)); - if (initialImagePath === url) { - dispatch(setInitialImagePath('')); + // remove references to image in options + const { initialImage, maskPath } = getState().options; + const { imageToInpaint } = getState().inpainting; + + if (initialImage?.url === url || initialImage === url) { + dispatch(clearInitialImage()); + } + + if (imageToInpaint?.url === url) { + dispatch(clearImageToInpaint()); } if (maskPath === url) { @@ -271,18 +292,40 @@ const makeSocketIOListeners = ( }) ); }, - /** - * Callback to run when we receive a 'initialImageUploaded' event. - */ - onInitialImageUploaded: (data: InvokeAI.ImageUrlResponse) => { - const { url } = data; - dispatch(setInitialImagePath(url)); - dispatch( - addLogEntry({ - timestamp: dateFormat(new Date(), 'isoDateTime'), - message: `Initial image uploaded: ${url}`, - }) - ); + onImageUploaded: (data: InvokeAI.ImageUploadResponse) => { + const { destination, ...rest } = data; + const image = { + uuid: uuidv4(), + ...rest, + }; + + try { + dispatch(addImage({ image, category: 'user' })); + + switch (destination) { + case 'img2img': { + dispatch(setInitialImage(image)); + break; + } + case 'inpainting': { + dispatch(setImageToInpaint(image)); + break; + } + default: { + dispatch(setCurrentImage(image)); + break; + } + } + + dispatch( + addLogEntry({ + timestamp: dateFormat(new Date(), 'isoDateTime'), + message: `Image uploaded: ${data.url}`, + }) + ); + } catch (e) { + console.error(e); + } }, /** * Callback to run when we receive a 'maskImageUploaded' event. @@ -300,6 +343,34 @@ const makeSocketIOListeners = ( onSystemConfig: (data: InvokeAI.SystemConfig) => { dispatch(setSystemConfig(data)); }, + onModelChanged: (data: InvokeAI.ModelChangeResponse) => { + const { model_name, model_list } = data; + dispatch(setModelList(model_list)); + dispatch(setCurrentStatus('Model Changed')); + dispatch(setIsProcessing(false)); + dispatch(setIsCancelable(false)); + dispatch( + addLogEntry({ + timestamp: dateFormat(new Date(), 'isoDateTime'), + message: `Model changed: ${model_name}`, + level: 'info', + }) + ); + }, + onModelChangeFailed: (data: InvokeAI.ModelChangeResponse) => { + const { model_name, model_list } = data; + dispatch(setModelList(model_list)); + dispatch(setIsProcessing(false)); + dispatch(setIsCancelable(false)); + dispatch(errorOccurred()); + dispatch( + addLogEntry({ + timestamp: dateFormat(new Date(), 'isoDateTime'), + message: `Model change failed: ${model_name}`, + level: 'error', + }) + ); + }, }; }; diff --git a/frontend/src/app/socketio/middleware.ts b/frontend/src/app/socketio/middleware.ts index 9891d6acce..854e245c4f 100644 --- a/frontend/src/app/socketio/middleware.ts +++ b/frontend/src/app/socketio/middleware.ts @@ -43,9 +43,11 @@ export const socketioMiddleware = () => { onGalleryImages, onProcessingCanceled, onImageDeleted, - onInitialImageUploaded, + onImageUploaded, onMaskImageUploaded, onSystemConfig, + onModelChanged, + onModelChangeFailed, } = makeSocketIOListeners(store); const { @@ -56,9 +58,10 @@ export const socketioMiddleware = () => { emitRequestImages, emitRequestNewImages, emitCancelProcessing, - emitUploadInitialImage, + emitUploadImage, emitUploadMaskImage, emitRequestSystemConfig, + emitRequestModelChange, } = makeSocketIOEmitters(store, socketio); /** @@ -97,13 +100,16 @@ export const socketioMiddleware = () => { onProcessingCanceled(); }); - socketio.on('imageDeleted', (data: InvokeAI.ImageUrlAndUuidResponse) => { + socketio.on('imageDeleted', (data: InvokeAI.ImageDeletedResponse) => { onImageDeleted(data); }); - socketio.on('initialImageUploaded', (data: InvokeAI.ImageUrlResponse) => { - onInitialImageUploaded(data); - }); + socketio.on( + 'imageUploaded', + (data: InvokeAI.ImageUploadResponse) => { + onImageUploaded(data); + } + ); socketio.on('maskImageUploaded', (data: InvokeAI.ImageUrlResponse) => { onMaskImageUploaded(data); @@ -113,6 +119,14 @@ export const socketioMiddleware = () => { onSystemConfig(data); }); + socketio.on('modelChanged', (data: InvokeAI.ModelChangeResponse) => { + onModelChanged(data); + }); + + socketio.on('modelChangeFailed', (data: InvokeAI.ModelChangeResponse) => { + onModelChangeFailed(data); + }); + areListenersSet = true; } @@ -121,7 +135,7 @@ export const socketioMiddleware = () => { */ switch (action.type) { case 'socketio/generateImage': { - emitGenerateImage(); + emitGenerateImage(action.payload); break; } @@ -141,12 +155,12 @@ export const socketioMiddleware = () => { } case 'socketio/requestImages': { - emitRequestImages(); + emitRequestImages(action.payload); break; } case 'socketio/requestNewImages': { - emitRequestNewImages(); + emitRequestNewImages(action.payload); break; } @@ -155,8 +169,8 @@ export const socketioMiddleware = () => { break; } - case 'socketio/uploadInitialImage': { - emitUploadInitialImage(action.payload); + case 'socketio/uploadImage': { + emitUploadImage(action.payload); break; } @@ -169,6 +183,11 @@ export const socketioMiddleware = () => { emitRequestSystemConfig(); break; } + + case 'socketio/requestModelChange': { + emitRequestModelChange(action.payload); + break; + } } next(action); diff --git a/frontend/src/app/store.ts b/frontend/src/app/store.ts index 0d41cbcc65..d37da505cb 100644 --- a/frontend/src/app/store.ts +++ b/frontend/src/app/store.ts @@ -7,6 +7,7 @@ import storage from 'redux-persist/lib/storage'; // defaults to localStorage for import optionsReducer from '../features/options/optionsSlice'; import galleryReducer from '../features/gallery/gallerySlice'; +import inpaintingReducer from '../features/tabs/Inpainting/inpaintingSlice'; import systemReducer from '../features/system/systemSlice'; import { socketioMiddleware } from './socketio/middleware'; @@ -32,13 +33,14 @@ import { socketioMiddleware } from './socketio/middleware'; const rootPersistConfig = { key: 'root', storage, - blacklist: ['gallery', 'system'], + blacklist: ['gallery', 'system', 'inpainting'], }; const systemPersistConfig = { key: 'system', storage, blacklist: [ + 'isCancelable', 'isConnected', 'isProcessing', 'currentStep', @@ -53,10 +55,30 @@ const systemPersistConfig = { ], }; +const galleryPersistConfig = { + key: 'gallery', + storage, + whitelist: [ + 'galleryWidth', + 'shouldPinGallery', + 'shouldShowGallery', + 'galleryScrollPosition', + 'galleryImageMinimumWidth', + 'galleryImageObjectFit', + ], +}; + +const inpaintingPersistConfig = { + key: 'inpainting', + storage, + blacklist: ['pastLines', 'futuresLines', 'cursorPosition'], +}; + const reducers = combineReducers({ options: optionsReducer, - gallery: galleryReducer, + gallery: persistReducer(galleryPersistConfig, galleryReducer), system: persistReducer(systemPersistConfig, systemReducer), + inpainting: persistReducer(inpaintingPersistConfig, inpaintingReducer), }); const persistedReducer = persistReducer(rootPersistConfig, reducers); diff --git a/frontend/src/common/components/GuidePopover.tsx b/frontend/src/common/components/GuidePopover.tsx index 2af5a0916b..b5893629c0 100644 --- a/frontend/src/common/components/GuidePopover.tsx +++ b/frontend/src/common/components/GuidePopover.tsx @@ -25,7 +25,10 @@ const systemSelector = createSelector( const GuidePopover = ({ children, feature }: GuideProps) => { const shouldDisplayGuides = useAppSelector(systemSelector); const { text } = FEATURES[feature]; - return shouldDisplayGuides ? ( + + if (!shouldDisplayGuides) return null; + + return ( {children} @@ -40,8 +43,6 @@ const GuidePopover = ({ children, feature }: GuideProps) => {
{text}
- ) : ( - <> ); }; diff --git a/frontend/src/common/components/IAICheckbox.scss b/frontend/src/common/components/IAICheckbox.scss new file mode 100644 index 0000000000..c0118e25e1 --- /dev/null +++ b/frontend/src/common/components/IAICheckbox.scss @@ -0,0 +1,26 @@ +.invokeai__checkbox { + .chakra-checkbox__label { + margin-top: 1px; + color: var(--text-color-secondary); + font-size: 0.9rem; + } + + .chakra-checkbox__control { + width: 1rem; + height: 1rem; + border: none; + border-radius: 0.2rem; + background-color: var(--input-checkbox-bg); + + svg { + width: 0.6rem; + height: 0.6rem; + stroke-width: 3px !important; + } + + &[data-checked] { + color: var(--text-color); + background-color: var(--input-checkbox-checked-bg); + } + } +} diff --git a/frontend/src/common/components/IAICheckbox.tsx b/frontend/src/common/components/IAICheckbox.tsx new file mode 100644 index 0000000000..fa9ab20ea2 --- /dev/null +++ b/frontend/src/common/components/IAICheckbox.tsx @@ -0,0 +1,17 @@ +import { Checkbox, CheckboxProps } from '@chakra-ui/react'; + +type IAICheckboxProps = CheckboxProps & { + label: string; + styleClass?: string; +}; + +const IAICheckbox = (props: IAICheckboxProps) => { + const { label, styleClass, ...rest } = props; + return ( + + {label} + + ); +}; + +export default IAICheckbox; diff --git a/frontend/src/common/components/IAIColorPicker.scss b/frontend/src/common/components/IAIColorPicker.scss new file mode 100644 index 0000000000..4b6e29483b --- /dev/null +++ b/frontend/src/common/components/IAIColorPicker.scss @@ -0,0 +1,8 @@ +.invokeai__color-picker { + .react-colorful__hue-pointer, + .react-colorful__saturation-pointer { + width: 1.5rem; + height: 1.5rem; + border-color: var(--white); + } +} diff --git a/frontend/src/common/components/IAIColorPicker.tsx b/frontend/src/common/components/IAIColorPicker.tsx new file mode 100644 index 0000000000..619c5758e6 --- /dev/null +++ b/frontend/src/common/components/IAIColorPicker.tsx @@ -0,0 +1,19 @@ +import { RgbaColorPicker } from 'react-colorful'; +import { ColorPickerBaseProps, RgbaColor } from 'react-colorful/dist/types'; + +type IAIColorPickerProps = ColorPickerBaseProps & { + styleClass?: string; +}; + +const IAIColorPicker = (props: IAIColorPickerProps) => { + const { styleClass, ...rest } = props; + + return ( + + ); +}; + +export default IAIColorPicker; diff --git a/frontend/src/common/components/IAIIconButton.scss b/frontend/src/common/components/IAIIconButton.scss new file mode 100644 index 0000000000..d123f1597f --- /dev/null +++ b/frontend/src/common/components/IAIIconButton.scss @@ -0,0 +1,20 @@ +@use '../../styles/Mixins/' as *; + +.icon-button { + background-color: var(--btn-grey); + cursor: pointer; + + &:hover { + background-color: var(--btn-grey-hover); + } + + &[data-selected=true] { + background-color: var(--accent-color); + &:hover { + background-color: var(--accent-color-hover); + } + } + &[disabled] { + cursor: not-allowed; + } +} diff --git a/frontend/src/common/components/IAIIconButton.tsx b/frontend/src/common/components/IAIIconButton.tsx index 97efe145a2..de8765c395 100644 --- a/frontend/src/common/components/IAIIconButton.tsx +++ b/frontend/src/common/components/IAIIconButton.tsx @@ -8,20 +8,28 @@ import { interface Props extends IconButtonProps { tooltip?: string; tooltipPlacement?: PlacementWithLogical | undefined; + styleClass?: string; } /** * Reusable customized button component. Originally was more customized - now probably unecessary. - * - * TODO: Get rid of this. */ const IAIIconButton = (props: Props) => { - const { tooltip = '', tooltipPlacement = 'bottom', onClick, ...rest } = props; + const { + tooltip = '', + tooltipPlacement = 'bottom', + styleClass, + onClick, + cursor, + ...rest + } = props; + return ( diff --git a/frontend/src/common/components/IAIInput.scss b/frontend/src/common/components/IAIInput.scss index 43a48da36d..a028d8ecda 100644 --- a/frontend/src/common/components/IAIInput.scss +++ b/frontend/src/common/components/IAIInput.scss @@ -17,8 +17,8 @@ &:focus { outline: none; - border: 2px solid var(--prompt-border-color); - box-shadow: 0 0 10px 0 var(--prompt-box-shadow-color); + border: 2px solid var(--input-border-color); + box-shadow: 0 0 10px 0 var(--input-box-shadow-color); } &:disabled { diff --git a/frontend/src/common/components/IAINumberInput.scss b/frontend/src/common/components/IAINumberInput.scss index 648613d621..32de658131 100644 --- a/frontend/src/common/components/IAINumberInput.scss +++ b/frontend/src/common/components/IAINumberInput.scss @@ -1,15 +1,32 @@ -.number-input { +.invokeai__number-input-form-control { display: grid; grid-template-columns: max-content auto; column-gap: 1rem; align-items: center; - .number-input-label { + .invokeai__number-input-form-label { color: var(--text-color-secondary); margin-right: 0; + font-size: 1rem; + margin-bottom: 0; + flex-grow: 2; + white-space: nowrap; + + &[data-focus] + .invokeai__number-input-root { + outline: none; + border: 2px solid var(--input-border-color); + box-shadow: 0 0 10px 0 var(--input-box-shadow-color); + } + + &[aria-invalid='true'] + .invokeai__number-input-root { + outline: none; + border: 2px solid var(--border-color-invalid); + box-shadow: 0 0 10px 0 var(--box-shadow-color-invalid); + } } - .number-input-field { + .invokeai__number-input-root { + height: 2rem; display: grid; grid-template-columns: auto max-content; column-gap: 0.5rem; @@ -19,34 +36,39 @@ border-radius: 0.2rem; } - .number-input-entry { + .invokeai__number-input-field { border: none; font-weight: bold; width: 100%; - padding-inline-end: 0; + height: auto; + padding: 0; + font-size: 0.9rem; + padding-left: 0.5rem; + padding-right: 0.5rem; &:focus { outline: none; - border: 2px solid var(--prompt-border-color); - box-shadow: 0 0 10px 0 var(--prompt-box-shadow-color); + box-shadow: none; } &:disabled { opacity: 0.2; } } - - .number-input-stepper { + .invokeai__number-input-stepper { display: grid; - padding-right: 0.7rem; + padding-right: 0.5rem; - svg { - width: 12px; - height: 12px; - } - - .number-input-stepper-button { + .invokeai__number-input-stepper-button { border: none; + // expand arrow hitbox + padding: 0 0.5rem; + margin: 0 -0.5rem; + + svg { + width: 10px; + height: 10px; + } } } } diff --git a/frontend/src/common/components/IAINumberInput.tsx b/frontend/src/common/components/IAINumberInput.tsx index d0bb6b0136..e2ff190b31 100644 --- a/frontend/src/common/components/IAINumberInput.tsx +++ b/frontend/src/common/components/IAINumberInput.tsx @@ -6,6 +6,12 @@ import { NumberDecrementStepper, NumberInputProps, FormLabel, + NumberInputFieldProps, + NumberInputStepperProps, + FormControlProps, + FormLabelProps, + TooltipProps, + Tooltip, } from '@chakra-ui/react'; import _ from 'lodash'; import { FocusEvent, useEffect, useState } from 'react'; @@ -23,6 +29,12 @@ interface Props extends Omit { max: number; clamp?: boolean; isInteger?: boolean; + formControlProps?: FormControlProps; + formLabelProps?: FormLabelProps; + numberInputProps?: NumberInputProps; + numberInputFieldProps?: NumberInputFieldProps; + numberInputStepperProps?: NumberInputStepperProps; + tooltipProps?: Omit; } /** @@ -34,8 +46,6 @@ const IAINumberInput = (props: Props) => { styleClass, isDisabled = false, showStepper = true, - fontSize = '1rem', - size = 'sm', width, textAlign, isInvalid, @@ -44,6 +54,11 @@ const IAINumberInput = (props: Props) => { min, max, isInteger = true, + formControlProps, + formLabelProps, + numberInputFieldProps, + numberInputStepperProps, + tooltipProps, ...rest } = props; @@ -65,7 +80,10 @@ const IAINumberInput = (props: Props) => { * from the current value. */ useEffect(() => { - if (!valueAsString.match(numberStringRegex) && value !== Number(valueAsString)) { + if ( + !valueAsString.match(numberStringRegex) && + value !== Number(valueAsString) + ) { setValueAsString(String(value)); } }, [value, valueAsString]); @@ -94,47 +112,55 @@ const IAINumberInput = (props: Props) => { }; return ( - - {label && ( + + {label} - )} - - -
- - -
-
-
+ +
+ + +
+
+
+ ); }; diff --git a/frontend/src/common/components/IAIPopover.scss b/frontend/src/common/components/IAIPopover.scss new file mode 100644 index 0000000000..73fab8cfb5 --- /dev/null +++ b/frontend/src/common/components/IAIPopover.scss @@ -0,0 +1,12 @@ +.invokeai__popover-content { + min-width: unset; + width: unset !important; + padding: 1rem; + border-radius: 0.5rem !important; + background-color: var(--background-color) !important; + border: 2px solid var(--border-color) !important; + + .invokeai__popover-arrow { + background-color: var(--background-color) !important; + } +} diff --git a/frontend/src/common/components/IAIPopover.tsx b/frontend/src/common/components/IAIPopover.tsx new file mode 100644 index 0000000000..231355cb03 --- /dev/null +++ b/frontend/src/common/components/IAIPopover.tsx @@ -0,0 +1,39 @@ +import { + Popover, + PopoverArrow, + PopoverContent, + PopoverTrigger, + Box, +} from '@chakra-ui/react'; +import { PopoverProps } from '@chakra-ui/react'; +import { ReactNode } from 'react'; + +type IAIPopoverProps = PopoverProps & { + triggerComponent: ReactNode; + children: ReactNode; + styleClass?: string; + hasArrow?: boolean; +}; + +const IAIPopover = (props: IAIPopoverProps) => { + const { + triggerComponent, + children, + styleClass, + hasArrow = true, + ...rest + } = props; + return ( + + + {triggerComponent} + + + {hasArrow && } + {children} + + + ); +}; + +export default IAIPopover; diff --git a/frontend/src/common/components/IAISelect.scss b/frontend/src/common/components/IAISelect.scss index 112de864e8..13e6f21344 100644 --- a/frontend/src/common/components/IAISelect.scss +++ b/frontend/src/common/components/IAISelect.scss @@ -1,28 +1,32 @@ -.iai-select { +@use '../../styles/Mixins/' as *; + +.invokeai__select { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 1rem; align-items: center; width: max-content; - .iai-select-label { + .invokeai__select-label { color: var(--text-color-secondary); margin-right: 0; } - .iai-select-picker { + .invokeai__select-picker { border: 2px solid var(--border-color); background-color: var(--background-color-secondary); font-weight: bold; + height: 2rem; + border-radius: 0.2rem; &:focus { outline: none; - border: 2px solid var(--prompt-border-color); - box-shadow: 0 0 10px 0 var(--prompt-box-shadow-color); + border: 2px solid var(--input-border-color); + box-shadow: 0 0 10px 0 var(--input-box-shadow-color); } } - .iai-select-option { + .invokeai__select-option { background-color: var(--background-color-secondary); } } diff --git a/frontend/src/common/components/IAISelect.tsx b/frontend/src/common/components/IAISelect.tsx index 4079facb76..f233bfc03b 100644 --- a/frontend/src/common/components/IAISelect.tsx +++ b/frontend/src/common/components/IAISelect.tsx @@ -21,13 +21,13 @@ const IAISelect = (props: Props) => { ...rest } = props; return ( - + {label} @@ -35,11 +35,11 @@ const IAISelect = (props: Props) => { fontSize={fontSize} size={size} {...rest} - className="iai-select-picker" + className="invokeai__select-picker" > {validValues.map((opt) => { return typeof opt === 'string' || typeof opt === 'number' ? ( - ) : ( diff --git a/frontend/src/common/components/IAISlider.scss b/frontend/src/common/components/IAISlider.scss new file mode 100644 index 0000000000..ef7681c42f --- /dev/null +++ b/frontend/src/common/components/IAISlider.scss @@ -0,0 +1,40 @@ +@use '../../styles/Mixins/' as *; + +.invokeai__slider-form-control { + display: flex; + column-gap: 1rem; + justify-content: space-between; + align-items: center; + width: max-content; + padding-right: 0.25rem; + + .invokeai__slider-inner-container { + display: flex; + column-gap: 0.5rem; + + .invokeai__slider-form-label { + color: var(--text-color-secondary); + margin: 0; + margin-right: 0.5rem; + margin-bottom: 0.1rem; + } + + .invokeai__slider-root { + .invokeai__slider-filled-track { + background-color: var(--accent-color-hover); + } + + .invokeai__slider-track { + background-color: var(--text-color-secondary); + height: 5px; + border-radius: 9999px; + } + + .invokeai__slider-thumb { + } + } + } +} + +.invokeai__slider-thumb-tooltip { +} diff --git a/frontend/src/common/components/IAISlider.tsx b/frontend/src/common/components/IAISlider.tsx new file mode 100644 index 0000000000..9b7156c5ad --- /dev/null +++ b/frontend/src/common/components/IAISlider.tsx @@ -0,0 +1,87 @@ +import { + Slider, + SliderTrack, + SliderFilledTrack, + SliderThumb, + FormControl, + FormLabel, + Tooltip, + SliderProps, + FormControlProps, + FormLabelProps, + SliderTrackProps, + SliderThumbProps, + TooltipProps, + SliderInnerTrackProps, +} from '@chakra-ui/react'; + +type IAISliderProps = SliderProps & { + label?: string; + styleClass?: string; + formControlProps?: FormControlProps; + formLabelProps?: FormLabelProps; + sliderTrackProps?: SliderTrackProps; + sliderInnerTrackProps?: SliderInnerTrackProps; + sliderThumbProps?: SliderThumbProps; + sliderThumbTooltipProps?: Omit; +}; + +const IAISlider = (props: IAISliderProps) => { + const { + label, + styleClass, + formControlProps, + formLabelProps, + sliderTrackProps, + sliderInnerTrackProps, + sliderThumbProps, + sliderThumbTooltipProps, + ...rest + } = props; + return ( + +
+ + {label} + + + + + + + + + + + +
+
+ ); +}; + +export default IAISlider; diff --git a/frontend/src/common/components/IAISwitch.scss b/frontend/src/common/components/IAISwitch.scss index 7ff1921ee1..af278dd2d0 100644 --- a/frontend/src/common/components/IAISwitch.scss +++ b/frontend/src/common/components/IAISwitch.scss @@ -1,18 +1,33 @@ -.chakra-switch, -.switch-button { - span { - background-color: var(--switch-bg-color); +.invokeai__switch-form-control { + .invokeai__switch-form-label { + display: flex; + column-gap: 1rem; + justify-content: space-between; + align-items: center; + color: var(--text-color-secondary); + font-size: 1rem; + margin-right: 0; + margin-bottom: 0.1rem; + white-space: nowrap; + width: auto; - span { - background-color: var(--white); - } - } + .invokeai__switch-root { + span { + background-color: var(--switch-bg-color); + span { + background-color: var(--white); + } + } - span[data-checked] { - background: var(--switch-bg-active-color); + &[data-checked] { + span { + background: var(--switch-bg-active-color); - span { - background-color: var(--white); + span { + background-color: var(--white); + } + } + } } } } diff --git a/frontend/src/common/components/IAISwitch.tsx b/frontend/src/common/components/IAISwitch.tsx index 19eb57b34e..6fa8171634 100644 --- a/frontend/src/common/components/IAISwitch.tsx +++ b/frontend/src/common/components/IAISwitch.tsx @@ -1,7 +1,8 @@ import { - Flex, FormControl, + FormControlProps, FormLabel, + FormLabelProps, Switch, SwitchProps, } from '@chakra-ui/react'; @@ -9,6 +10,9 @@ import { interface Props extends SwitchProps { label?: string; width?: string | number; + styleClass?: string; + formControlProps?: FormControlProps; + formLabelProps?: FormLabelProps; } /** @@ -18,26 +22,35 @@ const IAISwitch = (props: Props) => { const { label, isDisabled = false, - fontSize = 'md', - size = 'md', + // fontSize = 'md', + // size = 'md', width = 'auto', + formControlProps, + formLabelProps, + styleClass, ...rest } = props; return ( - - - {label && ( - - {label} - - )} - - + + + {label} + + ); }; diff --git a/frontend/src/common/components/ImageUploader.scss b/frontend/src/common/components/ImageUploader.scss new file mode 100644 index 0000000000..c0b3c1b396 --- /dev/null +++ b/frontend/src/common/components/ImageUploader.scss @@ -0,0 +1,72 @@ +.dropzone-container { + position: absolute; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: 999; + backdrop-filter: blur(20px); + + .dropzone-overlay { + opacity: 0.5; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + row-gap: 1rem; + align-items: center; + justify-content: center; + + &.is-drag-accept { + box-shadow: inset 0 0 20rem 1rem var(--status-good-color); + } + + &.is-drag-reject { + box-shadow: inset 0 0 20rem 1rem var(--status-bad-color); + } + + &.is-handling-upload { + box-shadow: inset 0 0 20rem 1rem var(--status-working-color); + } + } +} + +.image-uploader-button-outer { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + border-radius: 0.5rem; + color: var(--subtext-color-bright); + + &:hover { + background-color: var(--inpaint-bg-color); + } +} + +.image-upload-button-inner { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.image-upload-button { + display: flex; + flex-direction: column; + row-gap: 2rem; + align-items: center; + justify-content: center; + text-align: center; + + svg { + width: 4rem !important; + height: 4rem !important; + } + h2 { + font-size: 1.2rem !important; + } +} diff --git a/frontend/src/common/components/ImageUploader.tsx b/frontend/src/common/components/ImageUploader.tsx new file mode 100644 index 0000000000..30c5249334 --- /dev/null +++ b/frontend/src/common/components/ImageUploader.tsx @@ -0,0 +1,173 @@ +import { useCallback, ReactNode, useState, useEffect } from 'react'; +import { RootState, useAppDispatch, useAppSelector } from '../../app/store'; +import { tabMap } from '../../features/tabs/InvokeTabs'; +import { FileRejection, useDropzone } from 'react-dropzone'; +import { Heading, Spinner, useToast } from '@chakra-ui/react'; +import { createSelector } from '@reduxjs/toolkit'; +import { OptionsState } from '../../features/options/optionsSlice'; +import { uploadImage } from '../../app/socketio/actions'; +import { ImageUploadDestination, UploadImagePayload } from '../../app/invokeai'; +import { ImageUploaderTriggerContext } from '../../app/contexts/ImageUploaderTriggerContext'; + +const appSelector = createSelector( + (state: RootState) => state.options, + (options: OptionsState) => { + const { activeTab } = options; + return { + activeTabName: tabMap[activeTab], + }; + } +); + +type ImageUploaderProps = { + children: ReactNode; +}; + +const ImageUploader = (props: ImageUploaderProps) => { + const { children } = props; + const dispatch = useAppDispatch(); + const { activeTabName } = useAppSelector(appSelector); + const toast = useToast({}); + const [isHandlingUpload, setIsHandlingUpload] = useState(false); + + const fileRejectionCallback = useCallback( + (rejection: FileRejection) => { + setIsHandlingUpload(true); + const msg = rejection.errors.reduce( + (acc: string, cur: { message: string }) => acc + '\n' + cur.message, + '' + ); + toast({ + title: 'Upload failed', + description: msg, + status: 'error', + isClosable: true, + }); + }, + [toast] + ); + + const fileAcceptedCallback = useCallback( + (file: File) => { + setIsHandlingUpload(true); + const payload: UploadImagePayload = { file }; + if (['img2img', 'inpainting'].includes(activeTabName)) { + payload.destination = activeTabName as ImageUploadDestination; + } + dispatch(uploadImage(payload)); + }, + [dispatch, activeTabName] + ); + + const onDrop = useCallback( + (acceptedFiles: Array, fileRejections: Array) => { + fileRejections.forEach((rejection: FileRejection) => { + fileRejectionCallback(rejection); + }); + + acceptedFiles.forEach((file: File) => { + fileAcceptedCallback(file); + }); + }, + [fileAcceptedCallback, fileRejectionCallback] + ); + + const { + getRootProps, + getInputProps, + isDragAccept, + isDragReject, + isDragActive, + open, + } = useDropzone({ + accept: { 'image/png': ['.png'], 'image/jpeg': ['.jpg', '.jpeg', '.png'] }, + noClick: true, + onDrop, + maxFiles: 1, + }); + + useEffect(() => { + const pasteImageListener = (e: ClipboardEvent) => { + const dataTransferItemList = e.clipboardData?.items; + if (!dataTransferItemList) return; + + const imageItems: Array = []; + + for (const item of dataTransferItemList) { + if ( + item.kind === 'file' && + ['image/png', 'image/jpg'].includes(item.type) + ) { + imageItems.push(item); + } + } + + if (!imageItems.length) return; + + e.stopImmediatePropagation(); + + if (imageItems.length > 1) { + toast({ + description: + 'Multiple images pasted, may only upload one image at a time', + status: 'error', + isClosable: true, + }); + return; + } + + const file = imageItems[0].getAsFile(); + + if (!file) { + toast({ + description: 'Unable to load file', + status: 'error', + isClosable: true, + }); + return; + } + + const payload: UploadImagePayload = { file }; + if (['img2img', 'inpainting'].includes(activeTabName)) { + payload.destination = activeTabName as ImageUploadDestination; + } + + dispatch(uploadImage(payload)); + }; + document.addEventListener('paste', pasteImageListener); + return () => { + document.removeEventListener('paste', pasteImageListener); + }; + }, [dispatch, toast, activeTabName]); + + return ( + +
+ + {children} + {isDragActive && ( +
+ {isDragAccept && ( +
+ Drop Images +
+ )} + {isDragReject && ( +
+ Invalid Upload + Must be single JPEG or PNG image +
+ )} + {isHandlingUpload && ( +
+ +
+ )} +
+ )} +
+
+ ); +}; + +export default ImageUploader; diff --git a/frontend/src/common/components/ImageUploaderButton.tsx b/frontend/src/common/components/ImageUploaderButton.tsx new file mode 100644 index 0000000000..373ab7ad21 --- /dev/null +++ b/frontend/src/common/components/ImageUploaderButton.tsx @@ -0,0 +1,31 @@ +import { Heading } from '@chakra-ui/react'; +import { useContext } from 'react'; +import { FaUpload } from 'react-icons/fa'; +import { ImageUploaderTriggerContext } from '../../app/contexts/ImageUploaderTriggerContext'; + +type ImageUploaderButtonProps = { + styleClass?: string; +}; + +const ImageUploaderButton = (props: ImageUploaderButtonProps) => { + const { styleClass } = props; + const open = useContext(ImageUploaderTriggerContext); + + const handleClickUpload = () => { + open && open(); + }; + + return ( +
+
+ + Click or Drag and Drop +
+
+ ); +}; + +export default ImageUploaderButton; diff --git a/frontend/src/common/components/InvokeImageUploader.tsx b/frontend/src/common/components/InvokeImageUploader.tsx deleted file mode 100644 index 08f54420e3..0000000000 --- a/frontend/src/common/components/InvokeImageUploader.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { Button, useToast } from '@chakra-ui/react'; -import React, { useCallback } from 'react'; -import { FileRejection } from 'react-dropzone'; -import { useAppDispatch } from '../../app/store'; -import ImageUploader from '../../features/options/ImageUploader'; - -interface InvokeImageUploaderProps { - label?: string; - icon?: any; - onMouseOver?: any; - OnMouseout?: any; - dispatcher: any; - styleClass?: string; -} - -export default function InvokeImageUploader(props: InvokeImageUploaderProps) { - const { label, icon, dispatcher, styleClass, onMouseOver, OnMouseout } = - props; - - const toast = useToast(); - const dispatch = useAppDispatch(); - - // Callbacks to for handling file upload attempts - const fileAcceptedCallback = useCallback( - (file: File) => dispatch(dispatcher(file)), - [dispatch, dispatcher] - ); - - const fileRejectionCallback = useCallback( - (rejection: FileRejection) => { - const msg = rejection.errors.reduce( - (acc: string, cur: { message: string }) => acc + '\n' + cur.message, - '' - ); - - toast({ - title: 'Upload failed', - description: msg, - status: 'error', - isClosable: true, - }); - }, - [toast] - ); - - return ( - - - - ); -} diff --git a/frontend/src/common/components/radix-ui/IAISlider.scss b/frontend/src/common/components/radix-ui/IAISlider.scss new file mode 100644 index 0000000000..4a1418392e --- /dev/null +++ b/frontend/src/common/components/radix-ui/IAISlider.scss @@ -0,0 +1,62 @@ +.invokeai__slider-root { + position: relative; + display: flex; + align-items: center; + user-select: none; + touch-action: none; + width: 200px; + + &[data-orientation='horizontal'] { + height: 20px; + } + + &[data-orientation='vertical'] { + width: 20px; + height: 200px; + } + + .invokeai__slider-track { + background-color: black; + position: relative; + flex-grow: 1; + border-radius: 9999px; + + &[data-orientation='horizontal'] { + height: 0.25rem; + } + + &[data-orientation='vertical'] { + width: 0.25rem; + } + + .invokeai__slider-range { + position: absolute; + background-color: white; + border-radius: 9999px; + height: 100%; + } + } + + .invokeai__slider-thumb { + display: flex; + align-items: center; + + .invokeai__slider-thumb-div { + all: unset; + display: block; + width: 1rem; + height: 1rem; + background-color: white; + box-shadow: 0 2px 10px rgba(0, 2, 10, 0.3); + border-radius: 100%; + + &:hover { + background-color: violet; + } + + &:focus { + box-shadow: 0 0 0 5px rgba(0, 2, 10, 0.3); + } + } + } +} diff --git a/frontend/src/common/components/radix-ui/IAISlider.tsx b/frontend/src/common/components/radix-ui/IAISlider.tsx new file mode 100644 index 0000000000..7ad1a21df5 --- /dev/null +++ b/frontend/src/common/components/radix-ui/IAISlider.tsx @@ -0,0 +1,46 @@ +import { Tooltip } from '@chakra-ui/react'; +import * as Slider from '@radix-ui/react-slider'; +import React from 'react'; +import IAITooltip from './IAITooltip'; + +type IAISliderProps = Slider.SliderProps & { + value: number[]; + tooltipLabel?: string; + orientation?: 'horizontal' | 'vertial'; + trackProps?: Slider.SliderTrackProps; + rangeProps?: Slider.SliderRangeProps; + thumbProps?: Slider.SliderThumbProps; +}; + +const _IAISlider = (props: IAISliderProps) => { + const { + value, + tooltipLabel, + orientation, + trackProps, + rangeProps, + thumbProps, + ...rest + } = props; + return ( + + + + + + +
+ {/*}> + {value && value[0]} + */} + + + + ); +}; + +export default _IAISlider; diff --git a/frontend/src/common/components/radix-ui/IAITooltip.scss b/frontend/src/common/components/radix-ui/IAITooltip.scss new file mode 100644 index 0000000000..7d0ca8455c --- /dev/null +++ b/frontend/src/common/components/radix-ui/IAITooltip.scss @@ -0,0 +1,8 @@ +.invokeai__tooltip-content { + padding: 0.5rem; + background-color: grey; + border-radius: 0.25rem; + .invokeai__tooltip-arrow { + background-color: grey; + } +} diff --git a/frontend/src/common/components/radix-ui/IAITooltip.tsx b/frontend/src/common/components/radix-ui/IAITooltip.tsx new file mode 100644 index 0000000000..18fd908a93 --- /dev/null +++ b/frontend/src/common/components/radix-ui/IAITooltip.tsx @@ -0,0 +1,35 @@ +import * as Tooltip from '@radix-ui/react-tooltip'; +import { ReactNode } from 'react'; + +type IAITooltipProps = Tooltip.TooltipProps & { + trigger: ReactNode; + children: ReactNode; + triggerProps?: Tooltip.TooltipTriggerProps; + contentProps?: Tooltip.TooltipContentProps; + arrowProps?: Tooltip.TooltipArrowProps; +}; + +const IAITooltip = (props: IAITooltipProps) => { + const { trigger, children, triggerProps, contentProps, arrowProps, ...rest } = + props; + + return ( + + + {trigger} + + {e.preventDefault()}} + className="invokeai__tooltip-content" + > + + {children} + + + + + ); +}; + +export default IAITooltip; diff --git a/frontend/src/common/hooks/useCheckParameters.ts b/frontend/src/common/hooks/useCheckParameters.ts index 9629b4a9c2..5c23200442 100644 --- a/frontend/src/common/hooks/useCheckParameters.ts +++ b/frontend/src/common/hooks/useCheckParameters.ts @@ -1,65 +1,61 @@ import { createSelector } from '@reduxjs/toolkit'; -import { isEqual } from 'lodash'; +import _ from 'lodash'; import { useMemo } from 'react'; import { useAppSelector } from '../../app/store'; import { RootState } from '../../app/store'; import { OptionsState } from '../../features/options/optionsSlice'; import { SystemState } from '../../features/system/systemSlice'; +import { InpaintingState } from '../../features/tabs/Inpainting/inpaintingSlice'; +import { tabMap } from '../../features/tabs/InvokeTabs'; import { validateSeedWeights } from '../util/seedWeightPairs'; -export const optionsSelector = createSelector( - (state: RootState) => state.options, - (options: OptionsState) => { +export const useCheckParametersSelector = createSelector( + [ + (state: RootState) => state.options, + (state: RootState) => state.system, + (state: RootState) => state.inpainting, + ], + (options: OptionsState, system: SystemState, inpainting: InpaintingState) => { return { + // options prompt: options.prompt, shouldGenerateVariations: options.shouldGenerateVariations, seedWeights: options.seedWeights, maskPath: options.maskPath, - initialImagePath: options.initialImagePath, + initialImage: options.initialImage, seed: options.seed, - activeTab: options.activeTab, - }; - }, - { - memoizeOptions: { - resultEqualityCheck: isEqual, - }, - } -); - -export const systemSelector = createSelector( - (state: RootState) => state.system, - (system: SystemState) => { - return { + activeTabName: tabMap[options.activeTab], + // system isProcessing: system.isProcessing, isConnected: system.isConnected, + // inpainting + hasInpaintingImage: Boolean(inpainting.imageToInpaint), }; }, { memoizeOptions: { - resultEqualityCheck: isEqual, + resultEqualityCheck: _.isEqual, }, } ); - /** * Checks relevant pieces of state to confirm generation will not deterministically fail. * This is used to prevent the 'Generate' button from being clicked. */ const useCheckParameters = (): boolean => { - const { prompt } = useAppSelector(optionsSelector); - const { + prompt, shouldGenerateVariations, seedWeights, maskPath, - initialImagePath, + initialImage, seed, - activeTab, - } = useAppSelector(optionsSelector); - - const { isProcessing, isConnected } = useAppSelector(systemSelector); + activeTabName, + isProcessing, + isConnected, + hasInpaintingImage, + } = useAppSelector(useCheckParametersSelector); return useMemo(() => { // Cannot generate without a prompt @@ -67,12 +63,16 @@ const useCheckParameters = (): boolean => { return false; } - if (prompt && !initialImagePath && activeTab === 1) { + if (activeTabName === 'img2img' && !initialImage) { + return false; + } + + if (activeTabName === 'inpainting' && !hasInpaintingImage) { return false; } // Cannot generate with a mask without img2img - if (maskPath && !initialImagePath) { + if (maskPath && !initialImage) { return false; } @@ -100,13 +100,14 @@ const useCheckParameters = (): boolean => { }, [ prompt, maskPath, - initialImagePath, isProcessing, + initialImage, isConnected, shouldGenerateVariations, seedWeights, seed, - activeTab, + activeTabName, + hasInpaintingImage, ]); }; diff --git a/frontend/src/common/util/parameterTranslation.ts b/frontend/src/common/util/parameterTranslation.ts index 4b8a1aa4a9..d3d8e0c28c 100644 --- a/frontend/src/common/util/parameterTranslation.ts +++ b/frontend/src/common/util/parameterTranslation.ts @@ -1,22 +1,38 @@ -/* - These functions translate frontend state into parameters - suitable for consumption by the backend, and vice-versa. -*/ - import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from '../../app/constants'; import { OptionsState } from '../../features/options/optionsSlice'; import { SystemState } from '../../features/system/systemSlice'; -import { - seedWeightsToString, - stringToSeedWeightsArray, -} from './seedWeightPairs'; +import { stringToSeedWeightsArray } from './seedWeightPairs'; import randomInt from './randomInt'; +import { InvokeTabName } from '../../features/tabs/InvokeTabs'; +import { InpaintingState } from '../../features/tabs/Inpainting/inpaintingSlice'; +import generateMask from '../../features/tabs/Inpainting/util/generateMask'; +export type FrontendToBackendParametersConfig = { + generationMode: InvokeTabName; + optionsState: OptionsState; + inpaintingState: InpaintingState; + systemState: SystemState; + imageToProcessUrl?: string; + maskImageElement?: HTMLImageElement; +}; + +/** + * Translates/formats frontend state into parameters suitable + * for consumption by the API. + */ export const frontendToBackendParameters = ( - optionsState: OptionsState, - systemState: SystemState + config: FrontendToBackendParametersConfig ): { [key: string]: any } => { + const { + generationMode, + optionsState, + inpaintingState, + systemState, + imageToProcessUrl, + maskImageElement, + } = config; + const { prompt, iterations, @@ -30,10 +46,8 @@ export const frontendToBackendParameters = ( seed, seamless, hiresFix, - shouldUseInitImage, img2imgStrength, - initialImagePath, - maskPath, + initialImage, shouldFitToWidthHeight, shouldGenerateVariations, variationAmount, @@ -61,8 +75,6 @@ export const frontendToBackendParameters = ( width, sampler_name: sampler, seed, - seamless, - hires_fix: hiresFix, progress_images: shouldDisplayInProgress, }; @@ -70,13 +82,65 @@ export const frontendToBackendParameters = ( ? randomInt(NUMPY_RAND_MIN, NUMPY_RAND_MAX) : seed; - if (shouldUseInitImage) { - generationParameters.init_img = initialImagePath; + // parameters common to txt2img and img2img + if (['txt2img', 'img2img'].includes(generationMode)) { + generationParameters.seamless = seamless; + generationParameters.hires_fix = hiresFix; + } + + // img2img exclusive parameters + if (generationMode === 'img2img' && initialImage) { + generationParameters.init_img = + typeof initialImage === 'string' ? initialImage : initialImage.url; generationParameters.strength = img2imgStrength; generationParameters.fit = shouldFitToWidthHeight; - if (maskPath) { - generationParameters.init_mask = maskPath; + } + + // inpainting exclusive parameters + if (generationMode === 'inpainting' && maskImageElement) { + const { + lines, + boundingBoxCoordinate: { x, y }, + boundingBoxDimensions: { width, height }, + shouldShowBoundingBox, + inpaintReplace, + shouldUseInpaintReplace, + } = inpaintingState; + + let bx = x, + by = y, + bwidth = width, + bheight = height; + + if (!shouldShowBoundingBox) { + bx = 0; + by = 0; + bwidth = maskImageElement.width; + bheight = maskImageElement.height; } + + const boundingBox = { + x: bx, + y: by, + width: bwidth, + height: bheight, + }; + + if (shouldUseInpaintReplace) { + generationParameters.inpaint_replace = inpaintReplace; + } + + generationParameters.init_img = imageToProcessUrl; + generationParameters.strength = img2imgStrength; + generationParameters.fit = false; + + const maskDataURL = generateMask(maskImageElement, lines, boundingBox); + + generationParameters.init_mask = maskDataURL.split( + 'data:image/png;base64,' + )[1]; + + generationParameters.bounding_box = boundingBox; } if (shouldGenerateVariations) { @@ -105,7 +169,7 @@ export const frontendToBackendParameters = ( strength: facetoolStrength, }; if (facetoolType === 'codeformer') { - facetoolParameters.codeformer_fidelity = codeformerFidelity + facetoolParameters.codeformer_fidelity = codeformerFidelity; } } diff --git a/frontend/src/common/util/roundDownToMultiple.ts b/frontend/src/common/util/roundDownToMultiple.ts new file mode 100644 index 0000000000..850b235629 --- /dev/null +++ b/frontend/src/common/util/roundDownToMultiple.ts @@ -0,0 +1,7 @@ +export const roundDownToMultiple = (num: number, multiple: number): number => { + return Math.floor(num / multiple) * multiple; +}; + +export const roundToMultiple = (num: number, multiple: number): number => { + return Math.round(num / multiple) * multiple; +}; diff --git a/frontend/src/features/gallery/CurrentImageButtons.tsx b/frontend/src/features/gallery/CurrentImageButtons.tsx index 017d6dfdf3..7a6dc4e3fa 100644 --- a/frontend/src/features/gallery/CurrentImageButtons.tsx +++ b/frontend/src/features/gallery/CurrentImageButtons.tsx @@ -8,7 +8,7 @@ import { RootState } from '../../app/store'; import { setActiveTab, setAllParameters, - setInitialImagePath, + setInitialImage, setSeed, setShouldShowImageDetails, } from '../options/optionsSlice'; @@ -17,12 +17,21 @@ import { SystemState } from '../system/systemSlice'; import IAIButton from '../../common/components/IAIButton'; import { runESRGAN, runFacetool } from '../../app/socketio/actions'; import IAIIconButton from '../../common/components/IAIIconButton'; -import { MdDelete, MdFace, MdHd, MdImage, MdInfo } from 'react-icons/md'; +import { + MdDelete, + MdFace, + MdHd, + MdImage, + MdInfo, +} from 'react-icons/md'; import InvokePopover from './InvokePopover'; import UpscaleOptions from '../options/AdvancedOptions/Upscale/UpscaleOptions'; import FaceRestoreOptions from '../options/AdvancedOptions/FaceRestore/FaceRestoreOptions'; import { useHotkeys } from 'react-hotkeys-hook'; import { useToast } from '@chakra-ui/react'; +import { FaCopy, FaPaintBrush, FaSeedling } from 'react-icons/fa'; +import { setImageToInpaint } from '../tabs/Inpainting/inpaintingSlice'; +import { hoverableImageSelector } from './gallerySliceSelectors'; const systemSelector = createSelector( (state: RootState) => state.system, @@ -51,6 +60,7 @@ type CurrentImageButtonsProps = { */ const CurrentImageButtons = ({ image }: CurrentImageButtonsProps) => { const dispatch = useAppDispatch(); + const { activeTabName } = useAppSelector(hoverableImageSelector); const shouldShowImageDetails = useAppSelector( (state: RootState) => state.options.shouldShowImageDetails @@ -74,7 +84,7 @@ const CurrentImageButtons = ({ image }: CurrentImageButtonsProps) => { useAppSelector(systemSelector); const handleClickUseAsInitialImage = () => { - dispatch(setInitialImagePath(image.url)); + dispatch(setInitialImage(image)); dispatch(setActiveTab(1)); }; @@ -103,7 +113,8 @@ const CurrentImageButtons = ({ image }: CurrentImageButtonsProps) => { ); const handleClickUseAllParameters = () => - dispatch(setAllParameters(image.metadata)); + image.metadata && dispatch(setAllParameters(image.metadata)); + useHotkeys( 'a', () => { @@ -128,9 +139,8 @@ const CurrentImageButtons = ({ image }: CurrentImageButtonsProps) => { [image] ); - // Non-null assertion: this button is disabled if there is no seed. - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const handleClickUseSeed = () => dispatch(setSeed(image.metadata.image.seed)); + const handleClickUseSeed = () => + image.metadata && dispatch(setSeed(image.metadata.image.seed)); useHotkeys( 's', () => { @@ -221,6 +231,19 @@ const CurrentImageButtons = ({ image }: CurrentImageButtonsProps) => { const handleClickShowImageDetails = () => dispatch(setShouldShowImageDetails(!shouldShowImageDetails)); + const handleSendToInpainting = () => { + dispatch(setImageToInpaint(image)); + if (activeTabName !== 'inpainting') { + dispatch(setActiveTab('inpainting')); + } + toast({ + title: 'Sent to Inpainting', + status: 'success', + duration: 2500, + isClosable: true, + }); + }; + useHotkeys( 'i', () => { @@ -247,7 +270,32 @@ const CurrentImageButtons = ({ image }: CurrentImageButtonsProps) => { onClick={handleClickUseAsInitialImage} /> - } + tooltip="Send To Inpainting" + aria-label="Send To Inpainting" + onClick={handleSendToInpainting} + /> + + } + tooltip="Use All" + aria-label="Use All" + isDisabled={ + !['txt2img', 'img2img'].includes(image?.metadata?.image?.type) + } + onClick={handleClickUseAllParameters} + /> + + } + tooltip="Use Seed" + aria-label="Use Seed" + isDisabled={!image?.metadata?.image?.seed} + onClick={handleClickUseSeed} + /> + + {/* { label="Use Seed" isDisabled={!image?.metadata?.image?.seed} onClick={handleClickUseSeed} - /> + /> */} state.gallery, (state: RootState) => state.options], + (gallery: GalleryState, options: OptionsState) => { + const { currentImage, intermediateImage } = gallery; + const { activeTab, shouldShowImageDetails } = options; + + return { + currentImage, + intermediateImage, + activeTabName: tabMap[activeTab], + shouldShowImageDetails, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); /** * Displays the current image if there is one, plus associated actions. */ const CurrentImageDisplay = () => { - const { currentImage, intermediateImage } = useAppSelector( - (state: RootState) => state.gallery - ); - - const shouldShowImageDetails = useAppSelector( - (state: RootState) => state.options.shouldShowImageDetails - ); + const { + currentImage, + intermediateImage, + activeTabName, + } = useAppSelector(currentImageDisplaySelector); const imageToDisplay = intermediateImage || currentImage; - return imageToDisplay ? ( -
-
- -
- - {shouldShowImageDetails && ( - + return ( +
+ {imageToDisplay ? ( + <> + + + + ) : ( +
+ +
)}
- ) : ( -
- -
); }; diff --git a/frontend/src/features/gallery/CurrentImagePreview.tsx b/frontend/src/features/gallery/CurrentImagePreview.tsx index d71db0459b..e1342d59f7 100644 --- a/frontend/src/features/gallery/CurrentImagePreview.tsx +++ b/frontend/src/features/gallery/CurrentImagePreview.tsx @@ -1,23 +1,31 @@ import { IconButton, Image } from '@chakra-ui/react'; -import React, { useState } from 'react'; +import { useState } from 'react'; import { FaAngleLeft, FaAngleRight } from 'react-icons/fa'; import { RootState, useAppDispatch, useAppSelector } from '../../app/store'; import { GalleryState, selectNextImage, selectPrevImage } from './gallerySlice'; import * as InvokeAI from '../../app/invokeai'; import { createSelector } from '@reduxjs/toolkit'; import _ from 'lodash'; +import { OptionsState } from '../options/optionsSlice'; +import ImageMetadataViewer from './ImageMetaDataViewer/ImageMetadataViewer'; -const imagesSelector = createSelector( - (state: RootState) => state.gallery, - (gallery: GalleryState) => { - const currentImageIndex = gallery.images.findIndex( +export const imagesSelector = createSelector( + [(state: RootState) => state.gallery, (state: RootState) => state.options], + (gallery: GalleryState, options: OptionsState) => { + const { currentCategory } = gallery; + const { shouldShowImageDetails } = options; + + const tempImages = gallery.categories[currentCategory].images; + const currentImageIndex = tempImages.findIndex( (i) => i.uuid === gallery?.currentImage?.uuid ); - const imagesLength = gallery.images.length; + const imagesLength = tempImages.length; return { + currentCategory, isOnFirstImage: currentImageIndex === 0, isOnLastImage: !isNaN(currentImageIndex) && currentImageIndex === imagesLength - 1, + shouldShowImageDetails, }; }, { @@ -35,11 +43,12 @@ export default function CurrentImagePreview(props: CurrentImagePreviewProps) { const { imageToDisplay } = props; const dispatch = useAppDispatch(); - const { isOnFirstImage, isOnLastImage } = useAppSelector(imagesSelector); - - const shouldShowImageDetails = useAppSelector( - (state: RootState) => state.options.shouldShowImageDetails - ); + const { + isOnFirstImage, + isOnLastImage, + currentCategory, + shouldShowImageDetails, + } = useAppSelector(imagesSelector); const [shouldShowNextPrevButtons, setShouldShowNextPrevButtons] = useState(false); @@ -53,20 +62,19 @@ export default function CurrentImagePreview(props: CurrentImagePreviewProps) { }; const handleClickPrevButton = () => { - dispatch(selectPrevImage()); + dispatch(selectPrevImage(currentCategory)); }; const handleClickNextButton = () => { - dispatch(selectNextImage()); + dispatch(selectNextImage(currentCategory)); }; return ( -
+
{!shouldShowImageDetails && (
@@ -100,6 +108,12 @@ export default function CurrentImagePreview(props: CurrentImagePreviewProps) {
)} + {shouldShowImageDetails && ( + + )}
); } diff --git a/frontend/src/features/gallery/HoverableImage.scss b/frontend/src/features/gallery/HoverableImage.scss index cd4af05e60..b6563f4d7b 100644 --- a/frontend/src/features/gallery/HoverableImage.scss +++ b/frontend/src/features/gallery/HoverableImage.scss @@ -12,7 +12,6 @@ .hoverable-image-image { width: 100%; height: 100%; - object-fit: cover; max-width: 100%; max-height: 100%; } @@ -65,7 +64,7 @@ } .hoverable-image-context-menu { - z-index: 999; + z-index: 15; padding: 0.4rem; border-radius: 0.25rem; background-color: var(--context-menu-bg-color); diff --git a/frontend/src/features/gallery/HoverableImage.tsx b/frontend/src/features/gallery/HoverableImage.tsx index e38a129cfe..99f9edead8 100644 --- a/frontend/src/features/gallery/HoverableImage.tsx +++ b/frontend/src/features/gallery/HoverableImage.tsx @@ -6,8 +6,12 @@ import { Tooltip, useToast, } from '@chakra-ui/react'; -import { RootState, useAppDispatch, useAppSelector } from '../../app/store'; -import { setCurrentImage } from './gallerySlice'; +import { useAppDispatch, useAppSelector } from '../../app/store'; +import { + setCurrentImage, + setShouldHoldGalleryOpen, + setShouldShowGallery, +} from './gallerySlice'; import { FaCheck, FaTrashAlt } from 'react-icons/fa'; import DeleteImageModal from './DeleteImageModal'; import { memo, useState } from 'react'; @@ -15,13 +19,15 @@ import { setActiveTab, setAllImageToImageParameters, setAllTextToImageParameters, - setInitialImagePath, + setInitialImage, setPrompt, setSeed, } from '../options/optionsSlice'; import * as InvokeAI from '../../app/invokeai'; import * as ContextMenu from '@radix-ui/react-context-menu'; import { tabMap } from '../tabs/InvokeTabs'; +import { setImageToInpaint } from '../tabs/Inpainting/inpaintingSlice'; +import { hoverableImageSelector } from './gallerySliceSelectors'; interface HoverableImageProps { image: InvokeAI.Image; @@ -38,23 +44,21 @@ const memoEqualityCheck = ( */ const HoverableImage = memo((props: HoverableImageProps) => { const dispatch = useAppDispatch(); - const activeTab = useAppSelector( - (state: RootState) => state.options.activeTab - ); + const { activeTabName, galleryImageObjectFit, galleryImageMinimumWidth } = + useAppSelector(hoverableImageSelector); + const { image, isSelected } = props; + const { url, uuid, metadata } = image; const [isHovered, setIsHovered] = useState(false); const toast = useToast(); - const { image, isSelected } = props; - const { url, uuid, metadata } = image; - const handleMouseOver = () => setIsHovered(true); const handleMouseOut = () => setIsHovered(false); const handleUsePrompt = () => { - dispatch(setPrompt(image.metadata.image.prompt)); + image.metadata && dispatch(setPrompt(image.metadata.image.prompt)); toast({ title: 'Prompt Set', status: 'success', @@ -64,7 +68,7 @@ const HoverableImage = memo((props: HoverableImageProps) => { }; const handleUseSeed = () => { - dispatch(setSeed(image.metadata.image.seed)); + image.metadata && dispatch(setSeed(image.metadata.image.seed)); toast({ title: 'Seed Set', status: 'success', @@ -74,9 +78,9 @@ const HoverableImage = memo((props: HoverableImageProps) => { }; const handleSendToImageToImage = () => { - dispatch(setInitialImagePath(image.url)); - if (activeTab !== 1) { - dispatch(setActiveTab(1)); + dispatch(setInitialImage(image)); + if (activeTabName !== 'img2img') { + dispatch(setActiveTab('img2img')); } toast({ title: 'Sent to Image To Image', @@ -86,8 +90,21 @@ const HoverableImage = memo((props: HoverableImageProps) => { }); }; + const handleSendToInpainting = () => { + dispatch(setImageToInpaint(image)); + if (activeTabName !== 'inpainting') { + dispatch(setActiveTab('inpainting')); + } + toast({ + title: 'Sent to Inpainting', + status: 'success', + duration: 2500, + isClosable: true, + }); + }; + const handleUseAllParameters = () => { - dispatch(setAllTextToImageParameters(metadata)); + metadata && dispatch(setAllTextToImageParameters(metadata)); toast({ title: 'Parameters Set', status: 'success', @@ -124,7 +141,12 @@ const HoverableImage = memo((props: HoverableImageProps) => { const handleSelectImage = () => dispatch(setCurrentImage(image)); return ( - + { + dispatch(setShouldHoldGalleryOpen(open)); + dispatch(setShouldShowGallery(true)); + }} + > { > { /> )}
- {isHovered && ( + {isHovered && galleryImageMinimumWidth >= 64 && (
@@ -167,7 +189,10 @@ const HoverableImage = memo((props: HoverableImageProps) => { )} - + { Send to Image To Image + + Send to Inpainting + Delete Image diff --git a/frontend/src/features/gallery/ImageGallery.scss b/frontend/src/features/gallery/ImageGallery.scss index bc8f0b253c..3597836b27 100644 --- a/frontend/src/features/gallery/ImageGallery.scss +++ b/frontend/src/features/gallery/ImageGallery.scss @@ -1,64 +1,159 @@ @use '../../styles/Mixins/' as *; +.image-gallery-area-enter { + transform: translateX(150%); +} + +.image-gallery-area-enter-active { + transform: translateX(0); + transition: all 120ms ease-out; +} + +.image-gallery-area-exit { + transform: translateX(0); +} + +.image-gallery-area-exit-active { + transform: translateX(150%); + transition: all 120ms ease-out; +} + .image-gallery-area { - .image-gallery-popup-btn { - position: absolute; - top: 50%; - right: 1rem; - border-radius: 0.5rem 0 0 0.5rem; - padding: 0 0.5rem; - @include Button( - $btn-width: 1rem, - $btn-height: 6rem, - $icon-size: 20px, - $btn-color: var(--btn-grey), - $btn-color-hover: var(--btn-grey-hover) - ); + z-index: 10; + + &[data-pinned='false'] { + position: fixed; + height: 100vh; + top: 0; + right: 0; + + .image-gallery-popup { + border-radius: 0; + .image-gallery-container { + max-height: calc($app-height + 5rem); + } + } + } + + .image-gallery-popup { + background-color: var(--tab-color); + padding: 1rem; + display: flex; + flex-direction: column; + row-gap: 1rem; + border-radius: 0.5rem; + border-left-width: 0.3rem; + + border-color: var(--resizeable-handle-border-color); + + &[data-resize-alert='true'] { + border-color: var(--status-bad-color); + } + + .image-gallery-header { + display: flex; + align-items: center; + column-gap: 0.5rem; + justify-content: space-between; + + div { + display: flex; + column-gap: 0.5rem; + column-gap: 0.5rem; + } + + .image-gallery-icon-btn { + background-color: var(--btn-load-more) !important; + &:hover { + background-color: var(--btn-load-more-hover) !important; + } + } + + .image-gallery-settings-popover { + display: flex; + flex-direction: column; + row-gap: 0.5rem; + + div { + display: flex; + column-gap: 0.5rem; + align-items: center; + justify-content: space-between; + } + } + + h1 { + font-weight: bold; + } + } + + .image-gallery-container { + display: flex; + flex-direction: column; + max-height: $app-gallery-popover-height; + overflow-y: scroll; + @include HideScrollbar; + + .image-gallery-container-placeholder { + display: flex; + flex-direction: column; + background-color: var(--background-color-secondary); + border-radius: 0.5rem; + place-items: center; + padding: 2rem; + text-align: center; + + p { + color: var(--subtext-color-bright); + font-family: Inter; + } + + svg { + width: 5rem; + height: 5rem; + color: var(--svg-color); + } + } + + .image-gallery-load-more-btn { + background-color: var(--btn-load-more) !important; + font-size: 0.85rem !important; + padding: 0.5rem; + margin-top: 1rem; + + &:disabled { + &:hover { + background-color: var(--btn-load-more) !important; + } + } + + &:hover { + background-color: var(--btn-load-more-hover) !important; + } + } + } } } -.image-gallery-popup { - background-color: var(--tab-color); - padding: 1rem; - animation: slideOut 0.3s ease-out; - display: flex; - flex-direction: column; - row-gap: 1rem; - border-radius: 0.5rem; - border-left-width: 0.2rem; - min-width: 300px; - border-color: var(--gallery-resizeable-color); -} +.image-gallery-category-btn-group { + width: 100% !important; + column-gap: 0 !important; + justify-content: stretch !important; -.image-gallery-header { - display: flex; - align-items: center; - - h1 { - font-weight: bold; + button { + flex-grow: 1; + &[data-selected='true'] { + background-color: var(--accent-color); + &:hover { + background-color: var(--accent-color-hover); + } + } } } -.image-gallery-close-btn { - background-color: var(--btn-load-more) !important; - &:hover { - background-color: var(--btn-load-more-hover) !important; - } -} - -.image-gallery-container { - display: flex; - flex-direction: column; - gap: 1rem; - max-height: $app-gallery-popover-height; - overflow-y: scroll; - @include HideScrollbar; -} - // from https://css-tricks.com/a-grid-of-logos-in-squares/ .image-gallery { display: grid; - grid-template-columns: repeat(auto-fill, minmax(80px, auto)); grid-gap: 0.5rem; .hoverable-image { padding: 0.5rem; @@ -86,38 +181,3 @@ } } } - -.image-gallery-load-more-btn { - background-color: var(--btn-load-more) !important; - font-size: 0.85rem !important; - font-family: Inter; - - &:disabled { - &:hover { - background-color: var(--btn-load-more) !important; - } - } - - &:hover { - background-color: var(--btn-load-more-hover) !important; - } -} - -.image-gallery-container-placeholder { - display: flex; - background-color: var(--background-color-secondary); - border-radius: 0.5rem; - place-items: center; - padding: 2rem 0; - - p { - color: var(--subtext-color-bright); - font-family: Inter; - } - - svg { - width: 5rem; - height: 5rem; - color: var(--svg-color); - } -} diff --git a/frontend/src/features/gallery/ImageGallery.tsx b/frontend/src/features/gallery/ImageGallery.tsx index 434a861156..cc05070d53 100644 --- a/frontend/src/features/gallery/ImageGallery.tsx +++ b/frontend/src/features/gallery/ImageGallery.tsx @@ -1,47 +1,146 @@ -import { Button, IconButton } from '@chakra-ui/button'; -import { Resizable } from 're-resizable'; +import { Button } from '@chakra-ui/button'; +import { NumberSize, Resizable, Size } from 're-resizable'; -import React from 'react'; +import { ChangeEvent, useEffect, useRef, useState } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; import { MdClear, MdPhotoLibrary } from 'react-icons/md'; +import { BsPinAngleFill } from 'react-icons/bs'; import { requestImages } from '../../app/socketio/actions'; -import { RootState, useAppDispatch, useAppSelector } from '../../app/store'; +import { useAppDispatch, useAppSelector } from '../../app/store'; import IAIIconButton from '../../common/components/IAIIconButton'; -import { selectNextImage, selectPrevImage } from './gallerySlice'; +import { + selectNextImage, + selectPrevImage, + setCurrentCategory, + setGalleryImageMinimumWidth, + setGalleryImageObjectFit, + setGalleryScrollPosition, + setGalleryWidth, + setShouldAutoSwitchToNewImages, + setShouldHoldGalleryOpen, + setShouldPinGallery, +} from './gallerySlice'; import HoverableImage from './HoverableImage'; -import { setShouldShowGallery } from '../options/optionsSlice'; +import { setShouldShowGallery } from '../gallery/gallerySlice'; +import { ButtonGroup, useToast } from '@chakra-ui/react'; +import { CSSTransition } from 'react-transition-group'; +import { Direction } from 're-resizable/lib/resizer'; +import { imageGallerySelector } from './gallerySliceSelectors'; +import { FaImage, FaUser, FaWrench } from 'react-icons/fa'; +import IAIPopover from '../../common/components/IAIPopover'; +import IAISlider from '../../common/components/IAISlider'; +import { BiReset } from 'react-icons/bi'; +import IAICheckbox from '../../common/components/IAICheckbox'; +import { setNeedsCache } from '../tabs/Inpainting/inpaintingSlice'; +import _ from 'lodash'; + +const GALLERY_SHOW_BUTTONS_MIN_WIDTH = 320; export default function ImageGallery() { - const { images, currentImageUuid, areMoreImagesAvailable } = useAppSelector( - (state: RootState) => state.gallery - ); - - const shouldShowGallery = useAppSelector( - (state: RootState) => state.options.shouldShowGallery - ); - - const activeTab = useAppSelector( - (state: RootState) => state.options.activeTab - ); - const dispatch = useAppDispatch(); + const toast = useToast(); - const handleShowGalleryToggle = () => { - dispatch(setShouldShowGallery(!shouldShowGallery)); + const { + images, + currentCategory, + currentImageUuid, + shouldPinGallery, + shouldShowGallery, + galleryScrollPosition, + galleryImageMinimumWidth, + galleryGridTemplateColumns, + activeTabName, + galleryImageObjectFit, + shouldHoldGalleryOpen, + shouldAutoSwitchToNewImages, + areMoreImagesAvailable, + galleryWidth, + } = useAppSelector(imageGallerySelector); + + const [galleryMinWidth, setGalleryMinWidth] = useState(300); + const [galleryMaxWidth, setGalleryMaxWidth] = useState(590); + + const [shouldShowButtons, setShouldShowButtons] = useState( + galleryWidth >= GALLERY_SHOW_BUTTONS_MIN_WIDTH + ); + + useEffect(() => { + if (!shouldPinGallery) return; + + if (activeTabName === 'inpainting') { + dispatch(setGalleryWidth(220)); + setGalleryMinWidth(220); + setGalleryMaxWidth(220); + } else if (activeTabName === 'img2img') { + dispatch( + setGalleryWidth(Math.min(Math.max(Number(galleryWidth), 0), 490)) + ); + setGalleryMaxWidth(490); + } else { + dispatch( + setGalleryWidth(Math.min(Math.max(Number(galleryWidth), 0), 590)) + ); + setGalleryMaxWidth(590); + } + dispatch(setNeedsCache(true)); + }, [dispatch, activeTabName, shouldPinGallery, galleryWidth]); + + useEffect(() => { + if (!shouldPinGallery) { + setGalleryMaxWidth(window.innerWidth); + } + }, [shouldPinGallery]); + + const galleryRef = useRef(null); + const galleryContainerRef = useRef(null); + const timeoutIdRef = useRef(null); + + const handleSetShouldPinGallery = () => { + dispatch(setNeedsCache(true)); + dispatch(setShouldPinGallery(!shouldPinGallery)); }; - const handleGalleryClose = () => { + const handleToggleGallery = () => { + shouldShowGallery ? handleCloseGallery() : handleOpenGallery(); + }; + + const handleOpenGallery = () => { + dispatch(setShouldShowGallery(true)); + dispatch(setNeedsCache(true)); + }; + + const handleCloseGallery = () => { + dispatch( + setGalleryScrollPosition( + galleryContainerRef.current ? galleryContainerRef.current.scrollTop : 0 + ) + ); dispatch(setShouldShowGallery(false)); + dispatch(setShouldHoldGalleryOpen(false)); + dispatch(setNeedsCache(true)); }; const handleClickLoadMore = () => { - dispatch(requestImages()); + dispatch(requestImages(currentCategory)); + }; + + const handleChangeGalleryImageMinimumWidth = (v: number) => { + dispatch(setGalleryImageMinimumWidth(v)); + dispatch(setNeedsCache(true)); + }; + + const setCloseGalleryTimer = () => { + timeoutIdRef.current = window.setTimeout(() => handleCloseGallery(), 500); + }; + + const cancelCloseGalleryTimer = () => { + timeoutIdRef.current && window.clearTimeout(timeoutIdRef.current); }; useHotkeys( 'g', () => { - handleShowGalleryToggle(); + handleToggleGallery(); }, [shouldShowGallery] ); @@ -49,81 +148,353 @@ export default function ImageGallery() { useHotkeys( 'left', () => { - dispatch(selectPrevImage()); + dispatch(selectPrevImage(currentCategory)); }, - [] + [currentCategory] ); useHotkeys( 'right', () => { - dispatch(selectNextImage()); + dispatch(selectNextImage(currentCategory)); }, - [] + [currentCategory] ); - return ( -
- {!shouldShowGallery && ( - - - - )} + useHotkeys( + 'shift+p', + () => { + handleSetShouldPinGallery(); + }, + [shouldPinGallery] + ); - {shouldShowGallery && ( + const IMAGE_SIZE_STEP = 32; + + useHotkeys( + 'shift+up', + () => { + if (galleryImageMinimumWidth >= 256) { + return; + } + if (galleryImageMinimumWidth < 256) { + const newMinWidth = galleryImageMinimumWidth + IMAGE_SIZE_STEP; + if (newMinWidth <= 256) { + dispatch(setGalleryImageMinimumWidth(newMinWidth)); + toast({ + title: `Gallery Thumbnail Size set to ${newMinWidth}`, + status: 'success', + duration: 1000, + isClosable: true, + }); + } else { + dispatch(setGalleryImageMinimumWidth(256)); + toast({ + title: `Gallery Thumbnail Size set to 256`, + status: 'success', + duration: 1000, + isClosable: true, + }); + } + } + }, + [galleryImageMinimumWidth] + ); + + useHotkeys( + 'shift+down', + () => { + if (galleryImageMinimumWidth <= 32) { + return; + } + if (galleryImageMinimumWidth > 32) { + const newMinWidth = galleryImageMinimumWidth - IMAGE_SIZE_STEP; + if (newMinWidth > 32) { + dispatch(setGalleryImageMinimumWidth(newMinWidth)); + toast({ + title: `Gallery Thumbnail Size set to ${newMinWidth}`, + status: 'success', + duration: 1000, + isClosable: true, + }); + } else { + dispatch(setGalleryImageMinimumWidth(32)); + toast({ + title: `Gallery Thumbnail Size set to 32`, + status: 'success', + duration: 1000, + isClosable: true, + }); + } + } + }, + [galleryImageMinimumWidth] + ); + + useHotkeys( + 'shift+r', + () => { + dispatch(setGalleryImageMinimumWidth(64)); + toast({ + title: `Reset Gallery Image Size`, + status: 'success', + duration: 2500, + isClosable: true, + }); + }, + [galleryImageMinimumWidth] + ); + + // set gallery scroll position + useEffect(() => { + if (!galleryContainerRef.current) return; + galleryContainerRef.current.scrollTop = galleryScrollPosition; + }, [galleryScrollPosition, shouldShowGallery]); + + return ( + +
{ + dispatch( + setGalleryWidth( + _.clamp( + Number(galleryWidth) + delta.width, + 0, + Number(galleryMaxWidth) + ) + ) + ); + elementRef.removeAttribute('data-resize-alert'); + }} + onResize={( + _event: MouseEvent | TouchEvent, + _direction: Direction, + elementRef: HTMLElement, + delta: NumberSize + ) => { + const newWidth = _.clamp( + Number(galleryWidth) + delta.width, + 0, + Number(galleryMaxWidth) + ); + + if (newWidth >= 320 && !shouldShowButtons) { + setShouldShowButtons(true); + } else if (newWidth < 320 && shouldShowButtons) { + setShouldShowButtons(false); + } + + if (newWidth >= galleryMaxWidth) { + elementRef.setAttribute('data-resize-alert', 'true'); + } else { + elementRef.removeAttribute('data-resize-alert'); + } + }} >
-

Your Invocations

- } - /> -
-
- {images.length ? ( -
- {images.map((image) => { - const { uuid } = image; - const isSelected = currentImageUuid === uuid; - return ( - + + {shouldShowButtons ? ( + <> + + + + ) : ( + <> + } + onClick={() => dispatch(setCurrentCategory('result'))} /> - ); - })} -
+ } + onClick={() => dispatch(setCurrentCategory('user'))} + /> + + )} + +
+
+ } + className="image-gallery-icon-btn" + cursor={'pointer'} + /> + } + > +
+
+ + dispatch(setGalleryImageMinimumWidth(64))} + icon={} + data-selected={shouldPinGallery} + styleClass="image-gallery-icon-btn" + /> +
+
+ + dispatch( + setGalleryImageObjectFit( + galleryImageObjectFit === 'contain' + ? 'cover' + : 'contain' + ) + ) + } + /> +
+
+ ) => + dispatch( + setShouldAutoSwitchToNewImages(e.target.checked) + ) + } + /> +
+
+
+ + } + data-selected={shouldPinGallery} + /> + + } + /> +
+
+
+ {images.length || areMoreImagesAvailable ? ( + <> +
+ {images.map((image) => { + const { uuid } = image; + const isSelected = currentImageUuid === uuid; + return ( + + ); + })} +
+ + ) : (

No Images In Gallery

)} -
- )} -
+
+ ); } diff --git a/frontend/src/features/gallery/ImageGalleryOld.tsx b/frontend/src/features/gallery/ImageGalleryOld.tsx deleted file mode 100644 index 2d897a7bf5..0000000000 --- a/frontend/src/features/gallery/ImageGalleryOld.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import { - Button, - Drawer, - DrawerBody, - DrawerCloseButton, - DrawerContent, - DrawerHeader, - useDisclosure, -} from '@chakra-ui/react'; -import React from 'react'; -import { useHotkeys } from 'react-hotkeys-hook'; -import { MdPhotoLibrary } from 'react-icons/md'; -import { requestImages } from '../../app/socketio/actions'; -import { RootState, useAppDispatch } from '../../app/store'; -import { useAppSelector } from '../../app/store'; -import { selectNextImage, selectPrevImage } from './gallerySlice'; -import HoverableImage from './HoverableImage'; - -/** - * Simple image gallery. - */ -const ImageGalleryOld = () => { - const { images, currentImageUuid, areMoreImagesAvailable } = useAppSelector( - (state: RootState) => state.gallery - ); - const dispatch = useAppDispatch(); - - const { isOpen, onOpen, onClose } = useDisclosure(); - - /** - * I don't like that this needs to rerender whenever the current image is changed. - * What if we have a large number of images? I suppose pagination (planned) will - * mitigate this issue. - * - * TODO: Refactor if performance complaints, or after migrating to new API which supports pagination. - */ - - const handleClickLoadMore = () => { - dispatch(requestImages()); - }; - - useHotkeys( - 'g', - () => { - if (isOpen) { - onClose(); - } else { - onOpen(); - } - }, - [isOpen] - ); - - useHotkeys( - 'left', - () => { - dispatch(selectPrevImage()); - }, - [] - ); - - useHotkeys( - 'right', - () => { - dispatch(selectNextImage()); - }, - [] - ); - - return ( -
- - - -
- Your Invocations - -
- -
- {images.length ? ( -
- {images.map((image) => { - const { uuid } = image; - const isSelected = currentImageUuid === uuid; - return ( - - ); - })} -
- ) : ( -
- -

No Images In Gallery

-
- )} - -
-
-
-
-
- ); -}; - -export default ImageGalleryOld; diff --git a/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.scss b/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.scss index e5c33672ae..ba5e660682 100644 --- a/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.scss +++ b/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.scss @@ -1,12 +1,15 @@ @use '../../../styles/Mixins/' as *; .image-metadata-viewer { + position: absolute; + top: 0; width: 100%; border-radius: 0.5rem; padding: 1rem; background-color: var(--metadata-bg-color); overflow: scroll; max-height: $app-metadata-height; + height: 100%; z-index: 10; } diff --git a/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.tsx b/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.tsx index 0c2cc12942..080541419e 100644 --- a/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.tsx +++ b/frontend/src/features/gallery/ImageMetaDataViewer/ImageMetadataViewer.tsx @@ -20,7 +20,6 @@ import { setHeight, setHiresFix, setImg2imgStrength, - setInitialImagePath, setMaskPath, setPrompt, setSampler, @@ -32,6 +31,7 @@ import { setUpscalingLevel, setUpscalingStrength, setWidth, + setInitialImage, } from '../../options/optionsSlice'; import promptToString from '../../../common/util/promptToString'; import { seedWeightsToString } from '../../../common/util/seedWeightPairs'; @@ -248,7 +248,7 @@ const ImageMetadataViewer = memo( label="Initial image" value={init_image_path} isLink - onClick={() => dispatch(setInitialImagePath(init_image_path))} + onClick={() => dispatch(setInitialImage(init_image_path))} /> )} {mask_image_path && ( diff --git a/frontend/src/features/gallery/ShowHideGalleryButton.scss b/frontend/src/features/gallery/ShowHideGalleryButton.scss new file mode 100644 index 0000000000..83a698e559 --- /dev/null +++ b/frontend/src/features/gallery/ShowHideGalleryButton.scss @@ -0,0 +1,20 @@ +@use '../../styles/Mixins/' as *; + +.show-hide-gallery-button { + position: absolute !important; + top: 50%; + right: -1rem; + transform: translate(0, -50%); + z-index: 10; + + border-radius: 0.5rem 0 0 0.5rem !important; + padding: 0 0.5rem; + + @include Button( + $btn-width: 1rem, + $btn-height: 12rem, + $icon-size: 20px, + $btn-color: var(--btn-grey), + $btn-color-hover: var(--btn-grey-hover) + ); +} diff --git a/frontend/src/features/gallery/ShowHideGalleryButton.tsx b/frontend/src/features/gallery/ShowHideGalleryButton.tsx new file mode 100644 index 0000000000..a3d8cac0b1 --- /dev/null +++ b/frontend/src/features/gallery/ShowHideGalleryButton.tsx @@ -0,0 +1,57 @@ +import { useHotkeys } from 'react-hotkeys-hook'; +import { MdPhotoLibrary } from 'react-icons/md'; +import { RootState, useAppDispatch, useAppSelector } from '../../app/store'; +import IAIIconButton from '../../common/components/IAIIconButton'; +import { setShouldShowGallery } from '../gallery/gallerySlice'; +import { selectNextImage, selectPrevImage } from './gallerySlice'; + +const ShowHideGalleryButton = () => { + const dispatch = useAppDispatch(); + + const { shouldPinGallery, shouldShowGallery } = useAppSelector( + (state: RootState) => state.gallery + ); + + const handleShowGalleryToggle = () => { + dispatch(setShouldShowGallery(!shouldShowGallery)); + }; + + // useHotkeys( + // 'g', + // () => { + // handleShowGalleryToggle(); + // }, + // [shouldShowGallery] + // ); + + // useHotkeys( + // 'left', + // () => { + // dispatch(selectPrevImage()); + // }, + // [] + // ); + + // useHotkeys( + // 'right', + // () => { + // dispatch(selectNextImage()); + // }, + // [] + // ); + + return ( + + + + ); +}; + +export default ShowHideGalleryButton; diff --git a/frontend/src/features/gallery/gallerySlice.ts b/frontend/src/features/gallery/gallerySlice.ts index cc9341fd81..fb646daa94 100644 --- a/frontend/src/features/gallery/gallerySlice.ts +++ b/frontend/src/features/gallery/gallerySlice.ts @@ -3,20 +3,67 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import _, { clamp } from 'lodash'; import * as InvokeAI from '../../app/invokeai'; +export type GalleryCategory = 'user' | 'result'; + +export type AddImagesPayload = { + images: Array; + areMoreImagesAvailable: boolean; + category: GalleryCategory; +}; + +type GalleryImageObjectFitType = 'contain' | 'cover'; + +export type Gallery = { + images: InvokeAI.Image[]; + latest_mtime?: number; + earliest_mtime?: number; + areMoreImagesAvailable: boolean; +}; + export interface GalleryState { currentImage?: InvokeAI.Image; currentImageUuid: string; - images: Array; intermediateImage?: InvokeAI.Image; - areMoreImagesAvailable: boolean; - latest_mtime?: number; - earliest_mtime?: number; + shouldPinGallery: boolean; + shouldShowGallery: boolean; + galleryScrollPosition: number; + galleryImageMinimumWidth: number; + galleryImageObjectFit: GalleryImageObjectFitType; + shouldHoldGalleryOpen: boolean; + shouldAutoSwitchToNewImages: boolean; + categories: { + user: Gallery; + result: Gallery; + }; + currentCategory: GalleryCategory; + galleryWidth: number; } const initialState: GalleryState = { currentImageUuid: '', - images: [], - areMoreImagesAvailable: true, + shouldPinGallery: true, + shouldShowGallery: true, + galleryScrollPosition: 0, + galleryImageMinimumWidth: 64, + galleryImageObjectFit: 'cover', + shouldHoldGalleryOpen: false, + shouldAutoSwitchToNewImages: true, + currentCategory: 'result', + categories: { + user: { + images: [], + latest_mtime: undefined, + earliest_mtime: undefined, + areMoreImagesAvailable: true, + }, + result: { + images: [], + latest_mtime: undefined, + earliest_mtime: undefined, + areMoreImagesAvailable: true, + }, + }, + galleryWidth: 300, }; export const gallerySlice = createSlice({ @@ -27,10 +74,15 @@ export const gallerySlice = createSlice({ state.currentImage = action.payload; state.currentImageUuid = action.payload.uuid; }, - removeImage: (state, action: PayloadAction) => { - const uuid = action.payload; + removeImage: ( + state, + action: PayloadAction + ) => { + const { uuid, category } = action.payload; - const newImages = state.images.filter((image) => image.uuid !== uuid); + const tempImages = state.categories[category as GalleryCategory].images; + + const newImages = tempImages.filter((image) => image.uuid !== uuid); if (uuid === state.currentImageUuid) { /** @@ -42,7 +94,7 @@ export const gallerySlice = createSlice({ * * Get the currently selected image's index. */ - const imageToDeleteIndex = state.images.findIndex( + const imageToDeleteIndex = tempImages.findIndex( (image) => image.uuid === uuid ); @@ -68,22 +120,35 @@ export const gallerySlice = createSlice({ : ''; } - state.images = newImages; + state.categories[category as GalleryCategory].images = newImages; }, - addImage: (state, action: PayloadAction) => { - const newImage = action.payload; + addImage: ( + state, + action: PayloadAction<{ + image: InvokeAI.Image; + category: GalleryCategory; + }> + ) => { + const { image: newImage, category } = action.payload; const { uuid, url, mtime } = newImage; + const tempCategory = state.categories[category as GalleryCategory]; + // Do not add duplicate images - if (state.images.find((i) => i.url === url && i.mtime === mtime)) { + if (tempCategory.images.find((i) => i.url === url && i.mtime === mtime)) { return; } - state.images.unshift(newImage); - state.currentImageUuid = uuid; + tempCategory.images.unshift(newImage); + if (state.shouldAutoSwitchToNewImages) { + state.currentImageUuid = uuid; + state.currentImage = newImage; + if (category === 'result') { + state.currentCategory = 'result'; + } + } state.intermediateImage = undefined; - state.currentImage = newImage; - state.latest_mtime = mtime; + tempCategory.latest_mtime = mtime; }, setIntermediateImage: (state, action: PayloadAction) => { state.intermediateImage = action.payload; @@ -91,49 +156,53 @@ export const gallerySlice = createSlice({ clearIntermediateImage: (state) => { state.intermediateImage = undefined; }, - selectNextImage: (state) => { - const { images, currentImage } = state; + selectNextImage: (state, action: PayloadAction) => { + const category = action.payload; + const { currentImage } = state; + const tempImages = state.categories[category].images; + if (currentImage) { - const currentImageIndex = images.findIndex( + const currentImageIndex = tempImages.findIndex( (i) => i.uuid === currentImage.uuid ); - if (_.inRange(currentImageIndex, 0, images.length)) { - const newCurrentImage = images[currentImageIndex + 1]; + if (_.inRange(currentImageIndex, 0, tempImages.length)) { + const newCurrentImage = tempImages[currentImageIndex + 1]; state.currentImage = newCurrentImage; state.currentImageUuid = newCurrentImage.uuid; } } }, - selectPrevImage: (state) => { - const { images, currentImage } = state; + selectPrevImage: (state, action: PayloadAction) => { + const category = action.payload; + const { currentImage } = state; + const tempImages = state.categories[category].images; + if (currentImage) { - const currentImageIndex = images.findIndex( + const currentImageIndex = tempImages.findIndex( (i) => i.uuid === currentImage.uuid ); - if (_.inRange(currentImageIndex, 1, images.length + 1)) { - const newCurrentImage = images[currentImageIndex - 1]; + if (_.inRange(currentImageIndex, 1, tempImages.length + 1)) { + const newCurrentImage = tempImages[currentImageIndex - 1]; state.currentImage = newCurrentImage; state.currentImageUuid = newCurrentImage.uuid; } } }, - addGalleryImages: ( - state, - action: PayloadAction<{ - images: Array; - areMoreImagesAvailable: boolean; - }> - ) => { - const { images, areMoreImagesAvailable } = action.payload; + addGalleryImages: (state, action: PayloadAction) => { + const { images, areMoreImagesAvailable, category } = action.payload; + const tempImages = state.categories[category].images; + + // const prevImages = category === 'user' ? state.userImages : state.resultImages + if (images.length > 0) { // Filter images that already exist in the gallery const newImages = images.filter( (newImage) => - !state.images.find( + !tempImages.find( (i) => i.url === newImage.url && i.mtime === newImage.mtime ) ); - state.images = state.images + state.categories[category].images = tempImages .concat(newImages) .sort((a, b) => b.mtime - a.mtime); @@ -144,13 +213,46 @@ export const gallerySlice = createSlice({ } // keep track of the timestamps of latest and earliest images received - state.latest_mtime = images[0].mtime; - state.earliest_mtime = images[images.length - 1].mtime; + state.categories[category].latest_mtime = images[0].mtime; + state.categories[category].earliest_mtime = + images[images.length - 1].mtime; } + if (areMoreImagesAvailable !== undefined) { - state.areMoreImagesAvailable = areMoreImagesAvailable; + state.categories[category].areMoreImagesAvailable = + areMoreImagesAvailable; } }, + setShouldPinGallery: (state, action: PayloadAction) => { + state.shouldPinGallery = action.payload; + }, + setShouldShowGallery: (state, action: PayloadAction) => { + state.shouldShowGallery = action.payload; + }, + setGalleryScrollPosition: (state, action: PayloadAction) => { + state.galleryScrollPosition = action.payload; + }, + setGalleryImageMinimumWidth: (state, action: PayloadAction) => { + state.galleryImageMinimumWidth = action.payload; + }, + setGalleryImageObjectFit: ( + state, + action: PayloadAction + ) => { + state.galleryImageObjectFit = action.payload; + }, + setShouldHoldGalleryOpen: (state, action: PayloadAction) => { + state.shouldHoldGalleryOpen = action.payload; + }, + setShouldAutoSwitchToNewImages: (state, action: PayloadAction) => { + state.shouldAutoSwitchToNewImages = action.payload; + }, + setCurrentCategory: (state, action: PayloadAction) => { + state.currentCategory = action.payload; + }, + setGalleryWidth: (state, action: PayloadAction) => { + state.galleryWidth = action.payload; + }, }, }); @@ -163,6 +265,15 @@ export const { setIntermediateImage, selectNextImage, selectPrevImage, + setShouldPinGallery, + setShouldShowGallery, + setGalleryScrollPosition, + setGalleryImageMinimumWidth, + setGalleryImageObjectFit, + setShouldHoldGalleryOpen, + setShouldAutoSwitchToNewImages, + setCurrentCategory, + setGalleryWidth, } = gallerySlice.actions; export default gallerySlice.reducer; diff --git a/frontend/src/features/gallery/gallerySliceSelectors.ts b/frontend/src/features/gallery/gallerySliceSelectors.ts new file mode 100644 index 0000000000..750d71e922 --- /dev/null +++ b/frontend/src/features/gallery/gallerySliceSelectors.ts @@ -0,0 +1,55 @@ +import { createSelector } from '@reduxjs/toolkit'; +import { RootState } from '../../app/store'; +import { OptionsState } from '../options/optionsSlice'; +import { tabMap } from '../tabs/InvokeTabs'; +import { GalleryState } from './gallerySlice'; + +export const imageGallerySelector = createSelector( + [(state: RootState) => state.gallery, (state: RootState) => state.options], + (gallery: GalleryState, options: OptionsState) => { + const { + categories, + currentCategory, + currentImageUuid, + shouldPinGallery, + shouldShowGallery, + galleryScrollPosition, + galleryImageMinimumWidth, + galleryImageObjectFit, + shouldHoldGalleryOpen, + shouldAutoSwitchToNewImages, + galleryWidth, + } = gallery; + + const { activeTab } = options; + + return { + currentImageUuid, + shouldPinGallery, + shouldShowGallery, + galleryScrollPosition, + galleryImageMinimumWidth, + galleryImageObjectFit, + galleryGridTemplateColumns: `repeat(auto-fill, minmax(${galleryImageMinimumWidth}px, auto))`, + activeTabName: tabMap[activeTab], + shouldHoldGalleryOpen, + shouldAutoSwitchToNewImages, + images: categories[currentCategory].images, + areMoreImagesAvailable: + categories[currentCategory].areMoreImagesAvailable, + currentCategory, + galleryWidth, + }; + } +); + +export const hoverableImageSelector = createSelector( + [(state: RootState) => state.options, (state: RootState) => state.gallery], + (options: OptionsState, gallery: GalleryState) => { + return { + galleryImageObjectFit: gallery.galleryImageObjectFit, + galleryImageMinimumWidth: gallery.galleryImageMinimumWidth, + activeTabName: tabMap[options.activeTab], + }; + } +); diff --git a/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestore.tsx b/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestoreHeader.tsx similarity index 95% rename from frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestore.tsx rename to frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestoreHeader.tsx index 9bca8dbe74..0efe400d22 100644 --- a/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestore.tsx +++ b/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestoreHeader.tsx @@ -8,7 +8,7 @@ import { import IAISwitch from '../../../../common/components/IAISwitch'; import { setShouldRunFacetool } from '../../optionsSlice'; -export default function FaceRestore() { +export default function FaceRestoreHeader() { const isGFPGANAvailable = useAppSelector( (state: RootState) => state.system.isGFPGANAvailable ); diff --git a/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageAccordion.tsx b/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageAccordion.tsx deleted file mode 100644 index 50edc235c4..0000000000 --- a/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageAccordion.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Flex } from '@chakra-ui/layout'; -import React, { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from '../../../../app/store'; -import IAISwitch from '../../../../common/components/IAISwitch'; -import { setShouldUseInitImage } from '../../optionsSlice'; - -export default function ImageToImageAccordion() { - const dispatch = useAppDispatch(); - - const initialImagePath = useAppSelector( - (state: RootState) => state.options.initialImagePath - ); - - const shouldUseInitImage = useAppSelector( - (state: RootState) => state.options.shouldUseInitImage - ); - - const handleChangeShouldUseInitImage = (e: ChangeEvent) => - dispatch(setShouldUseInitImage(e.target.checked)); - return ( - -

Image to Image

- -
- ); -} diff --git a/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageOptions.tsx b/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageOptions.tsx deleted file mode 100644 index e0173cad8d..0000000000 --- a/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageOptions.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Flex } from '@chakra-ui/react'; -import InitAndMaskImage from '../../InitAndMaskImage'; -import ImageFit from './ImageFit'; -import ImageToImageStrength from './ImageToImageStrength'; - -/** - * Options for img2img generation (strength, fit, init/mask upload). - */ -const ImageToImageOptions = () => { - return ( - - - - - - ); -}; - -export default ImageToImageOptions; diff --git a/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx b/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx index e5b895116c..ea916c5460 100644 --- a/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx +++ b/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx @@ -30,7 +30,7 @@ export default function ImageToImageStrength(props: ImageToImageStrengthProps) { max={0.99} onChange={handleChangeStrength} value={img2imgStrength} - width="90px" + width="100%" isInteger={false} styleClass={styleClass} /> diff --git a/frontend/src/features/options/AdvancedOptions/Inpainting/BoundingBoxSettings.scss b/frontend/src/features/options/AdvancedOptions/Inpainting/BoundingBoxSettings.scss new file mode 100644 index 0000000000..3233c4a591 --- /dev/null +++ b/frontend/src/features/options/AdvancedOptions/Inpainting/BoundingBoxSettings.scss @@ -0,0 +1,43 @@ +.inpainting-bounding-box-settings { + display: flex; + flex-direction: column; + border-radius: 0.4rem; + border: 2px solid var(--tab-color); +} + +.inpainting-bounding-box-header { + background-color: var(--tab-color); + display: flex; + flex-direction: row; + justify-content: space-between; + padding: 0.5rem 1rem; + border-radius: 0.4rem 0.4rem 0 0; + + p { + font-weight: bold; + } +} + +.inpainting-bounding-box-settings-items { + padding: 1rem; + display: flex; + flex-direction: column; + row-gap: 1rem; + + .inpainting-bounding-box-reset-icon-btn { + background-color: var(--btn-load-more) !important; + &:hover { + background-color: var(--btn-load-more-hover) !important; + } + } +} + +.inpainting-bounding-box-dimensions-slider-numberinput { + display: grid; + grid-template-columns: repeat(3, auto); + column-gap: 1rem; +} + +.inpainting-bounding-box-darken { + width: max-content; +} diff --git a/frontend/src/features/options/AdvancedOptions/Inpainting/BoundingBoxSettings.tsx b/frontend/src/features/options/AdvancedOptions/Inpainting/BoundingBoxSettings.tsx new file mode 100644 index 0000000000..94dffc7ba6 --- /dev/null +++ b/frontend/src/features/options/AdvancedOptions/Inpainting/BoundingBoxSettings.tsx @@ -0,0 +1,202 @@ +import { Flex } from '@chakra-ui/react'; +import { createSelector } from '@reduxjs/toolkit'; +import _ from 'lodash'; +import { ChangeEvent } from 'react'; +import { BiReset } from 'react-icons/bi'; + +import { + RootState, + useAppDispatch, + useAppSelector, +} from '../../../../app/store'; +import IAICheckbox from '../../../../common/components/IAICheckbox'; +import IAIIconButton from '../../../../common/components/IAIIconButton'; + +import IAINumberInput from '../../../../common/components/IAINumberInput'; +import IAISlider from '../../../../common/components/IAISlider'; +import IAISwitch from '../../../../common/components/IAISwitch'; +import { roundDownToMultiple } from '../../../../common/util/roundDownToMultiple'; +import { + InpaintingState, + setBoundingBoxDimensions, + setShouldLockBoundingBox, + setShouldShowBoundingBox, + setShouldShowBoundingBoxFill, +} from '../../../tabs/Inpainting/inpaintingSlice'; + +const boundingBoxDimensionsSelector = createSelector( + (state: RootState) => state.inpainting, + (inpainting: InpaintingState) => { + const { + canvasDimensions, + boundingBoxDimensions, + shouldShowBoundingBox, + shouldShowBoundingBoxFill, + pastLines, + futureLines, + shouldLockBoundingBox, + } = inpainting; + return { + canvasDimensions, + boundingBoxDimensions, + shouldShowBoundingBox, + shouldShowBoundingBoxFill, + pastLines, + futureLines, + shouldLockBoundingBox, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +const BoundingBoxSettings = () => { + const dispatch = useAppDispatch(); + const { + canvasDimensions, + boundingBoxDimensions, + shouldShowBoundingBox, + shouldShowBoundingBoxFill, + shouldLockBoundingBox, + } = useAppSelector(boundingBoxDimensionsSelector); + + const handleChangeBoundingBoxWidth = (v: number) => { + dispatch(setBoundingBoxDimensions({ ...boundingBoxDimensions, width: Math.floor(v) })); + }; + + const handleChangeBoundingBoxHeight = (v: number) => { + dispatch(setBoundingBoxDimensions({ ...boundingBoxDimensions, height: Math.floor(v) })); + }; + + const handleShowBoundingBox = (e: ChangeEvent) => + dispatch(setShouldShowBoundingBox(e.target.checked)); + + const handleChangeShouldShowBoundingBoxFill = () => { + dispatch(setShouldShowBoundingBoxFill(!shouldShowBoundingBoxFill)); + }; + + const handleChangeShouldLockBoundingBox = () => { + dispatch(setShouldLockBoundingBox(!shouldLockBoundingBox)); + }; + + const handleResetWidth = () => { + dispatch( + setBoundingBoxDimensions({ + ...boundingBoxDimensions, + width: Math.floor(canvasDimensions.width), + }) + ); + }; + + const handleResetHeight = () => { + dispatch( + setBoundingBoxDimensions({ + ...boundingBoxDimensions, + height: Math.floor(canvasDimensions.height), + }) + ); + }; + + return ( +
+
+

Inpaint Box

+ +
+
+
+ + + } + styleClass="inpainting-bounding-box-reset-icon-btn" + isDisabled={ + !shouldShowBoundingBox || + canvasDimensions.width === boundingBoxDimensions.width + } + /> +
+
+ + + } + styleClass="inpainting-bounding-box-reset-icon-btn" + isDisabled={ + !shouldShowBoundingBox || + canvasDimensions.height === boundingBoxDimensions.height + } + /> +
+ + + + +
+
+ ); +}; + +export default BoundingBoxSettings; diff --git a/frontend/src/features/options/AdvancedOptions/Inpainting/InpaintingSettings.tsx b/frontend/src/features/options/AdvancedOptions/Inpainting/InpaintingSettings.tsx new file mode 100644 index 0000000000..1b9b125317 --- /dev/null +++ b/frontend/src/features/options/AdvancedOptions/Inpainting/InpaintingSettings.tsx @@ -0,0 +1,95 @@ +import { useToast } from '@chakra-ui/react'; +import { createSelector } from '@reduxjs/toolkit'; +import React, { ChangeEvent } from 'react'; +import { + RootState, + useAppDispatch, + useAppSelector, +} from '../../../../app/store'; +import IAIButton from '../../../../common/components/IAIButton'; +import { + InpaintingState, + setClearBrushHistory, + setInpaintReplace, + setShouldUseInpaintReplace, +} from '../../../tabs/Inpainting/inpaintingSlice'; +import BoundingBoxSettings from './BoundingBoxSettings'; +import _ from 'lodash'; +import IAINumberInput from '../../../../common/components/IAINumberInput'; +import IAISwitch from '../../../../common/components/IAISwitch'; + +const inpaintingSelector = createSelector( + (state: RootState) => state.inpainting, + (inpainting: InpaintingState) => { + const { pastLines, futureLines, inpaintReplace, shouldUseInpaintReplace } = + inpainting; + return { + pastLines, + futureLines, + inpaintReplace, + shouldUseInpaintReplace, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +export default function InpaintingSettings() { + const dispatch = useAppDispatch(); + const toast = useToast(); + + const { pastLines, futureLines, inpaintReplace, shouldUseInpaintReplace } = + useAppSelector(inpaintingSelector); + + const handleClearBrushHistory = () => { + dispatch(setClearBrushHistory()); + toast({ + title: 'Brush Stroke History Cleared', + status: 'success', + duration: 2500, + isClosable: true, + }); + }; + return ( + <> +
+ { + dispatch(setInpaintReplace(v)); + }} + /> + ) => + dispatch(setShouldUseInpaintReplace(e.target.checked)) + } + /> +
+ + 0 || pastLines.length > 0 ? false : true} + /> + + ); +} diff --git a/frontend/src/features/options/HiresOptions.tsx b/frontend/src/features/options/AdvancedOptions/Output/HiresOptions.tsx similarity index 68% rename from frontend/src/features/options/HiresOptions.tsx rename to frontend/src/features/options/AdvancedOptions/Output/HiresOptions.tsx index 09a886b815..fc5606d027 100644 --- a/frontend/src/features/options/HiresOptions.tsx +++ b/frontend/src/features/options/AdvancedOptions/Output/HiresOptions.tsx @@ -1,12 +1,15 @@ import { Flex } from '@chakra-ui/react'; -import { RootState } from '../../app/store'; -import { useAppDispatch, useAppSelector } from '../../app/store'; -import { setHiresFix } from './optionsSlice'; import { ChangeEvent } from 'react'; -import IAISwitch from '../../common/components/IAISwitch'; +import { + RootState, + useAppDispatch, + useAppSelector, +} from '../../../../app/store'; +import IAISwitch from '../../../../common/components/IAISwitch'; +import { setHiresFix } from '../../optionsSlice'; /** - * Image output options. Includes width, height, seamless tiling. + * Hires Fix Toggle */ const HiresOptions = () => { const dispatch = useAppDispatch(); @@ -16,7 +19,6 @@ const HiresOptions = () => { const handleChangeHiresFix = (e: ChangeEvent) => dispatch(setHiresFix(e.target.checked)); - return ( { + return ( + + Other Options + + ); +}; + +export default OutputHeader; diff --git a/frontend/src/features/options/OutputOptions.tsx b/frontend/src/features/options/AdvancedOptions/Output/OutputOptions.tsx similarity index 99% rename from frontend/src/features/options/OutputOptions.tsx rename to frontend/src/features/options/AdvancedOptions/Output/OutputOptions.tsx index 0b4ecc3ba9..7a8af1db00 100644 --- a/frontend/src/features/options/OutputOptions.tsx +++ b/frontend/src/features/options/AdvancedOptions/Output/OutputOptions.tsx @@ -1,10 +1,8 @@ import { Flex } from '@chakra-ui/react'; - import HiresOptions from './HiresOptions'; import SeamlessOptions from './SeamlessOptions'; const OutputOptions = () => { - return ( diff --git a/frontend/src/features/options/SeamlessOptions.tsx b/frontend/src/features/options/AdvancedOptions/Output/SeamlessOptions.tsx similarity index 67% rename from frontend/src/features/options/SeamlessOptions.tsx rename to frontend/src/features/options/AdvancedOptions/Output/SeamlessOptions.tsx index f97b444343..df15292870 100644 --- a/frontend/src/features/options/SeamlessOptions.tsx +++ b/frontend/src/features/options/AdvancedOptions/Output/SeamlessOptions.tsx @@ -1,10 +1,16 @@ import { Flex } from '@chakra-ui/react'; -import { RootState } from '../../app/store'; -import { useAppDispatch, useAppSelector } from '../../app/store'; -import { setSeamless } from './optionsSlice'; import { ChangeEvent } from 'react'; -import IAISwitch from '../../common/components/IAISwitch'; +import { + RootState, + useAppDispatch, + useAppSelector, +} from '../../../../app/store'; +import IAISwitch from '../../../../common/components/IAISwitch'; +import { setSeamless } from '../../optionsSlice'; +/** + * Seamless tiling toggle + */ const SeamlessOptions = () => { const dispatch = useAppDispatch(); @@ -25,4 +31,4 @@ const SeamlessOptions = () => { ); }; -export default SeamlessOptions; \ No newline at end of file +export default SeamlessOptions; diff --git a/frontend/src/features/options/AdvancedOptions/Seed/SeedHeader.tsx b/frontend/src/features/options/AdvancedOptions/Seed/SeedHeader.tsx new file mode 100644 index 0000000000..9c05b96d68 --- /dev/null +++ b/frontend/src/features/options/AdvancedOptions/Seed/SeedHeader.tsx @@ -0,0 +1,11 @@ +import { Box } from '@chakra-ui/react'; + +const SeedHeader = () => { + return ( + + Seed + + ); +}; + +export default SeedHeader; diff --git a/frontend/src/features/options/AdvancedOptions/Upscale/Upscale.tsx b/frontend/src/features/options/AdvancedOptions/Upscale/UpscaleHeader.tsx similarity index 95% rename from frontend/src/features/options/AdvancedOptions/Upscale/Upscale.tsx rename to frontend/src/features/options/AdvancedOptions/Upscale/UpscaleHeader.tsx index affa7aee41..4bb0347f04 100644 --- a/frontend/src/features/options/AdvancedOptions/Upscale/Upscale.tsx +++ b/frontend/src/features/options/AdvancedOptions/Upscale/UpscaleHeader.tsx @@ -8,7 +8,7 @@ import { import IAISwitch from '../../../../common/components/IAISwitch'; import { setShouldRunESRGAN } from '../../optionsSlice'; -export default function Upscale() { +export default function UpscaleHeader() { const isESRGANAvailable = useAppSelector( (state: RootState) => state.system.isESRGANAvailable ); diff --git a/frontend/src/features/options/AdvancedOptions/Variations/Variations.tsx b/frontend/src/features/options/AdvancedOptions/Variations/VariationsHeader.tsx similarity index 87% rename from frontend/src/features/options/AdvancedOptions/Variations/Variations.tsx rename to frontend/src/features/options/AdvancedOptions/Variations/VariationsHeader.tsx index 61fba4b220..ab02fad1f6 100644 --- a/frontend/src/features/options/AdvancedOptions/Variations/Variations.tsx +++ b/frontend/src/features/options/AdvancedOptions/Variations/VariationsHeader.tsx @@ -2,7 +2,7 @@ import { Flex } from '@chakra-ui/react'; import React from 'react'; import GenerateVariations from './GenerateVariations'; -export default function Variations() { +export default function VariationsHeader() { return ( void; - /** - * Callback to handle a file being rejected. - */ - fileRejectionCallback: (rejection: FileRejection) => void; - // Styling - styleClass?: string; -}; - -/** - * File upload using react-dropzone. - * Needs a child to be the button to activate the upload interface. - */ -const ImageUploader = ({ - children, - fileAcceptedCallback, - fileRejectionCallback, - styleClass, -}: ImageUploaderProps) => { - const onDrop = useCallback( - (acceptedFiles: Array, fileRejections: Array) => { - fileRejections.forEach((rejection: FileRejection) => { - fileRejectionCallback(rejection); - }); - - acceptedFiles.forEach((file: File) => { - fileAcceptedCallback(file); - }); - }, - [fileAcceptedCallback, fileRejectionCallback] - ); - - const { getRootProps, getInputProps, open } = useDropzone({ - onDrop, - accept: { - 'image/jpeg': ['.jpg', '.jpeg', '.png'], - }, - }); - - const handleClickUploadIcon = (e: SyntheticEvent) => { - e.stopPropagation(); - open(); - }; - - return ( - - - {cloneElement(children, { - onClick: handleClickUploadIcon, - })} - - ); -}; - -export default ImageUploader; diff --git a/frontend/src/features/options/InitAndMaskImage.css b/frontend/src/features/options/InitAndMaskImage.css deleted file mode 100644 index 31fe87fa17..0000000000 --- a/frontend/src/features/options/InitAndMaskImage.css +++ /dev/null @@ -1,20 +0,0 @@ -.checkerboard { - background-position: 0px 0px, 10px 10px; - background-size: 20px 20px; - background-image: linear-gradient( - 45deg, - #eee 25%, - transparent 25%, - transparent 75%, - #eee 75%, - #eee 100% - ), - linear-gradient( - 45deg, - #eee 25%, - white 25%, - white 75%, - #eee 75%, - #eee 100% - ); -} diff --git a/frontend/src/features/options/InitAndMaskImage.tsx b/frontend/src/features/options/InitAndMaskImage.tsx deleted file mode 100644 index efeffbd8e0..0000000000 --- a/frontend/src/features/options/InitAndMaskImage.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import { Flex, Image } from '@chakra-ui/react'; -import { useState } from 'react'; -import { useAppDispatch, useAppSelector } from '../../app/store'; -import { RootState } from '../../app/store'; -import { OptionsState, setInitialImagePath, setMaskPath } from './optionsSlice'; -import './InitAndMaskImage.css'; -import { createSelector } from '@reduxjs/toolkit'; -import { isEqual } from 'lodash'; -import InitAndMaskUploadButtons from './InitAndMaskUploadButtons'; - -const optionsSelector = createSelector( - (state: RootState) => state.options, - (options: OptionsState) => { - return { - initialImagePath: options.initialImagePath, - maskPath: options.maskPath, - }; - }, - { memoizeOptions: { resultEqualityCheck: isEqual } } -); - -/** - * Displays init and mask images and buttons to upload/delete them. - */ -const InitAndMaskImage = () => { - const dispatch = useAppDispatch(); - const { initialImagePath, maskPath } = useAppSelector(optionsSelector); - const [shouldShowMask, setShouldShowMask] = useState(false); - - const handleInitImageOnError = () => { - dispatch(setInitialImagePath('')); - }; - - const handleMaskImageOnError = () => { - dispatch(setMaskPath('')); - }; - - return ( - - - {initialImagePath && ( - - - {shouldShowMask && maskPath && ( - - )} - - )} - - ); -}; - -export default InitAndMaskImage; diff --git a/frontend/src/features/options/InitAndMaskUploadButtons.tsx b/frontend/src/features/options/InitAndMaskUploadButtons.tsx deleted file mode 100644 index 8649a4fe92..0000000000 --- a/frontend/src/features/options/InitAndMaskUploadButtons.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import { Button, Flex, IconButton, useToast } from '@chakra-ui/react'; -import { SyntheticEvent, useCallback } from 'react'; -import { FaTrash, FaUpload } from 'react-icons/fa'; -import { useAppDispatch, useAppSelector } from '../../app/store'; -import { RootState } from '../../app/store'; -import { OptionsState, setInitialImagePath, setMaskPath } from './optionsSlice'; -import { - uploadInitialImage, - uploadMaskImage, -} from '../../app/socketio/actions'; -import { createSelector } from '@reduxjs/toolkit'; -import { isEqual } from 'lodash'; -import ImageUploader from './ImageUploader'; -import { FileRejection } from 'react-dropzone'; - -const optionsSelector = createSelector( - (state: RootState) => state.options, - (options: OptionsState) => { - return { - initialImagePath: options.initialImagePath, - maskPath: options.maskPath, - }; - }, - { memoizeOptions: { resultEqualityCheck: isEqual } } -); - -type InitAndMaskUploadButtonsProps = { - setShouldShowMask: (b: boolean) => void; -}; - -/** - * Init and mask image upload buttons. - */ -const InitAndMaskUploadButtons = ({ - setShouldShowMask, -}: InitAndMaskUploadButtonsProps) => { - const dispatch = useAppDispatch(); - const { initialImagePath, maskPath } = useAppSelector(optionsSelector); - - // Use a toast to alert user when a file upload is rejected - const toast = useToast(); - - // Clear the init and mask images - const handleClickResetInitialImage = (e: SyntheticEvent) => { - e.stopPropagation(); - dispatch(setInitialImagePath('')); - }; - - // Clear the init and mask images - const handleClickResetMask = (e: SyntheticEvent) => { - e.stopPropagation(); - dispatch(setMaskPath('')); - }; - - // Handle hover to view initial image and mask image - const handleMouseOverInitialImageUploadButton = () => - setShouldShowMask(false); - const handleMouseOutInitialImageUploadButton = () => setShouldShowMask(true); - - const handleMouseOverMaskUploadButton = () => setShouldShowMask(true); - const handleMouseOutMaskUploadButton = () => setShouldShowMask(true); - - // Callbacks to for handling file upload attempts - const initImageFileAcceptedCallback = useCallback( - (file: File) => dispatch(uploadInitialImage(file)), - [dispatch] - ); - - const maskImageFileAcceptedCallback = useCallback( - (file: File) => dispatch(uploadMaskImage(file)), - [dispatch] - ); - - const fileRejectionCallback = useCallback( - (rejection: FileRejection) => { - const msg = rejection.errors.reduce( - (acc: string, cur: { message: string }) => acc + '\n' + cur.message, - '' - ); - - toast({ - title: 'Upload failed', - description: msg, - status: 'error', - isClosable: true, - }); - }, - [toast] - ); - - return ( - - - - - - } - /> - - - - - - } - /> - - ); -}; - -export default InitAndMaskUploadButtons; diff --git a/frontend/src/features/options/MainOptions/MainAdvancedOptions.tsx b/frontend/src/features/options/MainOptions/MainAdvancedOptionsCheckbox.tsx similarity index 58% rename from frontend/src/features/options/MainOptions/MainAdvancedOptions.tsx rename to frontend/src/features/options/MainOptions/MainAdvancedOptionsCheckbox.tsx index 18517ba8c3..29a0d37180 100644 --- a/frontend/src/features/options/MainOptions/MainAdvancedOptions.tsx +++ b/frontend/src/features/options/MainOptions/MainAdvancedOptionsCheckbox.tsx @@ -1,8 +1,10 @@ +import { Checkbox } from '@chakra-ui/react'; import React, { ChangeEvent } from 'react'; import { RootState, useAppDispatch, useAppSelector } from '../../../app/store'; +import IAICheckbox from '../../../common/components/IAICheckbox'; import { setShowAdvancedOptions } from '../optionsSlice'; -export default function MainAdvancedOptions() { +export default function MainAdvancedOptionsCheckbox() { const showAdvancedOptions = useAppSelector( (state: RootState) => state.options.showAdvancedOptions ); @@ -12,15 +14,11 @@ export default function MainAdvancedOptions() { dispatch(setShowAdvancedOptions(e.target.checked)); return ( -
- - -
+ ); } diff --git a/frontend/src/features/options/MainOptions/MainCFGScale.tsx b/frontend/src/features/options/MainOptions/MainCFGScale.tsx index adb4d4697e..07395c9fb6 100644 --- a/frontend/src/features/options/MainOptions/MainCFGScale.tsx +++ b/frontend/src/features/options/MainOptions/MainCFGScale.tsx @@ -14,7 +14,7 @@ export default function MainCFGScale() { state.options.height); + const { activeTab, height } = useAppSelector( + (state: RootState) => state.options + ); const dispatch = useAppDispatch(); const handleChangeHeight = (e: ChangeEvent) => @@ -14,6 +17,7 @@ export default function MainHeight() { return ( state.options.width); + const { width, activeTab } = useAppSelector( + (state: RootState) => state.options + ); const dispatch = useAppDispatch(); const handleChangeWidth = (e: ChangeEvent) => @@ -14,6 +17,7 @@ export default function MainWidth() { return ( state.system, + (system: SystemState) => { + return { + isProcessing: system.isProcessing, + isConnected: system.isConnected, + isCancelable: system.isCancelable, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); export default function CancelButton() { const dispatch = useAppDispatch(); - const { isProcessing, isConnected } = useAppSelector(systemSelector); + const { isProcessing, isConnected, isCancelable } = + useAppSelector(cancelButtonSelector); const handleClickCancel = () => dispatch(cancelProcessing()); useHotkeys( 'shift+x', () => { - if (isConnected || isProcessing) { + if ((isConnected || isProcessing) && isCancelable) { handleClickCancel(); } }, - [isConnected, isProcessing] + [isConnected, isProcessing, isCancelable] ); return ( @@ -26,9 +44,9 @@ export default function CancelButton() { icon={} tooltip="Cancel" aria-label="Cancel" - isDisabled={!isConnected || !isProcessing} + isDisabled={!isConnected || !isProcessing || !isCancelable} onClick={handleClickCancel} - className="cancel-btn" + styleClass="cancel-btn" /> ); } diff --git a/frontend/src/features/options/ProcessButtons/InvokeButton.tsx b/frontend/src/features/options/ProcessButtons/InvokeButton.tsx index 3a0472c435..230795a19e 100644 --- a/frontend/src/features/options/ProcessButtons/InvokeButton.tsx +++ b/frontend/src/features/options/ProcessButtons/InvokeButton.tsx @@ -1,15 +1,19 @@ -import React from 'react'; import { generateImage } from '../../../app/socketio/actions'; -import { useAppDispatch } from '../../../app/store'; +import { RootState, useAppDispatch, useAppSelector } from '../../../app/store'; import IAIButton from '../../../common/components/IAIButton'; import useCheckParameters from '../../../common/hooks/useCheckParameters'; +import { tabMap } from '../../tabs/InvokeTabs'; export default function InvokeButton() { const dispatch = useAppDispatch(); const isReady = useCheckParameters(); + const activeTab = useAppSelector( + (state: RootState) => state.options.activeTab + ); + const handleClickGenerate = () => { - dispatch(generateImage()); + dispatch(generateImage(tabMap[activeTab])); }; return ( diff --git a/frontend/src/features/options/ProcessButtons/ProcessButtons.scss b/frontend/src/features/options/ProcessButtons/ProcessButtons.scss index aed8d2ca27..6c6c13971d 100644 --- a/frontend/src/features/options/ProcessButtons/ProcessButtons.scss +++ b/frontend/src/features/options/ProcessButtons/ProcessButtons.scss @@ -7,16 +7,16 @@ .invoke-btn { @include Button( - $btn-color: var(--btn-purple), - $btn-color-hover: var(--btn-purple-hover), + $btn-color: var(--accent-color), + $btn-color-hover: var(--accent-color-hover), $btn-width: 5rem ); } .cancel-btn { @include Button( - $btn-color: var(--btn-red), - $btn-color-hover: var(--btn-red-hover), + $btn-color: var(--destructive-color), + $btn-color-hover: var(--destructive-color-hover), $btn-width: 3rem ); } diff --git a/frontend/src/features/options/PromptInput/PromptInput.scss b/frontend/src/features/options/PromptInput/PromptInput.scss index 5692a207ab..e7baf2f5f9 100644 --- a/frontend/src/features/options/PromptInput/PromptInput.scss +++ b/frontend/src/features/options/PromptInput/PromptInput.scss @@ -13,8 +13,8 @@ } &:focus-visible { - border: 2px solid var(--prompt-border-color); - box-shadow: 0 0 10px 0 var(--prompt-box-shadow-color); + border: 2px solid var(--input-border-color); + box-shadow: 0 0 10px 0 var(--input-box-shadow-color); } &[aria-invalid='true'] { diff --git a/frontend/src/features/options/PromptInput/PromptInput.tsx b/frontend/src/features/options/PromptInput/PromptInput.tsx index 0d440a9aae..178bd4ff30 100644 --- a/frontend/src/features/options/PromptInput/PromptInput.tsx +++ b/frontend/src/features/options/PromptInput/PromptInput.tsx @@ -5,22 +5,22 @@ import { generateImage } from '../../../app/socketio/actions'; import { OptionsState, setPrompt } from '../optionsSlice'; import { createSelector } from '@reduxjs/toolkit'; -import { isEqual } from 'lodash'; -import useCheckParameters, { - systemSelector, -} from '../../../common/hooks/useCheckParameters'; +import _ from 'lodash'; +import useCheckParameters from '../../../common/hooks/useCheckParameters'; import { useHotkeys } from 'react-hotkeys-hook'; +import { tabMap } from '../../tabs/InvokeTabs'; -export const optionsSelector = createSelector( +const promptInputSelector = createSelector( (state: RootState) => state.options, (options: OptionsState) => { return { prompt: options.prompt, + activeTabName: tabMap[options.activeTab], }; }, { memoizeOptions: { - resultEqualityCheck: isEqual, + resultEqualityCheck: _.isEqual, }, } ); @@ -30,8 +30,7 @@ export const optionsSelector = createSelector( */ const PromptInput = () => { const promptRef = useRef(null); - const { prompt } = useAppSelector(optionsSelector); - const { isProcessing } = useAppSelector(systemSelector); + const { prompt, activeTabName } = useAppSelector(promptInputSelector); const dispatch = useAppDispatch(); const isReady = useCheckParameters(); @@ -40,13 +39,13 @@ const PromptInput = () => { }; useHotkeys( - 'ctrl+enter', + 'ctrl+enter, cmd+enter', () => { if (isReady) { - dispatch(generateImage()); + dispatch(generateImage(activeTabName)); } }, - [isReady] + [isReady, activeTabName] ); useHotkeys( @@ -60,7 +59,7 @@ const PromptInput = () => { const handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Enter' && e.shiftKey === false && isReady) { e.preventDefault(); - dispatch(generateImage()); + dispatch(generateImage(activeTabName)); } }; diff --git a/frontend/src/features/options/SamplerOptions.tsx b/frontend/src/features/options/SamplerOptions.tsx deleted file mode 100644 index 3021e63a9a..0000000000 --- a/frontend/src/features/options/SamplerOptions.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { Flex } from '@chakra-ui/react'; - -import { RootState } from '../../app/store'; -import { useAppDispatch, useAppSelector } from '../../app/store'; - -import { - setCfgScale, - setSampler, - setThreshold, - setPerlin, - setSteps, - OptionsState, -} from './optionsSlice'; - -import { SAMPLERS } from '../../app/constants'; -import { createSelector } from '@reduxjs/toolkit'; -import { isEqual } from 'lodash'; -import { ChangeEvent } from 'react'; -import IAINumberInput from '../../common/components/IAINumberInput'; -import IAISelect from '../../common/components/IAISelect'; - -const optionsSelector = createSelector( - (state: RootState) => state.options, - (options: OptionsState) => { - return { - steps: options.steps, - cfgScale: options.cfgScale, - sampler: options.sampler, - threshold: options.threshold, - perlin: options.perlin, - }; - }, - { - memoizeOptions: { - resultEqualityCheck: isEqual, - }, - } -); - -/** - * Sampler options. Includes steps, CFG scale, sampler. - */ -const SamplerOptions = () => { - - const dispatch = useAppDispatch(); - const { steps, cfgScale, sampler, threshold, perlin } = useAppSelector(optionsSelector); - - const handleChangeSteps = (v: string | number) => - dispatch(setSteps(Number(v))); - - const handleChangeCfgScale = (v: string | number) => - dispatch(setCfgScale(Number(v))); - - const handleChangeSampler = (e: ChangeEvent) => - dispatch(setSampler(e.target.value)); - - const handleChangeThreshold = (v: string | number) => - dispatch(setThreshold(Number(v))); - - const handleChangePerlin = (v: string | number) => - dispatch(setPerlin(Number(v))); - - return ( - - {/* */} - {/* */} - - {/* */} - {/* */} - - ); -}; - -export default SamplerOptions; diff --git a/frontend/src/features/options/optionsSlice.ts b/frontend/src/features/options/optionsSlice.ts index de8d4668b0..22a2c03c1c 100644 --- a/frontend/src/features/options/optionsSlice.ts +++ b/frontend/src/features/options/optionsSlice.ts @@ -4,6 +4,7 @@ import * as InvokeAI from '../../app/invokeai'; import promptToString from '../../common/util/promptToString'; import { seedWeightsToString } from '../../common/util/seedWeightPairs'; import { FACETOOL_TYPES } from '../../app/constants'; +import { InvokeTabName, tabMap } from '../tabs/InvokeTabs'; export type UpscalingLevel = 2 | 4; @@ -26,8 +27,7 @@ export interface OptionsState { codeformerFidelity: number; upscalingLevel: UpscalingLevel; upscalingStrength: number; - shouldUseInitImage: boolean; - initialImagePath: string | null; + initialImage?: InvokeAI.Image | string; // can be an Image or url maskPath: string; seamless: boolean; hiresFix: boolean; @@ -41,7 +41,7 @@ export interface OptionsState { showAdvancedOptions: boolean; activeTab: number; shouldShowImageDetails: boolean; - shouldShowGallery: boolean; + showDualDisplay: boolean; } const initialOptionsState: OptionsState = { @@ -57,9 +57,7 @@ const initialOptionsState: OptionsState = { seed: 0, seamless: false, hiresFix: false, - shouldUseInitImage: false, img2imgStrength: 0.75, - initialImagePath: null, maskPath: '', shouldFitToWidthHeight: true, shouldGenerateVariations: false, @@ -76,7 +74,7 @@ const initialOptionsState: OptionsState = { showAdvancedOptions: true, activeTab: 0, shouldShowImageDetails: false, - shouldShowGallery: false, + showDualDisplay: true, }; const initialState: OptionsState = initialOptionsState; @@ -136,14 +134,6 @@ export const optionsSlice = createSlice({ setUpscalingStrength: (state, action: PayloadAction) => { state.upscalingStrength = action.payload; }, - setShouldUseInitImage: (state, action: PayloadAction) => { - state.shouldUseInitImage = action.payload; - }, - setInitialImagePath: (state, action: PayloadAction) => { - const newInitialImagePath = action.payload; - state.shouldUseInitImage = newInitialImagePath ? true : false; - state.initialImagePath = newInitialImagePath; - }, setMaskPath: (state, action: PayloadAction) => { state.maskPath = action.payload; }, @@ -169,9 +159,6 @@ export const optionsSlice = createSlice({ if (key === 'seed') { temp.shouldRandomizeSeed = false; } - if (key === 'initialImagePath' && value === '') { - temp.shouldUseInitImage = false; - } return temp; }, setShouldGenerateVariations: (state, action: PayloadAction) => { @@ -235,13 +222,10 @@ export const optionsSlice = createSlice({ action.payload.image; if (type === 'img2img') { - if (init_image_path) state.initialImagePath = init_image_path; + if (init_image_path) state.initialImage = init_image_path; if (mask_image_path) state.maskPath = mask_image_path; if (strength) state.img2imgStrength = strength; if (typeof fit === 'boolean') state.shouldFitToWidthHeight = fit; - state.shouldUseInitImage = true; - } else { - state.shouldUseInitImage = false; } }, setAllParameters: (state, action: PayloadAction) => { @@ -266,13 +250,10 @@ export const optionsSlice = createSlice({ } = action.payload.image; if (type === 'img2img') { - if (init_image_path) state.initialImagePath = init_image_path; + if (init_image_path) state.initialImage = init_image_path; if (mask_image_path) state.maskPath = mask_image_path; if (strength) state.img2imgStrength = strength; if (typeof fit === 'boolean') state.shouldFitToWidthHeight = fit; - state.shouldUseInitImage = true; - } else { - state.shouldUseInitImage = false; } if (variations && variations.length > 0) { @@ -321,14 +302,27 @@ export const optionsSlice = createSlice({ setShowAdvancedOptions: (state, action: PayloadAction) => { state.showAdvancedOptions = action.payload; }, - setActiveTab: (state, action: PayloadAction) => { - state.activeTab = action.payload; + setActiveTab: (state, action: PayloadAction) => { + if (typeof action.payload === 'number') { + state.activeTab = action.payload; + } else { + state.activeTab = tabMap.indexOf(action.payload); + } }, setShouldShowImageDetails: (state, action: PayloadAction) => { state.shouldShowImageDetails = action.payload; }, - setShouldShowGallery: (state, action: PayloadAction) => { - state.shouldShowGallery = action.payload; + setShowDualDisplay: (state, action: PayloadAction) => { + state.showDualDisplay = action.payload; + }, + setInitialImage: ( + state, + action: PayloadAction + ) => { + state.initialImage = action.payload; + }, + clearInitialImage: (state) => { + state.initialImage = undefined; }, }, }); @@ -352,8 +346,6 @@ export const { setCodeformerFidelity, setUpscalingLevel, setUpscalingStrength, - setShouldUseInitImage, - setInitialImagePath, setMaskPath, resetSeed, resetOptionsState, @@ -369,9 +361,11 @@ export const { setShowAdvancedOptions, setActiveTab, setShouldShowImageDetails, - setShouldShowGallery, setAllTextToImageParameters, setAllImageToImageParameters, + setShowDualDisplay, + setInitialImage, + clearInitialImage, } = optionsSlice.actions; export default optionsSlice.reducer; diff --git a/frontend/src/features/system/Console.scss b/frontend/src/features/system/Console.scss index d9ef94fc47..d8c5d1249f 100644 --- a/frontend/src/features/system/Console.scss +++ b/frontend/src/features/system/Console.scss @@ -1,4 +1,5 @@ .console { + width: 100vw; display: flex; flex-direction: column; background: var(--console-bg-color); @@ -7,7 +8,7 @@ font-family: monospace; padding: 0 1rem 1rem 3rem; border-top-width: 0.3rem; - border-color: var(--console-border-color); + border-color: var(--resizeable-handle-border-color); .console-info-color { color: var(--error-level-info); @@ -64,9 +65,9 @@ } &.autoscroll-enabled { - background: var(--btn-purple) !important; + background: var(--accent-color) !important; &:hover { - background: var(--btn-purple-hover) !important; + background: var(--accent-color-hover) !important; } } } diff --git a/frontend/src/features/system/HotkeysModal/HotkeysModal.scss b/frontend/src/features/system/HotkeysModal/HotkeysModal.scss index 07dd4e0d14..0a216b5c4b 100644 --- a/frontend/src/features/system/HotkeysModal/HotkeysModal.scss +++ b/frontend/src/features/system/HotkeysModal/HotkeysModal.scss @@ -1,6 +1,8 @@ @use '../../../styles/Mixins/' as *; .hotkeys-modal { + width: 36rem !important; + max-width: 36rem !important; display: grid; padding: 1rem; background-color: var(--settings-modal-bg) !important; @@ -11,14 +13,47 @@ font-size: 1.2rem; font-weight: bold; } + + h2 { + font-weight: bold; + } +} + +.hotkeys-modal-button { + display: flex; + align-items: center; + justify-content: space-between; } .hotkeys-modal-items { - display: grid; - row-gap: 0.5rem; - max-height: 32rem; + max-height: 36rem; overflow-y: scroll; @include HideScrollbar; + + .chakra-accordion { + display: grid; + row-gap: 0.5rem; + } + + .chakra-accordion__item { + border: none; + border-radius: 0.3rem; + background-color: var(--tab-hover-color); + } + + button { + border-radius: 0.3rem !important; + + &[aria-expanded='true'] { + background-color: var(--tab-hover-color); + border-radius: 0.3rem; + } + } +} + +.hotkey-modal-category { + display: grid; + row-gap: 0.5rem; } .hotkey-modal-item { diff --git a/frontend/src/features/system/HotkeysModal/HotkeysModal.tsx b/frontend/src/features/system/HotkeysModal/HotkeysModal.tsx index 12004640ef..df89408292 100644 --- a/frontend/src/features/system/HotkeysModal/HotkeysModal.tsx +++ b/frontend/src/features/system/HotkeysModal/HotkeysModal.tsx @@ -1,4 +1,9 @@ import { + Accordion, + AccordionButton, + AccordionIcon, + AccordionItem, + AccordionPanel, Modal, ModalCloseButton, ModalContent, @@ -13,6 +18,12 @@ type HotkeysModalProps = { children: ReactElement; }; +type HotkeyList = { + title: string; + desc: string; + hotkey: string; +}; + export default function HotkeysModal({ children }: HotkeysModalProps) { const { isOpen: isHotkeyModalOpen, @@ -20,51 +31,18 @@ export default function HotkeysModal({ children }: HotkeysModalProps) { onClose: onHotkeysModalClose, } = useDisclosure(); - const hotkeys = [ + const appHotkeys = [ { title: 'Invoke', desc: 'Generate an image', hotkey: 'Ctrl+Enter' }, { title: 'Cancel', desc: 'Cancel image generation', hotkey: 'Shift+X' }, - { - title: 'Toggle Gallery', - desc: 'Open and close the gallery drawer', - hotkey: 'G', - }, - { - title: 'Set Seed', - desc: 'Use the seed of the current image', - hotkey: 'S', - }, - { - title: 'Set Parameters', - desc: 'Use all parameters of the current image', - hotkey: 'A', - }, - { title: 'Restore Faces', desc: 'Restore the current image', hotkey: 'R' }, - { title: 'Upscale', desc: 'Upscale the current image', hotkey: 'U' }, - { - title: 'Show Info', - desc: 'Show metadata info of the current image', - hotkey: 'I', - }, - { - title: 'Send To Image To Image', - desc: 'Send the current image to Image to Image module', - hotkey: 'Shift+I', - }, - { title: 'Delete Image', desc: 'Delete the current image', hotkey: 'Del' }, { title: 'Focus Prompt', desc: 'Focus the prompt input area', hotkey: 'Alt+A', }, { - title: 'Previous Image', - desc: 'Display the previous image in the gallery', - hotkey: 'Arrow left', - }, - { - title: 'Next Image', - desc: 'Display the next image in the gallery', - hotkey: 'Arrow right', + title: 'Toggle Gallery', + desc: 'Open and close the gallery drawer', + hotkey: 'G', }, { title: 'Change Tabs', @@ -83,7 +61,144 @@ export default function HotkeysModal({ children }: HotkeysModalProps) { }, ]; - const renderHotkeyModalItems = () => { + const generalHotkeys = [ + { + title: 'Set Parameters', + desc: 'Use all parameters of the current image', + hotkey: 'A', + }, + { + title: 'Set Seed', + desc: 'Use the seed of the current image', + hotkey: 'S', + }, + { title: 'Restore Faces', desc: 'Restore the current image', hotkey: 'R' }, + { title: 'Upscale', desc: 'Upscale the current image', hotkey: 'U' }, + { + title: 'Show Info', + desc: 'Show metadata info of the current image', + hotkey: 'I', + }, + { + title: 'Send To Image To Image', + desc: 'Send current image to Image to Image', + hotkey: 'Shift+I', + }, + { title: 'Delete Image', desc: 'Delete the current image', hotkey: 'Del' }, + ]; + + const galleryHotkeys = [ + { + title: 'Previous Image', + desc: 'Display the previous image in gallery', + hotkey: 'Arrow left', + }, + { + title: 'Next Image', + desc: 'Display the next image in gallery', + hotkey: 'Arrow right', + }, + { + title: 'Toggle Gallery Pin', + desc: 'Pins and unpins the gallery to the UI', + hotkey: 'Shift+P', + }, + { + title: 'Increase Gallery Image Size', + desc: 'Increases gallery thumbnails size', + hotkey: 'Shift+Up', + }, + { + title: 'Decrease Gallery Image Size', + desc: 'Decreases gallery thumbnails size', + hotkey: 'Shift+Down', + }, + { + title: 'Reset Gallery Image Size', + desc: 'Resets image gallery size', + hotkey: 'Shift+R', + }, + ]; + + const inpaintingHotkeys = [ + { + title: 'Select Brush', + desc: 'Selects the inpainting brush', + hotkey: 'B', + }, + { + title: 'Select Eraser', + desc: 'Selects the inpainting eraser', + hotkey: 'E', + }, + { + title: 'Quick Toggle Brush/Eraser', + desc: 'Quick toggle between brush and eraser', + hotkey: 'Z', + }, + { + title: 'Decrease Brush Size', + desc: 'Decreases the size of the inpainting brush/eraser', + hotkey: '[', + }, + { + title: 'Increase Brush Size', + desc: 'Increases the size of the inpainting brush/eraser', + hotkey: ']', + }, + { + title: 'Hide Mask', + desc: 'Hide and unhide mask', + hotkey: 'H', + }, + { + title: 'Decrease Mask Opacity', + desc: 'Decreases the opacity of the mask', + hotkey: 'Shift+[', + }, + { + title: 'Increase Mask Opacity', + desc: 'Increases the opacity of the mask', + hotkey: 'Shift+]', + }, + { + title: 'Invert Mask', + desc: 'Invert the mask preview', + hotkey: 'Shift+M', + }, + { + title: 'Clear Mask', + desc: 'Clear the entire mask', + hotkey: 'Shift+C', + }, + { + title: 'Undo Stroke', + desc: 'Undo a brush stroke', + hotkey: 'Ctrl+Z', + }, + { + title: 'Redo Stroke', + desc: 'Redo a brush stroke', + hotkey: 'Ctrl+Shift+Z, Ctrl+Y', + }, + { + title: 'Lock Bounding Box', + desc: 'Locks the bounding box', + hotkey: 'M', + }, + { + title: 'Quick Toggle Lock Bounding Box', + desc: 'Hold to toggle locking the bounding box', + hotkey: 'Space', + }, + { + title: 'Expand Inpainting Area', + desc: 'Expand your inpainting work area', + hotkey: 'Shift+J', + }, + ]; + + const renderHotkeyModalItems = (hotkeys: HotkeyList[]) => { const hotkeyModalItemsToRender: ReactElement[] = []; hotkeys.forEach((hotkey, i) => { @@ -97,7 +212,9 @@ export default function HotkeysModal({ children }: HotkeysModalProps) { ); }); - return hotkeyModalItemsToRender; + return ( +
{hotkeyModalItemsToRender}
+ ); }; return ( @@ -109,8 +226,51 @@ export default function HotkeysModal({ children }: HotkeysModalProps) { +

Keyboard Shorcuts

-
{renderHotkeyModalItems()}
+
+ + + +

App Hotkeys

+ +
+ + {renderHotkeyModalItems(appHotkeys)} + +
+ + + +

General Hotkeys

+ +
+ + {renderHotkeyModalItems(generalHotkeys)} + +
+ + + +

Gallery Hotkeys

+ +
+ + {renderHotkeyModalItems(galleryHotkeys)} + +
+ + + +

Inpainting Hotkeys

+ +
+ + {renderHotkeyModalItems(inpaintingHotkeys)} + +
+
+
diff --git a/frontend/src/features/system/ProgressBar.scss b/frontend/src/features/system/ProgressBar.scss index 017b21833c..4bbe9c15f3 100644 --- a/frontend/src/features/system/ProgressBar.scss +++ b/frontend/src/features/system/ProgressBar.scss @@ -1,7 +1,19 @@ +@use '../../styles/Mixins/' as *; + .progress-bar { background-color: var(--root-bg-color); + height: $progress-bar-thickness !important; div { background-color: var(--progress-bar-color); + &[data-indeterminate] { + background-color: unset; + background-image: linear-gradient( + to right, + transparent 0%, + var(--progress-bar-color) 50%, + transparent 100% + ); + } } } diff --git a/frontend/src/features/system/ProgressBar.tsx b/frontend/src/features/system/ProgressBar.tsx index e2905172dc..9cbfcb8c5d 100644 --- a/frontend/src/features/system/ProgressBar.tsx +++ b/frontend/src/features/system/ProgressBar.tsx @@ -28,7 +28,6 @@ const ProgressBar = () => { return ( { + const { isProcessing, isConnected } = useAppSelector( + (state: RootState) => state.system + ); + + const dispatch = useAppDispatch(); + const { name, status, description } = props; + const handleChangeModel = () => { + dispatch(requestModelChange(name)); + }; + return ( +
+ +
{name}
+
+ +
+ {status} +
+
+ +
+
+ ); +}; + +const modelListSelector = createSelector( + (state: RootState) => state.system, + (system: SystemState) => { + const models = _.map(system.model_list, (model, key) => { + return { name: key, ...model }; + }); + + const activeModel = models.find((model) => model.status === 'active'); + + return { + models, + activeModel: activeModel, + }; + } +); + +const ModelList = () => { + const { models } = useAppSelector(modelListSelector); + + return ( +
+ + + +
+

Models

+ +
+
+ + +
+ {models.map((model, i) => ( + + ))} +
+
+
+
+
+ ); +}; + +export default ModelList; diff --git a/frontend/src/features/system/SettingsModal/SettingsModal.scss b/frontend/src/features/system/SettingsModal/SettingsModal.scss index b969523fb9..27adb3025e 100644 --- a/frontend/src/features/system/SettingsModal/SettingsModal.scss +++ b/frontend/src/features/system/SettingsModal/SettingsModal.scss @@ -2,11 +2,13 @@ .settings-modal { background-color: var(--settings-modal-bg) !important; + max-height: 36rem; font-family: Inter; .settings-modal-content { display: grid; row-gap: 2rem; + overflow-y: scroll; } .settings-modal-header { @@ -23,8 +25,8 @@ background-color: var(--background-color); padding: 0.4rem 1rem; border-radius: 0.5rem; - justify-content: space-between; align-items: center; + width: 100%; } } @@ -34,8 +36,8 @@ button { @include Button( - $btn-color: var(--btn-red), - $btn-color-hover: var(--btn-red-hover) + $btn-color: var(--destructive-color), + $btn-color-hover: var(--destructive-color-hover) ); } } diff --git a/frontend/src/features/system/SettingsModal/SettingsModal.tsx b/frontend/src/features/system/SettingsModal/SettingsModal.tsx index 6b2a01166e..ad5d06d173 100644 --- a/frontend/src/features/system/SettingsModal/SettingsModal.tsx +++ b/frontend/src/features/system/SettingsModal/SettingsModal.tsx @@ -13,7 +13,7 @@ import { useDisclosure, } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { isEqual } from 'lodash'; +import _, { isEqual } from 'lodash'; import { cloneElement, ReactElement } from 'react'; import { RootState, useAppSelector } from '../../../app/store'; import { persistor } from '../../../main'; @@ -23,6 +23,7 @@ import { setShouldDisplayInProgress, SystemState, } from '../systemSlice'; +import ModelList from './ModelList'; import SettingsModalItem from './SettingsModalItem'; const systemSelector = createSelector( @@ -32,11 +33,13 @@ const systemSelector = createSelector( shouldDisplayInProgress, shouldConfirmOnDelete, shouldDisplayGuides, + model_list, } = system; return { shouldDisplayInProgress, shouldConfirmOnDelete, shouldDisplayGuides, + models: _.map(model_list, (_model, key) => key), }; }, { @@ -97,6 +100,7 @@ const SettingsModal = ({ children }: SettingsModalProps) => { Settings +
- {settingTitle} - dispatch(dispatcher(e.target.checked))} - /> - + dispatch(dispatcher(e.target.checked))} + /> ); } diff --git a/frontend/src/features/system/SiteHeader.scss b/frontend/src/features/system/SiteHeader.scss index b83fbc0f64..f9b40912c0 100644 --- a/frontend/src/features/system/SiteHeader.scss +++ b/frontend/src/features/system/SiteHeader.scss @@ -4,10 +4,10 @@ } .site-header-left-side { - display: grid; - grid-template-columns: repeat(2, max-content); - column-gap: 0.6rem; + display: flex; align-items: center; + column-gap: 0.7rem; + padding-left: 0.5rem; img { width: 32px; @@ -20,8 +20,7 @@ } .site-header-right-side { - display: grid; - grid-template-columns: repeat(7, max-content); + display: flex; align-items: center; column-gap: 0.5rem; } diff --git a/frontend/src/features/system/SiteHeader.tsx b/frontend/src/features/system/SiteHeader.tsx index 527bb2e8d8..515787749b 100644 --- a/frontend/src/features/system/SiteHeader.tsx +++ b/frontend/src/features/system/SiteHeader.tsx @@ -41,16 +41,6 @@ const SiteHeader = () => {
- - } - /> - - { /> + + + + { /> - + } /> - +
); diff --git a/frontend/src/features/system/systemSlice.ts b/frontend/src/features/system/systemSlice.ts index af33b7e849..211686e6d3 100644 --- a/frontend/src/features/system/systemSlice.ts +++ b/frontend/src/features/system/systemSlice.ts @@ -35,6 +35,7 @@ export interface SystemState currentStatusHasSteps: boolean; shouldDisplayGuides: boolean; wasErrorSeen: boolean; + isCancelable: boolean; } const initialSystemState = { @@ -60,8 +61,10 @@ const initialSystemState = { model_hash: '', app_id: '', app_version: '', + model_list: {}, hasError: false, wasErrorSeen: true, + isCancelable: true, }; const initialState: SystemState = initialSystemState; @@ -85,12 +88,13 @@ export const systemSlice = createSlice({ errorOccurred: (state) => { state.hasError = true; state.isProcessing = false; + state.isCancelable = true; state.currentStep = 0; state.totalSteps = 0; state.currentIteration = 0; state.totalIterations = 0; state.currentStatusHasSteps = false; - state.currentStatus = 'Server error'; + state.currentStatus = 'Error'; state.wasErrorSeen = false; }, errorSeen: (state) => { @@ -123,6 +127,7 @@ export const systemSlice = createSlice({ setIsConnected: (state, action: PayloadAction) => { state.isConnected = action.payload; state.isProcessing = false; + state.isCancelable = true; state.currentStep = 0; state.totalSteps = 0; state.currentIteration = 0; @@ -140,13 +145,17 @@ export const systemSlice = createSlice({ state.openAccordions = action.payload; }, setSystemConfig: (state, action: PayloadAction) => { - return { ...state, ...action.payload }; + return { + ...state, + ...action.payload, + }; }, setShouldDisplayGuides: (state, action: PayloadAction) => { state.shouldDisplayGuides = action.payload; }, processingCanceled: (state) => { state.isProcessing = false; + state.isCancelable = true; state.currentStep = 0; state.totalSteps = 0; state.currentIteration = 0; @@ -154,6 +163,15 @@ export const systemSlice = createSlice({ state.currentStatusHasSteps = false; state.currentStatus = 'Processing canceled'; }, + setModelList: ( + state, + action: PayloadAction> + ) => { + state.model_list = action.payload; + }, + setIsCancelable: (state, action: PayloadAction) => { + state.isCancelable = action.payload; + }, }, }); @@ -173,6 +191,8 @@ export const { processingCanceled, errorOccurred, errorSeen, + setModelList, + setIsCancelable, } = systemSlice.actions; export default systemSlice.reducer; diff --git a/frontend/src/features/tabs/ImageToImage/ImageToImage.scss b/frontend/src/features/tabs/ImageToImage/ImageToImage.scss index 991d97c8c6..e2da2371a8 100644 --- a/frontend/src/features/tabs/ImageToImage/ImageToImage.scss +++ b/frontend/src/features/tabs/ImageToImage/ImageToImage.scss @@ -1,31 +1,22 @@ @use '../../../styles/Mixins/' as *; -.image-to-image-workarea { - display: grid; - grid-template-columns: max-content auto; - column-gap: 1rem; +.image-to-image-area { + display: flex; + flex-direction: column; + row-gap: 1rem; + width: 100%; + height: 100%; } .image-to-image-panel { display: grid; row-gap: 1rem; grid-auto-rows: max-content; - width: $options-bar-max-width; height: $app-content-height; overflow-y: scroll; @include HideScrollbar; } -.image-to-image-display-area { - display: grid; - column-gap: 0.5rem; - - .image-gallery-area { - z-index: 2; - height: 100%; - } -} - .image-to-image-strength-main-option { display: grid; grid-template-columns: none !important; @@ -35,109 +26,33 @@ } } -.image-to-image-display { - border-radius: 0.5rem; - background-color: var(--background-color-secondary); - display: grid; - height: $app-content-height; +.init-image-preview-header { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; - .current-image-options { - grid-auto-columns: max-content; - justify-self: center; - align-self: start; + h2 { + font-weight: bold; + font-size: 0.9rem; } } -.image-to-image-single-preview { - display: grid; - column-gap: 0.5rem; - padding: 0 1rem; - place-content: center; -} - -.image-to-image-dual-preview-container { - display: grid; - grid-template-areas: 'img2img-preview'; -} - -.image-to-image-dual-preview { - grid-area: img2img-preview; - display: grid; - grid-template-columns: 1fr 1fr; - column-gap: 0.5rem; - padding: 0 1rem; - place-content: center; - - .current-image-preview { - img { - height: calc($app-gallery-height - 2rem); - max-height: calc($app-gallery-height - 2rem); - } - } -} - -.img2img-metadata { - grid-area: img2img-preview; - z-index: 3; -} - .init-image-preview { - display: grid; - grid-template-areas: 'init-image-content'; - justify-content: center; - align-items: center; - border-radius: 0.5rem; - - .init-image-preview-header { - grid-area: init-image-content; - z-index: 2; - display: grid; - grid-template-columns: auto max-content; - height: max-content; - align-items: center; - align-self: start; - padding: 1rem; - border-radius: 0.5rem; - - h1 { - padding: 0.2rem 0.6rem; - border-radius: 0.4rem; - background-color: var(--tab-hover-color); - width: max-content; - font-weight: bold; - font-size: 0.85rem; - } - } - - .init-image-image { - grid-area: init-image-content; - - img { - border-radius: 0.5rem; - object-fit: contain; - background-color: var(--img2img-img-bg-color); - width: auto; - height: calc($app-gallery-height - 2rem); - max-height: calc($app-gallery-height - 2rem); - } - } -} - -.image-to-image-upload-btn { - display: grid; + position: relative; + height: 100%; width: 100%; - height: $app-content-height; + display: flex; + align-items: center; + justify-content: center; - button { - overflow: hidden; - width: 100%; - height: 100%; - font-size: 1.5rem; - color: var(--text-color-secondary); - background-color: var(--background-color-secondary); - - &:hover { - background-color: var(--img2img-img-bg-color); - } + img { + border-radius: 0.5rem; + object-fit: contain; + position: absolute; } } + +.image-to-image-current-image-display { + position: relative; +} diff --git a/frontend/src/features/tabs/ImageToImage/ImageToImage.tsx b/frontend/src/features/tabs/ImageToImage/ImageToImage.tsx deleted file mode 100644 index 44fd23e659..0000000000 --- a/frontend/src/features/tabs/ImageToImage/ImageToImage.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import ImageToImagePanel from './ImageToImagePanel'; -import ImageToImageDisplay from './ImageToImageDisplay'; -import ImageGallery from '../../gallery/ImageGallery'; -import { RootState, useAppSelector } from '../../../app/store'; - -export default function ImageToImage() { - const shouldShowGallery = useAppSelector( - (state: RootState) => state.options.shouldShowGallery - ); - - return ( -
- -
- - -
-
- ); -} diff --git a/frontend/src/features/tabs/ImageToImage/ImageToImageDisplay.tsx b/frontend/src/features/tabs/ImageToImage/ImageToImageDisplay.tsx index ae70f4b588..aa217069aa 100644 --- a/frontend/src/features/tabs/ImageToImage/ImageToImageDisplay.tsx +++ b/frontend/src/features/tabs/ImageToImage/ImageToImageDisplay.tsx @@ -1,74 +1,33 @@ -import React from 'react'; -import { FaUpload } from 'react-icons/fa'; -import { uploadInitialImage } from '../../../app/socketio/actions'; import { RootState, useAppSelector } from '../../../app/store'; -import InvokeImageUploader from '../../../common/components/InvokeImageUploader'; -import CurrentImageButtons from '../../gallery/CurrentImageButtons'; -import CurrentImagePreview from '../../gallery/CurrentImagePreview'; -import ImageMetadataViewer from '../../gallery/ImageMetaDataViewer/ImageMetadataViewer'; - +import ImageUploadButton from '../../../common/components/ImageUploaderButton'; +import CurrentImageDisplay from '../../gallery/CurrentImageDisplay'; import InitImagePreview from './InitImagePreview'; -export default function ImageToImageDisplay() { - const initialImagePath = useAppSelector( - (state: RootState) => state.options.initialImagePath +const ImageToImageDisplay = () => { + const initialImage = useAppSelector( + (state: RootState) => state.options.initialImage ); - const { currentImage, intermediateImage } = useAppSelector( - (state: RootState) => state.gallery - ); + const { currentImage } = useAppSelector((state: RootState) => state.gallery); - const shouldShowImageDetails = useAppSelector( - (state: RootState) => state.options.shouldShowImageDetails + const imageToImageComponent = initialImage ? ( +
+ +
+ ) : ( + ); - const imageToDisplay = intermediateImage || currentImage; - return ( -
- {initialImagePath ? ( - <> - {imageToDisplay ? ( - <> - -
-
- -
- -
-
- {shouldShowImageDetails && ( - - )} -
- - ) : ( -
- -
- )} - - ) : ( -
- } - styleClass="image-to-image-upload-btn" - dispatcher={uploadInitialImage} - /> +
+
{imageToImageComponent}
+ {currentImage && ( +
+
)}
); -} +}; + +export default ImageToImageDisplay; diff --git a/frontend/src/features/tabs/ImageToImage/ImageToImagePanel.tsx b/frontend/src/features/tabs/ImageToImage/ImageToImagePanel.tsx index 41eeb28ad0..cb1cbed533 100644 --- a/frontend/src/features/tabs/ImageToImage/ImageToImagePanel.tsx +++ b/frontend/src/features/tabs/ImageToImage/ImageToImagePanel.tsx @@ -1,20 +1,20 @@ -import { Box } from '@chakra-ui/react'; -import React from 'react'; import { Feature } from '../../../app/features'; import { RootState, useAppSelector } from '../../../app/store'; -import FaceRestore from '../../options/AdvancedOptions/FaceRestore/FaceRestore'; +import FaceRestoreHeader from '../../options/AdvancedOptions/FaceRestore/FaceRestoreHeader'; import FaceRestoreOptions from '../../options/AdvancedOptions/FaceRestore/FaceRestoreOptions'; import ImageFit from '../../options/AdvancedOptions/ImageToImage/ImageFit'; import ImageToImageStrength from '../../options/AdvancedOptions/ImageToImage/ImageToImageStrength'; +import OutputHeader from '../../options/AdvancedOptions/Output/OutputHeader'; +import OutputOptions from '../../options/AdvancedOptions/Output/OutputOptions'; +import SeedHeader from '../../options/AdvancedOptions/Seed/SeedHeader'; import SeedOptions from '../../options/AdvancedOptions/Seed/SeedOptions'; -import Upscale from '../../options/AdvancedOptions/Upscale/Upscale'; +import UpscaleHeader from '../../options/AdvancedOptions/Upscale/UpscaleHeader'; import UpscaleOptions from '../../options/AdvancedOptions/Upscale/UpscaleOptions'; -import Variations from '../../options/AdvancedOptions/Variations/Variations'; +import VariationsHeader from '../../options/AdvancedOptions/Variations/VariationsHeader'; import VariationsOptions from '../../options/AdvancedOptions/Variations/VariationsOptions'; -import MainAdvancedOptions from '../../options/MainOptions/MainAdvancedOptions'; +import MainAdvancedOptionsCheckbox from '../../options/MainOptions/MainAdvancedOptionsCheckbox'; import MainOptions from '../../options/MainOptions/MainOptions'; import OptionsAccordion from '../../options/OptionsAccordion'; -import OutputOptions from '../../options/OutputOptions'; import ProcessButtons from '../../options/ProcessButtons/ProcessButtons'; import PromptInput from '../../options/PromptInput/PromptInput'; @@ -25,35 +25,27 @@ export default function ImageToImagePanel() { const imageToImageAccordions = { seed: { - header: ( - - Seed - - ), + header: , feature: Feature.SEED, options: , }, variations: { - header: , + header: , feature: Feature.VARIATIONS, options: , }, face_restore: { - header: , + header: , feature: Feature.FACE_CORRECTION, options: , }, upscale: { - header: , + header: , feature: Feature.UPSCALE, options: , }, other: { - header: ( - - Other - - ), + header: , feature: Feature.OTHER, options: , }, @@ -69,7 +61,7 @@ export default function ImageToImagePanel() { styleClass="main-option-block image-to-image-strength-main-option" /> - + {showAdvancedOptions ? ( ) : null} diff --git a/frontend/src/features/tabs/ImageToImage/InitImagePreview.tsx b/frontend/src/features/tabs/ImageToImage/InitImagePreview.tsx index 9e4ba3489c..d80e7a1e74 100644 --- a/frontend/src/features/tabs/ImageToImage/InitImagePreview.tsx +++ b/frontend/src/features/tabs/ImageToImage/InitImagePreview.tsx @@ -2,12 +2,10 @@ import { IconButton, Image, useToast } from '@chakra-ui/react'; import React, { SyntheticEvent } from 'react'; import { MdClear } from 'react-icons/md'; import { RootState, useAppDispatch, useAppSelector } from '../../../app/store'; -import { setInitialImagePath } from '../../options/optionsSlice'; +import { clearInitialImage } from '../../options/optionsSlice'; export default function InitImagePreview() { - const initialImagePath = useAppSelector( - (state: RootState) => state.options.initialImagePath - ); + const { initialImage } = useAppSelector((state: RootState) => state.options); const dispatch = useAppDispatch(); @@ -15,7 +13,7 @@ export default function InitImagePreview() { const handleClickResetInitialImage = (e: SyntheticEvent) => { e.stopPropagation(); - dispatch(setInitialImagePath(null)); + dispatch(clearInitialImage()); }; const alertMissingInitImage = () => { @@ -25,31 +23,33 @@ export default function InitImagePreview() { status: 'error', isClosable: true, }); - dispatch(setInitialImagePath(null)); + dispatch(clearInitialImage()); }; return ( -
+ <>
-

Initial Image

+

Initial Image

} />
- {initialImagePath && ( -
+ {initialImage && ( +
)} -
+ ); } diff --git a/frontend/src/features/tabs/ImageToImage/InitialImageOverlay.tsx b/frontend/src/features/tabs/ImageToImage/InitialImageOverlay.tsx index acc49a701f..0c342821cf 100644 --- a/frontend/src/features/tabs/ImageToImage/InitialImageOverlay.tsx +++ b/frontend/src/features/tabs/ImageToImage/InitialImageOverlay.tsx @@ -3,14 +3,14 @@ import React from 'react'; import { RootState, useAppSelector } from '../../../app/store'; export default function InitialImageOverlay() { - const initialImagePath = useAppSelector( - (state: RootState) => state.options.initialImagePath + const initialImage = useAppSelector( + (state: RootState) => state.options.initialImage ); - return initialImagePath ? ( + return initialImage ? ( diff --git a/frontend/src/features/tabs/ImageToImage/index.tsx b/frontend/src/features/tabs/ImageToImage/index.tsx new file mode 100644 index 0000000000..5363c95f06 --- /dev/null +++ b/frontend/src/features/tabs/ImageToImage/index.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import ImageToImagePanel from './ImageToImagePanel'; +import ImageToImageDisplay from './ImageToImageDisplay'; +import InvokeWorkarea from '../InvokeWorkarea'; + +export default function ImageToImageWorkarea() { + return ( + }> + + + ); +} diff --git a/frontend/src/features/tabs/Inpainting/Inpainting.scss b/frontend/src/features/tabs/Inpainting/Inpainting.scss new file mode 100644 index 0000000000..28e627ca1d --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/Inpainting.scss @@ -0,0 +1,93 @@ +@use '../../../styles/Mixins/' as *; + +.inpainting-main-area { + display: flex; + flex-direction: column; + align-items: center; + row-gap: 1rem; + width: 100%; + height: 100%; + + .inpainting-settings { + display: flex; + align-items: center; + column-gap: 1rem; + + .inpainting-buttons-group { + display: flex; + align-items: center; + column-gap: 0.5rem; + } + + .inpainting-button-dropdown { + display: flex; + flex-direction: column; + row-gap: 0.5rem; + } + + .inpainting-color-picker { + margin-left: 1rem !important; + } + + .inpainting-slider-numberinput { + display: flex; + column-gap: 1rem; + align-items: center; + } + } + + .inpainting-canvas-area { + display: flex; + flex-direction: column; + align-items: center; + row-gap: 1rem; + width: 100%; + height: 100%; + } + + .inpainting-canvas-wrapper { + display: flex; + align-items: center; + justify-content: center; + position: relative; + height: 100%; + width: 100%; + border-radius: 0.5rem; + + .inpainting-alerts { + position: absolute; + top: 0; + left: 0; + display: flex; + column-gap: 0.5rem; + z-index: 2; + padding: 0.5rem; + pointer-events: none; + font-size: 0.9rem; + font-weight: bold; + + div { + background-color: var(--accent-color); + color: var(--text-color); + padding: 0.2rem 0.6rem; + border-radius: 0.25rem; + } + } + + .inpainting-canvas-stage { + border-radius: 0.5rem; + canvas { + border-radius: 0.5rem; + } + } + } +} + +// Overrides +.inpainting-workarea-overrides { + .image-gallery-area { + .chakra-popover__popper { + inset: 0 auto auto -75px !important; + } + } +} diff --git a/frontend/src/features/tabs/Inpainting/InpaintingCanvas.tsx b/frontend/src/features/tabs/Inpainting/InpaintingCanvas.tsx new file mode 100644 index 0000000000..8f306d7abf --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/InpaintingCanvas.tsx @@ -0,0 +1,321 @@ +// lib +import { + MutableRefObject, + useCallback, + useEffect, + useRef, + useState, +} from 'react'; +import Konva from 'konva'; +import { Layer, Stage } from 'react-konva'; +import { Image as KonvaImage } from 'react-konva'; +import { Stage as StageType } from 'konva/lib/Stage'; + +// app +import { useAppDispatch, useAppSelector } from '../../../app/store'; +import { + addLine, + addPointToCurrentLine, + clearImageToInpaint, + setCursorPosition, + setIsDrawing, +} from './inpaintingSlice'; +import { inpaintingCanvasSelector } from './inpaintingSliceSelectors'; + +// component +import InpaintingCanvasLines from './components/InpaintingCanvasLines'; +import InpaintingCanvasBrushPreview from './components/InpaintingCanvasBrushPreview'; +import InpaintingCanvasBrushPreviewOutline from './components/InpaintingCanvasBrushPreviewOutline'; +import Cacher from './components/Cacher'; +import { Vector2d } from 'konva/lib/types'; +import getScaledCursorPosition from './util/getScaledCursorPosition'; +import InpaintingBoundingBoxPreview, { + InpaintingBoundingBoxPreviewOverlay, +} from './components/InpaintingBoundingBoxPreview'; +import { KonvaEventObject } from 'konva/lib/Node'; +import KeyboardEventManager from './components/KeyboardEventManager'; +import { useToast } from '@chakra-ui/react'; + +// Use a closure allow other components to use these things... not ideal... +export let stageRef: MutableRefObject; +export let maskLayerRef: MutableRefObject; +export let inpaintingImageElementRef: MutableRefObject; + +const InpaintingCanvas = () => { + const dispatch = useAppDispatch(); + + const { + tool, + brushSize, + shouldInvertMask, + shouldShowMask, + shouldShowCheckboardTransparency, + maskColor, + imageToInpaint, + stageScale, + shouldShowBoundingBoxFill, + isDrawing, + shouldLockBoundingBox, + shouldShowBoundingBox, + } = useAppSelector(inpaintingCanvasSelector); + + const toast = useToast(); + + // set the closure'd refs + stageRef = useRef(null); + maskLayerRef = useRef(null); + inpaintingImageElementRef = useRef(null); + + const lastCursorPosition = useRef({ x: 0, y: 0 }); + + // Use refs for values that do not affect rendering, other values in redux + const didMouseMoveRef = useRef(false); + + // Load the image into this + const [canvasBgImage, setCanvasBgImage] = useState( + null + ); + + // Load the image and set the options panel width & height + useEffect(() => { + if (imageToInpaint) { + const image = new Image(); + image.onload = () => { + inpaintingImageElementRef.current = image; + setCanvasBgImage(image); + }; + image.onerror = () => { + toast({ + title: 'Unable to Load Image', + description: `Image ${imageToInpaint.url} failed to load`, + status: 'error', + isClosable: true, + }); + dispatch(clearImageToInpaint()); + }; + image.src = imageToInpaint.url; + } else { + setCanvasBgImage(null) + } + }, [imageToInpaint, dispatch, stageScale, toast]); + + /** + * + * Canvas onMouseDown + * + */ + const handleMouseDown = useCallback(() => { + if (!stageRef.current) return; + + const scaledCursorPosition = getScaledCursorPosition(stageRef.current); + + if ( + !scaledCursorPosition || + !maskLayerRef.current || + !shouldLockBoundingBox + ) + return; + + dispatch(setIsDrawing(true)); + + // Add a new line starting from the current cursor position. + dispatch( + addLine({ + tool, + strokeWidth: brushSize / 2, + points: [scaledCursorPosition.x, scaledCursorPosition.y], + }) + ); + }, [dispatch, brushSize, tool, shouldLockBoundingBox]); + + /** + * + * Canvas onMouseMove + * + */ + const handleMouseMove = useCallback(() => { + if (!stageRef.current) return; + + const scaledCursorPosition = getScaledCursorPosition(stageRef.current); + + if (!scaledCursorPosition) return; + + dispatch(setCursorPosition(scaledCursorPosition)); + + if (!maskLayerRef.current || !shouldLockBoundingBox) { + return; + } + + lastCursorPosition.current = scaledCursorPosition; + + if (!isDrawing) return; + + didMouseMoveRef.current = true; + // Extend the current line + dispatch( + addPointToCurrentLine([scaledCursorPosition.x, scaledCursorPosition.y]) + ); + }, [dispatch, isDrawing, shouldLockBoundingBox]); + + /** + * + * Canvas onMouseUp + * + */ + const handleMouseUp = useCallback(() => { + if (!didMouseMoveRef.current && isDrawing && stageRef.current) { + const scaledCursorPosition = getScaledCursorPosition(stageRef.current); + + if ( + !scaledCursorPosition || + !maskLayerRef.current || + !shouldLockBoundingBox + ) + return; + + /** + * Extend the current line. + * In this case, the mouse didn't move, so we append the same point to + * the line's existing points. This allows the line to render as a circle + * centered on that point. + */ + dispatch( + addPointToCurrentLine([scaledCursorPosition.x, scaledCursorPosition.y]) + ); + } else { + didMouseMoveRef.current = false; + } + dispatch(setIsDrawing(false)); + }, [dispatch, isDrawing, shouldLockBoundingBox]); + + /** + * + * Canvas onMouseOut + * + */ + const handleMouseOutCanvas = useCallback(() => { + dispatch(setCursorPosition(null)); + dispatch(setIsDrawing(false)); + }, [dispatch]); + + /** + * + * Canvas onMouseEnter + * + */ + const handleMouseEnter = useCallback( + (e: KonvaEventObject) => { + if (e.evt.buttons === 1) { + if (!stageRef.current) return; + + const scaledCursorPosition = getScaledCursorPosition(stageRef.current); + + if ( + !scaledCursorPosition || + !maskLayerRef.current || + !shouldLockBoundingBox + ) + return; + + dispatch(setIsDrawing(true)); + + // Add a new line starting from the current cursor position. + dispatch( + addLine({ + tool, + strokeWidth: brushSize / 2, + points: [scaledCursorPosition.x, scaledCursorPosition.y], + }) + ); + } + }, + [dispatch, brushSize, tool, shouldLockBoundingBox] + ); + + return ( +
+
+ {!shouldShowMask && ( +
Mask Hidden (H)
+ )} + {shouldInvertMask && ( +
Mask Inverted (Shift+M)
+ )} + {!shouldLockBoundingBox && ( +
+ Transforming Bounding Box (M) +
+ )} +
+ + {canvasBgImage && ( + + {!shouldInvertMask && !shouldShowCheckboardTransparency && ( + + + + )} + {shouldShowMask && ( + <> + + + + {shouldLockBoundingBox && } + + {shouldInvertMask && ( + + )} + {!shouldInvertMask && shouldShowCheckboardTransparency && ( + + )} + + + {shouldShowBoundingBox && shouldShowBoundingBoxFill && ( + + )} + {shouldShowBoundingBox && } + {shouldLockBoundingBox && ( + + )} + + + )} + + )} + + +
+ ); +}; + +export default InpaintingCanvas; diff --git a/frontend/src/features/tabs/Inpainting/InpaintingCanvasPlaceholder.tsx b/frontend/src/features/tabs/Inpainting/InpaintingCanvasPlaceholder.tsx new file mode 100644 index 0000000000..923db0ed76 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/InpaintingCanvasPlaceholder.tsx @@ -0,0 +1,34 @@ +import { Spinner } from '@chakra-ui/react'; +import { useLayoutEffect, useRef } from 'react'; +import { RootState, useAppDispatch, useAppSelector } from '../../../app/store'; +import { setStageScale } from './inpaintingSlice'; + +const InpaintingCanvasPlaceholder = () => { + const dispatch = useAppDispatch(); + const { needsCache, imageToInpaint } = useAppSelector( + (state: RootState) => state.inpainting + ); + const ref = useRef(null); + + useLayoutEffect(() => { + if (!ref.current || !imageToInpaint) return; + + const width = ref.current.clientWidth; + const height = ref.current.clientHeight; + + const scale = Math.min( + 1, + Math.min(width / imageToInpaint.width, height / imageToInpaint.height) + ); + + dispatch(setStageScale(scale)); + }, [dispatch, imageToInpaint, needsCache]); + + return ( +
+ +
+ ); +}; + +export default InpaintingCanvasPlaceholder; diff --git a/frontend/src/features/tabs/Inpainting/InpaintingControls.tsx b/frontend/src/features/tabs/Inpainting/InpaintingControls.tsx new file mode 100644 index 0000000000..a091104ece --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/InpaintingControls.tsx @@ -0,0 +1,446 @@ +import { useToast } from '@chakra-ui/react'; +import { useHotkeys } from 'react-hotkeys-hook'; +import { + FaEraser, + FaMask, + FaPaintBrush, + FaPalette, + FaPlus, + FaRedo, + FaTrash, + FaUndo, +} from 'react-icons/fa'; +import { BiHide, BiShow } from 'react-icons/bi'; +import { VscSplitHorizontal } from 'react-icons/vsc'; +import { useAppDispatch, useAppSelector } from '../../../app/store'; +import IAIIconButton from '../../../common/components/IAIIconButton'; +import { + clearMask, + redo, + setMaskColor, + setBrushSize, + setShouldShowBrushPreview, + setTool, + undo, + setShouldShowMask, + setShouldInvertMask, + setNeedsCache, + toggleShouldLockBoundingBox, + clearImageToInpaint, +} from './inpaintingSlice'; + +import { MdInvertColors, MdInvertColorsOff } from 'react-icons/md'; +import IAISlider from '../../../common/components/IAISlider'; +import IAINumberInput from '../../../common/components/IAINumberInput'; +import { inpaintingControlsSelector } from './inpaintingSliceSelectors'; +import IAIPopover from '../../../common/components/IAIPopover'; +import IAIColorPicker from '../../../common/components/IAIColorPicker'; +import { RgbaColor } from 'react-colorful'; +import { setShowDualDisplay } from '../../options/optionsSlice'; +import { useState } from 'react'; + +const InpaintingControls = () => { + const { + tool, + brushSize, + maskColor, + shouldInvertMask, + shouldShowMask, + canUndo, + canRedo, + isMaskEmpty, + activeTabName, + showDualDisplay, + shouldShowBoundingBox + } = useAppSelector(inpaintingControlsSelector); + + const dispatch = useAppDispatch(); + const toast = useToast(); + + // Button State Controllers + const [maskOptionsOpen, setMaskOptionsOpen] = useState(false); + + /** + * Hotkeys + */ + + // Decrease brush size + useHotkeys( + '[', + (e: KeyboardEvent) => { + e.preventDefault(); + if (brushSize - 5 > 0) { + handleChangeBrushSize(brushSize - 5); + } else { + handleChangeBrushSize(1); + } + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask, + }, + [activeTabName, shouldShowMask, brushSize] + ); + + // Increase brush size + useHotkeys( + ']', + (e: KeyboardEvent) => { + e.preventDefault(); + handleChangeBrushSize(brushSize + 5); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask, + }, + [activeTabName, shouldShowMask, brushSize] + ); + + // Decrease mask opacity + useHotkeys( + 'shift+[', + (e: KeyboardEvent) => { + e.preventDefault(); + handleChangeMaskColor({ + ...maskColor, + a: Math.max(maskColor.a - 0.05, 0), + }); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask, + }, + [activeTabName, shouldShowMask, maskColor.a] + ); + + // Increase mask opacity + useHotkeys( + 'shift+]', + (e: KeyboardEvent) => { + e.preventDefault(); + handleChangeMaskColor({ + ...maskColor, + a: Math.min(maskColor.a + 0.05, 100), + }); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask, + }, + [activeTabName, shouldShowMask, maskColor.a] + ); + + // Set tool to eraser + useHotkeys( + 'e', + (e: KeyboardEvent) => { + e.preventDefault(); + if (activeTabName !== 'inpainting' || !shouldShowMask) return; + handleSelectEraserTool(); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask, + }, + [activeTabName, shouldShowMask] + ); + + // Set tool to brush + useHotkeys( + 'b', + (e: KeyboardEvent) => { + e.preventDefault(); + handleSelectBrushTool(); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask, + }, + [activeTabName, shouldShowMask] + ); + + // Toggle lock bounding box + useHotkeys( + 'm', + (e: KeyboardEvent) => { + e.preventDefault(); + dispatch(toggleShouldLockBoundingBox()); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask && shouldShowBoundingBox, + }, + [activeTabName, shouldShowMask, shouldShowBoundingBox] + ); + + // Undo + useHotkeys( + 'cmd+z, control+z', + (e: KeyboardEvent) => { + e.preventDefault(); + handleUndo(); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask && canUndo, + }, + [activeTabName, shouldShowMask, canUndo] + ); + + // Redo + useHotkeys( + 'cmd+shift+z, control+shift+z, control+y, cmd+y', + (e: KeyboardEvent) => { + e.preventDefault(); + handleRedo(); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask && canRedo, + }, + [activeTabName, shouldShowMask, canRedo] + ); + + // Show/hide mask + useHotkeys( + 'h', + (e: KeyboardEvent) => { + e.preventDefault(); + handleToggleShouldShowMask(); + }, + { + enabled: activeTabName === 'inpainting', + }, + [activeTabName, shouldShowMask] + ); + + // Invert mask + useHotkeys( + 'shift+m', + (e: KeyboardEvent) => { + e.preventDefault(); + handleToggleShouldInvertMask(); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask, + }, + [activeTabName, shouldInvertMask, shouldShowMask] + ); + + // Clear mask + useHotkeys( + 'shift+c', + (e: KeyboardEvent) => { + e.preventDefault(); + handleClearMask(); + toast({ + title: 'Mask Cleared', + status: 'success', + duration: 2500, + isClosable: true, + }); + }, + { + enabled: activeTabName === 'inpainting' && shouldShowMask && !isMaskEmpty, + }, + [activeTabName, isMaskEmpty, shouldShowMask] + ); + + // Toggle split view + useHotkeys( + 'shift+j', + () => { + handleDualDisplay(); + }, + [showDualDisplay] + ); + + const handleClearMask = () => { + dispatch(clearMask()); + }; + + const handleSelectEraserTool = () => dispatch(setTool('eraser')); + + const handleSelectBrushTool = () => dispatch(setTool('brush')); + + const handleChangeBrushSize = (v: number) => { + dispatch(setShouldShowBrushPreview(true)); + dispatch(setBrushSize(v)); + }; + + const handleToggleShouldShowMask = () => + dispatch(setShouldShowMask(!shouldShowMask)); + + const handleToggleShouldInvertMask = () => + dispatch(setShouldInvertMask(!shouldInvertMask)); + + const handleShowBrushPreview = () => { + dispatch(setShouldShowBrushPreview(true)); + }; + + const handleHideBrushPreview = () => { + dispatch(setShouldShowBrushPreview(false)); + }; + + const handleChangeMaskColor = (newColor: RgbaColor) => { + dispatch(setMaskColor(newColor)); + }; + + const handleUndo = () => dispatch(undo()); + + const handleRedo = () => dispatch(redo()); + + const handleDualDisplay = () => { + dispatch(setShowDualDisplay(!showDualDisplay)); + dispatch(setNeedsCache(true)); + }; + + const handleClearImage = () => { + dispatch(clearImageToInpaint()); + }; + + return ( +
+
+ } + onClick={handleSelectBrushTool} + data-selected={tool === 'brush'} + isDisabled={!shouldShowMask} + /> + } + > +
+ + +
+
+ } + onClick={handleSelectEraserTool} + data-selected={tool === 'eraser'} + isDisabled={!shouldShowMask} + /> +
+
+ setMaskOptionsOpen(true)} + onClose={() => setMaskOptionsOpen(false)} + triggerComponent={ + } + cursor={'pointer'} + isDisabled={isMaskEmpty} + data-selected={maskOptionsOpen} + /> + } + > +
+ : + } + onClick={handleToggleShouldShowMask} + /> + + ) : ( + + ) + } + onClick={handleToggleShouldInvertMask} + isDisabled={!shouldShowMask} + /> + } + isDisabled={!shouldShowMask} + cursor={'pointer'} + /> + } + > + + +
+
+ } + onClick={handleClearMask} + isDisabled={isMaskEmpty || !shouldShowMask} + /> +
+
+ } + onClick={handleUndo} + isDisabled={!canUndo || !shouldShowMask} + /> + } + onClick={handleRedo} + isDisabled={!canRedo || !shouldShowMask} + /> +
+ +
+ } + onClick={handleClearImage} + /> +
+ } + data-selected={showDualDisplay} + onClick={handleDualDisplay} + /> +
+ ); +}; + +export default InpaintingControls; diff --git a/frontend/src/features/tabs/Inpainting/InpaintingDisplay.tsx b/frontend/src/features/tabs/Inpainting/InpaintingDisplay.tsx new file mode 100644 index 0000000000..3f58002721 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/InpaintingDisplay.tsx @@ -0,0 +1,70 @@ +import { createSelector } from '@reduxjs/toolkit'; +import _ from 'lodash'; +import { useLayoutEffect } from 'react'; +import { RootState, useAppDispatch, useAppSelector } from '../../../app/store'; +import ImageUploadButton from '../../../common/components/ImageUploaderButton'; +import CurrentImageDisplay from '../../gallery/CurrentImageDisplay'; +import { OptionsState } from '../../options/optionsSlice'; +import InpaintingCanvas from './InpaintingCanvas'; +import InpaintingCanvasPlaceholder from './InpaintingCanvasPlaceholder'; +import InpaintingControls from './InpaintingControls'; +import { InpaintingState, setNeedsCache } from './inpaintingSlice'; + +const inpaintingDisplaySelector = createSelector( + [(state: RootState) => state.inpainting, (state: RootState) => state.options], + (inpainting: InpaintingState, options: OptionsState) => { + const { needsCache, imageToInpaint } = inpainting; + const { showDualDisplay } = options; + return { + needsCache, + showDualDisplay, + imageToInpaint, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +const InpaintingDisplay = () => { + const dispatch = useAppDispatch(); + const { showDualDisplay, needsCache, imageToInpaint } = useAppSelector( + inpaintingDisplaySelector + ); + + useLayoutEffect(() => { + const resizeCallback = _.debounce(() => dispatch(setNeedsCache(true)), 250); + window.addEventListener('resize', resizeCallback); + return () => window.removeEventListener('resize', resizeCallback); + }, [dispatch]); + + const inpaintingComponent = imageToInpaint ? ( +
+ +
+ {needsCache ? : } +
+
+ ) : ( + + ); + + return ( +
+
{inpaintingComponent}
+ {showDualDisplay && ( +
+ +
+ )} +
+ ); +}; + +export default InpaintingDisplay; diff --git a/frontend/src/features/tabs/Inpainting/InpaintingPanel.tsx b/frontend/src/features/tabs/Inpainting/InpaintingPanel.tsx new file mode 100644 index 0000000000..3f30f67f78 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/InpaintingPanel.tsx @@ -0,0 +1,63 @@ +import { Feature } from '../../../app/features'; +import { RootState, useAppSelector } from '../../../app/store'; +import FaceRestoreHeader from '../../options/AdvancedOptions/FaceRestore/FaceRestoreHeader'; +import FaceRestoreOptions from '../../options/AdvancedOptions/FaceRestore/FaceRestoreOptions'; +import ImageToImageStrength from '../../options/AdvancedOptions/ImageToImage/ImageToImageStrength'; +import InpaintingSettings from '../../options/AdvancedOptions/Inpainting/InpaintingSettings'; +import SeedHeader from '../../options/AdvancedOptions/Seed/SeedHeader'; +import SeedOptions from '../../options/AdvancedOptions/Seed/SeedOptions'; +import UpscaleHeader from '../../options/AdvancedOptions/Upscale/UpscaleHeader'; +import UpscaleOptions from '../../options/AdvancedOptions/Upscale/UpscaleOptions'; +import VariationsHeader from '../../options/AdvancedOptions/Variations/VariationsHeader'; +import VariationsOptions from '../../options/AdvancedOptions/Variations/VariationsOptions'; +import MainAdvancedOptionsCheckbox from '../../options/MainOptions/MainAdvancedOptionsCheckbox'; +import MainOptions from '../../options/MainOptions/MainOptions'; +import OptionsAccordion from '../../options/OptionsAccordion'; +import ProcessButtons from '../../options/ProcessButtons/ProcessButtons'; +import PromptInput from '../../options/PromptInput/PromptInput'; + +export default function InpaintingPanel() { + const showAdvancedOptions = useAppSelector( + (state: RootState) => state.options.showAdvancedOptions + ); + + const imageToImageAccordions = { + seed: { + header: , + feature: Feature.SEED, + options: , + }, + variations: { + header: , + feature: Feature.VARIATIONS, + options: , + }, + face_restore: { + header: , + feature: Feature.FACE_CORRECTION, + options: , + }, + upscale: { + header: , + feature: Feature.UPSCALE, + options: , + }, + }; + + return ( +
+ + + + + + + {showAdvancedOptions ? ( + + ) : null} +
+ ); +} diff --git a/frontend/src/features/tabs/Inpainting/components/Cacher.tsx b/frontend/src/features/tabs/Inpainting/components/Cacher.tsx new file mode 100644 index 0000000000..b43e8b0989 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/components/Cacher.tsx @@ -0,0 +1,91 @@ +import { useEffect, useLayoutEffect, useState } from 'react'; +import { RootState, useAppSelector } from '../../../../app/store'; +import { maskLayerRef } from '../InpaintingCanvas'; + +/** + * Konva's cache() method basically rasterizes an object/canvas. + * This is needed to rasterize the mask, before setting the opacity. + * If we do not cache the maskLayer, the brush strokes will have opacity + * set individually. + * + * This logical component simply uses useLayoutEffect() to synchronously + * cache the mask layer every time something that changes how it should draw + * is changed. + */ +const Cacher = () => { + const { + tool, + lines, + cursorPosition, + brushSize, + canvasDimensions: { width, height }, + maskColor, + shouldInvertMask, + shouldShowMask, + shouldShowBrushPreview, + shouldShowCheckboardTransparency, + imageToInpaint, + shouldShowBrush, + shouldShowBoundingBoxFill, + shouldLockBoundingBox, + stageScale, + pastLines, + futureLines, + needsCache, + isDrawing, + } = useAppSelector((state: RootState) => state.inpainting); + + useLayoutEffect(() => { + if (!maskLayerRef.current) return; + maskLayerRef.current.cache({ + x: 0, + y: 0, + width, + height, + }); + }, [ + lines, + cursorPosition, + width, + height, + tool, + brushSize, + maskColor, + shouldInvertMask, + shouldShowMask, + shouldShowBrushPreview, + shouldShowCheckboardTransparency, + imageToInpaint, + shouldShowBrush, + shouldShowBoundingBoxFill, + shouldLockBoundingBox, + stageScale, + pastLines, + futureLines, + needsCache, + isDrawing, + ]); + + /** + * Hack to cache the mask layer after the canvas is ready. + */ + useEffect(() => { + const intervalId = window.setTimeout(() => { + if (!maskLayerRef.current) return; + maskLayerRef.current.cache({ + x: 0, + y: 0, + width, + height, + }); + }, 0); + + return () => { + window.clearTimeout(intervalId); + }; + }); + + return null; +}; + +export default Cacher; diff --git a/frontend/src/features/tabs/Inpainting/components/InpaintingBoundingBoxPreview.tsx b/frontend/src/features/tabs/Inpainting/components/InpaintingBoundingBoxPreview.tsx new file mode 100644 index 0000000000..2525b8984c --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/components/InpaintingBoundingBoxPreview.tsx @@ -0,0 +1,310 @@ +import { createSelector } from '@reduxjs/toolkit'; +import Konva from 'konva'; +import { KonvaEventObject } from 'konva/lib/Node'; +import { Box } from 'konva/lib/shapes/Transformer'; +import { Vector2d } from 'konva/lib/types'; +import _ from 'lodash'; +import { useCallback, useEffect, useRef } from 'react'; +import { Group, Rect, Transformer } from 'react-konva'; +import { + RootState, + useAppDispatch, + useAppSelector, +} from '../../../../app/store'; +import { roundToMultiple } from '../../../../common/util/roundDownToMultiple'; +import { + InpaintingState, + setBoundingBoxCoordinate, + setBoundingBoxDimensions, +} from '../inpaintingSlice'; +import { rgbaColorToString } from '../util/colorToString'; +import { + DASH_WIDTH, + // MARCHING_ANTS_SPEED, +} from '../util/constants'; + +const boundingBoxPreviewSelector = createSelector( + (state: RootState) => state.inpainting, + (inpainting: InpaintingState) => { + const { + boundingBoxCoordinate, + boundingBoxDimensions, + boundingBoxPreviewFill, + canvasDimensions, + stageScale, + imageToInpaint, + shouldLockBoundingBox, + } = inpainting; + return { + boundingBoxCoordinate, + boundingBoxDimensions, + boundingBoxPreviewFillString: rgbaColorToString(boundingBoxPreviewFill), + canvasDimensions, + stageScale, + imageToInpaint, + dash: DASH_WIDTH / stageScale, // scale dash lengths + strokeWidth: 1 / stageScale, // scale stroke thickness + shouldLockBoundingBox, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +/** + * Shades the area around the mask. + */ +export const InpaintingBoundingBoxPreviewOverlay = () => { + const { + boundingBoxCoordinate, + boundingBoxDimensions, + boundingBoxPreviewFillString, + canvasDimensions, + } = useAppSelector(boundingBoxPreviewSelector); + + return ( + + + + + ); +}; + +const InpaintingBoundingBoxPreview = () => { + const dispatch = useAppDispatch(); + const { + boundingBoxCoordinate, + boundingBoxDimensions, + strokeWidth, + stageScale, + imageToInpaint, + shouldLockBoundingBox, + } = useAppSelector(boundingBoxPreviewSelector); + + const transformerRef = useRef(null); + const shapeRef = useRef(null); + + useEffect(() => { + if (!transformerRef.current || !shapeRef.current) return; + transformerRef.current.nodes([shapeRef.current]); + transformerRef.current.getLayer()?.batchDraw(); + }, [shouldLockBoundingBox]); + + const scaledStep = 64 * stageScale; + + const handleOnDragMove = useCallback( + (e: KonvaEventObject) => { + dispatch( + setBoundingBoxCoordinate({ + x: Math.floor(e.target.x()), + y: Math.floor(e.target.y()), + }) + ); + }, + [dispatch] + ); + + const dragBoundFunc = useCallback( + (position: Vector2d) => { + if (!imageToInpaint) return boundingBoxCoordinate; + + const { x, y } = position; + + const maxX = imageToInpaint.width - boundingBoxDimensions.width; + const maxY = imageToInpaint.height - boundingBoxDimensions.height; + + const clampedX = Math.floor(_.clamp(x, 0, maxX * stageScale)); + const clampedY = Math.floor(_.clamp(y, 0, maxY * stageScale)); + + return { x: clampedX, y: clampedY }; + }, + [boundingBoxCoordinate, boundingBoxDimensions, imageToInpaint, stageScale] + ); + + const handleOnTransform = useCallback(() => { + /** + * The Konva Transformer changes the object's anchor point and scale factor, + * not its width and height. We need to un-scale the width and height before + * setting the values. + */ + if (!shapeRef.current) return; + + const rect = shapeRef.current; + + const scaleX = rect.scaleX(); + const scaleY = rect.scaleY(); + + // undo the scaling + const width = Math.round(rect.width() * scaleX); + const height = Math.round(rect.height() * scaleY); + + const x = Math.round(rect.x()); + const y = Math.round(rect.y()); + + dispatch( + setBoundingBoxDimensions({ + width, + height, + }) + ); + + dispatch( + setBoundingBoxCoordinate({ + x, + y, + }) + ); + + // Reset the scale now that the coords/dimensions have been un-scaled + rect.scaleX(1); + rect.scaleY(1); + }, [dispatch]); + + const anchorDragBoundFunc = useCallback( + ( + oldPos: Vector2d, // old absolute position of anchor point + newPos: Vector2d, // new absolute position (potentially) of anchor point + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _e: MouseEvent + ) => { + /** + * Konva does not transform with width or height. It transforms the anchor point + * and scale factor. This is then sent to the shape's onTransform listeners. + * + * We need to snap the new width to steps of 64 without also snapping the + * coordinates of the bounding box to steps of 64. But because the whole + * stage is scaled, our actual desired step is actually 64 * the stage scale. + */ + + // Difference of the old coords from the nearest multiple the scaled step + const offsetX = oldPos.x % scaledStep; + const offsetY = oldPos.y % scaledStep; + + // Round new position to the nearest multiple of the scaled step + const closestX = roundToMultiple(newPos.x, scaledStep) + offsetX; + const closestY = roundToMultiple(newPos.y, scaledStep) + offsetY; + + // the difference between the old coord and new + const diffX = Math.abs(newPos.x - closestX); + const diffY = Math.abs(newPos.y - closestY); + + // if the difference is less than the scaled step, we want to snap + const didSnapX = diffX < scaledStep; + const didSnapY = diffY < scaledStep; + + // We may not change anything, stash the old position + let newCoordinate = { ...oldPos }; + + // Set the new coords based on what snapped + if (didSnapX && !didSnapY) { + newCoordinate = { + x: closestX, + y: oldPos.y, + }; + } else if (!didSnapX && didSnapY) { + newCoordinate = { + x: oldPos.x, + y: closestY, + }; + } else if (didSnapX && didSnapY) { + newCoordinate = { + x: closestX, + y: closestY, + }; + } + + return newCoordinate; + }, + [scaledStep] + ); + + const boundBoxFunc = useCallback( + (oldBoundBox: Box, newBoundBox: Box) => { + /** + * The transformer uses this callback to limit valid transformations. + * Unlike anchorDragBoundFunc, it does get a width and height, so + * the logic to constrain the size of the bounding box is very simple. + */ + if (!imageToInpaint) return oldBoundBox; + + if ( + newBoundBox.width + newBoundBox.x > imageToInpaint.width * stageScale || + newBoundBox.height + newBoundBox.y > + imageToInpaint.height * stageScale || + newBoundBox.x < 0 || + newBoundBox.y < 0 + ) { + return oldBoundBox; + } + + return newBoundBox; + }, + [imageToInpaint, stageScale] + ); + + return ( + <> + { + const container = e?.target?.getStage()?.container(); + if (!container) return; + container.style.cursor = shouldLockBoundingBox ? 'none' : 'move'; + }} + onMouseLeave={(e) => { + const container = e?.target?.getStage()?.container(); + if (!container) return; + container.style.cursor = shouldLockBoundingBox ? 'none' : 'default'; + }} + draggable={!shouldLockBoundingBox} + onDragMove={handleOnDragMove} + dragBoundFunc={dragBoundFunc} + onTransform={handleOnTransform} + /> + + + ); +}; + +export default InpaintingBoundingBoxPreview; diff --git a/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasBrushPreview.tsx b/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasBrushPreview.tsx new file mode 100644 index 0000000000..f88150d794 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasBrushPreview.tsx @@ -0,0 +1,72 @@ +import { createSelector } from '@reduxjs/toolkit'; +import _ from 'lodash'; +import { Circle } from 'react-konva'; +import { RootState, useAppSelector } from '../../../../app/store'; +import { InpaintingState } from '../inpaintingSlice'; +import { rgbaColorToRgbString } from '../util/colorToString'; + +const inpaintingCanvasBrushPreviewSelector = createSelector( + (state: RootState) => state.inpainting, + (inpainting: InpaintingState) => { + const { + cursorPosition, + canvasDimensions: { width, height }, + shouldShowBrushPreview, + brushSize, + maskColor, + tool, + shouldShowBrush, + } = inpainting; + + return { + cursorPosition, + width, + height, + shouldShowBrushPreview, + brushSize, + maskColorString: rgbaColorToRgbString(maskColor), + tool, + shouldShowBrush, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +/** + * Draws a black circle around the canvas brush preview. + */ +const InpaintingCanvasBrushPreview = () => { + const { + cursorPosition, + width, + height, + shouldShowBrushPreview, + brushSize, + maskColorString, + tool, + shouldShowBrush, + } = useAppSelector(inpaintingCanvasBrushPreviewSelector); + + if (!shouldShowBrush || !(cursorPosition || shouldShowBrushPreview)) { + return null; + } + + return ( + + ); +}; + +export default InpaintingCanvasBrushPreview; diff --git a/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasBrushPreviewOutline.tsx b/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasBrushPreviewOutline.tsx new file mode 100644 index 0000000000..83563be337 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasBrushPreviewOutline.tsx @@ -0,0 +1,74 @@ +import { createSelector } from '@reduxjs/toolkit'; +import _ from 'lodash'; +import { Circle } from 'react-konva'; +import { RootState, useAppSelector } from '../../../../app/store'; +import { InpaintingState } from '../inpaintingSlice'; + +const inpaintingCanvasBrushPreviewSelector = createSelector( + (state: RootState) => state.inpainting, + (inpainting: InpaintingState) => { + const { + cursorPosition, + canvasDimensions: { width, height }, + shouldShowBrushPreview, + brushSize, + stageScale, + shouldShowBrush, + } = inpainting; + + return { + cursorPosition, + width, + height, + shouldShowBrushPreview, + brushSize, + strokeWidth: 1 / stageScale, // scale stroke thickness + shouldShowBrush, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +/** + * Draws the canvas brush preview outline. + */ +const InpaintingCanvasBrushPreviewOutline = () => { + const { + cursorPosition, + width, + height, + shouldShowBrushPreview, + brushSize, + strokeWidth, + shouldShowBrush, + } = useAppSelector(inpaintingCanvasBrushPreviewSelector); + + if (!shouldShowBrush || !(cursorPosition || shouldShowBrushPreview)) + return null; + + return ( + <> + + + + ); +}; +export default InpaintingCanvasBrushPreviewOutline; diff --git a/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasLines.tsx b/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasLines.tsx new file mode 100644 index 0000000000..d9cc41038d --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/components/InpaintingCanvasLines.tsx @@ -0,0 +1,37 @@ +import { Line } from 'react-konva'; +import { useAppSelector } from '../../../../app/store'; +import { inpaintingCanvasLinesSelector } from '../inpaintingSliceSelectors'; + +/** + * Draws the lines which comprise the mask. + * + * Uses globalCompositeOperation to handle the brush and eraser tools. + */ +const InpaintingCanvasLines = () => { + const { lines, maskColorString } = useAppSelector( + inpaintingCanvasLinesSelector + ); + + return ( + <> + {lines.map((line, i) => ( + + ))} + + ); +}; + +export default InpaintingCanvasLines; diff --git a/frontend/src/features/tabs/Inpainting/components/KeyboardEventManager.tsx b/frontend/src/features/tabs/Inpainting/components/KeyboardEventManager.tsx new file mode 100644 index 0000000000..34a1f31fd0 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/components/KeyboardEventManager.tsx @@ -0,0 +1,123 @@ +import { createSelector } from '@reduxjs/toolkit'; +import _ from 'lodash'; +import { useEffect, useRef } from 'react'; +import { + RootState, + useAppDispatch, + useAppSelector, +} from '../../../../app/store'; +import { OptionsState } from '../../../options/optionsSlice'; +import { tabMap } from '../../InvokeTabs'; +import { + InpaintingState, + setIsDrawing, + setShouldLockBoundingBox, + toggleTool, +} from '../inpaintingSlice'; + +const keyboardEventManagerSelector = createSelector( + [(state: RootState) => state.options, (state: RootState) => state.inpainting], + (options: OptionsState, inpainting: InpaintingState) => { + const { shouldShowMask, cursorPosition, shouldLockBoundingBox } = + inpainting; + return { + activeTabName: tabMap[options.activeTab], + shouldShowMask, + isCursorOnCanvas: Boolean(cursorPosition), + shouldLockBoundingBox, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +const KeyboardEventManager = () => { + const dispatch = useAppDispatch(); + const { + shouldShowMask, + activeTabName, + isCursorOnCanvas, + shouldLockBoundingBox, + } = useAppSelector(keyboardEventManagerSelector); + + const wasLastEventOverCanvas = useRef(false); + const lastEvent = useRef(null); + + useEffect(() => { + const listener = (e: KeyboardEvent) => { + if ( + !['z', ' '].includes(e.key) || + activeTabName !== 'inpainting' || + !shouldShowMask + ) { + return; + } + + // cursor is NOT over canvas + if (!isCursorOnCanvas) { + if (!lastEvent.current) { + lastEvent.current = e; + } + + wasLastEventOverCanvas.current = false; + return; + } + e.stopPropagation(); + e.preventDefault(); + if (e.repeat) return; + // cursor is over canvas, we can preventDefault now + + // if this is the first event + if (!lastEvent.current) { + wasLastEventOverCanvas.current = true; + lastEvent.current = e; + } + + if (!wasLastEventOverCanvas.current && e.type === 'keyup') { + wasLastEventOverCanvas.current = true; + lastEvent.current = e; + return; + } + + switch (e.key) { + case 'z': { + dispatch(toggleTool()); + break; + } + case ' ': { + if (!shouldShowMask) break; + + if (e.type === 'keydown') { + dispatch(setIsDrawing(false)); + } + dispatch(setShouldLockBoundingBox(!shouldLockBoundingBox)); + break; + } + } + + lastEvent.current = e; + wasLastEventOverCanvas.current = true; + }; + + document.addEventListener('keydown', listener); + document.addEventListener('keyup', listener); + + return () => { + document.removeEventListener('keydown', listener); + document.removeEventListener('keyup', listener); + }; + }, [ + dispatch, + activeTabName, + shouldShowMask, + isCursorOnCanvas, + shouldLockBoundingBox, + ]); + + return null; +}; + +export default KeyboardEventManager; diff --git a/frontend/src/features/tabs/Inpainting/hooks/_useInpaintingHotkeys.ts b/frontend/src/features/tabs/Inpainting/hooks/_useInpaintingHotkeys.ts new file mode 100644 index 0000000000..af7f380fef --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/hooks/_useInpaintingHotkeys.ts @@ -0,0 +1,146 @@ +import { useToast } from '@chakra-ui/react'; +import { useHotkeys } from 'react-hotkeys-hook'; + +type UseInpaintingHotkeysConfig = { + activeTab: string; + brushSize: number; + handleChangeBrushSize: (newBrushSize: number) => void; + handleSelectEraserTool: () => void; + handleSelectBrushTool: () => void; + canUndo: boolean; + handleUndo: () => void; + canRedo: boolean; + handleRedo: () => void; + canClearMask: boolean; + handleClearMask: () => void; +}; + +const useInpaintingHotkeys = (config: UseInpaintingHotkeysConfig) => { + const { + activeTab, + brushSize, + handleChangeBrushSize, + handleSelectEraserTool, + handleSelectBrushTool, + canUndo, + handleUndo, + canRedo, + handleRedo, + canClearMask, + handleClearMask, + } = config; + + const toast = useToast(); + // Hotkeys + useHotkeys( + '[', + () => { + if (activeTab === 'inpainting' && brushSize - 5 > 0) { + handleChangeBrushSize(brushSize - 5); + } else { + handleChangeBrushSize(1); + } + }, + [brushSize] + ); + + useHotkeys( + ']', + () => { + if (activeTab === 'inpainting') { + handleChangeBrushSize(brushSize + 5); + } + }, + [brushSize] + ); + + useHotkeys('e', () => { + if (activeTab === 'inpainting') { + handleSelectEraserTool(); + } + }); + + useHotkeys('b', () => { + if (activeTab === 'inpainting') { + handleSelectBrushTool(); + } + }); + + useHotkeys( + 'cmd+z', + () => { + if (activeTab === 'inpainting' && canUndo) { + handleUndo(); + } + }, + [canUndo] + ); + + useHotkeys( + 'control+z', + () => { + if (activeTab === 'inpainting' && canUndo) { + handleUndo(); + } + }, + [canUndo] + ); + + useHotkeys( + 'cmd+shift+z', + () => { + if (activeTab === 'inpainting' && canRedo) { + handleRedo(); + } + }, + [canRedo] + ); + + useHotkeys( + 'control+shift+z', + () => { + if (activeTab === 'inpainting' && canRedo) { + handleRedo(); + } + }, + [canRedo] + ); + + useHotkeys( + 'control+y', + () => { + if (activeTab === 'inpainting' && canRedo) { + handleRedo(); + } + }, + [canRedo] + ); + + useHotkeys( + 'cmd+y', + () => { + if (activeTab === 'inpainting' && canRedo) { + handleRedo(); + } + }, + [canRedo] + ); + + useHotkeys( + 'c', + () => { + if (activeTab === 'inpainting' && canClearMask) { + handleClearMask(); + toast({ + title: 'Mask Cleared', + status: 'success', + duration: 2500, + isClosable: true, + }); + } + }, + [canClearMask] + ); +}; + +export default useInpaintingHotkeys; diff --git a/frontend/src/features/tabs/Inpainting/index.tsx b/frontend/src/features/tabs/Inpainting/index.tsx new file mode 100644 index 0000000000..4b63c43412 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/index.tsx @@ -0,0 +1,14 @@ +import InpaintingPanel from './InpaintingPanel'; +import InpaintingDisplay from './InpaintingDisplay'; +import InvokeWorkarea from '../InvokeWorkarea'; + +export default function InpaintingWorkarea() { + return ( + } + styleClass="inpainting-workarea-overrides" + > + + + ); +} diff --git a/frontend/src/features/tabs/Inpainting/inpaintingSlice.ts b/frontend/src/features/tabs/Inpainting/inpaintingSlice.ts new file mode 100644 index 0000000000..fe0e12bbed --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/inpaintingSlice.ts @@ -0,0 +1,363 @@ +import { createSlice } from '@reduxjs/toolkit'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { Vector2d } from 'konva/lib/types'; +import { RgbaColor } from 'react-colorful'; +import * as InvokeAI from '../../../app/invokeai'; +import _ from 'lodash'; +import { roundDownToMultiple } from '../../../common/util/roundDownToMultiple'; + +export type InpaintingTool = 'brush' | 'eraser'; + +export type MaskLine = { + tool: InpaintingTool; + strokeWidth: number; + points: number[]; +}; + +export type MaskCircle = { + tool: InpaintingTool; + radius: number; + x: number; + y: number; +}; + +export type Dimensions = { + width: number; + height: number; +}; + +export type BoundingBoxPreviewType = 'overlay' | 'ants' | 'marchingAnts'; + +export interface InpaintingState { + tool: 'brush' | 'eraser'; + brushSize: number; + maskColor: RgbaColor; + cursorPosition: Vector2d | null; + canvasDimensions: Dimensions; + boundingBoxDimensions: Dimensions; + boundingBoxCoordinate: Vector2d; + boundingBoxPreviewFill: RgbaColor; + shouldShowBoundingBox: boolean; + shouldShowBoundingBoxFill: boolean; + lines: MaskLine[]; + pastLines: MaskLine[][]; + futureLines: MaskLine[][]; + shouldShowMask: boolean; + shouldInvertMask: boolean; + shouldShowCheckboardTransparency: boolean; + shouldShowBrush: boolean; + shouldShowBrushPreview: boolean; + imageToInpaint?: InvokeAI.Image; + needsCache: boolean; + stageScale: number; + isDrawing: boolean; + shouldUseInpaintReplace: boolean; + inpaintReplace: number; + shouldLockBoundingBox: boolean; +} + +const initialInpaintingState: InpaintingState = { + tool: 'brush', + brushSize: 50, + maskColor: { r: 255, g: 90, b: 90, a: 0.5 }, + canvasDimensions: { width: 0, height: 0 }, + boundingBoxDimensions: { width: 64, height: 64 }, + boundingBoxCoordinate: { x: 0, y: 0 }, + boundingBoxPreviewFill: { r: 0, g: 0, b: 0, a: 0.7 }, + shouldShowBoundingBox: false, + shouldShowBoundingBoxFill: false, + cursorPosition: null, + lines: [], + pastLines: [], + futureLines: [], + shouldShowMask: true, + shouldInvertMask: false, + shouldShowCheckboardTransparency: false, + shouldShowBrush: true, + shouldShowBrushPreview: false, + needsCache: false, + isDrawing: false, + stageScale: 1, + shouldUseInpaintReplace: false, + inpaintReplace: 1, + shouldLockBoundingBox: true, +}; + +const initialState: InpaintingState = initialInpaintingState; + +export const inpaintingSlice = createSlice({ + name: 'inpainting', + initialState, + reducers: { + setTool: (state, action: PayloadAction) => { + state.tool = action.payload; + }, + toggleTool: (state) => { + state.tool = state.tool === 'brush' ? 'eraser' : 'brush'; + }, + setBrushSize: (state, action: PayloadAction) => { + state.brushSize = action.payload; + }, + addLine: (state, action: PayloadAction) => { + state.pastLines.push(state.lines); + state.lines.push(action.payload); + state.futureLines = []; + }, + addPointToCurrentLine: (state, action: PayloadAction) => { + state.lines[state.lines.length - 1].points.push(...action.payload); + }, + undo: (state) => { + if (state.pastLines.length === 0) return; + const newLines = state.pastLines.pop(); + if (!newLines) return; + state.futureLines.unshift(state.lines); + state.lines = newLines; + }, + redo: (state) => { + if (state.futureLines.length === 0) return; + const newLines = state.futureLines.shift(); + if (!newLines) return; + state.pastLines.push(state.lines); + state.lines = newLines; + }, + clearMask: (state) => { + state.pastLines.push(state.lines); + state.lines = []; + state.futureLines = []; + state.shouldInvertMask = false; + }, + toggleShouldInvertMask: (state) => { + state.shouldInvertMask = !state.shouldInvertMask; + }, + toggleShouldShowMask: (state) => { + state.shouldShowMask = !state.shouldShowMask; + }, + setShouldInvertMask: (state, action: PayloadAction) => { + state.shouldInvertMask = action.payload; + }, + setShouldShowMask: (state, action: PayloadAction) => { + state.shouldShowMask = action.payload; + if (!action.payload) { + state.shouldInvertMask = false; + } + }, + setShouldShowCheckboardTransparency: ( + state, + action: PayloadAction + ) => { + state.shouldShowCheckboardTransparency = action.payload; + }, + setShouldShowBrushPreview: (state, action: PayloadAction) => { + state.shouldShowBrushPreview = action.payload; + }, + setShouldShowBrush: (state, action: PayloadAction) => { + state.shouldShowBrush = action.payload; + }, + setMaskColor: (state, action: PayloadAction) => { + state.maskColor = action.payload; + }, + setCursorPosition: (state, action: PayloadAction) => { + state.cursorPosition = action.payload; + }, + clearImageToInpaint: (state) => { + state.imageToInpaint = undefined; + }, + setImageToInpaint: (state, action: PayloadAction) => { + const { width: imageWidth, height: imageHeight } = action.payload; + const { width: boundingBoxWidth, height: boundingBoxHeight } = + state.boundingBoxDimensions; + const { x, y } = state.boundingBoxCoordinate; + + const newBoundingBoxWidth = roundDownToMultiple( + _.clamp(boundingBoxWidth, 64, imageWidth), + 64 + ); + + const newBoundingBoxHeight = roundDownToMultiple( + _.clamp(boundingBoxHeight, 64, imageHeight), + 64 + ); + + const newBoundingBoxX = roundDownToMultiple( + _.clamp(x, 0, imageWidth - newBoundingBoxWidth), + 64 + ); + + const newBoundingBoxY = roundDownToMultiple( + _.clamp(y, 0, imageHeight - newBoundingBoxHeight), + 64 + ); + + state.boundingBoxDimensions = { + width: newBoundingBoxWidth, + height: newBoundingBoxHeight, + }; + + state.boundingBoxCoordinate = { x: newBoundingBoxX, y: newBoundingBoxY }; + + state.canvasDimensions = { + width: imageWidth, + height: imageHeight, + }; + + state.imageToInpaint = action.payload; + state.needsCache = true; + }, + setCanvasDimensions: (state, action: PayloadAction) => { + state.canvasDimensions = action.payload; + + const { width: canvasWidth, height: canvasHeight } = action.payload; + + const { width: boundingBoxWidth, height: boundingBoxHeight } = + state.boundingBoxDimensions; + + const newBoundingBoxWidth = roundDownToMultiple( + _.clamp(boundingBoxWidth, 64, canvasWidth), + 64 + ); + const newBoundingBoxHeight = roundDownToMultiple( + _.clamp(boundingBoxHeight, 64, canvasHeight), + 64 + ); + + state.boundingBoxDimensions = { + width: newBoundingBoxWidth, + height: newBoundingBoxHeight, + }; + }, + setBoundingBoxDimensions: (state, action: PayloadAction) => { + state.boundingBoxDimensions = action.payload; + const { width: boundingBoxWidth, height: boundingBoxHeight } = + action.payload; + const { x: boundingBoxX, y: boundingBoxY } = state.boundingBoxCoordinate; + const { width: canvasWidth, height: canvasHeight } = + state.canvasDimensions; + + const roundedCanvasWidth = roundDownToMultiple(canvasWidth, 64); + const roundedCanvasHeight = roundDownToMultiple(canvasHeight, 64); + + const roundedBoundingBoxWidth = roundDownToMultiple(boundingBoxWidth, 64); + const roundedBoundingBoxHeight = roundDownToMultiple( + boundingBoxHeight, + 64 + ); + + const overflowX = boundingBoxX + boundingBoxWidth - canvasWidth; + const overflowY = boundingBoxY + boundingBoxHeight - canvasHeight; + + const newBoundingBoxWidth = _.clamp( + roundedBoundingBoxWidth, + 64, + roundedCanvasWidth + ); + + const newBoundingBoxHeight = _.clamp( + roundedBoundingBoxHeight, + 64, + roundedCanvasHeight + ); + + const overflowCorrectedX = + overflowX > 0 ? boundingBoxX - overflowX : boundingBoxX; + + const overflowCorrectedY = + overflowY > 0 ? boundingBoxY - overflowY : boundingBoxY; + + const clampedX = _.clamp( + overflowCorrectedX, + 0, + roundedCanvasWidth - newBoundingBoxWidth + ); + + const clampedY = _.clamp( + overflowCorrectedY, + 0, + roundedCanvasHeight - newBoundingBoxHeight + ); + + state.boundingBoxDimensions = { + width: newBoundingBoxWidth, + height: newBoundingBoxHeight, + }; + + state.boundingBoxCoordinate = { + x: clampedX, + y: clampedY, + }; + }, + setBoundingBoxCoordinate: (state, action: PayloadAction) => { + state.boundingBoxCoordinate = action.payload; + }, + setBoundingBoxPreviewFill: (state, action: PayloadAction) => { + state.boundingBoxPreviewFill = action.payload; + }, + setNeedsCache: (state, action: PayloadAction) => { + state.needsCache = action.payload; + }, + setStageScale: (state, action: PayloadAction) => { + state.stageScale = action.payload; + state.needsCache = false; + }, + setShouldShowBoundingBoxFill: (state, action: PayloadAction) => { + state.shouldShowBoundingBoxFill = action.payload; + }, + setIsDrawing: (state, action: PayloadAction) => { + state.isDrawing = action.payload; + }, + setShouldShowBoundingBox: (state, action: PayloadAction) => { + state.shouldShowBoundingBox = action.payload; + }, + setClearBrushHistory: (state) => { + state.pastLines = []; + state.futureLines = []; + }, + setShouldUseInpaintReplace: (state, action: PayloadAction) => { + state.shouldUseInpaintReplace = action.payload; + }, + setInpaintReplace: (state, action: PayloadAction) => { + state.inpaintReplace = action.payload; + }, + setShouldLockBoundingBox: (state, action: PayloadAction) => { + state.shouldLockBoundingBox = action.payload; + }, + toggleShouldLockBoundingBox: (state) => { + state.shouldLockBoundingBox = !state.shouldLockBoundingBox; + }, + }, +}); + +export const { + setTool, + setBrushSize, + addLine, + addPointToCurrentLine, + setShouldInvertMask, + setShouldShowMask, + setShouldShowCheckboardTransparency, + setShouldShowBrushPreview, + setMaskColor, + clearMask, + clearImageToInpaint, + undo, + redo, + setCursorPosition, + setCanvasDimensions, + setImageToInpaint, + setBoundingBoxDimensions, + setBoundingBoxCoordinate, + setBoundingBoxPreviewFill, + setNeedsCache, + setStageScale, + toggleTool, + setShouldShowBoundingBoxFill, + setIsDrawing, + setShouldShowBrush, + setShouldShowBoundingBox, + setClearBrushHistory, + setShouldUseInpaintReplace, + setInpaintReplace, + setShouldLockBoundingBox, + toggleShouldLockBoundingBox, +} = inpaintingSlice.actions; + +export default inpaintingSlice.reducer; diff --git a/frontend/src/features/tabs/Inpainting/inpaintingSliceSelectors.ts b/frontend/src/features/tabs/Inpainting/inpaintingSliceSelectors.ts new file mode 100644 index 0000000000..3edb3eb06f --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/inpaintingSliceSelectors.ts @@ -0,0 +1,105 @@ +import { createSelector } from '@reduxjs/toolkit'; +import _ from 'lodash'; +import { RootState } from '../../../app/store'; +import { OptionsState } from '../../options/optionsSlice'; +import { tabMap } from '../InvokeTabs'; +import { InpaintingState } from './inpaintingSlice'; +import { rgbaColorToRgbString } from './util/colorToString'; + +export const inpaintingCanvasLinesSelector = createSelector( + (state: RootState) => state.inpainting, + (inpainting: InpaintingState) => { + const { lines, maskColor } = inpainting; + return { + lines, + maskColorString: rgbaColorToRgbString(maskColor), + }; + } +); + +export const inpaintingControlsSelector = createSelector( + [(state: RootState) => state.inpainting, (state: RootState) => state.options], + (inpainting: InpaintingState, options: OptionsState) => { + const { + tool, + brushSize, + maskColor, + shouldInvertMask, + shouldShowMask, + shouldShowCheckboardTransparency, + lines, + pastLines, + futureLines, + shouldShowBoundingBoxFill, + shouldShowBoundingBox, + } = inpainting; + + const { activeTab, showDualDisplay } = options; + + return { + tool, + brushSize, + maskColor, + shouldInvertMask, + shouldShowMask, + shouldShowCheckboardTransparency, + canUndo: pastLines.length > 0, + canRedo: futureLines.length > 0, + isMaskEmpty: lines.length === 0, + activeTabName: tabMap[activeTab], + showDualDisplay, + shouldShowBoundingBoxFill, + shouldShowBoundingBox, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: _.isEqual, + }, + } +); + +export const inpaintingCanvasSelector = createSelector( + (state: RootState) => state.inpainting, + (inpainting: InpaintingState) => { + const { + tool, + brushSize, + maskColor, + shouldInvertMask, + shouldShowMask, + shouldShowCheckboardTransparency, + imageToInpaint, + stageScale, + shouldShowBoundingBoxFill, + isDrawing, + shouldLockBoundingBox, + shouldShowBoundingBox, + } = inpainting; + return { + tool, + brushSize, + shouldInvertMask, + shouldShowMask, + shouldShowCheckboardTransparency, + maskColor, + imageToInpaint, + stageScale, + shouldShowBoundingBoxFill, + isDrawing, + shouldLockBoundingBox, + shouldShowBoundingBox, + }; + }, + { + memoizeOptions: { + resultEqualityCheck: (a, b) => { + const { imageToInpaint: a_imageToInpaint, ...a_rest } = a; + const { imageToInpaint: b_imageToInpaint, ...b_rest } = b; + return ( + _.isEqual(a_rest, b_rest) && a_imageToInpaint == b_imageToInpaint + ); + }, + }, + } +); diff --git a/frontend/src/features/tabs/Inpainting/util/checkIsMaskEmpty.ts b/frontend/src/features/tabs/Inpainting/util/checkIsMaskEmpty.ts new file mode 100644 index 0000000000..cf93658057 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/util/checkIsMaskEmpty.ts @@ -0,0 +1,49 @@ +import Konva from 'konva'; +import { MaskLine } from '../inpaintingSlice'; + +/** + * Converts canvas into pixel buffer and checks if it is empty (all pixels full alpha). + * + * I DON' THINK THIS WORKS ACTUALLY + */ +const checkIsMaskEmpty = (image: HTMLImageElement, lines: MaskLine[]) => { + const offscreenContainer = document.createElement('div'); + + const { width, height } = image; + + const stage = new Konva.Stage({ + container: offscreenContainer, + width: width, + height: height, + }); + + const layer = new Konva.Layer(); + + stage.add(layer); + + lines.forEach((line) => + layer.add( + new Konva.Line({ + points: line.points, + stroke: 'rgb(255,255,255)', + strokeWidth: line.strokeWidth * 2, + tension: 0, + lineCap: 'round', + lineJoin: 'round', + shadowForStrokeEnabled: false, + globalCompositeOperation: + line.tool === 'brush' ? 'source-over' : 'destination-out', + }) + ) + ); + + offscreenContainer.remove(); + + const pixelBuffer = new Uint32Array( + layer.getContext().getImageData(0, 0, width, height).data.buffer + ); + + return !pixelBuffer.some((color) => color !== 0); +}; + +export default checkIsMaskEmpty; diff --git a/frontend/src/features/tabs/Inpainting/util/colorToString.ts b/frontend/src/features/tabs/Inpainting/util/colorToString.ts new file mode 100644 index 0000000000..8d503f4cd1 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/util/colorToString.ts @@ -0,0 +1,16 @@ +import { RgbaColor, RgbColor } from 'react-colorful'; + +export const rgbaColorToString = (color: RgbaColor): string => { + const { r, g, b, a } = color; + return `rgba(${r}, ${g}, ${b}, ${a})`; +}; + +export const rgbaColorToRgbString = (color: RgbaColor): string => { + const { r, g, b } = color; + return `rgba(${r}, ${g}, ${b})`; +}; + +export const rgbColorToString = (color: RgbColor): string => { + const { r, g, b } = color; + return `rgba(${r}, ${g}, ${b})`; +}; diff --git a/frontend/src/features/tabs/Inpainting/util/constants.ts b/frontend/src/features/tabs/Inpainting/util/constants.ts new file mode 100644 index 0000000000..85fc3eb97c --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/util/constants.ts @@ -0,0 +1,10 @@ +// widths of ants-style bounding box outline +export const DASH_WIDTH = 4; + +// speed of marching ants (lower is faster) +export const MARCHING_ANTS_SPEED = 30; + +// bounding box anchor size +export const TRANSFORMER_ANCHOR_SIZE = 15; + + diff --git a/frontend/src/features/tabs/Inpainting/util/generateMask.ts b/frontend/src/features/tabs/Inpainting/util/generateMask.ts new file mode 100644 index 0000000000..7e294198fc --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/util/generateMask.ts @@ -0,0 +1,59 @@ +import Konva from 'konva'; +import { IRect } from 'konva/lib/types'; +import { MaskLine } from '../inpaintingSlice'; + +/** + * Generating a mask image from InpaintingCanvas.tsx is not as simple + * as calling toDataURL() on the canvas, because the mask may be represented + * by colored lines or transparency, or the user may have inverted the mask + * display. + * + * So we need to regenerate the mask image by creating an offscreen canvas, + * drawing the mask and compositing everything correctly to output a valid + * mask image. + */ +const generateMask = ( + image: HTMLImageElement, + lines: MaskLine[], + boundingBox: IRect +) => { + const { width, height } = image; + + const offscreenContainer = document.createElement('div'); + + const stage = new Konva.Stage({ + container: offscreenContainer, + width: width, + height: height, + }); + + const layer = new Konva.Layer(); + + stage.add(layer); + + lines.forEach((line) => + layer.add( + new Konva.Line({ + points: line.points, + stroke: 'rgb(255,255,255)', + strokeWidth: line.strokeWidth * 2, + tension: 0, + lineCap: 'round', + lineJoin: 'round', + shadowForStrokeEnabled: false, + globalCompositeOperation: + line.tool === 'brush' ? 'source-over' : 'destination-out', + }) + ) + ); + + layer.add( + new Konva.Image({ image: image, globalCompositeOperation: 'source-out' }) + ); + + offscreenContainer.remove(); + + return stage.toDataURL(); +}; + +export default generateMask; diff --git a/frontend/src/features/tabs/Inpainting/util/getScaledCursorPosition.ts b/frontend/src/features/tabs/Inpainting/util/getScaledCursorPosition.ts new file mode 100644 index 0000000000..07487f4ea8 --- /dev/null +++ b/frontend/src/features/tabs/Inpainting/util/getScaledCursorPosition.ts @@ -0,0 +1,18 @@ +import { Stage } from 'konva/lib/Stage'; + +const getScaledCursorPosition = (stage: Stage) => { + const pointerPosition = stage.getPointerPosition(); + + const stageTransform = stage.getAbsoluteTransform().copy(); + + if (!pointerPosition || !stageTransform) return; + + const scaledCursorPosition = stageTransform.invert().point(pointerPosition); + + return { + x: Math.floor(scaledCursorPosition.x), + y: Math.floor(scaledCursorPosition.y), + }; +}; + +export default getScaledCursorPosition; diff --git a/frontend/src/features/tabs/InvokeTabs.scss b/frontend/src/features/tabs/InvokeTabs.scss index 3ac4bd78aa..b5c9ba4a8b 100644 --- a/frontend/src/features/tabs/InvokeTabs.scss +++ b/frontend/src/features/tabs/InvokeTabs.scss @@ -3,7 +3,7 @@ .app-tabs { display: grid !important; grid-template-columns: min-content auto; - column-gap: 1rem; + column-gap: 0.5rem; } .app-tabs-list { diff --git a/frontend/src/features/tabs/InvokeTabs.tsx b/frontend/src/features/tabs/InvokeTabs.tsx index d0cc0947e2..e422184a29 100644 --- a/frontend/src/features/tabs/InvokeTabs.tsx +++ b/frontend/src/features/tabs/InvokeTabs.tsx @@ -3,7 +3,6 @@ import _ from 'lodash'; import React, { ReactElement } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; import { RootState, useAppDispatch, useAppSelector } from '../../app/store'; -import InpaintingWIP from '../../common/components/WorkInProgress/InpaintingWIP'; import NodesWIP from '../../common/components/WorkInProgress/NodesWIP'; import OutpaintingWIP from '../../common/components/WorkInProgress/OutpaintingWIP'; import { PostProcessingWIP } from '../../common/components/WorkInProgress/PostProcessingWIP'; @@ -14,38 +13,39 @@ import OutpaintIcon from '../../common/icons/OutpaintIcon'; import PostprocessingIcon from '../../common/icons/PostprocessingIcon'; import TextToImageIcon from '../../common/icons/TextToImageIcon'; import { setActiveTab } from '../options/optionsSlice'; -import ImageToImage from './ImageToImage/ImageToImage'; -import TextToImage from './TextToImage/TextToImage'; +import ImageToImageWorkarea from './ImageToImage'; +import InpaintingWorkarea from './Inpainting'; +import TextToImageWorkarea from './TextToImage'; export const tab_dict = { txt2img: { title: , - panel: , + workarea: , tooltip: 'Text To Image', }, img2img: { title: , - panel: , + workarea: , tooltip: 'Image To Image', }, inpainting: { title: , - panel: , + workarea: , tooltip: 'Inpainting', }, outpainting: { title: , - panel: , + workarea: , tooltip: 'Outpainting', }, nodes: { title: , - panel: , + workarea: , tooltip: 'Nodes', }, postprocess: { title: , - panel: , + workarea: , tooltip: 'Post Processing', }, }; @@ -109,7 +109,7 @@ export default function InvokeTabs() { Object.keys(tab_dict).forEach((key) => { tabPanelsToRender.push( - {tab_dict[key as keyof typeof tab_dict].panel} + {tab_dict[key as keyof typeof tab_dict].workarea} ); }); diff --git a/frontend/src/features/tabs/InvokeWorkarea.scss b/frontend/src/features/tabs/InvokeWorkarea.scss new file mode 100644 index 0000000000..0850779af1 --- /dev/null +++ b/frontend/src/features/tabs/InvokeWorkarea.scss @@ -0,0 +1,47 @@ +@use '../../styles/Mixins/' as *; + +.workarea-wrapper { + position: relative; + width: 100%; + height: 100%; + + .workarea-main { + display: flex; + column-gap: 0.5rem; + height: 100%; + + .workarea-options-panel { + width: $options-bar-max-width; + max-width: $options-bar-max-width; + flex-shrink: 0; + } + + .workarea-split-view { + width: 100%; + display: grid; + grid-template-columns: 1fr 1fr; + // height: $app-content-height; + background-color: var(--background-color-secondary); + border-radius: 0.5rem; + } + + .workarea-single-view { + width: 100%; + // height: $app-content-height; + background-color: var(--background-color-secondary); + border-radius: 0.5rem; + } + + .workarea-split-view-left, + .workarea-split-view-right { + display: flex; + flex-direction: column; + height: 100%; + width: 100%; + row-gap: 1rem; + background-color: var(--background-color-secondary); + border-radius: 0.5rem; + padding: 1rem; + } + } +} diff --git a/frontend/src/features/tabs/InvokeWorkarea.tsx b/frontend/src/features/tabs/InvokeWorkarea.tsx new file mode 100644 index 0000000000..4350cc45ac --- /dev/null +++ b/frontend/src/features/tabs/InvokeWorkarea.tsx @@ -0,0 +1,36 @@ +import { ReactNode } from 'react'; +import { RootState, useAppSelector } from '../../app/store'; +import ImageGallery from '../gallery/ImageGallery'; +import ShowHideGalleryButton from '../gallery/ShowHideGalleryButton'; + +type InvokeWorkareaProps = { + optionsPanel: ReactNode; + children: ReactNode; + styleClass?: string; +}; + +const InvokeWorkarea = (props: InvokeWorkareaProps) => { + const { optionsPanel, children, styleClass } = props; + + const { shouldShowGallery, shouldHoldGalleryOpen, shouldPinGallery } = + useAppSelector((state: RootState) => state.gallery); + + return ( +
+
+
{optionsPanel}
+ {children} + +
+ {!(shouldShowGallery || (shouldHoldGalleryOpen && !shouldPinGallery)) && ( + + )} +
+ ); +}; + +export default InvokeWorkarea; diff --git a/frontend/src/features/tabs/TextToImage/TextToImage.scss b/frontend/src/features/tabs/TextToImage/TextToImage.scss index 4c24257bae..ae60236126 100644 --- a/frontend/src/features/tabs/TextToImage/TextToImage.scss +++ b/frontend/src/features/tabs/TextToImage/TextToImage.scss @@ -1,9 +1,8 @@ @use '../../../styles/Mixins/' as *; -.text-to-image-workarea { - display: grid; - grid-template-columns: max-content auto; - column-gap: 1rem; +.text-to-image-area { + padding: 1rem; + height: 100%; } .text-to-image-panel { @@ -14,21 +13,3 @@ overflow-y: scroll; @include HideScrollbar; } - -.text-to-image-display { - display: grid; - grid-template-areas: 'text-to-image-display'; - column-gap: 0.5rem; - - .current-image-display, - .current-image-display-placeholder { - grid-area: text-to-image-display; - height: $app-content-height; - } - - .image-gallery-area { - height: 100%; - z-index: 2; - place-self: end; - } -} diff --git a/frontend/src/features/tabs/TextToImage/TextToImage.tsx b/frontend/src/features/tabs/TextToImage/TextToImage.tsx deleted file mode 100644 index 910119ad2c..0000000000 --- a/frontend/src/features/tabs/TextToImage/TextToImage.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import TextToImagePanel from './TextToImagePanel'; -import CurrentImageDisplay from '../../gallery/CurrentImageDisplay'; -import ImageGallery from '../../gallery/ImageGallery'; -import { RootState, useAppSelector } from '../../../app/store'; - -export default function TextToImage() { - const shouldShowGallery = useAppSelector( - (state: RootState) => state.options.shouldShowGallery - ); - - return ( -
- -
- - -
-
- ); -} diff --git a/frontend/src/features/tabs/TextToImage/TextToImageDisplay.tsx b/frontend/src/features/tabs/TextToImage/TextToImageDisplay.tsx new file mode 100644 index 0000000000..4ea9736f35 --- /dev/null +++ b/frontend/src/features/tabs/TextToImage/TextToImageDisplay.tsx @@ -0,0 +1,13 @@ +import CurrentImageDisplay from '../../gallery/CurrentImageDisplay'; + +const TextToImageDisplay = () => { + return ( +
+
+ +
+
+ ); +}; + +export default TextToImageDisplay; diff --git a/frontend/src/features/tabs/TextToImage/TextToImagePanel.tsx b/frontend/src/features/tabs/TextToImage/TextToImagePanel.tsx index d4b3b722b6..120c31e94d 100644 --- a/frontend/src/features/tabs/TextToImage/TextToImagePanel.tsx +++ b/frontend/src/features/tabs/TextToImage/TextToImagePanel.tsx @@ -1,20 +1,18 @@ -import { Box } from '@chakra-ui/react'; -import React from 'react'; import { Feature } from '../../../app/features'; import { RootState, useAppSelector } from '../../../app/store'; -import FaceRestore from '../../options/AdvancedOptions/FaceRestore/FaceRestore'; +import FaceRestoreHeader from '../../options/AdvancedOptions/FaceRestore/FaceRestoreHeader'; import FaceRestoreOptions from '../../options/AdvancedOptions/FaceRestore/FaceRestoreOptions'; -import ImageToImageAccordion from '../../options/AdvancedOptions/ImageToImage/ImageToImageAccordion'; -import ImageToImageOptions from '../../options/AdvancedOptions/ImageToImage/ImageToImageOptions'; +import OutputHeader from '../../options/AdvancedOptions/Output/OutputHeader'; +import OutputOptions from '../../options/AdvancedOptions/Output/OutputOptions'; +import SeedHeader from '../../options/AdvancedOptions/Seed/SeedHeader'; import SeedOptions from '../../options/AdvancedOptions/Seed/SeedOptions'; -import Upscale from '../../options/AdvancedOptions/Upscale/Upscale'; +import UpscaleHeader from '../../options/AdvancedOptions/Upscale/UpscaleHeader'; import UpscaleOptions from '../../options/AdvancedOptions/Upscale/UpscaleOptions'; -import Variations from '../../options/AdvancedOptions/Variations/Variations'; +import VariationsHeader from '../../options/AdvancedOptions/Variations/VariationsHeader'; import VariationsOptions from '../../options/AdvancedOptions/Variations/VariationsOptions'; -import MainAdvancedOptions from '../../options/MainOptions/MainAdvancedOptions'; +import MainAdvancedOptionsCheckbox from '../../options/MainOptions/MainAdvancedOptionsCheckbox'; import MainOptions from '../../options/MainOptions/MainOptions'; import OptionsAccordion from '../../options/OptionsAccordion'; -import OutputOptions from '../../options/OutputOptions'; import ProcessButtons from '../../options/ProcessButtons/ProcessButtons'; import PromptInput from '../../options/PromptInput/PromptInput'; @@ -25,40 +23,27 @@ export default function TextToImagePanel() { const textToImageAccordions = { seed: { - header: ( - - Seed - - ), + header: , feature: Feature.SEED, options: , }, variations: { - header: , + header: , feature: Feature.VARIATIONS, options: , }, face_restore: { - header: , + header: , feature: Feature.FACE_CORRECTION, options: , }, upscale: { - header: , + header: , feature: Feature.UPSCALE, options: , }, - // img2img: { - // header: , - // feature: Feature.IMAGE_TO_IMAGE, - // options: , - // }, other: { - header: ( - - Other - - ), + header: , feature: Feature.OTHER, options: , }, @@ -69,7 +54,7 @@ export default function TextToImagePanel() { - + {showAdvancedOptions ? ( ) : null} diff --git a/frontend/src/features/tabs/TextToImage/index.tsx b/frontend/src/features/tabs/TextToImage/index.tsx new file mode 100644 index 0000000000..7aaceca833 --- /dev/null +++ b/frontend/src/features/tabs/TextToImage/index.tsx @@ -0,0 +1,11 @@ +import TextToImagePanel from './TextToImagePanel'; +import InvokeWorkarea from '../InvokeWorkarea'; +import TextToImageDisplay from './TextToImageDisplay'; + +export default function TextToImageWorkarea() { + return ( + }> + + + ); +} diff --git a/frontend/src/styles/Mixins/Buttons.scss b/frontend/src/styles/Mixins/Buttons.scss index d10172a215..511937d0af 100644 --- a/frontend/src/styles/Mixins/Buttons.scss +++ b/frontend/src/styles/Mixins/Buttons.scss @@ -7,16 +7,16 @@ ) { min-width: $btn-width; min-height: $btn-height; - background-color: $btn-color; + background-color: $btn-color !important; &:hover { - background-color: $btn-color-hover; + background-color: $btn-color-hover !important; } &:disabled { - background-color: rgb(45, 45, 55); + background-color: rgb(45, 45, 55) !important; &:hover { - background-color: rgb(45, 45, 55); + background-color: rgb(45, 45, 55) !important; } } diff --git a/frontend/src/styles/Mixins/_Variables.scss b/frontend/src/styles/Mixins/_Variables.scss index a7cc8289ba..865966386c 100644 --- a/frontend/src/styles/Mixins/_Variables.scss +++ b/frontend/src/styles/Mixins/_Variables.scss @@ -1,15 +1,20 @@ // Calc Values -$app-cutoff: 1.6rem; -$app-content-height-cutoff: 7rem; // default: 7rem +$app-cutoff: 0px; +$app-content-height-cutoff: 4rem; // default: 7rem // Usage Variables // app +$app-padding: 0.5rem; +$progress-bar-thickness: 0.3rem; $app-width: calc(100vw - $app-cutoff); -$app-height: calc(100vh - $app-cutoff); +$app-height: calc(100vh - $progress-bar-thickness); $app-content-height: calc(100vh - $app-content-height-cutoff); -$app-gallery-height: calc(100vh - ($app-content-height-cutoff + 6rem)); +$app-gallery-height: calc(100vh - ($app-content-height-cutoff + 5.5rem)); $app-gallery-popover-height: calc(100vh - ($app-content-height-cutoff + 6rem)); $app-metadata-height: calc(100vh - ($app-content-height-cutoff + 4.4rem)); +$app-text-to-image-height: calc( + 100vh - 9.4375rem - 1.925rem - 1.15rem +); // do not touch ffs // option bar $options-bar-max-width: 22.5rem; diff --git a/frontend/src/styles/_Colors_Dark.scss b/frontend/src/styles/_Colors_Dark.scss index fea6b65862..bfbe022343 100644 --- a/frontend/src/styles/_Colors_Dark.scss +++ b/frontend/src/styles/_Colors_Dark.scss @@ -19,6 +19,12 @@ --invalid: rgb(255, 75, 75); --invalid-secondary: rgb(120, 5, 5); + --accent-color: rgb(80, 40, 200); + --accent-color-hover: rgb(104, 60, 230); + + --destructive-color: rgb(185, 55, 55); + --destructive-color-hover: rgb(255, 75, 75); + // Error status colors --border-color-invalid: rgb(255, 80, 50); --box-shadow-color-invalid: rgb(210, 30, 10); @@ -30,8 +36,6 @@ // Prompt Box Colors --prompt-bg-color: rgb(10, 10, 10); - --prompt-border-color: rgb(140, 110, 255); - --prompt-box-shadow-color: rgb(80, 30, 210); // Button Colors --btn-svg-color: rgb(255, 255, 255); @@ -39,12 +43,6 @@ --btn-grey: rgb(30, 32, 42); --btn-grey-hover: rgb(46, 48, 68); - --btn-purple: rgb(80, 40, 200); - --btn-purple-hover: rgb(104, 60, 230); - - --btn-red: rgb(185, 55, 55); - --btn-red-hover: rgb(255, 75, 75); - --btn-load-more: rgb(30, 32, 42); --btn-load-more-hover: rgb(54, 56, 66); @@ -52,6 +50,9 @@ --switch-bg-color: rgb(100, 102, 110); --switch-bg-active-color: rgb(80, 40, 200); + // Resizable + --resizeable-handle-border-color: rgb(80, 82, 112); + // Tabs --tab-color: rgb(30, 32, 42); --tab-hover-color: rgb(36, 38, 48); @@ -79,14 +80,14 @@ --input-checkbox-bg: rgb(90, 90, 120); --input-checkbox-checked-bg: rgb(80, 40, 200); --input-checkbox-checked-tick: rgb(0, 0, 0); + --input-border-color: rgb(140, 110, 255); + --input-box-shadow-color: rgb(80, 30, 210); // Console --error-level-info: rgb(200, 202, 224); --error-level-warning: rgb(255, 225, 105); --error-level-error: rgb(255, 81, 46); --console-bg-color: rgb(30, 30, 36); - --console-border-color: rgb(80, 82, 112); - --console-icon-button-bg-color: rgb(50, 53, 64); --console-icon-button-bg-color-hover: rgb(70, 73, 84); @@ -94,10 +95,12 @@ --img2img-img-bg-color: rgb(30, 32, 42); // Gallery - --gallery-resizeable-color: rgb(36, 38, 48); // Context Menus --context-menu-bg-color: rgb(46, 48, 58); --context-menu-box-shadow: none; --context-menu-bg-color-hover: rgb(30, 32, 42); + + // Inpainting + --inpaint-bg-color: rgb(30, 32, 42); } diff --git a/frontend/src/styles/_Colors_Light.scss b/frontend/src/styles/_Colors_Light.scss index 8b0f8edb5f..329f30c62e 100644 --- a/frontend/src/styles/_Colors_Light.scss +++ b/frontend/src/styles/_Colors_Light.scss @@ -19,6 +19,12 @@ --invalid: rgb(255, 75, 75); --invalid-secondary: rgb(120, 5, 5); + --accent-color: rgb(235, 185, 5); + --accent-color-hover: rgb(255, 200, 0); + + --destructive-color: rgb(237, 51, 51); + --destructive-color-hover: rgb(255, 55, 55); + // Error status colors --border-color-invalid: rgb(255, 80, 50); --box-shadow-color-invalid: none; @@ -30,8 +36,6 @@ // Prompt Box Colors --prompt-bg-color: rgb(225, 227, 229); - --prompt-border-color: rgb(0, 0, 0); - --prompt-box-shadow-color: rgb(217, 217, 217); // Button Colors --btn-svg-color: rgb(0, 0, 0); @@ -39,12 +43,6 @@ --btn-grey: rgb(220, 222, 224); --btn-grey-hover: rgb(230, 232, 234); - --btn-purple: rgb(235, 185, 5); - --btn-purple-hover: rgb(255, 200, 0); - - --btn-red: rgb(237, 51, 51); - --btn-red-hover: rgb(255, 55, 55); - --btn-load-more: rgb(202, 204, 206); --btn-load-more-hover: rgb(178, 180, 182); @@ -52,6 +50,9 @@ --switch-bg-color: rgb(178, 180, 182); --switch-bg-active-color: rgb(235, 185, 5); + // Resizable + --resizeable-handle-border-color: rgb(160, 162, 164); + // Tabs --tab-color: rgb(202, 204, 206); --tab-hover-color: rgb(206, 208, 210); @@ -79,26 +80,28 @@ --input-checkbox-bg: rgb(90, 90, 120); --input-checkbox-checked-bg: rgb(235, 185, 5); --input-checkbox-checked-tick: rgb(0, 0, 0); + --input-border-color: rgb(0, 0, 0); + --input-box-shadow-color: none; // Console --error-level-info: rgb(42, 42, 42); --error-level-warning: rgb(173, 121, 0); --error-level-error: rgb(145, 14, 0); --console-bg-color: rgb(220, 224, 230); - --console-border-color: rgb(160, 162, 164); --console-icon-button-bg-color: var(--switch-bg-color); - --console-icon-button-bg-color-hover: var(--console-border-color); + --console-icon-button-bg-color-hover: var(--resizeable-handle-border-color); // Img2Img --img2img-img-bg-color: rgb(180, 182, 184); // Gallery - --gallery-resizeable-color: rgb(192, 194, 196); // Context Menus --context-menu-bg-color: var(--background-color); - --context-menu-box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), + --context-menu-box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2); --context-menu-bg-color-hover: var(--background-color-secondary); + // Inpainting + --inpaint-bg-color: rgb(180, 182, 184); } diff --git a/frontend/src/styles/_Misc.scss b/frontend/src/styles/_Misc.scss new file mode 100644 index 0000000000..d75046d008 --- /dev/null +++ b/frontend/src/styles/_Misc.scss @@ -0,0 +1,13 @@ +.checkerboard { + background-position: 0px 0px, 10px 10px; + background-size: 20px 20px; + background-image: linear-gradient( + 45deg, + #eee 25%, + transparent 25%, + transparent 75%, + #eee 75%, + #eee 100% + ), + linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%); +} diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 631f75b2f4..81bbc35cd7 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -3,15 +3,17 @@ @use 'Colors_Light'; @use 'Fonts'; @use 'Animations'; +@use 'Misc'; // Component Styles //app @use '../app/App.scss'; -//systen +//system @use '../features/system/SiteHeader.scss'; @use '../features/system/StatusIndicator.scss'; @use '../features/system/SettingsModal/SettingsModal.scss'; +@use '../features/system/SettingsModal/ModelList.scss'; @use '../features/system/HotkeysModal/HotkeysModal.scss'; @use '../features/system/Console.scss'; @@ -21,6 +23,7 @@ @use '../features/options/MainOptions/MainOptions.scss'; @use '../features/options/AccordionItems/AdvancedSettings.scss'; @use '../features/options/AdvancedOptions/Upscale/UpscaleOptions.scss'; +@use '../features/options/AdvancedOptions/Inpainting/BoundingBoxSettings.scss'; @use '../features/system/ProgressBar.scss'; // gallery @@ -28,21 +31,34 @@ @use '../features/gallery/ImageGallery.scss'; @use '../features/gallery/HoverableImage.scss'; @use '../features/gallery/InvokePopover.scss'; +@use '../features/gallery/ShowHideGalleryButton.scss'; @use '../features/gallery/ImageMetaDataViewer/ImageMetadataViewer.scss'; // Tabs @use '../features/tabs/InvokeTabs.scss'; +@use '../features/tabs/InvokeWorkarea.scss'; @use '../features/tabs/TextToImage/TextToImage.scss'; @use '../features/tabs/ImageToImage/ImageToImage.scss'; +@use '../features/tabs/Inpainting/Inpainting.scss'; // Component Shared @use '../common/components/IAINumberInput.scss'; @use '../common/components/IAIInput.scss'; -@use '../common/components/IAISelect.scss'; +@use '../common/components/IAIIconButton.scss'; @use '../common/components/IAISwitch.scss'; +@use '../common/components/IAISelect.scss'; +@use '../common/components/IAISlider.scss'; +@use '../common/components/IAICheckbox.scss'; +@use '../common/components/IAIPopover.scss'; +@use '../common/components/IAIColorPicker.scss'; +@use '../common/components/ImageUploader.scss'; @use '../common/components/WorkInProgress/WorkInProgress.scss'; @use '../common/components/GuidePopover.scss'; +// Component Shared - Radix UI +// @use '../common/components/radix-ui/IAISlider.scss'; +// @use '../common/components/radix-ui/IAITooltip.scss'; + // Shared Styles @use './Mixins/' as *; @@ -58,6 +74,7 @@ html, body { @include HideScrollbar; background-color: var(--root-bg-color); + overflow: hidden; } #root { diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 83f5be31ee..54384c4a4b 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -213,7 +213,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.13.10": +"@babel/runtime@^7.13.10", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.4.tgz#a42f814502ee467d55b38dd1c256f53a7b885c78" integrity sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA== @@ -1292,6 +1292,13 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw== +"@radix-ui/number@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/number/-/number-1.0.0.tgz#4c536161d0de750b3f5d55860fc3de46264f897b" + integrity sha512-Ofwh/1HX69ZfJRiRBMTy7rgjAzHmwe4kW9C9Y99HTRUcYLUuVT0KESFj15rPjRgKJs20GPq8Bm5aEDJ8DuA3vA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.0.0.tgz#e1d8ef30b10ea10e69c76e896f608d9276352253" @@ -1471,6 +1478,24 @@ "@radix-ui/react-use-callback-ref" "1.0.0" "@radix-ui/react-use-controllable-state" "1.0.0" +"@radix-ui/react-slider@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slider/-/react-slider-1.1.0.tgz#b3fdaca27619150e9e6067ad9f979a4535f68d5e" + integrity sha512-5H/QB4xD3GF9UfoSCVLBx2JjlXamMcmTyL6gr4kkd/MiAGaYB0W7Exi4MQa0tJApBFJe+KmS5InKCI56p2kmjA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/number" "1.0.0" + "@radix-ui/primitive" "1.0.0" + "@radix-ui/react-collection" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.0" + "@radix-ui/react-context" "1.0.0" + "@radix-ui/react-direction" "1.0.0" + "@radix-ui/react-primitive" "1.0.1" + "@radix-ui/react-use-controllable-state" "1.0.0" + "@radix-ui/react-use-layout-effect" "1.0.0" + "@radix-ui/react-use-previous" "1.0.0" + "@radix-ui/react-use-size" "1.0.0" + "@radix-ui/react-slot@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.1.tgz#e7868c669c974d649070e9ecbec0b367ee0b4d81" @@ -1479,6 +1504,25 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-compose-refs" "1.0.0" +"@radix-ui/react-tooltip@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-tooltip/-/react-tooltip-1.0.2.tgz#8e10b075767f785bf013146fdc954ac6885efda3" + integrity sha512-11gUlok2rv5mu+KBtxniOKKNKjqC/uTbgFHWoQdbF46vMV+zjDaBvCtVDK9+MTddlpmlisGPGvvojX7Qm0yr+g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.0" + "@radix-ui/react-compose-refs" "1.0.0" + "@radix-ui/react-context" "1.0.0" + "@radix-ui/react-dismissable-layer" "1.0.2" + "@radix-ui/react-id" "1.0.0" + "@radix-ui/react-popper" "1.0.1" + "@radix-ui/react-portal" "1.0.1" + "@radix-ui/react-presence" "1.0.0" + "@radix-ui/react-primitive" "1.0.1" + "@radix-ui/react-slot" "1.0.1" + "@radix-ui/react-use-controllable-state" "1.0.0" + "@radix-ui/react-visually-hidden" "1.0.1" + "@radix-ui/react-use-callback-ref@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.0.tgz#9e7b8b6b4946fe3cbe8f748c82a2cce54e7b6a90" @@ -1509,6 +1553,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-previous@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-previous/-/react-use-previous-1.0.0.tgz#e48a69c3a7d8078a967084038df66d0d181c56ac" + integrity sha512-RG2K8z/K7InnOKpq6YLDmT49HGjNmrK+fr82UCVKT2sW0GYfVnYp4wZWBooT/EYfQ5faA9uIjvsuMMhH61rheg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-rect@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-1.0.0.tgz#b040cc88a4906b78696cd3a32b075ed5b1423b3e" @@ -1525,6 +1576,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-layout-effect" "1.0.0" +"@radix-ui/react-visually-hidden@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.1.tgz#9a4ac4fc97ae8d72a10e727f16b3121b5f0aa469" + integrity sha512-K1hJcCMfWfiYUibRqf3V8r5Drpyf7rh44jnrwAbdvI5iCCijilBBeyQv9SKidYNZIopMdCyR9FnIjkHxHN0FcQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.1" + "@radix-ui/rect@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.0.0.tgz#0dc8e6a829ea2828d53cbc94b81793ba6383bf3c" @@ -1630,6 +1689,20 @@ dependencies: "@types/react" "*" +"@types/react-reconciler@^0.28.0": + version "0.28.0" + resolved "https://registry.yarnpkg.com/@types/react-reconciler/-/react-reconciler-0.28.0.tgz#513acbed173140e958c909041ca14eb40412077f" + integrity sha512-5cjk9ottZAj7eaTsqzPUIlrVbh3hBAO2YaEL1rkjHKB3xNAId7oU8GhzvAX+gfmlfoxTwJnBjPxEHyxkEA1Ffg== + dependencies: + "@types/react" "*" + +"@types/react-transition-group@^4.4.5": + version "4.4.5" + resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.5.tgz#aae20dcf773c5aa275d5b9f7cdbca638abc5e416" + integrity sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA== + dependencies: + "@types/react" "*" + "@types/react@*", "@types/react@^18.0.17": version "18.0.20" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.20.tgz#e4c36be3a55eb5b456ecf501bd4a00fd4fd0c9ab" @@ -1776,6 +1849,11 @@ acorn@^8.8.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== +add@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/add/-/add-2.0.6.tgz#248f0a9f6e5a528ef2295dbeec30532130ae2235" + integrity sha512-j5QzrmsokwWWp6kUcJQySpbG+xfOBqqKnup3OIk1pz+kB/80SLorZ9V8zHFLO92Lcd+hbvq8bT+zOGoPkmBV0Q== + ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -2055,6 +2133,14 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-helpers@^5.0.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902" + integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA== + dependencies: + "@babel/runtime" "^7.8.7" + csstype "^3.0.2" + duplexer@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" @@ -2725,6 +2811,13 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +its-fine@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/its-fine/-/its-fine-1.0.6.tgz#087b14d71137816dab676d8b57c35a6cd5d2b021" + integrity sha512-VZJZPwVT2kxe5KQv+TxCjojfLiUIut8zXDNLTxcM7gJ/xQ/bSPk5M0neZ+j3myy45KKkltY1mm1jyJgx3Fxsdg== + dependencies: + "@types/react-reconciler" "^0.28.0" + js-sdsl@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.4.tgz#78793c90f80e8430b7d8dc94515b6c77d98a26a6" @@ -2767,6 +2860,11 @@ json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +konva@^8.3.13: + version "8.3.13" + resolved "https://registry.yarnpkg.com/konva/-/konva-8.3.13.tgz#c1adc986ddf5dde4790c0ed47eef8d40a313232e" + integrity sha512-O5VxHfRfTj4PscTglQH1NimS8+CC5hQYLeB8YQstu8MN/i2L8GjA1T9d7xxzITF2TD5+xcIs5ei7en3cztbNXg== + levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -3061,6 +3159,11 @@ react-clientside-effect@^1.2.6: dependencies: "@babel/runtime" "^7.12.13" +react-colorful@^5.6.1: + version "5.6.1" + resolved "https://registry.yarnpkg.com/react-colorful/-/react-colorful-5.6.1.tgz#7dc2aed2d7c72fac89694e834d179e32f3da563b" + integrity sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw== + react-dom@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" @@ -3117,6 +3220,23 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +react-konva@^18.2.3: + version "18.2.3" + resolved "https://registry.yarnpkg.com/react-konva/-/react-konva-18.2.3.tgz#75c658fca493bdf515b38f2a8d544fa7a9c754c4" + integrity sha512-OPxjBTgaEGU9pt/VJSVM7QNXYHEZ5CkulX+4fTTvbaH+Wh+vMLbXmH3yjWw4kT/5Qi6t0UQKHPPmirCv8/9sdg== + dependencies: + its-fine "^1.0.6" + react-reconciler "~0.29.0" + scheduler "^0.23.0" + +react-reconciler@~0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.29.0.tgz#ee769bd362915076753f3845822f2d1046603de7" + integrity sha512-wa0fGj7Zht1EYMRhKWwoo1H9GApxYLBuhoAuXN0TlltESAjDssB+Apf0T/DngVqaMyPypDmabL37vw/2aRM98Q== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.0" + react-redux@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-8.0.2.tgz#bc2a304bb21e79c6808e3e47c50fe1caf62f7aad" @@ -3162,6 +3282,16 @@ react-style-singleton@^2.2.1: invariant "^2.2.4" tslib "^2.0.0" +react-transition-group@^4.4.5: + version "4.4.5" + resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1" + integrity sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g== + dependencies: + "@babel/runtime" "^7.5.5" + dom-helpers "^5.0.1" + loose-envify "^1.4.0" + prop-types "^15.6.2" + react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" @@ -3603,6 +3733,11 @@ yaml@^1.10.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yarn@^1.22.19: + version "1.22.19" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" + integrity sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" diff --git a/ldm/invoke/generator/inpaint.py b/ldm/invoke/generator/inpaint.py index a6ab0cd06a..2ba45ed804 100644 --- a/ldm/invoke/generator/inpaint.py +++ b/ldm/invoke/generator/inpaint.py @@ -43,6 +43,10 @@ class Inpaint(Img2Img): ) def tile_fill_missing(self, im: Image.Image, tile_size: int = 16, seed: int = None) -> Image: + # Only fill if there's an alpha layer + if im.mode != 'RGBA': + return im + a = np.asarray(im, dtype=np.uint8) tile_size = (tile_size, tile_size)